diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
index fef61c819..e1c252fe6 100644
--- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
+++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
@@ -201,5 +201,15 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
private String goodsMan;
@ApiModelProperty(name = "入库时间")
private Date incomingTime;
+ /**
+ * 仓库id
+ */
+ @ApiModelProperty(name = "当前所在仓库id", notes = "")
+ private Long nowWarehouseId;
+ /**
+ * 仓库名称
+ */
+ @ApiModelProperty(name = "当前所在仓库名称", notes = "")
+ private String nowWarehouseName;
}
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
index 836b1eb52..1ed2eec18 100644
--- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
@@ -2317,4 +2317,65 @@ public class CarsLoadController {
}
}
+
+ @ResponseBody
+ @PostMapping("/findSignOrderPageList")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "查询签收单分页列表", notes = "传入loadCarsDTO")
+ public R findSignOrderPageList(@RequestBody LoadCarsDTO loadCarsDTO) {
+ String method = "############findSignOrderPageList: ";
+ log.info(method + "请求参数{}", loadCarsDTO);
+ try{
+ //当前登录人选择的仓库
+ BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
+ if(Objects.isNull(myCurrentWarehouse)){
+ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
+ return R.fail(405,"仓库信息为空");
+ }
+ loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
+
+ return carsLoadService.findSignOrderPageList(loadCarsDTO);
+ }catch (CustomerException e){
+ log.error(e.message,e);
+ return R.fail(e.code,e.message);
+ }catch (Exception e){
+ log.error(method+"系统异常",e);
+ return R.fail(500,"系统异常");
+ }
+ }
+
+
+
+ @ResponseBody
+ @PostMapping("/findSignPhotoList")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "查询签收单图片列表", notes = "传入loadCarsDTO")
+ public R findSignPhotoList(@RequestBody LoadCarsDTO loadCarsDTO) {
+ String method = "############findSignPhotoList: ";
+ log.info(method + "请求参数{}", loadCarsDTO);
+ Long signOrderId = loadCarsDTO.getSignOrderId();
+ try{
+ //当前登录人选择的仓库
+ BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
+ if(Objects.isNull(myCurrentWarehouse)){
+ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
+ return R.fail(405,"仓库信息为空");
+ }
+ loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
+ if(Objects.isNull(signOrderId)){
+ log.warn(method+"签收单id为空 signOrderId={}",signOrderId);
+ return R.fail(405,"签收单id为空");
+ }
+
+ return carsLoadService.findSignPhotoList(loadCarsDTO);
+ }catch (CustomerException e){
+ log.error(e.message,e);
+ return R.fail(e.code,e.message);
+ }catch (Exception e){
+ log.error(method+"系统异常",e);
+ return R.fail(500,"系统异常");
+ }
+ }
+
+
}
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
index 1a44af87b..118ef57e5 100644
--- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
@@ -35,7 +35,8 @@
ltad.weight weight,
ltad.volume volume,
ltad.advance_id advanceId,
- ltad.incoming_warehouse_name incomingWarehouseName
+ ltad.incoming_warehouse_name incomingWarehouseName,
+ ltad.now_warehouse_name nowWarehouseName
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = ltad.order_package_code
@@ -220,7 +221,7 @@
select
ltad.waybill_id waybillId,
ltad.waybill_no waybillNo,
- t.warehouse nowWarehouseName,
+ ltad.now_warehouse_name nowWarehouseName,
ltad.train_number trainNumber,
ltad.package_status packageStatus,
lta.is_gcp isGcp,
@@ -250,40 +251,17 @@
lta.create_user_name createUserName,
lta.create_time createTime
from logpm_trunkline_advance_detail ltad
- left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
- left join (select ldpl.* from logpm_distribution_parcel_list ldpl
- join (
- select pl.order_package_code,
- max(pl.update_time) updateTime
- from logpm_distribution_parcel_list pl
- where 1=1
-
- and LOCATE(#{param.orderCode}, pl.order_code) > 0
-
-
- and pl.waybill_no = #{param.waybillNo}
-
-
- and pl.train_number = #{param.trainNumber}
-
-
- and pl.service_number = #{param.serviceNumber}
-
-
- and LOCATE(#{param.orderPackageCode},pl.order_package_code) > 0
-
- group by pl.order_package_code
- ) tmax on tmax.order_package_code = ldpl.order_package_code and ldpl.update_time = tmax.updateTime) t on t.order_package_code = ltad.order_package_code
- left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = t.order_package_code and lwtg.warehouse_id = t.warehouse_id
- left join logpm_warehouse_tray lwt on lwtg.tray_id = lwt.id
- left join (select ltcls.* from logpm_trunkline_cars_load_scan ltcls
- join (
- select cls.scan_code,
- max(cls.update_time) cupdateTime
- from logpm_trunkline_cars_load_scan cls
- group by cls.scan_code
- ) cmax on cmax.scan_code = ltcls.scan_code and cmax.cupdateTime = ltcls.update_time) m on m.scan_code = t.order_package_code
- left join logpm_distribution_loadscan ldl on ldl.order_package_code = t.order_package_code and ldl.scan_status != 1 and ldl.is_deleted = 0
+ left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
+ left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = ltad.order_package_code and lwtg.warehouse_id = ltad.now_warehouse_id
+ left join logpm_warehouse_tray lwt on lwtg.tray_id = lwt.id
+ left join (select ltcls.* from logpm_trunkline_cars_load_scan ltcls
+ join (
+ select cls.scan_code,
+ max(cls.update_time) cupdateTime
+ from logpm_trunkline_cars_load_scan cls
+ group by cls.scan_code
+ ) cmax on cmax.scan_code = ltcls.scan_code and cmax.cupdateTime = ltcls.update_time) m on m.scan_code = t.order_package_code
+ left join logpm_distribution_loadscan ldl on ldl.order_package_code = t.order_package_code and ldl.scan_status != 1 and ldl.is_deleted = 0
left join logpm_distribution_delivery_list lddl on lddl.id = ldl.delivery_id
where 1=1
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
index 439f3e60c..1ca8537e5 100644
--- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
@@ -398,6 +398,7 @@
left join logpm_warehouse_waybill lww on ltcls.waybill_no = lww.waybill_no
where ltcls.load_id = #{loadId}
and ltcls.warehouse_id = #{warehouseId}
+ and ltcls.warehouse_id != ltcls.unload_node_id
group by ltcls.order_code,
ltcls.waybill_no,
ltcls.type,
@@ -446,9 +447,9 @@
lww.consignee consignee,
lww.consignee_name consigneeName,
lww.consignee_mobile consigneeMobile,
- ltco.unload_num unloadNum,
- 0 planNum,
- sum(ltcls.num) smallTotal
+ IFNULL(ltco.plan_num,0) AS planNum,
+ sum(case when ltcls.scan_status != 1 then ltcls.num else 0 end) unloadNum,
+ sum( ltcls.num ) AS smallTota
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_order ltco on ltco.order_code = ltcls.order_code and ltco.waybill_no = ltcls.waybill_no and ltco.load_id = ltcls.load_id and ltco.node_id = ltcls.warehouse_id
left join logpm_distribution_stock_article ldsa on ldsa.order_code = ltcls.order_code and ldsa.warehouse_id = ltcls.from_warehouse_id
diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.java
index 13d89550e..eb1871b06 100644
--- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.java
+++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.java
@@ -24,4 +24,6 @@ public interface TrunklineLoadSignOrderMapper extends BaseMapper findSignOrderDetailList(IPage