|
@@ -1,8 +1,10 @@
|
|
|
package com.zjugis.business.flow.officialSeal.event;
|
|
|
|
|
|
|
|
|
+import com.zjugis.business.constants.ApplySealReasonTypeConstants;
|
|
|
import com.zjugis.business.constants.OfficialSealNameConstants;
|
|
|
import com.zjugis.business.constants.PostConstants;
|
|
|
+import com.zjugis.business.constants.UseSealLocationConstants;
|
|
|
import com.zjugis.business.converter.officialSeal.OfficialSealUseConvert;
|
|
|
import com.zjugis.business.flow.officialSeal.entity.OfficialSealUseDO;
|
|
|
import com.zjugis.business.flow.officialSeal.service.OfficialSealUseService;
|
|
@@ -22,6 +24,7 @@ import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -257,30 +260,37 @@ public class OfficialSealUseEvent extends BaseController {
|
|
|
if (StringUtils.isNotBlank(flowInstanceId)) {
|
|
|
OfficialSealUseDO entity = officialSealUseService.findByInstanceId(flowInstanceId);
|
|
|
List<Map<String, String>> userMaps = new ArrayList<>();
|
|
|
- if (entity.getOfficialSealName().equals(OfficialSealNameConstants.WW) || entity.getOfficialSealName().equals(OfficialSealNameConstants.WW_JS)) {
|
|
|
- int pId = entity.getOfficialSealName().equals(OfficialSealNameConstants.WW) ? PostConstants.OFFICIAL_SEAL_MANAGER : PostConstants.JIANGSU_OFFICIAL_SEAL_MANAGER;
|
|
|
- Collection<Long> collection = new ArrayList<>();
|
|
|
- collection.add(Long.valueOf(pId));
|
|
|
- List<AdminUserRespDTO> userList = adminUserApi.getUserListByPostIds(collection).getCheckedData();
|
|
|
- for (AdminUserRespDTO adminUserRespDTO : userList) {
|
|
|
- HashMap<String, String> map = new HashMap<>();
|
|
|
- map.put("id", adminUserRespDTO.getId());
|
|
|
- userMaps.add(map);
|
|
|
- }
|
|
|
- return ok(userMaps);
|
|
|
- } else if (entity.getOfficialSealName().equals(OfficialSealNameConstants.WW_BJ)){
|
|
|
- Collection<String> collection = new ArrayList<>();
|
|
|
- collection.add(PostConstants.BEIJING_FINANCE);
|
|
|
- List<AdminUserRespDTO> userList = adminUserApi.getUserListByPostCodes(collection).getCheckedData();
|
|
|
+
|
|
|
+ Collection<String> collection = new ArrayList<>();
|
|
|
+
|
|
|
+ //市场
|
|
|
+ if(entity.getApplyReasonType().equals(ApplySealReasonTypeConstants.MARKET)){
|
|
|
+ collection.add(PostConstants.MARKET_ASSISTANT);
|
|
|
+ } else if (entity.getApplyReasonType().equals(ApplySealReasonTypeConstants.OTHER)){
|
|
|
+ collection.add(PostConstants.SEAL_MANAGER);
|
|
|
+ } else {
|
|
|
+ throw new BusinessException("执行事件出错,请联系管理员!");
|
|
|
+ }
|
|
|
+
|
|
|
+ //杭州
|
|
|
+ if (entity.getOfficialSealLocation().equals(UseSealLocationConstants.HZ) ) {
|
|
|
+ collection.add(PostConstants.SEAL_MANAGER);
|
|
|
+ } else if (entity.getOfficialSealLocation().equals(UseSealLocationConstants.NJ)) {
|
|
|
+ collection.add(PostConstants.JS_SEAL_MANAGER);
|
|
|
+ } else if (entity.getOfficialSealLocation().equals(UseSealLocationConstants.BJ)) {
|
|
|
+ collection.add(PostConstants.BJ_SEAL_MANAGER);
|
|
|
+ } else {
|
|
|
+ throw new BusinessException("执行事件出错,请联系管理员!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ List<AdminUserRespDTO> userList = adminUserApi.getUserListByPostCodes(collection).getCheckedData();
|
|
|
for (AdminUserRespDTO adminUserRespDTO : userList) {
|
|
|
HashMap<String, String> map = new HashMap<>();
|
|
|
map.put("id", adminUserRespDTO.getId());
|
|
|
userMaps.add(map);
|
|
|
}
|
|
|
return ok(userMaps);
|
|
|
- } else {
|
|
|
- throw new BusinessException("执行事件出错,请联系管理员!");
|
|
|
- }
|
|
|
|
|
|
} else {
|
|
|
throw new BusinessException("执行事件出错,请联系管理员!");
|
|
@@ -292,4 +302,28 @@ public class OfficialSealUseEvent extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 申请事由类型:其他/市场相关材料盖章
|
|
|
+ * @param flowInstance
|
|
|
+ * @param type
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/reasonType/{type}")
|
|
|
+ public String reasonType(@ParamModel Map flowInstance, @PathVariable String type) {
|
|
|
+ try {
|
|
|
+ String flowInstanceId = flowInstance.get("id").toString();
|
|
|
+
|
|
|
+ OfficialSealUseDO entity = officialSealUseService.findByInstanceId(flowInstanceId);
|
|
|
+
|
|
|
+ if (type.equals(String.valueOf(entity.getApplyReasonType()))) {
|
|
|
+ return "true";
|
|
|
+ } else {
|
|
|
+ return "false";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception ex) {
|
|
|
+ return error(ex.getMessage(), ErrorCode.DEFAULT);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|