Browse Source

git-svn-id: https://192.168.57.71/svn/lyggkj@103 1a6f6e3a-4066-fe46-b609-79c204482ece

ld_liufl 9 years ago
parent
commit
afb9e1d3f9

+ 1 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/check/DcController.java

@@ -959,6 +959,7 @@ public class DcController extends BaseController {
 		addNotEmptyModel(filterList, "zxjcid", zxjcId.getId(), Operator.EQ);
 		addNotEmptyModel(filterList, "recordStatus",
 				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		addNotEmptyModel(filterList, "original", "original", Operator.NL);
 		Specification<DcEntity> spec = SpecificationCreater
 				.searchByPredicateModels(filterList);
 		list = (List<DcEntity>) dcService.findAll(spec);

+ 68 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/yjgl/zdwxyfb/CgController.java

@@ -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);
+	}
 
 }

+ 4 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/zyfzndjy/GkwxhwzyfzblhhzController.java

@@ -520,7 +520,10 @@ public class GkwxhwzyfzblhhzController extends BaseController {
 				.searchByPredicateModels(filterList);
 		List<GkwxhwzyfzblFzEntity> list = gkwxhwzyfzService.findAll(spec);
 		vo = gkwxhwzyfzblhhzService.saveAllFz(vo, saveList, list);
-
+		//根据附证更新场所
+		gkwxhwzyfzblhhzService.changeCs(vo);
+		
+		
 		// final GkwxhwzyfzblhhzEntity vo_f = vo;
 		final Long tempid = vo.getId();
 		final List<GkwxhwzyfzblFzEntity> list_f = getFzs(vo);

+ 5 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/dao/check/ZcyhDao.java

@@ -10,6 +10,7 @@ import com.jtgh.yjpt.entity.BaseEntity;
 import com.jtgh.yjpt.entity.bagl.zdsgdyhpchzlqkba.ZdsgdyhpchzlqkbaEntity;
 import com.jtgh.yjpt.entity.check.ZcEntity;
 import com.jtgh.yjpt.entity.check.ZcyhEntity;
+import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
 
 public interface ZcyhDao extends MyRepository<ZcyhEntity, Long> {
 
@@ -29,4 +30,8 @@ public interface ZcyhDao extends MyRepository<ZcyhEntity, Long> {
 	public List<ZcyhEntity> findBySync();
 
 	public List<ZcyhEntity> findBySssg(ZdsgdyhpchzlqkbaEntity sssg);
+	
+	@Query("from ZcyhEntity where cg = ?1 and yhqy=2 and recordStatus <> "
+			+ BaseEntity.RECORD_STATE_DELETE)
+	public List<ZcyhEntity> findByCg(CgEntity cg);
 }

+ 15 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/check/ZcyhEntity.java

@@ -18,6 +18,7 @@ import com.jtgh.yjpt.entity.BaseEntity;
 import com.jtgh.yjpt.entity.bagl.zdsgdyhpchzlqkba.ZdsgdyhpchzlqkbaEntity;
 import com.jtgh.yjpt.entity.common.AccessoryEntity;
 import com.jtgh.yjpt.entity.common.CodeEntity;
+import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
 
 @Entity
 @Table(name = "T_YJPT_ZCYH")
@@ -126,6 +127,8 @@ public class ZcyhEntity extends BaseEntity<Long> implements Cloneable {
 	 * 所属重大事故
 	 */
 	private ZdsgdyhpchzlqkbaEntity sssg;
+	
+	private CgEntity cg;
 
 	public String getYhfl() {
 		return yhfl;
@@ -306,7 +309,7 @@ public class ZcyhEntity extends BaseEntity<Long> implements Cloneable {
 		return null;
 	}
 
-	@ManyToOne(fetch = FetchType.EAGER, targetEntity = ZdsgdyhpchzlqkbaEntity.class)
+	@ManyToOne(fetch = FetchType.LAZY, targetEntity = ZdsgdyhpchzlqkbaEntity.class)
 	@JoinColumn(name = "sssg")
 	@RemotingExclude
 	public ZdsgdyhpchzlqkbaEntity getSssg() {
@@ -358,4 +361,15 @@ public class ZcyhEntity extends BaseEntity<Long> implements Cloneable {
 		this.yjffcs = yjffcs;
 	}
 
+	@ManyToOne(fetch = FetchType.EAGER, targetEntity = CgEntity.class)
+	@JoinColumn(name = "cg")
+	@RemotingExclude
+	public CgEntity getCg() {
+		return cg;
+	}
+
+	public void setCg(CgEntity cg) {
+		this.cg = cg;
+	}
+
 }

+ 51 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/yjgl/zdwxyfb/CgztEntity.java

@@ -55,6 +55,15 @@ public class CgztEntity extends BaseEntity<Long> {
 	/** 气体浓度,单位PPM。如2.39ppm */
 	private String qtnd;
 	
+	/** 理化性质 */
+	private String lhxz;
+	/** 安全防范措施 */
+	private String aqffcs;
+	/** UN编号 */
+	private String bh;
+	/** 系统编号*/
+	private String xtbh;
+	
 	
 	@Transient
 	public String getSequenceName() {
@@ -190,4 +199,46 @@ public class CgztEntity extends BaseEntity<Long> {
 		this.qtnd = qtnd;
 	}
 
+
+	public String getLhxz() {
+		return lhxz;
+	}
+
+
+	public void setLhxz(String lhxz) {
+		this.lhxz = lhxz;
+	}
+
+
+	public String getAqffcs() {
+		return aqffcs;
+	}
+
+
+	public void setAqffcs(String aqffcs) {
+		this.aqffcs = aqffcs;
+	}
+
+
+	public String getBh() {
+		return bh;
+	}
+
+
+	public void setBh(String bh) {
+		this.bh = bh;
+	}
+
+
+	public String getXtbh() {
+		return xtbh;
+	}
+
+
+	public void setXtbh(String xtbh) {
+		this.xtbh = xtbh;
+	}
+
+
+
 }

+ 2 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/check/ZcyhService.java

@@ -50,5 +50,6 @@ public interface ZcyhService {
 
 	public List<ZcyhEntity> findBySync();
 
-	List<ZcyhEntity> findBySssg(ZdsgdyhpchzlqkbaEntity sssg);
+	public List<ZcyhEntity> findBySssg(ZdsgdyhpchzlqkbaEntity sssg);
+	
 }

+ 16 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/zyfzndjy/GkwxhwzyfzblhhzServiceImpl.java

@@ -690,4 +690,20 @@ public class GkwxhwzyfzblhhzServiceImpl extends
 		
 	}
 
+	@Override
+	public void changeCs(GkwxhwzyfzblhhzEntity entity) {	
+		List<GkwxhwzyfzblFzEntity> fzList = fzbDao.findByFzsqId(entity.getId());		
+		if(entity.getZycs()!=null && Constants.GGDM_ID_ZYDD_CG.equals(entity.getZycs().getId())){
+			if(fzList!=null&&fzList.size()>0){
+				for(GkwxhwzyfzblFzEntity fz:fzList){
+					CgEntity cg = cgDao.findById(Long.parseLong(fz.getQynbbh()));
+					cg.setWhzyfzbh(fz.getFzcsbh());
+					cg.setHxpmc(fz.getByzd5());
+					cgDao.save(cg);		
+				}
+			}
+		}
+		
+	}
+
 }

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/zyfzndjy/GkwxhwzyfzblhhzService.java

@@ -116,4 +116,6 @@ public interface GkwxhwzyfzblhhzService extends BaseWorkFlowService {
 
 	public String countFz(boolean flag);
 	
+	public void changeCs(GkwxhwzyfzblhhzEntity entity);
+	
 }

+ 54 - 2
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/dc/JdjcWebService.java

@@ -523,7 +523,7 @@ public class JdjcWebService extends BaseController {
 	 * @param ggEntity
 	 * @return
 	 */
-	public DcZxjcEntity saveZxjc(DcZxjcEntity entity, GgEntity ggEntity) {
+	public DcZxjcEntity saveZxjc(DcZxjcEntity entity) {
 		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
@@ -543,10 +543,62 @@ public class JdjcWebService extends BaseController {
 			entity.setUpdateUser(Utils.getWebServiceUser());
 		}
 		entity = zxjcService.save(entity);
-		ggEntity = ggService.findById(ggEntity.getId());
+		GgEntity ggEntity = ggService.findById(entity.getGgid());
 		// 同步
 		zxjcService.sync(entity, ggEntity);
 		return entity;
 	}
+	
+	/**
+	 * 获取专项检查的详细信息
+	 * @param id
+	 * @return
+	 */
+	public DcZxjcEntity findZxjcById(Long id){
+		DcZxjcEntity dcZxjcEntity =zxjcService.findOne(id);
+		int zgs = 0;
+		double zgzj = 0.0;
+		List<DcEntity> dcList = listByZxjc(dcZxjcEntity);
+		for (DcEntity dcEntity : dcList) {
+			if (dcEntity.getMqzt().equals("1")) {
+				zgs += 1;
+			}
+			zgzj += (dcEntity.getZgtrzj() == null ? 0.0 : dcEntity
+					.getZgtrzj());
+		}
+		String zgl = "";
+		if (dcList == null
+				|| dcList.size() <= 0) {
+
+		} else {
+			BigDecimal bg = new BigDecimal((double) zgs
+					/ dcList.size());
+			zgl = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()
+					* 100 + "%";
+		}
+		dcZxjcEntity.setYhs(dcList==null?0:dcList.size());
+		dcZxjcEntity.setZgs(zgs);
+		dcZxjcEntity.setZgl(zgl);
+		dcZxjcEntity.setZgzj(zgzj);
+		return dcZxjcEntity;
+	}
+	
+	/**
+	 * 根据专项检查获取督查列表
+	 * @param zxjc
+	 * @return
+	 */
+	public List<DcEntity> listByZxjc(DcZxjcEntity zxjc) {
+		List<DcEntity> list = null;
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		addNotEmptyModel(filterList, "zxjcid", zxjc.getId(), Operator.EQ);
+		addNotEmptyModel(filterList, "recordStatus",
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		addNotEmptyModel(filterList, "original", "original", Operator.NL);
+		Specification<DcEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		list = (List<DcEntity>) dcService.findAll(spec);
+		return list;
+	}
 
 }

+ 1 - 0
gkaq/yjpt-java/trunk/locale/zh_CN/check.properties

@@ -103,6 +103,7 @@ yhfl=\u9690\u60a3\u5206\u7c7b
 yhqy=\u9690\u60a3\u533a\u57df
 jhwcsj=\u6574\u6539\u671f\u9650
 fxrq=\u53d1\u73b0\u65e5\u671f
+szcg=\u6240\u5728\u50a8\u7f50
 mqzt=\u76ee\u524d\u72b6\u6001
 wzg=\u672a\u6574\u6539
 yzg=\u5df2\u6574\u6539