Compare commits
41
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c71c4e661 | ||
|
|
69e54bb2c6 | ||
|
|
d268718f9b | ||
|
|
fc16c1edf2 | ||
|
|
4bd655e4da | ||
|
|
8681042a32 | ||
|
|
44c9953875 | ||
|
|
c48b8aa39a | ||
|
|
36b31e5d52 | ||
|
|
f5c096fe39 | ||
|
|
75e77c0476 | ||
|
|
709b151e3f | ||
|
|
fa731e1fa5 | ||
|
|
d1448b2746 | ||
|
|
32d38b7721 | ||
|
|
ebc7bee5be | ||
|
|
19ca4bbe6c | ||
|
|
2f6988abac | ||
|
|
e322e28d05 | ||
|
|
9f70b236a0 | ||
|
|
7dcedab498 | ||
|
|
e2f5896be2 | ||
|
|
effa681709 | ||
|
|
8ea6a82acd | ||
|
|
e7f2a79dee | ||
|
|
8a78122fcb | ||
|
|
49b3722328 | ||
|
|
cb96a3700d | ||
|
|
9250d03ab1 | ||
|
|
494f49ee1b | ||
|
|
be597775d9 | ||
|
|
9eff15e483 | ||
|
|
496548558b | ||
|
|
7bd2e0b87c | ||
|
|
266d416912 | ||
|
|
f2216adb06 | ||
|
|
b825f1a789 | ||
|
|
6177b70b34 | ||
|
|
30dd4abe43 | ||
|
|
5dd23e9f42 | ||
|
|
b4db0a8cdb |
@@ -18,7 +18,7 @@ import java.util.Set;
|
||||
/**
|
||||
* 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 {
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import java.util.List;
|
||||
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 {
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
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 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* @description: TODO
|
||||
* @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 {
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.mhd.system.api.feign.FeignAutoConfiguration;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
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 {
|
||||
|
||||
/**
|
||||
|
||||
+89
@@ -359,6 +359,95 @@ public class UserShipperApplicationService {
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人货主认证
|
||||
*
|
||||
|
||||
+6
@@ -244,6 +244,12 @@ public class UserShipperDO extends UserDO {
|
||||
@ApiModelProperty("货主/供应商/客户名称")
|
||||
private String userNameShipper;
|
||||
|
||||
@ApiModelProperty("用户名称")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("用户电话")
|
||||
private String userPhone;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
private String emergencyContactName;
|
||||
|
||||
|
||||
@@ -352,8 +352,20 @@ public class UserShipperAPI extends BaseController {
|
||||
@PostMapping("/wxGetPhoneNumber")
|
||||
public AjaxResult wxGetPhoneNumber(@RequestBody com.mhd.user.interfaces.dto.wechat.WxPhoneNumberDTO dto) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long organizationId = (loginUser != null && loginUser.getUserPo() != null)
|
||||
Long organizationId = (loginUser != null && loginUser.getUserPo() != null)
|
||||
? loginUser.getUserPo().getOrganizationId() : null;
|
||||
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:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
server-addr: 10.33.0.129:6010
|
||||
# server-addr: 10.102.192.30:6848
|
||||
# server-addr: 10.33.0.129:6010
|
||||
server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
config:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
server-addr: 10.33.0.129:6010
|
||||
# server-addr: 10.102.192.30:6848
|
||||
# server-addr: 10.33.0.129:6010
|
||||
server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
|
||||
|
||||
@@ -75,7 +75,9 @@
|
||||
AND b.del_flag = 1
|
||||
</sql>
|
||||
<sql id="selectShipperVo1">
|
||||
SELECT b.shipper_id,
|
||||
SELECT b.area,
|
||||
b.detail_address,
|
||||
b.shipper_id,
|
||||
a.user_id,
|
||||
b.parent_shipper_id,
|
||||
b.shipper_type,
|
||||
|
||||
@@ -19,14 +19,14 @@ spring:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
# server-addr: 10.33.0.129:6010
|
||||
server-addr: 10.102.192.31:6848
|
||||
server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
config:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
# server-addr: 10.33.0.129:6010
|
||||
server-addr: 10.102.192.31:6848
|
||||
server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
|
||||
|
||||
+1
@@ -68,4 +68,5 @@ public interface ExecutionStockInOrderMapper extends BaseMapper<ExecutionStockIn
|
||||
|
||||
String getNcUrl(@Param("interfaceType") String interfaceType,@Param("organizationName") String organizationName,@Param("organizationId") Long organizationId);
|
||||
|
||||
int countByOrderNumberPrefix(@Param("prefix") String prefix);
|
||||
}
|
||||
+1
@@ -37,4 +37,5 @@ public interface ExecutionStockOutOrderMapper extends BaseMapper<ExecutionStockO
|
||||
|
||||
public void delWOrderDetail(@Param("outOrderNumber") String outOrderNumber);
|
||||
|
||||
int countByOrderNumberPrefix(@Param("prefix") String prefix);
|
||||
}
|
||||
+2
@@ -29,6 +29,8 @@ public interface ReservationMaterialInventoryMapper extends BaseMapper<Reservati
|
||||
public List<ReservationMaterialInventoryPO> queryListByWl(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-货主
|
||||
public List<ReservationMaterialInventoryPO> queryListByHz(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-物料+过期日期
|
||||
public List<ReservationMaterialInventoryPO> queryListByWlExpiry(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
|
||||
|
||||
public MaterialBaseInfo getByInfoId(@Param("id") Long id);
|
||||
|
||||
+2
@@ -64,6 +64,8 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl<ReservationMat
|
||||
return materialInventoryMapper.queryListByKw(materialInventoryDO);
|
||||
} else if ("wlkw".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
|
||||
} else if ("wlExpiry".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByWlExpiry(materialInventoryDO);
|
||||
} else if ("all".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryList(materialInventoryDO);
|
||||
} else {
|
||||
|
||||
+2
@@ -253,4 +253,6 @@ public class ReservationMaterialInventoryDO extends MaterialBaseDO {
|
||||
private String createTimeEnd;
|
||||
private String expiryDateStr;
|
||||
private String productionDateStr;
|
||||
private String expiryDateStart;
|
||||
private String expiryDateEnd;
|
||||
}
|
||||
+9
-1
@@ -2,6 +2,7 @@ package com.mhd.oms.domain.reservationStockInOrder.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
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.repository.po.MaterialBaseInfoPO;
|
||||
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 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<ReservationMaterialInventoryPO> getkcId(@Param("id") Long id,@Param("q") BigDecimal q);
|
||||
|
||||
public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@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);
|
||||
|
||||
@@ -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 getCustomerOrgCode(@Param("id") Long id);
|
||||
|
||||
int countByOrderNumberPrefix(@Param("prefix") String prefix);
|
||||
|
||||
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
|
||||
}
|
||||
+31
-8
@@ -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.po.ReservationInMaterialDetailPO;
|
||||
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.todo.ReservationOutMaterialDetailDO;
|
||||
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.todo.ReservationStockInOrderDO;
|
||||
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.repository.facade.IReservationStockOutOrderService;
|
||||
import com.mhd.oms.domain.reservationStockOutOrder.repository.mapper.ReservationStockOutOrderMapper;
|
||||
@@ -83,6 +85,8 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private IReservationInMaterialDetailService materialDetailService;
|
||||
@Autowired
|
||||
private ReservationStockInOrderDomainService reservationStockInOrderDomainService;
|
||||
|
||||
/**
|
||||
* 查询入库单列表
|
||||
@@ -192,7 +196,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
List<Map<String,Object>> shipperIds = new ArrayList<>();
|
||||
Set<Long> processedShipperIds = new HashSet<>();
|
||||
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) {
|
||||
Long shipperId = materialBaseInfoPO.getShipperId();
|
||||
if (processedShipperIds.add(shipperId)) {
|
||||
@@ -216,7 +220,10 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
}
|
||||
|
||||
ReservationStockOutOrderDO reservationStockOutOrderDO = new ReservationStockOutOrderDO();
|
||||
reservationStockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
// 生成出库业务单号
|
||||
String orderNumber = reservationStockOutOrderApplicationService.generateReserveOrderNumber1();
|
||||
reservationStockOutOrderDO.setOutOrderNumber(orderNumber);
|
||||
reservationStockOutOrderDO.setBusinessOrderNo(orderNumber);
|
||||
// 货主信息:有货品明细时从解析结果取,无货品明细时从登录用户取
|
||||
if (!shipperIds.isEmpty()) {
|
||||
reservationStockOutOrderDO.setShipperId((Long) shipperIds.get(0).get("shipperId"));
|
||||
@@ -254,9 +261,22 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
for (ProductDetail productDetail : productDetailList) {
|
||||
ReservationOutMaterialDetailDO reservationOutMaterialDetailDO = new ReservationOutMaterialDetailDO();
|
||||
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));
|
||||
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.setMaterialCode(materialBaseInfoPO.getMaterialCode());
|
||||
reservationOutMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
|
||||
@@ -360,7 +380,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
List<Map<String,Object>> shipperIds = new ArrayList<>();
|
||||
Set<Long> processedShipperIds = new HashSet<>();
|
||||
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) {
|
||||
Long shipperId = materialBaseInfoPO.getShipperId();
|
||||
if (processedShipperIds.add(shipperId)) {
|
||||
@@ -373,7 +393,10 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
}
|
||||
}
|
||||
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.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
reservationStockInOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
@@ -399,7 +422,6 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
reservationStockInOrderDO.setWarehouseDate(stockInHeader.getStockInDate());
|
||||
reservationStockInOrderDO.setStorageTime(stockInHeader.getStockInDate());
|
||||
reservationStockInOrderDO.setExpectTime(stockInHeader.getStockInDate());
|
||||
reservationStockInOrderDO.setBusinessOrderNo(stockInHeader.getOrderNo());
|
||||
reservationStockInOrderDO.setReservationOrderSource("数据导入");
|
||||
List<ReservationInMaterialDetailDO> reservationInMaterialDetailDOList = new ArrayList<>();
|
||||
int index = 1;
|
||||
@@ -412,7 +434,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
reservationInMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
reservationInMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
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));
|
||||
if (materialBaseInfoPO != null) {
|
||||
reservationInMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
|
||||
@@ -469,7 +491,8 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertDomain(ReservationStockInOrderDO stockInOrderDO) {
|
||||
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);
|
||||
|
||||
+7
@@ -2286,4 +2286,11 @@ public class ReservationStockInOrderApplicationService {
|
||||
return filteredList;
|
||||
}
|
||||
|
||||
public String generateReserveOrderNumber() {
|
||||
return stockInOrderDomainService.generateReserveOrderNumber();
|
||||
}
|
||||
|
||||
public String generateReserveOrderNumber1() {
|
||||
return stockInOrderDomainService.generateReserveOrderNumber1();
|
||||
}
|
||||
}
|
||||
+55
-11
@@ -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.executionStockInOrder.entity.ExecutionStockInOrder;
|
||||
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.service.ExecutionStockInOrderApplicationService;
|
||||
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.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
|
||||
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.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.*;
|
||||
@@ -85,6 +87,10 @@ public class ReservationStockInOrderDomainService {
|
||||
private ExecutionStockInOrderApplicationService stockInOrderApplicationService;
|
||||
@Autowired
|
||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||
@Autowired
|
||||
private ExecutionStockInOrderMapper executionStockInOrderMapper;
|
||||
@Autowired
|
||||
private ReserveStockInOrderMapper reserveStockInOrderMapper;
|
||||
|
||||
/**
|
||||
* 分页查询入库单列表
|
||||
@@ -100,7 +106,8 @@ public class ReservationStockInOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReservationStockInOrderDO stockInOrderDO) {
|
||||
if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
stockInOrderDO.setInOrderNumber(generateReserveOrderNumber1());
|
||||
stockInOrderDO.setBusinessOrderNo(stockInOrderDO.getInOrderNumber());
|
||||
}
|
||||
// //设置默认值
|
||||
// setDefaultValues(stockInOrderDO);
|
||||
@@ -534,11 +541,7 @@ public class ReservationStockInOrderDomainService {
|
||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
|
||||
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||
reservationStockInOrder.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
} else {
|
||||
reservationStockInOrder.setInOrderNumber(inOrderNumber);
|
||||
}
|
||||
reservationStockInOrder.setInOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
int index = 1;
|
||||
@@ -691,11 +694,7 @@ public class ReservationStockInOrderDomainService {
|
||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
|
||||
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||
reservationStockInOrder.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
} else {
|
||||
reservationStockInOrder.setInOrderNumber(inOrderNumber);
|
||||
}
|
||||
reservationStockInOrder.setInOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
int index = 1;
|
||||
@@ -1212,4 +1211,49 @@ public class ReservationStockInOrderDomainService {
|
||||
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;
|
||||
}
|
||||
}
|
||||
+4
@@ -37,4 +37,8 @@ public interface ReservationStockOutOrderMapper extends BaseMapper<ReservationSt
|
||||
List<ReservationOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReservationStockOutOrderDO stockOutOrderDO);
|
||||
|
||||
Long queryShipperId(@Param("userMemberCode") String userMemberCode,@Param("organizationId") Long organizationId);
|
||||
|
||||
int countByOrderNumberPrefix(@Param("prefix") String prefix);
|
||||
|
||||
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
|
||||
}
|
||||
+7
@@ -1743,4 +1743,11 @@ public class ReservationStockOutOrderApplicationService {
|
||||
return filteredList;
|
||||
}
|
||||
|
||||
public String generateReserveOrderNumber() {
|
||||
return stockOutOrderDomainService.generateReserveOrderNumber();
|
||||
}
|
||||
|
||||
public String generateReserveOrderNumber1() {
|
||||
return stockOutOrderDomainService.generateReserveOrderNumber1();
|
||||
}
|
||||
}
|
||||
+60
-11
@@ -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.executionStockOutOrder.entity.ExecutionStockOutOrder;
|
||||
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.service.ExecutionStockOutOrderApplicationService;
|
||||
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.reservationStockOutOrder.entity.ReservationStockOutOrder;
|
||||
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.todo.ReservationStockOutOrderDO;
|
||||
import com.mhd.oms.domain.reserveStockOutOrder.repository.mapper.ReserveStockOutOrderMapper;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.*;
|
||||
@@ -62,6 +65,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -95,6 +99,8 @@ public class ReservationStockOutOrderDomainService {
|
||||
private ExecuteOrderMapper executeOrderMapper;
|
||||
@Autowired
|
||||
private ExecutionStockOutOrderApplicationService stockOutOrderApplicationService;
|
||||
@Autowired
|
||||
private ExecutionStockOutOrderMapper executionStockOutOrderMapper;
|
||||
@Resource
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Resource
|
||||
@@ -105,6 +111,10 @@ public class ReservationStockOutOrderDomainService {
|
||||
private IBusinessDeliveryDetailsLinkService businessDeliveryDetailsLinkService;
|
||||
@Autowired
|
||||
private BusinessDeliveryDetailsLinkMapper businessDeliveryDetailsLinkMapper;
|
||||
@Autowired
|
||||
private ReservationStockOutOrderMapper reservationStockOutOrderMapper;
|
||||
@Autowired
|
||||
private ReserveStockOutOrderMapper reserveStockOutOrderMapper;
|
||||
|
||||
/**
|
||||
* 分页查询出库单列表
|
||||
@@ -120,7 +130,8 @@ public class ReservationStockOutOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReservationStockOutOrderDO stockOutOrderDO) {
|
||||
if (stockOutOrderDO.getOutOrderNumber() == null) {
|
||||
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
stockOutOrderDO.setOutOrderNumber(generateReserveOrderNumber1());
|
||||
stockOutOrderDO.setBusinessOrderNo(stockOutOrderDO.getOutOrderNumber());
|
||||
}
|
||||
// 与 update / batchInsert 一致:前端传计划数量为 quantity,非 outboundQuantity
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
@@ -385,11 +396,8 @@ public class ReservationStockOutOrderDomainService {
|
||||
// reservationStockInOrder.setTopOrganizationId(topOrgId);
|
||||
|
||||
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||
reservationStockInOrder.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
} else {
|
||||
reservationStockInOrder.setOutOrderNumber(inOrderNumber);
|
||||
}
|
||||
reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
|
||||
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) {
|
||||
@@ -513,11 +521,7 @@ public class ReservationStockOutOrderDomainService {
|
||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||
if (materialDetailGroupByWarehouse!=null&&materialDetailGroupByWarehouse.size()>1) {
|
||||
reservationStockInOrder.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
} else {
|
||||
reservationStockInOrder.setOutOrderNumber(inOrderNumber);
|
||||
}
|
||||
reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
+4
@@ -46,4 +46,8 @@ public interface ReserveStockInOrderMapper extends BaseMapper<ReserveStockInOrde
|
||||
List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO);
|
||||
|
||||
public String getJsbz(@Param("id") Long id);
|
||||
|
||||
int countByOrderNumberPrefix(@Param("prefix") String prefix);
|
||||
|
||||
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
|
||||
}
|
||||
+4
@@ -2066,4 +2066,8 @@ public class ReserveStockInOrderApplicationService {
|
||||
// 3. 拼接结果
|
||||
return datePart + randomPart;
|
||||
}
|
||||
|
||||
public String generateReserveOrderNumber() {
|
||||
return stockInOrderDomainService.generateReserveOrderNumber();
|
||||
}
|
||||
}
|
||||
+27
-4
@@ -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.reservationStockInOrder.entity.ReservationStockInOrder;
|
||||
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.MaterialGoodsRulePO;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO;
|
||||
@@ -78,6 +79,8 @@ public class ReserveStockInOrderDomainService {
|
||||
private IReservationStockInOrderService reservationStockInOrderService;
|
||||
@Autowired
|
||||
private IReservationInMaterialDetailService reservationInMaterialDetailService;
|
||||
@Autowired
|
||||
private ReservationStockInOrderDomainService reservationStockInOrderDomainService;
|
||||
|
||||
/**
|
||||
* 分页查询入库单列表
|
||||
@@ -101,7 +104,7 @@ public class ReserveStockInOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReserveStockInOrderDO stockInOrderDO) {
|
||||
if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
stockInOrderDO.setInOrderNumber(reservationStockInOrderDomainService.generateReserveOrderNumber1());
|
||||
}
|
||||
// //设置默认值
|
||||
// setDefaultValues(stockInOrderDO);
|
||||
@@ -134,7 +137,7 @@ public class ReserveStockInOrderDomainService {
|
||||
public Boolean batchInsert(List<ReserveStockInOrderDO> stockInOrderDOList) {
|
||||
for (ReserveStockInOrderDO stockInOrderDO : stockInOrderDOList){
|
||||
if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
stockInOrderDO.setInOrderNumber(reservationStockInOrderDomainService.generateReserveOrderNumber1());
|
||||
}
|
||||
// //设置物料信息
|
||||
// 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);
|
||||
stockInOrderPO.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);
|
||||
stockInOrderDO.setWeightLimit(weightLimit);
|
||||
@@ -467,13 +474,17 @@ public class ReserveStockInOrderDomainService {
|
||||
Long shipperId = reservationStockInOrder.getShipperId();
|
||||
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
|
||||
reservationStockInOrder.setSettlementCurrency(jsbz);
|
||||
String inOrderNumber = reservationStockInOrder.getInOrderNumber();
|
||||
List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, inOrderNumber));
|
||||
String oldInOrderNumber = reservationStockInOrder.getInOrderNumber();
|
||||
// 直接使用预约单号作为业务单号
|
||||
reservationStockInOrder.setInOrderNumber(oldInOrderNumber);
|
||||
reservationStockInOrder.setBusinessOrderNo(oldInOrderNumber);
|
||||
List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, oldInOrderNumber));
|
||||
List<ReservationInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
int index = 1;
|
||||
for (ReserveInMaterialDetail reserveInMaterialDetail : materialDetailList) {
|
||||
ReservationInMaterialDetail reservationInMaterialDetail = new ReservationInMaterialDetail();
|
||||
BeanUtils.copyProperties(reserveInMaterialDetail, reservationInMaterialDetail,"materialDetailId");
|
||||
reservationInMaterialDetail.setInOrderNumber(oldInOrderNumber);
|
||||
reservationInMaterialDetail.setQuantity(reserveInMaterialDetail.getReserveQuantity());
|
||||
String lot = generateDateSerialNumber();
|
||||
lot = lot+"-"+index;
|
||||
@@ -969,4 +980,16 @@ public class ReserveStockInOrderDomainService {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -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.repository.po.ReserveStockOutOrderPO;
|
||||
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,4 +34,8 @@ public interface ReserveStockOutOrderMapper extends BaseMapper<ReserveStockOutOr
|
||||
* 出库单提货单打印-明细
|
||||
*/
|
||||
List<ReserveOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReserveStockOutOrderDO stockOutOrderDO);
|
||||
|
||||
int countByOrderNumberPrefix(@Param("prefix") String prefix);
|
||||
|
||||
List<String> generateReserveOrderNumber1(@Param("prefix") String prefix);
|
||||
}
|
||||
+4
@@ -1217,4 +1217,8 @@ public class ReserveStockOutOrderApplicationService {
|
||||
// 3. 拼接结果
|
||||
return datePart + randomPart;
|
||||
}
|
||||
|
||||
public String generateReserveOrderNumber() {
|
||||
return stockOutOrderDomainService.generateReserveOrderNumber();
|
||||
}
|
||||
}
|
||||
+29
-4
@@ -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.reservationStockOutOrder.entity.ReservationStockOutOrder;
|
||||
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.reserveOutMaterialDetail.entity.ReserveOutMaterialDetail;
|
||||
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.reserveStockOutOrder.entity.ReserveStockOutOrder;
|
||||
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.todo.ReserveStockOutOrderDO;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
@@ -71,6 +73,12 @@ public class ReserveStockOutOrderDomainService {
|
||||
@Autowired
|
||||
private ReserveStockInOrderMapper reservationStockInOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private ReserveStockOutOrderMapper stockOutOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private ReservationStockOutOrderDomainService reservationStockOutOrderDomainService;
|
||||
|
||||
/**
|
||||
* 分页查询出库单列表
|
||||
*/
|
||||
@@ -89,7 +97,7 @@ public class ReserveStockOutOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReserveStockOutOrderDO stockOutOrderDO) {
|
||||
if (stockOutOrderDO.getOutOrderNumber() == null) {
|
||||
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
stockOutOrderDO.setOutOrderNumber(reservationStockOutOrderDomainService.generateReserveOrderNumber1());
|
||||
}
|
||||
// 与 update / batchInsert 一致:前端传计划数量为 quantity,非 outboundQuantity
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
@@ -119,7 +127,7 @@ public class ReserveStockOutOrderDomainService {
|
||||
public Boolean batchInsert(List<ReserveStockOutOrderDO> stockOutOrderDOList) {
|
||||
for (ReserveStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
|
||||
if (StringUtils.isBlank(stockOutOrderDO.getOutOrderNumber())){
|
||||
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
stockOutOrderDO.setOutOrderNumber(reservationStockOutOrderDomainService.generateReserveOrderNumber1());
|
||||
}
|
||||
//设置物料信息
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
@@ -298,14 +306,18 @@ public class ReserveStockOutOrderDomainService {
|
||||
Long shipperId = reservationStockOutOrder.getShipperId();
|
||||
String jsbz = reservationStockInOrderMapper.getJsbz(shipperId);
|
||||
reservationStockOutOrder.setSettlementCurrency(jsbz);
|
||||
// 直接使用预约出库单号作为业务单号
|
||||
String oldOutOrderNumber = reservationStockOutOrder.getOutOrderNumber();
|
||||
reservationStockOutOrder.setOutOrderNumber(oldOutOrderNumber);
|
||||
reservationStockOutOrder.setBusinessOrderNo(oldOutOrderNumber);
|
||||
reservationStockOutOrderService.save(reservationStockOutOrder);
|
||||
String outOrderNumber = reservationStockOutOrder.getOutOrderNumber();
|
||||
List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, outOrderNumber));
|
||||
List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, oldOutOrderNumber));
|
||||
List<ReservationOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
int index = 1;
|
||||
for (ReserveOutMaterialDetail reserveOutMaterialDetail : materialDetailList) {
|
||||
ReservationOutMaterialDetail reservationOutMaterialDetail = new ReservationOutMaterialDetail();
|
||||
BeanUtils.copyProperties(reserveOutMaterialDetail, reservationOutMaterialDetail,"materialDetailId");
|
||||
reservationOutMaterialDetail.setOutOrderNumber(oldOutOrderNumber);
|
||||
String lot = generateDateSerialNumber();
|
||||
lot = lot+"-"+index;
|
||||
index++;
|
||||
@@ -751,4 +763,17 @@ public class ReserveStockOutOrderDomainService {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -246,4 +246,16 @@ public class ReservationStockOutOrderApi extends BaseController {
|
||||
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());
|
||||
}
|
||||
}
|
||||
+9
@@ -294,4 +294,13 @@ public class ReserveStockOutOrderApi extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成出库预约单号
|
||||
*/
|
||||
@ApiOperation("生成出库单号")
|
||||
@GetMapping("/generateOrderNumber")
|
||||
public AjaxResult generateOrderNumber() {
|
||||
return AjaxResult.success(stockOutOrderApplicationService.generateReserveOrderNumber());
|
||||
}
|
||||
|
||||
}
|
||||
+5
-1
@@ -50,7 +50,9 @@ public class ReservationMaterialInventoryApi extends BaseController {
|
||||
@ApiOperation("查询物料库存列表")
|
||||
@GetMapping("/list")
|
||||
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,使用精确匹配(不模糊匹配)
|
||||
String shipperName = null; // 保存查询到的货主名称
|
||||
@@ -78,6 +80,8 @@ public class ReservationMaterialInventoryApi extends BaseController {
|
||||
ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
|
||||
materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate());
|
||||
materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate());
|
||||
materialInventoryDO.setExpiryDateStart(expiryDateStart);
|
||||
materialInventoryDO.setExpiryDateEnd(expiryDateEnd);
|
||||
startPage();
|
||||
// 使用带批次属性的查询方法,批次属性值从库存表中获取
|
||||
List<ReservationMaterialInventoryPO> list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO);
|
||||
|
||||
+12
@@ -281,4 +281,16 @@ public class ReservationStockInOrderApi extends BaseController {
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -256,4 +256,13 @@ public class ReserveStockInOrderApi extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成入库预约单号
|
||||
*/
|
||||
@ApiOperation("生成入库单号")
|
||||
@GetMapping("/generateOrderNumber")
|
||||
public AjaxResult generateOrderNumber() {
|
||||
return AjaxResult.success(stockInOrderApplicationService.generateReserveOrderNumber());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
# server-addr: 10.33.0.129:6010
|
||||
server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
|
||||
+6
@@ -650,4 +650,10 @@
|
||||
<update id="delWShOrderDetail">
|
||||
update "NGWL_TEST_WMS".RECEIPT_MATERIAL_DETAIL set DEL_FLAG = 2 where DEL_FLAG = 1 and RECEIPT_ORDER_NUMBER = #{receiptOrderNumber}
|
||||
</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>
|
||||
+5
@@ -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>
|
||||
|
||||
<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>
|
||||
+44
@@ -276,6 +276,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productionDateStr != null and productionDateStr != ''">
|
||||
AND TO_CHAR(a.production_date, 'yyyy-MM-dd') = #{productionDateStr}
|
||||
</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>
|
||||
|
||||
<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
|
||||
</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
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
|
||||
+22
-4
@@ -519,21 +519,27 @@
|
||||
<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>
|
||||
<select id="getByCode" 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 = #{code}
|
||||
<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} and ORGANIZATION_ID = #{orgId}
|
||||
</select>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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 CUSTOMER_NC_CODE from "NGWL_TEST_USER".USER_SHIPPER where 1 = 1 and DEL_FLAG = 1 and USER_ID = #{id} limit 1
|
||||
</select>
|
||||
@@ -649,4 +655,16 @@
|
||||
<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>
|
||||
|
||||
<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>
|
||||
+10
@@ -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>
|
||||
|
||||
<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>
|
||||
@@ -777,4 +777,15 @@
|
||||
AND USER_ID = #{id} limit 1
|
||||
</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>
|
||||
@@ -517,4 +517,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="boxPalletNo" column="box_pallet_no"/>
|
||||
</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>
|
||||
+4
-1
@@ -250,7 +250,10 @@ public class MaterialBaseInfoApplicationService {
|
||||
}
|
||||
}
|
||||
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()) {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
List<Map<String, Object>> listNc = null;
|
||||
|
||||
+1
@@ -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.MaterialInventoryQueryListDO;
|
||||
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.po.MaterialBarCodePO;
|
||||
import com.mhd.wms.domain.materialMoreDetail.repository.po.MaterialMoreDetailPO;
|
||||
|
||||
+2
@@ -32,6 +32,8 @@ public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory>
|
||||
public List<MaterialInventoryPO> queryListByKw(MaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-物料
|
||||
public List<MaterialInventoryPO> queryListByWl(MaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-物料+过期日期
|
||||
public List<MaterialInventoryPO> queryListByWlExpiry(MaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-货主
|
||||
public List<MaterialInventoryPO> queryListByHz(MaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-货主+物料(同一物料在不同货主下各一行)
|
||||
|
||||
+2
@@ -85,6 +85,8 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
return materialInventoryMapper.queryListByKw(materialInventoryDO);
|
||||
} else if ("wlkw".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
|
||||
} else if ("wlExpiry".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByWlExpiry(materialInventoryDO);
|
||||
} else if ("all".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryList(materialInventoryDO);
|
||||
} else {
|
||||
|
||||
+5
-1
@@ -55,7 +55,9 @@ public class MaterialInventoryApi extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO,
|
||||
@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)) {
|
||||
materialInventoryDTO.setExcludeZeroInventoryQuantity(true);
|
||||
@@ -86,6 +88,8 @@ public class MaterialInventoryApi extends BaseController {
|
||||
MaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
|
||||
materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate());
|
||||
materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate());
|
||||
materialInventoryDO.setExpiryDateStart(expiryDateStart);
|
||||
materialInventoryDO.setExpiryDateEnd(expiryDateEnd);
|
||||
Date updateTime = materialInventoryDTO.getUpdateTime();
|
||||
if (updateTime != null) {
|
||||
LocalDateTime localDateTime = updateTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
|
||||
|
||||
@@ -16,7 +16,7 @@ spring:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# server-addr: 10.33.0.129:6010
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
server-addr: 10.102.192.31:6848
|
||||
server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
@@ -25,7 +25,7 @@ spring:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# server-addr: 10.33.0.129:6010
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
server-addr: 10.102.192.31:6848
|
||||
server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
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
|
||||
</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 行;库位取该货主+该物料下创建时间最新的一条明细 -->
|
||||
<select id="queryListByHzWl" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
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
|
||||
order by max(b.material_name), max(a.shipper_name), a.batch_number
|
||||
</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">
|
||||
group by a.storage_location_id
|
||||
order by max(a.storage_location_code)
|
||||
|
||||
Reference in New Issue
Block a user