Browse Source

增值服务接口调整

training
kilo 1 year ago
parent
commit
89db01bbd9
  1. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvalueVO.java
  2. 21
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java
  3. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionAddvalueAppController.java
  4. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  5. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppAddvalueDTO.java
  6. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml
  7. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml
  8. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  9. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  10. 22
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  11. 115
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java
  12. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  13. 141
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

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;
/**

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/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

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

@ -172,14 +172,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);
/**
* 查询出客户下的库存品订单维度信息

11
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">

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);
/**
* 批量转配送任务

115
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());
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isNotEmpty(packageListIds)){
List<Long> longs = Func.toLongList(packageListIds);
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.listByIds(longs);
addvalueVO.setPackageEntityList(distributionAddvaluePackageEntities);
if (Func.isNotEmpty(addvalueVO)){
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isNotEmpty(packageListIds)){
List<Long> longs = Func.toLongList(packageListIds);
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);
}

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

@ -61,6 +61,7 @@ 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;
@ -221,7 +222,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<>();
@ -244,7 +245,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 {
@ -1794,19 +1795,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();
distributionAppReservationVO.setIsstock("是");
distributionAppReservationVO.setIsload("是");
if (aLong < distributionAppReservationVO.getReservationNum()) {
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("是");
}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);
}

141
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());
@ -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());

Loading…
Cancel
Save