|
@@ -70,6 +70,7 @@ import com.jtgh.yjpt.entity.ireport.aqsp.WxhwzysqVo;
|
|
|
import com.jtgh.yjpt.entity.jlrxxgl.GlzdxxEntity;
|
|
|
import com.jtgh.yjpt.entity.jyr.JyrEntity;
|
|
|
import com.jtgh.yjpt.entity.jyrxxgl.RyjbxxEntity;
|
|
|
+import com.jtgh.yjpt.entity.task.Gztx;
|
|
|
import com.jtgh.yjpt.entity.yjgl.YjyaEntity;
|
|
|
import com.jtgh.yjpt.entity.yjzyxxgl.YjwzFlxxEntity;
|
|
|
import com.jtgh.yjpt.entity.zyfzhz.GkwxhwzyfzhzEntity;
|
|
@@ -82,6 +83,7 @@ import com.jtgh.yjpt.service.common.CodeService;
|
|
|
import com.jtgh.yjpt.service.jlrxxgl.GlzdxxService;
|
|
|
import com.jtgh.yjpt.service.jyr.JyrService;
|
|
|
import com.jtgh.yjpt.service.jyrxxgl.RyjbxxService;
|
|
|
+import com.jtgh.yjpt.service.task.TaskService;
|
|
|
import com.jtgh.yjpt.service.yjgl.YjyaService;
|
|
|
import com.jtgh.yjpt.service.yjzyxxgl.YjwzFlxxService;
|
|
|
import com.jtgh.yjpt.service.zyfzndjy.GkfzzbService;
|
|
@@ -123,32 +125,74 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
private YjwzFlxxService wzService;
|
|
|
@Autowired
|
|
|
private AccessoryService accessoryService;
|
|
|
+ @Autowired
|
|
|
+ private TaskService taskService;
|
|
|
|
|
|
/**
|
|
|
* 企业界面的查询
|
|
|
*/
|
|
|
@Log(Type.QUERY)
|
|
|
- public BusinessContext listByQy(Long functionId, Pageable pageable,
|
|
|
- String jyr, CodeEntity szd, GqEntity gq, CodeEntity whdj,
|
|
|
- String lcStatus, String fddbr) {
|
|
|
+ public BusinessContext listByQy(final Long functionId, Pageable pageable,
|
|
|
+ final String jyr,final CodeEntity szd,final GqEntity gq,final CodeEntity whdj,
|
|
|
+ final String lcStatus,final String fddbr) {
|
|
|
try {
|
|
|
- List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
- // 只检索非删除状态记录
|
|
|
- addNotEmptyModel(filterList, "recordStatus",
|
|
|
- BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
- // 根据所在地过滤
|
|
|
- if (szd != null)
|
|
|
- addNotEmptyModel(filterList, "szd.id", szd.getId(),
|
|
|
- Operator.LIKE_R);
|
|
|
- // 根据港区过滤
|
|
|
- addNotEmptyModel(filterList, "ssgq", gq, Operator.EQ);
|
|
|
- addNotEmptyModel(filterList, "jyrVo.gkjyr", jyr, Operator.LIKE);
|
|
|
- addNotEmptyModel(filterList, "whdj", whdj, Operator.EQ);
|
|
|
- addNotEmptyModel(filterList, "fddbr", fddbr, Operator.LIKE);
|
|
|
- addRecordCodeFilter(functionId, filterList, null, "jyrVo");
|
|
|
-
|
|
|
- Specification<GkwxhwzyfzblhhzEntity> spec = SpecificationCreater
|
|
|
- .searchByPredicateModels(filterList);
|
|
|
+// List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+// // 只检索非删除状态记录
|
|
|
+// addNotEmptyModel(filterList, "recordStatus",
|
|
|
+// BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+// // 根据所在地过滤
|
|
|
+// if (szd != null)
|
|
|
+// addNotEmptyModel(filterList, "szd.id", szd.getId(),
|
|
|
+// Operator.LIKE_R);
|
|
|
+// // 根据港区过滤
|
|
|
+// addNotEmptyModel(filterList, "ssgq", gq, Operator.EQ);
|
|
|
+// addNotEmptyModel(filterList, "jyrVo.gkjyr", jyr, Operator.LIKE);
|
|
|
+// addNotEmptyModel(filterList, "whdj", whdj, Operator.EQ);
|
|
|
+// addNotEmptyModel(filterList, "fddbr", fddbr, Operator.LIKE);
|
|
|
+// addRecordCodeFilter(functionId, filterList, null, "jyrVo");
|
|
|
+//
|
|
|
+// Specification<GkwxhwzyfzblhhzEntity> spec = SpecificationCreater
|
|
|
+// .searchByPredicateModels(filterList);
|
|
|
+
|
|
|
+
|
|
|
+ Specification<GkwxhwzyfzblhhzEntity> spec = new Specification<GkwxhwzyfzblhhzEntity>() {
|
|
|
+ @Override
|
|
|
+ public Predicate toPredicate(Root<GkwxhwzyfzblhhzEntity> root,
|
|
|
+ CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
+ List<Predicate> list = new ArrayList<Predicate>();
|
|
|
+ addRecordCodeFilter(functionId, cb, root, list);
|
|
|
+ // 只检索非删除状态记录
|
|
|
+ list.add(cb.notEqual(
|
|
|
+ root.get("recordStatus").as(String.class),
|
|
|
+ BaseEntity.RECORD_STATE_DELETE));
|
|
|
+
|
|
|
+ //经营人
|
|
|
+ if (null != jyr && !"".equals(jyr)) {
|
|
|
+ list.add(cb
|
|
|
+ .like(root.get("jyrVo").get("gkjyr")
|
|
|
+ .as(String.class), "%" + jyr + "%"));
|
|
|
+ }
|
|
|
+
|
|
|
+ // 危货等级
|
|
|
+ if (null != whdj) {
|
|
|
+ list.add(cb.equal(
|
|
|
+ root.get("whdj").as(CodeEntity.class), whdj));
|
|
|
+ }
|
|
|
+ // 法定代表人
|
|
|
+ if (null != fddbr && !"".equals(fddbr)) {
|
|
|
+ list.add(cb.like(root.get("fddbr").as(String.class),
|
|
|
+ "%" + fddbr + "%"));
|
|
|
+ }
|
|
|
+
|
|
|
+ //“默认”状态,此状态企业查看全部
|
|
|
+ if(!lcStatus.equals("default")){
|
|
|
+ list = Utils.setWorkflowSpec(list, cb, query, root,
|
|
|
+ lcStatus);
|
|
|
+ }
|
|
|
+ return cb.and(list.toArray(new Predicate[] {}));
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
Page<GkwxhwzyfzblhhzEntity> result = gkwxhwzyfzblhhzService
|
|
|
.findAll(spec, pageable);
|
|
|
for (GkwxhwzyfzblhhzEntity entity : result) {
|
|
@@ -737,6 +781,20 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
|
try {
|
|
|
BusinessContext bc = createBusinessContext();
|
|
|
gkwxhwzyfzblhhzService.logicDelete(entities);
|
|
|
+
|
|
|
+ //判断附证申请实例是不是退回状态,如果是,除了删除附证申请数据还要将工作工作提醒中的对应提醒也删除掉:
|
|
|
+ //edit by xuhao 2016-09-06
|
|
|
+ for(GkwxhwzyfzblhhzEntity entity : entities){
|
|
|
+ if(entity.getRecordStatus()==4){
|
|
|
+ List<Gztx> gztxList = taskService.findGztxByBYZD2(entity.getId().toString());//更具BYZD2找到实例
|
|
|
+ for(Gztx gztx : gztxList ){
|
|
|
+ gztx.setTxzt(Constants.NO);
|
|
|
+ taskService.saveGztx(gztx);//将工作提醒置关闭掉(即删除)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 制度list删除
|
|
|
// for (int i = 0; i < entities.size(); i++) {
|
|
|
// glzdxxService.logicDelete(findGlzdxxList(entities.get(i)
|