Browse Source

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

ld_liufl 9 years ago
parent
commit
d340c50870

BIN
gkaq/yjpt-java/trunk/flexResource/resource/images/zt_gree.gif


BIN
gkaq/yjpt-java/trunk/flexResource/resource/images/zt_red.gif


BIN
gkaq/yjpt-java/trunk/flexResource/resource/images/zt_yellow.gif


+ 1 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/Constants.java

@@ -183,6 +183,7 @@ public class Constants {
 	public static final String SEQ_YJPT_JYRXX_SNB = "SEQ_YJPT_JYRXX_SNB";
 	public static final String SEQ_YJPT_JYRXX_SNB = "SEQ_YJPT_JYRXX_SNB";
 	/** 重大危险源 **/
 	/** 重大危险源 **/
 	public static final String SEQ_T_YJPT_CG = "SEQ_T_YJPT_CG";
 	public static final String SEQ_T_YJPT_CG = "SEQ_T_YJPT_CG";
+	public static final String SEQ_T_YJPT_CGZT = "SEQ_T_YJPT_CGZT";
 	public static final String SEQ_T_YJPT_ZBHJJBQK = "SEQ_T_YJPT_ZBHJJBQK";
 	public static final String SEQ_T_YJPT_ZBHJJBQK = "SEQ_T_YJPT_ZBHJJBQK";
 	public static final String SEQ_T_YJPT_QSK = "SEQ_T_YJPT_QSK";
 	public static final String SEQ_T_YJPT_QSK = "SEQ_T_YJPT_QSK";
 	public static final String SEQ_T_YJPT_ZDWXYBA_FLOW = "SEQ_T_YJPT_GQNWXYDJBAB_FLOW";
 	public static final String SEQ_T_YJPT_ZDWXYBA_FLOW = "SEQ_T_YJPT_GQNWXYDJBAB_FLOW";

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

@@ -38,8 +38,8 @@ import com.jtgh.yjpt.common.BusinessContext;
 import com.jtgh.yjpt.common.Constants;
 import com.jtgh.yjpt.common.Constants;
 import com.jtgh.yjpt.common.GlobalData;
 import com.jtgh.yjpt.common.GlobalData;
 import com.jtgh.yjpt.common.PredicateModel;
 import com.jtgh.yjpt.common.PredicateModel;
-import com.jtgh.yjpt.common.ReportExportHelper;
 import com.jtgh.yjpt.common.PredicateModel.Operator;
 import com.jtgh.yjpt.common.PredicateModel.Operator;
+import com.jtgh.yjpt.common.ReportExportHelper;
 import com.jtgh.yjpt.common.SinglePageRequest;
 import com.jtgh.yjpt.common.SinglePageRequest;
 import com.jtgh.yjpt.common.SpecificationCreater;
 import com.jtgh.yjpt.common.SpecificationCreater;
 import com.jtgh.yjpt.common.Utils;
 import com.jtgh.yjpt.common.Utils;
@@ -53,12 +53,14 @@ import com.jtgh.yjpt.entity.jyr.JyrEntity;
 import com.jtgh.yjpt.entity.jyrxxgl.GksssbEntity;
 import com.jtgh.yjpt.entity.jyrxxgl.GksssbEntity;
 import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgCountEntity;
 import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgCountEntity;
 import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
 import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
+import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgztEntity;
 import com.jtgh.yjpt.entity.yjgl.zdwxyfb.ZbhjjbqkEntity;
 import com.jtgh.yjpt.entity.yjgl.zdwxyfb.ZbhjjbqkEntity;
 import com.jtgh.yjpt.service.common.AccessoryService;
 import com.jtgh.yjpt.service.common.AccessoryService;
 import com.jtgh.yjpt.service.gkgq.GqService;
 import com.jtgh.yjpt.service.gkgq.GqService;
 import com.jtgh.yjpt.service.jyr.JyrService;
 import com.jtgh.yjpt.service.jyr.JyrService;
 import com.jtgh.yjpt.service.jyrxxgl.GksssbService;
 import com.jtgh.yjpt.service.jyrxxgl.GksssbService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
+import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.ZbhjjbqkService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.ZbhjjbqkService;
 
 
 @Controller
 @Controller
@@ -72,6 +74,8 @@ public class CgController extends BaseController {
 	@Autowired
 	@Autowired
 	private CgService cgService;
 	private CgService cgService;
 	@Autowired
 	@Autowired
+	private CgztService cgztService;
+	@Autowired
 	private CgDao cgDao;
 	private CgDao cgDao;
 	@Autowired
 	@Autowired
 	private AccessoryService accessoryService;
 	private AccessoryService accessoryService;
@@ -102,6 +106,11 @@ public class CgController extends BaseController {
 		if (null == pageRequest) {
 		if (null == pageRequest) {
 			List<CgEntity> dataset = cgService.findAll(spec);
 			List<CgEntity> dataset = cgService.findAll(spec);
 			for (CgEntity vo : dataset) {
 			for (CgEntity vo : dataset) {
+				//检索储罐状态
+				CgztEntity cgzt = cgztService.findByCg(vo);
+				if(cgzt != null) {
+					vo.setZt(cgzt.getZt());
+				}
 				// 检索附件
 				// 检索附件
 				filterList = new ArrayList<PredicateModel>();
 				filterList = new ArrayList<PredicateModel>();
 				addNotEmptyModel(filterList, "entityType.id",
 				addNotEmptyModel(filterList, "entityType.id",
@@ -120,6 +129,11 @@ public class CgController extends BaseController {
 		} else {
 		} else {
 			Page<CgEntity> page = cgService.findAll(spec, pageRequest);
 			Page<CgEntity> page = cgService.findAll(spec, pageRequest);
 			for (CgEntity vo : page) {
 			for (CgEntity vo : page) {
+				//检索储罐状态
+				CgztEntity cgzt = cgztService.findByCg(vo);
+				if(cgzt != null) {
+					vo.setZt(cgzt.getZt());
+				}
 				// 检索附件
 				// 检索附件
 				filterList = new ArrayList<PredicateModel>();
 				filterList = new ArrayList<PredicateModel>();
 				addNotEmptyModel(filterList, "entityType.id",
 				addNotEmptyModel(filterList, "entityType.id",
@@ -526,6 +540,63 @@ public class CgController extends BaseController {
 		} finally {
 		} finally {
 			outputStream.close();
 			outputStream.close();
 		}
 		}
+	}
+	
 
 
+	/**
+	 * 查询储罐状态信息
+	 * @param pageRequest
+	 * @param functionId
+	 * @param entity
+	 * @param hz
+	 * @param tbsj1
+	 * @param tbsj2
+	 * @return
+	 */
+	public BusinessContext listZt(SinglePageRequest pageRequest, Long functionId,
+			CgEntity entity,String hz,Date tbsj1,Date tbsj2) {
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		//所属储罐
+		addNotEmptyModel(filterList, "cg", entity.getId(), Operator.EQ);
+		//货种
+		addNotEmptyModel(filterList, "hz", hz, Operator.LIKE);
+		//填报时间
+		if(tbsj1!=null){
+			addNotEmptyModel(filterList, "tbsj", Utils.getDateFirstTime(tbsj1), Operator.GTE);
+		}
+		if(tbsj2!=null){
+			addNotEmptyModel(filterList, "tbsj", Utils.getDateLastTime(tbsj2), Operator.LTE);
+		}
+		addNotEmptyModel(filterList, "recordStatus",
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		Specification<CgztEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		 Page<CgztEntity> page = cgztService.findAll(spec,pageRequest);
+		 return createBusinessContext(page);
+	}
+	
+	/**
+	 * 保存
+	 * @param functionId
+	 * @param entity
+	 * @return
+	 */
+	public  BusinessContext saveZt(Long functionId,CgztEntity entity){
+		//新增
+		if(entity.getId()==null || entity.getId().equals(0l)){
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getCurrentUser());
+			entity.setRecordCode( getCurrentRoleCode(functionId));
+		} else {
+			entity.setUpdateDate(new Date());
+			entity.setUpdateUser(Utils.getCurrentUser());
+		}
+		entity = cgztService.save(entity);
+		return createBusinessContext(entity);
 	}
 	}
+	
+	public void deleteZt(CgztEntity entity){
+		cgztService.logicDelete(entity.getId());
+	}
+	
 }
 }