Browse Source

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

xt_xuhao 8 years ago
parent
commit
017626e827

+ 3 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/bagl/aqpjjgba/AqpjjgryEntity.java

@@ -30,6 +30,9 @@ import com.jtgh.yjpt.entity.BaseEntity;
 @Entity
 @Table(name = "T_YJPT_AQPJJGRY")
 public class AqpjjgryEntity extends BaseEntity<Long> {
+	
+	private static final long serialVersionUID = -9074017281209390868L;
+	
 	/** ID主键 */
 	private Long id = null;
 	/** 所属机构 */

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/yjzyxxgl/GkqyxxwhEntity.java

@@ -31,6 +31,8 @@ import com.jtgh.yjpt.entity.BaseEntity;
 @Entity
 @Table(name = "T_YJPT_GKQY")
 public class GkqyxxwhEntity extends BaseEntity<Long> {
+	 
+	private static final long serialVersionUID = 2105299436932043595L;
 	/** ID主键 */
 	private Long id = null;
 	/** 姓名 */

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/yjzyxxgl/SxxgyjdwxxwhEntity.java

@@ -30,6 +30,8 @@ import com.jtgh.yjpt.entity.BaseEntity;
 @Entity
 @Table(name = "T_YJPT_SXXGYJDWXX")
 public class SxxgyjdwxxwhEntity extends BaseEntity<Long> {
+	 
+	private static final long serialVersionUID = 1552117965882704802L;
 	/** ID主键 */
 	private Long id = null;
 	/** 企业名称 */

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/yjzyxxgl/XgjyxxwhEntity.java

@@ -31,6 +31,8 @@ import com.jtgh.yjpt.entity.BaseEntity;
 @Entity
 @Table(name = "T_YJPT_XGJY")
 public class XgjyxxwhEntity extends BaseEntity<Long> {
+	 
+	private static final long serialVersionUID = 67752539678579147L;
 	/** ID主键 */
 	private Long id = null;
 	/** 应急信息ID */

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/yjzyxxgl/YjjyzbxxEntity.java

@@ -18,6 +18,8 @@ import com.jtgh.yjpt.entity.BaseEntity;
 @Entity
 @Table(name = "T_YJPT_YJJYZBXX")
 public class YjjyzbxxEntity extends BaseEntity<Long> {
+	 
+	private static final long serialVersionUID = -2041390577023566793L;
 	/** ID */
 	private Long id = null;
 	/** 装备编号 */

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/yjzyxxgl/YjlxxxwhEntity.java

@@ -32,6 +32,8 @@ import com.jtgh.yjpt.entity.BaseEntity;
 @Entity
 @Table(name = "T_YJPT_SXXGYJDWCYXX")
 public class YjlxxxwhEntity extends BaseEntity<Long> {
+	 
+	private static final long serialVersionUID = 3359836626300604867L;
 	/** ID主键 */
 	private Long id = null;
 	/** 所属队伍	*/

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/entity/zyfzndjy/SqxkfwEntity.java

@@ -20,6 +20,8 @@ import com.jtgh.yjpt.entity.BaseEntity;
 @Entity
 @Table(name = "T_YJPT_SQXKFW")
 public class SqxkfwEntity extends BaseEntity<Long> {
+	 
+	private static final long serialVersionUID = 6480187653822773744L;
 	
 	private Long id;// ID
 	private Long sqxkfwid;//申请许可范围ID

+ 4 - 9
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/zysqbp/ZysqbpServiceImpl.java

@@ -66,10 +66,8 @@ import com.jtgh.yjpt.service.zysqbp.ZysqbpService;
 import com.yjpt.util.DateUtil;
 
 @Service
-public class ZysqbpServiceImpl extends
-		BaseWorkFlowServiceImpl<ZysqbpEntity, Long> implements ZysqbpService {
-	private final static Logger LOGGER = Logger
-			.getLogger(ZysqbpServiceImpl.class);
+public class ZysqbpServiceImpl extends BaseWorkFlowServiceImpl<ZysqbpEntity, Long> implements ZysqbpService {
+	private final static Logger LOGGER = Logger.getLogger(ZysqbpServiceImpl.class);
 	@Autowired
 	private ZysqbpDao zysqbpDao;
 	@Autowired
@@ -232,15 +230,12 @@ public class ZysqbpServiceImpl extends
 
 	@Override
 	public <S extends ZysqbpEntity> S submit(String currentRoleCode, S data) {
-		String url =Thread.currentThread().getStackTrace()[2].getClassName()
-				+ "."
-				+ "submit";
+		String url =Thread.currentThread().getStackTrace()[2].getClassName() + "." + "submit";
 		
 		String zyddString;
 
 		if (data.getZyddqybh() != null)
-			zyddString = data.getZyddqybh().getQynbmc() != null ? data
-					.getZyddqybh().getQynbmc() : "";
+			zyddString = data.getZyddqybh().getQynbmc() != null ? data.getZyddqybh().getQynbmc() : "";
 		else {
 			zyddString = data.getZyddqt() != null ? data.getZyddqt() : "";
 		}

+ 0 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/yjzyxxgl/GkqyxxwhService.java

@@ -8,7 +8,6 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.domain.Specification;
 
-import com.jtgh.yjpt.entity.auth.RoleEntity;
 import com.jtgh.yjpt.entity.yjzyxxgl.GkqyxxwhEntity;
 
 public interface GkqyxxwhService {

+ 27 - 2
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zcdc/zc/ZczbWebService.java

@@ -618,13 +618,38 @@ public class ZczbWebService extends BaseController {
 		
 		Page<ZcyhEntity> pageContent = zcyhService.findAll(spec, page);
 		
-		if (pageContent == null || pageContent.getTotalPages() <= pageNum) {
+		if (pageContent == null || pageContent.getTotalPages() <= pageNum) { 
 			return new ArrayList<ZcyhEntity>();
 		}
-		
+		 
 		return pageContent.getContent();
 	}
 	
+	
+	/**
+	 * 获得根据储罐获取自查隐患列表数据总条数  
+	 * @param cgId
+	 * @return
+	 */
+	public Long countZcyhByCg(long cgId){
+		SinglePageRequest page = new SinglePageRequest(0, 10, "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);
+		
+		Long totalElements = pageContent.getTotalElements();
+		 
+		return totalElements;
+	}
+	
 	/**
 	 * 根据自查隐患的Id获得entity
 	 * @param zcyhId

+ 37 - 38
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zysqbp/WhsqbpWebService.java

@@ -16,6 +16,11 @@ import javax.jws.WebService;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.domain.Sort.Direction;
+import org.springframework.data.domain.Sort.Order;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -237,52 +242,55 @@ public class WhsqbpWebService extends BaseController {
 		// 报告时间
 		try {
 			if (!StringUtils.isEmpty(bgsj1))
-				addNotEmptyModel(filterList, "bgsj",
-						Utils.getDateFirstTime(sdf.parse(bgsj1)), Operator.GTE);
+				addNotEmptyModel(filterList, "bgsj",Utils.getDateFirstTime(sdf.parse(bgsj1)), Operator.GTE);
 			if (!StringUtils.isEmpty(bgsj2))
-				addNotEmptyModel(filterList, "bgsj",
-						Utils.getDateLastTime(sdf.parse(bgsj2)), Operator.LTE);
+				addNotEmptyModel(filterList, "bgsj",Utils.getDateLastTime(sdf.parse(bgsj2)), Operator.LTE);
 			// 开工时间
 			if (!StringUtils.isEmpty(kgsj1))
-				addNotEmptyModel(filterList, "kgsj",
-						Utils.getDateFirstTime(sdf.parse(kgsj1)), Operator.GTE);
+				addNotEmptyModel(filterList, "kgsj",Utils.getDateFirstTime(sdf.parse(kgsj1)), Operator.GTE);
 			if (!StringUtils.isEmpty(kgsj2))
-				addNotEmptyModel(filterList, "kgsj",
-						Utils.getDateLastTime(sdf.parse(kgsj2)), Operator.LTE);
+				addNotEmptyModel(filterList, "kgsj",Utils.getDateLastTime(sdf.parse(kgsj2)), Operator.LTE);
 			// 完工时间
 			if (!StringUtils.isEmpty(wgsj1))
-				addNotEmptyModel(filterList, "wgsj",
-						Utils.getDateFirstTime(sdf.parse(wgsj1)), Operator.GTE);
+				addNotEmptyModel(filterList, "wgsj",Utils.getDateFirstTime(sdf.parse(wgsj1)), Operator.GTE);
 			if (!StringUtils.isEmpty(wgsj2))
-				addNotEmptyModel(filterList, "wgsj",
-						Utils.getDateLastTime(sdf.parse(wgsj2)), Operator.LTE);
+				addNotEmptyModel(filterList, "wgsj",Utils.getDateLastTime(sdf.parse(wgsj2)), Operator.LTE);
 		} catch (ParseException e) {
 			e.printStackTrace();
 		}
 		if (Utils.getWebServiceUser() != null) {
 			UserEntity user = Utils.getWebServiceUser();
 			// 经营人只能查自己的
-			if (Constants.YES.equals(user.getSfjyr())
-					&& user.getJyrjcxx() != null) {
-				addNotEmptyModel(filterList, "zydw", user.getJyrjcxx(),
-						Operator.EQ);
+			if (Constants.YES.equals(user.getSfjyr()) && user.getJyrjcxx() != null) {
+				addNotEmptyModel(filterList, "zydw", user.getJyrjcxx(),Operator.EQ);
 			} else {
 				// 行政人员根据权限过滤(危货列表菜单ID=26)
 				addRecordCodeFilter(26l, filterList);
+				//行政人员排除掉草稿状态的数据
 				addNotEmptyModel(filterList, "recordStatus", BaseEntity.RECORD_STATE_VALID, Operator.NEQ);
 			}
 		}
 		Specification<ZysqbpEntity> spec = SpecificationCreater.searchByPredicateModels(filterList);
-		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc","bgsj");
 		
-		 
+		//分页
+		//SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc","bgsj");
+		//Sort sort= new Sort(Direction.DESC,"bgsj","recordStatus");
+		List<Order> orders = new ArrayList<Order>();
+		orders.add(new Order(Direction.DESC,"recordStatus"));
+		orders.add(new Order(Direction.DESC,"bgsj"));
+		Pageable page = new PageRequest(pageCount,n,new Sort(orders));
 		
 		Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
 		if (list == null || list.getTotalPages() < pageCount) {
 			return new ArrayList<ZysqbpEntity>();
 		}
+		
 		return list.getContent();
 	}
+	
+	
+	
+	
 
 	public WxhwpmEntity getWxhwpmByBh(String wxhwpmBh) {
 		List<WxhwpmEntity> whList = wxhwpmService.queryByBh(wxhwpmBh);
@@ -966,22 +974,17 @@ public class WhsqbpWebService extends BaseController {
 	 * @param pageCount
 	 * @return
 	 */
-	public List<ZysqbpEntity> getZysqbpPageListByCb(String cm, int n,
-			int pageCount) {
+	public List<ZysqbpEntity> getZysqbpPageListByCb(String cm, int n,int pageCount) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		List<PredicateModel> recordList = new ArrayList<PredicateModel>();
 		// 只检索已完成和变更已完成的数据
-		addNotEmptyModel(recordList, "recordStatus",
-				BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
-		addNotEmptyModel(recordList, "recordStatus",
-				BaseEntity.RECORD_STATE_COMPLETED, Operator.EQ);
+		addNotEmptyModel(recordList, "recordStatus",BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
+		addNotEmptyModel(recordList, "recordStatus",BaseEntity.RECORD_STATE_COMPLETED, Operator.EQ);
 		filterList.add(new PredicateModel(JoinType.OR, recordList));
 		// 根据船名
 		addNotEmptyModel(filterList, "cm", cm, Operator.EQ);
-		Specification<ZysqbpEntity> spec = SpecificationCreater
-				.searchByPredicateModels(filterList);
-		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
-				"bgsj");
+		Specification<ZysqbpEntity> spec = SpecificationCreater.searchByPredicateModels(filterList);
+		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc","bgsj");
 		Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
 		if (list == null || list.getTotalPages() < pageCount) {
 			return new ArrayList<ZysqbpEntity>();
@@ -1002,19 +1005,14 @@ public class WhsqbpWebService extends BaseController {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		List<PredicateModel> recordList = new ArrayList<PredicateModel>();
 		// 只检索已完成和变更已完成的数据
-		addNotEmptyModel(recordList, "recordStatus",
-				BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
-		addNotEmptyModel(recordList, "recordStatus",
-				BaseEntity.RECORD_STATE_COMPLETED, Operator.EQ);
+		addNotEmptyModel(recordList, "recordStatus",BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
+		addNotEmptyModel(recordList, "recordStatus",BaseEntity.RECORD_STATE_COMPLETED, Operator.EQ);
 		filterList.add(new PredicateModel(JoinType.OR, recordList));
 		// 根据泊位,只查询泊位
-		addNotEmptyModel(filterList, "zyddqybh.qynbbh", entity.getId(),
-				Operator.EQ);
+		addNotEmptyModel(filterList, "zyddqybh.qynbbh", entity.getId(),Operator.EQ);
 		addNotEmptyModel(filterList, "zydd.id", "10000501", Operator.EQ);
-		Specification<ZysqbpEntity> spec = SpecificationCreater
-				.searchByPredicateModels(filterList);
-		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
-				"bgsj");
+		Specification<ZysqbpEntity> spec = SpecificationCreater.searchByPredicateModels(filterList);
+		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc","bgsj");
 		Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
 		if (list == null || list.getTotalPages() < pageCount) {
 			return new ArrayList<ZysqbpEntity>();
@@ -1138,6 +1136,7 @@ public class WhsqbpWebService extends BaseController {
 		// 所属储罐
 		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));