fix:订单配备货相关链路功能调整
parent
71e8eb1e37
commit
8acc68141d
|
|
@ -114,11 +114,11 @@ export function savePurchaseOrderMap(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询采购单SN码列表
|
// 查询采购单SN码列表
|
||||||
export function purchaseSnList(purchaseNo, orderCode) {
|
export function purchaseSnList(purchaseNo, orderCode, productCode) {
|
||||||
return request({
|
return request({
|
||||||
url: '/project/order/vue/purchaseSnList',
|
url: '/project/order/vue/purchaseSnList',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { purchaseNo, orderCode }
|
params: { purchaseNo, orderCode, productCode }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -416,7 +416,7 @@
|
||||||
|
|
||||||
<div class="outer-sn-grid-container">
|
<div class="outer-sn-grid-container">
|
||||||
<div class="outer-sn-grid-header">
|
<div class="outer-sn-grid-header">
|
||||||
<span class="outer-sn-current-count">当前仓库SN码总数:{{ getWarehouseSnCount(outerSnActiveWarehouse) }}</span>
|
<!-- <span class="outer-sn-current-count">当前仓库SN码总数:{{ getWarehouseSnCount(outerSnActiveWarehouse) }}</span>-->
|
||||||
<pagination
|
<pagination
|
||||||
small
|
small
|
||||||
layout="total, sizes, prev, pager, next"
|
layout="total, sizes, prev, pager, next"
|
||||||
|
|
@ -894,6 +894,7 @@ export default {
|
||||||
orderId: this.stockingDetailRow.id,
|
orderId: this.stockingDetailRow.id,
|
||||||
purchaseId: bindItem.purchaseId,
|
purchaseId: bindItem.purchaseId,
|
||||||
purchaseNo: bindItem.purchaseNo,
|
purchaseNo: bindItem.purchaseNo,
|
||||||
|
productCode: item.productCode,
|
||||||
originalBindNum: originalPhNum,
|
originalBindNum: originalPhNum,
|
||||||
bindNum: currentPhNum
|
bindNum: currentPhNum
|
||||||
});
|
});
|
||||||
|
|
@ -913,6 +914,7 @@ export default {
|
||||||
Promise.all(this.stockingSaveChangedList.map(item => savePurchaseOrderMap({
|
Promise.all(this.stockingSaveChangedList.map(item => savePurchaseOrderMap({
|
||||||
orderId: item.orderId,
|
orderId: item.orderId,
|
||||||
purchaseId: item.purchaseId,
|
purchaseId: item.purchaseId,
|
||||||
|
productCode: item.productCode,
|
||||||
bindNum: item.bindNum
|
bindNum: item.bindNum
|
||||||
}))).then(() => {
|
}))).then(() => {
|
||||||
this.$message.success('保存成功');
|
this.$message.success('保存成功');
|
||||||
|
|
@ -973,7 +975,7 @@ export default {
|
||||||
}
|
}
|
||||||
this.outerSnDialogVisible = true;
|
this.outerSnDialogVisible = true;
|
||||||
this.outerSnLoading = true;
|
this.outerSnLoading = true;
|
||||||
purchaseSnList(row.purchaseNo, this.stockingDetailRow.orderCode).then(response => {
|
purchaseSnList(row.purchaseNo, this.stockingDetailRow.orderCode, item.productCode).then(response => {
|
||||||
const data = response.data || {};
|
const data = response.data || {};
|
||||||
this.outerSnDetail = {
|
this.outerSnDetail = {
|
||||||
totalQuantity: data.totalQuantity || 0,
|
totalQuantity: data.totalQuantity || 0,
|
||||||
|
|
|
||||||
|
|
@ -191,8 +191,8 @@ public class VueProjectOrderInfoController extends BaseController {
|
||||||
* 采购单SN码列表
|
* 采购单SN码列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/purchaseSnList")
|
@GetMapping("/purchaseSnList")
|
||||||
public AjaxResult purchaseSnList(@RequestParam String purchaseNo, @RequestParam String orderCode) {
|
public AjaxResult purchaseSnList(@RequestParam String purchaseNo, @RequestParam String orderCode, @RequestParam(required = false) String productCode) {
|
||||||
return AjaxResult.success(projectOrderInfoService.selectPurchaseSnList(purchaseNo, orderCode));
|
return AjaxResult.success(projectOrderInfoService.selectPurchaseSnList(purchaseNo, orderCode, productCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,7 @@ public class OmsPurchaseOrderMap {
|
||||||
|
|
||||||
private Long purchaseId;
|
private Long purchaseId;
|
||||||
|
|
||||||
|
private String productCode;
|
||||||
|
|
||||||
private Integer bindNum;
|
private Integer bindNum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
public interface OmsPurchaseOrderMapMapper {
|
public interface OmsPurchaseOrderMapMapper {
|
||||||
|
|
||||||
OmsPurchaseOrderMap selectByOrderIdAndPurchaseId(@Param("orderId") Long orderId, @Param("purchaseId") Long purchaseId);
|
OmsPurchaseOrderMap selectByOrderIdAndPurchaseId(@Param("orderId") Long orderId,
|
||||||
|
@Param("purchaseId") Long purchaseId,
|
||||||
|
@Param("productCode") String productCode);
|
||||||
|
|
||||||
int insertOmsPurchaseOrderMap(OmsPurchaseOrderMap omsPurchaseOrderMap);
|
int insertOmsPurchaseOrderMap(OmsPurchaseOrderMap omsPurchaseOrderMap);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ public interface ProjectOrderInfoMapper
|
||||||
int selectPurchaseOrderMapBindNum(@Param("purchaseNo") String purchaseNo,
|
int selectPurchaseOrderMapBindNum(@Param("purchaseNo") String purchaseNo,
|
||||||
@Param("orderCode") String orderCode);
|
@Param("orderCode") String orderCode);
|
||||||
|
|
||||||
List<OrderProductMatchSnDetailDto> selectProductMatchSnDetailList(@Param("purchaseNo") String purchaseNo);
|
List<OrderProductMatchSnDetailDto> selectProductMatchSnDetailList(@Param("purchaseNo") String purchaseNo,
|
||||||
|
@Param("productCode") String productCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ public interface IProjectOrderInfoService
|
||||||
|
|
||||||
int savePurchaseOrderMap(OmsPurchaseOrderMap omsPurchaseOrderMap);
|
int savePurchaseOrderMap(OmsPurchaseOrderMap omsPurchaseOrderMap);
|
||||||
|
|
||||||
OrderProductMatchSnDto selectPurchaseSnList(String purchaseNo, String orderCode);
|
OrderProductMatchSnDto selectPurchaseSnList(String purchaseNo, String orderCode, String productCode);
|
||||||
|
|
||||||
int bindOrderSnCodes(BindOrderSnCodesDto params);
|
int bindOrderSnCodes(BindOrderSnCodesDto params);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
if (purchaseOrder == null) {
|
if (purchaseOrder == null) {
|
||||||
throw new ServiceException("采购单信息不存在");
|
throw new ServiceException("采购单信息不存在");
|
||||||
}
|
}
|
||||||
OmsPurchaseOrderMap purchaseOrderMap = omsPurchaseOrderMapMapper.selectByOrderIdAndPurchaseId(orderInfo.getId(), purchaseOrder.getId());
|
OmsPurchaseOrderMap purchaseOrderMap = omsPurchaseOrderMapMapper.selectByOrderIdAndPurchaseId(orderInfo.getId(), purchaseOrder.getId(), inventoryDelivery.getProductCode());
|
||||||
if (purchaseOrderMap == null || purchaseOrderMap.getBindNum() == null || purchaseOrderMap.getBindNum() <= 0) {
|
if (purchaseOrderMap == null || purchaseOrderMap.getBindNum() == null || purchaseOrderMap.getBindNum() <= 0) {
|
||||||
throw new ServiceException("当前订单与采购单未建立绑定关系或绑定数量为0");
|
throw new ServiceException("当前订单与采购单未建立绑定关系或绑定数量为0");
|
||||||
}
|
}
|
||||||
|
|
@ -170,7 +170,7 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
|
||||||
throw new ServiceException(String.format("采购单[%s]信息不存在", purchaseNo));
|
throw new ServiceException(String.format("采购单[%s]信息不存在", purchaseNo));
|
||||||
}
|
}
|
||||||
|
|
||||||
OmsPurchaseOrderMap purchaseOrderMap = omsPurchaseOrderMapMapper.selectByOrderIdAndPurchaseId(orderInfo.getId(), purchaseOrder.getId());
|
OmsPurchaseOrderMap purchaseOrderMap = omsPurchaseOrderMapMapper.selectByOrderIdAndPurchaseId(orderInfo.getId(), purchaseOrder.getId(), inventoryDelivery.getProductCode());
|
||||||
if (purchaseOrderMap == null || purchaseOrderMap.getBindNum() == null || purchaseOrderMap.getBindNum() <= 0) {
|
if (purchaseOrderMap == null || purchaseOrderMap.getBindNum() == null || purchaseOrderMap.getBindNum() <= 0) {
|
||||||
throw new ServiceException(String.format("订单与采购单[%s]未建立绑定关系或绑定数量为0", purchaseNo));
|
throw new ServiceException(String.format("订单与采购单[%s]未建立绑定关系或绑定数量为0", purchaseNo));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2889,7 +2889,11 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int savePurchaseOrderMap(OmsPurchaseOrderMap omsPurchaseOrderMap) {
|
public int savePurchaseOrderMap(OmsPurchaseOrderMap omsPurchaseOrderMap) {
|
||||||
OmsPurchaseOrderMap exist = omsPurchaseOrderMapMapper.selectByOrderIdAndPurchaseId(omsPurchaseOrderMap.getOrderId(), omsPurchaseOrderMap.getPurchaseId());
|
OmsPurchaseOrderMap exist = omsPurchaseOrderMapMapper.selectByOrderIdAndPurchaseId(
|
||||||
|
omsPurchaseOrderMap.getOrderId(),
|
||||||
|
omsPurchaseOrderMap.getPurchaseId(),
|
||||||
|
omsPurchaseOrderMap.getProductCode()
|
||||||
|
);
|
||||||
int result;
|
int result;
|
||||||
if (exist == null) {
|
if (exist == null) {
|
||||||
result = omsPurchaseOrderMapMapper.insertOmsPurchaseOrderMap(omsPurchaseOrderMap);
|
result = omsPurchaseOrderMapMapper.insertOmsPurchaseOrderMap(omsPurchaseOrderMap);
|
||||||
|
|
@ -2905,10 +2909,9 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OrderProductMatchSnDto selectPurchaseSnList(String purchaseNo, String orderCode) {
|
public OrderProductMatchSnDto selectPurchaseSnList(String purchaseNo, String orderCode, String productCode) {
|
||||||
OrderProductMatchSnDto result = new OrderProductMatchSnDto();
|
OrderProductMatchSnDto result = new OrderProductMatchSnDto();
|
||||||
List<OrderProductMatchSnDetailDto> snList = projectOrderInfoMapper.selectProductMatchSnDetailList(purchaseNo);
|
List<OrderProductMatchSnDetailDto> snList = projectOrderInfoMapper.selectProductMatchSnDetailList(purchaseNo, productCode);
|
||||||
// result.setTotalQuantity(projectOrderInfoMapper.selectProductMatchSnCountlList(purchaseNo));
|
|
||||||
result.setTotalQuantity(snList.size());
|
result.setTotalQuantity(snList.size());
|
||||||
Integer quotaQuantity = projectOrderInfoMapper.selectPurchaseOrderMapBindNum(purchaseNo, orderCode);
|
Integer quotaQuantity = projectOrderInfoMapper.selectPurchaseOrderMapBindNum(purchaseNo, orderCode);
|
||||||
result.setQuotaQuantity(quotaQuantity);
|
result.setQuotaQuantity(quotaQuantity);
|
||||||
|
|
|
||||||
|
|
@ -8,20 +8,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="id" column="id"/>
|
<result property="id" column="id"/>
|
||||||
<result property="orderId" column="order_id"/>
|
<result property="orderId" column="order_id"/>
|
||||||
<result property="purchaseId" column="purchase_id"/>
|
<result property="purchaseId" column="purchase_id"/>
|
||||||
|
<result property="productCode" column="product_code"/>
|
||||||
<result property="bindNum" column="bind_num"/>
|
<result property="bindNum" column="bind_num"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectByOrderIdAndPurchaseId" resultMap="OmsPurchaseOrderMapResult">
|
<select id="selectByOrderIdAndPurchaseId" resultMap="OmsPurchaseOrderMapResult">
|
||||||
select id, order_id, purchase_id, bind_num
|
select id, order_id, purchase_id, product_code, bind_num
|
||||||
from oms_purchase_order_map
|
from oms_purchase_order_map
|
||||||
where order_id = #{orderId}
|
where order_id = #{orderId}
|
||||||
and purchase_id = #{purchaseId}
|
and purchase_id = #{purchaseId}
|
||||||
|
and product_code = #{productCode}
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertOmsPurchaseOrderMap" parameterType="OmsPurchaseOrderMap" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertOmsPurchaseOrderMap" parameterType="OmsPurchaseOrderMap" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into oms_purchase_order_map(order_id, purchase_id, bind_num)
|
insert into oms_purchase_order_map(order_id, purchase_id, product_code, bind_num)
|
||||||
values (#{orderId}, #{purchaseId}, #{bindNum})
|
values (#{orderId}, #{purchaseId}, #{productCode}, #{bindNum})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateOmsPurchaseOrderMap" parameterType="OmsPurchaseOrderMap">
|
<update id="updateOmsPurchaseOrderMap" parameterType="OmsPurchaseOrderMap">
|
||||||
|
|
|
||||||
|
|
@ -965,7 +965,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
(select vendor_address from oms_vendor_info as tt where tt.vendor_id = t6.vendor_id) as vendor_address,
|
(select vendor_address from oms_vendor_info as tt where tt.vendor_id = t6.vendor_id) as vendor_address,
|
||||||
max(t4.price) as price,
|
max(t4.price) as price,
|
||||||
t4.quantity as cg_num,
|
t4.quantity as cg_num,
|
||||||
t4.quantity - ifnull((select sum(bind_num) from oms_purchase_order_map as tt where tt.purchase_id = t4.purchase_id), 0) as ky_num,
|
t4.quantity - ifnull((select sum(bind_num) from oms_purchase_order_map as tt
|
||||||
|
where tt.purchase_id = t4.purchase_id and tt.product_code = t4.product_code), 0) as ky_num,
|
||||||
t5.bind_num as ph_num,
|
t5.bind_num as ph_num,
|
||||||
t6.status,
|
t6.status,
|
||||||
(
|
(
|
||||||
|
|
@ -1030,6 +1031,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join oms_warehouse_info as t3
|
left join oms_warehouse_info as t3
|
||||||
on t2.warehouse_id = t3.id
|
on t2.warehouse_id = t3.id
|
||||||
where t2.purchase_no = #{purchaseNo}
|
where t2.purchase_no = #{purchaseNo}
|
||||||
|
and t1.product_code = #{productCode}
|
||||||
order by t1.product_sn
|
order by t1.product_sn
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue