Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e60f22979c | ||
|
|
84ff45b43d | ||
|
|
892cc30999 | ||
|
|
da76816533 | ||
|
|
b86ab75dcf | ||
|
|
796bb99a8b | ||
|
|
f9a50ae353 | ||
|
|
2094ea31cd | ||
|
|
788bae9a16 | ||
|
|
a65cca1cfa | ||
|
|
cae62e83a5 | ||
|
|
e2da7177f0 | ||
|
|
0b45ad181f | ||
|
|
260ec1f369 | ||
|
|
b28575c34d | ||
|
|
8af8197901 | ||
|
|
12f1d99e02 | ||
|
|
244fbf9759 | ||
|
|
e3826d6333 | ||
|
|
f217d6ec5c | ||
|
|
e58b6cb9ce | ||
|
|
b7cacaeb8d | ||
|
|
715883f1d4 | ||
|
|
139a3a82da | ||
|
|
fcc8102d9e | ||
|
|
7649585715 | ||
|
|
7511d211c6 |
@@ -19,7 +19,7 @@ import java.util.Set;
|
|||||||
/**
|
/**
|
||||||
* bms财务结算系统feign调用接口
|
* bms财务结算系统feign调用接口
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.102.192.32:8012",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.33.0.109:8012",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||||
public interface BmsServiceFeign {
|
public interface BmsServiceFeign {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.102.192.33:8017",fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.33.0.99:8017",fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||||
public interface OmsServiceFeign {
|
public interface OmsServiceFeign {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.102.192.31:8014",configuration = FeignAutoConfiguration.class)
|
@FeignClient(contextId = "commonWlhyServiceFeign",value = ServiceNameConstants.WLHY_SERVICE,url = "http://10.33.0.129:8014",configuration = FeignAutoConfiguration.class)
|
||||||
public interface WlhyServiceFeign {
|
public interface WlhyServiceFeign {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -539,6 +539,13 @@ public interface WlhyServiceFeign {
|
|||||||
@GetMapping("/feign/order/cancelIssueDocuments")
|
@GetMapping("/feign/order/cancelIssueDocuments")
|
||||||
public AjaxResult cancelIssueDocuments(@RequestParam(name="executeOrderId") String executeOrderId);
|
public AjaxResult cancelIssueDocuments(@RequestParam(name="executeOrderId") String executeOrderId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OMS出库业务单反审联动: 按执行单货源编号软删TMS整条链路(货源单->运单->运输作业单, is_delete=1), 幂等,
|
||||||
|
* 与 cancelIssueDocuments(仅关闭货源单且有有效运单即拒绝)不同, 反审口径不留TMS数据
|
||||||
|
*/
|
||||||
|
@PostMapping("/feign/order/deleteChainByExecuteOrderNumber")
|
||||||
|
public AjaxResult deleteChainByExecuteOrderNumber(@RequestParam(name="executeOrderNumber") String executeOrderNumber);
|
||||||
|
|
||||||
@GetMapping(value = "/ntocc/tmsSettlementExchangeRate/queryList")
|
@GetMapping(value = "/ntocc/tmsSettlementExchangeRate/queryList")
|
||||||
public AjaxResult<?> queryList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
public AjaxResult<?> queryList(@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
|||||||
* @description: TODO
|
* @description: TODO
|
||||||
* @date 2024/5/10 8:58
|
* @date 2024/5/10 8:58
|
||||||
**/
|
**/
|
||||||
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE,url = "http://10.102.192.32:8016",fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE,url = "http://10.33.0.109:8016",fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||||
public interface WmsServiceFeign {
|
public interface WmsServiceFeign {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,21 +74,21 @@ public interface WmsServiceFeign {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("oms下发单保存")
|
@ApiOperation("oms下发单保存")
|
||||||
@PostMapping(value = "/stockOutOrderApi/omsOutOrderAdd")
|
@PostMapping(value = "/stockOutOrderApi/omsOutOrderAdd")
|
||||||
public void omsOutOrderAdd(@RequestBody StockOutOrder stockOutOrder);
|
public AjaxResult omsOutOrderAdd(@RequestBody StockOutOrder stockOutOrder);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* oms下发单明细保存
|
* oms下发单明细保存
|
||||||
*/
|
*/
|
||||||
@ApiOperation("oms下发单明细保存")
|
@ApiOperation("oms下发单明细保存")
|
||||||
@PostMapping(value = "/stockOutOrderApi/omsOutOrderAddDetail")
|
@PostMapping(value = "/stockOutOrderApi/omsOutOrderAddDetail")
|
||||||
public void omsOutOrderAddDetail(@RequestBody List<OutMaterialDetail> outMaterialDetails);
|
public AjaxResult omsOutOrderAddDetail(@RequestBody List<OutMaterialDetail> outMaterialDetails);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* oms下发单明细保存
|
* oms下发单明细保存
|
||||||
*/
|
*/
|
||||||
@ApiOperation("oms下发单明细保存")
|
@ApiOperation("oms下发单明细保存")
|
||||||
@PostMapping(value = "/stockOutOrderApi/omsOutOrderAddDeliveryDetailsLink")
|
@PostMapping(value = "/stockOutOrderApi/omsOutOrderAddDeliveryDetailsLink")
|
||||||
public void omsOutOrderAddDeliveryDetailsLink(@RequestBody List<DeliveryDetailsLink> deliveryDetailsLinks);
|
public AjaxResult omsOutOrderAddDeliveryDetailsLink(@RequestBody List<DeliveryDetailsLink> deliveryDetailsLinks);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,6 +133,27 @@ public interface WmsServiceFeign {
|
|||||||
@PostMapping(value = "/stockInOrderApi/omsCancelInOrder")
|
@PostMapping(value = "/stockInOrderApi/omsCancelInOrder")
|
||||||
public AjaxResult omsCancelInOrder(@RequestBody StockInOrder stockInOrder);
|
public AjaxResult omsCancelInOrder(@RequestBody StockInOrder stockInOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* oms出库执行单反审(已出库/已复核单据客户通知回退场景):WMS侧还原实物库存并推送OMS库存、
|
||||||
|
* 逻辑删除出库链路单据、生成1条出库异常【反审记录】;反审原因经 remark 透传。
|
||||||
|
* 已产生下游不可逆数据时返回错误,OMS据此整体回滚。
|
||||||
|
*/
|
||||||
|
@ApiOperation("oms出库执行单反审WMS回退")
|
||||||
|
@PostMapping(value = "/stockOutOrderApi/omsReverseExecutionOrder")
|
||||||
|
public AjaxResult omsReverseExecutionOrder(@RequestBody StockOutOrder stockOutOrder);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* oms入库业务单反审:WMS侧一个事务内回退已入库/收货中/上架中单据——
|
||||||
|
* 校验未产生出库(按入库单号+动作"分配库存/出库"查库存调整记录>0即有出库) ->
|
||||||
|
* 按库存行整行回退库存扣减 -> 软删W入库单/W收货单/W上架单全链并打已反审标记
|
||||||
|
* (各页面【已反审】tab按"已软删+已反审"查询归档数据)-> 写1条入库异常【反审记录】(type=3)。
|
||||||
|
* 入参: inOrderNumber=执行入库单号, remark=业务单号+反审原因, updateBy/updateByName=反审人;
|
||||||
|
* WMS无该单数据时幂等返回成功(未下发单反审不产生WMS数据)。
|
||||||
|
*/
|
||||||
|
@ApiOperation("oms入库单反审WMS回退")
|
||||||
|
@PostMapping(value = "/stockInOrderApi/omsReverseInOrder")
|
||||||
|
public AjaxResult omsReverseInOrder(@RequestBody StockInOrder stockInOrder);
|
||||||
|
|
||||||
@ApiOperation("oms查询物料列表")
|
@ApiOperation("oms查询物料列表")
|
||||||
@GetMapping("/materialBaseInfoApi/queryList")
|
@GetMapping("/materialBaseInfoApi/queryList")
|
||||||
public TableDataInfo getMaterialBaseInfoList(MaterialInfoDTO materialInfoDTO);
|
public TableDataInfo getMaterialBaseInfoList(MaterialInfoDTO materialInfoDTO);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import com.mhd.system.api.feign.FeignAutoConfiguration;
|
|||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,url = "http://10.102.192.33:8018",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,url = "http://10.33.0.99:8018",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||||
public interface YmsServiceFeign {
|
public interface YmsServiceFeign {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+6
@@ -551,6 +551,12 @@ public class RemoteWlhyFallbackFactory implements FallbackFactory<WlhyServiceFei
|
|||||||
return AjaxResult.error(cause.getMessage());
|
return AjaxResult.error(cause.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult deleteChainByExecuteOrderNumber(String executeOrderNumber) {
|
||||||
|
//返回错误而非静默成功, 让OMS反审事务能感知失败并整体回滚
|
||||||
|
return AjaxResult.error("TMS反审联动软删链路失败(服务降级):" + cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult<?> queryList(Integer pageNo, Integer pageSize, String pushStatus, String organizationId) {
|
public AjaxResult<?> queryList(Integer pageNo, Integer pageSize, String pushStatus, String organizationId) {
|
||||||
return AjaxResult.error(cause.getMessage());
|
return AjaxResult.error(cause.getMessage());
|
||||||
|
|||||||
+19
-4
@@ -57,16 +57,19 @@ public class RemoteWmsFallbackFactory implements FallbackFactory<WmsServiceFeign
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void omsOutOrderAdd(StockOutOrder stockOutOrder) {
|
public AjaxResult omsOutOrderAdd(StockOutOrder stockOutOrder) {
|
||||||
|
//返回错误而非静默成功: 降级吞掉会让OMS继续走分配, 残留"有单无明细"的垃圾单
|
||||||
|
return AjaxResult.error("WMS下发单保存失败(服务降级):" + cause.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void omsOutOrderAddDetail(List<OutMaterialDetail> outMaterialDetails) {
|
public AjaxResult omsOutOrderAddDetail(List<OutMaterialDetail> outMaterialDetails) {
|
||||||
|
return AjaxResult.error("WMS下发单明细保存失败(服务降级):" + cause.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void omsOutOrderAddDeliveryDetailsLink(List<DeliveryDetailsLink> deliveryDetailsLinks) {
|
public AjaxResult omsOutOrderAddDeliveryDetailsLink(List<DeliveryDetailsLink> deliveryDetailsLinks) {
|
||||||
|
return AjaxResult.error("WMS下发单配送明细保存失败(服务降级):" + cause.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -82,6 +85,12 @@ public class RemoteWmsFallbackFactory implements FallbackFactory<WmsServiceFeign
|
|||||||
return AjaxResult.error("WMS取消下发清理失败:" + cause.getMessage());
|
return AjaxResult.error("WMS取消下发清理失败:" + cause.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult omsReverseExecutionOrder(StockOutOrder stockOutOrder) {
|
||||||
|
//返回错误而非静默成功,让OMS反审事务能感知失败并整体回滚
|
||||||
|
return AjaxResult.error("WMS出库执行单反审失败(服务降级):" + cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void omsAutoAssign(StockOutOrderDTO stockOutOrderDTO) {
|
public void omsAutoAssign(StockOutOrderDTO stockOutOrderDTO) {
|
||||||
|
|
||||||
@@ -110,6 +119,12 @@ public class RemoteWmsFallbackFactory implements FallbackFactory<WmsServiceFeign
|
|||||||
return AjaxResult.error("WMS取消下发清理失败:" + cause.getMessage());
|
return AjaxResult.error("WMS取消下发清理失败:" + cause.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult omsReverseInOrder(StockInOrder stockInOrder) {
|
||||||
|
//返回错误而非静默成功,让OMS侧反审能感知回退失败并整体回滚(反审可重试,WMS回退幂等)
|
||||||
|
return AjaxResult.error("WMS入库单反审回退失败(服务降级):" + cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo getMaterialBaseInfoList(MaterialInfoDTO materialInfoDTO) {
|
public TableDataInfo getMaterialBaseInfoList(MaterialInfoDTO materialInfoDTO) {
|
||||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ import java.io.InputStream;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@FeignClient(value = "mhd-third-party-service",url = "http://10.102.192.31:8012", configuration = FeignAutoConfiguration.class)
|
@FeignClient(value = "mhd-third-party-service",url = "http://10.33.0.129:8012", configuration = FeignAutoConfiguration.class)
|
||||||
public interface ThirdPartyServiceFeign {
|
public interface ThirdPartyServiceFeign {
|
||||||
|
|
||||||
//查询当前组织所有三方接口信息
|
//查询当前组织所有三方接口信息
|
||||||
|
|||||||
+58
@@ -0,0 +1,58 @@
|
|||||||
|
package com.mhd.oms.application.service;
|
||||||
|
|
||||||
|
import com.mhd.common.core.exception.ServiceException;
|
||||||
|
import com.mhd.common.core.web.domain.AjaxResult;
|
||||||
|
import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReservationStockInOrderMapper;
|
||||||
|
import com.mhd.system.api.SystemServiceFeign;
|
||||||
|
import com.mhd.system.api.domain.WarehouseFeignPO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓库信息获取(带本地兜底): 下发/下单冻结/保存等流程原先直接 Feign 调 system 服务取仓库信息,
|
||||||
|
* system 服务未启动/降级/返回非200时整个流程被"获取仓库信息失败"阻断。
|
||||||
|
* 本组件统一收口: 优先 Feign, 失败时回退本地跨库直查 "NGWL_TEST_SYSTEM".WAREHOUSE(与 Feign 同库同表, OMS 库账号可读),
|
||||||
|
* 两侧都取不到才抛错并带出 Feign 真实返回原因。
|
||||||
|
*
|
||||||
|
* @date 2026/9/11
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class WarehouseInfoApplicationService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SystemServiceFeign systemServiceFeign;
|
||||||
|
@Autowired
|
||||||
|
private ReservationStockInOrderMapper reservationStockInOrderMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取仓库信息: Feign 优先, 失败走本地兜底; 两边都取不到抛 ServiceException
|
||||||
|
*
|
||||||
|
* @param warehouseId 仓库id
|
||||||
|
* @return 仓库信息(含编码/名称/单号生成规则/库存锁定模式等)
|
||||||
|
*/
|
||||||
|
public WarehouseFeignPO getWarehouseInfo(Long warehouseId) {
|
||||||
|
if (warehouseId == null) {
|
||||||
|
throw new ServiceException("仓库ID不能为空");
|
||||||
|
}
|
||||||
|
AjaxResult ajaxResult = null;
|
||||||
|
try {
|
||||||
|
ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取仓库信息Feign调用异常, 走本地兜底查询, warehouseId={}, error={}", warehouseId, e.getMessage());
|
||||||
|
}
|
||||||
|
if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code"))) && ajaxResult.get("data") != null) {
|
||||||
|
return com.alibaba.fastjson.JSON.parseObject(
|
||||||
|
com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||||
|
}
|
||||||
|
String remoteMsg = ajaxResult == null ? "Feign调用异常" : String.valueOf(ajaxResult.get("msg"));
|
||||||
|
log.warn("获取仓库信息Feign失败(返回: {}), 走本地兜底查询, warehouseId={}", remoteMsg, warehouseId);
|
||||||
|
WarehouseFeignPO local = reservationStockInOrderMapper.getWarehouseInfoFallback(warehouseId);
|
||||||
|
if (local == null) {
|
||||||
|
throw new ServiceException("获取仓库信息失败(Feign返回:" + remoteMsg + "), 且本地未查到仓库[warehouseId="
|
||||||
|
+ warehouseId + "], 请检查仓库是否存在/已启用");
|
||||||
|
}
|
||||||
|
return local;
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
-6
@@ -46,6 +46,9 @@ public class OutEntrustOrderApplicationService {
|
|||||||
@Resource
|
@Resource
|
||||||
private SystemServiceFeign systemServiceFeign;
|
private SystemServiceFeign systemServiceFeign;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private com.mhd.oms.application.service.WarehouseInfoApplicationService warehouseInfoApplicationService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private WmsServiceFeign wmsServiceFeign;
|
private WmsServiceFeign wmsServiceFeign;
|
||||||
|
|
||||||
@@ -352,14 +355,10 @@ public class OutEntrustOrderApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库信息校验并回填编码/名称
|
* 仓库信息校验并回填编码/名称 (Feign失败走本地跨库兜底)
|
||||||
*/
|
*/
|
||||||
private void setWarehouseInfo(OutEntrustOrderDO outEntrustOrderDO) {
|
private void setWarehouseInfo(OutEntrustOrderDO outEntrustOrderDO) {
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(outEntrustOrderDO.getWarehouseId());
|
WarehouseFeignPO warehouseFeignPO = warehouseInfoApplicationService.getWarehouseInfo(outEntrustOrderDO.getWarehouseId());
|
||||||
if (ajaxResult == null || !"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
|
||||||
throw new ServiceException("获取仓库信息失败,请检查仓库是否有效");
|
|
||||||
}
|
|
||||||
WarehouseFeignPO warehouseFeignPO = JSONUtil.toBean(JSONUtil.toJsonStr(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
if (warehouseFeignPO == null || Objects.isNull(warehouseFeignPO.getWarehouseId())) {
|
if (warehouseFeignPO == null || Objects.isNull(warehouseFeignPO.getWarehouseId())) {
|
||||||
throw new ServiceException("仓库不存在,请重新选择");
|
throw new ServiceException("仓库不存在,请重新选择");
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -39,8 +39,8 @@ public interface BusinessDocumentOrderMapper extends BaseMapper<BusinessDocument
|
|||||||
String getPushVerifyByOrgId(@Param("organizationId") Long organizationId);
|
String getPushVerifyByOrgId(@Param("organizationId") Long organizationId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计指定日期前缀(yyMMdd)下已生成的新格式业务单号数量
|
* 查询指定日期前缀(yyMMdd)下已生成的新格式业务单号列表
|
||||||
* 仅统计新格式(长度<=12),过滤历史16位旧数据,保证序号每日从001正确累计
|
* 仅查新格式(长度<=12),过滤历史16位旧数据,供取号器解析当日最大序号
|
||||||
*/
|
*/
|
||||||
int countByGoodsNumberPrefix(@Param("prefix") String prefix);
|
List<String> selectGoodsNumbersByPrefix(@Param("prefix") String prefix);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-5
@@ -237,11 +237,8 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
|||||||
subOrder.setRecipientName(user.getUserName());
|
subOrder.setRecipientName(user.getUserName());
|
||||||
|
|
||||||
|
|
||||||
//生成子单货源单号(yyMMdd + 当日顺序号)
|
//生成子单货源单号(yyMMdd + 当日顺序号)并落库, 撞唯一索引自动重新取号重试
|
||||||
String orderCode = goodsNumberGenerator.generateUniqueGoodsNumber(subOrder.getDocumentDate());
|
goodsNumberGenerator.insertWithUniqueGoodsNumber(subOrder);
|
||||||
subOrder.setGoodsNumber(orderCode);
|
|
||||||
|
|
||||||
businessDocumentOrderMapper.insert(subOrder);
|
|
||||||
subOrderCount++; // 增加子单计数
|
subOrderCount++; // 增加子单计数
|
||||||
|
|
||||||
// 保存子单的地址信息到BUSINESS_DOCUMENT_ADDRESS_MULTI表
|
// 保存子单的地址信息到BUSINESS_DOCUMENT_ADDRESS_MULTI表
|
||||||
|
|||||||
+21
-19
@@ -285,24 +285,9 @@ public class BusinessDocumentOrderDomainService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//生成货源单号(yyMMdd + 当日顺序号,每日重置)
|
//生成货源单号并落库见下方 insertWithUniqueGoodsNumber:
|
||||||
String orderCode = goodsNumberGenerator.generateUniqueGoodsNumber(tmsOrder.getDocumentDate());
|
//取号与插单合并为原子重试(撞goods_number唯一索引自动重新取号),
|
||||||
tmsOrder.setGoodsNumber(orderCode);
|
//出库/入库业务单的单号回填也移至插单成功之后,避免插单失败留下脏回填
|
||||||
|
|
||||||
ReservationStockOutOrder reservationStockOutOrder = reservationStockOutOrderMapper.selectOne(new LambdaQueryWrapper<ReservationStockOutOrder>()
|
|
||||||
.eq(ReservationStockOutOrder::getOutOrderNumber, tmsOrder.getInOrderNumber())
|
|
||||||
.eq(ReservationStockOutOrder::getDelFlag, 1));
|
|
||||||
if (reservationStockOutOrder != null){
|
|
||||||
reservationStockOutOrder.setBusinessNumber(tmsOrder.getGoodsNumber());
|
|
||||||
reservationStockOutOrderMapper.updateById(reservationStockOutOrder);
|
|
||||||
}
|
|
||||||
ReservationStockInOrder reservationStockInOrder = reservationStockInOrderMapper.selectOne(new LambdaQueryWrapper<ReservationStockInOrder>()
|
|
||||||
.eq(ReservationStockInOrder::getInOrderNumber, tmsOrder.getInOrderNumber())
|
|
||||||
.eq(ReservationStockInOrder::getDelFlag, 1));
|
|
||||||
if (reservationStockInOrder != null){
|
|
||||||
reservationStockInOrder.setBusinessNumber(tmsOrder.getGoodsNumber());
|
|
||||||
reservationStockInOrderMapper.updateById(reservationStockInOrder);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<BusinessDocumentAddressMultiDTO> loadingAddressList = businessDocumentOrderDO.getLoadingAddressList();//装货地信息集合
|
List<BusinessDocumentAddressMultiDTO> loadingAddressList = businessDocumentOrderDO.getLoadingAddressList();//装货地信息集合
|
||||||
List<BusinessDocumentAddressMultiDTO> unloadAddressList = businessDocumentOrderDO.getUnloadAddressList();//卸货地信息集合
|
List<BusinessDocumentAddressMultiDTO> unloadAddressList = businessDocumentOrderDO.getUnloadAddressList();//卸货地信息集合
|
||||||
@@ -426,7 +411,24 @@ public class BusinessDocumentOrderDomainService {
|
|||||||
//一天后
|
//一天后
|
||||||
tmsOrder.setDocumentDate(businessDocumentOrderDO.getDocumentDate());
|
tmsOrder.setDocumentDate(businessDocumentOrderDO.getDocumentDate());
|
||||||
|
|
||||||
boolean istrue = businessDocumentOrderMapper.insert(tmsOrder) > 0;
|
//生成货源单号(yyMMdd + 当日顺序号,每日重置)并落库, 撞唯一索引自动重新取号重试
|
||||||
|
boolean istrue = goodsNumberGenerator.insertWithUniqueGoodsNumber(tmsOrder);
|
||||||
|
|
||||||
|
//落库成功后将运输业务单号回填至关联的出库/入库业务单
|
||||||
|
ReservationStockOutOrder reservationStockOutOrder = reservationStockOutOrderMapper.selectOne(new LambdaQueryWrapper<ReservationStockOutOrder>()
|
||||||
|
.eq(ReservationStockOutOrder::getOutOrderNumber, tmsOrder.getInOrderNumber())
|
||||||
|
.eq(ReservationStockOutOrder::getDelFlag, 1));
|
||||||
|
if (reservationStockOutOrder != null){
|
||||||
|
reservationStockOutOrder.setBusinessNumber(tmsOrder.getGoodsNumber());
|
||||||
|
reservationStockOutOrderMapper.updateById(reservationStockOutOrder);
|
||||||
|
}
|
||||||
|
ReservationStockInOrder reservationStockInOrder = reservationStockInOrderMapper.selectOne(new LambdaQueryWrapper<ReservationStockInOrder>()
|
||||||
|
.eq(ReservationStockInOrder::getInOrderNumber, tmsOrder.getInOrderNumber())
|
||||||
|
.eq(ReservationStockInOrder::getDelFlag, 1));
|
||||||
|
if (reservationStockInOrder != null){
|
||||||
|
reservationStockInOrder.setBusinessNumber(tmsOrder.getGoodsNumber());
|
||||||
|
reservationStockInOrderMapper.updateById(reservationStockInOrder);
|
||||||
|
}
|
||||||
|
|
||||||
if (hasDetails) {
|
if (hasDetails) {
|
||||||
for (BusinessDeliveryDetailsLinkDTO businessDeliveryDetailsLinkDTO : businessDeliveryDetailsLinkDTOList) {
|
for (BusinessDeliveryDetailsLinkDTO businessDeliveryDetailsLinkDTO : businessDeliveryDetailsLinkDTOList) {
|
||||||
|
|||||||
+90
-4
@@ -5,23 +5,44 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.mhd.common.core.exception.ServiceException;
|
import com.mhd.common.core.exception.ServiceException;
|
||||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 业务单据订单(goodsNumber)单号生成器
|
* 业务单据订单(goodsNumber)单号生成器
|
||||||
* 规则: yyMMdd(取自单据日期) + 当日顺序号(每日重置, 3位起步, 超999自动扩位)
|
* 规则: yyMMdd(取自单据日期) + 当日顺序号(每日重置, 3位起步, 超999自动扩位)
|
||||||
* 示例: 260804001、260804999、2608041000
|
* 示例: 260804001、260804999、2608041000
|
||||||
|
*
|
||||||
|
* 唯一性保障(不依赖唯一索引, 三层防线):
|
||||||
|
* 1) 取号: 当日已生成单号 MAX+1 作为基线 + 候选号存在性校验后移收敛
|
||||||
|
* (对齐入库单号修复先例 ReservationStockInOrderDomainService#generateReserveOrderNumber)
|
||||||
|
* 2) 落库: 按日期前缀分段的JVM锁串行化"取号+插单", 消除本实例内并发审核/
|
||||||
|
* 批量取号的check-then-act竞态(多实例部署时本层只覆盖各自实例)
|
||||||
|
* 3) 自检自愈: 插单后立即校验同号数量, >1 说明与并发插入撞号, 给本单重新
|
||||||
|
* 取号改号, 兜住跨实例残余竞态
|
||||||
|
* 若日后补建goods_number唯一索引(见 sql/20260906_oms_business_goods_number_unique.sql),
|
||||||
|
* 撞号将抛DuplicateKeyException由重试逻辑接住, 与上述防线叠加互不冲突
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class GoodsNumberGenerator {
|
public class GoodsNumberGenerator {
|
||||||
|
|
||||||
private static final int MAX_RETRY = 100;
|
private static final int MAX_RETRY = 100;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取号+插单分段锁: 按单号日期前缀(yyMMdd)分段, 同日串行、跨日并行,
|
||||||
|
* 锁对象常驻(每日新增1个, 增量可忽略)
|
||||||
|
*/
|
||||||
|
private static final Map<String, Object> LOCK_STRIPES = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||||
|
|
||||||
@@ -33,8 +54,21 @@ public class GoodsNumberGenerator {
|
|||||||
Date date = (documentDate == null) ? new Date() : documentDate;
|
Date date = (documentDate == null) ? new Date() : documentDate;
|
||||||
String datePart = DateUtil.format(date, "yyMMdd");
|
String datePart = DateUtil.format(date, "yyMMdd");
|
||||||
|
|
||||||
// count 只查一次作为序号基线
|
// 当日已生成单号的最大序号作为基线(MAX+1而非COUNT+1, 防脏数据/序号错位导致回退复用)
|
||||||
long seq = (long) businessDocumentOrderMapper.countByGoodsNumberPrefix(datePart) + 1;
|
List<String> existNumbers = businessDocumentOrderMapper.selectGoodsNumbersByPrefix(datePart);
|
||||||
|
long seq = 0;
|
||||||
|
for (String existNumber : existNumbers) {
|
||||||
|
if (existNumber == null || existNumber.length() <= datePart.length()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String numStr = existNumber.substring(datePart.length());
|
||||||
|
if (!numStr.matches("\\d+")) {
|
||||||
|
continue; // 防脏数据(非纯数字后缀)导致解析失败
|
||||||
|
}
|
||||||
|
seq = Math.max(seq, Long.parseLong(numStr));
|
||||||
|
}
|
||||||
|
seq = seq + 1;
|
||||||
|
|
||||||
int retryCount = 0;
|
int retryCount = 0;
|
||||||
while (retryCount < MAX_RETRY) {
|
while (retryCount < MAX_RETRY) {
|
||||||
String orderCode = datePart + String.format("%03d", seq);
|
String orderCode = datePart + String.format("%03d", seq);
|
||||||
@@ -46,8 +80,60 @@ public class GoodsNumberGenerator {
|
|||||||
if (CollectionUtils.isEmpty(exist)) {
|
if (CollectionUtils.isEmpty(exist)) {
|
||||||
return orderCode;
|
return orderCode;
|
||||||
}
|
}
|
||||||
seq++; // ← 关键:查重失败,序号往后递增找空位,而不是重新count
|
seq++; // ← 关键:查重失败,序号往后递增找空位,而不是重新取基线
|
||||||
}
|
}
|
||||||
throw new ServiceException("生成唯一业务单号失败,已达到最大重试次数:" + MAX_RETRY);
|
throw new ServiceException("生成唯一业务单号失败,已达到最大重试次数:" + MAX_RETRY);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 生成唯一业务单号并落库: JVM分段锁内完成"取号+插单",
|
||||||
|
* 插入撞goods_number唯一索引时自动重新取号重试(索引为可选兜底),
|
||||||
|
* 插单成功后自检同号并自愈改号。
|
||||||
|
* 供业务单创建入口(手动/审核新增、审核拆单、预约确认)统一使用。
|
||||||
|
* @return 是否插入成功(mapper.insert结果)
|
||||||
|
*/
|
||||||
|
public boolean insertWithUniqueGoodsNumber(BusinessDocumentOrder order) {
|
||||||
|
Date date = (order.getDocumentDate() == null) ? new Date() : order.getDocumentDate();
|
||||||
|
String lockKey = DateUtil.format(date, "yyMMdd");
|
||||||
|
synchronized (LOCK_STRIPES.computeIfAbsent(lockKey, k -> new Object())) {
|
||||||
|
int retryCount = 0;
|
||||||
|
while (retryCount < MAX_RETRY) {
|
||||||
|
retryCount++;
|
||||||
|
order.setGoodsNumber(generateUniqueGoodsNumber(order.getDocumentDate()));
|
||||||
|
try {
|
||||||
|
boolean inserted = businessDocumentOrderMapper.insert(order) > 0;
|
||||||
|
// 插单后自检自愈: 无唯一索引时跨实例并发窗口内的撞号双方都能落库,
|
||||||
|
// 同号数量>1说明本单撞号, 给本单重新取号改号, 防止单号重复扩散
|
||||||
|
healIfDuplicated(order);
|
||||||
|
return inserted;
|
||||||
|
} catch (DuplicateKeyException e) {
|
||||||
|
// 已建唯一索引时的兜底: 仅业务单号撞唯一索引时重试, 其他唯一约束冲突原样抛出
|
||||||
|
String message = e.getMessage();
|
||||||
|
if (message == null || !message.toLowerCase().contains("goods_number")) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
log.warn("业务单号[{}]撞号, 自动重新取号重试(第{}次): {}", order.getGoodsNumber(), retryCount, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new ServiceException("生成唯一业务单号失败,已达到最大重试次数:" + MAX_RETRY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插单后自检自愈: 查同号数量, >1 说明有并发插入撞号(本单为后插入方),
|
||||||
|
* 保持先落库单据单号不变, 重新取号给本单改号
|
||||||
|
*/
|
||||||
|
private void healIfDuplicated(BusinessDocumentOrder order) {
|
||||||
|
List<BusinessDocumentOrder> sameNumber = businessDocumentOrderMapper.selectList(
|
||||||
|
new QueryWrapper<BusinessDocumentOrder>().eq("goods_number", order.getGoodsNumber())
|
||||||
|
);
|
||||||
|
if (sameNumber != null && sameNumber.size() > 1) {
|
||||||
|
String oldNumber = order.getGoodsNumber();
|
||||||
|
String newNumber = generateUniqueGoodsNumber(order.getDocumentDate());
|
||||||
|
order.setGoodsNumber(newNumber);
|
||||||
|
businessDocumentOrderMapper.updateById(order);
|
||||||
|
log.warn("业务单号[{}]与并发插入撞号(无唯一索引兜底), 已自愈改号为[{}], orderId={}",
|
||||||
|
oldNumber, newNumber, order.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -501,6 +501,6 @@ public class ExecutionInMaterialDetailPO extends ExecutionStockInOrderBasePO {
|
|||||||
private BigDecimal insureAmount;
|
private BigDecimal insureAmount;
|
||||||
|
|
||||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||||
@Excel(name = "货物类型")
|
@Excel(name = "货物类型", readConverterExp = "0=物料,1=半成品,2=成品")
|
||||||
private Integer goodsType;
|
private Integer goodsType;
|
||||||
}
|
}
|
||||||
+16
-1
@@ -1,5 +1,7 @@
|
|||||||
package com.mhd.oms.domain.executionInMaterialDetail.repository.po;
|
package com.mhd.oms.domain.executionInMaterialDetail.repository.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.mhd.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -15,21 +17,34 @@ import java.util.Date;
|
|||||||
public class ExecutionInMaterialDetailWithOrderPO extends ExecutionInMaterialDetailPO {
|
public class ExecutionInMaterialDetailWithOrderPO extends ExecutionInMaterialDetailPO {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty("入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
@ApiModelProperty("入库单流转状态(参考): 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||||
private Integer inOrderStatus;
|
private Integer inOrderStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单展示状态: 0-已创建 2-已审核 3-已驳回 4-已入库(WMS回写status=5时同步/推送创建时置4,前端状态列绑定此字段)")
|
||||||
|
@Excel(name = "单据状态", readConverterExp = "0=已创建,2=已审核,3=已驳回,4=已入库")
|
||||||
|
private Integer issueStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("货物种类(物料分类名称,多个逗号分隔)")
|
||||||
|
@Excel(name = "货物种类")
|
||||||
|
private String materialClassifyName;
|
||||||
|
|
||||||
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
|
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
private Integer inOrderAuditStatus;
|
private Integer inOrderAuditStatus;
|
||||||
|
|
||||||
@ApiModelProperty("货主ID")
|
@ApiModelProperty("货主ID")
|
||||||
private Long orderShipperId;
|
private Long orderShipperId;
|
||||||
|
|
||||||
@ApiModelProperty("货主编码")
|
@ApiModelProperty("货主编码")
|
||||||
|
@Excel(name = "货主编码")
|
||||||
private String orderShipperCode;
|
private String orderShipperCode;
|
||||||
|
|
||||||
@ApiModelProperty("货主名称")
|
@ApiModelProperty("货主名称")
|
||||||
|
@Excel(name = "货主名称")
|
||||||
private String orderShipperName;
|
private String orderShipperName;
|
||||||
|
|
||||||
@ApiModelProperty("入库日期")
|
@ApiModelProperty("入库日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date warehouseDate;
|
private Date warehouseDate;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -45,6 +45,12 @@ public class ExecutionInMaterialDetailQueryDTO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("入库单类型编码")
|
@ApiModelProperty("入库单类型编码")
|
||||||
private String inOrderTypeCode;
|
private String inOrderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单类型编码(与inOrderTypeCode同义)")
|
||||||
|
private String orderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单类型名称(模糊查询)")
|
||||||
|
private String orderTypeName;
|
||||||
|
|
||||||
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||||
private Integer inStatus;
|
private Integer inStatus;
|
||||||
|
|
||||||
@@ -66,4 +72,10 @@ public class ExecutionInMaterialDetailQueryDTO extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("物料名称")
|
@ApiModelProperty("物料名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际入仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String warehouseDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际入仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String warehouseDateEnd;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -78,6 +78,12 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
|||||||
@Excel(name = "入库单类型编码")
|
@Excel(name = "入库单类型编码")
|
||||||
private String inOrderTypeCode;
|
private String inOrderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单类型编码(与inOrderTypeCode同义)")
|
||||||
|
private String orderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单类型名称")
|
||||||
|
private String orderTypeName;
|
||||||
|
|
||||||
@ApiModelProperty("入库单类型名称")
|
@ApiModelProperty("入库单类型名称")
|
||||||
@Excel(name = "入库单类型名称")
|
@Excel(name = "入库单类型名称")
|
||||||
private String inOrderTypeName;
|
private String inOrderTypeName;
|
||||||
@@ -137,4 +143,10 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||||
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||||
private Integer overStockStatus;
|
private Integer overStockStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际入仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String warehouseDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际入仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String warehouseDateEnd;
|
||||||
}
|
}
|
||||||
+17
@@ -85,4 +85,21 @@ public class ExecutionInMaterialDetailApplicationService {
|
|||||||
return inMaterialDetailDomainService.queryInOrderDetailList(queryOrderOverStockDO);
|
return inMaterialDetailDomainService.queryInOrderDetailList(queryOrderOverStockDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细导出(全字段,口径同 queryInOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<ExecutionInMaterialDetailWithOrderPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
List<ExecutionInMaterialDetailWithOrderPO> list = queryInOrderDetailList(queryOrderOverStockDO);
|
||||||
|
// 货物种类=挂载分类的父级分类名称:material_classify_name为分类路径(如"食品,饮料"),取倒数第二段;
|
||||||
|
// 仅一级分类(无父级)时取自身名称
|
||||||
|
for (ExecutionInMaterialDetailWithOrderPO po : list) {
|
||||||
|
String names = po.getMaterialClassifyName();
|
||||||
|
if (names != null && names.contains(",")) {
|
||||||
|
String[] parts = names.split(",");
|
||||||
|
po.setMaterialClassifyName(parts[parts.length - 2].trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+4
-1
@@ -518,4 +518,7 @@ public class ExecutionOutMaterialDetail extends BaseVOEntity {
|
|||||||
private String inLineNumGw;
|
private String inLineNumGw;
|
||||||
private String opWhLocGw;
|
private String opWhLocGw;
|
||||||
private String warehouseGw;
|
private String warehouseGw;
|
||||||
}
|
|
||||||
|
@ApiModelProperty("反审标记: 0-无 1-已反审(业务单反审时软删del_flag=2并打标记)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
}
|
||||||
|
|||||||
+17
-1
@@ -1,6 +1,7 @@
|
|||||||
package com.mhd.oms.domain.executionOutMaterialDetail.repository.po;
|
package com.mhd.oms.domain.executionOutMaterialDetail.repository.po;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.mhd.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
@@ -18,34 +19,49 @@ import java.util.Date;
|
|||||||
public class ExecutionOutMaterialDetailWithOrderPO extends ExecutionOutMaterialDetailPO {
|
public class ExecutionOutMaterialDetailWithOrderPO extends ExecutionOutMaterialDetailPO {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty("出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
@ApiModelProperty("出库单流转状态(参考): 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接;WMS出库完成不回写此字段")
|
||||||
private Integer outOrderStatus;
|
private Integer outOrderStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单展示状态: 0-已创建 2-已审核 3-已驳回 4-已出库(WMS出库完成/推送创建时回写,前端状态列绑定此字段)")
|
||||||
|
@Excel(name = "单据状态", readConverterExp = "0=已创建,2=已审核,3=已驳回,4=已出库")
|
||||||
|
private Integer issueStatus;
|
||||||
|
|
||||||
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
|
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
private Integer outOrderAuditStatus;
|
private Integer outOrderAuditStatus;
|
||||||
|
|
||||||
@ApiModelProperty("货主ID")
|
@ApiModelProperty("货主ID")
|
||||||
private Long orderShipperId;
|
private Long orderShipperId;
|
||||||
|
|
||||||
@ApiModelProperty("货主编码")
|
@ApiModelProperty("货主编码")
|
||||||
|
@Excel(name = "货主编码")
|
||||||
private String orderShipperCode;
|
private String orderShipperCode;
|
||||||
|
|
||||||
@ApiModelProperty("货主名称")
|
@ApiModelProperty("货主名称")
|
||||||
|
@Excel(name = "货主名称")
|
||||||
private String orderShipperName;
|
private String orderShipperName;
|
||||||
|
|
||||||
@ApiModelProperty("出仓日期")
|
@ApiModelProperty("出仓日期")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date orderOutboundDate;
|
private Date orderOutboundDate;
|
||||||
|
|
||||||
@ApiModelProperty("出库时间")
|
@ApiModelProperty("出库时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date orderOutboundTime;
|
private Date orderOutboundTime;
|
||||||
|
|
||||||
@ApiModelProperty("保额")
|
@ApiModelProperty("保额")
|
||||||
|
@Excel(name = "保额")
|
||||||
private BigDecimal insureAmount;
|
private BigDecimal insureAmount;
|
||||||
|
|
||||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||||
|
@Excel(name = "货物类型", readConverterExp = "0=物料,1=半成品,2=成品")
|
||||||
private Integer goodsType;
|
private Integer goodsType;
|
||||||
|
|
||||||
|
@ApiModelProperty("货物种类(物料分类名称,多个逗号分隔)")
|
||||||
|
@Excel(name = "货物种类")
|
||||||
|
private String materialClassifyName;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -45,6 +45,12 @@ public class ExecutionOutMaterialDetailQueryDTO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("出库单类型编码")
|
@ApiModelProperty("出库单类型编码")
|
||||||
private String outOrderTypeCode;
|
private String outOrderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单类型编码(与outOrderTypeCode同义)")
|
||||||
|
private String orderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单类型名称(模糊查询)")
|
||||||
|
private String orderTypeName;
|
||||||
|
|
||||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||||
private Integer outStatus;
|
private Integer outStatus;
|
||||||
|
|
||||||
@@ -66,4 +72,10 @@ public class ExecutionOutMaterialDetailQueryDTO extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("物料名称")
|
@ApiModelProperty("物料名称")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际出仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String outboundDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际出仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String outboundDateEnd;
|
||||||
}
|
}
|
||||||
|
|||||||
+17
@@ -459,4 +459,21 @@ public class ExecutionStockInOrder extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("通知单备注")
|
@ApiModelProperty("通知单备注")
|
||||||
private String noticeRemark;
|
private String noticeRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+17
@@ -482,4 +482,21 @@ public class ExecutionStockInOrderPO extends BaseVOEntity {
|
|||||||
private String khdm;
|
private String khdm;
|
||||||
@ApiModelProperty("通知单备注")
|
@ApiModelProperty("通知单备注")
|
||||||
private String noticeRemark;
|
private String noticeRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+17
@@ -513,4 +513,21 @@ public class ExecutionStockInOrderDO extends BaseVOEntity {
|
|||||||
private String businessPriceWay;
|
private String businessPriceWay;
|
||||||
@ApiModelProperty("通知单备注")
|
@ApiModelProperty("通知单备注")
|
||||||
private String noticeRemark;
|
private String noticeRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+17
@@ -510,4 +510,21 @@ public class ExecutionStockInOrderDTO extends ExecutionStockInOrderBaseDTO {
|
|||||||
private String businessPriceWay;
|
private String businessPriceWay;
|
||||||
@ApiModelProperty("通知单备注")
|
@ApiModelProperty("通知单备注")
|
||||||
private String noticeRemark;
|
private String noticeRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+18
-1
@@ -263,7 +263,16 @@ public class ExecutionStockInOrderApplicationService {
|
|||||||
*/
|
*/
|
||||||
public ExecutionStockInOrderPO getInfo(Long inOrderId)
|
public ExecutionStockInOrderPO getInfo(Long inOrderId)
|
||||||
{
|
{
|
||||||
ExecutionStockInOrderPO info = stockInOrderDomainService.getInfo(inOrderId);
|
return getInfo(inOrderId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库执行单详情(getReverseAuditInfo 归档详情复用)
|
||||||
|
* @param archive true-查询【已反审】tab 归档数据
|
||||||
|
*/
|
||||||
|
public ExecutionStockInOrderPO getInfo(Long inOrderId, boolean archive)
|
||||||
|
{
|
||||||
|
ExecutionStockInOrderPO info = stockInOrderDomainService.getInfo(inOrderId, archive);
|
||||||
String userNcCode = reservationStockInOrderMapper.getUserNcCode(info.getShipperId());
|
String userNcCode = reservationStockInOrderMapper.getUserNcCode(info.getShipperId());
|
||||||
info.setKhdm(userNcCode);
|
info.setKhdm(userNcCode);
|
||||||
List<ExecutionInMaterialDetailPO> materialDetailList = info.getMaterialDetailList();
|
List<ExecutionInMaterialDetailPO> materialDetailList = info.getMaterialDetailList();
|
||||||
@@ -276,6 +285,14 @@ public class ExecutionStockInOrderApplicationService {
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询入库执行单【已反审】tab 归档详情(已软删+已反审标记的数据,含软删明细)
|
||||||
|
*/
|
||||||
|
public ExecutionStockInOrderPO getReverseAuditInfo(Long inOrderId)
|
||||||
|
{
|
||||||
|
return getInfo(inOrderId, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+17
@@ -314,14 +314,31 @@ public class ExecutionStockInOrderDomainService {
|
|||||||
* 获取入库单详细信息
|
* 获取入库单详细信息
|
||||||
*/
|
*/
|
||||||
public ExecutionStockInOrderPO getInfo(Long inOrderId)
|
public ExecutionStockInOrderPO getInfo(Long inOrderId)
|
||||||
|
{
|
||||||
|
return getInfo(inOrderId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库执行单详情
|
||||||
|
* @param archive true-查询【已反审】tab 归档数据(主单须为已软删+已反审标记,明细放行软删行)
|
||||||
|
*/
|
||||||
|
public ExecutionStockInOrderPO getInfo(Long inOrderId, boolean archive)
|
||||||
{
|
{
|
||||||
ExecutionStockInOrderPO stockInOrderPO = stockInOrderService.getInfo(inOrderId);
|
ExecutionStockInOrderPO stockInOrderPO = stockInOrderService.getInfo(inOrderId);
|
||||||
|
if (archive && (stockInOrderPO.getDelFlag() == null || stockInOrderPO.getDelFlag() != 2
|
||||||
|
|| !Integer.valueOf(1).equals(stockInOrderPO.getReverseAuditStatus()))) {
|
||||||
|
throw new ServiceException("入库执行单非已反审归档数据,无法查看归档详情");
|
||||||
|
}
|
||||||
ExecutionInMaterialDetailDO inMaterialDetailDO = new ExecutionInMaterialDetailDO();
|
ExecutionInMaterialDetailDO inMaterialDetailDO = new ExecutionInMaterialDetailDO();
|
||||||
String inOrderNumber = stockInOrderPO.getInOrderNumber();
|
String inOrderNumber = stockInOrderPO.getInOrderNumber();
|
||||||
List<BusinessDocumentOrder> businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getInOrderNumber, inOrderNumber).notIn(BusinessDocumentOrder::getOrderStatus,4,5));
|
List<BusinessDocumentOrder> businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getInOrderNumber, inOrderNumber).notIn(BusinessDocumentOrder::getOrderStatus,4,5));
|
||||||
stockInOrderPO.setBusinessDocumentOrderDOList(businessDocumentOrders);
|
stockInOrderPO.setBusinessDocumentOrderDOList(businessDocumentOrders);
|
||||||
inMaterialDetailDO.setInOrderNumber(inOrderNumber);
|
inMaterialDetailDO.setInOrderNumber(inOrderNumber);
|
||||||
inMaterialDetailDO.setLevel(1);
|
inMaterialDetailDO.setLevel(1);
|
||||||
|
if (archive) {
|
||||||
|
//归档明细已随主单软删(del_flag=2),放行软删明细行
|
||||||
|
inMaterialDetailDO.setDelFlag(2);
|
||||||
|
}
|
||||||
List<ExecutionInMaterialDetailPO> inMaterialDetailPOList = materialDetailService.queryList(inMaterialDetailDO);
|
List<ExecutionInMaterialDetailPO> inMaterialDetailPOList = materialDetailService.queryList(inMaterialDetailDO);
|
||||||
|
|
||||||
// 先通过入库单号查询收货单列表
|
// 先通过入库单号查询收货单列表
|
||||||
|
|||||||
+4
-1
@@ -516,4 +516,7 @@ public class ExecutionStockOutOrder extends BaseVOEntity {
|
|||||||
@ApiModelProperty("折扣")
|
@ApiModelProperty("折扣")
|
||||||
private BigDecimal discount;
|
private BigDecimal discount;
|
||||||
|
|
||||||
}
|
|
||||||
|
@ApiModelProperty("反审标记: 0-无 1-已反审(业务单反审时软删del_flag=2并打标记)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
}
|
||||||
|
|||||||
+2
@@ -29,6 +29,8 @@ public class ExecutionStockOutOrderPO extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("出库单id")
|
@ApiModelProperty("出库单id")
|
||||||
private Long outOrderId;
|
private Long outOrderId;
|
||||||
|
@ApiModelProperty("反审标记: 1-已反审(反审软删归档, 【已反审】tab按 delFlag=2+reverseFlag=1 查询)")
|
||||||
|
private Integer reverseFlag;
|
||||||
@ApiModelProperty("总价")
|
@ApiModelProperty("总价")
|
||||||
@Excel(name = "总价")
|
@Excel(name = "总价")
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
|||||||
+3
@@ -29,6 +29,9 @@ public class ExecutionStockOutOrderDO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("出库单id")
|
@ApiModelProperty("出库单id")
|
||||||
private Long outOrderId;
|
private Long outOrderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审标记查询: 1-已反审(与delFlag=2成对传, 查【已反审】tab归档数据)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
|
||||||
@ApiModelProperty("组织表ID")
|
@ApiModelProperty("组织表ID")
|
||||||
@Excel(name = "组织表ID")
|
@Excel(name = "组织表ID")
|
||||||
private Long organizationId;
|
private Long organizationId;
|
||||||
|
|||||||
+3
@@ -27,6 +27,9 @@ public class ExecutionStockOutOrderDTO extends ExecutionStockOutOrderBaseDTO {
|
|||||||
@ApiModelProperty("出库单id")
|
@ApiModelProperty("出库单id")
|
||||||
private Long outOrderId;
|
private Long outOrderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审标记查询: 1-已反审(与delFlag=2成对传, 查【已反审】tab归档数据)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
|
||||||
@ApiModelProperty("组织表ID")
|
@ApiModelProperty("组织表ID")
|
||||||
@Excel(name = "组织表ID")
|
@Excel(name = "组织表ID")
|
||||||
private Long organizationId;
|
private Long organizationId;
|
||||||
|
|||||||
+4
-5
@@ -66,6 +66,8 @@ import java.util.stream.Collectors;
|
|||||||
public class ExecutionStockOutOrderApplicationService {
|
public class ExecutionStockOutOrderApplicationService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ExecutionStockOutOrderDomainService stockOutOrderDomainService;
|
private ExecutionStockOutOrderDomainService stockOutOrderDomainService;
|
||||||
|
@Autowired
|
||||||
|
private com.mhd.oms.application.service.WarehouseInfoApplicationService warehouseInfoApplicationService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private ExecutionOutMaterialDetailDomainService outMaterialDetailDomainService;
|
// private ExecutionOutMaterialDetailDomainService outMaterialDetailDomainService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
@@ -862,11 +864,8 @@ public class ExecutionStockOutOrderApplicationService {
|
|||||||
if (stockOutOrderDO.getWarehouseId() == null) {
|
if (stockOutOrderDO.getWarehouseId() == null) {
|
||||||
throw new ServiceException("仓库ID不能为空");
|
throw new ServiceException("仓库ID不能为空");
|
||||||
}
|
}
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(stockOutOrderDO.getWarehouseId());
|
// Feign失败走本地跨库兜底, 避免保存被"获取仓库信息失败"阻断
|
||||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
WarehouseFeignPO warehouseFeignPO = warehouseInfoApplicationService.getWarehouseInfo(stockOutOrderDO.getWarehouseId());
|
||||||
throw new ServiceException("获取仓库信息失败");
|
|
||||||
}
|
|
||||||
WarehouseFeignPO warehouseFeignPO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
stockOutOrderDO.setWarehouseCode(warehouseFeignPO.getWarehouseCode());
|
stockOutOrderDO.setWarehouseCode(warehouseFeignPO.getWarehouseCode());
|
||||||
stockOutOrderDO.setWarehouseName(warehouseFeignPO.getWarehouseName());
|
stockOutOrderDO.setWarehouseName(warehouseFeignPO.getWarehouseName());
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-17
@@ -71,6 +71,8 @@ public class ExecutionStockOutOrderDomainService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IExecutionStockOutOrderService stockOutOrderService;
|
private IExecutionStockOutOrderService stockOutOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private com.mhd.oms.application.service.WarehouseInfoApplicationService warehouseInfoApplicationService;
|
||||||
|
@Autowired
|
||||||
private IExecutionOutMaterialDetailService outMaterialDetailService;
|
private IExecutionOutMaterialDetailService outMaterialDetailService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IReservationDeliveryDetailsLinkService deliveryDetailsLinkService;
|
private IReservationDeliveryDetailsLinkService deliveryDetailsLinkService;
|
||||||
@@ -148,14 +150,9 @@ public class ExecutionStockOutOrderDomainService {
|
|||||||
public Boolean insert(ExecutionStockOutOrderDO stockOutOrderDO) {
|
public Boolean insert(ExecutionStockOutOrderDO stockOutOrderDO) {
|
||||||
//建单校验:明细数量必须大于0(0数量单下发WMS后自动分配必失败,出库单会卡死在已审核状态)
|
//建单校验:明细数量必须大于0(0数量单下发WMS后自动分配必失败,出库单会卡死在已审核状态)
|
||||||
validateMaterialDetailQuantity(stockOutOrderDO.getMaterialDetailList());
|
validateMaterialDetailQuantity(stockOutOrderDO.getMaterialDetailList());
|
||||||
//设置单号
|
//设置单号(仓库信息: Feign优先, system服务失败/降级时本地跨库兜底)
|
||||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
WarehouseFeignPO warehouseFeignPO = warehouseInfoApplicationService.getWarehouseInfo(warehouseId);
|
||||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
|
||||||
throw new ServiceException("获取仓库信息失败");
|
|
||||||
}
|
|
||||||
//仓库信息
|
|
||||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||||
@@ -218,14 +215,9 @@ public class ExecutionStockOutOrderDomainService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean batchInsert(List<ExecutionStockOutOrderDO> stockOutOrderDOList) {
|
public Boolean batchInsert(List<ExecutionStockOutOrderDO> stockOutOrderDOList) {
|
||||||
for (ExecutionStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
|
for (ExecutionStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
|
||||||
//设置单号
|
//设置单号(仓库信息: Feign优先, system服务失败/降级时本地跨库兜底)
|
||||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
WarehouseFeignPO warehouseFeignPO = warehouseInfoApplicationService.getWarehouseInfo(warehouseId);
|
||||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
|
||||||
throw new ServiceException("获取仓库信息失败");
|
|
||||||
}
|
|
||||||
//仓库信息
|
|
||||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||||
@@ -542,7 +534,12 @@ public class ExecutionStockOutOrderDomainService {
|
|||||||
stockOutOrder.setOrganizationId(orgId);
|
stockOutOrder.setOrganizationId(orgId);
|
||||||
stockOutOrder.setOrganizationName(orgName);
|
stockOutOrder.setOrganizationName(orgName);
|
||||||
stockOutOrder.setTopOrganizationId(topOrgId);
|
stockOutOrder.setTopOrganizationId(topOrgId);
|
||||||
wmsServiceFeign.omsOutOrderAdd(stockOutOrder);
|
//单头/配送明细推送同样校验返回值: 降级吞掉会残留"有单无明细"等半截单
|
||||||
|
AjaxResult orderAddResult = wmsServiceFeign.omsOutOrderAdd(stockOutOrder);
|
||||||
|
if (orderAddResult == null || !"200".equals(String.valueOf(orderAddResult.get("code")))) {
|
||||||
|
throw new ServiceException("出库单[" + currentOrderNumber + "]WMS出库单推送失败:"
|
||||||
|
+ (orderAddResult == null ? "WMS服务不可用或已降级" : orderAddResult.get("msg")));
|
||||||
|
}
|
||||||
|
|
||||||
List<ReservationDeliveryDetailsLink> list = deliveryDetailsLinkService.list(new QueryWrapper<ReservationDeliveryDetailsLink>().lambda().eq(ReservationDeliveryDetailsLink::getOrderNumber, byId.getOutOrderNumber()));
|
List<ReservationDeliveryDetailsLink> list = deliveryDetailsLinkService.list(new QueryWrapper<ReservationDeliveryDetailsLink>().lambda().eq(ReservationDeliveryDetailsLink::getOrderNumber, byId.getOutOrderNumber()));
|
||||||
List<DeliveryDetailsLink> deliveryDetailsLinkList = new ArrayList<>();
|
List<DeliveryDetailsLink> deliveryDetailsLinkList = new ArrayList<>();
|
||||||
@@ -552,7 +549,11 @@ public class ExecutionStockOutOrderDomainService {
|
|||||||
deliveryDetailsLink.setOmsId(reservationDeliveryDetailsLink.getId());
|
deliveryDetailsLink.setOmsId(reservationDeliveryDetailsLink.getId());
|
||||||
deliveryDetailsLinkList.add(deliveryDetailsLink);
|
deliveryDetailsLinkList.add(deliveryDetailsLink);
|
||||||
}
|
}
|
||||||
wmsServiceFeign.omsOutOrderAddDeliveryDetailsLink(deliveryDetailsLinkList);
|
AjaxResult linkAddResult = wmsServiceFeign.omsOutOrderAddDeliveryDetailsLink(deliveryDetailsLinkList);
|
||||||
|
if (linkAddResult == null || !"200".equals(String.valueOf(linkAddResult.get("code")))) {
|
||||||
|
throw new ServiceException("出库单[" + currentOrderNumber + "]WMS配送明细推送失败:"
|
||||||
|
+ (linkAddResult == null ? "WMS服务不可用或已降级" : linkAddResult.get("msg")));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
String inOrderNumber = stockOutOrder.getOutOrderNumber();
|
String inOrderNumber = stockOutOrder.getOutOrderNumber();
|
||||||
@@ -566,7 +567,12 @@ public class ExecutionStockOutOrderDomainService {
|
|||||||
outMaterialDetail.setTopOrganizationId(topOrgId);
|
outMaterialDetail.setTopOrganizationId(topOrgId);
|
||||||
outMaterialDetailList.add(outMaterialDetail);
|
outMaterialDetailList.add(outMaterialDetail);
|
||||||
}
|
}
|
||||||
wmsServiceFeign.omsOutOrderAddDetail(outMaterialDetailList);
|
//明细推送必须校验返回值: 失败被降级吞掉时WMS会残留"有单无明细"的出库单, 自动分配报"可用库存为0"难定位
|
||||||
|
AjaxResult detailAddResult = wmsServiceFeign.omsOutOrderAddDetail(outMaterialDetailList);
|
||||||
|
if (detailAddResult == null || !"200".equals(String.valueOf(detailAddResult.get("code")))) {
|
||||||
|
throw new ServiceException("出库单[" + currentOrderNumber + "]WMS出库明细推送失败:"
|
||||||
|
+ (detailAddResult == null ? "WMS服务不可用或已降级" : detailAddResult.get("msg")));
|
||||||
|
}
|
||||||
|
|
||||||
String outOrderNumber = byId.getOutOrderNumber();
|
String outOrderNumber = byId.getOutOrderNumber();
|
||||||
com.mhd.system.api.domain.StockOutOrderDTO stockOutOrderDTO = new com.mhd.system.api.domain.StockOutOrderDTO();
|
com.mhd.system.api.domain.StockOutOrderDTO stockOutOrderDTO = new com.mhd.system.api.domain.StockOutOrderDTO();
|
||||||
|
|||||||
+12
@@ -102,6 +102,12 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
|||||||
@Excel(name = "出库单类型编码")
|
@Excel(name = "出库单类型编码")
|
||||||
private String outOrderTypeCode;
|
private String outOrderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单类型编码(与outOrderTypeCode同义)")
|
||||||
|
private String orderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单类型名称")
|
||||||
|
private String orderTypeName;
|
||||||
|
|
||||||
@ApiModelProperty("出库单类型名称")
|
@ApiModelProperty("出库单类型名称")
|
||||||
@Excel(name = "出库单类型名称")
|
@Excel(name = "出库单类型名称")
|
||||||
private String outOrderTypeName;
|
private String outOrderTypeName;
|
||||||
@@ -137,4 +143,10 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||||
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||||
private Integer overStockStatus;
|
private Integer overStockStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际出仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String outboundDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际出仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String outboundDateEnd;
|
||||||
}
|
}
|
||||||
+17
@@ -456,4 +456,21 @@ public class ReservationStockInOrder extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("业务计价方式")
|
@ApiModelProperty("业务计价方式")
|
||||||
private String businessPriceWay;
|
private String businessPriceWay;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+7
@@ -54,6 +54,13 @@ public interface ReservationStockInOrderMapper extends BaseMapper<ReservationSto
|
|||||||
|
|
||||||
public String getWarehouseName(@Param("id") Long id);
|
public String getWarehouseName(@Param("id") Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本地跨库直查仓库信息(编码/名称/单号生成规则),
|
||||||
|
* 供下发等流程在 system 服务 Feign 失败/降级时兜底, 与 getWarehouseInfoByWarehouseId Feign 接口同数据源。
|
||||||
|
* 不含 STOCK_LOCK_MODE(冻结功能列, 各环境库结构不一致), 兜底时 stockLockMode 为 null 即默认分配库存冻结模式
|
||||||
|
*/
|
||||||
|
public com.mhd.system.api.domain.WarehouseFeignPO getWarehouseInfoFallback(@Param("id") Long id);
|
||||||
|
|
||||||
List<ReservationStockInOrderPO> queryNoticePrint(ReservationStockInOrderDO stockInOrderDO);
|
List<ReservationStockInOrderPO> queryNoticePrint(ReservationStockInOrderDO stockInOrderDO);
|
||||||
List<ReservationInMaterialDetailPO> queryNoticePrintDetail(ReservationStockInOrderDO stockInOrderDO);
|
List<ReservationInMaterialDetailPO> queryNoticePrintDetail(ReservationStockInOrderDO stockInOrderDO);
|
||||||
public void updateByTransportationNumber(@Param("transportationNumber") String transportationNumber);
|
public void updateByTransportationNumber(@Param("transportationNumber") String transportationNumber);
|
||||||
|
|||||||
+17
@@ -502,4 +502,21 @@ public class ReservationStockInOrderPO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("业务计价方式")
|
@ApiModelProperty("业务计价方式")
|
||||||
private String businessPriceWay;
|
private String businessPriceWay;
|
||||||
private String khdm;
|
private String khdm;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+17
@@ -513,4 +513,21 @@ public class ReservationStockInOrderDO extends BaseVOEntity {
|
|||||||
|
|
||||||
@ApiModelProperty("业务计价方式")
|
@ApiModelProperty("业务计价方式")
|
||||||
private String businessPriceWay;
|
private String businessPriceWay;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+17
@@ -507,4 +507,21 @@ public class ReservationStockInOrderDTO extends ReservationStockInOrderBaseDTO {
|
|||||||
|
|
||||||
@ApiModelProperty("业务计价方式")
|
@ApiModelProperty("业务计价方式")
|
||||||
private String businessPriceWay;
|
private String businessPriceWay;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审")
|
||||||
|
private Integer reverseAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseAuditRemark;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseAuditBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseAuditByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseAuditTime;
|
||||||
}
|
}
|
||||||
+10
-2
@@ -282,8 +282,7 @@ public class ReservationStockInOrderApplicationService {
|
|||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
public Boolean auditState(ReservationStockInOrderDO stockInOrderDO){
|
public Boolean auditState(ReservationStockInOrderDO stockInOrderDO){
|
||||||
Boolean b = stockInOrderDomainService.auditState(stockInOrderDO);
|
Boolean b = stockInOrderDomainService.auditState(stockInOrderDO);// List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||||
// List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
|
||||||
// if (inOrderIds != null && !inOrderIds.isEmpty()) {
|
// if (inOrderIds != null && !inOrderIds.isEmpty()) {
|
||||||
// ReservationStockInOrder stockInOrder = reservationStockInOrderMapper.selectById(inOrderIds.get(0));
|
// ReservationStockInOrder stockInOrder = reservationStockInOrderMapper.selectById(inOrderIds.get(0));
|
||||||
// Integer needCustomsDeclaration = stockInOrder.getNeedCustomsDeclaration();
|
// Integer needCustomsDeclaration = stockInOrder.getNeedCustomsDeclaration();
|
||||||
@@ -302,6 +301,15 @@ public class ReservationStockInOrderApplicationService {
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反审入库业务单:业务单状态改为已驳回(issueStatus=3)并打已反审标记落入【已反审】tab,
|
||||||
|
* 入库执行单+明细逻辑删除,WMS侧整链回退(库存扣减+单据清理+反审异常记录),
|
||||||
|
* W入库单有出库记录时WMS侧拦截,已推送关务直接拦截
|
||||||
|
*/
|
||||||
|
public Boolean reverseAudit(ReservationStockInOrderDO stockInOrderDO){
|
||||||
|
return stockInOrderDomainService.reverseAudit(stockInOrderDO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 下发入库单
|
* @description 下发入库单
|
||||||
* @author ZhouGY
|
* @author ZhouGY
|
||||||
|
|||||||
+176
-2
@@ -13,6 +13,9 @@ import com.mhd.common.core.web.domain.AjaxResult;
|
|||||||
import com.mhd.common.security.utils.SecurityUtils;
|
import com.mhd.common.security.utils.SecurityUtils;
|
||||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||||
|
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignature;
|
||||||
|
import com.mhd.oms.domain.electronicSignature.repository.facade.IElectronicSignatureMaterialDetailService;
|
||||||
|
import com.mhd.oms.domain.electronicSignature.repository.facade.IElectronicSignatureService;
|
||||||
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
||||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
|
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
|
||||||
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
|
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
|
||||||
@@ -91,6 +94,10 @@ public class ReservationStockInOrderDomainService {
|
|||||||
private ExecutionStockInOrderMapper executionStockInOrderMapper;
|
private ExecutionStockInOrderMapper executionStockInOrderMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReserveStockInOrderMapper reserveStockInOrderMapper;
|
private ReserveStockInOrderMapper reserveStockInOrderMapper;
|
||||||
|
@Autowired
|
||||||
|
private IElectronicSignatureService electronicSignatureService;
|
||||||
|
@Autowired
|
||||||
|
private IElectronicSignatureMaterialDetailService electronicSignatureMaterialDetailService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询入库单列表
|
* 分页查询入库单列表
|
||||||
@@ -169,6 +176,10 @@ public class ReservationStockInOrderDomainService {
|
|||||||
// //统计总体积
|
// //统计总体积
|
||||||
// BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReservationInMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
// BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReservationInMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
// stockInOrderDO.setVolumeLimit(volumeLimit);
|
// stockInOrderDO.setVolumeLimit(volumeLimit);
|
||||||
|
// 订单来源为空时兜底为手动创建(导入/预约下发等路径已显式设置,不受影响),下发执行单时随业务单继承
|
||||||
|
if (stockInOrderDO.getReservationOrderSource() == null || stockInOrderDO.getReservationOrderSource().isEmpty()) {
|
||||||
|
stockInOrderDO.setReservationOrderSource("手动创建");
|
||||||
|
}
|
||||||
stockInOrderService.insert(stockInOrderDO);
|
stockInOrderService.insert(stockInOrderDO);
|
||||||
return materialDetailService.batchInsert(stockInOrderDO.getInOrderNumber(), stockInOrderDO.getMaterialDetailList());
|
return materialDetailService.batchInsert(stockInOrderDO.getInOrderNumber(), stockInOrderDO.getMaterialDetailList());
|
||||||
}
|
}
|
||||||
@@ -607,7 +618,6 @@ public class ReservationStockInOrderDomainService {
|
|||||||
reservationStockInOrder.setOrderTypeName("普通入库");
|
reservationStockInOrder.setOrderTypeName("普通入库");
|
||||||
reservationStockInOrder.setBusinessType("pu_tong_ru_ku");
|
reservationStockInOrder.setBusinessType("pu_tong_ru_ku");
|
||||||
}
|
}
|
||||||
reservationStockInOrder.setReservationOrderSource("客户预约");
|
|
||||||
reservationStockInOrder.setWarehouseId(warehouseId);
|
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||||
if (warehouseId == null || warehouseId == 0L){
|
if (warehouseId == null || warehouseId == 0L){
|
||||||
reservationStockInOrder.setWarehouseId(byId.getWarehouseId());
|
reservationStockInOrder.setWarehouseId(byId.getWarehouseId());
|
||||||
@@ -767,6 +777,171 @@ public class ReservationStockInOrderDomainService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反审入库业务单(需求:已入库/已出库的单子客户通知需要回退的场景,单子回退到最原始状态):
|
||||||
|
* 页面状态列按 issueStatus(0-已创建 1-进行中 2-已审核 3-已驳回 4-已入库 5-部分完成)展示,
|
||||||
|
* 反审条件按 issueStatus 判断——进行中(1)/已审核(2)/已入库(4)/部分完成(5)可反审,
|
||||||
|
* 已创建(0)无需反审、已驳回(3)可直接编辑;已取消/已关闭(status 6/7)兜底拦截。
|
||||||
|
* 反审动作("审核不通过"同语义 + 全链路回退,补齐 auditState 审核不通过缺失的下游联动):
|
||||||
|
* <ul>
|
||||||
|
* <li>业务单状态改为"已驳回"(issueStatus=3),打已反审标记(REVERSE_AUDIT_STATUS=1)落入【已反审】tab,
|
||||||
|
* 之后可「编辑」→重新「审核」→重新「下发」生成全新执行单</li>
|
||||||
|
* <li>入库执行单+物料明细软删(del_flag=2)并打已反审标记——执行单【已反审】tab按
|
||||||
|
* "已软删+已反审"查询归档数据;软删后不出现在正常tab,避免归档单被误「审核/下发」</li>
|
||||||
|
* <li>清空WMS完成上架跨库回写的完成数据(业务单 IN_QUANTITY/STORAGE_TIME、明细 INBOUND_ITEMS/TOTAL_NET_WEIGHT)</li>
|
||||||
|
* <li>WMS侧逐执行单回退(omsReverseInOrder):W入库单有出库记录则拦截(按入库单号+动作"分配库存/出库"
|
||||||
|
* 查库存调整记录>0)→ 库存还原扣减 → W入库单/W收货单/W上架单整链软删并打已反审标记
|
||||||
|
* (数据划归W入库单/W收货单/W上架单【已反审】tab归档)→
|
||||||
|
* 写1条W入库异常【反审记录】用于记录跟踪</li>
|
||||||
|
* </ul>
|
||||||
|
* 已推送关务(pushStatus=3)直接拦截。WMS回退幂等,反审失败可安全重试。
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean reverseAudit(ReservationStockInOrderDO stockInOrderDO) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
|
||||||
|
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||||
|
? loginUser.getUserPo().getUserName()
|
||||||
|
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
||||||
|
|
||||||
|
List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
|
||||||
|
if (inOrderIds == null || inOrderIds.isEmpty()) {
|
||||||
|
throw new ServiceException("未选择反审的入库业务单");
|
||||||
|
}
|
||||||
|
Date now = new Date();
|
||||||
|
for (Long inOrderId : inOrderIds) {
|
||||||
|
ReservationStockInOrder businessOrder = stockInOrderService.getById(inOrderId);
|
||||||
|
if (businessOrder == null
|
||||||
|
|| (businessOrder.getDelFlag() != null && businessOrder.getDelFlag() != 1)) {
|
||||||
|
throw new ServiceException("入库业务单不存在或已被删除,无法反审");
|
||||||
|
}
|
||||||
|
String businessNumber = businessOrder.getInOrderNumber();
|
||||||
|
Integer issueStatus = businessOrder.getIssueStatus();
|
||||||
|
if (issueStatus == null || issueStatus == 0) {
|
||||||
|
throw new ServiceException("入库业务单[" + businessNumber + "]为已创建状态,无需反审");
|
||||||
|
}
|
||||||
|
if (issueStatus == 3) {
|
||||||
|
throw new ServiceException("入库业务单[" + businessNumber + "]已驳回,无需反审,可直接编辑后重新提交审核");
|
||||||
|
}
|
||||||
|
if (issueStatus != 1 && issueStatus != 2 && issueStatus != 4 && issueStatus != 5) {
|
||||||
|
throw new ServiceException("入库业务单[" + businessNumber + "]仅进行中/已审核/已入库状态可反审,当前状态值:" + issueStatus);
|
||||||
|
}
|
||||||
|
if (businessOrder.getStatus() != null && (businessOrder.getStatus() == 6 || businessOrder.getStatus() == 7)) {
|
||||||
|
throw new ServiceException("入库业务单[" + businessNumber + "]已取消/已关闭,无法反审");
|
||||||
|
}
|
||||||
|
if (businessOrder.getPushStatus() != null && businessOrder.getPushStatus() == 3) {
|
||||||
|
throw new ServiceException("入库业务单[" + businessNumber + "]已推送关务/NC,无法反审,请先在关务侧处理");
|
||||||
|
}
|
||||||
|
|
||||||
|
//该业务单下全部有效执行单:逐张调WMS回退后软删并打已反审标记
|
||||||
|
List<ExecutionStockInOrder> executionOrders = executionStockInOrderService.list(
|
||||||
|
new LambdaQueryWrapper<ExecutionStockInOrder>()
|
||||||
|
.eq(ExecutionStockInOrder::getBusinessInOrderNumber, businessNumber)
|
||||||
|
.eq(ExecutionStockInOrder::getDelFlag, 1));
|
||||||
|
for (ExecutionStockInOrder executionOrder : executionOrders) {
|
||||||
|
String executionNumber = executionOrder.getInOrderNumber();
|
||||||
|
if (executionOrder.getPushStatus() != null && executionOrder.getPushStatus() == 3) {
|
||||||
|
throw new ServiceException("执行入库单[" + executionNumber + "]已推送关务/NC,无法反审,请先在关务侧处理");
|
||||||
|
}
|
||||||
|
//WMS侧回退(对称收货/上架完成链路,见 WMS StockInOrderDomainService.reverseExecutionOrder):
|
||||||
|
//有出库/库存已被分配时WMS报错,此处抛错整体回滚;WMS无数据时幂等成功(未下发执行单反审)
|
||||||
|
StockInOrder reverseParam = new StockInOrder();
|
||||||
|
reverseParam.setInOrderNumber(executionNumber);
|
||||||
|
reverseParam.setRemark("业务单号:" + businessNumber
|
||||||
|
+ (StringUtils.isNotEmpty(stockInOrderDO.getReverseAuditRemark())
|
||||||
|
? ",反审原因:" + stockInOrderDO.getReverseAuditRemark() : ""));
|
||||||
|
//组织三字段:WMS幂等跳过分支(未下发单反审)写反审记录时取不到W入库单,需经Feign透传
|
||||||
|
reverseParam.setOrganizationId(executionOrder.getOrganizationId());
|
||||||
|
reverseParam.setOrganizationName(executionOrder.getOrganizationName());
|
||||||
|
reverseParam.setTopOrganizationId(executionOrder.getTopOrganizationId());
|
||||||
|
reverseParam.setUpdateBy(loginUser.getUserid());
|
||||||
|
reverseParam.setUpdateByName(userRealName);
|
||||||
|
AjaxResult reverseResult = wmsServiceFeign.omsReverseInOrder(reverseParam);
|
||||||
|
if (reverseResult == null || !"200".equals(String.valueOf(reverseResult.get("code")))) {
|
||||||
|
throw new ServiceException("反审失败:执行入库单[" + executionNumber + "]WMS回退失败:"
|
||||||
|
+ (reverseResult == null ? "WMS服务不可用或已降级" : reverseResult.get("msg")));
|
||||||
|
}
|
||||||
|
//清理下发自动审核生成的待签名电子签名记录(signatureStatus=1,已签名记录保留作凭证)
|
||||||
|
cancelPendingSignature(executionNumber);
|
||||||
|
//执行单+物料明细软删(del_flag=2)并打已反审标记:
|
||||||
|
//执行单【已反审】tab按"已软删+已反审"(del_flag=2 and REVERSE_AUDIT_STATUS=1)查询归档数据;
|
||||||
|
//软删后不出现在正常tab,避免归档单被误「审核/下发」;业务单重新下发时生成全新执行单
|
||||||
|
executionInMaterialDetailService.update(new UpdateWrapper<ExecutionInMaterialDetail>().lambda()
|
||||||
|
.set(ExecutionInMaterialDetail::getDelFlag, 2)
|
||||||
|
.set(ExecutionInMaterialDetail::getUpdateBy, loginUser.getUserid())
|
||||||
|
.set(ExecutionInMaterialDetail::getUpdateByName, userRealName)
|
||||||
|
.set(ExecutionInMaterialDetail::getUpdateTime, now)
|
||||||
|
.eq(ExecutionInMaterialDetail::getInOrderNumber, executionNumber)
|
||||||
|
.eq(ExecutionInMaterialDetail::getDelFlag, 1));
|
||||||
|
executionStockInOrderService.update(new UpdateWrapper<ExecutionStockInOrder>().lambda()
|
||||||
|
.set(ExecutionStockInOrder::getDelFlag, 2)
|
||||||
|
.set(ExecutionStockInOrder::getReverseAuditStatus, 1)
|
||||||
|
.set(ExecutionStockInOrder::getReverseAuditRemark, stockInOrderDO.getReverseAuditRemark())
|
||||||
|
.set(ExecutionStockInOrder::getReverseAuditBy, loginUser.getUserid())
|
||||||
|
.set(ExecutionStockInOrder::getReverseAuditByName, userRealName)
|
||||||
|
.set(ExecutionStockInOrder::getReverseAuditTime, now)
|
||||||
|
.set(ExecutionStockInOrder::getUpdateBy, loginUser.getUserid())
|
||||||
|
.set(ExecutionStockInOrder::getUpdateByName, userRealName)
|
||||||
|
.set(ExecutionStockInOrder::getUpdateTime, now)
|
||||||
|
.eq(ExecutionStockInOrder::getInOrderId, executionOrder.getInOrderId())
|
||||||
|
.eq(ExecutionStockInOrder::getDelFlag, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
//清空WMS完成上架跨库回写的业务单明细入库数量(INBOUND_ITEMS/TOTAL_NET_WEIGHT 上架时按上架量覆写过)
|
||||||
|
materialDetailService.update(new UpdateWrapper<ReservationInMaterialDetail>().lambda()
|
||||||
|
.set(ReservationInMaterialDetail::getInboundQuantity, BigDecimal.ZERO)
|
||||||
|
.set(ReservationInMaterialDetail::getTotalNetWeight, BigDecimal.ZERO)
|
||||||
|
.eq(ReservationInMaterialDetail::getInOrderNumber, businessNumber)
|
||||||
|
.eq(ReservationInMaterialDetail::getDelFlag, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务单状态改为"已驳回"(与审核不通过同语义)+ 已反审标记落入【已反审】tab + 清空完成回写数据
|
||||||
|
return stockInOrderService.update(null, new UpdateWrapper<ReservationStockInOrder>().lambda()
|
||||||
|
.set(ReservationStockInOrder::getIssueStatus, 3)
|
||||||
|
//清空下发/执行时间(前端"是否执行"列按执行时间判断,不清会仍显示已执行,与取消下发 cancelIssueOrder 同口径)
|
||||||
|
.set(ReservationStockInOrder::getIssueTime, null)
|
||||||
|
//入库进度状态(1-已创建 2-已审核 3-收货中 4-上架中 5-已入库):首轮"完成上架"会经WMS回传写成5,
|
||||||
|
//不重置的话重新下发时copy给执行单→W入库单→收货单,收货单带着"已完成"状态导致前端不给收货按钮;
|
||||||
|
//重置为1(已创建),与手工新单首次下发链路一致(W入库单/收货单起点=1-待收货)
|
||||||
|
.set(ReservationStockInOrder::getStatus, 1)
|
||||||
|
.set(ReservationStockInOrder::getInQuantity, BigDecimal.ZERO)
|
||||||
|
.set(ReservationStockInOrder::getStorageTime, null)
|
||||||
|
.set(ReservationStockInOrder::getExecutionInOrderNumber, null)
|
||||||
|
//反审标记与反审痕迹(【已反审】tab 按 reverseAuditStatus=1 过滤;业务单本身不软删,保持可编辑重新下发)
|
||||||
|
.set(ReservationStockInOrder::getReverseAuditStatus, 1)
|
||||||
|
.set(ReservationStockInOrder::getReverseAuditRemark, stockInOrderDO.getReverseAuditRemark())
|
||||||
|
.set(ReservationStockInOrder::getReverseAuditBy, loginUser.getUserid())
|
||||||
|
.set(ReservationStockInOrder::getReverseAuditByName, userRealName)
|
||||||
|
.set(ReservationStockInOrder::getReverseAuditTime, now)
|
||||||
|
.set(ReservationStockInOrder::getUpdateBy, loginUser.getUserid())
|
||||||
|
.set(ReservationStockInOrder::getUpdateByName, userRealName)
|
||||||
|
.set(ReservationStockInOrder::getUpdateTime, now)
|
||||||
|
.in(ReservationStockInOrder::getInOrderId, inOrderIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反审时清理下发自动审核生成的待签名电子签名记录(signatureStatus=1)及其明细,
|
||||||
|
* 已签名记录保留作凭证;清理失败仅记日志不阻断反审主流程(同取消下发)
|
||||||
|
*/
|
||||||
|
private void cancelPendingSignature(String inOrderNumber) {
|
||||||
|
try {
|
||||||
|
List<ElectronicSignature> signatures = electronicSignatureService.list(
|
||||||
|
new LambdaQueryWrapper<ElectronicSignature>()
|
||||||
|
.eq(ElectronicSignature::getOrderNumber, inOrderNumber)
|
||||||
|
.eq(ElectronicSignature::getOrderType, "IN")
|
||||||
|
.eq(ElectronicSignature::getSignatureStatus, 1)
|
||||||
|
.eq(ElectronicSignature::getDelFlag, 1));
|
||||||
|
for (ElectronicSignature signature : signatures) {
|
||||||
|
electronicSignatureMaterialDetailService.deleteBySignatureId(signature.getSignatureId());
|
||||||
|
electronicSignatureService.update(new UpdateWrapper<ElectronicSignature>().lambda()
|
||||||
|
.set(ElectronicSignature::getDelFlag, 2)
|
||||||
|
.eq(ElectronicSignature::getSignatureId, signature.getSignatureId()));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("反审清理电子签名记录失败,入库单号:{}", inOrderNumber, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean executeAndIssue(ReservationStockInOrderDO stockInOrderDO) {
|
public Boolean executeAndIssue(ReservationStockInOrderDO stockInOrderDO) {
|
||||||
// 防重复执行校验(与 issueOrder 的防重逻辑对齐):issueTime 有值表示已下发/执行过。
|
// 防重复执行校验(与 issueOrder 的防重逻辑对齐):issueTime 有值表示已下发/执行过。
|
||||||
@@ -870,7 +1045,6 @@ public class ReservationStockInOrderDomainService {
|
|||||||
reservationStockInOrder.setOrderTypeName("普通入库");
|
reservationStockInOrder.setOrderTypeName("普通入库");
|
||||||
reservationStockInOrder.setBusinessType("pu_tong_ru_ku");
|
reservationStockInOrder.setBusinessType("pu_tong_ru_ku");
|
||||||
}
|
}
|
||||||
reservationStockInOrder.setReservationOrderSource("客户预约");
|
|
||||||
reservationStockInOrder.setWarehouseId(warehouseId);
|
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||||
// reservationStockInOrder.setOrganizationId(orgId);
|
// reservationStockInOrder.setOrganizationId(orgId);
|
||||||
// reservationStockInOrder.setOrganizationName(orgName);
|
// reservationStockInOrder.setOrganizationName(orgName);
|
||||||
|
|||||||
+17
@@ -515,4 +515,21 @@ public class ReservationStockOutOrder extends BaseVOEntity {
|
|||||||
@ApiModelProperty("折扣")
|
@ApiModelProperty("折扣")
|
||||||
private BigDecimal discount;
|
private BigDecimal discount;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审(反审后status回退为1-已创建,重新审核通过自动复位0)")
|
||||||
|
private Integer reverseStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseRemark;
|
||||||
|
|
||||||
}
|
}
|
||||||
+17
@@ -538,4 +538,21 @@ public class ReservationStockOutOrderPO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("折扣")
|
@ApiModelProperty("折扣")
|
||||||
private BigDecimal discount;
|
private BigDecimal discount;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审(反审后status回退为1-已创建,重新审核通过自动复位0)")
|
||||||
|
private Integer reverseStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseRemark;
|
||||||
|
|
||||||
}
|
}
|
||||||
+15
@@ -591,4 +591,19 @@ public class ReservationStockOutOrderDO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("折扣")
|
@ApiModelProperty("折扣")
|
||||||
private BigDecimal discount;
|
private BigDecimal discount;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审(反审后status回退为1-已创建,重新审核通过自动复位0)")
|
||||||
|
private Integer reverseStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
private Date reverseTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseRemark;
|
||||||
|
|
||||||
}
|
}
|
||||||
+17
@@ -580,4 +580,21 @@ public class ReservationStockOutOrderDTO extends ReservationStockOutOrderBaseDTO
|
|||||||
@ApiModelProperty("折扣")
|
@ApiModelProperty("折扣")
|
||||||
private BigDecimal discount;
|
private BigDecimal discount;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审状态: 0-无 1-已反审(反审后status回退为1-已创建,重新审核通过自动复位0)")
|
||||||
|
private Integer reverseStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人id")
|
||||||
|
private Long reverseBy;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审人姓名")
|
||||||
|
private String reverseByName;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审时间")
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date reverseTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("反审原因")
|
||||||
|
private String reverseRemark;
|
||||||
|
|
||||||
}
|
}
|
||||||
+12
-5
@@ -85,6 +85,8 @@ import java.util.stream.Collectors;
|
|||||||
public class ReservationStockOutOrderApplicationService {
|
public class ReservationStockOutOrderApplicationService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReservationStockOutOrderDomainService stockOutOrderDomainService;
|
private ReservationStockOutOrderDomainService stockOutOrderDomainService;
|
||||||
|
@Autowired
|
||||||
|
private com.mhd.oms.application.service.WarehouseInfoApplicationService warehouseInfoApplicationService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private ReservationOutMaterialDetailDomainService outMaterialDetailDomainService;
|
// private ReservationOutMaterialDetailDomainService outMaterialDetailDomainService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
@@ -881,6 +883,14 @@ public class ReservationStockOutOrderApplicationService {
|
|||||||
return stockOutOrderDomainService.cancelIssueOrder(stockOutOrderDO);
|
return stockOutOrderDomainService.cancelIssueOrder(stockOutOrderDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 反审出库业务单(已出库/已复核单据回退到已创建, WMS库存还原并生成反审异常记录)
|
||||||
|
* @date 2026/9/8
|
||||||
|
*/
|
||||||
|
public Boolean reverseAudit(ReservationStockOutOrderDO stockOutOrderDO){
|
||||||
|
return stockOutOrderDomainService.reverseAudit(stockOutOrderDO);
|
||||||
|
}
|
||||||
|
|
||||||
public Boolean executeAndIssue(ReservationStockOutOrderDO stockOutOrderDO){
|
public Boolean executeAndIssue(ReservationStockOutOrderDO stockOutOrderDO){
|
||||||
return stockOutOrderDomainService.executeAndIssue(stockOutOrderDO);
|
return stockOutOrderDomainService.executeAndIssue(stockOutOrderDO);
|
||||||
}
|
}
|
||||||
@@ -905,11 +915,8 @@ public class ReservationStockOutOrderApplicationService {
|
|||||||
if (stockOutOrderDO.getWarehouseId() == null) {
|
if (stockOutOrderDO.getWarehouseId() == null) {
|
||||||
throw new ServiceException("仓库ID不能为空");
|
throw new ServiceException("仓库ID不能为空");
|
||||||
}
|
}
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(stockOutOrderDO.getWarehouseId());
|
// Feign失败走本地跨库兜底, 避免新增/编辑保存被"获取仓库信息失败"阻断
|
||||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
WarehouseFeignPO warehouseFeignPO = warehouseInfoApplicationService.getWarehouseInfo(stockOutOrderDO.getWarehouseId());
|
||||||
throw new ServiceException("获取仓库信息失败");
|
|
||||||
}
|
|
||||||
WarehouseFeignPO warehouseFeignPO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
stockOutOrderDO.setWarehouseCode(warehouseFeignPO.getWarehouseCode());
|
stockOutOrderDO.setWarehouseCode(warehouseFeignPO.getWarehouseCode());
|
||||||
stockOutOrderDO.setWarehouseName(warehouseFeignPO.getWarehouseName());
|
stockOutOrderDO.setWarehouseName(warehouseFeignPO.getWarehouseName());
|
||||||
}
|
}
|
||||||
|
|||||||
+291
-22
@@ -18,6 +18,10 @@ import com.mhd.oms.domain.businessDeliveryDetailsLink.repository.facade.IBusines
|
|||||||
import com.mhd.oms.domain.businessDeliveryDetailsLink.repository.mapper.BusinessDeliveryDetailsLinkMapper;
|
import com.mhd.oms.domain.businessDeliveryDetailsLink.repository.mapper.BusinessDeliveryDetailsLinkMapper;
|
||||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||||
|
import com.mhd.oms.domain.businessDocumentCargoMulti.entity.BusinessDocumentCargoMulti;
|
||||||
|
import com.mhd.oms.domain.businessDocumentCargoMulti.repository.mapper.BusinessDocumentCargoMultiMapper;
|
||||||
|
import com.mhd.oms.domain.businessDocumentAddressMulti.entity.BusinessDocumentAddressMulti;
|
||||||
|
import com.mhd.oms.domain.businessDocumentAddressMulti.repository.mapper.BusinessDocumentAddressMultiMapper;
|
||||||
import com.mhd.oms.domain.executeOrder.entity.ExecuteOrder;
|
import com.mhd.oms.domain.executeOrder.entity.ExecuteOrder;
|
||||||
import com.mhd.oms.domain.executeOrder.repository.mapper.ExecuteOrderMapper;
|
import com.mhd.oms.domain.executeOrder.repository.mapper.ExecuteOrderMapper;
|
||||||
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
||||||
@@ -48,6 +52,8 @@ import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReservationS
|
|||||||
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
|
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
|
||||||
import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO;
|
import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO;
|
||||||
import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder;
|
import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder;
|
||||||
|
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord;
|
||||||
|
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper.ReservationInventoryAdjustmentRecordMapper;
|
||||||
import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService;
|
import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService;
|
||||||
import com.mhd.oms.domain.reservationStockOutOrder.repository.mapper.ReservationStockOutOrderMapper;
|
import com.mhd.oms.domain.reservationStockOutOrder.repository.mapper.ReservationStockOutOrderMapper;
|
||||||
import com.mhd.oms.domain.reservationStockOutOrder.repository.po.ReservationStockOutOrderPO;
|
import com.mhd.oms.domain.reservationStockOutOrder.repository.po.ReservationStockOutOrderPO;
|
||||||
@@ -55,6 +61,7 @@ import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ReservationSt
|
|||||||
import com.mhd.oms.domain.reserveStockOutOrder.repository.mapper.ReserveStockOutOrderMapper;
|
import com.mhd.oms.domain.reserveStockOutOrder.repository.mapper.ReserveStockOutOrderMapper;
|
||||||
import com.mhd.system.api.SystemServiceFeign;
|
import com.mhd.system.api.SystemServiceFeign;
|
||||||
import com.mhd.system.api.WmsServiceFeign;
|
import com.mhd.system.api.WmsServiceFeign;
|
||||||
|
import com.mhd.system.api.WlhyServiceFeign;
|
||||||
import com.mhd.system.api.domain.*;
|
import com.mhd.system.api.domain.*;
|
||||||
import com.mhd.system.api.model.LoginUser;
|
import com.mhd.system.api.model.LoginUser;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -118,6 +125,16 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
private ReserveStockOutOrderMapper reserveStockOutOrderMapper;
|
private ReserveStockOutOrderMapper reserveStockOutOrderMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MaterialBaseInfoResolveService materialBaseInfoResolveService;
|
private MaterialBaseInfoResolveService materialBaseInfoResolveService;
|
||||||
|
@Resource
|
||||||
|
private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper;
|
||||||
|
@Resource
|
||||||
|
private WlhyServiceFeign wlhyServiceFeign;
|
||||||
|
@Autowired
|
||||||
|
private BusinessDocumentCargoMultiMapper businessDocumentCargoMultiMapper;
|
||||||
|
@Autowired
|
||||||
|
private BusinessDocumentAddressMultiMapper businessDocumentAddressMultiMapper;
|
||||||
|
@Autowired
|
||||||
|
private com.mhd.oms.application.service.WarehouseInfoApplicationService warehouseInfoApplicationService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询出库单列表
|
* 分页查询出库单列表
|
||||||
@@ -215,6 +232,10 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
if (stockOutOrderDO.getCheckTaskDistribution() == null) {
|
if (stockOutOrderDO.getCheckTaskDistribution() == null) {
|
||||||
stockOutOrderDO.setCheckTaskDistribution(2);
|
stockOutOrderDO.setCheckTaskDistribution(2);
|
||||||
}
|
}
|
||||||
|
// 订单来源为空时兜底为手动创建(导入/预约下发等路径已显式设置,不受影响),下发执行单时随业务单继承
|
||||||
|
if (stockOutOrderDO.getReservationOrderSource() == null || stockOutOrderDO.getReservationOrderSource().isEmpty()) {
|
||||||
|
stockOutOrderDO.setReservationOrderSource("手动创建");
|
||||||
|
}
|
||||||
stockOutOrderService.insert(stockOutOrderDO);
|
stockOutOrderService.insert(stockOutOrderDO);
|
||||||
List<ReservationDeliveryDetailsLink> reservationDeliveryDetailsLinkList = stockOutOrderDO.getReservationDeliveryDetailsLinkList();
|
List<ReservationDeliveryDetailsLink> reservationDeliveryDetailsLinkList = stockOutOrderDO.getReservationDeliveryDetailsLinkList();
|
||||||
if (reservationDeliveryDetailsLinkList != null && !reservationDeliveryDetailsLinkList.isEmpty()){
|
if (reservationDeliveryDetailsLinkList != null && !reservationDeliveryDetailsLinkList.isEmpty()){
|
||||||
@@ -409,7 +430,8 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||||
? loginUser.getUserPo().getUserName()
|
? loginUser.getUserPo().getUserName()
|
||||||
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
||||||
boolean updateResult = stockOutOrderService.update(null, new UpdateWrapper<ReservationStockOutOrder>().lambda()
|
boolean updateResult;
|
||||||
|
LambdaUpdateWrapper<ReservationStockOutOrder> auditUpdateWrapper = new UpdateWrapper<ReservationStockOutOrder>().lambda()
|
||||||
.set(ReservationStockOutOrder::getReservationAuditId, loginUser.getUserid())
|
.set(ReservationStockOutOrder::getReservationAuditId, loginUser.getUserid())
|
||||||
.set(ReservationStockOutOrder::getReservationAuditName, userRealName)
|
.set(ReservationStockOutOrder::getReservationAuditName, userRealName)
|
||||||
.set(ReservationStockOutOrder::getReservationAuditTime, new Date())
|
.set(ReservationStockOutOrder::getReservationAuditTime, new Date())
|
||||||
@@ -417,7 +439,12 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
.set(ReservationStockOutOrder::getUpdateByName, userRealName)
|
.set(ReservationStockOutOrder::getUpdateByName, userRealName)
|
||||||
.set(ReservationStockOutOrder::getUpdateTime, new Date())
|
.set(ReservationStockOutOrder::getUpdateTime, new Date())
|
||||||
.set(ReservationStockOutOrder::getIssueStatus, issueStatus)
|
.set(ReservationStockOutOrder::getIssueStatus, issueStatus)
|
||||||
.in(ReservationStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
|
.in(ReservationStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds());
|
||||||
|
// 重新审核通过时复位反审标记: 单据离开【已反审】页签回到正常流转
|
||||||
|
if (issueStatus == 2) {
|
||||||
|
auditUpdateWrapper.set(ReservationStockOutOrder::getReverseStatus, 0);
|
||||||
|
}
|
||||||
|
updateResult = stockOutOrderService.update(null, auditUpdateWrapper);
|
||||||
|
|
||||||
//审核通过时同步线路/车次到关联的运输业务单
|
//审核通过时同步线路/车次到关联的运输业务单
|
||||||
if (issueStatus == 2) {
|
if (issueStatus == 2) {
|
||||||
@@ -481,6 +508,125 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新下发前自愈清理: 历史版本反审/取消下发软删的执行明细(del_flag=2)仍占用unique_id
|
||||||
|
* (EXECUTION_OUT_MATERIAL_DETAIL 唯一约束不含del_flag), 重新下发从预留明细复制同一unique_id会撞键;
|
||||||
|
* 归档行的unique_id无功能用途(仅活动明细展示反查批号用到), 统一置空释放键位, 幂等可重复执行
|
||||||
|
*/
|
||||||
|
private void releaseArchivedDetailUniqueId(String businessOutOrderNumber) {
|
||||||
|
List<String> executionOrderNumbers = executionStockOutOrderService.list(new QueryWrapper<ExecutionStockOutOrder>().lambda()
|
||||||
|
.eq(ExecutionStockOutOrder::getBusinessOutOrderNumber, businessOutOrderNumber))
|
||||||
|
.stream()
|
||||||
|
.map(ExecutionStockOutOrder::getOutOrderNumber)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (executionOrderNumbers.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
executionOutMaterialDetailService.update(null, new UpdateWrapper<ExecutionOutMaterialDetail>().lambda()
|
||||||
|
.set(ExecutionOutMaterialDetail::getUniqueId, null)
|
||||||
|
.eq(ExecutionOutMaterialDetail::getDelFlag, 2)
|
||||||
|
.in(ExecutionOutMaterialDetail::getOutOrderNumber, executionOrderNumbers));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反审联动软删运输链路(编辑"是否运输"=是 且审核通过后生成的链), 真实层级:
|
||||||
|
* 运输业务单-主单(splicingOrderType=4, business_document_order)
|
||||||
|
* -> 审核运输业务单按配送明细生成子单(splicingOrderType=3, mainOrderId=主单id, 每明细一单)
|
||||||
|
* -> 下发每个子单各生成一个运输执行单(execute_order.businessDocumentId=【子单id】, goodsNumber=子单货源号, 主单下无直接执行单)
|
||||||
|
* -> 每个执行单各推一单TMS(tms_order.execute_order_number=执行单货源号) -> TMS运单/运输作业单(wlhy外部服务)。
|
||||||
|
* 定位运输业务单: ①出库单.businessNumber(创建运输业务单时回填的货源单号) ②inOrderNumber=出库单号兜底
|
||||||
|
* (businessNumber缺失/已清空场景); 均不滤del_flag——此前被旧版反审漏删或手工删过的主单,
|
||||||
|
* 其子单/执行单/TMS链可能仍存活, 同样要清理(幂等)。配送明细链的invoiceNumber存的是送货单号而非出库单号, 不能作为定位条件。
|
||||||
|
* 执行单逐个调 TMS deleteChainByExecuteOrderNumber 软删TMS侧整链(未下发过则TMS无数据, 幂等空操作), 失败抛异常整批回滚;
|
||||||
|
* 本地软删执行单/主单及子单及其货品/地址明细/配送明细链; 无关联运输单时直接跳过。
|
||||||
|
*/
|
||||||
|
private void reverseTransportChain(ReservationStockOutOrder byId) {
|
||||||
|
String outOrderNumber = byId.getOutOrderNumber();
|
||||||
|
Set<Long> transportOrderIds = new HashSet<>();
|
||||||
|
if (StringUtils.isNotBlank(byId.getBusinessNumber())) {
|
||||||
|
businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>()
|
||||||
|
.eq(BusinessDocumentOrder::getGoodsNumber, byId.getBusinessNumber()))
|
||||||
|
.forEach(order -> transportOrderIds.add(order.getId()));
|
||||||
|
}
|
||||||
|
businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>()
|
||||||
|
.eq(BusinessDocumentOrder::getInOrderNumber, outOrderNumber))
|
||||||
|
.forEach(order -> transportOrderIds.add(order.getId()));
|
||||||
|
if (transportOrderIds.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (Long transportOrderId : transportOrderIds) {
|
||||||
|
BusinessDocumentOrder transportOrder = businessDocumentOrderMapper.selectById(transportOrderId);
|
||||||
|
if (transportOrder == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// 0. 拆单主单自身无执行单: 收集主单+全部子单id, 执行单/货品/地址明细按全量id清理
|
||||||
|
List<BusinessDocumentOrder> subOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>()
|
||||||
|
.eq(BusinessDocumentOrder::getMainOrderId, String.valueOf(transportOrderId))
|
||||||
|
.eq(BusinessDocumentOrder::getDelFlag, 1));
|
||||||
|
Set<Long> chainDocIds = new HashSet<>();
|
||||||
|
chainDocIds.add(transportOrderId);
|
||||||
|
subOrders.forEach(subOrder -> chainDocIds.add(subOrder.getId()));
|
||||||
|
// 1. 执行单: 不滤del_flag——历史周期已归档执行单的TMS链也幂等补清(防"执行单已删TMS残留"),
|
||||||
|
// 先逐个软删TMS侧整链(货源单->运单->作业单), 再软删本地执行单(已归档的跳过更新)
|
||||||
|
List<ExecuteOrder> executeOrders = executeOrderMapper.selectList(new LambdaQueryWrapper<ExecuteOrder>()
|
||||||
|
.in(ExecuteOrder::getBusinessDocumentId, chainDocIds));
|
||||||
|
for (ExecuteOrder executeOrder : executeOrders) {
|
||||||
|
if (StringUtils.isNotBlank(executeOrder.getGoodsNumber())) {
|
||||||
|
AjaxResult tmsResult = wlhyServiceFeign.deleteChainByExecuteOrderNumber(executeOrder.getGoodsNumber());
|
||||||
|
if (tmsResult == null || !"200".equals(String.valueOf(tmsResult.get("code")))) {
|
||||||
|
throw new ServiceException("出库单[" + outOrderNumber + "]反审失败: 运输执行单货源单号["
|
||||||
|
+ executeOrder.getGoodsNumber() + "]TMS链路软删失败: "
|
||||||
|
+ (tmsResult == null ? "TMS服务不可用" : tmsResult.get("msg")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!Integer.valueOf(2).equals(executeOrder.getDelFlag())) {
|
||||||
|
executeOrder.setDelFlag(2);
|
||||||
|
executeOrderMapper.updateById(executeOrder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 2. 软删运输业务单(主单+子单)及其货品/地址明细(主单已软删的只补清理子单/明细, 不重复更新主单)
|
||||||
|
if (!Integer.valueOf(2).equals(transportOrder.getDelFlag())) {
|
||||||
|
transportOrder.setDelFlag(2);
|
||||||
|
businessDocumentOrderMapper.updateById(transportOrder);
|
||||||
|
}
|
||||||
|
for (BusinessDocumentOrder subOrder : subOrders) {
|
||||||
|
subOrder.setDelFlag(2);
|
||||||
|
businessDocumentOrderMapper.updateById(subOrder);
|
||||||
|
}
|
||||||
|
List<String> chainDocIdStrings = chainDocIds.stream().map(String::valueOf).collect(Collectors.toList());
|
||||||
|
businessDocumentCargoMultiMapper.update(null, new LambdaUpdateWrapper<BusinessDocumentCargoMulti>()
|
||||||
|
.set(BusinessDocumentCargoMulti::getDelFlag, 2)
|
||||||
|
.in(BusinessDocumentCargoMulti::getOrderId, chainDocIdStrings)
|
||||||
|
.eq(BusinessDocumentCargoMulti::getDelFlag, 1));
|
||||||
|
businessDocumentAddressMultiMapper.update(null, new LambdaUpdateWrapper<BusinessDocumentAddressMulti>()
|
||||||
|
.set(BusinessDocumentAddressMulti::getDelFlag, 2)
|
||||||
|
.in(BusinessDocumentAddressMulti::getOrderId, chainDocIdStrings)
|
||||||
|
.eq(BusinessDocumentAddressMulti::getDelFlag, 1));
|
||||||
|
}
|
||||||
|
// 3. 配送明细链软删: 链的orderId固定指向运输业务单-主单, 按本次命中的主单id清理(含历史周期残留链)
|
||||||
|
businessDeliveryDetailsLinkService.update(null, new LambdaUpdateWrapper<BusinessDeliveryDetailsLink>()
|
||||||
|
.set(BusinessDeliveryDetailsLink::getDelFlag, 2)
|
||||||
|
.in(BusinessDeliveryDetailsLink::getOrderId, transportOrderIds)
|
||||||
|
.eq(BusinessDeliveryDetailsLink::getDelFlag, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取仓库信息(Feign优先, system服务失败/降级时本地跨库兜底), 统一委托共享组件
|
||||||
|
*/
|
||||||
|
private WarehouseFeignPO getWarehouseInfoWithFallback(Long warehouseId) {
|
||||||
|
return warehouseInfoApplicationService.getWarehouseInfo(warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取仓库单号生成规则(下发生成执行单号用): 优先 Feign 调 system 服务;
|
||||||
|
* Feign 异常/降级/返回非200时回退本地跨库直查 NGWL_TEST_SYSTEM.WAREHOUSE(同库同表, 与 getWarehouseCode 等查询同数据源),
|
||||||
|
* 避免 system 服务抖动阻断下发; 两侧都取不到才报错并带出 Feign 真实返回原因。
|
||||||
|
*/
|
||||||
|
private WarehouseFeignPO getWarehouseOrderNoRule(Long warehouseId) {
|
||||||
|
return getWarehouseInfoWithFallback(warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 审核出库单
|
* @description 审核出库单
|
||||||
* @author ZhouGY
|
* @author ZhouGY
|
||||||
@@ -521,8 +667,14 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
if (activeExecutionCount > 0) {
|
if (activeExecutionCount > 0) {
|
||||||
throw new ServiceException("出库单[" + inOrderNumber + "]已下发,请勿重复下发;如需重新下发请先取消下发");
|
throw new ServiceException("出库单[" + inOrderNumber + "]已下发,请勿重复下发;如需重新下发请先取消下发");
|
||||||
}
|
}
|
||||||
|
// 自愈: 历史版本反审/取消下发的归档明细可能仍占用unique_id, 先置空释放键位再重新下发
|
||||||
|
releaseArchivedDetailUniqueId(inOrderNumber);
|
||||||
List<String> executionInOrderNumbers = new ArrayList<>();
|
List<String> executionInOrderNumbers = new ArrayList<>();
|
||||||
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda().eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber));
|
// 下发明细必须过滤软删行(del_flag=1):编辑对账软删的旧行仍留表内,
|
||||||
|
// 不滤会参与按仓库分组/数量汇总,多生成执行单且数量叠加(入库侧同查询已过滤)
|
||||||
|
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda()
|
||||||
|
.eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber)
|
||||||
|
.eq(ReservationOutMaterialDetail::getDelFlag, 1));
|
||||||
|
|
||||||
// 按照 warehouseId 分组
|
// 按照 warehouseId 分组
|
||||||
Map<Long, List<ReservationOutMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
Map<Long, List<ReservationOutMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||||
@@ -540,7 +692,6 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
reservationStockInOrder.setOrderTypeCode("pu_tong_chu_ku");
|
reservationStockInOrder.setOrderTypeCode("pu_tong_chu_ku");
|
||||||
reservationStockInOrder.setOrderTypeName("普通出库");
|
reservationStockInOrder.setOrderTypeName("普通出库");
|
||||||
reservationStockInOrder.setBusinessType("pu_tong_chu_ku");
|
reservationStockInOrder.setBusinessType("pu_tong_chu_ku");
|
||||||
reservationStockInOrder.setReservationOrderSource("客户预约");
|
|
||||||
reservationStockInOrder.setWarehouseId(warehouseId);
|
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||||
@@ -556,14 +707,8 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||||
// reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
// reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||||
|
|
||||||
//设置单号
|
//设置单号(仓库单号规则: Feign优先, system服务失败/降级时本地跨库兜底)
|
||||||
Long warehouseId1 = reservationStockInOrder.getWarehouseId();
|
WarehouseFeignPO warehouseFeignPO = getWarehouseOrderNoRule(reservationStockInOrder.getWarehouseId());
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId1);
|
|
||||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
|
||||||
throw new ServiceException("获取仓库信息失败");
|
|
||||||
}
|
|
||||||
//仓库信息
|
|
||||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||||
@@ -652,6 +797,8 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
materialDetails.forEach(executionOutMaterialDetail -> {
|
materialDetails.forEach(executionOutMaterialDetail -> {
|
||||||
executionOutMaterialDetailService.update(null, new UpdateWrapper<ExecutionOutMaterialDetail>().lambda()
|
executionOutMaterialDetailService.update(null, new UpdateWrapper<ExecutionOutMaterialDetail>().lambda()
|
||||||
.set(ExecutionOutMaterialDetail::getDelFlag, 2)
|
.set(ExecutionOutMaterialDetail::getDelFlag, 2)
|
||||||
|
// 归档行置空uniqueId: 明细表唯一约束不含del_flag, 保留原值会与重新下发时从预留明细复制的同一uniqueId撞键
|
||||||
|
.set(ExecutionOutMaterialDetail::getUniqueId, null)
|
||||||
.eq(ExecutionOutMaterialDetail::getMaterialDetailId, executionOutMaterialDetail.getMaterialDetailId()));
|
.eq(ExecutionOutMaterialDetail::getMaterialDetailId, executionOutMaterialDetail.getMaterialDetailId()));
|
||||||
});
|
});
|
||||||
executionStockOutOrderService.update(null, new UpdateWrapper<ExecutionStockOutOrder>().lambda()
|
executionStockOutOrderService.update(null, new UpdateWrapper<ExecutionStockOutOrder>().lambda()
|
||||||
@@ -662,6 +809,129 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 反审出库业务单(按前端展示字段 issueStatus 判断可反审范围: 2-已审核(未出库) / 4-已出库 均可反审;
|
||||||
|
* 0-已创建无需反审、3-已驳回可直接编辑; status 字段在出库完成后不一定同步为9, 故不作为判断依据,
|
||||||
|
* 仅兜底排除 10-已取消/11-已关闭)。
|
||||||
|
* 反审将单据回退到已创建(status=1)且审核状态置为已驳回(issueStatus=3, 与入库侧反审同口径, 可编辑→重新审核→重新下发)
|
||||||
|
* 并打上反审标记:
|
||||||
|
* WMS 侧按出库单实际状态分支还原库存(已出库: 实物库存还原+推OMS; 未出库: 仅还原分配/冻结占用)、
|
||||||
|
* 清理执行单据(出库单/明细/拣货/复核/交接/配送, 软删+reverseFlag=1 划归【已反审】tab)、
|
||||||
|
* 每个执行出库单生成1条出库异常记录【反审记录】(out_order_abnormal, abnormalType=3);
|
||||||
|
* OMS 侧软删执行出库单及明细、软删预约库存调整记录。
|
||||||
|
* 反审后单据进入【已反审】页签(status=1 且 reverse_status=1), 可继续编辑/审核/撤销;
|
||||||
|
* 重新审核通过时 reverse_status 自动复位 0(见 auditState)。
|
||||||
|
* @date 2026/9/8
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean reverseAudit(ReservationStockOutOrderDO stockOutOrderDO) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
|
||||||
|
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
|
||||||
|
? loginUser.getUserPo().getUserName()
|
||||||
|
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
|
||||||
|
List<Long> outOrderIds = stockOutOrderDO.getOutOrderIds();
|
||||||
|
if (outOrderIds == null || outOrderIds.isEmpty()) {
|
||||||
|
throw new ServiceException("请选择需要反审的出库单");
|
||||||
|
}
|
||||||
|
String reverseRemark = stockOutOrderDO.getReverseRemark();
|
||||||
|
|
||||||
|
for (Long outOrderId : outOrderIds) {
|
||||||
|
ReservationStockOutOrder byId = stockOutOrderService.getById(outOrderId);
|
||||||
|
if (byId == null) {
|
||||||
|
throw new ServiceException("出库单不存在, outOrderId=" + outOrderId);
|
||||||
|
}
|
||||||
|
Integer status = byId.getStatus();
|
||||||
|
if (status != null && (status == 10 || status == 11)) {
|
||||||
|
throw new ServiceException("出库单[" + byId.getOutOrderNumber() + "]已取消/已关闭, 不能反审");
|
||||||
|
}
|
||||||
|
// 反审条件按前端展示字段 issueStatus 判断: 2-已审核(未出库) / 4-已出库 均可反审
|
||||||
|
Integer issueStatus = byId.getIssueStatus();
|
||||||
|
if (!Integer.valueOf(2).equals(issueStatus) && !Integer.valueOf(4).equals(issueStatus)) {
|
||||||
|
throw new ServiceException("出库单[" + byId.getOutOrderNumber() + "]当前状态(issueStatus=" + issueStatus
|
||||||
|
+ ")不支持反审, 仅已审核/已出库状态可反审");
|
||||||
|
}
|
||||||
|
// 逐个执行出库单调 WMS 反审: 还原实物库存+推送OMS库存、清理WMS单据、生成反审异常记录;
|
||||||
|
// 任一失败抛异常整体回滚, 避免单边反审
|
||||||
|
List<ExecutionStockOutOrder> executionOrders = executionStockOutOrderService.list(new QueryWrapper<ExecutionStockOutOrder>().lambda()
|
||||||
|
.eq(ExecutionStockOutOrder::getBusinessOutOrderNumber, byId.getOutOrderNumber())
|
||||||
|
.eq(ExecutionStockOutOrder::getDelFlag, 1));
|
||||||
|
for (ExecutionStockOutOrder executionStockOutOrder : executionOrders) {
|
||||||
|
String executionOutOrderNumber = executionStockOutOrder.getOutOrderNumber();
|
||||||
|
StockOutOrder wmsOutOrder = new StockOutOrder();
|
||||||
|
wmsOutOrder.setOutOrderNumber(executionOutOrderNumber);
|
||||||
|
// 反审原因经 remark 透传 WMS, 记入反审异常记录备注
|
||||||
|
wmsOutOrder.setRemark("业务单号:" + byId.getOutOrderNumber()
|
||||||
|
+ (reverseRemark != null && !reverseRemark.isEmpty() ? ",反审原因:" + reverseRemark : ""));
|
||||||
|
AjaxResult wmsResult = wmsServiceFeign.omsReverseExecutionOrder(wmsOutOrder);
|
||||||
|
if (wmsResult == null || !"200".equals(String.valueOf(wmsResult.get("code")))) {
|
||||||
|
throw new ServiceException("执行出库单[" + executionOutOrderNumber + "]WMS反审失败:"
|
||||||
|
+ (wmsResult == null ? "WMS服务不可用" : wmsResult.get("msg")));
|
||||||
|
}
|
||||||
|
// 软删执行出库单明细 + 执行出库单(与取消下发 cancelIssueOrder 一致)
|
||||||
|
List<ExecutionOutMaterialDetail> materialDetails = executionOutMaterialDetailService.list(new QueryWrapper<ExecutionOutMaterialDetail>().lambda()
|
||||||
|
.eq(ExecutionOutMaterialDetail::getOutOrderNumber, executionOutOrderNumber)
|
||||||
|
.eq(ExecutionOutMaterialDetail::getDelFlag, 1));
|
||||||
|
materialDetails.forEach(executionOutMaterialDetail -> {
|
||||||
|
executionOutMaterialDetailService.update(null, new UpdateWrapper<ExecutionOutMaterialDetail>().lambda()
|
||||||
|
.set(ExecutionOutMaterialDetail::getDelFlag, 2)
|
||||||
|
.set(ExecutionOutMaterialDetail::getReverseFlag, 1)
|
||||||
|
// 归档行置空uniqueId: 明细表唯一约束不含del_flag, 保留原值会与重新下发时从预留明细复制的同一uniqueId撞键
|
||||||
|
.set(ExecutionOutMaterialDetail::getUniqueId, null)
|
||||||
|
.eq(ExecutionOutMaterialDetail::getMaterialDetailId, executionOutMaterialDetail.getMaterialDetailId()));
|
||||||
|
});
|
||||||
|
executionStockOutOrderService.update(null, new UpdateWrapper<ExecutionStockOutOrder>().lambda()
|
||||||
|
.set(ExecutionStockOutOrder::getDelFlag, 2)
|
||||||
|
.set(ExecutionStockOutOrder::getReverseFlag, 1)
|
||||||
|
.eq(ExecutionStockOutOrder::getOutOrderNumber, executionOutOrderNumber));
|
||||||
|
// 软删预约库存调整记录(下发分配时生成): 仅软删留痕, 库存数量由 WMS omsEdit 推送还原
|
||||||
|
inventoryAdjustmentRecordMapper.update(null, new UpdateWrapper<ReservationInventoryAdjustmentRecord>().lambda()
|
||||||
|
.set(ReservationInventoryAdjustmentRecord::getDelFlag, 2)
|
||||||
|
.eq(ReservationInventoryAdjustmentRecord::getExecutionOrderNumber, executionOutOrderNumber)
|
||||||
|
.eq(ReservationInventoryAdjustmentRecord::getDelFlag, 1));
|
||||||
|
}
|
||||||
|
// 反审联动: 软删关联运输链路(运输业务单/运输执行单/TMS货源单-运单-作业单), 无关联运输单时跳过
|
||||||
|
reverseTransportChain(byId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主单回退到已创建并打反审标记; 更新条件带 issueStatus in (2,4) + 排除已取消/已关闭 兜底防并发重复反审
|
||||||
|
// issueStatus 回退到 3-已驳回(前端展示映射: 0-已创建 2-已审核 3-已驳回 4-已出库; 与入库侧反审同口径,
|
||||||
|
// 已驳回态可编辑→重新审核→重新下发, 重新审核通过时 reverse_status 自动复位 0 离开已反审tab);
|
||||||
|
// 清空执行出库单号——执行单已随反审软删, 前端"是否执行"列由该字段有无值推导, 不清空会仍显示已执行
|
||||||
|
return stockOutOrderService.update(null, new UpdateWrapper<ReservationStockOutOrder>().lambda()
|
||||||
|
.set(ReservationStockOutOrder::getStatus, 1)
|
||||||
|
.set(ReservationStockOutOrder::getIssueStatus, 3)
|
||||||
|
.set(ReservationStockOutOrder::getExecutionOutOrderNumber, null)
|
||||||
|
// 运输业务单已随反审软删, 货源单号一并清空, 重新审核后重建运输链路时自动回填
|
||||||
|
.set(ReservationStockOutOrder::getBusinessNumber, null)
|
||||||
|
.set(ReservationStockOutOrder::getIssueId, null)
|
||||||
|
.set(ReservationStockOutOrder::getIssueName, null)
|
||||||
|
.set(ReservationStockOutOrder::getIssueTime, null)
|
||||||
|
.set(ReservationStockOutOrder::getReservationAuditId, null)
|
||||||
|
.set(ReservationStockOutOrder::getReservationAuditName, null)
|
||||||
|
.set(ReservationStockOutOrder::getReservationAuditTime, null)
|
||||||
|
.set(ReservationStockOutOrder::getAllocationQuantity, BigDecimal.ZERO)
|
||||||
|
.set(ReservationStockOutOrder::getAlreadyAllocationQuantity, BigDecimal.ZERO)
|
||||||
|
.set(ReservationStockOutOrder::getPickingQuantity, BigDecimal.ZERO)
|
||||||
|
.set(ReservationStockOutOrder::getCheckQuantity, BigDecimal.ZERO)
|
||||||
|
.set(ReservationStockOutOrder::getCheckStatus, 1)
|
||||||
|
.set(ReservationStockOutOrder::getCheckTaskDistribution, 2)
|
||||||
|
.set(ReservationStockOutOrder::getCheckTaskDistributionTime, null)
|
||||||
|
.set(ReservationStockOutOrder::getCompleteTime, null)
|
||||||
|
.set(ReservationStockOutOrder::getOutboundTime, null)
|
||||||
|
.set(ReservationStockOutOrder::getReverseStatus, 1)
|
||||||
|
.set(ReservationStockOutOrder::getReverseBy, loginUser.getUserid())
|
||||||
|
.set(ReservationStockOutOrder::getReverseByName, userRealName)
|
||||||
|
.set(ReservationStockOutOrder::getReverseTime, new Date())
|
||||||
|
.set(ReservationStockOutOrder::getReverseRemark, reverseRemark)
|
||||||
|
.set(ReservationStockOutOrder::getUpdateBy, loginUser.getUserid())
|
||||||
|
.set(ReservationStockOutOrder::getUpdateByName, userRealName)
|
||||||
|
.set(ReservationStockOutOrder::getUpdateTime, new Date())
|
||||||
|
.in(ReservationStockOutOrder::getOutOrderId, outOrderIds)
|
||||||
|
.in(ReservationStockOutOrder::getIssueStatus, 2, 4)
|
||||||
|
.notIn(ReservationStockOutOrder::getStatus, 10, 11));
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean executeAndIssue(ReservationStockOutOrderDO stockOutOrderDO) {
|
public Boolean executeAndIssue(ReservationStockOutOrderDO stockOutOrderDO) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
@@ -691,7 +961,13 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
String warehouseCode1 = byId.getWarehouseCode();
|
String warehouseCode1 = byId.getWarehouseCode();
|
||||||
String warehouseName1 = byId.getWarehouseName();
|
String warehouseName1 = byId.getWarehouseName();
|
||||||
String inOrderNumber = byId.getOutOrderNumber();
|
String inOrderNumber = byId.getOutOrderNumber();
|
||||||
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda().eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber));
|
// 自愈: 历史版本反审/取消下发的归档明细可能仍占用unique_id, 先置空释放键位再重新下发
|
||||||
|
releaseArchivedDetailUniqueId(inOrderNumber);
|
||||||
|
// 下发明细必须过滤软删行(del_flag=1):编辑对账软删的旧行仍留表内,
|
||||||
|
// 不滤会参与按仓库分组/数量汇总,多生成执行单且数量叠加(入库侧同查询已过滤)
|
||||||
|
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda()
|
||||||
|
.eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber)
|
||||||
|
.eq(ReservationOutMaterialDetail::getDelFlag, 1));
|
||||||
|
|
||||||
// 按照 warehouseId 分组
|
// 按照 warehouseId 分组
|
||||||
Map<Long, List<ReservationOutMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
Map<Long, List<ReservationOutMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||||
@@ -755,7 +1031,6 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
reservationStockInOrder.setOrderTypeCode("pu_tong_chu_ku");
|
reservationStockInOrder.setOrderTypeCode("pu_tong_chu_ku");
|
||||||
reservationStockInOrder.setOrderTypeName("普通出库");
|
reservationStockInOrder.setOrderTypeName("普通出库");
|
||||||
reservationStockInOrder.setBusinessType("pu_tong_chu_ku");
|
reservationStockInOrder.setBusinessType("pu_tong_chu_ku");
|
||||||
reservationStockInOrder.setReservationOrderSource("客户预约");
|
|
||||||
reservationStockInOrder.setWarehouseId(warehouseId);
|
reservationStockInOrder.setWarehouseId(warehouseId);
|
||||||
reservationStockInOrder.setOrganizationId(orgId);
|
reservationStockInOrder.setOrganizationId(orgId);
|
||||||
reservationStockInOrder.setOrganizationName(orgName);
|
reservationStockInOrder.setOrganizationName(orgName);
|
||||||
@@ -765,14 +1040,8 @@ public class ReservationStockOutOrderDomainService {
|
|||||||
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||||
|
|
||||||
|
|
||||||
//设置单号
|
//设置单号(仓库单号规则: Feign优先, system服务失败/降级时本地跨库兜底)
|
||||||
// Long warehouseId1 = reservationStockInOrder.getWarehouseId();
|
WarehouseFeignPO warehouseFeignPO = getWarehouseOrderNoRule(warehouseId);
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
|
||||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
|
||||||
throw new ServiceException("获取仓库信息失败");
|
|
||||||
}
|
|
||||||
//仓库信息
|
|
||||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||||
|
|||||||
+4
-5
@@ -68,6 +68,8 @@ import java.util.concurrent.ThreadLocalRandom;
|
|||||||
public class ReserveStockOutOrderApplicationService {
|
public class ReserveStockOutOrderApplicationService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReserveStockOutOrderDomainService stockOutOrderDomainService;
|
private ReserveStockOutOrderDomainService stockOutOrderDomainService;
|
||||||
|
@Autowired
|
||||||
|
private com.mhd.oms.application.service.WarehouseInfoApplicationService warehouseInfoApplicationService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private ReserveOutMaterialDetailDomainService outMaterialDetailDomainService;
|
// private ReserveOutMaterialDetailDomainService outMaterialDetailDomainService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
@@ -895,11 +897,8 @@ public class ReserveStockOutOrderApplicationService {
|
|||||||
if (stockOutOrderDO.getWarehouseId() == null) {
|
if (stockOutOrderDO.getWarehouseId() == null) {
|
||||||
throw new ServiceException("仓库ID不能为空");
|
throw new ServiceException("仓库ID不能为空");
|
||||||
}
|
}
|
||||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(stockOutOrderDO.getWarehouseId());
|
// Feign失败走本地跨库兜底, 避免保存被"获取仓库信息失败"阻断
|
||||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
WarehouseFeignPO warehouseFeignPO = warehouseInfoApplicationService.getWarehouseInfo(stockOutOrderDO.getWarehouseId());
|
||||||
throw new ServiceException("获取仓库信息失败");
|
|
||||||
}
|
|
||||||
WarehouseFeignPO warehouseFeignPO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
|
||||||
stockOutOrderDO.setWarehouseCode(warehouseFeignPO.getWarehouseCode());
|
stockOutOrderDO.setWarehouseCode(warehouseFeignPO.getWarehouseCode());
|
||||||
stockOutOrderDO.setWarehouseName(warehouseFeignPO.getWarehouseName());
|
stockOutOrderDO.setWarehouseName(warehouseFeignPO.getWarehouseName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* 三方服务 Feign
|
* 三方服务 Feign
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "thirdPartyServiceFeign",url = "http://10.102.192.31:8012", value = ServiceNameConstants.THIRDPARTY_CENTER, configuration = FeignAutoConfiguration.class)
|
@FeignClient(contextId = "thirdPartyServiceFeign",url = "http://10.33.0.129:8012", value = ServiceNameConstants.THIRDPARTY_CENTER, configuration = FeignAutoConfiguration.class)
|
||||||
public interface ThirdPartyServiceFeign {
|
public interface ThirdPartyServiceFeign {
|
||||||
|
|
||||||
//查询当前组织所有三方接口信息
|
//查询当前组织所有三方接口信息
|
||||||
|
|||||||
+11
@@ -159,6 +159,17 @@ public class ReservationStockOutOrderApi extends BaseController {
|
|||||||
return AjaxResult.success(stockOutOrderApplicationService.cancelIssueOrder(stockOutOrderDO));
|
return AjaxResult.success(stockOutOrderApplicationService.cancelIssueOrder(stockOutOrderDO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反审出库单: 已出库/已复核(issueStatus=2已审核)的单据回退到已创建并打反审标记,
|
||||||
|
* WMS还原实物库存并生成出库异常记录【反审记录】, 单据划归【已反审】页签
|
||||||
|
*/
|
||||||
|
@ApiOperation("反审出库单")
|
||||||
|
@PostMapping(value = "/reverseAudit")
|
||||||
|
public AjaxResult reverseAudit(@RequestBody ReservationStockOutOrderDTO stockOutOrderDTO) {
|
||||||
|
ReservationStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
|
||||||
|
return AjaxResult.success(stockOutOrderApplicationService.reverseAudit(stockOutOrderDO));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("下发出库单")
|
@ApiOperation("下发出库单")
|
||||||
@PostMapping(value = "/executeAndIssue")
|
@PostMapping(value = "/executeAndIssue")
|
||||||
public AjaxResult executeAndIssue(@RequestBody ReservationStockOutOrderDTO stockOutOrderDTO) {
|
public AjaxResult executeAndIssue(@RequestBody ReservationStockOutOrderDTO stockOutOrderDTO) {
|
||||||
|
|||||||
+23
@@ -3,6 +3,7 @@ package com.mhd.oms.interfaces.facade.executionInMaterialDetail;
|
|||||||
import com.mhd.common.core.web.controller.BaseController;
|
import com.mhd.common.core.web.controller.BaseController;
|
||||||
import com.mhd.common.core.web.domain.AjaxResult;
|
import com.mhd.common.core.web.domain.AjaxResult;
|
||||||
import com.mhd.common.core.web.page.TableDataInfo;
|
import com.mhd.common.core.web.page.TableDataInfo;
|
||||||
|
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
||||||
@@ -16,6 +17,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,4 +99,24 @@ public class ExecutionInMaterialDetailApi extends BaseController {
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出入库明细查询Excel(关联入库执行单,全量不分页;
|
||||||
|
* SQL固定只统计已入库(5)单据,可按单据类型(如退货入库tui_huo_ru_ku)与实际入仓日期区间过滤)
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出入库明细查询Excel")
|
||||||
|
@GetMapping("/exportWithOrder")
|
||||||
|
public void exportWithOrder(HttpServletResponse response, ExecutionInMaterialDetailQueryDTO queryDTO) throws Exception
|
||||||
|
{
|
||||||
|
//转换实体(不分页,导出全量)
|
||||||
|
QueryOrderOverStockDO queryDO = inMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||||
|
List<ExecutionInMaterialDetailWithOrderPO> list = inMaterialDetailApplicationService.exportInOrderDetailList(queryDO);
|
||||||
|
|
||||||
|
String fileName = URLEncoder.encode("入库明细查询", "UTF-8").replaceAll("\\+", "%20");
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||||
|
ExcelUtil<ExecutionInMaterialDetailWithOrderPO> util = new ExcelUtil<>(ExecutionInMaterialDetailWithOrderPO.class);
|
||||||
|
util.exportExcel(response, list, "入库明细查询");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+22
@@ -2,6 +2,7 @@ package com.mhd.oms.interfaces.facade.executionOutMaterialDetail;
|
|||||||
|
|
||||||
import com.mhd.common.core.web.controller.BaseController;
|
import com.mhd.common.core.web.controller.BaseController;
|
||||||
import com.mhd.common.core.web.page.TableDataInfo;
|
import com.mhd.common.core.web.page.TableDataInfo;
|
||||||
|
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
||||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailQueryDTO;
|
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailQueryDTO;
|
||||||
import com.mhd.oms.domain.executionOutMaterialDetail.service.ExecutionOutMaterialDetailApplicationService;
|
import com.mhd.oms.domain.executionOutMaterialDetail.service.ExecutionOutMaterialDetailApplicationService;
|
||||||
@@ -14,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,4 +44,23 @@ public class ExecutionOutMaterialDetailApi extends BaseController {
|
|||||||
List<ExecutionOutMaterialDetailWithOrderPO> list = outMaterialDetailApplicationService.queryOutOrderDetailList(queryDO);
|
List<ExecutionOutMaterialDetailWithOrderPO> list = outMaterialDetailApplicationService.queryOutOrderDetailList(queryDO);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出出库明细查询Excel(关联出库执行单,全量不分页;
|
||||||
|
* SQL固定只统计已出库(9/12/13)单据,可按单据类型与实际出仓日期区间过滤)
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出出库明细查询Excel")
|
||||||
|
@GetMapping("/exportWithOrder")
|
||||||
|
public void exportWithOrder(HttpServletResponse response, ExecutionOutMaterialDetailQueryDTO queryDTO) throws Exception {
|
||||||
|
//转换实体(不分页,导出全量)
|
||||||
|
QueryOrderOverStockDO queryDO = outMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||||
|
List<ExecutionOutMaterialDetailWithOrderPO> list = outMaterialDetailApplicationService.queryOutOrderDetailList(queryDO);
|
||||||
|
|
||||||
|
String fileName = URLEncoder.encode("出库明细查询", "UTF-8").replaceAll("\\+", "%20");
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||||
|
ExcelUtil<ExecutionOutMaterialDetailWithOrderPO> util = new ExcelUtil<>(ExecutionOutMaterialDetailWithOrderPO.class);
|
||||||
|
util.exportExcel(response, list, "出库明细查询");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -93,6 +93,16 @@ public class ExecutionStockInOrderApi extends BaseController {
|
|||||||
return AjaxResult.success(stockInOrderApplicationService.getInfo(inOrderId));
|
return AjaxResult.success(stockInOrderApplicationService.getInfo(inOrderId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询入库执行单【已反审】tab 归档详情(已软删+已反审标记的数据,含软删明细)
|
||||||
|
*/
|
||||||
|
@ApiOperation("查询入库执行单已反审归档详情")
|
||||||
|
@GetMapping(value = "/getReverseAuditInfo/{inOrderId}")
|
||||||
|
public AjaxResult getReverseAuditInfo(@PathVariable("inOrderId") Long inOrderId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(stockInOrderApplicationService.getReverseAuditInfo(inOrderId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入入库单
|
* 导入入库单
|
||||||
*/
|
*/
|
||||||
|
|||||||
+13
@@ -122,6 +122,19 @@ public class ReservationStockInOrderApi extends BaseController {
|
|||||||
return AjaxResult.success(stockInOrderApplicationService.auditState(stockInOrderDO));
|
return AjaxResult.success(stockInOrderApplicationService.auditState(stockInOrderDO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反审入库业务单:已入库/已出库的单子客户通知需要回退的场景,单子回退到最原始状态——
|
||||||
|
* 业务单状态改为"已驳回"(issueStatus=3,与审核不通过同语义,可编辑→重新审核→重新下发)
|
||||||
|
* 并打已反审标记落入【已反审】tab;入库执行单+明细软删并打已反审标记;
|
||||||
|
* W入库单有出库记录时WMS侧拦截不允许反审;已推送关务(pushStatus=3)直接拦截
|
||||||
|
*/
|
||||||
|
@ApiOperation("反审入库业务单")
|
||||||
|
@PostMapping(value = "/reverseAudit")
|
||||||
|
public AjaxResult reverseAudit(@RequestBody ReservationStockInOrderDTO stockInOrderDTO) {
|
||||||
|
ReservationStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
|
||||||
|
return AjaxResult.success(stockInOrderApplicationService.reverseAudit(stockInOrderDO));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发入库单
|
* 下发入库单
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ spring:
|
|||||||
discovery:
|
discovery:
|
||||||
# server-addr: 127.0.0.1:8848
|
# server-addr: 127.0.0.1:8848
|
||||||
# 线上测试环境配置 容器名+端口号
|
# 线上测试环境配置 容器名+端口号
|
||||||
# server-addr: 10.33.0.129:6010
|
server-addr: 10.33.0.129:6010
|
||||||
server-addr: 10.102.192.31:6848
|
# server-addr: 10.102.192.31:6848
|
||||||
username: nacos
|
username: nacos
|
||||||
password: manhuoda@2023
|
password: manhuoda@2023
|
||||||
config:
|
config:
|
||||||
# server-addr: 127.0.0.1:8848
|
# server-addr: 127.0.0.1:8848
|
||||||
# 线上测试环境配置 容器名+端口号
|
# 线上测试环境配置 容器名+端口号
|
||||||
# server-addr: 10.33.0.129:6010
|
server-addr: 10.33.0.129:6010
|
||||||
server-addr: 10.102.192.31:6848
|
# server-addr: 10.102.192.31:6848
|
||||||
username: nacos
|
username: nacos
|
||||||
password: manhuoda@2023
|
password: manhuoda@2023
|
||||||
#线上正式环境
|
#线上正式环境
|
||||||
|
|||||||
+2
-2
@@ -1278,8 +1278,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select PUSH_VERIFY from NGWL_TEST_PRODUCT.SYS_ORGANIZATION where ORGANIZATION_ID = #{organizationId}
|
select PUSH_VERIFY from NGWL_TEST_PRODUCT.SYS_ORGANIZATION where ORGANIZATION_ID = #{organizationId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="countByGoodsNumberPrefix" resultType="java.lang.Integer">
|
<select id="selectGoodsNumbersByPrefix" resultType="java.lang.String">
|
||||||
SELECT COUNT(1)
|
SELECT goods_number
|
||||||
FROM business_document_order
|
FROM business_document_order
|
||||||
WHERE goods_number LIKE concat(#{prefix}, '%')
|
WHERE goods_number LIKE concat(#{prefix}, '%')
|
||||||
AND LENGTH(goods_number) <= 12
|
AND LENGTH(goods_number) <= 12
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<sql id="selectExecuteOrderPo1">
|
<sql id="selectExecuteOrderPo1">
|
||||||
<where>
|
<where>
|
||||||
|
<!-- 默认只查正常单(del_flag=1); 反审/删除的归档行需显式传delFlag=2(已反审tab) -->
|
||||||
|
<choose>
|
||||||
|
<when test="delFlag != null">and eo.DEL_FLAG = #{delFlag}</when>
|
||||||
|
<otherwise>and eo.DEL_FLAG = 1</otherwise>
|
||||||
|
</choose>
|
||||||
<if test="createStartTime != null">
|
<if test="createStartTime != null">
|
||||||
and eo.CREATE_TIME >= #{createStartTime}
|
and eo.CREATE_TIME >= #{createStartTime}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
+23
-3
@@ -365,6 +365,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<resultMap type="com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO" id="InMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
<resultMap type="com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO" id="InMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
||||||
<result property="inOrderStatus" column="in_order_status" />
|
<result property="inOrderStatus" column="in_order_status" />
|
||||||
<result property="inOrderAuditStatus" column="in_order_audit_status" />
|
<result property="inOrderAuditStatus" column="in_order_audit_status" />
|
||||||
|
<result property="issueStatus" column="issue_status" />
|
||||||
|
<result property="materialClassifyName" column="material_classify_name" />
|
||||||
|
<result property="orderTypeCode" column="order_type_code" />
|
||||||
|
<result property="orderTypeName" column="order_type_name" />
|
||||||
<result property="orderShipperId" column="order_shipper_id" />
|
<result property="orderShipperId" column="order_shipper_id" />
|
||||||
<result property="orderShipperCode" column="order_shipper_code" />
|
<result property="orderShipperCode" column="order_shipper_code" />
|
||||||
<result property="orderShipperName" column="order_shipper_name" />
|
<result property="orderShipperName" column="order_shipper_name" />
|
||||||
@@ -403,12 +407,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.single_volume, a.single_gross_weight, a.lot_no,
|
a.single_volume, a.single_gross_weight, a.lot_no,
|
||||||
a.drink_date, a.fire_insure_fee, a.unit_price,
|
a.drink_date, a.fire_insure_fee, a.unit_price,
|
||||||
a.line_num_gw, a.spec_gw, a.unit_gw, a.qty_gw, a.erp_curr_gw, a.erp_price_gw, a.amount_gw,
|
a.line_num_gw, a.spec_gw, a.unit_gw, a.qty_gw, a.erp_curr_gw, a.erp_price_gw, a.amount_gw,
|
||||||
c.insure_amount, c.goods_type,
|
c.insure_amount, c.goods_type, c.material_classify_name,
|
||||||
b.shipper_id as order_shipper_id,
|
b.shipper_id as order_shipper_id,
|
||||||
b.shipper_code as order_shipper_code,
|
b.shipper_code as order_shipper_code,
|
||||||
b.shipper_name as order_shipper_name,
|
b.shipper_name as order_shipper_name,
|
||||||
|
b.order_type_code,
|
||||||
|
b.order_type_name,
|
||||||
b.status as in_order_status,
|
b.status as in_order_status,
|
||||||
b.audit_status as in_order_audit_status,
|
b.audit_status as in_order_audit_status,
|
||||||
|
b.issue_status as issue_status,
|
||||||
b.warehouse_date
|
b.warehouse_date
|
||||||
from execution_in_material_detail a
|
from execution_in_material_detail a
|
||||||
left join execution_stock_in_order b on a.in_order_number = b.in_order_number
|
left join execution_stock_in_order b on a.in_order_number = b.in_order_number
|
||||||
@@ -450,15 +457,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="inOrderTypeCode != null and inOrderTypeCode != ''">
|
<if test="inOrderTypeCode != null and inOrderTypeCode != ''">
|
||||||
and b.order_type_code = #{inOrderTypeCode}
|
and b.order_type_code = #{inOrderTypeCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="inStatus != null ">
|
<if test="orderTypeCode != null and orderTypeCode != ''">
|
||||||
and b.status = #{inStatus}
|
and b.order_type_code = #{orderTypeCode}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderTypeName != null and orderTypeName != ''">
|
||||||
|
and b.order_type_name like concat('%', #{orderTypeName}, '%')
|
||||||
|
</if>
|
||||||
|
<!-- 入库单展示状态issue_status: 0-已创建 2-已审核 3-已驳回 4-已入库(WMS回写status=5时同步为4);
|
||||||
|
"已入库"以issue_status=4为准(推送创建的单据直接置4,status不一定为5) -->
|
||||||
|
and b.issue_status = 4
|
||||||
<if test="inOrderExpectStartTime != null">
|
<if test="inOrderExpectStartTime != null">
|
||||||
and b.expect_time >= #{inOrderExpectStartTime}
|
and b.expect_time >= #{inOrderExpectStartTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="inOrderExpectEndTime != null">
|
<if test="inOrderExpectEndTime != null">
|
||||||
and b.expect_time <= #{inOrderExpectEndTime}
|
and b.expect_time <= #{inOrderExpectEndTime}
|
||||||
</if>
|
</if>
|
||||||
|
<!-- 实际入仓日期区间(为空的历史单按建档时间兜底),用于统计当天入库 -->
|
||||||
|
<if test="warehouseDateStart != null and warehouseDateStart != ''">
|
||||||
|
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') >= #{warehouseDateStart}
|
||||||
|
</if>
|
||||||
|
<if test="warehouseDateEnd != null and warehouseDateEnd != ''">
|
||||||
|
and date_format(IFNULL(b.warehouse_date, b.create_time), '%Y-%m-%d') <= #{warehouseDateEnd}
|
||||||
|
</if>
|
||||||
and a.del_flag = 1
|
and a.del_flag = 1
|
||||||
and b.del_flag = 1
|
and b.del_flag = 1
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
+24
-4
@@ -454,6 +454,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
id="OutMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
id="OutMaterialDetailWithOrderResult" extends="MaterialDetailResult">
|
||||||
<result property="outOrderStatus" column="out_order_status" />
|
<result property="outOrderStatus" column="out_order_status" />
|
||||||
<result property="outOrderAuditStatus" column="out_order_audit_status" />
|
<result property="outOrderAuditStatus" column="out_order_audit_status" />
|
||||||
|
<result property="issueStatus" column="issue_status" />
|
||||||
|
<result property="materialClassifyName" column="material_classify_name" />
|
||||||
|
<result property="orderTypeCode" column="order_type_code" />
|
||||||
|
<result property="orderTypeName" column="order_type_name" />
|
||||||
<result property="orderShipperId" column="order_shipper_id" />
|
<result property="orderShipperId" column="order_shipper_id" />
|
||||||
<result property="orderShipperCode" column="order_shipper_code" />
|
<result property="orderShipperCode" column="order_shipper_code" />
|
||||||
<result property="orderShipperName" column="order_shipper_name" />
|
<result property="orderShipperName" column="order_shipper_name" />
|
||||||
@@ -495,14 +499,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.stock_unit, a.stock_quantity, a.inventory_quantity,
|
a.stock_unit, a.stock_quantity, a.inventory_quantity,
|
||||||
a.line_num_gw, a.spec_gw, a.unit_gw, a.qty_gw,
|
a.line_num_gw, a.spec_gw, a.unit_gw, a.qty_gw,
|
||||||
a.erp_curr_gw, a.erp_price_gw, a.amount_gw, a.in_order_number_gw, a.in_line_num_gw,
|
a.erp_curr_gw, a.erp_price_gw, a.amount_gw, a.in_order_number_gw, a.in_line_num_gw,
|
||||||
c.insure_amount, c.goods_type,
|
c.insure_amount, c.goods_type, c.material_classify_name,
|
||||||
b.shipper_id as order_shipper_id,
|
b.shipper_id as order_shipper_id,
|
||||||
b.shipper_code as order_shipper_code,
|
b.shipper_code as order_shipper_code,
|
||||||
b.shipper_name as order_shipper_name,
|
b.shipper_name as order_shipper_name,
|
||||||
|
b.order_type_code,
|
||||||
|
b.order_type_name,
|
||||||
b.OUTBOUND_DATE as order_outbound_date,
|
b.OUTBOUND_DATE as order_outbound_date,
|
||||||
b.OUTBOUND_TIME as order_outbound_time,
|
b.OUTBOUND_TIME as order_outbound_time,
|
||||||
b.status as out_order_status,
|
b.status as out_order_status,
|
||||||
b.audit_status as out_order_audit_status
|
b.audit_status as out_order_audit_status,
|
||||||
|
b.issue_status as issue_status
|
||||||
from execution_out_material_detail a
|
from execution_out_material_detail a
|
||||||
left join execution_stock_out_order b on a.out_order_number = b.out_order_number
|
left join execution_stock_out_order b on a.out_order_number = b.out_order_number
|
||||||
left join NGWL_TEST_WMS.material_base_info c on a.material_base_info_id = c.material_base_info_id
|
left join NGWL_TEST_WMS.material_base_info c on a.material_base_info_id = c.material_base_info_id
|
||||||
@@ -543,15 +550,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="outOrderTypeCode != null and outOrderTypeCode != ''">
|
<if test="outOrderTypeCode != null and outOrderTypeCode != ''">
|
||||||
and b.order_type_code = #{outOrderTypeCode}
|
and b.order_type_code = #{outOrderTypeCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="outStatus != null ">
|
<if test="orderTypeCode != null and orderTypeCode != ''">
|
||||||
and b.status = #{outStatus}
|
and b.order_type_code = #{orderTypeCode}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderTypeName != null and orderTypeName != ''">
|
||||||
|
and b.order_type_name like concat('%', #{orderTypeName}, '%')
|
||||||
|
</if>
|
||||||
|
<!-- 出库单展示状态issue_status: 0-已创建 2-已审核 3-已驳回 4-已出库;
|
||||||
|
执行出库单status不随WMS出库完成流转(回写被注释),"已出库"以issue_status=4为准 -->
|
||||||
|
and b.issue_status = 4
|
||||||
<if test="outOrderExpectStartTime != null">
|
<if test="outOrderExpectStartTime != null">
|
||||||
and b.expect_time >= #{outOrderExpectStartTime}
|
and b.expect_time >= #{outOrderExpectStartTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="outOrderExpectEndTime != null">
|
<if test="outOrderExpectEndTime != null">
|
||||||
and b.expect_time <= #{outOrderExpectEndTime}
|
and b.expect_time <= #{outOrderExpectEndTime}
|
||||||
</if>
|
</if>
|
||||||
|
<!-- 出库时间区间(统计当天出库):严格按出仓日期OUTBOUND_DATE过滤(页面所见即所筛) -->
|
||||||
|
<if test="outboundDateStart != null and outboundDateStart != ''">
|
||||||
|
and date_format(b.OUTBOUND_DATE, '%Y-%m-%d') >= #{outboundDateStart}
|
||||||
|
</if>
|
||||||
|
<if test="outboundDateEnd != null and outboundDateEnd != ''">
|
||||||
|
and date_format(b.OUTBOUND_DATE, '%Y-%m-%d') <= #{outboundDateEnd}
|
||||||
|
</if>
|
||||||
and a.del_flag = 1
|
and a.del_flag = 1
|
||||||
and b.del_flag = 1
|
and b.del_flag = 1
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
+19
-4
@@ -108,6 +108,11 @@
|
|||||||
<result property="discount" column="DISCOUNT" />
|
<result property="discount" column="DISCOUNT" />
|
||||||
<result property="isFreeManpowerFee" column="IS_FREE_MANPOWER_FEE" />
|
<result property="isFreeManpowerFee" column="IS_FREE_MANPOWER_FEE" />
|
||||||
<result property="businessInOrderNumber" column="BUSINESS_IN_ORDER_NUMBER" />
|
<result property="businessInOrderNumber" column="BUSINESS_IN_ORDER_NUMBER" />
|
||||||
|
<result property="reverseAuditStatus" column="REVERSE_AUDIT_STATUS" />
|
||||||
|
<result property="reverseAuditRemark" column="REVERSE_AUDIT_REMARK" />
|
||||||
|
<result property="reverseAuditBy" column="REVERSE_AUDIT_BY" />
|
||||||
|
<result property="reverseAuditByName" column="REVERSE_AUDIT_BY_NAME" />
|
||||||
|
<result property="reverseAuditTime" column="REVERSE_AUDIT_TIME" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
@@ -145,7 +150,8 @@
|
|||||||
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reservation_audit_time,a.reservation_audit_name
|
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reservation_audit_time,a.reservation_audit_name
|
||||||
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number
|
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number
|
||||||
,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity,
|
,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity,
|
||||||
a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME
|
a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME,
|
||||||
|
a.REVERSE_AUDIT_STATUS,a.REVERSE_AUDIT_REMARK,a.REVERSE_AUDIT_BY,a.REVERSE_AUDIT_BY_NAME,a.REVERSE_AUDIT_TIME
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="joinStockInOrderPo">
|
<sql id="joinStockInOrderPo">
|
||||||
@@ -288,7 +294,7 @@
|
|||||||
and a.order_type_code = #{orderTypeCode}
|
and a.order_type_code = #{orderTypeCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="orderTypeName != null and orderTypeName != ''">
|
<if test="orderTypeName != null and orderTypeName != ''">
|
||||||
and (a.BUSINESS_TYPE like concat('%', #{orderTypeName}, '%') or a.ORDER_TYPE_CODE like concat('%', #{orderTypeName}, '%'))
|
and (a.ORDER_TYPE_NAME like concat('%', #{orderTypeName}, '%') or a.BUSINESS_TYPE like concat('%', #{orderTypeName}, '%') or a.ORDER_TYPE_CODE like concat('%', #{orderTypeName}, '%'))
|
||||||
</if>
|
</if>
|
||||||
<if test="supplierId != null ">
|
<if test="supplierId != null ">
|
||||||
and a.supplier_id = #{supplierId}
|
and a.supplier_id = #{supplierId}
|
||||||
@@ -501,9 +507,18 @@
|
|||||||
</if>
|
</if>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
<!-- 反审状态过滤:入库执行单【已反审】tab 传 reverseAuditStatus=1,查询已软删且打反审标记的归档数据 -->
|
||||||
<choose>
|
<choose>
|
||||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
<when test="reverseAuditStatus != null">
|
||||||
<otherwise> and a.del_flag = 1 </otherwise>
|
and a.REVERSE_AUDIT_STATUS = #{reverseAuditStatus}
|
||||||
|
and a.del_flag = 2
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
<choose>
|
||||||
|
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||||
|
<otherwise> and a.del_flag = 1 </otherwise>
|
||||||
|
</choose>
|
||||||
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateByName" column="update_by_name" />
|
<result property="updateByName" column="update_by_name" />
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
|
<result property="reverseFlag" column="reverse_flag" />
|
||||||
<result property="overStockId" column="over_stock_id" />
|
<result property="overStockId" column="over_stock_id" />
|
||||||
<result property="overStockStatus" column="over_stock_status" />
|
<result property="overStockStatus" column="over_stock_status" />
|
||||||
<result property="overStockType" column="over_stock_type" />
|
<result property="overStockType" column="over_stock_type" />
|
||||||
@@ -127,7 +128,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
a.cancel_time, a.close_order, a.close_remark, a.close_by, a.close_by_name, a.close_time, a.check_status,a.BUSINESS_ORDER_NO,
|
a.cancel_time, a.close_order, a.close_remark, a.close_by, a.close_by_name, a.close_time, a.check_status,a.BUSINESS_ORDER_NO,
|
||||||
a.check_task_distribution, a.check_task_distribution_time, a.check_operators_by, a.check_operators_name, a.mobilize_code,
|
a.check_task_distribution, a.check_task_distribution_time, a.check_operators_by, a.check_operators_name, a.mobilize_code,
|
||||||
a.remark, a.create_time, a.create_by, a.create_by_name,a.business_number,a.train_no,a.amount,a.business_out_order_number,
|
a.remark, a.create_time, a.create_by, a.create_by_name,a.business_number,a.train_no,a.amount,a.business_out_order_number,
|
||||||
a.update_time, a.update_by, a.update_by_name, a.del_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type,a."TO",
|
a.update_time, a.update_by, a.update_by_name, a.del_flag, a.reverse_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type,a."TO",
|
||||||
a.CONTACT_PERSON,a.VEHICLE_MODEL_PLATE,a.ENTRUST_NO,a.TEL,a.DRIVER_SIGN,a.FAX,a.DECLARE_CUSTOMS,a.MANUFACTURER,
|
a.CONTACT_PERSON,a.VEHICLE_MODEL_PLATE,a.ENTRUST_NO,a.TEL,a.DRIVER_SIGN,a.FAX,a.DECLARE_CUSTOMS,a.MANUFACTURER,
|
||||||
a.CUSTOMS_DECLARER_INFO,a.DELIVERY_ADDR,a.ENTRY_EXIT_CUSTOMS,a.DEPARTURE_ARRIVAL_COUNTRY,a.CARRIER,a.CONTAINER_NO,a.CONTAINER_NO_NAME,a.OUTBOUND_DATE,
|
a.CUSTOMS_DECLARER_INFO,a.DELIVERY_ADDR,a.ENTRY_EXIT_CUSTOMS,a.DEPARTURE_ARRIVAL_COUNTRY,a.CARRIER,a.CONTAINER_NO,a.CONTAINER_NO_NAME,a.OUTBOUND_DATE,
|
||||||
a.COMPLETE_TIME,a.ORDER_DATE,a.TRANSPORT_MODE_CODE,a.TRANSPORT_MODE_NAME,a.SUPERVISION_MODE_CODE,a.SUPERVISION_MODE_NAME,
|
a.COMPLETE_TIME,a.ORDER_DATE,a.TRANSPORT_MODE_CODE,a.TRANSPORT_MODE_NAME,a.SUPERVISION_MODE_CODE,a.SUPERVISION_MODE_NAME,
|
||||||
@@ -401,6 +402,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||||
<otherwise> and a.del_flag = 1 </otherwise>
|
<otherwise> and a.del_flag = 1 </otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
|
<!-- 反审标记查询: OMS执行单【已反审】tab 前端传 delFlag=2 + reverseFlag=1 (与WMS四列表同口径, 两参数须成对传) -->
|
||||||
|
<if test="reverseFlag != null"> and a.reverse_flag = #{reverseFlag} </if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="queryList" parameterType="com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderDO" resultMap="StockOutOrderResult">
|
<select id="queryList" parameterType="com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderDO" resultMap="StockOutOrderResult">
|
||||||
|
|||||||
+26
-3
@@ -109,6 +109,11 @@
|
|||||||
<result property="discount" column="DISCOUNT" />
|
<result property="discount" column="DISCOUNT" />
|
||||||
<result property="isFreeManpowerFee" column="IS_FREE_MANPOWER_FEE" />
|
<result property="isFreeManpowerFee" column="IS_FREE_MANPOWER_FEE" />
|
||||||
<result property="executionInOrderNumber" column="EXECUTION_IN_ORDER_NUMBER" />
|
<result property="executionInOrderNumber" column="EXECUTION_IN_ORDER_NUMBER" />
|
||||||
|
<result property="reverseAuditStatus" column="REVERSE_AUDIT_STATUS" />
|
||||||
|
<result property="reverseAuditRemark" column="REVERSE_AUDIT_REMARK" />
|
||||||
|
<result property="reverseAuditBy" column="REVERSE_AUDIT_BY" />
|
||||||
|
<result property="reverseAuditByName" column="REVERSE_AUDIT_BY_NAME" />
|
||||||
|
<result property="reverseAuditTime" column="REVERSE_AUDIT_TIME" />
|
||||||
<!-- 饮用有效日期:queryList联查明细表聚合带出,其他查询无此列时不填充 -->
|
<!-- 饮用有效日期:queryList联查明细表聚合带出,其他查询无此列时不填充 -->
|
||||||
<result property="drinkDate" column="drink_date" />
|
<result property="drinkDate" column="drink_date" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
@@ -155,7 +160,8 @@
|
|||||||
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reservation_audit_time,a.reservation_audit_name
|
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reservation_audit_time,a.reservation_audit_name
|
||||||
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number
|
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number
|
||||||
,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity,
|
,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity,
|
||||||
a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME,a.execution_in_order_number
|
a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME,a.execution_in_order_number,
|
||||||
|
a.REVERSE_AUDIT_STATUS,a.REVERSE_AUDIT_REMARK,a.REVERSE_AUDIT_BY,a.REVERSE_AUDIT_BY_NAME,a.REVERSE_AUDIT_TIME
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="joinStockInOrderPo">
|
<sql id="joinStockInOrderPo">
|
||||||
@@ -239,7 +245,7 @@
|
|||||||
and a.notice_number = #{noticeNumber}
|
and a.notice_number = #{noticeNumber}
|
||||||
</if>
|
</if>
|
||||||
<if test="inOrderNumber != null and inOrderNumber != ''">
|
<if test="inOrderNumber != null and inOrderNumber != ''">
|
||||||
and a.in_order_number = #{inOrderNumber}
|
and a.in_order_number like concat('%', #{inOrderNumber}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="status != null ">
|
<if test="status != null ">
|
||||||
and a.status = #{status}
|
and a.status = #{status}
|
||||||
@@ -274,6 +280,10 @@
|
|||||||
<if test="issueStatus != null">
|
<if test="issueStatus != null">
|
||||||
and a.issue_status = #{issueStatus}
|
and a.issue_status = #{issueStatus}
|
||||||
</if>
|
</if>
|
||||||
|
<!-- 反审状态过滤:入库业务单【已反审】tab 传 reverseAuditStatus=1 -->
|
||||||
|
<if test="reverseAuditStatus != null">
|
||||||
|
and a.REVERSE_AUDIT_STATUS = #{reverseAuditStatus}
|
||||||
|
</if>
|
||||||
<if test="warehouseId != null ">
|
<if test="warehouseId != null ">
|
||||||
and a.warehouse_id = #{warehouseId}
|
and a.warehouse_id = #{warehouseId}
|
||||||
</if>
|
</if>
|
||||||
@@ -293,7 +303,7 @@
|
|||||||
and a.order_type_code = #{orderTypeCode}
|
and a.order_type_code = #{orderTypeCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="orderTypeName != null and orderTypeName != ''">
|
<if test="orderTypeName != null and orderTypeName != ''">
|
||||||
and (a.BUSINESS_TYPE like concat('%', #{orderTypeName}, '%') or a.ORDER_TYPE_CODE like concat('%', #{orderTypeName}, '%'))
|
and (a.ORDER_TYPE_NAME like concat('%', #{orderTypeName}, '%') or a.BUSINESS_TYPE like concat('%', #{orderTypeName}, '%') or a.ORDER_TYPE_CODE like concat('%', #{orderTypeName}, '%'))
|
||||||
</if>
|
</if>
|
||||||
<if test="supplierId != null ">
|
<if test="supplierId != null ">
|
||||||
and a.supplier_id = #{supplierId}
|
and a.supplier_id = #{supplierId}
|
||||||
@@ -582,6 +592,19 @@
|
|||||||
select WAREHOUSE_CODE from "NGWL_TEST_SYSTEM".WAREHOUSE where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
select WAREHOUSE_CODE from "NGWL_TEST_SYSTEM".WAREHOUSE where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 本地跨库直查仓库信息: 下发/保存等流程 Feign 获取仓库信息失败/降级时兜底(与 system 服务同库同表)。
|
||||||
|
注意不含 STOCK_LOCK_MODE(冻结功能列, 各环境库结构不一致, 兜底路径不依赖冻结功能的列;
|
||||||
|
stockLockMode 走 Feign 正常路径获取, 兜底时为 null 即默认"分配库存冻结"模式) -->
|
||||||
|
<select id="getWarehouseInfoFallback" parameterType="java.lang.Long" resultType="com.mhd.system.api.domain.WarehouseFeignPO">
|
||||||
|
select WAREHOUSE_CODE as warehouseCode,
|
||||||
|
WAREHOUSE_NAME as warehouseName,
|
||||||
|
ORDER_NO_GENERATE_RULE as orderNoGenerateRule,
|
||||||
|
OUT_ORDER_NO_PREFIX as outOrderNoPrefix,
|
||||||
|
SAMPLE_OUT_ORDER_NO_PREFIX as sampleOutOrderNoPrefix
|
||||||
|
from "NGWL_TEST_SYSTEM".WAREHOUSE
|
||||||
|
where 1 = 1 and DEL_FLAG = 1 and WAREHOUSE_ID = #{id} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<!-- 入仓通知单打印-表头查询 -->
|
<!-- 入仓通知单打印-表头查询 -->
|
||||||
<select id="queryNoticePrint" resultMap="StockInOrderResult">
|
<select id="queryNoticePrint" resultMap="StockInOrderResult">
|
||||||
|
|||||||
+17
-1
@@ -117,6 +117,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="businessPriceWay" column="BUSINESS_PRICE_WAY" />
|
<result property="businessPriceWay" column="BUSINESS_PRICE_WAY" />
|
||||||
<result property="discount" column="DISCOUNT" />
|
<result property="discount" column="DISCOUNT" />
|
||||||
<result property="totalOutboundQuantity" column="TOTAL_OUTBOUND_QUANTITY" />
|
<result property="totalOutboundQuantity" column="TOTAL_OUTBOUND_QUANTITY" />
|
||||||
|
<result property="reverseStatus" column="REVERSE_STATUS" />
|
||||||
|
<result property="reverseBy" column="REVERSE_BY" />
|
||||||
|
<result property="reverseByName" column="REVERSE_BY_NAME" />
|
||||||
|
<result property="reverseTime" column="REVERSE_TIME" />
|
||||||
|
<result property="reverseRemark" column="REVERSE_REMARK" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
@@ -136,7 +141,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.tms_order_number,
|
,a.reservation_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.tms_order_number,
|
||||||
a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.RESERVATION_ORDER_SOURCE,a.OUTBOUND_TIME,a.RETURN_QUANTITY,a.DELIVERY_NAME,a.CUSTOMER_NUMBER,a.INVOICE_NUMBER,a.RETURN_ORDER_NUMBER,a.TOTAL_AMOUNT,
|
a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.RESERVATION_ORDER_SOURCE,a.OUTBOUND_TIME,a.RETURN_QUANTITY,a.DELIVERY_NAME,a.CUSTOMER_NUMBER,a.INVOICE_NUMBER,a.RETURN_ORDER_NUMBER,a.TOTAL_AMOUNT,
|
||||||
a.ROUTE,a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME,a.execution_out_order_number,a.LINE_CODE,a.LINE_NAME,a.SHUTTLE_NO,
|
a.ROUTE,a.PUSH_TIME,a.PUSH_STATUS,a.PUSH_BY,a.PUSH_BY_NAME,a.execution_out_order_number,a.LINE_CODE,a.LINE_NAME,a.SHUTTLE_NO,
|
||||||
a.TOTAL_WAREHOUSE_RENT,a.BUSINESS_CHARGE_TYPE,a.BUSINESS_PRICE_WAY,a.DISCOUNT
|
a.TOTAL_WAREHOUSE_RENT,a.BUSINESS_CHARGE_TYPE,a.BUSINESS_PRICE_WAY,a.DISCOUNT,
|
||||||
|
a.REVERSE_STATUS,a.REVERSE_BY,a.REVERSE_BY_NAME,a.REVERSE_TIME,a.REVERSE_REMARK
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
@@ -178,11 +184,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<!-- 出库状态: 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中-->
|
<!-- 出库状态: 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中-->
|
||||||
and a.status IN (3, 4, 5, 6, 7, 8)
|
and a.status IN (3, 4, 5, 6, 7, 8)
|
||||||
</when>
|
</when>
|
||||||
|
<when test="status == -2 "> <!-- 已反审 -->
|
||||||
|
<!-- 反审后单据回退为 1-已创建 且打上反审标记, 与【已创建】页签互斥 -->
|
||||||
|
and a.status = 1 and a.reverse_status = 1
|
||||||
|
</when>
|
||||||
|
<when test="status == 1 "> <!-- 已创建: 排除已反审的单据(已划归【已反审】页签) -->
|
||||||
|
and a.status = 1 and (a.reverse_status is null or a.reverse_status = 0)
|
||||||
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
and a.status = #{status}
|
and a.status = #{status}
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
|
<if test="reverseStatus != null ">
|
||||||
|
and a.reverse_status = #{reverseStatus}
|
||||||
|
</if>
|
||||||
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 -->
|
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 -->
|
||||||
<if test="gtStatus != null ">
|
<if test="gtStatus != null ">
|
||||||
and a.status > #{gtStatus}
|
and a.status > #{gtStatus}
|
||||||
|
|||||||
+8
@@ -157,6 +157,14 @@ public class HandoverTaskOrderApplicationService {
|
|||||||
return handoverTaskOrderDomainService.getInfo(outTaskOrderId);
|
return handoverTaskOrderDomainService.getInfo(outTaskOrderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取交接作业单归档详情(已反审): 反审时交接单已软删, 供【已反审】tab 查看归档详情
|
||||||
|
*/
|
||||||
|
public HandoverTaskOrderPO getReverseInfo(Long outTaskOrderId)
|
||||||
|
{
|
||||||
|
return handoverTaskOrderDomainService.getReverseInfo(outTaskOrderId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按作业单号获取交接作业单详细信息(PDA 端)
|
* 按作业单号获取交接作业单详细信息(PDA 端)
|
||||||
* 用于下发任务(taskType=7)中 trackingNumber 对应交接作业单的 taskNumber
|
* 用于下发任务(taskType=7)中 trackingNumber 对应交接作业单的 taskNumber
|
||||||
|
|||||||
+48
@@ -2,9 +2,12 @@ package com.mhd.wms.application.service.inMaterialDetail;
|
|||||||
|
|
||||||
import com.mhd.common.security.utils.SecurityUtils;
|
import com.mhd.common.security.utils.SecurityUtils;
|
||||||
import com.mhd.system.api.model.LoginUser;
|
import com.mhd.system.api.model.LoginUser;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.service.InMaterialDetailDomainService;
|
import com.mhd.wms.domain.inMaterialDetail.service.InMaterialDetailDomainService;
|
||||||
|
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -39,6 +42,51 @@ public class InMaterialDetailApplicationService {
|
|||||||
return inMaterialDetailDomainService.queryList(inMaterialDetailDO);
|
return inMaterialDetailDomainService.queryList(inMaterialDetailDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
if (loginUser != null){
|
||||||
|
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||||
|
if (topOrganizationId != null && topOrganizationId != 1){
|
||||||
|
queryOrderOverStockDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return inMaterialDetailDomainService.queryInOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
List<InMaterialDetailExportPO> list = inMaterialDetailDomainService.exportInOrderDetailList(setDataPermission(queryOrderOverStockDO));
|
||||||
|
// 货物种类=挂载分类的父级分类名称:material_classify_name为分类路径(如"食品,饮料"),取倒数第二段;
|
||||||
|
// 仅一级分类(无父级)时取自身名称
|
||||||
|
for (InMaterialDetailExportPO po : list) {
|
||||||
|
String names = po.getMaterialClassifyName();
|
||||||
|
if (names != null && names.contains(",")) {
|
||||||
|
String[] parts = names.split(",");
|
||||||
|
po.setMaterialClassifyName(parts[parts.length - 2].trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限:非平台超管(1)按登录人一级组织过滤
|
||||||
|
*/
|
||||||
|
private QueryOrderOverStockDO setDataPermission(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
if (loginUser != null){
|
||||||
|
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||||
|
if (topOrganizationId != null && topOrganizationId != 1){
|
||||||
|
queryOrderOverStockDO.setTopOrganizationId(topOrganizationId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return queryOrderOverStockDO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增物料明细
|
* 新增物料明细
|
||||||
|
|||||||
+47
-29
@@ -167,7 +167,11 @@ public class InvestigationManageApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<InvestigetionManageDetailPO> detailList = investigationManagePO.getInvestigetionManageDetailList();
|
List<InvestigetionManageDetailPO> detailList = investigationManagePO.getInvestigetionManageDetailList();
|
||||||
|
|
||||||
|
// 物料编码相同的明细排在一起展示(稳定排序,同编码内保持原顺序;仅排序不聚合,各条明细独立)
|
||||||
|
detailList.sort(Comparator.comparing(InvestigetionManageDetailPO::getMaterialCode,
|
||||||
|
Comparator.nullsLast(Comparator.naturalOrder())));
|
||||||
|
|
||||||
// 性能优化:批量获取批次属性,避免N+1查询问题
|
// 性能优化:批量获取批次属性,避免N+1查询问题
|
||||||
// 1. 收集所有唯一的materialBaseInfoId
|
// 1. 收集所有唯一的materialBaseInfoId
|
||||||
Set<Long> materialBaseInfoIdSet = detailList.stream()
|
Set<Long> materialBaseInfoIdSet = detailList.stream()
|
||||||
@@ -236,8 +240,9 @@ public class InvestigationManageApplicationService {
|
|||||||
|
|
||||||
if (materialBaseInfoId != null && batchDetailMap.containsKey(materialBaseInfoId)) {
|
if (materialBaseInfoId != null && batchDetailMap.containsKey(materialBaseInfoId)) {
|
||||||
List<BatchDetailFeignPO> batchDetailFeignPOList = batchDetailMap.get(materialBaseInfoId);
|
List<BatchDetailFeignPO> batchDetailFeignPOList = batchDetailMap.get(materialBaseInfoId);
|
||||||
// 用于跟踪已添加到列表中的batchDetailId
|
// 用于跟踪已添加到列表中的batchDetailId(batchDetailId为空的配置行改用标签去重,不再丢弃)
|
||||||
Set<Long> addedBatchDetailIds = new HashSet<>();
|
Set<Long> addedBatchDetailIds = new HashSet<>();
|
||||||
|
Set<String> addedLabelKeys = new HashSet<>();
|
||||||
|
|
||||||
for (BatchDetailFeignPO batchDetailFeignPO : batchDetailFeignPOList) {
|
for (BatchDetailFeignPO batchDetailFeignPO : batchDetailFeignPOList) {
|
||||||
MaterialMoreDetailPO materialMoreDetailPO = new MaterialMoreDetailPO();
|
MaterialMoreDetailPO materialMoreDetailPO = new MaterialMoreDetailPO();
|
||||||
@@ -249,40 +254,44 @@ public class InvestigationManageApplicationService {
|
|||||||
materialMoreDetailPO.setAttributeOption(batchDetailFeignPO.getAttributeOption());
|
materialMoreDetailPO.setAttributeOption(batchDetailFeignPO.getAttributeOption());
|
||||||
materialMoreDetailPO.setRemark(batchDetailFeignPO.getRemark());
|
materialMoreDetailPO.setRemark(batchDetailFeignPO.getRemark());
|
||||||
|
|
||||||
// 确保添加到列表中(使用batchDetailId来避免重复)
|
// 确保添加到列表中(按batchDetailId+标签双重去重,batchDetailId为空的配置行也保留)
|
||||||
Long batchDetailId = batchDetailFeignPO.getBatchDetailId();
|
Long batchDetailId = batchDetailFeignPO.getBatchDetailId();
|
||||||
if (batchDetailId != null && !addedBatchDetailIds.contains(batchDetailId)) {
|
String labelKey = batchDetailFeignPO.getBatchLabels() == null ? "" : batchDetailFeignPO.getBatchLabels().trim();
|
||||||
|
boolean duplicated = addedLabelKeys.contains(labelKey)
|
||||||
|
|| (batchDetailId != null && addedBatchDetailIds.contains(batchDetailId));
|
||||||
|
if (!duplicated) {
|
||||||
materialMoreDetailList.add(materialMoreDetailPO);
|
materialMoreDetailList.add(materialMoreDetailPO);
|
||||||
addedBatchDetailIds.add(batchDetailId);
|
addedLabelKeys.add(labelKey);
|
||||||
|
if (batchDetailId != null) {
|
||||||
|
addedBatchDetailIds.add(batchDetailId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据fieldName或batchLabels从库存表中获取对应的字段值
|
// 根据fieldName或batchLabels从库存表中获取对应的字段值
|
||||||
if (materialInventoryPO != null) {
|
if (materialInventoryPO != null) {
|
||||||
String fieldValue = null;
|
String fieldValue = null;
|
||||||
String usedFieldName = null;
|
|
||||||
// 优先使用fieldName(如果存在)
|
// 优先使用fieldName(如果存在)
|
||||||
if (StringUtils.isNotBlank(batchDetailFeignPO.getFieldName())) {
|
if (StringUtils.isNotBlank(batchDetailFeignPO.getFieldName())) {
|
||||||
usedFieldName = batchDetailFeignPO.getFieldName();
|
String usedFieldName = batchDetailFeignPO.getFieldName();
|
||||||
fieldValue = getFieldValueByFieldName(materialInventoryPO, usedFieldName);
|
fieldValue = getFieldValueByFieldName(materialInventoryPO, usedFieldName);
|
||||||
log.info("批次属性 batchDetailId={}, fieldName={}, 从库存表获取到的值={}",
|
log.info("批次属性 batchDetailId={}, fieldName={}, 从库存表获取到的值={}",
|
||||||
batchDetailFeignPO.getBatchDetailId(), usedFieldName, fieldValue);
|
batchDetailFeignPO.getBatchDetailId(), usedFieldName, fieldValue);
|
||||||
}
|
}
|
||||||
// 如果fieldName为空,尝试根据batchLabels映射到字段名
|
// fieldName没取到值时,回退按batchLabels映射字段名再取一次(修复fieldName配置失效导致值永远为空)
|
||||||
else if (StringUtils.isNotBlank(batchDetailFeignPO.getBatchLabels())) {
|
if (fieldValue == null && StringUtils.isNotBlank(batchDetailFeignPO.getBatchLabels())) {
|
||||||
String fieldNameByLabel = getFieldNameByBatchLabel(batchDetailFeignPO.getBatchLabels());
|
String fieldNameByLabel = getFieldNameByBatchLabel(batchDetailFeignPO.getBatchLabels());
|
||||||
if (StringUtils.isNotBlank(fieldNameByLabel)) {
|
if (StringUtils.isNotBlank(fieldNameByLabel)) {
|
||||||
usedFieldName = fieldNameByLabel;
|
fieldValue = getFieldValueByFieldName(materialInventoryPO, fieldNameByLabel);
|
||||||
fieldValue = getFieldValueByFieldName(materialInventoryPO, usedFieldName);
|
log.info("批次属性 batchDetailId={}, batchLabels={}, 映射字段名={}, 从库存表获取到的值={}",
|
||||||
log.info("批次属性 batchDetailId={}, batchLabels={}, 映射字段名={}, 从库存表获取到的值={}",
|
batchDetailFeignPO.getBatchDetailId(), batchDetailFeignPO.getBatchLabels(),
|
||||||
batchDetailFeignPO.getBatchDetailId(), batchDetailFeignPO.getBatchLabels(),
|
fieldNameByLabel, fieldValue);
|
||||||
usedFieldName, fieldValue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 只有当获取到值时才更新attributeValue
|
// 只有当获取到值时才更新attributeValue
|
||||||
if (fieldValue != null) {
|
if (fieldValue != null) {
|
||||||
materialMoreDetailPO.setAttributeValue(fieldValue);
|
materialMoreDetailPO.setAttributeValue(fieldValue);
|
||||||
log.info("设置更多属性:batchDetailId={}, batchLabels={}, attributeValue={}",
|
log.info("设置更多属性:batchDetailId={}, batchLabels={}, attributeValue={}",
|
||||||
materialMoreDetailPO.getBatchDetailId(), materialMoreDetailPO.getBatchLabels(),
|
materialMoreDetailPO.getBatchDetailId(), materialMoreDetailPO.getBatchLabels(),
|
||||||
materialMoreDetailPO.getAttributeValue());
|
materialMoreDetailPO.getAttributeValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,22 +315,29 @@ public class InvestigationManageApplicationService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批次标签到字段名的映射关系
|
// 批次标签到字段名的映射关系(LinkedHashMap保证匹配优先级稳定;长key放前面,避免短标签模糊匹配被抢先误匹配)
|
||||||
Map<String, String> labelToFieldNameMap = new HashMap<>();
|
Map<String, String> labelToFieldNameMap = new LinkedHashMap<>();
|
||||||
labelToFieldNameMap.put("Invoice No.", "invoiceNo");
|
|
||||||
labelToFieldNameMap.put("Invoice No", "invoiceNo");
|
|
||||||
labelToFieldNameMap.put("发票号", "invoiceNo");
|
|
||||||
labelToFieldNameMap.put("Batch Ref NO's", "batchRefNo");
|
labelToFieldNameMap.put("Batch Ref NO's", "batchRefNo");
|
||||||
|
labelToFieldNameMap.put("Sheet Ref NO's", "sheetRefNo");
|
||||||
|
labelToFieldNameMap.put("箱号/卡板号", "boxPalletNo");
|
||||||
|
labelToFieldNameMap.put("Invoice No.", "invoiceNo");
|
||||||
|
labelToFieldNameMap.put("发票号", "invoiceNo");
|
||||||
labelToFieldNameMap.put("Batch Ref NO", "batchRefNo");
|
labelToFieldNameMap.put("Batch Ref NO", "batchRefNo");
|
||||||
labelToFieldNameMap.put("批次参考号", "batchRefNo");
|
labelToFieldNameMap.put("批次参考号", "batchRefNo");
|
||||||
labelToFieldNameMap.put("Sheet Ref NO's", "sheetRefNo");
|
|
||||||
labelToFieldNameMap.put("Sheet Ref NO", "sheetRefNo");
|
labelToFieldNameMap.put("Sheet Ref NO", "sheetRefNo");
|
||||||
labelToFieldNameMap.put("单据参考号", "sheetRefNo");
|
labelToFieldNameMap.put("单据参考号", "sheetRefNo");
|
||||||
labelToFieldNameMap.put("箱号/卡板号", "boxPalletNo");
|
|
||||||
labelToFieldNameMap.put("箱号", "boxPalletNo");
|
labelToFieldNameMap.put("箱号", "boxPalletNo");
|
||||||
labelToFieldNameMap.put("卡板号", "boxPalletNo");
|
labelToFieldNameMap.put("卡板号", "boxPalletNo");
|
||||||
|
labelToFieldNameMap.put("Batch Number", "batchNumber");
|
||||||
|
labelToFieldNameMap.put("Production Date", "productionDate");
|
||||||
labelToFieldNameMap.put("生产日期", "productionDate");
|
labelToFieldNameMap.put("生产日期", "productionDate");
|
||||||
|
labelToFieldNameMap.put("Expiry Date", "expiryDate");
|
||||||
|
labelToFieldNameMap.put("EXP Date", "expiryDate");
|
||||||
labelToFieldNameMap.put("过期日期", "expiryDate");
|
labelToFieldNameMap.put("过期日期", "expiryDate");
|
||||||
|
labelToFieldNameMap.put("Batch No", "batchNumber");
|
||||||
|
labelToFieldNameMap.put("批次号", "batchNumber");
|
||||||
|
labelToFieldNameMap.put("入库日期", "createTime");
|
||||||
|
labelToFieldNameMap.put("入库时间", "createTime");
|
||||||
labelToFieldNameMap.put("存货日期", "inventoryDate");
|
labelToFieldNameMap.put("存货日期", "inventoryDate");
|
||||||
labelToFieldNameMap.put("扩展字段1", "extAttr1");
|
labelToFieldNameMap.put("扩展字段1", "extAttr1");
|
||||||
labelToFieldNameMap.put("扩展字段2", "extAttr2");
|
labelToFieldNameMap.put("扩展字段2", "extAttr2");
|
||||||
@@ -334,14 +350,16 @@ public class InvestigationManageApplicationService {
|
|||||||
return fieldName;
|
return fieldName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 模糊匹配(包含关系)
|
// 模糊匹配(包含关系):多个key命中时取最长的key,保证同一标签映射结果稳定
|
||||||
|
String bestMatchKey = null;
|
||||||
for (Map.Entry<String, String> entry : labelToFieldNameMap.entrySet()) {
|
for (Map.Entry<String, String> entry : labelToFieldNameMap.entrySet()) {
|
||||||
if (batchLabel.contains(entry.getKey()) || entry.getKey().contains(batchLabel)) {
|
if (batchLabel.contains(entry.getKey()) || entry.getKey().contains(batchLabel)) {
|
||||||
return entry.getValue();
|
if (bestMatchKey == null || entry.getKey().length() > bestMatchKey.length()) {
|
||||||
|
bestMatchKey = entry.getKey();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return bestMatchKey != null ? labelToFieldNameMap.get(bestMatchKey) : null;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
package com.mhd.wms.application.service.outMaterialDetail;
|
||||||
|
|
||||||
|
import com.mhd.common.security.utils.SecurityUtils;
|
||||||
|
import com.mhd.system.api.model.LoginUser;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.service.OutMaterialDetailDomainService;
|
||||||
|
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库物料明细ApplicationService
|
||||||
|
*
|
||||||
|
* @author rcx
|
||||||
|
* @date 2026-09-09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class OutMaterialDetailApplicationService {
|
||||||
|
@Autowired
|
||||||
|
private OutMaterialDetailDomainService outMaterialDetailDomainService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return outMaterialDetailDomainService.queryOutOrderDetailList(setDataPermission(queryOrderOverStockDO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return outMaterialDetailDomainService.exportOutOrderDetailList(setDataPermission(queryOrderOverStockDO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据权限:非平台超管(1)按登录人一级组织过滤
|
||||||
|
*/
|
||||||
|
private QueryOrderOverStockDO setDataPermission(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
if (loginUser != null){
|
||||||
|
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||||
|
if (topOrganizationId != null && topOrganizationId != 1){
|
||||||
|
queryOrderOverStockDO.setTopOrganizationId(topOrganizationId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return queryOrderOverStockDO;
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
-2
@@ -282,11 +282,18 @@ public class PickingOrderApplicationService {
|
|||||||
setMaterialMoreDetailListRecursively(pickingMaterialDetailPOList, batchDetailMap);
|
setMaterialMoreDetailListRecursively(pickingMaterialDetailPOList, batchDetailMap);
|
||||||
|
|
||||||
pickingOrderPO.setMaterialDetailList(pickingMaterialDetailPOList);
|
pickingOrderPO.setMaterialDetailList(pickingMaterialDetailPOList);
|
||||||
log.info("返回拣货单信息,pickingOrderId={}, materialDetailList大小={}",
|
log.info("返回拣货单信息,pickingOrderId={}, materialDetailList大小={}",
|
||||||
pickingOrderPO.getPickingOrderId(),
|
pickingOrderPO.getPickingOrderId(),
|
||||||
pickingMaterialDetailPOList != null ? pickingMaterialDetailPOList.size() : 0);
|
pickingMaterialDetailPOList != null ? pickingMaterialDetailPOList.size() : 0);
|
||||||
return pickingOrderPO;
|
return pickingOrderPO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取拣货单归档详情(已反审): 反审时拣货单已软删(del_flag=2), 供【已反审】tab 查看归档详情
|
||||||
|
*/
|
||||||
|
public PickingOrderPO getReverseInfoByIdAndType(Long pickingOrderId, Integer type) {
|
||||||
|
return pickingOrderDomainService.getReverseInfoByIdAndType(pickingOrderId, type);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 递归为物料明细设置更多属性
|
* 递归为物料明细设置更多属性
|
||||||
|
|||||||
+21
@@ -186,6 +186,27 @@ public class ReviewOrderApplicationService {
|
|||||||
header.setMaterialDetailList(details);
|
header.setMaterialDetailList(details);
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取复核单归档详情(已反审): 反审时复核单/明细均已软删(del_flag=2), 供【已反审】tab 查看归档详情
|
||||||
|
*/
|
||||||
|
public ReviewOrderPO getReverseDetailByReviewOrderId(Long reviewOrderId) {
|
||||||
|
if (reviewOrderId == null) {
|
||||||
|
throw new ServiceException("复核单ID不能为空");
|
||||||
|
}
|
||||||
|
ReviewOrderPO header = reviewOrderMapper.selectHeaderByReviewOrderIdReverse(reviewOrderId);
|
||||||
|
if (header == null) {
|
||||||
|
throw new ServiceException("复核单不存在");
|
||||||
|
}
|
||||||
|
List<ReviewMaterialDetailPO> details = reviewOrderMapper.queryDetailByReviewOrderIdReverse(reviewOrderId);
|
||||||
|
fillDisplayQtyFields(details);
|
||||||
|
Map<Long, List<BatchDetailFeignPO>> batchDetailMap = loadDisplayBatchDetailMap(details);
|
||||||
|
fillDynamicBatchDisplayFields(details, batchDetailMap);
|
||||||
|
buildReviewMaterialMoreDetailListLikeShelf(details, batchDetailMap);
|
||||||
|
fillHeaderSummary(header, details);
|
||||||
|
header.setMaterialDetailList(details);
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public ReviewOrderPO getDetailByReviewOrderNumber(String reviewOrderNumber) {
|
public ReviewOrderPO getDetailByReviewOrderNumber(String reviewOrderNumber) {
|
||||||
|
|||||||
+26
-1
@@ -667,7 +667,16 @@ public class StockInOrderApplicationService {
|
|||||||
*/
|
*/
|
||||||
public StockInOrderPO getInfo(Long inOrderId)
|
public StockInOrderPO getInfo(Long inOrderId)
|
||||||
{
|
{
|
||||||
StockInOrderPO info = stockInOrderDomainService.getInfo(inOrderId);
|
return getInfo(inOrderId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库单详情
|
||||||
|
* @param archive true-查询【已反审】tab 归档数据(已软删+已反审标记,明细放行软删行)
|
||||||
|
*/
|
||||||
|
public StockInOrderPO getInfo(Long inOrderId, boolean archive)
|
||||||
|
{
|
||||||
|
StockInOrderPO info = stockInOrderDomainService.getInfo(inOrderId, archive);
|
||||||
String userNcCode = stockOutOrderMapper.getUserNcCode(info.getShipperId());
|
String userNcCode = stockOutOrderMapper.getUserNcCode(info.getShipperId());
|
||||||
info.setKhdm(userNcCode);
|
info.setKhdm(userNcCode);
|
||||||
List<InMaterialDetailPO> materialDetailList = info.getMaterialDetailList();
|
List<InMaterialDetailPO> materialDetailList = info.getMaterialDetailList();
|
||||||
@@ -762,6 +771,14 @@ public class StockInOrderApplicationService {
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询入库单【已反审】tab 归档详情(已软删+已反审标记的数据,含软删明细/收货单/上架单)
|
||||||
|
*/
|
||||||
|
public StockInOrderPO getReverseAuditInfo(Long inOrderId)
|
||||||
|
{
|
||||||
|
return getInfo(inOrderId, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -955,6 +972,14 @@ public class StockInOrderApplicationService {
|
|||||||
stockInOrderDomainService.cancelExecutionOrder(stockInOrder);
|
stockInOrderDomainService.cancelExecutionOrder(stockInOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OMS入库业务单反审:WMS侧回退已完成单据(出库拦截 -> 回退库存 ->
|
||||||
|
* 逻辑删除收货/上架链路 -> 写入库异常【反审记录】),已产生出库则报错拦截
|
||||||
|
*/
|
||||||
|
public void omsReverseInOrder(StockInOrder stockInOrder){
|
||||||
|
stockInOrderDomainService.reverseExecutionOrder(stockInOrder);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 取消入库单
|
* @description 取消入库单
|
||||||
* @author ZhouGY
|
* @author ZhouGY
|
||||||
|
|||||||
+16
-1
@@ -500,7 +500,15 @@ public class StockOutOrderApplicationService {
|
|||||||
|
|
||||||
return stockOutOrderPO;
|
return stockOutOrderPO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取出库单归档详情(已反审): 反审时单据已软删, 供【已反审】tab 查看归档详情
|
||||||
|
*/
|
||||||
|
public StockOutOrderPO getReverseInfoChildren(Long outOrderId)
|
||||||
|
{
|
||||||
|
return stockOutOrderDomainService.getReverseInfoChildren(outOrderId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 出库交接场景:递归过滤 pickingQuantity 为 0 的明细(与交接详情一致)
|
* 出库交接场景:递归过滤 pickingQuantity 为 0 的明细(与交接详情一致)
|
||||||
* @param detailList 物料明细树
|
* @param detailList 物料明细树
|
||||||
@@ -1950,6 +1958,13 @@ public class StockOutOrderApplicationService {
|
|||||||
stockOutOrderDomainService.cancelExecutionOrder(stockOutOrder);
|
stockOutOrderDomainService.cancelExecutionOrder(stockOutOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* oms出库执行单反审(已出库单据回退): 还原实物库存并推送OMS、清理单据、生成反审异常记录
|
||||||
|
*/
|
||||||
|
public void reverseExecutionOrder(StockOutOrder stockOutOrder){
|
||||||
|
stockOutOrderDomainService.reverseExecutionOrder(stockOutOrder);
|
||||||
|
}
|
||||||
|
|
||||||
public void omsOrderAddDetail(List<OutMaterialDetail> outMaterialDetails){
|
public void omsOrderAddDetail(List<OutMaterialDetail> outMaterialDetails){
|
||||||
stockOutOrderDomainService.omsOrderAddDetail(outMaterialDetails);
|
stockOutOrderDomainService.omsOrderAddDetail(outMaterialDetails);
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-1
@@ -201,9 +201,22 @@ public class StockReceiptOrderApplicationService {
|
|||||||
*/
|
*/
|
||||||
public StockReceiptOrderPO getInfo(Long receiptOrderId)
|
public StockReceiptOrderPO getInfo(Long receiptOrderId)
|
||||||
{
|
{
|
||||||
StockReceiptOrderPO stockReceiptOrderPO = stockReceiptOrderDomainService.getInfo(receiptOrderId);
|
return getInfo(receiptOrderId, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取收货单详情
|
||||||
|
* @param archive true-查询【已反审】tab 归档数据(已软删+已反审标记,明细放行软删行)
|
||||||
|
*/
|
||||||
|
public StockReceiptOrderPO getInfo(Long receiptOrderId, boolean archive)
|
||||||
|
{
|
||||||
|
StockReceiptOrderPO stockReceiptOrderPO = stockReceiptOrderDomainService.getInfo(receiptOrderId, archive);
|
||||||
ReceiptMaterialDetailDO receiptMaterialDetailDO = new ReceiptMaterialDetailDO();
|
ReceiptMaterialDetailDO receiptMaterialDetailDO = new ReceiptMaterialDetailDO();
|
||||||
receiptMaterialDetailDO.setReceiptOrderNumber(stockReceiptOrderPO.getReceiptOrderNumber());
|
receiptMaterialDetailDO.setReceiptOrderNumber(stockReceiptOrderPO.getReceiptOrderNumber());
|
||||||
|
if (archive) {
|
||||||
|
//归档明细已随主单软删,放行软删行
|
||||||
|
receiptMaterialDetailDO.setDelFlag(2);
|
||||||
|
}
|
||||||
List<ReceiptMaterialDetailPO> receiptMaterialDetailPOList = receiptMaterialDetailDomainService.queryListChildren(receiptMaterialDetailDO);
|
List<ReceiptMaterialDetailPO> receiptMaterialDetailPOList = receiptMaterialDetailDomainService.queryListChildren(receiptMaterialDetailDO);
|
||||||
|
|
||||||
// 性能优化:批量获取批次属性,避免N+1查询问题
|
// 性能优化:批量获取批次属性,避免N+1查询问题
|
||||||
@@ -306,6 +319,14 @@ public class StockReceiptOrderApplicationService {
|
|||||||
totalNetWeight, totalGrossWeight, totalVolume, totalArea);
|
totalNetWeight, totalGrossWeight, totalVolume, totalArea);
|
||||||
return stockReceiptOrderPO;
|
return stockReceiptOrderPO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询收货单【已反审】tab 归档详情(已软删+已反审标记的数据,含软删明细)
|
||||||
|
*/
|
||||||
|
public StockReceiptOrderPO getReverseAuditInfo(Long receiptOrderId)
|
||||||
|
{
|
||||||
|
return getInfo(receiptOrderId, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据物料基础信息ID获取批次属性(更多属性),只返回isDisplay=1的属性
|
* 根据物料基础信息ID获取批次属性(更多属性),只返回isDisplay=1的属性
|
||||||
|
|||||||
+13
-6
@@ -134,12 +134,12 @@ public class StockShelfOrderApplicationService {
|
|||||||
private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD";
|
private static final String VERIFY = "ESLuxAmB6VXCgbqP1eFzxTPVRagkQ62BUkfhElrgQ6XmE/g2reHVflY/SiCSU7JD";
|
||||||
|
|
||||||
/** 仅这些仓库的上架单在PC上传页默认填充上架库位(按仓库名匹配;需放开其他仓库时在此追加)。
|
/** 仅这些仓库的上架单在PC上传页默认填充上架库位(按仓库名匹配;需放开其他仓库时在此追加)。
|
||||||
* 生产环境:维他奶仓(warehouseId=14,已对照线上库位树验证:库区id=20,库位id=33);测试环境为 青洲仓(warehouseId=13),需测试时切换 */
|
* 测试环境:青洲仓(warehouseId=13);生产环境为 维他奶仓(warehouseId=14,已对照线上库位树验证:库区id=20,库位id=33),发版前需切换 */
|
||||||
private static final Set<String> DEFAULT_STORAGE_LOCATION_WAREHOUSE_NAMES = new HashSet<>(Collections.singletonList("维他奶仓"));
|
private static final Set<String> DEFAULT_STORAGE_LOCATION_WAREHOUSE_NAMES = new HashSet<>(Collections.singletonList("青洲仓"));
|
||||||
/** 默认上架库位:指定库区名→库位名(精确匹配,须与基础资料名称完全一致,注意含繁体字)。
|
/** 默认上架库位:指定库区名→库位名(精确匹配,须与基础资料名称完全一致)。
|
||||||
* 生产环境:維他奶2层冷凍A區 → 2层冷凍A區A01;测试环境为 4楼A区 → 4A-01-01,需测试时切换 */
|
* 测试环境:4楼A区 → 4A-01-01;生产环境为 維他奶2层冷凍A區 → 2层冷凍A區A01(含繁体字),发版前需切换 */
|
||||||
private static final String DEFAULT_SHELF_STORAGE_NAME = "維他奶2层冷凍A區";
|
private static final String DEFAULT_SHELF_STORAGE_NAME = "4楼A区";
|
||||||
private static final String DEFAULT_SHELF_STORAGE_LOCATION_NAME = "2层冷凍A區A01";
|
private static final String DEFAULT_SHELF_STORAGE_LOCATION_NAME = "4A-01-01";
|
||||||
/** 仅这些组织的上架单在PC上传页默认填充上架库位(按组织id精确匹配;测试与生产均为 谷丰=2842,若不一致需按环境切换) */
|
/** 仅这些组织的上架单在PC上传页默认填充上架库位(按组织id精确匹配;测试与生产均为 谷丰=2842,若不一致需按环境切换) */
|
||||||
private static final Set<Long> DEFAULT_STORAGE_LOCATION_ORGANIZATION_IDS = new HashSet<>(Collections.singletonList(2842L));
|
private static final Set<Long> DEFAULT_STORAGE_LOCATION_ORGANIZATION_IDS = new HashSet<>(Collections.singletonList(2842L));
|
||||||
|
|
||||||
@@ -243,6 +243,13 @@ public class StockShelfOrderApplicationService {
|
|||||||
return getInfo(shelfOrderId, false);
|
return getInfo(shelfOrderId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询上架单【已反审】tab 归档详情(已软删+已反审标记的数据,含软删明细)
|
||||||
|
*/
|
||||||
|
public StockShelfOrderPO getReverseAuditInfo(Long shelfOrderId) {
|
||||||
|
return stockShelfOrderDomainService.getInfo(shelfOrderId, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取上架单详细信息
|
* 获取上架单详细信息
|
||||||
*
|
*
|
||||||
|
|||||||
+4
-1
@@ -144,4 +144,7 @@ public class HandoverTaskOrder extends BaseVOEntity {
|
|||||||
private String operatorsName;
|
private String operatorsName;
|
||||||
@ApiModelProperty("计费信息")
|
@ApiModelProperty("计费信息")
|
||||||
private String billingJson;
|
private String billingJson;
|
||||||
}
|
|
||||||
|
@ApiModelProperty("反审标记: 0-无 1-已反审(反审时软删del_flag=2并打标记)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
}
|
||||||
|
|||||||
+4
-1
@@ -146,4 +146,7 @@ public class HandoverTaskOrderPO extends BaseVOEntity {
|
|||||||
private List<TaskHandoverMaterialDetailPO> materialDetailList;
|
private List<TaskHandoverMaterialDetailPO> materialDetailList;
|
||||||
@ApiModelProperty("计费信息")
|
@ApiModelProperty("计费信息")
|
||||||
private String billingJson;
|
private String billingJson;
|
||||||
}
|
|
||||||
|
@ApiModelProperty("反审标记: 0-无 1-已反审(反审时软删del_flag=2并打标记)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
}
|
||||||
|
|||||||
+4
-1
@@ -146,4 +146,7 @@ public class HandoverTaskOrderDO extends BaseVOEntity {
|
|||||||
private String pictureApp;
|
private String pictureApp;
|
||||||
|
|
||||||
private String billingJson;
|
private String billingJson;
|
||||||
}
|
|
||||||
|
@ApiModelProperty("反审标记: 1-已反审(查询【已反审】tab时与delFlag=2一起传入)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
}
|
||||||
|
|||||||
+85
@@ -44,6 +44,7 @@ import com.mhd.wms.domain.materialInventory.repository.mapper.MaterialInventoryM
|
|||||||
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryParamDO;
|
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryParamDO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailMapper;
|
import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailMapper;
|
||||||
|
import com.mhd.wms.domain.pickingMaterialDetail.entity.PickingMaterialDetail;
|
||||||
import com.mhd.wms.domain.pickingMaterialDetail.repository.mapper.PickingMaterialDetailMapper;
|
import com.mhd.wms.domain.pickingMaterialDetail.repository.mapper.PickingMaterialDetailMapper;
|
||||||
import com.mhd.wms.domain.pickingMaterialDetail.repository.po.PickingMaterialDetailPO;
|
import com.mhd.wms.domain.pickingMaterialDetail.repository.po.PickingMaterialDetailPO;
|
||||||
import com.mhd.wms.domain.shelfMaterialDetail.repository.todo.ShelfMaterialDetailDO;
|
import com.mhd.wms.domain.shelfMaterialDetail.repository.todo.ShelfMaterialDetailDO;
|
||||||
@@ -242,6 +243,90 @@ public class HandoverTaskOrderDomainService {
|
|||||||
return handoverTaskOrderPO;
|
return handoverTaskOrderPO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取交接作业单归档详情(已反审): 出库单反审时交接单及关联出库明细均已软删(del_flag=2),
|
||||||
|
* 本方法镜像 getInfo 按 del_flag=2 查归档数据, 供交接单【已反审】tab 查看详情。
|
||||||
|
*/
|
||||||
|
public HandoverTaskOrderPO getReverseInfo(Long outTaskOrderId)
|
||||||
|
{
|
||||||
|
HandoverTaskOrderPO handoverTaskOrderPO = handoverTaskOrderService.getInfo(outTaskOrderId);
|
||||||
|
if (handoverTaskOrderPO == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String orderNumber = handoverTaskOrderPO.getOrderNumber();
|
||||||
|
if (orderNumber != null && !orderNumber.trim().isEmpty()) {
|
||||||
|
StockOutOrder stockOutOrder = stockOutOrderMapper.selectOne(new QueryWrapper<StockOutOrder>().lambda()
|
||||||
|
.eq(StockOutOrder::getOutOrderNumber, orderNumber)
|
||||||
|
.eq(StockOutOrder::getDelFlag, 2));
|
||||||
|
Integer review = stockOutOrder != null ? stockOutOrder.getReview() : null;
|
||||||
|
// 归档明细: 出库明细已随反审软删, 按 del_flag=2 查
|
||||||
|
LambdaQueryWrapper<OutMaterialDetail> omdQuery = new QueryWrapper<OutMaterialDetail>().lambda()
|
||||||
|
.eq(OutMaterialDetail::getOutOrderNumber, orderNumber)
|
||||||
|
.eq(OutMaterialDetail::getDelFlag, 2);
|
||||||
|
List<OutMaterialDetail> outMaterialDetailList = outMaterialDetailMapper.selectList(omdQuery);
|
||||||
|
List<TaskHandoverMaterialDetailPO> materialDetailList = new ArrayList<>();
|
||||||
|
for (OutMaterialDetail omd : outMaterialDetailList) {
|
||||||
|
BigDecimal handoverQuantity;
|
||||||
|
BigDecimal pickQty;
|
||||||
|
if (Integer.valueOf(1).equals(review)) {
|
||||||
|
// 需要复核时:仅限复核单上的明细(picking_material_detail 有拣货的 unique_id)
|
||||||
|
List<PickingMaterialDetail> pmdList = pickingMaterialDetailMapper.selectList(new QueryWrapper<PickingMaterialDetail>().lambda()
|
||||||
|
.eq(PickingMaterialDetail::getOutUniqueId, omd.getUniqueId())
|
||||||
|
.eq(PickingMaterialDetail::getDelFlag, 2)
|
||||||
|
.gt(PickingMaterialDetail::getPickingQuantity, BigDecimal.ZERO));
|
||||||
|
if (pmdList == null || pmdList.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (omd.getCheckQuantity() == null || omd.getCheckQuantity().compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PickingMaterialDetailPO pickingSummary = pickingMaterialDetailMapper.queryTotalsByOutNumberAndBaseId(omd.getUniqueId());
|
||||||
|
pickQty = (pickingSummary != null && pickingSummary.getPickingQuantity() != null) ? pickingSummary.getPickingQuantity() : BigDecimal.ZERO;
|
||||||
|
if (pickQty.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
handoverQuantity = omd.getCheckQuantity();
|
||||||
|
} else {
|
||||||
|
BigDecimal qty = omd.getPickingQuantity() != null ? omd.getPickingQuantity() : omd.getQuantity();
|
||||||
|
if (qty == null || qty.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pickQty = qty;
|
||||||
|
handoverQuantity = qty;
|
||||||
|
}
|
||||||
|
TaskHandoverMaterialDetailPO detail = new TaskHandoverMaterialDetailPO();
|
||||||
|
detail.setMaterialDetailId(omd.getMaterialDetailId());
|
||||||
|
detail.setUniqueId(omd.getUniqueId());
|
||||||
|
detail.setTaskNumber(handoverTaskOrderPO.getTaskNumber());
|
||||||
|
detail.setOrganizationId(omd.getOrganizationId());
|
||||||
|
detail.setOrganizationName(omd.getOrganizationName());
|
||||||
|
detail.setTopOrganizationId(omd.getTopOrganizationId());
|
||||||
|
detail.setMaterialBaseInfoId(omd.getMaterialBaseInfoId());
|
||||||
|
detail.setMaterialCode(omd.getMaterialCode() != null ? omd.getMaterialCode() : omd.getMaterialNo());
|
||||||
|
detail.setMaterialName(omd.getMaterialName() != null ? omd.getMaterialName() : omd.getCommodityName());
|
||||||
|
detail.setBarCode(omd.getBarCode());
|
||||||
|
detail.setWeightLimit(omd.getWeightLimit());
|
||||||
|
detail.setVolumeLimit(omd.getVolumeLimit());
|
||||||
|
detail.setQuantity(omd.getQuantity());
|
||||||
|
detail.setPickingQuantity(pickQty);
|
||||||
|
detail.setCheckQuantity(handoverQuantity);
|
||||||
|
detail.setPackId(omd.getPackId());
|
||||||
|
detail.setPackCode(omd.getPackCode());
|
||||||
|
detail.setPackName(omd.getPackName());
|
||||||
|
detail.setPackDetailId(omd.getPackDetailId() != null ? String.valueOf(omd.getPackDetailId()) : null);
|
||||||
|
detail.setUnitCode(omd.getUnitCode());
|
||||||
|
detail.setUnitName(omd.getUnitName());
|
||||||
|
detail.setUnitNumber(omd.getUnitNumber());
|
||||||
|
detail.setMaterialWarehouseControlId(omd.getMaterialWarehouseControlId());
|
||||||
|
detail.setSerialNumberManage(omd.getSerialNumberManage());
|
||||||
|
detail.setRemark(omd.getRemark());
|
||||||
|
materialDetailList.add(detail);
|
||||||
|
}
|
||||||
|
handoverTaskOrderPO.setMaterialDetailList(materialDetailList);
|
||||||
|
}
|
||||||
|
return handoverTaskOrderPO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 分配月台
|
* @description 分配月台
|
||||||
|
|||||||
+12
@@ -2,7 +2,9 @@ package com.mhd.wms.domain.inMaterialDetail.repository.facade;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailBaseDO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailBaseDO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||||
@@ -27,6 +29,16 @@ public interface IInMaterialDetailService extends IService<InMaterialDetail>
|
|||||||
|
|
||||||
public List<InMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
public List<InMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询物料明细列表
|
* 分页查询物料明细列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
+12
@@ -2,7 +2,9 @@ package com.mhd.wms.domain.inMaterialDetail.repository.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||||
@@ -28,6 +30,16 @@ public interface InMaterialDetailMapper extends BaseMapper<InMaterialDetail>
|
|||||||
*/
|
*/
|
||||||
public List<InMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
public List<InMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入库列表页:按入库单号批量取去重后的 Invoice No(仅 level=1)
|
* 入库列表页:按入库单号批量取去重后的 Invoice No(仅 level=1)
|
||||||
*/
|
*/
|
||||||
|
|||||||
+18
@@ -13,7 +13,9 @@ import com.mhd.system.api.model.LoginUser;
|
|||||||
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
import com.mhd.wms.domain.inMaterialDetail.entity.InMaterialDetail;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService;
|
import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.mapper.InMaterialDetailMapper;
|
import com.mhd.wms.domain.inMaterialDetail.repository.mapper.InMaterialDetailMapper;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InStockListMaterialAgg;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailBaseDO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailBaseDO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||||
@@ -72,6 +74,22 @@ public class InMaterialDetailImpl extends ServiceImpl<InMaterialDetailMapper, In
|
|||||||
return inMaterialDetailMapper.queryInOrderList(queryOrderOverStockDO);
|
return inMaterialDetailMapper.queryInOrderList(queryOrderOverStockDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return inMaterialDetailMapper.queryInOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return inMaterialDetailMapper.exportInOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物料明细列表
|
* 查询物料明细列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
+112
@@ -0,0 +1,112 @@
|
|||||||
|
package com.mhd.wms.domain.inMaterialDetail.repository.po;
|
||||||
|
|
||||||
|
import com.mhd.common.core.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细导出专用PO(仅含客户要求的导出列,列顺序即导出顺序;
|
||||||
|
* 火险保费 WMS 库暂无数据来源,先占位导出空列;
|
||||||
|
* 单件净重(KG) 入库明细表无单件净重列,先占位导出空列)
|
||||||
|
*
|
||||||
|
* @author rcx
|
||||||
|
* @date 2026-09-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InMaterialDetailExportPO {
|
||||||
|
|
||||||
|
@Excel(name = "客户编号", sort = 1)
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
|
@Excel(name = "客户名称", sort = 2)
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@Excel(name = "入库单号", sort = 3)
|
||||||
|
private String inOrderNumber;
|
||||||
|
|
||||||
|
@Excel(name = "入库日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 4)
|
||||||
|
private Date warehouseDate;
|
||||||
|
|
||||||
|
@Excel(name = "LOT编号", sort = 5)
|
||||||
|
private String lotNo;
|
||||||
|
|
||||||
|
@Excel(name = "客户预约名称", sort = 6)
|
||||||
|
private String customerOrderNumber;
|
||||||
|
|
||||||
|
@Excel(name = "物料名称", sort = 7)
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Excel(name = "物料编码", sort = 8)
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
@Excel(name = "库存单位", sort = 9)
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@Excel(name = "件数", sort = 10)
|
||||||
|
private BigDecimal pieceCount;
|
||||||
|
|
||||||
|
@Excel(name = "仓库", sort = 11)
|
||||||
|
private String warehouseName;
|
||||||
|
|
||||||
|
@Excel(name = "饮用日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 12)
|
||||||
|
private Date drinkDate;
|
||||||
|
|
||||||
|
@Excel(name = "库位", sort = 13)
|
||||||
|
private String storageLocationName;
|
||||||
|
|
||||||
|
@Excel(name = "单件净重(KG)", sort = 14)
|
||||||
|
private BigDecimal netWeight;
|
||||||
|
|
||||||
|
@Excel(name = "单件体积(CBM)", sort = 15)
|
||||||
|
private BigDecimal singleVolume;
|
||||||
|
|
||||||
|
@Excel(name = "单价", sort = 16)
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
@Excel(name = "总价", sort = 17)
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
@Excel(name = "折扣(%)", sort = 18)
|
||||||
|
private BigDecimal discountRate;
|
||||||
|
|
||||||
|
@Excel(name = "每月仓租", sort = 19)
|
||||||
|
private BigDecimal monthlyWarehouseFee;
|
||||||
|
|
||||||
|
@Excel(name = "半月仓租", sort = 20)
|
||||||
|
private BigDecimal halfMonthWhFee;
|
||||||
|
|
||||||
|
@Excel(name = "合同收费", sort = 21)
|
||||||
|
private BigDecimal contractFee;
|
||||||
|
|
||||||
|
@Excel(name = "火险保费", sort = 22)
|
||||||
|
private BigDecimal fireInsureFee;
|
||||||
|
|
||||||
|
@Excel(name = "备注", sort = 23)
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Excel(name = "货物种类", sort = 24)
|
||||||
|
private String materialClassifyName;
|
||||||
|
|
||||||
|
@Excel(name = "总重量", sort = 25)
|
||||||
|
private BigDecimal totalGrossWeight;
|
||||||
|
|
||||||
|
@Excel(name = "每件保额", sort = 26)
|
||||||
|
private BigDecimal insureAmount;
|
||||||
|
|
||||||
|
@Excel(name = "仓位/库位", sort = 27)
|
||||||
|
private String storageName;
|
||||||
|
|
||||||
|
@Excel(name = "收费标准", sort = 28)
|
||||||
|
private BigDecimal chargeStandard;
|
||||||
|
|
||||||
|
@Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd", sort = 29)
|
||||||
|
private Date expiryDate;
|
||||||
|
|
||||||
|
@Excel(name = "单据状态", sort = 30, readConverterExp = "5=已入库")
|
||||||
|
private Integer inOrderStatus;
|
||||||
|
|
||||||
|
@Excel(name = "业务单据类型", sort = 31)
|
||||||
|
private String orderTypeName;
|
||||||
|
}
|
||||||
+47
@@ -0,0 +1,47 @@
|
|||||||
|
package com.mhd.wms.domain.inMaterialDetail.repository.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.mhd.common.core.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细查询结果(关联入库单,只统计已入库单据)
|
||||||
|
*
|
||||||
|
* @author rcx
|
||||||
|
* @date 2026-09-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InMaterialDetailWithOrderPO extends InMaterialDetailPO {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||||
|
@Excel(name = "入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||||
|
private Integer inOrderStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单状态(与inOrderStatus同值,便于前端按status字段名绑定)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
|
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
|
private Integer inOrderAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("入仓日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date warehouseDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("保额")
|
||||||
|
@Excel(name = "保额")
|
||||||
|
private BigDecimal insureAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("货物类型: 0-物料 1-半成品 2-成品")
|
||||||
|
@Excel(name = "货物类型: 0-物料 1-半成品 2-成品")
|
||||||
|
private Integer goodsType;
|
||||||
|
|
||||||
|
@ApiModelProperty("货物种类(物料分类名称,多个逗号分隔)")
|
||||||
|
private String materialClassifyName;
|
||||||
|
}
|
||||||
+17
@@ -1,8 +1,11 @@
|
|||||||
package com.mhd.wms.domain.inMaterialDetail.service;
|
package com.mhd.wms.domain.inMaterialDetail.service;
|
||||||
|
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService;
|
import com.mhd.wms.domain.inMaterialDetail.repository.facade.IInMaterialDetailService;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.inMaterialDetail.repository.po.InMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||||
|
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -30,6 +33,20 @@ public class InMaterialDetailDomainService {
|
|||||||
return materialDetailService.queryList(inMaterialDetailDO);
|
return materialDetailService.queryList(inMaterialDetailDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细查询(关联入库单,只统计已入库(5)单据)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return materialDetailService.queryInOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库明细导出(专用列集,口径同 queryInOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<InMaterialDetailExportPO> exportInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return materialDetailService.exportInOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增物料明细
|
* 新增物料明细
|
||||||
|
|||||||
+4
-4
@@ -53,8 +53,8 @@ public class InOrderAbnormal extends BaseVOEntity {
|
|||||||
@Excel(name = "上架单号")
|
@Excel(name = "上架单号")
|
||||||
private String shelfOrderNumber;
|
private String shelfOrderNumber;
|
||||||
|
|
||||||
@ApiModelProperty("类型:1-收货 2-上架")
|
@ApiModelProperty("类型:1-收货 2-上架 3-反审")
|
||||||
@Excel(name = "类型:1-收货 2-上架")
|
@Excel(name = "类型:1-收货 2-上架 3-反审")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty("计划数量")
|
@ApiModelProperty("计划数量")
|
||||||
@@ -73,8 +73,8 @@ public class InOrderAbnormal extends BaseVOEntity {
|
|||||||
@Excel(name = "异常数量")
|
@Excel(name = "异常数量")
|
||||||
private BigDecimal abnormalActualQuantity;
|
private BigDecimal abnormalActualQuantity;
|
||||||
|
|
||||||
@ApiModelProperty("异常类型: 1-上架异常 2-收货异常 3-收货异常(允许超收没超出超收比例) 4-收货异常(不允许超收)5-收货异常(允许超收但超出超收比例)")
|
@ApiModelProperty("异常类型: 1-上架异常 2-收货异常 3-收货异常(允许超收没超出超收比例) 4-收货异常(不允许超收)5-收货异常(允许超收但超出超收比例) 6-反审记录")
|
||||||
@Excel(name = "异常类型: 1-上架异常 2-收货异常 3-收货异常", readConverterExp = "允=许超收但不允许超出超收比例")
|
@Excel(name = "异常类型: 1-上架异常 2-收货异常 6-反审记录", readConverterExp = "允=许超收但不允许超出超收比例")
|
||||||
private Integer abnormalType;
|
private Integer abnormalType;
|
||||||
|
|
||||||
@ApiModelProperty("异常原因")
|
@ApiModelProperty("异常原因")
|
||||||
|
|||||||
+7
@@ -51,4 +51,11 @@ public interface IInOrderAbnormalService extends IService<InOrderAbnormal>
|
|||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
Boolean genInOrderAbnormal(InOrderAbnormalBaseDO inOrderAbnormalBaseDO, Integer type);
|
Boolean genInOrderAbnormal(InOrderAbnormalBaseDO inOrderAbnormalBaseDO, Integer type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成入库异常【反审记录】(入库业务单反审时调用,用于记录跟踪)
|
||||||
|
* 单号自动生成(FSYC 前缀,与出库反审记录一致),固定 type=3(反审)、abnormalType=6(反审记录),
|
||||||
|
* 其余字段(inOrderNumber/abnormalReason/quantity/remark/createBy 等)由调用方填充
|
||||||
|
*/
|
||||||
|
Boolean genReverseAuditAbnormal(InOrderAbnormal inOrderAbnormal);
|
||||||
}
|
}
|
||||||
|
|||||||
+25
@@ -174,6 +174,27 @@ public class InOrderAbnormalImpl extends ServiceImpl<InOrderAbnormalMapper, InOr
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成入库异常【反审记录】(入库业务单反审时调用,用于记录跟踪)
|
||||||
|
* 与出库反审记录共用 FSYC 单号前缀;type=3(反审)、abnormalType=6(反审记录)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public Boolean genReverseAuditAbnormal(InOrderAbnormal inOrderAbnormal) {
|
||||||
|
if (inOrderAbnormal == null || !StringUtils.hasText(inOrderAbnormal.getInOrderNumber())) {
|
||||||
|
throw new ServiceException("生成反审记录失败:入库单号为空");
|
||||||
|
}
|
||||||
|
inOrderAbnormal.setAbnormalNumber(OrderSequence.getOrderCode("FSYC"));
|
||||||
|
inOrderAbnormal.setType(3);
|
||||||
|
inOrderAbnormal.setAbnormalType(6);
|
||||||
|
//del_flag 不显式置1时 insert 不含该列,列无默认值则落库为NULL,会被列表的 del_flag=1 过滤掉导致记录永远不可见
|
||||||
|
inOrderAbnormal.setDelFlag(1);
|
||||||
|
if (inOrderAbnormal.getCreateTime() == null) {
|
||||||
|
inOrderAbnormal.setCreateTime(new Date());
|
||||||
|
}
|
||||||
|
return this.save(inOrderAbnormal);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 收货数量与计划数量不符,完成收货会生成收货异常记录
|
* @description 收货数量与计划数量不符,完成收货会生成收货异常记录
|
||||||
* @author ZhouGY
|
* @author ZhouGY
|
||||||
@@ -223,6 +244,8 @@ public class InOrderAbnormalImpl extends ServiceImpl<InOrderAbnormalMapper, InOr
|
|||||||
inOrderAbnormal.setCreateByName(userRealName);
|
inOrderAbnormal.setCreateByName(userRealName);
|
||||||
inOrderAbnormal.setCreateTime(new Date());
|
inOrderAbnormal.setCreateTime(new Date());
|
||||||
inOrderAbnormal.setType(2);
|
inOrderAbnormal.setType(2);
|
||||||
|
//del_flag 不显式置1时 insert 不含该列,列无默认值则落库为NULL,会被列表的 del_flag=1 过滤掉导致记录永远不可见
|
||||||
|
inOrderAbnormal.setDelFlag(1);
|
||||||
inOrderAbnormalList.add(inOrderAbnormal);
|
inOrderAbnormalList.add(inOrderAbnormal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -268,6 +291,8 @@ public class InOrderAbnormalImpl extends ServiceImpl<InOrderAbnormalMapper, InOr
|
|||||||
inOrderAbnormal.setCreateByName(userRealName);
|
inOrderAbnormal.setCreateByName(userRealName);
|
||||||
inOrderAbnormal.setCreateTime(new Date());
|
inOrderAbnormal.setCreateTime(new Date());
|
||||||
inOrderAbnormal.setType(1);
|
inOrderAbnormal.setType(1);
|
||||||
|
//del_flag 不显式置1时 insert 不含该列,列无默认值则落库为NULL,会被列表的 del_flag=1 过滤掉导致记录永远不可见
|
||||||
|
inOrderAbnormal.setDelFlag(1);
|
||||||
inOrderAbnormalList.add(inOrderAbnormal);
|
inOrderAbnormalList.add(inOrderAbnormal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -541,4 +541,7 @@ public class OutMaterialDetail extends BaseVOEntity {
|
|||||||
@ApiModelProperty("出库数量")
|
@ApiModelProperty("出库数量")
|
||||||
@Excel(name = "出库数量")
|
@Excel(name = "出库数量")
|
||||||
private BigDecimal outQuantity;
|
private BigDecimal outQuantity;
|
||||||
}
|
|
||||||
|
@ApiModelProperty("反审标记: 0-无 1-已反审(反审时软删del_flag=2并打标记)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
}
|
||||||
|
|||||||
+12
@@ -3,7 +3,9 @@ package com.mhd.wms.domain.outMaterialDetail.repository.facade;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialCheckPO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialCheckPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailBaseDO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailBaseDO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||||
@@ -32,6 +34,16 @@ public interface IOutMaterialDetailService extends IService<OutMaterialDetail>
|
|||||||
*/
|
*/
|
||||||
public List<OutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
public List<OutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<OutMaterialDetailPO> queryListChildren(OutMaterialDetailDO outMaterialDetailDO);
|
public List<OutMaterialDetailPO> queryListChildren(OutMaterialDetailDO outMaterialDetailDO);
|
||||||
|
|||||||
+12
@@ -2,7 +2,9 @@ package com.mhd.wms.domain.outMaterialDetail.repository.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||||
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||||
@@ -28,6 +30,16 @@ public interface OutMaterialDetailMapper extends BaseMapper<OutMaterialDetail>
|
|||||||
*/
|
*/
|
||||||
public List<OutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
public List<OutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 批量修改指定物料明细分配数量
|
* @description 批量修改指定物料明细分配数量
|
||||||
|
|||||||
+18
@@ -34,7 +34,9 @@ import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
|||||||
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailMapper;
|
import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailMapper;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialCheckPO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialCheckPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutStockListMaterialAgg;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailBaseDO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailBaseDO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||||
@@ -107,6 +109,22 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
|||||||
return outMaterialDetailMapper.queryOutOrderList(queryOrderOverStockDO);
|
return outMaterialDetailMapper.queryOutOrderList(queryOrderOverStockDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return outMaterialDetailMapper.queryOutOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return outMaterialDetailMapper.exportOutOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物料明细列表
|
* 查询物料明细列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
+111
@@ -0,0 +1,111 @@
|
|||||||
|
package com.mhd.wms.domain.outMaterialDetail.repository.po;
|
||||||
|
|
||||||
|
import com.mhd.common.core.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细导出专用PO(仅含客户要求的导出列,列顺序即导出顺序;
|
||||||
|
* 火险保费 WMS 库暂无数据来源,先占位导出空列)
|
||||||
|
*
|
||||||
|
* @author rcx
|
||||||
|
* @date 2026-09-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OutMaterialDetailExportPO {
|
||||||
|
|
||||||
|
@Excel(name = "出库单号", sort = 1)
|
||||||
|
private String outOrderNumber;
|
||||||
|
|
||||||
|
@Excel(name = "出库日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 2)
|
||||||
|
private Date outboundDate;
|
||||||
|
|
||||||
|
@Excel(name = "创建日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 3)
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Excel(name = "客户编号", sort = 4)
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
|
@Excel(name = "客户名称", sort = 5)
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@Excel(name = "LOT编号", sort = 6)
|
||||||
|
private String lotNo;
|
||||||
|
|
||||||
|
@Excel(name = "客户预约名称", sort = 7)
|
||||||
|
private String customerOrderNumber;
|
||||||
|
|
||||||
|
@Excel(name = "物料名称", sort = 8)
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Excel(name = "物料编码", sort = 9)
|
||||||
|
private String materialCode;
|
||||||
|
|
||||||
|
@Excel(name = "库存单位", sort = 10)
|
||||||
|
private String stockUnit;
|
||||||
|
|
||||||
|
@Excel(name = "件数", sort = 11)
|
||||||
|
private BigDecimal pieceCount;
|
||||||
|
|
||||||
|
@Excel(name = "仓库", sort = 12)
|
||||||
|
private String warehouseName;
|
||||||
|
|
||||||
|
@Excel(name = "饮用日期", width = 30, dateFormat = "yyyy-MM-dd", sort = 13)
|
||||||
|
private Date drinkDate;
|
||||||
|
|
||||||
|
@Excel(name = "库位", sort = 14)
|
||||||
|
private String storageLocationName;
|
||||||
|
|
||||||
|
@Excel(name = "单件净重(KG)", sort = 15)
|
||||||
|
private BigDecimal weightLimit;
|
||||||
|
|
||||||
|
@Excel(name = "单件体积(CBM)", sort = 16)
|
||||||
|
private BigDecimal singleVolume;
|
||||||
|
|
||||||
|
@Excel(name = "单价", sort = 17)
|
||||||
|
private BigDecimal unitPrice;
|
||||||
|
|
||||||
|
@Excel(name = "总价", sort = 18)
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
@Excel(name = "折扣(%)", sort = 19)
|
||||||
|
private BigDecimal discountRate;
|
||||||
|
|
||||||
|
@Excel(name = "每月仓租", sort = 20)
|
||||||
|
private BigDecimal monthlyWarehouseFee;
|
||||||
|
|
||||||
|
@Excel(name = "半月仓租", sort = 21)
|
||||||
|
private BigDecimal halfMonthWhFee;
|
||||||
|
|
||||||
|
@Excel(name = "合同收费", sort = 22)
|
||||||
|
private BigDecimal contractFee;
|
||||||
|
|
||||||
|
@Excel(name = "火险保费", sort = 23)
|
||||||
|
private BigDecimal fireInsureFee;
|
||||||
|
|
||||||
|
@Excel(name = "备注", sort = 24)
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Excel(name = "总重量(KG)", sort = 25)
|
||||||
|
private BigDecimal totalGrossWeight;
|
||||||
|
|
||||||
|
@Excel(name = "仓位/库位", sort = 26)
|
||||||
|
private String storageName;
|
||||||
|
|
||||||
|
@Excel(name = "入库单号", sort = 27)
|
||||||
|
private String inOrderNumber;
|
||||||
|
|
||||||
|
@Excel(name = "种类", sort = 28)
|
||||||
|
private String materialClassifyName;
|
||||||
|
|
||||||
|
@Excel(name = "总价值", sort = 29)
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
@Excel(name = "单据状态", sort = 30, readConverterExp = "9=已出库,12=已复核,13=已交接")
|
||||||
|
private Integer outOrderStatus;
|
||||||
|
|
||||||
|
@Excel(name = "业务单据类型", sort = 31)
|
||||||
|
private String orderTypeName;
|
||||||
|
}
|
||||||
+66
@@ -0,0 +1,66 @@
|
|||||||
|
package com.mhd.wms.domain.outMaterialDetail.repository.po;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.mhd.common.core.annotation.Excel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细查询结果(关联出库单,只统计已出库单据)
|
||||||
|
*
|
||||||
|
* @author rcx
|
||||||
|
* @date 2026-09-09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OutMaterialDetailWithOrderPO extends OutMaterialDetailPO {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户id")
|
||||||
|
@Excel(name = "客户id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户编码")
|
||||||
|
@Excel(name = "客户编码")
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户名称")
|
||||||
|
@Excel(name = "客户名称")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接")
|
||||||
|
@Excel(name = "出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接")
|
||||||
|
private Integer outOrderStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单状态(与outOrderStatus同值,便于前端按status字段名绑定)")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("货物种类(物料分类名称,多个逗号分隔)")
|
||||||
|
private String materialClassifyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
|
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||||
|
private Integer outOrderAuditStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("出仓日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date outboundDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("完成时间(出库完成时间,Excel导入/录单时填写)")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date completeTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("保额")
|
||||||
|
@Excel(name = "保额")
|
||||||
|
private BigDecimal insureAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("货物类型: 0-物料 1-半成品 2-成品")
|
||||||
|
@Excel(name = "货物类型: 0-物料 1-半成品 2-成品")
|
||||||
|
private Integer goodsType;
|
||||||
|
}
|
||||||
+17
@@ -1,8 +1,11 @@
|
|||||||
package com.mhd.wms.domain.outMaterialDetail.service;
|
package com.mhd.wms.domain.outMaterialDetail.service;
|
||||||
|
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailExportPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||||
|
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailWithOrderPO;
|
||||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||||
|
import com.mhd.wms.domain.overStock.repository.todo.QueryOrderOverStockDO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -30,6 +33,20 @@ public class OutMaterialDetailDomainService {
|
|||||||
return outMaterialDetailService.queryList(outMaterialDetailDO);
|
return outMaterialDetailService.queryList(outMaterialDetailDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细查询(关联出库单,只统计已出库(9/12/13)单据)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return outMaterialDetailService.queryOutOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库明细导出(专用列集,口径同 queryOutOrderDetailList,不分页)
|
||||||
|
*/
|
||||||
|
public List<OutMaterialDetailExportPO> exportOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||||
|
return outMaterialDetailService.exportOutOrderDetailList(queryOrderOverStockDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增物料明细
|
* 新增物料明细
|
||||||
|
|||||||
+4
-4
@@ -53,8 +53,8 @@ public class OutOrderAbnormal extends BaseVOEntity {
|
|||||||
@Excel(name = "拣货作业单号")
|
@Excel(name = "拣货作业单号")
|
||||||
private String outTaskOrderNumber;
|
private String outTaskOrderNumber;
|
||||||
|
|
||||||
@ApiModelProperty("类型:1-拣货 2-复核")
|
@ApiModelProperty("类型:1-拣货 2-复核 3-反审记录")
|
||||||
@Excel(name = "类型:1-拣货 2-复核")
|
@Excel(name = "类型:1-拣货 2-复核 3-反审记录")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty("计划数量")
|
@ApiModelProperty("计划数量")
|
||||||
@@ -69,8 +69,8 @@ public class OutOrderAbnormal extends BaseVOEntity {
|
|||||||
@Excel(name = "异常数量 = 作业数量 - 计划数量")
|
@Excel(name = "异常数量 = 作业数量 - 计划数量")
|
||||||
private BigDecimal abnormalActualQuantity;
|
private BigDecimal abnormalActualQuantity;
|
||||||
|
|
||||||
@ApiModelProperty("异常类型: 1-拣货异常 2-复核异常")
|
@ApiModelProperty("异常类型: 1-拣货异常 2-复核异常 3-反审记录")
|
||||||
@Excel(name = "异常类型: 1-拣货异常 2-复核异常")
|
@Excel(name = "异常类型: 1-拣货异常 2-复核异常 3-反审记录")
|
||||||
private Integer abnormalType;
|
private Integer abnormalType;
|
||||||
|
|
||||||
@ApiModelProperty("异常原因")
|
@ApiModelProperty("异常原因")
|
||||||
|
|||||||
+4
-4
@@ -53,8 +53,8 @@ public class OutOrderAbnormalPO extends BaseVOEntity {
|
|||||||
@Excel(name = "拣货作业单号")
|
@Excel(name = "拣货作业单号")
|
||||||
private String outTaskOrderNumber;
|
private String outTaskOrderNumber;
|
||||||
|
|
||||||
@ApiModelProperty("类型:1-拣货 2-复核")
|
@ApiModelProperty("类型:1-拣货 2-复核 3-反审记录")
|
||||||
@Excel(name = "类型:1-拣货 2-复核")
|
@Excel(name = "类型:1-拣货 2-复核 3-反审记录")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty("计划数量:拣货异常=分配数量;复核异常=拣货数量")
|
@ApiModelProperty("计划数量:拣货异常=分配数量;复核异常=拣货数量")
|
||||||
@@ -69,8 +69,8 @@ public class OutOrderAbnormalPO extends BaseVOEntity {
|
|||||||
@Excel(name = "异常数量 = 作业数量 - 计划数量")
|
@Excel(name = "异常数量 = 作业数量 - 计划数量")
|
||||||
private BigDecimal abnormalActualQuantity;
|
private BigDecimal abnormalActualQuantity;
|
||||||
|
|
||||||
@ApiModelProperty("异常类型: 1-拣货异常 2-复核异常")
|
@ApiModelProperty("异常类型: 1-拣货异常 2-复核异常 3-反审记录")
|
||||||
@Excel(name = "异常类型: 1-拣货异常 2-复核异常")
|
@Excel(name = "异常类型: 1-拣货异常 2-复核异常 3-反审记录")
|
||||||
private Integer abnormalType;
|
private Integer abnormalType;
|
||||||
|
|
||||||
@ApiModelProperty("异常原因")
|
@ApiModelProperty("异常原因")
|
||||||
|
|||||||
+4
-4
@@ -51,8 +51,8 @@ public class OutOrderAbnormalDO extends BaseVOEntity {
|
|||||||
@Excel(name = "拣货作业单号")
|
@Excel(name = "拣货作业单号")
|
||||||
private String outTaskOrderNumber;
|
private String outTaskOrderNumber;
|
||||||
|
|
||||||
@ApiModelProperty("类型:1-拣货 2-复核")
|
@ApiModelProperty("类型:1-拣货 2-复核 3-反审记录")
|
||||||
@Excel(name = "类型:1-拣货 2-复核")
|
@Excel(name = "类型:1-拣货 2-复核 3-反审记录")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty("计划数量")
|
@ApiModelProperty("计划数量")
|
||||||
@@ -67,8 +67,8 @@ public class OutOrderAbnormalDO extends BaseVOEntity {
|
|||||||
@Excel(name = "异常数量 = 作业数量 - 计划数量")
|
@Excel(name = "异常数量 = 作业数量 - 计划数量")
|
||||||
private BigDecimal abnormalActualQuantity;
|
private BigDecimal abnormalActualQuantity;
|
||||||
|
|
||||||
@ApiModelProperty("异常类型: 1-拣货异常 2-复核异常")
|
@ApiModelProperty("异常类型: 1-拣货异常 2-复核异常 3-反审记录")
|
||||||
@Excel(name = "异常类型: 1-拣货异常 2-复核异常")
|
@Excel(name = "异常类型: 1-拣货异常 2-复核异常 3-反审记录")
|
||||||
private Integer abnormalType;
|
private Integer abnormalType;
|
||||||
|
|
||||||
@ApiModelProperty("异常原因")
|
@ApiModelProperty("异常原因")
|
||||||
|
|||||||
+18
@@ -78,6 +78,12 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
|||||||
@Excel(name = "入库单类型编码")
|
@Excel(name = "入库单类型编码")
|
||||||
private String inOrderTypeCode;
|
private String inOrderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单类型编码(与inOrderTypeCode同义)")
|
||||||
|
private String orderTypeCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("入库单类型名称")
|
||||||
|
private String orderTypeName;
|
||||||
|
|
||||||
@ApiModelProperty("入库单类型名称")
|
@ApiModelProperty("入库单类型名称")
|
||||||
@Excel(name = "入库单类型名称")
|
@Excel(name = "入库单类型名称")
|
||||||
private String inOrderTypeName;
|
private String inOrderTypeName;
|
||||||
@@ -137,4 +143,16 @@ public class QueryOrderOverStockDO extends BaseVOEntity {
|
|||||||
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||||
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
|
||||||
private Integer overStockStatus;
|
private Integer overStockStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际入仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String warehouseDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际入仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String warehouseDateEnd;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际出仓日期 开始(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String outboundDateStart;
|
||||||
|
|
||||||
|
@ApiModelProperty("实际出仓日期 结束(yyyy-MM-dd,为空按建档时间兜底)")
|
||||||
|
private String outboundDateEnd;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -321,4 +321,7 @@ public class PickingMaterialDetail extends BaseVOEntity {
|
|||||||
private String bondInvtNoGw;
|
private String bondInvtNoGw;
|
||||||
private String whNoGw;
|
private String whNoGw;
|
||||||
private String seatNoGw;
|
private String seatNoGw;
|
||||||
}
|
|
||||||
|
@ApiModelProperty("反审标记: 0-无 1-已反审(反审时软删del_flag=2并打标记)")
|
||||||
|
private Integer reverseFlag;
|
||||||
|
}
|
||||||
|
|||||||
+6
@@ -26,6 +26,12 @@ public interface PickingMaterialDetailMapper extends BaseMapper<PickingMaterialD
|
|||||||
|
|
||||||
public PickingMaterialDetailPO queryTotalsByOutNumberAndBaseId(@Param("outUniqueId") Long outUniqueId);
|
public PickingMaterialDetailPO queryTotalsByOutNumberAndBaseId(@Param("outUniqueId") Long outUniqueId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归档汇总(已反审): 同 queryTotalsByOutNumberAndBaseId, 但按 DEL_FLAG=2 统计软删归档的拣货明细,
|
||||||
|
* 供交接单归档详情 getReverseInfo 使用(反审时拣货明细均已软删, 按 del_flag=1 统计恒为0会丢行)
|
||||||
|
*/
|
||||||
|
public PickingMaterialDetailPO queryTotalsByOutNumberAndBaseIdReverse(@Param("outUniqueId") Long outUniqueId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按出库单号汇总拣货完成数量(实际下发/拣货完成的数量)
|
* 按出库单号汇总拣货完成数量(实际下发/拣货完成的数量)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user