Browse Source

1.干线-修复bug

2.补丁-新增修复totalNumber数据
chenglong
zhenghaoyu 1 year ago
parent
commit
15f181117f
  1. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java
  2. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCategoryClient.java
  3. 6
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataFreightClient.java
  4. 10
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataFreightApiVO.java
  5. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java
  6. 2
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java
  7. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java
  8. 6
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  9. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java
  10. 6
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java
  11. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/AdvanceDetailGoodsVO.java
  12. 8
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadScanVO.java
  13. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCategoryClient.java
  14. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataFreightClient.java
  15. 51
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  16. 29
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  17. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java
  18. 14
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml
  19. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java
  20. 5
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java
  21. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/InComingApiController.java
  22. 47
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  23. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  24. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  25. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  26. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  27. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  28. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  29. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  30. 94
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  31. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  32. 110
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  33. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java

@ -210,4 +210,7 @@ public class BasicdataClientEntity extends TenantEntity {
@ApiModelProperty(value = "默认付款方式 1现付 2到付 3月结 4回付 5内部结算 ")
private String defaultPaymentMethods;
@ApiModelProperty(value = "是否是新用户 0否 1是")
private Integer isNew;
}

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCategoryClient.java

@ -60,4 +60,7 @@ public interface IBasicdataCategoryClient {
@GetMapping(API_PREFIX+"/findListByName")
List<JSONObject> findListByName(@RequestParam String goodsName);
@GetMapping(API_PREFIX+"/findEntityById")
BasicdataCategoryEntity findEntityById(@RequestParam Long goodsId);
}

6
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataFreightClient.java

@ -23,6 +23,8 @@ import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@ -52,8 +54,8 @@ public interface IBasicdataFreightClient {
@GetMapping(TOP)
BladePage<BasicdataFreightEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(PRICE)
List<BasicdataFreightDetailEntity> pirce(BasicdataFreightApiVO param);
@PostMapping(PRICE)
List<BasicdataFreightDetailEntity> pirce(@RequestBody BasicdataFreightApiVO param);

10
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataFreightApiVO.java

@ -29,9 +29,9 @@ import java.io.Serializable;
@Data
public class BasicdataFreightApiVO implements Serializable {
private static final long serialVersionUID = 1L;
private String itemName;
private String category;
private String issueWarehouse;
private String destination;
private String arrivalWarehouse;
private String itemName;//收货单位
private String category;//货物名称
private String issueWarehouse;//发站仓
private String destination;//到站
private String arrivalWarehouse;//目的仓
}

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDTO.java

@ -4,6 +4,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
@ -27,6 +28,7 @@ public class AdvanceDTO implements Serializable {
//列表查询参数
private String orderCode;
private String dealerName;
private String dealerCode;
private String storeName;
private String siteName;
private String trainNumber;
@ -35,4 +37,10 @@ public class AdvanceDTO implements Serializable {
private Integer hasPackage;
private String startCreateTimeStr;
private String endCreateTimeStr;
private Date startCreateTime;
private Date endCreateTime;
}

2
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java

@ -12,7 +12,7 @@ public class InComingDTO implements Serializable {
private String orderPackageCode;//包件码
private Long warehouseId;//仓库id
private String warehouseName;//仓库
private Integer incomingType;//入库类型
private String trayCode;//托盘码

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java

@ -38,6 +38,7 @@ public class OpenOrderDTO implements Serializable {
private String consigneeMobile;//收货人电话
private String consigneeAddress;//收货地址
private String goodsName;//货物名称
private List<Long> goodsIds;
private List<WaybillDetailDTO> waybillDetailList = new ArrayList<>();

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

@ -36,6 +36,12 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
/** 仓库名称 */
@ApiModelProperty(name = "仓库名称",notes = "")
private String warehouseName ;
/** 仓库id */
@ApiModelProperty(name = "导入仓库id",notes = "")
private Long incomingWarehouseId ;
/** 仓库名称 */
@ApiModelProperty(name = "导入仓库名称",notes = "")
private String incomingWarehouseName ;
/** 暂存单id */
@ApiModelProperty(name = "暂存单id",notes = "")
private Long advanceId ;

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceEntity.java

@ -36,6 +36,14 @@ public class TrunklineAdvanceEntity extends TenantEntity {
/** 仓库名称 */
@ApiModelProperty(name = "仓库名称",notes = "")
private String warehouseName ;
/** 入库仓库id */
@ApiModelProperty(name = "入库仓库id",notes = "")
private Long incomingWarehouseId ;
/** 入库仓库名称 */
@ApiModelProperty(name = "入库仓库名称",notes = "")
private String incomingWarehouseName ;
/** 订单自编码 */
@ApiModelProperty(name = "订单自编码",notes = "")
private String orderCode ;

6
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java

@ -121,4 +121,10 @@ public class TrunklineCarsLoadScanEntity extends TenantEntity {
@ApiModelProperty(name = "签收单id",notes = "")
private Long signOrderId;
@ApiModelProperty(name = "装车人名称",notes = "")
private String loadingUserName;
@ApiModelProperty(name = "卸车人名称",notes = "")
private String unloadUserName;
}

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/AdvanceDetailGoodsVO.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.vo;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import java.io.Serializable;
@ -14,7 +15,10 @@ public class AdvanceDetailGoodsVO implements Serializable {
private String goodsName;//货物名称
private Integer num;//件数
private BigDecimal weight;//重量
private BigDecimal volume;//体积
private BigDecimal price = BigDecimal.ZERO;//单价
private BigDecimal volume;//体积
private JSONArray arrPirce;
}

8
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadScanVO.java

@ -0,0 +1,8 @@
package com.logpm.trunkline.vo;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import lombok.Data;
@Data
public class TrunklineCarsLoadScanVO extends TrunklineCarsLoadScanEntity {
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCategoryClient.java

@ -77,4 +77,10 @@ public class BasicdataCategoryClient implements IBasicdataCategoryClient {
return basicdataCategoryService.findListByName(goodsName);
}
@Override
public BasicdataCategoryEntity findEntityById(Long goodsId) {
BasicdataCategoryEntity categoryEntity = basicdataCategoryService.getById(goodsId);
return categoryEntity;
}
}

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataFreightClient.java

@ -59,7 +59,6 @@ public class BasicdataFreightClient implements IBasicdataFreightClient {
}
@Override
@GetMapping(PRICE)
public List<BasicdataFreightDetailEntity> pirce(BasicdataFreightApiVO param) {
QueryWrapper<BasicdataFreightEntity> queryWrapper1 = new QueryWrapper();
queryWrapper1.eq("item_name", param.getItemName()).like("category", param.getCategory()).eq("is_deleted",0);

51
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -1339,30 +1339,6 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
Set<String> waybillNoSet = new TreeSet<>();
for (DistributionParcelListEntity parcelListEntity : list) {
incomingNum = incomingNum + 1;
String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
String orderPackageReservationStatus = parcelListEntity.getOrderPackageReservationStatus();
String orderPackageGroundingStatus = parcelListEntity.getOrderPackageGroundingStatus();
String waybillNumber = parcelListEntity.getWaybillNumber();
if(StringUtils.isNotBlank(waybillNumber)){
waybillNoSet.add(parcelListEntity.getWaybillNumber());
}
if("20".equals(orderPackageGroundingStatus)){
groundingNum = groundingNum + 1;
}
if("20".equals(orderPackageReservationStatus)){
reservationNum = reservationNum + 1;
}
if(!"60".equals(orderPackageStatus) && !"70".equals(orderPackageStatus)){
handleNum = handleNum + 1;
}else if ("60".equals(orderPackageStatus)){
outNum = outNum +1;
}else if ("70".equals(orderPackageStatus)){
signNum = signNum + 1;
}
Date warehouseEntryTimeEnd = parcelListEntity.getWarehouseEntryTimeEnd();
if(Objects.isNull(warehouseEntryTimeEnd)){
warehouseEntryTimeEnd = parcelListEntity.getCreateTime();
@ -1384,6 +1360,33 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
lastEntryTime = time;
}
}
Integer conditions = parcelListEntity.getConditions();
if(conditions.equals(1)){
String orderPackageStatus = parcelListEntity.getOrderPackageStatus();
String orderPackageReservationStatus = parcelListEntity.getOrderPackageReservationStatus();
String orderPackageGroundingStatus = parcelListEntity.getOrderPackageGroundingStatus();
String waybillNumber = parcelListEntity.getWaybillNumber();
if(StringUtils.isNotBlank(waybillNumber)){
waybillNoSet.add(parcelListEntity.getWaybillNumber());
}
if("20".equals(orderPackageGroundingStatus)){
groundingNum = groundingNum + 1;
}
if("20".equals(orderPackageReservationStatus)){
reservationNum = reservationNum + 1;
}
if(!"60".equals(orderPackageStatus) && !"70".equals(orderPackageStatus)){
handleNum = handleNum + 1;
}else if ("60".equals(orderPackageStatus)){
outNum = outNum +1;
}else if ("70".equals(orderPackageStatus)){
signNum = signNum + 1;
}
}
}
String orderWaybillNo = null;

29
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -4,6 +4,7 @@ import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.entity.AdvanceEntity;
@ -601,5 +602,33 @@ public class SyncOrderInfoToPlatform {
}
@XxlJob("repairOrderTotalNum")
public ReturnT<String> repairOrderTotalNum(String param) {
log.info("############repairOrderTotalNum: 修复订单totalNumber");
List<JSONObject> ls = warehouseMappingDataService.findAllOrderCode();
for (JSONObject jsonObject : ls) {
String orderCode = jsonObject.getStr("orderCode");
Long warehouseId = jsonObject.getLong("warehouseId");
Integer total = 0;
List<AdvanceEntity> advanceList = advanceClient.getAdvanceList(orderCode);
for (AdvanceEntity advanceEntity : advanceList) {
total = total + advanceEntity.getTotal();
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(!Objects.isNull(stockArticleEntity)){
stockArticleEntity.setTotalNumber(total);
distributionStockArticleClient.saveOrUpdate(stockArticleEntity);
distributionStockArticleClient.updateOrderInfo(orderCode,warehouseId);
}
}
return ReturnT.SUCCESS;
}
}

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java

@ -50,4 +50,6 @@ public interface WarehouseMappingDataMapper {
List<JSONObject> findTotalCountByWarehouseId(@Param("newWarehouseId") Long newWarehouseId);
void updatePackageStatus(@Param("packageStatuss") String packageStatuss, @Param("packageId") Long packageId);
List<JSONObject> findAllOrderCode();
}

14
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml

@ -148,4 +148,18 @@
where id = #{packageId}
</update>
<select id="findAllOrderCode" resultType="cn.hutool.json.JSONObject">
select ldsa.total_number totalNumber,
ldsa.order_code orderCode,
ldsa.warehouse_id warehouseId,
count(ldpl.id) num
from logpm_distribution_stock_article ldsa
left join logpm_distribution_parcel_list ldpl on ldpl.order_code = ldsa.order_code
where ldsa.order_code is not null
and ldsa.order_code != ''
group by ldsa.total_number,
ldsa.order_code,ldsa.warehouse_id
HAVING count(ldpl.id) != ldsa.total_number
</select>
</mapper>

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

@ -46,4 +46,6 @@ public interface IWarehouseMappingDataService {
List<JSONObject> findTotalCountByWarehouseId(Long newWarehouseId);
void updatePackageStatus(String packageStatuss, Long packageId);
List<JSONObject> findAllOrderCode();
}

5
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java

@ -116,4 +116,9 @@ public class WarehouseMappingDataServiceImpl implements IWarehouseMappingDataSer
public void updatePackageStatus(String packageStatuss, Long packageId) {
warehouseMappingDataMapper.updatePackageStatus(packageStatuss,packageId);
}
@Override
public List<JSONObject> findAllOrderCode() {
return warehouseMappingDataMapper.findAllOrderCode();
}
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/InComingApiController.java

@ -48,7 +48,7 @@ public class InComingApiController {
return R.fail(403,"仓库信息为空");
}
inComingDTO.setWarehouseId(myCurrentWarehouse.getId());
inComingDTO.setWarehouseName(myCurrentWarehouse.getName());
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包件码不能为空");

47
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -1402,4 +1402,51 @@ public class OpenOrderController {
}
}
@ResponseBody
@PostMapping("/findArrPrice")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询货物价格", notes = "传入openOrderDTO")
public R findArrPrice(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############findCategoryInfo: ";
log.info(method + "请求参数{}", openOrderDTO);
Long consigneeId = openOrderDTO.getConsigneeId();
Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId();
Long destinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
String destinationCode = openOrderDTO.getDestinationCode();
List<Long> goodsIds = openOrderDTO.getGoodsIds();
try{
if(Objects.isNull(consigneeId)){
log.warn(method+"收货单位id为空 consigneeId={}",consigneeId);
return R.fail(405,"收货单位id为空");
}
if(Objects.isNull(departureWarehouseId)){
log.warn(method+"发站仓id为空 departureWarehouseId={}",departureWarehouseId);
return R.fail(405,"发站仓id为空");
}
if(Objects.isNull(destinationWarehouseId)){
log.warn(method+"目的仓id为空 destinationWarehouseId={}",destinationWarehouseId);
return R.fail(405,"目的仓id为空");
}
if(StringUtil.isBlank(destinationCode)){
log.warn(method+"到站编码为空 destinationCode={}",destinationCode);
return R.fail(405,"到站编码为空");
}
if(goodsIds.isEmpty()){
log.warn(method+"货物id为空 goodsIds={}",goodsIds);
return R.fail(405,"货物id为空");
}
return openOrderService.findArrPrice(openOrderDTO);
}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,"系统异常");
}
}
}

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

@ -16,7 +16,7 @@ import java.util.List;
@Mapper
public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(@Param("packageStatus") String packageStatus, @Param("advanceDetailId") Long advanceDetailId);
void updatePackageStatusById(@Param("packageStatus") String packageStatus, @Param("advanceDetailId") Long advanceDetailId, @Param("warehouseId") Long warehouseId,@Param("warehouseName") String warehouseName);
List<TrunklineAdvanceDetailVO> findList(@Param("advanceId") Long advanceId);

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

@ -5,7 +5,9 @@
<update id="updatePackageStatusById">
update logpm_trunkline_advance_detail
set package_status = #{packageStatus}
set package_status = #{packageStatus},
incoming_warehouse_id = #{warehouseId},
incoming_warehouse_name = #{warehouseName}
where id = #{advanceDetailId}
</update>

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -26,6 +26,9 @@
<if test="param.orderCode != null and param.orderCode != ''">
and lta.order_code like concat('%',#{param.orderCode},'%')
</if>
<if test="param.dealerCode != null and param.dealerCode != ''">
and lta.dealer_code like concat('%',#{param.dealerCode},'%')
</if>
<if test="param.dealerName != null and param.dealerName != ''">
and lta.dealer_name like concat('%',#{param.dealerName},'%')
</if>
@ -53,6 +56,13 @@
<if test="param.customerAddress != null and param.customerAddress != ''">
and lta.customer_address like concat('%',#{param.customerAddress},'%')
</if>
<if test="param.startCreateTime != null">
and lta.create_time &gt;= #{param.startCreateTime}
</if>
<if test="param.endCreateTime != null">
and lta.create_time &lt;= #{param.endCreateTime}
</if>
order by lta.create_time desc
</select>
<select id="findListByIds" resultType="com.logpm.trunkline.entity.TrunklineAdvanceEntity">

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -83,6 +83,7 @@
select *
from logpm_trunkline_cars_load_scan
where load_id = #{param.loadId}
</select>
<select id="findCarsLoadingOrderDetail" resultType="com.logpm.trunkline.vo.OrderScanDetailVO">

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

@ -71,6 +71,7 @@ public interface IOpenOrderService {
R findCategoryInfo(String goodsName);
R findArrPrice(OpenOrderDTO openOrderDTO);
// R findWaybillInfo(String waybillNo);

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

@ -16,7 +16,7 @@ import java.util.Map;
public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(String packageStatus, Long advanceDetailId);
void updatePackageStatusById(String packageStatus, Long advanceDetailId,Long warehouseId,String warehouseName);
TrunklineAdvanceDetailEntity findEntityByOrderPackageCodeAndWarehouseId(String orderPackageCode, Long warehouseId);

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

@ -34,6 +34,7 @@ public class InComingServiceImpl implements IInComingService {
public R incomingPackage(InComingDTO inComingDTO) {
String orderPackageCode = inComingDTO.getOrderPackageCode();//包件码
Long warehouseId = inComingDTO.getWarehouseId();//仓库id
String warehouseName = inComingDTO.getWarehouseName();
Long billladingId = inComingDTO.getBillladingId();//提货单id
Integer incomingType = inComingDTO.getIncomingType();//入库类型
String trayCode = inComingDTO.getTrayCode();//托盘码
@ -60,7 +61,7 @@ public class InComingServiceImpl implements IInComingService {
}
//1.修改暂存单包件入库状态
advanceDetailService.updatePackageStatusById("1",advanceDetailId);
advanceDetailService.updatePackageStatusById("1",advanceDetailId,warehouseId,warehouseName);
//2.判断包件和订单是否已经存入在库订单
boolean b = advanceService.saveOrderAndPackage(advanceDetailEntity, warehouseId);

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

@ -1,6 +1,8 @@
package com.logpm.trunkline.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -9,6 +11,7 @@ import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.feign.*;
import com.logpm.basicdata.vo.BasicdataFreightApiVO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
@ -75,6 +78,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
private final IBasicMaterialClient basicMaterialClient;
private final IBasicdataBrandClient basicdataBrandClient;
private final IBasicdataForwardingUnitClient basicdataForwardingUnitClient;
private final IBasicdataFreightClient basicdataFreightClient;
@Override
public IPage<TrunklineAdvanceVO> advancePageList(AdvanceDTO advanceDTO) {
@ -185,16 +189,31 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//组装货物数据
List<AdvanceDetailGoodsVO> goodsList = advanceDetailService.findGoodsListByAdvanceIds(advanceIds);
//因为这个时候还没有到站信息,所有无法去匹配一个该商场的货物单价
// for (AdvanceDetailGoodsVO advanceDetailGoodsVO:goodsList){
// String goodsName = advanceDetailGoodsVO.getGoodsName();
// if(!Objects.isNull(basicdataClientEntity)){
// //TODO 这里要根据商场信息和物品名称去匹配一个预设单价
// advanceDetailGoodsVO.setPrice(BigDecimal.ZERO);
// }else{
// //因为没有
// }
// }
BasicdataFreightApiVO basicdataFreightApiVO = new BasicdataFreightApiVO();
basicdataFreightApiVO.setItemName(openOrderVO.getConsigneeClientId()+"");
basicdataFreightApiVO.setIssueWarehouse(openOrderVO.getDepartureWarehouseId()+"");
basicdataFreightApiVO.setDestination(openOrderVO.getDestinationCode());
basicdataFreightApiVO.setArrivalWarehouse(openOrderVO.getDestinationWarehouseId()+"");
for (AdvanceDetailGoodsVO advanceDetailGoodsVO : goodsList) {
String goodsName = advanceDetailGoodsVO.getGoodsName();
BasicdataCategoryEntity basicdataCategoryEntity = basicdataCategoryClient.findByName(goodsName);
Long goodsId = null;
if(Objects.isNull(basicdataCategoryEntity)){
basicdataCategoryEntity = new BasicdataCategoryEntity();
basicdataCategoryEntity.setType(1);
basicdataCategoryEntity.setName(goodsName);
goodsId = basicdataCategoryClient.addReturnId(basicdataCategoryEntity);
}else{
goodsId = basicdataCategoryEntity.getId();
}
advanceDetailGoodsVO.setGoodsId(goodsId);
basicdataFreightApiVO.setCategory(goodsId+"");
List<BasicdataFreightDetailEntity> pirceList = basicdataFreightClient.pirce(basicdataFreightApiVO);
JSONArray price= JSONArray.parseArray(JSON.toJSONString(pirceList));
advanceDetailGoodsVO.setArrPirce(price);
}
openOrderVO.setGoodsList(goodsList);
//查询支付方式
@ -428,7 +447,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<TrunklineAdvanceDetailVO> list = advanceDetailService.findList(advanceEntity.getId());
trunklineWaybillPackageService.saveList(list,waybillEntity);
distributionParcelListClient.updateEntityByOpenOrder(advanceId,warehouseId,waybillId);
// orderCodes.add(advanceEntity.getOrderCode());
orderCodes.add(advanceEntity.getOrderCode());
advanceEntity.setWaybillStatus("1");
advanceEntity.setWaybillNo(waybillEntity.getWaybillNo());
}
@ -441,10 +460,22 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
// isTransfer = 0;
// }
// for (String orderCode : orderCodes) {
// distributionParcelListClient.updateTransferStatus(orderCode,warehouseId,isTransfer);
// }
for (String orderCode : orderCodes) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(!Objects.isNull(stockArticleEntity)){
stockArticleEntity.setConsigneeUnit(openOrderDTO.getConsignee());
stockArticleEntity.setConsigneePerson(openOrderDTO.getConsigneeName());
stockArticleEntity.setConsigneeMobile(openOrderDTO.getConsigneeMobile());
stockArticleEntity.setConsigneeAddress(openOrderDTO.getConsigneeAddress());
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(consigneeId);
if(Objects.isNull(basicdataClientEntity)){
stockArticleEntity.setMallId(consigneeId);
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
stockArticleEntity.setMallName(basicdataClientEntity.getClientName());
}
distributionStockArticleClient.saveOrUpdate(stockArticleEntity);
}
}
//计算扫码入库的包件是否需要把运单和提货单挂上
List<BillladingPackageVO> billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds);
@ -537,6 +568,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
return R.fail(405,"仓库信息不存在");
}
String warehouseCode = basicdataWarehouseEntity.getWarehouseCode();
String name = basicdataWarehouseEntity.getName();
//如果运单号为空则自动生成运单号
if(StringUtil.isBlank(waybillNo)){
@ -2028,6 +2060,37 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
return R.data(ls);
}
@Override
public R findArrPrice(OpenOrderDTO openOrderDTO) {
Long consigneeId = openOrderDTO.getConsigneeId();
Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId();
Long destinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
String destinationCode = openOrderDTO.getDestinationCode();
List<Long> goodsIds = openOrderDTO.getGoodsIds();
List<Map<String,Object>> ls = new ArrayList<>();
for (Long goodsId : goodsIds) {
BasicdataCategoryEntity categoryEntity = basicdataCategoryClient.findEntityById(goodsId);
if(!Objects.isNull(categoryEntity)){
Map<String,Object> map = new HashMap<>();
map.put("goodsId",goodsId);
map.put("goodsName",categoryEntity.getName());
BasicdataFreightApiVO basicdataFreightApiVO = new BasicdataFreightApiVO();
basicdataFreightApiVO.setItemName(consigneeId+"");
basicdataFreightApiVO.setIssueWarehouse(departureWarehouseId+"");
basicdataFreightApiVO.setDestination(destinationCode);
basicdataFreightApiVO.setArrivalWarehouse(destinationWarehouseId+"");
basicdataFreightApiVO.setCategory(goodsId+"");
List<BasicdataFreightDetailEntity> pirceList = basicdataFreightClient.pirce(basicdataFreightApiVO);
JSONArray price= JSONArray.parseArray(JSON.toJSONString(pirceList));
map.put("arrPrice",price);
ls.add(map);
}
}
return R.data(ls);
}
private String verifyData(OpenOrderDTO openOrderDTO, WarehouseWaybillEntity waybillEntity) {
log.info("###################verifyData: 验证改单数据");
StringBuilder stringBuilder = new StringBuilder();
@ -2805,6 +2868,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
basicdataClientEntity.setLinkman(linkman);
basicdataClientEntity.setPhone(linkPhone);
basicdataClientEntity.setDetailedly(linkAddress);
basicdataClientEntity.setIsNew(1);
return basicdataClientClient.addReturnId(basicdataClientEntity);
}

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

@ -46,8 +46,8 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
private final TrunklineAdvanceMapper advanceMapper;
@Override
public void updatePackageStatusById(String packageStatus, Long advanceDetailId) {
baseMapper.updatePackageStatusById(packageStatus,advanceDetailId);
public void updatePackageStatusById(String packageStatus, Long advanceDetailId,Long warehouseId,String warehouseName) {
baseMapper.updatePackageStatusById(packageStatus,advanceDetailId,warehouseId,warehouseName);
}
@Override

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

@ -29,7 +29,9 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
@ -79,6 +81,11 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
throw new CustomerException(405,"暂存单信息不存在");
}
Long userId = AuthUtil.getUserId();
String deptIds = AuthUtil.getDeptId();
String[] split = deptIds.split(",");
Long deptId = Long.parseLong(split[0]);
//2.查询订单信息
int total = baseMapper.getAllTotalNum(orderCode);
@ -88,11 +95,15 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
if(Objects.isNull(stockArticleEntity)){
log.info("#############saveOrderAndPackage: 订单信息为空,同步订单信息");
//订单信息为空
String waybillNo = advanceEntity.getWaybillNo();
stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setCreateUser(userId);
stockArticleEntity.setUpdateUser(userId);
stockArticleEntity.setCreateDept(deptId);
stockArticleEntity.setOrderCode(orderCode);
stockArticleEntity.setServiceNumber(advanceEntity.getServiceNum());
stockArticleEntity.setWaybillNumber(advanceEntity.getWaybillNo());
stockArticleEntity.setWaybillNumber(waybillNo);
stockArticleEntity.setTotalNumber(total);
stockArticleEntity.setHandQuantity(0);
stockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
@ -109,42 +120,69 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
stockArticleEntity.setTypeService("1");//默认商配
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, advanceEntity.getBrand());
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if(!Objects.isNull(basicdataClientEntity)){
String clientType = basicdataClientEntity.getClientType();
if("5".equals(clientType)){
stockArticleEntity.setStoreId(basicdataClientEntity.getId());
stockArticleEntity.setStoreCode(basicdataClientEntity.getClientCode());
stockArticleEntity.setStoreName(basicdataClientEntity.getClientName());
//查询门店的父级商场
Long pid = basicdataClientEntity.getPid();
BasicdataClientEntity pidEntity = basicdataClientClient.findEntityById(pid);
if(!Objects.isNull(pidEntity)){
String pidEntityClientType = pidEntity.getClientType();
if("2".equals(pidEntityClientType)){
//商城
stockArticleEntity.setMallId(pidEntity.getId());
stockArticleEntity.setMallName(pidEntity.getClientName());
stockArticleEntity.setMallCode(pidEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(pidEntity.getId(), 3);
if(Objects.isNull(basicdataStoreBusinessEntity)){
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
}
}else if("2".equals(clientType)){
//商城
stockArticleEntity.setMallId(basicdataClientEntity.getId());
stockArticleEntity.setMallName(basicdataClientEntity.getClientName());
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
if(!StringUtil.isBlank(waybillNo)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(!Objects.isNull(waybillEntity)){
Long consigneeId = waybillEntity.getConsigneeId();
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(basicdataClientEntity.getId(), 3);
BasicdataClientEntity clientEntity = basicdataClientClient.findEntityById(consigneeId);
if(!Objects.isNull(clientEntity)){
stockArticleEntity.setMallId(clientEntity.getId());
stockArticleEntity.setMallName(clientEntity.getClientName());
stockArticleEntity.setMallCode(clientEntity.getClientCode());
}
String consignee = waybillEntity.getConsignee();
String consigneeName = waybillEntity.getConsigneeName();
String consigneeMobile = waybillEntity.getConsigneeMobile();
String consigneeAddress = waybillEntity.getConsigneeAddress();
stockArticleEntity.setConsigneeUnit(consignee);
stockArticleEntity.setConsigneePerson(consigneeName);
stockArticleEntity.setConsigneeMobile(consigneeMobile);
stockArticleEntity.setConsigneeAddress(consigneeAddress);
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(consigneeId, 3);
if(Objects.isNull(basicdataStoreBusinessEntity)){
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
}else{
Long clientId = basicdataTripartiteMallClient.getClientIdByNameAndBrand(dealerName, advanceEntity.getBrand());
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findEntityById(clientId);
if(!Objects.isNull(basicdataClientEntity)){
String clientType = basicdataClientEntity.getClientType();
if("5".equals(clientType)){
stockArticleEntity.setStoreId(basicdataClientEntity.getId());
stockArticleEntity.setStoreCode(basicdataClientEntity.getClientCode());
stockArticleEntity.setStoreName(basicdataClientEntity.getClientName());
//查询门店的父级商场
Long pid = basicdataClientEntity.getPid();
BasicdataClientEntity pidEntity = basicdataClientClient.findEntityById(pid);
if(!Objects.isNull(pidEntity)){
String pidEntityClientType = pidEntity.getClientType();
if("2".equals(pidEntityClientType)){
//商城
stockArticleEntity.setMallId(pidEntity.getId());
stockArticleEntity.setMallName(pidEntity.getClientName());
stockArticleEntity.setMallCode(pidEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(pidEntity.getId(), 3);
if(Objects.isNull(basicdataStoreBusinessEntity)){
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
}
}else if("2".equals(clientType)){
//商城
stockArticleEntity.setMallId(basicdataClientEntity.getId());
stockArticleEntity.setMallName(basicdataClientEntity.getClientName());
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(basicdataClientEntity.getId(), 3);
if(Objects.isNull(basicdataStoreBusinessEntity)){
stockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold());
}
}
}
}
stockArticleEntity.setCustomerName(advanceEntity.getCustomerName());
@ -178,6 +216,9 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
//保存包件信息
DistributionParcelListEntity parcelList = new DistributionParcelListEntity();
parcelList.setCreateUser(userId);
parcelList.setUpdateUser(userId);
parcelList.setCreateDept(deptId);
parcelList.setWarehouse(warehouseEntity.getName());
parcelList.setWarehouseId(warehouseId);
String waybillNo = advanceEntity.getWaybillNo();
@ -270,10 +311,15 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
@Override
public IPage<TrunklineAdvanceVO> advancePageList(IPage<Object> page, AdvanceDTO advanceDTO) {
advanceDTO.setStartCreateTime(CommonUtil.getStartByDateStr(advanceDTO.getStartCreateTimeStr()));
advanceDTO.setEndCreateTime(CommonUtil.getEndByDateStr(advanceDTO.getEndCreateTimeStr()));
IPage<TrunklineAdvanceVO> trunklineAdvanceVOIPage = baseMapper.advancePageList(page, advanceDTO);
List<TrunklineAdvanceVO> records = trunklineAdvanceVOIPage.getRecords();
for (TrunklineAdvanceVO trunklineAdvanceVO:records){
String dealerName = trunklineAdvanceVO.getDealerName();
String brand = trunklineAdvanceVO.getBrand();
Long clientId = tripartiteMallClient.getClientIdByNameAndBrand(dealerName, brand);

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

@ -1852,6 +1852,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
updownTypeClient.downPackageOrDelTray(orderPackageCode,warehouseId);
}
}
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanService.save(carsLoadScanEntity);
loadScanId = carsLoadScanEntity.getId();
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId,warehouseName,loadId,loadCode,waybillId,waybillNo,orderCode,orderPackageCode,1,
@ -1987,6 +1988,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setFromWarehouseId(warehouseId);
carsLoadScanEntity.setFinalNodeId(finalNodeId);
carsLoadScanEntity.setFinalNodeName(finalNodeName);
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanService.save(carsLoadScanEntity);
loadScanId = carsLoadScanEntity.getId();
difficult = enterNum;
@ -3718,6 +3720,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
trunklineCarsLoadScanEntity.setUnloadNum(1);
trunklineCarsLoadScanEntity.setIsSupple(0);
trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
Long loadScanId = trunklineCarsLoadScanEntity.getId();
@ -3766,6 +3770,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
trunklineCarsLoadScanEntity.setUnloadNodeName(warehouseName);
trunklineCarsLoadScanEntity.setUnloadNum(1);
trunklineCarsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
Long loadScanId = trunklineCarsLoadScanEntity.getId();
@ -4036,6 +4042,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNodeName(warehouseName);
carsLoadScanEntity.setUnloadAbnormal(0);
carsLoadScanEntity.setScanStatus("2");
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId,warehouseName,loadId,loadCode,waybillId,waybillNo,orderCode,

Loading…
Cancel
Save