Пример #1
0
 /** 人防信息通过id查询 */
 @Override
 public AqffRfxxb queryRfxxById(AqffRfxxb entity) {
   AqffRfxxb AqffRfxxb = rfxxbDao.queryRfxxById(entity);
   Map<String, Object> map = new HashMap<String, Object>();
   map.put("rfid", entity.getId());
   List<Aqffrfryxxb> list = rfxxbDao.queryRfcyxxByrfid(map);
   AqffRfxxb.setRyAllList(list);
   return AqffRfxxb;
 }
Пример #2
0
 /** 人防信息添加 */
 @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);
       }
     }
   }
 }