Commit 96b0094f authored by tianbo's avatar tianbo

修改:使用单位可添加设备

parent 5a509a0f
package com.yeejoin.amos.boot.module.jg.biz.service.impl; package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
...@@ -12,9 +11,8 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey; ...@@ -12,9 +11,8 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum; import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper;
import com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.jg.biz.service.*; import com.yeejoin.amos.boot.module.jg.biz.service.*;
import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto; import com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto;
...@@ -142,8 +140,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -142,8 +140,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
private JgInstallationNoticeEqServiceImpl jgInstallationNoticeEqServiceImpl; private JgInstallationNoticeEqServiceImpl jgInstallationNoticeEqServiceImpl;
@Autowired @Autowired
private JgUseRegistrationEqServiceImpl jgUseRegistrationEqServiceImpl; private JgUseRegistrationEqServiceImpl jgUseRegistrationEqServiceImpl;
@Autowired
private JgInstallationNoticeServiceImpl jgInstallationNoticeService;
/** /**
* 设备注册信息 * 设备注册信息
...@@ -1129,11 +1127,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1129,11 +1127,21 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String operateType = ValidationUtil.isEmpty(equipmentInfoForm.get("SEQUENCE_NBR")) ? OPERATESAVE : OPERATEEDIT; String operateType = ValidationUtil.isEmpty(equipmentInfoForm.get("SEQUENCE_NBR")) ? OPERATESAVE : OPERATEEDIT;
record = OPERATESAVE.equals(operateType) ? UUID.randomUUID().toString() : equipmentInfoForm.get("RECORD").toString(); record = OPERATESAVE.equals(operateType) ? UUID.randomUUID().toString() : equipmentInfoForm.get("RECORD").toString();
// 单位类型
Map<String, Object> companyType = jgInstallationNoticeService.getCompanyType();
String companyTypeStr = companyType.get("companyType").toString();
//使用信息 //使用信息
IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgUseInfo.class); IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgUseInfo.class);
useInfo.setRecord(record); useInfo.setRecord(record);
useInfo.setRecDate(date); useInfo.setRecDate(date);
useInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("USEINFO_SEQ"))); useInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("USEINFO_SEQ")));
if(companyTypeStr.contains(CompanyTypeEnum.USE.getCode())) {
useInfo.setUseUnitCreditCode(companyType.get("creditCode").toString());
useInfo.setUseUnitName(companyType.get("companyTypeName").toString());
}
idxBizJgUseInfoService.saveOrUpdateData(useInfo); idxBizJgUseInfoService.saveOrUpdateData(useInfo);
//设计制造 //设计制造
...@@ -1158,8 +1166,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1158,8 +1166,12 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgConstructionInfo.class); IdxBizJgConstructionInfo constructionInfo = JSON.parseObject(JSON.toJSONString(equipmentInfoForm), IdxBizJgConstructionInfo.class);
constructionInfo.setRecord(record); constructionInfo.setRecord(record);
constructionInfo.setRecDate(date); constructionInfo.setRecDate(date);
if(companyTypeStr.contains(CompanyTypeEnum.CONSTRUCTION.getCode())) {
constructionInfo.setUscUnitCreditCode(companyCode); constructionInfo.setUscUnitCreditCode(companyCode);
constructionInfo.setUscUnitName(companyName); constructionInfo.setUscUnitName(companyName);
}
constructionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("CONSTRUCTIONINFO_SEQ"))); constructionInfo.setSequenceNbr(OPERATESAVE.equals(operateType) ? null : String.valueOf(equipmentInfoForm.get("CONSTRUCTIONINFO_SEQ")));
iIdxBizJgConstructionInfoService.saveOrUpdateData(constructionInfo); iIdxBizJgConstructionInfoService.saveOrUpdateData(constructionInfo);
......
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