|
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import com.jtgh.yjpt.common.Constants;
|
|
|
+import com.jtgh.yjpt.common.GlobalData;
|
|
|
import com.jtgh.yjpt.common.Logable;
|
|
|
import com.jtgh.yjpt.common.PredicateModel;
|
|
|
import com.jtgh.yjpt.common.PredicateModel.Operator;
|
|
@@ -23,12 +24,14 @@ import com.jtgh.yjpt.common.SpecificationCreater;
|
|
|
import com.jtgh.yjpt.common.Utils;
|
|
|
import com.jtgh.yjpt.controller.BaseController;
|
|
|
import com.jtgh.yjpt.controller.bagl.aqpjbgjzgfalsba.AqpjbgjzgfalsbaController;
|
|
|
+import com.jtgh.yjpt.controller.bagl.aqpjjgba.AqpjjgbaController;
|
|
|
import com.jtgh.yjpt.controller.bagl.jdhxpandzdwxyba.JdhxpZdwxyBadjController;
|
|
|
import com.jtgh.yjpt.controller.bagl.yjyaba.YjyabaController;
|
|
|
import com.jtgh.yjpt.controller.bagl.zdsgdyhpchzlqkba.ZdsgdyhpchzlqkbaController;
|
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
|
import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
|
import com.jtgh.yjpt.entity.bagl.aqpjbgjzgfalsba.AqpjbgjzgfalsbaEntity;
|
|
|
+import com.jtgh.yjpt.entity.bagl.aqpjjgba.AqpjjgbaEntity;
|
|
|
import com.jtgh.yjpt.entity.bagl.jdhxpandzdwxyba.GqnwxydjbabEntity;
|
|
|
import com.jtgh.yjpt.entity.bagl.jdhxpandzdwxyba.GqnwxyzlbEntity;
|
|
|
import com.jtgh.yjpt.entity.bagl.jdhxpandzdwxyba.ZlbzjdhxpxxEntity;
|
|
@@ -39,6 +42,8 @@ import com.jtgh.yjpt.entity.check.ZcyhEntity;
|
|
|
import com.jtgh.yjpt.entity.jyr.JyrEntity;
|
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
|
|
|
import com.jtgh.yjpt.service.bagl.aqpjbgjzgfalsba.AqpjbgjzgfalsbaService;
|
|
|
+import com.jtgh.yjpt.service.bagl.aqpjjgba.AqpjjgbaProService;
|
|
|
+import com.jtgh.yjpt.service.bagl.aqpjjgba.AqpjjgbaService;
|
|
|
import com.jtgh.yjpt.service.bagl.jdhxpandzdwxyba.GqnwxydjbabFlowService;
|
|
|
import com.jtgh.yjpt.service.bagl.jdhxpandzdwxyba.GqnwxydjbabService;
|
|
|
import com.jtgh.yjpt.service.bagl.jdhxpandzdwxyba.GqnwxyzlbService;
|
|
@@ -95,6 +100,12 @@ public class BaglWebService extends BaseController {
|
|
|
private CgService cgService;
|
|
|
@Autowired
|
|
|
private JyrService jyrService;
|
|
|
+ @Autowired
|
|
|
+ private AqpjjgbaService aqpjjgbaService;
|
|
|
+ @Autowired
|
|
|
+ private AqpjjgbaController aqpjjgbaController;
|
|
|
+ @Autowired
|
|
|
+ private AqpjjgbaProService aqpjjgbaProService;
|
|
|
|
|
|
/**
|
|
|
* 获取重大危险源分页列表
|
|
@@ -199,7 +210,7 @@ public class BaglWebService extends BaseController {
|
|
|
zlb.setAddUser(Utils.getWebServiceUser());
|
|
|
zlb.setRecordCode("90");
|
|
|
} else {
|
|
|
- GqnwxyzlbEntity vo = zlbService.findById(entity.getId());
|
|
|
+ GqnwxyzlbEntity vo = zlbService.findById(zlb.getId());
|
|
|
zlb.setAddDate(vo.getAddDate());
|
|
|
zlb.setAddUser(vo.getAddUser());
|
|
|
zlb.setRecordCode(vo.getRecordCode());
|
|
@@ -228,15 +239,15 @@ public class BaglWebService extends BaseController {
|
|
|
jdhxp.setAddUser(Utils.getWebServiceUser());
|
|
|
jdhxp.setRecordCode("90");
|
|
|
} else {
|
|
|
- ZlbzjdhxpxxEntity vo = jdhxpService.findById(entity.getId());
|
|
|
+ ZlbzjdhxpxxEntity vo = jdhxpService.findById(jdhxp.getId());
|
|
|
jdhxp.setAddDate(vo.getAddDate());
|
|
|
jdhxp.setAddUser(vo.getAddUser());
|
|
|
jdhxp.setRecordCode(vo.getRecordCode());
|
|
|
- jdhxp.setRecordStatus(vo.getRecordStatus());
|
|
|
- jdhxp.setSftb(vo.getSftb());
|
|
|
- jdhxp.setTbzt(vo.getTbzt());
|
|
|
- jdhxp.setQylb(vo.getQylb());
|
|
|
- jdhxp.setTbdyid(vo.getTbdyid());
|
|
|
+ jdhxp.setRecordStatus(BaseEntity.RECORD_STATE_VALID);
|
|
|
+ // jdhxp.setSftb(vo.getSftb());
|
|
|
+ // jdhxp.setTbzt(vo.getTbzt());
|
|
|
+ // jdhxp.setQylb(vo.getQylb());
|
|
|
+ // jdhxp.setTbdyid(vo.getTbdyid());
|
|
|
jdhxp.setUpdateDate(new Date());
|
|
|
jdhxp.setUpdateUser(Utils.getWebServiceUser());
|
|
|
}
|
|
@@ -256,15 +267,15 @@ public class BaglWebService extends BaseController {
|
|
|
wxy.setAddUser(Utils.getWebServiceUser());
|
|
|
wxy.setRecordCode("90");
|
|
|
} else {
|
|
|
- ZlbzzdwxyxxEntity vo = zdwxyService.findById(entity.getId());
|
|
|
+ ZlbzzdwxyxxEntity vo = zdwxyService.findById(wxy.getId());
|
|
|
wxy.setAddDate(vo.getAddDate());
|
|
|
wxy.setAddUser(vo.getAddUser());
|
|
|
wxy.setRecordCode(vo.getRecordCode());
|
|
|
- wxy.setRecordStatus(vo.getRecordStatus());
|
|
|
- wxy.setSftb(vo.getSftb());
|
|
|
- wxy.setTbzt(vo.getTbzt());
|
|
|
- wxy.setQylb(vo.getQylb());
|
|
|
- wxy.setTbdyid(vo.getTbdyid());
|
|
|
+ wxy.setRecordStatus(BaseEntity.RECORD_STATE_VALID);
|
|
|
+ // wxy.setSftb(vo.getSftb());
|
|
|
+ // wxy.setTbzt(vo.getTbzt());
|
|
|
+ // wxy.setQylb(vo.getQylb());
|
|
|
+ // wxy.setTbdyid(vo.getTbdyid());
|
|
|
wxy.setUpdateDate(new Date());
|
|
|
wxy.setUpdateUser(Utils.getWebServiceUser());
|
|
|
}
|
|
@@ -327,7 +338,7 @@ public class BaglWebService extends BaseController {
|
|
|
zlb.setAddUser(Utils.getWebServiceUser());
|
|
|
zlb.setRecordCode("90");
|
|
|
} else {
|
|
|
- GqnwxyzlbEntity vo = zlbService.findById(entity.getId());
|
|
|
+ GqnwxyzlbEntity vo = zlbService.findById(zlb.getId());
|
|
|
zlb.setAddDate(vo.getAddDate());
|
|
|
zlb.setAddUser(vo.getAddUser());
|
|
|
zlb.setRecordCode(vo.getRecordCode());
|
|
@@ -356,7 +367,7 @@ public class BaglWebService extends BaseController {
|
|
|
jdhxp.setAddUser(Utils.getWebServiceUser());
|
|
|
jdhxp.setRecordCode("90");
|
|
|
} else {
|
|
|
- ZlbzjdhxpxxEntity vo = jdhxpService.findById(entity.getId());
|
|
|
+ ZlbzjdhxpxxEntity vo = jdhxpService.findById(jdhxp.getId());
|
|
|
jdhxp.setAddDate(vo.getAddDate());
|
|
|
jdhxp.setAddUser(vo.getAddUser());
|
|
|
jdhxp.setRecordCode(vo.getRecordCode());
|
|
@@ -384,7 +395,7 @@ public class BaglWebService extends BaseController {
|
|
|
wxy.setAddUser(Utils.getWebServiceUser());
|
|
|
wxy.setRecordCode("90");
|
|
|
} else {
|
|
|
- ZlbzzdwxyxxEntity vo = zdwxyService.findById(entity.getId());
|
|
|
+ ZlbzzdwxyxxEntity vo = zdwxyService.findById(wxy.getId());
|
|
|
wxy.setAddDate(vo.getAddDate());
|
|
|
wxy.setAddUser(vo.getAddUser());
|
|
|
wxy.setRecordCode(vo.getRecordCode());
|
|
@@ -982,7 +993,7 @@ public class BaglWebService extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 保存安全评价报告况备案记录(包含修改和新增)
|
|
|
+ * 保存应急预案备案记录(包含修改和新增)
|
|
|
*
|
|
|
* @param entity
|
|
|
* @return
|
|
@@ -1012,7 +1023,7 @@ public class BaglWebService extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 提交安全评价报告备案记录(包含修改和新增)
|
|
|
+ * 提交应急预案备案记录(包含修改和新增)
|
|
|
*
|
|
|
* @param entity
|
|
|
* @return
|
|
@@ -1043,7 +1054,7 @@ public class BaglWebService extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 审核安全评价报告备案
|
|
|
+ * 审核应急预案备案
|
|
|
*
|
|
|
* @param shyj
|
|
|
* @param shsj
|
|
@@ -1064,7 +1075,7 @@ public class BaglWebService extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 删除安全评价报告备案
|
|
|
+ * 删除应急预案报告备案
|
|
|
*
|
|
|
* @param id
|
|
|
* @return
|
|
@@ -1082,7 +1093,7 @@ public class BaglWebService extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取安全评价报告备案详细信息
|
|
|
+ * 获取应急预案备案详细信息
|
|
|
*
|
|
|
* @param id
|
|
|
* @return
|
|
@@ -1092,7 +1103,7 @@ public class BaglWebService extends BaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 判断当前用户是否有重大事故备案审批权限 之判断
|
|
|
+ * 判断当前用户是否有应急预案备案审批权限 之判断
|
|
|
*
|
|
|
* @param id
|
|
|
* @return 0 表示未签收,待办理,1表示已签收待办理 ,""表示 无流程
|
|
@@ -1157,4 +1168,182 @@ public class BaglWebService extends BaseController {
|
|
|
return list.getContent();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取安全评价机构备案分页列表
|
|
|
+ *
|
|
|
+ * @param jgmc
|
|
|
+ * @param zzzsbh
|
|
|
+ * @param jglx
|
|
|
+ * @param dh
|
|
|
+ * @param yxqz
|
|
|
+ * @param n
|
|
|
+ * @param pageCount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<AqpjjgbaEntity> getAqpjjgbaPageListByParams(String jgmc,
|
|
|
+ String zzzsbh, String jglx, String dh, Date yxqz, int n,
|
|
|
+ int pageCount) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ yxqz = Utils.getDateLastTime(yxqz);
|
|
|
+ addNotEmptyModel(filterList, "jgmc", jgmc, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "dh", dh, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "zzzsbm", zzzsbh, Operator.LIKE);
|
|
|
+ addNotEmptyModel(filterList, "jglx", jglx, Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "zzyxq", yxqz, Operator.LTE);
|
|
|
+ addNotEmptyModel(filterList, "sfqxzg", Constants.YES, Operator.NEQ);
|
|
|
+ // 行政人员根据权限过滤(安全评价机构备案列表菜单ID=35)
|
|
|
+ addRecordCodeFilter(35l, filterList);
|
|
|
+ SinglePageRequest pageable = new SinglePageRequest(pageCount, n,
|
|
|
+ "desc", "id");
|
|
|
+ Specification<AqpjjgbaEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ Page<AqpjjgbaEntity> page = aqpjjgbaService.findAll(spec, pageable);
|
|
|
+ if (page == null || page.getTotalPages() <= pageCount) {
|
|
|
+ return new ArrayList<AqpjjgbaEntity>();
|
|
|
+ }
|
|
|
+ return page.getContent();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存安全评价机构备案记录(包含修改和新增)
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AqpjjgbaEntity saveAqpjjgba(AqpjjgbaEntity entity) {
|
|
|
+ // 判断该记录是否为新增
|
|
|
+ if (entity.getId() == null || entity.getId().equals(0l)) {
|
|
|
+ entity.setAddDate(new Date());
|
|
|
+ entity.setAddUser(Utils.getWebServiceUser());
|
|
|
+ entity.setRecordCode("90");
|
|
|
+ } else {
|
|
|
+ AqpjjgbaEntity vo = aqpjjgbaService.findOne(entity.getId());
|
|
|
+ entity.setAddDate(vo.getAddDate());
|
|
|
+ entity.setAddUser(vo.getAddUser());
|
|
|
+ entity.setRecordCode(vo.getRecordCode());
|
|
|
+ entity.setRecordStatus(vo.getRecordStatus());
|
|
|
+ entity.setSftb(vo.getSftb());
|
|
|
+ entity.setTbzt(vo.getTbzt());
|
|
|
+ entity.setQylb(vo.getQylb());
|
|
|
+ entity.setTbdyid(vo.getTbdyid());
|
|
|
+ entity.setUpdateDate(new Date());
|
|
|
+ entity.setUpdateUser(Utils.getWebServiceUser());
|
|
|
+ }
|
|
|
+ // 执行save方法
|
|
|
+ entity = aqpjjgbaService.save(entity);
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 提交安全评价机构备案记录(包含修改和新增)
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AqpjjgbaEntity submitAqpjjgba(AqpjjgbaEntity entity) {
|
|
|
+ // 判断该记录是否为新增
|
|
|
+ if (entity.getId() == null || entity.getId().equals(0l)) {
|
|
|
+ entity.setAddDate(new Date());
|
|
|
+ entity.setAddUser(Utils.getWebServiceUser());
|
|
|
+ entity.setRecordCode("90");
|
|
|
+ } else {
|
|
|
+ AqpjjgbaEntity vo = aqpjjgbaService.findOne(entity.getId());
|
|
|
+ entity.setAddDate(vo.getAddDate());
|
|
|
+ entity.setAddUser(vo.getAddUser());
|
|
|
+ entity.setRecordCode(vo.getRecordCode());
|
|
|
+ entity.setRecordStatus(vo.getRecordStatus());
|
|
|
+ entity.setSftb(vo.getSftb());
|
|
|
+ entity.setTbzt(vo.getTbzt());
|
|
|
+ entity.setQylb(vo.getQylb());
|
|
|
+ entity.setTbdyid(vo.getTbdyid());
|
|
|
+ entity.setUpdateDate(new Date());
|
|
|
+ entity.setUpdateUser(Utils.getWebServiceUser());
|
|
|
+ }
|
|
|
+ // 执行sumit方法
|
|
|
+ entity = aqpjjgbaService.submit(entity.getRecordCode(), entity);
|
|
|
+
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核安全评价机构备案
|
|
|
+ *
|
|
|
+ * @param shyj
|
|
|
+ * @param shsj
|
|
|
+ * @param data
|
|
|
+ * @param flag
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AqpjjgbaEntity auditAqpjjgba(String shyj, Date shsj,
|
|
|
+ AqpjjgbaEntity data, boolean flag) {
|
|
|
+ data = aqpjjgbaService.findOne(data.getId());
|
|
|
+ aqpjjgbaController.audit(shyj, shsj, data, flag);
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除安全评价机构备案
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public WsResult deleteAqpjjgba(AqpjjgbaEntity entity) {
|
|
|
+ WsResult ws = new WsResult();
|
|
|
+ try {
|
|
|
+ aqpjjgbaService.logicDelete(entity.getId());
|
|
|
+ ws.setResultCode(WsResult.SUCCESS);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ ws.setResultCode(WsResult.FAILURE);
|
|
|
+ }
|
|
|
+ return ws;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取安全评价报告备案详细信息
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public AqpjjgbaEntity findAqpjjgbaById(Long id) {
|
|
|
+ return aqpjjgbaService.findOne(id);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断当前用户是否有安全评价机构备案审批权限 之判断
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return 0 表示未签收,待办理,1表示已签收待办理 ,""表示 无流程
|
|
|
+ */
|
|
|
+ public String getAqpjjgbaTaskStateByid(Long id) {
|
|
|
+ AqpjjgbaEntity ba = aqpjjgbaService.findOne(id);
|
|
|
+ if (ba.getRecordStatus() == BaseEntity.RECORD_STATE_SUBMIT) {// 申请对应的流程
|
|
|
+ if (GlobalData.DEPLOY_MODE.equals(Constants.DEPLOY_MODE_CITY)) {
|
|
|
+ if (aqpjjgbaService.getTaskByUserAndBusKey(Utils
|
|
|
+ .getWebServiceUser().getId().toString(), ba.getId()
|
|
|
+ .toString()) != null) {
|
|
|
+ return Constants.TASK_ASSIGN;
|
|
|
+ } else if (aqpjjgbaService.getCandidateTaskByUserAndBusKey(
|
|
|
+ Utils.getWebServiceUser().getId().toString(), ba
|
|
|
+ .getId().toString()) != null) {
|
|
|
+ return Constants.TASK_CANDIDATE;
|
|
|
+ }
|
|
|
+ } else if (GlobalData.DEPLOY_MODE
|
|
|
+ .equals(Constants.DEPLOY_MODE_PROVINCE)) {
|
|
|
+ if (aqpjjgbaProService.getTaskByUserAndBusKey(Utils
|
|
|
+ .getWebServiceUser().getId().toString(), ba.getId()
|
|
|
+ .toString()) != null) {
|
|
|
+ return Constants.TASK_ASSIGN;
|
|
|
+ } else if (aqpjjgbaProService.getCandidateTaskByUserAndBusKey(
|
|
|
+ Utils.getWebServiceUser().getId().toString(), ba
|
|
|
+ .getId().toString()) != null) {
|
|
|
+ return Constants.TASK_CANDIDATE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
}
|