|
@@ -59,6 +59,7 @@ import com.jtgh.yjpt.entity.common.CodeEntity;
|
|
|
import com.jtgh.yjpt.entity.gkgq.GqEntity;
|
|
|
import com.jtgh.yjpt.entity.gkgq.MtEntity;
|
|
|
import com.jtgh.yjpt.entity.jyr.BwEntity;
|
|
|
+import com.jtgh.yjpt.entity.jyr.CgqEntity;
|
|
|
import com.jtgh.yjpt.entity.jyr.GkwhccssEntity;
|
|
|
import com.jtgh.yjpt.entity.jyr.GkwhqyCountEntity;
|
|
|
import com.jtgh.yjpt.entity.jyr.JyrCountEntity;
|
|
@@ -74,6 +75,7 @@ import com.jtgh.yjpt.entity.jyrxxgl.JyrtzqkEntity;
|
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
|
|
|
import com.jtgh.yjpt.entity.zyfzndjy.GkwxhwzyfzblFzEntity;
|
|
|
import com.jtgh.yjpt.service.common.CodeService;
|
|
|
+import com.jtgh.yjpt.service.jyr.CgqService;
|
|
|
import com.jtgh.yjpt.service.jyr.JyrNsService;
|
|
|
import com.jtgh.yjpt.service.jyr.JyrService;
|
|
|
|
|
@@ -99,6 +101,8 @@ public class JyrController extends BaseController {
|
|
|
private CodeService codeService;
|
|
|
@Autowired
|
|
|
private JyrNsService nsService;
|
|
|
+ @Autowired
|
|
|
+ private CgqService cgqService;
|
|
|
|
|
|
/**
|
|
|
* 页面一览查询
|
|
@@ -174,17 +178,17 @@ public class JyrController extends BaseController {
|
|
|
}
|
|
|
list.add(cb.like(root.get("gkjyr").as(String.class), "%"
|
|
|
+ gkjyr + "%"));
|
|
|
- if (sfwhqy != null
|
|
|
- && StringUtils.isNotEmpty(sfwhqy.trim())) {
|
|
|
- if("YW".equals(sfwhqy)) {
|
|
|
+ if (sfwhqy != null && StringUtils.isNotEmpty(sfwhqy.trim())) {
|
|
|
+ if ("YW".equals(sfwhqy)) {
|
|
|
list.add(cb.or(new Predicate[] {
|
|
|
- cb.equal(root.get("sfwhqy").as(String.class),
|
|
|
- "Y"),cb.equal(root.get("sfwhqy").as(String.class),
|
|
|
- "W")
|
|
|
- }));
|
|
|
+ cb.equal(root.get("sfwhqy")
|
|
|
+ .as(String.class), "Y"),
|
|
|
+ cb.equal(root.get("sfwhqy")
|
|
|
+ .as(String.class), "W") }));
|
|
|
} else {
|
|
|
- list.add(cb.equal(root.get("sfwhqy").as(String.class),
|
|
|
- sfwhqy));
|
|
|
+ list.add(cb
|
|
|
+ .equal(root.get("sfwhqy").as(String.class),
|
|
|
+ sfwhqy));
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(szqy)) {
|
|
@@ -252,7 +256,7 @@ public class JyrController extends BaseController {
|
|
|
@Log(Type.QUERY)
|
|
|
public BusinessContext doSearch(Long functionId,
|
|
|
SinglePageRequest pageRequest, String gkjyr, CodeEntity szd,
|
|
|
- GqEntity szgq ,String sfzdsp) {
|
|
|
+ GqEntity szgq, String sfzdsp) {
|
|
|
|
|
|
List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
addNotEmptyModel(filterList, "gkjyr", gkjyr.trim(), Operator.LIKE);
|
|
@@ -346,9 +350,11 @@ public class JyrController extends BaseController {
|
|
|
public BusinessContext doAdd(Long functionId, JyrEntity jyrEntity,
|
|
|
List<JyrdcxxEntity> dc_add_list, List<JyrdcxxEntity> dc_del_list,
|
|
|
List<BwEntity> bw_add_list, List<BwEntity> bw_del_list,
|
|
|
- List<JyrckxxEntity> ckList, List<JyrckxxEntity> delCkList) {
|
|
|
+ List<JyrckxxEntity> ckList, List<JyrckxxEntity> delCkList,
|
|
|
+ List<CgqEntity> cgq_add_list, List<CgqEntity> cgq_del_list) {
|
|
|
return save(functionId, jyrEntity, dc_add_list, dc_del_list,
|
|
|
- bw_add_list, bw_del_list, ckList, delCkList);
|
|
|
+ bw_add_list, bw_del_list, ckList, delCkList, cgq_add_list,
|
|
|
+ cgq_del_list);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -370,9 +376,11 @@ public class JyrController extends BaseController {
|
|
|
public BusinessContext doEdit(Long functionId, JyrEntity jyrEntity,
|
|
|
List<JyrdcxxEntity> dc_add_list, List<JyrdcxxEntity> dc_del_list,
|
|
|
List<BwEntity> bw_add_list, List<BwEntity> bw_del_list,
|
|
|
- List<JyrckxxEntity> ckList, List<JyrckxxEntity> delCkList) {
|
|
|
+ List<JyrckxxEntity> ckList, List<JyrckxxEntity> delCkList,
|
|
|
+ List<CgqEntity> cgq_add_list, List<CgqEntity> cgq_del_list) {
|
|
|
return save(functionId, jyrEntity, dc_add_list, dc_del_list,
|
|
|
- bw_add_list, bw_del_list, ckList, delCkList);
|
|
|
+ bw_add_list, bw_del_list, ckList, delCkList, cgq_add_list,
|
|
|
+ cgq_del_list);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -391,7 +399,8 @@ public class JyrController extends BaseController {
|
|
|
private BusinessContext save(Long functionId, JyrEntity jyrEntity,
|
|
|
List<JyrdcxxEntity> dc_add_list, List<JyrdcxxEntity> dc_del_list,
|
|
|
List<BwEntity> bw_add_list, List<BwEntity> bw_del_list,
|
|
|
- List<JyrckxxEntity> ckList, List<JyrckxxEntity> delCkList) {
|
|
|
+ List<JyrckxxEntity> ckList, List<JyrckxxEntity> delCkList,
|
|
|
+ List<CgqEntity> cgq_add_list, List<CgqEntity> cgq_del_list) {
|
|
|
BusinessContext bContext = new BusinessContext();
|
|
|
if (jyrEntity.getId() == null) {
|
|
|
jyrEntity.setAddDate(new Date());
|
|
@@ -412,7 +421,8 @@ public class JyrController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
jyrEntity = service.save(jyrEntity, dc_add_list, dc_del_list,
|
|
|
- bw_add_list, bw_del_list, ckList, delCkList);
|
|
|
+ bw_add_list, bw_del_list, ckList, delCkList, cgq_add_list,
|
|
|
+ cgq_del_list);
|
|
|
// 同步
|
|
|
try {
|
|
|
service.tbWebService(jyrEntity, dc_add_list, dc_del_list,
|
|
@@ -553,7 +563,7 @@ public class JyrController extends BaseController {
|
|
|
Specification<JyrEntity> spec = SpecificationCreater
|
|
|
.searchByPredicateModels(filterList);
|
|
|
Sort sort2 = new Sort(Direction.ASC, "gkjyr");
|
|
|
- list.addAll(service.findAll(spec,sort2)) ;
|
|
|
+ list.addAll(service.findAll(spec, sort2));
|
|
|
}
|
|
|
bc.setResult(list);
|
|
|
return bc;
|
|
@@ -579,7 +589,7 @@ public class JyrController extends BaseController {
|
|
|
Specification<JyrEntity> spec = SpecificationCreater
|
|
|
.searchByPredicateModels(filterList);
|
|
|
Sort sort2 = new Sort(Direction.ASC, "gkjyr");
|
|
|
- list.addAll(service.findAll(spec,sort2)) ;
|
|
|
+ list.addAll(service.findAll(spec, sort2));
|
|
|
bc.setResult(list);
|
|
|
return bc;
|
|
|
}
|
|
@@ -605,7 +615,7 @@ public class JyrController extends BaseController {
|
|
|
Specification<JyrEntity> spec = SpecificationCreater
|
|
|
.searchByPredicateModels(filterList);
|
|
|
Sort sort2 = new Sort(Direction.ASC, "gkjyr");
|
|
|
- list.addAll(service.findAll(spec,sort2)) ;
|
|
|
+ list.addAll(service.findAll(spec, sort2));
|
|
|
}
|
|
|
bc.setResult(list);
|
|
|
return bc;
|
|
@@ -635,7 +645,7 @@ public class JyrController extends BaseController {
|
|
|
Specification<JyrEntity> spec = SpecificationCreater
|
|
|
.searchByPredicateModels(filterList);
|
|
|
Sort sort2 = new Sort(Direction.ASC, "gkjyr");
|
|
|
- list.addAll(service.findAll(spec,sort2)) ;
|
|
|
+ list.addAll(service.findAll(spec, sort2));
|
|
|
}
|
|
|
bc.setResult(list);
|
|
|
return bc;
|
|
@@ -671,7 +681,7 @@ public class JyrController extends BaseController {
|
|
|
.searchByPredicateModels(filterList);
|
|
|
List<JyrEntity> list = new ArrayList<JyrEntity>();
|
|
|
Sort sort2 = new Sort(Direction.ASC, "gkjyr");
|
|
|
- list.addAll(service.findAll(spec,sort2)) ;
|
|
|
+ list.addAll(service.findAll(spec, sort2));
|
|
|
bc.setResult(list);
|
|
|
return bc;
|
|
|
}
|
|
@@ -695,7 +705,7 @@ public class JyrController extends BaseController {
|
|
|
.searchByPredicateModels(filterList);
|
|
|
List<JyrEntity> list = new ArrayList<JyrEntity>();
|
|
|
Sort sort2 = new Sort(Direction.ASC, "gkjyr");
|
|
|
- list.addAll(service.findAll(spec,sort2)) ;
|
|
|
+ list.addAll(service.findAll(spec, sort2));
|
|
|
bc.setResult(list);
|
|
|
return bc;
|
|
|
}
|
|
@@ -1043,15 +1053,16 @@ public class JyrController extends BaseController {
|
|
|
+ param.get(0).toString() + "%"));
|
|
|
if (null != param.get(3)
|
|
|
&& !"null".equals(param.get(3).toString())) {
|
|
|
- if("YW".equals(param.get(3).toString())) {
|
|
|
+ if ("YW".equals(param.get(3).toString())) {
|
|
|
list.add(cb.or(new Predicate[] {
|
|
|
- cb.equal(root.get("sfwhqy").as(String.class),
|
|
|
- "Y"),cb.equal(root.get("sfwhqy").as(String.class),
|
|
|
- "W")
|
|
|
- }));
|
|
|
+ cb.equal(root.get("sfwhqy")
|
|
|
+ .as(String.class), "Y"),
|
|
|
+ cb.equal(root.get("sfwhqy")
|
|
|
+ .as(String.class), "W") }));
|
|
|
} else {
|
|
|
- list.add(cb.equal(root.get("sfwhqy").as(String.class),
|
|
|
- param.get(3).toString()));
|
|
|
+ list.add(cb.equal(
|
|
|
+ root.get("sfwhqy").as(String.class), param
|
|
|
+ .get(3).toString()));
|
|
|
}
|
|
|
}
|
|
|
if (null != param.get(5)
|
|
@@ -1443,7 +1454,6 @@ public class JyrController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 自动设置一览
|
|
|
*
|
|
@@ -1452,24 +1462,23 @@ public class JyrController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@Log(Type.QUERY)
|
|
|
- public BusinessContext saveZdspsj( CodeEntity szd,
|
|
|
- GqEntity szgq ,String gkjyr,Date zdspsjq,Date zdspsjz) {
|
|
|
- BusinessContext bContext=new BusinessContext();
|
|
|
+ public BusinessContext saveZdspsj(CodeEntity szd, GqEntity szgq,
|
|
|
+ String gkjyr, Date zdspsjq, Date zdspsjz) {
|
|
|
+ BusinessContext bContext = new BusinessContext();
|
|
|
List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
addNotEmptyModel(filterList, "gkjyr", gkjyr.trim(), Operator.LIKE);
|
|
|
if (szd != null)
|
|
|
addNotEmptyModel(filterList, "szd.id", szd.getId(), Operator.LIKE_R);
|
|
|
addNotEmptyModel(filterList, "szgq", szgq, Operator.EQ);
|
|
|
- addNotEmptyModel(filterList, "sfzdsp",
|
|
|
- "Y", Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "sfzdsp", "Y", Operator.EQ);
|
|
|
addNotEmptyModel(filterList, "recordStatus",
|
|
|
BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
addNotEmptyModel(filterList, "recordStatus",
|
|
|
BaseEntity.RECORD_STATE_DRAFT, Operator.NEQ);
|
|
|
Specification<JyrEntity> spec = SpecificationCreater
|
|
|
.searchByPredicateModels(filterList);
|
|
|
- List<JyrEntity> list = service.findAll(spec);
|
|
|
- for (JyrEntity entity:list) {
|
|
|
+ List<JyrEntity> list = service.findAll(spec);
|
|
|
+ for (JyrEntity entity : list) {
|
|
|
entity.setZdspsjq(zdspsjq);
|
|
|
entity.setZdspsjz(zdspsjz);
|
|
|
entity = service.save(entity);
|
|
@@ -1480,10 +1489,10 @@ public class JyrController extends BaseController {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- bContext.addMsg("save.success", "common", MsgLevel.INFO);
|
|
|
+ bContext.addMsg("save.success", "common", MsgLevel.INFO);
|
|
|
return bContext;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 公告一览表
|
|
|
*
|
|
@@ -1494,8 +1503,7 @@ public class JyrController extends BaseController {
|
|
|
@Log(Type.QUERY)
|
|
|
public BusinessContext listForGg(final Long functionId,
|
|
|
SinglePageRequest pageRequest, final String gkjyr,
|
|
|
- final CodeEntity szd, final GqEntity szgq,
|
|
|
- final String fddbr) {
|
|
|
+ final CodeEntity szd, final GqEntity szgq, final String fddbr) {
|
|
|
try {
|
|
|
Specification<JyrEntity> spec = new Specification<JyrEntity>() {
|
|
|
|
|
@@ -1521,7 +1529,7 @@ public class JyrController extends BaseController {
|
|
|
}
|
|
|
list.add(cb.like(root.get("gkjyr").as(String.class), "%"
|
|
|
+ gkjyr + "%"));
|
|
|
-
|
|
|
+
|
|
|
list.add(cb.like(root.get("fddbr").as(String.class), "%"
|
|
|
+ fddbr + "%"));
|
|
|
list = Utils.setWorkflowSpec(list, cb, query, root, null);
|
|
@@ -1535,4 +1543,54 @@ public class JyrController extends BaseController {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有储罐区
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public BusinessContext listAllCgq() {
|
|
|
+ BusinessContext bc = createBusinessContext();
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DRAFT, Operator.NEQ);
|
|
|
+ List<CgqEntity> list = new ArrayList<CgqEntity>();
|
|
|
+ // 经营人只能查询自己的记录
|
|
|
+ if (Constants.YES.equals(Utils.getCurrentUser().getSfjyr())
|
|
|
+ && Utils.getCurrentUser().getJyrjcxx() != null) {
|
|
|
+ addNotEmptyModel(filterList, "dwmc", Utils.getCurrentUser()
|
|
|
+ .getJyrjcxx(), Operator.EQ);
|
|
|
+ } else {
|
|
|
+ Specification<CgqEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ Sort sort2 = new Sort(Direction.ASC, "cgqmc");
|
|
|
+ list.addAll(cgqService.findAll(spec, sort2));
|
|
|
+ }
|
|
|
+ bc.setResult(list);
|
|
|
+ return bc;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取所有储罐区
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public BusinessContext listAllCgq(JyrEntity jyr) {
|
|
|
+ BusinessContext bc = createBusinessContext();
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DRAFT, Operator.NEQ);
|
|
|
+ List<CgqEntity> list = new ArrayList<CgqEntity>();
|
|
|
+ addNotEmptyModel(filterList, "dwmc", jyr, Operator.EQ);
|
|
|
+ Specification<CgqEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ Sort sort2 = new Sort(Direction.ASC, "cgqmc");
|
|
|
+ list.addAll(cgqService.findAll(spec, sort2));
|
|
|
+ bc.setResult(list);
|
|
|
+ return bc;
|
|
|
+ }
|
|
|
}
|