Browse Source

1.bug修复

master
zhenghaoyu 9 months ago
parent
commit
b247128f3e
  1. 4
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java
  2. 50
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAddClientVO.java
  3. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java
  4. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingWaybillVO.java
  5. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java
  6. 4
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml
  7. 27
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java
  8. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java
  9. 69
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/PushInstallDTO.java
  10. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/JobAnnotationAspect.java
  11. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/bean/Resp.java
  12. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/OrderDetailsDTO.java
  13. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  14. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  15. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.java
  16. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.xml
  17. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml
  18. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  19. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml
  20. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingPackageServicie.java
  21. 26
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  22. 24
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  23. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  24. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  25. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  26. 79
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java
  27. 99
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  28. 78
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  29. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

4
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java

@ -65,6 +65,10 @@ public class BasicTenantCodeEntity extends TenantEntity implements Serializable
@ApiModelProperty(value = "编码")
private String code;
@JsonSerialize(using = ToStringSerializer.class)
@ApiModelProperty(value = "简称")
private String desName;
@ApiModelProperty(value = "预留1")
private String reserve1;
/**

50
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAddClientVO.java

@ -1,50 +0,0 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
* 基础价格按品类计费 视图实体类
*
* @author zqb
* @since 2024-04-02
*/
@Builder
@Data
public class PriceDispatchAddClientVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "品类id")
private Long categoryId;
@ApiModelProperty(value = "分货费")
private Double sortPrice;
@ApiModelProperty(value = "装卸费")
private Double handlingPrice;
@ApiModelProperty(value = "平移费")
private Double relocationPrice;
@ApiModelProperty(value = "上楼费")
private Double upstairsDeliveryPrice;
@ApiModelProperty(value = "配送-上楼费免费楼层")
private Integer dispatchStairsCarryingCharge;
}

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java

@ -30,6 +30,7 @@ public class LoadCarsDTO implements Serializable {
private Integer pageSize;
private String loadCarsNo;
private String loadStatus;
private Long warehouseId;
@ -150,4 +151,6 @@ public class LoadCarsDTO implements Serializable {
private Date unloadTimeStart;
private Date unloadTimeEnd;
private String carsNo;
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingWaybillVO.java

@ -34,5 +34,6 @@ public class TrunklineBillladingWaybillVO extends TrunklineBillladingWaybillEnti
private Long billladingWaybillId;
private Integer totalPlanNum;
private Integer scanNum;
private Integer noBillladingNum;
}

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java

@ -18,6 +18,7 @@ package com.logpm.warehouse.feign;
import com.alibaba.fastjson.JSONObject;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
@ -74,4 +75,7 @@ public interface IWarehouseTrayTypeClient {
@GetMapping(API_PREFIX+"/trayToNull")
void trayToNull(@RequestParam String trayCode,@RequestParam String remark);
@GetMapping(API_PREFIX+"/findTrayTypeEntity")
WarehouseTrayTypeEntity findTrayTypeEntity(@RequestParam String trayCode);
}

4
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml

@ -57,9 +57,7 @@
<if test="param.dealDateEnd !=null">
and deal_time &lt;= #{param.dealDateEnd}
</if>
order by up_time desc
order by create_time desc
</select>
<select id="findListByCarsNoAndUpWarehouseId" resultType="com.alibaba.fastjson.JSONObject">

27
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java

@ -1,10 +1,9 @@
package com.logpm.basicdata.service.impl;
import com.logpm.basic.entity.BasicTenantCodeEntity;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.basicdata.entity.BasicdataCodeRecordEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.mapper.BasicdataTrayMapper;
import com.logpm.basicdata.service.IBasicdataCodeRecordService;
import com.logpm.basicdata.service.IBasicdataCodeService;
import com.logpm.basicdata.service.IBasicdataWarehouseService;
@ -29,14 +28,12 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
private final IBasicTenantCodeClient basicTenantCodeClient;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IBasicdataWarehouseService basicdataWarehouseService;
private final BasicdataTrayMapper basicdataTrayMapper;
private final IBasicdataCodeRecordService basicdataCodeRecordService;
private final IBasicTenantCodeClient tenantCodeClient;
/**
* 根据类型生成编号
* @param type
@ -409,6 +406,14 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
}
private String generateTraysCode(Integer type, String warehouseCode) {
BasicTenantCodeEntity basicTenantCode = tenantCodeClient.findBasicTenantCodeByCodeAndShowType("1", 6);
if(Objects.isNull(basicTenantCode)){
log.warn("############generateTraysCode: 租户信息不存在basicTenantCode={}",basicTenantCode);
return null;
}
String desName = basicTenantCode.getDesName();
String code = basicTenantCode.getCode();
if(!StringUtil.hasLength(warehouseCode)){
log.warn("############generateTraysCode: 仓库编码为空warehouseCode={}",warehouseCode);
return null;
@ -421,6 +426,9 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
return null;
}
String abbreviation = basicdataWarehouseEntity.getAbbreviation();
Calendar calendar = Calendar.getInstance();
//获取年份
Integer year = calendar.get(Calendar.YEAR);
@ -439,7 +447,7 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
basicdataCodeRecordEntity.setWarehouseCode(warehouseCode);
basicdataCodeRecordEntity.setYear(year+"");
basicdataCodeRecordEntity.setMonth(month+"");
basicdataCodeRecordEntity.setNum(0);
basicdataCodeRecordEntity.setNum(100000);
basicdataCodeRecordService.save(basicdataCodeRecordEntity);
}
Integer inrc = basicdataCodeRecordEntity.getNum() + 1;
@ -447,7 +455,10 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
basicdataCodeRecordEntity.setNum(inrc);
basicdataCodeRecordService.updateById(basicdataCodeRecordEntity);
return "HT"+warehouseCode+year+CommonUtil.geFourNumber(month.longValue(),2)+CommonUtil.geFourNumber(inrc.longValue(),5);
String trayCode = "T" + code + year + CommonUtil.geFourNumber(month.longValue(), 2) + inrc;
String trayName = desName + abbreviation + inrc;
return trayCode+"&&"+trayName;
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java

@ -120,7 +120,7 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe
basicdataTrayEntity = new BasicdataTrayEntity();
BeanUtils.copyProperties(basicdataTrayDTO,basicdataTrayEntity);
//String trayCode = tenantCodeClient.shelfCode(AuthUtil.getTenantId(), "6");
String trayCode = basicdataCodeClient.getCodeByType(CodeNumConstant.TRAYS,basicdataWarehouseEntity.getWarehouseCode(),"465897");
String trayInfo = basicdataCodeClient.getCodeByType(CodeNumConstant.TRAYS,basicdataWarehouseEntity.getWarehouseCode(),"465897");
// basicdataTrayEntity.setTrayStatus("1");
//String uuid = "1" + Func.random(18, RandomType.INT).trim();
//long id = Long.parseLong(uuid);
@ -132,8 +132,9 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe
// basicdataTrayEntity.setIsDeleted(0);
// basicdataTrayEntity.setStatus(1);
// basicdataTrayEntity.setId(id);
basicdataTrayEntity.setPalletCode(trayCode);
basicdataTrayEntity.setPalletName(trayCode);
String[] split = trayInfo.split("&&");
basicdataTrayEntity.setPalletCode(split[0]);
basicdataTrayEntity.setPalletName(split[1]);
basicdataTrayEntities.add(basicdataTrayEntity);
}
result = this.saveBatch(basicdataTrayEntities);

69
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/PushInstallDTO.java

@ -1,69 +0,0 @@
package com.logpm.distribution.dto;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.function.Consumer;
@Data
public class PushInstallDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String name;
private String tel;
private String address;
private String balance_people;
private String balance_type;
private String balance_name;
private List<Order> order;
private List<OrderDetail> order_detail;
@Data
public static class Order implements Serializable{
private static final long serialVersionUID = 1L;
private String waybill_no;
private String all_num;
private String end_num;
private String order_no;
}
@Data
public static class OrderDetail implements Serializable {
private static final long serialVersionUID = 1L;
private String waybill_no;
private String package_code;
private String level1_type;
private String level2_type;
private String level3_type;
private String materials;
private String order_no;
private String number;
}
}

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/aspect/JobAnnotationAspect.java

@ -1,7 +1,5 @@
package com.logpm.factory.aspect;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import lombok.AllArgsConstructor;
@ -10,7 +8,6 @@ import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.component.MockLoginService;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.lock.LockType;
import org.springblade.core.redis.lock.RedisLockClient;
@ -22,8 +19,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/bean/Resp.java

@ -16,6 +16,15 @@ public class Resp extends R {
return resp;
}
public static Resp scanData(String msg,String audio,Object data){
Resp resp = new Resp();
resp.setCode(200);
resp.setMsg(msg);
resp.setData(data);
resp.setAudio(audio);
return resp;
}
public static Resp scanFail(String msg,String audio){
Resp resp = new Resp();
resp.setCode(3001);

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

@ -25,6 +25,7 @@ public class OrderDetailsDTO implements Serializable {
private String brand;
private String firsts;//一级品类
private String sencods;//二级品类
private String thirds;//三级品类
private String trainNumber;//客户号车次号
@ -35,7 +36,8 @@ public class OrderDetailsDTO implements Serializable {
private String sendDateStr;//发货时间
private String createUserName;//创建人
private Date createTimeStart;//创建时间
private String createTimeStr;//创建时间
private String createTimeStartStr;//创建时间
private String createTimeEndStr;//创建时间
private Date createTimeEnd;//创建时间
}

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

@ -294,6 +294,15 @@
<if test="param.deliveryTrainNumber != null and param.deliveryTrainNumber != '' ">
and lddl.train_number = #{param.deliveryTrainNumber}
</if>
<if test="param.firsts != null and param.firsts != '' ">
and LOCATE(#{param.firsts}, ltad.first_pack_name) > 0
</if>
<if test="param.sencods != null and param.sencods != '' ">
and LOCATE(#{param.sencods}, ltad.second_pack_name) > 0
</if>
<if test="param.thirds != null and param.thirds != '' ">
and LOCATE(#{param.thirds}, ltad.third_pack_name) > 0
</if>
<if test="param.nowWarehouseId != null ">
and ldpl.warehouse_id = #{param.nowWarehouseId}
</if>
@ -309,9 +318,6 @@
<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>

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

@ -80,8 +80,8 @@
carrier_name carrierName,
remark remark
from logpm_trunkline_billlading
where billlading_status = '2'
where billlading_status = #{param.billladingStatus}
AND warehouse_id = #{param.warehouseId}
</select>
<select id="findWaybillListNotBillladingId" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO">

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.java

@ -18,4 +18,6 @@ public interface TrunklineBillladingPackageMapper extends BaseMapper<TrunklineBi
TrunklineBillladingPackageEntity findBillladingPackage(@Param("packageCode") String packageCode);
List<String> findBillladingPackages(@Param("orderPackageCodes") List<String> orderPackageCodes);
List<TrunklineBillladingPackageEntity> findListByBillladingAndWaybillId(@Param("billladingId") Long billladingId, @Param("waybillId") Long waybillId);
}

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.xml

@ -73,4 +73,13 @@
</foreach>
</select>
<select id="findListByBillladingAndWaybillId" resultType="com.logpm.trunkline.entity.TrunklineBillladingPackageEntity">
select ltbp.*
from logpm_trunkline_billlading_package ltbp
left join logpm_trunkline_advance_detail ltad on ltad.order_package_code = ltbp.order_package_code
where ltbp.billlading_id = #{billladingId}
and ltad.waybill_id = #{waybillId}
</select>
</mapper>

18
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml

@ -22,8 +22,8 @@
<select id="findWaybillInfoListByBillladingId" resultType="com.logpm.trunkline.vo.TrunklineBillladingWaybillVO">
select ltb.billlading_code billadingCode,
ltad.waybill_id waybillId,
ltad.waybill_no waybillNo,
ltbw.waybill_id waybillId,
ltbw.waybill_no waybillNo,
ltbw.id billladingWaybillId,
lww.create_time openOrderTime,
lww.goods_name goodsName,
@ -45,17 +45,19 @@
ltbw.real_num realNum,
ltbw.billlading_fee billladingFee,
lww.collect_pay collectPay,
count(ltad.id) scanNum
t.num scanNum
from logpm_trunkline_billlading_waybill ltbw
left join logpm_trunkline_billlading_package ltbp on ltbw.billlading_id = ltbp.billlading_id
left join logpm_trunkline_advance_detail ltad on ltad.order_package_code = ltbp.order_package_code and ltad.waybill_id = ltbw.waybill_id
left join (select IFNULL(ltad.waybill_no,'————') waybillNo,
COUNT(ltbp.id) num
from logpm_trunkline_billlading_package ltbp
left join logpm_platform.logpm_trunkline_advance_detail ltad on ltbp.order_package_code = ltad.order_package_code
where ltbp.billlading_id=#{billladingId}
group by IFNULL(ltad.waybill_no,'————')) t on t.waybillNo = ltbw.waybill_no
left join logpm_trunkline_billlading ltb on ltb.id = ltbw.billlading_id
left join logpm_warehouse_waybill lww on lww.waybill_no = ltbw.waybill_no
where ltbw.billlading_id = #{billladingId}
and ltbw.is_deleted = 0
group by ltb.billlading_code,
ltbw.waybill_id,
ltbw.waybill_no
and ltbw.real_num > 0
</select>
<update id="updateDataByBillladingWaybillId" >

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

@ -45,6 +45,12 @@
<if test="param.warehouseId != null" >
and ltcl.start_warehouse_id = #{param.warehouseId}
</if>
<if test="param.loadCarsNo != null and param.loadCarsNo != ''">
and ltcl.cars_no = #{param.loadCarsNo}
</if>
<if test="param.loadStatus != null and param.loadStatus != ''">
and ltcl.load_status = #{param.loadStatus}
</if>
group by ltcl.id,ltcl.cars_no,
ltcl.plan_loading_number,
ltcl.real_loading_number,
@ -387,6 +393,9 @@
<if test="param.endTime != null">
and ltcl.create_time &lt;= #{param.endTime}
</if>
<if test="param.loadCarsNo != null and param.loadCarsNo != ''">
and ltcl.cars_no &lt;= #{param.loadCarsNo}
</if>
group by ltcl.id
order by ltcl.create_time desc
</select>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml

@ -97,6 +97,9 @@
<if test="param.loadId != null">
and ltlso.load_id = #{param.loadId}
</if>
<if test="param.loadCarsNo != null param.loadCarsNo != ''">
and ltcl.cars_no = #{param.loadCarsNo}
</if>
<if test="param.signStatus != null and param.signStatus == '20'">
and ltlso.sign_status = '20'
and ltlso.sign_time &gt;= #{param.enterTimeStart}

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

@ -19,4 +19,7 @@ public interface ITrunklineBillladingPackageServicie extends BaseService<Trunkli
List<String> findBillladingPackages(List<String> orderPackageCodes);
void saveEntityBatch(List<String> noOrderPackageCodes, Long billladingId, Long warehouseId, Integer incomingType);
List<TrunklineBillladingPackageEntity> findListByBillladingAndWaybillId(Long billladingId, Long waybillId);
}

26
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -436,18 +436,30 @@ public class InComingServiceImpl implements IInComingService {
String packageCode = packageCodes.get(0);
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.findEntityByOrderPackageCode(packageCode);
Long advanceId = advanceDetailEntity.getAdvanceId();
Long waybillId = advanceDetailEntity.getWaybillId();
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
String dealerName = advanceEntity.getDealerName();
String dealerCode = advanceEntity.getDealerCode();
String brand = advanceEntity.getBrand();
BasicdataTripartiteMallEntity tripartiteMallEntity = tripartiteMallClient.findEntityByDealerNameAndDealerCodeAndBrand(dealerName,dealerCode,brand);
if(!Objects.isNull(tripartiteMallEntity)){
Long clientId = tripartiteMallEntity.getClientId();
BasicdataStorageServicesEntity storageServicesEntity = storageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId);
if(!Objects.isNull(storageServicesEntity)){
String serveWarehouseName = storageServicesEntity.getServeWarehouseName();
return Resp.scanSuccess(dealerName+"的服务仓库为"+serveWarehouseName,dealerName+"的服务仓库为"+serveWarehouseName);
if(Objects.isNull(waybillId)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
if(!Objects.isNull(waybillEntity)){
String destinationWarehouseName = waybillEntity.getDestinationWarehouseName();
return Resp.scanSuccess(dealerName+"的目的仓库为"+destinationWarehouseName,dealerName+"的目的仓库为"+destinationWarehouseName);
}else{
return Resp.scanSuccess("商家为"+dealerName,"商家为"+dealerName);
}
}else{
BasicdataTripartiteMallEntity tripartiteMallEntity = tripartiteMallClient.findEntityByDealerNameAndDealerCodeAndBrand(dealerName,dealerCode,brand);
if(!Objects.isNull(tripartiteMallEntity)){
Long clientId = tripartiteMallEntity.getClientId();
BasicdataStorageServicesEntity storageServicesEntity = storageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId);
if(!Objects.isNull(storageServicesEntity)){
String serveWarehouseName = storageServicesEntity.getServeWarehouseName();
return Resp.scanSuccess(dealerName+"的服务仓库为"+serveWarehouseName,dealerName+"的服务仓库为"+serveWarehouseName);
}
}
return Resp.scanSuccess("商家为"+dealerName,"商家为"+dealerName);
}
}
}

24
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java

@ -826,6 +826,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
@Override
public void dealwithBillladingInfo(List<Long> advanceIds,Long warehouseId,String warehouseName,Long waybillId,String waybillNo) {
//查询这些暂存单所有包件有在哪些提货单中有多少个
List<BillladingPackageVO> billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds);
List<TrunklineBillladingWaybillEntity> addBillladingWaybillEntities = new ArrayList<>();
List<TrunklineBillladingWaybillEntity> updateBillladingWaybillEntities = new ArrayList<>();
@ -846,25 +847,26 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
//把billladingEntities转化成以id为key的Map
Map<Long, TrunklineBillladingEntity> billladingMap = billladingEntities.stream().collect(Collectors.toMap(TrunklineBillladingEntity::getId, Function.identity()));
List<TrunklineBillladingWaybillEntity> billladingWaybillEntities = trunklineBillladingWaybillService.getNoDataWaybillByBillladingIds(billladingIds);
//查询这些提货单下没有运单的数据
List<TrunklineBillladingWaybillEntity> billladingNoWaybillEntities = trunklineBillladingWaybillService.getNoDataWaybillByBillladingIds(billladingIds);
//把billladingWaybillEntities转化成以billladingId为key的Map
Map<Long, TrunklineBillladingWaybillEntity> billladingWaybillMap = billladingWaybillEntities.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getId, Function.identity()));
Map<Long, TrunklineBillladingWaybillEntity> billladingNoWaybillMap = billladingNoWaybillEntities.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getBillladingId, Function.identity()));
billladingPackageMap.keySet().forEach(billladingId -> {
BillladingPackageVO billladingPackageVO = billladingPackageMap.get(billladingId);
Integer num = billladingPackageVO.getNum();
TrunklineBillladingWaybillEntity billladingWaybillEntity = billladingWaybillMap.get(billladingId);
if(!Objects.isNull(billladingWaybillEntity)){
TrunklineBillladingWaybillEntity billladingNoWaybillEntity = billladingNoWaybillMap.get(billladingId);
if(!Objects.isNull(billladingNoWaybillEntity)){
TrunklineBillladingEntity billladingEntity = billladingMap.get(billladingId);
Integer realNum = billladingWaybillEntity.getRealNum();
Integer realNum = billladingNoWaybillEntity.getRealNum();
if (realNum > num) {
billladingWaybillEntity.setRealNum(realNum - num);
billladingNoWaybillEntity.setRealNum(realNum - num);
} else if (realNum.equals(num)) {
billladingWaybillEntity.setRealNum(0);
billladingWaybillEntity.setIsDeleted(1);
billladingNoWaybillEntity.setRealNum(0);
billladingNoWaybillEntity.setIsDeleted(1);
}
updateBillladingWaybillEntities.add(billladingWaybillEntity);
updateBillladingWaybillEntities.add(billladingNoWaybillEntity);
TrunklineBillladingWaybillEntity addbillladingWaybillEntity = new TrunklineBillladingWaybillEntity();
addbillladingWaybillEntity.setWarehouseId(warehouseId);
addbillladingWaybillEntity.setWarehouseName(warehouseName);
@ -887,6 +889,10 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
for (TrunklineBillladingEntity billladingEntity : updateFeeBilllading) {
trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(billladingEntity);
}
}

18
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -449,6 +449,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
waybillEntity.setStockCount(advanceDetailStockNumVO.getStockNum());
waybillEntity.setStockWeight(advanceDetailStockNumVO.getStockWeight());
waybillEntity.setStockVolume(advanceDetailStockNumVO.getStockVolume());
List<BillladingPackageVO> billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds);
//把billladingPackageList中的所有num累加
waybillEntity.setBillladingNum(billladingPackageList.stream().mapToInt(BillladingPackageVO::getNum).sum());
waybillEntity.setTotalFreight(openOrderDTO.getTotalFreight());
waybillEntity.setDeliveryFee(openOrderDTO.getDeliveryFee());
@ -2292,7 +2295,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<TrunklineAdvanceEntity> list = new ArrayList<>();
importOrderNoPackageExcelDTOMap.keySet().forEach(key -> {
ImportOrderNoPackageExcelDTO importOrderNoPackageExcelDTO = importOrderNoPackageExcelDTOMap.get(key);
if(Objects.isNull(importOrderNoPackageExcelDTO)){
if(!Objects.isNull(importOrderNoPackageExcelDTO)){
String orderCode = importOrderNoPackageExcelDTO.getOrderCode();
TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceVO();
advanceEntity.setWarehouseId(warehouseId);
@ -2375,7 +2378,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}else{
advanceDetailModel.setWeight(new BigDecimal(weight));
}
advanceDetailModel.setWeight(new BigDecimal(importOrderNoPackageExcelDTO.getWeight()));
advanceDetailModel.setPackageStatus("0");
List<String> orderPackageCodes = basicdataCodeClient.getBatchPackageCodeByType(warehouseCode, orderCode, totalNum);
@ -3249,6 +3251,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
StringBuilder stringBuilder = new StringBuilder();
List<EditOrderMsgVO> msgList = new ArrayList<>();
String newBrand = openOrderDTO.getBrand();
Long newBrandId = openOrderDTO.getBrandId();
String brand = waybillEntity.getBrand();
Long brandId = waybillEntity.getBrandId();
if(!ObjectUtil.equals(newBrandId,brandId)){
EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO();
editOrderMsgVO.setItemName("品牌");
editOrderMsgVO.setOldValue(brand);
editOrderMsgVO.setNewValue(newBrand);
msgList.add(editOrderMsgVO);
}
String newDeparture = openOrderDTO.getDeparture();
String departure = waybillEntity.getDeparture();
if(!ObjectUtil.equals(newDeparture,departure)){

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

@ -28,6 +28,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
@ -168,6 +169,14 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
vo.setDepartureStation(StringUtil.isBlank(waybillEntity.getDepartureWarehouseName())?"":waybillEntity.getDepartureWarehouseName());
vo.setWaybillNumber(StringUtil.isBlank(waybillEntity.getWaybillNo())?"":waybillEntity.getWaybillNo());
}
}else{
vo.setShipperName("");
vo.setShipperAddress("");
vo.setMallName("");
vo.setWaybillsNum("");
vo.setObjective("");
vo.setDepartureStation("");
vo.setWaybillNumber("");
}
vo.setOrderCode(orderCode);
@ -293,6 +302,10 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
page.setCurrent(orderDetailsDTO.getPageNum());
page.setSize(orderDetailsDTO.getPageSize());
orderDetailsDTO.setCreateTimeStart(CommonUtil.getStartByDateStr(orderDetailsDTO.getCreateTimeStartStr()));
orderDetailsDTO.setCreateTimeEnd(CommonUtil.getEndByDateStr(orderDetailsDTO.getCreateTimeEndStr()));
IPage<OrderDetailInfoVO> pageList = baseMapper.findOrderDetails(page,orderDetailsDTO);
return R.data(pageList);
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -1014,6 +1014,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
}
updateWaybill.setId(waybillEntity.getId());
updateWaybill.setStockCount(waybillEntity.getStockCount() + size);
// updateWaybill.setBillladingNum(waybillEntity.getBillladingNum() + size);
updateWaybillList.add(updateWaybill);
}
});

79
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingPackageServiceImpl.java

@ -219,8 +219,7 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
}
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailEntityQueryWrapper = new QueryWrapper<>();
advanceDetailEntityQueryWrapper.in("order_package_code",noOrderPackageCodes)
.eq("warehouse_id",warehouseId);
advanceDetailEntityQueryWrapper.in("order_package_code",noOrderPackageCodes);
List<TrunklineAdvanceDetailEntity> advanceDetailList = trunklineAdvanceDetailService.list(advanceDetailEntityQueryWrapper);
if(advanceDetailList.isEmpty()){
@ -244,13 +243,16 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
});
saveBatch(billladingPackageEntities);
//查出所有入库包件对应的暂存单
QueryWrapper<TrunklineAdvanceEntity> advanceEntityQueryWrapper = new QueryWrapper<>();
advanceEntityQueryWrapper.in("id",advanceIdsSet)
.eq("waybill_status","1");
advanceEntityQueryWrapper.in("id",advanceIdsSet);
List<TrunklineAdvanceEntity> advanceEntities = trunklineAdvanceService.list(advanceEntityQueryWrapper);
//把所有暂存单已开单的运单号提取出来
//把advanceEntities所有元素的waybillNo放入一个Set<String>
Set<String> waybillNoSet = advanceEntities.stream().map(TrunklineAdvanceEntity::getWaybillNo).collect(Collectors.toSet());
Set<String> waybillNoSet = advanceEntities.stream().filter(advanceEntity -> !StringUtil.isEmpty(advanceEntity.getWaybillNo())).map(TrunklineAdvanceEntity::getWaybillNo).collect(Collectors.toSet());
//所有已开单暂存单运单信息
Map<String, WarehouseWaybillEntity> waybillEntityMap = new HashMap<>();
if(!waybillNoSet.isEmpty()){
List<WarehouseWaybillEntity> waybillEntityList = warehouseWaybillClient.findWaybillBilllByWaybillNos(new ArrayList<>(waybillNoSet));
@ -259,21 +261,26 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
}
//所有暂存单信息
//把advanceEntities转成以id为key的Map
Map<Long, TrunklineAdvanceEntity> advanceEntityMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity()));
//把这次所有入库的包件根据暂存单id进行分组
//把advanceDetailList中的所有元素的advanceId分组
Map<Long, List<TrunklineAdvanceDetailEntity>> advanceIdGroupedEntities = advanceDetailList.stream()
.collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId));
//把没开单的暂存单包件放在一起
List<TrunklineAdvanceDetailEntity> noWaybillList = new ArrayList<>();
Map<String,Integer> waybillNoMNumMap = new HashMap<>();
Map<String, WarehouseWaybillEntity> finalWaybillEntityMap = waybillEntityMap;
advanceEntityMap.keySet().forEach(advanceId -> {
TrunklineAdvanceEntity advanceEntity = advanceEntityMap.get(advanceId);
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = advanceIdGroupedEntities.get(advanceId);
String waybillNo = advanceEntity.getWaybillNo();
if(StringUtil.isNotBlank(waybillNo)){
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = advanceIdGroupedEntities.get(advanceId);
int size = advanceDetailEntities.size();
int size = advanceDetailEntities.size();//入库件数
WarehouseWaybillEntity waybillEntity = finalWaybillEntityMap.get(waybillNo);
if(!Objects.isNull(waybillEntity)){
Integer stockCount = waybillEntity.getStockCount();
@ -284,13 +291,9 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
}
int diff = 0;
int all = stockCount + size;
int allBillladingNum = billladingNum + size;
waybillEntity.setBillladingNum(allBillladingNum);
if(all > totalCount){
// waybillEntity.setStockCount(totalCount);
diff = totalCount - stockCount;
}else{
// waybillEntity.setStockCount(all);
diff = size;
}
Integer integer = waybillNoMNumMap.get(waybillNo);
@ -302,6 +305,8 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
finalWaybillEntityMap.put(waybillNo,waybillEntity);
}
}else{
noWaybillList.addAll(advanceDetailEntities);
}
});
@ -319,11 +324,29 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
}
List<TrunklineBillladingWaybillEntity> addList = new ArrayList<>();
List<TrunklineBillladingWaybillEntity> updateList = new ArrayList<>();
TrunklineBillladingWaybillEntity noWaybillNoData = trunklineBillladingWaybillService.findNoWaybillNoData(billladingId);
if(CollUtil.isNotEmpty(noWaybillList)){
int size = noWaybillList.size();
if(Objects.isNull(noWaybillNoData)){
noWaybillNoData = new TrunklineBillladingWaybillEntity();
noWaybillNoData.setWarehouseId(warehouseId);
noWaybillNoData.setWarehouseName(warehouseEntity.getName());
noWaybillNoData.setBillladingId(billladingId);
noWaybillNoData.setBilladingCode(trunklineBillladingEntity.getBillladingCode());
noWaybillNoData.setWaybillNo("————");
noWaybillNoData.setRealNum(size);
noWaybillNoData.setRealWeight(BigDecimal.ZERO);
noWaybillNoData.setRealVolume(BigDecimal.ZERO);
}else{
Integer realNum = noWaybillNoData.getRealNum();
noWaybillNoData.setRealNum(realNum+size);
}
}
for (String waybillNo : waybillNoSet) {
Integer integer = waybillNoMNumMap.get(waybillNo);
@ -340,33 +363,28 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
noWaybillNoData.setRealNum(integer);
noWaybillNoData.setRealWeight(BigDecimal.ZERO);
noWaybillNoData.setRealVolume(BigDecimal.ZERO);
addList.add(noWaybillNoData);
}else{
Integer realNum = noWaybillNoData.getRealNum();
noWaybillNoData.setRealNum(realNum+integer);
updateList.add(noWaybillNoData);
}
}else{
Integer realNum = billladingWaybillEntity.getRealNum();
billladingWaybillEntity.setRealNum(realNum + integer);
updateList.add(billladingWaybillEntity);
}
}
if(!addList.isEmpty()){
trunklineBillladingWaybillService.saveBatch(addList);
if(!Objects.isNull(noWaybillNoData)){
trunklineBillladingWaybillService.saveOrUpdate(noWaybillNoData);
}
trunklineBillladingWaybillService.updateBatchById(updateList);
// if(!updateList.isEmpty()){
// trunklineBillladingWaybillService.updateBatchById(updateList);
// }
TrunklineBillladingEntity billladingEntity = trunklineBillladingService.getById(billladingId);
if(!Objects.isNull(billladingEntity)){
int realNum = billladingEntity.getRealNum();
Integer all = 0;
if(CollUtil.isNotEmpty(waybillNoMNumMap)){
all = waybillNoMNumMap.values().stream().reduce(Integer::sum).get();
}
int all = advanceDetailList.size();
billladingEntity.setRealNum(realNum+all);
trunklineBillladingService.updateById(billladingEntity);
}
@ -401,7 +419,7 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
warehouseWaybillClient.updateList(warehouseWaybillEntities);
//根据提货单id重新计算每个运单的费用
// trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(trunklineBillladingEntity);
// trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(billladingEntity);
//--------------------------------------分割线------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@ -493,4 +511,9 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
}
@Override
public List<TrunklineBillladingPackageEntity> findListByBillladingAndWaybillId(Long billladingId, Long waybillId) {
return baseMapper.findListByBillladingAndWaybillId(billladingId,waybillId);
}
}

99
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -107,41 +107,52 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
updateById(trunklineBillladingEntity);
List<TrunklineBillladingWaybillEntity> saveBillladingWaybillList = new ArrayList<>();
// Map<Long, Integer> waybillBillladingNumMap = new HashMap<>();
//保存提货运单
List<TrunklineBillladingWaybillVO> billladingWaybillList = billladingDTO.getBillladingWaybillList();
for (TrunklineBillladingWaybillVO billladingWaybillVO:billladingWaybillList){
TrunklineBillladingWaybillEntity billladingWaybillEntity = new TrunklineBillladingWaybillEntity();
BeanUtil.copy(billladingWaybillVO,billladingWaybillEntity);
billladingWaybillEntity.setBillladingId(billladingId);
billladingWaybillEntity.setBilladingCode(trunklineBillladingEntity.getBillladingCode());
billladingWaybillEntity.setRealNum(0);
billladingWaybillEntity.setRealWeight(BigDecimal.ZERO);
billladingWaybillEntity.setRealVolume(BigDecimal.ZERO);
billladingWaybillEntity.setBillladingFee(BigDecimal.ZERO);
// billladingWaybillEntity.setPlanNum(billladingWaybillVO.getPlanNum());
saveBillladingWaybillList.add(billladingWaybillEntity);
// waybillBillladingNumMap.put(billladingWaybillVO.getWaybillId(),billladingWaybillVO.getPlanNum());
if(CollUtil.isNotEmpty(billladingWaybillList)){
//把billladingWaybillList中所有元素的waybillId放到一个List
List<Long> waybillIdList = billladingWaybillList.stream()
.map(TrunklineBillladingWaybillVO::getWaybillId)
.collect(Collectors.toList());
//查询运单
Map<Long, WarehouseWaybillEntity> waybillEntityMap = new HashMap<>();
if(CollUtil.isNotEmpty(waybillIdList)){
List<WarehouseWaybillEntity> waybillEntityList = warehouseWaybillClient.findListByWaybillIds(waybillIdList);
//把waybillEntityList转化为waybillId为key的Map
waybillEntityMap = waybillEntityList.stream()
.collect(Collectors.toMap(WarehouseWaybillEntity::getId, waybillEntity -> waybillEntity));
}
List<WarehouseWaybillEntity> updateWaybillList = new ArrayList<>();
for (TrunklineBillladingWaybillVO billladingWaybillVO:billladingWaybillList){
Long waybillId = billladingWaybillVO.getWaybillId();
WarehouseWaybillEntity warehouseWaybillEntity = waybillEntityMap.get(waybillId);
if(!Objects.isNull(warehouseWaybillEntity)){
Integer noBillladingNum = billladingWaybillVO.getNoBillladingNum();
Integer billladingNum = warehouseWaybillEntity.getBillladingNum();
Integer totalCount = warehouseWaybillEntity.getTotalCount();
if(billladingNum+noBillladingNum > totalCount){
log.warn("########saveNew1: "+waybillId+"已大于运单总件数");
continue;
}
warehouseWaybillEntity.setBillladingNum(billladingNum+noBillladingNum);
updateWaybillList.add(warehouseWaybillEntity);
TrunklineBillladingWaybillEntity billladingWaybillEntity = new TrunklineBillladingWaybillEntity();
BeanUtil.copy(billladingWaybillVO,billladingWaybillEntity);
billladingWaybillEntity.setBillladingId(billladingId);
billladingWaybillEntity.setBilladingCode(trunklineBillladingEntity.getBillladingCode());
billladingWaybillEntity.setRealNum(billladingWaybillVO.getNoBillladingNum());
billladingWaybillEntity.setRealWeight(BigDecimal.ZERO);
billladingWaybillEntity.setRealVolume(BigDecimal.ZERO);
billladingWaybillEntity.setBillladingFee(BigDecimal.ZERO);
saveBillladingWaybillList.add(billladingWaybillEntity);
}
}
billladingWaybillService.saveBatch(saveBillladingWaybillList);
warehouseWaybillClient.updateList(updateWaybillList);
}
billladingWaybillService.saveBatch(saveBillladingWaybillList);
// Set<Long> waybillIds = waybillBillladingNumMap.keySet();
//
// List<WarehouseWaybillEntity> waybillEntityList = warehouseWaybillClient.findListByWaybillIds(new ArrayList<>(waybillIds));
// waybillEntityList.forEach(waybillEntity -> {
// Long waybillEntityId = waybillEntity.getId();
// Integer planNum = waybillBillladingNumMap.get(waybillEntityId);
// if(Objects.isNull(planNum)){
// planNum = 0;
// }
// Integer billladingNum = waybillEntity.getBillladingNum();
// if(Objects.isNull(billladingNum)){
// billladingNum = 0;
// }
// waybillEntity.setBillladingNum(billladingNum+planNum);
// });
//
// warehouseWaybillClient.updateList(waybillEntityList);
TrunklineBillladingLogEntity logEntity = new TrunklineBillladingLogEntity();
@ -654,6 +665,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
return R.data(ls);
}
@Transactional(rollbackFor = Exception.class)
@Override
public R addWaybillToBillladingId(BillladingDTO billladingDTO) {
log.info("##############addWaybillToBillladingId: 添加运单");
@ -691,11 +703,32 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
entity.setBilladingCode(trunklineBillladingEntity.getBillladingCode());
entity.setWaybillId(waybillId);
entity.setWaybillNo(waybillNo);
entity.setRealNum(enterNum);
entity.setRealNum(warehouseWaybillEntity.getTotalCount()-warehouseWaybillEntity.getBillladingNum());
entity.setRealWeight(BigDecimal.ZERO);
entity.setRealVolume(BigDecimal.ZERO);
entity.setBillladingFee(BigDecimal.ZERO);
billladingWaybillService.save(entity);
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
if (!Objects.isNull(waybillEntity)){
waybillEntity.setBillladingNum(waybillEntity.getBillladingNum()+enterNum);
}
warehouseWaybillClient.updateEntity(waybillEntity);
TrunklineBillladingWaybillEntity noWaybillNoBillladingWaybill = billladingWaybillService.findNoWaybillNoData(billladingId);
if(!Objects.isNull(noWaybillNoBillladingWaybill)){
Integer realNum = noWaybillNoBillladingWaybill.getRealNum();
//有没挂运单的数据
List<TrunklineBillladingPackageEntity> billladingPackageEntities = trunklineBillladingPackageServicie.findListByBillladingAndWaybillId(billladingId,waybillId);
if(CollUtil.isNotEmpty(billladingPackageEntities)){
int size = billladingPackageEntities.size();
noWaybillNoBillladingWaybill.setRealNum(realNum-size);
}
billladingWaybillService.updateById(noWaybillNoBillladingWaybill);
}
billladingWaybillService.updateBillladingFeeByBillladingId(trunklineBillladingEntity);
return R.success("添加成功");
}

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

@ -40,6 +40,7 @@ import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
@ -349,7 +350,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//更新关联订单数据的发车数量
trunklineCarsOrderService.updateStartNumByLoadIdAndWarehouseId(loadId, warehouseId);
//生成直发商家签收单
createCustomerSignOrder(loadId, warehouseId);
// createCustomerSignOrder(loadId, warehouseId);
//生成异常列表
carsLoadAsyncService.abnormalListStartCarByLoadIdAndWarehouseId(loadId, warehouseId, AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), AuthUtil.getTenantId(), loadCarsDTO.getWarehouseName());
} catch (Exception e) {
@ -728,10 +729,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//更新关联订单数据的发车数量
trunklineCarsOrderService.updateStartNumToPlanNumByLoadIdAndWarehouseId(loadId, warehouseId);
//取消节点的签收单
cancleCustomerSignOrder(loadId, warehouseId);
carsLoadEntity.setIsCustomer("2");
updateById(carsLoadEntity);
// //取消节点的签收单
// cancleCustomerSignOrder(loadId, warehouseId);
// carsLoadEntity.setIsCustomer("2");
// updateById(carsLoadEntity);
} catch (Exception e) {
log.error("#############cancelStartCarByLoadId: 处理取消节点签收单 和 发车数量失败", e);
}
@ -3438,6 +3439,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Map<String, Object> map = new HashMap<>();
map.put("orders", orders);
WarehouseTrayTypeEntity trayTypeEntity = trayTypeClient.findTrayTypeEntity(trayCode);
if(!Objects.isNull(trayTypeEntity)){
Integer totalNum = trayTypeEntity.getTotalNum();
return Resp.scanData("打托成功", totalNum+"件",map);
}
return R.data(map);
}
@ -3668,8 +3674,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
JSONObject jsonObject = trunklineCarsLoadScanService.findUnloadNumAudio(loadId, warehouseId);
Integer totalUnloadNum = jsonObject.getInteger("totalUnloadNum");
Integer abnormalUnloadNum = jsonObject.getInteger("abnormalUnloadNum");
StringBuilder audio = new StringBuilder();
audio.append("卸车").append(totalUnloadNum).append("件");
if(!Objects.isNull(abnormalUnloadNum) && !abnormalUnloadNum.equals(0)){
audio.append("异常卸车").append(abnormalUnloadNum).append("件");
}
return Resp.scanSuccess("卸车成功","卸车"+totalUnloadNum+"件,异常卸车"+abnormalUnloadNum+"件");
return Resp.scanSuccess("卸车成功",audio.toString());
}
@Override
@ -3750,7 +3761,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updateNumByLoadId(loadId);
return R.success("卸车成功");
JSONObject jsonObject = trunklineCarsLoadScanService.findUnloadNumAudio(loadId, warehouseId);
Integer totalUnloadNum = jsonObject.getInteger("totalUnloadNum");
Integer abnormalUnloadNum = jsonObject.getInteger("abnormalUnloadNum");
StringBuilder audio = new StringBuilder();
audio.append("卸车").append(totalUnloadNum).append("件");
if(!Objects.isNull(abnormalUnloadNum) && !abnormalUnloadNum.equals(0)){
audio.append("异常卸车").append(abnormalUnloadNum).append("件");
}
return Resp.scanSuccess("卸车成功",audio.toString());
}
@Override
@ -3780,7 +3800,16 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//处理托盘的入库和货物的入库
trayTypeClient.changeTrayWarehouseInfo(trayCode, warehouseId);
return R.success("卸车成功");
JSONObject jsonObject = trunklineCarsLoadScanService.findUnloadNumAudio(loadId, warehouseId);
Integer totalUnloadNum = jsonObject.getInteger("totalUnloadNum");
Integer abnormalUnloadNum = jsonObject.getInteger("abnormalUnloadNum");
StringBuilder audio = new StringBuilder();
audio.append("卸车").append(totalUnloadNum).append("件");
if(!Objects.isNull(abnormalUnloadNum) && !abnormalUnloadNum.equals(0)){
audio.append("异常卸车").append(abnormalUnloadNum).append("件");
}
return Resp.scanSuccess("卸车成功",audio.toString());
}
@Transactional(rollbackFor = Exception.class)
@ -4284,21 +4313,43 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(pageList);
}
@Transactional(rollbackFor = Exception.class)
@Override
public R updateWaybillOrderIsCustemer(LoadCarsDTO loadCarsDTO) {
String carsOrderIds = loadCarsDTO.getCarsOrderIds();
String isCustomer = loadCarsDTO.getIsCustomer();
Long loadId = loadCarsDTO.getLoadId();
Long warehouseId = loadCarsDTO.getWarehouseId();
String[] split = carsOrderIds.split(",");
List<Long> carsOrderIdList = new ArrayList<>();
for (String s : split) {
carsOrderIdList.add(Long.parseLong(s));
}
Long carsOrderId = carsOrderIdList.get(0);
TrunklineCarsOrderEntity carsOrder = trunklineCarsOrderService.getById(carsOrderId);
loadId = carsOrder.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("###########updateWaybillOrderIsCustemer: 配载计划不存在 loadId={}",loadId);
return R.fail(405,"配载计划不存在");
}
baseMapper.updateWaybillOrderIsCustemer(carsOrderIdList, isCustomer);
//取消节点的签收单
cancleCustomerSignOrder(loadId, warehouseId);
carsLoadEntity.setIsCustomer("2");
updateById(carsLoadEntity);
//生成直发商家签收单
createCustomerSignOrder(loadId, warehouseId);
return R.success("更新成功");
}
@ -4648,6 +4699,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setScanStatus("3");
carsLoadScanEntity.setUnloadNum(enterNum);
carsLoadScanEntity.setUnloadAbnormal(0);
carsLoadScanEntity.setSignTime(date);
carsLoadScanEntity.setSignAbnormal(0);
carsLoadScanEntity.setSignUserName(AuthUtil.getNickName());
@ -4655,6 +4707,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadNodeId(warehouseId);
carsLoadScanEntity.setUnloadNodeName(warehouseEntity.getName());
carsLoadScanEntity.setUnloadCheck(0);
carsLoadScanEntity.setSignOrderId(signOrderId);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
//生成签收记录
@ -4665,7 +4719,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//重新计算签收单的数量
updateSignOrderNumBySignOrderId(signOrderId);
return R.success("签收成功");
return Resp.scanSuccess("签收成功",enterNum+"件");
}
@Override
@ -5093,6 +5147,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "车辆还未发车");
}
if(!"40".equals(loadStatus)){
log.warn("############signLoadScanByIds: 车辆还未到达 loadStatus={}", loadStatus);
return R.fail(405, "车辆还未到达");
}
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

@ -1,7 +1,9 @@
package com.logpm.warehouse.feign;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.warehouse.dto.ZeroOrderVO;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.service.IWarehouseTrayTypeService;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import lombok.AllArgsConstructor;
@ -140,5 +142,13 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
warehouseTrayTypeService.trayToNull(trayCode,remark);
}
@Override
public WarehouseTrayTypeEntity findTrayTypeEntity(String trayCode) {
QueryWrapper<WarehouseTrayTypeEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
return warehouseTrayTypeService.getOne(queryWrapper);
}
}

Loading…
Cancel
Save