Compare commits
93
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14a5aedf15 | ||
|
|
d4f660bc7e | ||
|
|
64bb96c97c | ||
|
|
9df65779ad | ||
|
|
176a0aa879 | ||
|
|
1241256787 | ||
|
|
5e65d63a4f | ||
|
|
296176c85e | ||
|
|
993746ee41 | ||
|
|
6a0818350a | ||
|
|
1b8a75aea5 | ||
|
|
76a290dc58 | ||
|
|
969d90fff5 | ||
|
|
23b5f96a0c | ||
|
|
02de8706e2 | ||
|
|
e6aa8d59e2 | ||
|
|
4b29406701 | ||
|
|
1c29c7e5e4 | ||
|
|
add7ef60db | ||
|
|
d14cea759a | ||
|
|
4fde6e1a9c | ||
|
|
0f88ad75b9 | ||
|
|
067fe1c2c9 | ||
|
|
6b2adce82f | ||
|
|
bee31cf944 | ||
|
|
552a685bb1 | ||
|
|
1c46de4fb7 | ||
|
|
a66177e21b | ||
|
|
fedeece533 | ||
|
|
ae138915ae | ||
|
|
57b8dcfb02 | ||
|
|
b45af55cdd | ||
|
|
3991496617 | ||
|
|
261bb07fb0 | ||
|
|
b18fa5938a | ||
|
|
ba3a90471a | ||
|
|
c5a39d23f2 | ||
|
|
cb136a19b4 | ||
|
|
0f26cd3d0d | ||
|
|
57649dbdfa | ||
|
|
b55c890f7e | ||
|
|
315d96063a | ||
|
|
897e5f195f | ||
|
|
b5b7143d7c | ||
|
|
f06c210ae9 | ||
|
|
4f38ac7cd6 | ||
|
|
488fdfc50e | ||
|
|
1cdc1878a0 | ||
|
|
2c91368278 | ||
|
|
c0f70715c7 | ||
|
|
c93445ca4c | ||
|
|
cb9d09c899 | ||
|
|
f3aec5d42f | ||
|
|
bcd7991725 | ||
|
|
db5e0e1a66 | ||
|
|
ba8dbdd859 | ||
|
|
f1967dd40f | ||
|
|
505f0aff5e | ||
|
|
b9dd2999f1 | ||
|
|
091c971f30 | ||
|
|
2de4efbe65 | ||
|
|
e5ef8740de | ||
|
|
661e57ce62 | ||
|
|
49233cf19b | ||
|
|
b96db591f2 | ||
|
|
236b047f5e | ||
|
|
feba6ff672 | ||
|
|
8caf83b823 | ||
|
|
789c9ac29c | ||
|
|
925eeba899 | ||
|
|
56b39702b5 | ||
|
|
8414fa1509 | ||
|
|
4b382e4d8f | ||
|
|
b80668145a | ||
|
|
81841b7ad0 | ||
|
|
e366f78081 | ||
|
|
a12ac94dd3 | ||
|
|
d1ce20abae | ||
|
|
df6b11a8bb | ||
|
|
ef53355b87 | ||
|
|
04545a8219 | ||
|
|
95d232623b | ||
|
|
498574763b | ||
|
|
c852ef1b8b | ||
|
|
f660c66027 | ||
|
|
c1e062082a | ||
|
|
e77937fb89 | ||
|
|
6b78248531 | ||
|
|
21db85ef2b | ||
|
|
f32f43ab18 | ||
|
|
eb3ada8335 | ||
|
|
49f6832d3f | ||
|
|
60bc140195 |
Binary file not shown.
@@ -66,4 +66,8 @@ public interface OmsServiceFeign {
|
||||
@ApiOperation("批量推送")
|
||||
@PostMapping("/reservationStockOutOrderApi/batchPushByNumber")
|
||||
public AjaxResult batchPushByNumber(@RequestBody List<String> numberList);
|
||||
|
||||
@ApiOperation("保存电子签名记录")
|
||||
@PostMapping("/electronicSignatureApi/saveSignature")
|
||||
public AjaxResult saveSignature(@RequestBody ElectronicSignatureSyncDTO saveDTO);
|
||||
}
|
||||
@@ -165,6 +165,10 @@ public interface UserServiceFeign {
|
||||
@GetMapping("/userShipperApi/userShipperListAll")
|
||||
public AjaxResult<?> userShipperListAll();
|
||||
|
||||
@ApiOperation("查询租户下全部托运人")
|
||||
@GetMapping("/userShipperApi/userShipperListAllByOrg")
|
||||
public AjaxResult<?> userShipperListAllByOrg(@RequestParam("orgCode") Long orgCode);
|
||||
|
||||
@ApiOperation("查询租户下全部承运人")
|
||||
@GetMapping("/userDriverApi/userDriverListAll")
|
||||
public AjaxResult<?> userDriverListAll();
|
||||
|
||||
@@ -141,4 +141,14 @@ public interface WmsServiceFeign {
|
||||
@ApiOperation("生成拣货单")
|
||||
@PostMapping("/stockOutOrderApi/genPickingOrderByOms")
|
||||
public AjaxResult genPickingOrderByOms(@RequestBody com.mhd.system.api.domain.StockOutOrderDTO stockOutOrderDTO);
|
||||
|
||||
/**
|
||||
* OMS批量签名:更新WMS入/出库单签名字段
|
||||
*
|
||||
* <p>OMS端勾选记录批量签名后,通过此Feign调用WMS的 /stockSignatureApi/batchSign 接口,
|
||||
* 同步更新WMS stock_in_order / stock_out_order 表的签名状态、签名时间、签名图片、签名备注。</p>
|
||||
*/
|
||||
@ApiOperation("OMS批量签名-同步WMS入/出库单签名字段")
|
||||
@PostMapping("/stockSignatureApi/batchSign")
|
||||
public AjaxResult batchSignWms(@RequestBody SignatureBatchFeignDTO dto);
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
package com.mhd.system.api.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名同步DTO(WMS端通过Feign调用OMS)
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicSignatureSyncDTO {
|
||||
|
||||
@ApiModelProperty("订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("订单号")
|
||||
private String orderNumber;
|
||||
|
||||
@ApiModelProperty("订单类型:IN-入库 OUT-出库")
|
||||
private String orderType;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long createBy;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
private String createByName;
|
||||
|
||||
@ApiModelProperty("物料明细列表")
|
||||
private List<MaterialDetailItem> materialDetailList;
|
||||
|
||||
@Data
|
||||
public static class MaterialDetailItem {
|
||||
|
||||
@ApiModelProperty("物料基础信息ID")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@ApiModelProperty("单位代码")
|
||||
private String unitCode;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("批次号")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("库区ID")
|
||||
private Long storageSectionId;
|
||||
|
||||
@ApiModelProperty("库区编码")
|
||||
private String storageSectionCode;
|
||||
|
||||
@ApiModelProperty("库区名称")
|
||||
private String storageSectionName;
|
||||
|
||||
@ApiModelProperty("库位ID")
|
||||
private Long storageLocationId;
|
||||
|
||||
@ApiModelProperty("库位编码")
|
||||
private String storageLocationCode;
|
||||
|
||||
@ApiModelProperty("库位名称")
|
||||
private String storageLocationName;
|
||||
|
||||
@ApiModelProperty("业务唯一ID")
|
||||
private Long uniqueId;
|
||||
}
|
||||
}
|
||||
+21
-3
@@ -240,9 +240,7 @@ public class InMaterialDetail extends BaseVOEntity {
|
||||
@ApiModelProperty("父级唯一Id")
|
||||
private Long parentUniqueId;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@ApiModelProperty("越库单id")
|
||||
private Long overStockId;
|
||||
@@ -376,4 +374,24 @@ public class InMaterialDetail extends BaseVOEntity {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date drinkDate;
|
||||
|
||||
@ApiModelProperty("来货验收是否合格;1 合格,0 不合格")
|
||||
@Excel(name = "来货验收是否合格;1 合格,0 不合格")
|
||||
private String arrivalAcceptQualified;
|
||||
|
||||
@ApiModelProperty("包装是否破损;1 破损,0 完好")
|
||||
@Excel(name = "包装是否破损;1 破损,0 完好")
|
||||
private String packageDamaged;
|
||||
|
||||
@ApiModelProperty("是否解冻 / 水渍;1 是,0 否")
|
||||
@Excel(name = "是否解冻 / 水渍;1 是,0 否")
|
||||
private String isThawWaterstain;
|
||||
|
||||
@ApiModelProperty("问题货是否已通知客户;1 已通知,0 未通知")
|
||||
@Excel(name = "问题货是否已通知客户;1 已通知,0 未通知")
|
||||
private String notifyCustomerAbnormal;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.mhd.system.api.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OMS→WMS 批量签名 Feign DTO
|
||||
*
|
||||
* <p>OMS端批量签名时,通过此DTO调用WMS的批量签名接口,
|
||||
* 更新WMS stock_in_order / stock_out_order 表的签名字段。</p>
|
||||
*/
|
||||
@Data
|
||||
public class SignatureBatchFeignDTO {
|
||||
|
||||
@ApiModelProperty("入库单ID列表")
|
||||
private List<Long> inOrderIds;
|
||||
|
||||
@ApiModelProperty("出库单ID列表")
|
||||
private List<Long> outOrderIds;
|
||||
|
||||
@ApiModelProperty("签名状态:2-已签名")
|
||||
private Integer signatureStatus;
|
||||
|
||||
@ApiModelProperty("签名时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date signatureTime;
|
||||
|
||||
@ApiModelProperty("手写签名图片(base64或URL,单张)")
|
||||
private String signaturePic;
|
||||
|
||||
@ApiModelProperty("拍照取证图片(逗号分隔多张URL)")
|
||||
private String evidencePics;
|
||||
|
||||
@ApiModelProperty("签名备注")
|
||||
private String signatureRemark;
|
||||
}
|
||||
@@ -124,4 +124,20 @@ public class WarehouseFeignPO extends BaseVOEntity{
|
||||
@Excel(name = "作业模式")
|
||||
private String workMode;
|
||||
|
||||
@ApiModelProperty("订单号生成规则(0-日期累加 1-历史累加)")
|
||||
@Excel(name = "单号生成规则")
|
||||
private String orderNoGenerateRule;
|
||||
|
||||
@ApiModelProperty("入库单号首字母前缀")
|
||||
@Excel(name = "入库单号首字母前缀")
|
||||
private String inOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("出库单号首字母前缀")
|
||||
@Excel(name = "出库单号首字母前缀")
|
||||
private String outOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("样品出库单号首字母前缀")
|
||||
@Excel(name = "样品出库单号首字母前缀")
|
||||
private String sampleOutOrderNoPrefix;
|
||||
|
||||
}
|
||||
+5
@@ -90,6 +90,11 @@ public class RemoteOmsFeignFallbackFactory implements FallbackFactory<OmsService
|
||||
public AjaxResult batchPushByNumber(List<String> numberList) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult saveSignature(ElectronicSignatureSyncDTO saveDTO) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+5
@@ -140,6 +140,11 @@ public class RemoteUserFeignFallbackFactory implements FallbackFactory<UserServi
|
||||
return AjaxResult.error("获取租户托运人失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult<?> userShipperListAllByOrg(Long orgCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult<?> userDriverListAll() {
|
||||
return AjaxResult.error("获取租户承运人失败");
|
||||
|
||||
+6
@@ -119,6 +119,12 @@ public class RemoteWmsFallbackFactory implements FallbackFactory<WmsServiceFeign
|
||||
public AjaxResult genPickingOrderByOms(StockOutOrderDTO stockOutOrderDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult batchSignWms(SignatureBatchFeignDTO dto) {
|
||||
log.error("WMS批量签名调用失败");
|
||||
return AjaxResult.error("WMS批量签名调用失败:" + cause.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.mhd.bi.domain.biPlatformRealData.repository.mapper;
|
||||
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 月台监测-真实数据 Mapper
|
||||
* 数据来源:TEST_NGWL_YMS 库(达梦,跨库访问)
|
||||
* 注:列名按达梦默认大写规则;若实际库中小写请反馈调整
|
||||
*/
|
||||
public interface BiPlatformRealDataMapper {
|
||||
|
||||
/** 作业车辆状态列表 */
|
||||
List<RealPlatformVehiclePO> queryVehicles();
|
||||
|
||||
/** 月台实时概览(总数 / 当前作业中) */
|
||||
RealPlatformOverviewPO queryPlatformOverview();
|
||||
|
||||
/** 今日作业任务数 */
|
||||
Long countTodayTasks();
|
||||
|
||||
/** 车辆状态统计(今日) */
|
||||
RealVehicleStatusPO queryVehicleStatusToday();
|
||||
|
||||
/** 本月任务量 */
|
||||
Long countMonthTasks();
|
||||
|
||||
/** 任务负荷(今日 24 小时) */
|
||||
List<RealTaskLoadPO> queryTaskLoadToday();
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.mhd.bi.domain.biPlatformRealData.repository.po;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 月台实时概览(真实数据,来自 TEST_NGWL_YMS.QMS_WINDOW_INFO)
|
||||
*/
|
||||
@Data
|
||||
public class RealPlatformOverviewPO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 月台总数 */
|
||||
private Long totalPlatforms;
|
||||
|
||||
/** 当前作业中(月台作业状态=占用) */
|
||||
private Long operatingPlatforms;
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.mhd.bi.domain.biPlatformRealData.repository.po;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 月台监测-作业车辆(真实数据,来自 TEST_NGWL_YMS.QMS_MAIN_BUSINESS 等)
|
||||
*/
|
||||
@Data
|
||||
public class RealPlatformVehiclePO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 车牌号(qms_main_business.CARNO) */
|
||||
private String plateNumber;
|
||||
|
||||
/** 流程状态(qms_main_business.FLOWSTATUS) */
|
||||
private String status;
|
||||
|
||||
/** 叫号月台(qms_queue_list.WINDOWNAME) */
|
||||
private String platformId;
|
||||
|
||||
/** 月台作业时长,分钟(EXITTIME - ENTRYTIME) */
|
||||
private Long platformDuration;
|
||||
|
||||
/** 预约申请时间(qms_main_business.CREATE_TIME) */
|
||||
private String appointmentTime;
|
||||
|
||||
/** 作业楼层(qms_window_info.PLATFORMFLOOR) */
|
||||
private String workFloor;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.mhd.bi.domain.biPlatformRealData.repository.po;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 任务负荷统计(按小时,来自 TEST_NGWL_YMS.QMS_MAIN_BUSINESS)
|
||||
*/
|
||||
@Data
|
||||
public class RealTaskLoadPO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 0-23 小时 */
|
||||
private Integer hourOfDay;
|
||||
|
||||
/** 该小时段任务数 */
|
||||
private Long taskCount;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.mhd.bi.domain.biPlatformRealData.repository.po;
|
||||
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 作业车辆状态统计(真实数据,来自 TEST_NGWL_YMS.QMS_MAIN_BUSINESS)
|
||||
*/
|
||||
@Data
|
||||
public class RealVehicleStatusPO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 今日预约车辆 */
|
||||
private Long todayReservedVehicles;
|
||||
|
||||
/** 当前未签到 */
|
||||
private Long notCheckedIn;
|
||||
|
||||
/** 当前作业中 */
|
||||
private Long operatingVehicles;
|
||||
|
||||
/** 作业完成 */
|
||||
private Long completedVehicles;
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
package com.mhd.bi.domain.biPlatformRealData.service;
|
||||
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.mapper.BiPlatformRealDataMapper;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO;
|
||||
import com.mhd.bi.domain.biSnapshotSync.support.BiSnapshotWeeklyRandomDataBuilder;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformSurveillanceVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformVehicleItemVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.TaskLoadItemVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* 月台监测-真实数据业务层(封装 YMS 跨库查询)
|
||||
* 注:列名大小写、字段类型需以实际库为准;若 YMS 库无数据/无权限,相关方法应返回空/0,不影响写死字段写入快照
|
||||
*/
|
||||
@Service
|
||||
public class BiPlatformRealDataService {
|
||||
|
||||
@Resource
|
||||
private BiPlatformRealDataMapper biPlatformRealDataMapper;
|
||||
|
||||
public List<RealPlatformVehiclePO> queryVehicles() {
|
||||
try {
|
||||
return biPlatformRealDataMapper.queryVehicles();
|
||||
} catch (Exception e) {
|
||||
return java.util.Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
public RealPlatformOverviewPO queryPlatformOverview() {
|
||||
try {
|
||||
RealPlatformOverviewPO po = biPlatformRealDataMapper.queryPlatformOverview();
|
||||
if (po == null) {
|
||||
po = new RealPlatformOverviewPO();
|
||||
}
|
||||
if (po.getTotalPlatforms() == null) po.setTotalPlatforms(0L);
|
||||
if (po.getOperatingPlatforms() == null) po.setOperatingPlatforms(0L);
|
||||
return po;
|
||||
} catch (Exception e) {
|
||||
RealPlatformOverviewPO po = new RealPlatformOverviewPO();
|
||||
po.setTotalPlatforms(0L);
|
||||
po.setOperatingPlatforms(0L);
|
||||
return po;
|
||||
}
|
||||
}
|
||||
|
||||
public long countTodayTasks() {
|
||||
try {
|
||||
Long n = biPlatformRealDataMapper.countTodayTasks();
|
||||
return n == null ? 0L : n;
|
||||
} catch (Exception e) {
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public RealVehicleStatusPO queryVehicleStatusToday() {
|
||||
try {
|
||||
RealVehicleStatusPO po = biPlatformRealDataMapper.queryVehicleStatusToday();
|
||||
if (po == null) po = new RealVehicleStatusPO();
|
||||
if (po.getTodayReservedVehicles() == null) po.setTodayReservedVehicles(0L);
|
||||
if (po.getNotCheckedIn() == null) po.setNotCheckedIn(0L);
|
||||
if (po.getOperatingVehicles() == null) po.setOperatingVehicles(0L);
|
||||
if (po.getCompletedVehicles() == null) po.setCompletedVehicles(0L);
|
||||
return po;
|
||||
} catch (Exception e) {
|
||||
RealVehicleStatusPO po = new RealVehicleStatusPO();
|
||||
po.setTodayReservedVehicles(0L);
|
||||
po.setNotCheckedIn(0L);
|
||||
po.setOperatingVehicles(0L);
|
||||
po.setCompletedVehicles(0L);
|
||||
return po;
|
||||
}
|
||||
}
|
||||
|
||||
public long countMonthTasks() {
|
||||
try {
|
||||
Long n = biPlatformRealDataMapper.countMonthTasks();
|
||||
return n == null ? 0L : n;
|
||||
} catch (Exception e) {
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public List<RealTaskLoadPO> queryTaskLoadToday() {
|
||||
try {
|
||||
return biPlatformRealDataMapper.queryTaskLoadToday();
|
||||
} catch (Exception e) {
|
||||
return java.util.Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时组装月台监测数据:真实字段查 YMS 库,写死字段保留静态值。
|
||||
* 每次调用实时查库,不经过快照表。
|
||||
*/
|
||||
public PlatformSurveillanceVO buildRealTimePlatformSurveillance() {
|
||||
Random r = new Random();
|
||||
PlatformSurveillanceVO template = BiSnapshotWeeklyRandomDataBuilder.platformSurveillance(r);
|
||||
|
||||
// 作业车辆列表
|
||||
List<RealPlatformVehiclePO> realVehicles = queryVehicles();
|
||||
List<PlatformVehicleItemVO> vehicleVos = new ArrayList<>();
|
||||
for (RealPlatformVehiclePO rv : realVehicles) {
|
||||
PlatformVehicleItemVO v = new PlatformVehicleItemVO();
|
||||
v.setAppointmentTime(rv.getAppointmentTime());
|
||||
v.setWorkFloor(rv.getWorkFloor());
|
||||
v.setPlateNumber(rv.getPlateNumber());
|
||||
v.setStatus(rv.getStatus());
|
||||
v.setPlatformId(rv.getPlatformId());
|
||||
v.setPlatformDuration(rv.getPlatformDuration() == null ? 0 : rv.getPlatformDuration().intValue());
|
||||
vehicleVos.add(v);
|
||||
}
|
||||
if (!vehicleVos.isEmpty()) {
|
||||
template.setVehicles(vehicleVos);
|
||||
}
|
||||
|
||||
// 月台实时概览
|
||||
RealPlatformOverviewPO ov = queryPlatformOverview();
|
||||
if (template.getPlatformOverview() != null) {
|
||||
template.getPlatformOverview().setTotalPlatforms(ov.getTotalPlatforms().intValue());
|
||||
template.getPlatformOverview().setOperatingPlatforms(ov.getOperatingPlatforms().intValue());
|
||||
int total = ov.getTotalPlatforms().intValue();
|
||||
int occ = ov.getOperatingPlatforms().intValue();
|
||||
int rate = total > 0 ? (int) Math.round(((double) occ / total) * 100.0) : 0;
|
||||
template.getPlatformOverview().setCurrentOccupancyRate(rate);
|
||||
}
|
||||
long todayTasks = countTodayTasks();
|
||||
if (template.getPlatformOverview() != null) {
|
||||
template.getPlatformOverview().setTodayTasks((int) todayTasks);
|
||||
}
|
||||
|
||||
// 作业车辆状态统计
|
||||
RealVehicleStatusPO vs = queryVehicleStatusToday();
|
||||
if (template.getVehicleStatus() != null) {
|
||||
template.getVehicleStatus().setTodayReservedVehicles(vs.getTodayReservedVehicles().intValue());
|
||||
template.getVehicleStatus().setNotCheckedIn(vs.getNotCheckedIn().intValue());
|
||||
template.getVehicleStatus().setOperatingVehicles(vs.getOperatingVehicles().intValue());
|
||||
template.getVehicleStatus().setCompletedVehicles(vs.getCompletedVehicles().intValue());
|
||||
}
|
||||
|
||||
// 本月任务统计 taskTotal
|
||||
long monthTasks = countMonthTasks();
|
||||
if (template.getMonthlyTaskStatistics() != null) {
|
||||
template.getMonthlyTaskStatistics().setTaskTotal((int) monthTasks);
|
||||
}
|
||||
|
||||
// 任务负荷(今日 24 小时)
|
||||
List<RealTaskLoadPO> loads = queryTaskLoadToday();
|
||||
if (!loads.isEmpty() && template.getTaskLoadStatistics() != null) {
|
||||
Map<Integer, Long> hourMap = new HashMap<>();
|
||||
for (RealTaskLoadPO l : loads) {
|
||||
hourMap.put(l.getHourOfDay(), l.getTaskCount());
|
||||
}
|
||||
for (TaskLoadItemVO item : template.getTaskLoadStatistics()) {
|
||||
Integer hour = parseHourFromLabel(item.getTime());
|
||||
if (hour != null) {
|
||||
Long n = hourMap.get(hour);
|
||||
if (n != null) item.setTaskCount(n.intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
private static Integer parseHourFromLabel(String label) {
|
||||
if (label == null) return null;
|
||||
try {
|
||||
String s = label.replace("时", "").trim();
|
||||
return Integer.parseInt(s);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+91
-2
@@ -13,10 +13,20 @@ import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformSurveillance
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.hkMacaoZone.HkMacaoServiceZoneVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.transportZone.TransportOperationZoneVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.warehouseZone.WarehouseOperationZoneVO;
|
||||
import com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.PlatformVehicleItemVO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.service.BiPlatformRealDataService;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO;
|
||||
import com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
@@ -34,6 +44,7 @@ public class BiReportSnapshotSyncService {
|
||||
|
||||
private final BiSnapshotWriteMapper biSnapshotWriteMapper;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final BiPlatformRealDataService biPlatformRealDataService;
|
||||
|
||||
/**
|
||||
* 依次同步各快照表;单表失败不影响其它表,只记日志。
|
||||
@@ -137,9 +148,87 @@ public class BiReportSnapshotSyncService {
|
||||
return BiSnapshotWeeklyRandomDataBuilder.warehouseTransport(new Random());
|
||||
}
|
||||
|
||||
/** TODO 业务落地:改为查询真实数据。临时实现见 {@link BiSnapshotWeeklyRandomDataBuilder#platformSurveillance(Random)}。 */
|
||||
/** TODO 业务落地:部分字段改为真实数据,其余仍写死。 */
|
||||
protected PlatformSurveillanceVO buildPlatformSurveillanceSnapshot() {
|
||||
return BiSnapshotWeeklyRandomDataBuilder.platformSurveillance(new Random());
|
||||
Random r = new Random();
|
||||
// 写死数据复用原 builder
|
||||
PlatformSurveillanceVO template = BiSnapshotWeeklyRandomDataBuilder.platformSurveillance(r);
|
||||
|
||||
// ====== 真实数据:作业车辆列表 ======
|
||||
List<RealPlatformVehiclePO> realVehicles = biPlatformRealDataService.queryVehicles();
|
||||
List<PlatformVehicleItemVO> vehicleVos = new ArrayList<>();
|
||||
for (RealPlatformVehiclePO rv : realVehicles) {
|
||||
PlatformVehicleItemVO v = new PlatformVehicleItemVO();
|
||||
v.setAppointmentTime(rv.getAppointmentTime());
|
||||
v.setWorkFloor(rv.getWorkFloor());
|
||||
v.setPlateNumber(rv.getPlateNumber());
|
||||
v.setStatus(rv.getStatus());
|
||||
v.setPlatformId(rv.getPlatformId());
|
||||
v.setPlatformDuration(rv.getPlatformDuration() == null ? 0 : rv.getPlatformDuration().intValue());
|
||||
vehicleVos.add(v);
|
||||
}
|
||||
if (!vehicleVos.isEmpty()) {
|
||||
template.setVehicles(vehicleVos);
|
||||
}
|
||||
|
||||
// ====== 真实数据:月台实时概览 ======
|
||||
RealPlatformOverviewPO ov = biPlatformRealDataService.queryPlatformOverview();
|
||||
if (template.getPlatformOverview() != null) {
|
||||
template.getPlatformOverview().setTotalPlatforms(ov.getTotalPlatforms().intValue());
|
||||
template.getPlatformOverview().setOperatingPlatforms(ov.getOperatingPlatforms().intValue());
|
||||
int total = ov.getTotalPlatforms().intValue();
|
||||
int occ = ov.getOperatingPlatforms().intValue();
|
||||
int rate = total > 0 ? (int) Math.round(((double) occ / total) * 100.0) : 0;
|
||||
template.getPlatformOverview().setCurrentOccupancyRate(rate);
|
||||
}
|
||||
long todayTasks = biPlatformRealDataService.countTodayTasks();
|
||||
if (template.getPlatformOverview() != null) {
|
||||
template.getPlatformOverview().setTodayTasks((int) todayTasks);
|
||||
}
|
||||
|
||||
// ====== 真实数据:作业车辆状态统计 ======
|
||||
RealVehicleStatusPO vs = biPlatformRealDataService.queryVehicleStatusToday();
|
||||
if (template.getVehicleStatus() != null) {
|
||||
template.getVehicleStatus().setTodayReservedVehicles(vs.getTodayReservedVehicles().intValue());
|
||||
template.getVehicleStatus().setNotCheckedIn(vs.getNotCheckedIn().intValue());
|
||||
template.getVehicleStatus().setOperatingVehicles(vs.getOperatingVehicles().intValue());
|
||||
template.getVehicleStatus().setCompletedVehicles(vs.getCompletedVehicles().intValue());
|
||||
}
|
||||
|
||||
// ====== 真实数据:本月任务统计 taskTotal ======
|
||||
long monthTasks = biPlatformRealDataService.countMonthTasks();
|
||||
if (template.getMonthlyTaskStatistics() != null) {
|
||||
template.getMonthlyTaskStatistics().setTaskTotal((int) monthTasks);
|
||||
}
|
||||
|
||||
// ====== 真实数据:任务负荷(今日 24 小时) ======
|
||||
List<RealTaskLoadPO> loads = biPlatformRealDataService.queryTaskLoadToday();
|
||||
if (!loads.isEmpty() && template.getTaskLoadStatistics() != null) {
|
||||
Map<Integer, Long> hourMap = new HashMap<>();
|
||||
for (RealTaskLoadPO l : loads) {
|
||||
hourMap.put(l.getHourOfDay(), l.getTaskCount());
|
||||
}
|
||||
for (com.mhd.bi.interfaces.facadeApi.biReport.vo.platform.TaskLoadItemVO item : template.getTaskLoadStatistics()) {
|
||||
Integer hour = parseHourFromLabel(item.getTime());
|
||||
if (hour != null) {
|
||||
Long n = hourMap.get(hour);
|
||||
if (n != null) item.setTaskCount(n.intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
private static Integer parseHourFromLabel(String label) {
|
||||
if (label == null) return null;
|
||||
// "15时" -> 15
|
||||
try {
|
||||
String s = label.replace("时", "").trim();
|
||||
return Integer.parseInt(s);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.mhd.bi.interfaces.facadeApi.biReport;
|
||||
import com.mhd.bi.domain.biSnapshotSync.service.BiReportSnapshotSyncService;
|
||||
import com.mhd.bi.domain.biComprehensive.service.BiComprehensiveReportService;
|
||||
import com.mhd.bi.domain.biPlatformSurveillance.service.BiPlatformSurveillanceReportService;
|
||||
import com.mhd.bi.domain.biPlatformRealData.service.BiPlatformRealDataService;
|
||||
import com.mhd.bi.domain.biOverallOperation.service.BiOverallOperationReportService;
|
||||
import com.mhd.bi.domain.biHkMacaoServiceZone.service.BiHkMacaoServiceZoneReportService;
|
||||
import com.mhd.bi.domain.biTransportOperationZone.service.BiTransportOperationZoneReportService;
|
||||
@@ -48,6 +49,9 @@ public class BiReportApi extends BaseController {
|
||||
@Autowired
|
||||
private BiPlatformSurveillanceReportService biPlatformSurveillanceReportService;
|
||||
|
||||
@Autowired
|
||||
private BiPlatformRealDataService biPlatformRealDataService;
|
||||
|
||||
@Autowired
|
||||
private BiOverallOperationReportService biOverallOperationReportService;
|
||||
|
||||
@@ -92,12 +96,12 @@ public class BiReportApi extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 月台监测指标查询(按照 del_flag=1,按 create_time 最新一条)
|
||||
* 月台监测指标查询(实时查 YMS 库,真实字段 + 写死字段)
|
||||
*/
|
||||
@ApiOperation(value = "月台监测指标查询", notes = "返回 DEL_FLAG=1 且 CREATE_TIME 最新的一条快照")
|
||||
@ApiOperation(value = "月台监测指标查询", notes = "每次调用实时查询 YMS 库组装;部分字段为真实业务数据,部分为写死数据")
|
||||
@GetMapping("/platformSurveillance")
|
||||
public BiApiResult<PlatformSurveillanceVO> platformSurveillance() {
|
||||
PlatformSurveillanceVO data = biPlatformSurveillanceReportService.loadLatestPlatformSurveillance();
|
||||
PlatformSurveillanceVO data = biPlatformRealDataService.buildRealTimePlatformSurveillance();
|
||||
return BiApiResult.ok(data);
|
||||
}
|
||||
//园区物流大屏接口----------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.mhd.bi.domain.biPlatformRealData.repository.mapper.BiPlatformRealDataMapper">
|
||||
|
||||
<!-- 作业车辆状态列表(vehicles):
|
||||
plateNumber <- qms_main_business.CARNO
|
||||
status <- qms_main_business.FLOWSTATUS
|
||||
platformId <- qms_queue_list.WINDOWNAME(按主业务的某个窗口关联键关联;此处用 businessNo = windowNo 关联,根据实际表调整)
|
||||
platformDuration <- qms_main_business.EXITTIME - ENTRYTIME(分钟)
|
||||
appointmentTime <- qms_main_business.CREATE_TIME(创建时间)
|
||||
workFloor <- qms_window_info.PLATFORMFLOOR(按 platformId 关联窗口号)
|
||||
注:列名按达梦默认大写规则;若实际为小写,请反馈调整 -->
|
||||
<select id="queryVehicles" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO">
|
||||
SELECT
|
||||
mb.CARNO AS plateNumber,
|
||||
mb.FLOWSTATUS AS status,
|
||||
ql.WINDOWNAME AS platformId,
|
||||
CASE
|
||||
WHEN mb.EXITTIME IS NOT NULL AND mb.ENTRYTIME IS NOT NULL
|
||||
THEN CAST((mb.EXITTIME - mb.ENTRYTIME) AS BIGINT)
|
||||
ELSE 0
|
||||
END AS platformDuration,
|
||||
TO_CHAR(mb.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') AS appointmentTime,
|
||||
wi.PLATFORMFLOOR AS workFloor
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS mb
|
||||
LEFT JOIN NGWL_TEST_YMS.QMS_QUEUE_LIST ql ON ql.MAIN_BUSINESS_ID = mb.ID
|
||||
LEFT JOIN NGWL_TEST_YMS.QMS_WINDOW_INFO wi ON wi.WINDOW_NO = ql.WINDOWNAME
|
||||
WHERE 1=1
|
||||
AND mb.DEL_FLAG = 1
|
||||
ORDER BY mb.CREATE_TIME DESC
|
||||
LIMIT 50
|
||||
</select>
|
||||
|
||||
<!-- 月台概览:totalPlatforms(总条数)、operatingPlatforms(作业状态=占用/作业中) -->
|
||||
<select id="queryPlatformOverview" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO">
|
||||
SELECT
|
||||
COUNT(1) AS totalPlatforms,
|
||||
SUM(CASE WHEN STATUS = 2 THEN 1 ELSE 0 END) AS operatingPlatforms
|
||||
FROM NGWL_TEST_YMS.QMS_WINDOW_INFO
|
||||
WHERE DEL_FLAG = 1
|
||||
</select>
|
||||
|
||||
<!-- 今日作业任务:实际进入时间是今日的 -->
|
||||
<select id="countTodayTasks" resultType="java.lang.Long">
|
||||
SELECT COUNT(1)
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
WHERE DEL_FLAG = 1
|
||||
AND TRUNC(ENTRYTIME) = TRUNC(SYSDATE)
|
||||
</select>
|
||||
|
||||
<!-- 车辆状态统计:今日的统计(按预约申请时间 / 流程状态) -->
|
||||
<select id="queryVehicleStatusToday" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealVehicleStatusPO">
|
||||
SELECT
|
||||
SUM(CASE WHEN TRUNC(CREATE_TIME) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) AS todayReservedVehicles,
|
||||
SUM(CASE WHEN FLOWSTATUS = '已预约' AND TRUNC(CREATE_TIME) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) AS notCheckedIn,
|
||||
SUM(CASE WHEN FLOWSTATUS IN ('已进场','已称重','已装车','二次称重','已结算','已还卡') AND TRUNC(CREATE_TIME) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) AS operatingVehicles,
|
||||
SUM(CASE WHEN FLOWSTATUS = '已出场' AND TRUNC(CREATE_TIME) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) AS completedVehicles
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
WHERE DEL_FLAG = 1
|
||||
</select>
|
||||
|
||||
<!-- 本月任务量:实际进入时间是本月的 -->
|
||||
<select id="countMonthTasks" resultType="java.lang.Long">
|
||||
SELECT COUNT(1)
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
WHERE DEL_FLAG = 1
|
||||
AND ENTRYTIME IS NOT NULL
|
||||
AND TO_CHAR(ENTRYTIME, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM')
|
||||
</select>
|
||||
|
||||
<!-- 任务负荷(今日 24 小时时段):按 HOUR(ENTRYTIME) 统计 -->
|
||||
<select id="queryTaskLoadToday" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO">
|
||||
SELECT
|
||||
HOUR(ENTRYTIME) AS hourOfDay,
|
||||
COUNT(1) AS taskCount
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
WHERE DEL_FLAG = 1
|
||||
AND ENTRYTIME IS NOT NULL
|
||||
AND TRUNC(ENTRYTIME) = TRUNC(SYSDATE)
|
||||
GROUP BY HOUR(ENTRYTIME)
|
||||
ORDER BY HOUR(ENTRYTIME)
|
||||
</select>
|
||||
</mapper>
|
||||
+2
@@ -33,4 +33,6 @@ public class WarehousePO implements Serializable {
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@Excel(name = "是否启用: 1-否 2-是")
|
||||
private Integer isEnable;
|
||||
}
|
||||
|
||||
+47
@@ -1124,4 +1124,51 @@ public class ContractManageApplicationService {
|
||||
public ContractManagePO getGeneralContract() {
|
||||
return contractManageDomainService.getGeneralContract();
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同导出(合同头字段 + 明细拍平成一行一条明细)
|
||||
*/
|
||||
public List<ContractManageExportVO> buildExportList(ContractManageDO contractManageDO) {
|
||||
List<ContractManagePO> contractList = this.queryList(contractManageDO);
|
||||
List<ContractManageExportVO> exportList = new ArrayList<>();
|
||||
if (contractList == null || contractList.isEmpty()) {
|
||||
return exportList;
|
||||
}
|
||||
List<Long> contractManageIds = contractList.stream()
|
||||
.map(ContractManagePO::getContractManageId)
|
||||
.collect(Collectors.toList());
|
||||
Map<Long, List<ContractManageDetailPO>> detailMap = contractManageDetailDomainService
|
||||
.queryListByManageIds(contractManageIds).stream()
|
||||
.collect(Collectors.groupingBy(ContractManageDetailPO::getContractManageId));
|
||||
|
||||
for (ContractManagePO contract : contractList) {
|
||||
List<ContractManageDetailPO> details = detailMap.get(contract.getContractManageId());
|
||||
if (details != null && !details.isEmpty()) {
|
||||
for (ContractManageDetailPO detail : details) {
|
||||
ContractManageExportVO vo = new ContractManageExportVO();
|
||||
// 合同头字段整体复制
|
||||
BeanUtils.copyProperties(contract, vo);
|
||||
// 明细字段显式赋值(合同头/明细存在同名字段,避免互相覆盖)
|
||||
vo.setSubjectType(detail.getSubjectType());
|
||||
vo.setFirstSubjectCode(detail.getFirstSubjectCode());
|
||||
vo.setFirstSubjectName(detail.getFirstSubjectName());
|
||||
vo.setSecondSubjectCode(detail.getSecondSubjectCode());
|
||||
vo.setSecondSubjectName(detail.getSecondSubjectName());
|
||||
vo.setAccountingStrategy(detail.getAccountingStrategy());
|
||||
vo.setBillingAttributes(detail.getBillingAttributes());
|
||||
vo.setSubjectEffectiveDate(detail.getSubjectEffectiveDate());
|
||||
vo.setSubjectExpirationDate(detail.getSubjectExpirationDate());
|
||||
vo.setDocumentType(detail.getDocumentType());
|
||||
vo.setServiceItemsName(detail.getServiceItemsName());
|
||||
exportList.add(vo);
|
||||
}
|
||||
} else {
|
||||
// 无明细的合同也保留一行头字段
|
||||
ContractManageExportVO vo = new ContractManageExportVO();
|
||||
BeanUtils.copyProperties(contract, vo);
|
||||
exportList.add(vo);
|
||||
}
|
||||
}
|
||||
return exportList;
|
||||
}
|
||||
}
|
||||
+25
@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 合同管理详情
|
||||
@@ -95,5 +96,29 @@ public class ContractManageDetailDomainService {
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据多个合同管理id批量查询合同科目详情(一次SQL查询,避免逐合同N+1)
|
||||
* @param contractManageIds 合同管理id集合
|
||||
* @return 合同科目详情列表
|
||||
*/
|
||||
public List<ContractManageDetailPO> queryListByManageIds(Collection<Long> contractManageIds) {
|
||||
List<ContractManageDetailPO> resultList = new ArrayList<>();
|
||||
if (contractManageIds == null || contractManageIds.isEmpty()) {
|
||||
return resultList;
|
||||
}
|
||||
LambdaQueryWrapper<ContractManageDetail> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(ContractManageDetail::getContractManageId, contractManageIds);
|
||||
queryWrapper.eq(ContractManageDetail::getDelFlag, 1);
|
||||
List<ContractManageDetail> contractManageDetails = contractManageDetailService.list(queryWrapper);
|
||||
if (contractManageDetails != null && contractManageDetails.size() > 0) {
|
||||
for (ContractManageDetail contractManageDetail : contractManageDetails) {
|
||||
ContractManageDetailPO contractManageDetailPO = new ContractManageDetailPO();
|
||||
BeanUtils.copyProperties(contractManageDetail, contractManageDetailPO);
|
||||
resultList.add(contractManageDetailPO);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+16
@@ -130,4 +130,20 @@ public class Warehouse extends BaseVOEntity{
|
||||
@Excel(name = "作业模式")
|
||||
private String workMode;
|
||||
|
||||
@ApiModelProperty("订单号生成规则0日期累加1历史累加")
|
||||
@Excel(name = "单号生成规则")
|
||||
private String orderNoGenerateRule;
|
||||
|
||||
@ApiModelProperty("入库单号首字母前缀")
|
||||
@Excel(name = "入库单号首字母前缀")
|
||||
private String inOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("出库单号首字母前缀")
|
||||
@Excel(name = "出库单号首字母前缀")
|
||||
private String outOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("样品出库单号首字母前缀")
|
||||
@Excel(name = "样品出库单号首字母前缀")
|
||||
private String sampleOutOrderNoPrefix;
|
||||
|
||||
}
|
||||
+17
@@ -131,4 +131,21 @@ public class WarehousePO extends BaseVOEntity{
|
||||
@ApiModelProperty("作业模式")
|
||||
@Excel(name = "作业模式")
|
||||
private String workMode;
|
||||
|
||||
|
||||
@ApiModelProperty("订单号生成规则")
|
||||
@Excel(name = "单号生成规则")
|
||||
private String orderNoGenerateRule;
|
||||
|
||||
@ApiModelProperty("入库单号首字母前缀")
|
||||
@Excel(name = "入库单号首字母前缀")
|
||||
private String inOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("出库单号首字母前缀")
|
||||
@Excel(name = "出库单号首字母前缀")
|
||||
private String outOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("样品出库单号首字母前缀")
|
||||
@Excel(name = "样品出库单号首字母前缀")
|
||||
private String sampleOutOrderNoPrefix;
|
||||
}
|
||||
+17
@@ -139,4 +139,21 @@ public class WarehouseDO extends BaseVOEntity{
|
||||
@ApiModelProperty("作业模式")
|
||||
@Excel(name = "作业模式")
|
||||
private String workMode;
|
||||
|
||||
|
||||
@ApiModelProperty("订单号生成规则")
|
||||
@Excel(name = "单号生成规则")
|
||||
private String orderNoGenerateRule;
|
||||
|
||||
@ApiModelProperty("入库单号首字母前缀")
|
||||
@Excel(name = "入库单号首字母前缀")
|
||||
private String inOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("出库单号首字母前缀")
|
||||
@Excel(name = "出库单号首字母前缀")
|
||||
private String outOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("样品出库单号首字母前缀")
|
||||
@Excel(name = "样品出库单号首字母前缀")
|
||||
private String sampleOutOrderNoPrefix;
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.mhd.basic.interfaces.dto.contractManage;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 合同管理导出对象(合同头字段 + 科目明细字段,拍平为一行一条明细)
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-06-07
|
||||
*/
|
||||
@Data
|
||||
@ApiModel(value = "合同管理导出对象", description = "合同管理导出对象(含明细)")
|
||||
public class ContractManageExportVO {
|
||||
|
||||
/** ====== 合同头字段(与 ContractManagePO 的 @Excel 一致) ====== */
|
||||
@Excel(name = "合同编号")
|
||||
private String contractNumber;
|
||||
|
||||
@Excel(name = "合同名称")
|
||||
private String contractName;
|
||||
|
||||
@Excel(name = "是否通用合同", readConverterExp = "1=是,2=否")
|
||||
private Integer commonContractFlag;
|
||||
|
||||
@Excel(name = "合同类型", readConverterExp = "1=仓储,2=运输,3=其他")
|
||||
private Integer contractType;
|
||||
|
||||
@Excel(name = "合同状态", readConverterExp = "1=未生效,2=使用中,3=已过期,4=已作废")
|
||||
private Integer contractState;
|
||||
|
||||
@Excel(name = "签订单位")
|
||||
private String signingUnit;
|
||||
|
||||
@Excel(name = "结算主体")
|
||||
private String settlementCustomers;
|
||||
|
||||
@Excel(name = "我司身份", readConverterExp = "1=甲方,2=乙方")
|
||||
private Integer ourIdentity;
|
||||
|
||||
@Excel(name = "账期", readConverterExp = "1=每月,2=双月,3=季度")
|
||||
private Integer accountingPeriod;
|
||||
|
||||
@Excel(name = "合同签订日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date signingDate;
|
||||
|
||||
@Excel(name = "合同生效日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date effectiveDate;
|
||||
|
||||
@Excel(name = "合同到期日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date expirationDate;
|
||||
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@Excel(name = "客户类型")
|
||||
private String customerType;
|
||||
|
||||
@Excel(name = "是否自动出账", readConverterExp = "1=是,2=否")
|
||||
private Integer automaticFlag;
|
||||
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/** ====== 明细字段(来源于 contract_manage_detail) ====== */
|
||||
@Excel(name = "结算科目类型", readConverterExp = "1=通用,2=临时")
|
||||
private Integer subjectType;
|
||||
|
||||
@Excel(name = "一级费用科目code")
|
||||
private String firstSubjectCode;
|
||||
|
||||
@Excel(name = "一级费用科目")
|
||||
private String firstSubjectName;
|
||||
|
||||
@Excel(name = "二级费用科目code")
|
||||
private String secondSubjectCode;
|
||||
|
||||
@Excel(name = "二级费用科目")
|
||||
private String secondSubjectName;
|
||||
|
||||
@Excel(name = "计费策略")
|
||||
private String accountingStrategy;
|
||||
|
||||
@Excel(name = "计费周期")
|
||||
private String billingAttributes;
|
||||
|
||||
@Excel(name = "科目生效日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date subjectEffectiveDate;
|
||||
|
||||
@Excel(name = "科目到期日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date subjectExpirationDate;
|
||||
|
||||
@Excel(name = "单据类型")
|
||||
private String documentType;
|
||||
|
||||
@Excel(name = "费用类别")
|
||||
private String serviceItemsName;
|
||||
}
|
||||
+17
@@ -144,4 +144,21 @@ public class WarehouseDTO extends BaseVOEntity{
|
||||
@ApiModelProperty("作业模式")
|
||||
@Excel(name = "作业模式")
|
||||
private String workMode;
|
||||
|
||||
|
||||
@ApiModelProperty("订单号生成规则")
|
||||
@Excel(name = "单号生成规则")
|
||||
private String orderNoGenerateRule;
|
||||
|
||||
@ApiModelProperty("入库单号首字母前缀")
|
||||
@Excel(name = "入库单号首字母前缀")
|
||||
private String inOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("出库单号首字母前缀")
|
||||
@Excel(name = "出库单号首字母前缀")
|
||||
private String outOrderNoPrefix;
|
||||
|
||||
@ApiModelProperty("样品出库单号首字母前缀")
|
||||
@Excel(name = "样品出库单号首字母前缀")
|
||||
private String sampleOutOrderNoPrefix;
|
||||
}
|
||||
+22
@@ -1,8 +1,11 @@
|
||||
package com.mhd.basic.interfaces.facade.contractManage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
|
||||
import com.mhd.basic.interfaces.assember.contractManage.ContractManageAssembler;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.ContractManageExportVO;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceDTO;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceReturn;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -14,9 +17,11 @@ import com.mhd.basic.domain.contractManage.repository.todo.ContractManageDO;
|
||||
import com.mhd.basic.domain.contractManage.repository.po.ContractManagePO;
|
||||
import com.mhd.basic.application.service.contractManage.ContractManageApplicationService;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 合同管理Api
|
||||
@@ -205,7 +210,24 @@ public class ContractManageApi extends BaseController{
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("导出合同(含明细)")
|
||||
@GetMapping(value = "/export", produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
public void export(ContractManageDTO contractManageDTO, HttpServletResponse response) throws IOException
|
||||
{
|
||||
//转换实体
|
||||
ContractManageDO contractManageDO = new ContractManageDO();
|
||||
BeanUtils.copyProperties(contractManageDTO, contractManageDO);
|
||||
//查询全量(不分页)并拍平明细
|
||||
List<ContractManageExportVO> list = contractManageApplicationService.buildExportList(contractManageDO);
|
||||
|
||||
//设置下载头,防止浏览器乱码
|
||||
String fileName = URLEncoder.encode("合同导出", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||
|
||||
ExcelUtil<ContractManageExportVO> util = new ExcelUtil<>(ContractManageExportVO.class);
|
||||
util.exportExcel(response, list, "合同导出");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,18 +14,18 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# 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.31:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
# server-addr: 10.102.192.105:6848
|
||||
config:
|
||||
# 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.31:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
|
||||
+2
-2
@@ -185,8 +185,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="queryList" parameterType="com.mhd.basic.domain.storageLocation.repository.todo.StorageLocationDO" resultMap="StorageLocationResult">
|
||||
<include refid="selectStorageLocationPo"/>
|
||||
<include refid="selectStorageLocationPo1"/>
|
||||
-- 按照创建时间倒序排序
|
||||
order by a.create_time desc
|
||||
-- 按照库位名称正序排序,名称相同时按创建时间倒序
|
||||
order by a.storage_location_name asc, a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getStorageLocationCount" parameterType="com.mhd.basic.domain.storageLocation.repository.todo.StorageLocationDO" resultType="java.lang.Long">
|
||||
|
||||
+1
-1
@@ -100,6 +100,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="queryList" parameterType="com.mhd.basic.domain.storageSection.repository.todo.StorageSectionDO" resultMap="StorageSectionResult">
|
||||
<include refid="selectStorageSectionPo"/>
|
||||
<include refid="selectStorageSectionPo1"/>
|
||||
order by a.create_time desc
|
||||
order by a.storage_name asc, a.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
+6
-1
@@ -39,6 +39,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="isEnable" column="IS_ENABLE" />
|
||||
<result property="workMode" column="WORK_MODE" />
|
||||
<result property="taskMode" column="TASK_MODE" />
|
||||
<result property="sampleOutOrderNoPrefix" column="SAMPLE_OUT_ORDER_NO_PREFIX" />
|
||||
<result property="orderNoGenerateRule" column="ORDER_NO_GENERATE_RULE" />
|
||||
<result property="inOrderNoPrefix" column="IN_ORDER_NO_PREFIX" />
|
||||
<result property="outOrderNoPrefix" column="OUT_ORDER_NO_PREFIX" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -47,7 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
warehouse_type, warehouse_type_name, warehouse_structure, warehouse_nature, warm_layer_code, warm_layer_name,
|
||||
director_name, director_phone, region_code, region_name, detail_address, longitude, latitude, building_region,
|
||||
usage_region, remark, opening_up, nullify, create_time, create_by, create_by_name, update_time, update_by,
|
||||
update_by_name, del_flag, IS_ENABLE ,WORK_MODE,TASK_MODE
|
||||
update_by_name, del_flag, IS_ENABLE ,WORK_MODE,TASK_MODE,SAMPLE_OUT_ORDER_NO_PREFIX,ORDER_NO_GENERATE_RULE,IN_ORDER_NO_PREFIX,
|
||||
OUT_ORDER_NO_PREFIX
|
||||
from warehouse
|
||||
</sql>
|
||||
|
||||
|
||||
+6
@@ -1306,6 +1306,12 @@ public class UserShipperApplicationService {
|
||||
return userShipperDomainService.userShipperList(userShipperDO);
|
||||
}
|
||||
|
||||
public List<UserShipperPo> userShipperListAllByOrg(Long orgCode) {
|
||||
UserShipperDO userShipperDO = new UserShipperDO();
|
||||
userShipperDO.setOrganizationId(orgCode);
|
||||
return userShipperDomainService.userShipperList(userShipperDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* E签宝回调接口-认证授权完成
|
||||
* @param jsonObject 回调参数
|
||||
|
||||
@@ -212,6 +212,15 @@ public class UserShipperAPI extends BaseController {
|
||||
return AjaxResult.success("操作成功",list);
|
||||
}
|
||||
|
||||
@Log(title = "托运人管理-查询租户下所有托运人", description ="查询租户下所有托运人",businessType = BusinessType.INQUIRE)
|
||||
@ApiOperation("查询租户下所有托运人")
|
||||
@GetMapping("/userShipperListAllByOrg")
|
||||
public AjaxResult userShipperListAllByOrg(@RequestParam("orgCode") Long orgCode) {
|
||||
//转换实体
|
||||
List<UserShipperPo> list = userShipperApplicationService.userShipperListAllByOrg(orgCode);
|
||||
return AjaxResult.success("操作成功",list);
|
||||
}
|
||||
|
||||
@Log(title = "托运人管理-修改授权额度 结算天数 使用额度", description ="修改授权额度 结算天数 使用额度",businessType = BusinessType.INQUIRE)
|
||||
@ApiOperation("修改授权额度和结算天数")
|
||||
@PutMapping("/settlementInfo")
|
||||
|
||||
@@ -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.31: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.31: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,如果使用默认分组可以不配置
|
||||
|
||||
@@ -782,10 +782,6 @@
|
||||
<if test="organizationId !=null">
|
||||
AND (
|
||||
u.organization_id = #{organizationId}
|
||||
OR b.org_code LIKE concat('%"code":"', #{organizationId}, '"%')
|
||||
OR b.org_code LIKE concat('%code:', #{organizationId}, '%')
|
||||
OR b.org_code LIKE concat('%code: ', #{organizationId}, '%')
|
||||
OR b.org_code LIKE concat('%"code":', #{organizationId}, '%')
|
||||
)
|
||||
AND u.organization_name IS NOT NULL
|
||||
</if>
|
||||
|
||||
@@ -381,10 +381,6 @@
|
||||
<if test="organizationId !=null">
|
||||
AND (
|
||||
a.organization_id = #{organizationId}
|
||||
OR b.org_code LIKE concat('%"code":"', #{organizationId}, '"%')
|
||||
OR b.org_code LIKE concat('%code:', #{organizationId}, '%')
|
||||
OR b.org_code LIKE concat('%code: ', #{organizationId}, '%')
|
||||
OR b.org_code LIKE concat('%"code":', #{organizationId}, '%')
|
||||
)
|
||||
</if>
|
||||
/*组织名称*/
|
||||
|
||||
+2
@@ -521,6 +521,8 @@ public class BillManageApplicationService {
|
||||
item.setTaxAmount(taxAmount);
|
||||
item.setTaxFreeFee(taxFreeFee);
|
||||
item.setTaxRate(taxRate);
|
||||
item.setBillManageId(billManageDO.getBillManageId());
|
||||
item.setBillNumber(billManageDO.getBillNumber());
|
||||
allTaxRate += taxRate;
|
||||
allTaxAmount = allTaxAmount.add(taxAmount);
|
||||
allTaxFreeFee = allTaxFreeFee.add(taxFreeFee);
|
||||
|
||||
+4
-1
@@ -596,7 +596,10 @@ public class BillingStatementApplicationService {
|
||||
BeanUtils.copyProperties(billingStatementDO,billingStatementPO);
|
||||
billingStatementPO.setBillingTotalAmount(billingStatementDO.getBillingAmount());
|
||||
billingStatementPO.setDataSources(2);
|
||||
billingStatementPO.setBillingFlow(OrderSequence.getOrderCode("JFLS"));
|
||||
// 若传入了计费流水号,则直接使用;否则自动生成
|
||||
if (StringUtils.isEmpty(billingStatementPO.getBillingFlow())) {
|
||||
billingStatementPO.setBillingFlow(OrderSequence.getOrderCode("JFLS"));
|
||||
}
|
||||
billingStatementPO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
billingStatementPO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
billingStatementPO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ public class SettlementCustomersApplicationService {
|
||||
SyncDictCache dictCache,
|
||||
List<SettlementCustomers> toInsert,
|
||||
List<SettlementCustomers> toUpdate) {
|
||||
AjaxResult ajaxResult = userServiceFeign.userShipperListAll();
|
||||
AjaxResult ajaxResult = userServiceFeign.userShipperListAllByOrg(loginUser.getUserPo().getOrganizationId());
|
||||
List<UserShipperPo> userShipperPoList = parseFeignList(ajaxResult, UserShipperPo.class);
|
||||
if (userShipperPoList.isEmpty()) {
|
||||
return;
|
||||
|
||||
+10
-2
@@ -334,7 +334,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
} else {
|
||||
item.setScomment("业务部:应收"+appointShipper+invoiceItemName);
|
||||
}
|
||||
item.setPk_currtype(settlementCurrencyNcCode);
|
||||
if (settlementCurrencyNcCode != null && !settlementCurrencyNcCode.isEmpty()) {
|
||||
item.setPk_currtype(settlementCurrencyNcCode);
|
||||
} else {
|
||||
item.setPk_currtype("CNY");
|
||||
}
|
||||
item.setPurchaseorder("");
|
||||
item.setTaxrate(String.valueOf(make.getTaxRate()));
|
||||
item.setQuantity_de("0");
|
||||
@@ -1002,7 +1006,11 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
String[] split = invoiceItem1.split(",");
|
||||
item.setDef29(split[0]);
|
||||
}
|
||||
item.setPk_currtype(settlementCurrencyNcCode);
|
||||
if (settlementCurrencyNcCode != null && !settlementCurrencyNcCode.isEmpty()) {
|
||||
item.setPk_currtype(settlementCurrencyNcCode);
|
||||
} else {
|
||||
item.setPk_currtype("CNY");
|
||||
}
|
||||
item.setMoney_cr(String.valueOf(totalInvoiceValue));
|
||||
item.setMoney_bal(String.valueOf(totalInvoiceValue));
|
||||
ysitemList.add(item);
|
||||
|
||||
@@ -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,如果使用默认分组可以不配置
|
||||
|
||||
@@ -89,6 +89,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="billingRulesDO.serviceItemsCode != null and billingRulesDO.serviceItemsCode != ''">
|
||||
and service_items_code = #{billingRulesDO.serviceItemsCode}
|
||||
</if>
|
||||
<if test="billingRulesDO.serviceItemsName != null and billingRulesDO.serviceItemsName != ''">
|
||||
and service_items_name like concat('%',#{billingRulesDO.serviceItemsName},'%')
|
||||
</if>
|
||||
<if test="billingRulesDO.firstSubjectCode != null and billingRulesDO.firstSubjectCode != ''">
|
||||
and first_subject_code = #{billingRulesDO.firstSubjectCode}
|
||||
</if>
|
||||
<if test="billingRulesDO.firstSubjectName != null and billingRulesDO.firstSubjectName != ''">
|
||||
and first_subject_name like concat('%',#{billingRulesDO.firstSubjectName},'%')
|
||||
</if>
|
||||
<if test="billingRulesDO.secondSubjectCode != null and billingRulesDO.secondSubjectCode != ''">
|
||||
and second_subject_code = #{billingRulesDO.secondSubjectCode}
|
||||
</if>
|
||||
<if test="billingRulesDO.secondSubjectName != null and billingRulesDO.secondSubjectName != ''">
|
||||
and second_subject_name like concat('%',#{billingRulesDO.secondSubjectName},'%')
|
||||
</if>
|
||||
<if test="billingRulesDO.billingRulesState != null">
|
||||
and billing_rules_state = #{billingRulesDO.billingRulesState}
|
||||
</if>
|
||||
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.mhd.oms.domain.electronicSignature.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 电子签名主表 electronic_signature
|
||||
*/
|
||||
@Data
|
||||
@TableName("ELECTRONIC_SIGNATURE")
|
||||
public class ElectronicSignature extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("签名ID")
|
||||
@TableId(type = IdType.INPUT)
|
||||
private Long signatureId;
|
||||
|
||||
@ApiModelProperty("订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("订单号")
|
||||
private String orderNumber;
|
||||
|
||||
@ApiModelProperty("订单类型:IN-入库 OUT-出库")
|
||||
private String orderType;
|
||||
|
||||
@ApiModelProperty("签名状态:1-待签名 2-已签名")
|
||||
private Integer signatureStatus;
|
||||
|
||||
@ApiModelProperty("签名时间")
|
||||
private Date signatureTime;
|
||||
|
||||
@ApiModelProperty("手写签名图片")
|
||||
private String signaturePic;
|
||||
|
||||
@ApiModelProperty("拍照取证图片")
|
||||
private String evidencePics;
|
||||
|
||||
@ApiModelProperty("签名备注")
|
||||
private String signatureRemark;
|
||||
|
||||
@ApiModelProperty("签名方式:1-扫描二维码 2-电子签名 3-打印手写签名 4-超时自动签名")
|
||||
private Integer signatureMode;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package com.mhd.oms.domain.electronicSignature.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 电子签名物料明细表 electronic_signature_material_detail
|
||||
*/
|
||||
@Data
|
||||
@TableName("ELECTRONIC_SIGNATURE_MATERIAL_DETAIL")
|
||||
public class ElectronicSignatureMaterialDetail extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("明细ID")
|
||||
@TableId(type = IdType.INPUT)
|
||||
private Long detailId;
|
||||
|
||||
@ApiModelProperty("签名ID")
|
||||
private Long signatureId;
|
||||
|
||||
@ApiModelProperty("物料基础信息ID")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@ApiModelProperty("单位代码")
|
||||
private String unitCode;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("批次号")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("库区ID")
|
||||
private Long storageSectionId;
|
||||
|
||||
@ApiModelProperty("库区编码")
|
||||
private String storageSectionCode;
|
||||
|
||||
@ApiModelProperty("库区名称")
|
||||
private String storageSectionName;
|
||||
|
||||
@ApiModelProperty("库位ID")
|
||||
private Long storageLocationId;
|
||||
|
||||
@ApiModelProperty("库位编码")
|
||||
private String storageLocationCode;
|
||||
|
||||
@ApiModelProperty("库位名称")
|
||||
private String storageLocationName;
|
||||
|
||||
@ApiModelProperty("业务唯一ID")
|
||||
private Long uniqueId;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mhd.oms.domain.electronicSignature.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignatureMaterialDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名物料明细Service接口
|
||||
*/
|
||||
public interface IElectronicSignatureMaterialDetailService extends IService<ElectronicSignatureMaterialDetail> {
|
||||
|
||||
/**
|
||||
* 根据签名ID逻辑删除明细
|
||||
*/
|
||||
int deleteBySignatureId(Long signatureId);
|
||||
|
||||
/**
|
||||
* 批量插入明细
|
||||
*/
|
||||
boolean batchInsert(List<ElectronicSignatureMaterialDetail> detailList);
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.mhd.oms.domain.electronicSignature.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignature;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.todo.ElectronicSignatureDO;
|
||||
|
||||
/**
|
||||
* 电子签名Service接口
|
||||
*/
|
||||
public interface IElectronicSignatureService extends IService<ElectronicSignature> {
|
||||
|
||||
/**
|
||||
* 保存电子签名
|
||||
*/
|
||||
Boolean saveSignature(ElectronicSignatureDO electronicSignatureDO);
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
package com.mhd.oms.domain.electronicSignature.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignature;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignatureMaterialDetail;
|
||||
import com.mhd.oms.interfaces.dto.electronicSignature.ElectronicSignatureQueryDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名Mapper接口
|
||||
*/
|
||||
public interface ElectronicSignatureMapper extends BaseMapper<ElectronicSignature> {
|
||||
|
||||
@Select("SELECT NGWL_TEST_OMS.SEQ_ELECTRONIC_SIGNATURE.NEXTVAL FROM DUAL")
|
||||
Long nextSignatureId();
|
||||
|
||||
@Select("SELECT NGWL_TEST_OMS.SEQ_ES_MATERIAL_DETAIL.NEXTVAL FROM DUAL")
|
||||
Long nextDetailId();
|
||||
|
||||
@Select("SELECT * FROM NGWL_TEST_OMS.ELECTRONIC_SIGNATURE WHERE ORDER_ID = #{orderId} AND ORDER_TYPE = #{orderType} AND DEL_FLAG = 1")
|
||||
ElectronicSignature selectByOrderIdAndType(@Param("orderId") Long orderId, @Param("orderType") String orderType);
|
||||
|
||||
/**
|
||||
* 分页查询电子签名列表(需配合PageHelper使用)
|
||||
*/
|
||||
@Select("<script>"
|
||||
+ "SELECT s.* FROM NGWL_TEST_OMS.ELECTRONIC_SIGNATURE s WHERE s.DEL_FLAG = 1"
|
||||
+ "<if test='params.orderType != null and params.orderType != \"\"'> AND s.ORDER_TYPE = #{params.orderType}</if>"
|
||||
+ "<if test='params.orderNumber != null and params.orderNumber != \"\"'> AND s.ORDER_NUMBER LIKE CONCAT('%', #{params.orderNumber}, '%')</if>"
|
||||
+ "<if test='params.signatureStatus != null'> AND s.SIGNATURE_STATUS = #{params.signatureStatus}</if>"
|
||||
+ "<if test='params.signatureMode != null'> AND s.SIGNATURE_MODE = #{params.signatureMode}</if>"
|
||||
+ "<if test='params.organizationId != null'> AND s.ORGANIZATION_ID = #{params.organizationId}</if>"
|
||||
+ "<if test='params.organizationName != null and params.organizationName != \"\"'> AND s.ORGANIZATION_NAME LIKE CONCAT('%', #{params.organizationName}, '%')</if>"
|
||||
+ "<if test='params.warehouseId != null'> AND s.WAREHOUSE_ID = #{params.warehouseId}</if>"
|
||||
+ "<if test='params.warehouseName != null and params.warehouseName != \"\"'> AND s.WAREHOUSE_NAME LIKE CONCAT('%', #{params.warehouseName}, '%')</if>"
|
||||
+ "<if test='params.createTimeFrom != null'> AND s.CREATE_TIME >= #{params.createTimeFrom}</if>"
|
||||
+ "<if test='params.createTimeTo != null'> AND s.CREATE_TIME <= #{params.createTimeTo}</if>"
|
||||
+ " ORDER BY s.CREATE_TIME DESC"
|
||||
+ "</script>")
|
||||
List<ElectronicSignature> selectSignatureList(@Param("params") ElectronicSignatureQueryDTO queryDTO);
|
||||
|
||||
/**
|
||||
* 根据签名ID查询
|
||||
*/
|
||||
@Select("SELECT * FROM NGWL_TEST_OMS.ELECTRONIC_SIGNATURE WHERE SIGNATURE_ID = #{signatureId} AND DEL_FLAG = 1")
|
||||
ElectronicSignature selectBySignatureId(@Param("signatureId") Long signatureId);
|
||||
|
||||
/**
|
||||
* 根据签名ID查询物料明细列表
|
||||
*/
|
||||
@Select("SELECT * FROM NGWL_TEST_OMS.ELECTRONIC_SIGNATURE_MATERIAL_DETAIL WHERE SIGNATURE_ID = #{signatureId} AND DEL_FLAG = 1")
|
||||
List<ElectronicSignatureMaterialDetail> selectMaterialDetailBySignatureId(@Param("signatureId") Long signatureId);
|
||||
|
||||
/**
|
||||
* 批量签名:根据签名ID列表更新签名信息
|
||||
*/
|
||||
@Update("<script>"
|
||||
+ "UPDATE NGWL_TEST_OMS.ELECTRONIC_SIGNATURE SET "
|
||||
+ "SIGNATURE_STATUS = 2, "
|
||||
+ "SIGNATURE_TIME = #{signatureTime}, "
|
||||
+ "<if test='signaturePic != null and signaturePic != \"\"'>SIGNATURE_PIC = #{signaturePic}, </if>"
|
||||
+ "<if test='evidencePics != null and evidencePics != \"\"'>EVIDENCE_PICS = #{evidencePics}, </if>"
|
||||
+ "<if test='signatureRemark != null and signatureRemark != \"\"'>SIGNATURE_REMARK = #{signatureRemark}, </if>"
|
||||
+ "<if test='signatureMode != null'>SIGNATURE_MODE = #{signatureMode}, </if>"
|
||||
+ "UPDATE_TIME = #{signatureTime} "
|
||||
+ "WHERE SIGNATURE_ID IN "
|
||||
+ "<foreach collection='signatureIds' item='id' open='(' separator=',' close=')'>#{id}</foreach>"
|
||||
+ " AND DEL_FLAG = 1 AND SIGNATURE_STATUS = 1"
|
||||
+ "</script>")
|
||||
int batchUpdateSign(@Param("signatureIds") List<Long> signatureIds,
|
||||
@Param("signatureTime") Date signatureTime,
|
||||
@Param("signaturePic") String signaturePic,
|
||||
@Param("evidencePics") String evidencePics,
|
||||
@Param("signatureRemark") String signatureRemark,
|
||||
@Param("signatureMode") Integer signatureMode);
|
||||
|
||||
|
||||
@Update("<script>"
|
||||
+ "UPDATE NGWL_TEST_OMS.ELECTRONIC_SIGNATURE SET "
|
||||
+ "SIGNATURE_STATUS = 2, "
|
||||
+ "SIGNATURE_TIME = #{signatureTime}, "
|
||||
+ "<if test='signaturePic != null and signaturePic != \"\"'>SIGNATURE_PIC = #{signaturePic}, </if>"
|
||||
+ "<if test='evidencePics != null and evidencePics != \"\"'>EVIDENCE_PICS = #{evidencePics}, </if>"
|
||||
+ "<if test='signatureRemark != null and signatureRemark != \"\"'>SIGNATURE_REMARK = #{signatureRemark}, </if>"
|
||||
+ "<if test='signatureMode != null'>SIGNATURE_MODE = #{signatureMode}, </if>"
|
||||
+ "UPDATE_TIME = #{signatureTime} "
|
||||
+ "WHERE ORDER_ID IN "
|
||||
+ "<foreach collection='signatureIds' item='id' open='(' separator=',' close=')'>#{id}</foreach>"
|
||||
+ " AND DEL_FLAG = 1 AND SIGNATURE_STATUS = 1"
|
||||
+ "</script>")
|
||||
int batchUpdateSignByOrder(@Param("signatureIds") List<Long> signatureIds,
|
||||
@Param("signatureTime") Date signatureTime,
|
||||
@Param("signaturePic") String signaturePic,
|
||||
@Param("evidencePics") String evidencePics,
|
||||
@Param("signatureRemark") String signatureRemark,
|
||||
@Param("signatureMode") Integer signatureMode);
|
||||
|
||||
/**
|
||||
* 根据签名ID列表批量查询
|
||||
*/
|
||||
@Select("<script>"
|
||||
+ "SELECT * FROM NGWL_TEST_OMS.ELECTRONIC_SIGNATURE "
|
||||
+ "WHERE SIGNATURE_ID IN "
|
||||
+ "<foreach collection='signatureIds' item='id' open='(' separator=',' close=')'>#{id}</foreach>"
|
||||
+ " AND DEL_FLAG = 1"
|
||||
+ "</script>")
|
||||
List<ElectronicSignature> selectBySignatureIds(@Param("signatureIds") List<Long> signatureIds);
|
||||
|
||||
|
||||
@Select("<script>"
|
||||
+ "SELECT * FROM NGWL_TEST_OMS.ELECTRONIC_SIGNATURE "
|
||||
+ "WHERE ORDER_ID IN "
|
||||
+ "<foreach collection='signatureIds' item='id' open='(' separator=',' close=')'>#{id}</foreach>"
|
||||
+ " AND DEL_FLAG = 1"
|
||||
+ "</script>")
|
||||
List<ElectronicSignature> selectByOrderIds(@Param("signatureIds") List<Long> signatureIds);
|
||||
|
||||
|
||||
@Update("UPDATE NGWL_TEST_WMS.STOCK_IN_ORDER SET SIGNATURE_STATUS = 2,SIGNATURE_TIME =now() WHERE IN_ORDER_ID = #{id}")
|
||||
int updateIn( @Param("id") Long id);
|
||||
|
||||
@Update("UPDATE NGWL_TEST_WMS.STOCK_OUT_ORDER SET SIGNATURE_STATUS = 2,SIGNATURE_TIME =now() WHERE OUT_ORDER_ID = #{id}")
|
||||
int updateOut(@Param("id") Long id);
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.mhd.oms.domain.electronicSignature.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignatureMaterialDetail;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 电子签名物料明细Mapper接口
|
||||
*/
|
||||
public interface ElectronicSignatureMaterialDetailMapper extends BaseMapper<ElectronicSignatureMaterialDetail> {
|
||||
|
||||
@Update("UPDATE NGWL_TEST_OMS.ELECTRONIC_SIGNATURE_MATERIAL_DETAIL SET DEL_FLAG = 2 WHERE SIGNATURE_ID = #{signatureId} AND DEL_FLAG = 1")
|
||||
int logicDeleteBySignatureId(@Param("signatureId") Long signatureId);
|
||||
|
||||
@Select("SELECT NGWL_TEST_OMS.SEQ_ES_MATERIAL_DETAIL.NEXTVAL FROM DUAL")
|
||||
Long nextDetailId();
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.mhd.oms.domain.electronicSignature.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignature;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.facade.IElectronicSignatureService;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.mapper.ElectronicSignatureMapper;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.todo.ElectronicSignatureDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 电子签名Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class ElectronicSignatureImpl extends ServiceImpl<ElectronicSignatureMapper, ElectronicSignature> implements IElectronicSignatureService {
|
||||
|
||||
@Autowired
|
||||
private ElectronicSignatureMapper electronicSignatureMapper;
|
||||
|
||||
@Override
|
||||
public Boolean saveSignature(ElectronicSignatureDO electronicSignatureDO) {
|
||||
ElectronicSignature entity = new ElectronicSignature();
|
||||
BeanUtils.copyProperties(electronicSignatureDO, entity);
|
||||
Long id = electronicSignatureMapper.nextSignatureId();
|
||||
entity.setSignatureId(id);
|
||||
entity.setSignatureMode(2); // 2-电子签名
|
||||
return this.save(entity);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.mhd.oms.domain.electronicSignature.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignatureMaterialDetail;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.facade.IElectronicSignatureMaterialDetailService;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.mapper.ElectronicSignatureMaterialDetailMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名物料明细Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class ElectronicSignatureMaterialDetailImpl extends ServiceImpl<ElectronicSignatureMaterialDetailMapper, ElectronicSignatureMaterialDetail> implements IElectronicSignatureMaterialDetailService {
|
||||
|
||||
@Autowired
|
||||
private ElectronicSignatureMaterialDetailMapper electronicSignatureMaterialDetailMapper;
|
||||
|
||||
@Override
|
||||
public int deleteBySignatureId(Long signatureId) {
|
||||
return electronicSignatureMaterialDetailMapper.logicDeleteBySignatureId(signatureId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean batchInsert(List<ElectronicSignatureMaterialDetail> detailList) {
|
||||
if (detailList == null || detailList.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
for (ElectronicSignatureMaterialDetail detail : detailList) {
|
||||
Long detailId = electronicSignatureMaterialDetailMapper.nextDetailId();
|
||||
detail.setDetailId(detailId);
|
||||
this.save(detail);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.mhd.oms.domain.electronicSignature.repository.todo;
|
||||
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignatureMaterialDetail;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名保存入参
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicSignatureDO {
|
||||
|
||||
/** 订单ID */
|
||||
private Long orderId;
|
||||
|
||||
/** 订单号 */
|
||||
private String orderNumber;
|
||||
|
||||
/** 订单类型:IN-入库 OUT-出库 */
|
||||
private String orderType;
|
||||
|
||||
/** 组织ID */
|
||||
private Long organizationId;
|
||||
|
||||
/** 组织名称 */
|
||||
private String organizationName;
|
||||
|
||||
/** 一级组织ID */
|
||||
private Long topOrganizationId;
|
||||
|
||||
/** 仓库ID */
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库编码 */
|
||||
private String warehouseCode;
|
||||
|
||||
/** 仓库名称 */
|
||||
private String warehouseName;
|
||||
|
||||
/** 创建人 */
|
||||
private Long createBy;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String createByName;
|
||||
|
||||
/** 物料明细列表 */
|
||||
private List<ElectronicSignatureMaterialDetail> materialDetailList;
|
||||
}
|
||||
+311
@@ -0,0 +1,311 @@
|
||||
package com.mhd.oms.domain.electronicSignature.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignature;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignatureMaterialDetail;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.facade.IElectronicSignatureMaterialDetailService;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.facade.IElectronicSignatureService;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.mapper.ElectronicSignatureMapper;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.todo.ElectronicSignatureDO;
|
||||
import com.mhd.oms.interfaces.dto.electronicSignature.ElectronicSignatureBatchSignDTO;
|
||||
import com.mhd.oms.interfaces.dto.electronicSignature.ElectronicSignatureQueryDTO;
|
||||
import com.mhd.system.api.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.SignatureBatchFeignDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 电子签名领域服务
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ElectronicSignatureDomainService {
|
||||
|
||||
@Autowired
|
||||
private IElectronicSignatureService electronicSignatureService;
|
||||
|
||||
@Autowired
|
||||
private IElectronicSignatureMaterialDetailService electronicSignatureMaterialDetailService;
|
||||
|
||||
@Autowired
|
||||
private ElectronicSignatureMapper electronicSignatureMapper;
|
||||
|
||||
@Autowired(required = false)
|
||||
private WmsServiceFeign wmsServiceFeign;
|
||||
|
||||
/**
|
||||
* 保存电子签名记录(生成待签名记录)
|
||||
* 业务规则:
|
||||
* 1. 查询是否已有签名记录
|
||||
* 2. 若已签名(SIGNATURE_STATUS=2),跳过
|
||||
* 3. 若待签名(SIGNATURE_STATUS=1),覆盖明细(先逻辑删除旧明细,再插入新明细)
|
||||
* 4. 若不存在,新增主表+明细
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean saveSignature(ElectronicSignatureDO electronicSignatureDO) {
|
||||
Long orderId = electronicSignatureDO.getOrderId();
|
||||
String orderType = electronicSignatureDO.getOrderType();
|
||||
|
||||
// 查询是否已有签名记录
|
||||
ElectronicSignature existing = electronicSignatureMapper.selectByOrderIdAndType(orderId, orderType);
|
||||
|
||||
if (existing != null) {
|
||||
// 已签名,跳过
|
||||
if (existing.getSignatureStatus() != null && existing.getSignatureStatus() == 2) {
|
||||
log.info("订单 {} 已签名,跳过生成签名记录", electronicSignatureDO.getOrderNumber());
|
||||
return true;
|
||||
}
|
||||
|
||||
// 待签名,覆盖:逻辑删除旧明细,插入新明细
|
||||
log.info("订单 {} 已有待签名记录,覆盖明细", electronicSignatureDO.getOrderNumber());
|
||||
electronicSignatureMaterialDetailService.deleteBySignatureId(existing.getSignatureId());
|
||||
batchInsertDetails(existing.getSignatureId(), electronicSignatureDO.getMaterialDetailList());
|
||||
return true;
|
||||
}
|
||||
|
||||
// 不存在,新增
|
||||
log.info("订单 {} 生成新的待签名记录", electronicSignatureDO.getOrderNumber());
|
||||
electronicSignatureService.saveSignature(electronicSignatureDO);
|
||||
|
||||
// 查询刚插入的记录以获取签名ID
|
||||
ElectronicSignature newEntity = electronicSignatureMapper.selectByOrderIdAndType(orderId, orderType);
|
||||
if (newEntity != null) {
|
||||
batchInsertDetails(newEntity.getSignatureId(), electronicSignatureDO.getMaterialDetailList());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存电子签名记录(生成待签名记录)
|
||||
* 业务规则:
|
||||
* 1. 查询是否已有签名记录
|
||||
* 2. 若已签名(SIGNATURE_STATUS=2),跳过
|
||||
* 3. 若待签名(SIGNATURE_STATUS=1),覆盖明细(先逻辑删除旧明细,再插入新明细)
|
||||
* 4. 若不存在,新增主表+明细
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean inQqcode(ElectronicSignatureDO electronicSignatureDO) {
|
||||
Long orderId = electronicSignatureDO.getOrderId();
|
||||
ElectronicSignature existing = electronicSignatureService.getOne(new LambdaQueryWrapper<ElectronicSignature>()
|
||||
.eq(ElectronicSignature::getOrderId, orderId)
|
||||
.eq(ElectronicSignature::getDelFlag, 1), false);
|
||||
if (existing != null) {
|
||||
existing.setSignatureTime(new Date()); // 设置签名时间
|
||||
existing.setSignatureStatus(2); // 设置签名状态为已签名
|
||||
existing.setSignatureMode(1); // 设置签名方式为1-二维码
|
||||
electronicSignatureService.updateById(existing);
|
||||
electronicSignatureMapper.updateIn(existing.getOrderId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean outQqcode(ElectronicSignatureDO electronicSignatureDO) {
|
||||
Long orderId = electronicSignatureDO.getOrderId();
|
||||
ElectronicSignature existing = electronicSignatureService.getOne(new LambdaQueryWrapper<ElectronicSignature>()
|
||||
.eq(ElectronicSignature::getOrderId, orderId)
|
||||
.eq(ElectronicSignature::getDelFlag, 1), false);
|
||||
if (existing != null) {
|
||||
existing.setSignatureTime(new Date()); // 设置签名时间
|
||||
existing.setSignatureStatus(2); // 设置签名状态为已签名
|
||||
existing.setSignatureMode(1); // 设置签名方式为1-二维码
|
||||
electronicSignatureService.updateById(existing);
|
||||
electronicSignatureMapper.updateOut(existing.getOrderId());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询电子签名列表
|
||||
*/
|
||||
public List<ElectronicSignature> querySignatureList(ElectronicSignatureQueryDTO queryDTO) {
|
||||
return electronicSignatureMapper.selectSignatureList(queryDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单编号查询电子签名列表
|
||||
*/
|
||||
public List<ElectronicSignature> getByOrderNumber(ElectronicSignatureQueryDTO queryDTO) {
|
||||
return electronicSignatureMapper.selectList(new LambdaQueryWrapper<ElectronicSignature>()
|
||||
.eq(ElectronicSignature::getOrderNumber, queryDTO.getOrderNumber())
|
||||
.eq(ElectronicSignature::getDelFlag, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据签名ID查询
|
||||
*/
|
||||
public ElectronicSignature getSignatureById(Long signatureId) {
|
||||
return electronicSignatureMapper.selectBySignatureId(signatureId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据签名ID查询物料明细
|
||||
*/
|
||||
public List<ElectronicSignatureMaterialDetail> queryMaterialDetailBySignatureId(Long signatureId) {
|
||||
return electronicSignatureMapper.selectMaterialDetailBySignatureId(signatureId);
|
||||
}
|
||||
|
||||
private void batchInsertDetails(Long signatureId, List<ElectronicSignatureMaterialDetail> detailList) {
|
||||
if (detailList == null || detailList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
for (ElectronicSignatureMaterialDetail detail : detailList) {
|
||||
detail.setSignatureId(signatureId);
|
||||
}
|
||||
electronicSignatureMaterialDetailService.batchInsert(detailList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量签名:勾选多条记录后批量签名
|
||||
*
|
||||
* <p>业务流程:
|
||||
* 1. 查询OMS电子签名表,获取每条记录的 orderId + orderType
|
||||
* 2. 更新OMS ELECTRONIC_SIGNATURE表:signatureStatus=2(已签名)、signatureTime、signaturePic、
|
||||
* evidencePics、signatureRemark、signatureMode
|
||||
* 3. 按订单类型分组后,调用WMS Feign更新WMS stock_in_order / stock_out_order表
|
||||
* </p>
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int batchSign(ElectronicSignatureBatchSignDTO dto) {
|
||||
List<Long> signatureIds = dto.getSignatureIds();
|
||||
if (CollectionUtil.isEmpty(signatureIds)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 1. 查询签名记录,获取 orderId + orderType
|
||||
List<ElectronicSignature> signatureList = electronicSignatureMapper.selectBySignatureIds(signatureIds);
|
||||
if (CollectionUtil.isEmpty(signatureList)) {
|
||||
log.warn("批量签名失败:未找到有效的签名记录");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 2. 更新OMS电子签名表
|
||||
Date now = new Date();
|
||||
String evidencePicsStr = null;
|
||||
if (CollectionUtil.isNotEmpty(dto.getEvidencePics())) {
|
||||
evidencePicsStr = String.join(",", dto.getEvidencePics());
|
||||
}
|
||||
|
||||
int updated = electronicSignatureMapper.batchUpdateSign(
|
||||
signatureIds, now,
|
||||
dto.getSignaturePic(),
|
||||
evidencePicsStr,
|
||||
dto.getSignatureRemark(),
|
||||
2);
|
||||
log.info("批量签名:OMS电子签名表更新 {} 条", updated);
|
||||
|
||||
// 3. 按订单类型分组,调用WMS更新入/出库表
|
||||
if (wmsServiceFeign != null) {
|
||||
try {
|
||||
// 分组:IN-入库、OUT-出库
|
||||
List<Long> inOrderIds = signatureList.stream()
|
||||
.filter(s -> "IN".equals(s.getOrderType()))
|
||||
.map(ElectronicSignature::getOrderId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<Long> outOrderIds = signatureList.stream()
|
||||
.filter(s -> "OUT".equals(s.getOrderType()))
|
||||
.map(ElectronicSignature::getOrderId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 构建 WMS 批量签名 DTO(一次调用同时处理入库+出库)
|
||||
SignatureBatchFeignDTO wmsDto = new SignatureBatchFeignDTO();
|
||||
wmsDto.setInOrderIds(inOrderIds.isEmpty() ? null : inOrderIds);
|
||||
wmsDto.setOutOrderIds(outOrderIds.isEmpty() ? null : outOrderIds);
|
||||
wmsDto.setSignatureStatus(2);
|
||||
wmsDto.setSignatureTime(now);
|
||||
wmsDto.setSignaturePic(dto.getSignaturePic());
|
||||
wmsDto.setEvidencePics(evidencePicsStr);
|
||||
wmsDto.setSignatureRemark(dto.getSignatureRemark());
|
||||
|
||||
log.info("批量签名:调用WMS更新入/出库单,入库{}条,出库{}条",
|
||||
inOrderIds.size(), outOrderIds.size());
|
||||
wmsServiceFeign.batchSignWms(wmsDto);
|
||||
} catch (Exception e) {
|
||||
log.error("批量签名:调用WMS更新入/出库表失败", e);
|
||||
// WMS更新失败不影响OMS表更新结果,仅记录日志
|
||||
}
|
||||
}
|
||||
|
||||
return updated;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int batchSignByWmsId(ElectronicSignatureBatchSignDTO dto) {
|
||||
List<Long> signatureIds = dto.getSignatureIds();
|
||||
if (CollectionUtil.isEmpty(signatureIds)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 1. 查询签名记录,获取 orderId + orderType
|
||||
List<ElectronicSignature> signatureList = electronicSignatureMapper.selectByOrderIds(signatureIds);
|
||||
if (CollectionUtil.isEmpty(signatureList)) {
|
||||
log.warn("批量签名失败:未找到有效的签名记录");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 2. 更新OMS电子签名表
|
||||
Date now = new Date();
|
||||
String evidencePicsStr = null;
|
||||
if (CollectionUtil.isNotEmpty(dto.getEvidencePics())) {
|
||||
evidencePicsStr = String.join(",", dto.getEvidencePics());
|
||||
}
|
||||
|
||||
int updated = electronicSignatureMapper.batchUpdateSignByOrder(
|
||||
signatureIds, now,
|
||||
dto.getSignaturePic(),
|
||||
evidencePicsStr,
|
||||
dto.getSignatureRemark(),
|
||||
2);
|
||||
log.info("批量签名:OMS电子签名表更新 {} 条", updated);
|
||||
|
||||
// 3. 按订单类型分组,调用WMS更新入/出库表
|
||||
// if (wmsServiceFeign != null) {
|
||||
// try {
|
||||
// // 分组:IN-入库、OUT-出库
|
||||
// List<Long> inOrderIds = signatureList.stream()
|
||||
// .filter(s -> "IN".equals(s.getOrderType()))
|
||||
// .map(ElectronicSignature::getOrderId)
|
||||
// .distinct()
|
||||
// .collect(Collectors.toList());
|
||||
// List<Long> outOrderIds = signatureList.stream()
|
||||
// .filter(s -> "OUT".equals(s.getOrderType()))
|
||||
// .map(ElectronicSignature::getOrderId)
|
||||
// .distinct()
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// // 构建 WMS 批量签名 DTO(一次调用同时处理入库+出库)
|
||||
// SignatureBatchFeignDTO wmsDto = new SignatureBatchFeignDTO();
|
||||
// wmsDto.setInOrderIds(inOrderIds.isEmpty() ? null : inOrderIds);
|
||||
// wmsDto.setOutOrderIds(outOrderIds.isEmpty() ? null : outOrderIds);
|
||||
// wmsDto.setSignatureStatus(2);
|
||||
// wmsDto.setSignatureTime(now);
|
||||
// wmsDto.setSignaturePic(dto.getSignaturePic());
|
||||
// wmsDto.setEvidencePics(evidencePicsStr);
|
||||
// wmsDto.setSignatureRemark(dto.getSignatureRemark());
|
||||
//
|
||||
// log.info("批量签名:调用WMS更新入/出库单,入库{}条,出库{}条",
|
||||
// inOrderIds.size(), outOrderIds.size());
|
||||
// wmsServiceFeign.batchSignWms(wmsDto);
|
||||
// } catch (Exception e) {
|
||||
// log.error("批量签名:调用WMS更新入/出库表失败", e);
|
||||
// // WMS更新失败不影响OMS表更新结果,仅记录日志
|
||||
// }
|
||||
// }
|
||||
|
||||
return updated;
|
||||
}
|
||||
}
|
||||
+6
@@ -3,6 +3,7 @@ package com.mhd.oms.domain.executionInMaterialDetail.repository.facade;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailBaseDO;
|
||||
@@ -65,4 +66,9 @@ public interface IExecutionInMaterialDetailService extends IService<ExecutionInM
|
||||
public ExecutionInMaterialDetailPO getInfo(Long materialDetailId);
|
||||
|
||||
public List<InventoryAdjustmentRecordPO> getkctzjl(Long materialBaseInfoId, String orderNumber, String adjustType);
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库执行单)
|
||||
*/
|
||||
public List<ExecutionInMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
}
|
||||
+6
@@ -3,6 +3,7 @@ package com.mhd.oms.domain.executionInMaterialDetail.repository.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.entity.ExecutionInMaterialDetail;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
||||
@@ -30,4 +31,9 @@ public interface ExecutionInMaterialDetailMapper extends BaseMapper<ExecutionInM
|
||||
|
||||
public List<InventoryAdjustmentRecordPO> getkctzjl(@Param("materialBaseInfoId") Long materialBaseInfoId, @Param("orderNumber") String orderNumber, @Param("adjustType") String adjustType);
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库执行单)
|
||||
*/
|
||||
public List<ExecutionInMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
|
||||
}
|
||||
+9
@@ -12,6 +12,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.mapper.ExecutionInMaterialDetailMapper;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailBaseDO;
|
||||
@@ -309,4 +310,12 @@ public class ExecutionInMaterialDetailImpl extends ServiceImpl<ExecutionInMateri
|
||||
return inMaterialDetailMapper.getkctzjl(materialBaseInfoId, orderNumber, adjustType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库执行单)
|
||||
*/
|
||||
@Override
|
||||
public List<ExecutionInMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return inMaterialDetailMapper.queryInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.mhd.oms.domain.executionInMaterialDetail.repository.po;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 入库明细查询结果(关联入库执行单)
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@Data
|
||||
public class ExecutionInMaterialDetailWithOrderPO extends ExecutionInMaterialDetailPO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("入库单状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
private Integer inOrderStatus;
|
||||
|
||||
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer inOrderAuditStatus;
|
||||
|
||||
@ApiModelProperty("货主ID")
|
||||
private Long orderShipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
private String orderShipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String orderShipperName;
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.mhd.oms.domain.executionInMaterialDetail.repository.todo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入库明细查询参数 DTO
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@Data
|
||||
public class ExecutionInMaterialDetailQueryDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("仓库id")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("入库单类型编码")
|
||||
private String inOrderTypeCode;
|
||||
|
||||
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
private Integer inStatus;
|
||||
|
||||
@ApiModelProperty("预计到货时间 开始")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inOrderExpectStartTime;
|
||||
|
||||
@ApiModelProperty("预计到货时间 结束")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inOrderExpectEndTime;
|
||||
|
||||
@ApiModelProperty("物料基础信息id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
}
|
||||
+16
@@ -2,7 +2,9 @@ package com.mhd.oms.domain.executionInMaterialDetail.service;
|
||||
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -69,4 +71,18 @@ public class ExecutionInMaterialDetailApplicationService {
|
||||
return inMaterialDetailDomainService.getInfo(materialDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库执行单)
|
||||
*/
|
||||
public List<ExecutionInMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1) {
|
||||
queryOrderOverStockDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
}
|
||||
return inMaterialDetailDomainService.queryInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
}
|
||||
+11
@@ -8,6 +8,8 @@ import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDTO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailQueryDTO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -62,4 +64,13 @@ public class ExecutionInMaterialDetailAssembler {
|
||||
return inMaterialDetailDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库明细查询 DTO → QueryOrderOverStockDO
|
||||
*/
|
||||
public QueryOrderOverStockDO toQueryDO(ExecutionInMaterialDetailQueryDTO queryDTO) {
|
||||
QueryOrderOverStockDO queryDO = new QueryOrderOverStockDO();
|
||||
BeanUtils.copyProperties(queryDTO, queryDO, IgnoreNullUtil.getNullPropertyNames(queryDTO));
|
||||
return queryDO;
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -2,7 +2,9 @@ package com.mhd.oms.domain.executionInMaterialDetail.service;
|
||||
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.facade.IExecutionInMaterialDetailService;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -62,4 +64,11 @@ public class ExecutionInMaterialDetailDomainService {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库执行单)
|
||||
*/
|
||||
public List<ExecutionInMaterialDetailWithOrderPO> queryInOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return materialDetailService.queryInOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -3,6 +3,7 @@ package com.mhd.oms.domain.executionOutMaterialDetail.repository.facade;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.entity.ExecutionOutMaterialDetail;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailBaseDO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
@@ -62,4 +63,9 @@ public interface IExecutionOutMaterialDetailService extends IService<ExecutionOu
|
||||
* 查询物料明细
|
||||
*/
|
||||
public ExecutionOutMaterialDetailPO getInfo(Long materialDetailId);
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库执行单)
|
||||
*/
|
||||
public List<ExecutionOutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
}
|
||||
+6
@@ -3,6 +3,7 @@ package com.mhd.oms.domain.executionOutMaterialDetail.repository.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.entity.ExecutionOutMaterialDetail;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -67,4 +68,9 @@ public interface ExecutionOutMaterialDetailMapper extends BaseMapper<ExecutionOu
|
||||
public String getLotByKcId(@Param("id") Long id);
|
||||
|
||||
public String getInLotNo(@Param("inOrderNumber") String inOrderNumber, @Param("baseId") Long baseId);
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库执行单)
|
||||
*/
|
||||
public List<ExecutionOutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO);
|
||||
}
|
||||
+10
@@ -12,6 +12,7 @@ import com.mhd.oms.domain.executionOutMaterialDetail.entity.ExecutionOutMaterial
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.facade.IExecutionOutMaterialDetailService;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.mapper.ExecutionOutMaterialDetailMapper;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailBaseDO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
|
||||
import com.mhd.oms.domain.executionStockInOrder.repository.mapper.ExecutionStockInOrderMapper;
|
||||
@@ -261,4 +262,13 @@ public class ExecutionOutMaterialDetailImpl extends ServiceImpl<ExecutionOutMate
|
||||
BeanUtils.copyProperties(outMaterialDetail, outMaterialDetailPO);
|
||||
return outMaterialDetailPO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库执行单)
|
||||
*/
|
||||
@Override
|
||||
public List<ExecutionOutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailMapper.queryOutOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.mhd.oms.domain.executionOutMaterialDetail.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 出库明细查询结果(关联出库执行单)
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@Data
|
||||
public class ExecutionOutMaterialDetailWithOrderPO extends ExecutionOutMaterialDetailPO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("出库单状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
private Integer outOrderStatus;
|
||||
|
||||
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer outOrderAuditStatus;
|
||||
|
||||
@ApiModelProperty("货主ID")
|
||||
private Long orderShipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
private String orderShipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String orderShipperName;
|
||||
|
||||
@ApiModelProperty("出仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderOutboundDate;
|
||||
|
||||
@ApiModelProperty("出库时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date orderOutboundTime;
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.mhd.oms.domain.executionOutMaterialDetail.repository.todo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 出库明细查询参数 DTO
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@Data
|
||||
public class ExecutionOutMaterialDetailQueryDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@ApiModelProperty("仓库id")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("出库单类型编码")
|
||||
private String outOrderTypeCode;
|
||||
|
||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
private Integer outStatus;
|
||||
|
||||
@ApiModelProperty("预计出库时间 开始")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date outOrderExpectStartTime;
|
||||
|
||||
@ApiModelProperty("预计出库时间 结束")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date outOrderExpectEndTime;
|
||||
|
||||
@ApiModelProperty("物料基础信息id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.mhd.oms.domain.executionOutMaterialDetail.service;
|
||||
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出库明细ApplicationService
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ExecutionOutMaterialDetailApplicationService {
|
||||
@Autowired
|
||||
private ExecutionOutMaterialDetailDomainService outMaterialDetailDomainService;
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库执行单)
|
||||
*/
|
||||
public List<ExecutionOutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1) {
|
||||
queryOrderOverStockDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
}
|
||||
return outMaterialDetailDomainService.queryOutOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.mhd.oms.domain.executionOutMaterialDetail.service;
|
||||
|
||||
import com.mhd.common.core.utils.IgnoreNullUtil;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailQueryDTO;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 出库明细Assembler
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-24
|
||||
*/
|
||||
@Component
|
||||
public class ExecutionOutMaterialDetailAssembler {
|
||||
|
||||
/**
|
||||
* 出库明细查询 DTO → QueryOrderOverStockDO
|
||||
*/
|
||||
public QueryOrderOverStockDO toQueryDO(ExecutionOutMaterialDetailQueryDTO queryDTO) {
|
||||
QueryOrderOverStockDO queryDO = new QueryOrderOverStockDO();
|
||||
BeanUtils.copyProperties(queryDTO, queryDO, IgnoreNullUtil.getNullPropertyNames(queryDTO));
|
||||
return queryDO;
|
||||
}
|
||||
}
|
||||
+9
@@ -5,7 +5,9 @@ package com.mhd.oms.domain.executionOutMaterialDetail.service;
|
||||
//import com.mhd.wms.domain.outMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.facade.IExecutionOutMaterialDetailService;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.po.ExecutionOutMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionOutMaterialDetail.repository.todo.ExecutionOutMaterialDetailDO;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -64,4 +66,11 @@ public class ExecutionOutMaterialDetailDomainService {
|
||||
return outMaterialDetailService.getInfo(materialDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库明细查询(关联出库执行单)
|
||||
*/
|
||||
public List<ExecutionOutMaterialDetailWithOrderPO> queryOutOrderDetailList(QueryOrderOverStockDO queryOrderOverStockDO) {
|
||||
return outMaterialDetailService.queryOutOrderDetailList(queryOrderOverStockDO);
|
||||
}
|
||||
|
||||
}
|
||||
+3
@@ -456,4 +456,7 @@ public class ExecutionStockInOrder extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("业务计价方式")
|
||||
private String businessPriceWay;
|
||||
|
||||
@ApiModelProperty("通知单备注")
|
||||
private String noticeRemark;
|
||||
}
|
||||
+2
@@ -480,4 +480,6 @@ public class ExecutionStockInOrderPO extends BaseVOEntity {
|
||||
@ApiModelProperty("业务计价方式")
|
||||
private String businessPriceWay;
|
||||
private String khdm;
|
||||
@ApiModelProperty("通知单备注")
|
||||
private String noticeRemark;
|
||||
}
|
||||
+2
@@ -511,4 +511,6 @@ public class ExecutionStockInOrderDO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("业务计价方式")
|
||||
private String businessPriceWay;
|
||||
@ApiModelProperty("通知单备注")
|
||||
private String noticeRemark;
|
||||
}
|
||||
+2
@@ -508,4 +508,6 @@ public class ExecutionStockInOrderDTO extends ExecutionStockInOrderBaseDTO {
|
||||
|
||||
@ApiModelProperty("业务计价方式")
|
||||
private String businessPriceWay;
|
||||
@ApiModelProperty("通知单备注")
|
||||
private String noticeRemark;
|
||||
}
|
||||
+91
-4
@@ -30,6 +30,7 @@ import com.mhd.oms.domain.executionStockInOrder.repository.todo.ExecutionStockIn
|
||||
import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.facade.IExecutionStockOutOrderService;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReservationStockInOrderMapper;
|
||||
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.*;
|
||||
@@ -43,6 +44,7 @@ import org.springframework.util.CollectionUtils;
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -89,6 +91,8 @@ public class ExecutionStockInOrderDomainService {
|
||||
// private IShelfMaterialDetailService shelfMaterialDetailService;
|
||||
@Resource
|
||||
private ReservationStockInOrderMapper stockInOrderMapper;
|
||||
@Autowired
|
||||
private ReserveStockInOrderMapper reserveStockInOrderMapper;
|
||||
/**
|
||||
* 分页查询入库单列表
|
||||
*/
|
||||
@@ -96,14 +100,70 @@ public class ExecutionStockInOrderDomainService {
|
||||
return stockInOrderService.queryList(stockInOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从单号列表中提取最大序号
|
||||
* 单号格式: prefix + 数字序号(如 RK260807001 中 prefix=RK260807, 序号=001)
|
||||
* 即使中间有删单,也能保证序号递增不重复
|
||||
*
|
||||
* @param orderNumbers 匹配的单号列表
|
||||
* @param prefixLength 前缀长度(序号从该位置开始截取)
|
||||
* @return 最大序号值,列表为空时返回0
|
||||
*/
|
||||
private int extractMaxSequenceNumber(List<String> orderNumbers, int prefixLength) {
|
||||
if (orderNumbers == null || orderNumbers.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int maxSeq = 0;
|
||||
for (String orderNumber : orderNumbers) {
|
||||
if (orderNumber != null && orderNumber.length() > prefixLength) {
|
||||
try {
|
||||
String seqStr = orderNumber.substring(prefixLength);
|
||||
int seq = Integer.parseInt(seqStr);
|
||||
if (seq > maxSeq) {
|
||||
maxSeq = seq;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 序号部分非数字,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxSeq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库单
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ExecutionStockInOrderDO stockInOrderDO) {
|
||||
if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
//设置入库单号
|
||||
Long warehouseId = stockInOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = stockInOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockInOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(prefix + seq);
|
||||
}
|
||||
// //设置默认值
|
||||
// setDefaultValues(stockInOrderDO);
|
||||
@@ -132,8 +192,35 @@ public class ExecutionStockInOrderDomainService {
|
||||
*/
|
||||
public Boolean batchInsert(List<ExecutionStockInOrderDO> stockInOrderDOList) {
|
||||
for (ExecutionStockInOrderDO stockInOrderDO : stockInOrderDOList){
|
||||
if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
//设置入库单号
|
||||
Long warehouseId = stockInOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = stockInOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockInOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(prefix + seq);
|
||||
}
|
||||
// //设置物料信息
|
||||
// setMaterialDetailInfo(stockInOrderDO);
|
||||
|
||||
+103
-5
@@ -8,6 +8,7 @@ import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.businessDeliveryDetailsLink.entity.BusinessDeliveryDetailsLink;
|
||||
import com.mhd.oms.domain.businessDeliveryDetailsLink.repository.facade.IBusinessDeliveryDetailsLinkService;
|
||||
@@ -38,6 +39,8 @@ import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReservationStockInOrderMapper;
|
||||
import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper;
|
||||
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.*;
|
||||
@@ -50,6 +53,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;
|
||||
|
||||
@@ -96,6 +100,8 @@ public class ExecutionStockOutOrderDomainService {
|
||||
private ReservationMaterialInventoryMapper reservationMaterialInventoryMapper;
|
||||
@Autowired
|
||||
private ReservationStockInOrderMapper stockInOrderMapper;
|
||||
@Autowired
|
||||
private ReserveStockOutOrderMapper reserveStockOutOrderMapper;
|
||||
/**
|
||||
* 分页查询出库单列表
|
||||
*/
|
||||
@@ -103,14 +109,74 @@ public class ExecutionStockOutOrderDomainService {
|
||||
return stockOutOrderService.queryList(stockOutOrderDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从单号列表中提取最大序号
|
||||
* 单号格式: prefix + 数字序号(如 RK260807001 中 prefix=RK260807, 序号=001)
|
||||
* 即使中间有删单,也能保证序号递增不重复
|
||||
*
|
||||
* @param orderNumbers 匹配的单号列表
|
||||
* @param prefixLength 前缀长度(序号从该位置开始截取)
|
||||
* @return 最大序号值,列表为空时返回0
|
||||
*/
|
||||
private int extractMaxSequenceNumber(List<String> orderNumbers, int prefixLength) {
|
||||
if (orderNumbers == null || orderNumbers.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int maxSeq = 0;
|
||||
for (String orderNumber : orderNumbers) {
|
||||
if (orderNumber != null && orderNumber.length() > prefixLength) {
|
||||
try {
|
||||
String seqStr = orderNumber.substring(prefixLength);
|
||||
int seq = Integer.parseInt(seqStr);
|
||||
if (seq > maxSeq) {
|
||||
maxSeq = seq;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 序号部分非数字,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxSeq;
|
||||
}
|
||||
/**
|
||||
* 新增出库单
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ExecutionStockOutOrderDO stockOutOrderDO) {
|
||||
if (stockOutOrderDO.getOutOrderNumber() == null) {
|
||||
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
//设置单号
|
||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(datePrefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(prefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
// 与 update / batchInsert 一致:前端传计划数量为 quantity,非 outboundQuantity
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
@@ -147,8 +213,40 @@ public class ExecutionStockOutOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchInsert(List<ExecutionStockOutOrderDO> stockOutOrderDOList) {
|
||||
for (ExecutionStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
|
||||
if (StringUtils.isBlank(stockOutOrderDO.getOutOrderNumber())){
|
||||
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
//设置单号
|
||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(datePrefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(prefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
//设置物料信息
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
|
||||
+4
@@ -61,6 +61,10 @@ public class ReservationStockInOrder extends BaseVOEntity {
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行入库单号")
|
||||
@Excel(name = "执行入库单号")
|
||||
private String executionInOrderNumber;
|
||||
|
||||
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
|
||||
private Integer status;
|
||||
|
||||
+69
-3
@@ -39,6 +39,7 @@ import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservatio
|
||||
import com.mhd.oms.domain.reservationStockOutOrder.repository.mapper.ReservationStockOutOrderMapper;
|
||||
import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ReservationStockOutOrderDO;
|
||||
import com.mhd.oms.domain.reservationStockOutOrder.service.ReservationStockOutOrderApplicationService;
|
||||
import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
import com.mhd.system.api.domain.SysDictData;
|
||||
@@ -87,7 +88,8 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
private IReservationInMaterialDetailService materialDetailService;
|
||||
@Autowired
|
||||
private ReservationStockInOrderDomainService reservationStockInOrderDomainService;
|
||||
|
||||
@Autowired
|
||||
private ReserveStockInOrderMapper reservationStockInOrderMapper;
|
||||
/**
|
||||
* 查询入库单列表
|
||||
*/
|
||||
@@ -504,12 +506,76 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
||||
return insertDomain(stockInOrderDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从单号列表中提取最大序号
|
||||
* 单号格式: prefix + 数字序号(如 RK260807001 中 prefix=RK260807, 序号=001)
|
||||
* 即使中间有删单,也能保证序号递增不重复
|
||||
*
|
||||
* @param orderNumbers 匹配的单号列表
|
||||
* @param prefixLength 前缀长度(序号从该位置开始截取)
|
||||
* @return 最大序号值,列表为空时返回0
|
||||
*/
|
||||
private int extractMaxSequenceNumber(List<String> orderNumbers, int prefixLength) {
|
||||
if (orderNumbers == null || orderNumbers.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int maxSeq = 0;
|
||||
for (String orderNumber : orderNumbers) {
|
||||
if (orderNumber != null && orderNumber.length() > prefixLength) {
|
||||
try {
|
||||
String seqStr = orderNumber.substring(prefixLength);
|
||||
int seq = Integer.parseInt(seqStr);
|
||||
if (seq > maxSeq) {
|
||||
maxSeq = seq;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 序号部分非数字,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxSeq;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertDomain(ReservationStockInOrderDO stockInOrderDO) {
|
||||
if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
// if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
|
||||
//设置入库单号
|
||||
Long warehouseId = stockInOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = stockInOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockInOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reservationStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(datePrefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reservationStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(prefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
stockInOrderDO.setInOrderNumber(reservationStockInOrderDomainService.generateReserveOrderNumber());
|
||||
stockInOrderDO.setBusinessOrderNo(stockInOrderDO.getInOrderNumber());
|
||||
}
|
||||
// }
|
||||
// //统计总计划数
|
||||
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReservationInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderDO.setQuantity(quantity);
|
||||
|
||||
+8
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||
import com.mhd.oms.domain.executionStockInOrder.entity.ExecutionStockInOrder;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -62,6 +63,10 @@ public class ReservationStockInOrderPO extends BaseVOEntity {
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行入库单号")
|
||||
@Excel(name = "执行入库单号")
|
||||
private String executionInOrderNumber;
|
||||
|
||||
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
|
||||
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
|
||||
private Integer status;
|
||||
@@ -242,6 +247,9 @@ public class ReservationStockInOrderPO extends BaseVOEntity {
|
||||
@ApiModelProperty("物料明细")
|
||||
private List<ReservationInMaterialDetailPO> materialDetailList;
|
||||
|
||||
@ApiModelProperty("执行单列表")
|
||||
private List<ExecutionStockInOrder> executionStockInOrderList;
|
||||
|
||||
@ApiModelProperty("越库单id")
|
||||
private Long overStockId;
|
||||
|
||||
|
||||
+4
@@ -59,6 +59,10 @@ public class ReservationStockInOrderDO extends BaseVOEntity {
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行入库单号")
|
||||
@Excel(name = "执行入库单号")
|
||||
private String executionInOrderNumber;
|
||||
|
||||
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
|
||||
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
|
||||
private Integer status;
|
||||
|
||||
+4
@@ -59,6 +59,10 @@ public class ReservationStockInOrderDTO extends ReservationStockInOrderBaseDTO {
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行入库单号")
|
||||
@Excel(name = "执行入库单号")
|
||||
private String executionInOrderNumber;
|
||||
|
||||
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
|
||||
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
|
||||
private Integer status;
|
||||
|
||||
+2
-10
@@ -181,17 +181,9 @@ public class ReservationStockInOrderApplicationService {
|
||||
* 新增入库单
|
||||
*/
|
||||
public Boolean insert(ReservationStockInOrderDO stockInOrderDO) {
|
||||
// 如果仓库ID为空,从当前登录用户的关联仓库中获取
|
||||
// 仓库为必填项,前端必须选择入库仓库
|
||||
if (stockInOrderDO.getWarehouseId() == null) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException("登录已失效,请重新登录");
|
||||
}
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
if (associationWarehouseCacheDO == null || associationWarehouseCacheDO.getWarehouseId() == null) {
|
||||
throw new ServiceException("当前用户未配置关联仓库,请先配置仓库");
|
||||
}
|
||||
stockInOrderDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
throw new ServiceException("请选择入库仓库");
|
||||
}
|
||||
//设置仓库
|
||||
setWarehouseInfo(stockInOrderDO);
|
||||
|
||||
+195
-8
@@ -99,16 +99,92 @@ public class ReservationStockInOrderDomainService {
|
||||
return stockInOrderService.queryList(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;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 从单号列表中提取最大序号
|
||||
* 单号格式: prefix + 数字序号(如 RK260807001 中 prefix=RK260807, 序号=001)
|
||||
* 即使中间有删单,也能保证序号递增不重复
|
||||
*
|
||||
* @param orderNumbers 匹配的单号列表
|
||||
* @param prefixLength 前缀长度(序号从该位置开始截取)
|
||||
* @return 最大序号值,列表为空时返回0
|
||||
*/
|
||||
private int extractMaxSequenceNumber(List<String> orderNumbers, int prefixLength) {
|
||||
if (orderNumbers == null || orderNumbers.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int maxSeq = 0;
|
||||
for (String orderNumber : orderNumbers) {
|
||||
if (orderNumber != null && orderNumber.length() > prefixLength) {
|
||||
try {
|
||||
String seqStr = orderNumber.substring(prefixLength);
|
||||
int seq = Integer.parseInt(seqStr);
|
||||
if (seq > maxSeq) {
|
||||
maxSeq = seq;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 序号部分非数字,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxSeq;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增入库单
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReservationStockInOrderDO stockInOrderDO) {
|
||||
if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
stockInOrderDO.setInOrderNumber(generateReserveOrderNumber());
|
||||
stockInOrderDO.setBusinessOrderNo(stockInOrderDO.getInOrderNumber());
|
||||
}
|
||||
// if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
|
||||
//设置入库单号
|
||||
Long warehouseId = stockInOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = stockInOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockInOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(datePrefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(prefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
// stockInOrderDO.setInOrderNumber(generateReserveOrderNumber());
|
||||
// stockInOrderDO.setBusinessOrderNo(stockInOrderDO.getInOrderNumber());
|
||||
// }
|
||||
// //设置默认值
|
||||
// setDefaultValues(stockInOrderDO);
|
||||
// //设置物料信息
|
||||
@@ -136,9 +212,40 @@ public class ReservationStockInOrderDomainService {
|
||||
*/
|
||||
public Boolean batchInsert(List<ReservationStockInOrderDO> stockInOrderDOList) {
|
||||
for (ReservationStockInOrderDO stockInOrderDO : stockInOrderDOList){
|
||||
if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
|
||||
//设置入库单号
|
||||
Long warehouseId = stockInOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = stockInOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockInOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(datePrefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(prefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
// //设置物料信息
|
||||
// setMaterialDetailInfo(stockInOrderDO);
|
||||
// //统计总物料种数
|
||||
@@ -247,6 +354,12 @@ public class ReservationStockInOrderDomainService {
|
||||
String inOrderNumber = stockInOrderPO.getInOrderNumber();
|
||||
List<BusinessDocumentOrder> businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getInOrderNumber, inOrderNumber).notIn(BusinessDocumentOrder::getOrderStatus,4,5));
|
||||
stockInOrderPO.setBusinessDocumentOrderDOList(businessDocumentOrders);
|
||||
//执行单
|
||||
List<ExecutionStockInOrder> executionStockInOrders = executionStockInOrderMapper.selectList(new LambdaQueryWrapper<ExecutionStockInOrder>()
|
||||
.eq(ExecutionStockInOrder::getBusinessInOrderNumber, inOrderNumber)
|
||||
.eq(ExecutionStockInOrder::getDelFlag, 1));
|
||||
stockInOrderPO.setExecutionStockInOrderList(executionStockInOrders);
|
||||
|
||||
inMaterialDetailDO.setInOrderNumber(inOrderNumber);
|
||||
inMaterialDetailDO.setLevel(1);
|
||||
List<ReservationInMaterialDetailPO> inMaterialDetailPOList = materialDetailService.queryList(inMaterialDetailDO);
|
||||
@@ -514,6 +627,7 @@ public class ReservationStockInOrderDomainService {
|
||||
// 按照 warehouseId 分组
|
||||
Map<Long, List<ReservationInMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||
.collect(Collectors.groupingBy(ReservationInMaterialDetail::getWarehouseId));
|
||||
List<String> executionInOrderNumbers = new ArrayList<>();
|
||||
materialDetailGroupByWarehouse.forEach((warehouseId, details) -> {
|
||||
Long topOrgId = reservationStockInOrderMapper.getTopOrgId(warehouseId);
|
||||
Long orgId = reservationStockInOrderMapper.getOrgId(warehouseId);
|
||||
@@ -541,7 +655,40 @@ public class ReservationStockInOrderDomainService {
|
||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
|
||||
reservationStockInOrder.setInOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
|
||||
//设置入库单号
|
||||
Long warehouseId1 = reservationStockInOrder.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId1);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = reservationStockInOrder.getOrganizationId();
|
||||
Long warehouseIdForCount = reservationStockInOrder.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setInOrderNumber(datePrefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setInOrderNumber(prefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
int index = 1;
|
||||
@@ -564,8 +711,11 @@ public class ReservationStockInOrderDomainService {
|
||||
BigDecimal quantity = details.stream().map(ReservationInMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
reservationStockInOrder.setQuantity(quantity);
|
||||
executionStockInOrderService.save(reservationStockInOrder);
|
||||
executionInOrderNumbers.add(reservationStockInOrder.getInOrderNumber());
|
||||
executionInMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||
});
|
||||
byId.setExecutionInOrderNumber(String.join(",", executionInOrderNumbers));
|
||||
stockInOrderService.updateById(byId);
|
||||
}
|
||||
|
||||
|
||||
@@ -667,6 +817,7 @@ public class ReservationStockInOrderDomainService {
|
||||
// 按照 warehouseId 分组
|
||||
Map<Long, List<ReservationInMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||
.collect(Collectors.groupingBy(ReservationInMaterialDetail::getWarehouseId));
|
||||
List<String> executionInOrderNumbers = new ArrayList<>();
|
||||
materialDetailGroupByWarehouse.forEach((warehouseId, details) -> {
|
||||
if (warehouseId == null) warehouseId = warehouseId1;
|
||||
|
||||
@@ -694,7 +845,40 @@ public class ReservationStockInOrderDomainService {
|
||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||
reservationStockInOrder.setBusinessInOrderNumber(inOrderNumber);
|
||||
reservationStockInOrder.setInOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
|
||||
//设置入库单号
|
||||
// Long warehouseId1 = reservationStockInOrder.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = reservationStockInOrder.getOrganizationId();
|
||||
Long warehouseIdForCount = reservationStockInOrder.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setInOrderNumber(datePrefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setInOrderNumber(prefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
List<ExecutionInMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
int index = 1;
|
||||
@@ -716,6 +900,7 @@ public class ReservationStockInOrderDomainService {
|
||||
}
|
||||
BigDecimal quantity = details.stream().map(ReservationInMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
reservationStockInOrder.setQuantity(quantity);
|
||||
executionInOrderNumbers.add(reservationStockInOrder.getInOrderNumber());
|
||||
executionStockInOrderService.save(reservationStockInOrder);
|
||||
executionInMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||
ExecutionStockInOrderDO param = new ExecutionStockInOrderDO();
|
||||
@@ -725,6 +910,8 @@ public class ReservationStockInOrderDomainService {
|
||||
param.setInOrderIds(inOrderIdList1);
|
||||
stockInOrderApplicationService.issueOrder(param);
|
||||
});
|
||||
byId.setExecutionInOrderNumber(String.join(",", executionInOrderNumbers));
|
||||
stockInOrderService.updateById(byId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
@@ -50,6 +50,10 @@ public class ReservationStockOutOrder extends BaseVOEntity {
|
||||
@Excel(name = "出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行出库单号")
|
||||
@Excel(name = "执行出库单号")
|
||||
private String executionOutOrderNumber;
|
||||
|
||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
|
||||
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
|
||||
private Integer status;
|
||||
|
||||
+8
@@ -3,6 +3,7 @@ package com.mhd.oms.domain.reservationStockOutOrder.repository.po;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder;
|
||||
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
|
||||
import com.mhd.oms.domain.reservationDeliveryDetailsLink.repository.po.ReservationDeliveryDetailsLinkPO;
|
||||
import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.ReservationOutMaterialDetailPO;
|
||||
@@ -56,6 +57,10 @@ public class ReservationStockOutOrderPO extends BaseVOEntity {
|
||||
@Excel(name = "出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行出库单号")
|
||||
@Excel(name = "执行出库单号")
|
||||
private String executionOutOrderNumber;
|
||||
|
||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
private Integer status;
|
||||
@@ -261,6 +266,9 @@ public class ReservationStockOutOrderPO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("物料明细")
|
||||
private List<ReservationOutMaterialDetailPO> materialDetailList;
|
||||
|
||||
@ApiModelProperty("执行单列表")
|
||||
private List<ExecutionStockOutOrder> executionStockOutOrderList;
|
||||
//
|
||||
// @ApiModelProperty("出库单复核统计")
|
||||
// private ReservationOutMaterialCheckPO outMaterialCheckPO;
|
||||
|
||||
+4
@@ -52,6 +52,10 @@ public class ReservationStockOutOrderDO extends BaseVOEntity {
|
||||
@Excel(name = "出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行出库单号")
|
||||
@Excel(name = "执行出库单号")
|
||||
private String executionOutOrderNumber;
|
||||
|
||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
private Integer status;
|
||||
|
||||
+4
@@ -50,6 +50,10 @@ public class ReservationStockOutOrderDTO extends ReservationStockOutOrderBaseDTO
|
||||
@Excel(name = "出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@ApiModelProperty("执行出库单号")
|
||||
@Excel(name = "执行出库单号")
|
||||
private String executionOutOrderNumber;
|
||||
|
||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
|
||||
private Integer status;
|
||||
|
||||
+11
@@ -16,6 +16,8 @@ import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.utils.uuid.IdGenerator;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.entity.ExecutionStockOutOrder;
|
||||
import com.mhd.oms.domain.executionStockOutOrder.repository.mapper.ExecutionStockOutOrderMapper;
|
||||
import com.mhd.oms.domain.gwLog.entity.GwLog;
|
||||
import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper;
|
||||
import com.mhd.oms.domain.reservationDeliveryDetailsLink.entity.ReservationDeliveryDetailsLink;
|
||||
@@ -111,6 +113,8 @@ public class ReservationStockOutOrderApplicationService {
|
||||
private ReservationOutMaterialDetailMapper reservationOutMaterialDetailMapper;
|
||||
@Autowired
|
||||
private ReservationDeliveryDetailsLinkMapper reservationDeliveryDetailsLinkMapper;
|
||||
@Autowired
|
||||
private ExecutionStockOutOrderMapper executionStockOutOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private ReservationStockInOrderMapper reservationStockInOrderMapper;
|
||||
@@ -306,6 +310,13 @@ public class ReservationStockOutOrderApplicationService {
|
||||
return stockOutOrderPO;
|
||||
}
|
||||
stockOutOrderPO.setKhdm(userNcCode);
|
||||
|
||||
//执行单
|
||||
List<ExecutionStockOutOrder> executionStockInOrders = executionStockOutOrderMapper.selectList(new LambdaQueryWrapper<ExecutionStockOutOrder>()
|
||||
.eq(ExecutionStockOutOrder::getBusinessOutOrderNumber, stockOutOrderPO.getOutOrderNumber())
|
||||
.eq(ExecutionStockOutOrder::getDelFlag, 1));
|
||||
stockOutOrderPO.setExecutionStockOutOrderList(executionStockInOrders);
|
||||
|
||||
if (stockOutOrderPO.getMaterialDetailList() != null && stockOutOrderPO.getMaterialDetailList().size() > 0) {
|
||||
List<ReservationOutMaterialDetailPO> materialDetailList = stockOutOrderPO.getMaterialDetailList();
|
||||
if (CollectionUtils.isEmpty(materialDetailList)) {
|
||||
|
||||
+184
-8
@@ -122,17 +122,78 @@ public class ReservationStockOutOrderDomainService {
|
||||
public List<ReservationStockOutOrderPO> queryList(ReservationStockOutOrderDO stockOutOrderDO) {
|
||||
return stockOutOrderService.queryList(stockOutOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从单号列表中提取最大序号
|
||||
* 单号格式: prefix + 数字序号(如 RK260807001 中 prefix=RK260807, 序号=001)
|
||||
* 即使中间有删单,也能保证序号递增不重复
|
||||
*
|
||||
* @param orderNumbers 匹配的单号列表
|
||||
* @param prefixLength 前缀长度(序号从该位置开始截取)
|
||||
* @return 最大序号值,列表为空时返回0
|
||||
*/
|
||||
private int extractMaxSequenceNumber(List<String> orderNumbers, int prefixLength) {
|
||||
if (orderNumbers == null || orderNumbers.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int maxSeq = 0;
|
||||
for (String orderNumber : orderNumbers) {
|
||||
if (orderNumber != null && orderNumber.length() > prefixLength) {
|
||||
try {
|
||||
String seqStr = orderNumber.substring(prefixLength);
|
||||
int seq = Integer.parseInt(seqStr);
|
||||
if (seq > maxSeq) {
|
||||
maxSeq = seq;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 序号部分非数字,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxSeq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReservationStockOutOrderDO stockOutOrderDO) {
|
||||
if (stockOutOrderDO.getOutOrderNumber() == null) {
|
||||
stockOutOrderDO.setOutOrderNumber(generateReserveOrderNumber());
|
||||
stockOutOrderDO.setBusinessOrderNo(stockOutOrderDO.getOutOrderNumber());
|
||||
|
||||
//设置单号
|
||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(datePrefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(prefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
// 与 update / batchInsert 一致:前端传计划数量为 quantity,非 outboundQuantity
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
stockOutOrderDO.setMaterialQuantity(stockOutOrderDO.getMaterialDetailList().size());
|
||||
@@ -172,9 +233,44 @@ public class ReservationStockOutOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchInsert(List<ReservationStockOutOrderDO> stockOutOrderDOList) {
|
||||
for (ReservationStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
|
||||
if (StringUtils.isBlank(stockOutOrderDO.getOutOrderNumber())){
|
||||
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
|
||||
|
||||
|
||||
//设置单号
|
||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(datePrefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(prefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
//设置物料信息
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
//统计种类
|
||||
@@ -364,6 +460,7 @@ public class ReservationStockOutOrderDomainService {
|
||||
for (Long inOrderId : inOrderIds) {
|
||||
ReservationStockOutOrder byId = stockOutOrderService.getById(inOrderId);
|
||||
String inOrderNumber = byId.getOutOrderNumber();
|
||||
List<String> executionInOrderNumbers = new ArrayList<>();
|
||||
List<ReservationOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReservationOutMaterialDetail>().lambda().eq(ReservationOutMaterialDetail::getOutOrderNumber, inOrderNumber));
|
||||
|
||||
// 按照 warehouseId 分组
|
||||
@@ -396,7 +493,43 @@ public class ReservationStockOutOrderDomainService {
|
||||
// reservationStockInOrder.setTopOrganizationId(topOrgId);
|
||||
|
||||
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||
reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
// reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
//设置单号
|
||||
Long warehouseId1 = reservationStockInOrder.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId1);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setOutOrderNumber(datePrefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setOutOrderNumber(prefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
|
||||
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
@@ -415,8 +548,11 @@ public class ReservationStockOutOrderDomainService {
|
||||
BigDecimal quantity = details.stream().map(ReservationOutMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
reservationStockInOrder.setQuantity(quantity);
|
||||
executionStockOutOrderService.save(reservationStockInOrder);
|
||||
executionInOrderNumbers.add(reservationStockInOrder.getOutOrderNumber());
|
||||
executionOutMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||
});
|
||||
byId.setExecutionOutOrderNumber(String.join(",", executionInOrderNumbers));
|
||||
stockOutOrderService.updateById(byId);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
@@ -496,6 +632,7 @@ public class ReservationStockOutOrderDomainService {
|
||||
// 按照 warehouseId 分组
|
||||
Map<Long, List<ReservationOutMaterialDetail>> materialDetailGroupByWarehouse = materialDetailList.stream()
|
||||
.collect(Collectors.groupingBy(ReservationOutMaterialDetail::getWarehouseId));
|
||||
List<String> executionInOrderNumbers = new ArrayList<>();
|
||||
materialDetailGroupByWarehouse.forEach((warehouseId, details) -> {
|
||||
if (warehouseId == null) warehouseId = warehouseId1;
|
||||
Long topOrgId = reservationStockInOrderMapper.getTopOrgId(warehouseId);
|
||||
@@ -521,7 +658,43 @@ public class ReservationStockOutOrderDomainService {
|
||||
reservationStockInOrder.setWarehouseCode(warehouseCode);
|
||||
reservationStockInOrder.setWarehouseName(warehouseName);
|
||||
reservationStockInOrder.setBusinessOutOrderNumber(inOrderNumber);
|
||||
reservationStockInOrder.setOutOrderNumber(generateExecutionOrderNumber(warehouseCode));
|
||||
|
||||
|
||||
//设置单号
|
||||
// Long warehouseId1 = reservationStockInOrder.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setOutOrderNumber(datePrefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reserveStockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
reservationStockInOrder.setOutOrderNumber(prefix + seq);
|
||||
// reservationStockInOrder.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
List<ExecutionOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
for (ReservationOutMaterialDetail reservationOutMaterialDetail : details) {
|
||||
@@ -538,6 +711,7 @@ public class ReservationStockOutOrderDomainService {
|
||||
}
|
||||
BigDecimal quantity = details.stream().map(ReservationOutMaterialDetail::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
reservationStockInOrder.setQuantity(quantity);
|
||||
executionInOrderNumbers.add(reservationStockInOrder.getOutOrderNumber());
|
||||
executionStockOutOrderService.save(reservationStockInOrder);
|
||||
executionOutMaterialDetailService.saveBatch(inMaterialDetailList);
|
||||
|
||||
@@ -549,6 +723,8 @@ public class ReservationStockOutOrderDomainService {
|
||||
param.setOutOrderIds(ids);
|
||||
stockOutOrderApplicationService.issueOrder(param);
|
||||
});
|
||||
byId.setExecutionOutOrderNumber(String.join(",", executionInOrderNumbers));
|
||||
stockOutOrderService.updateById(byId);
|
||||
}
|
||||
return update;
|
||||
}
|
||||
|
||||
+8
@@ -77,4 +77,12 @@ public interface ReserveStockInOrderMapper extends BaseMapper<ReserveStockInOrde
|
||||
* 根据入库单号精确统计(导入防重用)
|
||||
*/
|
||||
int countByInOrderNumber(@Param("inOrderNumber") String inOrderNumber);
|
||||
|
||||
/**
|
||||
* 跨4张入库单表查询指定前缀+组织+仓库的所有入库单号(用于取最大序号+1,防止删单后单号重复)
|
||||
* 包含: reserve_stock_in_order, reservation_stock_in_order, execution_stock_in_order, WMS stock_in_order
|
||||
*/
|
||||
List<String> getMaxStockInOrderByPrefixAndOrgAndWarehouse(@Param("prefix") String prefix,
|
||||
@Param("organizationId") Long organizationId,
|
||||
@Param("warehouseId") Long warehouseId);
|
||||
}
|
||||
+95
-7
@@ -103,9 +103,39 @@ public class ReserveStockInOrderDomainService {
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReserveStockInOrderDO stockInOrderDO) {
|
||||
if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
stockInOrderDO.setInOrderNumber(generateReserveOrderNumber());
|
||||
// if (stockInOrderDO.getInOrderNumber() == null) {
|
||||
Long warehouseId = stockInOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = stockInOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockInOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reservationStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(datePrefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reservationStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(prefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
// }
|
||||
// //设置默认值
|
||||
// setDefaultValues(stockInOrderDO);
|
||||
// //设置物料信息
|
||||
@@ -136,8 +166,36 @@ public class ReserveStockInOrderDomainService {
|
||||
*/
|
||||
public Boolean batchInsert(List<ReserveStockInOrderDO> stockInOrderDOList) {
|
||||
for (ReserveStockInOrderDO stockInOrderDO : stockInOrderDOList){
|
||||
if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){
|
||||
stockInOrderDO.setInOrderNumber(generateReserveOrderNumber());
|
||||
Long warehouseId = stockInOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getInOrderNoPrefix();
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "RK";
|
||||
}
|
||||
Long organizationId = stockInOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockInOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = reservationStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(datePrefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = reservationStockInOrderMapper.getMaxStockInOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockInOrderDO.setInOrderNumber(prefix + seq);
|
||||
stockInOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
// //设置物料信息
|
||||
// setMaterialDetailInfo(stockInOrderDO);
|
||||
@@ -477,15 +535,15 @@ public class ReserveStockInOrderDomainService {
|
||||
String oldInOrderNumber = reservationStockInOrder.getInOrderNumber();
|
||||
// 生成新业务单号,防止与已生成的入库业务单号重复
|
||||
String newOrderNumber = reservationStockInOrderDomainService.generateReserveOrderNumber();
|
||||
reservationStockInOrder.setInOrderNumber(newOrderNumber);
|
||||
reservationStockInOrder.setBusinessOrderNo(newOrderNumber);
|
||||
// reservationStockInOrder.setInOrderNumber(newOrderNumber);
|
||||
// reservationStockInOrder.setBusinessOrderNo(newOrderNumber);
|
||||
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(newOrderNumber); // 使用新单号保持与主表关联
|
||||
// reservationInMaterialDetail.setInOrderNumber(newOrderNumber); // 使用新单号保持与主表关联
|
||||
reservationInMaterialDetail.setQuantity(reserveInMaterialDetail.getReserveQuantity());
|
||||
String lot = generateDateSerialNumber();
|
||||
lot = lot+"-"+index;
|
||||
@@ -993,4 +1051,34 @@ public class ReserveStockInOrderDomainService {
|
||||
return prefix + seq;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从单号列表中提取最大序号
|
||||
* 单号格式: prefix + 数字序号(如 RK260807001 中 prefix=RK260807, 序号=001)
|
||||
* 即使中间有删单,也能保证序号递增不重复
|
||||
*
|
||||
* @param orderNumbers 匹配的单号列表
|
||||
* @param prefixLength 前缀长度(序号从该位置开始截取)
|
||||
* @return 最大序号值,列表为空时返回0
|
||||
*/
|
||||
private int extractMaxSequenceNumber(List<String> orderNumbers, int prefixLength) {
|
||||
if (orderNumbers == null || orderNumbers.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int maxSeq = 0;
|
||||
for (String orderNumber : orderNumbers) {
|
||||
if (orderNumber != null && orderNumber.length() > prefixLength) {
|
||||
try {
|
||||
String seqStr = orderNumber.substring(prefixLength);
|
||||
int seq = Integer.parseInt(seqStr);
|
||||
if (seq > maxSeq) {
|
||||
maxSeq = seq;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 序号部分非数字,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxSeq;
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -50,4 +50,12 @@ public interface ReserveStockOutOrderMapper extends BaseMapper<ReserveStockOutOr
|
||||
* @param warehouseType 仓库类型编码(如 "1"/"2")
|
||||
*/
|
||||
List<WarehousePO> getWarehouseByType(@Param("warehouseType") String warehouseType);
|
||||
|
||||
/**
|
||||
* 跨4张入库单表查询指定前缀+组织+仓库的所有入库单号(用于取最大序号+1,防止删单后单号重复)
|
||||
* 包含: reserve_stock_in_order, reservation_stock_in_order, execution_stock_in_order, WMS stock_in_order
|
||||
*/
|
||||
List<String> getMaxStockOutOrderByPrefixAndOrgAndWarehouse(@Param("prefix") String prefix,
|
||||
@Param("organizationId") Long organizationId,
|
||||
@Param("warehouseId") Long warehouseId);
|
||||
}
|
||||
+106
-12
@@ -7,6 +7,7 @@ import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||
import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail;
|
||||
@@ -34,10 +35,7 @@ import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrde
|
||||
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.WmsServiceFeign;
|
||||
import com.mhd.system.api.domain.OutMaterialDetail;
|
||||
import com.mhd.system.api.domain.OutMaterialDetailTZPD;
|
||||
import com.mhd.system.api.domain.StockOutOrder;
|
||||
import com.mhd.system.api.domain.StockOutOrderTZPD;
|
||||
import com.mhd.system.api.domain.*;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -78,6 +76,8 @@ public class ReserveStockOutOrderDomainService {
|
||||
|
||||
@Autowired
|
||||
private ReservationStockOutOrderDomainService reservationStockOutOrderDomainService;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
|
||||
/**
|
||||
* 分页查询出库单列表
|
||||
@@ -90,15 +90,77 @@ public class ReserveStockOutOrderDomainService {
|
||||
return stockOutOrderService.detailsList(stockOutOrderDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从单号列表中提取最大序号
|
||||
* 单号格式: prefix + 数字序号(如 RK260807001 中 prefix=RK260807, 序号=001)
|
||||
* 即使中间有删单,也能保证序号递增不重复
|
||||
*
|
||||
* @param orderNumbers 匹配的单号列表
|
||||
* @param prefixLength 前缀长度(序号从该位置开始截取)
|
||||
* @return 最大序号值,列表为空时返回0
|
||||
*/
|
||||
private int extractMaxSequenceNumber(List<String> orderNumbers, int prefixLength) {
|
||||
if (orderNumbers == null || orderNumbers.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
int maxSeq = 0;
|
||||
for (String orderNumber : orderNumbers) {
|
||||
if (orderNumber != null && orderNumber.length() > prefixLength) {
|
||||
try {
|
||||
String seqStr = orderNumber.substring(prefixLength);
|
||||
int seq = Integer.parseInt(seqStr);
|
||||
if (seq > maxSeq) {
|
||||
maxSeq = seq;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
// 序号部分非数字,跳过
|
||||
}
|
||||
}
|
||||
}
|
||||
return maxSeq;
|
||||
}
|
||||
/**
|
||||
* 新增出库单
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(ReserveStockOutOrderDO stockOutOrderDO) {
|
||||
if (stockOutOrderDO.getOutOrderNumber() == null) {
|
||||
stockOutOrderDO.setOutOrderNumber(generateReserveOrderNumber());
|
||||
//设置单号
|
||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = stockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(datePrefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = stockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(prefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
|
||||
|
||||
// 与 update / batchInsert 一致:前端传计划数量为 quantity,非 outboundQuantity
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
stockOutOrderDO.setMaterialQuantity(stockOutOrderDO.getMaterialDetailList().size());
|
||||
@@ -126,8 +188,40 @@ public class ReserveStockOutOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean batchInsert(List<ReserveStockOutOrderDO> stockOutOrderDOList) {
|
||||
for (ReserveStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
|
||||
if (StringUtils.isBlank(stockOutOrderDO.getOutOrderNumber())){
|
||||
stockOutOrderDO.setOutOrderNumber(generateReserveOrderNumber());
|
||||
//设置单号
|
||||
Long warehouseId = stockOutOrderDO.getWarehouseId();
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(warehouseId);
|
||||
if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
}
|
||||
//仓库信息
|
||||
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
|
||||
String orderNoGenerateRule = warehouseFeignPO.getOrderNoGenerateRule();
|
||||
String prefix = warehouseFeignPO.getOutOrderNoPrefix();
|
||||
if ("yang_pin_chu_ku".equals(stockOutOrderDO.getBusinessType())) {
|
||||
prefix = warehouseFeignPO.getSampleOutOrderNoPrefix();
|
||||
}
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
prefix = "CK";
|
||||
}
|
||||
Long organizationId = stockOutOrderDO.getOrganizationId();
|
||||
Long warehouseIdForCount = stockOutOrderDO.getWarehouseId();
|
||||
if (orderNoGenerateRule != null && "0".equals(orderNoGenerateRule)) {
|
||||
//日期累加: 前缀 + 当前日期yymmdd + 当天最大序号+1
|
||||
String dateStr = new SimpleDateFormat("yyMMdd").format(new Date());
|
||||
String datePrefix = prefix + dateStr;
|
||||
List<String> orderNumbers = stockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(datePrefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, datePrefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(datePrefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(datePrefix + seq);
|
||||
} else {
|
||||
//历史累加: 前缀 + 历史最大序号+1
|
||||
List<String> orderNumbers = stockOutOrderMapper.getMaxStockOutOrderByPrefixAndOrgAndWarehouse(prefix, organizationId, warehouseIdForCount);
|
||||
int maxSeq = extractMaxSequenceNumber(orderNumbers, prefix.length());
|
||||
String seq = String.format("%03d", maxSeq + 1);
|
||||
stockOutOrderDO.setOutOrderNumber(prefix + seq);
|
||||
stockOutOrderDO.setBusinessOrderNo(prefix + seq);
|
||||
}
|
||||
//设置物料信息
|
||||
setMaterialDetailInfo(stockOutOrderDO);
|
||||
@@ -310,8 +404,8 @@ public class ReserveStockOutOrderDomainService {
|
||||
String oldOutOrderNumber = reservationStockOutOrder.getOutOrderNumber();
|
||||
// 生成出库业务单号,防止与已生成的出库业务单号重复
|
||||
String newOrderNumber = reservationStockOutOrderDomainService.generateReserveOrderNumber();
|
||||
reservationStockOutOrder.setOutOrderNumber(newOrderNumber);
|
||||
reservationStockOutOrder.setBusinessOrderNo(newOrderNumber);
|
||||
// reservationStockOutOrder.setOutOrderNumber(newOrderNumber);
|
||||
// reservationStockOutOrder.setBusinessOrderNo(newOrderNumber);
|
||||
reservationStockOutOrderService.save(reservationStockOutOrder);
|
||||
List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, oldOutOrderNumber));
|
||||
List<ReservationOutMaterialDetail> inMaterialDetailList = new ArrayList<>();
|
||||
@@ -319,7 +413,7 @@ public class ReserveStockOutOrderDomainService {
|
||||
for (ReserveOutMaterialDetail reserveOutMaterialDetail : materialDetailList) {
|
||||
ReservationOutMaterialDetail reservationOutMaterialDetail = new ReservationOutMaterialDetail();
|
||||
BeanUtils.copyProperties(reserveOutMaterialDetail, reservationOutMaterialDetail,"materialDetailId");
|
||||
reservationOutMaterialDetail.setOutOrderNumber(newOrderNumber); // 使用新单号保持与主表关联
|
||||
// reservationOutMaterialDetail.setOutOrderNumber(newOrderNumber); // 使用新单号保持与主表关联
|
||||
String lot = generateDateSerialNumber();
|
||||
lot = lot+"-"+index;
|
||||
index++;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.Map;
|
||||
/**
|
||||
* 三方服务 Feign
|
||||
*/
|
||||
@FeignClient(contextId = "thirdPartyServiceFeign", value = ServiceNameConstants.THIRDPARTY_CENTER, configuration = FeignAutoConfiguration.class)
|
||||
@FeignClient(contextId = "thirdPartyServiceFeign",url = "http://10.33.0.129:8012", value = ServiceNameConstants.THIRDPARTY_CENTER, configuration = FeignAutoConfiguration.class)
|
||||
public interface ThirdPartyServiceFeign {
|
||||
|
||||
//查询当前组织所有三方接口信息
|
||||
@@ -141,4 +141,4 @@ public interface ThirdPartyServiceFeign {
|
||||
@PostMapping("/esignSaasV3/downloadSignContract")
|
||||
R<String> downloadSignContract(@RequestBody Map<String, String> mapResult);
|
||||
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.mhd.oms.interfaces.dto.electronicSignature;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名批量签名请求DTO
|
||||
*
|
||||
* <p>勾选多条记录后批量签名,更新OMS电子签名表 + 调用WMS更新入/出库单表。</p>
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicSignatureBatchSignDTO {
|
||||
|
||||
@ApiModelProperty(value = "签名ID列表", required = true)
|
||||
private List<Long> signatureIds;
|
||||
|
||||
@ApiModelProperty("手写签名图片(base64或URL,单张)")
|
||||
private String signaturePic;
|
||||
|
||||
@ApiModelProperty("拍照取证图片URL列表(多张)")
|
||||
private List<String> evidencePics;
|
||||
|
||||
@ApiModelProperty("签名备注")
|
||||
private String signatureRemark;
|
||||
|
||||
@ApiModelProperty("签名方式:1-扫描二维码 2-电子签名 3-打印手写签名 4-超时自动签名")
|
||||
private Integer signatureMode;
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.mhd.oms.interfaces.dto.electronicSignature;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 电子签名列表查询DTO
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicSignatureQueryDTO {
|
||||
|
||||
@ApiModelProperty("订单类型:IN-入库 OUT-出库")
|
||||
private String orderType;
|
||||
|
||||
@ApiModelProperty("订单号(模糊查询)")
|
||||
private String orderNumber;
|
||||
|
||||
@ApiModelProperty("签名状态:1-待签名 2-已签名")
|
||||
private Integer signatureStatus;
|
||||
|
||||
@ApiModelProperty("签名方式:1-扫描二维码 2-电子签名 3-打印手写签名 4-超时自动签名")
|
||||
private Integer signatureMode;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称(模糊查询)")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库名称(模糊查询)")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("创建时间起")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTimeFrom;
|
||||
|
||||
@ApiModelProperty("创建时间止")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTimeTo;
|
||||
|
||||
@ApiModelProperty("页码")
|
||||
private Integer pageNum;
|
||||
|
||||
@ApiModelProperty("每页条数")
|
||||
private Integer pageSize;
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
package com.mhd.oms.interfaces.dto.electronicSignature;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名保存DTO(接收WMS端Feign调用)
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicSignatureSaveDTO {
|
||||
|
||||
@ApiModelProperty("订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("订单号")
|
||||
private String orderNumber;
|
||||
|
||||
@ApiModelProperty("订单类型:IN-入库 OUT-出库")
|
||||
private String orderType;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long createBy;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
private String createByName;
|
||||
|
||||
@ApiModelProperty("物料明细列表")
|
||||
private List<MaterialDetailItem> materialDetailList;
|
||||
|
||||
@Data
|
||||
public static class MaterialDetailItem {
|
||||
|
||||
@ApiModelProperty("物料基础信息ID")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@ApiModelProperty("单位代码")
|
||||
private String unitCode;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("批次号")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("库区ID")
|
||||
private Long storageSectionId;
|
||||
|
||||
@ApiModelProperty("库区编码")
|
||||
private String storageSectionCode;
|
||||
|
||||
@ApiModelProperty("库区名称")
|
||||
private String storageSectionName;
|
||||
|
||||
@ApiModelProperty("库位ID")
|
||||
private Long storageLocationId;
|
||||
|
||||
@ApiModelProperty("库位编码")
|
||||
private String storageLocationCode;
|
||||
|
||||
@ApiModelProperty("库位名称")
|
||||
private String storageLocationName;
|
||||
|
||||
@ApiModelProperty("业务唯一ID")
|
||||
private Long uniqueId;
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package com.mhd.oms.interfaces.dto.electronicSignature;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子签名列表返回VO
|
||||
*/
|
||||
@Data
|
||||
public class ElectronicSignatureVO {
|
||||
|
||||
@ApiModelProperty("签名ID")
|
||||
private Long signatureId;
|
||||
|
||||
@ApiModelProperty("订单ID")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("订单号")
|
||||
private String orderNumber;
|
||||
|
||||
@ApiModelProperty("订单类型:IN-入库 OUT-出库")
|
||||
private String orderType;
|
||||
|
||||
@ApiModelProperty("签名状态:1-待签名 2-已签名")
|
||||
private Integer signatureStatus;
|
||||
|
||||
@ApiModelProperty("签名状态名称")
|
||||
private String signatureStatusName;
|
||||
|
||||
@ApiModelProperty("签名时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date signatureTime;
|
||||
|
||||
@ApiModelProperty("手写签名图片")
|
||||
private String signaturePic;
|
||||
|
||||
@ApiModelProperty("拍照取证图片")
|
||||
private String evidencePics;
|
||||
|
||||
@ApiModelProperty("签名备注")
|
||||
private String signatureRemark;
|
||||
|
||||
@ApiModelProperty("签名方式:1-扫描二维码 2-电子签名 3-打印手写签名 4-超时自动签名")
|
||||
private Integer signatureMode;
|
||||
|
||||
@ApiModelProperty("签名方式名称")
|
||||
private String signatureModeName;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@ApiModelProperty("仓库编码")
|
||||
private String warehouseCode;
|
||||
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
private Long createBy;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
private String createByName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("物料明细列表")
|
||||
private List<MaterialDetailVO> materialDetailList;
|
||||
|
||||
@Data
|
||||
public static class MaterialDetailVO {
|
||||
|
||||
@ApiModelProperty("明细ID")
|
||||
private Long detailId;
|
||||
|
||||
@ApiModelProperty("物料基础信息ID")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
private BigDecimal quantity;
|
||||
|
||||
@ApiModelProperty("单位代码")
|
||||
private String unitCode;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("批次号")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
@ApiModelProperty("库区编码")
|
||||
private String storageSectionCode;
|
||||
|
||||
@ApiModelProperty("库区名称")
|
||||
private String storageSectionName;
|
||||
|
||||
@ApiModelProperty("库位编码")
|
||||
private String storageLocationCode;
|
||||
|
||||
@ApiModelProperty("库位名称")
|
||||
private String storageLocationName;
|
||||
}
|
||||
}
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
package com.mhd.oms.interfaces.facade.electronicSignature;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignature;
|
||||
import com.mhd.oms.domain.electronicSignature.entity.ElectronicSignatureMaterialDetail;
|
||||
import com.mhd.oms.domain.electronicSignature.repository.todo.ElectronicSignatureDO;
|
||||
import com.mhd.oms.domain.electronicSignature.service.ElectronicSignatureDomainService;
|
||||
import com.mhd.oms.interfaces.dto.electronicSignature.ElectronicSignatureBatchSignDTO;
|
||||
import com.mhd.oms.interfaces.dto.electronicSignature.ElectronicSignatureQueryDTO;
|
||||
import com.mhd.oms.interfaces.dto.electronicSignature.ElectronicSignatureSaveDTO;
|
||||
import com.mhd.oms.interfaces.dto.electronicSignature.ElectronicSignatureVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 电子签名Api
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/electronicSignatureApi")
|
||||
@Api(tags = "电子签名")
|
||||
public class ElectronicSignatureApi extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ElectronicSignatureDomainService electronicSignatureDomainService;
|
||||
|
||||
/**
|
||||
* 保存电子签名记录(WMS端Feign调用)
|
||||
*/
|
||||
@ApiOperation("保存电子签名记录")
|
||||
@PostMapping("/saveSignature")
|
||||
public AjaxResult saveSignature(@RequestBody ElectronicSignatureSaveDTO saveDTO) {
|
||||
try {
|
||||
ElectronicSignatureDO signatureDO = toDO(saveDTO);
|
||||
electronicSignatureDomainService.saveSignature(signatureDO);
|
||||
return AjaxResult.success("电子签名记录保存成功");
|
||||
} catch (Exception e) {
|
||||
log.error("保存电子签名记录失败", e);
|
||||
return AjaxResult.error("保存电子签名记录失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存电子签名记录(WMS端Feign调用)
|
||||
*/
|
||||
@ApiOperation("二维码签名")
|
||||
@PostMapping("/inQqcode")
|
||||
public AjaxResult inQqcode(@RequestBody ElectronicSignatureSaveDTO saveDTO) {
|
||||
try {
|
||||
ElectronicSignatureDO signatureDO = toDO(saveDTO);
|
||||
electronicSignatureDomainService.inQqcode(signatureDO);
|
||||
return AjaxResult.success("电子签名记录保存成功");
|
||||
} catch (Exception e) {
|
||||
log.error("保存电子签名记录失败", e);
|
||||
return AjaxResult.error("保存电子签名记录失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("二维码签名")
|
||||
@PostMapping("/outQqcode")
|
||||
public AjaxResult outQqcode(@RequestBody ElectronicSignatureSaveDTO saveDTO) {
|
||||
try {
|
||||
ElectronicSignatureDO signatureDO = toDO(saveDTO);
|
||||
electronicSignatureDomainService.outQqcode(signatureDO);
|
||||
return AjaxResult.success("电子签名记录保存成功");
|
||||
} catch (Exception e) {
|
||||
log.error("保存电子签名记录失败", e);
|
||||
return AjaxResult.error("保存电子签名记录失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询电子签名列表
|
||||
*/
|
||||
@ApiOperation("分页查询电子签名列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ElectronicSignatureQueryDTO queryDTO) {
|
||||
PageHelper.startPage(queryDTO.getPageNum() == null ? 1 : queryDTO.getPageNum(),
|
||||
queryDTO.getPageSize() == null ? 10 : queryDTO.getPageSize());
|
||||
List<ElectronicSignature> list = electronicSignatureDomainService.querySignatureList(queryDTO);
|
||||
List<ElectronicSignatureVO> voList = list.stream()
|
||||
.map(this::toVO)
|
||||
.collect(Collectors.toList());
|
||||
return getDataTable(voList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单编号查询电子签名列表
|
||||
*/
|
||||
@ApiOperation("根据订单编号查询电子签名列表")
|
||||
@GetMapping("/getByOrderNumber")
|
||||
public AjaxResult getByOrderNumber(ElectronicSignatureQueryDTO queryDTO) {
|
||||
List<ElectronicSignature> list = electronicSignatureDomainService.getByOrderNumber(queryDTO);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询签名详情(含物料明细)
|
||||
*/
|
||||
@ApiOperation("查询签名详情(含物料明细)")
|
||||
@GetMapping("/detail")
|
||||
public AjaxResult detail(Long signatureId) {
|
||||
if (signatureId == null) {
|
||||
return AjaxResult.error("签名ID不能为空");
|
||||
}
|
||||
ElectronicSignature signature = electronicSignatureDomainService.getSignatureById(signatureId);
|
||||
if (signature == null) {
|
||||
return AjaxResult.error("未找到签名记录");
|
||||
}
|
||||
ElectronicSignatureVO vo = toVO(signature);
|
||||
// 查询物料明细
|
||||
List<ElectronicSignatureMaterialDetail> details =
|
||||
electronicSignatureDomainService.queryMaterialDetailBySignatureId(signatureId);
|
||||
if (details != null && !details.isEmpty()) {
|
||||
vo.setMaterialDetailList(details.stream().map(d -> {
|
||||
ElectronicSignatureVO.MaterialDetailVO dto = new ElectronicSignatureVO.MaterialDetailVO();
|
||||
BeanUtils.copyProperties(d, dto);
|
||||
return dto;
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
return AjaxResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 勾选记录批量签名
|
||||
*
|
||||
* <p>前端勾选多条待签名的电子签名记录,传入签名ID列表(signatureIds)、签名图片(signaturePic)、
|
||||
* 签名备注(signatureRemark)、签名方式(signatureMode),后端:</p>
|
||||
* <ul>
|
||||
* <li>更新 OMS ELECTRONIC_SIGNATURE 表:signatureStatus=2(已签名)、signatureTime=当前时间、signaturePic、evidencePics、signatureRemark、signatureMode</li>
|
||||
* <li>通过 Feign 调用 WMS 更新 stock_in_order / stock_out_order 表的对应签名字段</li>
|
||||
* </ul>
|
||||
*/
|
||||
@ApiOperation("批量签名(勾选记录后批量更新签名状态为已签名)")
|
||||
@PostMapping("/batchSign")
|
||||
public AjaxResult batchSign(@RequestBody ElectronicSignatureBatchSignDTO dto) {
|
||||
if (dto.getSignatureIds() == null || dto.getSignatureIds().isEmpty()) {
|
||||
return AjaxResult.error("请选择需要签名的记录");
|
||||
}
|
||||
try {
|
||||
int count = electronicSignatureDomainService.batchSign(dto);
|
||||
if (count > 0) {
|
||||
return AjaxResult.success("批量签名成功,共更新 " + count + " 条记录");
|
||||
} else {
|
||||
return AjaxResult.error("批量签名失败:未找到有效的待签名记录");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量签名失败", e);
|
||||
return AjaxResult.error("批量签名失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("批量签名(勾选记录后批量更新签名状态为已签名)")
|
||||
@PostMapping("/batchSignByWmsId")
|
||||
public AjaxResult batchSignByWmsId(@RequestBody ElectronicSignatureBatchSignDTO dto) {
|
||||
if (dto.getSignatureIds() == null || dto.getSignatureIds().isEmpty()) {
|
||||
return AjaxResult.error("请选择需要签名的记录");
|
||||
}
|
||||
try {
|
||||
int count = electronicSignatureDomainService.batchSignByWmsId(dto);
|
||||
if (count > 0) {
|
||||
return AjaxResult.success("批量签名成功,共更新 " + count + " 条记录");
|
||||
} else {
|
||||
return AjaxResult.error("批量签名失败:未找到有效的待签名记录");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("批量签名失败", e);
|
||||
return AjaxResult.error("批量签名失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private ElectronicSignatureDO toDO(ElectronicSignatureSaveDTO dto) {
|
||||
ElectronicSignatureDO signatureDO = new ElectronicSignatureDO();
|
||||
BeanUtils.copyProperties(dto, signatureDO, "materialDetailList");
|
||||
|
||||
// 转换物料明细
|
||||
if (dto.getMaterialDetailList() != null) {
|
||||
List<ElectronicSignatureMaterialDetail> detailList = new ArrayList<>();
|
||||
for (ElectronicSignatureSaveDTO.MaterialDetailItem item : dto.getMaterialDetailList()) {
|
||||
ElectronicSignatureMaterialDetail detail = new ElectronicSignatureMaterialDetail();
|
||||
BeanUtils.copyProperties(item, detail);
|
||||
detailList.add(detail);
|
||||
}
|
||||
signatureDO.setMaterialDetailList(detailList);
|
||||
}
|
||||
|
||||
return signatureDO;
|
||||
}
|
||||
|
||||
private ElectronicSignatureVO toVO(ElectronicSignature entity) {
|
||||
ElectronicSignatureVO vo = new ElectronicSignatureVO();
|
||||
BeanUtils.copyProperties(entity, vo);
|
||||
|
||||
// 签名状态名称
|
||||
if (entity.getSignatureStatus() != null) {
|
||||
vo.setSignatureStatusName(entity.getSignatureStatus() == 1 ? "待签名" : entity.getSignatureStatus() == 2 ? "已签名" : null);
|
||||
}
|
||||
// 签名方式名称
|
||||
if (entity.getSignatureMode() != null) {
|
||||
switch (entity.getSignatureMode()) {
|
||||
case 1: vo.setSignatureModeName("扫描二维码"); break;
|
||||
case 2: vo.setSignatureModeName("电子签名"); break;
|
||||
case 3: vo.setSignatureModeName("打印手写签名"); break;
|
||||
case 4: vo.setSignatureModeName("超时自动签名"); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
+16
@@ -4,8 +4,11 @@ import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.po.ExecutionInMaterialDetailWithOrderPO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailDTO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.ExecutionInMaterialDetailQueryDTO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.repository.todo.QueryOrderOverStockDO;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.service.ExecutionInMaterialDetailApplicationService;
|
||||
import com.mhd.oms.domain.executionInMaterialDetail.service.ExecutionInMaterialDetailAssembler;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -80,4 +83,17 @@ public class ExecutionInMaterialDetailApi extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 入库明细查询(关联入库执行单)
|
||||
*/
|
||||
@ApiOperation("入库明细查询(关联入库执行单)")
|
||||
@GetMapping("/listWithOrder")
|
||||
public TableDataInfo listWithOrder(ExecutionInMaterialDetailQueryDTO queryDTO)
|
||||
{
|
||||
QueryOrderOverStockDO queryDO = inMaterialDetailAssembler.toQueryDO(queryDTO);
|
||||
startPage();
|
||||
List<ExecutionInMaterialDetailWithOrderPO> list = inMaterialDetailApplicationService.queryInOrderDetailList(queryDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user