feat(inventory): 增加项目编号字段并优化发货逻辑
- 在待办完成页面增加项目编号输入框和显示列- 修改库存执行页面数量校验条件从<=0为<0- 优化外发编辑页面上传功能,支持获取仓库ID - 发货功能增加detailId参数传递- 更新库存发货服务实现,新增detailId字段处理 -修复库存信息查询SQL统计逻辑错误 - 完善库存导入逻辑,返回仓库ID和产品序列号数据 - 增加OuterDeliveryProductVo的ID字段 - 流程待办增加项目编号字段及查询条件 - 扩展文件上传支持图片、PDF和Word文档格式- 发货查看页面增加备注信息展示dev_1.0.0
parent
c238a27a36
commit
f53b64264f
|
|
@ -48,6 +48,10 @@
|
|||
<div class="select-list">
|
||||
<input type="text" name="approve" value="approve" hidden="hidden" />
|
||||
<ul>
|
||||
<li>
|
||||
<label>项目编号:</label>
|
||||
<input type="text" name="projectCode" placeholder="项目编号" />
|
||||
</li>
|
||||
<li>
|
||||
<label>业务号:</label>
|
||||
<input type="text" name="businessKey" placeholder="业务号" />
|
||||
|
|
@ -162,6 +166,11 @@
|
|||
width:100,
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'projectCode',
|
||||
title: '项目编号',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
field: 'businessKey',
|
||||
title: '业务号',
|
||||
|
|
|
|||
|
|
@ -67,7 +67,9 @@
|
|||
<td>发货人:</td>
|
||||
<td> <input name="createByName" th:field="*{createByName}" class="form-control" type="text" readonly></td>
|
||||
<td>发货时间:</td>
|
||||
<td colspan="3"> <input name="deliveryTime" disabled th:value="${#dates.format(inventoryDelivery.deliveryTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"></td>
|
||||
<td > <input name="deliveryTime" disabled th:value="${#dates.format(inventoryDelivery.deliveryTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"></td>
|
||||
<td>备注</td>
|
||||
<td> <input name="remark" class="form-control" th:field="*{remark}" disabled type="text"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
|||
|
|
@ -692,7 +692,7 @@ function initWarehouseTable(data) {
|
|||
$("#warehouse-table input[name$='quantity']").each(function () {
|
||||
let val = $(this).val();
|
||||
if (val && !isNaN(val)) {
|
||||
if (Number(val) <= 0) {
|
||||
if (Number(val) < 0) {
|
||||
errFlag = true;
|
||||
}
|
||||
totalConfirmQuantity += Number(val);
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@
|
|||
</form>
|
||||
</div>
|
||||
|
||||
<input id="uploadInput" type="file" accept=".zip,.rar" style="display: none">
|
||||
<input id="uploadInput" type="file" accept=".zip,.rar,image/*,.pdf,.doc,.docx" style="display: none">
|
||||
<input type="hidden" id="orderId">
|
||||
<input type="hidden" id="versionCode">
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
|
|
|
|||
|
|
@ -281,7 +281,8 @@
|
|||
let data = JSON.parse(res.currentTarget.response)
|
||||
if (data.code === 0) {
|
||||
$.modal.msgSuccess('上传成功');
|
||||
productSnData = data.data;
|
||||
productSnData = data.data.productSnDataList;
|
||||
$('[name="warehouseId"]').val(data.data.warehouseId)
|
||||
$.table.refreshOptions($.extend(productSnOptions, {
|
||||
url: '',
|
||||
data: productSnData,
|
||||
|
|
@ -434,7 +435,7 @@
|
|||
formatter: function (value, row, index) {
|
||||
var actions = [];
|
||||
let disabled = Number(row.quantity) <= Number(row.deliveryGenerateQuantity) + Number(row.deliveryConfirmQuantity)
|
||||
actions.push(`<span class="btn btn-success btn-sm " href="javascript:void(0)" ${disabled ? 'style="pointer-events: none;" disabled' : ''} onclick="checkDelivery(\'${row.quantity}\','${row.deliveryGenerateQuantity}\','${row.deliveryConfirmQuantity}\',\'${row.warehouseId}\','${row.productCode}')">发货</span>`);
|
||||
actions.push(`<span class="btn btn-success btn-sm " href="javascript:void(0)" ${disabled ? 'style="pointer-events: none;" disabled' : ''} onclick="checkDelivery(\'${row.quantity}\','${row.deliveryGenerateQuantity}\','${row.deliveryConfirmQuantity}\',\'${row.warehouseId}\','${row.productCode}','${row.id}')">发货</span>`);
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
|
|
@ -442,7 +443,7 @@
|
|||
$.table.init(options);
|
||||
}
|
||||
|
||||
function checkDelivery(quantity,deliveryGenerateQuantity,deliveryConfirmQuantity, warehouseId, productCode) {
|
||||
function checkDelivery(quantity,deliveryGenerateQuantity,deliveryConfirmQuantity, warehouseId, productCode,detailId) {
|
||||
initModal()
|
||||
// $.table.set('bootstrap-table')
|
||||
let width = 1000, height = 700
|
||||
|
|
@ -499,13 +500,14 @@
|
|||
logisticsCode: $('#logisticsCode').val(),
|
||||
productCode: productCode,
|
||||
quantity: productSnData.length <= 0 ? arrays.length : productSnData.length,
|
||||
warehouseId: warehouseId,
|
||||
warehouseId: $('[name="warehouseId"]').val(),
|
||||
logisticsCompany: $('#logisticsCompany').val(),
|
||||
deliveryType: $('#deliveryType').val(),
|
||||
deliveryTime: $('#deliveryTime').val(),
|
||||
deliveryTimeType: $('#deliveryTimeType').val(),
|
||||
outerCode: $('[name="outerCode"]').val(),
|
||||
remark: $('[name="remark"]').val(),
|
||||
detailId: detailId,
|
||||
productSnDataList: productSnData,
|
||||
}
|
||||
var config = {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class InventoryDelivery extends BaseEntity
|
|||
|
||||
|
||||
|
||||
|
||||
private Long detailId;
|
||||
|
||||
private String createByName;
|
||||
private String remark;
|
||||
|
|
|
|||
|
|
@ -100,4 +100,5 @@ public class Todo extends BaseEntity
|
|||
|
||||
private Long businessId;
|
||||
private String businessName;
|
||||
private String projectCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ public class TodoServiceImpl implements TodoService {
|
|||
return;
|
||||
}
|
||||
item.setBusinessId(projectOrderInfo.getId());
|
||||
item.setProjectCode(projectOrderInfo.getProjectCode());
|
||||
item.setBusinessName(projectOrderInfo.getProjectName());
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ruoyi.sip.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.sip.domain.InventoryInfo;
|
||||
import com.ruoyi.sip.domain.OmsInventoryInner;
|
||||
|
|
@ -64,5 +65,5 @@ public interface IOmsInventoryInnerService
|
|||
|
||||
|
||||
void importByOuter(List<InventoryInfo> inventoryInfoList,String productCode);
|
||||
List<InventoryInfo> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode);
|
||||
Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.ruoyi.common.utils.StringUtils;
|
|||
import com.ruoyi.sip.domain.*;
|
||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||
import com.ruoyi.sip.dto.inventory.InventoryDeliveryDetailExcelDto;
|
||||
import com.ruoyi.sip.mapper.InventoryOuterDetailMapper;
|
||||
import com.ruoyi.sip.mapper.InventoryOuterMapper;
|
||||
import com.ruoyi.sip.service.*;
|
||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||
|
|
@ -41,6 +42,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
private IOmsInventoryInnerService omsInventoryInnerService;
|
||||
@Resource
|
||||
private InventoryOuterMapper inventoryOuterMapper;
|
||||
@Resource
|
||||
private InventoryOuterDetailMapper inventoryOuterDetailMapper;
|
||||
@Autowired
|
||||
private IProjectProductInfoService projectProductInfoService;
|
||||
@Autowired
|
||||
|
|
@ -129,6 +132,10 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
}
|
||||
omsInventoryInnerService.importByOuter(productSnDataList,inventoryDelivery.getProductCode());
|
||||
}
|
||||
InventoryOuterDetail inventoryOuterDetail = new InventoryOuterDetail();
|
||||
inventoryOuterDetail.setId(inventoryDelivery.getDetailId());
|
||||
inventoryOuterDetail.setWarehouseId(inventoryDelivery.getWarehouseId());
|
||||
inventoryOuterDetailMapper.updateInventoryOuterDetail(inventoryOuterDetail);
|
||||
int i = inventoryDeliveryMapper.insertInventoryDelivery(inventoryDelivery);
|
||||
if (CollUtil.isNotEmpty(detailList)){
|
||||
for (OmsInventoryDeliveryDetail detail : detailList) {
|
||||
|
|
@ -303,6 +310,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
|||
.map(OmsInventoryDeliveryDetail::getProductSn).collect(Collectors.toList()));
|
||||
}
|
||||
queryParams.setOuterCode(dbData.getOuterCode());
|
||||
queryParams.setWarehouseId(dbData.getWarehouseId());
|
||||
List<InventoryInfo> inventoryInfos = inventoryInfoService.selectInventoryInfoList(queryParams);
|
||||
return inventoryInfos.stream().map(item->{
|
||||
InventoryDeliveryDetailExcelDto detailExcelDto = new InventoryDeliveryDetailExcelDto();
|
||||
|
|
|
|||
|
|
@ -268,6 +268,7 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
|
|||
List<InventoryOuterDetail> detailList = detailService.selectInventoryOuterDetailList(inventoryOuterDetail);
|
||||
List<OuterDeliveryProductVo> productVoList = detailList.stream().map(item -> {
|
||||
OuterDeliveryProductVo vo = new OuterDeliveryProductVo();
|
||||
vo.setId(item.getId());
|
||||
vo.setProductCode(item.getProductCode());
|
||||
vo.setModel(item.getModel());
|
||||
vo.setQuantity(item.getQuantity());
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.ruoyi.sip.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -210,7 +208,7 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<InventoryInfo> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode) {
|
||||
public Map<String,Object> getInventoryInfoList(List<InventoryInfoExcelDto> inventoryInfoExcelDtoList, String productCode) {
|
||||
long count = inventoryInfoExcelDtoList.stream().filter(item -> !item.getProductCode().equals(productCode)).count();
|
||||
if (count > 0){
|
||||
throw new ServiceException("导入清单的产品与出库单不符");
|
||||
|
|
@ -224,6 +222,9 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
throw new ServiceException("产品编码对应产品未找到");
|
||||
}
|
||||
List<OmsWarehouseInfo> warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList);
|
||||
if (CollUtil.isEmpty(warehouseInfoList)) {
|
||||
throw new ServiceException("仓库未找到,导入失败");
|
||||
}
|
||||
Map<String, OmsWarehouseInfo> warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
|
||||
List<InventoryInfo> inventoryInfoList = inventoryInfoExcelDtoList.stream().map(item -> {
|
||||
InventoryInfo info = new InventoryInfo();
|
||||
|
|
@ -234,9 +235,6 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
info.setProductDesc(productInfos.get(0).getDescription());
|
||||
info.setInnerPrice(item.getInnerPrice());
|
||||
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(item.getWarehouseName());
|
||||
if (omsWarehouseInfo == null){
|
||||
throw new ServiceException("仓库未找到,导入失败");
|
||||
}
|
||||
info.setWarehouseId(omsWarehouseInfo.getId());
|
||||
info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||
|
||||
|
|
@ -246,7 +244,10 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
|||
if (CollUtil.isNotEmpty(repeatSnList)) {
|
||||
throw new ServiceException(StrUtil.format("SN码[{}]已存在,导入失败", repeatSnList));
|
||||
}
|
||||
return inventoryInfoList;
|
||||
Map<String,Object> result=new HashMap<>();
|
||||
result.put("warehouseId",warehouseInfoList.get(0).getId());
|
||||
result.put("productSnDataList",inventoryInfoList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import lombok.Data;
|
|||
*/
|
||||
@Data
|
||||
public class OuterDeliveryProductVo {
|
||||
private Long id;
|
||||
private String productCode;
|
||||
private String model;
|
||||
private Long quantity;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
'%')
|
||||
</if>
|
||||
<if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="projectCode != null and projectCode != ''">and business_key in (
|
||||
select order_code from project_info t1 inner join project_order_info t2 on t1.id=t2.project_id where t1.project_code like concat('%', #{projectCode}, '%')
|
||||
)</if>
|
||||
<if test="approveUserName != null and approveUserName != ''">and approve_user_name = #{approveUserName}
|
||||
</if>
|
||||
<if test="applyUserName != null and applyUserName != ''">and apply_user_name like concat('%',
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="checkOurPreview" resultType="com.ruoyi.sip.dto.inventory.ProductWarehouseInfo">
|
||||
SELECT t1.available_count,t1.warehouse_id,
|
||||
t2.warehouse_name
|
||||
FROM (SELECT warehouse_id, count(CASE inventory_status WHEN 0 THEN 1 ELSE 0 END) available_count
|
||||
FROM (SELECT warehouse_id, sum(CASE inventory_status WHEN 0 THEN 1 ELSE 0 END) available_count
|
||||
FROM oms_inventory_info
|
||||
WHERE product_code in
|
||||
<foreach item="item" index="index" collection="list" separator="," open="(" close=")">
|
||||
|
|
|
|||
Loading…
Reference in New Issue