Commit 210f9fa0 authored by 刘林's avatar 刘林

Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register

parents 4be4070b 0206e2a6
......@@ -21,7 +21,7 @@ public interface JgUseRegistrationMapper extends BaseMapper<JgUseRegistration> {
Map<String, Object> getDetail(@Param("id")String id);
Map<String, Object> getInspectDetail(@Param("id")String id);
Map<String, Object> getInspectDetail(@Param("id") String id, @Param("permissionInspectTypes") List<String> permissionInspectTypes);
Map<String, Object> getUseDetail(@Param("id")String id);
......
......@@ -127,8 +127,9 @@
jci.USC_UNIT_NAME as uscUnitName,
jci.USC_UNIT_CREDIT_CODE as uscUnitCreditCode,
jri.OTHER_ACCESSORIES_REG as otherAccessoriesReg,
jfi.OTHER_ACCESSORIES_FACT as otherAccessoriesFact
jfi.OTHER_ACCESSORIES_FACT as otherAccessoriesFact,
jfi.FACT_SUPERVISION_INSPECTION_REPORT as factSupervisionInspectionReport,
jfi.BOILER_ENERGY_EFFICIENCY_CERTIFICATE as boilerEnergyEfficiencyCertificate
from idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_factory_info jfi on jri.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_construction_info jci on jri.RECORD = jci.RECORD
......@@ -147,7 +148,14 @@
INSPECT_REPORT as inspectReport,
INSPECT_ORG_CODE as inspectOrgCode
from idx_biz_jg_inspection_detection_info
where RECORD = #{id}
where
RECORD = #{id}
<if test="permissionInspectTypes != null and permissionInspectTypes.size() > 0">
and
<foreach collection="permissionInspectTypes" item="inspectType" open="(" close=")" separator="or">
INSPECT_TYPE = #{inspectType}
</foreach>
</if>
ORDER BY INSPECT_DATE desc LIMIT 1
</select>
<select id="getUseDetail" resultType="java.util.Map">
......
......@@ -110,7 +110,16 @@ public class IdxBizJqEquipmentRegisterController extends BaseController {
@GetMapping(value = "/category/list")
@ApiOperation(httpMethod = "GET", value = "查询不同单位类型可新增的设备种类列表", notes = "查询不同单位类型可新增的设备种类列表")
public ResponseModel<List<DictionarieValueModel>> equCategoryListByCompanyType() {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo()));
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo(), null));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equ-category/listByPersonAndEquList")
@ApiOperation(httpMethod = "GET", value = "按照人员身份、设备种类查询设备类别", notes = "按照人员身份、设备种类查询设备类别")
public ResponseModel<List<DictionarieValueModel>> equCategoryList(@RequestParam(value = "equList") String equList) {
return ResponseHelper.buildResponse(idxBizJgRegisterInfoService.equCategoryListByCompanyType(getSelectedOrgInfo(), equList));
}
}
......@@ -4,7 +4,6 @@ package com.yeejoin.amos.boot.module.jg.biz.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgRegisterInfoDto;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -31,5 +30,5 @@ public interface IIdxBizJgRegisterInfoService {
Map<String, Object> getDetailFieldCamelCaseByRecord(String record);
List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo);
List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList);
}
......@@ -49,6 +49,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
......@@ -378,9 +379,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
}
@Override
public List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo) {
public List<DictionarieValueModel> equCategoryListByCompanyType(ReginParams selectedOrgInfo, String equList) {
String companyType = selectedOrgInfo.getCompany().getCompanyType();
String dictCodePrefix = getDictCodePrefix(companyType);
String dictCodePrefix = getDictCodePrefix(companyType, equList);
if(StringUtils.isEmpty(dictCodePrefix)){
return new ArrayList<>();
}
......@@ -388,7 +389,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return FeignUtil.remoteCall(()->Systemctl.dictionarieClient.dictValues(dictCode));
}
private String getDictCodePrefix(String companyType) {
private String getDictCodePrefix(String companyType, String equList) {
String dictCodePrefix = "";
if ((companyType.contains(USE_TYPE_NAME) || companyType.contains(INDIVIDUAL_TYPE_NAME)) && !companyType.contains(MAINTENANCE_TYPE_NAME)) { // 使用单位
dictCodePrefix = "USE";
......@@ -399,7 +400,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (companyType.contains(MAINTENANCE_TYPE_NAME) && companyType.contains(USE_TYPE_NAME)) { // 所有单位
dictCodePrefix = "ALL";
}
return dictCodePrefix;
return StringUtils.isNotEmpty(equList) ? equList + "_" + dictCodePrefix : dictCodePrefix;
}
......@@ -599,11 +600,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
factoryInfoMap.put("factoryStandard", JSON.parseArray(factoryInfo.getFactoryStandard()));
factoryInfoMap.put("productQualityYieldProve", JSON.parseArray(factoryInfo.getProductQualityYieldProve()));
factoryInfoMap.put("insUseMaintainExplain", JSON.parseArray(factoryInfo.getInsUseMaintainExplain()));
factoryInfoMap.put("factSupervisionInspectionReport", JSON.parseArray(factoryInfo.getFactSupervisionInspectionReport()));
factoryInfoMap.put("boilerEnergyEfficiencyCertificate", JSON.parseArray(factoryInfo.getBoilerEnergyEfficiencyCertificate()));
if (!ObjectUtils.isEmpty(factoryInfoMap.get("otherAccessoriesFact"))) {
factoryInfoMap.put("otherAccessoriesFact", JSON.parse(String.valueOf(factoryInfoMap.get("otherAccessoriesFact"))));
}
} else {
String[] fields = {"FACTORY_STANDARD", "PRODUCT_QUALITY_YIELD_PROVE", "INS_USE_MAINTAIN_EXPLAIN","OTHER_ACCESSORIES_FACT"};
String[] fields = {"FACTORY_STANDARD", "PRODUCT_QUALITY_YIELD_PROVE", "INS_USE_MAINTAIN_EXPLAIN",
"OTHER_ACCESSORIES_FACT","FACT_SUPERVISION_INSPECTION_REPORT","BOILER_ENERGY_EFFICIENCY_CERTIFICATE"};
factoryInfoMap = convertCamelToUnderscore(factoryInfo, fields);
String imported = factoryInfo.getImported();
if ("0".equals(imported)) {
......
......@@ -572,6 +572,9 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if (!ValidationUtil.isEmpty(model.getPowerOfAttorneyList())) {
model.setPowerOfAttorney(JSON.toJSONString(model.getPowerOfAttorneyList()));
}
if (!ValidationUtil.isEmpty(model.getOtherAccessories())) {
model.setOtherAccessories(JSON.toJSONString(model.getOtherAccessories()));
}
// 分割省市区字段
String province = model.getProvince();
if (!ObjectUtils.isEmpty(province)) {
......
......@@ -34,6 +34,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.boot.module.ymt.api.service.InspectionDetectionInfoService;
import com.yeejoin.amos.feign.systemctl.model.TaskV2Model;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO;
import com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO;
......@@ -49,6 +50,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
......@@ -95,7 +97,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
"inspectReport", "designStandard", "designDoc", "longitudeLatitude", "otherAccessoriesDes", "otherAccessoriesFact",
"otherAccessoriesReg", "installProxyStatementAttachment", "installContractAttachment", "insOtherAccessories",
"maintenanceContract", "maintOtherAccessories", "installProxyStatementAttachment", "installContractAttachment",
"insOtherAccessories", "maintenanceContract"};
"insOtherAccessories", "maintenanceContract","factSupervisionInspectionReport","boilerEnergyEfficiencyCertificate"};
@Autowired
private IdxBizJgUseInfoMapper useInfoMapper;
@Autowired
......@@ -209,11 +211,9 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useInfoMapper.update(useInfo, lambda);
InspectionDetectionInfo inspectionDetectionInfo = new InspectionDetectionInfo();
BeanUtil.copyProperties(map, inspectionDetectionInfo);
LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda();
inspectionLambda.eq(InspectionDetectionInfo::getRecord, map.get("equipId"));
// 更新检验检测信息
// inspectionDetectionInfo.setInspectReport(null);
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
this.updateOrCreateInspectionDetection(map.get("equipId"), inspectionDetectionInfo);
// 更新注册登记信息表
LambdaQueryWrapper<JgUseRegistrationEq> jgUseRegEqWrapper = new QueryWrapper<JgUseRegistrationEq>().lambda();
jgUseRegEqWrapper.eq(JgUseRegistrationEq::getEquipTransferId, currentDocumentId);
......@@ -240,6 +240,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
createCode(map, jgUseRegistration, registerInfo, useInfo, otherInfo);
}
private void updateOrCreateInspectionDetection(Object equipId, InspectionDetectionInfo inspectionDetectionInfo) {
LambdaQueryWrapper<InspectionDetectionInfo> inspectionLambda = new QueryWrapper<InspectionDetectionInfo>().lambda();
inspectionLambda.eq(InspectionDetectionInfo::getRecord, equipId);
InspectionDetectionInfo inspectionDetectionInfoDb = inspectionDetectionInfoMapper.selectOne(inspectionLambda);
Bean.copyExistPropertis(inspectionDetectionInfo, inspectionDetectionInfoDb);
inspectionDetectionInfoMapper.update(inspectionDetectionInfo, inspectionLambda);
}
/**
* 递归属地监管部门树匹配监管部门
*
......@@ -847,7 +855,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
// 基本信息 + 制造信息
Map<String, Object> detail = this.baseMapper.getDetail(record);
// 检验信息
Map<String, Object> inspectDetail = this.baseMapper.getInspectDetail(record);
Map<String, Object> inspectDetail = this.getInspectDetail(record);
// 使用信息
Map<String, Object> useDetail = this.baseMapper.getUseDetail(record);
// 设计信息
......@@ -878,6 +886,48 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return detail;
}
private Map<String, Object> getInspectDetail(String record){
LambdaQueryWrapper<IdxBizJgRegisterInfo> wrapper = new QueryWrapper<IdxBizJgRegisterInfo>().lambda().eq(IdxBizJgRegisterInfo::getRecord, record);
IdxBizJgRegisterInfo registerInfo = idxBizJgRegisterInfoMapper.selectOne(wrapper);
List<String> permissionInspectTypes = getInspectInfoByEquDefine(registerInfo.getEquList(), registerInfo.getEquCategory(), registerInfo.getEquDefine());
if(permissionInspectTypes.size() >0){
return this.baseMapper.getInspectDetail(record, permissionInspectTypes);
} else {
return null;
}
}
private List<String> getInspectInfoByEquDefine(String equList, String equCategory, String equDefine){
List<String> permissionInspectTypes = new ArrayList<>();
// 使用登记时:需要《首次检验》类型检验信息的设备种类、设备类别、设备品种
String[] FIRST_INSPECT_EQULIST = {"3000", "4170"};
String[] FIRST_INSPECT_EQUCATEGORY = {"4400", "4900","4A00"};
String[] FIRST_INSPECT_EQUDEFINE = {"4170"};
// 使用登记时:需要《安装监督验》类型检验信息的设备种类、设备类别、设备品种
String[] AZJDJY_INSPECT_EQULIST = {"6000","9000","8000","1000"};
String[] AZJDJY_INSPECT_EQUCATEGORY = {"4800","4300","4700","4D00","2100","2400"};
String[] AZJDJY_INSPECT_EQUDEFINE = {"4110","4130","4140","4150","4190","4220","4210","4260","4270","4290"};
// 使用登记时:需要《首次检验》或者《安装监督验检验》信息的设备种类、设备类别、设备品种
String[] SCJY_OR_AZJDJY_EQULIST = {};
String[] SCJY_OR_AZJDJY_EQUCATEGORY = {};
String[] SCJY_OR_AZJDJY_INSPECT_EQUDEFINE = {"4230","4240","4250","4280"};
if(Arrays.asList(FIRST_INSPECT_EQULIST).contains(equList) || Arrays.asList(FIRST_INSPECT_EQUCATEGORY).contains(equCategory) || Arrays.asList(FIRST_INSPECT_EQUDEFINE).contains(equDefine)){
permissionInspectTypes.add("SCJY");
return permissionInspectTypes;
}
if(Arrays.asList(AZJDJY_INSPECT_EQULIST).contains(equList) || Arrays.asList(AZJDJY_INSPECT_EQUCATEGORY).contains(equCategory) || Arrays.asList(AZJDJY_INSPECT_EQUDEFINE).contains(equDefine)){
permissionInspectTypes.add("AZJDJY");
return permissionInspectTypes;
}
if(Arrays.asList(SCJY_OR_AZJDJY_EQULIST).contains(equList) || Arrays.asList(SCJY_OR_AZJDJY_EQUCATEGORY).contains(equCategory) || Arrays.asList(SCJY_OR_AZJDJY_INSPECT_EQUDEFINE).contains(equDefine)){
permissionInspectTypes.add("SCJY");
permissionInspectTypes.add("AZJDJY");
return permissionInspectTypes;
}
// 为空时不需要检验信息,不返回检验信息
return permissionInspectTypes;
}
/**
* 填充设备最新的数据至历史json
*
......@@ -1063,7 +1113,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
useFlagParamDto.setCarNumber(registerInfo.getCarNumber());
useFlagParamDto.setApplyNo(useRegistration.getApplyNo());
// 检验信息字段设置
setInspectFidld(registerInfo, useFlagParamDto);
setInspectField(registerInfo, useFlagParamDto);
// 电梯维保信息字段设置
setMainInfoField(registerInfo, useFlagParamDto);
// 车用气瓶专用字段 暂无数据源 需车用气瓶功能开发完成后进行
......@@ -1072,8 +1122,8 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
return useFlagParamDto;
}
private void setInspectFidld(IdxBizJgRegisterInfo registerInfo, UseFlagParamDto useFlagParamDto) {
Map<String, Object> inspectDetail = this.baseMapper.getInspectDetail(registerInfo.getRecord());
private void setInspectField(IdxBizJgRegisterInfo registerInfo, UseFlagParamDto useFlagParamDto) {
Map<String, Object> inspectDetail = this.baseMapper.getInspectDetail(registerInfo.getRecord(), null);
useFlagParamDto.setInspectionUnitName(inspectDetail.get("inspectOrgName") == null ? "" : inspectDetail.get("inspectOrgName").toString());
useFlagParamDto.setNextInspectionDate(inspectDetail.get("nextInspectDate") == null ? null : (Date) inspectDetail.get("nextInspectDate"));
}
......
package com.yeejoin.amos.boot.module.ymt.api.entity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yeejoin.amos.boot.biz.common.entity.TzsBaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -14,7 +14,6 @@ import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 安全追溯-制造信息
......@@ -23,21 +22,12 @@ import java.util.List;
* @date 2023-08-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "idx_biz_jg_factory_info", autoResultMap = true)
public class IdxBizJgFactoryInfo implements Serializable {
@TableName("idx_biz_jg_factory_info")
public class IdxBizJgFactoryInfo extends TzsBaseEntity {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.UUID)
@TableField("\"SEQUENCE_NBR\"")
protected String sequenceNbr;
@TableField("\"REC_DATE\"")
protected Date recDate;
@TableField("\"REC_USER_ID\"")
protected String recUserId;
/**
*
......@@ -141,16 +131,15 @@ public class IdxBizJgFactoryInfo implements Serializable {
* * 制造监督检验报告
* */
@TableField(value ="\"FACT_SUPERVISION_INSPECTION_REPORT\"",typeHandler = JacksonTypeHandler.class)
private JSONArray factSupervisionInspectionReport;
@TableField(value = "\"FACT_SUPERVISION_INSPECTION_REPORT\"")
private String factSupervisionInspectionReport;
/**
* * 锅炉能效证明文件
* */
* * 锅炉能效证明文件
*/
@TableField(value ="\"BOILER_ENERGY_EFFICIENCY_CERTIFICATE\"",typeHandler = JacksonTypeHandler.class)
private JSONArray boilerEnergyEfficiencyCertificate;
@TableField(value = "\"BOILER_ENERGY_EFFICIENCY_CERTIFICATE\"")
private String boilerEnergyEfficiencyCertificate;
}
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