Merge remote-tracking branch 'origin/master'
commit
ab40ad4c27
|
|
@ -48,6 +48,10 @@
|
||||||
<div class="select-list">
|
<div class="select-list">
|
||||||
<input type="text" name="approve" value="approve" hidden="hidden" />
|
<input type="text" name="approve" value="approve" hidden="hidden" />
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>项目编号:</label>
|
||||||
|
<input type="text" name="projectCode" placeholder="项目编号" />
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label>业务号:</label>
|
<label>业务号:</label>
|
||||||
<input type="text" name="businessKey" placeholder="业务号" />
|
<input type="text" name="businessKey" placeholder="业务号" />
|
||||||
|
|
@ -162,6 +166,11 @@
|
||||||
width:100,
|
width:100,
|
||||||
visible: false
|
visible: false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'projectCode',
|
||||||
|
title: '项目编号',
|
||||||
|
width:100
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'businessKey',
|
field: 'businessKey',
|
||||||
title: '业务号',
|
title: '业务号',
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,9 @@
|
||||||
<td>发货人:</td>
|
<td>发货人:</td>
|
||||||
<td> <input name="createByName" th:field="*{createByName}" class="form-control" type="text" readonly></td>
|
<td> <input name="createByName" th:field="*{createByName}" class="form-control" type="text" readonly></td>
|
||||||
<td>发货时间:</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>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -692,7 +692,7 @@ function initWarehouseTable(data) {
|
||||||
$("#warehouse-table input[name$='quantity']").each(function () {
|
$("#warehouse-table input[name$='quantity']").each(function () {
|
||||||
let val = $(this).val();
|
let val = $(this).val();
|
||||||
if (val && !isNaN(val)) {
|
if (val && !isNaN(val)) {
|
||||||
if (Number(val) <= 0) {
|
if (Number(val) < 0) {
|
||||||
errFlag = true;
|
errFlag = true;
|
||||||
}
|
}
|
||||||
totalConfirmQuantity += Number(val);
|
totalConfirmQuantity += Number(val);
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</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="orderId">
|
||||||
<input type="hidden" id="versionCode">
|
<input type="hidden" id="versionCode">
|
||||||
<div class="col-sm-12 select-table table-striped">
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
|
|
||||||
|
|
@ -281,7 +281,8 @@
|
||||||
let data = JSON.parse(res.currentTarget.response)
|
let data = JSON.parse(res.currentTarget.response)
|
||||||
if (data.code === 0) {
|
if (data.code === 0) {
|
||||||
$.modal.msgSuccess('上传成功');
|
$.modal.msgSuccess('上传成功');
|
||||||
productSnData = data.data;
|
productSnData = data.data.productSnDataList;
|
||||||
|
$('[name="warehouseId"]').val(data.data.warehouseId)
|
||||||
$.table.refreshOptions($.extend(productSnOptions, {
|
$.table.refreshOptions($.extend(productSnOptions, {
|
||||||
url: '',
|
url: '',
|
||||||
data: productSnData,
|
data: productSnData,
|
||||||
|
|
@ -434,7 +435,7 @@
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var actions = [];
|
var actions = [];
|
||||||
let disabled = Number(row.quantity) <= Number(row.deliveryGenerateQuantity) + Number(row.deliveryConfirmQuantity)
|
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('');
|
return actions.join('');
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|
@ -442,7 +443,7 @@
|
||||||
$.table.init(options);
|
$.table.init(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkDelivery(quantity,deliveryGenerateQuantity,deliveryConfirmQuantity, warehouseId, productCode) {
|
function checkDelivery(quantity,deliveryGenerateQuantity,deliveryConfirmQuantity, warehouseId, productCode,detailId) {
|
||||||
initModal()
|
initModal()
|
||||||
// $.table.set('bootstrap-table')
|
// $.table.set('bootstrap-table')
|
||||||
let width = 1000, height = 700
|
let width = 1000, height = 700
|
||||||
|
|
@ -499,13 +500,14 @@
|
||||||
logisticsCode: $('#logisticsCode').val(),
|
logisticsCode: $('#logisticsCode').val(),
|
||||||
productCode: productCode,
|
productCode: productCode,
|
||||||
quantity: productSnData.length <= 0 ? arrays.length : productSnData.length,
|
quantity: productSnData.length <= 0 ? arrays.length : productSnData.length,
|
||||||
warehouseId: warehouseId,
|
warehouseId: $('[name="warehouseId"]').val(),
|
||||||
logisticsCompany: $('#logisticsCompany').val(),
|
logisticsCompany: $('#logisticsCompany').val(),
|
||||||
deliveryType: $('#deliveryType').val(),
|
deliveryType: $('#deliveryType').val(),
|
||||||
deliveryTime: $('#deliveryTime').val(),
|
deliveryTime: $('#deliveryTime').val(),
|
||||||
deliveryTimeType: $('#deliveryTimeType').val(),
|
deliveryTimeType: $('#deliveryTimeType').val(),
|
||||||
outerCode: $('[name="outerCode"]').val(),
|
outerCode: $('[name="outerCode"]').val(),
|
||||||
remark: $('[name="remark"]').val(),
|
remark: $('[name="remark"]').val(),
|
||||||
|
detailId: detailId,
|
||||||
productSnDataList: productSnData,
|
productSnDataList: productSnData,
|
||||||
}
|
}
|
||||||
var config = {
|
var config = {
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ public class InventoryDelivery extends BaseEntity
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private Long detailId;
|
||||||
|
|
||||||
private String createByName;
|
private String createByName;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
|
||||||
|
|
@ -100,4 +100,5 @@ public class Todo extends BaseEntity
|
||||||
|
|
||||||
private Long businessId;
|
private Long businessId;
|
||||||
private String businessName;
|
private String businessName;
|
||||||
|
private String projectCode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,7 @@ public class TodoServiceImpl implements TodoService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
item.setBusinessId(projectOrderInfo.getId());
|
item.setBusinessId(projectOrderInfo.getId());
|
||||||
|
item.setProjectCode(projectOrderInfo.getProjectCode());
|
||||||
item.setBusinessName(projectOrderInfo.getProjectName());
|
item.setBusinessName(projectOrderInfo.getProjectName());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.sip.service;
|
package com.ruoyi.sip.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.ruoyi.sip.domain.InventoryInfo;
|
import com.ruoyi.sip.domain.InventoryInfo;
|
||||||
import com.ruoyi.sip.domain.OmsInventoryInner;
|
import com.ruoyi.sip.domain.OmsInventoryInner;
|
||||||
|
|
@ -64,5 +65,5 @@ public interface IOmsInventoryInnerService
|
||||||
|
|
||||||
|
|
||||||
void importByOuter(List<InventoryInfo> inventoryInfoList,String productCode);
|
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.domain.*;
|
||||||
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
import com.ruoyi.sip.dto.ApiDataQueryDto;
|
||||||
import com.ruoyi.sip.dto.inventory.InventoryDeliveryDetailExcelDto;
|
import com.ruoyi.sip.dto.inventory.InventoryDeliveryDetailExcelDto;
|
||||||
|
import com.ruoyi.sip.mapper.InventoryOuterDetailMapper;
|
||||||
import com.ruoyi.sip.mapper.InventoryOuterMapper;
|
import com.ruoyi.sip.mapper.InventoryOuterMapper;
|
||||||
import com.ruoyi.sip.service.*;
|
import com.ruoyi.sip.service.*;
|
||||||
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
import com.ruoyi.sip.vo.DeliveryInfoVo;
|
||||||
|
|
@ -41,6 +42,8 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
private IOmsInventoryInnerService omsInventoryInnerService;
|
private IOmsInventoryInnerService omsInventoryInnerService;
|
||||||
@Resource
|
@Resource
|
||||||
private InventoryOuterMapper inventoryOuterMapper;
|
private InventoryOuterMapper inventoryOuterMapper;
|
||||||
|
@Resource
|
||||||
|
private InventoryOuterDetailMapper inventoryOuterDetailMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IProjectProductInfoService projectProductInfoService;
|
private IProjectProductInfoService projectProductInfoService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -129,6 +132,10 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
}
|
}
|
||||||
omsInventoryInnerService.importByOuter(productSnDataList,inventoryDelivery.getProductCode());
|
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);
|
int i = inventoryDeliveryMapper.insertInventoryDelivery(inventoryDelivery);
|
||||||
if (CollUtil.isNotEmpty(detailList)){
|
if (CollUtil.isNotEmpty(detailList)){
|
||||||
for (OmsInventoryDeliveryDetail detail : detailList) {
|
for (OmsInventoryDeliveryDetail detail : detailList) {
|
||||||
|
|
@ -303,6 +310,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
.map(OmsInventoryDeliveryDetail::getProductSn).collect(Collectors.toList()));
|
.map(OmsInventoryDeliveryDetail::getProductSn).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
queryParams.setOuterCode(dbData.getOuterCode());
|
queryParams.setOuterCode(dbData.getOuterCode());
|
||||||
|
queryParams.setWarehouseId(dbData.getWarehouseId());
|
||||||
List<InventoryInfo> inventoryInfos = inventoryInfoService.selectInventoryInfoList(queryParams);
|
List<InventoryInfo> inventoryInfos = inventoryInfoService.selectInventoryInfoList(queryParams);
|
||||||
return inventoryInfos.stream().map(item->{
|
return inventoryInfos.stream().map(item->{
|
||||||
InventoryDeliveryDetailExcelDto detailExcelDto = new InventoryDeliveryDetailExcelDto();
|
InventoryDeliveryDetailExcelDto detailExcelDto = new InventoryDeliveryDetailExcelDto();
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ public class InventoryOuterServiceImpl implements IInventoryOuterService
|
||||||
List<InventoryOuterDetail> detailList = detailService.selectInventoryOuterDetailList(inventoryOuterDetail);
|
List<InventoryOuterDetail> detailList = detailService.selectInventoryOuterDetailList(inventoryOuterDetail);
|
||||||
List<OuterDeliveryProductVo> productVoList = detailList.stream().map(item -> {
|
List<OuterDeliveryProductVo> productVoList = detailList.stream().map(item -> {
|
||||||
OuterDeliveryProductVo vo = new OuterDeliveryProductVo();
|
OuterDeliveryProductVo vo = new OuterDeliveryProductVo();
|
||||||
|
vo.setId(item.getId());
|
||||||
vo.setProductCode(item.getProductCode());
|
vo.setProductCode(item.getProductCode());
|
||||||
vo.setModel(item.getModel());
|
vo.setModel(item.getModel());
|
||||||
vo.setQuantity(item.getQuantity());
|
vo.setQuantity(item.getQuantity());
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package com.ruoyi.sip.service.impl;
|
package com.ruoyi.sip.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -210,7 +208,7 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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();
|
long count = inventoryInfoExcelDtoList.stream().filter(item -> !item.getProductCode().equals(productCode)).count();
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
throw new ServiceException("导入清单的产品与出库单不符");
|
throw new ServiceException("导入清单的产品与出库单不符");
|
||||||
|
|
@ -224,6 +222,9 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
throw new ServiceException("产品编码对应产品未找到");
|
throw new ServiceException("产品编码对应产品未找到");
|
||||||
}
|
}
|
||||||
List<OmsWarehouseInfo> warehouseInfoList = warehouseInfoService.listByNameList(warehouseNameList);
|
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));
|
Map<String, OmsWarehouseInfo> warehouseInfoMap = warehouseInfoList.stream().collect(Collectors.toMap(OmsWarehouseInfo::getWarehouseName, Function.identity(), (v1, v2) -> v1));
|
||||||
List<InventoryInfo> inventoryInfoList = inventoryInfoExcelDtoList.stream().map(item -> {
|
List<InventoryInfo> inventoryInfoList = inventoryInfoExcelDtoList.stream().map(item -> {
|
||||||
InventoryInfo info = new InventoryInfo();
|
InventoryInfo info = new InventoryInfo();
|
||||||
|
|
@ -234,9 +235,6 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
info.setProductDesc(productInfos.get(0).getDescription());
|
info.setProductDesc(productInfos.get(0).getDescription());
|
||||||
info.setInnerPrice(item.getInnerPrice());
|
info.setInnerPrice(item.getInnerPrice());
|
||||||
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(item.getWarehouseName());
|
OmsWarehouseInfo omsWarehouseInfo = warehouseInfoMap.get(item.getWarehouseName());
|
||||||
if (omsWarehouseInfo == null){
|
|
||||||
throw new ServiceException("仓库未找到,导入失败");
|
|
||||||
}
|
|
||||||
info.setWarehouseId(omsWarehouseInfo.getId());
|
info.setWarehouseId(omsWarehouseInfo.getId());
|
||||||
info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
info.setWarehouseName(omsWarehouseInfo.getWarehouseName());
|
||||||
|
|
||||||
|
|
@ -246,7 +244,10 @@ public class OmsInventoryInnerServiceImpl implements IOmsInventoryInnerService {
|
||||||
if (CollUtil.isNotEmpty(repeatSnList)) {
|
if (CollUtil.isNotEmpty(repeatSnList)) {
|
||||||
throw new ServiceException(StrUtil.format("SN码[{}]已存在,导入失败", 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
|
@Data
|
||||||
public class OuterDeliveryProductVo {
|
public class OuterDeliveryProductVo {
|
||||||
|
private Long id;
|
||||||
private String productCode;
|
private String productCode;
|
||||||
private String model;
|
private String model;
|
||||||
private Long quantity;
|
private Long quantity;
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
'%')
|
'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</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 test="approveUserName != null and approveUserName != ''">and approve_user_name = #{approveUserName}
|
||||||
</if>
|
</if>
|
||||||
<if test="applyUserName != null and applyUserName != ''">and apply_user_name like concat('%',
|
<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 id="checkOurPreview" resultType="com.ruoyi.sip.dto.inventory.ProductWarehouseInfo">
|
||||||
SELECT t1.available_count,t1.warehouse_id,
|
SELECT t1.available_count,t1.warehouse_id,
|
||||||
t2.warehouse_name
|
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
|
FROM oms_inventory_info
|
||||||
WHERE product_code in
|
WHERE product_code in
|
||||||
<foreach item="item" index="index" collection="list" separator="," open="(" close=")">
|
<foreach item="item" index="index" collection="list" separator="," open="(" close=")">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue