Browse Source

1.干线-bug修复

master
zhenghaoyu 12 months ago
parent
commit
8d25ef8d7c
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  2. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  3. 43
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OrderDetailInfoVO.java
  4. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  6. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  7. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  8. 38
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java
  9. 41
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderDetailsDTO.java
  10. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  11. 122
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  12. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  13. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  14. 28
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  15. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -142,7 +142,7 @@ public interface IDistributionParcelListClient {
List<DistributionParcelListEntity> findByWaybillNumber(@RequestParam String waybillNumber);
@GetMapping(API_PREFIX+"/findEntityListByOrderCodeAndStatus")
List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(@RequestParam String orderCode, @RequestParam Long warehouseId, @RequestParam String packageStatus);
List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(@RequestParam String orderCode, @RequestParam Long warehouseId, @RequestParam String packageStatus,@RequestParam String waybillNo);
@GetMapping(API_PREFIX+"/getListByOrderPackageCode")
List<DistributionParcelListEntity> getListByOrderPackageCode(@RequestParam String orderPackageCode);

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java

@ -130,4 +130,5 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
private String carNumber;
@ApiModelProperty(name = "货主")
private String goodsMan;
}

43
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OrderDetailInfoVO.java

@ -0,0 +1,43 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class OrderDetailInfoVO implements Serializable {
private Long waybillId;
private String waybillNo;
private String nowWarehouseName;
private String trainNumber;
private String packageStatus;
private Integer isGcp;
private String firstPackName;
private String secondPackName;
private String thirdPackName;
private String materialCode;
private String materialName;
private String orderPackageCode;
private String brand;
private String serviceNumber;
private Integer quantity;
private String trayCode;
private String trayName;
private BigDecimal weight;
private BigDecimal volume;
private String sendDateStr;
private String trunklineCarsNo;
private String scanStatus;
private Date trunklineLoadingTime;
private Date trunklineSignTime;
private String deliveryTrainNumber;
private Date deliveryLoadingTime;
private Date deliverySignTime;
private String importWarehouseName;
private String createUserName;
private Date createTime;
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java

@ -35,6 +35,7 @@ import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -299,8 +300,8 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
}
@Override
public List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus) {
return distributionParcelListService.findEntityListByOrderCodeAndStatus(orderCode,warehouseId,packageStatus);
public List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus, @RequestParam String waybillNo) {
return distributionParcelListService.findEntityListByOrderCodeAndStatus(orderCode,warehouseId,packageStatus,waybillNo);
}
@Override

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -194,7 +194,7 @@ public interface IDistributionParcelListService extends BaseService<Distribution
*/
R searchNode(String packageCode);
List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus);
List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus,String waybillNo);
/**

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -1120,11 +1120,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
}
@Override
public List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus) {
public List<DistributionParcelListEntity> findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus,String waybillNo) {
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_code", orderCode)
.eq("warehouse_id", warehouseId)
.eq("order_package_status", packageStatus)
.eq("waybill_number",waybillNo)
.eq("is_transfer", 1)
.eq("is_deleted", 0);
return baseMapper.selectList(queryWrapper);

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -1595,7 +1595,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
Integer carsType = orderDetailEntity.getCarsType();
Integer signState = orderDetailEntity.getSignState();
waybillNo = orderDetailEntity.getWaybillNo();
Date rukuTime = orderDetailEntity.getCreateTime();
Date rukuTime = orderDetailEntity.getUpdateTime();
if(StringUtil.isBlank(waybillNo)){
Integer advanceId = orderDetailEntity.getAdvanceId();
AdvanceEntity advanceEntity = advanceClient.fingById(advanceId);

38
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java

@ -1,11 +1,13 @@
package com.logpm.trunkline.controller;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import io.swagger.annotations.Api;
@ -86,7 +88,7 @@ public class AdvanceDetailController {
try{
List<Long> advanceDetailIds = advanceDetailDTO.getAdvanceDetailIds();
if(0 == advanceDetailIds.size()){
if(CollUtil.isEmpty(advanceDetailIds)){
log.warn(method+"请选择删除的包件");
return R.fail(405,"请选择删除的包件");
}
@ -103,4 +105,38 @@ public class AdvanceDetailController {
}
@ResponseBody
@PostMapping("/findOrderDetails")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询订单明细", notes = "orderDetailsDTO")
public R findOrderDetails(@RequestBody OrderDetailsDTO orderDetailsDTO) {
String method = "############findOrderDetails: ";
log.info(method+"请求参数{}",orderDetailsDTO);
try{
Integer pageSize = orderDetailsDTO.getPageSize();
Integer pageNum = orderDetailsDTO.getPageNum();
if(Objects.isNull(pageSize)){
orderDetailsDTO.setPageSize(30);
}
if(Objects.isNull(pageNum)){
orderDetailsDTO.setPageNum(1);
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(!Objects.isNull(myCurrentWarehouse)){
orderDetailsDTO.setWarehouseId(myCurrentWarehouse.getId());
orderDetailsDTO.setWarehouseName(myCurrentWarehouse.getName());
}
return advanceDetailService.findOrderDetails(orderDetailsDTO);
}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,"系统异常");
}
}
}

41
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderDetailsDTO.java

@ -0,0 +1,41 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class OrderDetailsDTO implements Serializable {
private Integer pageSize;
private Integer pageNum;
private Long warehouseId;
private String warehouseName;
private Integer packageStatus;//是否入库 0未入库 1已入库
private Integer isGcp;//是否干仓配 0否 1是
private String orderCode;//订单好
private String waybillNo;//运单号
private String orderPackageCode;//包件码
private String brand;
private String sencods;//二级品类
private String thirds;//三级品类
private String trainNumber;//客户号车次号
private String serviceNumber;//服务号
private String trunklineCarsNo;//干线车次号
private String deliveryTrainNumber;//配送车次号
private String nowWarehouseId;//当前所在仓iD
private String sendDateStr;//发货时间
private String createUserName;//创建人
private Date createTimeStart;//创建时间
private String createTimeStr;//创建时间
private Date createTimeEnd;//创建时间
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java

@ -3,11 +3,9 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.AdvanceDetailGoodsVO;
import com.logpm.trunkline.vo.AdvanceDetailStockNumVO;
import com.logpm.trunkline.vo.BillladingPackageVO;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.trunkline.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -59,4 +57,6 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
*/
List<String> findPackageCodeByCodes(@Param("orderPackageCodes") Set<String> orderPackageCodes);
IPage<OrderDetailInfoVO> findOrderDetails(IPage<Object> page, @Param("param") OrderDetailsDTO orderDetailsDTO);
}

122
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -213,4 +213,126 @@
) packageCodes where packageCodes.pid = t.order_package_code)
</select>
<select id="findOrderDetails" resultType="com.logpm.trunkline.vo.OrderDetailInfoVO">
select
ltad.waybill_id waybillId,
ltad.waybill_no waybillNo,
ldpl.warehouse nowWarehouseName,
ltad.train_number trainNumber,
ltad.package_status packageStatus,
lta.is_gcp isGcp,
ltad.first_pack_name firstPackName,
ltad.second_pack_name secondPackName,
ltad.third_pack_name thirdPackName,
ltad.material_code materialCode,
ltad.material_name materialName,
ltad.order_package_code orderPackageCode,
ltad.brand brand,
lta.service_num serviceNumber,
ltad.quantity quantity,
lwtg.tray_code trayCode,
lwt.pallet_name trayName,
ltad.weight weight,
ltad.volume volume,
ltad.send_date_str sendDateStr,
ltcls.load_code trunklineCarsNo,
ltcls.scan_status scanStatus,
ltcls.create_time trunklineLoadingTime,
ltcls.sign_time trunklineSignTime,
lddl.train_number deliveryTrainNumber,
ldl.scan_time deliveryLoadingTime,
ldl.signing_time deliverySignTime,
ltad.warehouse_name importWarehouseName,
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 logpm_distribution_parcel_list ldpl on ltad.order_package_code = ldpl.order_package_code
inner join (
select pl.order_package_code,
max(pl.update_time) updateTime
from logpm_distribution_parcel_list pl
left join logpm_trunkline_advance_detail ad on ad.order_package_code = pl.order_package_code
where 1=1
<if test="param.orderCode != null and param.orderCode != '' ">
and LOCATE(#{param.orderCode}, pl.order_code)
</if>
<if test="param.waybillNo != null and param.waybillNo != '' ">
and ad.waybill_no = #{param.waybill}
</if>
<if test="param.trainNumber != null and param.trainNumber != '' ">
and ad.train_number = #{param.trainNumber}
</if>
<if test="param.serviceNumber != null and param.serviceNumber != '' ">
and ad.service_num = #{param.serviceNumber}
</if>
<if test="param.orderPackageCode != null and param.orderPackageCode != '' ">
and LOCATE(#{param.orderPackageCode},ad.order_package_code)
</if>
group by pl.order_package_code
) tmax on tmax.order_package_code = ldpl.order_package_code and ldpl.update_time = tmax.updateTime
left join logpm_warehouse_tray_goods lwtg on lwtg.association_value = ldpl.order_package_code and lwtg.warehouse_id = ldpl.warehouse_id
left join logpm_warehouse_tray lwt on lwtg.tray_id = lwt.id
left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code
left 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 = ldpl.order_package_code and cmax.cupdateTime = ltcls.update_time
left join logpm_distribution_loadscan ldl on ldl.order_package_code = ldpl.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
<if test="param.orderCode != null and param.orderCode != '' ">
and LOCATE(#{param.orderCode}, ltad.order_code)
</if>
<if test="param.waybillNo != null and param.waybillNo != '' ">
and ltad.waybill_no = #{param.waybill}
</if>
<if test="param.trainNumber != null and param.trainNumber != '' ">
and ltad.train_number = #{param.trainNumber}
</if>
<if test="param.serviceNumber != null and param.serviceNumber != '' ">
and ltad.service_num = #{param.serviceNumber}
</if>
<if test="param.orderPackageCode != null and param.orderPackageCode != '' ">
and LOCATE(#{param.orderPackageCode}, ltad.order_package_code)
</if>
<if test="param.packageStatus != null ">
and ltad.package_status = #{param.packageStatus}
</if>
<if test="param.isGcp != null ">
and lta.is_gcp = #{param.isGcp}
</if>
<if test="param.brand != null and param.brand != '' ">
and ltad.brand = #{param.brand}
</if>
<if test="param.trunklineCarsNo != null and param.trunklineCarsNo != '' ">
and ltcls.load_code = #{param.trunklineCarsNo}
</if>
<if test="param.deliveryTrainNumber != null and param.deliveryTrainNumber != '' ">
and lddl.train_number = #{param.deliveryTrainNumber}
</if>
<if test="param.nowWarehouseId != null ">
and ldpl.warehouse_id = #{param.nowWarehouseId}
</if>
<if test="param.sendDateStr != null and param.sendDateStr != '' ">
and ltad.send_date_str = #{param.sendDateStr}
</if>
<if test="param.createUserName != null and param.createUserName != '' ">
and ltad.send_date_str = #{param.createUserName}
</if>
<if test="param.createTimeStart != null ">
and ltad.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null ">
and ltad.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.createTimeEnd != null and param.createTimeEnd != '' ">
and ltad.create_time = #{param.sendDateStr}
</if>
</select>
</mapper>

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -62,6 +62,7 @@
ltcl.start_time,
ltcl.now_warehouse_id,
ltcl.count_transport_cost
order by ltcl.create_time desc
</select>
@ -120,6 +121,7 @@
ltcl.end_warehouse_names,
ltcl.arrive_time,
ltcl.start_time
order by ltcl.create_time desc
</select>
@ -302,7 +304,7 @@
where ltco.load_id = #{param.loadId}
and ltco.final_node_id = #{param.finalNodeId}
and ldpl.is_deleted = 0
and ldpl.order_package_status in ('20','30')
and ldpl.order_package_status in ('20','30','60')
<if test="param.warehouseId != null">
and ldpl.warehouse_id = #{param.warehouseId}
</if>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -3,6 +3,7 @@ package com.logpm.trunkline.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.vo.AdvanceDetailGoodsVO;
import com.logpm.trunkline.vo.AdvanceDetailStockNumVO;
@ -70,4 +71,6 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
*/
List<String> findPackageCodeByCodes(Set<String> orderPackageCodes);
R findOrderDetails(OrderDetailsDTO orderDetailsDTO);
}

28
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -10,15 +10,13 @@ import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.distribution.vo.DistributionStockArticleQRCodeVO;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.trunkline.dto.AdvanceDetailDTO;
import com.logpm.trunkline.dto.OrderDetailsDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.mapper.TrunklineAdvanceDetailMapper;
import com.logpm.trunkline.mapper.TrunklineAdvanceMapper;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.vo.AdvanceDetailGoodsVO;
import com.logpm.trunkline.vo.AdvanceDetailStockNumVO;
import com.logpm.trunkline.vo.BillladingPackageVO;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import com.logpm.trunkline.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
@ -31,11 +29,7 @@ import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.*;
@Slf4j
@Service
@ -256,4 +250,20 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
public List<String> findPackageCodeByCodes(Set<String> orderPackageCodes) {
return baseMapper.findPackageCodeByCodes(orderPackageCodes);
}
@Override
public R findOrderDetails(OrderDetailsDTO orderDetailsDTO) {
//判断orderDetailsDTO中的订单号 运单号 包件码 服务号 客户车次号至少有一个有值
if(StringUtil.isBlank(orderDetailsDTO.getOrderCode()) && StringUtil.isBlank(orderDetailsDTO.getWaybillNo()) && StringUtil.isBlank(orderDetailsDTO.getOrderPackageCode()) && StringUtil.isBlank(orderDetailsDTO.getServiceNumber()) && StringUtil.isBlank(orderDetailsDTO.getTrunklineCarsNo())){
return R.fail("订单号 运单号 包件码 服务号 客户车次号至少有一个有值");
}
IPage<Object> page = new Page<>();
page.setCurrent(orderDetailsDTO.getPageNum());
page.setSize(orderDetailsDTO.getPageSize());
IPage<OrderDetailInfoVO> pageList = baseMapper.findOrderDetails(page,orderDetailsDTO);
return R.data(pageList);
}
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -3927,7 +3927,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//订制品订单
String orderCode = carsOrderEntity.getOrderCode();
Integer planNum = carsOrderEntity.getPlanNum();
List<DistributionParcelListEntity> entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, "20");
String waybillNo = carsOrderEntity.getWaybillNo();
List<DistributionParcelListEntity> entityListByOrderCode = distributionParcelListClient.findEntityListByOrderCodeAndStatus(orderCode, warehouseId, "20",waybillNo);
int size = entityListByOrderCode.size();
if (planNum.equals(size + realNum)) {
for (DistributionParcelListEntity parcelListEntity : entityListByOrderCode) {

Loading…
Cancel
Save