Selaa lähdekoodia

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

xt_xuhao 8 vuotta sitten
vanhempi
commit
2f5856ad7d

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

@@ -48,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.DcEntity;
 import com.jtgh.yjpt.entity.check.ZcyhEntity;
 import com.jtgh.yjpt.entity.common.AccessoryEntity;
 import com.jtgh.yjpt.entity.gkgq.GqEntity;
@@ -59,6 +60,7 @@ 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.DcService;
 import com.jtgh.yjpt.service.check.ZcyhService;
 import com.jtgh.yjpt.service.common.AccessoryService;
 import com.jtgh.yjpt.service.gkgq.GqService;
@@ -100,6 +102,8 @@ public class CgController extends BaseController {
 	private ZcyhService zcyhService;
 	@Autowired
 	private ZysqbpService zysqbpService;
+	@Autowired
+	private DcService dcService;
 	
 
 	@Log(Type.QUERY)
@@ -661,7 +665,7 @@ public class CgController extends BaseController {
 	}
 
 	/**
-	 * 获取隐患分页列表
+//	 * 获取自查隐患分页列表
 	 * @param pageRequest
 	 * @param entity
 	 * @return
@@ -680,6 +684,27 @@ public class CgController extends BaseController {
 		return createBusinessContext(page);
 	}
 	
+	
+	/**
+//	 * 获取督查隐患分页列表
+	 * @param pageRequest
+	 * @param entity
+	 * @return
+	 */
+	public BusinessContext listDcYh(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<DcEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		Page<DcEntity> page = dcService.findAll(spec, pageRequest);
+		return createBusinessContext(page);
+	}
+	
 	/**
 	 * 获取作业分页列表
 	 * @param pageRequest

+ 23 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/check/DcEntity.java

@@ -25,27 +25,35 @@ import com.jtgh.yjpt.entity.common.TaskInfoEntity;
 import com.jtgh.yjpt.entity.gg.GgEntity;
 import com.jtgh.yjpt.entity.gkgq.GqEntity;
 import com.jtgh.yjpt.entity.jyr.JyrEntity;
+import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
 
 @Entity
 @Table(name = "T_YJPT_DC")
 public class DcEntity extends BaseEntity<Long> implements Cloneable {
 
-	public static final String PROCESS_DEFINITION_KEY = "jdjc";
+	public static final String PROCESS_DEFINITION_KEY = "jdjc";//监督检查
 
+	 
+	private static final long serialVersionUID = 3632942506139336575L;
+	
 	/**
-	 * 
+	 * 储罐 
+	 * add by xh-2016.10.13
 	 */
-	private static final long serialVersionUID = 3632942506139336575L;
+	private CgEntity cg;
+	
 	/**
 	 * ID
 	 * 
 	 */
 	private Long id;
+	
 	// /**
 	// * 所在地
 	// *
 	// */
 	// private CodeEntity szd;
+	
 	/**
 	 * 所在港区
 	 * 
@@ -525,5 +533,17 @@ public class DcEntity extends BaseEntity<Long> implements Cloneable {
 	public void setYqzgyy(String yqzgyy) {
 		this.yqzgyy = yqzgyy;
 	}
+	
+	
+	@ManyToOne(fetch = FetchType.EAGER, targetEntity = CgEntity.class)
+	@JoinColumn(name = "cg")
+	@RemotingExclude
+	public CgEntity getCg() {
+		return cg;
+	}
+
+	public void setCg(CgEntity cg) {
+		this.cg = cg;
+	}
 
 }

+ 18 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/zysqbp/ZysqbpServiceImpl.java

@@ -22,6 +22,9 @@ import java.util.Map;
 import org.activiti.engine.task.Task;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
@@ -55,6 +58,7 @@ import com.jtgh.yjpt.entity.zysqbp.ZysqbpCountEntity;
 import com.jtgh.yjpt.entity.zysqbp.ZysqbpCountEntity1;
 import com.jtgh.yjpt.entity.zysqbp.ZysqbpEntity;
 import com.jtgh.yjpt.entity.zysqbp.ZysqbpGatherEntity;
+import com.jtgh.yjpt.service.common.QueryService;
 import com.jtgh.yjpt.service.common.WorkflowMangerService;
 import com.jtgh.yjpt.service.impl.BaseWorkFlowServiceImpl;
 import com.jtgh.yjpt.service.zyfzndjy.AutoAuditService;
@@ -96,6 +100,20 @@ public class ZysqbpServiceImpl extends
 	protected MyRepository<ZysqbpEntity, Long> getDao() {
 		return zysqbpDao;
 	}
+	
+	@Autowired
+	private QueryService query;
+	
+	@Override
+	public Page<ZysqbpEntity> findAll(Specification<ZysqbpEntity> spec,
+			Pageable pageable) {
+		try {
+			return query.findAll(spec, pageable, ZysqbpEntity.class);
+		}catch (Exception e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
 
 	/**
 	 * 查询统计

+ 40 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/zc/ZczbWebService.java

@@ -595,5 +595,45 @@ public class ZczbWebService extends BaseController {
 		}
 		return pageList.getContent();
 	}
+	
+	
+	/**
+	 * 根据储罐获取自查隐患列表  
+	 * @param cgId
+	 * @param pageSize
+	 * @param pageNum
+	 * @return
+	 */
+	public List<ZcyhEntity> getZcyhByCg(long cgId,int pageSize,int pageNum){
+		SinglePageRequest page = new SinglePageRequest(pageNum, pageSize, "desc", "id");
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		
+		filterList.add(new PredicateModel("recordStatus",BaseEntity.RECORD_STATE_DELETE, Operator.NEQ));
+		// 所属储罐
+		filterList.add(new PredicateModel("cg", cgId, Operator.EQ));
+		// 隐患区域-罐区
+		filterList.add(new PredicateModel("yhqy", "2", Operator.EQ));
+		 
+		Specification<ZcyhEntity> spec = SpecificationCreater.searchByPredicateModels(filterList);
+		
+		Page<ZcyhEntity> pageContent = zcyhService.findAll(spec, page);
+		
+		if (pageContent == null || pageContent.getTotalPages() <= pageNum) {
+			return new ArrayList<ZcyhEntity>();
+		}
+		
+		return pageContent.getContent();
+	}
+	
+	/**
+	 * 根据自查隐患的Id获得entity
+	 * @param zcyhId
+	 * @return
+	 */
+	public ZcyhEntity getZcyhById(long zcyhId){
+		ZcyhEntity entity = zcyhService.findOne(zcyhId);
+		return entity;
+	}
+	 
 
 }

+ 4 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/zcyh/ZcyhWebService.java

@@ -42,4 +42,8 @@ public class ZcyhWebService extends BaseWebService {
 		}
 		return ws;
 	}
+	
+	
+
+	
 }

+ 27 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zysqbp/WhsqbpWebService.java

@@ -1105,5 +1105,32 @@ public class WhsqbpWebService extends BaseController {
 		}
 		return statisticsEntity;
 	}
+	
+	/**
+	 * 根据储罐获取危货作业申报列表 
+	 * @param cgId
+	 * @param pageSize
+	 * @param pageNum
+	 * @return
+	 */
+	public List<ZysqbpEntity> getWhsbByCg(long cgId,int pageSize,int pageNum){
+		SinglePageRequest page = new SinglePageRequest(pageNum, pageSize, "desc", "id");
+		
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		// 作业地点-储罐
+		addNotEmptyModel(filterList, "zydd.id", Constants.GGDM_ID_ZYDD_CG, Operator.EQ);
+		// 所属储罐
+		addNotEmptyModel(filterList, "zyddqybh.qynbbh", cgId, Operator.EQ);
+		
+		List<PredicateModel> orList = new ArrayList<PredicateModel>();
+		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> pageContent = zysqbpService.findAll(spec, page);
+		return pageContent.getContent();
+	}
 
 }

+ 1 - 1
gkaq/yjpt-java/trunk/resources/spring/application.properties

@@ -1,6 +1,6 @@
 \ufeff#***************************************  jdbc info  ********************************************#
 jdbc.driver                 = oracle.jdbc.driver.OracleDriver
-jdbc.url                      = jdbc:oracle:thin:@192.168.57.36:1521:orcl
+jdbc.url                      = jdbc:oracle:thin:@localhost:1521:orcl
 jdbc.username           = yjptlyg
 jdbc.password            = yjpt
 hibernate.dialect        = org.hibernate.dialect.Oracle10gDialect

+ 7 - 0
gkaq/yjpt-java/trunk/resources/sql/init/9.update.sql.ftl

@@ -8826,3 +8826,10 @@ alter  table T_GKHS_BZHWAQSYD modify sbdwbh varchar2(30);
 alter  table T_GKHS_SZGTAQSYD modify sbdwbh varchar2(30);
 alter  table T_GKHS_SZYTAQSYD modify sbdwbh varchar2(30);
 </#if>
+<#if versionDate?date("yyyyMMdd") lt "20161013"?date("yyyyMMdd") >
+--督查中增加CG字段
+ALTER TABLE T_YJPT_DC ADD (CG NUMBER NULL)  ;
+COMMENT ON COLUMN T_YJPT_DC.CG IS '储罐id'; 
+--补上自查隐患中CG的comments
+COMMENT ON COLUMN T_YJPT_ZCYH.CG IS '储罐id';
+</#if>