耗材字典多个DI问题

test
anthonywj 1 year ago
parent 12f1851bba
commit 16e5b8de59

@ -1,5 +1,7 @@
package com.glxp.api.controller.basic;
import com.glxp.api.service.inout.IoOrderDetailCodeService;
import com.glxp.api.util.IntUtil;
import org.springframework.beans.BeanUtils;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
@ -64,7 +66,8 @@ public class UdiContrastController {
ProductInfoService productInfoService;
@Resource
ThrDataService thrDataService;
@Resource
IoOrderDetailCodeService orderDetailCodeService;
/**
*
@ -243,6 +246,13 @@ public class UdiContrastController {
}
}
}
//判断单据是否存在相关对照的产品组合
Boolean exitUuid = orderDetailCodeService.isExit(udiRelevanceEntity.getId(), udiRelevanceEntity.getUuid());
if (IntUtil.value(exitUuid)) {
return ResultVOUtils.error(500, "该产品已关联单据,无法解绑!");
}
ThrSystemEntity thrSystemEntity = thrSystemService.selectMainThrSys();
ThrProductsEntity thrProductsEntity = thrDataService.getProducts(udiRelevanceEntity.getMainId(), thrSystemEntity.getThirdId());
UdiProductEntity UdiInfoRequest = new UdiProductEntity();

@ -1,5 +1,6 @@
package com.glxp.api.controller.basic;
import cn.hutool.core.bean.BeanUtil;
import com.glxp.api.dao.basic.UdiRelevanceDao;
import com.glxp.api.service.inout.impl.IoCodeService;
import com.glxp.api.service.inv.impl.InvProductService;
@ -239,7 +240,7 @@ public class UdiRelevanceController extends BaseController {
for (UdiProductEntity udiProductEntity : udiInfoEntities) {
UdiRelevanceResponse udiRelevanceResponse = new UdiRelevanceResponse();
BeanUtils.copyProperties(udiProductEntity, udiRelevanceResponse);
BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceResponse);
BeanUtil.copyProperties(udiRelevanceEntity, udiRelevanceResponse);
udiRelevanceResponses.add(udiRelevanceResponse);
}
}
@ -409,17 +410,15 @@ public class UdiRelevanceController extends BaseController {
//新增或修改关联
@AuthRuleAnnotation("")
@PostMapping("/udi/udirel/check/udi")
public BaseResponse checkUdi(@RequestBody UdiCombineRequest udiCombineRequest) {
List<String> keys = udiCombineRequest.getKeys();
List<String> keys = udiCombineRequest.getDevKeys();
if (keys != null && keys.size() > 0) {
List<UdiRelevanceEntity> datas = udiRelevanceService.batchSelectByUuid(keys);
if (datas.isEmpty()) {
return ResultVOUtils.success("无被选入!");
} else {
return ResultVOUtils.error(499, "所选产品DI已经被" + "第三方产品ID" + "绑定,您确定继续对照");
return ResultVOUtils.error(499, "所选产品DI已存在耗材字典,继续对照将会出现不可预估错误,是否继续选入?");
}
}
return ResultVOUtils.success("未选择产品");

@ -45,6 +45,8 @@ public interface IoOrderDetailCodeService {
boolean isExit(Long relId, String bacthNo, Long ignoreId, String orderId);
boolean isExit(Long relId, String uuid);
/**
* VO
*

@ -118,6 +118,12 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService {
.isNull(StrUtil.isEmpty(bacthNo), "batchNo").eq("orderIdFk", orderId).ne("id", ignoreId));
}
@Override
public boolean isExit(Long relId, String uuid) {
return ioOrderDetailCodeDao.exists(new QueryWrapper<IoOrderDetailCodeEntity>().eq("bindRlFk", relId).eq("uuidFk", uuid));
}
@Override
public List<IoOrderDetailCodeResponse> getDetailCodeResponse(List<IoOrderDetailCodeEntity> orderEntityList) {
if (CollUtil.isEmpty(orderEntityList)) {

@ -1211,70 +1211,70 @@
<insert id="insertUdiRelevance" keyProperty="id" parameterType="com.glxp.api.entity.basic.UdiRelevanceEntity">
replace
INTO basic_udirel
(id, uuid, mainId, thirdId, thirdId1, thirdId2, thirdId3, thirdId4, udplatCode, isUseDy, isDisable,
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy, needCert)
INTO basic_udirel
(id, uuid, mainId, thirdId, thirdId1, thirdId2, thirdId3, thirdId4, udplatCode, isUseDy, isDisable,
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy, needCert)
values (#{id},
#{uuid},
#{mainId},
#{thirdId},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{udplatCode},
#{isUseDy},
#{isDisable},
#{isLock},
#{lockStatus},
#{isAdavence},
#{useMuti},
#{useNum},
#{supName},
#{createTime},
#{updateTime},
#{modifyTime},
#{createUser},
#{updateUser},
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy}, #{needCert})
#{uuid},
#{mainId},
#{thirdId},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{udplatCode},
#{isUseDy},
#{isDisable},
#{isLock},
#{lockStatus},
#{isAdavence},
#{useMuti},
#{useNum},
#{supName},
#{createTime},
#{updateTime},
#{modifyTime},
#{createUser},
#{updateUser},
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy}, #{needCert})
</insert>
<insert id="insertUdiRelevanceignore"
parameterType="com.glxp.api.entity.basic.UdiRelevanceEntity">
insert
ignore
ignore
INTO basic_udirel
(id, uuid, mainId, thirdId, thirdId1, thirdId2, thirdId3, thirdId4, udplatCode, isUseDy, isDisable,
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy, needCert)
(id, uuid, mainId, thirdId, thirdId1, thirdId2, thirdId3, thirdId4, udplatCode, isUseDy, isDisable,
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy, needCert)
values (#{id},
#{uuid},
#{mainId},
#{thirdId},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{udplatCode},
#{isUseDy},
#{isDisable},
#{isLock},
#{lockStatus},
#{isAdavence},
#{useMuti},
#{useNum},
#{supName},
#{createTime},
#{updateTime},
#{modifyTime},
#{createUser},
#{updateUser},
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy}, #{needCert})
#{uuid},
#{mainId},
#{thirdId},
#{thirdId1},
#{thirdId2},
#{thirdId3},
#{thirdId4},
#{udplatCode},
#{isUseDy},
#{isDisable},
#{isLock},
#{lockStatus},
#{isAdavence},
#{useMuti},
#{useNum},
#{supName},
#{createTime},
#{updateTime},
#{modifyTime},
#{createUser},
#{updateUser},
#{remark}, #{useExpireTime}, #{dispatch}, #{groupBuy}, #{needCert})
</insert>
<delete id="deleteById" parameterType="Map">
@ -1399,7 +1399,7 @@
<select id="batchSelectByUuid" resultType="com.glxp.api.entity.basic.UdiRelevanceEntity">
select *
from basic_udirel where uuid in
from basic_products where basic_products.deviceRecordKey in
<foreach collection="uuids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
@ -1415,106 +1415,106 @@
<insert id="importUdiRelevance" parameterType="java.util.List">
replace
into basic_udirel
(id, uuid, mainId, thirdId, thirdId1, thirdId2, thirdId3, thirdId4, udplatCode, isUseDy, isDisable,
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy, needCert)
values
into basic_udirel
(id, uuid, mainId, thirdId, thirdId1, thirdId2, thirdId3, thirdId4, udplatCode, isUseDy, isDisable,
isLock,
lockStatus, isAdavence, useMuti, useNum, supName, createTime, updateTime, modifyTime, createUser,
updateUser,
remark, useExpireTime, dispatch, groupBuy, needCert)
values
<foreach collection="udiRelevanceEntities" item="item" index="index" separator=",">
(#{item.id},
#{item.uuid},
#{item.mainId},
#{item.thirdId},
#{item.thirdId1},
#{item.thirdId2},
#{item.thirdId3},
#{item.thirdId4},
#{item.udplatCode},
#{item.isUseDy},
#{item.isDisable},
#{item.isLock},
#{item.lockStatus},
#{item.isAdavence},
#{item.useMuti},
#{item.useNum},
#{item.supName},
#{item.createTime},
#{item.updateTime},
#{item.modifyTime},
#{item.createUser},
#{item.updateUser},
#{item.remark}, #{item.useExpireTime}, #{item.dispatch}, #{item.groupBuy}, #{item.needCert})
#{item.uuid},
#{item.mainId},
#{item.thirdId},
#{item.thirdId1},
#{item.thirdId2},
#{item.thirdId3},
#{item.thirdId4},
#{item.udplatCode},
#{item.isUseDy},
#{item.isDisable},
#{item.isLock},
#{item.lockStatus},
#{item.isAdavence},
#{item.useMuti},
#{item.useNum},
#{item.supName},
#{item.createTime},
#{item.updateTime},
#{item.modifyTime},
#{item.createUser},
#{item.updateUser},
#{item.remark}, #{item.useExpireTime}, #{item.dispatch}, #{item.groupBuy}, #{item.needCert})
</foreach>
</insert>
<select id="selectGroupByNameCode" parameterType="java.lang.String"
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
select basic_udirel.*,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
basic_products.sfwblztlcp,
basic_products.cgzmraqxgxx,
basic_products.sfbjwycxsy,
basic_products.zdcfsycs,
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
basic_products.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
basic_products.sfwblztlcp,
basic_products.cgzmraqxgxx,
basic_products.sfbjwycxsy,
basic_products.zdcfsycs,
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName
FROM basic_udirel
INNER JOIN basic_products
on basic_udirel.uuid = basic_products.uuid
INNER JOIN basic_products
on basic_udirel.uuid = basic_products.uuid
<where>
<if test="nameCode != null">
AND nameCode = #{nameCode}
@ -1536,14 +1536,14 @@
<select id="selectProductNameByRelId" resultType="java.lang.String">
select basic_products.cpmctymc
from basic_udirel
left join basic_products on basic_udirel.uuid = basic_products.uuid
left join basic_products on basic_udirel.uuid = basic_products.uuid
where basic_udirel.id = #{relId}
</select>
<update id="updateBatchById" parameterType="java.util.List">
<foreach collection="list" item="item" separator=";">
update
basic_udirel
basic_udirel
set `relCode` = #{item.relCode}
where id = #{item.id}
</foreach>
@ -1565,79 +1565,79 @@
<select id="selectRelIdByNameCode" resultType="java.lang.String">
select basic_udirel.id
from basic_udirel
inner join basic_products on basic_udirel.uuid = basic_products.uuid
inner join basic_products on basic_udirel.uuid = basic_products.uuid
where basic_products.nameCode = #{nameCode}
</select>
<select id="selectOneUdiJoinSup" resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
select basic_udirel.*,
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
company_product_relevance.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
basic_products.sfwblztlcp,
basic_products.cgzmraqxgxx,
basic_products.sfbjwycxsy,
basic_products.zdcfsycs,
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName,
company_product_relevance.unitFk,
basic_corp.name companyName
basic_products.originUuid,
basic_products.nameCode,
basic_products.deviceRecordKey,
basic_products.packRatio,
basic_products.packUnit,
basic_products.packLevel,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.ybbm,
basic_products.sptm,
basic_products.manufactory,
basic_products.measname,
basic_products.productType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.cplx,
basic_products.hchzsb,
basic_products.cpdls,
company_product_relevance.price,
basic_products.basicPrductRemak1,
basic_products.basicPrductRemak2,
basic_products.basicPrductRemak3,
basic_products.basicPrductRemak4,
basic_products.basicPrductRemak5,
basic_products.basicPrductRemak6,
basic_products.basicPrductRemak7,
basic_products.basicPrductRemak8,
basic_products.sfwblztlcp,
basic_products.cgzmraqxgxx,
basic_products.sfbjwycxsy,
basic_products.zdcfsycs,
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName,
company_product_relevance.unitFk,
basic_corp.name companyName
FROM basic_udirel
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid
left join company_product_relevance
on basic_udirel.id = company_product_relevance.udiRlIdFk
left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId
inner JOIN basic_products
ON basic_products.uuid = basic_udirel.uuid
left join company_product_relevance
on basic_udirel.id = company_product_relevance.udiRlIdFk
left JOIN basic_corp on basic_corp.erpId = company_product_relevance.customerId
<where>
<if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')

Loading…
Cancel
Save