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

dev_unify
wangwei 7 months ago
commit 74501c23ce

@ -401,6 +401,7 @@ public class IoOrderController extends BaseController {
BaseResponse tempResponse = checkSubmitEnable(orderEntity); BaseResponse tempResponse = checkSubmitEnable(orderEntity);
if (tempResponse != null) if (tempResponse != null)
return tempResponse; return tempResponse;
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
//校验单据是否已完成 //校验单据是否已完成
List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(addOrderRequest.getBillNo()); List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(addOrderRequest.getBillNo());
@ -412,7 +413,6 @@ public class IoOrderController extends BaseController {
} }
//单据提交后再次校验库存是否足够 //单据提交后再次校验库存是否足够
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
BaseResponse baseResponse = ioAddInoutService.checkInv(bussinessTypeEntity, orderDetailBizEntities, orderEntity, codeTempEntities); BaseResponse baseResponse = ioAddInoutService.checkInv(bussinessTypeEntity, orderDetailBizEntities, orderEntity, codeTempEntities);
if (baseResponse != null) if (baseResponse != null)
return baseResponse; return baseResponse;
@ -465,9 +465,16 @@ public class IoOrderController extends BaseController {
orderService.update(orderEntity); orderService.update(orderEntity);
checkInoutService.check(addOrderRequest.getBillNo()); checkInoutService.check(addOrderRequest.getBillNo());
} else { } else {
String errMsg = checkInoutService.bizNoPiCheck(orderDetailBizEntities, orderEntity); if (IntUtil.value(bussinessTypeEntity.getCheckWebNewType()) == 3) {
if (StrUtil.isNotEmpty(errMsg)) { String errMsg = checkInoutService.bizOrderCheckPass(orderDetailBizEntities, orderDetailCodeEntities);
return ResultVOUtils.error(500, errMsg); if (StrUtil.isNotEmpty(errMsg)) {
return ResultVOUtils.error(500, errMsg);
}
} else {
String errMsg = checkInoutService.bizNoPiCheck(orderDetailBizEntities, orderEntity);
if (StrUtil.isNotEmpty(errMsg)) {
return ResultVOUtils.error(500, errMsg);
}
} }
orderDetailBizService.deleteByOrderId(addOrderRequest.getBillNo()); orderDetailBizService.deleteByOrderId(addOrderRequest.getBillNo());
for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) { for (IoOrderDetailCodeEntity orderDetailCodeEntity : orderDetailCodeEntities) {
@ -787,8 +794,8 @@ public class IoOrderController extends BaseController {
@Log(title = "单据管理", businessType = BusinessType.DELETE) @Log(title = "单据管理", businessType = BusinessType.DELETE)
public BaseResponse deletById(@RequestBody DeleteRequest deleteRequest) { public BaseResponse deletById(@RequestBody DeleteRequest deleteRequest) {
IoOrderEntity orderEntity = orderService.findByBillNo(deleteRequest.getBillNo()); IoOrderEntity orderEntity = orderService.findByBillNo(deleteRequest.getBillNo());
if (orderEntity == null){ if (orderEntity == null) {
return ResultVOUtils.error(500,"单据不存在,刷新重新上货"); return ResultVOUtils.error(500, "单据不存在,刷新重新上货");
} }
if (orderEntity.getStatus() != 1 && orderEntity.getStatus() != 3 && orderEntity.getStatus() != 4 && orderEntity.getStatus() != 6 && orderEntity.getStatus() != 10) { if (orderEntity.getStatus() != 1 && orderEntity.getStatus() != 3 && orderEntity.getStatus() != 4 && orderEntity.getStatus() != 6 && orderEntity.getStatus() != 10) {
return ResultVOUtils.error(500, "单据已提交无法删除!"); return ResultVOUtils.error(500, "单据已提交无法删除!");

@ -449,7 +449,7 @@ public class BasicBussinessTypeEntity {
private int spaceOut; private int spaceOut;
/** /**
* 0:1 * 0:1;3,
*/ */
@TableField(value = "checkWebNewType") @TableField(value = "checkWebNewType")
private int checkWebNewType; private int checkWebNewType;

@ -177,7 +177,7 @@ public class BasicBussinessTypeResponse {
private boolean thrCheckReview; private boolean thrCheckReview;
/** /**
* 0:1 * 0:1;3,
*/ */
private int checkWebNewType; private int checkWebNewType;

@ -628,66 +628,70 @@ public class IoCheckInoutService {
return; return;
} }
String errMsg = ""; String errMsg = "";
//正向校验
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
String msg = "";
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
if (!bizEntity.isCheckSuccess() && !codeEntity.isCheckSuccess() && checkId(bizEntity, codeEntity) == null
&& checkBatchNo(bizEntity, codeEntity) == null
&& checkProductDate(bizEntity, codeEntity) == null
&& checkExpireDate(bizEntity, codeEntity) == null
) {
if (checkCount(bizEntity, codeEntity) == null) { BasicBussinessTypeEntity businessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
bizEntity.setCheckSuccess(true); if (IntUtil.value(businessTypeEntity.getCheckWebNew()) != 3 || IntUtil.value(businessTypeEntity.getCheckWebNewType()) != 3) {
bizEntity.setScanCount(codeEntity.getReCount()); //正向校验
codeEntity.setCheckSuccess(true); for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
codeEntity.setPrice(bizEntity.getPrice()); String msg = "";
} else { for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
bizEntity.setScanCount(codeEntity.getReCount()); if (!bizEntity.isCheckSuccess() && !codeEntity.isCheckSuccess() && checkId(bizEntity, codeEntity) == null
bizEntity.setCheckSuccess(false); && checkBatchNo(bizEntity, codeEntity) == null
msg = "数量不匹配"; && checkProductDate(bizEntity, codeEntity) == null
&& checkExpireDate(bizEntity, codeEntity) == null
) {
if (checkCount(bizEntity, codeEntity) == null) {
bizEntity.setCheckSuccess(true);
bizEntity.setScanCount(codeEntity.getReCount());
codeEntity.setCheckSuccess(true);
codeEntity.setPrice(bizEntity.getPrice());
} else {
bizEntity.setScanCount(codeEntity.getReCount());
bizEntity.setCheckSuccess(false);
msg = "数量不匹配";
}
break;
} }
break;
} }
if (StrUtil.isEmpty(msg) && !bizEntity.isCheckSuccess()) {
msg = "三期不匹配";
}
bizEntity.setErrMsg(msg);
} }
if (StrUtil.isEmpty(msg) && !bizEntity.isCheckSuccess()) {
msg = "三期不匹配";
}
bizEntity.setErrMsg(msg);
}
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
if (!bizEntity.isCheckSuccess()) {
errMsg = errMsg + bizEntity.getCoName() + bizEntity.getErrMsg() + ";";
}
}
//反向校验
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) { for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
if (!bizEntity.isCheckSuccess() && !codeEntity.isCheckSuccess() && checkId(bizEntity, codeEntity) == null if (!bizEntity.isCheckSuccess()) {
&& checkBatchNo(bizEntity, codeEntity) == null errMsg = errMsg + bizEntity.getCoName() + bizEntity.getErrMsg() + ";";
&& checkProductDate(bizEntity, codeEntity) == null }
&& checkExpireDate(bizEntity, codeEntity) == null }
) {
if (checkCount(bizEntity, codeEntity) == null) { //反向校验
bizEntity.setCheckSuccess(true); for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
codeEntity.setCheckSuccess(true); for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
if (!bizEntity.isCheckSuccess() && !codeEntity.isCheckSuccess() && checkId(bizEntity, codeEntity) == null
&& checkBatchNo(bizEntity, codeEntity) == null
&& checkProductDate(bizEntity, codeEntity) == null
&& checkExpireDate(bizEntity, codeEntity) == null
) {
if (checkCount(bizEntity, codeEntity) == null) {
bizEntity.setCheckSuccess(true);
codeEntity.setCheckSuccess(true);
}
break;
} }
break;
} }
} }
} for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
if (!codeEntity.isCheckSuccess()) {
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) { errMsg = errMsg + codeEntity.getCoName() + ";";
if (!codeEntity.isCheckSuccess()) { }
errMsg = errMsg + codeEntity.getCoName() + ";";
} }
} }
if (StrUtil.isNotEmpty(errMsg)) { if (StrUtil.isNotEmpty(errMsg)) {
orderEntity.setErrMsg(errMsg + "校验失败"); orderEntity.setErrMsg(errMsg + "校验失败");
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_FAIL); orderEntity.setStatus(ConstantStatus.ORDER_STATUS_CHECK_FAIL);
@ -735,6 +739,49 @@ public class IoCheckInoutService {
} }
} }
public String bizOrderCheckPass(List<IoOrderDetailBizEntity> orderDetailBizEntities, List<IoOrderDetailCodeEntity> orderDetailCodeEntities) {
String errMsg = "";
//初始化默认值
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
codeEntity.setCheckSuccess(false);
}
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
bizEntity.setCheckSuccess(false);
}
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
String msg = "";
for (IoOrderDetailCodeEntity codeEntity : orderDetailCodeEntities) {
if (!bizEntity.isCheckSuccess() && !codeEntity.isCheckSuccess() && checkId(bizEntity, codeEntity) == null
&& checkBatchNo(bizEntity, codeEntity) == null
&& checkProductDate(bizEntity, codeEntity) == null
&& checkExpireDate(bizEntity, codeEntity) == null
) {
if (checkBizCount(bizEntity, codeEntity) == null) {
bizEntity.setCheckSuccess(true);
codeEntity.setCheckSuccess(true);
bizEntity.setScanCount(codeEntity.getReCount());
} else {
msg = "扫码数量超出";
bizEntity.setCheckSuccess(false);
}
break;
}
}
if (StrUtil.isEmpty(msg) && !bizEntity.isCheckSuccess()) {
msg = "三期不匹配";
}
bizEntity.setErrMsg(msg);
}
for (IoOrderDetailBizEntity bizEntity : orderDetailBizEntities) {
if (!bizEntity.isCheckSuccess()) {
errMsg = errMsg + bizEntity.getCoName() + bizEntity.getErrMsg() + ";";
}
}
return errMsg;
}
//业务单正向校验 //业务单正向校验
public String bizNoPiCheck(List<IoOrderDetailBizEntity> orderDetailBizEntities, IoOrderEntity orderEntity) { public String bizNoPiCheck(List<IoOrderDetailBizEntity> orderDetailBizEntities, IoOrderEntity orderEntity) {
@ -862,7 +909,7 @@ public class IoCheckInoutService {
ioOrderCheckResultResponse.setBBatchNo(bizEntity.getBatchNo()); ioOrderCheckResultResponse.setBBatchNo(bizEntity.getBatchNo());
ioOrderCheckResultResponse.setBProductDate(bizEntity.getProductDate()); ioOrderCheckResultResponse.setBProductDate(bizEntity.getProductDate());
ioOrderCheckResultResponse.setBExpireDate(bizEntity.getExpireDate()); ioOrderCheckResultResponse.setBExpireDate(bizEntity.getExpireDate());
if (product.getProductsType() == 2){ if (product.getProductsType() == 2) {
ioOrderCheckResultResponse.setBzgg(product.getBzgg()); ioOrderCheckResultResponse.setBzgg(product.getBzgg());
ioOrderCheckResultResponse.setPrepnSpec(product.getPrepnSpec()); ioOrderCheckResultResponse.setPrepnSpec(product.getPrepnSpec());
ioOrderCheckResultResponse.setPrepnUnit(product.getPrepnUnit()); ioOrderCheckResultResponse.setPrepnUnit(product.getPrepnUnit());
@ -1409,4 +1456,12 @@ public class IoCheckInoutService {
} }
} }
public String checkBizCount(IoOrderDetailBizEntity bizEntity, IoOrderDetailCodeEntity codeEntity) {
if (bizEntity.getCount() > codeEntity.getReCount()) {
return null;
}
return bizEntity.getCoName() + "数量不匹配!";
}
} }

@ -58,7 +58,7 @@ public class IoGenInvService {
public void genNorInv(String orderId) { public void genNorInv(String orderId) {
IoOrderEntity orderEntity = orderService.findByBillNo(orderId); IoOrderEntity orderEntity = orderService.findByBillNo(orderId);
List<IoOrderDetailResultEntity> orderDetailResultEntities = orderDetailResultService.findByOrderId(orderId); List<IoOrderDetailResultEntity> orderDetailResultEntities = orderDetailResultService.findByOrderId(orderId);
List<IoCodeEntity> codeEnttities = codeService.findByOrderId(orderId);
//补齐单据信息 //补齐单据信息
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction()); BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(orderEntity.getAction());
@ -91,9 +91,9 @@ public class IoGenInvService {
} }
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) { if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
invProductEntity.setOutCount(invProductEntity.getOutCount() + orderDetailResultEntity.getReCount()); invProductEntity.setOutCount(invProductEntity.getOutCount() + orderDetailResultEntity.getCount());
} else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { } else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
invProductEntity.setInCount(invProductEntity.getInCount() + orderDetailResultEntity.getReCount()); invProductEntity.setInCount(invProductEntity.getInCount() + orderDetailResultEntity.getCount());
} }
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount()); invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
invProductEntity.setUpdateTime(new Date()); invProductEntity.setUpdateTime(new Date());
@ -110,6 +110,7 @@ public class IoGenInvService {
&& bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT) //入库 && bussinessTypeEntity.getMainAction().equals(ConstantType.TYPE_PUT) //入库
&& bussinessTypeEntity.getDevInType().equals(1) && bussinessTypeEntity.getDevInType().equals(1)
) { ) {
List<IoCodeEntity> codeEnttities = codeService.findByOrderId(orderId);
deviceChangeOrderService.generateDeviceInfo(orderEntity, codeEnttities); deviceChangeOrderService.generateDeviceInfo(orderEntity, codeEnttities);
} }

@ -172,8 +172,16 @@ public class FilterUdiUtils {
public static UdiEntity getDrugInfo(String data) { public static UdiEntity getDrugInfo(String data) {
UdiEntity udiEntity = new UdiEntity(); UdiEntity udiEntity = new UdiEntity();
String prefix = data.substring(0, 7); String prefix;
String serialNo = data.substring(7, 16); String serialNo;
if (data.startsWith("89")) {
prefix = data.substring(0, 8);
serialNo = data.substring(8, 16);
} else {
prefix = data.substring(0, 7);
serialNo = data.substring(7, 16);
}
udiEntity.setBatchNo(null); udiEntity.setBatchNo(null);
udiEntity.setExpireDate(null); udiEntity.setExpireDate(null);
udiEntity.setProduceDate(null); udiEntity.setProduceDate(null);

@ -9,25 +9,25 @@
ip.nameCode, ip.nameCode,
bp.cpmctymc, bp.cpmctymc,
bp.measname, bp.measname,
bp.bzgg, COALESCE(bp.ggxh, bp.bzgg) as ggxh,
ip.relIdFk, ip.relIdFk,
bp.ggxh, bp.ggxh,
ip.batchNo, ip.batchNo,
ip.productionDate, ip.productionDate,
ip.expireDate, ip.expireDate,
bp.ylqxzcrbarmc, COALESCE(bp.ylqxzcrbarmc, bp.manufactory) as ylqxzcrbarmc,
bp.zczbhhzbapzbh, bp.zczbhhzbapzbh,
ip.inCount, ip.inCount,
ip.outCount, ip.outCount,
ip.reCount, ip.reCount,
ip.customerId, ip.customerId,
basic_corp.name supName, basic_corp.name supName,
ip.supId, ip.supId,
auth_dept.name deptName, auth_dept.name deptName,
auth_warehouse.name invName, auth_warehouse.name invName,
ip.deptCode, ip.deptCode,
ip.invCode, ip.invCode,
as.name spaceName, as.name spaceName,
bp.productsType, bp.productsType,
bp.levelUnit, bp.levelUnit,
bp.prepnUnit, bp.prepnUnit,
@ -54,12 +54,11 @@
bp.packUnit, bp.packUnit,
ip.price ip.price
from inv_product ip from inv_product ip
inner join basic_udirel on ip.relIdFk = basic_udirel.id INNER JOIN basic_products bp ON ip.relIdFk = (SELECT id FROM basic_udirel WHERE uuid = bp.uuid)
inner join basic_products bp on basic_udirel.uuid = bp.uuid LEFT JOIN basic_corp ON ip.supId = basic_corp.erpId
left join basic_corp on ip.supId = basic_corp.erpId LEFT JOIN auth_dept ON auth_dept.CODE = ip.deptCode
left join auth_dept on auth_dept.code = ip.deptCode LEFT JOIN auth_warehouse ON auth_warehouse.CODE = ip.invCode
left join auth_warehouse on auth_warehouse.code = ip.invCode LEFT JOIN auth_space s ON ip.invSpaceCode = s.CODE
left join auth_space `as` on ip.invSpaceCode = `as`.code
<where> <where>
<if test="productsType != null"> <if test="productsType != null">
AND bp.productsType = #{productsType} AND bp.productsType = #{productsType}
@ -87,9 +86,9 @@
</if> </if>
<if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''"> <if test="ylqxzcrbarmc != null and ylqxzcrbarmc != ''">
AND ( AND (
bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%') bp.ylqxzcrbarmc like concat('%', #{ylqxzcrbarmc}, '%')
or bp.manufactory like concat('%', #{ylqxzcrbarmc}, '%') or bp.manufactory like concat('%', #{ylqxzcrbarmc}, '%')
) )
</if> </if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''"> <if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%') AND bp.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
@ -142,15 +141,15 @@
</if> </if>
<if test="keyWords != '' and keyWords != null"> <if test="keyWords != '' and keyWords != null">
AND ( AND (
bp.cpmctymc like concat('%', #{keyWords}, '%') bp.cpmctymc like concat('%', #{keyWords}, '%')
or ip.nameCode like concat('%', #{keyWords}, '%') or ip.nameCode like concat('%', #{keyWords}, '%')
or bp.ggxh like concat('%', #{keyWords}, '%') or bp.ggxh like concat('%', #{keyWords}, '%')
or bp.bzgg like concat('%', #{keyWords}, '%') or bp.bzgg like concat('%', #{keyWords}, '%')
or bp.prepnSpec LIKE concat('%', #{keyWords}, '%') or bp.prepnSpec LIKE concat('%', #{keyWords}, '%')
or ip.batchNo like concat('%', #{keyWords}, '%') or ip.batchNo like concat('%', #{keyWords}, '%')
or bp.zczbhhzbapzbh LIKE concat('%', #{keyWords}, '%') or bp.zczbhhzbapzbh LIKE concat('%', #{keyWords}, '%')
or bp.manufactory LIKE concat('%', #{keyWords}, '%') or bp.manufactory LIKE concat('%', #{keyWords}, '%')
or bp.ylqxzcrbarywmc LIKE concat('%', #{keyWords}, '%')) or bp.ylqxzcrbarywmc LIKE concat('%', #{keyWords}, '%'))
</if> </if>
</where> </where>
GROUP BY ip.relIdFk, ip.batchNo, ip.supId, ip.price GROUP BY ip.relIdFk, ip.batchNo, ip.supId, ip.price
@ -175,10 +174,10 @@
sum(ip.outCount) outCount, sum(ip.outCount) outCount,
sum(ip.reCount) reCount sum(ip.reCount) reCount
from inv_product ip from inv_product ip
inner join basic_udirel bu on ip.relIdFk = bu.id inner join basic_udirel bu on ip.relIdFk = bu.id
inner join basic_products bp on bu.uuid = bp.uuid inner join basic_products bp on bu.uuid = bp.uuid
left join basic_corp bc on ip.supId = bc.erpId left join basic_corp bc on ip.supId = bc.erpId
left join auth_warehouse aw on aw.code = ip.invCode left join auth_warehouse aw on aw.code = ip.invCode
<where> <where>
bp.diType = 1 bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''"> <if test="cpmctymc != null and cpmctymc != ''">
@ -229,9 +228,9 @@
bp.manufactory, bp.manufactory,
bp.zczbhhzbapzbh bp.zczbhhzbapzbh
FROM inv_product_detail ip FROM inv_product_detail ip
LEFT JOIN basic_udirel bu ON bu.id = ip.relId LEFT JOIN basic_udirel bu ON bu.id = ip.relId
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
LEFT JOIN basic_corp ON ip.supId = basic_corp.erpId LEFT JOIN basic_corp ON ip.supId = basic_corp.erpId
<where> <where>
<if test="nameCode != null and nameCode != ''"> <if test="nameCode != null and nameCode != ''">
AND bp.nameCode like concat('%', #{nameCode}, '%') AND bp.nameCode like concat('%', #{nameCode}, '%')
@ -268,10 +267,10 @@
<select id="selectProductInfo" resultType="com.glxp.api.entity.inv.InvProductEntity"> <select id="selectProductInfo" resultType="com.glxp.api.entity.inv.InvProductEntity">
select ip.* select ip.*
from inv_product ip from inv_product ip
left join inv_product_detail ipd on ip.relIdFk = ipd.relId left join inv_product_detail ipd on ip.relIdFk = ipd.relId
and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
and ip.deptCode = ipd.deptCode and ip.deptCode = ipd.deptCode
and ip.invCode = ipd.invCode and ip.invCode = ipd.invCode
<where> <where>
<if test="relId != null and relId != ''"> <if test="relId != null and relId != ''">
AND ip.relIdFk = #{relId} AND ip.relIdFk = #{relId}
@ -309,11 +308,11 @@
-- sum(inv_product.inCount - inv_product.outCount) reCount, -- sum(inv_product.inCount - inv_product.outCount) reCount,
basic_products.cpmctymc basic_products.cpmctymc
from inv_product_detail from inv_product_detail
left join inv_product on inv_product_detail.relId = inv_product.relIdFk left join inv_product on inv_product_detail.relId = inv_product.relIdFk
and inv_product.invCode = inv_product_detail.invCode and inv_product.invCode = inv_product_detail.invCode
AND IFNULL(inv_product.batchNo, 'empty') = IFNULL(inv_product_detail.batchNo, 'empty') AND IFNULL(inv_product.batchNo, 'empty') = IFNULL(inv_product_detail.batchNo, 'empty')
left join basic_udirel on inv_product_detail.relId = basic_udirel.id left join basic_udirel on inv_product_detail.relId = basic_udirel.id
left join basic_products on basic_products.uuid = basic_udirel.uuid left join basic_products on basic_products.uuid = basic_udirel.uuid
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND inv_product_detail.invCode = #{invCode} AND inv_product_detail.invCode = #{invCode}
@ -347,8 +346,8 @@
ip.outCount, ip.outCount,
ip.reCount ip.reCount
from inv_product ip from inv_product ip
left join inv_product_detail ipd left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') on ip.relIdFk = ipd.relId and ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND ip.invCode = #{invCode} AND ip.invCode = #{invCode}
@ -366,10 +365,10 @@
<select id="filterProductNames" resultType="com.glxp.api.res.inv.InvProductResponse"> <select id="filterProductNames" resultType="com.glxp.api.res.inv.InvProductResponse">
select ip.relIdFk, bp.cpmctymc, bp.ggxh, bp.ylqxzcrbarmc, bp.zczbhhzbapzbh select ip.relIdFk, bp.cpmctymc, bp.ggxh, bp.ylqxzcrbarmc, bp.zczbhhzbapzbh
from inv_product ip from inv_product ip
left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and left join inv_product_detail ipd on ip.relIdFk = ipd.relId and ip.invCode = ipd.invCode and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
left join basic_udirel bu on bu.id = ip.relIdFk left join basic_udirel bu on bu.id = ip.relIdFk
left join basic_products bp on bp.uuid = bu.uuid left join basic_products bp on bp.uuid = bu.uuid
<where> <where>
<if test="cpmctymc != null and cpmctymc != ''"> <if test="cpmctymc != null and cpmctymc != ''">
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%') AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
@ -408,13 +407,13 @@
ip.deptCode, ip.deptCode,
ip.invCode ip.invCode
from inv_product ip from inv_product ip
inner join basic_udirel on ip.relIdFk = basic_udirel.id inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode left join auth_warehouse on auth_warehouse.code = ip.invCode
left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
<where> <where>
bp.diType = 1 bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''"> <if test="cpmctymc != null and cpmctymc != ''">
@ -498,15 +497,15 @@
ip.price, ip.price,
ip.invCode ip.invCode
from inv_product ip from inv_product ip
inner join basic_udirel on ip.relIdFk = basic_udirel.id inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode left join auth_warehouse on auth_warehouse.code = ip.invCode
left join basic_product_category_rel on basic_product_category_rel.relId = basic_udirel.id left join basic_product_category_rel on basic_product_category_rel.relId = basic_udirel.id
left join basic_product_category on basic_product_category_rel.code = basic_product_category.code left join basic_product_category on basic_product_category_rel.code = basic_product_category.code
left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and left join inv_product_detail ipd on ip.invCode = ipd.invCode and ip.relIdFk = ipd.relId and
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty') ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
<where> <where>
bp.diType = 1 bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''"> <if test="cpmctymc != null and cpmctymc != ''">

Loading…
Cancel
Save