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