/** 人防信息添加 */ @SuppressWarnings({"unchecked", "static-access"}) @Override public void insertRfxx(AqffRfxxb entity, SessionBean sessionBean) { setSaveProperties(entity, sessionBean); entity.setRfid(entity.getId()); rfxxbDao.insertRfxx(entity); List<Aqffrfryxxb> list = new ArrayList<Aqffrfryxxb>(); JSONArray jcxmxJsonArray = JSONArray.fromObject(entity.getRyAll()); List<Aqffrfryxxb> listForIU = new ArrayList<Aqffrfryxxb>(); listForIU = (List<Aqffrfryxxb>) jcxmxJsonArray.toCollection(jcxmxJsonArray, Aqffrfryxxb.class); for (int i = 0; i < listForIU.size(); i++) { Aqffrfryxxb rfry = listForIU.get(i); rfry.setRfid(entity.getId()); if (null != rfry.getId() && rfry.getId() != "" && !"".equals(rfry.getId())) { setUpdateProperties(rfry, sessionBean); rfxxbDao.updateRfcyxx(rfry); } else { rfry.setId(UUID.create()); setSaveProperties(rfry, sessionBean); rfxxbDao.saveRfcyxx(rfry); } } if (null != entity.getRydelete() || entity.getRydelete().equals("")) { JSONArray deleteJsonArray = JSONArray.fromObject(entity.getRydelete()); list = null; list = (List<Aqffrfryxxb>) deleteJsonArray.toCollection(deleteJsonArray, Aqffrfryxxb.class); for (int i = 0; i < list.size(); i++) { Aqffrfryxxb rfry = list.get(i); if (!"null".equals(rfry) && null != rfry) { rfry.setRfid(entity.getId()); setUpdateProperties(rfry, sessionBean); rfxxbDao.deleteRfcyxx(rfry); } } } }
/** 人防成员信息添加 */ @Override public void saveRfcyxx(Aqffrfryxxb entity, SessionBean sessionBean) { entity.setId(UUID.create()); setSaveProperties(entity, sessionBean); rfxxbDao.saveRfcyxx(entity); }