Compare commits
173
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
624b7d7d6e | ||
|
|
0b61b813a5 | ||
|
|
6252866f7c | ||
|
|
15c8a2b6e6 | ||
|
|
4b434a2cd2 | ||
|
|
0376f8328c | ||
|
|
58e3882ef4 | ||
|
|
1d96322370 | ||
|
|
19857686aa | ||
|
|
d079e35374 | ||
|
|
466a9fa31f | ||
|
|
d74a28bceb | ||
|
|
1cc123917b | ||
|
|
39ebcb70ed | ||
|
|
e7e64252e7 | ||
|
|
a400a34b0c | ||
|
|
ac349ea8a8 | ||
|
|
7356208228 | ||
|
|
5963f6ed3a | ||
|
|
6f28cfdda0 | ||
|
|
5c472ad04e | ||
|
|
070cdcd5de | ||
|
|
061c5bc600 | ||
|
|
e5fea50466 | ||
|
|
6a87c5a75a | ||
|
|
63dcfaf028 | ||
|
|
c80e4b3ca3 | ||
|
|
3240e57c3e | ||
|
|
e35fa7d48e | ||
|
|
d5bdb5b419 | ||
|
|
fd1436da9c | ||
|
|
802a2994cc | ||
|
|
3d3036cebf | ||
|
|
123a5af241 | ||
|
|
da31a81415 | ||
|
|
84d4df0809 | ||
|
|
d17146dc4b | ||
|
|
44e9eb47bc | ||
|
|
bc9a4f7204 | ||
|
|
b37edf7c63 | ||
|
|
f6125e68bf | ||
|
|
d6037d5846 | ||
|
|
df51abe33f | ||
|
|
5cf46604fa | ||
|
|
208024a6cc | ||
|
|
1d01431354 | ||
|
|
cbaab0ffee | ||
|
|
a310c9dfa6 | ||
|
|
3866bfee05 | ||
|
|
5032cf2413 | ||
|
|
a10cfb0f55 | ||
|
|
59ede5ceb7 | ||
|
|
de4d4fa70d | ||
|
|
7e496834ae | ||
|
|
300b5ac239 | ||
|
|
9519d8610b | ||
|
|
064a87e751 | ||
|
|
9e2dc508a8 | ||
|
|
6a84abf6dd | ||
|
|
8b4e785de3 | ||
|
|
c95fdfc067 | ||
|
|
40a906a9fb | ||
|
|
d91aadca0b | ||
|
|
898cc32452 | ||
|
|
6cf2a8bc74 | ||
|
|
bce9969589 | ||
|
|
b73eb84b87 | ||
|
|
7d0d24ea77 | ||
|
|
dd5280ab78 | ||
|
|
bc6b2ba777 | ||
|
|
f58691615b | ||
|
|
15fdace0bc | ||
|
|
0904b78846 | ||
|
|
734b51bfec | ||
|
|
784d04ebec | ||
|
|
b29632cebc | ||
|
|
3211cfe892 | ||
|
|
32e8be5363 | ||
|
|
207734c75e | ||
|
|
8eb280f2b9 | ||
|
|
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.
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.33.0.99:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE, url = "http://10.33.0.99:8017",fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||
public interface OmsServiceFeign {
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
* @description: TODO
|
||||
* @date 2024/5/10 8:58
|
||||
**/
|
||||
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.33.0.109:8016", fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||
@FeignClient(contextId = "remoteWmsServiceFeign",value = ServiceNameConstants.WMS_SERVICE, url = "http://10.33.0.109:8016",fallbackFactory = RemoteWmsFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||
public interface WmsServiceFeign {
|
||||
|
||||
/**
|
||||
@@ -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);
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import com.mhd.system.api.feign.FeignAutoConfiguration;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,fallbackFactory = RemoteBmsFeignFallbackFactory.class,url = "http://10.33.0.99:8018", configuration = FeignAutoConfiguration.class)
|
||||
@FeignClient(contextId = "YmsService", value = ServiceNameConstants.YMS_SERVICE,url = "http://10.33.0.99:8018",fallbackFactory = RemoteBmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
|
||||
public interface YmsServiceFeign {
|
||||
|
||||
/**
|
||||
|
||||
+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;
|
||||
}
|
||||
+6
@@ -244,4 +244,10 @@ public class MaterialBaseInfoFeign extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(name = "组织(多个用,分开)")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
}
|
||||
+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;
|
||||
}
|
||||
@@ -50,8 +50,8 @@ public class StockOutOrder extends BaseVOEntity {
|
||||
@Excel(name = "出库单号")
|
||||
private String outOrderNumber;
|
||||
|
||||
@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-已复核")
|
||||
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接")
|
||||
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核 13-已交接")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
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,不影响写死字段写入快照
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BiPlatformRealDataService {
|
||||
|
||||
@Resource
|
||||
private BiPlatformRealDataMapper biPlatformRealDataMapper;
|
||||
|
||||
public List<RealPlatformVehiclePO> queryVehicles() {
|
||||
try {
|
||||
return biPlatformRealDataMapper.queryVehicles();
|
||||
} catch (Exception e) {
|
||||
log.error("【YMS】查询作业车辆列表失败: {}", e.getMessage(), 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) {
|
||||
log.error("【YMS】查询月台概览失败: {}", e.getMessage(), 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) {
|
||||
log.error("【YMS】统计今日作业任务失败: {}", e.getMessage(), 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) {
|
||||
log.error("【YMS】统计车辆状态失败: {}", e.getMessage(), 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) {
|
||||
log.error("【YMS】统计本月任务量失败: {}", e.getMessage(), e);
|
||||
return 0L;
|
||||
}
|
||||
}
|
||||
|
||||
public List<RealTaskLoadPO> queryTaskLoadToday() {
|
||||
try {
|
||||
return biPlatformRealDataMapper.queryTaskLoadToday();
|
||||
} catch (Exception e) {
|
||||
log.error("【YMS】统计任务负荷失败: {}", e.getMessage(), 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(translateFlowStatus(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();
|
||||
double rate = total > 0 ? Math.round(((double) occ / total) * 100.0 * 100.0) / 100.0 : 0d;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* FLOW_STATUS 数字转中文:1已预约 2已签到 3已叫号 4已过号 5已进场 6已称重 7已装车 8二次称重 9已结算 10已还卡 11已出场 12已取消
|
||||
*/
|
||||
private static String translateFlowStatus(String flowStatus) {
|
||||
if (flowStatus == null) return null;
|
||||
switch (flowStatus.trim()) {
|
||||
case "1": return "已预约";
|
||||
case "2": return "已签到";
|
||||
case "3": return "已叫号";
|
||||
case "4": return "已过号";
|
||||
case "5": return "已进场";
|
||||
case "6": return "已称重";
|
||||
case "7": return "已装车";
|
||||
case "8": return "二次称重";
|
||||
case "9": return "已结算";
|
||||
case "10": return "已还卡";
|
||||
case "11": return "已出场";
|
||||
case "12": return "已取消";
|
||||
default: return flowStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -85,7 +85,7 @@ public final class BiReportSnapshotMapperSupport {
|
||||
.entryOvertimeRate(0).overtimeCount(0).platformOnTimeRate(0)
|
||||
.avgPlatformDuration(0d).yardOnTimeRate(0).avgYardDuration(0d).build())
|
||||
.platformOverview(PlatformOverviewVO.builder()
|
||||
.totalPlatforms(0).currentOccupancyRate(0).operatingPlatforms(0).todayTasks(0).build())
|
||||
.totalPlatforms(0).currentOccupancyRate(0d).operatingPlatforms(0).todayTasks(0).build())
|
||||
.vehicleStatus(VehicleStatusVO.builder()
|
||||
.todayReservedVehicles(0).notCheckedIn(0).operatingVehicles(0).completedVehicles(0).build())
|
||||
.avgOperationDurationTrend(Collections.emptyList())
|
||||
|
||||
+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();
|
||||
double rate = total > 0 ? Math.round(((double) occ / total) * 100.0 * 100.0) / 100.0 : 0d;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ public final class BiSnapshotWeeklyRandomDataBuilder {
|
||||
|
||||
PlatformOverviewVO overview = PlatformOverviewVO.builder()
|
||||
.totalPlatforms(Math.max(1, jitterInt(Baseline.P_TOT_PL, r)))
|
||||
.currentOccupancyRate(jitterPercentInt(Baseline.P_OCC, r))
|
||||
.currentOccupancyRate((double) jitterPercentInt(Baseline.P_OCC, r))
|
||||
.operatingPlatforms(Math.max(0, jitterInt(Baseline.P_OP, r)))
|
||||
.todayTasks(Math.max(0, jitterInt(Baseline.P_TASKS, r)))
|
||||
.build();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
//园区物流大屏接口----------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ public class PlatformOverviewVO {
|
||||
private Integer totalPlatforms;
|
||||
|
||||
@ApiModelProperty("当前占用率,单位:%")
|
||||
private Integer currentOccupancyRate;
|
||||
private Double currentOccupancyRate;
|
||||
|
||||
@ApiModelProperty("当前作业中,单位:个")
|
||||
private Integer operatingPlatforms;
|
||||
|
||||
@@ -19,14 +19,14 @@ spring:
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
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
|
||||
#线上正式环境
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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.CAR_NO
|
||||
status <- qms_main_business.FLOW_STATUS
|
||||
platformId <- qms_main_business.WINDOW_NAME(叫号月台,主业务表直接有)
|
||||
platformDuration <- qms_main_business.EXIT_TIME - ENTRY_TIME(分钟)
|
||||
appointmentTime <- qms_main_business.CREATE_TIME
|
||||
workFloor <- qms_window_info.PLATFORM_FLOOR(按 WINDOW_NAME 关联)
|
||||
-->
|
||||
<select id="queryVehicles" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformVehiclePO">
|
||||
SELECT
|
||||
mb.CAR_NO AS plateNumber,
|
||||
mb.FLOW_STATUS AS status,
|
||||
mb.WINDOW_NAME AS platformId,
|
||||
CASE
|
||||
WHEN mb.EXIT_TIME IS NOT NULL AND mb.ENTRY_TIME IS NOT NULL
|
||||
THEN CAST((mb.EXIT_TIME - mb.ENTRY_TIME) * 24 * 60 AS BIGINT)
|
||||
ELSE 0
|
||||
END AS platformDuration,
|
||||
TO_CHAR(mb.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') AS appointmentTime,
|
||||
wi.PLATFORM_FLOOR AS workFloor
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS mb
|
||||
LEFT JOIN NGWL_TEST_YMS.QMS_WINDOW_INFO wi
|
||||
ON wi.WINDOW_NAME = mb.WINDOW_NAME
|
||||
ORDER BY mb.CREATE_TIME DESC
|
||||
</select>
|
||||
|
||||
<!-- 月台概览:totalPlatforms(总条数)、operatingPlatforms(作业状态=占用,JOB_STATUS: 0空闲 1占用) -->
|
||||
<select id="queryPlatformOverview" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealPlatformOverviewPO">
|
||||
SELECT
|
||||
COUNT(1) AS totalPlatforms,
|
||||
SUM(CASE WHEN JOB_STATUS = 1 THEN 1 ELSE 0 END) AS operatingPlatforms
|
||||
FROM NGWL_TEST_YMS.QMS_WINDOW_INFO
|
||||
</select>
|
||||
|
||||
<!-- 今日作业任务:实际进入时间是今日的 -->
|
||||
<select id="countTodayTasks" resultType="java.lang.Long">
|
||||
SELECT COUNT(1)
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
WHERE ENTRY_TIME IS NOT NULL
|
||||
AND TRUNC(ENTRY_TIME) = TRUNC(SYSDATE)
|
||||
</select>
|
||||
|
||||
<!-- 车辆状态统计:今日的统计(按创建时间 / 流程状态)
|
||||
FLOW_STATUS: 1已预约 2已签到 3已叫号 4已过号 5已进场 6已称重 7已装车 8二次称重 9已结算 10已还卡 11已出场 12已取消 -->
|
||||
<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 FLOW_STATUS = '1' AND TRUNC(CREATE_TIME) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) AS notCheckedIn,
|
||||
SUM(CASE WHEN FLOW_STATUS IN ('5','6','7','8','9','10') AND TRUNC(CREATE_TIME) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) AS operatingVehicles,
|
||||
SUM(CASE WHEN FLOW_STATUS = '11' AND TRUNC(CREATE_TIME) = TRUNC(SYSDATE) THEN 1 ELSE 0 END) AS completedVehicles
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
</select>
|
||||
|
||||
<!-- 本月任务量:实际进入时间是本月的 -->
|
||||
<select id="countMonthTasks" resultType="java.lang.Long">
|
||||
SELECT COUNT(1)
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
WHERE ENTRY_TIME IS NOT NULL
|
||||
AND TO_CHAR(ENTRY_TIME, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM')
|
||||
</select>
|
||||
|
||||
<!-- 任务负荷(今日 24 小时时段):按 EXTRACT(HOUR FROM ENTRY_TIME) 统计 -->
|
||||
<select id="queryTaskLoadToday" resultType="com.mhd.bi.domain.biPlatformRealData.repository.po.RealTaskLoadPO">
|
||||
SELECT
|
||||
EXTRACT(HOUR FROM ENTRY_TIME) AS hourOfDay,
|
||||
COUNT(1) AS taskCount
|
||||
FROM NGWL_TEST_YMS.QMS_MAIN_BUSINESS
|
||||
WHERE ENTRY_TIME IS NOT NULL
|
||||
AND TRUNC(ENTRY_TIME) = TRUNC(SYSDATE)
|
||||
GROUP BY EXTRACT(HOUR FROM ENTRY_TIME)
|
||||
ORDER BY EXTRACT(HOUR FROM ENTRY_TIME)
|
||||
</select>
|
||||
</mapper>
|
||||
+2
@@ -33,4 +33,6 @@ public class WarehousePO implements Serializable {
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
@Excel(name = "是否启用: 1-否 2-是")
|
||||
private Integer isEnable;
|
||||
}
|
||||
|
||||
+127
-2
@@ -40,6 +40,14 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.mhd.basic.interfaces.dto.shipperLeaseDetailsApi.WarehouseLeaseExportVO;
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -270,14 +278,15 @@ public class LeaseApplicationService {
|
||||
* 货主租赁明细
|
||||
* 定时任务:每天凌晨1点执行,计算前一天的货主租赁明细
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 1 * * ?")
|
||||
@Scheduled(cron = "0 0 1 * * ?")
|
||||
public void shipperLeaseDetails() {
|
||||
log.info("开始执行货主租赁明细定时任务");
|
||||
// 计算前一天的日期,将时间设置为当天的0点0分0秒,只保留日期部分
|
||||
final Date yesterday = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -1));
|
||||
|
||||
LeaseDO leaseDO = new LeaseDO();
|
||||
leaseDO.setTime(yesterday);
|
||||
leaseDO.setTime(yesterday); // 设置查询时间
|
||||
leaseDO.setStatus(1); // 只查询启用状态的租赁,停用的不参与出租率计算
|
||||
//查询有效期内的租赁
|
||||
List<LeasePO> leasePOS = queryList(leaseDO);
|
||||
List<LeasePO> entireUnit = leasePOS.stream()
|
||||
@@ -494,6 +503,103 @@ public class LeaseApplicationService {
|
||||
return warehouseOccupancyRatesList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出仓库出租率及客户租赁明细(单 sheet,明细行带仓库当日汇总列)
|
||||
* 参数与 /warehouseOccupancyRate、/list 一致
|
||||
*/
|
||||
public void exportOccupancyRate(HttpServletResponse response, ShipperLeaseDetailsDO shipperLeaseDetailsDO) throws IOException {
|
||||
// 注意:本方法不调用 warehouseOccupancyRate(),因为该方法在不传 warehouseId 时
|
||||
// totalArea 会算成全系统所有仓库库区面积之和(如 6168),导致导出面积/日租率错误。
|
||||
// 这里自行按 (业务日期 + 仓库) 维度计算,保证多仓库导出时每个仓库的面积/日租率正确。
|
||||
|
||||
// ===== 1. 查全部明细(用副本 DO,避免影响外部)=====
|
||||
ShipperLeaseDetailsDO detailDO = new ShipperLeaseDetailsDO();
|
||||
BeanUtils.copyProperties(shipperLeaseDetailsDO, detailDO);
|
||||
List<ShipperLeaseDetailsPO> detailList = shipperLeaseDetailsService.queryList(detailDO);
|
||||
if (detailList == null) {
|
||||
detailList = new ArrayList<>();
|
||||
}
|
||||
|
||||
// ===== 2. 预算每个仓库的总面积(启用库区的 storageRegion 累加),建 warehouseId -> totalArea 映射 =====
|
||||
Set<Long> warehouseIds = detailList.stream()
|
||||
.map(ShipperLeaseDetailsPO::getWarehouseId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
Map<Long, BigDecimal> warehouseTotalAreaMap = new HashMap<>();
|
||||
for (Long wid : warehouseIds) {
|
||||
StorageSectionDO storageSectionDO = new StorageSectionDO();
|
||||
storageSectionDO.setWarehouseId(wid);
|
||||
storageSectionDO.setOpeningUp(1);
|
||||
List<StorageSectionPO> sections = storageSectionApplicationService.queryList(storageSectionDO);
|
||||
BigDecimal area = BigDecimal.ZERO;
|
||||
for (StorageSectionPO s : sections) {
|
||||
area = area.add(s.getStorageRegion() == null ? BigDecimal.ZERO : s.getStorageRegion());
|
||||
}
|
||||
warehouseTotalAreaMap.put(wid, area);
|
||||
}
|
||||
|
||||
// ===== 3. 按 (业务日期 + 仓库ID) 聚合,算每个仓库当天的整租/散租面积 =====
|
||||
// summaryMap: key -> [整租面积, 散租面积]
|
||||
SimpleDateFormat keySdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Map<String, BigDecimal[]> summaryMap = new HashMap<>();
|
||||
for (ShipperLeaseDetailsPO d : detailList) {
|
||||
String key = (d.getBusinessDate() == null ? "" : keySdf.format(d.getBusinessDate()))
|
||||
+ "_" + d.getWarehouseId();
|
||||
BigDecimal[] arr = summaryMap.computeIfAbsent(key, k -> new BigDecimal[]{BigDecimal.ZERO, BigDecimal.ZERO});
|
||||
BigDecimal leaseArea = d.getLeaseArea() == null ? BigDecimal.ZERO : d.getLeaseArea();
|
||||
if ("整租".equals(d.getLeaseType())) {
|
||||
arr[0] = arr[0].add(leaseArea);
|
||||
} else {
|
||||
arr[1] = arr[1].add(leaseArea);
|
||||
}
|
||||
}
|
||||
|
||||
// ===== 4. 明细为主,每行拼上对应仓库当天的汇总(总面积/日租率按仓库单独算)=====
|
||||
List<WarehouseLeaseExportVO> exportList = new ArrayList<>();
|
||||
for (ShipperLeaseDetailsPO d : detailList) {
|
||||
WarehouseLeaseExportVO vo = new WarehouseLeaseExportVO();
|
||||
// 明细列
|
||||
vo.setBusinessDate(d.getBusinessDate());
|
||||
vo.setOrganizationName(d.getOrganizationName());
|
||||
vo.setWarehouseName(d.getWarehouseName());
|
||||
vo.setCargoOwnerName(d.getCargoOwnerName());
|
||||
vo.setLeaseType(d.getLeaseType());
|
||||
vo.setLeaseArea(d.getLeaseArea());
|
||||
// 汇总列
|
||||
String key = (d.getBusinessDate() == null ? "" : keySdf.format(d.getBusinessDate()))
|
||||
+ "_" + d.getWarehouseId();
|
||||
BigDecimal[] arr = summaryMap.get(key);
|
||||
BigDecimal entireLeaseArea = (arr != null) ? arr[0] : BigDecimal.ZERO;
|
||||
BigDecimal fractionalLeaseArea = (arr != null) ? arr[1] : BigDecimal.ZERO;
|
||||
vo.setEntireLeaseArea(entireLeaseArea);
|
||||
vo.setFractionalLeaseArea(fractionalLeaseArea);
|
||||
// 该仓库的总面积(按仓库单独算,不再用全局总和)
|
||||
BigDecimal widTotalArea = warehouseTotalAreaMap.getOrDefault(d.getWarehouseId(), BigDecimal.ZERO);
|
||||
vo.setTotalArea(widTotalArea);
|
||||
// 日租率 = (整租+散租) / 总面积 × 100,保留2位小数(直接输出百分比值,如 10.00)
|
||||
BigDecimal leaseSum = entireLeaseArea.add(fractionalLeaseArea);
|
||||
BigDecimal dailyRate = widTotalArea.compareTo(BigDecimal.ZERO) == 0
|
||||
? BigDecimal.ZERO
|
||||
: leaseSum.multiply(new BigDecimal("100")).divide(widTotalArea, 2, BigDecimal.ROUND_HALF_UP);
|
||||
vo.setDailyRentalRate(dailyRate);
|
||||
exportList.add(vo);
|
||||
}
|
||||
|
||||
// ===== 5. 按业务日期降序、仓库名升序排序(null 排最后)=====
|
||||
exportList.sort(Comparator
|
||||
.comparing(WarehouseLeaseExportVO::getBusinessDate, Comparator.nullsLast(Comparator.reverseOrder()))
|
||||
.thenComparing(WarehouseLeaseExportVO::getWarehouseName, Comparator.nullsLast(Comparator.naturalOrder())));
|
||||
|
||||
// ===== 6. 用 ExcelUtil 导出(项目通用做法,单 sheet)=====
|
||||
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<WarehouseLeaseExportVO> util = new ExcelUtil<>(WarehouseLeaseExportVO.class);
|
||||
util.exportExcel(response, exportList, "仓库出租率");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定时任务整租推送到bms
|
||||
@@ -581,6 +687,25 @@ public class LeaseApplicationService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/停用租赁
|
||||
* @param leaseIds 租赁ID列表
|
||||
* @param status 目标状态:1=启用,0=停用
|
||||
*/
|
||||
public Boolean updateStatus(List<Long> leaseIds, Integer status) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
Long updateBy = loginUser != null ? loginUser.getUserid() : null;
|
||||
String updateByName = loginUser != null ? loginUser.getUsername() : null;
|
||||
if (leaseIds == null || leaseIds.isEmpty()) {
|
||||
throw new ServiceException("租赁ID不能为空");
|
||||
}
|
||||
if (status == null || (status != 0 && status != 1)) {
|
||||
throw new ServiceException("状态值无效:1=启用,0=停用");
|
||||
}
|
||||
log.info("启用/停用租赁--结束,leaseIds={},状态={},更新人id={},更新人名称={}",leaseIds,status==0?"停用":"启用",updateBy,updateByName);
|
||||
return leaseDomainService.updateStatus(leaseIds, status, updateBy, updateByName);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @description 设置数据字典键值
|
||||
// * @author ZhouGY
|
||||
|
||||
+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;
|
||||
}
|
||||
}
|
||||
+35
-5
@@ -30,11 +30,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -580,6 +576,40 @@ public class ExpenseAccountApplicationService {
|
||||
return expenseAccountDomainService.getInfoByCode2(subjectCode,topOrganizationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编码和组织ID查询
|
||||
*/
|
||||
public ExpenseAccountPO getInfoByOrgAndCode(String subjectCode, Long organizationId) {
|
||||
if(!StringUtils.isNotEmpty(subjectCode)){
|
||||
throw new ServiceException("费用科目编码不能为空");
|
||||
}
|
||||
if(organizationId == null){
|
||||
throw new ServiceException("组织ID不能为空");
|
||||
}
|
||||
ExpenseAccountPO expenseAccountPO = expenseAccountDomainService.getInfoByOrgAndCode(subjectCode, organizationId);
|
||||
// // 组装计费单位列表:单位-单位英文
|
||||
// List<String> unit = new ArrayList<>();
|
||||
// if (expenseAccountPO != null) {
|
||||
// unit.add(expenseAccountPO.getBillingUnit() + "-" + expenseAccountPO.getBillingUnitEn());
|
||||
// unit.add(expenseAccountPO.getBillingUnit2() + "-" + expenseAccountPO.getBillingUnitEn2());
|
||||
// expenseAccountPO.setUnit(unit);
|
||||
// }
|
||||
// 组装计费单位列表(数组)
|
||||
List<Map<String, String>> unit = new ArrayList<>();
|
||||
if (expenseAccountPO != null) {
|
||||
Map<String, String> unit1 = new HashMap<>();
|
||||
unit1.put("unit", expenseAccountPO.getBillingUnit() + "-" + expenseAccountPO.getBillingUnitEn());
|
||||
unit.add(unit1);
|
||||
|
||||
Map<String, String> unit2 = new HashMap<>();
|
||||
unit2.put("unit", expenseAccountPO.getBillingUnit2() + "-" + expenseAccountPO.getBillingUnitEn2());
|
||||
unit.add(unit2);
|
||||
|
||||
expenseAccountPO.setUnit(unit);
|
||||
}
|
||||
return expenseAccountPO;
|
||||
}
|
||||
|
||||
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
|
||||
setDataPermissionForSearch(searchExpenseAccountDO);
|
||||
return expenseAccountDomainService.selectExpenseAccount(searchExpenseAccountDO);
|
||||
|
||||
+13
-10
@@ -157,15 +157,18 @@ public class MaterialBaseInfoApplicationService {
|
||||
* @param materialBaseInfoDO
|
||||
*/
|
||||
private void shipperParam(MaterialBaseInfoDO materialBaseInfoDO){
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(materialBaseInfoDO.getShipperId());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取货主信息失败");
|
||||
}
|
||||
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
// 如果原始shipperName不为空,保留原始值(导入或手动输入时应该保留完整名称)
|
||||
// 只有在原始shipperName为空时,才使用查询到的userName
|
||||
if (materialBaseInfoDO.getShipperName() == null || materialBaseInfoDO.getShipperName().trim().isEmpty()) {
|
||||
materialBaseInfoDO.setShipperName(userPo.getUserName());
|
||||
Long shipperId = materialBaseInfoDO.getShipperId();
|
||||
if (shipperId != null && shipperId != 0l) {
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(materialBaseInfoDO.getShipperId());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取货主信息失败");
|
||||
}
|
||||
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
// 如果原始shipperName不为空,保留原始值(导入或手动输入时应该保留完整名称)
|
||||
// 只有在原始shipperName为空时,才使用查询到的userName
|
||||
if (materialBaseInfoDO.getShipperName() == null || materialBaseInfoDO.getShipperName().trim().isEmpty()) {
|
||||
materialBaseInfoDO.setShipperName(userPo.getUserName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,4 +185,4 @@ public class MaterialBaseInfoApplicationService {
|
||||
//return materialBaseInfoDomainService.getMaterialStockList(shipperName,materialName,machineCode,topOrganizationId,pageNum,pageSize);/**/
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -58,6 +58,11 @@ public interface IExpenseAccountService extends IService<ExpenseAccount>
|
||||
*/
|
||||
ExpenseAccountPO getInfoByCode(ExpenseAccountDO expenseAccountDO);
|
||||
|
||||
/**
|
||||
* 根据费用科目code和组织ID查询费用信息
|
||||
*/
|
||||
ExpenseAccountPO getInfoByOrgAndCode(ExpenseAccountDO expenseAccountDO);
|
||||
|
||||
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO);
|
||||
|
||||
public List<QueryExpenseAccountPO> selectOtherExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO);
|
||||
|
||||
+5
@@ -39,6 +39,11 @@ public interface ExpenseAccountMapper extends BaseMapper<ExpenseAccount>
|
||||
*/
|
||||
ExpenseAccountPO getInfoByCode(@Param("expenseAccountDO") ExpenseAccountDO expenseAccountDO);
|
||||
|
||||
/**
|
||||
* 根据费用科目code和组织ID查询费用信息
|
||||
*/
|
||||
ExpenseAccountPO getInfoByOrgAndCode(@Param("expenseAccountDO") ExpenseAccountDO expenseAccountDO);
|
||||
|
||||
public List<QueryExpenseAccountPO> selectExpenseAccount(@Param("searchExpenseAccountDO") SearchExpenseAccountDO searchExpenseAccountDO);
|
||||
|
||||
public List<QueryExpenseAccountPO> selectOtherExpenseAccount(@Param("searchExpenseAccountDO") SearchExpenseAccountDO searchExpenseAccountDO);
|
||||
|
||||
+5
@@ -129,6 +129,11 @@ public class ExpenseAccountImpl extends ServiceImpl<ExpenseAccountMapper, Expens
|
||||
return expenseAccountMapper.getInfoByCode(expenseAccountDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExpenseAccountPO getInfoByOrgAndCode(ExpenseAccountDO expenseAccountDO) {
|
||||
return expenseAccountMapper.getInfoByOrgAndCode(expenseAccountDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统科目查询
|
||||
* 社会车辆:service_items_code='SHCL',upper_subject_code='shcl_clyf',society_status=1
|
||||
|
||||
+5
@@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
@@ -159,4 +160,8 @@ public class ExpenseAccountPO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("nc科目编码")
|
||||
private String ncSubjectCode;
|
||||
|
||||
@ApiModelProperty("计费单位列表(单位-单位英文)")
|
||||
private List<Map<String, String>> unit;
|
||||
|
||||
}
|
||||
+10
@@ -101,6 +101,16 @@ public class ExpenseAccountDomainService {
|
||||
expenseAccountDO.setTopOrganizationId(topOrganizationId);
|
||||
return expenseAccountService.getInfoByCode(expenseAccountDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据编码和组织ID查询费用科目信息
|
||||
*/
|
||||
public ExpenseAccountPO getInfoByOrgAndCode(String subjectCode, Long organizationId) {
|
||||
ExpenseAccountDO expenseAccountDO = new ExpenseAccountDO();
|
||||
expenseAccountDO.setSubjectCode(subjectCode);
|
||||
expenseAccountDO.setOrganizationId(organizationId);
|
||||
return expenseAccountService.getInfoByOrgAndCode(expenseAccountDO);
|
||||
}
|
||||
public List<QueryExpenseAccountPO> selectExpenseAccount(SearchExpenseAccountDO searchExpenseAccountDO){
|
||||
return expenseAccountService.selectExpenseAccount(searchExpenseAccountDO);
|
||||
}
|
||||
|
||||
@@ -96,4 +96,7 @@ public class Lease extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("业务员ID")
|
||||
private String salesmanId;
|
||||
|
||||
@ApiModelProperty("状态:1=正常,0=停用")
|
||||
private Integer status;
|
||||
}
|
||||
+3
@@ -97,4 +97,7 @@ public class LeasePO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("业务员ID")
|
||||
private String salesmanId;
|
||||
|
||||
@ApiModelProperty("状态:1=正常,0=停用")
|
||||
private Integer status;
|
||||
}
|
||||
+3
@@ -113,4 +113,7 @@ public class LeaseDO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("业务员ID")
|
||||
private String salesmanId;
|
||||
|
||||
@ApiModelProperty("状态:1=正常,0=停用")
|
||||
private Integer status;
|
||||
}
|
||||
+18
@@ -89,4 +89,22 @@ public class LeaseDomainService {
|
||||
.in(Lease::getId, leaseIds)
|
||||
.eq(Lease::getDelFlag, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/停用租赁
|
||||
* @param leaseIds 租赁ID列表
|
||||
* @param status 目标状态:1=启用,0=停用
|
||||
* @param updateBy 操作人ID
|
||||
* @param updateByName 操作人名称
|
||||
*/
|
||||
public Boolean updateStatus(List<Long> leaseIds, Integer status, Long updateBy, String updateByName) {
|
||||
return leaseService.update(new UpdateWrapper<Lease>().lambda()
|
||||
.set(Lease::getStatus, status)
|
||||
.set(Lease::getUpdateBy, updateBy)
|
||||
.set(Lease::getUpdateByName, updateByName)
|
||||
.set(Lease::getUpdateTime, new Date())
|
||||
.in(Lease::getId, leaseIds)
|
||||
.eq(Lease::getDelFlag, 1));
|
||||
}
|
||||
|
||||
}
|
||||
+9
@@ -1,5 +1,6 @@
|
||||
package com.mhd.basic.domain.materialBaseInfo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@@ -44,14 +45,17 @@ public class MaterialBaseInfo extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
@Excel(name = "货主id")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
@Excel(name = "物料编码")
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@@ -404,4 +408,9 @@ public class MaterialBaseInfo extends BaseVOEntity{
|
||||
@ApiModelProperty(name = "收费标准")
|
||||
private BigDecimal chargeStandard;
|
||||
|
||||
@ApiModelProperty(name = "组织(多个用,分开)")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
}
|
||||
+6
@@ -393,4 +393,10 @@ public class MaterialBaseInfoPO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "收费标准")
|
||||
private BigDecimal chargeStandard;
|
||||
|
||||
@ApiModelProperty(name = "组织(多个用,分开)")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
}
|
||||
+6
@@ -399,4 +399,10 @@ public class MaterialBaseInfoDO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(name = "收费标准")
|
||||
private BigDecimal chargeStandard;
|
||||
|
||||
@ApiModelProperty(name = "组织(多个用,分开)")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
}
|
||||
+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;
|
||||
}
|
||||
+2
@@ -168,9 +168,11 @@ public class WarehouseDomainService {
|
||||
warehouseLinkagePO.setName(warehousePO.getWarehouseName());
|
||||
StorageSectionDO storageSectionDO = new StorageSectionDO();
|
||||
storageSectionDO.setWarehouseId(warehousePO.getWarehouseId());
|
||||
storageSectionDO.setNullify(1);
|
||||
List<StorageSectionPO> storageSectionPOList = storageSectionService.queryList(storageSectionDO);
|
||||
StorageLocationDO storageLocationDO = new StorageLocationDO();
|
||||
storageLocationDO.setWarehouseId(warehousePO.getWarehouseId());
|
||||
storageLocationDO.setNullify(1);
|
||||
List<StorageLocationPO> storageLocationPOList = storageLocationService.queryList(storageLocationDO);
|
||||
//根据库区唯一标识进行分组
|
||||
Map<String, List<StorageLocationPO>> storageLocationListMap = storageLocationPOList.stream().collect(Collectors.groupingBy(StorageLocationPO::getStorageCode));
|
||||
|
||||
+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;
|
||||
}
|
||||
@@ -110,4 +110,7 @@ public class LeaseDTO extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty("业务员ID")
|
||||
private String salesmanId;
|
||||
|
||||
@ApiModelProperty("状态:1=正常,0=停用")
|
||||
private Integer status;
|
||||
}
|
||||
+6
@@ -379,4 +379,10 @@ public class MaterialBaseInfoDTO extends BaseVOEntity{
|
||||
@ApiModelProperty(name = "收费标准")
|
||||
private BigDecimal chargeStandard;
|
||||
|
||||
@ApiModelProperty(name = "组织(多个用,分开)")
|
||||
private String orgId;
|
||||
|
||||
@ApiModelProperty(name = "是否正常物料: 0-是 1-否")
|
||||
private Integer isNormalMaterial;
|
||||
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.mhd.basic.interfaces.dto.shipperLeaseDetailsApi;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 仓库出租率及客户租赁明细 导出VO(单 sheet)
|
||||
* 明细为主行,附该仓库当日汇总列
|
||||
*/
|
||||
@Data
|
||||
public class WarehouseLeaseExportVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("仓库")
|
||||
@Excel(name = "仓库")
|
||||
private String warehouseName;
|
||||
|
||||
@ApiModelProperty("业务日期")
|
||||
@Excel(name = "业务日期", width = 20, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date businessDate;
|
||||
|
||||
@ApiModelProperty("整租面积(m²)")
|
||||
@Excel(name = "整租面积(m²)")
|
||||
private BigDecimal entireLeaseArea;
|
||||
|
||||
@ApiModelProperty("散租面积(m²)")
|
||||
@Excel(name = "散租面积(m²)")
|
||||
private BigDecimal fractionalLeaseArea;
|
||||
|
||||
@ApiModelProperty("总面积(m²)")
|
||||
@Excel(name = "总面积(m²)")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@ApiModelProperty("日租率(%)")
|
||||
@Excel(name = "日租率(%)")
|
||||
private BigDecimal dailyRentalRate;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String cargoOwnerName;
|
||||
|
||||
@ApiModelProperty("租赁方式")
|
||||
@Excel(name = "租赁方式")
|
||||
private String leaseType;
|
||||
|
||||
@ApiModelProperty("租赁面积(m²)")
|
||||
@Excel(name = "租赁面积(m²)")
|
||||
private BigDecimal leaseArea;
|
||||
|
||||
// ===== 以下为仓库当日汇总列(同一仓库同一天的多行会重复,属正常)=====
|
||||
|
||||
}
|
||||
+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, "合同导出");
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -328,5 +328,13 @@ public class ExpenseAccountApi extends BaseController{
|
||||
return AjaxResult.success(expenseAccountPO);
|
||||
}
|
||||
|
||||
@ApiOperation("根据code和组织ID获取数据")
|
||||
@GetMapping(value = "/getInfoByOrgAndCode")
|
||||
public AjaxResult getInfoByOrgAndCode(@RequestParam("subjectCode") String subjectCode,@RequestParam("organizationId") Long organizationId)
|
||||
{
|
||||
ExpenseAccountPO expenseAccountPO = expenseAccountApplicationService.getInfoByOrgAndCode(subjectCode, organizationId);
|
||||
return AjaxResult.success(expenseAccountPO.getUnit());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+14
@@ -130,4 +130,18 @@ public class LeaseApi extends BaseController{
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用/停用租赁
|
||||
* @param leaseIds 租赁ID集合
|
||||
* @param status 目标状态(启用/停用)
|
||||
* @return 操作结果
|
||||
*/
|
||||
@ApiOperation("启用/停用租赁")
|
||||
@PutMapping("/updateStatus/{leaseIds}/{status}")
|
||||
public AjaxResult updateStatus(@PathVariable("leaseIds") List<Long> leaseIds,
|
||||
@PathVariable("status") Integer status)
|
||||
{
|
||||
return toAjax(leaseApplicationService.updateStatus(leaseIds, status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+14
@@ -20,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -157,5 +159,17 @@ public class ShipperLeaseDetailsApi extends BaseController{
|
||||
return getDataTable(warehouseOccupancyRates);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出仓库出租率及客户租赁明细
|
||||
* 参数与 /warehouseOccupancyRate、/list 一致
|
||||
*/
|
||||
@ApiOperation("导出仓库出租率及客户租赁明细")
|
||||
@GetMapping(value = "/export", produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
public void export(ShipperLeaseDetailsDTO shipperLeaseDetailsDTO, HttpServletResponse response) throws IOException
|
||||
{
|
||||
ShipperLeaseDetailsDO shipperLeaseDetailsDO = shipperLeaseDetailsAssembler.toDO(shipperLeaseDetailsDTO);
|
||||
leaseApplicationService.exportOccupancyRate(response, shipperLeaseDetailsDO);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,18 +14,16 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
# server-addr: 10.33.0.129:6010
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
server-addr: 10.102.192.30:6848
|
||||
server-addr: 10.33.0.129:6010
|
||||
# server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
# 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.102.192.30:6848
|
||||
server-addr: 10.33.0.129:6010
|
||||
# server-addr: 10.102.192.30:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
|
||||
@@ -151,6 +151,22 @@
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getInfoByOrgAndCode" resultType="com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO" parameterType="com.mhd.basic.domain.expenseAccount.repository.todo.ExpenseAccountDO">
|
||||
SELECT
|
||||
a.* ,
|
||||
b.tax_rate,
|
||||
b.service_items_name,
|
||||
b.service_items_code
|
||||
FROM
|
||||
expense_account a
|
||||
LEFT JOIN service_items_manage b ON a.service_items_manage_id = b.service_items_manage_id
|
||||
WHERE
|
||||
a.del_flag = 1
|
||||
AND a.organization_id = #{expenseAccountDO.organizationId}
|
||||
AND a.subject_code = #{expenseAccountDO.subjectCode}
|
||||
AND a.status = 1
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<sql id="common_where_two">
|
||||
<!-- 数据权限:南光组织(organizationId=2827)查全部,其他组织查自己 -->
|
||||
|
||||
@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateByName" column="update_by_name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -68,7 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.bill_time,
|
||||
a.salesman_name,
|
||||
a.settlement_currency,
|
||||
a.salesman_id
|
||||
a.salesman_id,
|
||||
a.status
|
||||
from lease a
|
||||
LEFT JOIN warehouse w ON a.warehouse_id = w.warehouse_id AND w.del_flag = 1
|
||||
</sql>
|
||||
@@ -136,6 +138,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND a.start_date <= #{time}
|
||||
AND a.end_date >= #{time}
|
||||
</if>
|
||||
<!-- 停用状态过滤:status 不为空时按状态过滤 -->
|
||||
<if test="status != null">
|
||||
AND a.status = #{status}
|
||||
</if>
|
||||
<!-- 删除标记 -->
|
||||
<choose>
|
||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||
|
||||
+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>
|
||||
|
||||
|
||||
+60
-36
@@ -161,11 +161,22 @@ public class UserShipperApplicationService {
|
||||
|
||||
// 先保存前端传递的 organizationId(如果存在)
|
||||
Long frontendOrganizationId = userShipperDO.getOrganizationId();
|
||||
|
||||
|
||||
// 获取当前登录用户的组织信息
|
||||
Long loginUserOrganizationId = userPo.getOrganizationId();
|
||||
Long topOrganizationId = userPo.getTopOrganizationId();
|
||||
|
||||
|
||||
// 如果前端传了 orgCode(组织ID),直接按 org_code 过滤查询委托方,不覆盖组织条件
|
||||
// orgCode 匹配 user_shipper.org_code JSON 数组中的 code 字段,用于精确查询委托方
|
||||
if (StringUtils.isNotBlank(userShipperDO.getOrgCode())) {
|
||||
// 清空 organizationId / topOrganizationId,避免被数据权限覆盖逻辑拦截 orgCode 已授权的委托方
|
||||
userShipperDO.setOrganizationId(null);
|
||||
userShipperDO.setTopOrganizationId(null);
|
||||
log.info("托运人列表查询 - 按 orgCode 查询:orgCode={}", userShipperDO.getOrgCode());
|
||||
List<UserShipperPo> userShipperList = userShipperDomainService.userShipperList(userShipperDO);
|
||||
return processShipperList(userShipperList);
|
||||
}
|
||||
|
||||
// 数据权限:根据 organizationId 来设置查询权限
|
||||
// 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己
|
||||
if (loginUserOrganizationId != null && loginUserOrganizationId.equals(2827L)) {
|
||||
@@ -184,32 +195,13 @@ public class UserShipperApplicationService {
|
||||
log.info("托运人列表查询 - 南光组织查询所有组织:不设置组织过滤条件");
|
||||
}
|
||||
} else {
|
||||
// 其他组织:设置 organizationId,只查询当前组织的数据
|
||||
// 其他组织只能查询自己组织的数据,不能查询其他组织的数据
|
||||
if (frontendOrganizationId != null) {
|
||||
// 前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (!frontendOrganizationId.equals(loginUserOrganizationId)) {
|
||||
// 前端传递了其他组织的 organizationId,强制使用当前登录用户的组织ID,防止越权查询
|
||||
log.warn("托运人列表查询 - 前端传递的组织ID {} 与当前登录用户的组织ID {} 不一致,使用当前登录用户的组织ID进行过滤",
|
||||
frontendOrganizationId, loginUserOrganizationId);
|
||||
userShipperDO.setOrganizationId(loginUserOrganizationId);
|
||||
if (frontendOrganizationId.equals(2827L)){
|
||||
userShipperDO.setOrganizationId(null);
|
||||
}
|
||||
} else {
|
||||
// 前端传递的 organizationId 与当前登录用户的组织ID一致,使用前端传递的值
|
||||
userShipperDO.setOrganizationId(frontendOrganizationId);
|
||||
}
|
||||
if (topOrganizationId != null) {
|
||||
userShipperDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
} else {
|
||||
// 前端没有传递 organizationId,使用当前登录用户的组织ID
|
||||
userShipperDO.setOrganizationId(loginUserOrganizationId);
|
||||
if (topOrganizationId != null) {
|
||||
userShipperDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
}
|
||||
// 其他组织:设置 organizationId 为当前登录组织ID。
|
||||
// 查询条件为:a.organization_id = 本组织 OR b.org_code LIKE 本组织ID
|
||||
// 即委托方初始绑定本组织、或 org_code 中包含本组织(被授权给本组织)时,均可查到。
|
||||
// 不设置 topOrganizationId,避免跨顶级组织授权(org_code 已包含本组织)被顶级组织条件拦截。
|
||||
userShipperDO.setOrganizationId(loginUserOrganizationId);
|
||||
userShipperDO.setTopOrganizationId(null);
|
||||
log.info("托运人列表查询 - 其他组织按本组织及 org_code 查询:organizationId={}", loginUserOrganizationId);
|
||||
}
|
||||
|
||||
log.info("托运人列表查询 - 设置组织ID后,查询参数:organizationId={}, topOrganizationId={}, userId={}",
|
||||
@@ -413,10 +405,15 @@ public class UserShipperApplicationService {
|
||||
shipperDO.setShipperEnterpriseName(companyName);
|
||||
// NC客户编码使用模板中的独立字段,不再复用登录账号
|
||||
shipperDO.setCustomerNcCode(ncCustomerCode);
|
||||
// 联系人 -> user表 user_name + user_shipper表 user_name_shipper
|
||||
shipperDO.setUserName(contactName);
|
||||
// 公司名称 -> user表 user_name + user_shipper表 user_name_shipper
|
||||
shipperDO.setUserName(companyName);
|
||||
shipperDO.setUserNameShipper(contactName);
|
||||
// 联系电话 -> user表 user_phone
|
||||
// 登录账号 -> user表 user_member_code
|
||||
shipperDO.setUserMemberCode(userAccount);
|
||||
// 联系人 -> user表 emergency_contact_name
|
||||
shipperDO.setEmergencyContactName(contactName);
|
||||
// 联系电话 -> user表 emergency_contact_phone
|
||||
shipperDO.setEmergencyContactPhone(contactPhone);
|
||||
shipperDO.setUserPhone(contactPhone);
|
||||
// 地址 -> user表 user_area_name,详细地址 -> user表 user_area_address
|
||||
shipperDO.setUserAreaName(address);
|
||||
@@ -461,16 +458,30 @@ public class UserShipperApplicationService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入时若账号没有任何角色,则补分配企业货主角色
|
||||
* 导入委托方时,确保账号仅绑定企业货主(company)角色。
|
||||
* 注意:authShipper 会把“当前登录管理员的所有角色”都分配给导入用户,
|
||||
* 因此这里必须保证用户最终只绑定 company 角色——若现有角色不是“唯一的 company 角色”,
|
||||
* 一律删除后重新分配,避免残留 ownerCargo 等多条错误角色。
|
||||
*/
|
||||
private void assignCompanyRoleIfMissing(Long userId, Long organizationId) {
|
||||
if (userId == null || organizationId == null) {
|
||||
return;
|
||||
}
|
||||
// 查询用户现有角色
|
||||
List<UserRoleMenuPO> existingRoles = userRoleDomainService.selectRolesByUserId(userId);
|
||||
if (CollUtil.isNotEmpty(existingRoles)) {
|
||||
// 只有恰好绑定了唯一的 company 角色时,才认为正确,无需处理
|
||||
boolean onlyCompany = !CollUtil.isEmpty(existingRoles)
|
||||
&& existingRoles.size() == 1
|
||||
&& RoleEnum.COMPANY.getCode().equals(existingRoles.get(0).getRoleCode());
|
||||
if (onlyCompany) {
|
||||
return;
|
||||
}
|
||||
// 否则:删除所有现有角色(ownerCargo、或多个角色),重新分配 company
|
||||
if (CollUtil.isNotEmpty(existingRoles)) {
|
||||
log.info("导入委托方 - 用户{}角色不正确,删除原角色后重新分配company,原角色: {}",
|
||||
userId, existingRoles.stream().map(UserRoleMenuPO::getRoleCode).collect(Collectors.toList()));
|
||||
userRoleDomainService.deleteByUserId(userId);
|
||||
}
|
||||
// 按 role_code + organization_id 精确匹配角色(selectByOrganizationIdAndRoleCode 的 common_where 不含 roleCode 过滤,不适用)
|
||||
RolePO rolePO = roleDomainService.selectByRoleCodeAndOrganizationId(RoleEnum.COMPANY.getCode(), organizationId);
|
||||
if (rolePO == null) {
|
||||
@@ -547,8 +558,15 @@ public class UserShipperApplicationService {
|
||||
userDO.setUserId(userId);
|
||||
if (StringUtils.isNotBlank(userAccount)) {
|
||||
userDO.setUserAccount(userAccount);
|
||||
// 登录账号 -> user表 user_member_code
|
||||
userDO.setUserMemberCode(userAccount);
|
||||
}
|
||||
userDO.setUserName(contactName);
|
||||
// 公司名称 -> user表 user_name
|
||||
userDO.setUserName(companyName);
|
||||
// 联系人 -> user表 emergency_contact_name
|
||||
userDO.setEmergencyContactName(contactName);
|
||||
// 联系电话 -> user表 emergency_contact_phone
|
||||
userDO.setEmergencyContactPhone(contactPhone);
|
||||
userDO.setUserPhone(contactPhone);
|
||||
userDO.setUserAreaName(address);
|
||||
userDO.setUserAreaAddress(detailedAddress);
|
||||
@@ -564,8 +582,8 @@ public class UserShipperApplicationService {
|
||||
userDO.setUserSalt(salt);
|
||||
}
|
||||
userDomainService.updateUser(userDO);
|
||||
// 如果该账号没有任何角色,补分配企业货主角色,避免登录报“账号未授权角色信息”
|
||||
assignCompanyRoleIfMissing(userId, existingShipper.getOrganizationId());
|
||||
// 如果该账号没有企业货主(company)角色,补分配当前导入组织下的 company 角色,避免登录报“账号未授权角色信息”
|
||||
assignCompanyRoleIfMissing(userId, currentOrgId);
|
||||
}
|
||||
|
||||
// 3. 更新 orgCode 中当前组织的 ncCustomer
|
||||
@@ -1306,6 +1324,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 回调参数
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class UserShipperDomainService {
|
||||
}
|
||||
}
|
||||
|
||||
// @DataPermissions(cacheName = "master")
|
||||
// @DataPermissions(cacheName = "master")
|
||||
public List<UserShipperPo> userShipperList(UserShipperDO userShipperDO) {
|
||||
// 数据权限逻辑已在 UserShipperApplicationService.userShipperList 中处理
|
||||
// 这里不再重复处理数据权限,直接使用传入的参数进行查询
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -781,11 +781,11 @@
|
||||
/*组织ID - 数据隔离:南光组织(organizationId=2827)查询全部,其他组织查询自己组织的数据*/
|
||||
<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}, '%')
|
||||
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>
|
||||
|
||||
@@ -378,13 +378,23 @@
|
||||
and b.parent_shipper_id = #{parentShipperId}
|
||||
</if>
|
||||
/*用户组织ID*/
|
||||
<if test="organizationId !=null">
|
||||
/*用户组织ID*/
|
||||
<if test="organizationId !=null or (orgCode != null and orgCode != '')">
|
||||
AND (
|
||||
<if test="organizationId !=null">
|
||||
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>
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
<if test="organizationId !=null"> OR </if>
|
||||
b.org_code LIKE concat('%code:', #{orgCode}, '%')
|
||||
OR b.org_code LIKE concat('%code: ', #{orgCode}, '%')
|
||||
OR b.org_code LIKE concat('%"code":', #{orgCode}, '%')
|
||||
OR b.org_code LIKE concat('%"code":"', #{orgCode}, '"%')
|
||||
</if>
|
||||
)
|
||||
</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;
|
||||
|
||||
@@ -88,4 +88,10 @@ public class BillDetail extends BaseVOEntity{
|
||||
private String invoiceItemName;
|
||||
@ApiModelProperty(value = "费用类别")
|
||||
private String feeType;
|
||||
@ApiModelProperty(value = "计费单位")
|
||||
private String billingUnit;
|
||||
@ApiModelProperty(value = "计费数量")
|
||||
private BigDecimal billingNum;
|
||||
@ApiModelProperty(value = "计费单价")
|
||||
private BigDecimal billingUnitPrice;
|
||||
}
|
||||
+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);
|
||||
|
||||
@@ -134,5 +134,11 @@ public class BillDetailPO extends BaseVOEntity{
|
||||
private String invoiceItemName;
|
||||
@ApiModelProperty(value = "费用类别")
|
||||
private String feeType;
|
||||
@ApiModelProperty(value = "计费单位")
|
||||
private String billingUnit;
|
||||
@ApiModelProperty(value = "计费数量")
|
||||
private BigDecimal billingNum;
|
||||
@ApiModelProperty(value = "计费单价")
|
||||
private BigDecimal billingUnitPrice;
|
||||
|
||||
}
|
||||
@@ -262,4 +262,9 @@ public class BillManagePO extends BaseVOEntity{
|
||||
@ApiModelProperty("收款帐户名称")
|
||||
private String paymentAccountName;
|
||||
private List<BillDetail> billDetailList;
|
||||
|
||||
@ApiModelProperty("最近收款时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@Excel(name = "最近收款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date collectionTime;
|
||||
}
|
||||
@@ -98,4 +98,10 @@ public class BillDetailDO extends BaseVOEntity{
|
||||
private String invoiceItemName;
|
||||
@ApiModelProperty(value = "费用类别")
|
||||
private String feeType;
|
||||
@ApiModelProperty(value = "计费单位")
|
||||
private String billingUnit;
|
||||
@ApiModelProperty(value = "计费数量")
|
||||
private BigDecimal billingNum;
|
||||
@ApiModelProperty(value = "计费单价")
|
||||
private BigDecimal billingUnitPrice;
|
||||
}
|
||||
+3
@@ -180,6 +180,9 @@ public class ReceiptManageDomainService {
|
||||
receiptManageDO.setCreateBy(loginUser.getUserPo().getUserId());
|
||||
receiptManageDO.setCreateByName(loginUser.getUserPo().getUserName());
|
||||
receiptManageDO.setCreateTime(new Date());
|
||||
if (receiptManageDO.getCollectionTime() == null) {
|
||||
receiptManageDO.setCollectionTime(new Date());
|
||||
}
|
||||
ReceiptManage receiptManage = new ReceiptManage();
|
||||
BeanUtils.copyProperties(receiptManageDO,receiptManage);
|
||||
Boolean flagTwo = receiptManageService.save(receiptManage);
|
||||
|
||||
@@ -139,4 +139,10 @@ public class BillDetailDTO extends BaseVOEntity{
|
||||
private String invoiceItemName;
|
||||
@ApiModelProperty(value = "费用类别")
|
||||
private String feeType;
|
||||
@ApiModelProperty(value = "计费单位")
|
||||
private String billingUnit;
|
||||
@ApiModelProperty(value = "计费数量")
|
||||
private BigDecimal billingNum;
|
||||
@ApiModelProperty(value = "计费单价")
|
||||
private BigDecimal billingUnitPrice;
|
||||
}
|
||||
@@ -18,15 +18,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,如果使用默认分组可以不配置
|
||||
|
||||
@@ -8,7 +8,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.bms.domain.billManage.repository.todo.BillManageDO" resultType="com.mhd.bms.domain.billManage.repository.po.BillManagePO">
|
||||
select
|
||||
a.*,b.SETTLEMENT_ENTITY_ID as settlementEntityId
|
||||
a.*,
|
||||
b.SETTLEMENT_ENTITY_ID as settlementEntityId,
|
||||
(SELECT MAX(c.collection_time)
|
||||
FROM receipt_detail rd
|
||||
LEFT JOIN receipt_manage c ON rd.receipt_manage_id = c.receipt_manage_id
|
||||
WHERE rd.bill_manage_id = a.bill_manage_id
|
||||
AND rd.del_flag = 1
|
||||
AND c.del_flag = 1) AS collectionTime
|
||||
from bill_manage a LEFT JOIN SETTLEMENT_CUSTOMERS b on a.SETTLEMENT_CUSTOMERS_ID = b.SETTLEMENT_CUSTOMERS_ID
|
||||
where a.del_flag = 1
|
||||
<include refid="common_where"/>
|
||||
|
||||
@@ -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>
|
||||
|
||||
+8
@@ -147,6 +147,14 @@ public class BusinessDocumentOrderApplicationService {
|
||||
{
|
||||
return businessDocumentOrderDomainService.audit(businessAuditDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务单反审核
|
||||
*/
|
||||
public Boolean cancelAudit(BusinessAuditDTO businessAuditDTO)
|
||||
{
|
||||
return businessDocumentOrderDomainService.cancelAudit(businessAuditDTO);
|
||||
}
|
||||
public boolean execute(List<Long> ids) {
|
||||
return businessDocumentOrderDomainService.execute(ids);
|
||||
}
|
||||
|
||||
+5
@@ -49,6 +49,11 @@ public interface IBusinessDocumentOrderService extends IService<BusinessDocument
|
||||
|
||||
public Boolean audit( List<Long> ids, Long reviewStatus, String SalesManager,String reviewOpinion);
|
||||
|
||||
/**
|
||||
* 业务单反审核(将已审核订单恢复到待审核)
|
||||
*/
|
||||
public Boolean cancelAudit(List<Long> ids);
|
||||
|
||||
String selectByMakerCodeNc(String salesmanCodeNc);
|
||||
|
||||
String selectByMakerCodeNc1(String salesmanCodeNc);
|
||||
|
||||
+6
@@ -37,4 +37,10 @@ public interface BusinessDocumentOrderMapper extends BaseMapper<BusinessDocument
|
||||
TmsTransportNote getTmsTransportNote(@Param("tmsOrderId") String tmsOrderId);
|
||||
|
||||
String getPushVerifyByOrgId(@Param("organizationId") Long organizationId);
|
||||
|
||||
/**
|
||||
* 统计指定日期前缀(yyMMdd)下已生成的新格式业务单号数量
|
||||
* 仅统计新格式(长度<=12),过滤历史16位旧数据,保证序号每日从001正确累计
|
||||
*/
|
||||
int countByGoodsNumberPrefix(@Param("prefix") String prefix);
|
||||
}
|
||||
|
||||
+89
-46
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
@@ -19,6 +20,7 @@ import com.mhd.oms.domain.businessDocumentOrder.repository.facade.IBusinessDocum
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.po.BusinessDocumentOrderPO;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.todo.BusinessDocumentOrderDO;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.service.GoodsNumberGenerator;
|
||||
import com.mhd.oms.domain.executeOrder.entity.ExecuteOrder;
|
||||
import com.mhd.oms.domain.executeOrder.repository.mapper.ExecuteOrderMapper;
|
||||
import com.mhd.oms.domain.executeOrder.repository.todo.ExecuteOrderDO;
|
||||
@@ -88,6 +90,9 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
@Autowired
|
||||
private WlhyServiceFeign wlhyServiceFeign;
|
||||
|
||||
@Autowired
|
||||
private GoodsNumberGenerator goodsNumberGenerator;
|
||||
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
@@ -173,28 +178,6 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String getOrderCodeByDate(Date date){
|
||||
return new StringBuffer()
|
||||
.append(getSecondPartByDate(date))
|
||||
.append(getThreePart())
|
||||
.toString();
|
||||
}
|
||||
private static String getSecondPartByDate(Date date) {
|
||||
if (date == null) {
|
||||
date = new Date();
|
||||
}
|
||||
String temp_current_time = DateUtil.format(date, datePattern());
|
||||
return temp_current_time.substring(2, temp_current_time.length());
|
||||
}
|
||||
private static String datePattern() {
|
||||
return "yyyyMMddHHmmss";
|
||||
}
|
||||
private static String getThreePart() {
|
||||
return RandomUtil.randomNumbers(4);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean audit(List<Long> ids, Long reviewStatus, String SalesManager,String reviewOpinion ) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();//获取登录人
|
||||
@@ -225,7 +208,6 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
BeanUtils.copyProperties(businessDocumentOrder, subOrder);
|
||||
|
||||
subOrder.setId(null);
|
||||
subOrder.setGoodsNumber(OrderSequence.getOrderCode()); // 生成新的子单号
|
||||
|
||||
// 设置子单的拼单类型和主单关系
|
||||
subOrder.setSplicingOrderType(3L); // 合单-子单
|
||||
@@ -255,31 +237,10 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
subOrder.setRecipientName(user.getUserName());
|
||||
|
||||
|
||||
String orderCode = null;
|
||||
int maxRetryCount = 100;
|
||||
int retryCount = 0;
|
||||
|
||||
while (retryCount < maxRetryCount) {
|
||||
orderCode = getOrderCodeByDate(subOrder.getDocumentDate());
|
||||
retryCount++;
|
||||
|
||||
List<BusinessDocumentOrder> checkOrderCodes = businessDocumentOrderMapper.selectList(
|
||||
new QueryWrapper<BusinessDocumentOrder>().eq("goods_number", orderCode)
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(checkOrderCodes)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (retryCount >= maxRetryCount) {
|
||||
throw new com.aliyun.oss.ServiceException("生成唯一订单编号失败,已达到最大重试次数:" + maxRetryCount);
|
||||
}
|
||||
}
|
||||
|
||||
//生成货源单号
|
||||
//生成子单货源单号(yyMMdd + 当日顺序号)
|
||||
String orderCode = goodsNumberGenerator.generateUniqueGoodsNumber(subOrder.getDocumentDate());
|
||||
subOrder.setGoodsNumber(orderCode);
|
||||
|
||||
|
||||
businessDocumentOrderMapper.insert(subOrder);
|
||||
subOrderCount++; // 增加子单计数
|
||||
|
||||
@@ -338,6 +299,88 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean cancelAudit(List<Long> ids) { // 取消审核 后端暂时未加鉴权
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
throw new ServiceException("未选择反审核的业务单");
|
||||
}
|
||||
for (Long id : ids) {
|
||||
BusinessDocumentOrder order = businessDocumentOrderMapper.selectById(id);
|
||||
if (ObjectUtil.isNull(order)) {
|
||||
throw new ServiceException("未查询到业务单信息");
|
||||
}
|
||||
// 校验1:子单(splicingOrderType=3)不允许单独反审核,需对主单操作
|
||||
if (order.getSplicingOrderType() != null && order.getSplicingOrderType() == 3L) {
|
||||
throw new ServiceException("业务单【" + order.getGoodsNumber() + "】为子单,请对主单进行反审核");
|
||||
}
|
||||
// 校验2:仅"审核通过(reviewStatus=1)"可反审核
|
||||
if (order.getReviewStatus() == null || order.getReviewStatus() != 1L) {
|
||||
throw new ServiceException("业务单【" + order.getGoodsNumber() + "】非已审核状态,无法反审核");
|
||||
}
|
||||
// 校验3:已生成执行单的不允许反审核,需先取消执行
|
||||
ExecuteOrder existExec = executeOrderMapper.selectOne(new LambdaQueryWrapper<ExecuteOrder>()
|
||||
.eq(ExecuteOrder::getBusinessDocumentId, id)
|
||||
.eq(ExecuteOrder::getDelFlag, 1).last("LIMIT 1"));
|
||||
if (ObjectUtil.isNotNull(existExec)) {
|
||||
throw new ServiceException("业务单【" + order.getGoodsNumber() + "】已生成执行单,无法进行反审核");
|
||||
}
|
||||
|
||||
boolean isMain = order.getSplicingOrderType() != null && order.getSplicingOrderType() == 4L;
|
||||
// 拆单主单(isMain):清理审核时生成的子单、子单地址、以及回填到配送明细的 subOrderId
|
||||
if (isMain) {
|
||||
List<BusinessDocumentOrder> subOrders = businessDocumentOrderMapper.selectList(
|
||||
new LambdaQueryWrapper<BusinessDocumentOrder>()
|
||||
.eq(BusinessDocumentOrder::getMainOrderId, String.valueOf(id))
|
||||
.eq(BusinessDocumentOrder::getDelFlag, 1));
|
||||
if (subOrders != null && !subOrders.isEmpty()) {
|
||||
List<String> subIdStrs = new ArrayList<>();
|
||||
for (BusinessDocumentOrder sub : subOrders) {
|
||||
// 校验4:子单若已生成执行单,主单不可反审核
|
||||
ExecuteOrder subExec = executeOrderMapper.selectOne(new LambdaQueryWrapper<ExecuteOrder>()
|
||||
.eq(ExecuteOrder::getBusinessDocumentId, sub.getId())
|
||||
.eq(ExecuteOrder::getDelFlag, 1).last("LIMIT 1"));
|
||||
if (ObjectUtil.isNotNull(subExec)) {
|
||||
throw new ServiceException("子单【" + sub.getGoodsNumber() + "】已生成执行单,无法反审核主单");
|
||||
}
|
||||
subIdStrs.add(String.valueOf(sub.getId()));
|
||||
// 逻辑删除子单(与 delete() 方法一致:delFlag 2)
|
||||
sub.setDelFlag(2);
|
||||
businessDocumentOrderMapper.updateById(sub);
|
||||
}
|
||||
// 逻辑删除子单的地址(审核时按 orderId=子单id 生成)
|
||||
businessDocumentAddressMultiMapper.update(null,
|
||||
new LambdaUpdateWrapper<BusinessDocumentAddressMulti>()
|
||||
.in(BusinessDocumentAddressMulti::getOrderId, subIdStrs)
|
||||
.set(BusinessDocumentAddressMulti::getDelFlag, 2));
|
||||
// 清空审核时回填到 business_delivery_details_link.sub_order_id 的子单id
|
||||
businessDeliveryDetailsLinkMapper.update(null,
|
||||
new LambdaUpdateWrapper<BusinessDeliveryDetailsLink>()
|
||||
.eq(BusinessDeliveryDetailsLink::getOrderId, id)
|
||||
.isNotNull(BusinessDeliveryDetailsLink::getSubOrderId)
|
||||
.set(BusinessDeliveryDetailsLink::getSubOrderId, null));
|
||||
}
|
||||
}
|
||||
|
||||
// 状态复位 + 清空审核信息(用 UpdateWrapper.set 确保 null 能写入;updateById 默认不更新 null)
|
||||
LambdaUpdateWrapper<BusinessDocumentOrder> updateWrapper = new LambdaUpdateWrapper<BusinessDocumentOrder>()
|
||||
.eq(BusinessDocumentOrder::getId, id)
|
||||
.set(BusinessDocumentOrder::getReviewStatus, 0L) // 未审核
|
||||
.set(BusinessDocumentOrder::getOrderStatus, 0L) // 待审核
|
||||
.set(BusinessDocumentOrder::getExecuteStatus, 0L) // 无状态
|
||||
.set(BusinessDocumentOrder::getReviewId, null)
|
||||
.set(BusinessDocumentOrder::getReview, null)
|
||||
.set(BusinessDocumentOrder::getReviewTime, null)
|
||||
.set(BusinessDocumentOrder::getReviewOpinion, null)
|
||||
.set(BusinessDocumentOrder::getSalesManager, null);
|
||||
if (isMain) {
|
||||
updateWrapper.set(BusinessDocumentOrder::getDeliveryProgress, null); // 清空主单拆单数
|
||||
}
|
||||
businessDocumentOrderMapper.update(null, updateWrapper);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean execute(List<Long> ids) {
|
||||
|
||||
+18
-66
@@ -102,6 +102,9 @@ public class BusinessDocumentOrderDomainService {
|
||||
@Autowired
|
||||
private UserServiceFeign userServiceFeign;
|
||||
|
||||
@Autowired
|
||||
private GoodsNumberGenerator goodsNumberGenerator;
|
||||
|
||||
/**
|
||||
* 分页查询【请填写功能名称】列表
|
||||
*/
|
||||
@@ -109,26 +112,6 @@ public class BusinessDocumentOrderDomainService {
|
||||
return businessDocumentOrderService.queryList(businessDocumentOrderDO);
|
||||
}
|
||||
|
||||
public static String getOrderCodeByDate(Date date){
|
||||
return new StringBuffer()
|
||||
.append(getSecondPartByDate(date))
|
||||
.append(getThreePart())
|
||||
.toString();
|
||||
}
|
||||
private static String getSecondPartByDate(Date date) {
|
||||
if (date == null) {
|
||||
date = new Date();
|
||||
}
|
||||
String temp_current_time = DateUtil.format(date, datePattern());
|
||||
return temp_current_time.substring(2, temp_current_time.length());
|
||||
}
|
||||
private static String datePattern() {
|
||||
return "yyyyMMddHHmmss";
|
||||
}
|
||||
private static String getThreePart() {
|
||||
return RandomUtil.randomNumbers(4);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@@ -302,30 +285,8 @@ public class BusinessDocumentOrderDomainService {
|
||||
}
|
||||
}
|
||||
|
||||
//生成货源单号
|
||||
|
||||
String orderCode = null;
|
||||
int maxRetryCount = 100;
|
||||
int retryCount = 0;
|
||||
|
||||
while (retryCount < maxRetryCount) {
|
||||
orderCode = getOrderCodeByDate(tmsOrder.getDocumentDate());
|
||||
retryCount++;
|
||||
|
||||
List<BusinessDocumentOrder> checkOrderCodes = businessDocumentOrderMapper.selectList(
|
||||
new QueryWrapper<BusinessDocumentOrder>().eq("goods_number", orderCode)
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(checkOrderCodes)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (retryCount >= maxRetryCount) {
|
||||
throw new ServiceException("生成唯一订单编号失败,已达到最大重试次数:" + maxRetryCount);
|
||||
}
|
||||
}
|
||||
|
||||
//生成货源单号
|
||||
//生成货源单号(yyMMdd + 当日顺序号,每日重置)
|
||||
String orderCode = goodsNumberGenerator.generateUniqueGoodsNumber(tmsOrder.getDocumentDate());
|
||||
tmsOrder.setGoodsNumber(orderCode);
|
||||
|
||||
ReservationStockOutOrder reservationStockOutOrder = reservationStockOutOrderMapper.selectOne(new LambdaQueryWrapper<ReservationStockOutOrder>()
|
||||
@@ -513,6 +474,8 @@ public class BusinessDocumentOrderDomainService {
|
||||
tmsOrderAccount.setOrderId(String.valueOf(tmsOrder.getId()));
|
||||
tmsOrderAccount.setCreateBy(String.valueOf(u.getUserid()));
|
||||
tmsOrderAccount.setCreateTime(new Date());
|
||||
// 复制新增时科目行会带原订单的id,避免报错
|
||||
tmsOrderAccount.setId(null);
|
||||
// 设置组织信息
|
||||
if (businessDocumentOrderDO.getOrganizationId() != null) {
|
||||
tmsOrderAccount.setOrganizationId(businessDocumentOrderDO.getOrganizationId());
|
||||
@@ -774,28 +737,8 @@ public class BusinessDocumentOrderDomainService {
|
||||
// boolean istrue=businessDocumentOrderService.update(businessDocumentOrderDO);
|
||||
|
||||
|
||||
String orderCode = null;
|
||||
int maxRetryCount = 100;
|
||||
int retryCount = 0;
|
||||
|
||||
while (retryCount < maxRetryCount) {
|
||||
orderCode = getOrderCodeByDate(tmsOrder.getDocumentDate());
|
||||
retryCount++;
|
||||
|
||||
List<BusinessDocumentOrder> checkOrderCodes = businessDocumentOrderMapper.selectList(
|
||||
new QueryWrapper<BusinessDocumentOrder>().eq("goods_number", orderCode)
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(checkOrderCodes)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (retryCount >= maxRetryCount) {
|
||||
throw new ServiceException("生成唯一订单编号失败,已达到最大重试次数:" + maxRetryCount);
|
||||
}
|
||||
}
|
||||
|
||||
//生成货源单号
|
||||
//生成货源单号(yyMMdd + 当日顺序号,每日重置) 原更新操作会将 电脑更细为当日的日期。默认和之前的逻辑一样保持不变
|
||||
String orderCode = goodsNumberGenerator.generateUniqueGoodsNumber(tmsOrder.getDocumentDate());
|
||||
tmsOrder.setGoodsNumber(orderCode);
|
||||
|
||||
ReservationStockOutOrder reservationStockOutOrder = reservationStockOutOrderMapper.selectOne(new LambdaQueryWrapper<ReservationStockOutOrder>()
|
||||
@@ -989,6 +932,15 @@ public class BusinessDocumentOrderDomainService {
|
||||
|
||||
return businessDocumentOrderService.audit(businessAuditDTO.getIds(),businessAuditDTO.getReviewStatus(),businessAuditDTO.getSalesManager(),businessAuditDTO.getReviewOpinion());
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务单反审核
|
||||
*/
|
||||
public Boolean cancelAudit(BusinessAuditDTO businessAuditDTO)
|
||||
{
|
||||
return businessDocumentOrderService.cancelAudit(businessAuditDTO.getIds());
|
||||
}
|
||||
|
||||
public Boolean execute(List<Long> ids) {
|
||||
return businessDocumentOrderService.execute(ids);
|
||||
}
|
||||
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.mhd.oms.domain.businessDocumentOrder.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
|
||||
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 业务单据订单(goodsNumber)单号生成器
|
||||
* 规则: yyMMdd(取自单据日期) + 当日顺序号(每日重置, 3位起步, 超999自动扩位)
|
||||
* 示例: 260804001、260804999、2608041000
|
||||
*/
|
||||
@Component
|
||||
public class GoodsNumberGenerator {
|
||||
|
||||
private static final int MAX_RETRY = 100;
|
||||
|
||||
@Autowired
|
||||
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
|
||||
|
||||
/**
|
||||
* 生成唯一业务单号
|
||||
* @param documentDate 单据日期(为空取当前日期)
|
||||
*/
|
||||
public String generateUniqueGoodsNumber(Date documentDate) {
|
||||
Date date = (documentDate == null) ? new Date() : documentDate;
|
||||
String datePart = DateUtil.format(date, "yyMMdd");
|
||||
|
||||
// count 只查一次作为序号基线
|
||||
long seq = (long) businessDocumentOrderMapper.countByGoodsNumberPrefix(datePart) + 1;
|
||||
int retryCount = 0;
|
||||
while (retryCount < MAX_RETRY) {
|
||||
String orderCode = datePart + String.format("%03d", seq);
|
||||
retryCount++;
|
||||
|
||||
List<BusinessDocumentOrder> exist = businessDocumentOrderMapper.selectList(
|
||||
new QueryWrapper<BusinessDocumentOrder>().eq("goods_number", orderCode)
|
||||
);
|
||||
if (CollectionUtils.isEmpty(exist)) {
|
||||
return orderCode;
|
||||
}
|
||||
seq++; // ← 关键:查重失败,序号往后递增找空位,而不是重新count
|
||||
}
|
||||
throw new ServiceException("生成唯一业务单号失败,已达到最大重试次数:" + MAX_RETRY);
|
||||
}
|
||||
}
|
||||
+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);
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user