Commit 572af7da authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_bugfix' into develop_tzs_register

# Conflicts: # amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgVehicleInformationServiceImpl.java # amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/biz/service/impl/TzBaseEnterpriseInfoServiceImpl.java # amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-biz/src/main/java/com/yeejoin/amos/boot/module/tcm/flc/biz/service/impl/RegUnitInfoServiceImpl.java
parents a51e8f0d 8d947879
......@@ -196,4 +196,10 @@ public class ESEquipmentCategoryDto {
*/
@Field(type = FieldType.Integer, name = "DATA_QUALITY_SCORE")
private Integer dataQualityScore;
/**
* 创建时间
*/
@Field(type = FieldType.Long)
private Long CREATE_DATE;
}
......@@ -306,7 +306,7 @@ public class TzBaseEnterpriseInfoDto extends BaseDto {
private String cityCode;
@ApiModelProperty(value = "创建时间")
protected Date createDate;
protected String createDate;
/**
......
......@@ -36,8 +36,15 @@
<select id="page"
resultType="com.yeejoin.amos.boot.module.jczs.api.dto.TzBaseEnterpriseInfoDto">
SELECT
*,
SELECT "sequence_nbr","use_unit_code","supervise_code","use_unit_certificate","unit_type","use_code","use_unit","supervise_org_code",
"supervise_org_name","key_unit","class_places","province","city","district","street","community",
"address","legal_person","legal_phone","use_contact","contact_phone","safety_one","safety_one_id","safety_one_phone",
"safety_two","safety_two_id","safety_two_phone","longitude","latitude","sync_date","sync_state","app_id","rec_date","rec_user_id",
"governing_body","data_sources","industry","registration_authority","approval_time","operating_status","mainten_person","mainten_telephone",
"sqa","quality_person","quality_telephone","technical_person","is_delete","rec_user_name","equip_category","unit_business_license","unit_exequatur",
"safety_two_photo","safety_one_photo","sqa_phone","qr_code","industry_supervisor","regulatory_labels",
"register_type","other_accessories","status" ,"org_code","office_region","office_address",
DATE_FORMAT(create_date,'%Y-%m-%d') as createDate,
CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address
FROM
......@@ -87,8 +94,15 @@
<select id="pageList"
resultType="com.yeejoin.amos.boot.module.jczs.api.dto.TzBaseEnterpriseInfoDto">
SELECT
*,
SELECT "sequence_nbr","use_unit_code","supervise_code","use_unit_certificate","unit_type","use_code","use_unit","supervise_org_code",
"supervise_org_name","key_unit","class_places","province","city","district","street","community",
"address","legal_person","legal_phone","use_contact","contact_phone","safety_one","safety_one_id","safety_one_phone",
"safety_two","safety_two_id","safety_two_phone","longitude","latitude","sync_date","sync_state","app_id","rec_date","rec_user_id",
"governing_body","data_sources","industry","registration_authority","approval_time","operating_status","mainten_person","mainten_telephone",
"sqa","quality_person","quality_telephone","technical_person","is_delete","rec_user_name","equip_category","unit_business_license","unit_exequatur",
"safety_two_photo","safety_one_photo","sqa_phone","qr_code","industry_supervisor","regulatory_labels",
"register_type","other_accessories","status" ,"org_code","office_region","office_address",
DATE_FORMAT(create_date,'%Y-%m-%d') as createDate,
CONCAT(province,'/',city,'/',district) AS region,
CONCAT(street,'/',address) AS full_address
FROM
......@@ -123,6 +137,14 @@
AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.useContact!=null and tzBaseEnterpriseInfoDto.useContact!='' ">
AND use_contact LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useContact},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.contactPhone!=null and tzBaseEnterpriseInfoDto.contactPhone!='' ">
AND contact_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.contactPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
......@@ -156,7 +178,7 @@
<if test="sort != null">
${sort.field} ${sort.sortType},
</if>
rec_date DESC,sequence_nbr DESC
create_date DESC,sequence_nbr DESC
</select>
<select id="queryBaseEnterpriseInIds" resultType="com.yeejoin.amos.boot.module.jczs.api.vo.BaseEnterpriseVo">
......
......@@ -50,9 +50,6 @@ public class UserInfoVo {
@ExcelProperty("住址")
private String address;
@ExcelProperty(value = "执业注册")
private String practiceRegistration;
@ExcelProperty("平台账户名")
private String amosUserName;
......@@ -81,6 +78,7 @@ public class UserInfoVo {
protected Date transferOutTime;
@ExcelProperty("检验检测-级别")
@DictCode2DictName(type = "RYJB_JC", typeHandler = "platformDictTypeHandler")
private String permissionLevel;
@ExcelProperty("检验检测-资质项目")
......
......@@ -125,10 +125,7 @@
group_concat(DISTINCT c.name)
from
idx_biz_jg_register_info jri,tz_equipment_category c where jri.EQU_DEFINE = c.code and jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equDefine,
(SELECT
group_concat(DISTINCT ibjsi.ORG_BRANCH_NAME)
from
idx_biz_jg_supervision_info ibjsi where ibjsi.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as orgBranchName
(select c.company_name from privilege_company c where c.org_code = ur.supervision_org_code and c.is_deleted = false limit 1) as orgBranchName
from
tzs_jg_use_registration ur
......@@ -209,10 +206,7 @@
group_concat(DISTINCT c.name)
from
idx_biz_jg_register_info jri,tz_equipment_category c where jri.EQU_DEFINE = c.code and jri.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as equDefine,
(SELECT
group_concat(DISTINCT ibjsi.ORG_BRANCH_NAME)
from
idx_biz_jg_supervision_info ibjsi where ibjsi.RECORD in (select re.equ_id from tzs_jg_use_registration_eq re where ur.sequence_nbr = re.equip_transfer_id)) as orgBranchName
(select c.company_name from privilege_company c where c.org_code = ur.supervision_org_code and c.is_deleted = false limit 1) as orgBranchName
from
tzs_jg_use_registration ur
</sql>
......@@ -977,9 +971,6 @@
<choose>
<when test="jsonObject.DATA_SOURCE == 'jg_his_black'">
and ui."DATA_SOURCE" like 'jg_his_black%'
and CURRENT_DATE <![CDATA[<]]> (select NEXT_INSPECT_DATE
from idx_biz_jg_inspection_detection_info
where "RECORD" = ui."RECORD" ORDER BY REC_DATE DESC limit 1 )
</when>
<when test="jsonObject.DATA_SOURCE == 'jg_his'">
and ui."DATA_SOURCE" like 'jg_his%'
......
......@@ -130,7 +130,7 @@ public class JgChangeVehicleRegistrationUnitController extends BaseController {
@RequestParam(value = "size") int size,
@RequestParam(value = "useUnitCreditCode", required = false) String useUnitCreditCode,
@RequestParam(value = "whetherVehicleCylinder") String whetherVehicleCylinder,
@RequestParam(value = "certificateStatus") String certificateStatus,
@RequestParam(value = "certificateStatus", required = false) String certificateStatus,
@RequestParam(value = "useRegistrationCode", required = false) String useRegistrationCode) {
if (ValidationUtil.isEmpty(useUnitCreditCode))
throw new BadRequest("请先选择原使用单位");
......
......@@ -717,6 +717,7 @@ public class DataDockServiceImpl {
ESEquipmentCategoryDto equipmentCategoryDto = JSON.parseObject(toJSONString(map), ESEquipmentCategoryDto.class);
if (!ObjectUtils.isEmpty(equipmentCategoryDto)) {
long time = Timestamp.valueOf(map.get("REC_DATE").toString().substring(0, 19)).getTime();
equipmentCategoryDto.setCREATE_DATE(time);
equipmentCategoryDto.setREC_DATE(time);
equipmentCategoryDto.setSTATUS("已认领");
equipmentCategoryDto.setIS_DO_BUSINESS(Boolean.TRUE);
......@@ -2110,6 +2111,7 @@ public class DataDockServiceImpl {
ESEquipmentCategoryDto esEquipmentDto = JSON.parseObject(toJSONString(pipeline), ESEquipmentCategoryDto.class);
esEquipmentDto.setDATA_SOURCE(paramsDto.getDataSource());
esEquipmentDto.setREC_DATE(System.currentTimeMillis());
esEquipmentDto.setCREATE_DATE(System.currentTimeMillis());
esEquipmentDto.setSEQUENCE_NBR(record);
esEquipmentDto.setIS_INTO_MANAGEMENT(Boolean.TRUE);
esEquipmentDto.setEQU_CATEGORY_CODE(paramsDto.getEquCategoryCode());
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapBuilder;
......@@ -463,7 +464,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
return ResponseHelper.buildResponse(batchSubmitOrUpdatePipeline(equipmentInfoForm, submitType));
} catch (Exception e) {
log.error("操作失败,数据异常: {}", e.getMessage(), e);
handleError(e, String.valueOf(paramMap.getOrDefault(SEQUENCE_NBR, "未知序号")));
handleError(e, String.valueOf(paramMap.getOrDefault(SEQUENCE_NBR, "")));
return ResponseHelper.buildResponse(null);
}
}
......@@ -566,6 +567,9 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if ("add".equals(submitType)) {
projectContraption.setCreateDate(date);
}
if (StringUtils.isEmpty(projectContraption.getProjectContraption())) {
throw new BadRequest("请填写工程(装置)名称/项目名称后暂存!");
}
idxBizJgProjectContraptionService.saveOrUpdateData(projectContraption);
List<IdxBizJgUseInfo> useInfoList = initializeList();
......@@ -823,7 +827,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
.map(String::valueOf)
.map(String::trim)
.orElse(null);
if (dataSource.equals("jg_his") && useRegistrationCode == null || Objects.requireNonNull(useRegistrationCode).isEmpty()) {
if (useRegistrationCode == null) {
throw new BadRequest("请填写使用登记证编号后进行暂存!");
}
String equipId = String.valueOf(equipmentInfoForm.get("RECORD"));
......@@ -1089,10 +1093,14 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if(!PipelineEnum.PRESSURE_PIPELINE.getCode().equals(map.get("equList"))) {
this.checkForDelete(records);
}
// 删除涉及的19张表的数据
superviseInfoMapper.deleteDataAll(records);
// 删除es中的数据
esEquipmentCategory.deleteAll(list);
if (CollUtil.isNotEmpty(records)) {
// 删除涉及的19张表的数据
superviseInfoMapper.deleteDataAll(records);
}
if (CollUtil.isNotEmpty(list)) {
// 删除es中的数据
esEquipmentCategory.deleteAll(list);
}
return true;
}
......@@ -3738,6 +3746,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (!ObjectUtils.isEmpty(dto)) {
long time = Timestamp.valueOf(map.get("REC_DATE").toString().substring(0, 19)).getTime();
dto.setREC_DATE(time);
dto.setCREATE_DATE(time);
// 需要安装的设备 安装告知审批通过 清除设备的USC_UNIT_CREDIT_CODE安装单位信息
// 使用单位编辑 防止更新设备时将安改维单位信息更新到es中
CompanyBo company = getSelectedOrgInfo().getCompany();
......@@ -4132,6 +4141,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if (inspectionDetectionInfo.getNextInspectDate() != null) {
esEquipmentDto.setNEXT_INSPECT_DATE(inspectionDetectionInfo.getNextInspectDate().getTime());
}
esEquipmentDto.setCREATE_DATE(System.currentTimeMillis());
esEquipmentDto.setREC_DATE(System.currentTimeMillis());
esEquipmentDto.setSEQUENCE_NBR(record);
esEquipmentDto.setFACTORY_NUM(factoryInfo.getFactoryNum());
......
......@@ -206,7 +206,11 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//区内移装,需判断是否为同一地市,如果不是同一地市,返回异常 -> 610000#610200#610204#610204002
if ("0".equals(tableData.get("transferType"))) {
deviceList.forEach(device -> {
String deviceCity = Arrays.stream(((String) device.get("USE_PLACE_CODE")).split("#"))
Object usePlaceCodeObj = device.get("USE_PLACE_CODE");
if (usePlaceCodeObj == null) {
throw new BadRequest("没有查询到地市信息");
}
String deviceCity = Arrays.stream(((String) usePlaceCodeObj).split("#"))
.skip(1)
.findFirst()
.orElseThrow(() -> new BadRequest("没有查询到地市信息"));
......@@ -217,7 +221,11 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
});
} else {
deviceList.forEach(device -> {
String deviceCity = Arrays.stream(((String) device.get("USE_PLACE_CODE")).split("#"))
Object usePlaceCodeObj = device.get("USE_PLACE_CODE");
if (usePlaceCodeObj == null) {
throw new BadRequest("没有查询到地市信息");
}
String deviceCity = Arrays.stream(((String) usePlaceCodeObj).split("#"))
.skip(1)
.findFirst()
.orElseThrow(() -> new BadRequest("没有查询到地市信息"));
......@@ -1025,6 +1033,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
.set(JgUseRegistrationManage::getIsScrap, 1)
// TODO 区外移装,业务已限制需要先注销证,这主要目的是将韩城、杨凌的特殊《区内逻辑》但是需要新生成的证的把之前证改成已注销
.set(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIZHUXIAO.getName())
.set(JgUseRegistrationManage::getIsDoBusiness, "3")// 限制区外移装后的老证不可办理业务,但是证管理可以查看
.in(JgUseRegistrationManage::getSequenceNbr,
registrationList.stream()
.map(JgUseRegistrationManage::getSequenceNbr)
......
......@@ -1215,6 +1215,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
map1.put("USE_UNIT_CREDIT_CODE", companyCode.length > 1 ? companyCode[1] : registration.getNewUseUnitCreditCode());
map1.put("USE_UNIT_NAME", registration.getNewUseUnitName());
map1.put("REC_DATE", new Date());// 更新时间,设备筛选时排在前面 bug-21476
map1.put("EQU_STATE", "1");
resultMap.put(equipId, map1);
//修改各类告知列表,置为废弃
this.updataInvalidStatusByHistory(equipId, registration.getApplyNo());
......@@ -1238,6 +1239,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
idxBizJgUseInfoService.update(
new IdxBizJgUseInfo()
.setEstateUnitCreditCode(enterpriseInfo.getUseUnitCode())
.setEquState(EquimentEnum.ZAIYONG.getCode().toString())
.setEstateUnitName(enterpriseInfo.getUseUnit()),
new LambdaQueryWrapper<IdxBizJgUseInfo>()
.in(IdxBizJgUseInfo::getRecord, records)
......@@ -1269,6 +1271,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
registrationManage.setReceiveCompanyCode(registration.getReceiveOrgCode());
registrationManage.setAuditPassDate(registration.getAuditPassDate());
registrationManage.setVersion(registrationManage.getVersion() + 1);
registrationManage.setCertificateStatus("已登记");
if ("5000".equals(registrationManage.getEquListCode())) {
String targetCode = registrationManage.getUseRegistrationCode();
dto.getRegistrationList().stream()
......
......@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgUseInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
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.IdxBizJgOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper;
......@@ -455,6 +456,7 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
HashMap<String, Map<String, Object>> objMap = new HashMap<>();
ids.forEach(item -> {
HashMap<String, Object> param = new HashMap<>();
param.put("EQU_STATE", EquimentEnum.ZAIYONG.getCode().toString());
param.put("USE_UNIT_NAME", jgChangeVehicleRegistrationUnit.getNewUseUnitName());
param.put("USE_UNIT_CREDIT_CODE", jgChangeVehicleRegistrationUnit.getNewUseUnitCreditCode());
// 更新车用气瓶变更登记后,修改气瓶的单位内部编号为车牌号 bug23732
......@@ -571,6 +573,7 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
manage.setChangeReason(BusinessTypeEnum.JG_VEHICLE_GAS_CYLINDER_CHANGE.getName());
manage.setSuperviseOrgCode(jgChangeVehicleRegistrationUnit.getOrgBranchCode());
manage.setSuperviseOrgName(jgChangeVehicleRegistrationUnit.getOrgBranchName());
manage.setCertificateStatus("已登记");
jgUseRegistrationManageService.updateById(manage);
// 保存证流水信息
jgCertificateChangeRecord.setUseRegistrationCode(manage.getUseRegistrationCode());
......@@ -593,6 +596,7 @@ public class JgChangeVehicleRegistrationUnitServiceImpl extends BaseService<JgCh
LambdaUpdateWrapper<IdxBizJgUseInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(IdxBizJgUseInfo::getRecord, collect);
updateWrapper.set(IdxBizJgUseInfo::getUseInnerCode, jgChangeVehicleRegistrationUnit.getNewCarNumber());
updateWrapper.set(IdxBizJgUseInfo::getEquState, EquimentEnum.ZAIYONG.getCode().toString());
jgUseInfoMapper.update(null, updateWrapper);
}
......
package com.yeejoin.amos.boot.module.jg.biz.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -15,6 +17,7 @@ import com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisableEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.BusinessTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CertificateStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.*;
import com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService;
......@@ -105,6 +108,9 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
@Autowired
private JgUseRegistrationManageMapper jgUseRegistrationManageMapper;
@Autowired
private JgUseRegistrationManageServiceImpl useRegistrationManageService;
/**
* 设备状态:启用
*/
......@@ -218,7 +224,7 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
List<IdxBizJgInspectionDetectionInfo> inspectInfos = jgInspectionDetectionInfoService.checkInspectionInfo(record);
List<Date> nextInspectDates = inspectInfos.stream().map(IdxBizJgInspectionDetectionInfo::getNextInspectDate).collect(Collectors.toList());
Date currentDate = new Date();
nextInspectDates.forEach(next -> {
nextInspectDates.stream().filter(Objects::nonNull).forEach(next -> {
// 下次检验日期在当前时间之前的
if (next.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()
.isBefore(currentDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate())) {
......@@ -660,6 +666,20 @@ public class JgEnableDisableServiceImpl extends BaseService<JgEnableDisableDto,
// 2.更新设备的es数据的状态:启用->停用,停用->启用
updateEquipEsData(jgEnableDisableEq, idxBizJgUseInfo);
});
String useRegistrationCodeStr = jgEnableDisable.getUseRegistrationCode();
List<String> useRegistrationCodeList = Optional.ofNullable(useRegistrationCodeStr)
.map(str -> Arrays.stream(str.split(","))
.map(String::trim)
.filter(StrUtil::isNotBlank)
.collect(Collectors.toList()))
.orElse(Collections.emptyList());
if (CollUtil.isNotEmpty(useRegistrationCodeList)) {
useRegistrationManageService.lambdaUpdate()
.set(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName())
.in(JgUseRegistrationManage::getUseRegistrationCode, useRegistrationCodeList)
.update();
}
}
private void updateEquipEsData(JgEnableDisableEq jgScrapCancelEq, IdxBizJgUseInfo idxBizJgUseInfo) {
......
......@@ -32,6 +32,7 @@ import com.yeejoin.amos.boot.module.jg.api.enums.PipelineEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
import com.yeejoin.amos.boot.module.jg.api.vo.SortVo;
import com.yeejoin.amos.boot.module.jg.api.vo.tableDataExportVo.InstallationVo;
......@@ -203,6 +204,8 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private JgTransferNoticeServiceImpl jgTransferNoticeService;
@Autowired
private JgMaintainNoticeServiceImpl jgMaintainNoticeService;
@Autowired
private JgUseRegistrationMapper jgUseRegistrationMapper;
/**
......@@ -374,6 +377,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
equips.forEach(equip -> {
Map<String, Object> objectHashMap = new HashMap<>();
BeanUtil.beanToMap(equip, objectHashMap, false, false);
objectHashMap.replaceAll((k, v) -> v == null ? "" : v);
objectHashMap.put("record", equip.getSEQUENCE_NBR());
objectHashMap.put("ADDRESS", concatDetailAddress(equip));
arrayList.add(objectHashMap);
......@@ -409,7 +413,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo.put("equDefineName", projectContraption.getEquDefineName());
equipListMaps = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionId);
equipListMaps.forEach(item ->
item.put("deviceLevel", Optional.ofNullable(dataDictionaryMapper.selectById(String.valueOf(item.get("deviceLevel"))))
item.put("deviceLevel", Optional.ofNullable(dataDictionaryMapper.getByCode(String.valueOf(item.get("deviceLevel")),"8300"))
.map(DataDictionary::getName)
.orElse("")));
} else {
......@@ -952,6 +956,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
*/
private void buildTaskDraft(List<JgInstallationNotice> list) {
List<TaskModelDto> modelDtos = new ArrayList<>();
String equType = Optional.ofNullable(list)
.filter(l -> !l.isEmpty())
.map(l -> l.get(0))
.map(JgInstallationNotice::getEquListCode)
.map(jgUseRegistrationMapper::getEquType)
.orElse(null);
assert list != null;
list.forEach(obj -> {
TaskModelDto dto = new TaskModelDto();
// 行数据
......@@ -959,7 +970,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
BeanUtils.copyProperties(obj, taskMessageDto);
dto.setModel(taskMessageDto);
// 摘要 按原有规则组装
dto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", obj.getEquList(), obj.getApplyNo()));
dto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", equType, obj.getApplyNo()));
// 申请单号
dto.setTaskCode(obj.getApplyNo());
// 业务类型枚举code值
......@@ -974,6 +985,13 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
private void buildTask(List<JgInstallationNotice> list, List<WorkflowResultDto> workflowResultList, Boolean isDeleteDraft) {
List<TaskModelDto> taskModelDtoList = new ArrayList<>();
WorkflowResultDto workflowResultDto = workflowResultList.get(0);
String equType = Optional.ofNullable(list)
.filter(l -> !l.isEmpty())
.map(l -> l.get(0))
.map(JgInstallationNotice::getEquListCode)
.map(jgUseRegistrationMapper::getEquType)
.orElse(null);
assert list != null;
list.forEach(item -> {
TaskModelDto taskModelDto = new TaskModelDto();
taskModelDto.setFlowCreateDate(item.getCreateDate());
......@@ -992,7 +1010,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
taskModelDto.setStartUserCompanyName(item.getCreateUserCompanyName()); // 任务发起人所在单位
taskModelDto.setStartDate(item.getCreateDate());
taskModelDto.setNextExecuteUser(item.getNextExecuteIds());
taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo()));
taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", equType, item.getApplyNo()));
TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(item, taskMessageDto);
taskModelDto.setModel(taskMessageDto);
......@@ -2006,7 +2024,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
List<Map<String, Object>> deviceList = projectContraptionService.getBaseMapper().selectEquipList(projectContraptionSeq);
deviceList.forEach(device -> {
String deviceLevel = String.valueOf(device.get("deviceLevel"));
device.put("deviceLevel", dataDictionaryMapper.selectById(deviceLevel).getName());
device.put("deviceLevel", dataDictionaryMapper.getByCode(deviceLevel,"8300").getName());
device.put("sequenceNbr", projectContraptionSeq);
device.put("equListName", projectContraption.getEquListName());
});
......
......@@ -986,6 +986,7 @@ public class JgScrapCancelServiceImpl extends BaseService<JgScrapCancelDto, JgSc
useRegistrationManage.setChangeReason(BusinessTypeEnum.JG_EQUIPMENT_CANCEL.getName());
useRegistrationManage.setIsScrap("1");
useRegistrationManage.setRecDate(new Date());
useRegistrationManage.setIsDoBusiness("3");//报废修改为3,不可做业务,可以被证管理查询到
}
jgUseRegistrationManageService.updateBatchById(jgUseRegistrationManageList);
}
......
......@@ -883,7 +883,7 @@ public class JgTableDataExportServiceImpl implements IJgTableDataExportService {
@Override
public void userInfoExport(String uuid, String ids, Map<String, Object> map) {
List<String> userInfoSeqs = getUserInfoSeqs(false, ids, map);
List<Map<String, String>> enterInfoWithExport = tzsUserInfoMapper.getUserInfoWithExport(userInfoSeqs);
List<Map<String, String>> enterInfoWithExport = tzsUserInfoMapper.getUserInfoWithExport("false",userInfoSeqs);
List<UserInfoVo> exportData = JSON.parseArray(JSON.toJSONString(enterInfoWithExport), UserInfoVo.class);
DictUtil.dictCode2DictName(exportData);
MultipartFile templateExcelFile = ExcelUtil.createTemplateExcelFile("人员信息列表数据", "人员信息列表列表", exportData, UserInfoVo.class, null, false);
......@@ -899,7 +899,7 @@ public class JgTableDataExportServiceImpl implements IJgTableDataExportService {
@Override
public void userInfoExportWithAdmin(String uuid, String ids, Map<String, Object> map) {
List<String> userInfoSeqs = getUserInfoSeqs(true, ids, map);
List<Map<String, String>> enterInfoWithExport = tzsUserInfoMapper.getUserInfoWithExport(userInfoSeqs);
List<Map<String, String>> enterInfoWithExport = tzsUserInfoMapper.getUserInfoWithExport("true", userInfoSeqs);
List<UserInfoVo> exportData = JSON.parseArray(JSON.toJSONString(enterInfoWithExport), UserInfoVo.class);
DictUtil.dictCode2DictName(exportData);
MultipartFile templateExcelFile = ExcelUtil.createTemplateExcelFile("人员信息列表数据", "人员信息列表列表", exportData, UserInfoVo.class, null, false);
......
......@@ -565,7 +565,11 @@ public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistr
BoolQueryBuilder elcBuilder = QueryBuilders.boolQuery();
if (EquimentEnum.BAOFEI.getCode().equals(Integer.valueOf(enableType))) { // 报废业务选择未报废的设备
elcBuilder.mustNot(QueryBuilders.matchPhraseQuery("EQU_STATE", QueryParser.escape(enableType)));
} else {
} else if (EquimentEnum.TINGYONG.getCode().equals(Integer.valueOf(enableType))){
elcBuilder.must(QueryBuilders.termsQuery("EQU_STATE", "2", "4"));
}else if (EquimentEnum.ZAIYONG.getCode().equals(Integer.valueOf(enableType))){
elcBuilder.must(QueryBuilders.termsQuery("EQU_STATE", "1", "4"));
}else{
elcBuilder.must(QueryBuilders.matchPhraseQuery("EQU_STATE", QueryParser.escape(enableType)));
}
boolQuery.must(elcBuilder);
......
......@@ -421,6 +421,13 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
IdxBizJgRegLambda.eq(IdxBizJgRegisterInfo::getRecord, map.get("equipId"))
.set(IdxBizJgRegisterInfo::getRegisterState, this.getRegCode()).set(IdxBizJgRegisterInfo::getCylinderCategory, map.get("cylinderCategory"));
idxBizJgRegisterInfoService.update(IdxBizJgRegLambda);
// 更新制造信息-产品编号
LambdaUpdateWrapper<IdxBizJgFactoryInfo> factoryLambda = new UpdateWrapper<IdxBizJgFactoryInfo>().lambda();
factoryLambda.eq(IdxBizJgFactoryInfo::getRecord, map.get("equipId"))
.set(IdxBizJgFactoryInfo::getFactoryNum, map.get("factoryNum"));
idxBizJgFactoryInfoService.update(factoryLambda);
// 更新设备监管部门
IdxBizJgSupervisionInfo idxBizJgSupervisionInfo = new IdxBizJgSupervisionInfo();
if (map.containsKey("orgBranchCode") && !ObjectUtils.isEmpty(map.get("orgBranchCode"))) {
......@@ -875,14 +882,14 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.collect(toSet())
: Collections.emptySet();
if (EquipmentClassifityEnum.YLGD.getCode().equals(equListCode) && !CollectionUtils.isEmpty(equipmentLists)) {
/*if (EquipmentClassifityEnum.YLGD.getCode().equals(equListCode) && !CollectionUtils.isEmpty(equipmentLists)) {
equipmentLists.forEach(equip -> {
if ((equip.get("inspectReportNo") == null || equip.get("inspectReportNo").toString().isEmpty()) ||
(equip.get("inspectOrgCode") == null || equip.get("inspectOrgCode").toString().isEmpty())) {
throw new BadRequest("检验信息不能为空,请完善检验信息后进行登记!");
}
});
}
}*/
List<Map<String, Object>> filteredEquipmentLists = Optional.ofNullable(equipmentLists)
.orElse(Collections.emptyList())
......@@ -1468,7 +1475,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.eq(JgUseRegistrationManage::getUseRegistrationCode, jgUseRegistration.getUseRegistrationCode())
.eq(JgUseRegistrationManage::getIsDelete, 0)
.eq(JgUseRegistrationManage::getCertificateStatus, CertificateStatusEnum.YIDENGJI.getName()).one();
changeRecord.setCertificateNo(manage.getCertificateNo());//登记证书唯一码
changeRecord.setCertificateNo(ValidationUtil.isEmpty(manage) ? this.genCertificateNo(registerInfo, jgUseRegistration) : manage.getCertificateNo());//登记证书唯一码
}
changeRecord.setUseUnitCreditCode(jgUseRegistration.getUseUnitCreditCode());//使用单位统一信用代码
changeRecord.setUseUnitName(jgUseRegistration.getUseUnitName());//使用单位名称
......@@ -1479,6 +1486,18 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
certificateChangeRecordService.save(changeRecord);
}
public String genCertificateNo(IdxBizJgRegisterInfo registerInfo, JgUseRegistration jgUseRegistration) {
String ym = "";
try {
ym = Optional.of(DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN_MM)).orElse(DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN_MM));
} catch (ParseException e) {
log.error("日期转换失败:", e);
}
String equCode = Optional.ofNullable(registerInfo.getEquDefine()).orElse(registerInfo.getEquCategory());
String registrationCode = equCode + jgUseRegistration.getReceiveCompanyOrgCode() + ym;
return tzsServiceFeignClient.deviceRegistrationCode(registrationCode).getResult();
}
/**
* 更新登记证管理表数据
*
......@@ -1515,6 +1534,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
* @param registerInfo 一码通设备注册信息表
*/
private void generateRegistrationManage(JgUseRegistration jgUseRegistration, IdxBizJgRegisterInfo registerInfo, Boolean flag, Long useRegistrationManageSeq) {
IdxBizJgUseInfo useInfo = useInfoMapper.selectOne(new QueryWrapper<IdxBizJgUseInfo>().lambda().eq(IdxBizJgUseInfo::getRecord, registerInfo.getRecord()));
if (flag) {
// LambdaQueryWrapper<JgUseRegistrationManage> queryWrapper = new LambdaQueryWrapper<>();
......@@ -1540,7 +1560,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
JgUseRegistrationManage jgUseRegistrationManage = new JgUseRegistrationManage();
jgUseRegistrationManage.setUseUnitName(jgUseRegistration.getUseUnitName());
jgUseRegistrationManage.setApplyNo(jgUseRegistration.getApplyNo());
jgUseRegistrationManage.setCertificateStatus(CertificateStatusEnum.YIDENGJI.getName());
jgUseRegistrationManage.setCertificateStatus(EquimentEnum.ZHUXIAO.getCode().toString().equals(useInfo.getEquState()) ? CertificateStatusEnum.YIZHUXIAO.getName() : CertificateStatusEnum.YIDENGJI.getName());
jgUseRegistrationManage.setReceiveOrgName(jgUseRegistration.getReceiveOrgName());
jgUseRegistrationManage.setAuditPassDate(jgUseRegistration.getAuditPassDate());
jgUseRegistrationManage.setRegType(BusinessTypeEnum.JG_USAGE_REGISTRATION.getName());
......@@ -1927,9 +1947,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
param.put("ADDRESS", dataMap.getOrDefault("address", ""));
param.put("USE_PLACE", usePlace);
param.put("STATUS", "已认领");
if (useInfo.getEquState() == null){
param.put("EQU_STATE", 1);
}
param.put("EQU_STATE", useInfo.getEquState());
// 更新es的下次检验日期
param.put("NEXT_INSPECT_DATE", this.castDate2TimeStr(dataMap.getString("nextInspectDate")));
param.put("USE_INNER_CODE", useInfo.getUseInnerCode());
......@@ -4860,7 +4878,6 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
.map(JSON::parseObject)
.orElse(new JSONObject());
re.put("useRegistrationCode", p.getUseRegistrationCode());
re.put("safetyManager", h.getOrDefault("safetyManagerId", "") + "_" + h.getOrDefault("safetyManager", ""));
re.put("useDate", h.getOrDefault("useDate", p.getUseDate()));
re.put("otherAccessories", h.get("otherAccessories"));
re.put("province", h.getOrDefault("province", p.getProvince()));
......
......@@ -2396,7 +2396,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 更新设备信息
this.updateEquipInfo(vehicleInformation, registerInfo, otherInfo, String.valueOf(x.get("record")));
// 更新es
this.updateEquipEsData(vehicleInformation, otherInfo, registerInfo, String.valueOf(x.get("record")));
this.updateEquipEsData(vehicleInformation, otherInfo, registerInfo, String.valueOf(x.get("record")), useInfo);
// 查询设备制造信息
LambdaQueryWrapper<IdxBizJgFactoryInfo> factoryInfoWrapper = new LambdaQueryWrapper<>();
factoryInfoWrapper.eq(IdxBizJgFactoryInfo::getRecord, String.valueOf(x.get("record")));
......
......@@ -432,6 +432,7 @@ public class ShCarServiceImpl extends BaseService<ShCar, ShCar, ShCarMapper> imp
IdxBizJgUseInfo useInfo = JSON.parseObject(JSON.toJSONString(equObj), IdxBizJgUseInfo.class);
useInfo.setRecord(equRecord);
useInfo.setRecDate(date);
useInfo.setCreateDate(date);
useInfo.setDataSource("jg_his_sh");
useInfo.setIsIntoManagement(Boolean.TRUE);
useInfo.setEquState("1");
......
......@@ -871,7 +871,7 @@
<w:sz w:val="24"/>
</w:rPr>
<w:pict>
<v:shape id="文本框 20" o:spid="_x0000_s1029" o:spt="202" type="#_x0000_t202" style="position:absolute;left:0pt;margin-left:254.45pt;margin-top:132.1pt;height:20.5pt;width:165.5pt;z-index:251678720;mso-width-relative:page;mso-height-relative:page;" fillcolor="#FFFFFF" filled="t" stroked="f" coordsize="21600,21600">
<v:shape id="文本框 20" o:spid="_x0000_s1029" o:spt="202" type="#_x0000_t202" style="position:absolute;left:0pt;margin-left:254.45pt;margin-top:132.1pt;height:20.5pt;width:275.5pt;z-index:251678720;mso-width-relative:page;mso-height-relative:page;" fillcolor="#FFFFFF" filled="t" stroked="f" coordsize="21600,21600">
<v:path/>
<v:fill on="t" color2="#FFFFFF" focussize="0,0"/>
<v:stroke on="f" weight="0.5pt"/>
......
......@@ -14,20 +14,33 @@ public class QualificationProjectConverter implements Converter<String> {
private static final Map<String,String> CODE_MAP = new HashMap<>();
static {
CODE_MAP.put("检验员-大型游乐设施检验","YLY");
CODE_MAP.put("检验员-场(厂)内专用机动车辆检验","CCY");
CODE_MAP.put("检验员-承压类设备型式试验","CXY");
CODE_MAP.put("检验员-机电类设备型式试验","JXY");
CODE_MAP.put("检验员-锅炉检验","GLY");
CODE_MAP.put("检验员-锅炉能效测试","GNY");
CODE_MAP.put("检验员-锅炉水(介)质检验-蒸汽锅炉(额定压力小于或者等于2.5MPa)、热水锅炉和有机热载体锅炉的定期检验和监督检验","GSY");
CODE_MAP.put("检验员-锅炉水(介)质检验-热载体锅炉价值的定期检验和化学清洗过程的监督检验","GRY");
CODE_MAP.put("检验员-压力容器检验","RQY");
CODE_MAP.put("检验员-气瓶检验","QPY");
CODE_MAP.put("检验员-压力管道检验","GDY");
CODE_MAP.put("检验员-电梯检验","DTY");
CODE_MAP.put("检验员-起重机械检验","QZY");
CODE_MAP.put("检验员-客运索道检验","SDY");
CODE_MAP.put("检验师-大型游乐设施检验","YLS");
CODE_MAP.put("检验师-锅炉水(介)质检验","SZS");
CODE_MAP.put("检验师-压力容器检验","RQS");
CODE_MAP.put("检验师-压力管道检验","GDS");
CODE_MAP.put("检验师-电梯检验","DTS");
CODE_MAP.put("检验师-起重机械检验","QZS");
CODE_MAP.put("检验师-客运索道检验","SDS");
CODE_MAP.put("检验师-锅炉检验","GLS");
CODE_MAP.put("检验师-场(厂)内专用机动车辆检验","CCS");
CODE_MAP.put("机电类设备检验","JDG");
CODE_MAP.put("承压类设备检验","CYG");
CODE_MAP.put("大型游乐设施检验","YLY");
CODE_MAP.put("型式试验","CXY");
CODE_MAP.put("锅炉检验","GLY");
CODE_MAP.put("锅炉能效测试","GNY");
CODE_MAP.put("锅炉水(介)质检验","GSY");
CODE_MAP.put("压力容器检验","RQY");
CODE_MAP.put("气瓶检验","QPY");
CODE_MAP.put("压力管道检验","GDY");
CODE_MAP.put("电梯检验","DTY");
CODE_MAP.put("起重机械检验","QZY");
CODE_MAP.put("客运索道检验","SDY");
CODE_MAP.put("场(厂)内专用机动车辆检验","CCY");
}
@Override
......
......@@ -14,9 +14,9 @@ public class TestLevelConverter implements Converter<String> {
private static final Map<String,String> CODE_MAP = new HashMap<>();
static {
CODE_MAP.put("Ⅰ级(初级)","RYJB_JC");
CODE_MAP.put("Ⅱ级(中级)","RYJB_JC");
CODE_MAP.put("Ⅲ级(高级)","RYJB_JC");
CODE_MAP.put("Ⅰ级初级","I");
CODE_MAP.put("Ⅱ级中级","II");
CODE_MAP.put("Ⅲ级高级","III");
}
@Override
......
......@@ -14,18 +14,26 @@ public class TestProjectConverter implements Converter<String> {
private static final Map<String,String> CODE_MAP = new HashMap<>();
static {
CODE_MAP.put("声发射检测","ZZXM_III");
CODE_MAP.put("涡流检测","ZZXM_III");
CODE_MAP.put("渗透检测","ZZXM_III");
CODE_MAP.put("磁粉检测","ZZXM_III");
CODE_MAP.put("脉冲反射法超声检测","ZZXM_III");
CODE_MAP.put("射线数字成像检测","ZZXM_II");
CODE_MAP.put("脉冲反射法超声检测(自动)","ZZXM_II");
CODE_MAP.put("衍射时差法超声检测","ZZXM_II");
CODE_MAP.put("相控阵超声检测","ZZXM_II");
CODE_MAP.put("涡流检测(自动)","ZZXM_II");
CODE_MAP.put("漏磁检测(自动)","ZZXM_II");
CODE_MAP.put("射线胶片照相检测","ZZXM_II");
CODE_MAP.put("安全阀校验","F");
CODE_MAP.put("射线胶片照相检测","RT");
CODE_MAP.put("脉冲反射法超声检测","UT");
CODE_MAP.put("磁粉检测","MT");
CODE_MAP.put("渗透检测","PT");
CODE_MAP.put("射线数字成像检测","RT(D)");
CODE_MAP.put("脉冲反射法超声检测(自动)","UT(AUTO)");
CODE_MAP.put("衍射时差法超声检测","TOFD");
CODE_MAP.put("相控阵超声检测","PA");
CODE_MAP.put("涡流检测(自动)","ECT(AUTO)");
CODE_MAP.put("漏磁检测(自动)","MFL(AUTO)");
// CODE_MAP.put("射线胶片照相检测","RT");
// CODE_MAP.put("脉冲反射法超声检测","UT");
// CODE_MAP.put("磁粉检测","MT");
CODE_MAP.put("声发射检测","AE");
CODE_MAP.put("涡流检测","ECT");
// CODE_MAP.put("渗透检测","PT");
// CODE_MAP.put("磁粉检测","MT");
// CODE_MAP.put("脉冲反射法超声检测","UT");
// CODE_MAP.put("射线胶片照相检测","RT");
}
@Override
......
......@@ -4,6 +4,7 @@ import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.tcm.api.converter.*;
import lombok.Data;
......@@ -97,7 +98,7 @@ public class CompanyUserImportDto {
private String permissionLevel;
@NotBlank(message = "检验资质项目不能为空!")
@ExcelProperty(value = "项目", converter = QualificationProjectConverter.class)
@ExcelProperty(value = "项目")
private String permissionItem;
@NotBlank(message = "检验资质发证日期不能为空!")
......@@ -175,6 +176,8 @@ public class CompanyUserImportDto {
@ExcelIgnore
private JSONArray jobItem;
@ExcelIgnore
private JSONObject itemCode;
@ExcelProperty(value = "金属焊接操作-项目代号")
private String JSHJCZItemCode;
......
......@@ -123,6 +123,14 @@
AND legal_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.legalPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.useContact!=null and tzBaseEnterpriseInfoDto.useContact!='' ">
AND use_contact LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.useContact},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.contactPhone!=null and tzBaseEnterpriseInfoDto.contactPhone!='' ">
AND contact_phone LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.contactPhone},'%')
</if>
<if
test="tzBaseEnterpriseInfoDto.superviseOrgCode!=null and tzBaseEnterpriseInfoDto.superviseOrgCode!='' ">
AND supervise_org_code LIKE CONCAT('%',#{tzBaseEnterpriseInfoDto.superviseOrgCode},'%')
</if>
......
......@@ -67,8 +67,6 @@ import org.typroject.tyboot.core.restful.exception.instance.TooManyRequests;
import java.text.ParseException;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
......@@ -1244,7 +1242,6 @@ public class TzBaseEnterpriseInfoServiceImpl
// 省内充装单位1231:生成对接数据账号
// final String FILLING_UNIT_TYPE = RegUnitInfoServiceImpl.FILLING_UNIT_TYPE;
// 20250701 改为全部企业类型生成对接数据账号@tianbo
// if (unitTypeCodes.contains(FILLING_UNIT_TYPE)
// && (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide()))) {
if (ValidationUtil.isEmpty(regUnitInfo.getIsNationwide()) || "0".equals(regUnitInfo.getIsNationwide())) {
......
......@@ -1428,7 +1428,7 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
String sheetName = readSheet.getSheetName();
int sheetNo = readSheet.getSheetNo();
// 忽略 sheet页:企业人员录入限制(参考)
if (sheetName.contains("企业人员录入限制")) {
if (sheetName.contains("企业人员录入限制") || sheetName.contains("隐藏")) {
continue;
}
// 人员信息 sheet页
......@@ -1487,52 +1487,55 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
}).headRowNumber(2).sheet(sheetNo, sheetName).doRead();
}
}
// 存在检验不通过的数据则返回错误信息,不在向下写入库
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
// 3.数据入库
dataList.forEach(data -> {
TzsUserInfoDto dto = new TzsUserInfoDto();
BeanUtils.copyProperties(data, dto);
dto.setCreateDate(new Date());
try {
this.saveUserInfo(dto);
} catch (Exception e) {
sheetError.add(dto.getName() + "-" + dto.getCertificateNum() + ":" + e.getMessage());
}
});
// 第二次捕获save中的异常
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
// 存在检验不通过的数据则返回错误信息,不在向下写入库
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
// 3.数据入库
dataList.forEach(data -> {
TzsUserInfoDto dto = new TzsUserInfoDto();
BeanUtils.copyProperties(data, dto);
dto.setCreateDate(new Date());
try {
this.saveUserInfo(dto);
} catch (Exception e) {
sheetError.add(dto.getName() + "-" + dto.getCertificateNum() + ":" + e.getMessage());
}
});
// 第二次捕获save中的异常
if (!sheetError.isEmpty()) {
sendErrorContext(sheetError);
}
return ResponseHelper.buildResponse("success");
}
private void sendErrorContext(ArrayList<String> sheetError) throws IOException {
private void sendErrorContext(ArrayList<String> sheetError) {
// 发送错误文件
String uuid = UUID.randomUUID().toString();
startDownLoadMsg("人员导入错误文件", uuid);
File tempFile = File.createTempFile("errors", ".txt");
try (FileWriter writer = new FileWriter(tempFile)) {
for (String error : sheetError) {
writer.write(error + System.lineSeparator());
try {
String uuid = UUID.randomUUID().toString();
startDownLoadMsg("人员导入错误文件", uuid);
File tempFile = File.createTempFile("errors", ".txt");
try (FileWriter writer = new FileWriter(tempFile)) {
for (String error : sheetError) {
writer.write(error + System.lineSeparator());
}
}
byte[] fileContent = Files.readAllBytes(tempFile.toPath());
MultipartFile mockMultipartFile = new MockMultipartFile("errors.txt", "errors.txt", "text/plain", fileContent);
String urlString = this.uploadExcelFile(mockMultipartFile);
sendDownLoadExcelMsg(String.format(DOWNLOAD_TOPIC, RequestContext.getToken()), new JSONObject()
.fluentPut("id", uuid)
.fluentPut("status", "done")
.fluentPut("fileName", "人员导入错误文件")
.fluentPut("url", urlString)
.fluentPut("time", new Date().getTime()));
tempFile.delete();
} finally {
throw new BadRequest("数据校验错误,详见人员导入错误文件!");
}
byte[] fileContent = Files.readAllBytes(tempFile.toPath());
MultipartFile mockMultipartFile = new MockMultipartFile("errors.txt", "errors.txt", "text/plain", fileContent);
String urlString = this.uploadExcelFile(mockMultipartFile);
sendDownLoadExcelMsg(String.format(DOWNLOAD_TOPIC, RequestContext.getToken()), new JSONObject()
.fluentPut("id", uuid)
.fluentPut("status", "done")
.fluentPut("fileName", "人员导入错误文件")
.fluentPut("url", urlString)
.fluentPut("time", new Date().getTime()));
tempFile.delete();
throw new BadRequest("校验出错,请查看错误文件!");
}
private void companyUserCheckField(ArrayList<String> sheetError, String sheetName, List<CompanyUserImportDto> dataList,
......@@ -1641,6 +1644,16 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
dataList.forEach(data -> {
if (!ValidationUtil.isEmpty(data.getCertificateNum()) && data.getCertificateNum().equals(inspectItem.getCertificateNum())) {
JSONArray permissionData66151 = data.getPermissionData66151();
// , converter = QualificationProjectConverter.class
String permissionLevel = inspectItem.getPermissionLevel();
if (!ValidationUtil.isEmpty(permissionLevel)) {
String permissionItem = inspectItem.getPermissionItem();
Systemctl.dictionarieClient.dictValues("ZZXM_" + permissionLevel).getResult()
.stream()
.filter(x -> permissionItem.equals(StringUtils.isEmpty(x.getDictDataDesc()) ? x.getDictDataValue() : x.getDictDataValue() + "-" + x.getDictDataDesc()))
.findFirst()
.ifPresent(x -> inspectItem.setPermissionItem(x.getDictDataKey()));
}
permissionData66151.add(inspectItem);
data.setPermissionData66151(permissionData66151);
}
......@@ -1694,6 +1707,14 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
JSONArray objects = new JSONArray();
objects.add(OperatorQua.getJobItemStr());
OperatorQua.setJobItem(objects);
JSONObject itemCode = new JSONObject();
if (!ValidationUtil.isEmpty(OperatorQua.getFJSHJCZItemCode())) {
itemCode.fluentPut("FJSHJCZItemCode",OperatorQua.getFJSHJCZItemCode());
}
if (!ValidationUtil.isEmpty(OperatorQua.getJSHJCZItemCode())) {
itemCode.fluentPut("JSHJCZItemCode",OperatorQua.getJSHJCZItemCode());
}
OperatorQua.setItemCode(itemCode);
permissionData6552.add(OperatorQua);
data.setPermissionData6552(permissionData6552);
}
......@@ -2185,7 +2206,12 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
Map.Entry<String, JsonNode> entry = fields.next();
String postCode = entry.getKey();// 主岗位
JsonNode subPostCode = entry.getValue();// 子岗位
allPostUnderTheUnit.put(postCode, subPostCode);
// 确保最大范围包含子类型
if (subPostCode.isEmpty()){
allPostUnderTheUnit.put(postCode, subPostCode);
}else {
allPostUnderTheUnit.putIfAbsent(postCode, subPostCode);
}
}
}
});
......
......@@ -114,15 +114,18 @@ public class TzsUserPermissionServiceImpl extends BaseService<TzsUserPermissionD
// 作业项目中含有【金属焊接操作】,则【金属焊接操作-项目代号】必填
// 作业项目中含有【非金属焊接操作】,则【非金属焊接操作-项目代号】必填
// 作业项目中含有【其他】,则【其他作业项目是必填的】必填
String jobItem = String.valueOf(itempermissionData6552.get("jobItem"));
JSONArray jobItem = JSON.parseArray(JSON.toJSONString(itempermissionData6552.get("jobItem")));
String otherItem = String.valueOf(itempermissionData6552.get("otherItem"));
JSONObject itemCode = JSON.parseObject(String.valueOf(itempermissionData6552.get("itemCode")));
if (jobItem.contains("金属焊接操作") && !ObjectUtils.isEmpty(itemCode) && ObjectUtils.isEmpty(itemCode.get("JSHJCZItemCode"))) {
throw new BadRequest("作业项目中含有金属焊接操作,需填写金属焊接操作-项目代号");
}
if (jobItem.contains("非金属焊接操作") && !ObjectUtils.isEmpty(itemCode) && ObjectUtils.isEmpty(itemCode.get("FJSHJCZItemCode"))) {
throw new BadRequest("作业项目中含有非金属焊接操作,需填写非金属焊接操作-项目代号");
}
jobItem.forEach(job ->{
String jobStr = String.valueOf(job);
if (jobStr.equals("金属焊接操作") && !ObjectUtils.isEmpty(itemCode) && ObjectUtils.isEmpty(itemCode.get("JSHJCZItemCode"))) {
throw new BadRequest("作业项目中含有金属焊接操作,需填写金属焊接操作-项目代号");
}
if (jobStr.equals("非金属焊接操作") && !ObjectUtils.isEmpty(itemCode) && ObjectUtils.isEmpty(itemCode.get("FJSHJCZItemCode"))) {
throw new BadRequest("作业项目中含有非金属焊接操作,需填写非金属焊接操作-项目代号");
}
});
if (jobItem.contains("其他") && ObjectUtils.isEmpty(otherItem)) {
throw new BadRequest("作业项目中含有其他,需填写其他作业项目");
}
......
......@@ -20,5 +20,5 @@ public interface TzsUserInfoMapper extends BaseMapper<TzsUserInfo> {
List<TzsUserInfoDto> selectUserPermission(@Param("operator") String operator, @Param("posts") List<String> posts);
List<Map<String, String>> getUserInfoWithExport(@Param("ids") List<String> userInfoSeqs);
List<Map<String, String>> getUserInfoWithExport(@Param("isAdmin") String isAdmin, @Param("ids") List<String> userInfoSeqs);
}
......@@ -103,7 +103,7 @@
<select id="getUserInfoWithExport" resultType="java.util.Map">
SELECT
ur."name",ur."certificate_type",ur."certificate_num",ur."post",ur."phone",ur."birthday",ur."education",ur."speciality",ur."email",ur."address",ur."identification",ur."profile",ur."rec_date",ur."rec_user_id",ur."rec_user_name",ur."amos_user_id",ur."amos_user_name",ur."unit_name",ur."is_delete",ur."lock_status",ur."unit_code",ur."post_name",ur."equip_type",ur."appoint_doc",ur."inner_person_code",ur."other_accessories",ur."permission_level",ur."permission_item",ur."permission_data",ur."new_post",ur."job_title",ur."qr_code_state",ur."sub_post",ur."sub_post_name",ur."transfer_out_time",ur."practice_registration",ur."labor_contract",
ur."name",ur."certificate_type",ur."certificate_num",ur."post",ur."phone",ur."birthday",ur."education",ur."speciality",ur."email",ur."address",ur."identification",ur."profile",ur."rec_date",ur."rec_user_id",ur."rec_user_name",ur."amos_user_id",ur."amos_user_name",ur."unit_name",ur."is_delete",ur."lock_status",ur."unit_code",ur."post_name",ur."equip_type",ur."appoint_doc",ur."inner_person_code",ur."other_accessories",ur."new_post",ur."job_title",ur."qr_code_state",ur."sub_post",ur."sub_post_name",ur."transfer_out_time",ur."practice_registration",ur."labor_contract",
up."permission_level", up."permission_item", up."permission_post", up."cert_no", up."expiry_date", up."approved_organ", up."issue_date", up."cert_attachment", up."cert_type", up."job_item", up."other_item", up."remark", up."rec_date", up."rec_user_id", up."rec_user_name", up."item_code",
CASE
WHEN ur.gender = 1 THEN
......@@ -116,12 +116,18 @@
FROM "amos_tzs_biz"."tzs_user_info" ur
LEFT JOIN "amos_tzs_biz"."tzs_user_permission" up ON ur."sequence_nbr" = up."user_seq"
<where>
<if test='ids != null'>
<if test='ids != null and isAdmin == "true"'>
and (COALESCE (up.sequence_nbr, ur.sequence_nbr)) in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test='ids != null and isAdmin == "false"'>
and ur.sequence_nbr in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
</where>
</select>
</mapper>
\ No newline at end of file
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