Author SHA1 Message Date
zhaoqing 0c71c4e661 fix(oms):出库单号/预约单生成修改,预约确认生成单号修改 2026-07-25 09:43:05 +08:00
zhaoqing 69e54bb2c6 fix(oms):出库单号/预约单生成修改 2026-07-24 18:09:27 +08:00
zhaoqing d268718f9b fix(oms):入库/出库 预约/业务单号生成 2026-07-23 17:53:32 +08:00
王奎兴 fc16c1edf2 发30 2026-07-23 14:54:15 +08:00
王奎兴 4bd655e4da nc推送改造(进行中); 2026-07-23 14:51:14 +08:00
zhaoqing 8681042a32 发测试 2026-07-23 11:47:53 +08:00
高正杨 44c9953875 oms启动报错 2026-07-23 11:00:06 +08:00
zhaoqing c48b8aa39a fix(oms):预约确认后,物料明细查询问题 2026-07-23 10:50:57 +08:00
王奎兴 36b31e5d52 Merge branch 'dev' into dev_crkbh_260721
# Conflicts:
#	mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/persistence/ReservationStockInOrderImpl.java
#	mhd_oms/src/main/resources/bootstrap.yml
2026-07-23 10:44:31 +08:00
秦鸿展 f5c096fe39 发30 2026-07-23 00:39:52 +08:00
秦鸿展 75e77c0476 发31 2026-07-23 00:18:41 +08:00
王奎兴 709b151e3f 参数类型 2026-07-22 22:45:08 +08:00
王奎兴 fa731e1fa5 发30 2026-07-22 22:44:26 +08:00
王奎兴 d1448b2746 发30 2026-07-22 22:42:39 +08:00
王奎兴 32d38b7721 发30 2026-07-22 22:08:21 +08:00
王奎兴 ebc7bee5be 发31 2026-07-22 22:06:05 +08:00
王奎兴 19ca4bbe6c 物料根据组织查询; 2026-07-22 21:53:09 +08:00
王奎兴 2f6988abac 修改预约单更新预约数量 2026-07-22 21:46:28 +08:00
王奎兴 e322e28d05 修改预约单更新预约数量 2026-07-22 21:44:22 +08:00
zhaoqing 9f70b236a0 fix(oms):修改导入的单号 2026-07-22 21:35:29 +08:00
秦鸿展 7dcedab498 委托方导入修改 2026-07-22 21:03:07 +08:00
zhaoqing e2f5896be2 fix(oms):修改预约确认的单号生成 2026-07-22 20:14:19 +08:00
秦鸿展 effa681709 导入修改 2026-07-22 19:01:18 +08:00
秦鸿展 8ea6a82acd 发测试 2026-07-22 16:26:45 +08:00
秦鸿展 e7f2a79dee 委托方导入修改 2026-07-22 14:31:15 +08:00
秦鸿展 8a78122fcb 委托方导入修改以及OMS库存查询调整 2026-07-22 14:10:29 +08:00
zhaoqing 49b3722328 发测试 2026-07-22 13:43:29 +08:00
zhaoqing cb96a3700d 区分预约单和业务单 2026-07-22 11:45:06 +08:00
秦鸿展 9250d03ab1 委托方导入 2026-07-22 11:26:19 +08:00
秦鸿展 494f49ee1b 库存查询按照过期日期来过滤查询 2026-07-22 10:39:34 +08:00
zhaoqing be597775d9 fix(oms):修改预约单 2026-07-21 22:10:27 +08:00
zhaoqing 9eff15e483 fix(oms):修改orderNo 2026-07-21 21:51:33 +08:00
zhaoqing 496548558b fix(oms):出入库预约单单号 2026-07-21 21:20:56 +08:00
zhaoqing 7bd2e0b87c fix(oms):出入库执行单修改 2026-07-21 20:29:38 +08:00
zhaoqing 266d416912 fix(oms):出入库预约确认 2026-07-21 20:00:06 +08:00
zhaoqing f2216adb06 fix(oms):出库执行修改 2026-07-21 19:08:43 +08:00
zhaoqing b825f1a789 fix(oms):入库执行修改 2026-07-21 18:51:53 +08:00
zhaoqing 6177b70b34 feat(oms):出库预约单号 2026-07-21 17:57:35 +08:00
zhaoqing 30dd4abe43 feat(oms):入库预约单号 2026-07-21 17:34:24 +08:00
王奎兴 5dd23e9f42 Merge branch 'dev_jinji' into dev 2026-07-21 16:53:01 +08:00
王奎兴 b4db0a8cdb 修改预约单更新预约数量 2026-07-21 15:42:52 +08:00
49 changed files with 592 additions and 62 deletions
@@ -18,7 +18,7 @@ import java.util.Set;
/** /**
* bms财务结算系统feign调用接口 * bms财务结算系统feign调用接口
*/ */
@FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.102.192.32:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class) @FeignClient(contextId = "BmsService", value = ServiceNameConstants.BMS_SERVICE, url = "http://10.102.192.3:8019",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface BmsServiceFeign { public interface BmsServiceFeign {
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
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.102.192.4: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.102.192.30:8014",configuration = FeignAutoConfiguration.class)
public interface WlhyServiceFeign { public interface WlhyServiceFeign {
/** /**
@@ -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.102.192.3:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface WmsServiceFeign { public interface WmsServiceFeign {
/** /**
@@ -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,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.102.192.33:8018", configuration = FeignAutoConfiguration.class) @FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.102.192.4:8018", configuration = FeignAutoConfiguration.class)
public interface YmsServiceFeign { public interface YmsServiceFeign {
/** /**
@@ -359,6 +359,95 @@ public class UserShipperApplicationService {
return result; return result;
} }
/**
* 从 Excel 导入委托方
* 模版列:登录账号、公司名称、联系人、联系电话、地址、详细地址、备注、结算币种
*/
public com.mhd.common.core.web.domain.AjaxResult importShipperFromExcel(org.springframework.web.multipart.MultipartFile file) {
if (file == null || file.isEmpty()) {
return com.mhd.common.core.web.domain.AjaxResult.error("文件不能为空");
}
try {
org.apache.poi.ss.usermodel.Workbook workbook = org.apache.poi.ss.usermodel.WorkbookFactory.create(file.getInputStream());
org.apache.poi.ss.usermodel.Sheet sheet = workbook.getSheetAt(0);
int total = 0, success = 0, failed = 0;
java.util.List<String> errors = new java.util.ArrayList<>();
for (int i = 1; i <= sheet.getLastRowNum(); i++) {
org.apache.poi.ss.usermodel.Row row = sheet.getRow(i);
if (row == null) continue;
String userAccount = getCellStr(row.getCell(0));
String companyName = getCellStr(row.getCell(1));
if (org.springframework.util.StringUtils.isEmpty(companyName)) continue;
total++;
try {
// 先按公司名称查是否已存在委托方
UserShipperEntity existingShipper = findFirstByShipperEnterpriseNameAcrossOrgs(companyName);
if (existingShipper != null && existingShipper.getShipperId() != null) {
// 已存在:只更新NC客户编码和org_code
appendOrganizationToExistingShipper(existingShipper,
SecurityUtils.getLoginUser().getUserPo().getOrganizationId(),
SecurityUtils.getLoginUser().getUserPo().getOrganizationName(),
userAccount, SecurityUtils.getLoginUser());
success++;
} else {
UserShipperDO shipperDO = new UserShipperDO();
shipperDO.setShipperType(2);
shipperDO.setDataSource(2);
shipperDO.setUserAccount(userAccount);
shipperDO.setShipperEnterpriseName(companyName);
// 登录账号同时作为NC客户编码
shipperDO.setCustomerNcCode(userAccount);
String contactName = getCellStr(row.getCell(2));
String contactPhone = getCellStr(row.getCell(3));
// 联系人 -> user表 user_name + user_shipper表 user_name_shipper
shipperDO.setUserName(contactName);
shipperDO.setUserNameShipper(contactName);
// 联系电话 -> user表 user_phone
shipperDO.setUserPhone(contactPhone);
// 地址 -> user表 user_area_name,详细地址 -> user表 user_area_address
shipperDO.setUserAreaName(getCellStr(row.getCell(4)));
shipperDO.setUserAreaAddress(getCellStr(row.getCell(5)));
shipperDO.setRemark(getCellStr(row.getCell(6)));
shipperDO.setSettlementCurrency(getCellStr(row.getCell(7)));
// 初始化 orgCode:记录当前组织信息和NC客户编码
com.alibaba.fastjson.JSONArray orgCodeArray = new com.alibaba.fastjson.JSONArray();
com.alibaba.fastjson.JSONObject orgItem = new com.alibaba.fastjson.JSONObject();
LoginUser loginUser = SecurityUtils.getLoginUser();
orgItem.put("name", loginUser.getUserPo().getOrganizationName());
orgItem.put("code", loginUser.getUserPo().getOrganizationId());
orgItem.put("ncCustomer", userAccount);
orgItem.put("names", loginUser.getUserPo().getOrganizationId());
orgCodeArray.add(orgItem);
shipperDO.setOrgCode(orgCodeArray.toJSONString());
addShipper(shipperDO);
success++;
}
} catch (Exception e) {
failed++;
errors.add("" + (i + 1) + "行[" + companyName + "]导入失败:" + e.getMessage());
log.error("导入委托方第{}行失败", i + 1, e);
}
}
workbook.close();
java.util.Map<String, Object> result = new java.util.HashMap<>();
result.put("total", total);
result.put("success", success);
result.put("failed", failed);
result.put("errorMessages", errors);
return com.mhd.common.core.web.domain.AjaxResult.success("导入完成", result);
} catch (Exception e) {
log.error("解析Excel失败", e);
return com.mhd.common.core.web.domain.AjaxResult.error("解析Excel失败:" + e.getMessage());
}
}
private String getCellStr(org.apache.poi.ss.usermodel.Cell cell) {
if (cell == null) return null;
cell.setCellType(org.apache.poi.ss.usermodel.CellType.STRING);
String v = cell.getStringCellValue();
return v == null ? null : v.trim();
}
/** /**
* 个人货主认证 * 个人货主认证
* *
@@ -244,6 +244,12 @@ public class UserShipperDO extends UserDO {
@ApiModelProperty("货主/供应商/客户名称") @ApiModelProperty("货主/供应商/客户名称")
private String userNameShipper; private String userNameShipper;
@ApiModelProperty("用户名称")
private String userName;
@ApiModelProperty("用户电话")
private String userPhone;
@ApiModelProperty("联系人") @ApiModelProperty("联系人")
private String emergencyContactName; private String emergencyContactName;
@@ -352,8 +352,20 @@ public class UserShipperAPI extends BaseController {
@PostMapping("/wxGetPhoneNumber") @PostMapping("/wxGetPhoneNumber")
public AjaxResult wxGetPhoneNumber(@RequestBody com.mhd.user.interfaces.dto.wechat.WxPhoneNumberDTO dto) { public AjaxResult wxGetPhoneNumber(@RequestBody com.mhd.user.interfaces.dto.wechat.WxPhoneNumberDTO dto) {
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
Long organizationId = (loginUser != null && loginUser.getUserPo() != null) Long organizationId = (loginUser != null && loginUser.getUserPo() != null)
? loginUser.getUserPo().getOrganizationId() : null; ? loginUser.getUserPo().getOrganizationId() : null;
return wechatMiniAppService.wxGetPhoneNumber(dto, organizationId); return wechatMiniAppService.wxGetPhoneNumber(dto, organizationId);
} }
@Log(title = "托运人管理-导入", description = "从Excel导入委托方", businessType = BusinessType.IMPORT)
@ApiOperation("导入委托方(Excel批量)")
@PostMapping("/import")
public AjaxResult importShipper(@RequestParam("file") org.springframework.web.multipart.MultipartFile file) {
try {
return userShipperApplicationService.importShipperFromExcel(file);
} catch (Exception e) {
log.error("导入委托方失败", e);
return AjaxResult.error("导入失败:" + e.getMessage());
}
}
} }
@@ -20,15 +20,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.30:6848 server-addr: 10.102.192.30: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.30:6848 server-addr: 10.102.192.30:6848
username: nacos username: nacos
password: manhuoda@2023 password: manhuoda@2023
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置 group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
@@ -75,7 +75,9 @@
AND b.del_flag = 1 AND b.del_flag = 1
</sql> </sql>
<sql id="selectShipperVo1"> <sql id="selectShipperVo1">
SELECT b.shipper_id, SELECT b.area,
b.detail_address,
b.shipper_id,
a.user_id, a.user_id,
b.parent_shipper_id, b.parent_shipper_id,
b.shipper_type, b.shipper_type,
+2 -2
View File
@@ -19,14 +19,14 @@ spring:
# 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.30: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.30:6848
username: nacos username: nacos
password: manhuoda@2023 password: manhuoda@2023
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置 group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
@@ -68,4 +68,5 @@ public interface ExecutionStockInOrderMapper extends BaseMapper<ExecutionStockIn
String getNcUrl(@Param("interfaceType") String interfaceType,@Param("organizationName") String organizationName,@Param("organizationId") Long organizationId); String getNcUrl(@Param("interfaceType") String interfaceType,@Param("organizationName") String organizationName,@Param("organizationId") Long organizationId);
int countByOrderNumberPrefix(@Param("prefix") String prefix);
} }
@@ -37,4 +37,5 @@ public interface ExecutionStockOutOrderMapper extends BaseMapper<ExecutionStockO
public void delWOrderDetail(@Param("outOrderNumber") String outOrderNumber); public void delWOrderDetail(@Param("outOrderNumber") String outOrderNumber);
int countByOrderNumberPrefix(@Param("prefix") String prefix);
} }
@@ -29,6 +29,8 @@ public interface ReservationMaterialInventoryMapper extends BaseMapper<Reservati
public List<ReservationMaterialInventoryPO> queryListByWl(ReservationMaterialInventoryDO materialInventoryDO); public List<ReservationMaterialInventoryPO> queryListByWl(ReservationMaterialInventoryDO materialInventoryDO);
//查物料库存列表-货主 //查物料库存列表-货主
public List<ReservationMaterialInventoryPO> queryListByHz(ReservationMaterialInventoryDO materialInventoryDO); public List<ReservationMaterialInventoryPO> queryListByHz(ReservationMaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料+过期日期
public List<ReservationMaterialInventoryPO> queryListByWlExpiry(ReservationMaterialInventoryDO materialInventoryDO);
public MaterialBaseInfo getByInfoId(@Param("id") Long id); public MaterialBaseInfo getByInfoId(@Param("id") Long id);
@@ -64,6 +64,8 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl<ReservationMat
return materialInventoryMapper.queryListByKw(materialInventoryDO); return materialInventoryMapper.queryListByKw(materialInventoryDO);
} else if ("wlkw".equals(queryRule)) { } else if ("wlkw".equals(queryRule)) {
return materialInventoryMapper.queryListByWlKw(materialInventoryDO); return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
} else if ("wlExpiry".equals(queryRule)) {
return materialInventoryMapper.queryListByWlExpiry(materialInventoryDO);
} else if ("all".equals(queryRule)) { } else if ("all".equals(queryRule)) {
return materialInventoryMapper.queryList(materialInventoryDO); return materialInventoryMapper.queryList(materialInventoryDO);
} else { } else {
@@ -253,4 +253,6 @@ public class ReservationMaterialInventoryDO extends MaterialBaseDO {
private String createTimeEnd; private String createTimeEnd;
private String expiryDateStr; private String expiryDateStr;
private String productionDateStr; private String productionDateStr;
private String expiryDateStart;
private String expiryDateEnd;
} }
@@ -2,6 +2,7 @@ package com.mhd.oms.domain.reservationStockInOrder.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO; import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO;
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder; import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder;
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.po.MaterialGoodsRulePO; import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO;
@@ -30,13 +31,16 @@ public interface ReservationStockInOrderMapper extends BaseMapper<ReservationSto
public MaterialBaseInfoPO getByName(@Param("name") String name); public MaterialBaseInfoPO getByName(@Param("name") String name);
public MaterialBaseInfoPO getByCode(@Param("code") String code); public MaterialBaseInfoPO getByCode(@Param("code") String code,@Param("orgId") Long orgId);
public List<MaterialBaseInfoPO> getMaterialBaseInfoList(@Param("id") String id); public List<MaterialBaseInfoPO> getMaterialBaseInfoList(@Param("id") String id);
public List<ReservationMaterialInventoryPO> getkcId(@Param("id") Long id,@Param("q") BigDecimal q);
public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id); public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id);
public MaterialGoodsRulePO getGoodsInfoByMaterialBaseInfoIds(@Param("id") Long id); public MaterialGoodsRulePO getGoodsInfoByMaterialBaseInfoIds(@Param("id") Long id);
// public List<ReservationMaterialInventoryPO> getkcId(@Param("id") Long id, @Param("q") BigDecimal q);
public String getUserNcCode(@Param("id") Long id); public String getUserNcCode(@Param("id") Long id);
@@ -67,4 +71,8 @@ public interface ReservationStockInOrderMapper extends BaseMapper<ReservationSto
String getNcUrl(@Param("interfaceType") String interfaceType,@Param("organizationName") String organizationName,@Param("organizationId") Long organizationId); String getNcUrl(@Param("interfaceType") String interfaceType,@Param("organizationName") String organizationName,@Param("organizationId") Long organizationId);
String getCustomerOrgCode(@Param("id") Long id); String getCustomerOrgCode(@Param("id") Long id);
int countByOrderNumberPrefix(@Param("prefix") String prefix);
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
} }
@@ -20,6 +20,7 @@ import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.facade.IRese
import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReservationInMaterialDetailService; import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReservationInMaterialDetailService;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO; import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReservationInMaterialDetailDO; import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReservationInMaterialDetailDO;
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
import com.mhd.oms.domain.reservationOutMaterialDetail.repository.facade.IReservationOutMaterialDetailService; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.facade.IReservationOutMaterialDetailService;
import com.mhd.oms.domain.reservationOutMaterialDetail.repository.todo.ReservationOutMaterialDetailDO; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.todo.ReservationOutMaterialDetailDO;
import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder; import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder;
@@ -32,6 +33,7 @@ import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfo
import com.mhd.oms.domain.reservationStockInOrder.repository.po.ReservationStockInOrderPO; import com.mhd.oms.domain.reservationStockInOrder.repository.po.ReservationStockInOrderPO;
import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO; import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO;
import com.mhd.oms.domain.reservationStockInOrder.repository.vo.*; import com.mhd.oms.domain.reservationStockInOrder.repository.vo.*;
import com.mhd.oms.domain.reservationStockInOrder.service.ReservationStockInOrderDomainService;
import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder; import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder;
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;
@@ -83,6 +85,8 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
private SystemServiceFeign systemServiceFeign; private SystemServiceFeign systemServiceFeign;
@Autowired @Autowired
private IReservationInMaterialDetailService materialDetailService; private IReservationInMaterialDetailService materialDetailService;
@Autowired
private ReservationStockInOrderDomainService reservationStockInOrderDomainService;
/** /**
* 查询入库单列表 * 查询入库单列表
@@ -192,7 +196,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
List<Map<String,Object>> shipperIds = new ArrayList<>(); List<Map<String,Object>> shipperIds = new ArrayList<>();
Set<Long> processedShipperIds = new HashSet<>(); Set<Long> processedShipperIds = new HashSet<>();
for (ProductDetail productDetail : productDetailList) { for (ProductDetail productDetail : productDetailList) {
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode()); MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode(),loginUser.getUserPo().getOrganizationId());
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) { if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
Long shipperId = materialBaseInfoPO.getShipperId(); Long shipperId = materialBaseInfoPO.getShipperId();
if (processedShipperIds.add(shipperId)) { if (processedShipperIds.add(shipperId)) {
@@ -216,7 +220,10 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
} }
ReservationStockOutOrderDO reservationStockOutOrderDO = new ReservationStockOutOrderDO(); ReservationStockOutOrderDO reservationStockOutOrderDO = new ReservationStockOutOrderDO();
reservationStockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK")); // 生成出库业务单号
String orderNumber = reservationStockOutOrderApplicationService.generateReserveOrderNumber1();
reservationStockOutOrderDO.setOutOrderNumber(orderNumber);
reservationStockOutOrderDO.setBusinessOrderNo(orderNumber);
// 货主信息有货品明细时从解析结果取无货品明细时从登录用户取 // 货主信息有货品明细时从解析结果取无货品明细时从登录用户取
if (!shipperIds.isEmpty()) { if (!shipperIds.isEmpty()) {
reservationStockOutOrderDO.setShipperId((Long) shipperIds.get(0).get("shipperId")); reservationStockOutOrderDO.setShipperId((Long) shipperIds.get(0).get("shipperId"));
@@ -254,9 +261,22 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
for (ProductDetail productDetail : productDetailList) { for (ProductDetail productDetail : productDetailList) {
ReservationOutMaterialDetailDO reservationOutMaterialDetailDO = new ReservationOutMaterialDetailDO(); ReservationOutMaterialDetailDO reservationOutMaterialDetailDO = new ReservationOutMaterialDetailDO();
reservationOutMaterialDetailDO.setOutOrderNumber(reservationStockOutOrderDO.getOutOrderNumber()); reservationOutMaterialDetailDO.setOutOrderNumber(reservationStockOutOrderDO.getOutOrderNumber());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode()); MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode(),loginUser.getUserPo().getOrganizationId());
reservationOutMaterialDetailDO.setQuantity(new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP)); reservationOutMaterialDetailDO.setQuantity(new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP));
if (materialBaseInfoPO != null) { if (materialBaseInfoPO != null) {
Long materialBaseInfoId = materialBaseInfoPO.getMaterialBaseInfoId();
List<ReservationMaterialInventoryPO> reservationMaterialInventoryPOS = stockInOrderMapper.getkcId(materialBaseInfoId, new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP));
if (reservationMaterialInventoryPOS != null&&reservationMaterialInventoryPOS.size() > 0) {
ReservationMaterialInventoryPO reservationMaterialInventoryPO = reservationMaterialInventoryPOS.get(0);
Long materialInventoryId = reservationMaterialInventoryPO.getMaterialInventoryId();
String batchNumber = reservationMaterialInventoryPO.getBatchNumber();
String lotNumber = reservationMaterialInventoryPO.getLotNumber();
reservationOutMaterialDetailDO.setMaterialInventoryId(materialInventoryId);
reservationOutMaterialDetailDO.setBatchNumber(batchNumber);
reservationOutMaterialDetailDO.setLotNo(lotNumber);
} else {
throw new RuntimeException("物料批次库存数量少于出库数量!");
}
reservationOutMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId()); reservationOutMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
reservationOutMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode()); reservationOutMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
reservationOutMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName()); reservationOutMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
@@ -360,7 +380,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
List<Map<String,Object>> shipperIds = new ArrayList<>(); List<Map<String,Object>> shipperIds = new ArrayList<>();
Set<Long> processedShipperIds = new HashSet<>(); Set<Long> processedShipperIds = new HashSet<>();
for (StockInProductDetail productDetail : productDetailList) { for (StockInProductDetail productDetail : productDetailList) {
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode()); MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode(),loginUser.getUserPo().getOrganizationId());
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) { if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
Long shipperId = materialBaseInfoPO.getShipperId(); Long shipperId = materialBaseInfoPO.getShipperId();
if (processedShipperIds.add(shipperId)) { if (processedShipperIds.add(shipperId)) {
@@ -373,7 +393,10 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
} }
} }
ReservationStockInOrderDO reservationStockInOrderDO = new ReservationStockInOrderDO(); ReservationStockInOrderDO reservationStockInOrderDO = new ReservationStockInOrderDO();
reservationStockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK")); // 生成业务单号
String orderNumber = reservationStockInOrderDomainService.generateReserveOrderNumber1();
reservationStockInOrderDO.setInOrderNumber(orderNumber);
reservationStockInOrderDO.setBusinessOrderNo(orderNumber);
reservationStockInOrderDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); reservationStockInOrderDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
reservationStockInOrderDO.setOrganizationName(loginUser.getUserPo().getOrganizationName()); reservationStockInOrderDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
reservationStockInOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); reservationStockInOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
@@ -399,7 +422,6 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
reservationStockInOrderDO.setWarehouseDate(stockInHeader.getStockInDate()); reservationStockInOrderDO.setWarehouseDate(stockInHeader.getStockInDate());
reservationStockInOrderDO.setStorageTime(stockInHeader.getStockInDate()); reservationStockInOrderDO.setStorageTime(stockInHeader.getStockInDate());
reservationStockInOrderDO.setExpectTime(stockInHeader.getStockInDate()); reservationStockInOrderDO.setExpectTime(stockInHeader.getStockInDate());
reservationStockInOrderDO.setBusinessOrderNo(stockInHeader.getOrderNo());
reservationStockInOrderDO.setReservationOrderSource("数据导入"); reservationStockInOrderDO.setReservationOrderSource("数据导入");
List<ReservationInMaterialDetailDO> reservationInMaterialDetailDOList = new ArrayList<>(); List<ReservationInMaterialDetailDO> reservationInMaterialDetailDOList = new ArrayList<>();
int index = 1; int index = 1;
@@ -412,7 +434,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
reservationInMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId()); reservationInMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId());
reservationInMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName()); reservationInMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName());
reservationInMaterialDetailDO.setCreateTime(new Date()); reservationInMaterialDetailDO.setCreateTime(new Date());
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(stockInProductDetail.getProductCode()); MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(stockInProductDetail.getProductCode(),loginUser.getUserPo().getOrganizationId());
reservationInMaterialDetailDO.setQuantity(new BigDecimal(stockInProductDetail.getBoxCount()).setScale(2, BigDecimal.ROUND_HALF_UP)); reservationInMaterialDetailDO.setQuantity(new BigDecimal(stockInProductDetail.getBoxCount()).setScale(2, BigDecimal.ROUND_HALF_UP));
if (materialBaseInfoPO != null) { if (materialBaseInfoPO != null) {
reservationInMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId()); reservationInMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
@@ -469,7 +491,8 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insertDomain(ReservationStockInOrderDO stockInOrderDO) { public Boolean insertDomain(ReservationStockInOrderDO stockInOrderDO) {
if (stockInOrderDO.getInOrderNumber() == null) { if (stockInOrderDO.getInOrderNumber() == null) {
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK")); stockInOrderDO.setInOrderNumber(reservationStockInOrderDomainService.generateReserveOrderNumber1());
stockInOrderDO.setBusinessOrderNo(stockInOrderDO.getInOrderNumber());
} }
// //统计总计划数 // //统计总计划数
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReservationInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReservationInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
@@ -2286,4 +2286,11 @@ public class ReservationStockInOrderApplicationService {
return filteredList; return filteredList;
} }
public String generateReserveOrderNumber() {
return stockInOrderDomainService.generateReserveOrderNumber();
}
public String generateReserveOrderNumber1() {
return stockInOrderDomainService.generateReserveOrderNumber1();
}
} }
@@ -17,6 +17,7 @@ import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDe
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;
import com.mhd.oms.domain.executionStockInOrder.repository.facade.IExecutionStockInOrderService; import com.mhd.oms.domain.executionStockInOrder.repository.facade.IExecutionStockInOrderService;
import com.mhd.oms.domain.executionStockInOrder.repository.mapper.ExecutionStockInOrderMapper;
import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockInOrderDO; import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockInOrderDO;
import com.mhd.oms.domain.executionStockInOrder.service.ExecutionStockInOrderApplicationService; import com.mhd.oms.domain.executionStockInOrder.service.ExecutionStockInOrderApplicationService;
import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail; import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail;
@@ -37,6 +38,7 @@ import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrd
import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService; import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService;
import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail; import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
import com.mhd.oms.domain.reserveStockInOrder.entity.ReserveStockInOrder; import com.mhd.oms.domain.reserveStockInOrder.entity.ReserveStockInOrder;
import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper;
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.domain.*; import com.mhd.system.api.domain.*;
@@ -85,6 +87,10 @@ public class ReservationStockInOrderDomainService {
private ExecutionStockInOrderApplicationService stockInOrderApplicationService; private ExecutionStockInOrderApplicationService stockInOrderApplicationService;
@Autowired @Autowired
private BusinessDocumentOrderMapper businessDocumentOrderMapper; private BusinessDocumentOrderMapper businessDocumentOrderMapper;
@Autowired
private ExecutionStockInOrderMapper executionStockInOrderMapper;
@Autowired
private ReserveStockInOrderMapper reserveStockInOrderMapper;
/** /**
* 分页查询入库单列表 * 分页查询入库单列表
@@ -100,7 +106,8 @@ public class ReservationStockInOrderDomainService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insert(ReservationStockInOrderDO stockInOrderDO) { public Boolean insert(ReservationStockInOrderDO stockInOrderDO) {
if (stockInOrderDO.getInOrderNumber() == null) { if (stockInOrderDO.getInOrderNumber() == null) {
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK")); stockInOrderDO.setInOrderNumber(generateReserveOrderNumber1());
stockInOrderDO.setBusinessOrderNo(stockInOrderDO.getInOrderNumber());
} }
// //设置默认值 // //设置默认值
// setDefaultValues(stockInOrderDO); // setDefaultValues(stockInOrderDO);
@@ -534,11 +541,7 @@ public class ReservationStockInOrderDomainService {
reservationStockInOrder.setWarehouseCode(warehouseCode); reservationStockInOrder.setWarehouseCode(warehouseCode);
reservationStockInOrder.setWarehouseName(warehouseName); reservationStockInOrder.setWarehouseName(warehouseName);
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber); reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) { reservationStockInOrder.setInOrderNumber(generateExecutionOrderNumber(warehouseCode));
reservationStockInOrder.setInOrderNumber(OrderSequence.getOrderCode("RK"));
} else {
reservationStockInOrder.setInOrderNumber(inOrderNumber);
}
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>(); List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
int index = 1; int index = 1;
@@ -691,11 +694,7 @@ public class ReservationStockInOrderDomainService {
reservationStockInOrder.setWarehouseCode(warehouseCode); reservationStockInOrder.setWarehouseCode(warehouseCode);
reservationStockInOrder.setWarehouseName(warehouseName); reservationStockInOrder.setWarehouseName(warehouseName);
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber); reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) { reservationStockInOrder.setInOrderNumber(generateExecutionOrderNumber(warehouseCode));
reservationStockInOrder.setInOrderNumber(OrderSequence.getOrderCode("RK"));
} else {
reservationStockInOrder.setInOrderNumber(inOrderNumber);
}
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>(); List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
int index = 1; int index = 1;
@@ -1212,4 +1211,49 @@ public class ReservationStockInOrderDomainService {
return stockInOrderService.queryNoticePrintDetail(stockInOrderDO); return stockInOrderService.queryNoticePrintDetail(stockInOrderDO);
} }
/**
* 生成执行入库单号仓库代码简称 + YYMMDD + 当日累加3位不足补零
*/
public String generateExecutionOrderNumber(String warehouseCode) {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "R" + warehouseCode + datePart;
int todayCount = executionStockInOrderMapper.countByOrderNumberPrefix(prefix);
String seq = String.format("%03d", todayCount + 1);
return prefix + seq;
}
/**
* 生成入库预约单号
*/
public String generateReserveOrderNumber() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "R" + datePart;
int todayCount = reservationStockInOrderMapper.countByOrderNumberPrefix(prefix);
String seq = String.format("%03d", todayCount + 1);
return prefix + seq;
}
public String generateReserveOrderNumber1() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "R" + datePart;
List<String> orderNumber1 = reservationStockInOrderMapper.generateReserveOrderNumber1(prefix);
List<String> orderNumber2 = reserveStockInOrderMapper.generateReserveOrderNumber1(prefix);
List<String> allOrders = new ArrayList<>();
allOrders.addAll(orderNumber1);
allOrders.addAll(orderNumber2);
int maxseq = 0;
for(String order:allOrders)
{
String numStr = order.substring(prefix.length());
int num = Integer.parseInt(numStr);
if(num > maxseq){
maxseq = num;
}
}
String seq = String.format("%03d", maxseq + 1);
return prefix + seq;
}
} }
@@ -37,4 +37,8 @@ public interface ReservationStockOutOrderMapper extends BaseMapper<ReservationSt
List<ReservationOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReservationStockOutOrderDO stockOutOrderDO); List<ReservationOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReservationStockOutOrderDO stockOutOrderDO);
Long queryShipperId(@Param("userMemberCode") String userMemberCode,@Param("organizationId") Long organizationId); Long queryShipperId(@Param("userMemberCode") String userMemberCode,@Param("organizationId") Long organizationId);
int countByOrderNumberPrefix(@Param("prefix") String prefix);
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
} }
@@ -1743,4 +1743,11 @@ public class ReservationStockOutOrderApplicationService {
return filteredList; return filteredList;
} }
public String generateReserveOrderNumber() {
return stockOutOrderDomainService.generateReserveOrderNumber();
}
public String generateReserveOrderNumber1() {
return stockOutOrderDomainService.generateReserveOrderNumber1();
}
} }
@@ -27,6 +27,7 @@ import com.mhd.oms.domain.executionOutMaterialDetail.repository.facade.IExecutio
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder; import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder; import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder;
import com.mhd.oms.domain.executionStockOutOrder.repository.facade.IExecutionStockOutOrderService; import com.mhd.oms.domain.executionStockOutOrder.repository.facade.IExecutionStockOutOrderService;
import com.mhd.oms.domain.executionStockOutOrder.repository.mapper.ExecutionStockOutOrderMapper;
import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderDO; import com.mhd.oms.domain.executionStockOutOrder.repository.todo.ExecutionStockOutOrderDO;
import com.mhd.oms.domain.executionStockOutOrder.service.ExecutionStockOutOrderApplicationService; import com.mhd.oms.domain.executionStockOutOrder.service.ExecutionStockOutOrderApplicationService;
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink; import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
@@ -47,8 +48,10 @@ import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfo
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.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.po.ReservationStockOutOrderPO; import com.mhd.oms.domain.reservationStockOutOrder.repository.po.ReservationStockOutOrderPO;
import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ReservationStockOutOrderDO; import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ReservationStockOutOrderDO;
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.domain.*; import com.mhd.system.api.domain.*;
@@ -62,6 +65,7 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -95,6 +99,8 @@ public class ReservationStockOutOrderDomainService {
private ExecuteOrderMapper executeOrderMapper; private ExecuteOrderMapper executeOrderMapper;
@Autowired @Autowired
private ExecutionStockOutOrderApplicationService stockOutOrderApplicationService; private ExecutionStockOutOrderApplicationService stockOutOrderApplicationService;
@Autowired
private ExecutionStockOutOrderMapper executionStockOutOrderMapper;
@Resource @Resource
private SystemServiceFeign systemServiceFeign; private SystemServiceFeign systemServiceFeign;
@Resource @Resource
@@ -105,6 +111,10 @@ public class ReservationStockOutOrderDomainService {
private IBusinessDeliveryDetailsLinkService businessDeliveryDetailsLinkService; private IBusinessDeliveryDetailsLinkService businessDeliveryDetailsLinkService;
@Autowired @Autowired
private BusinessDeliveryDetailsLinkMapper businessDeliveryDetailsLinkMapper; private BusinessDeliveryDetailsLinkMapper businessDeliveryDetailsLinkMapper;
@Autowired
private ReservationStockOutOrderMapper reservationStockOutOrderMapper;
@Autowired
private ReserveStockOutOrderMapper reserveStockOutOrderMapper;
/** /**
* 分页查询出库单列表 * 分页查询出库单列表
@@ -120,7 +130,8 @@ public class ReservationStockOutOrderDomainService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insert(ReservationStockOutOrderDO stockOutOrderDO) { public Boolean insert(ReservationStockOutOrderDO stockOutOrderDO) {
if (stockOutOrderDO.getOutOrderNumber() == null) { if (stockOutOrderDO.getOutOrderNumber() == null) {
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK")); stockOutOrderDO.setOutOrderNumber(generateReserveOrderNumber1());
stockOutOrderDO.setBusinessOrderNo(stockOutOrderDO.getOutOrderNumber());
} }
// update / batchInsert 一致前端传计划数量为 quantity outboundQuantity // update / batchInsert 一致前端传计划数量为 quantity outboundQuantity
setMaterialDetailInfo(stockOutOrderDO); setMaterialDetailInfo(stockOutOrderDO);
@@ -385,11 +396,8 @@ public class ReservationStockOutOrderDomainService {
// reservationStockInOrder.setTopOrganizationId(topOrgId); // reservationStockInOrder.setTopOrganizationId(topOrgId);
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber); reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) { reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
reservationStockInOrder.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
} else {
reservationStockInOrder.setOutOrderNumber(inOrderNumber);
}
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>(); List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) { for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) {
@@ -513,11 +521,7 @@ public class ReservationStockOutOrderDomainService {
reservationStockInOrder.setWarehouseCode(warehouseCode); reservationStockInOrder.setWarehouseCode(warehouseCode);
reservationStockInOrder.setWarehouseName(warehouseName); reservationStockInOrder.setWarehouseName(warehouseName);
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber); reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) { reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
reservationStockInOrder.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
} else {
reservationStockInOrder.setOutOrderNumber(inOrderNumber);
}
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>(); List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) { for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) {
@@ -1051,4 +1055,49 @@ public class ReservationStockOutOrderDomainService {
} }
} }
/**
* 生成执行出库单号仓库代码简称 + YYMMDD + 当日累加3位不足补零
*/
public String generateExecutionOrderNumber(String warehouseCode) {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "C" + warehouseCode + datePart;
int todayCount = executionStockOutOrderMapper.countByOrderNumberPrefix(prefix);
String seq = String.format("%03d", todayCount + 1);
return prefix + seq;
}
/**
* 生成出库预约单号
*/
public String generateReserveOrderNumber() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "C" + datePart;
int todayCount = reservationStockOutOrderMapper.countByOrderNumberPrefix(prefix);
String seq = String.format("%03d", todayCount + 1);
return prefix + seq;
}
public String generateReserveOrderNumber1() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "C" + datePart;
List<String> orderNumber1 = reservationStockOutOrderMapper.generateReserveOrderNumber1(prefix);
List<String> orderNumber2 = reserveStockOutOrderMapper.generateReserveOrderNumber1(prefix);
List<String> allOrders = new ArrayList<>();
allOrders.addAll(orderNumber1);
allOrders.addAll(orderNumber2);
int maxseq = 0;
for(String order:allOrders)
{
String numStr = order.substring(prefix.length());
int num = Integer.parseInt(numStr);
if(num > maxseq){
maxseq = num;
}
}
String seq = String.format("%03d", maxseq + 1);
return prefix + seq;
}
} }
@@ -46,4 +46,8 @@ public interface ReserveStockInOrderMapper extends BaseMapper<ReserveStockInOrde
List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO); List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO);
public String getJsbz(@Param("id") Long id); public String getJsbz(@Param("id") Long id);
int countByOrderNumberPrefix(@Param("prefix") String prefix);
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
} }
@@ -2066,4 +2066,8 @@ public class ReserveStockInOrderApplicationService {
// 3. 拼接结果 // 3. 拼接结果
return datePart + randomPart; return datePart + randomPart;
} }
public String generateReserveOrderNumber() {
return stockInOrderDomainService.generateReserveOrderNumber();
}
} }
@@ -18,6 +18,7 @@ import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReserva
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO; import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder; import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder;
import com.mhd.oms.domain.reservationStockInOrder.repository.facade.IReservationStockInOrderService; import com.mhd.oms.domain.reservationStockInOrder.repository.facade.IReservationStockInOrderService;
import com.mhd.oms.domain.reservationStockInOrder.service.ReservationStockInOrderDomainService;
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.po.MaterialGoodsRulePO; import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO; import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO;
@@ -78,6 +79,8 @@ public class ReserveStockInOrderDomainService {
private IReservationStockInOrderService reservationStockInOrderService; private IReservationStockInOrderService reservationStockInOrderService;
@Autowired @Autowired
private IReservationInMaterialDetailService reservationInMaterialDetailService; private IReservationInMaterialDetailService reservationInMaterialDetailService;
@Autowired
private ReservationStockInOrderDomainService reservationStockInOrderDomainService;
/** /**
* 分页查询入库单列表 * 分页查询入库单列表
@@ -101,7 +104,7 @@ public class ReserveStockInOrderDomainService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insert(ReserveStockInOrderDO stockInOrderDO) { public Boolean insert(ReserveStockInOrderDO stockInOrderDO) {
if (stockInOrderDO.getInOrderNumber() == null) { if (stockInOrderDO.getInOrderNumber() == null) {
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK")); stockInOrderDO.setInOrderNumber(reservationStockInOrderDomainService.generateReserveOrderNumber1());
} }
// //设置默认值 // //设置默认值
// setDefaultValues(stockInOrderDO); // setDefaultValues(stockInOrderDO);
@@ -134,7 +137,7 @@ public class ReserveStockInOrderDomainService {
public Boolean batchInsert(List<ReserveStockInOrderDO> stockInOrderDOList) { public Boolean batchInsert(List<ReserveStockInOrderDO> stockInOrderDOList) {
for (ReserveStockInOrderDO stockInOrderDO : stockInOrderDOList){ for (ReserveStockInOrderDO stockInOrderDO : stockInOrderDOList){
if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){ if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK")); stockInOrderDO.setInOrderNumber(reservationStockInOrderDomainService.generateReserveOrderNumber1());
} }
// //设置物料信息 // //设置物料信息
// setMaterialDetailInfo(stockInOrderDO); // setMaterialDetailInfo(stockInOrderDO);
@@ -176,6 +179,10 @@ public class ReserveStockInOrderDomainService {
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderPO.setQuantity(quantity); stockInOrderPO.setQuantity(quantity);
stockInOrderDO.setQuantity(quantity); stockInOrderDO.setQuantity(quantity);
//统计预约数量
BigDecimal reserceQuantity = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getReserveQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderPO.setReserveQuantity(reserceQuantity);
stockInOrderDO.setReserveQuantity(reserceQuantity);
//统计总重量 //统计总重量
BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderDO.setWeightLimit(weightLimit); stockInOrderDO.setWeightLimit(weightLimit);
@@ -467,13 +474,17 @@ public class ReserveStockInOrderDomainService {
Long shipperId = reservationStockInOrder.getShipperId(); Long shipperId = reservationStockInOrder.getShipperId();
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId); String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
reservationStockInOrder.setSettlementCurrency(jsbz); reservationStockInOrder.setSettlementCurrency(jsbz);
String inOrderNumber = reservationStockInOrder.getInOrderNumber(); String oldInOrderNumber = reservationStockInOrder.getInOrderNumber();
List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, inOrderNumber)); // 直接使用预约单号作为业务单号
reservationStockInOrder.setInOrderNumber(oldInOrderNumber);
reservationStockInOrder.setBusinessOrderNo(oldInOrderNumber);
List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, oldInOrderNumber));
List<ReservationInMaterialDetail> inMaterialDetailList = new ArrayList<>(); List<ReservationInMaterialDetail> inMaterialDetailList = new ArrayList<>();
int index = 1; int index = 1;
for (ReserveInMaterialDetail reserveInMaterialDetail : materialDetailList) { for (ReserveInMaterialDetail reserveInMaterialDetail : materialDetailList) {
ReservationInMaterialDetail reservationInMaterialDetail = new ReservationInMaterialDetail(); ReservationInMaterialDetail reservationInMaterialDetail = new ReservationInMaterialDetail();
BeanUtils.copyProperties(reserveInMaterialDetail, reservationInMaterialDetail,"materialDetailId"); BeanUtils.copyProperties(reserveInMaterialDetail, reservationInMaterialDetail,"materialDetailId");
reservationInMaterialDetail.setInOrderNumber(oldInOrderNumber);
reservationInMaterialDetail.setQuantity(reserveInMaterialDetail.getReserveQuantity()); reservationInMaterialDetail.setQuantity(reserveInMaterialDetail.getReserveQuantity());
String lot = generateDateSerialNumber(); String lot = generateDateSerialNumber();
lot = lot+"-"+index; lot = lot+"-"+index;
@@ -969,4 +980,16 @@ public class ReserveStockInOrderDomainService {
return stockInOrderService.queryNoticePrintDetail(stockInOrderDO); return stockInOrderService.queryNoticePrintDetail(stockInOrderDO);
} }
/**
* 生成入库预约单号
*/
public String generateReserveOrderNumber() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "R" + datePart;
int todayCount = reservationStockInOrderMapper.countByOrderNumberPrefix(prefix);
String seq = String.format("%03d", todayCount + 1);
return prefix + seq;
}
} }
@@ -6,6 +6,7 @@ import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMater
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder; import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO; import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO; import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@@ -33,4 +34,8 @@ public interface ReserveStockOutOrderMapper extends BaseMapper<ReserveStockOutOr
* 出库单提货单打印-明细 * 出库单提货单打印-明细
*/ */
List<ReserveOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReserveStockOutOrderDO stockOutOrderDO); List<ReserveOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReserveStockOutOrderDO stockOutOrderDO);
int countByOrderNumberPrefix(@Param("prefix") String prefix);
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
} }
@@ -1217,4 +1217,8 @@ public class ReserveStockOutOrderApplicationService {
// 3. 拼接结果 // 3. 拼接结果
return datePart + randomPart; return datePart + randomPart;
} }
public String generateReserveOrderNumber() {
return stockOutOrderDomainService.generateReserveOrderNumber();
}
} }
@@ -16,6 +16,7 @@ import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder; import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder;
import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService; import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService;
import com.mhd.oms.domain.reservationStockOutOrder.service.ReservationStockOutOrderDomainService;
import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail; import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
import com.mhd.oms.domain.reserveOutMaterialDetail.entity.ReserveOutMaterialDetail; import com.mhd.oms.domain.reserveOutMaterialDetail.entity.ReserveOutMaterialDetail;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.facade.IReserveOutMaterialDetailService; import com.mhd.oms.domain.reserveOutMaterialDetail.repository.facade.IReserveOutMaterialDetailService;
@@ -28,6 +29,7 @@ import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOr
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO; import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO;
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder; import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.facade.IReserveStockOutOrderService; import com.mhd.oms.domain.reserveStockOutOrder.repository.facade.IReserveStockOutOrderService;
import com.mhd.oms.domain.reserveStockOutOrder.repository.mapper.ReserveStockOutOrderMapper;
import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO; import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO; import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import com.mhd.system.api.SystemServiceFeign; import com.mhd.system.api.SystemServiceFeign;
@@ -71,6 +73,12 @@ public class ReserveStockOutOrderDomainService {
@Autowired @Autowired
private ReserveStockInOrderMapper reservationStockInOrderMapper; private ReserveStockInOrderMapper reservationStockInOrderMapper;
@Autowired
private ReserveStockOutOrderMapper stockOutOrderMapper;
@Autowired
private ReservationStockOutOrderDomainService reservationStockOutOrderDomainService;
/** /**
* 分页查询出库单列表 * 分页查询出库单列表
*/ */
@@ -89,7 +97,7 @@ public class ReserveStockOutOrderDomainService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Boolean insert(ReserveStockOutOrderDO stockOutOrderDO) { public Boolean insert(ReserveStockOutOrderDO stockOutOrderDO) {
if (stockOutOrderDO.getOutOrderNumber() == null) { if (stockOutOrderDO.getOutOrderNumber() == null) {
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK")); stockOutOrderDO.setOutOrderNumber(reservationStockOutOrderDomainService.generateReserveOrderNumber1());
} }
// update / batchInsert 一致前端传计划数量为 quantity outboundQuantity // update / batchInsert 一致前端传计划数量为 quantity outboundQuantity
setMaterialDetailInfo(stockOutOrderDO); setMaterialDetailInfo(stockOutOrderDO);
@@ -119,7 +127,7 @@ public class ReserveStockOutOrderDomainService {
public Boolean batchInsert(List<ReserveStockOutOrderDO> stockOutOrderDOList) { public Boolean batchInsert(List<ReserveStockOutOrderDO> stockOutOrderDOList) {
for (ReserveStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){ for (ReserveStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
if (StringUtils.isBlank(stockOutOrderDO.getOutOrderNumber())){ if (StringUtils.isBlank(stockOutOrderDO.getOutOrderNumber())){
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK")); stockOutOrderDO.setOutOrderNumber(reservationStockOutOrderDomainService.generateReserveOrderNumber1());
} }
//设置物料信息 //设置物料信息
setMaterialDetailInfo(stockOutOrderDO); setMaterialDetailInfo(stockOutOrderDO);
@@ -298,14 +306,18 @@ public class ReserveStockOutOrderDomainService {
Long shipperId = reservationStockOutOrder.getShipperId(); Long shipperId = reservationStockOutOrder.getShipperId();
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId); String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
reservationStockOutOrder.setSettlementCurrency(jsbz); reservationStockOutOrder.setSettlementCurrency(jsbz);
// 直接使用预约出库单号作为业务单号
String oldOutOrderNumber = reservationStockOutOrder.getOutOrderNumber();
reservationStockOutOrder.setOutOrderNumber(oldOutOrderNumber);
reservationStockOutOrder.setBusinessOrderNo(oldOutOrderNumber);
reservationStockOutOrderService.save(reservationStockOutOrder); reservationStockOutOrderService.save(reservationStockOutOrder);
String outOrderNumber = reservationStockOutOrder.getOutOrderNumber(); List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, oldOutOrderNumber));
List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, outOrderNumber));
List<ReservationOutMaterialDetail> inMaterialDetailList = new ArrayList<>(); List<ReservationOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
int index = 1; int index = 1;
for (ReserveOutMaterialDetail reserveOutMaterialDetail : materialDetailList) { for (ReserveOutMaterialDetail reserveOutMaterialDetail : materialDetailList) {
ReservationOutMaterialDetail reservationOutMaterialDetail = new ReservationOutMaterialDetail(); ReservationOutMaterialDetail reservationOutMaterialDetail = new ReservationOutMaterialDetail();
BeanUtils.copyProperties(reserveOutMaterialDetail, reservationOutMaterialDetail,"materialDetailId"); BeanUtils.copyProperties(reserveOutMaterialDetail, reservationOutMaterialDetail,"materialDetailId");
reservationOutMaterialDetail.setOutOrderNumber(oldOutOrderNumber);
String lot = generateDateSerialNumber(); String lot = generateDateSerialNumber();
lot = lot+"-"+index; lot = lot+"-"+index;
index++; index++;
@@ -751,4 +763,17 @@ public class ReserveStockOutOrderDomainService {
return stockOutOrderService.queryOutStockNoticePrintDetail(stockOutOrderDO); return stockOutOrderService.queryOutStockNoticePrintDetail(stockOutOrderDO);
} }
/**
* 生成出库预约单号C + YYMMDD + 当日累加序号3位不足补零
* 当日累加 = 今日已有单数 + 1
*/
public String generateReserveOrderNumber() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
String datePart = sdf.format(new Date());
String prefix = "C" + datePart;
int todayCount = stockOutOrderMapper.countByOrderNumberPrefix(prefix);
String seq = String.format("%03d", todayCount + 1);
return prefix + seq;
}
} }
@@ -246,4 +246,16 @@ public class ReservationStockOutOrderApi extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@ApiOperation("生成出库预约单号")
@GetMapping("/generateOrderNumber")
public AjaxResult generateOrderNumber() {
return AjaxResult.success(stockOutOrderApplicationService.generateReserveOrderNumber());
}
@ApiOperation("生成出库预约单号/出库业务单号")
@GetMapping("/generateOrderNumber1")
public AjaxResult generateOrderNumber1() {
return AjaxResult.success(stockOutOrderApplicationService.generateReserveOrderNumber1());
}
} }
@@ -294,4 +294,13 @@ public class ReserveStockOutOrderApi extends BaseController {
} }
} }
/**
* 生成出库预约单号
*/
@ApiOperation("生成出库单号")
@GetMapping("/generateOrderNumber")
public AjaxResult generateOrderNumber() {
return AjaxResult.success(stockOutOrderApplicationService.generateReserveOrderNumber());
}
} }
@@ -50,7 +50,9 @@ public class ReservationMaterialInventoryApi extends BaseController {
@ApiOperation("查询物料库存列表") @ApiOperation("查询物料库存列表")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(ReservationMaterialInventoryDTO materialInventoryDTO, public TableDataInfo list(ReservationMaterialInventoryDTO materialInventoryDTO,
@RequestParam(value = "customerName", required = false) String customerName) @RequestParam(value = "customerName", required = false) String customerName,
@RequestParam(value = "expiryDateStart", required = false) String expiryDateStart,
@RequestParam(value = "expiryDateEnd", required = false) String expiryDateEnd)
{ {
// 出库分配前端传的是客户名称 customerName这里通过名称查询货主ID使用精确匹配不模糊匹配 // 出库分配前端传的是客户名称 customerName这里通过名称查询货主ID使用精确匹配不模糊匹配
String shipperName = null; // 保存查询到的货主名称 String shipperName = null; // 保存查询到的货主名称
@@ -78,6 +80,8 @@ public class ReservationMaterialInventoryApi extends BaseController {
ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO); ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate()); materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate());
materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate()); materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate());
materialInventoryDO.setExpiryDateStart(expiryDateStart);
materialInventoryDO.setExpiryDateEnd(expiryDateEnd);
startPage(); startPage();
// 使用带批次属性的查询方法批次属性值从库存表中获取 // 使用带批次属性的查询方法批次属性值从库存表中获取
List<ReservationMaterialInventoryPO> list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO); List<ReservationMaterialInventoryPO> list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO);
@@ -281,4 +281,16 @@ public class ReservationStockInOrderApi extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
@ApiOperation("生成入库预约单号")
@GetMapping("/generateOrderNumber")
public AjaxResult generateOrderNumber() {
return AjaxResult.success(stockInOrderApplicationService.generateReserveOrderNumber());
}
@ApiOperation("生成入库预约单号/入库业务单号")
@GetMapping("/generateOrderNumber1")
public AjaxResult generateOrderNumber1() {
return AjaxResult.success(stockInOrderApplicationService.generateReserveOrderNumber1());
}
} }
@@ -256,4 +256,13 @@ public class ReserveStockInOrderApi extends BaseController {
} }
} }
/**
* 生成入库预约单号
*/
@ApiOperation("生成入库单号")
@GetMapping("/generateOrderNumber")
public AjaxResult generateOrderNumber() {
return AjaxResult.success(stockInOrderApplicationService.generateReserveOrderNumber());
}
} }
+1 -1
View File
@@ -17,7 +17,7 @@ spring:
nacos: nacos:
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.30:6848 server-addr: 10.102.192.30:6848
username: nacos username: nacos
@@ -650,4 +650,10 @@
<update id="delWShOrderDetail"> <update id="delWShOrderDetail">
update "NGWL_TEST_WMS".RECEIPT_MATERIAL_DETAIL set DEL_FLAG = 2 where DEL_FLAG = 1 and RECEIPT_ORDER_NUMBER = #{receiptOrderNumber} update "NGWL_TEST_WMS".RECEIPT_MATERIAL_DETAIL set DEL_FLAG = 2 where DEL_FLAG = 1 and RECEIPT_ORDER_NUMBER = #{receiptOrderNumber}
</update> </update>
<select id="countByOrderNumberPrefix" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(1)
FROM execution_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
</select>
</mapper> </mapper>
@@ -475,4 +475,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update "NGWL_TEST_WMS".out_material_detail set DEL_FLAG = 2 where DEL_FLAG = 1 and out_order_number = #{outOrderNumber} update "NGWL_TEST_WMS".out_material_detail set DEL_FLAG = 2 where DEL_FLAG = 1 and out_order_number = #{outOrderNumber}
</update> </update>
<select id="countByOrderNumberPrefix" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(1)
FROM execution_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
</select>
</mapper> </mapper>
@@ -276,6 +276,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productionDateStr != null and productionDateStr != ''"> <if test="productionDateStr != null and productionDateStr != ''">
AND TO_CHAR(a.production_date, 'yyyy-MM-dd') = #{productionDateStr} AND TO_CHAR(a.production_date, 'yyyy-MM-dd') = #{productionDateStr}
</if> </if>
<if test="expiryDateStart != null and expiryDateStart != ''">
and a.expiry_date >= #{expiryDateStart}
</if>
<if test="expiryDateEnd != null and expiryDateEnd != ''">
and a.expiry_date <![CDATA[ < ]]> DATEADD(DAY, 1, #{expiryDateEnd})
</if>
</sql> </sql>
<select id="queryList" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult"> <select id="queryList" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
@@ -330,6 +336,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY a.MATERIAL_BASE_INFO_ID GROUP BY a.MATERIAL_BASE_INFO_ID
</select> </select>
<!-- 按物料+过期日期汇总 -->
<select id="queryListByWlExpiry" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
select
a.material_base_info_id, a.expiry_date, a.shipper_id, a.shipper_code, a.shipper_name,
a.organization_id, a.organization_name, a.top_organization_id,
MAX(a.warehouse_id) AS warehouse_id, MAX(a.warehouse_code) AS warehouse_code, MAX(a.warehouse_name) AS warehouse_name,
MAX(a.storage_section_id) AS storage_section_id, MAX(a.storage_code) AS storage_code, MAX(a.storage_name) AS storage_name,
MAX(a.storage_location_id) AS storage_location_id, MAX(a.storage_location_code) AS storage_location_code, MAX(a.storage_location_name) AS storage_location_name,
MAX(a.batch_number) AS batch_number, MAX(a.material_status_code) AS material_status_code, MAX(a.material_status_name) AS material_status_name,
MAX(a.container_id) AS container_id, MAX(a.container_code) AS container_code, MAX(a.container_type) AS container_type, MAX(a.container_type_name) AS container_type_name,
IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity, a.is_able,
IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity,
IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity,
IFNULL(SUM(a.area), 0) AS area,
IFNULL(SUM(a.NET_WEIGHT), 0) AS NET_WEIGHT,
IFNULL(SUM(a.GROSS_WEIGHT), 0) AS GROSS_WEIGHT,
IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
MAX(a.unit) AS unit,
MAX(a.unit_name) AS unit_name,
MAX(a.production_date) AS production_date,
MAX(a.inventory_date) AS inventory_date,
MAX(a.batch_ref_no) AS batch_ref_no, MAX(a.sheet_ref_no) AS sheet_ref_no, MAX(a.box_pallet_no) AS box_pallet_no,
MAX(a.bar_code) AS inv_bar_code,
MAX(a.in_order_number) AS in_order_number, MAX(a.lot_number) AS lot_number,
b.material_code, b.material_name,
CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
from reservation_material_inventory a
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
<where>
<include refid="selectMaterialInventoryPo1"/>
<include refid="JoinMaterialBaseInfoPoWhere"/>
</where>
GROUP BY a.MATERIAL_BASE_INFO_ID, a.EXPIRY_DATE, a.shipper_id, a.shipper_code, a.shipper_name,
a.organization_id, a.organization_name, a.top_organization_id,
b.material_code, b.material_name
order by sort_order, MAX(a.update_time) desc
</select>
<select id="queryListByHz" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult"> <select id="queryListByHz" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
select select
<include refid="selectMaterialInventoryPo"/> <include refid="selectMaterialInventoryPo"/>
@@ -519,21 +519,27 @@
<select id="getByName" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO"> <select id="getByName" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_NAME = #{name} select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_NAME = #{name}
</select> </select>
<select id="getByCode" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO"> <select id="getByCode" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_CODE = #{code} select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_CODE = #{code} and ORGANIZATION_ID = #{orgId}
</select> </select>
<select id="getMaterialBaseInfoList" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO"> <select id="getMaterialBaseInfoList" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and material_code = #{id} select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and material_code = #{id}
</select> </select>
<select id="getInfoByMaterialBaseInfoIds" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO"> <!-- <select id="getkcId" resultType="com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO">-->
<!-- select * from "NGWL_TEST_WMS".MATERIAL_INVENTORY where 1 = 1 and DEL_FLAG = 1 and MATERIAL_BASE_INFO_ID = #{id} and ALLOCATION_QUANTITY >= #{q}-->
<!-- </select>-->
<select id="getInfoByMaterialBaseInfoIds" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO">
select * from "NGWL_TEST_WMS".MATERIAL_WAREHOUSE_CONTROL where 1 = 1 and DEL_FLAG = 1 and MATERIAL_BASE_INFO_ID = #{id} select * from "NGWL_TEST_WMS".MATERIAL_WAREHOUSE_CONTROL where 1 = 1 and DEL_FLAG = 1 and MATERIAL_BASE_INFO_ID = #{id}
</select> </select>
<select id="getGoodsInfoByMaterialBaseInfoIds" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO"> <select id="getGoodsInfoByMaterialBaseInfoIds" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO">
select * from "NGWL_TEST_WMS".MATERIAL_GOODS_RULE where 1 = 1 and DEL_FLAG = 1 and MATERIAL_BASE_INFO_ID = #{id} select * from "NGWL_TEST_WMS".MATERIAL_GOODS_RULE where 1 = 1 and DEL_FLAG = 1 and MATERIAL_BASE_INFO_ID = #{id}
</select> </select>
<select id="getkcId" resultType="com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO">
select * from "NGWL_TEST_WMS".MATERIAL_INVENTORY where 1 = 1 and DEL_FLAG = 1 and MATERIAL_BASE_INFO_ID = #{id} and ALLOCATION_QUANTITY >= #{q}
</select>
<select id="getUserNcCode" parameterType="java.lang.Long" resultType="java.lang.String"> <select id="getUserNcCode" parameterType="java.lang.Long" resultType="java.lang.String">
select CUSTOMER_NC_CODE from "NGWL_TEST_USER".USER_SHIPPER where 1 = 1 and DEL_FLAG = 1 and USER_ID = #{id} limit 1 select CUSTOMER_NC_CODE from "NGWL_TEST_USER".USER_SHIPPER where 1 = 1 and DEL_FLAG = 1 and USER_ID = #{id} limit 1
</select> </select>
@@ -649,4 +655,16 @@
<select id="getCustomerOrgCode" resultType="java.lang.String"> <select id="getCustomerOrgCode" resultType="java.lang.String">
select ORG_CODE from "NGWL_TEST_USER".USER_SHIPPER where 1 = 1 and DEL_FLAG = 1 and USER_ID = #{id} select ORG_CODE from "NGWL_TEST_USER".USER_SHIPPER where 1 = 1 and DEL_FLAG = 1 and USER_ID = #{id}
</select> </select>
<select id="countByOrderNumberPrefix" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(1)
FROM reservation_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
</select>
<select id="generateReserveOrderNumber1" resultType="java.lang.String">
select in_order_number
FROM reservation_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
</select>
</mapper> </mapper>
@@ -470,4 +470,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select max(user_id) as user_id from NGWL_TEST_USER."USER" where ORGANIZATION_ID = #{organizationId} and USER_MEMBER_CODE = #{userMemberCode} and DEL_FLAG = 1 select max(user_id) as user_id from NGWL_TEST_USER."USER" where ORGANIZATION_ID = #{organizationId} and USER_MEMBER_CODE = #{userMemberCode} and DEL_FLAG = 1
</select> </select>
<select id="countByOrderNumberPrefix" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(1)
FROM reservation_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
</select>
<select id="generateReserveOrderNumber1" resultType="java.lang.String">
SELECT out_order_number
FROM reservation_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
</select>
</mapper> </mapper>
@@ -777,4 +777,15 @@
AND USER_ID = #{id} limit 1 AND USER_ID = #{id} limit 1
</select> </select>
<select id="countByOrderNumberPrefix" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(1)
FROM reserve_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
</select>
<select id="generateReserveOrderNumber1" resultType="java.lang.String">
SELECT in_order_number
FROM reserve_stock_in_order
WHERE in_order_number LIKE concat(#{prefix}, '%')
</select>
</mapper> </mapper>
@@ -517,4 +517,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="boxPalletNo" column="box_pallet_no"/> <result property="boxPalletNo" column="box_pallet_no"/>
</resultMap> </resultMap>
<select id="countByOrderNumberPrefix" resultType="java.lang.Integer" parameterType="java.lang.String">
SELECT COUNT(1)
FROM reserve_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
</select>
<select id="generateReserveOrderNumber1" resultType="java.lang.String">
SELECT out_order_number
FROM reserve_stock_out_order
WHERE out_order_number LIKE concat(#{prefix}, '%')
</select>
</mapper> </mapper>
@@ -250,7 +250,10 @@ public class MaterialBaseInfoApplicationService {
} }
} }
Long shipperId = materialBaseInfoDO.getShipperId(); Long shipperId = materialBaseInfoDO.getShipperId();
String customerCodeNcJson = materialBaseInfoMapper.getCustomerCodeNcJson(shipperId.toString()); String customerCodeNcJson = null;
if (shipperId != null) {
customerCodeNcJson = materialBaseInfoMapper.getCustomerCodeNcJson(shipperId.toString());
}
if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) { if (customerCodeNcJson != null && !customerCodeNcJson.isEmpty()) {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> listNc = null; List<Map<String, Object>> listNc = null;
@@ -18,6 +18,7 @@ import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryQuery
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO; import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO;
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryQueryListDO; import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryQueryListDO;
import com.mhd.wms.domain.materialInventory.service.MaterialInventoryDomainService; import com.mhd.wms.domain.materialInventory.service.MaterialInventoryDomainService;
import com.mhd.wms.interfaces.dto.materialInventory.MaterialInventoryDTO;
import com.mhd.wms.domain.materialBarCode.repository.facade.IMaterialBarCodeService; import com.mhd.wms.domain.materialBarCode.repository.facade.IMaterialBarCodeService;
import com.mhd.wms.domain.materialBarCode.repository.po.MaterialBarCodePO; import com.mhd.wms.domain.materialBarCode.repository.po.MaterialBarCodePO;
import com.mhd.wms.domain.materialMoreDetail.repository.po.MaterialMoreDetailPO; import com.mhd.wms.domain.materialMoreDetail.repository.po.MaterialMoreDetailPO;
@@ -32,6 +32,8 @@ public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory>
public List<MaterialInventoryPO> queryListByKw(MaterialInventoryDO materialInventoryDO); public List<MaterialInventoryPO> queryListByKw(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料 //查物料库存列表-物料
public List<MaterialInventoryPO> queryListByWl(MaterialInventoryDO materialInventoryDO); public List<MaterialInventoryPO> queryListByWl(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料+过期日期
public List<MaterialInventoryPO> queryListByWlExpiry(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-货主 //查物料库存列表-货主
public List<MaterialInventoryPO> queryListByHz(MaterialInventoryDO materialInventoryDO); public List<MaterialInventoryPO> queryListByHz(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-货主+物料同一物料在不同货主下各一行 //查物料库存列表-货主+物料同一物料在不同货主下各一行
@@ -85,6 +85,8 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
return materialInventoryMapper.queryListByKw(materialInventoryDO); return materialInventoryMapper.queryListByKw(materialInventoryDO);
} else if ("wlkw".equals(queryRule)) { } else if ("wlkw".equals(queryRule)) {
return materialInventoryMapper.queryListByWlKw(materialInventoryDO); return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
} else if ("wlExpiry".equals(queryRule)) {
return materialInventoryMapper.queryListByWlExpiry(materialInventoryDO);
} else if ("all".equals(queryRule)) { } else if ("all".equals(queryRule)) {
return materialInventoryMapper.queryList(materialInventoryDO); return materialInventoryMapper.queryList(materialInventoryDO);
} else { } else {
@@ -55,7 +55,9 @@ public class MaterialInventoryApi extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO, public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO,
@RequestParam(value = "customerName", required = false) String customerName, @RequestParam(value = "customerName", required = false) String customerName,
@RequestParam(value = "excludeZeroInventoryQuantity", required = false) Boolean excludeZeroInventoryQuantity) @RequestParam(value = "excludeZeroInventoryQuantity", required = false) Boolean excludeZeroInventoryQuantity,
@RequestParam(value = "expiryDateStart", required = false) String expiryDateStart,
@RequestParam(value = "expiryDateEnd", required = false) String expiryDateEnd)
{ {
if (Boolean.TRUE.equals(excludeZeroInventoryQuantity)) { if (Boolean.TRUE.equals(excludeZeroInventoryQuantity)) {
materialInventoryDTO.setExcludeZeroInventoryQuantity(true); materialInventoryDTO.setExcludeZeroInventoryQuantity(true);
@@ -86,6 +88,8 @@ public class MaterialInventoryApi extends BaseController {
MaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO); MaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate()); materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate());
materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate()); materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate());
materialInventoryDO.setExpiryDateStart(expiryDateStart);
materialInventoryDO.setExpiryDateEnd(expiryDateEnd);
Date updateTime = materialInventoryDTO.getUpdateTime(); Date updateTime = materialInventoryDTO.getUpdateTime();
if (updateTime != null) { if (updateTime != null) {
LocalDateTime localDateTime = updateTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); LocalDateTime localDateTime = updateTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+2 -2
View File
@@ -16,7 +16,7 @@ spring:
# 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.30:6848
username: nacos username: nacos
password: manhuoda@2023 password: manhuoda@2023
#线上正式环境 #线上正式环境
@@ -25,7 +25,7 @@ spring:
# 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.30:6848
username: nacos username: nacos
password: manhuoda@2023 password: manhuoda@2023
#线上正式环境 #线上正式环境
@@ -455,6 +455,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
loc.storage_location_id, loc.storage_location_code, loc.storage_location_name order by sort_order, a.update_time desc loc.storage_location_id, loc.storage_location_code, loc.storage_location_name order by sort_order, a.update_time desc
</select> </select>
<!-- 按物料+过期日期汇总:相同物料+相同过期日期合并,不同过期日期分开 -->
<select id="queryListByWlExpiry" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
select
a.material_base_info_id, a.expiry_date, a.shipper_id, a.shipper_code, a.shipper_name,
a.organization_id, a.organization_name, a.top_organization_id,
MAX(a.warehouse_id) AS warehouse_id, MAX(a.warehouse_code) AS warehouse_code, MAX(a.warehouse_name) AS warehouse_name,
MAX(a.storage_section_id) AS storage_section_id, MAX(a.storage_code) AS storage_code, MAX(a.storage_name) AS storage_name,
MAX(a.storage_location_id) AS storage_location_id, MAX(a.storage_location_code) AS storage_location_code, MAX(a.storage_location_name) AS storage_location_name,
MAX(a.batch_number) AS batch_number, MAX(a.material_status_code) AS material_status_code, MAX(a.material_status_name) AS material_status_name,
MAX(a.container_id) AS container_id, MAX(a.container_code) AS container_code, MAX(a.container_type) AS container_type, MAX(a.container_type_name) AS container_type_name,
IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity, a.is_able,
IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity,
IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity,
IFNULL(SUM(a.area), 0) AS area,
IFNULL(SUM(a.NET_WEIGHT), 0) AS NET_WEIGHT,
IFNULL(SUM(a.GROSS_WEIGHT), 0) AS GROSS_WEIGHT,
IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
MAX(a.unit) AS unit,
MAX(a.unit_name) AS unit_name,
MAX(a.production_date) AS production_date,
MAX(a.inventory_date) AS inventory_date,
MAX(a.batch_ref_no) AS batch_ref_no, MAX(a.sheet_ref_no) AS sheet_ref_no, MAX(a.box_pallet_no) AS box_pallet_no,
MAX(a.bar_code) AS inv_bar_code,
MAX(a.in_order_number) AS in_order_number, MAX(a.lot_number) AS lot_number,
b.specification_model,
b.material_code, b.material_name,
CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
from material_inventory a
left join material_base_info b on a.material_base_info_id = b.material_base_info_id
<where>
<include refid="selectMaterialInventoryPo1"/>
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
</where>
GROUP BY a.MATERIAL_BASE_INFO_ID, a.EXPIRY_DATE, a.shipper_id, a.shipper_code, a.shipper_name,
a.organization_id, a.organization_name, a.top_organization_id,
b.material_code, b.material_name, b.specification_model
order by sort_order, MAX(a.update_time) desc
</select>
<!-- 按货主+物料汇总:A货主物料1、A货主物料2、B货主物料1、B货主物料2 为 4 行;库位取该货主+该物料下创建时间最新的一条明细 --> <!-- 按货主+物料汇总:A货主物料1、A货主物料2、B货主物料1、B货主物料2 为 4 行;库位取该货主+该物料下创建时间最新的一条明细 -->
<select id="queryListByHzWl" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult"> <select id="queryListByHzWl" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
select select
@@ -580,6 +619,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by b.material_base_info_id, a.shipper_id, a.batch_number group by b.material_base_info_id, a.shipper_id, a.batch_number
order by max(b.material_name), max(a.shipper_name), a.batch_number order by max(b.material_name), max(a.shipper_name), a.batch_number
</when> </when>
<when test="queryType != null and queryType == 7">
group by b.material_base_info_id, a.shipper_id, a.expiry_date
order by max(b.material_name), max(a.shipper_name), a.expiry_date
</when>
<when test="queryType != null and queryType == 4"> <when test="queryType != null and queryType == 4">
group by a.storage_location_id group by a.storage_location_id
order by max(a.storage_location_code) order by max(a.storage_location_code)