Commit 86872532 authored by suhuiguang's avatar suhuiguang

1.西安数据补充接口

parent 15cfccb6
...@@ -79,7 +79,14 @@ public class IdxBizJqEquipmentRegisterController extends BaseController { ...@@ -79,7 +79,14 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@GetMapping(value = "/{record}") @GetMapping(value = "/{record}")
@ApiOperation(httpMethod = "GET", value = "根据record查询设备注册信息详情", notes = "根据record查询设备注册信息详情") @ApiOperation(httpMethod = "GET", value = "根据record查询设备注册信息详情", notes = "根据record查询设备注册信息详情")
public ResponseModel<Object> selectOne(@PathVariable String record, @RequestParam(required = false) String isCopy) { public ResponseModel<Object> selectOne(@PathVariable String record, @RequestParam(required = false) String isCopy) {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.getEquipmentRegisterByRecord(record, isCopy)); CompanyBo companyBo = getSelectedOrgInfo().getCompany();
String companyLevel;
if(companyBo.getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)){
companyLevel = companyBo.getLevel();
} else {
companyLevel = BaseController.COMPANY_TYPE_SUPERVISION;
}
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.getEquipmentRegisterByRecord(record, isCopy, companyLevel));
} }
......
...@@ -22,7 +22,7 @@ public interface IIdxBizJgRegisterInfoService { ...@@ -22,7 +22,7 @@ public interface IIdxBizJgRegisterInfoService {
boolean batchDeleteByRecord(Map<String,Object> map); boolean batchDeleteByRecord(Map<String,Object> map);
Map<String, Map<String, Object>> getEquipmentRegisterByRecord(String record, String isCopy); Map<String, Map<String, Object>> getEquipmentRegisterByRecord(String record, String isCopy, String companyLevel);
Page<JSONObject> queryForEquipmentRegisterPage(JSONObject jsonObject); Page<JSONObject> queryForEquipmentRegisterPage(JSONObject jsonObject);
......
...@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; ...@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper; import com.yeejoin.amos.boot.biz.common.dao.mapper.DataDictionaryMapper;
import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto; import com.yeejoin.amos.boot.biz.common.dto.KeyValueDto;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
...@@ -23,7 +22,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto; ...@@ -23,7 +22,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeEqDto;
import com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto; import com.yeejoin.amos.boot.module.jg.api.dto.PieLineEquipContraptionDto;
import com.yeejoin.amos.boot.module.jg.api.entity.*; import com.yeejoin.amos.boot.module.jg.api.entity.*;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum; import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.DataHandlerMapper;
...@@ -37,7 +35,6 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.*; ...@@ -37,7 +35,6 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -46,13 +43,12 @@ import org.springframework.util.StopWatch; ...@@ -46,13 +43,12 @@ import org.springframework.util.StopWatch;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -1038,17 +1034,20 @@ public class DataHandlerServiceImpl { ...@@ -1038,17 +1034,20 @@ public class DataHandlerServiceImpl {
*/ */
public void updateUseInfoOfCompanyV1() { public void updateUseInfoOfCompanyV1() {
List<IdxBizJgUseInfo> useInfos = useInfoService.getBaseMapper().selectXAList(); List<IdxBizJgUseInfo> useInfos = useInfoService.getBaseMapper().selectXAList();
log.info("1.西安导入数据需补充使用单位代码的设备数量:{}", useInfos.size());
Map<String, String> companynameCodeMap = getCompanyNameCodeMap(); Map<String, String> companynameCodeMap = getCompanyNameCodeMap();
AtomicInteger i = new AtomicInteger();
useInfos.forEach(e->{ useInfos.forEach(e->{
String companyCode = companynameCodeMap.get(e.getUseUnitName()); String companyCode = companynameCodeMap.get(e.getUseUnitName());
if(companyCode != null){ if(companyCode != null){
i.getAndIncrement();
// 1.数据库更新 // 1.数据库更新
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TzsBaseEntity::getSequenceNbr, e.getSequenceNbr()); updateWrapper.eq(TzsBaseEntity::getSequenceNbr, e.getSequenceNbr());
updateWrapper.set(IdxBizJgUseInfo::getUseUnitCreditCode, companyCode); updateWrapper.set(IdxBizJgUseInfo::getUseUnitCreditCode, companyCode);
updateWrapper.set(TzsBaseEntity::getRecDate, new Date()); updateWrapper.set(TzsBaseEntity::getRecDate, new Date());
useInfoService.update(updateWrapper); useInfoService.update(updateWrapper);
// 2.es 更新 // 2.es更新
Optional<ESEquipmentCategoryDto> categoryDto = esEquipmentCategory.findById(e.getRecord()); Optional<ESEquipmentCategoryDto> categoryDto = esEquipmentCategory.findById(e.getRecord());
categoryDto.ifPresent(categoryEs -> { categoryDto.ifPresent(categoryEs -> {
categoryEs.setUSE_UNIT_CREDIT_CODE(companyCode); categoryEs.setUSE_UNIT_CREDIT_CODE(companyCode);
...@@ -1058,6 +1057,7 @@ public class DataHandlerServiceImpl { ...@@ -1058,6 +1057,7 @@ public class DataHandlerServiceImpl {
}); });
} }
}); });
log.info("2.西安数据需补充使用单位设备数量:{}, 实际补充使用单位设备数量:{}", useInfos.size(), i.intValue());
} }
private Map<String, String> getCompanyNameCodeMap() { private Map<String, String> getCompanyNameCodeMap() {
......
...@@ -12,7 +12,6 @@ import com.alibaba.fastjson.JSON; ...@@ -12,7 +12,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
...@@ -773,7 +772,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -773,7 +772,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String record = (String) equipmentInfoForm.get(RECORD); String record = (String) equipmentInfoForm.get(RECORD);
String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE); String dataSource = (String) equipmentInfoForm.get(DATA_SOURCE);
if (dataSource.contains("his")) { if (dataSource.contains("his") && equipmentInfoForm.get("useRegistrationCode") != null) {
String useRegistrationCode = String.valueOf(equipmentInfoForm.get("useRegistrationCode")).trim(); String useRegistrationCode = String.valueOf(equipmentInfoForm.get("useRegistrationCode")).trim();
String equipId = String.valueOf(equipmentInfoForm.get("RECORD")); String equipId = String.valueOf(equipmentInfoForm.get("RECORD"));
// 校验使用登记证编号的唯一性 // 校验使用登记证编号的唯一性
...@@ -1052,9 +1051,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1052,9 +1051,10 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
* 查询设备注册信息详情 * 查询设备注册信息详情
* *
* @param record * @param record
* @param companyLevel
* @return * @return
*/ */
public Map<String, Map<String, Object>> getEquipmentRegisterByRecord(String record, String isCopy) { public Map<String, Map<String, Object>> getEquipmentRegisterByRecord(String record, String isCopy, String companyLevel) {
Map<String, Map<String, Object>> resultMap = new HashMap<>(); Map<String, Map<String, Object>> resultMap = new HashMap<>();
// 设备种类 // 设备种类
Map<String, Object> equIpClassMap = this.getEquIpClassMap(record, ""); Map<String, Object> equIpClassMap = this.getEquIpClassMap(record, "");
...@@ -1063,6 +1063,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -1063,6 +1063,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ValidationUtil.isEmpty(equIpClassMap)) { if (!ValidationUtil.isEmpty(equIpClassMap)) {
resultMap.put(EQUIP_CLASS_FORM_ID, equIpClassMap); resultMap.put(EQUIP_CLASS_FORM_ID, equIpClassMap);
} }
equipInfoMap.put("companyLevel", companyLevel);
// 设备参数 // 设备参数
if (equIpClassMap.containsKey(EQU_LIST) && !ValidationUtil.isEmpty(equIpClassMap.get(EQU_LIST).toString())) { if (equIpClassMap.containsKey(EQU_LIST) && !ValidationUtil.isEmpty(equIpClassMap.get(EQU_LIST).toString())) {
Map<String, Object> equipParamsMap = this.getEquipParamsMap(record, "", equIpClassMap.get(EQU_LIST).toString()); Map<String, Object> equipParamsMap = this.getEquipParamsMap(record, "", equIpClassMap.get(EQU_LIST).toString());
...@@ -3101,11 +3102,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -3101,11 +3102,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String record = null; String record = null;
// 设备种类 // 设备种类
String equList = String.valueOf(equipmentClassForm.get(EQU_LIST)); String equList = String.valueOf(equipmentInfoForm.get(EQU_LIST));
// 设备类别 // 设备类别
String equCategory = String.valueOf(equipmentClassForm.get(EQU_CATEGORY)); String equCategory = String.valueOf(equipmentInfoForm.get(EQU_CATEGORY));
// 设备品种 // 设备品种
String equDefine = String.valueOf(equipmentClassForm.get(EQU_DEFINE)); String equDefine = String.valueOf(equipmentInfoForm.get(EQU_DEFINE));
// 业务场景 // 业务场景
String businessScenarios = String.valueOf(equipmentClassForm.get(BUSINESS_SCENARIOS)); String businessScenarios = String.valueOf(equipmentClassForm.get(BUSINESS_SCENARIOS));
// 操作类型 // 操作类型
......
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