Browse Source

Merge remote-tracking branch 'origin/dev' into dev

training
caoyizhong 2 years ago
parent
commit
4e40f723d9
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java
  2. 40
      blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java
  3. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCarrierClient.java
  4. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehicleClient.java
  5. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java
  6. 21
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java
  7. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehicleClient.java
  8. 34
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml
  9. 42
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java
  10. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java
  11. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  12. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  13. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java
  14. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml
  15. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml
  16. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  17. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  18. 67
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  19. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  20. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  21. 109
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java
  22. 298
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  23. 145
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  24. 18
      blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java
  25. 30
      blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java
  26. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java
  27. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseStockVOWrapper.java

5
blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java

@ -8,7 +8,7 @@ package org.springblade.common.constant.printTemplate;
*/
public enum PrintTemplateStatusConstant {
daiqueren_1("配送任务打印模板","1"),
daiqueren_1("配送任务打印模板-市配","1"),
daiqueren_2("配载计划打印模板","2"),
daiqueren_3("运单票据打印模板","3"),
daiqueren_4("托运单模板","4"),
@ -18,7 +18,8 @@ public enum PrintTemplateStatusConstant {
daiqueren_8("货位码模板","8"),
daiqueren_9("货架码模板","9"),
daiqueren_10("包件模板","10"),
daiqueren_11("库存品包件模板","11");
daiqueren_11("库存品包件模板","11"),
daiqueren_12("配送任务打印模板-商配","12");
/**

40
blade-biz-common/src/main/java/org/springblade/common/utils/TemplateUtil.java

@ -28,24 +28,52 @@ public class TemplateUtil {
* 通过远程URL地址获取模板
* 此方法可以通过URL加载存储在远程服务器上的模板
*
* @param template
* @param map
* @param url
* @param name 模板名称
* @param map 填充内容
* @param url 模板地址
* @return
* @throws Exception
*/
public static String getTemplateByUrl(String template, Map<String, Object> map, String url) throws Exception {
public static String getTemplateByUrl(String name, Map<String, Object> map, String url) throws Exception {
Configuration cfg = new Configuration(Configuration.VERSION_2_3_30);
ByteArrayTemplateLoader byteArrayTemplateLoader = new ByteArrayTemplateLoader();
InputStream initialStream = getInputStreamByGet(url);
byteArrayTemplateLoader.putTemplate(template,
byteArrayTemplateLoader.putTemplate(name,
IOUtils.toByteArray(initialStream));
cfg.setTemplateLoader(byteArrayTemplateLoader);
cfg.setDefaultEncoding("UTF-8");
cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
cfg.setLogTemplateExceptions(false);
cfg.setClassicCompatible(true);
Template temp = cfg.getTemplate(template);
Template temp = cfg.getTemplate(name);
StringWriter stringWriter = new StringWriter();
temp.process(map, stringWriter);
stringWriter.flush();
stringWriter.close();
String result = stringWriter.getBuffer().toString();
return result;
}
/**
* 根据模板填充模板内容
* @param name 模板名称
* @param map 填充内容
* @param temlate
* @return
* @throws Exception
*/
public static String popTemplate(String name, Map<String, Object> map, String temlate) throws Exception {
Configuration cfg = new Configuration(Configuration.VERSION_2_3_30);
ByteArrayTemplateLoader byteArrayTemplateLoader = new ByteArrayTemplateLoader();
byteArrayTemplateLoader.putTemplate(name,
temlate.getBytes());
cfg.setTemplateLoader(byteArrayTemplateLoader);
cfg.setDefaultEncoding("UTF-8");
cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
cfg.setLogTemplateExceptions(false);
cfg.setClassicCompatible(true);
Template temp = cfg.getTemplate(name);
StringWriter stringWriter = new StringWriter();
temp.process(map, stringWriter);
stringWriter.flush();

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

@ -46,5 +46,6 @@ public interface IBasicdataCarrierClient {
*/
@GetMapping(TOP)
BladePage<BasicdataCarrierEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(API_PREFIX + "/getCarrierById")
BasicdataCarrierEntity getCarrierById(@RequestParam("current") Long carrierId);
}

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

@ -48,4 +48,7 @@ public interface IBasicdataVehicleClient {
@GetMapping(TOP)
BladePage<BasicdataVehicleEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping(API_PREFIX + "/getVehicleById")
BasicdataVehicleEntity getVehicleById(@RequestParam("id") Long id);
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java

@ -51,5 +51,7 @@ public class DistributionAddvalueVO extends DistributionAddvalueEntity {
private Double distance;
private Long addvalueDetailId;
}

21
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java

@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.List;
/**
@ -83,6 +84,26 @@ public class DistributionReservationVO extends DistributionReservationEntity {
private String signingStatusName;
/**
* 仓库地址
*/
@ApiModelProperty(value = "签收状态")
private String warehouseAddress;
/**
* 仓库经度
*/
@ApiModelProperty(value = "签收状态")
private BigDecimal jingdu;
/**
* 仓库纬度
*/
@ApiModelProperty(value = "签收状态")
private BigDecimal weidu;
/**

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehicleClient.java

@ -50,4 +50,9 @@ public class BasicdataVehicleClient implements IBasicdataVehicleClient {
return BladePage.of(page);
}
@Override
public BasicdataVehicleEntity getVehicleById(Long id) {
return basicdataVehicleService.getOneById(id);
}
}

34
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml

@ -200,37 +200,23 @@
sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
</select>
<select id="exportWarehouseByallocation" resultType="com.logpm.basicdata.excel.BasicdatavisualizationSheetTwo">
SELECT positionInfo,
GROUP_CONCAT(DISTINCT firsts SEPARATOR '、') firsts,
GROUP_CONCAT(DISTINCT SECOND SEPARATOR '、') SECOND,
GROUP_CONCAT(DISTINCT thirdProduct SEPARATOR '、') thirdProduct,
GROUP_CONCAT(DISTINCT orderCode SEPARATOR '、') orderCode,
GROUP_CONCAT(DISTINCT materialName SEPARATOR '、') materialName,
SUM(num) num
FROM (
SELECT lwug.position_code AS positionInfo,
CONCAT(ldpl.firsts, '(', SUM(lwug.num), ')') AS firsts,
CONCAT(ldpl.SECOND, '(', SUM(lwug.num), ')') AS SECOND,
CONCAT(ldpl.third_product, '(', SUM(lwug.num), ')') AS thirdProduct,
CONCAT(ldpl.order_code, '(', SUM(lwug.num), ')') AS orderCode,
CONCAT(ldpl.material_name, '(', SUM(lwug.num), ')') AS materialName,
SELECT
lwug.position_code AS positionInfo,
GROUP_CONCAT(ldpl.firsts SEPARATOR '、') AS firsts,
GROUP_CONCAT(ldpl.SECOND SEPARATOR '、') AS SECOND,
GROUP_CONCAT(ldpl.third_product SEPARATOR '、') AS thirdProduct,
GROUP_CONCAT(ldpl.order_code SEPARATOR '、') AS orderCode,
GROUP_CONCAT(ldpl.material_name SEPARATOR '、') AS materialName,
SUM(lwug.num) AS num
FROM
logpm_warehouse_updown_goods lwug
JOIN logpm_distribution_parcel_list ldpl
ON lwug.association_id = ldpl.id
JOIN
logpm_distribution_parcel_list ldpl ON lwug.association_id = ldpl.id
<where>
ldpl.warehouse_id =#{areaId}
</where>
GROUP BY
lwug.position_code,
ldpl.firsts,
ldpl.SECOND,
ldpl.third_product,
ldpl.order_code,
ldpl.material_name
) AS subquery
GROUP BY positionInfo
lwug.position_code;
</select>
<select id="exportWarehouseByStrip" resultType="com.logpm.basicdata.excel.BasicdatavisualizationSheetThree">
SELECT

42
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java

@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAreaEntity;
@ -57,10 +58,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -327,6 +325,13 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
List<BasicdatavisualizationSheetOne> basicdatavisualizationSheetOnes = baseMapper.exportWarehouseByorderId(areaId);
//sheetTwo
List<BasicdatavisualizationSheetTwo> basicdatavisualizationSheetTwos = baseMapper.exportWarehouseByallocation(areaId);
basicdatavisualizationSheetTwos.forEach(e->{
if (StringUtils.isNotBlank(e.getFirsts())){e.setFirsts(this.countUniqueProperties(e.getFirsts())); }
if (StringUtils.isNotBlank(e.getSecond())){e.setSecond(this.countUniqueProperties(e.getSecond()));}
if (StringUtils.isNotBlank(e.getThirdProduct())){e.setThirdProduct(this.countUniqueProperties(e.getThirdProduct()));}
if (StringUtils.isNotBlank(e.getOrderCode())){e.setOrderCode(this.countUniqueProperties(e.getOrderCode()));}
if (StringUtils.isNotBlank(e.getMaterialName())){e.setMaterialName(this.countUniqueProperties(e.getMaterialName()));}
});
//sheetThree
List<BasicdatavisualizationSheetThree> basicdatavisualizationSheetThrees = baseMapper.exportWarehouseByStrip(areaId);
//转换上架人
@ -364,4 +369,33 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
//return warehouseGoodsAreaList;
}
public String countUniqueProperties(String initial){
// 对字段进行按逗号分割后的属性去重,并拼接去重后的数量
String[] propertyArray = initial.split("、");
List<String> uniqueProperties = new ArrayList<>();
HashMap<String, Integer> propertyCounts = new HashMap<>();
for (String prop : propertyArray) {
String trimmedProp = prop.trim();
if (!uniqueProperties.contains(trimmedProp)) {
uniqueProperties.add(trimmedProp);
}
propertyCounts.put(trimmedProp, propertyCounts.getOrDefault(trimmedProp, 0) + 1);
}
StringBuilder resultBuilder = new StringBuilder();
for (String prop : uniqueProperties) {
int propCount = propertyCounts.get(prop);
if (resultBuilder.length() > 0) {
resultBuilder.append("、");
}
resultBuilder.append(prop).append(" (").append(propCount).append(")");
}
return resultBuilder.toString();
}
}

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java

@ -38,7 +38,7 @@ import java.util.Map;
@RestController
@AllArgsConstructor
@RequestMapping("/app/addvalue")
@Api(value = "签收管理", tags = "签收管理App接口")
@Api(value = "配送管理", tags = "增值服务App接口")
public class DistributionAddvalueAppController {
private final DistributionAddvalueServiceImpl distributionAddvalueService;
@ -63,8 +63,8 @@ public class DistributionAddvalueAppController {
* 扫描接口
*/
@PostMapping("/scanAddvaluePackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "增值服务扫描、输入包件码", notes = "DistributionAppDeliveryListDTO")
public R scanAddvaluePackage(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.scanAddvaluePackage(distributionAppAddvalueDTO);
return r;
@ -76,8 +76,8 @@ public class DistributionAddvalueAppController {
* 全部包件
*/
@PostMapping("/getAllPackageList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "查询该客户下的所有配送包件信息", notes = "DistributionAppDeliveryListDTO")
public List<DistributionAddvaluePackageEntity> getAllPackageList(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageEntity> allPackageList = distributionAddvalueService.getAllPackageList(distributionAppAddvalueDTO);
return allPackageList;
@ -87,8 +87,8 @@ public class DistributionAddvalueAppController {
* 保存增值服务
*/
@PostMapping("/saveAddvalueInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "保存增值服务项", notes = "DistributionAppDeliveryListDTO")
public R saveAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.saveAddvalueInfo(distributionAppAddvalueDTO);
return r;
@ -99,8 +99,8 @@ public class DistributionAddvalueAppController {
* 编辑保存
*/
@PostMapping("/updateAddvalueInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改增值服务项保存", notes = "DistributionAppDeliveryListDTO")
public R updateAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.updateAddvalueInfo(distributionAppAddvalueDTO);
return r;
@ -112,8 +112,8 @@ public class DistributionAddvalueAppController {
* 查询编辑增值服务数据
*/
@PostMapping("/editAddvalueInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询增值服务列表", notes = "DistributionAppDeliveryListDTO")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "查询编辑增值服务列表数据", notes = "DistributionAppDeliveryListDTO")
public R editAddvalueInfo(@Valid @RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
R r =distributionAddvalueService.editAddvalueInfo(distributionAppAddvalueDTO);
return r;

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

@ -345,11 +345,11 @@ public class DistributionDeliveryListController extends BladeController {
@PostMapping("/printBatch")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "批量打印", notes = "ids")
public R<PrintPreviewVO> printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
@ApiOperation(value = "批量打印")
public R<List<PrintPreviewVO>> printBatch(@ApiParam(value = "主键集合", required = true) @RequestParam String ids ,@ApiParam(value = "打印类型", required = true) @RequestParam Integer type) {
try {
PrintPreviewVO printPreviewVOS = distributionDeliveryListService.printBatch(ids);
List<PrintPreviewVO> printPreviewVOS = distributionDeliveryListService.printBatch(ids,type);
return R.data(printPreviewVOS);
} catch (Exception e) {
throw new RuntimeException(e);

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

@ -221,9 +221,9 @@ public class DistributionReservationController extends BladeController {
@GetMapping("/getReservationAddr")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "查询指定预约信息地址")
public R<IPage<DistributionReservationVO>> getReservationAddr(@ApiParam(value = "主键集合", required = true)@RequestParam String ids) {
IPage<DistributionReservationEntity> result = reservationService.getReservationAddr(ids);
return R.data(DistributionReservationWrapper.build().pageVO(result));
public R<List<DistributionReservationVO>> getReservationAddr(@ApiParam(value = "主键集合", required = true)@RequestParam String ids) {
List<DistributionReservationVO> result = reservationService.getReservationAddr(ids);
return R.data(result);
}
/**

22
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java

@ -46,6 +46,20 @@ public class DistributionAppAddvalueDTO extends TenantEntity {
private String barcode;
/**
* 扫描码
*/
@ApiModelProperty(value = "扫描码")
private List<Long> packageListIds;
/**
* 是否手动 1 - 2-
*/
@ApiModelProperty(value = "是否手动")
private Integer isManual;
/**
* 配送任务Id
*/
@ -121,6 +135,14 @@ public class DistributionAppAddvalueDTO extends TenantEntity {
private BigDecimal fee;
/**
* 公里数
*/
@ApiModelProperty(value = "公里数")
// @NotEmpty(message = "客户Id不能为空")
private Long addvalueDetailId;

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

@ -29,6 +29,7 @@
lda.addvalue_id,
group_concat(DISTINCT ldad.fee) AS fee,
group_concat(DISTINCT ldad.num) AS num,
group_concat(DISTINCT ldad.id) AS addvalueDetailId,
group_concat(DISTINCT ldad.flool_num) AS floolNum,
group_concat(DISTINCT ldad.distance) AS distance,
group_concat( ldap.id SEPARATOR ',' ) AS packageListIds
@ -60,6 +61,7 @@
ldad.num AS num,
ldad.flool_num AS floolNum,
ldad.distance AS distance,
ldad.id AS addvalueDetailId,
GROUP_CONCAT(ldap.package_id) AS packageListIds
FROM
logpm_distribution_addvalue AS lda
@ -67,7 +69,7 @@
INNER JOIN logpm_distribution_addvalue_package AS ldap ON ldad.id = ldap.addvalue_detail_id
WHERE
lda.ref_id = #{reservationId} and lda.addvalue_id = #{addvalueType}
GROUP BY ldad.fee,ldad.num,ldad.flool_num,ldad.distance
GROUP BY ldad.fee,ldad.num,ldad.flool_num,ldad.distance,ldad.id
</select>

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

@ -32,10 +32,10 @@
<delete id="deleteAddvalueDetail">
</delete>
<delete id="deleteAddvaluePackageList">
DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId}
DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and addvalue_detail_id = #{addvalueDetailId}
</delete>
<delete id="deleteAddvaluePackage">
DELETE FROM logpm_diatribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId}
DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId}
</delete>
<select id="selectDistributionAddvaluePackagePage" resultMap="distributionAddvaluePackageResultMap">
select * from logpm_distribution_addvalue_package where is_deleted = 0

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

@ -231,6 +231,9 @@
ldsa.consignee_address,
ldsa.consignee_mobile,
ldsa.order_status,
ldsa.customer_name,
ldsa.customer_telephone,
ldsa.customer_address,
ldsa.description_goods descriptionGoods,
(

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

@ -29,6 +29,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 预约列表 Mapper 接口
@ -172,14 +173,14 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @param reservationId
* @return
*/
List<DistributionAddvaluePackageEntity> selectAppInventoryListByReservation(@Param("reservationId") Long reservationId);
List<DistributionAddvaluePackageEntity> selectAppInventoryListByReservation(@Param("reservationId") Long reservationId,List<Long> packageListIds);
/**
* 查询客户下的包件信息
* @param reservationId
* @return
*/
List<DistributionAddvaluePackageEntity> selectAppPackageListByReservationId(@Param("reservationId")Long reservationId);
List<DistributionAddvaluePackageEntity> selectAppPackageListByReservationId(@Param("reservationId")Long reservationId,List<Long> packageListIds);
/**
* 查询出客户下的库存品订单维度信息
@ -210,4 +211,14 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @return
*/
List<DistributionReservationEntity> findByDeliveryId(@Param("id")Long id);
List<Map<String, Object>> findAllCategoryNum(@Param("id") Long reservationId);
List<String> getAllocationByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
List<String> getStockupAreaByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
List<String> getMaterialNameByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
List<Map<String, Object>> getCategoryByStockArticleIdAndReservationId(@Param("stockArticleId") Long stockArticleId, @Param("reservationId") Long reservationId);
}

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

@ -722,7 +722,10 @@
INNER JOIN logpm_dis_stock_list_detail AS ldsld ON ldr.id = ldsld.reservation_id
INNER JOIN logpm_distribution_stock_list AS ldsl ON ldsl.id = ldsld.stock_list_id
WHERE
ldr.id = #{reservationId} and ldsld.stock_package_status in ('1','3')
ldr.id = #{reservationId} and ldsld.stock_package_status in ('1','3') and ldsld.id not in
<foreach collection="packageListIds" item="id" open="(" close=")" index="i" separator=",">
#{id}
</foreach>
</select>
<select id="selectAppPackageListByReservationId"
resultType="com.logpm.distribution.entity.DistributionAddvaluePackageEntity">
@ -746,7 +749,11 @@
logpm_distribution_reservation_package AS ldrs
INNER JOIN logpm_distribution_parcel_list AS ldpl ON ldrs.parce_list_id = ldpl.id
WHERE
ldrs.packet_bar_status IN ('1','3') and reservation_id = #{reservationId}
ldrs.packet_bar_status IN ('1','3') and reservation_id = #{reservationId} and ldpl.id not in
<foreach collection="packageListIds" item="id" open="(" close=")" index="i" separator=",">
#{id}
</foreach>
</select>
<select id="selectStockListByReservationId"
resultType="com.logpm.distribution.entity.DistributionReservationStocklistEntity">
@ -909,4 +916,60 @@
</select>
<select id="findAllCategoryNum" resultType="java.util.Map">
select IFNULL(ldpl.third_product,'其他') thirdName,
count(ldpl.id) num
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where 1=1
and ldrp.reservation_id = #{id}
and ldrp.packet_bar_status in (1,3)
group by IFNULL(ldpl.third_product,'其他')
</select>
<select id="getAllocationByStockArticleIdAndReservationId" resultType="java.lang.String">
select CONCAT(lwug.area_title,'-',lwug.shelf_title,'-',lwug.allocation_title)
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
left join logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
and lwug.id is not null
</select>
<select id="getStockupAreaByStockArticleIdAndReservationId" resultType="java.lang.String">
select ldss.stockup_area
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
left join logpm_distribution_stockup_scan ldss on ldss.parcel_list_id = ldpl.id
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
and ldss.reservation_id = #{reservationId}
and ldss.id is not null
group by ldss.stockup_area
</select>
<select id="getMaterialNameByStockArticleIdAndReservationId" resultType="java.lang.String">
select CONCAT(ldpl.material_name,'(',count(ldpl.id),')')
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
group by ldpl.material_name
</select>
<select id="getCategoryByStockArticleIdAndReservationId" resultType="java.util.Map">
select IFNULL(ldpl.third_product,'其他') thirdProduct,
count(ldpl.id) num
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}
group by IFNULL(ldpl.third_product,'其他')
</select>
</mapper>

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

@ -225,5 +225,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param ids
* @return
*/
PrintPreviewVO printBatch(String ids) throws Exception;
List<PrintPreviewVO> printBatch(String ids,Integer type) throws Exception;
void testData(String s) throws Exception;
}

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

@ -84,6 +84,26 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
String bianMa();
/**
* 预约编码
* @return
*/
String reservationMa();
/**
* 配送编码
* @return
*/
String deliveryListMa();
/**
* 配送编码
* @return
*/
String trainNumberMa();
/**
* 批量预约转备货任务
* @param stockUpInfo 备货信息
@ -97,7 +117,7 @@ public interface IDistributionReservationService extends BaseService<Distributio
* @param ids id字符串
* @return
*/
IPage<DistributionReservationEntity> getReservationAddr(String ids);
List<DistributionReservationVO> getReservationAddr(String ids);
/**
* 批量转配送任务

109
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java

@ -103,6 +103,17 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
//该客户不存在包件信息
return Resp.scanFail("客户信息有误!!!", "客户信息有误");
}
List<Long> packageListIds = distributionAppAddvalueDTO.getPackageListIds();
Integer isManual = distributionAppAddvalueDTO.getIsManual();
List<DistributionParcelListEntity> collect1 = parcelListEntityList.stream().filter(p -> packageListIds.contains(p.getId())).collect(Collectors.toList());
if (collect1.size() == 1 ){
return Resp.scanFail("重复扫描", "重复扫描");
}
List<DisStockListDetailEntity> collect2 = detailEntities.stream().filter(i -> packageListIds.contains(i.getId())).collect(Collectors.toList());
if (collect2.size() == 1 ){
return Resp.scanFail("重复扫描", "重复扫描");
}
List<DistributionParcelListEntity> packageInfo = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(distributionAppAddvalueDTO.getBarcode())).collect(Collectors.toList());
// DistributionAddvaluePackageEntity distributionAddvaluePackageEntiy = new DistributionAddvaluePackageEntity();
if (Func.isNotEmpty(packageInfo) && packageInfo.size() == 1) {
@ -115,7 +126,10 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
distributionAddvaluePackageEntiy.setReservationId(distributionAppAddvalueDTO.getReservationId());
distributionAddvaluePackageEntiy.setStockArticleId(parcelListEntity.getStockArticleId());
distributionAddvaluePackageEntiy.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
distributionAddvaluePackageEntiy.setRecordType("1");
distributionAddvaluePackageEntiy.setRecordType("2");
if (isManual.equals(2)){
distributionAddvaluePackageEntiy.setRecordType("3");
}
return Res.scanSuccess("扫描成功", "扫描成功", distributionAddvaluePackageEntiy);
} else if (packageInfo.size() == 0) {
//包件列表不存在,这里查询看库存品是否存在?
@ -131,7 +145,10 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
distributionAddvaluePackageEntiy.setReservationId(distributionAppAddvalueDTO.getReservationId());
distributionAddvaluePackageEntiy.setStockArticleId(disStockListDetailEntity.getStockListId());
distributionAddvaluePackageEntiy.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode());
distributionAddvaluePackageEntiy.setRecordType("1");
distributionAddvaluePackageEntiy.setRecordType("2");
if (isManual.equals(2)){
distributionAddvaluePackageEntiy.setRecordType("3");
}
return Res.scanSuccess("扫描成功", "扫描成功", distributionAddvaluePackageEntiy);
} else if (inventoryInfo.size() == 0) {
//该客户下既不存在该包件,也不存在该库存品 ---
@ -173,7 +190,13 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
if (Func.isEmpty(packageEntityList)) {
return Resp.scanFail("请添加包件", "请添加包件");
}
DistributionAddvalueDetailEntity distributionAddvalueDetailEntity = new DistributionAddvalueDetailEntity();
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "错误的包件数量");
}else {
distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
}
// 上楼 超区 平移 搬运 分拣 专车
switch (distributionAppAddvalueDTO.getAddvalueType()) {
case "1":
@ -197,13 +220,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "4":
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "请输入件数");
} else {
distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
}
break;
// case "4" :
// case "5":
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "请输入件数");
@ -237,82 +254,91 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
@Override
public List<DistributionAddvaluePackageEntity> getAllPackageList(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageEntity> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
// List<DistributionAddvaluePackageEntity> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
List<Long> packageListIds = distributionAppAddvalueDTO.getPackageListIds();
Long reservationId = distributionAppAddvalueDTO.getReservationId();
List<DistributionAddvaluePackageEntity> parcelListEntities = distributionReservationMapper.selectAppPackageListByReservationId(reservationId);
List<DistributionAddvaluePackageEntity> detailEntities = distributionReservationMapper.selectAppInventoryListByReservation(reservationId);
List<DistributionAddvaluePackageEntity> parcelListEntities = distributionReservationMapper.selectAppPackageListByReservationId(reservationId,packageListIds);
List<DistributionAddvaluePackageEntity> detailEntities = distributionReservationMapper.selectAppInventoryListByReservation(reservationId,packageListIds);
parcelListEntities.addAll(detailEntities);
if (Func.isEmpty(parcelListEntities)) {
log.error("################该客户下包件信息:{}", parcelListEntities);
log.error("################该客户下库存品包件信息:{}", detailEntities);
// return R.fail("服务器正忙....");
}
List<DistributionAddvaluePackageEntity> entityList = null;
if (Func.isNotEmpty(packageEntityList)) {
entityList = parcelListEntities.stream().filter(p1 -> packageEntityList.stream().noneMatch(p2 -> p2.equals(p1.getId()))).collect(Collectors.toList());
if (Func.isEmpty(entityList)) {
log.error("################该客户下库存品包件信息:{}", detailEntities);
log.error("################该客户下包件信息:{}", parcelListEntities);
}
} else {
entityList = parcelListEntities;
}
if (Func.isNotEmpty(parcelListEntities)){
parcelListEntities.stream().forEach(p->{p.setRecordType("1");});
}
// List<DistributionAddvaluePackageEntity> entityList = null;
// if (Func.isNotEmpty(packageEntityList)) {
// entityList = parcelListEntities.stream().filter(p1 -> packageEntityList.stream().noneMatch(p2 -> p2.equals(p1.getId()))).collect(Collectors.toList());
// if (Func.isEmpty(entityList)) {
// log.error("################该客户下库存品包件信息:{}", detailEntities);
// log.error("################该客户下包件信息:{}", parcelListEntities);
// }
// } else {
// entityList = parcelListEntities;
// }
return entityList;
return parcelListEntities;
}
@Override
@Transactional
public R updateAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageEntity> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
//这里需要查询出原来的增值服务项详情
DistributionAddvalueDetailEntity distributionAddvalueDetailEntity = new DistributionAddvalueDetailEntity();
// DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
DistributionAddvalueDetailEntity detailEntity = distributionAddvalueDetailMapper.selectById(distributionAppAddvalueDTO.getAddvalueDetailId());
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "错误的包件数量");
// }else {
// distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
// }
// 上楼 超区 平移 搬运 分拣 专车
switch (distributionAppAddvalueDTO.getAddvalueType()) {
case "1":
if (Func.isEmpty(distributionAppAddvalueDTO.getFloolNum())) {
return Resp.scanFail("添加失败", "请输入楼层数");
} else {
distributionAddvalueDetailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum());
detailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum());
}
break;
case "2":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入超区公里数");
} else {
distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "3":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入平移距离");
} else {
distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "4":
case "5":
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "请输入件数");
} else {
distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
detailEntity.setNum(distributionAppAddvalueDTO.getNum());
}
break;
// case "5":
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "请输入件数");
// } else {
// distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
// }
// break;
case "6":
if (Func.isEmpty(distributionAppAddvalueDTO.getFee())) {
return Resp.scanFail("添加失败", "请输入件数");
return Resp.scanFail("添加失败", "错误的包件数量");
} else {
distributionAddvalueDetailEntity.setFee(distributionAppAddvalueDTO.getFee());
detailEntity.setFee(distributionAppAddvalueDTO.getFee());
}
break;
default:
return Resp.scanFail("添加失败", "服务器正忙");
}
distributionAddvalueDetailMapper.updateById(detailEntity);
if (Func.isEmpty(packageEntityList) && packageEntityList.size() == 0) {
//没有包件信息,对该增值服务进行清除
DistributionAddvalueEntity distributionAddvalueEntity = distributionAddvalueMapper.selectOne(Wrappers.<DistributionAddvalueEntity>query().lambda()
@ -329,7 +355,9 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isNotEmpty(packageListIds)) {
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.listByIds(Func.toLongList(packageListIds));
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.in(DistributionAddvaluePackageEntity::getPackageId,Func.toLongList(packageListIds))
.eq(DistributionAddvaluePackageEntity::getAddvalueDetailId,distributionAppAddvalueDTO.getAddvalueDetailId()));
Map<Long, List<DistributionAddvaluePackageEntity>> oldPackageList = distributionAddvaluePackageEntities.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
Map<Long, List<DistributionAddvaluePackageEntity>> newPackageList = packageEntityList.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
newPackageList.forEach((k, v) -> {
@ -343,7 +371,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
oldPackageList.remove(k);
}
});
if (Func.isEmpty(oldPackageList)) {
if (Func.isNotEmpty(oldPackageList)) {
//进行删除,这里删除的时候需要考虑是否删除增值服务项,是否删除整个关于该客户的增值服务信息
oldPackageList.forEach((m, n) -> {
//进行删除
@ -362,13 +390,14 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
@Override
public R editAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
if (Func.isNotEmpty(addvalueVO)){
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isNotEmpty(packageListIds)){
List<Long> longs = Func.toLongList(packageListIds);
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.listByIds(longs);
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.<DistributionAddvaluePackageEntity>query().lambda().in(DistributionAddvaluePackageEntity::getPackageId,longs).eq(DistributionAddvaluePackageEntity::getAddvalueDetailId,addvalueVO.getAddvalueDetailId()));
addvalueVO.setPackageEntityList(distributionAddvaluePackageEntities);
}
}
return R.data(addvalueVO);
}

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

@ -17,6 +17,8 @@
package com.logpm.distribution.service.impl;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -28,7 +30,9 @@ import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataCarrierClient;
import com.logpm.basicdata.feign.IBasicdataDriverArteryClient;
import com.logpm.basicdata.feign.IBasicdataVehicleClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.dto.*;
@ -60,12 +64,15 @@ import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.constant.reservation.*;
import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.serviceConstant.ServiceConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -84,6 +91,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@ -137,6 +145,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private final DistributionStockListMapper distributionStockListMapper;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
private final IBasicPrintTemplateClient basicPrintTemplateClient;
private final IBasicdataVehicleClient basicdataVehicleClient;
private final IBasicdataCarrierClient basicdataCarrierClient;
@Override
public IPage<DistributionDeliveryListEntity> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListEntity> page, DistributionDeliveryListDTO distributionDeliveryList) {
@ -218,7 +228,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionStockupVO> distributionStockupVOList = distributionStockupMapper.getMarketDeliveryStockupInfo(detail.getId());
//这里需要处理一下
if (distributionStockupVOList.size() > 1) {
Date outboundDate = distributionStockupVOList.stream().filter(o -> o.getOutboundDate() != null).max(Comparator.comparing(DistributionStockupVO::getOutboundDate)).get().getOutboundDate();
// Date outboundDate = distributionStockupVOList.stream().filter(o -> o.getOutboundDate() != null).max(Comparator.comparing(DistributionStockupVO::getOutboundDate)).get().getOutboundDate();
HashSet<String> forkliftName = new HashSet<>();
HashSet<String> loaderName = new HashSet<>();
HashSet<String> stockUser = new HashSet<>();
@ -241,7 +251,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionStockupVO.setForkliftName(String.join(",", forkliftName));
distributionStockupVO.setStockupArea(String.join(",", goodsArea));
distributionStockupVO.setStockupUser(String.join(",", stockUser));
distributionStockupVO.setOutboundDate(outboundDate);
// distributionStockupVO.setOutboundDate(outboundDate);
distributionDeliveryListVO.setStockupInfo(distributionStockupVO);
} else {
@ -1791,19 +1801,37 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询客户
List<DistributionAppReservationVO> customList = distributionDeliveryInfoMapper.selectAppcustomListPage(page, distributionDeliveryList.getId());
for (DistributionAppReservationVO distributionAppReservationVO : customList) {
//查询备货是否完成
int aLong = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda()
.eq(DistributionStockEntity::getReservationId, distributionAppReservationVO.getId())
.eq(DistributionStockEntity::getType, 1)
).intValue();
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppReservationVO.getId());
List<DisStockListDetailEntity> stockListDetailEntityList = distributionReservationMapper.selectInventoryListByReservation(distributionAppReservationVO.getId());
boolean stockArticleStockupStatus = parcelListEntities.stream().allMatch(s -> Func.isNotEmpty(s.getOrderPackageStockupStatus()) && s.getOrderPackageStockupStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue()));
boolean inventoryStockupStatus = stockListDetailEntityList.stream().allMatch(i -> Func.isNotEmpty(i.getStockPackageCode()));
if (stockArticleStockupStatus && inventoryStockupStatus ){
distributionAppReservationVO.setIsstock("是");
distributionAppReservationVO.setIsload("是");
if (aLong < distributionAppReservationVO.getReservationNum()) {
}else {
distributionAppReservationVO.setIsstock("否");
}
if (distributionAppReservationVO.getLoadingNub() < distributionAppReservationVO.getReservationNum()) {
boolean stockArticleLoadingStatus = parcelListEntities.stream().allMatch(s -> Func.isNotEmpty(s.getOrderPackageLoadingStatus()) && s.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
boolean inventoryLoadingStatus = stockListDetailEntityList.stream().allMatch(i -> Func.isNotEmpty(i.getStockPackageCode()) && i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue()));
if (stockArticleLoadingStatus && inventoryLoadingStatus){
distributionAppReservationVO.setIsload("是");
}else {
distributionAppReservationVO.setIsload("否");
}
// //查询备货是否完成
// int aLong = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda()
// .eq(DistributionStockEntity::getReservationId, distributionAppReservationVO.getId())
// .eq(DistributionStockEntity::getType, 1)
// ).intValue();
// distributionAppReservationVO.setIsstock("是");
// distributionAppReservationVO.setIsload("是");
// if (aLong < distributionAppReservationVO.getReservationNum()) {
// distributionAppReservationVO.setIsstock("否");
// }
// if (distributionAppReservationVO.getLoadingNub() < distributionAppReservationVO.getReservationNum()) {
// distributionAppReservationVO.setIsload("否");
// }
}
return page.setRecords(customList);
}
@ -3154,42 +3182,227 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public PrintPreviewVO printBatch(String ids) throws Exception {
public List<PrintPreviewVO> printBatch(String ids, Integer type) throws Exception {
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
List<Map> data = new ArrayList<>();
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue());
if (ObjectUtil.isEmpty(template)) {
throw new ServiceException("模板内容未找到");
}
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
printPreviewVO.setTemplateHtml(html);
printPreviewVO.setTemplateId(template.getId());
BasicPrintTemplateEntity template = getPrintTemplate(type);
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
// printPreviewVO.setTemplateHtml(html);
// printPreviewVO.setTemplateId(template.getId());
String[] idArray = ids.split(",");
if (ObjectUtils.isNull(idArray)) {
throw new ServiceException("参数错误");
}
if (2 == type) {
return handleShiPeiData(template, idArray,html);
} else if (1 == type) {
return handleShangPeiData(template.getId(), idArray,html);
} else {
log.warn("###########printBatch: 未知的打印类型");
throw new CustomerException(403, "未知的打印类型");
}
}
for (String id : idArray) {
@Override
public void testData(String s) throws Exception {
String[] split = s.split(",");
handleShangPeiData(1111L, split,"111");
}
// 获取需要的数据
private List<PrintPreviewVO> handleShangPeiData(Long templateId, String[] idArray,String html) throws Exception {
List<PrintPreviewVO> result = new ArrayList<>();
List<Map<String,Object>> test = new ArrayList<>();
for (String id : idArray) {
//查询对应配送单
DistributionDeliveryListEntity deliveryListEntity = baseMapper.selectById(id);//配送单
if(Objects.isNull(deliveryListEntity)){
log.warn("#########handleShangPeiData: 配送单信息不存在 deliveryListEntityId={}",id);
throw new CustomerException(403,"配送单信息不存在");
}
Long deliveryListEntityId = deliveryListEntity.getId();
String taskTime = deliveryListEntity.getTaskTime();//配送时间
String kind = deliveryListEntity.getKind();
String dirverName = "";
String dirverPhone = "";
String carNumber = "";
if("1".equals(kind)){
QueryWrapper<DistributionDeliverySelfEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("delivery_id",deliveryListEntityId);
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliverySelfService.getOne(queryWrapper);
dirverName = deliverySelfEntity.getDriverName();
dirverPhone = deliverySelfEntity.getDriverPhone();
carNumber = deliverySelfEntity.getVehicleNub();
}else if("2".equals(kind)){
QueryWrapper<DistributionDeliveryTripartiteEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("delivery_id",deliveryListEntityId);
DistributionDeliveryTripartiteEntity deliveryTripartiteEntity = distributionDeliveryTripartiteService.getOne(queryWrapper);
dirverName = deliveryTripartiteEntity.getDriverName();
dirverPhone = deliveryTripartiteEntity.getDriverPhone();
carNumber = deliveryTripartiteEntity.getVehicleNum();
}
List<DistributionReservationEntity> distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(deliveryListEntityId);
//循环查询出来的预约单
for (DistributionReservationEntity reservationEntity:distributionReservationEntityList){
Map<String,Object> map = new HashMap<>();
map.put("配送单号", reservationEntity.getReservationCode());
String fileTypeName = QRCodeUtil.createCodeToFile(reservationEntity.getReservationCode());
map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName));
map.put("收货单单位",reservationEntity.getReceivingUnit());//收货单单位
map.put("商场名称",reservationEntity.getStoreName());//商场名称
map.put("收货人",reservationEntity.getConsignee());//收货人
map.put("收货人电话",reservationEntity.getDeliveryPhone());//收货人电话
map.put("收货人地址",reservationEntity.getDeliveryAddress());//收货人地址
map.put("配送时间",taskTime);//配送时间
map.put("承运商",deliveryListEntity.getDistributionCompany());
map.put("配送仓库",deliveryListEntity.getWarehouseName());
map.put("出库时间",deliveryListEntity.getWarehouseName());
map.put("送货司机",dirverName+"/"+dirverPhone);
map.put("车牌号",carNumber);
Long reservationId = reservationEntity.getId();//预约id
//通过预约id查询所有包件并按三级品类分组
List<Map<String,Object>> categoryList = distributionReservationMapper.findAllCategoryNum(reservationId);
//计算一个总计
Map<String,Object> total = new HashMap<>();
Integer totalNum = 0;
for (Map<String,Object> m:categoryList){
Set<String> set = m.keySet();
String categoryName = "";
Long num = 0L;
for (String s:set){
if("num".equals(s)){
num = (Long)m.get(s);
totalNum = totalNum + num.intValue();
}else{
categoryName = (String)m.get(s);
}
}
total.put(categoryName,num);
}
total.put("合计件数",totalNum);
//先查询预约单对应有哪些订单
QueryWrapper<DistributionReservationStockarticleEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("reservation_id",reservationId);
List<DistributionReservationStockarticleEntity> reservationStockarticleList = distributionReservationStockarticleService.list(queryWrapper);
List<Map<String,Object>> ls = new ArrayList<>();
BigDecimal totalPrice = BigDecimal.ZERO;
for (int i = 0; i < reservationStockarticleList.size(); i++) {
DistributionReservationStockarticleEntity reservationStockarticleEntity = reservationStockarticleList.get(i);
Long stockArticleId = reservationStockarticleEntity.getStockArticleId();//订单id
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(stockArticleId);
if(Objects.isNull(stockArticleEntity)){
log.warn("#########handleShangPeiData: 订单信息不存在 stockArticleId={}",stockArticleId);
throw new CustomerException(403,"订单信息不存在");
}
Map<String,Object> orderMap = new HashMap<>();
orderMap.put("序号",i+1);
orderMap.put("运单号",stockArticleEntity.getWaybillNumber());
orderMap.put("合同号",stockArticleEntity.getOrderCode());
//通过订单id和预约id查询对应包件的库位信息
List<String> allocationStrList = distributionReservationMapper.getAllocationByStockArticleIdAndReservationId(stockArticleId,reservationId);
String allocationStr = StringUtils.join(allocationStrList, ",");
orderMap.put("货位",allocationStr);
//通过订单id和预约id查询对应包件的备货区信息
List<String> stockupAreaStrList = distributionReservationMapper.getStockupAreaByStockArticleIdAndReservationId(stockArticleId,reservationId);
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ",");
orderMap.put("备货区",stockupAreaStr);
//查询当前订单的品类数量
List<Map<String,Object>> mapList = distributionReservationMapper.getCategoryByStockArticleIdAndReservationId(stockArticleId,reservationId);
Map<String,Object> numObj = new HashMap<>();
Integer tn = 0;
Set<String> set = total.keySet();
for (String key:set){
if(!"合计件数".equals(key)){
numObj.put(key,0);
for (Map<String,Object> m:mapList){
String thirdProduct = (String)m.get("thirdProduct");
Long num = (Long)m.get("num");
if(thirdProduct.equals(key)){
numObj.put(key,num);
tn = tn + num.intValue();
}
}
}
}
numObj.put("合计数量",tn);
orderMap.put("产品明细",numObj);
//通过订单id和预约id查询对应包件的物料信息
List<String> materialNameStrList = distributionReservationMapper.getMaterialNameByStockArticleIdAndReservationId(stockArticleId,reservationId);
String materialNameStr = StringUtils.join(materialNameStrList, ",");
orderMap.put("物料名称",materialNameStr);
orderMap.put("到付运费",0);//todo 需要累加到totalPrice上
ls.add(orderMap);
}
total.put("到付费用",totalPrice);
map.put("明细",ls);
map.put("合计",total);
test.add(map);
String popHtml =TemplateUtil.popTemplate("商配配配送单",map,html);
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
printPreviewVO.setTemplateId(templateId);
printPreviewVO.setTemplateHtml(popHtml);
result.add(printPreviewVO);
}
}
log.info("#############test: test={}",test);
String s = JSON.toJSONString(test);
JSONArray array= JSONArray.parseArray(JSON.toJSONString(test));
return result;
}
/**
* 得到填充内容
* @param template
* @param idArray
* @param html
* @return
* @throws Exception
*/
private List<PrintPreviewVO> handleShiPeiData(BasicPrintTemplateEntity template, String[] idArray,String html) throws Exception {
List<PrintPreviewVO> result = new ArrayList<>();
List<Map> data = new ArrayList<>();
for (String id : idArray) {
// 获取需要的数据
DistributionDeliveryListEntity byId = this.getById(id);
if (ObjectUtils.isNull(byId)) {
throw new ServiceException("未找到相关数据");
}
//查询这个配送下面的预约单
List<DistributionReservationEntity> distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(byId.getId());
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) {
if (distributionReservationEntityList.isEmpty()) {
throw new ServiceException("未找到相关数据");
}
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) {
Map<String, Object> map = new HashMap<>();
log.debug(">>>> distributionReservationEntity {}",distributionReservationEntity);
map.put("配送单号", distributionReservationEntity.getReservationCode());
// todo 商场电话是否需要查询商场信息得到电话
String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode());
map.put("配送单二维码",QRCodeUtil.getEmpAutograph(fileTypeName));
// todo 查询运单的收货人电话
map.put("商场名称", distributionReservationEntity.getMallName());
map.put("商场电话", distributionReservationEntity.getReservationCode());
map.put("送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " 全天");
@ -3203,32 +3416,40 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// 通过预约单查询预约下面的订单 --1 或者 库存品 --2
List<Map<String, Object>> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1);
map.put("定制品集合", spaclOrderList);
map.put("备注", distributionReservationEntity.getRemarks());
}
map.put("送货司机", byId.getTrainNumber() + "/" + byId.getDriverName());
map.put("送货司机", byId.getVehicleName() + "/" + byId.getDriverName());
data.add(map);
String popHtml =TemplateUtil.popTemplate("市配配送单",map,html);
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
printPreviewVO.setTemplateId(template.getId());
printPreviewVO.setTemplateHtml(popHtml);
result.add(printPreviewVO);
}
}
return result;
}
return printPreviewVO;
private BasicPrintTemplateEntity getPrintTemplate(Integer type) {
BasicPrintTemplateEntity template = null;
if (2 == type) {
template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_1.getValue());
} else if (1 == type) {
template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_12.getValue());
}
if (ObjectUtil.isEmpty(template)) {
throw new ServiceException("模板内容未找到");
}
return template;
}
/**
* 构建预约单下面的订单信息
*
* @param id 预约单ID
* @param distributionReservationEntity 预约单
* @param i 构建类型 1 表示订单 2 表示库存品
* @return List
*/
@ -3258,6 +3479,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
temp.put("数量", distributionReservationStockarticleEntity.getReservationNum());
temp.put("备货区", null);
//todo 这里还没完成
temp.put("货位", null);
result.add(temp);

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

@ -462,8 +462,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//统计数量
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee);
String random = Func.random(13, RandomType.ALL);
reservationEntity.setReservationCode(random);
reservationEntity.setReservationCode(reservationMa());
//设置预约为市配
reservationEntity.setDeliveryType(DistributionTypeConstant.shipie.getValue());
reservationEntity.setReservationNum(packageTotal.get());
@ -512,11 +511,83 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return sb.toString();
}
@Override
public String reservationMa() {
StringBuilder sb = new StringBuilder();
sb.append("YY");
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId());
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "YY" + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "YY" + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
@Override
public String deliveryListMa() {
StringBuilder sb = new StringBuilder();
sb.append("PS");
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId());
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "PS" + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "PS" + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
@Override
public String trainNumberMa() {
StringBuilder sb = new StringBuilder();
sb.append("PSCC");
BladeUser user = AuthUtil.getUser();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
String format1 = format.format(new Date());
BasicdataWarehouseEntity warehouseByDepartment = basicdataWarehouseClient.getWarehouseByDepartment(user.getDeptId());
if (ObjectUtil.isNotEmpty(warehouseByDepartment)) {
sb.append(warehouseByDepartment.getWarehouseCode());
sb.append(format1);
String s = "PSCC" + warehouseByDepartment.getWarehouseCode();
String s1 = jiShuan(s);
sb.append(s1);
} else {
sb.append("00000");
sb.append(format1);
String s = "PSCC" + "00000";
String s1 = jiShuan(s);
sb.append(s1);
}
return sb.toString();
}
private String jiShuan(String s) {
String n = "00001";
if (Func.notNull(bladeRedis.get(s))) {
Object o1 = bladeRedis.get(s);
int anInt = Integer.parseInt(String.valueOf(o1));
if (anInt < 10) {
if (anInt + 1 == 10) {
@ -530,7 +601,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
} else {
n = String.format("000%d", anInt + 1);
}
} else if (anInt < 1000) {
if (anInt + 1 == 1000) {
n = String.format("0%d", anInt + 1);
@ -629,26 +699,38 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
@Override
public IPage<DistributionReservationEntity> getReservationAddr(String ids) {
public List<DistributionReservationVO> getReservationAddr(String ids) {
if (Func.isBlank(ids)) {
return null;
}
String[] split = ids.split(",");
List<DistributionReservationEntity> distributionReservationVOS = new ArrayList<>();
if (split.length == 1) {
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(ids);
distributionReservationVOS.add(reservationEntity);
} else {
for (String s : split) {
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(s);
distributionReservationVOS.add(reservationEntity);
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
List<DistributionReservationVO> reservationVOList = null;
if (Func.isNotEmpty(myCurrentWarehouse)){
List<Long> longs = Func.toLongList(ids);
List<DistributionReservationEntity> reservationEntityList = this.listByIds(longs);
reservationVOList = DistributionReservationWrapper.build().listVO(reservationEntityList);
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(reservationVOList.get(0).getWarehouseId());
if (Func.isNotEmpty(entityWarehouseId)){
reservationVOList.stream().forEach(r->{r.setJingdu(entityWarehouseId.getLongitude());r.setWeidu(entityWarehouseId.getLatitude());});
}
}
Page<DistributionReservationEntity> distributionReservationVOPage = new Page<>();
Page<DistributionReservationEntity> resultPage = distributionReservationVOPage.setRecords(distributionReservationVOS);
return resultPage;
// String[] split = ids.split(",");
//
// List<DistributionReservationEntity> distributionReservationVOS = new ArrayList<>();
// if (split.length == 1) {
// DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(ids);
// distributionReservationVOS.add(reservationEntity);
// } else {
// for (String s : split) {
// DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(s);
// distributionReservationVOS.add(reservationEntity);
// }
// }
return reservationVOList;
}
@Override
@ -695,9 +777,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity();
//设置车次号
String today = DateUtil.today();
String random = Func.random(7, RandomType.ALL);
distributionDeliveryListEntity.setTrainNumber(random + today);
// String today = DateUtil.today();
// String random = Func.random(7, RandomType.ALL);
distributionDeliveryListEntity.setTrainNumber(trainNumberMa());
distributionDeliveryListEntity.setFee(BigDecimal.ZERO);
distributionDeliveryListEntity.setPrice(BigDecimal.ZERO);
distributionDeliveryListService.save(distributionDeliveryListEntity);
@ -751,7 +833,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
stockupEntity.setStockupCode(bianMa());
stockupEntity.setStockupStatus(StockupStatusConstant.weibeihuo.getValue());
stockupEntity.setStockupDate(new Date());
stockupEntity.setOutboundDate(new Date());
// stockupEntity.setOutboundDate(new Date());
stockupEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionStockupService.save(stockupEntity);
}
@ -768,7 +850,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
}
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setTrainNumber(random);
distributionSignforEntity.setTrainNumber(trainNumberMa());
distributionSignforEntity.setReservationId(reservationEntity.getId());
distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId());
distributionSignforEntity.setSigningStatus(SignforStatusConstant.daiqianshou.getValue());
@ -912,7 +994,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setType(DistributionTypeConstant.shipie.getValue());
distributionDeliveryListEntity.setOrderCode(String.join(",", hashSet));
// distributionDeliveryListEntity.setTaskTime(allocationDTO.getTaskTime());
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
distributionDeliveryListEntity.setNoteNumber(deliveryListMa());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
String taskTime = allocationDTO.getTaskTime();
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -926,7 +1008,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setRemarks(allocationDTO.getRemarks());
}
distributionDeliveryListEntity.setTaskTime(taskTime);
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
// distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
// if (orderIds.length() > 1) {
// distributionDeliveryListEntity.setOrderId(orderIds.deleteCharAt(orderIds.length() - 1).toString());
// }
@ -1303,7 +1385,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//4、维护配送表数据
DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity();
String str = Func.random(7, RandomType.ALL) + DateUtil.today();
distributionDeliveryListEntity.setTrainNumber(str);
distributionDeliveryListEntity.setTrainNumber(trainNumberMa());
distributionDeliveryListEntity.setType(DistributionTypeConstant.shangpei.getValue());
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue());
distributionDeliveryListEntity.setPrice(BigDecimal.ZERO);
@ -1447,7 +1529,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// reservationEntity.setWaybillId(String.join(",", waybillId));
reservationEntity.setReservationDate(date);
// -----------------------预约信息完善----------------------------
reservationEntity.setReservationCode(Func.random(11,RandomType.INT));
reservationEntity.setReservationCode(reservationMa());
// reservationEntity.setDeliveryWay();
reservationEntity.setDeliveryType(DistributionTypeConstant.shangpei.getValue());
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
@ -1465,7 +1547,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum());
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setReservationId(reservationEntity.getId());
distributionSignforEntity.setTrainNumber(str);
distributionSignforEntity.setTrainNumber(trainNumberMa());
distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId());
distributionSignforService.save(distributionSignforEntity);
deliveryWarehouseName.add(reservationEntity.getWarehouseName());
@ -1540,7 +1622,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
// distributionDeliveryListEntity.setOrderCode(String.join(",", orderNumber));
distributionDeliveryListEntity.setOrderNumber(orderTotal.get());
distributionDeliveryListEntity.setDeliveryNumber(deliveryPackageTotal.get());
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
distributionDeliveryListEntity.setNoteNumber(deliveryListMa());
distributionDeliveryListEntity.setCustomersNumber(clientTotal.get());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId());
@ -1973,7 +2055,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Func.copy(distributionReservationDTO, reservationEntity);
reservationEntity.setWarehouseId(myCurrentWarehouse.getId());
//新建预约单为待确认状态
reservationEntity.setReservationStatus(ReservationStatusConstant.daiqueren.getValue());
reservationEntity.setReservationStatus(ReservationStatusConstant.yiqueren.getValue());
//新建预约单订单处于未备货状态
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.weibeihuo.getValue());
this.save(reservationEntity);
@ -2183,8 +2265,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//统计数量
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee);
String random = Func.random(13, RandomType.ALL);
reservationEntity.setReservationCode(random);
reservationEntity.setReservationCode(reservationMa());
//设置预约为市配
reservationEntity.setDeliveryType(DistributionTypeConstant.shipie.getValue());
reservationEntity.setReservationNum(packageTotal.get());
@ -2194,7 +2275,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
String s = String.join(",", serviceNumber);
reservationEntity.setServiceNumber(s);
}
reservationEntity.setReservationStatus(distributionReservationDTO.getReservationStatus());
// reservationEntity.setReservationStatus(distributionReservationDTO.getReservationStatus());
reservationEntity.setOrderSource(ReservationOrderSourceConstant.zijian.getValue());
if (Func.isNotEmpty(distributionReservationDTO.getServeType())){
reservationEntity.setServeType(distributionReservationDTO.getServeType());

18
blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java

@ -42,14 +42,16 @@ public class MyTest {
@Test
public void te(){
Map<String, Object> params = new HashMap<>();
params.put("ids","1686560469635727362");
try {
OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params);
System.out.println(orderPackgeCodeDataVO);
} catch (Exception e) {
e.printStackTrace();
}
// Map<String, Object> params = new HashMap<>();
// params.put("ids","1686560469635727362");
// try {
// OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params);
// System.out.println(orderPackgeCodeDataVO);
// } catch (Exception e) {
// e.printStackTrace();
// }
List<PrintPreviewVO> printPreviewVOS = distributionDeliveryListService.printBatch(ids,type);
}
}

30
blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java

@ -0,0 +1,30 @@
package com.logpm.distribution;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springblade.core.test.BladeBootTest;
import org.springblade.core.test.BladeSpringExtension;
import org.springframework.beans.factory.annotation.Autowired;
@ExtendWith(BladeSpringExtension.class)
@BladeBootTest(appName = "logpm-distribution", enableLoader = true)
public class TestService {
@Autowired
private IDistributionDeliveryListService distributionDeliveryListService;
@Test
public void test2() throws Exception {
// List<PrintPreviewVO> printPreviewVOS = distributionDeliveryListService.printBatch("1703958397055135745", 1);
distributionDeliveryListService.testData("1703958397055135745");
System.out.println(111111);
}
}

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java

@ -107,6 +107,7 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
// map.put(layerNum, new ArrayList<>());
// }
WarehouseGoodsAllocationVO warehouseGoodsAllocationVO = this.convert(warehouseGoodsAllocationEntity);
log.info("List>>>>>>>>>>>>>>>>>{}",warehouseGoodsAllocationVO);
// map.get(layerNum).add(warehouseGoodsAllocationVO);
warehouseGoodsAllocationVOS.add(warehouseGoodsAllocationVO);
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/wrapper/WarehouseStockVOWrapper.java

@ -42,7 +42,9 @@ public class WarehouseStockVOWrapper extends BaseEntityWrapper<WarehouseScanReco
@Override
public WarehouseScanRecordVO entityVO(WarehouseScanRecordVO WarehouseStock) {
if (null != WarehouseStock.getOperatorId() && 0 !=WarehouseStock.getOperatorId()){
WarehouseStock.setOperatorName(userCliient.userInfoById(WarehouseStock.getOperatorId()).getData().getName());
}
WarehouseStock.setOrderPackageStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STATUS, WarehouseStock.getOrderPackageStatus()));
WarehouseStock.setOrderPackageFreezeStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_FREEZE_STATUS, WarehouseStock.getOrderPackageFreezeStatus()));
WarehouseStock.setOrderPackageGroundingStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_GROUNDING_STATUS, WarehouseStock.getOrderPackageGroundingStatus()));

Loading…
Cancel
Save