1.合并自助平台库存预警设置的代码

master
x_z 2 years ago
parent 48981033e8
commit abbc13b2f5

@ -1,10 +1,13 @@
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.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.inv.InvRemindSetEntity;
import com.glxp.api.req.inv.AddInvRemindSetRequest;
import com.glxp.api.req.inv.FilterInvRemindSetRequest;
@ -79,4 +82,33 @@ public class InvRemindSetController {
return invRemindSetService.deleteInvRemindSet(Integer.valueOf(deleteRequest.getId()));
}
/**
*
*
* @param addInvRemindSetRequest
* @return
*/
@PostMapping("/udiwms/inv/remind/set/batchAddInvRemindSet")
@Log(title = "库存预警", businessType = BusinessType.INSERT)
public BaseResponse batchAddInvRemindSet(@RequestBody AddInvRemindSetRequest addInvRemindSetRequest) {
if (null == addInvRemindSetRequest || CollUtil.isEmpty(addInvRemindSetRequest.getRelIdList())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invRemindSetService.batchAddInvRemindSet(addInvRemindSetRequest);
}
/**
* ID
*
* @param invId
* @return
*/
@GetMapping("/udiwms/inv/remind/set/getInfoByInvId")
public BaseResponse getInfoByInvId(FilterInvRemindSetRequest filterInvRemindSetRequest) {
if (null == filterInvRemindSetRequest || null == filterInvRemindSetRequest.getInvId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invRemindSetService.getInfoByInvId(filterInvRemindSetRequest.getInvId());
}
}

@ -24,4 +24,14 @@ public class FilterInvRemindSetRequest extends ListPageRequest {
*/
private String invSpaceCode;
/**
* ID
*/
private Integer invId;
/**
* 0 1
*/
private Integer status;
}

@ -52,7 +52,16 @@ public class InvRemindSetServiceImpl implements InvRemindSetService {
if (null != filterInvRemindSetRequest.getPage() && null != filterInvRemindSetRequest.getLimit()) {
PageHelper.offsetPage((filterInvRemindSetRequest.getPage() - 1) * filterInvRemindSetRequest.getLimit(), filterInvRemindSetRequest.getLimit());
}
return invRemindSetDao.filterList(filterInvRemindSetRequest);
List<InvRemindSetResponse> list = invRemindSetDao.filterList(filterInvRemindSetRequest);
if (CollUtil.isNotEmpty(list)) {
list.forEach(invRemindSetResponse -> {
if (invRemindSetResponse.getIsDateBy() == 1 && null != invRemindSetResponse.getRecentDateTime()) {
//将近效期预警值由小时换算成天
invRemindSetResponse.setRecentDateTime(invRemindSetResponse.getRecentDateTime() / 24);
}
});
}
return list;
}
@Override
@ -115,6 +124,20 @@ public class InvRemindSetServiceImpl implements InvRemindSetService {
public BaseResponse getInfoByInvId(Integer invId) {
InvRemindSetResponse response = invRemindSetDao.selectInfoByInvId(invId);
if (null != response) {
//查询是否已有库存预警设置信息,若已存在预警设置,则回显旧数据
InvRemindSetEntity invRemindSetEntity = invRemindSetDao.selectOne(new QueryWrapper<InvRemindSetEntity>()
.eq("deptCode", response.getDeptCode())
.eq("invCode", response.getInvCode())
.eq("relId", response.getRelId())
);
if (null != invRemindSetEntity) {
response.setLackStock(invRemindSetEntity.getLackStock());
response.setLowStock(invRemindSetEntity.getLowStock());
response.setOverStock(invRemindSetEntity.getOverStock());
response.setExpireDate(invRemindSetEntity.getExpireDate());
response.setRecentDate(invRemindSetEntity.getRecentDate());
}
if (response.getIsDateBy() == 1 && null != response.getRecentDateTime()) {
//将近效期预警值由小时换算成天
response.setRecentDateTime(response.getRecentDateTime() / 24);

@ -13,6 +13,11 @@
irs.expireDate,
irs.recentDate,
irs.remark,
bu.lowStockNum,
bu.overStockNum,
bu.recentDateTime,
bu.useExpireTime,
bu.isDateBy,
bp.cpmctymc productName,
bp.ggxh,
(select `name` from auth_warehouse where `code` = irs.invCode) invName,
@ -38,26 +43,27 @@
</select>
<select id="selectInfoByInvId" resultType="com.glxp.api.res.inv.InvRemindSetResponse">
select ip.relIdFk relId,
ip.deptCode,
ip.invCode,
ipd.invSpaceCode,
(select `name` from auth_warehouse where code = ip.invCode) invName,
(select `name`
from auth_space
where code = ipd.invSpaceCode and invWarehouseCode = ip.invCode) invSpaceName,
bp.ggxh,
bp.cpmctymc productName,
bu.lowStockNum,
bu.overStockNum,
bu.recentDateTime,
bu.isDateBy
select ip.relIdFk relId,
ip.deptCode,
ip.invCode,
ipd.invSpaceCode,
(select `name` from auth_warehouse where code = ip.invCode) invName,
(select `name`
from auth_space
where code = ipd.invSpaceCode
and invWarehouseCode = ip.invCode) invSpaceName,
bp.ggxh,
bp.cpmctymc productName,
bu.lowStockNum,
bu.overStockNum,
bu.recentDateTime,
bu.isDateBy
from inv_product ip
left join basic_udirel bu on ip.relIdFk = bu.id
left join basic_products bp on bu.uuid = bp.uuid
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and IFNULL(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
and ip.invCode = ipd.invCode
left join basic_udirel bu on ip.relIdFk = bu.id
left join basic_products bp on bu.uuid = bp.uuid
left join inv_product_detail ipd
on ip.relIdFk = ipd.relId and IFNULL(ip.batchNo, 'empty') = ifnull(ipd.batchNo, 'empty')
and ip.invCode = ipd.invCode
where ip.id = #{invId}
group by ip.id
</select>

@ -122,6 +122,7 @@ CALL Pro_Temp_ColumnWork('sup_product', 'allowNoProduct', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sup_product', 'allowNoSerial', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('inv_remind_msg', 'remindCount', 'int', 1);
CALL Pro_Temp_ColumnWork('inv_remind_set', 'status', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sup_cert_remind_msg', 'remindCount', 'int', 1);
CALL Pro_Temp_ColumnWork('sync_data_bustypes', 'orderStatus', 'tinyint', 1);
@ -166,6 +167,7 @@ CALL Pro_Temp_ColumnWork('sys_pdf_template_relevance_biz', 'updateTime', 'dateti
CALL Pro_Temp_ColumnWork('sys_pdf_template_relevance_label', 'updateTime', 'datetime', 1);
CALL Pro_Temp_ColumnWork('sys_pdf_template_relevance_statemen', 'updateTime', 'datetime', 1);
# CALL Pro_Temp_ColumnWork('sup_cert_set', 'foreign', 'tinyint', 3);
# CALL Pro_Temp_ColumnWork('sup_cert_set', 'needForeign', 'tinyint', 1);

Loading…
Cancel
Save