Browse Source

Merge branch 'dev' into test

test
pref_mail@163.com 2 years ago
parent
commit
ff9990a8fa
  1. 100
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelDetailsEntity.java
  2. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  3. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java
  4. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java
  5. 49
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelDetailsClient.java
  6. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  7. 35
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelDetailsVO.java
  8. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java
  9. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  10. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java
  11. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml
  12. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java
  13. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  14. 36
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  15. 150
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelDetailsController.java
  16. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  17. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  18. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  19. 34
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionParcelDetailsDTO.java
  20. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingackDTO.java
  21. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java
  22. 129
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionParcelDetailsExcel.java
  23. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelDetailsClient.java
  24. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  25. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  26. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  27. 112
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  28. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java
  29. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml
  30. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelDetailsMapper.java
  31. 40
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelDetailsMapper.xml
  32. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  33. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  34. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  35. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  36. 52
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelDetailsService.java
  37. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  38. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  39. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  40. 92
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  41. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelDetailsServiceImpl.java
  42. 156
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  43. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  44. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  45. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  46. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtOrderStatusDTO.java
  47. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java
  48. 28
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  49. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  50. 27
      blade-service/logpm-factory/src/main/resources/application-dev.yml
  51. 27
      blade-service/logpm-factory/src/main/resources/application.yml
  52. 4
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceDetailClient.java
  53. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java
  54. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IServiceNumService.java
  55. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java
  56. 514
      doc/dpm/物流租户系统.pdma.json

100
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelDetailsEntity.java

@ -0,0 +1,100 @@
/*
* 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.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* 包件清单详情 实体类
*
* @author cyz
* @since 2023-06-30
*/
@Data
@TableName("logpm_distribution_parcel_details")
@ApiModel(value = "DistributionParcelDetails对象", description = "包件清单详情")
@EqualsAndHashCode(callSuper = true)
public class DistributionParcelDetailsEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 包件清单id
*/
@ApiModelProperty(value = "包件清单id")
private String parcelListId;
/**
* 订单ID
*/
@ApiModelProperty(value = "订单ID")
private String stockArticleId;
/**
* 包件码
*/
@ApiModelProperty(value = "包件码")
private String packageCode;
/**
* 编码
*/
@ApiModelProperty(value = "编码")
private String encoded;
/**
* 名称
*/
@ApiModelProperty(value = "名称")
private String name;
/**
* 尺寸
*/
@ApiModelProperty(value = "尺寸")
private String dimensions;
/**
* 数量
*/
@ApiModelProperty(value = "数量")
private Integer number;
}

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java

@ -130,6 +130,12 @@ public class DistributionReservationEntity extends TenantEntity {
@ApiModelProperty(value = "时段;1-上午、2-下午、3-全天")
private String periodOfTime;
/**
* 预约数量
*/
@ApiModelProperty(value = "预约数量")
private Integer reservationNum;
/**
* 费用汇总
*/

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java

@ -186,8 +186,6 @@ public class DistributionStockArticleEntity extends TenantEntity {
*/
@ApiModelProperty(value = "老系统advanceId")
private Integer advanceId;
/**
* 预约数量
*/
@ -205,7 +203,7 @@ public class DistributionStockArticleEntity extends TenantEntity {
@ApiModelProperty(value = "收货单位")
private Integer consigneeUnit;
/**
* 预约数量
* 到付费用
*/
@ApiModelProperty(value = "到付费用")
private BigDecimal collectFee;

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java

@ -127,6 +127,11 @@ public class DistributionStockListEntity extends TenantEntity {
*/
@ApiModelProperty(value = "商城名称")
private String mallName;
/**
* 拆包
*/
@ApiModelProperty(value = "拆包")
private Boolean unpack;
/**
* 库存数量
*/

49
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelDetailsClient.java

@ -0,0 +1,49 @@
/*
* 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.distribution.feign;
import org.springblade.core.mp.support.BladePage;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 包件清单详情 Feign接口类
*
* @author cyz
* @since 2023-06-30
*/
@FeignClient(
value = "blade-distributionParcelDetails"
)
public interface IDistributionParcelDetailsClient {
String API_PREFIX = "/client";
String TOP = API_PREFIX + "/top";
/**
* 获取包件清单详情列表
*
* @param current 页号
* @param size 页数
* @return BladePage
*/
@GetMapping(TOP)
BladePage<DistributionParcelDetailsEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

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

@ -56,5 +56,8 @@ public interface IDistributionStockArticleClient {
DistributionStockArticleEntity findByAdvanceId(@RequestParam Integer advanceId);
@PostMapping(API_PREFIX + "/saveOrUpdate")
void saveOrUpdate(DistributionStockArticleEntity distributionStockArticleEntity);
void saveOrUpdate(@RequestBody DistributionStockArticleEntity distributionStockArticleEntity);
@GetMapping(API_PREFIX + "/addHandQuantity")
void addHandQuantity(@RequestParam("id") Long id,@RequestParam("num") int num);
}

35
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelDetailsVO.java

@ -0,0 +1,35 @@
/*
* 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.distribution.vo;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 包件清单详情 视图实体类
*
* @author cyz
* @since 2023-06-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionParcelDetailsVO extends DistributionParcelDetailsEntity {
private static final long serialVersionUID = 1L;
}

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java

@ -58,4 +58,7 @@ public interface IServiceNumClient {
@GetMapping(API_PREFIX + "/findByserviceNum")
ServiceNumEntity findByserviceNum(@RequestParam String sn);
@PostMapping(API_PREFIX + "/update")
void updateServiceNum(@RequestBody ServiceNumEntity serviceNum);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

@ -162,7 +162,7 @@ public class BasicdataWarehouseController extends BladeController {
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam List<String> ids) {
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
boolean result = warehouseService.removeWarehouse(ids);
if (result){
return R.status(result);

15
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java

@ -52,9 +52,17 @@ public interface BasicdataWarehouseMapper extends BaseMapper<BasicdataWarehouseE
*/
List<BasicdataWarehouseExcel> exportWarehouseWarehouse(@Param("ew") Wrapper<BasicdataWarehouseEntity> queryWrapper);
/**
* 获取仓库下的货区信息
* @return
*/
List<BasicdataWarehouseVO> getWarehouseAndGoodsAreaInfo();
/**
* 获取所有仓库列表
* @return
*/
List<BasicdataWarehouseVO> getWarehouseList();
@ -65,6 +73,11 @@ public interface BasicdataWarehouseMapper extends BaseMapper<BasicdataWarehouseE
*/
List<BasicdataWarehouseVO> selectWarehouseWarehouseDictionary();
Integer removeWarehouse(String id);
/**
* 删除仓库
* @param id
* @return
*/
Integer removeWarehouse(Long id);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml

@ -53,12 +53,12 @@
<!-- <result column="manage_code" property="manageCode"/>-->
<result column="payment_code_url" property="paymentCodeUrl"/>
</resultMap>
<!-- AND NOT EXISTS (SELECT f.id FROM logpm_basic_team_group f WHERE f.belong_to=#{id} AND f.is_deleted = 0 )-->
<update id="removeWarehouse">
UPDATE logpm_warehouse_warehouse
SET is_deleted = 1
WHERE
NOT EXISTS ( SELECT b.id FROM logpm_warehouse_goods_area b WHERE b.warehouse_id = #{id} AND b.is_deleted = 0)
AND NOT EXISTS (SELECT f.id FROM logpm_basic_team_group f WHERE f.belong_to=#{id} AND f.is_deleted = 0 )
AND id = #{id}
</update>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java

@ -71,7 +71,7 @@ public interface IBasicdataWarehouseService extends BaseService<BasicdataWarehou
* @param ids
* @return
*/
boolean removeWarehouse(List<String> ids);
boolean removeWarehouse(String ids);
/**
*

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -81,19 +81,21 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override
@Transactional
public boolean removeWarehouse(List<String> ids) {
public boolean removeWarehouse(String ids) {
// //仓库涉及众多表,取消批量删除,这里只针对仓库下是否存在有托盘、货区、班组等下级资源
if (Func.isEmpty(ids)){
log.error("传入参数异常["+ids+"]");
return false;
}
List<Long> longs = Func.toLongList(ids);
boolean result = false;
for (String id : ids) {
for (Long id : longs) {
result = SqlHelper.retBool(warehouseMapper.removeWarehouse(id));
if (!result){
return result;
}
}
return result;
}

36
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -123,9 +123,19 @@ public class DistributionDeliveryListController extends BladeController {
@PostMapping("/loadingscan")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<Integer> loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
Integer i = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
return R.data(i);
public R loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
return msg;
}
/**
* 配送管理 装车扫描(一件装车)
*/
@GetMapping("/oneloading")
@ApiOperationSupport(order = 2)
public R oneloading() {
R msg = distributionDeliveryListService.oneloading();
return msg;
}
/**
@ -134,18 +144,28 @@ public class DistributionDeliveryListController extends BladeController {
@PostMapping("/loadingack")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<Integer> loadingack(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
Integer i = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
return R.data(i);
public R<String> loadingack(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.loadingack(distrilbutionloadingscanDTO);
return msg;
}
/**
* 配送管理 装车确认(一键确认)
*/
@GetMapping("/oneack")
@ApiOperationSupport(order = 2)
public R oneack() {
R msg = distributionDeliveryListService.oneack();
return msg;
}
/**
* 配送管理 点击发车
*/
@GetMapping("/start")
@PostMapping("/start")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionDeliveryList")
public R<Integer> start(DistributionDeliveryListDTO distributionDeliveryList) {
public R<Integer> start(@Valid @RequestBody DistributionDeliveryListDTO distributionDeliveryList) {
Integer i = distributionDeliveryListService.start(distributionDeliveryList);
return R.data(i);
}

150
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelDetailsController.java

@ -0,0 +1,150 @@
/*
* 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.distribution.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import com.logpm.distribution.vo.DistributionParcelDetailsVO;
import com.logpm.distribution.excel.DistributionParcelDetailsExcel;
import com.logpm.distribution.service.IDistributionParcelDetailsService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
/**
* 包件清单详情 控制器
*
* @author cyz
* @since 2023-06-30
*/
@RestController
@AllArgsConstructor
@RequestMapping("/distributionParcelDetails")
@Api(value = "包件清单详情", tags = "包件清单详情接口")
public class DistributionParcelDetailsController extends BladeController {
private final IDistributionParcelDetailsService distributionParcelDetailsService;
/**
* 包件清单详情 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distributionParcelDetails")
public R<DistributionParcelDetailsEntity> detail(DistributionParcelDetailsEntity distributionParcelDetails) {
DistributionParcelDetailsEntity detail = distributionParcelDetailsService.getOne(Condition.getQueryWrapper(distributionParcelDetails));
return R.data(detail);
}
/**
* 包件清单详情 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionParcelDetails")
public R<IPage<DistributionParcelDetailsEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distributionParcelDetails, Query query) {
IPage<DistributionParcelDetailsEntity> pages = distributionParcelDetailsService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionParcelDetails, DistributionParcelDetailsEntity.class));
return R.data(pages);
}
/**
* 包件清单详情 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入distributionParcelDetails")
public R<IPage<DistributionParcelDetailsVO>> page(DistributionParcelDetailsVO distributionParcelDetails, Query query) {
IPage<DistributionParcelDetailsVO> pages = distributionParcelDetailsService.selectDistributionParcelDetailsPage(Condition.getPage(query), distributionParcelDetails);
return R.data(pages);
}
/**
* 包件清单详情 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入distributionParcelDetails")
public R save(@Valid @RequestBody DistributionParcelDetailsEntity distributionParcelDetails) {
return R.status(distributionParcelDetailsService.save(distributionParcelDetails));
}
/**
* 包件清单详情 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入distributionParcelDetails")
public R update(@Valid @RequestBody DistributionParcelDetailsEntity distributionParcelDetails) {
return R.status(distributionParcelDetailsService.updateById(distributionParcelDetails));
}
/**
* 包件清单详情 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入distributionParcelDetails")
public R submit(@Valid @RequestBody DistributionParcelDetailsEntity distributionParcelDetails) {
return R.status(distributionParcelDetailsService.saveOrUpdate(distributionParcelDetails));
}
/**
* 包件清单详情 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(distributionParcelDetailsService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-distributionParcelDetails")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionParcelDetails")
public void exportDistributionParcelDetails(@ApiIgnore @RequestParam Map<String, Object> distributionParcelDetails, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionParcelDetailsEntity> queryWrapper = Condition.getQueryWrapper(distributionParcelDetails, DistributionParcelDetailsEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(DistributionParcelDetails::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(DistributionParcelDetailsEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionParcelDetailsExcel> list = distributionParcelDetailsService.exportDistributionParcelDetails(queryWrapper);
ExcelUtil.export(response, "包件清单详情数据" + DateUtil.time(), "包件清单详情数据表", list, DistributionParcelDetailsExcel.class);
}
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -110,8 +110,9 @@ public class DistributionReservationController extends BladeController {
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入distrbutionReservation")
public R update(@Valid @RequestBody DistributionReservationEntity distrbutionReservation) {
return R.status(reservationService.updateById(distrbutionReservation));
public R update(@Valid @RequestBody DistributionReservationDTO distributionReservationDTO) {
boolean result = reservationService.updateReservation(distributionReservationDTO);
return R.status(result);
}
/**

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -258,4 +258,9 @@ public class DistributionStockArticleController extends BladeController {
return result;
}
}

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.controller;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -147,4 +148,15 @@ public class DistributionStockListController extends BladeController {
ExcelUtil.export(response, "库存品管理数据" + DateUtil.time(), "库存品管理数据表", list, DistributionStockListExcel.class);
}
/**
* 获取批量在库订单信息
*/
@GetMapping("/packageList")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R getPackageList(@RequestParam String id) {
R<List<DistributionStockArticleVO>> result = distributionStockListService.getPackageList(id);
return result;
}
}

34
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionParcelDetailsDTO.java

@ -0,0 +1,34 @@
/*
* 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.distribution.dto;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 包件清单详情 数据传输对象实体类
*
* @author cyz
* @since 2023-06-30
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionParcelDetailsDTO extends DistributionParcelDetailsEntity {
private static final long serialVersionUID = 1L;
}

31
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingackDTO.java

@ -0,0 +1,31 @@
package com.logpm.distribution.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
@Data
public class DistrilbutionloadingackDTO {
/**
* pda信息
*/
@ApiModelProperty(value = "pda信息")
private String pdaInformation;
/**
* 扫描包条信息
*/
@ApiModelProperty(value = "扫描包条信息")
@NotEmpty(message = "扫描单号不能为空")
private String barcode;
/**
* 确认类型
*/
@ApiModelProperty(value = "确认类型(1-整车确认,2-零星确认)")
private Integer ackType;
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java

@ -10,30 +10,17 @@ import javax.validation.constraints.NotEmpty;
public class DistrilbutionloadingscanDTO {
/**
* pda信息
*/
@ApiModelProperty(value = "pda信息")
@NotEmpty(message = "pda信息不能为空")
private String pdaInformation;
/**
* 扫描包条信息
*/
@ApiModelProperty(value = "扫描包条信息")
@NotEmpty(message = "扫描单号不能为空")
private String barcode;
/**
* 扫描类型
* 扫描物品
*/
@ApiModelProperty(value = "扫描类型(1-包条,2-托盘)")
@NotEmpty(message = "扫描类型不能为空")
@ApiModelProperty(value = "扫描物品(1-包条,2-托盘)")
private Integer type;
/**
* 确认类型
*/
@ApiModelProperty(value = "确认类型(1-整车确认,2-零星确认)")
private Integer ackType;
}

129
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionParcelDetailsExcel.java

@ -0,0 +1,129 @@
/*
* 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.distribution.excel;
import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
/**
* 包件清单详情 Excel实体类
*
* @author cyz
* @since 2023-06-30
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionParcelDetailsExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
/**
* 预留1
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
/**
* 预留2
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
/**
* 预留3
*/
@ColumnWidth(20)
@ExcelProperty("预留3")
private String reserve3;
/**
* 预留4
*/
@ColumnWidth(20)
@ExcelProperty("预留4")
private String reserve4;
/**
* 预留5
*/
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
/**
* 包件清单id
*/
@ColumnWidth(20)
@ExcelProperty("包件清单id")
private String parcelListId;
/**
* 订单ID
*/
@ColumnWidth(20)
@ExcelProperty("订单ID")
private String stockArticleId;
/**
* 包件码
*/
@ColumnWidth(20)
@ExcelProperty("包件码")
private String packageCode;
/**
* 编码
*/
@ColumnWidth(20)
@ExcelProperty("编码")
private String encoded;
/**
* 名称
*/
@ColumnWidth(20)
@ExcelProperty("名称")
private String name;
/**
* 尺寸
*/
@ColumnWidth(20)
@ExcelProperty("尺寸")
private String dimensions;
/**
* 数量
*/
@ColumnWidth(20)
@ExcelProperty("数量")
private Integer number;
}

53
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelDetailsClient.java

@ -0,0 +1,53 @@
/*
* 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.distribution.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import com.logpm.distribution.service.IDistributionParcelDetailsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 包件清单详情 Feign实现类
*
* @author cyz
* @since 2023-06-30
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class DistributionParcelDetailsClient implements IDistributionParcelDetailsClient {
private final IDistributionParcelDetailsService distributionParcelDetailsService;
@Override
@GetMapping(TOP)
public BladePage<DistributionParcelDetailsEntity> top(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<DistributionParcelDetailsEntity> page = distributionParcelDetailsService.page(Condition.getPage(query));
return BladePage.of(page);
}
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -77,4 +77,10 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
distributionStockArticleService.saveOrUpdate(distributionStockArticleEntity);
}
@Override
@GetMapping(API_PREFIX + "/addHandQuantity")
public void addHandQuantity(Long id, int num) {
distributionStockArticleService.addHandQuantity(id,num);
}
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -102,9 +102,9 @@
SELECT
count(*)
FROM
logpm_distribution_delivery_info lddi
logpm_distribution_loadscan ldl
<where>
lddi.is_deleted = 0 and lddi.reservation_id = #{id}
ldl.is_deleted = 0 and ldl.reservation_id = #{id}
</where>
</select>
<select id="selectcustomListByOrderId" resultType="com.logpm.distribution.vo.DistributionDeliveryInfoVO">

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java

@ -81,4 +81,10 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
* @return
*/
Integer updateloadingTime(Long id);
/**
* 更新上车时间
*
* @return
*/
Integer updateloadingTimeById(Long id);
}

112
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -45,6 +45,9 @@
SET lddl.loading_time = now()
WHERE ldl.package_id = #{id} and lddl.loading_time is null
</update>
<update id="updateloadingTimeById">
UPDATE logpm_distribution_delivery_list lddl SET lddl.loading_time = now() WHERE lddl.id = #{id} and lddl.loading_time is null
</update>
<select id="selectDistributionDeliveryListPage" resultType="com.logpm.distribution.vo.DistributionDeliveryListVO">
@ -79,9 +82,18 @@
logpm_distribution_delivery_list lddl
<where>
<if test="param.trainNumber != null and param.trainNumber!=''">
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.warehouseName != null and param.warehouseName!=''">
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.driverName != null and param.driverName!=''">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
<if test="param.kind != null and param.kind!=''">
and lddl.kind = #{param.kind}
</if>
@ -111,29 +123,41 @@
SELECT * FROM logpm_distribution_delivery_list ${ew.customSqlSegment}
</select>
<select id="selectBycommercialNub" resultType="java.lang.Integer">
SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_delivery_list
SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_delivery_list lddl
<where>
type = '2'
lddl.type = '2'
<if test="param.trainNumber != null and param.trainNumber!=''">
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.warehouseName != null and param.warehouseName!=''">
and warehouse_name like concat('%',#{param.warehouseName},'%')
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.driverName != null and param.driverName!=''">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
<if test="param.kind != null and param.kind!=''">
and kind = #{param.kind}
and lddl.kind = #{param.kind}
</if>
<if test="param.distributionCompany != null and param.distributionCompany!=''">
and distribution_company = #{param.distributionCompany}
and lddl.distribution_company = #{param.distributionCompany}
</if>
<if test="param.type != null and param.type!=''">
and lddl.type = #{param.type}
</if>
<if test="param.state != null and param.state!=''">
and state = #{param.state}
and lddl.state = #{param.state}
</if>
<if test="param.createTime_query!=null and param.createTime_query!=''">
and date_format(create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
and lddl.date_format(create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
</if>
<if test="param.leadTime!=null and param.leadTime!=''">
and date_format(lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
<if test="param.leadTime!=null and param.leadTime!=''">
and lddl.date_format(lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
</if>
<if test="param.loadingTime!=null and param.loadingTime!=''">
and date_format(loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
<if test="param.loadingTime!=null and param.loadingTime!=''">
and lddl.date_format(loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
</if>
</where>
</select>
@ -145,53 +169,77 @@
JOIN logpm_distribution_loadscan ldl ON lddl.id = ldl.delivery_id
<where>
lddl.type = '2'
<if test="param.trainNumber != null and param.trainNumber!=''">
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.warehouseName != null and param.warehouseName!=''">
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.driverName != null and param.driverName!=''">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
<if test="param.kind != null and param.kind!=''">
and lddl.kind = #{param.kind}
</if>
<if test="param.distributionCompany != null and param.distributionCompany!=''">
and lddl.distribution_company = #{param.distributionCompany}
</if>
<if test="param.type != null and param.type!=''">
and lddl.type = #{param.type}
</if>
<if test="param.state != null and param.state!=''">
and lddl.state = #{param.state}
</if>
<if test="param.createTime_query!=null and param.createTime_query!=''">
and date_format(lddl.create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
and lddl.date_format(create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
</if>
<if test="param.leadTime!=null and param.leadTime!=''">
and date_format(lddl.lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
and lddl.date_format(lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
</if>
<if test="param.loadingTime!=null and param.loadingTime!=''">
and date_format(lddl.loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
and lddl.date_format(loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
</if>
</where>
</select>
<select id="selectmarketNub" resultType="java.lang.Integer">
SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_delivery_list
SELECT COALESCE(COUNT(*), 0) FROM logpm_distribution_delivery_list lddl
<where>
type = '1'
lddl.type = '1'
<if test="param.trainNumber != null and param.trainNumber!=''">
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.warehouseName != null and param.warehouseName!=''">
and warehouse_name like concat('%',#{param.warehouseName},'%')
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.driverName != null and param.driverName!=''">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
<if test="param.kind != null and param.kind!=''">
and kind = #{param.kind}
and lddl.kind = #{param.kind}
</if>
<if test="param.distributionCompany != null and param.distributionCompany!=''">
and distribution_company = #{param.distributionCompany}
and lddl.distribution_company = #{param.distributionCompany}
</if>
<if test="param.type != null and param.type!=''">
and lddl.type = #{param.type}
</if>
<if test="param.state != null and param.state!=''">
and state = #{param.state}
and lddl.state = #{param.state}
</if>
<if test="param.createTime_query!=null and param.createTime_query!=''">
and date_format(create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
and lddl.date_format(create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
</if>
<if test="param.leadTime!=null and param.leadTime!=''">
and date_format(lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
and lddl.date_format(lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
</if>
<if test="param.loadingTime!=null and param.loadingTime!=''">
and date_format(loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
and lddl.date_format(loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
</if>
</where>
</select>
@ -204,26 +252,38 @@
<where>
lddl.type = '1'
<if test="param.trainNumber != null and param.trainNumber!=''">
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.warehouseName != null and param.warehouseName!=''">
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.driverName != null and param.driverName!=''">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
<if test="param.kind != null and param.kind!=''">
and lddl.kind = #{param.kind}
</if>
<if test="param.distributionCompany != null and param.distributionCompany!=''">
and lddl.distribution_company = #{param.distributionCompany}
</if>
<if test="param.type != null and param.type!=''">
and lddl.type = #{param.type}
</if>
<if test="param.state != null and param.state!=''">
and lddl.state = #{param.state}
</if>
<if test="param.createTime_query!=null and param.createTime_query!=''">
and date_format(lddl.create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
and lddl.date_format(create_time,'%y%m%d%') = date_format(#{param.createTime_query},'%y%m%d%')
</if>
<if test="param.leadTime!=null and param.leadTime!=''">
and date_format(lddl.lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
and lddl.date_format(lead_time,'%y%m%d%') = date_format(#{param.leadTime},'%y%m%d%')
</if>
<if test="param.loadingTime!=null and param.loadingTime!=''">
and date_format(lddl.loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
and lddl.date_format(loading_time,'%y%m%d%') = date_format(#{param.loadingTime},'%y%m%d%')
</if>
</where>
</select>

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java

@ -56,4 +56,16 @@ public interface DistributionLoadscanMapper extends BaseMapper<DistributionLoads
* @return
*/
Integer updateByPackageId(Long id);
/**
* 查询当前包条码所在车次
*
* @return
*/
String selecttrainNumberByPackageId(Long id);
/**
* 装车件数
*
* @return
*/
Integer selectWrapdreCount(Long id);
}

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml

@ -169,5 +169,17 @@
<select id="exportDistributionLoadscan" resultType="com.logpm.distribution.excel.DistributionLoadscanExcel">
SELECT * FROM logpm_distribution_loadscan ${ew.customSqlSegment}
</select>
<select id="selecttrainNumberByPackageId" resultType="java.lang.String">
select train_number trainNumber from logpm_distribution_loadscan where is_deleted = 0 and package_id = #{id}
</select>
<select id="selectWrapdreCount" resultType="java.lang.Integer">
SELECT
count(*)
FROM
logpm_distribution_loadscan ldl
<where>
ldl.is_deleted = 0 and ldl.reservation_id = #{id} and (ldl.scan_status =2 or ldl.scan_status =3)
</where>
</select>
</mapper>

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelDetailsMapper.java

@ -0,0 +1,54 @@
/*
* 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.distribution.mapper;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import com.logpm.distribution.vo.DistributionParcelDetailsVO;
import com.logpm.distribution.excel.DistributionParcelDetailsExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 包件清单详情 Mapper 接口
*
* @author cyz
* @since 2023-06-30
*/
public interface DistributionParcelDetailsMapper extends BaseMapper<DistributionParcelDetailsEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionParcelDetails
* @return
*/
List<DistributionParcelDetailsVO> selectDistributionParcelDetailsPage(IPage page, DistributionParcelDetailsVO distributionParcelDetails);
/**
* 获取导出数据
*
* @param queryWrapper
* @return
*/
List<DistributionParcelDetailsExcel> exportDistributionParcelDetails(@Param("ew") Wrapper<DistributionParcelDetailsEntity> queryWrapper);
}

40
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelDetailsMapper.xml

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.distribution.mapper.DistributionParcelDetailsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="distributionParcelDetailsResultMap" type="com.logpm.distribution.entity.DistributionParcelDetailsEntity">
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="parcel_list_id" property="parcelListId"/>
<result column="stock_article_id" property="stockArticleId"/>
<result column="package_code" property="packageCode"/>
<result column="encoded" property="encoded"/>
<result column="name" property="name"/>
<result column="dimensions" property="dimensions"/>
<result column="number" property="number"/>
</resultMap>
<select id="selectDistributionParcelDetailsPage" resultMap="distributionParcelDetailsResultMap">
select * from logpm_distribution_parcel_details where is_deleted = 0
</select>
<select id="exportDistributionParcelDetails" resultType="com.logpm.distribution.excel.DistributionParcelDetailsExcel">
SELECT * FROM logpm_distribution_parcel_details ${ew.customSqlSegment}
</select>
</mapper>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -28,7 +28,7 @@
<result column="order_source" property="orderSource"/>
<result column="stockup_status" property="stockupStatus"/>
<result column="goods_shelf_id" property="goodsAreaId"/>
<!-- <result column="reservation_id" property="reservationId"/>-->
<result column="reservation_num" property="reservationNum"/>
<result column="period_of_time" property="periodOfTime"/>
<result column="fee" property="fee"/>
<result column="reserve1" property="reserve1"/>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -51,4 +51,5 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
*/
List<DistributionStockArticleExcel> exportDistributionStockArticle(@Param("ew") Wrapper<DistributionStockArticleEntity> queryWrapper);
void addHandQuantity(@Param("id") Long id,@Param("num") int num);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -50,4 +50,8 @@
SELECT * FROM logpm_distribution_stock_article ${ew.customSqlSegment}
</select>
<update id="addHandQuantity" >
update logpm_distribution_stock_article set hand_quantity = hand_quantity + #{num} where id = #{id}
</update>
</mapper>

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -25,6 +25,7 @@ import com.logpm.distribution.excel.DistributionDeliveryListExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.vo.DistributionstatisticsnmbVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
@ -78,5 +79,17 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
/**
*装车扫描
*/
Integer loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
*装车确认
*/
R loadingack(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
*装车扫描(一键装车)
*/
R oneloading();
/**
*装车扫描(一键确认)
*/
R oneack();
}

52
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelDetailsService.java

@ -0,0 +1,52 @@
/*
* 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.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import com.logpm.distribution.vo.DistributionParcelDetailsVO;
import com.logpm.distribution.excel.DistributionParcelDetailsExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 包件清单详情 服务类
*
* @author cyz
* @since 2023-06-30
*/
public interface IDistributionParcelDetailsService extends BaseService<DistributionParcelDetailsEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionParcelDetails
* @return
*/
IPage<DistributionParcelDetailsVO> selectDistributionParcelDetailsPage(IPage<DistributionParcelDetailsVO> page, DistributionParcelDetailsVO distributionParcelDetails);
/**
* 导出数据
*
* @param queryWrapper
* @return
*/
List<DistributionParcelDetailsExcel> exportDistributionParcelDetails(Wrapper<DistributionParcelDetailsEntity> queryWrapper);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -99,8 +99,16 @@ public interface IDistributionReservationService extends BaseService<Distributio
/**
* 查询指定预约信息
* @param id
* @param reservationId
* @return
*/
R<DistributionReservationVO> getReservationInfo(String reservationId);
/**
* 修改预约计划
* @param distributionReservationDTO
* @return
*/
boolean updateReservation(DistributionReservationDTO distributionReservationDTO);
}

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

@ -65,4 +65,7 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
Boolean saveStockRow(DistributionStockArticleDTO distributionStockArticleDTO);
R<List<DistributionStockArticleVO>> getStockArticleInfo(String ids);
void addHandQuantity(Long id, int num);
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java

@ -18,10 +18,13 @@ package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.excel.DistributionStockListExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
/**
@ -49,4 +52,10 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/
List<DistributionStockListExcel> exportDistributionStockList(Wrapper<DistributionStockListEntity> queryWrapper);
/**
* 查询订单下的包件信息
* @param id
* @return
*/
R<List<DistributionStockArticleVO>> getPackageList(String id);
}

92
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -31,6 +31,9 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.redis.config.RedisAutoCacheManager;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -50,7 +53,9 @@ import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* 配送管理 服务实现类
@ -67,6 +72,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private final DistributionParcelListMapper distributionParcelListMapper;
private final DistributionLoadscanMapper distributionLoadscanMapper;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
private final DistributionSignforServiceImpl distributionSignforService;
private final DistributionStockArticleMapper distributionStockArticleMapper;
private final BladeRedis bladeRedis;
@Override
public IPage<DistributionDeliveryListVO> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListVO> page, DistributionDeliveryListDTO distributionDeliveryList) {
@ -158,15 +165,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//TODO 冗余加入签收表
distributionReservationEntities.forEach(e->{
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
BeanUtils.copyProperties(e,distributionSignforEntity);
Func.copy(e,distributionSignforEntity);
distributionSignforEntity.setReservationId(e.getId());
distributionSignforEntity.setConsigneeName(e.getConsignee());
distributionSignforEntity.setWarehouseId(distributionDeliveryList.getWarehouseId());
distributionSignforEntity.setWarehouseName(distributionDeliveryList.getWarehouseName());
distributionSignforEntity.setTrainNumber(distributionDeliveryList.getTrainNumber());
//通过客户查询已经上车的订单
String orderIds = distributionDeliveryInfoMapper.selectorderIdList(e.getId());
distributionSignforEntity.setOrderId(orderIds);
distributionSignforEntity.setDeliveryDriverName(distributionDeliveryList.getDriverName());
distributionSignforEntity.setDeliveryDriverId(distributionDeliveryList.getDriverId());
//配送时间
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
String format = simpleDateFormat.format(new Date());
distributionSignforEntity.setDeliveryTime(format);
//通过客户查询已经上车的订单(待定)
// String orderIds = distributionDeliveryInfoMapper.selectorderIdList(e.getId());
distributionSignforEntity.setOrderId(e.getStockArticleId());
//查询订单总数
Integer i = StringUtils.countMatches(e.getStockArticleId(), ",")+1;
distributionSignforEntity.setOrderTotal(i);
@ -174,8 +187,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer i1 =distributionDeliveryInfoMapper.selectWrapCount(e.getId());
distributionSignforEntity.setTotal(i1);
//装车件数
Integer dre = distributionLoadscanMapper.selectWrapdreCount(e.getId());
distributionSignforEntity.setLoadedNumber(dre);
//签收状态
distributionSignforEntity.setSigningStatus("1");
distributionSignforEntity.setReservationId(e.getId());
distributionSignforEntities.add(distributionSignforEntity);
});
distributionSignforService.saveBatch(distributionSignforEntities);
}else {
}
@ -184,31 +203,74 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//获取关联订单
String orderId = distributionDeliveryList.getOrderId();
List<Long> orderIds = Arrays.asList(Long.valueOf(String.valueOf(orderId.split(","))));
//查询在库订单
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleMapper.selectBatchIds(orderIds);
//插入配送详情表
distributionStockArticleEntities.forEach(e->{
DistributionSigndetailEntity distributionSigndetailEntity = new DistributionSigndetailEntity();
Func.copy(e,distributionSigndetailEntity);
});
//TODO 修改配送表id
return null;
}
@Override
public Integer loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//查询是否同一pda
// bladeRedis.setEx(distrilbutionloadingscanDTO.getPdaInformation(),);
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//获取当前用户司机
BladeUser user = AuthUtil.getUser();
//寻找车次
List<DistributionDeliveryListEntity> distributionDeliveryListEntities = distributionDeliveryListMapper.selectList(new QueryWrapper<DistributionDeliveryListEntity>()
.lambda().eq(DistributionDeliveryListEntity::getState, 1).like(DistributionDeliveryListEntity::getDriverId, user.getUserId())
);
if (distributionDeliveryListEntities.size()<0){return R.fail(3001,"该司机无车次");}
//查询缓存
if (distrilbutionloadingscanDTO.getType()==1){
//找出该包条码
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper<DistributionParcelListEntity>().lambda()
.eq(DistributionParcelListEntity::getPacketBarCode,distrilbutionloadingscanDTO.getBarcode()));
distributionParcelListEntities.forEach(e->{
//修改对应的装车表
distributionLoadscanMapper.updateByPackageId(e.getId());
//TODO 查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTime(e.getId());
// baseMapper.updateloadingTime(e.getId());
});
for (DistributionParcelListEntity e : distributionParcelListEntities) {
String trainNumber = distributionLoadscanMapper.selecttrainNumberByPackageId(e.getId());
if (!trainNumber.equals(distributionDeliveryListEntities.get(0).getTrainNumber())) {return R.fail(3002,"不是当前司机配送车次");}
if (Func.notNull(bladeRedis.get("ZC"+user.getUserId()))){
if (!(bladeRedis.get("ZC"+user.getUserId().toString()).equals(trainNumber))){
return R.fail(3003,"串货");
}
}else {
//第一次缓存
bladeRedis.setEx("ZC"+user.getUserId(),trainNumber,3600L);
//TODO 查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntities.get(0).getId());
}
//修改对应的装车表
distributionLoadscanMapper.updateByPackageId(e.getId());
// baseMapper.updateloadingTime(e.getId());
}
}else if (distrilbutionloadingscanDTO.getType()==2){
//TODO 托盘扫描
}
return 1;
return R.success("成功");
}
@Override
public R loadingack(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
return null;
}
@Override
public R oneloading() {
//获取当前用户司机
BladeUser user = AuthUtil.getUser();
//TODO 用个配送司机车辆中间表字段存储状态
return null;
}
@Override
public R oneack() {
return null;
}
}

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelDetailsServiceImpl.java

@ -0,0 +1,54 @@
/*
* 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.distribution.service.impl;
import com.logpm.distribution.entity.DistributionParcelDetailsEntity;
import com.logpm.distribution.vo.DistributionParcelDetailsVO;
import com.logpm.distribution.excel.DistributionParcelDetailsExcel;
import com.logpm.distribution.mapper.DistributionParcelDetailsMapper;
import com.logpm.distribution.service.IDistributionParcelDetailsService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 包件清单详情 服务实现类
*
* @author cyz
* @since 2023-06-30
*/
@Service
public class DistributionParcelDetailsServiceImpl extends BaseServiceImpl<DistributionParcelDetailsMapper, DistributionParcelDetailsEntity> implements IDistributionParcelDetailsService {
@Override
public IPage<DistributionParcelDetailsVO> selectDistributionParcelDetailsPage(IPage<DistributionParcelDetailsVO> page, DistributionParcelDetailsVO distributionParcelDetails) {
return page.setRecords(baseMapper.selectDistributionParcelDetailsPage(page, distributionParcelDetails));
}
@Override
public List<DistributionParcelDetailsExcel> exportDistributionParcelDetails(Wrapper<DistributionParcelDetailsEntity> queryWrapper) {
List<DistributionParcelDetailsExcel> distributionParcelDetailsList = baseMapper.exportDistributionParcelDetails(queryWrapper);
//distributionParcelDetailsList.forEach(distributionParcelDetails -> {
// distributionParcelDetails.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionParcelDetails.getType()));
//});
return distributionParcelDetailsList;
}
}

156
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -76,8 +76,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private final IDistributionReservationStocklistService distributionReservationStocklistService;
@Override
public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) {
return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation));
@ -122,14 +120,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Override
@Transactional
public boolean insertReservation(DistributionReservationDTO distributionReservationDTO) {
if (Func.isEmpty(distributionReservationDTO)){
if (Func.isEmpty(distributionReservationDTO)) {
log.error("参数错误+{" + distributionReservationDTO + "}");
return false;
return false;
}
//构建预约单
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
Func.copy(distributionReservationDTO,reservationEntity);
Func.copy(distributionReservationDTO, reservationEntity);
//新建预约单为待确认状态
reservationEntity.setReservationStatus("1");
//新建预约单订单处于未备货状态
reservationEntity.setStockupStatus("1");
this.save(reservationEntity);
//获取新增预约信息的编号
@ -141,15 +141,22 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<String> arrayList = new ArrayList<>();
AtomicReference<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO);
//存在订单构建预约订单关联信息
if (!Func.isEmpty(stockArticleList)){
stockArticleList.forEach(s->{
if (!Func.isEmpty(stockArticleList)) {
stockArticleList.forEach(s -> {
//修改订单状态为已预约
s.setState(2);
stockArticleCount.getAndAdd(s.getReservationNum());
distributionStockArticleService.updateById(s);
//拼接订单自编号
arrayList.add(s.getOrderSelfNumbering());
initTotal.accumulateAndGet(new BigDecimal(s.getFee().toString()),BigDecimal::add);
initTotal.accumulateAndGet(new BigDecimal(s.getRate().toString()),BigDecimal::add);
//订单增值服务费
initTotal.accumulateAndGet(new BigDecimal(s.getFee().toString()), BigDecimal::add);
//订单协商费用
initTotal.accumulateAndGet(new BigDecimal(s.getRate().toString()), BigDecimal::add);
//订单到付费用
initTotal.accumulateAndGet(new BigDecimal(s.getCollectFee().toString()), BigDecimal::add);
//仓储费用
initTotal.accumulateAndGet(new BigDecimal(s.getStorageFee().toString()), BigDecimal::add);
Long stockArticleId = s.getId();
DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity();
distributionReservationStockarticleEntity.setReservationId(reservationId);
@ -159,8 +166,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
});
}
//存在库存品构建预约库存品关联信息
if (!Func.isEmpty(inventoryList)){
inventoryList.forEach(i->{
if (!Func.isEmpty(inventoryList)) {
inventoryList.forEach(i -> {
distributionStockListService.updateById(i);
Long stocklistId = i.getId();
stockListCount.getAndAdd(i.getReservationNum());
@ -182,6 +189,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//统计数量
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee);
int count = stockArticleCount.get() + stockListCount.get();
reservationEntity.setReservationNum(count);
distributionReservationMapper.updateById(reservationEntity);
return true;
}
@ -273,9 +282,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
log.error("预约参数错误+{" + ids + "}");
return R.fail("预约信息错误!!!");
}
String text = "4564654654";
String[] split = text.split(",");
//判断是自主配送还是三方配送
String tripartiteSource = (String) deliveryInfo.get("tripartiteSource");
boolean result = false;
@ -297,7 +303,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionTripartiteDeliveryEntity.setDriverPhone((String) deliveryInfo.get("driverPhone"));
distributionTripartiteDeliveryEntity.setDriverName((String) deliveryInfo.get("driverName"));
distributionTripartiteDeliveryEntity.setVehicleNum((String) deliveryInfo.get("vehicleNum"));
distributionTripartiteDeliveryEntity.setDeliveryFee(new BigDecimal((String) deliveryInfo.get("deliveryFee")) );
distributionTripartiteDeliveryEntity.setDeliveryFee(new BigDecimal((String) deliveryInfo.get("deliveryFee")));
distributionTripartiteDeliveryEntity.setReservationIds(idsStr);
result = distributionTripartiteDeliveryService.save(distributionTripartiteDeliveryEntity);
Long distributionTripartiteDeliveryEntityId = distributionTripartiteDeliveryEntity.getId();
@ -308,7 +314,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
stockupEntity.setStockupStatus("2");
stockupEntity.setStockupArea((String) deliveryInfo.get("goodsAreaId"));
stockupEntity.setStockupUser(AuthUtil.getUser().getUserId().toString());
stockupEntity.setLoader(Long.parseLong((String) deliveryInfo.get("loader")) );
stockupEntity.setLoader(Long.parseLong((String) deliveryInfo.get("loader")));
stockupEntity.setAssignStatus("2");
stockupEntity.setAssignTime(new Date());
String stockUpdate = (String) deliveryInfo.get("stockupDate");
@ -326,7 +332,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//对预约信息进行备货状态修改
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(id);
String stockupStatus = reservationEntity.getStockupStatus();
if (!stockupStatus.equals("1")){
if (!stockupStatus.equals("1")) {
//预约任务处于未备货状态
//预约信息编号拼接
reservationIdBuffer.append(reservationEntity.getId()).append(",");
@ -367,16 +373,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setWarehouseId(warehouseName.get());
String masterDriverName = (String) deliveryInfo.get("masterDriverName");
String slaveDriverNames = (String) deliveryInfo.get("slaveDriverNames");
if (Func.isBlank(masterDriverName)){
if (Func.isBlank(masterDriverName)) {
//这里就是外协配送的方式
distributionDeliveryListEntity.setDriverName((String) deliveryInfo.get("driverName"));
distributionDeliveryListEntity.setKind("2");
distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNum"));
}else {
} else {
distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNums"));
distributionDeliveryListEntity.setVehicleId((String) deliveryInfo.get("vehicleIds"));
distributionDeliveryListEntity.setDriverName(masterDriverName+","+slaveDriverNames);
distributionDeliveryListEntity.setDriverName(masterDriverName + "," + slaveDriverNames);
distributionDeliveryListEntity.setDriverId((String) deliveryInfo.get("driverIds"));
distributionDeliveryListEntity.setKind("1");
}
@ -388,7 +394,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error("异常错误+{"+e.getMessage()+"}");
log.error("异常错误+{" + e.getMessage() + "}");
return R.fail("操作失败!!!");
}
return R.status(result);
@ -399,34 +405,112 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//查询出预约信息
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(reservationId);
DistributionReservationVO reservationVO = new DistributionReservationVO();
Func.copy(reservationEntity,reservationVO);
Func.copy(reservationEntity, reservationVO);
//查询出订单信息
QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(),DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId,reservationEntity.getId());
QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId());
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(),DistributionReservationStocklistEntity.class);
w.lambda().eq(DistributionReservationStocklistEntity::getReservationId,reservationEntity.getId());
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStocklistEntity.class);
w.lambda().eq(DistributionReservationStocklistEntity::getReservationId, reservationEntity.getId());
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w);
if (!Func.isEmpty(reservationStockarticleEntityList)){
if (!Func.isEmpty(reservationStockarticleEntityList)) {
List<DistributionStockArticleEntity> stockArticleEntityList = new ArrayList<>();
reservationStockarticleEntityList.forEach(a->{
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(a.getStockarticleId());
stockArticleEntity.setReservationNum(a.getReservationNum());
reservationStockarticleEntityList.forEach(a1 -> {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(a1.getStockarticleId());
stockArticleEntity.setReservationNum(a1.getReservationNum());
stockArticleEntityList.add(stockArticleEntity);
});
//查询出库存信息
//查询出 库存信息
reservationVO.setStockArticleList(stockArticleEntityList);
}
if (!Func.isEmpty(reservationStocklistEntityList)){
if (!Func.isEmpty(reservationStocklistEntityList)) {
List<DistributionStockListEntity> stockArticleEntityList = new ArrayList<>();
reservationStocklistEntityList.forEach(a->{
DistributionStockListEntity stockListEntity = distributionStockListService.getById(a.getStocklistId());
stockListEntity.setReservationNum(a.getReservationNum());
reservationStocklistEntityList.forEach(a2 -> {
DistributionStockListEntity stockListEntity = distributionStockListService.getById(a2.getStocklistId());
stockListEntity.setReservationNum(a2.getReservationNum());
stockArticleEntityList.add(stockListEntity);
});
//查询出库存信息
//查询出 库存信息
reservationVO.setInventoryList(stockArticleEntityList);
}
return R.data(reservationVO);
}
@Override
@Transactional
public boolean updateReservation(DistributionReservationDTO distributionReservationDTO) {
//修改预约信息
if (Func.isEmpty(distributionReservationDTO)) {
log.error("参数异常+{" + distributionReservationDTO + "}");
return false;
}
//删除原有
DistributionReservationEntity distributionReservationEntity = this.getById(distributionReservationDTO.getId());
Func.copy(distributionReservationDTO, distributionReservationEntity);
QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, distributionReservationEntity.getId());
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStocklistEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, distributionReservationEntity.getId());
//查询已有的中间表信息
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w);
if (!Func.isEmpty(reservationStockarticleEntityList)) {
//对已有预约信息的订单包件数量进行清理
reservationStockarticleEntityList.forEach(s1 -> {
int delete = distributionReservationStockarticleService.getBaseMapper().delete(q);
});
}
if (!Func.isEmpty(reservationStocklistEntityList)) {
//对已有预约信息的订单包件数量进行清理
reservationStocklistEntityList.forEach(r1 -> {
int delete = distributionReservationStocklistService.getBaseMapper().delete(w);
});
}
//包件数量累加
AtomicInteger count = new AtomicInteger();
//计算总费用
AtomicReference<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO);
//订单自编号拼接
HashSet<String> hashSet = new HashSet<>();
List<DistributionStockArticleEntity> stockArticleList = distributionReservationDTO.getStockArticleList();
if (!Func.isEmpty(stockArticleList)) {
//这里判断修改内容是否存在订单信息,如果存在则进行中间表数据的重新插入
stockArticleList.forEach(s -> {
DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity();
//构建预约订单中间表信息
distributionReservationStockarticleEntity.setReservationNum(s.getReservationNum());
distributionReservationStockarticleEntity.setStockarticleId(s.getId());
distributionReservationStockarticleEntity.setReservationId(distributionReservationEntity.getId());
distributionReservationStockarticleService.save(distributionReservationStockarticleEntity);
//统计订单包件数量
count.getAndAdd(s.getReservationNum());
//订单到付费用
initTotal.getAndAccumulate(new BigDecimal(s.getCollectFee().toString()), BigDecimal::add);
//订单仓储费
initTotal.getAndAccumulate(new BigDecimal(s.getStorageFee().toString()), BigDecimal::add);
//协商费用
initTotal.getAndAccumulate(new BigDecimal(s.getRate().toString()), BigDecimal::add);
hashSet.add(s.getOrderSelfNumbering());
});
}
List<DistributionStockListEntity> inventoryList = distributionReservationDTO.getInventoryList();
if (!Func.isEmpty(inventoryList)) {
//重新构建备货信息
inventoryList.forEach(i -> {
DistributionReservationStocklistEntity distributionReservationStocklistEntity = new DistributionReservationStocklistEntity();
distributionReservationStocklistEntity.setReservationId(distributionReservationEntity.getId());
distributionReservationStocklistEntity.setReservationNum(i.getReservationNum());
distributionReservationStocklistEntity.setStocklistId(i.getId());
distributionReservationStocklistService.save(distributionReservationStocklistEntity);
count.getAndAdd(i.getReservationNum());
hashSet.add(i.getOrderSelfNumbering());
});
}
String orderId = String.join(",", hashSet);
distributionReservationEntity.setFee(initTotal.get());
distributionReservationEntity.setReservationNum(count.get());
distributionReservationEntity.setStockArticleId(orderId);
distributionReservationMapper.updateById(distributionReservationEntity);
return true;
}
}

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

@ -16,35 +16,31 @@
*/
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.logpm.basic.feign.IBasicTenantCodeClient;
import com.logpm.distribution.dto.DistributionStockArticleDTO;
import com.logpm.distribution.dto.DistributionStockDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.excel.DistributionStockArticleExcel;
import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.sun.org.apache.xpath.internal.operations.Bool;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.RandomType;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
/**
* 配送在库订单 服务实现类
@ -242,4 +238,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return R.data(distributionStockArticleEntityList);
}
@Override
public void addHandQuantity(Long id, int num) {
baseMapper.addHandQuantity(id,num);
}
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -17,11 +17,13 @@
package com.logpm.distribution.service.impl;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.excel.DistributionStockListExcel;
import com.logpm.distribution.mapper.DistributionStockListMapper;
import com.logpm.distribution.service.IDistributionStockListService;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -53,4 +55,10 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return distributionStockListList;
}
@Override
public R<List<DistributionStockArticleVO>> getPackageList(String id) {
return null;
}
}

17
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -240,13 +240,13 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
// serviceNum.setCreateTime(LocalDate.now());
serviceNum.setDeleteTime(0);
serviceNumEntityList.add(serviceNum);
serviceNumClient.addServiceNum(serviceNumEntityList);
}else{
log.info("#############handlerDataToHt: 当前服务号已存在数据serviceNum={}",sn);
serviceNum.setTotal(Integer.parseInt(serviceNum.getTotal())+1+"");
serviceNumClient.updateServiceNum(serviceNum);
}
}
if(!serviceNumEntityList.isEmpty()){
serviceNumClient.addServiceNum(serviceNumEntityList);
}
log.info("##############handlerDataToHt: 处理数据完成");
}
@ -346,8 +346,9 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setOrderNum("");//MSCS单号 可以为空
advanceDetailEntity.setIsOpai(0);//是否干仓配:1=是,0=否
advanceDetailEntity.setMtdsNo("");//MTDS单号 可以为空
advanceDetailEntity.setFirstPackName(StringUtil.isBlank(mtPackageInfo.getBigType())?"":mtPackageInfo.getBigType());//一级品类
advanceDetailEntity.setFirstPackCode(StringUtil.isBlank(mtPackageInfo.getSmallType())?"":mtPackageInfo.getSmallType());//二级品类
advanceDetailEntity.setFirstPackName("门");//一级品类
// advanceDetailEntity.setFirstPackName(StringUtil.isBlank(mtPackageInfo.getBigType())?"":mtPackageInfo.getBigType());//一级品类
advanceDetailEntity.setFirstPackCode("");//二级品类
advanceDetailEntity.setSiteName("");//基地名称 基地 TODO 需要映射
advanceDetailEntity.setSiteCode("");//基地编码
advanceDetailEntity.setProductCode(StringUtil.isBlank(mtPackageInfo.getPackageType())?"":mtPackageInfo.getPackageType());//货品名称 可以为空
@ -373,7 +374,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setDate6("");//车辆离厂时间
advanceDetailEntity.setCreateTime(LocalDate.now());//创建时间
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum("");//服务号
advanceDetailEntity.setServiceNum(StringUtil.isBlank(mtFactoryOrder.getMainOrderCode())?"":mtFactoryOrder.getMainOrderCode());//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
// advanceDetailEntity.setDueDate(0);//交期
@ -407,12 +408,14 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
// serviceNum.setCreateTime(LocalDate.now());
serviceNum.setDeleteTime(0);
serviceNumEntityList.add(serviceNum);
serviceNumClient.addServiceNum(serviceNumEntityList);
}else{
log.info("#############handlerMtDataToHt: 当前服务号已存在数据serviceNum={}",sn);
serviceNum.setTotal(Integer.parseInt(serviceNum.getTotal())+1+"");
serviceNumClient.updateServiceNum(serviceNum);
}
}
serviceNumClient.addServiceNum(serviceNumEntityList);
log.info("##############handlerMtDataToHt: 处理数据完成");
}

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtOrderStatusDTO.java

@ -12,7 +12,7 @@ import java.util.Date;
@Data
public class MtOrderStatusDTO implements Serializable {
@JsonProperty("发单编号")
@JsonProperty("发单编号")
private String invoiceOrderCode;
@JsonProperty("订单编号")

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/IMtFactoryDataService.java

@ -1,5 +1,6 @@
package com.logpm.factory.mt.service;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.logpm.factory.comfac.dto.OrderInfoDTO;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.comfac.dto.ReceiveInfoDTO;
@ -15,7 +16,7 @@ public interface IMtFactoryDataService {
R handleData(OrderInfoDTO orderInfoDTO);
R handleStatusData(OrderStatusDTO orderStatusDTO);
R handleStatusData(OrderStatusDTO orderStatusDTO) throws JsonProcessingException;
R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO);
R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException;
}

28
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

@ -6,6 +6,9 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.alibaba.nacos.shaded.com.google.gson.GsonBuilder;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.logpm.factory.comfac.dto.*;
import com.logpm.factory.mt.dto.*;
import com.logpm.factory.mt.service.IMtFactoryDataService;
@ -92,6 +95,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
//判断是否有新的包件
if(packageInfos.size() == 0){
//如果没有新增包件就直接下一条数据
log.info("##################dealWithData: 没有新增包件,所以当前数据不保存 invoiceOrderCode={}",invoiceOrderCode);
continue;
}
//如果有新增包件就去存入订单发车单,和订单信息
@ -208,7 +212,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
jsonObject1.put("APPSECRET",mtFactoryProperties.getAppsecret());
jsonObject1.put("USERID",mtFactoryProperties.getUserid());
jsonObject1.put("USERPWD",mtFactoryProperties.getUserpwd());
String result = HttpRequest.post(mtFactoryProperties.getUrl())
String result = HttpRequest.post(mtFactoryProperties.getUrl()+"/Auth/Validate")
.header("Content-Type","application/json").body(jsonObject1.toJSONString()).timeout(5 * 1000)
.execute()
.body();
@ -235,13 +239,11 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
}
return mtToken;
}
@Override
public R handleStatusData(OrderStatusDTO orderStatusDTO) throws CustomerException {
public R handleStatusData(OrderStatusDTO orderStatusDTO) throws CustomerException, JsonProcessingException {
String status = orderStatusDTO.getStatus();
String orderNo = orderStatusDTO.getOrderNo();
@ -281,11 +283,15 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
mtOrderStatusDTO.setWarehouse(mtFactoryOrderMain.getCenterWarehouseCode());
mtOrderStatusDTO.setDealerName(mtFactoryOrder.getDealerName());
ObjectMapper objectMapper = new JsonMapper();
String s = objectMapper.writeValueAsString(mtOrderStatusDTO);
//先获取token
String token = getMtToken();
//请求参数
logger.info("##############handleStatusData: 推送包件状态请求参数 {}",mtOrderStatusDTO);
logger.info("##############handleStatusData: 推送包件状态请求参数 {}",s);
//处理逻辑
String result = HttpRequest.post(mtFactoryProperties.getUrl()+"/Auth/text")
@ -294,7 +300,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
.header("USERID",mtFactoryProperties.getUserid())
.header("USERPWD",mtFactoryProperties.getUserpwd())
.header("Content-Type","application/json")
.body(JSONObject.toJSONString(mtOrderStatusDTO)).timeout(5 * 1000)
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############handleStatusData: 推送包件状态返回参数 {}",result);
@ -319,7 +325,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
@Transactional
@Override
public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) {
public R sendReceiveInfo(ReceiveInfoDTO receiveInfoDTO) throws JsonProcessingException {
log.info("###########sendReceiveInfo: 处理签收图片数据开始");
Integer newDistributionContactId = receiveInfoDTO.getNewDistributionContactId();
List<ReceiveBodyDTO> receiveBodyList = receiveInfoDTO.getReceiveBodyList();
@ -382,12 +388,16 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
//签收图片数据存入头部数据
mtReceiveDTO.setReceiveImagesList(mtReceiveImagesDTOList);
ObjectMapper objectMapper = new ObjectMapper();
String s = objectMapper.writeValueAsString(mtReceiveDTO);
//推送数据到梦天
//先获取token
String token = getMtToken();
//请求参数
logger.info("##############sendReceiveInfo: 推送包件状态请求参数 {}",mtReceiveDTO);
logger.info("##############sendReceiveInfo: 推送包件状态请求参数 {}",s);
//处理逻辑
String result = HttpRequest.post(mtFactoryProperties.getUrl()+"/Auth/text2")
@ -396,7 +406,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
.header("USERID",mtFactoryProperties.getUserid())
.header("USERPWD",mtFactoryProperties.getUserpwd())
.header("Content-Type","application/json")
.body(JSONObject.toJSONString(mtReceiveDTO)).timeout(5 * 1000)
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############sendReceiveInfo: 推送包件状态返回参数 {}",result);

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -384,8 +384,8 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderSelfNum={}",orderSelfNum);
throw new CustomerException(405,"保存包件信息失败");
}
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity()+1);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
//包件保存成功去修改订单的数量
distributionStockArticleClient.addHandQuantity(id,1);
logger.info("#################handleDataToPlatform: 数据处理完成");
}else{

27
blade-service/logpm-factory/src/main/resources/application-dev.yml

@ -10,6 +10,33 @@ server:
# password: ${blade.datasource.dev.password}
spring:
#rabbitmq配置
rabbitmq:
host: 192.168.2.100
port: 5672
username: admin
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
#排除DruidDataSourceAutoConfigure
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure

27
blade-service/logpm-factory/src/main/resources/application.yml

@ -36,33 +36,6 @@ spring:
main:
allow-circular-references: true
#rabbitmq配置
rabbitmq:
host: 192.168.2.100
port: 5672
username: admin
password: admin
#虚拟host 可以不设置,使用server默认host
virtual-host: /
#确认消息已发送到队列(Queue)
publisher-returns: true
publisher-confirm-type: correlated
# 手动提交消息
listener:
simple:
acknowledge-mode: auto
default-requeue-rejected: false
retry:
enabled: true # 开启消费者失败重试
initial-interval: 1000 # 初识的失败等待时长为1秒
multiplier: 1 # 失败的等待时长倍数,下次等待时长 = multiplier * last-interval
max-attempts: 3 # 最大重试次数
stateless: true # true无状态;false有状态。如果业务中包含事务,这里改为false
direct:
acknowledge-mode: manual
template:
mandatory: true
xxl:
job:
accessToken: ''

4
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceDetailClient.java

@ -75,8 +75,8 @@ public class AdvanceDetailClient implements IAdvanceDetailClient {
}
@Override
public DistributionParcelListEntityVO getByUnitNo(String UnitNo) {
return advanceDetailService.getByUnitNo(UnitNo);
public DistributionParcelListEntityVO getByUnitNo(String unitNo) {
return advanceDetailService.getByUnitNo(unitNo);
}
}

6
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java

@ -52,6 +52,12 @@ public class ServiceNumClient implements IServiceNumClient {
return serviceNumService.findByserviceNum(sn);
}
@Override
@PostMapping(API_PREFIX + "/updateServiceNum")
public void updateServiceNum(ServiceNumEntity serviceNum) {
serviceNumService.updateServiceNum(serviceNum);
}
// @Override
// @GetMapping(TOP)
// public BladePage<ServiceNumEntity> top(Integer current, Integer size) {

1
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IServiceNumService.java

@ -34,4 +34,5 @@ public interface IServiceNumService {
ServiceNumEntity findByserviceNum(String sn);
void updateServiceNum(ServiceNumEntity serviceNum);
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java

@ -52,4 +52,9 @@ public class ServiceNumServiceImpl implements IServiceNumService {
queryWrapper.eq("serviceNum",sn);
return serviceNumMapper.selectOne(queryWrapper);
}
@Override
public void updateServiceNum(ServiceNumEntity serviceNum) {
serviceNumMapper.updateById(serviceNum);
}
}

514
doc/dpm/物流租户系统.pdma.json

@ -4,7 +4,7 @@
"avatar": "",
"version": "4.5.1",
"createdTime": "2023-3-27 13:32:56",
"updatedTime": "2023-6-28 11:21:06",
"updatedTime": "2023-6-30 18:03:26",
"dbConns": [],
"profile": {
"default": {
@ -52642,6 +52642,515 @@
],
"correlations": [],
"indexes": []
},
{
"id": "E49C4E0A-761C-48A9-AFDA-7F44465A94EA",
"env": {
"base": {
"nameSpace": "",
"codeRoot": ""
}
},
"defKey": "logpm_distribution_parcel_details",
"defName": "包件清单详情",
"comment": "",
"properties": {
"partitioned by": "(date string)",
"row format delimited": "",
"fields terminated by ','": "",
"collection items terminated by '-'": "",
"map keys terminated by ':'": "",
"store as textfile;": ""
},
"nameTemplate": "{defKey}[{defName}]",
"notes": {},
"headers": [
{
"refKey": "hideInGraph",
"hideInGraph": true
},
{
"refKey": "defKey",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "defName",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "primaryKey",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "notNull",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "autoIncrement",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "domain",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "type",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "len",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "scale",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "comment",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "refDict",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "defaultValue",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "isStandard",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "uiHint",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "extProps",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr1",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr2",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr3",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr4",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr5",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr6",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr7",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr8",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr9",
"freeze": false,
"hideInGraph": true
}
],
"fields": [
{
"defKey": "tenant_id",
"defName": "租户号",
"comment": "",
"type": "",
"len": 32,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"domain": "16120F75-6AA7-4483-868D-F07F511BB081",
"refDict": "",
"uiHint": "",
"id": "73CEE2F0-D371-4ECF-BB27-C329946F7D95"
},
{
"defKey": "create_user",
"defName": "创建人",
"comment": "",
"domain": "16120F75-6AA7-4483-868D-F07F511BB081",
"type": "",
"len": 32,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "D9AD4CB1-8181-4074-AD45-047D09EB9956"
},
{
"defKey": "create_time",
"defName": "创建时间",
"comment": "",
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "571ABD46-E167-4EA4-BFA6-A0420BF628A9"
},
{
"defKey": "update_user",
"defName": "更新人",
"comment": "",
"domain": "16120F75-6AA7-4483-868D-F07F511BB081",
"type": "",
"len": 32,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "1AA85409-2774-43B1-85F6-CC705D720630"
},
{
"defKey": "update_time",
"defName": "更新时间",
"comment": "",
"domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": true,
"refDict": "",
"uiHint": "",
"id": "1B0FF251-8091-4E1D-B78C-1FA4D680F3AD"
},
{
"defKey": "status",
"defName": "状态",
"comment": "",
"type": "INT",
"len": 2,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "8FC352A5-7ED5-44DF-AD22-8B8D24BA00A9"
},
{
"defKey": "is_deleted",
"defName": "是否已删除",
"comment": "",
"type": "INT",
"len": 2,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "560F85E7-D8FF-41AB-A9B7-3A110CB53E39"
},
{
"defKey": "create_dept",
"defName": "创建部门",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
"id": "75A7735D-338D-4B24-9EC1-5F80ED341167"
},
{
"defKey": "id",
"defName": "主键",
"comment": "",
"type": "INT",
"len": 20,
"scale": "",
"primaryKey": true,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "644F9D0F-2B55-4FBA-943C-E7312D92A1FB"
},
{
"defKey": "reserve1",
"defName": "预留1",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "7D58C2BC-70DC-409C-B9D1-712B42C134F2"
},
{
"defKey": "reserve2",
"defName": "预留2",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "76239632-E2BF-47D0-88B6-2024097B9AF6"
},
{
"defKey": "reserve3",
"defName": "预留3",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "197588BE-B371-4B1E-AAED-98F0DBABB6F8"
},
{
"defKey": "reserve4",
"defName": "预留4",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "2B2ED735-9FD9-4AB9-B911-88A0D60B8292"
},
{
"defKey": "reserve5",
"defName": "预留5",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "F3F9FDB0-4181-45A0-9FEF-F1BF20A5CDC8"
},
{
"defKey": "parcel_list_id",
"defName": "包件清单id",
"comment": "",
"type": "VARCHAR",
"len": 20,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "4988326D-2C8A-445A-9FE9-506DDED38169"
},
{
"defKey": "stock_article_id",
"defName": "订单ID",
"comment": "",
"type": "VARCHAR",
"len": 20,
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "2452D5C0-F562-47C1-925E-6DD4FF403C1C"
},
{
"defKey": "package_code",
"defName": "包件码",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "CE5B3750-4772-4924-B741-E9F99E5F2926"
},
{
"defKey": "encoded",
"defName": "编码",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "4B821870-44FA-4B6D-93EB-5BA4A3BEAF90"
},
{
"defKey": "name",
"defName": "名称",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "03BEB6E6-5037-4017-98FD-C120B83DD73A"
},
{
"defKey": "dimensions",
"defName": "尺寸",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573",
"id": "9D7C742A-479E-41FA-9028-DB6A426C852F"
},
{
"defKey": "number",
"defName": "数量",
"comment": "",
"type": "",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E",
"id": "83F86C62-F204-4A24-BA4E-503FFB314113"
}
],
"correlations": [],
"indexes": []
}
],
"views": [],
@ -52781,7 +53290,8 @@
"E2646474-6619-49BE-849D-6A46524F011F",
"E3B3072D-E273-4E25-8E16-54665C5FF707",
"26370030-9EE7-45D5-AC1E-8202547F84A0",
"9E6A0AB6-F41E-4830-95BA-829BED345327"
"9E6A0AB6-F41E-4830-95BA-829BED345327",
"E49C4E0A-761C-48A9-AFDA-7F44465A94EA"
],
"refViews": [],
"refDiagrams": [],

Loading…
Cancel
Save