Commit e701c202 authored by yangyang's avatar yangyang

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

parents b7bcf800 4e9b721c
...@@ -199,4 +199,7 @@ public class JgTransferNoticeDto extends BaseDto { ...@@ -199,4 +199,7 @@ public class JgTransferNoticeDto extends BaseDto {
@ApiModelProperty(value = "办理日期") @ApiModelProperty(value = "办理日期")
private Date handleDate; private Date handleDate;
private String noticeReportUrl;
} }
...@@ -283,6 +283,8 @@ public class JgTransferNotice extends BaseEntity { ...@@ -283,6 +283,8 @@ public class JgTransferNotice extends BaseEntity {
@TableField("next_execute_ids") @TableField("next_execute_ids")
private String nextExecuteIds; private String nextExecuteIds;
@TableField("notice_report_url")
private String noticeReportUrl;
@TableField("status") @TableField("status")
private String status; private String status;
...@@ -293,4 +295,7 @@ public class JgTransferNotice extends BaseEntity { ...@@ -293,4 +295,7 @@ public class JgTransferNotice extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String equipCateName; private String equipCateName;
@TableField(value = "handle_date")
private Date handleDate;
} }
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
tjtn.next_execute_ids AS nextExecuteIds, tjtn.next_execute_ids AS nextExecuteIds,
tjtn.instance_status AS instanceStatus, tjtn.instance_status AS instanceStatus,
tjtn.notice_report_url AS noticeReportUrl, tjtn.notice_report_url AS noticeReportUrl,
ec."name" AS equipCateName ec."name" AS equipCateName,
tjtn.handle_date AS handleDate
FROM FROM
tzs_jg_transfer_notice tjtn tzs_jg_transfer_notice tjtn
LEFT JOIN tzs_jg_transfer_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
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
</if> </if>
</if> </if>
<if test="type == 'supervision'"> <if test="type == 'supervision'">
AND tjtn.receive_org_code = #{orgCode} AND tjtn.receive_org_code = #{orgCode} AND tjtn.instance_id IS NOT NULL
</if> </if>
<if test="type == 'enterprise'"> <if test="type == 'enterprise'">
AND tjtn.install_unit_credit_code = #{orgCode} AND tjtn.install_unit_credit_code = #{orgCode}
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
tjtn.city_name AS cityName, tjtn.city_name AS cityName,
tjtn.county_name AS countyName, tjtn.county_name AS countyName,
tjtn.promoter AS promoter, tjtn.promoter AS promoter,
tjtn.equ_register_code AS equRegisterCode,
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,
......
...@@ -5,12 +5,15 @@ import com.alibaba.fastjson.JSON; ...@@ -5,12 +5,15 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.aspose.words.SaveFormat; import com.aspose.words.SaveFormat;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile; import com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile;
import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto; import com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNotice;
import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq; import com.yeejoin.amos.boot.module.jg.api.entity.JgTransferNoticeEq;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeEqMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgTransferNoticeEqMapper;
...@@ -19,6 +22,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgTransferNoticeService; ...@@ -19,6 +22,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgTransferNoticeService;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient; import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils;
import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils; import com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.RegistrationInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
...@@ -50,6 +54,7 @@ import java.io.File; ...@@ -50,6 +54,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -179,9 +184,9 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -179,9 +184,9 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
throw new IllegalArgumentException("参数不能为空"); throw new IllegalArgumentException("参数不能为空");
} }
JgTransferNotice jgMaintainNotice = this.getById(sequenceNbr); JgTransferNotice jgTransferNotice = this.getById(sequenceNbr);
List<Map<String, Object>> informationList = jgTransferNoticeMapper.queryEquipInformation(sequenceNbr); List<Map<String, Object>> informationList = jgTransferNoticeMapper.queryEquipInformation(sequenceNbr);
if (Objects.isNull(jgMaintainNotice) || CollectionUtils.isEmpty(informationList)) { if (Objects.isNull(jgTransferNotice) || CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("移装告知单不存在"); throw new IllegalArgumentException("移装告知单不存在");
} }
Map<String, Object> maintain = informationList.get(0); Map<String, Object> maintain = informationList.get(0);
...@@ -195,18 +200,18 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -195,18 +200,18 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
placeholders.put("applyNo", getValue.apply("applyNo")); placeholders.put("applyNo", getValue.apply("applyNo"));
placeholders.put("productName", getValue.apply("productName")); placeholders.put("productName", getValue.apply("productName"));
placeholders.put("equipType", getValue.apply("equType")); placeholders.put("equipType", getValue.apply("equType"));
// placeholders.put("equipCode", getValue.apply("equRegisterCode")); placeholders.put("equipCode", getValue.apply("equRegisterCode"));
placeholders.put("produceCode", getValue.apply("produceCode")); // TODO: 制造编号 placeholders.put("produceCode", getValue.apply("produceCode")); // TODO: 制造编号
placeholders.put("produceUnitName", getValue.apply("produceUnitName")); placeholders.put("produceUnitName", getValue.apply("produceUnitName"));
placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum")); placeholders.put("produceLicenseNum", getValue.apply("produceLicenseNum"));
placeholders.put("fullAddress", getValue.apply("provinceName") + getValue.apply("cityName") + getValue.apply("countyName") + getValue.apply("address")); placeholders.put("fullAddress", getValue.apply("provinceName") + getValue.apply("cityName") + getValue.apply("countyName") + getValue.apply("address"));
// placeholders.put("installStartDate", getValue.apply("installStartDate")); placeholders.put("installStartDate", "");
// placeholders.put("installType", getValue.apply("installType")); // TODO: 施工类别 placeholders.put("installType", "");
// placeholders.put("installLicenseNo", getValue.apply("installLicenseNo")); placeholders.put("installLicenseNo", "");
// placeholders.put("installLicenseExpirationDate", getValue.apply("installLicenseExpirationDate")); placeholders.put("installLicenseExpirationDate", "");
// placeholders.put("installLeaderName", getValue.apply("installLeaderName")); placeholders.put("installLeaderName", "");
// placeholders.put("installLeaderPhone", getValue.apply("installLeaderPhone")); placeholders.put("installLeaderPhone", "");
// placeholders.put("installUnitAddress", getValue.apply("installUnitAddress")); // TODO: 施工单位地址 placeholders.put("installUnitAddress", "");
placeholders.put("useUnitName", getValue.apply("useUnitName")); placeholders.put("useUnitName", getValue.apply("useUnitName"));
placeholders.put("useUnitLeaderName", getValue.apply("safetyManager")); placeholders.put("useUnitLeaderName", getValue.apply("safetyManager"));
placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone")); placeholders.put("useUnitLeaderPhone", getValue.apply("safetyManagerPhone"));
...@@ -218,7 +223,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -218,7 +223,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
// word转pdf // word转pdf
File pdfFile; File pdfFile;
try { try {
pdfFile = this.wordToPdf("transfer-notification-report.ftl", placeholders); pdfFile = this.wordToPdf("installation-notification-report.ftl", placeholders);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
...@@ -234,8 +239,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -234,8 +239,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} }
// 更新到数据库 // 更新到数据库
// jgMaintainNotice.setNoticeReportUrl(url); jgTransferNotice.setNoticeReportUrl(url);
// this.updateById(jgMaintainNotice); this.updateById(jgTransferNotice);
return url; return url;
} }
...@@ -549,15 +554,15 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -549,15 +554,15 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
model.setReceiveOrgName(receiveOrgIdList[1]); model.setReceiveOrgName(receiveOrgIdList[1]);
} }
} }
//
// String inspectUnitId = model.getInspectUnitId(); String constructionManagerId = model.getConstructionManagerId();
// if (!ObjectUtils.isEmpty(inspectUnitId)) { if (!ObjectUtils.isEmpty(constructionManagerId)) {
// String[] inspectUnitIdList = inspectUnitId.split("_"); String[] constructionManagerIdList = constructionManagerId.split("_");
// if (inspectUnitIdList.length > 1) { if (constructionManagerIdList.length > 1) {
// model.setInspectUnitId(inspectUnitIdList[0]); model.setConstructionManagerId(constructionManagerIdList[0]);
// model.setInspectUnitName(inspectUnitIdList[1]); model.setConstructionManager(constructionManagerIdList[1]);
// } }
// } }
String factoryUseSiteStreet = model.getFactoryUseSiteStreet(); String factoryUseSiteStreet = model.getFactoryUseSiteStreet();
if (!ObjectUtils.isEmpty(factoryUseSiteStreet)) { if (!ObjectUtils.isEmpty(factoryUseSiteStreet)) {
...@@ -620,81 +625,58 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto ...@@ -620,81 +625,58 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
} }
} }
@Transactional
public void accept(JgTransferNoticeDto dto, String op) { public void accept(JgTransferNoticeDto dto, String op) {
String[] taskName = new String[]{"流程结束"};
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
JgTransferNotice jgTransferNotice = this.jgTransferNoticeMapper.selectById(dto.getSequenceNbr()); JgTransferNotice jgTransferNotice = this.jgTransferNoticeMapper.selectById(dto.getSequenceNbr());
// 组装设备注册代码 // 组装设备注册代码
// StringBuffer stringBuffer = new StringBuffer(); StringBuffer stringBuffer = new StringBuffer();
// String ym = null; String ym = null;
// try { try {
// ym = DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN_MM); ym = DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN_MM);
// } catch (ParseException e) { } catch (ParseException e) {
// log.error("日期转换失败:{}", e); log.error("日期转换失败:{}", e);
// } }
// LambdaQueryWrapper<JgTransferNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(JgTransferNoticeEq::getEquipTransferId, dto.getSequenceNbr());
// JgTransferNoticeEq jgRelationEquip = jgTransferNoticeEqMapper.selectOne(queryWrapper);
//
// LambdaQueryWrapper<OtherInfo> queryWrapper1 = new LambdaQueryWrapper<>();
// queryWrapper1.eq(OtherInfo::getRecord, jgRelationEquip.getEquId());
// OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
//
// LambdaQueryWrapper<RegistrationInfo> queryWrapper2 = new LambdaQueryWrapper<>();
// queryWrapper2.eq(RegistrationInfo::getRecord, jgRelationEquip.getEquId());
// RegistrationInfo tzsJgRegistrationInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
//
//
// stringBuffer.append(tzsJgRegistrationInfo.getEquCategory()).append(JgTransferNotice.getCity()).append(ym);
// String equCode = stringBuffer.toString();
// String deviceRegistrationCode = iCreateCodeService.createDeviceRegistrationCode(equCode);
// Map<String, Object> map = new HashMap<>();
// map.put("cityCode", JgTransferNotice.getCity());
// map.put("countyCode", JgTransferNotice.getCounty());
// map.put("equCategory", tzsJgRegistrationInfo.getEquCategory());
//// map.put("isXiXian", JgTransferNotice.getIsXixian() == null ? "0" : JgTransferNotice.getIsXixian());
// Map<String, Object> mapCode;
// ResponseModel<Map<String, Object>> code = tzsServiceFeignClient.createCode(map);
// mapCode = code.getResult();
//
// LambdaQueryWrapper<SupervisoryCodeInfo> queryWrapper3 = new LambdaQueryWrapper<>();
// queryWrapper3.eq(SupervisoryCodeInfo::getSupervisoryCode, mapCode.get("superviseCode").toString());
// SupervisoryCodeInfo supervisoryCodeInfo = supervisoryCodeInfoMapper.selectOne(queryWrapper3);
// supervisoryCodeInfo.setStatus("1");
// supervisoryCodeInfoMapper.updateById(supervisoryCodeInfo);
ArrayList<String> roleList = new ArrayList<>();
boolean submit = submit(jgTransferNotice, op); boolean submit = submit(jgTransferNotice, op);
if(submit) { if(submit) {
getNext(roleList, dto.getInstanceId(), taskName);
jgTransferNotice.setPromoter(reginParams.getUserModel().getUserId()); jgTransferNotice.setPromoter(reginParams.getUserModel().getUserId());
if("0".equals(op)) { if("0".equals(op)) {
jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode())); if (roleList.size() == 0) {
// this.generateMaintainNoticeReport(JgTransferNotice.getSequenceNbr()); LambdaQueryWrapper<JgTransferNoticeEq> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(JgTransferNoticeEq::getEquipTransferId, dto.getSequenceNbr());
JgTransferNoticeEq jgTransferNoticeEq = jgTransferNoticeEqMapper.selectOne(queryWrapper);
LambdaQueryWrapper<RegistrationInfo> queryWrapper2 = new LambdaQueryWrapper<>();
queryWrapper2.eq(RegistrationInfo::getRecord, jgTransferNoticeEq.getEquId());
RegistrationInfo tzsJgRegistrationInfo = tzsJgRegistrationInfoMapper.selectOne(queryWrapper2);
stringBuffer.append(tzsJgRegistrationInfo.getEquCategory()).append(jgTransferNotice.getCity()).append(ym);
Map<String, Object> map = new HashMap<>();
map.put("cityCode", jgTransferNotice.getCity());
map.put("countyCode", jgTransferNotice.getCounty());
map.put("equCategory", tzsJgRegistrationInfo.getEquCategory());
jgTransferNotice.setPromoter("");
jgTransferNotice.setHandleDate(new Date());
jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_FINISHED.getCode()));
this.generateTransferNoticeReport(jgTransferNotice.getSequenceNbr());
} else {
jgTransferNotice.setNextExecuteIds(String.join(",", roleList));
if (!ObjectUtils.isEmpty(jgTransferNotice.getInstanceStatus())) {
jgTransferNotice.setInstanceStatus(jgTransferNotice.getInstanceStatus() + "," + String.join(",", roleList));
} else {
jgTransferNotice.setInstanceStatus(String.join(",", roleList));
}
jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_SUBMITTED.getCode()));
jgTransferNotice.setInstanceStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode()));
}
} else { } else {
jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_SUBMITTED.getCode())); jgTransferNotice.setPromoter("");
jgTransferNotice.setInstanceStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode())); jgTransferNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode()));
} }
jgTransferNoticeMapper.updateById(jgTransferNotice); jgTransferNoticeMapper.updateById(jgTransferNotice);
} }
// // 组装监管码
// String division = "";
// if (((XIAN.equals(dto.getCity()) || XIAN_YANG.equals(dto.getCity())) && "1".equals(dto.getIsXixian()))) {
// division = "X";
// } else {
// //生成监管码前缀
// Map<String, Object> divisionMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), dto.getCounty());
// division = ObjectUtils.isEmpty(divisionMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQH.getCode(), dto.getCity()).get("code").toString() : divisionMap.get("code").toString();
// }
//
// // 组装96333码
// String prefix = "";
// if (((XIAN.equals(dto.getCity()) || XIAN_YANG.equals(dto.getCity())) && "1".equals(dto.getIsXixian()))) {
// prefix = EquipmentCategoryEnum.XXCSM.getValue();
// } else {
// Map<String, Object> elevatorMap = equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), dto.getCounty());
// prefix = ObjectUtils.isEmpty(elevatorMap) ? equipmentCategoryMapper.getAdministrativeDivision(EquipmentCategoryEnum.XZQHDT.getCode(), dto.getCity()).get("code").toString() : elevatorMap.get("code").toString();
// }
} }
void getNext(ArrayList<String> roleListFirst, String instanceId, String[] taskName) { void getNext(ArrayList<String> roleListFirst, String instanceId, String[] taskName) {
......
...@@ -18,6 +18,7 @@ import java.util.Collections; ...@@ -18,6 +18,7 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @author system_generator * @author system_generator
...@@ -46,14 +47,32 @@ public class CommonController extends BaseController { ...@@ -46,14 +47,32 @@ public class CommonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getUserPhonesByPersonCode") @PostMapping(value = "/getUserPhonesByPersonCode")
@ApiOperation(httpMethod = "GET", value = "根据公司的unitCode获取检测检验人员列表", notes = "根据公司的unitCode获取检测检验人员列表") @ApiOperation(httpMethod = "GET", value = "根据公司的unitCode获取检测检验人员联系电话", notes = "根据公司的unitCode获取检测检验人员联系电话")
public ResponseModel<Map<String,Object>> getUserPhonesByPersonCode(@RequestParam String unitCode) { public ResponseModel<Map<String,Object>> getUserPhonesByPersonCode(@RequestParam String unitCode) {
List<TzsUserInfo> userPhones = commonserviceImpl.getUserPhonesByPersonCode(unitCode); List<TzsUserInfo> userPhones = commonserviceImpl.getUserPhonesByPersonCode(unitCode);
if (CollectionUtils.isEmpty(userPhones)){ if (CollectionUtils.isEmpty(userPhones)){
return null; return null;
} }
List<String> phones = userPhones.stream().map(TzsUserInfo::getPhone).collect(Collectors.toList());
String phone = String.join(",", phones);
Map<String,Object> map = new HashMap<>();
map.put("phone",phone);
return ResponseHelper.buildResponse(map);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/getInnerPersonCodeByPersonCode")
@ApiOperation(httpMethod = "GET", value = "根据公司的unitCode获取检测检验人员内部编号", notes = "根据公司的unitCode获取检测检验人员内部编号")
public ResponseModel<Map<String,Object>> getInnerPersonCodeByPersonCode(@RequestParam String unitCode) {
List<TzsUserInfo> userPhones = commonserviceImpl.getUserPhonesByPersonCode(unitCode);
if (CollectionUtils.isEmpty(userPhones)){
return null;
}
List<String> phones = userPhones.stream().map(TzsUserInfo::getInnerPersonCode).collect(Collectors.toList());
String innerPersonCode = String.join(",", phones);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("phone",userPhones.get(0).getPhone() == null?"":userPhones.get(0).getPhone()); map.put("innerPersonCode",innerPersonCode);
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
......
package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...@@ -50,8 +51,10 @@ public class CommonserviceImpl { ...@@ -50,8 +51,10 @@ public class CommonserviceImpl {
} }
public List<TzsUserInfo> getUserPhonesByPersonCode(String personCode) { public List<TzsUserInfo> getUserPhonesByPersonCode(String personCode) {
List<String> ids = StrUtil.split(personCode, ",");
QueryWrapper userInfoQueryWrapper = new QueryWrapper<>(); QueryWrapper userInfoQueryWrapper = new QueryWrapper<>();
userInfoQueryWrapper.eq("sequence_nbr", personCode); userInfoQueryWrapper.in("sequence_nbr", ids);
List<TzsUserInfo> userInfos = userInfoMapper.selectList(userInfoQueryWrapper); List<TzsUserInfo> userInfos = userInfoMapper.selectList(userInfoQueryWrapper);
return userInfos; return userInfos;
} }
......
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