|
@@ -38,6 +38,7 @@ import com.jtgh.yjpt.common.BusinessContext;
|
|
|
import com.jtgh.yjpt.common.Constants;
|
|
|
import com.jtgh.yjpt.common.GlobalData;
|
|
|
import com.jtgh.yjpt.common.PredicateModel;
|
|
|
+import com.jtgh.yjpt.common.PredicateModel.JoinType;
|
|
|
import com.jtgh.yjpt.common.PredicateModel.Operator;
|
|
|
import com.jtgh.yjpt.common.ReportExportHelper;
|
|
|
import com.jtgh.yjpt.common.SinglePageRequest;
|
|
@@ -47,6 +48,7 @@ import com.jtgh.yjpt.controller.BaseController;
|
|
|
import com.jtgh.yjpt.controller.sgalgl.PoiUtils;
|
|
|
import com.jtgh.yjpt.dao.yjgl.zdwxyfb.CgDao;
|
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
|
+import com.jtgh.yjpt.entity.check.ZcyhEntity;
|
|
|
import com.jtgh.yjpt.entity.common.AccessoryEntity;
|
|
|
import com.jtgh.yjpt.entity.gkgq.GqEntity;
|
|
|
import com.jtgh.yjpt.entity.jyr.JyrEntity;
|
|
@@ -56,6 +58,8 @@ import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
|
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgsyEntity;
|
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgztEntity;
|
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.ZbhjjbqkEntity;
|
|
|
+import com.jtgh.yjpt.entity.zysqbp.ZysqbpEntity;
|
|
|
+import com.jtgh.yjpt.service.check.ZcyhService;
|
|
|
import com.jtgh.yjpt.service.common.AccessoryService;
|
|
|
import com.jtgh.yjpt.service.gkgq.GqService;
|
|
|
import com.jtgh.yjpt.service.jyr.JyrService;
|
|
@@ -64,6 +68,7 @@ import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
|
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgsyService;
|
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
|
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.ZbhjjbqkService;
|
|
|
+import com.jtgh.yjpt.service.zysqbp.ZysqbpService;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping(value = "")
|
|
@@ -91,6 +96,10 @@ public class CgController extends BaseController {
|
|
|
private JyrService jyrService;
|
|
|
@Autowired
|
|
|
private GksssbService aqsssbService;
|
|
|
+ @Autowired
|
|
|
+ private ZcyhService zcyhService;
|
|
|
+ @Autowired
|
|
|
+ private ZysqbpService zysqbpService;
|
|
|
|
|
|
|
|
|
@Log(Type.QUERY)
|
|
@@ -271,6 +280,10 @@ public class CgController extends BaseController {
|
|
|
CgsyEntity cgsyEntity = entity.getCgsy();
|
|
|
cgsyEntity.setCg(cgEntity);
|
|
|
saveSy(functionId, cgsyEntity);
|
|
|
+ CgztEntity cgzt = cgztService.findByCg(cgEntity);
|
|
|
+ if(cgzt!=null){
|
|
|
+ cgztService.saveCgzt(cgzt);
|
|
|
+ }
|
|
|
}
|
|
|
List<ZbhjjbqkEntity> tbAddList = new ArrayList<ZbhjjbqkEntity>();
|
|
|
for (ZbhjjbqkEntity zbhjjbqk : addList) {
|
|
@@ -317,6 +330,10 @@ public class CgController extends BaseController {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
+ bc.setAttribute(
|
|
|
+ "qrcode",
|
|
|
+ Utils.getQrcodeImage(100, 100, Constants.ALL_QRCODE
|
|
|
+ + Constants.QRCODE_CG + cgEntity.getId()));
|
|
|
bc.setAttribute("cg", cgEntity);
|
|
|
bc.setAttribute("jmq", jmqList);
|
|
|
bc.setAttribute("jgtt", jgttList);
|
|
@@ -584,6 +601,13 @@ public class CgController extends BaseController {
|
|
|
Specification<CgztEntity> spec = SpecificationCreater
|
|
|
.searchByPredicateModels(filterList);
|
|
|
Page<CgztEntity> page = cgztService.findAll(spec, pageRequest);
|
|
|
+ for(CgztEntity cgzt:page){
|
|
|
+ CgEntity cg=cgzt.getCg();
|
|
|
+ if(cg!=null){
|
|
|
+ cg.setCgsy(cgsyService.findByCg(cg));
|
|
|
+ cgzt.setCg(cg);
|
|
|
+ }
|
|
|
+ }
|
|
|
return createBusinessContext(page);
|
|
|
}
|
|
|
|
|
@@ -636,6 +660,49 @@ public class CgController extends BaseController {
|
|
|
return createBusinessContext(entity);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 获取隐患分页列表
|
|
|
+ * @param pageRequest
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public BusinessContext listYh(SinglePageRequest pageRequest,CgEntity entity) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ // 所属储罐
|
|
|
+ addNotEmptyModel(filterList, "cg", entity.getId(), Operator.EQ);
|
|
|
+ // 隐患区域-罐区
|
|
|
+ addNotEmptyModel(filterList, "yhqy", "2", Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ Specification<ZcyhEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ Page<ZcyhEntity> page = zcyhService.findAll(spec, pageRequest);
|
|
|
+ return createBusinessContext(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取作业分页列表
|
|
|
+ * @param pageRequest
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public BusinessContext listWhsb(SinglePageRequest pageRequest,CgEntity entity) {
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ List<PredicateModel> orList = new ArrayList<PredicateModel>();
|
|
|
+ // 所属储罐
|
|
|
+ addNotEmptyModel(filterList, "zyddqybh.qynbbh", entity.getId(), Operator.EQ);
|
|
|
+ // 作业地点-储罐
|
|
|
+ addNotEmptyModel(filterList, "zydd.id", Constants.GGDM_ID_ZYDD_CG, Operator.EQ);
|
|
|
+ //只显示已完成和变更已完成
|
|
|
+ orList.add(new PredicateModel("recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_COMPLETED, Operator.EQ));
|
|
|
+ orList.add(new PredicateModel("recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ));
|
|
|
+ filterList.add(new PredicateModel(JoinType.OR, orList));
|
|
|
+ Specification<ZysqbpEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ Page<ZysqbpEntity> page = zysqbpService.findAll(spec, pageRequest);
|
|
|
+ return createBusinessContext(page);
|
|
|
+ }
|
|
|
|
|
|
}
|