|
@@ -44,11 +44,13 @@ import com.jtgh.yjpt.common.SinglePageRequest;
|
|
|
import com.jtgh.yjpt.common.SpecificationCreater;
|
|
|
import com.jtgh.yjpt.common.Utils;
|
|
|
import com.jtgh.yjpt.common.WorkFlowParam;
|
|
|
+import com.jtgh.yjpt.common.servlet.InitServlet;
|
|
|
import com.jtgh.yjpt.controller.BaseController;
|
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
|
import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
|
import com.jtgh.yjpt.entity.bagl.aqpjjgba.AqpjjgbaEntity;
|
|
|
import com.jtgh.yjpt.entity.bagl.aqpjjgba.AqpjjgryEntity;
|
|
|
+import com.jtgh.yjpt.entity.common.AccessoryEntity;
|
|
|
import com.jtgh.yjpt.entity.common.TaskInfoEntity;
|
|
|
import com.jtgh.yjpt.service.bagl.aqpjjgba.AqpjjgbaProService;
|
|
|
import com.jtgh.yjpt.service.bagl.aqpjjgba.AqpjjgbaService;
|
|
@@ -141,7 +143,7 @@ public class AqpjjgbaController extends BaseController {
|
|
|
if (data.getProvinceTaskList() != null
|
|
|
&& data.getProvinceTaskList().size() > 0) {
|
|
|
data.getProvinceTaskList().get(0);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
// 市级页面查询
|
|
|
else {
|
|
@@ -186,7 +188,8 @@ public class AqpjjgbaController extends BaseController {
|
|
|
addNotEmptyModel(filterList, "zzzsbm", zzzsbh, Operator.LIKE);
|
|
|
addNotEmptyModel(filterList, "jglx", jglx, Operator.EQ);
|
|
|
addNotEmptyModel(filterList, "zzyxq", yxqz, Operator.LTE);
|
|
|
- addNotEmptyModel(filterList, "sfqxzg", Constants.YES, Operator.NEQ);;
|
|
|
+ addNotEmptyModel(filterList, "sfqxzg", Constants.YES, Operator.NEQ);
|
|
|
+ ;
|
|
|
addNotEmptyModel(filterList, "recordStatus",
|
|
|
Logable.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
addRecordCodeFilter(functionId, filterList);
|
|
@@ -238,8 +241,9 @@ public class AqpjjgbaController extends BaseController {
|
|
|
root.get("addUser").as(UserEntity.class),
|
|
|
Utils.getCurrentUser()));
|
|
|
}
|
|
|
- //省局只检索已完成的数据
|
|
|
- if(Constants.SZD_ID_PROVINCE.equals(Utils.getCurrentUserSzd())){
|
|
|
+ // 省局只检索已完成的数据
|
|
|
+ if (Constants.SZD_ID_PROVINCE.equals(Utils
|
|
|
+ .getCurrentUserSzd())) {
|
|
|
list.add(cb.equal(
|
|
|
root.get("recordStatus").as(String.class),
|
|
|
BaseEntity.RECORD_STATE_COMPLETED));
|
|
@@ -449,7 +453,7 @@ public class AqpjjgbaController extends BaseController {
|
|
|
*/
|
|
|
public BusinessContext submit(AqpjjgbaEntity entity, Long functionId)
|
|
|
throws CloneNotSupportedException {
|
|
|
- if (null == entity.getId()||entity.getId().equals(0l)) {
|
|
|
+ if (null == entity.getId() || entity.getId().equals(0l)) {
|
|
|
entity.setAddDate(new Date());
|
|
|
entity.setAddUser(Utils.getCurrentUser());
|
|
|
entity.setRecordCode(getCurrentRoleCode(functionId));
|
|
@@ -480,21 +484,21 @@ public class AqpjjgbaController extends BaseController {
|
|
|
|
|
|
public BusinessContext audit(String shyj, Date shsj,
|
|
|
AqpjjgbaEntity aqpjjgbaEntity, boolean flag) {
|
|
|
- if(Constants.SZD_ID_PROVINCE.equals(Utils.getCurrentUserSzd())){
|
|
|
- if(aqpjjgbaProService.getCandidateTaskByUserAndBusKey(Utils
|
|
|
- .getCurrentUser().getId().toString(), aqpjjgbaEntity.getId()
|
|
|
- .toString()) != null) {
|
|
|
+ if (Constants.SZD_ID_PROVINCE.equals(Utils.getCurrentUserSzd())) {
|
|
|
+ if (aqpjjgbaProService.getCandidateTaskByUserAndBusKey(Utils
|
|
|
+ .getCurrentUser().getId().toString(), aqpjjgbaEntity
|
|
|
+ .getId().toString()) != null) {
|
|
|
aqpjjgbaProService.claim(aqpjjgbaEntity.getId().toString(),
|
|
|
Utils.getCurrentUser().getId().toString());
|
|
|
}
|
|
|
// 省级完成
|
|
|
- aqpjjgbaProService.doApprove(aqpjjgbaEntity, flag, shyj);
|
|
|
+ aqpjjgbaProService.doApprove(aqpjjgbaEntity, flag, shyj);
|
|
|
} else {
|
|
|
if (aqpjjgbaService.getCandidateTaskByUserAndBusKey(Utils
|
|
|
- .getCurrentUser().getId().toString(), aqpjjgbaEntity.getId()
|
|
|
- .toString()) != null) {
|
|
|
- aqpjjgbaService.claim(aqpjjgbaEntity.getId().toString(), Utils
|
|
|
- .getCurrentUser().getId().toString());
|
|
|
+ .getCurrentUser().getId().toString(), aqpjjgbaEntity
|
|
|
+ .getId().toString()) != null) {
|
|
|
+ aqpjjgbaService.claim(aqpjjgbaEntity.getId().toString(), Utils
|
|
|
+ .getCurrentUser().getId().toString());
|
|
|
}
|
|
|
// 市级审批
|
|
|
WorkFlowParam param = new WorkFlowParam();
|
|
@@ -508,10 +512,12 @@ public class AqpjjgbaController extends BaseController {
|
|
|
List<Task> l = aqpjjgbaService.complete(param, variables);
|
|
|
// 审批完成
|
|
|
if (null == l || l.size() == 0) {
|
|
|
- aqpjjgbaEntity= aqpjjgbaService.findOne(aqpjjgbaEntity.getId());
|
|
|
- aqpjjgbaEntity.setRecordStatus(BaseEntity.RECORD_STATE_COMPLETED);
|
|
|
+ aqpjjgbaEntity = aqpjjgbaService
|
|
|
+ .findOne(aqpjjgbaEntity.getId());
|
|
|
+ aqpjjgbaEntity
|
|
|
+ .setRecordStatus(BaseEntity.RECORD_STATE_COMPLETED);
|
|
|
aqpjjgbaEntity.setSsqy(Constants.SSQY_ALL);
|
|
|
- aqpjjgbaService.save(aqpjjgbaEntity);
|
|
|
+ aqpjjgbaService.save(aqpjjgbaEntity);
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
@@ -528,7 +534,7 @@ public class AqpjjgbaController extends BaseController {
|
|
|
if (!Utils.getCurrentUserSzd().equals(Constants.SZD_ID_PROVINCE)) {
|
|
|
aqpjjgbaService.claim(entity.getId().toString(), Utils
|
|
|
.getCurrentUser().getId().toString());
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
aqpjjgbaProService.claim(entity.getId().toString(), Utils
|
|
|
.getCurrentUser().getId().toString());
|
|
|
}
|
|
@@ -537,4 +543,37 @@ public class AqpjjgbaController extends BaseController {
|
|
|
}
|
|
|
return createBusinessContext("save.success", true);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑初始化
|
|
|
+ *
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public BusinessContext doEidtInit(AqpjjgbaEntity entity) {
|
|
|
+ BusinessContext bc = new BusinessContext();
|
|
|
+ bc.setAttribute("filesList",findFilesNoValue(entity));
|
|
|
+ bc.setAttribute("fileTypeList",
|
|
|
+ InitServlet.groupcodeMap.get(Constants.GROUP_CODE_AQPJJGFJLX));
|
|
|
+ return bc;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 返回已经存在的附件类型
|
|
|
+ public List<AccessoryEntity> findFilesNoValue(AqpjjgbaEntity entity) {
|
|
|
+ // 附件查询
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
+ addNotEmptyModel(filterList, "entityId", entity.getId(), Operator.EQ);
|
|
|
+ addNotEmptyModel(filterList, "entityType",
|
|
|
+ Constants.FJSSLX_AQPJJGBA, Operator.EQ);
|
|
|
+ Specification<AccessoryEntity> spec = SpecificationCreater
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
+ List<AccessoryEntity> list = accessoryService.findAll(spec);
|
|
|
+ // 只返回附件类型
|
|
|
+ for (AccessoryEntity acc : list) {
|
|
|
+ acc.setContent(null);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
}
|