|
@@ -139,29 +139,24 @@ public class CgxxglWebService extends BaseController {
|
|
|
* @param cgmc
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<CgEntity> findCgByParams(final Long szd, final Long szgq,
|
|
|
- final Long gkjyr, final String cgmc) {
|
|
|
+ public List<CgEntity> findCgByParams(final Long szd, final Long szgq,final Long gkjyr, final String cgmc) {
|
|
|
List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE_R);
|
|
|
addNotEmptyModel(filterList, "gq", szgq, Operator.EQ);
|
|
|
addNotEmptyModel(filterList, "dwmc", gkjyr, Operator.EQ);
|
|
|
addNotEmptyModel(filterList, "cgmc", cgmc, Operator.LIKE);
|
|
|
- addNotEmptyModel(filterList, "recordStatus",
|
|
|
- BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
if (Utils.getWebServiceUser() != null) {
|
|
|
UserEntity user = Utils.getWebServiceUser();
|
|
|
// 经营人只能查自己的
|
|
|
- if (Constants.YES.equals(user.getSfjyr())
|
|
|
- && user.getJyrjcxx() != null) {
|
|
|
- addNotEmptyModel(filterList, "dwmc", user.getJyrjcxx(),
|
|
|
- Operator.EQ);
|
|
|
+ if (Constants.YES.equals(user.getSfjyr()) && user.getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "dwmc", user.getJyrjcxx(),Operator.EQ);
|
|
|
} else {
|
|
|
// 行政人员根据权限过滤(储罐列表菜单ID=26)
|
|
|
addRecordCodeFilter(19l, filterList);
|
|
|
}
|
|
|
}
|
|
|
- Specification<CgEntity> spec = SpecificationCreater
|
|
|
- .searchByPredicateModels(filterList);
|
|
|
+ Specification<CgEntity> spec = SpecificationCreater.searchByPredicateModels(filterList);
|
|
|
List<CgEntity> list = cgService.findAll(spec);
|
|
|
for (CgEntity vo : list) {
|
|
|
// 检索储罐状态
|
|
@@ -208,6 +203,11 @@ public class CgxxglWebService extends BaseController {
|
|
|
if (list == null || list.getTotalPages() <= pageCount) {
|
|
|
return new ArrayList<CgEntity>();
|
|
|
}
|
|
|
+ for (CgEntity vo : list) {
|
|
|
+ // 检索储罐状态
|
|
|
+ vo.setCgzt(cgztService.findByCg(vo));
|
|
|
+ vo.setCgsy(cgsyService.findByCg(vo));
|
|
|
+ }
|
|
|
return list.getContent();
|
|
|
}
|
|
|
|
|
@@ -242,8 +242,7 @@ public class CgxxglWebService extends BaseController {
|
|
|
* @param tbsj2
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<CgztEntity> findCgztByParams(CgEntity entity, String hz,
|
|
|
- Date tbsj1, Date tbsj2) {
|
|
|
+ public List<CgztEntity> findCgztByParams(CgEntity entity, String hz, Date tbsj1, Date tbsj2) {
|
|
|
List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
// 所属储罐
|
|
|
addNotEmptyModel(filterList, "cg", entity.getId(), Operator.EQ);
|
|
@@ -251,17 +250,13 @@ public class CgxxglWebService extends BaseController {
|
|
|
addNotEmptyModel(filterList, "hz", hz, Operator.LIKE);
|
|
|
// 填报时间
|
|
|
if (tbsj1 != null) {
|
|
|
- addNotEmptyModel(filterList, "tbsj", Utils.getDateFirstTime(tbsj1),
|
|
|
- Operator.GTE);
|
|
|
+ addNotEmptyModel(filterList, "tbsj", Utils.getDateFirstTime(tbsj1),Operator.GTE);
|
|
|
}
|
|
|
if (tbsj2 != null) {
|
|
|
- addNotEmptyModel(filterList, "tbsj", Utils.getDateLastTime(tbsj2),
|
|
|
- Operator.LTE);
|
|
|
+ addNotEmptyModel(filterList, "tbsj", Utils.getDateLastTime(tbsj2),Operator.LTE);
|
|
|
}
|
|
|
- addNotEmptyModel(filterList, "recordStatus",
|
|
|
- BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
- Specification<CgztEntity> spec = SpecificationCreater
|
|
|
- .searchByPredicateModels(filterList);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ Specification<CgztEntity> spec = SpecificationCreater.searchByPredicateModels(filterList);
|
|
|
List<CgztEntity> list = cgztService.findAll(spec);
|
|
|
return list;
|
|
|
}
|
|
@@ -343,15 +338,12 @@ public class CgxxglWebService extends BaseController {
|
|
|
public List<CgEntity> findCgByJyrs(final List<Long> jyrs) {
|
|
|
List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
addNotEmptyModel(filterList, "dwmc", jyrs, Operator.IN);
|
|
|
- addNotEmptyModel(filterList, "recordStatus",
|
|
|
- BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
if (Utils.getWebServiceUser() != null) {
|
|
|
UserEntity user = Utils.getWebServiceUser();
|
|
|
// 经营人只能查自己的
|
|
|
- if (Constants.YES.equals(user.getSfjyr())
|
|
|
- && user.getJyrjcxx() != null) {
|
|
|
- addNotEmptyModel(filterList, "dwmc", user.getJyrjcxx(),
|
|
|
- Operator.EQ);
|
|
|
+ if (Constants.YES.equals(user.getSfjyr()) && user.getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "dwmc", user.getJyrjcxx(),Operator.EQ);
|
|
|
} else {
|
|
|
// 行政人员根据权限过滤(储罐列表菜单ID=26)
|
|
|
addRecordCodeFilter(19l, filterList);
|