1.修复库存预警设置相关的bug

master
x_z 2 years ago
parent 1ed5a743fa
commit 5f2239d494

@ -1,5 +1,6 @@
package com.glxp.api.controller.inv;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.enums.ResultEnum;
@ -59,6 +60,9 @@ public class InvRemindSetController {
*/
@PostMapping("/udiwms/inv/remind/set/batchAddInvRemindSet")
public BaseResponse batchAddInvRemindSet(@RequestBody AddInvRemindSetRequest addInvRemindSetRequest) {
if (null == addInvRemindSetRequest || CollUtil.isEmpty(addInvRemindSetRequest.getRelIdList())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invRemindSetService.batchAddInvRemindSet(addInvRemindSetRequest);
}

@ -161,12 +161,13 @@ public class InvRemindSetServiceImpl implements InvRemindSetService {
InvRemindSetEntity invRemindSetEntity = invRemindSetDao.selectOne(new QueryWrapper<InvRemindSetEntity>()
.eq("invCode", addInvRemindSetRequest.getInvCode())
.eq(StrUtil.isNotBlank(addInvRemindSetRequest.getInvSpaceCode()), "invSpaceCode", addInvRemindSetRequest.getInvSpaceCode())
.eq(StrUtil.isNotBlank(addInvRemindSetRequest.getRelId()), "relId", addInvRemindSetRequest.getRelId())
.eq("relId", relId)
.eq(StrUtil.isNotBlank(addInvRemindSetRequest.getGgxh()), "ggxh", addInvRemindSetRequest.getGgxh())
);
if (null == invRemindSetEntity) {
invRemindSetEntity = new InvRemindSetEntity();
BeanUtil.copyProperties(addInvRemindSetRequest, invRemindSetEntity);
invRemindSetEntity.setRelId(relId);
verifySetParams(invRemindSetEntity);
setUpdateInfo(invRemindSetEntity);
invRemindSetDao.insert(invRemindSetEntity);
@ -184,10 +185,13 @@ public class InvRemindSetServiceImpl implements InvRemindSetService {
//查询有无相同设置,有则更新时间
InvRemindSetEntity invRemindSetEntity = invRemindSetDao.selectOne(new QueryWrapper<InvRemindSetEntity>()
.eq("invCode", addInvRemindSetRequest.getInvCode())
.eq(StrUtil.isNotBlank(addInvRemindSetRequest.getInvSpaceCode()), "invSpaceCode", addInvRemindSetRequest.getInvSpaceCode()));
.eq(StrUtil.isNotBlank(addInvRemindSetRequest.getInvSpaceCode()), "invSpaceCode", addInvRemindSetRequest.getInvSpaceCode())
.isNull("relId")
);
if (null == invRemindSetEntity) {
invRemindSetEntity = new InvRemindSetEntity();
BeanUtil.copyProperties(addInvRemindSetRequest, invRemindSetEntity);
invRemindSetEntity.setStatus(1);
setUpdateInfo(invRemindSetEntity);
invRemindSetDao.insert(invRemindSetEntity);
} else {

@ -1090,7 +1090,7 @@
<select id="selectRemindParams" resultType="com.glxp.api.entity.basic.UdiRelevanceEntity">
select lowStockNum, overStockNum, recentDateTime
select id, lowStockNum, overStockNum, recentDateTime
from basic_udirel
where id = #{relId}
</select>

@ -316,11 +316,13 @@
ip.deptCode,
ip.invCode
from inv_product ip
inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode
left join auth_warehouse on auth_warehouse.code = ip.invCode
inner join basic_udirel on ip.relIdFk = basic_udirel.id
inner join basic_products bp on basic_udirel.uuid = bp.uuid
left join basic_corp on ip.supId = basic_corp.erpId
left join auth_dept on auth_dept.code = ip.deptCode
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
ifnull(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
<where>
bp.diType = 1
<if test="cpmctymc != null and cpmctymc != ''">
@ -371,6 +373,9 @@
<if test="supName != null and supName != ''">
AND basic_corp.name like concat('%', #{supName}, '%')
</if>
<if test="invSpaceCode != null and invSpaceCode != ''">
AND ipd.invSpaceCode = #{invSpaceCode}
</if>
</where>
group by ip.relIdFk
order by ip.updateTime desc

Loading…
Cancel
Save