Commit da22eb8d authored by tianyiming's avatar tianyiming

监管业务类型枚举及公共提交方法修改

parent af7ce956
package com.yeejoin.amos.boot.module.jg.biz.controller; package com.yeejoin.amos.boot.module.jg.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationEqDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationEqDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable; import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -13,6 +16,7 @@ import java.util.List; ...@@ -13,6 +16,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl; import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -37,6 +41,9 @@ public class JgEnableDisableController extends BaseController { ...@@ -37,6 +41,9 @@ public class JgEnableDisableController extends BaseController {
@Autowired @Autowired
JgEnableDisableServiceImpl jgEnableDisableServiceImpl; JgEnableDisableServiceImpl jgEnableDisableServiceImpl;
@Autowired
RedisUtils redisUtils;
/** /**
* 新增 * 新增
* *
...@@ -46,7 +53,8 @@ public class JgEnableDisableController extends BaseController { ...@@ -46,7 +53,8 @@ public class JgEnableDisableController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增") @ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<Object> save(@RequestBody JSONObject map) { public ResponseModel<Object> save(@RequestBody JSONObject map) {
jgEnableDisableServiceImpl.saveOrUpdate(map); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
jgEnableDisableServiceImpl.saveOrUpdate(map, reginParams);
return ResponseHelper.buildResponse("ok"); return ResponseHelper.buildResponse("ok");
} }
......
...@@ -521,6 +521,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -521,6 +521,7 @@ public class CommonServiceImpl implements ICommonService {
Map<String, Object> provideMap = new HashMap<>(); Map<String, Object> provideMap = new HashMap<>();
String type = (String) basicObj.get("type"); String type = (String) basicObj.get("type");
noticeObj.put("businessCode", type);
if (type.equals(ApplicationFormTypeEnum.AZGZ.getBusinessCode())) { if (type.equals(ApplicationFormTypeEnum.AZGZ.getBusinessCode())) {
JgInstallationNoticeDto jgInstallationNoticeDto = JSON.parseObject(JSON.toJSONString(noticeObj), JgInstallationNoticeDto.class); JgInstallationNoticeDto jgInstallationNoticeDto = JSON.parseObject(JSON.toJSONString(noticeObj), JgInstallationNoticeDto.class);
...@@ -585,7 +586,7 @@ public class CommonServiceImpl implements ICommonService { ...@@ -585,7 +586,7 @@ public class CommonServiceImpl implements ICommonService {
JgEquipTransferDto jgEquipTransferDto = JSON.parseObject(JSON.toJSONString(noticeObj), JgEquipTransferDto.class); JgEquipTransferDto jgEquipTransferDto = JSON.parseObject(JSON.toJSONString(noticeObj), JgEquipTransferDto.class);
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(jgEquipTransferDto); JSONObject jsonObject = (JSONObject) JSONObject.toJSON(jgEquipTransferDto);
jgEquipTransferServiceImpl.saveTransfer(submitType, jsonObject, reginParams); jgEquipTransferServiceImpl.saveTransfer(submitType, jsonObject, reginParams);
} else if (type.contains(ApplicationFormTypeEnum.SBZX.getBusinessCode())) { } else if (type.contains(ApplicationFormTypeEnum.YZBF.getBusinessCode())||type.contains(ApplicationFormTypeEnum.ZXBF.getBusinessCode())) {
noticeObj.put("receiveOrgCreditCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1"))); noticeObj.put("receiveOrgCreditCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
provideMap.put(SBZX_PAGE_ID, noticeObj); provideMap.put(SBZX_PAGE_ID, noticeObj);
...@@ -597,11 +598,12 @@ public class CommonServiceImpl implements ICommonService { ...@@ -597,11 +598,12 @@ public class CommonServiceImpl implements ICommonService {
provideMap.put(GMBG_PAGE_ID, noticeObj); provideMap.put(GMBG_PAGE_ID, noticeObj);
JSONObject jsonObject = new JSONObject(provideMap); JSONObject jsonObject = new JSONObject(provideMap);
jgChangeRegistrationNameService.save2(submitType, jsonObject); jgChangeRegistrationNameService.save2(submitType, jsonObject);
} else if (type.equals(ApplicationFormTypeEnum.TYQY.getBusinessCode())) { } else if (type.equals(ApplicationFormTypeEnum.SBQY.getBusinessCode()) || type.equals(ApplicationFormTypeEnum.SBTY.getBusinessCode())) {
noticeObj.put("submit", submitType);
noticeObj.put("pageType","add");
noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1"))); noticeObj.put("receiveOrgCode", !ObjectUtils.isEmpty(basicObj.get("receiveOrgCreditCode")) ? String.valueOf(basicObj.get("receiveOrgCreditCode")) : String.valueOf(basicObj.get("receiveOrgCreditCode1")));
JSONObject jsonObject = new JSONObject(noticeObj); JSONObject jsonObject = new JSONObject(noticeObj);
jgEnableDisableServiceImpl.saveOrUpdate(jsonObject); jgEnableDisableServiceImpl.saveOrUpdate(jsonObject, reginParams);
} }
} }
......
...@@ -61,10 +61,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -61,10 +61,8 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
private final String WORK_FLOW_KEY = "deactivateEnable"; private final String WORK_FLOW_KEY = "deactivateEnable";
public void saveOrUpdate(JSONObject map) { public void saveOrUpdate(JSONObject map,ReginParams reginParams) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
JgEnableDisable jgEnableDisable = new JgEnableDisable(); JgEnableDisable jgEnableDisable = new JgEnableDisable();
BeanUtil.copyProperties(map, jgEnableDisable);
jgEnableDisable.setApplyDate(new Date()); jgEnableDisable.setApplyDate(new Date());
String submit = String.valueOf(map.get("submit")); String submit = String.valueOf(map.get("submit"));
String pageType = String.valueOf(map.get("pageType")); String pageType = String.valueOf(map.get("pageType"));
...@@ -79,7 +77,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto, ...@@ -79,7 +77,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
// 仅保存 // 仅保存
if ("add".equals(pageType)) { if ("add".equals(pageType)) {
// 获取申请编号 // 获取申请编号
ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.TYQY.getCode(), 1); ResponseModel<List<String>> listResponseModel = tzsServiceFeignClient.applicationFormCode(ApplicationFormTypeEnum.getCode.get(String.valueOf(map.get("businessCode"))), 1);
if (!ObjectUtils.isEmpty(listResponseModel)) { if (!ObjectUtils.isEmpty(listResponseModel)) {
jgEnableDisable.setApplyNo(listResponseModel.getResult().get(0)); jgEnableDisable.setApplyNo(listResponseModel.getResult().get(0));
} }
......
...@@ -129,25 +129,25 @@ ...@@ -129,25 +129,25 @@
"type": "112-1", "type": "112-1",
"pageType": "look", "pageType": "look",
"name": "设备启用", "name": "设备启用",
"url": "" "url": "mixuap?appId=1742358052905971713&id=1737383754143395841&roleIds={roleIds}&userId={userId}&formType=look"
}, },
{ {
"type": "112-1", "type": "112-1",
"pageType": "edit", "pageType": "edit",
"name": "设备启用", "name": "设备启用",
"url": "" "url": "mixuap?appId=1742358052905971713&id=1737383754143395841&roleIds={roleIds}&userId={userId}&formType=edit"
}, },
{ {
"type": "112-2", "type": "112-2",
"pageType": "look", "pageType": "look",
"name": "设备停用", "name": "设备停用",
"url": "" "url": "mixuap?appId=1742358052905971713&id=1737383754143395841&roleIds={roleIds}&userId={userId}&formType=look"
}, },
{ {
"type": "112-2", "type": "112-2",
"pageType": "edit", "pageType": "edit",
"name": "设备停用", "name": "设备停用",
"url": "" "url": "mixuap?appId=1742358052905971713&id=1737383754143395841&roleIds={roleIds}&userId={userId}&formType=edit"
}, },
{ {
"type": "113-1", "type": "113-1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment