Browse Source

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

ld_liufl 9 years ago
parent
commit
0bea5d31dd

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

@@ -869,4 +869,16 @@ public class Constants {
 	//************************储罐状态************************
 	public final static String CGZT_ZC = "1";
 	public final static String CGZT_YC = "2";
+	
+	//**************************外部数据类型*****************************
+	//待办任务
+	public final static String MESSAGE_CATEGORY_TODO="TODO";
+	//工作提醒
+	public final static String MESSAGE_CATEGORY_REMIND="REMIND";
+	//公告
+	public final static String MESSAGE_CATEGORY_NOTICE="NOTICE";
+	//数据来源
+	public final static String DATA_SOURCE_SC="SC";
+	//
+	public static String API_RES_URL="http://139.224.68.23:18081/wisdomport-api/wisdomport-api/api/rest";
 }

+ 4 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/GlobalData.java

@@ -179,7 +179,10 @@ public class GlobalData {
 		if(StringUtils.hasLength(prop)) {
 			Utils.setField(null, prop, "PASSWORD_YXQ", Constants.class);
 		}
-
+		prop = String.valueOf(p.get("api.res.url"));
+		if (StringUtils.hasLength(prop)) {
+			Utils.setField(null, prop, "API_RES_URL", Constants.class);
+		}
 		
 	}
 

+ 0 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/cg/CgdtjkServiceImpl.java

@@ -16,7 +16,6 @@ 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.service.cg.CgdtjkService;
-import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgsyService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
 
@@ -24,8 +23,6 @@ import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
 public class CgdtjkServiceImpl implements CgdtjkService {
 
 	@Autowired
-	private CgService cgService;
-	@Autowired
 	private CgztService cgztService;
 	@Autowired
 	private CgsyService cgsyService;

+ 0 - 4
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/yjzyxxgl/YjwzxxServiceImpl.java

@@ -212,7 +212,6 @@ public class YjwzxxServiceImpl extends BaseService<YjwzxxEntity, Long>
 
 	@Override
 	public YjwzxxEntity FindOne(long id) {
-		// TODO Auto-generated method stub
 		return yjwzxxDao.findOne(id);
 	}
 
@@ -316,9 +315,7 @@ public class YjwzxxServiceImpl extends BaseService<YjwzxxEntity, Long>
 			List<YjwzFlxxEntity> ssList, List<YjwzFlxxEntity> deleteSsList) {
 		entity = this.save(entity);
 		for (int i = 0; i < ssList.size(); i++) {
-			if (ssList.get(i).getId() == null) {
 				ssList.get(i).setWzid(entity);
-			}
 		}
 		List<YjwzFlxxEntity> flxx = yjwzFlxxService.save(ssList);
 		yjwzFlxxService.logicDelete(deleteSsList);
@@ -353,7 +350,6 @@ public class YjwzxxServiceImpl extends BaseService<YjwzxxEntity, Long>
 		if (szd != 0l) {
 			hj1Dqqy = Utils.getResource("select", codeDao.findOne(szd)
 					.getName());
-
 		} else {
 			hj1Dqqy = "江苏省";
 		}

+ 7 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/zyfzns/GkzyfznsServiceImpl.java

@@ -202,11 +202,18 @@ public class GkzyfznsServiceImpl extends
 				nsEntity.setNssj(nssj);
 				nsEntity.setNsyj(nsyj);
 				nsEntity.setNsr(nsr);
+				nsEntity.setUpdateUser(Utils.getCurrentUser());
 				nsEntity.setUpdateDate(new Date());
 				nsDao.save(nsEntity);
 			} else {
 				nsEntity.setNsns(nsns);
 				nsEntity.setNsjg(nsjg);
+				nsEntity.setNsid(entity.getId());
+				nsEntity.setNssj(nssj);
+				nsEntity.setNsyj(nsyj);
+				nsEntity.setNsr(nsr);
+				nsEntity.setJyr(entity.getJyr());
+				nsEntity.setAddUser(Utils.getCurrentUser());
 				nsEntity.setAddDate(new Date());
 				nsEntity.setFzbh(entity.getFzbh());
 				nsDao.save(nsEntity);

+ 1 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/yjgl/zdwxyfb/CgztService.java

@@ -44,6 +44,6 @@ public interface CgztService {
 	
 	public CgztEntity findByCg(CgEntity cg);
 
-	CgztEntity saveCgzt(CgztEntity entity);
+	public CgztEntity saveCgzt(CgztEntity entity);
 
 }

+ 284 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/yjgl/YjglWebService.java

@@ -0,0 +1,284 @@
+package com.jtgh.yjpt.webService.yjgl;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+
+import com.jtgh.yjpt.common.PredicateModel;
+import com.jtgh.yjpt.common.PredicateModel.Operator;
+import com.jtgh.yjpt.common.SinglePageRequest;
+import com.jtgh.yjpt.common.SpecificationCreater;
+import com.jtgh.yjpt.common.Utils;
+import com.jtgh.yjpt.controller.BaseController;
+import com.jtgh.yjpt.entity.BaseEntity;
+import com.jtgh.yjpt.entity.sgalgl.SgalglEntity;
+import com.jtgh.yjpt.entity.sgalgl.SgalglwzddEntity;
+import com.jtgh.yjpt.entity.yjgl.YjpxEntity;
+import com.jtgh.yjpt.entity.yjgl.YjylEntity;
+import com.jtgh.yjpt.entity.yjgl.YjyxEntity;
+import com.jtgh.yjpt.entity.yjzyxxgl.YjwzFlxxEntity;
+import com.jtgh.yjpt.service.sgalgl.SgalglService;
+import com.jtgh.yjpt.service.yjgl.YjpxService;
+import com.jtgh.yjpt.service.yjgl.YjylService;
+import com.jtgh.yjpt.service.yjgl.YjyxService;
+import com.jtgh.yjpt.service.yjzyxxgl.YjwzFlxxService;
+import com.jtgh.yjpt.webService.WsResult;
+
+/**
+ * 应急演练WebService
+ * 
+ * @author chenkf
+ * 
+ */
+@Service
+@WebService(targetNamespace = "http://webService.yjpt.com/", serviceName = "yjglService")
+@HandlerChain(file="handle-chain.xml")
+public class YjglWebService extends BaseController {
+
+	@Autowired
+	private YjpxService yjpxService;
+	@Autowired
+	private YjyxService yjyxService;
+	@Autowired
+	private YjylService yjylService;
+	@Autowired
+	private SgalglService sgalglService;
+	@Autowired
+	private YjwzFlxxService yjwzFlxxService;
+	
+
+	/**
+	 * 保存应急培训
+	 * @param entity
+	 * @return
+	 */
+	public YjpxEntity saveYjpx(YjpxEntity entity) {
+		if(entity.getId()==null || entity.getId().equals(0l)){
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			entity.setRecordCode("90");
+		}else {
+			YjpxEntity vo = yjpxService.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());
+		}
+		entity = yjpxService.saveEntity(entity);
+		return entity;
+	}
+	
+	
+	/**
+	 * 删除应急培训
+	 * @param entities
+	 */
+	public WsResult deleteYjpx(YjpxEntity entity){	
+		WsResult ws = new WsResult();
+		try {
+			if(entity.getId()!=null)
+				yjpxService.logicDeleteEntity(entity);
+			ws.setResultCode(WsResult.SUCCESS);
+		} catch (Exception e) {
+			e.printStackTrace();
+			ws.setResultCode(WsResult.FAILURE);
+		}
+		return ws;	
+	}
+	
+	/**
+	 * 查询应急培训详细信息
+	 * @param id
+	 * @return
+	 */
+	public YjpxEntity findYjpxById(Long id){
+		YjpxEntity entity = yjpxService.findOne(id);
+		return  entity;		
+	}
+	/**
+	 * 保存应急演习
+	 * @param entity
+	 * @return
+	 */
+	public YjyxEntity saveYjyx(YjyxEntity entity) {
+		if(entity.getId()==null || entity.getId().equals(0l)){
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			entity.setRecordCode("90");
+		}else {
+			YjyxEntity vo = yjyxService.findById(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());
+		}
+		entity = yjyxService.saveEntity(entity);
+		return entity;
+	}
+	
+	
+	/**
+	 * 删除应急演习
+	 * @param entities
+	 */
+	public WsResult deleteYjyx(YjyxEntity entity){	
+		WsResult ws = new WsResult();
+		try {
+			if(entity.getId()!=null)
+				yjyxService.logicDeleteEntity(entity);
+			ws.setResultCode(WsResult.SUCCESS);
+		} catch (Exception e) {
+			e.printStackTrace();
+			ws.setResultCode(WsResult.FAILURE);
+		}
+		return ws;	
+	}
+	
+	/**
+	 * 查询应急演习详细信息
+	 * @param id
+	 * @return
+	 */
+	public YjyxEntity findYjyxById(Long id){
+		YjyxEntity entity = yjyxService.findById(id);
+		return  entity;		
+	}
+	/**
+	 * 保存应急演练
+	 * @param entity
+	 * @return
+	 */
+	public YjylEntity saveYjyl(YjylEntity entity) {
+		if(entity.getId()==null || entity.getId().equals(0l)){
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			entity.setRecordCode("90");
+		}else {
+			YjylEntity vo = yjylService.findById(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());
+		}
+		entity = yjylService.saveEntity(entity);
+		return entity;
+	}
+	
+	
+	/**
+	 * 删除应急演练
+	 * @param entities
+	 */
+	public WsResult deleteYjyl(YjylEntity entity){	
+		WsResult ws = new WsResult();
+		try {
+			if(entity.getId()!=null)
+				yjylService.logicDeleteEntity(entity);
+			ws.setResultCode(WsResult.SUCCESS);
+		} catch (Exception e) {
+			e.printStackTrace();
+			ws.setResultCode(WsResult.FAILURE);
+		}
+		return ws;	
+	}
+	
+	/**
+	 * 查询应急演练详细信息
+	 * @param id
+	 * @return
+	 */
+	public YjylEntity findYjylById(Long id){
+		YjylEntity entity = yjylService.findById(id);
+		return  entity;		
+	}
+	
+	/**
+	 * 保存事故案例
+	 * @param entity
+	 * @param saveList
+	 * @return
+	 */
+	public SgalglEntity saveSgal(SgalglEntity entity,List<SgalglwzddEntity> saveList){
+		if(entity.getId()==null || entity.getId().equals(0l)){
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			entity.setRecordCode("90");
+		}else {
+			SgalglEntity vo = sgalglService.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());
+		}
+		entity = sgalglService.save(entity, saveList);
+		return entity;
+	}
+	
+	
+	/**
+	 * 获取应急物资分页列表
+	 * @param gkdw
+	 * @param dw
+	 * @param ssmc
+	 * @param n
+	 * @param pageCount
+	 * @return
+	 */
+	public List<YjwzFlxxEntity> queryWzzz(Long gkdw, String dw,
+			String ssmc,int n,int pageCount) {
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
+		// 根据事故类别过滤
+		if (0l != gkdw) {
+			addNotEmptyModel(filterList, "wzid.gkdw", gkdw, Operator.EQ);
+		}
+		// 根据事故等级过滤
+		addNotEmptyModel(filterList, "wzid.szdgkj", dw, Operator.LIKE);
+		// 根据事故等级过滤
+		addNotEmptyModel(filterList, "ssmc", ssmc, Operator.LIKE);
+		addNotEmptyModel(filterList, "zyfzId", 0, Operator.EQ);
+
+		addNotEmptyModel(filterList, "recordStatus",
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+		Specification<YjwzFlxxEntity> spec = SpecificationCreater
+				.searchByPredicateModels(filterList);
+		SinglePageRequest pageable = new SinglePageRequest(pageCount, n, "desc",
+				"id");
+		Page<YjwzFlxxEntity> list = yjwzFlxxService.findAll(spec, pageable);
+		if(list==null || list.getTotalPages()<=pageCount){
+			return new ArrayList<YjwzFlxxEntity>();
+		}
+		return list.getContent();
+	}
+}

+ 3 - 2
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/yjgl/yjya/YjyaWebService.java

@@ -66,6 +66,8 @@ public class YjyaWebService extends BaseWebService {
 		}
 		return ws;	
 	}
+	
+	
 	public void saveEntityAndFj(YjyaEntity entity,List<AccessoryEntity> list){
 		entity.setSzd(entity.getSzd());
 		entity.setUpdateUser(GlobalData.TB_USER);
@@ -74,8 +76,7 @@ public class YjyaWebService extends BaseWebService {
 			accessoryEntity.setUpdateUser(GlobalData.TB_USER);
 			accessoryEntity.setAddUser(GlobalData.TB_USER);
 		}
-		yjyaService.save(entity,list);
-		
+		yjyaService.save(entity,list);	
 		
 	}
 	

+ 2 - 3
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/yjzyxxgl/YjzyxxglWebService.java

@@ -12,7 +12,6 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 
-import com.jtgh.yjpt.common.BusinessContext;
 import com.jtgh.yjpt.common.Constants;
 import com.jtgh.yjpt.common.PredicateModel;
 import com.jtgh.yjpt.common.PredicateModel.Operator;
@@ -335,7 +334,7 @@ public class YjzyxxglWebService extends BaseController {
 		return list.getContent();
 	}
 
-	public BusinessContext saveYjdw(ZyyjjydwEntity entity,
+	public ZyyjjydwEntity saveYjdw(ZyyjjydwEntity entity,
 			List<ZyyjjydwryhzEntity> zyList, List<JzyjjydwryhzEntity> jzList,
 			List<ZyyjjydwryhzEntity> zyDelete, List<JzyjjydwryhzEntity> jzDelete)
 			throws CloneNotSupportedException {
@@ -359,7 +358,7 @@ public class YjzyxxglWebService extends BaseController {
 		}
 		entity = zyjjydwService.saveEntity(entity, zyList, jzList, zyDelete,
 				jzDelete);
-		return createBusinessContext(entity);
+		return entity;
 	}
 
 	/**

+ 232 - 49
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/dc/JdjcWebService.java

@@ -1,6 +1,6 @@
 package com.jtgh.yjpt.webService.zcdc.dc;
 
-
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -11,6 +11,11 @@ import java.util.Map;
 
 import javax.jws.HandlerChain;
 import javax.jws.WebService;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.persistence.criteria.Subquery;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -19,6 +24,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
 import com.jtgh.yjpt.common.Constants;
+import com.jtgh.yjpt.common.GlobalData;
 import com.jtgh.yjpt.common.PredicateModel;
 import com.jtgh.yjpt.common.PredicateModel.Operator;
 import com.jtgh.yjpt.common.SinglePageRequest;
@@ -30,10 +36,15 @@ import com.jtgh.yjpt.controller.check.DcController;
 import com.jtgh.yjpt.entity.BaseEntity;
 import com.jtgh.yjpt.entity.auth.UserEntity;
 import com.jtgh.yjpt.entity.check.DcEntity;
+import com.jtgh.yjpt.entity.check.DcZxjcEntity;
 import com.jtgh.yjpt.entity.common.AccessoryEntity;
+import com.jtgh.yjpt.entity.gg.GgEntity;
 import com.jtgh.yjpt.service.check.DcService;
+import com.jtgh.yjpt.service.check.ZxjcService;
 import com.jtgh.yjpt.service.common.AccessoryService;
+import com.jtgh.yjpt.service.gg.GgService;
 import com.jtgh.yjpt.webService.WsResult;
+
 /**
  * 督察WebService
  * 
@@ -42,7 +53,7 @@ import com.jtgh.yjpt.webService.WsResult;
  */
 @Service
 @WebService(targetNamespace = "http://webService.yjpt.com/", serviceName = "jdjcService")
-@HandlerChain(file="handle-chain.xml")
+@HandlerChain(file = "handle-chain.xml")
 public class JdjcWebService extends BaseController {
 
 	@Autowired
@@ -51,9 +62,14 @@ public class JdjcWebService extends BaseController {
 	private DcService dcService;
 	@Autowired
 	private AccessoryService accessoryService;
+	@Autowired
+	private ZxjcService zxjcService;
+	@Autowired
+	private GgService ggService;
 	
 	/**
 	 * 保存
+	 * 
 	 * @param entity
 	 * @return
 	 */
@@ -61,7 +77,7 @@ public class JdjcWebService extends BaseController {
 		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
-			//行政人员
+			// 行政人员
 			entity.setRecordCode("100100100100");
 		} else {
 			DcEntity vo = dcService.findOne(entity.getId());
@@ -82,6 +98,7 @@ public class JdjcWebService extends BaseController {
 
 	/**
 	 * 删除
+	 * 
 	 * @param entity
 	 * @return
 	 */
@@ -96,21 +113,23 @@ public class JdjcWebService extends BaseController {
 		}
 		return ws;
 	}
-	
+
 	/**
 	 * 提交
+	 * 
 	 * @param entity
 	 * @param accessoryList附件
 	 * @return
 	 */
-	public DcEntity submitWithFj(DcEntity entity,List<AccessoryEntity> accessoryList){
+	public DcEntity submitWithFj(DcEntity entity,
+			List<AccessoryEntity> accessoryList) {
 		boolean init = false;
 		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
-			//行政人员
+			// 行政人员
 			entity.setRecordCode("100100100100");
-			init=true;
+			init = true;
 		} else {
 			DcEntity vo = dcService.findOne(entity.getId());
 			entity.setAddDate(vo.getAddDate());
@@ -146,17 +165,18 @@ public class JdjcWebService extends BaseController {
 		dcService.submit(dcEntity);// 市级提交发起流程
 		return dcEntity;
 	}
-	
+
 	/**
 	 * 提交
+	 * 
 	 * @param entity
 	 * @return
 	 */
-	public DcEntity submit(DcEntity entity){
+	public DcEntity submit(DcEntity entity) {
 		if (null == entity.getId() || entity.getId().equals(0l)) {
 			entity.setAddDate(new Date());
 			entity.setAddUser(Utils.getWebServiceUser());
-			//行政人员
+			// 行政人员
 			entity.setRecordCode("100100100100");
 		} else {
 			DcEntity vo = dcService.findOne(entity.getId());
@@ -176,9 +196,10 @@ public class JdjcWebService extends BaseController {
 		dcService.submit(dcEntity);// 市级提交发起流程
 		return dcEntity;
 	}
-	
+
 	/**
 	 * 经营人修改完了提交
+	 * 
 	 * @param entity
 	 * @param accessoryList
 	 * @return
@@ -195,9 +216,9 @@ public class JdjcWebService extends BaseController {
 			entity.setAddUser(Utils.getCurrentUser());
 			entity.setAddDate(new Date());
 			entity.setRecordCode("100100100100");
-			dcEntity=entity;
+			dcEntity = entity;
 		} else {
-			dcEntity=dcService.findOne(entity.getId());
+			dcEntity = dcService.findOne(entity.getId());
 			dcEntity.setUpdateUser(Utils.getCurrentUser());
 			dcEntity.setUpdateDate(new Date());
 			dcEntity.setMqzt(entity.getMqzt());
@@ -206,7 +227,7 @@ public class JdjcWebService extends BaseController {
 			dcEntity.setYzgbz(entity.getYzgbz());
 			dcEntity.setZgtrzj(entity.getZgtrzj());
 			dcEntity.setYqzgqx(entity.getYqzgqx());
-			dcEntity.setYqzgyy(entity.getYqzgyy());			
+			dcEntity.setYqzgyy(entity.getYqzgyy());
 		}
 		dcEntity.setRecordStatus(BaseEntity.RECORD_STATE_SUBMIT);
 		dcEntity = dcService.save(dcEntity);
@@ -227,9 +248,10 @@ public class JdjcWebService extends BaseController {
 		dcService.complete(param, variables);
 		return dcEntity;
 	}
-	
+
 	/**
 	 * 判断当前用户是否有审批权限 之判断
+	 * 
 	 * @param id
 	 * @return 0 表示未签收,代办理,1表示已签收待办理 ,""表示 无流程
 	 */
@@ -245,9 +267,10 @@ public class JdjcWebService extends BaseController {
 		}
 		return "";
 	}
-	
+
 	/**
 	 * 审批
+	 * 
 	 * @param entity
 	 * @param accessoryList
 	 * @param shyj
@@ -256,57 +279,80 @@ public class JdjcWebService extends BaseController {
 	 * @param toWho
 	 * @return
 	 */
-	public DcEntity audit( DcEntity entity, String shyj, Date shsj,
-			boolean flag, String toWho){
+	public DcEntity audit(DcEntity entity, String shyj, Date shsj,
+			boolean flag, String toWho) {
 		entity = dcService.findOne(entity.getId());
 		List<AccessoryEntity> accessoryList = new ArrayList<AccessoryEntity>();
-		List<AccessoryEntity> acc1 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGCSFJ), 0l);
-		if(acc1!=null && acc1.size()>0){
+		List<AccessoryEntity> acc1 = accessoryService
+				.findByEntityIdAndEntityTypeAndType(entity.getId(),
+						Long.parseLong(Constants.FJSSLX_DCZGCSFJ), 0l);
+		if (acc1 != null && acc1.size() > 0) {
 			accessoryList.addAll(acc1);
 		}
-		List<AccessoryEntity> acc2 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGYQFJ), 0l);
-		if(acc2!=null && acc2.size()>0){
+		List<AccessoryEntity> acc2 = accessoryService
+				.findByEntityIdAndEntityTypeAndType(entity.getId(),
+						Long.parseLong(Constants.FJSSLX_DCZGYQFJ), 0l);
+		if (acc2 != null && acc2.size() > 0) {
 			accessoryList.addAll(acc2);
 		}
-		List<AccessoryEntity> acc3 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_ZPFJ), 0l);
-		if(acc2!=null && acc2.size()>0){
+		List<AccessoryEntity> acc3 = accessoryService
+				.findByEntityIdAndEntityTypeAndType(entity.getId(),
+						Long.parseLong(Constants.FJSSLX_ZPFJ), 0l);
+		if (acc2 != null && acc2.size() > 0) {
 			accessoryList.addAll(acc3);
 		}
-		List<AccessoryEntity> acc4 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGHZP), 0l);
-		if(acc2!=null && acc2.size()>0){
+		List<AccessoryEntity> acc4 = accessoryService
+				.findByEntityIdAndEntityTypeAndType(entity.getId(),
+						Long.parseLong(Constants.FJSSLX_DCZGHZP), 0l);
+		if (acc2 != null && acc2.size() > 0) {
 			accessoryList.addAll(acc4);
 		}
-		List<AccessoryEntity> acc5 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGJGFJ), 0l);
-		if(acc2!=null && acc2.size()>0){
+		List<AccessoryEntity> acc5 = accessoryService
+				.findByEntityIdAndEntityTypeAndType(entity.getId(),
+						Long.parseLong(Constants.FJSSLX_DCZGJGFJ), 0l);
+		if (acc2 != null && acc2.size() > 0) {
 			accessoryList.addAll(acc5);
 		}
-		List<AccessoryEntity> acc6 = accessoryService.findByEntityIdAndEntityTypeAndType(entity.getId(), Long.parseLong(Constants.FJSSLX_DCZGHZP), 0l);
-		if(acc2!=null && acc2.size()>0){
+		List<AccessoryEntity> acc6 = accessoryService
+				.findByEntityIdAndEntityTypeAndType(entity.getId(),
+						Long.parseLong(Constants.FJSSLX_DCZGHZP), 0l);
+		if (acc2 != null && acc2.size() > 0) {
 			accessoryList.addAll(acc6);
 		}
-		dcController.audit(0l, entity, accessoryList, shyj, new Date(), flag, toWho);
+		dcController.audit(0l, entity, accessoryList, shyj, new Date(), flag,
+				toWho);
 		entity = dcService.findOne(entity.getId());
 		return entity;
 	}
-	
+
 	/**
 	 * 分页查询
-	 * @param szd 所在地
-	 * @param szgq 所在港区
-	 * @param bdcdw 被督查单位
-	 * @param dcdw 督查单位
-	 * @param bdcdwfzr 被督查单位负责人
-	 * @param wxhwpm 整改状态
-	 * @param sbsj1 申报时间
+	 * 
+	 * @param szd
+	 *            所在地
+	 * @param szgq
+	 *            所在港区
+	 * @param bdcdw
+	 *            被督查单位
+	 * @param dcdw
+	 *            督查单位
+	 * @param bdcdwfzr
+	 *            被督查单位负责人
+	 * @param wxhwpm
+	 *            整改状态
+	 * @param sbsj1
+	 *            申报时间
 	 * @param sbsj2
-	 * @param n  条数
-	 * @param pageCount 页
+	 * @param n
+	 *            条数
+	 * @param pageCount
+	 *            页
 	 * @return
 	 */
 	public List<DcEntity> getDcPageListByParam(Long szd, Long szgq,
-			String bdcdw,String dcdw, String bdcdwfzr, String mqzt, String sbsj1,
-			String sbsj2,int n, int pageCount) {
-		List<PredicateModel> filterList = new ArrayList<PredicateModel>();	
+			String bdcdw, String dcdw, String bdcdwfzr, String mqzt,
+			String sbsj1, String sbsj2, int n, int pageCount) {
+		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		// 只检索非删除状态记录
 		addNotEmptyModel(filterList, "recordStatus",
 				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
@@ -316,11 +362,11 @@ public class JdjcWebService extends BaseController {
 		addNotEmptyModel(filterList, "szgq.id", szgq, Operator.EQ);
 		// 根据被督查单位 过滤
 		addNotEmptyModel(filterList, "bdcdw.gkjyr", bdcdw, Operator.LIKE);
-		//督查单位
+		// 督查单位
 		addNotEmptyModel(filterList, "dcdw", dcdw, Operator.LIKE);
-		//整改状态
+		// 整改状态
 		addNotEmptyModel(filterList, "mqzt", mqzt, Operator.EQ);
-		//过滤历史记	
+		// 过滤历史记
 		addNotEmptyModel(filterList, "original", "original", Operator.NL);
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-M-d");
 		// 报告时间
@@ -351,14 +397,15 @@ public class JdjcWebService extends BaseController {
 		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
 				"sj");
 		Page<DcEntity> list = dcService.findAll(spec, page);
-		if(list==null||list.getTotalPages()<pageCount){
-			return  new ArrayList<DcEntity>();
+		if (list == null || list.getTotalPages() <= pageCount) {
+			return new ArrayList<DcEntity>();
 		}
 		return list.getContent();
 	}
 
 	/**
 	 * 获取单条信息
+	 * 
 	 * @param id
 	 * @return
 	 */
@@ -366,4 +413,140 @@ public class JdjcWebService extends BaseController {
 		return dcService.findOne(id);
 	}
 
+	/**
+	 * 获取专项检查分页信息
+	 * @param szd
+	 * @param szgq
+	 * @param jyr
+	 * @param ggmc
+	 * @param n
+	 * @param pageCount
+	 * @return
+	 * @throws ParseException
+	 */
+	public List<DcZxjcEntity> getZxjcPageListByParam(final Long szd,
+			final Long szgq, final Long jyr, final String ggmc,int n, int pageCount)
+			throws ParseException {
+		Specification<DcZxjcEntity> spec = new Specification<DcZxjcEntity>() {
+			@Override
+			public Predicate toPredicate(Root<DcZxjcEntity> root,
+					CriteriaQuery<?> query, CriteriaBuilder cb) {
+				List<Predicate> list = new ArrayList<Predicate>();
+				// 只检索非删除状态记录
+				list.add(cb.notEqual(root.get("recordStatus").as(String.class),
+						BaseEntity.RECORD_STATE_DELETE));
+				if (!StringUtils.isEmpty(ggmc))
+					list.add(cb.like(root.get("ggmc").as(String.class), "%"
+							+ ggmc + "%"));
+				if (szgq != null
+						|| jyr != null
+						|| (szd != null && !GlobalData.CITY_CODE.equals(szd
+								.toString()))) {
+					Subquery<DcEntity> subquery = query
+							.subquery(DcEntity.class);
+					Root<DcEntity> subRoot = subquery.from(DcEntity.class);
+					subquery.select(subRoot);
+					List<Predicate> subQueryPredicates = new ArrayList<Predicate>();
+					subQueryPredicates.add(cb.equal(
+							root.get("id").as(String.class),
+							subRoot.get("zxjcid").as(String.class)));
+					if (szd != null && !szd.equals("")
+							&& !GlobalData.CITY_CODE.equals(szd.toString()))
+						subQueryPredicates.add(cb.like(
+								subRoot.get("szd").get("id").as(String.class),
+								szd + "%"));
+					if (szgq != null && !szgq.equals(""))
+						subQueryPredicates.add(cb.equal(subRoot.get("szgq")
+								.get("id").as(Long.class), szgq));
+					if (jyr != null && !jyr.equals(""))
+						subQueryPredicates.add(cb.equal(subRoot.get("bdcdw")
+								.get("id").as(Long.class), jyr));
+					subquery.where(subQueryPredicates
+							.toArray(new Predicate[] {}));
+					list.add(cb.exists(subquery));
+				}
+				return cb.and(list.toArray(new Predicate[] {}));
+			}
+		};
+		SinglePageRequest pageRequest = new SinglePageRequest(pageCount, n, "desc",
+				"id");
+		Page<DcZxjcEntity> page = zxjcService.findAll(spec, pageRequest);
+		if (page == null || page.getTotalPages() <= pageCount) {
+			return new ArrayList<DcZxjcEntity>();
+		}
+		for (DcZxjcEntity dcZxjcEntity : page) {
+			if (dcZxjcEntity.getDcList() != null
+					&& dcZxjcEntity.getDcList().size() > 0) {
+				dcZxjcEntity.getDcList().get(0);
+			}
+			int zgs = 0;
+			double zgzj = 0.0;
+			List<DcEntity> dclist = dcZxjcEntity.getDcList();
+			for (DcEntity dcEntity : dclist) {
+				if (dcEntity.getMqzt().equals("1")) {
+					zgs += 1;
+				}
+				zgzj += (dcEntity.getZgtrzj() == null ? 0.0 : dcEntity
+						.getZgtrzj());
+			}
+			String zgl = "";
+			if (dcZxjcEntity.getDcList() == null
+					|| dcZxjcEntity.getDcList().size() <= 0) {
+
+			} else {
+				BigDecimal bg = new BigDecimal((double) zgs
+						/ dcZxjcEntity.getDcList().size());
+				zgl = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()
+						* 100 + "%";
+			}
+			dcZxjcEntity.setYhs(dcZxjcEntity.getDcList().size());
+			dcZxjcEntity.setZgs(zgs);
+			dcZxjcEntity.setZgl(zgl);
+			dcZxjcEntity.setZgzj(zgzj);
+		}
+		return page.getContent();
+	}
+	
+	/**
+	 * 获取可选的公告
+	 * @param title
+	 * @param lkr
+	 * @return
+	 */
+	public List<GgEntity> listNeed(String title, String lkr) {
+		return ggService.queryNeed(title, lkr);
+	}
+	
+	/**
+	 * 保存专项检查 
+	 * @param entity
+	 * @param ggEntity
+	 * @return
+	 */
+	public DcZxjcEntity saveZxjc(DcZxjcEntity entity, GgEntity ggEntity) {
+		if (null == entity.getId() || entity.getId().equals(0l)) {
+			entity.setAddDate(new Date());
+			entity.setAddUser(Utils.getWebServiceUser());
+			// 行政人员
+			entity.setRecordCode("100100100100");
+		} else {
+			DcZxjcEntity vo = zxjcService.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());
+		}
+		entity = zxjcService.save(entity);
+		ggEntity = ggService.findById(ggEntity.getId());
+		// 同步
+		zxjcService.sync(entity, ggEntity);
+		return entity;
+	}
+
 }