Commit 87c9d4b8 authored by chenzhao's avatar chenzhao

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents 4f1693e2 88b4d200
...@@ -62,19 +62,35 @@ public class JgMaintenanceContractDto extends BaseDto { ...@@ -62,19 +62,35 @@ public class JgMaintenanceContractDto extends BaseDto {
@ApiModelProperty(value = "维保合同结束日期") @ApiModelProperty(value = "维保合同结束日期")
private Date informEnd; private Date informEnd;
@ApiModelProperty(value = "管理员id") @ApiModelProperty(value = "安全管理员id")
private String maintenanceManagerId; private String maintenanceManagerId;
@ApiModelProperty(value = "管理员姓名") @ApiModelProperty(value = "安全管理员姓名")
private String maintenanceManagerName; private String maintenanceManagerName;
@ApiModelProperty(value = "安全管理员姓名联系方式")
private String maintenanceManagerPhone;
@ApiModelProperty(value = "维保负责人一id") @ApiModelProperty(value = "维保负责人一id")
private String maintenanceManagerOneId; private String maintenanceManagerOneId;
@ApiModelProperty(value = "维保负责人一姓名")
private String maintenanceManagerOneName;
@ApiModelProperty(value = "维保负责人一联系方式")
private String maintenanceManagerOnePhone;
@ApiModelProperty(value = "维保负责人二id") @ApiModelProperty(value = "维保负责人二id")
private String maintenanceManagerTwoId; private String maintenanceManagerTwoId;
@ApiModelProperty(value = "维保负责人二姓名")
private String maintenanceManagerTwoName;
@ApiModelProperty(value = "维保负责人二联系方式")
private String maintenanceManagerTwoPhone;
@ApiModelProperty(value = "紧急救援电话") @ApiModelProperty(value = "紧急救援电话")
private String emergencyCall; private String emergencyCall;
......
...@@ -36,6 +36,9 @@ public class JgTransferNoticeDto extends BaseDto { ...@@ -36,6 +36,9 @@ public class JgTransferNoticeDto extends BaseDto {
@ApiModelProperty(value = "告知状态") @ApiModelProperty(value = "告知状态")
private String noticeStatus; private String noticeStatus;
@ApiModelProperty(value = "告知状态")
private String noticeStatusDesc;
@ApiModelProperty(value = "施工单位统一信用代码") @ApiModelProperty(value = "施工单位统一信用代码")
private String installUnitCreditCode; private String installUnitCreditCode;
...@@ -173,6 +176,9 @@ public class JgTransferNoticeDto extends BaseDto { ...@@ -173,6 +176,9 @@ public class JgTransferNoticeDto extends BaseDto {
@ApiModelProperty(value = "完整地址") @ApiModelProperty(value = "完整地址")
private String fullAddress; private String fullAddress;
@ApiModelProperty(value = "userId")
private String promoter;
public String getFullAddress() { public String getFullAddress() {
return (StringUtils.isEmpty(this.provinceName) ? "" : this.provinceName) return (StringUtils.isEmpty(this.provinceName) ? "" : this.provinceName)
+ (StringUtils.isEmpty(this.cityName) ? "" : this.cityName) + (StringUtils.isEmpty(this.cityName) ? "" : this.cityName)
......
...@@ -101,17 +101,23 @@ public class JgMaintenanceContract extends BaseEntity { ...@@ -101,17 +101,23 @@ public class JgMaintenanceContract extends BaseEntity {
private Date informEnd; private Date informEnd;
/** /**
* 管理员id * 安全管理员id
*/ */
@TableField("maintenance_manager_id") @TableField("maintenance_manager_id")
private String maintenanceManagerId; private String maintenanceManagerId;
/** /**
* 管理员id * 安全管理员姓名
*/ */
@TableField("maintenance_manager_name") @TableField("maintenance_manager_name")
private String maintenanceManagerName; private String maintenanceManagerName;
/**
* 安全管理员姓名联系方式
*/
@TableField("maintenance_manager_phone")
private String maintenanceManagerPhone;
/** /**
* 维保负责人一id * 维保负责人一id
...@@ -120,6 +126,18 @@ public class JgMaintenanceContract extends BaseEntity { ...@@ -120,6 +126,18 @@ public class JgMaintenanceContract extends BaseEntity {
private String maintenanceManagerOneId; private String maintenanceManagerOneId;
/** /**
* 维保负责人一姓名
*/
@TableField("maintenance_manager_one_name")
private String maintenanceManagerOneName;
/**
* 维保负责人一联系方式
*/
@TableField("maintenance_manager_one_phone")
private String maintenanceManagerOnePhone;
/**
* 维保负责人二id * 维保负责人二id
*/ */
@TableField("maintenance_manager_two_id") @TableField("maintenance_manager_two_id")
...@@ -127,6 +145,19 @@ public class JgMaintenanceContract extends BaseEntity { ...@@ -127,6 +145,19 @@ public class JgMaintenanceContract extends BaseEntity {
/** /**
* 维保负责人二姓名
*/
@TableField("maintenance_manager_two_name")
private String maintenanceManagerTwoName;
/**
* 维保负责人二联系方式
*/
@TableField("maintenance_manager_two_phone")
private String maintenanceManagerTwoPhone;
/**
* 紧急救援电话 * 紧急救援电话
*/ */
@TableField("emergency_call") @TableField("emergency_call")
......
...@@ -279,4 +279,7 @@ public class JgTransferNotice extends BaseEntity { ...@@ -279,4 +279,7 @@ public class JgTransferNotice extends BaseEntity {
@TableField("province_name") @TableField("province_name")
private String provinceName; private String provinceName;
@TableField("promoter")
private String promoter;
} }
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
</if> </if>
</if> </if>
<if test="type == 'supervision'"> <if test="type == 'supervision'">
AND (tjmn.notice_status in ('6612', '6613', '6614') or tjmn.status in('6614') ) AND (tjmn.notice_status in ('6612', '6613', '6614') )
AND tjmn.receive_org_credit_code = #{orgCode} AND tjmn.receive_org_code = #{orgCode}
</if> </if>
<if test="type == 'enterprise'"> <if test="type == 'enterprise'">
AND tjmn.install_unit_credit_code = #{orgCode} AND tjmn.install_unit_credit_code = #{orgCode}
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</if> </if>
<if test="type == 'supervision'"> <if test="type == 'supervision'">
AND isn.notice_status in ('6612', '6613', '6614') AND isn.notice_status in ('6612', '6613', '6614')
AND isn.receive_org_credit_code = #{orgCode} <!-- AND isn.receive_org_code = #{orgCode}-->
<!-- AND (isn.notice_status in ('6612', '6613', '6614') or isn.status in('6614') )--> <!-- AND (isn.notice_status in ('6612', '6613', '6614') or isn.status in('6614') )-->
</if> </if>
<if test="orgCode != null and orgCode != ''"> <if test="orgCode != null and orgCode != ''">
......
...@@ -12,12 +12,13 @@ ...@@ -12,12 +12,13 @@
tjtn.address AS address, tjtn.address AS address,
tjtn.notice_status AS noticeStatus, tjtn.notice_status AS noticeStatus,
tjtn.install_unit_name AS installUnitName, tjtn.install_unit_name AS installUnitName,
tjtn.province AS provinceName, tjtn.province_name AS provinceName,
tjtn.city AS cityName, tjtn.city_name AS cityName,
tjtn.county AS countyName, tjtn.county_name AS countyName,
tjtn.instance_id AS instanceId, tjtn.instance_id AS instanceId,
tjtn.transfer_type AS transferType, tjtn.transfer_type AS transferType,
tjtn.plan_date AS planDate tjtn.plan_date AS planDate,
tjtn.promoter AS promoter
FROM FROM
tzs_jg_transfer_notice tjtn tzs_jg_transfer_notice tjtn
<where> <where>
...@@ -38,11 +39,18 @@ ...@@ -38,11 +39,18 @@
<if test="param.noticeStatus != null and param.noticeStatus != ''"> <if test="param.noticeStatus != null and param.noticeStatus != ''">
AND tjtn.notice_status = #{param.noticeStatus} AND tjtn.notice_status = #{param.noticeStatus}
</if> </if>
<if test="param.transferType != null and param.transferType != '' and param.transferType == '10002'">
AND tjtn.transfer_type = '区内移装'
</if>
<if test="param.transferType != null and param.transferType != '' and param.transferType == '10003'">
AND tjtn.transfer_type = '跨区移装'
</if>
</if> </if>
<if test="type == 'supervision'"> <if test="type == 'supervision'">
AND (tjtn.notice_status in ('6612', '6613', '6614') or tjtn.status in('6614') ) AND tjtn.notice_status in ('6612', '6613', '6614')
AND tjtn.receive_org_code = #{orgCode}
</if> </if>
<if test="orgCode != null and orgCode != ''"> <if test="type == 'enterprise'">
AND tjtn.install_unit_credit_code = #{orgCode} AND tjtn.install_unit_credit_code = #{orgCode}
</if> </if>
</where> </where>
...@@ -71,9 +79,10 @@ ...@@ -71,9 +79,10 @@
tjtn.construction_contract AS constructionContract, tjtn.construction_contract AS constructionContract,
tjtn.transfer_type AS transferType, tjtn.transfer_type AS transferType,
tjtn.factory_use_site_street AS factoryUseSiteStreet, tjtn.factory_use_site_street AS factoryUseSiteStreet,
tjtn.province AS provinceName, tjtn.province_name AS provinceName,
tjtn.city AS cityName, tjtn.city_name AS cityName,
tjtn.county AS countyName, tjtn.county_name AS countyName,
tjtn.promoter AS promoter,
ri.equ_list AS equList, ri.equ_list AS equList,
ri.equ_category AS equCategory, ri.equ_category AS equCategory,
ri.EQU_DEFINE AS equDefine, ri.EQU_DEFINE AS equDefine,
...@@ -110,7 +119,7 @@ ...@@ -110,7 +119,7 @@
ui.ADDRESS AS useUnitAddress ui.ADDRESS AS useUnitAddress
FROM FROM
tzs_jg_transfer_notice tjtn tzs_jg_transfer_notice tjtn
LEFT JOIN tzs_jg_installation_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr LEFT JOIN tzs_jg_transfer_notice_eq re ON re.equip_transfer_id = tjtn.sequence_nbr
LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id
LEFT JOIN idx_biz_jg_design_info di ON di.record = re.equ_id LEFT JOIN idx_biz_jg_design_info di ON di.record = re.equ_id
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
......
package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto;
import com.yeejoin.amos.boot.module.jg.biz.service.impl.JgTransferNoticeServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;
/**
* 移装告知
*
* @author system_generator
* @date 2023-12-12
*/
@RestController
@Api(tags = "移装告知工作流相关Api")
@RequestMapping(value = "/jg-transfer-workflow")
public class JgTransferNoticeByWorkFlowController {
@Autowired
JgTransferNoticeServiceImpl jgTransferNoticeService;
/**
* 提交
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/submit")
@ApiOperation(httpMethod = "POST", value = "移装告知提交", notes = "移装告知提交")
public ResponseModel<JgTransferNoticeDto> submit(@RequestBody JgTransferNoticeDto model, String op) {
// TODO 发起移装告知流程
// jgInstallationNoticeServiceImpl.submit(model, op);
return ResponseHelper.buildResponse(model);
}
/**
* 撤销
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/cancel")
@ApiOperation(httpMethod = "POST", value = "移装告知撤销", notes = "移装告知撤销")
public ResponseModel<JgTransferNoticeDto> cancel(@RequestBody Map<String, Object> model) {
JgTransferNoticeDto installationInfo = BeanUtil.mapToBean(((LinkedHashMap) model.get("transferNoticeInfo")), JgTransferNoticeDto.class, true);
if (Objects.isNull(installationInfo)) {
throw new IllegalArgumentException("参数transferNoticeInfo不能为空");
}
jgTransferNoticeService.cancel(installationInfo);
return ResponseHelper.buildResponse(installationInfo);
}
/**
* 受理
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/accept")
@ApiOperation(httpMethod = "POST", value = "移装告知受理", notes = "移装告知受理")
public ResponseModel<JgTransferNoticeDto> accept(@RequestBody Map<String, Object> model, String op) {
// TODO 受理移装告知流程
LinkedHashMap model1 = (LinkedHashMap)model.get("model");
LinkedHashMap installationInfo = (LinkedHashMap)model1.get("transferNoticeInfo");
JgTransferNoticeDto JgTransferNoticeDto = JSON.parseObject(JSON.toJSONString(installationInfo), JgTransferNoticeDto.class);
jgTransferNoticeService.accept(JgTransferNoticeDto,op);
return ResponseHelper.buildResponse(null);
}
}
...@@ -65,12 +65,12 @@ public class JgTransferNoticeController extends BaseController { ...@@ -65,12 +65,12 @@ public class JgTransferNoticeController extends BaseController {
@RequestParam String submitType, @RequestParam String submitType,
@RequestBody Map<String, Object> model, @RequestBody Map<String, Object> model,
@RequestParam(value = "op", required = false) String op) { @RequestParam(value = "op", required = false) String op) {
JgTransferNoticeDto transferNoticeInfo = BeanUtil.mapToBean(((LinkedHashMap) model.get("transferInfo")), JgTransferNoticeDto.class, true); JgTransferNoticeDto transferNoticeInfo = BeanUtil.mapToBean(((LinkedHashMap) model.get("transferNoticeInfo")), JgTransferNoticeDto.class, true);
if (Objects.isNull(transferNoticeInfo)) { if (Objects.isNull(transferNoticeInfo)) {
throw new IllegalArgumentException("参数transferInfo不能为空"); throw new IllegalArgumentException("参数transferInfo不能为空");
} }
Object o = ((LinkedHashMap<?, ?>) model.get("transferInfo")).get("proxyStatementAttachment"); Object o = ((LinkedHashMap<?, ?>) model.get("transferNoticeInfo")).get("proxyStatementAttachmentList");
Object o1 = ((LinkedHashMap<?, ?>) model.get("transferInfo")).get("installContractAttachment"); Object o1 = ((LinkedHashMap<?, ?>) model.get("transferNoticeInfo")).get("installContractAttachmentList");
transferNoticeInfo.setConstructionContractList((List<Map<String, Object>>) o); transferNoticeInfo.setConstructionContractList((List<Map<String, Object>>) o);
transferNoticeInfo.setPowerOfAttorneyList((List<Map<String, Object>>) o1); transferNoticeInfo.setPowerOfAttorneyList((List<Map<String, Object>>) o1);
return ResponseHelper.buildResponse(jgTransferNoticeService.updateTransferNotice(submitType, transferNoticeInfo, op)); return ResponseHelper.buildResponse(jgTransferNoticeService.updateTransferNotice(submitType, transferNoticeInfo, op));
......
...@@ -6,8 +6,8 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -6,8 +6,8 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Map; import java.util.Map;
@FeignClient(name = "TZS-YMT", path = "/ymt", configuration = @FeignClient(name = "TZS-YMT", path = "/ymt", configuration =
...@@ -33,4 +33,16 @@ public interface TzsServiceFeignClient { ...@@ -33,4 +33,16 @@ public interface TzsServiceFeignClient {
@RequestMapping(value = "/equipment-category/commonUpdateEsData", method = RequestMethod.POST) @RequestMapping(value = "/equipment-category/commonUpdateEsData", method = RequestMethod.POST)
ResponseModel<Map<String, Object>> commonUpdateEsDataByIds(@RequestBody Map<String, Map<String, Object>> paramMap); ResponseModel<Map<String, Object>> commonUpdateEsDataByIds(@RequestBody Map<String, Map<String, Object>> paramMap);
/**
* 申请单编号生成
* @param type type
* @param batchSize batchSize
* @return List
*/
@RequestMapping(value = "/generate-code/applicationFormCode", method = RequestMethod.POST)
ResponseModel<Map<String, Object>> applicationFormCode(@RequestParam("type") String type,
@RequestParam("batchSize") int batchSize);
} }
...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper; ...@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import org.apache.commons.collections.CollectionUtils;
import org.apache.lucene.queryparser.classic.QueryParser; import org.apache.lucene.queryparser.classic.QueryParser;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.search.SearchResponse;
...@@ -197,89 +198,89 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -197,89 +198,89 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
} }
return resultMap; return resultMap;
} }
private Map<String, Object> getStringObjectMap(String record) { private Map<String, Object> getStringObjectMap(String record) {
Map<String, Object> objMap = new HashMap<>(); Map<String, Object> objMap = new HashMap<>();
//使用信息 //使用信息
IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.getOneData(record); IdxBizJgUseInfo useInfo = idxBizJgUseInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(useInfo)) { if (!ValidationUtil.isEmpty(useInfo)) {
Map<String, Object> useInfoMap = new HashMap<>(); Map<String, Object> useInfoMap = convertCamelToUnderscore(useInfo, null);
String[] fields = null;
useInfoMap = this.convertCamelToUnderscore(useInfo, fields);
useInfoMap.put("USEINFO_SEQ", useInfo.getSequenceNbr()); useInfoMap.put("USEINFO_SEQ", useInfo.getSequenceNbr());
objMap.putAll(useInfoMap); objMap.putAll(useInfoMap);
} }
//设计制造 //设计制造
IdxBizJgDesignInfo designInfo = iIdxBizJgDesignInfoService.getOneData(record); IdxBizJgDesignInfo designInfo = iIdxBizJgDesignInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(designInfo)) { if (!ValidationUtil.isEmpty(designInfo)) {
Map<String, Object> designInfoMap = new HashMap<>();
String[] fields = {"DESIGN_DOC", "DESIGN_STANDARD"}; String[] fields = {"DESIGN_DOC", "DESIGN_STANDARD"};
designInfoMap = this.convertCamelToUnderscore(designInfo, fields); Map<String, Object> designInfoMap = convertCamelToUnderscore(designInfo, fields);
designInfoMap.put("DESIGNINFO_SEQ", designInfo.getSequenceNbr()); designInfoMap.put("DESIGNINFO_SEQ", designInfo.getSequenceNbr());
objMap.putAll(designInfoMap); objMap.putAll(designInfoMap);
} }
//制造信息 //制造信息
IdxBizJgFactoryInfo factoryInfo = iIdxBizJgFactoryInfoService.getOneData(record); IdxBizJgFactoryInfo factoryInfo = iIdxBizJgFactoryInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(factoryInfo)) { if (!ValidationUtil.isEmpty(factoryInfo)) {
Map<String, Object> factoryInfoMap = new HashMap<>();
String[] fields = {"FACTORY_STANDARD", "PRODUCT_QUALITY_YIELD_PROVE", "INS_USE_MAINTAIN_EXPLAIN"}; String[] fields = {"FACTORY_STANDARD", "PRODUCT_QUALITY_YIELD_PROVE", "INS_USE_MAINTAIN_EXPLAIN"};
factoryInfoMap = this.convertCamelToUnderscore(factoryInfo, fields); Map<String, Object> factoryInfoMap = convertCamelToUnderscore(factoryInfo, fields);
String imported = factoryInfo.getImported();
if("0".equals(imported)){
factoryInfoMap.put("IMPORTED_DESC","否");
}else if("1".equals(imported)){
factoryInfoMap.put("IMPORTED_DESC","是");
}
factoryInfoMap.put("FACTORYINFO_SEQ", factoryInfo.getSequenceNbr()); factoryInfoMap.put("FACTORYINFO_SEQ", factoryInfo.getSequenceNbr());
objMap.putAll(factoryInfoMap); objMap.putAll(factoryInfoMap);
} }
//施工信息 //施工信息
IdxBizJgConstructionInfo constructionInfo = iIdxBizJgConstructionInfoService.getOneData(record); IdxBizJgConstructionInfo constructionInfo = iIdxBizJgConstructionInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(constructionInfo)) { if (!ValidationUtil.isEmpty(constructionInfo)) {
Map<String, Object> constructionInfoMap = new HashMap<>(); Map<String, Object> constructionInfoMap = convertCamelToUnderscore(constructionInfo, null);
String[] fields = null;
constructionInfoMap = this.convertCamelToUnderscore(constructionInfo, fields);
constructionInfoMap.put("CONSTRUCTIONINFO_SEQ", constructionInfo.getSequenceNbr()); constructionInfoMap.put("CONSTRUCTIONINFO_SEQ", constructionInfo.getSequenceNbr());
objMap.putAll(constructionInfoMap); objMap.putAll(constructionInfoMap);
} }
//注册登记 //注册登记
IdxBizJgRegisterInfo registerInfo = this.getOne(new QueryWrapper<IdxBizJgRegisterInfo>().eq("RECORD", record)); IdxBizJgRegisterInfo registerInfo = this.getOne(new QueryWrapper<IdxBizJgRegisterInfo>().eq("RECORD", record));
if (!ValidationUtil.isEmpty(registerInfo)) { if (!ValidationUtil.isEmpty(registerInfo)) {
Map<String, Object> registerInfoMap = new HashMap<>();
String[] fields = {"PRODUCT_PHOTO"}; String[] fields = {"PRODUCT_PHOTO"};
registerInfoMap = this.convertCamelToUnderscore(registerInfo, fields); Map<String, Object> registerInfoMap = convertCamelToUnderscore(registerInfo, fields);
registerInfoMap.put("REGISTERINFO_SEQ", registerInfo.getSequenceNbr()); registerInfoMap.put("REGISTERINFO_SEQ", registerInfo.getSequenceNbr());
registerInfoMap.put("SEQUENCE_NBR", registerInfo.getSequenceNbr()); registerInfoMap.put("SEQUENCE_NBR", registerInfo.getSequenceNbr());
String equCategory = registerInfo.getEquCategory();//设备类别
String equDefine = registerInfo.getEquDefine();//设备品种
List<EquipmentCategory> categoryList1 = commonService.getEquipmentCategoryList(equCategory, null);
if(CollectionUtils.isNotEmpty(categoryList1)){
registerInfoMap.put("EQU_CATEGORY_DESC",categoryList1.get(0).getName());
}
List<EquipmentCategory> categoryList2 = commonService.getEquipmentCategoryList(equDefine, null);
if(CollectionUtils.isNotEmpty(categoryList2)){
registerInfoMap.put("EQU_DEFINE_DESC",categoryList2.get(0).getName());
}
objMap.putAll(registerInfoMap); objMap.putAll(registerInfoMap);
} }
//维保备案 //维保备案
IdxBizJgMaintenanceRecordInfo maintenanceRecordInfo = iIdxBizJgMaintenanceRecordInfoService.getOneData(record); IdxBizJgMaintenanceRecordInfo maintenanceRecordInfo = iIdxBizJgMaintenanceRecordInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(maintenanceRecordInfo)) { if (!ValidationUtil.isEmpty(maintenanceRecordInfo)) {
Map<String, Object> maintenanceRecordInfoMap = new HashMap<>(); Map<String, Object> maintenanceRecordInfoMap = convertCamelToUnderscore(maintenanceRecordInfo, null);
String[] fields = null;
maintenanceRecordInfoMap = this.convertCamelToUnderscore(maintenanceRecordInfo, fields);
maintenanceRecordInfoMap.put("MAINTENANCERECORDINFO_SEQ", maintenanceRecordInfo.getSequenceNbr()); maintenanceRecordInfoMap.put("MAINTENANCERECORDINFO_SEQ", maintenanceRecordInfo.getSequenceNbr());
objMap.putAll(maintenanceRecordInfoMap); objMap.putAll(maintenanceRecordInfoMap);
} }
//监督管理 //监督管理
IdxBizJgSupervisionInfo supervisionInfo = iIdxBizJgSupervisionInfoService.getOneData(record); IdxBizJgSupervisionInfo supervisionInfo = iIdxBizJgSupervisionInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(supervisionInfo)) { if (!ValidationUtil.isEmpty(supervisionInfo)) {
Map<String, Object> supervisionInfoMap = new HashMap<>(); Map<String, Object> supervisionInfoMap = convertCamelToUnderscore(supervisionInfo, null);
String[] fields = null;
supervisionInfoMap = this.convertCamelToUnderscore(supervisionInfo, fields);
supervisionInfoMap.put("SUPERVISIONINFO_SEQ", supervisionInfo.getSequenceNbr()); supervisionInfoMap.put("SUPERVISIONINFO_SEQ", supervisionInfo.getSequenceNbr());
objMap.putAll(supervisionInfoMap); objMap.putAll(supervisionInfoMap);
} }
//其他信息 //其他信息
IdxBizJgOtherInfo otherInfo = iIdxBizJgOtherInfoService.getOneData(record); IdxBizJgOtherInfo otherInfo = iIdxBizJgOtherInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(otherInfo)) { if (!ValidationUtil.isEmpty(otherInfo)) {
Map<String, Object> otherInfoMap = new HashMap<>(); Map<String, Object> otherInfoMap = convertCamelToUnderscore(otherInfo, null);
String[] fields = null;
otherInfoMap = this.convertCamelToUnderscore(otherInfo, fields);
otherInfoMap.put("OTHERINFO_SEQ", otherInfo.getSequenceNbr()); otherInfoMap.put("OTHERINFO_SEQ", otherInfo.getSequenceNbr());
objMap.putAll(otherInfoMap); objMap.putAll(otherInfoMap);
} }
//检验检测 //检验检测
IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.getOneData(record); IdxBizJgInspectionDetectionInfo inspectionDetectionInfo = iIdxBizJgInspectionDetectionInfoService.getOneData(record);
if (!ValidationUtil.isEmpty(inspectionDetectionInfo)) { if (!ValidationUtil.isEmpty(inspectionDetectionInfo)) {
Map<String, Object> inspectionDetectionInfoMap = new HashMap<>();
String[] fields = {"INSPECT_REPORT"}; String[] fields = {"INSPECT_REPORT"};
inspectionDetectionInfoMap = this.convertCamelToUnderscore(inspectionDetectionInfo, fields); Map<String, Object> inspectionDetectionInfoMap = convertCamelToUnderscore(inspectionDetectionInfo, fields);
inspectionDetectionInfoMap.put("INSPECTIONDETECTIONINFO_SEQ", inspectionDetectionInfo.getSequenceNbr()); inspectionDetectionInfoMap.put("INSPECTIONDETECTIONINFO_SEQ", inspectionDetectionInfo.getSequenceNbr());
objMap.putAll(inspectionDetectionInfoMap); objMap.putAll(inspectionDetectionInfoMap);
} }
...@@ -287,9 +288,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -287,9 +288,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
//电梯 //电梯
IdxBizJgTechParamsElevator elevator = iIdxBizJgTechParamsElevatorService.getOneData(record); IdxBizJgTechParamsElevator elevator = iIdxBizJgTechParamsElevatorService.getOneData(record);
if (!ValidationUtil.isEmpty(elevator)) { if (!ValidationUtil.isEmpty(elevator)) {
Map<String, Object> elevatorMap = new HashMap<>();
String[] fields = {"EXPLOSIONPROOF_SIGN_COMPLETE"}; String[] fields = {"EXPLOSIONPROOF_SIGN_COMPLETE"};
elevatorMap = this.convertCamelToUnderscore(elevator, fields); Map<String, Object> elevatorMap = convertCamelToUnderscore(elevator, fields);
elevatorMap.put("ELEVATOR_SEQ", elevator.getSequenceNbr()); elevatorMap.put("ELEVATOR_SEQ", elevator.getSequenceNbr());
objMap.putAll(elevatorMap); objMap.putAll(elevatorMap);
} }
...@@ -304,18 +304,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -304,18 +304,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
//主要零部件 //主要零部件
IdxBizJgMainParts mainParts = iIdxBizJgMainPartsService.getOneData(record); IdxBizJgMainParts mainParts = iIdxBizJgMainPartsService.getOneData(record);
if (!ValidationUtil.isEmpty(mainParts)) { if (!ValidationUtil.isEmpty(mainParts)) {
Map<String, Object> mainPartsMap = new HashMap<>(); Map<String, Object> mainPartsMap = convertCamelToUnderscore(mainParts, null);
String[] fields = null;
mainPartsMap = this.convertCamelToUnderscore(mainParts, fields);
mainPartsMap.put("MAINPARTS_SEQ", mainParts.getSequenceNbr()); mainPartsMap.put("MAINPARTS_SEQ", mainParts.getSequenceNbr());
objMap.putAll(mainPartsMap); objMap.putAll(mainPartsMap);
} }
//安全附件 //安全附件
IdxBizJgProtectionDevices protectionDevices = iIdxBizJgProtectionDevicesService.getOneData(record); IdxBizJgProtectionDevices protectionDevices = iIdxBizJgProtectionDevicesService.getOneData(record);
if (!ValidationUtil.isEmpty(protectionDevices)) { if (!ValidationUtil.isEmpty(protectionDevices)) {
Map<String, Object> protectionDevicesMap = new HashMap<>(); Map<String, Object> protectionDevicesMap = convertCamelToUnderscore(protectionDevices, null);
String[] fields = null;
protectionDevicesMap = this.convertCamelToUnderscore(protectionDevices, fields);
protectionDevicesMap.put("PROTECTIONDEVICES_SEQ", protectionDevices.getSequenceNbr()); protectionDevicesMap.put("PROTECTIONDEVICES_SEQ", protectionDevices.getSequenceNbr());
objMap.putAll(protectionDevicesMap); objMap.putAll(protectionDevicesMap);
} }
......
//package com.yeejoin.amos.boot.module.ymt.api.controller;
//
//import com.yeejoin.amos.boot.biz.common.controller.BaseController;
//import com.yeejoin.amos.boot.module.ymt.api.service.ICreateCodeService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//import org.typroject.tyboot.core.foundation.enumeration.UserType;
//import org.typroject.tyboot.core.restful.doc.TycloudOperation;
//import org.typroject.tyboot.core.restful.utils.ResponseHelper;
//import org.typroject.tyboot.core.restful.utils.ResponseModel;
//import java.util.List;
//
///**
// *
// * 生成顺序码
// * @author LiuLin
// * @date 2023-12-14
// */
//@RestController
//@Api(tags = "生成顺序码")
//@RequestMapping(value = "/code")
//public class CreateCodeController extends BaseController {
//
// @Autowired
// private ICreateCodeService createCodeService;
//
// /**
// * 申请单编号生成
// * @param type type
// * @param batchSize batchSize
// * @return List
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/ANCode")
// @ApiOperation(httpMethod = "POST", value = "申请单编号生成", notes = "申请单编号生成")
// public ResponseModel<List<String>> createANCode(@RequestParam("type") String type,
// @RequestParam("batchSize") int batchSize) {
// return ResponseHelper.buildResponse(createCodeService.createApplicationFormCode(type,batchSize));
// }
//
// /**
// * 生成设备注册编码
// * @param key key
// * @return String
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/DRCode")
// @ApiOperation(httpMethod = "POST", value = "生成设备注册编码", notes = "生成设备注册编码")
// public ResponseModel<String> createDRCode(@RequestParam("key") String key) {
// return ResponseHelper.buildResponse(createCodeService.createDeviceRegistrationCode(key));
// }
//
// /**
// * 使用登记证生成
// * @param key key
// * @return String
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/URCode")
// @ApiOperation(httpMethod = "POST", value = "使用登记证生成", notes = "使用登记证生成")
// public ResponseModel<String> createURCode(@RequestParam("key") String key) {
// return ResponseHelper.buildResponse(createCodeService.createUseRegistrationCode(key));
// }
//
// /**
// * 96333顺序码生成
// * @param key key
// * @return String
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/elevatorCode")
// @ApiOperation(httpMethod = "POST", value = "96333顺序码生成", notes = "96333顺序码生成")
// public ResponseModel<String> elevatorCode(@RequestParam("key") String key) {
// return ResponseHelper.buildResponse(createCodeService.createElevatorCode(key));
// }
//
// /**
// * 监管顺序码生成
// * @param key key
// * @return String
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY)
// @PostMapping(value = "/sequenceKeyCode")
// @ApiOperation(httpMethod = "POST", value = "监管顺序码生成", notes = "监管顺序码生成")
// public ResponseModel<String> sequenceKeyCode(@RequestParam("key") String key) {
// return ResponseHelper.buildResponse(createCodeService.createSupervisoryCode(key));
// }
//}
package com.yeejoin.amos.boot.module.ymt.api.service;
import java.util.List;
/**
* 生成码服务类
* @author LiuLin
* @date 2023-12-14
*/
public interface IGenerateCodeService {
/**
* 生成申请单编号(13位,GZ20231214000)
* @param type 枚举类型
* @param batchSize 生成个数
* @return List
*/
List<String> createApplicationFormCode(String type, int batchSize);
/**
* 生成设备注册编码(20位)
* @param key key
* @return 顺序编号
*/
String createDeviceRegistrationCode(String key);
/**
* 生成使用登记证编号(13位,起11陕C00001(23))
* @param key key
* @return 顺序编号
*/
String createUseRegistrationCode(String key);
/**
* 96333编码生成(7位)
* @param key key
* @return 96333顺序码
*/
String createElevatorCode(String key);
/**
* 回退顺序码
* @param key redisKey
* @return bool
*/
boolean reduceElevatorCode(String key);
/**
* 监管编码生成(7位)
* @param key key
* @return 7位监管编码生成
*/
String createSupervisoryCode(String key);
}
package com.yeejoin.amos.boot.module.ymt.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ymt.api.service.IGenerateCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
/**
*
* 生成顺序码
* @author LiuLin
* @date 2023-12-14
*/
@RestController
@Api(tags = "生成顺序码")
@RequestMapping(value = "/generate-code")
public class GenerateCodeController extends BaseController {
@Autowired
private IGenerateCodeService generateCodeService;
/**
* 申请单编号生成
* @param type type
* @param batchSize batchSize
* @return List
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/applicationFormCode")
@ApiOperation(httpMethod = "POST", value = "申请单编号生成", notes = "申请单编号生成")
public ResponseModel<List<String>> createApplicationFormCode(@RequestParam("type") String type,
@RequestParam("batchSize") int batchSize) {
return ResponseHelper.buildResponse(generateCodeService.createApplicationFormCode(type,batchSize));
}
/**
* 生成设备注册编码
* @param key key
* @return String
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/deviceRegistrationCode")
@ApiOperation(httpMethod = "POST", value = "生成设备注册编码", notes = "生成设备注册编码")
public ResponseModel<String> createDeviceRegistrationCode(@RequestParam("key") String key) {
return ResponseHelper.buildResponse(generateCodeService.createDeviceRegistrationCode(key));
}
/**
* 使用登记证生成
* @param key key
* @return String
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/useRegistrationCode")
@ApiOperation(httpMethod = "POST", value = "使用登记证生成", notes = "使用登记证生成")
public ResponseModel<String> createUseRegistrationCode(@RequestParam("key") String key) {
return ResponseHelper.buildResponse(generateCodeService.createUseRegistrationCode(key));
}
}
...@@ -59,6 +59,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsVesselMappe ...@@ -59,6 +59,7 @@ import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgTechParamsVesselMappe
import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.SuperviseInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.SupervisoryCodeInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.SupervisoryCodeInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.service.IEquipmentCategoryService; import com.yeejoin.amos.boot.module.ymt.api.service.IEquipmentCategoryService;
import com.yeejoin.amos.boot.module.ymt.api.service.IGenerateCodeService;
import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo; import com.yeejoin.amos.boot.module.ymt.api.vo.EquipExportVo;
import com.yeejoin.amos.boot.module.ymt.biz.dao.ESElavtorRepository; import com.yeejoin.amos.boot.module.ymt.biz.dao.ESElavtorRepository;
import com.yeejoin.amos.boot.module.ymt.biz.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.ymt.biz.dao.ESEquipmentCategory;
...@@ -105,7 +106,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -105,7 +106,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
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 java.io.IOException; import java.io.IOException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -126,7 +126,6 @@ import java.util.concurrent.ExecutorService; ...@@ -126,7 +126,6 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.IntStream; import java.util.stream.IntStream;
import static com.alibaba.fastjson.JSON.toJSONString; import static com.alibaba.fastjson.JSON.toJSONString;
/** /**
...@@ -269,6 +268,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -269,6 +268,9 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
IdxFeignService idxFeignService; IdxFeignService idxFeignService;
@Autowired @Autowired
IGenerateCodeService generateCodeService;
@Autowired
private static final String TABLENAME = "tableName"; private static final String TABLENAME = "tableName";
@Autowired @Autowired
private ESElavtorRepository esElavtorRepository; private ESElavtorRepository esElavtorRepository;
...@@ -707,12 +709,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -707,12 +709,12 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
* 具体生成监管码和电梯96333识别码逻辑 * 具体生成监管码和电梯96333识别码逻辑
*/ */
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
public synchronized Map<String, String> creatCode(String isNotXiXian,String city, String county, String equipCategory, String code96333, String supervisionCode) { public Map<String, String> creatCode(String isNotXiXian,String city, String county, String equipCategory, String code96333, String supervisionCode) {
RLock lock = redissonClient.getLock(LOCK_KEY); //RLock lock = redissonClient.getLock(LOCK_KEY);
Map<String, String> resultMap = null; Map<String, String> resultMap = null;
try { try {
lock.lock(); // 获取锁 //lock.lock(); // 获取锁
log.info("加锁成功"); //log.info("加锁成功");
resultMap = new HashMap<>(); resultMap = new HashMap<>();
StringBuilder supervisorCode = new StringBuilder(); StringBuilder supervisorCode = new StringBuilder();
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
...@@ -731,7 +733,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -731,7 +733,7 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
//查询未使用的电梯码 //查询未使用的电梯码
categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode()); categoryOtherInfo = categoryOtherInfoMapper.selectElevatorCode(prefix, EquipmentCategoryEnum.WSY.getCode());
//如果存在未使用的电梯码则启用未使用的否则创建 //如果存在未使用的电梯码则启用未使用的否则创建
String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? createElevatorCode(prefix) : categoryOtherInfo.getCode(); String elevator = ObjectUtils.isEmpty(categoryOtherInfo) ? generateCodeService.createElevatorCode("96333_"+ prefix) : categoryOtherInfo.getCode();
if (!ObjectUtils.isEmpty(categoryOtherInfo)) { if (!ObjectUtils.isEmpty(categoryOtherInfo)) {
supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333", categoryOtherInfo.getCode())); supervisoryCodeInfoMapper.delete(new QueryWrapper<SupervisoryCodeInfo>().eq("code96333", categoryOtherInfo.getCode()));
} }
...@@ -775,10 +777,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -775,10 +777,11 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
resultMap.put("qrCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString()); resultMap.put("qrCode", ObjectUtils.isEmpty(supervisorCode) ? null : supervisorCode.toString());
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
lock.unlock(); // 释放锁
log.info("释放锁");
} }
//finally {
// lock.unlock(); // 释放锁
// log.info("释放锁");
//}
return resultMap; return resultMap;
} }
...@@ -803,34 +806,39 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -803,34 +806,39 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county); Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), county);
division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString(); division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), city).get("code").toString() : divisionMap.get("code").toString();
} }
supervisorCode.append(division).append(equipCategory).append("-"); //supervisorCode.append(division).append(equipCategory).append("-");
supervisorCode.append(division).append(equipCategory);
return generateCodeService.createSupervisoryCode(String.valueOf(supervisorCode));
//获取行政区划区县、市是否存在历史监管码 //获取行政区划区县、市是否存在历史监管码
CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString()); //CategoryOtherInfo supervisor = categoryOtherInfoMapper.selectSupervisorCode(supervisorCode.toString());
//生成对应监管码 //生成对应监管码
if (!ObjectUtils.isEmpty(supervisor) && supervisor.getSupervisoryCode() != null) { //if (!ObjectUtils.isEmpty(supervisor) && supervisor.getSupervisoryCode() != null) {
//获取补零位长度 // //获取补零位长度
String supervisoryCode = supervisor.getSupervisoryCode().substring(6); // String supervisoryCode = supervisor.getSupervisoryCode().substring(6);
long num = Long.valueOf(supervisoryCode) + 1; // long num = Long.valueOf(supervisoryCode) + 1;
int numLength = String.valueOf(num).length(); // int numLength = String.valueOf(num).length();
int a = 7 - numLength; // int a = 7 - numLength;
StringBuilder zero = new StringBuilder(); // StringBuilder zero = new StringBuilder();
for (int i = 0; i < a; i++) { // for (int i = 0; i < a; i++) {
zero.append(EquipmentCategoryEnum.BLW.getCode()); // zero.append(EquipmentCategoryEnum.BLW.getCode());
} // }
zero.append(num); // zero.append(num);
supervisorCode.append(zero); // supervisorCode.append(zero);
} else { //} else {
supervisorCode.append(EquipmentCategoryEnum.JGM.getCode()); // supervisorCode.append(EquipmentCategoryEnum.JGM.getCode());
} //}
return supervisorCode.toString(); //return supervisorCode.toString();
} }
/** /**
*
* 生成96333电梯识别码 * 生成96333电梯识别码
* *
* @param prefix 电梯码前缀 * @param prefix 电梯码前缀
* @return 96333电梯识别码 * @return 96333电梯识别码
*/ */
@Deprecated
public String createElevatorCode(String prefix) { public String createElevatorCode(String prefix) {
StringBuilder elevatorCode = new StringBuilder(); StringBuilder elevatorCode = new StringBuilder();
//生成生成96333电梯码前缀 //生成生成96333电梯码前缀
...@@ -1622,7 +1630,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD ...@@ -1622,7 +1630,8 @@ public class EquipmentCategoryServiceImpl extends BaseService<EquipmentCategoryD
supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.YSY.getCode()); supervisoryCodeInfo.setStatus(EquipmentCategoryEnum.YSY.getCode());
if (category.startsWith("3")) { if (category.startsWith("3")) {
if ("null".equals(map.get("code"))) { if ("null".equals(map.get("code"))) {
code96333 = createElevatorCode("31"); //code96333 = createElevatorCode("31");
code96333 = generateCodeService.createElevatorCode("96333_31");
supervisoryCodeInfo.setCreateStatus(CREATE); supervisoryCodeInfo.setCreateStatus(CREATE);
} else { } else {
supervisoryCodeInfo.setCreateStatus(NOT_CREATE); supervisoryCodeInfo.setCreateStatus(NOT_CREATE);
......
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