Browse Source

首页车次信息、司机一件签收推送修复

master
汤建军 7 months ago
parent
commit
a24f12f15d
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java
  2. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  3. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionReservationVO.java
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  5. 219
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  6. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  7. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  8. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionReservationWrapper.java
  9. 36
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java
  10. 1
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/IndexDTO.java
  11. 48
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java
  12. 225
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  13. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java
  14. 61
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  15. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexDeliveryDataVO.java
  16. 27
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java

1
blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java

@ -94,6 +94,7 @@ public class DictBizConstant {
// --------------2023-08-24 ---------------------
public static final String RESERVATION_LIST_LOADING_STATUS = "reservation_loading_status";//预约装车状态
public static final String RESERVATION_SIGNFOR_STATUS = "reservation_signfor_status";//预约签收状态
public static final String YES_NO = "yes_no";//预约签收状态
// --------------2023-09-01 ---------------------
public static final String ORDER_PACKAGE_LOADING_STATUS = "order_package_loading_status";//预约签收状态

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

@ -297,6 +297,10 @@ public class DistributionReservationEntity extends TenantEntity {
@ApiModelProperty(value = "备货结束时间")
private Date endTimeStocking;
/**
* 是否安装
*/
@ApiModelProperty(value = "是否安装, 0-否 1- 是")
private Integer isInstall;
}

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

@ -91,6 +91,12 @@ public class DistributionReservationVO extends DistributionReservationEntity {
@ApiModelProperty(value = "签收状态")
private String warehouseAddress;
/**
* 是否安装
*/
@ApiModelProperty(value = "是否安装")
private String isInstallName;
/**
* 仓库经度

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -335,7 +335,6 @@ public class DistributionSignforController extends BladeController {
distributionSignforDTO.setId(distributionSignfor.getId());
distributionSignforService.updateSign(distributionSignforDTO);
distributionStockupInfoService.maintenanceStockUp(distributionSignfor.getReservationId(),1);
}
// return R.status(distributionSignforService.updateById(distributionSignfor));
return r;

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

@ -252,6 +252,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Autowired
private IBasicdataDriverArteryClient arteryClient;
@Autowired
private IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
// @Lazy
@ -4849,14 +4852,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistrilbutionBillPackageEntity> distrilbutionBillPackageEntities = distrilbutionBillPackageMapper.selectList(distrilbutionBillStockEntityLambdaQueryWrapper);
// 得到所以的订单列表
List<DistributionParcelListEntity> distributionParcelListEntities = null;
List<DistributionParcelListEntity> distributionParcelListEntities = new ArrayList<>();
if (!distrilbutionBillPackageEntities.isEmpty()) {
List<Long> ids = distrilbutionBillPackageEntities.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList());
distributionParcelListEntities = distributionParcelListMapper.selectBatchIds(ids);
distributionParcelListEntities = distributionParcelListMapper.selectBatchIds(ids);
}
Map<String, Object> map = new HashMap<>();
map.put("自提单号", distrilbutionBillLadingEntity.getPickupBatch());
String fileTypeName = QRCodeUtil.createCodeToFile(map.get("自提单号").toString());
@ -4864,9 +4868,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// map.put("收货单单位", reservationEntity.getReceivingUnit());//收货单单位
// map.put("商场名称", reservationEntity.getStoreName());//商场名称
// 构建map集合中收货单和商场名称
if (!distributionParcelListEntities.isEmpty() && !distrilbutionBillStockEntities.isEmpty()){
buildMapByDistrilbutionBillLadingEntity(map, distrilbutionBillStockEntities, distributionParcelListEntities, distrilbutionBillLadingEntity);
}
map.put("提货人", distrilbutionBillLadingEntity.getConsignee());//提货人
map.put("联系电话", distrilbutionBillLadingEntity.getConsigneePhone());//收货人电话
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(distrilbutionBillLadingEntity.getWarehouseId());
@ -4919,24 +4922,71 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private void buildMapByDistrilbutionBillLadingEntity(Map<String, Object> map, List<DistrilbutionBillStockEntity> distrilbutionBillStockEntities, List<DistributionParcelListEntity> distributionParcelListEntities, DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) {
// 查询订单集合
Set<Long> ids = new HashSet<Long>();
for (DistrilbutionBillStockEntity distrilbutionBillStockEntity : distrilbutionBillStockEntities) {
ids.add(distrilbutionBillStockEntity.getStockArticleId());
}
// 得到所以的订单列表
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleMapper.selectBatchIds(ids);
int a = 1;
List<Map<String, Object>> ls = new ArrayList<>();
// 获取订单中的商城和收货单位
StringBuilder consigneeUnit = new StringBuilder();
StringBuilder mailNames = new StringBuilder();
List<Map<String, Object>> ls = new ArrayList<>();
int hejiNum = 0;
Map<String, Object> m = new HashMap<>();
// 查询库存品信息
List<DistributionDeliveryDetailsEntity> detailsEntities = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
.eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLadingEntity.getId())
.ne(DistributionDeliveryDetailsEntity::getStockStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
if (!detailsEntities.isEmpty()) {
Map<Long, List<DistributionDeliveryDetailsEntity>> inventoryMap = detailsEntities.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId));
List<Long> inventoryIds = detailsEntities.stream().map(DistributionDeliveryDetailsEntity::getStockListId).collect(Collectors.toList());
List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(inventoryIds);
if (!distributionStockListEntities.isEmpty()) {
for (DistributionStockListEntity distributionStockListEntity : distributionStockListEntities) {
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("序号", a);
tempMap.put("运单号", distributionStockListEntity.getIncomingBatch());
tempMap.put("合同号", distributionStockListEntity.getOrderCode());
tempMap.put("物料名称", distributionStockListEntity.getDescriptionGoods());
//构建产品明细
Map<String,Object> map1 = new HashMap<>();
map1.put("物料编码",distributionStockListEntity.getCargoNumber());
map1.put("物料单位",distributionStockListEntity.getCargoUnit());
map1.put("物料规格",distributionStockListEntity.getCargoNorms());
//查询此订制品库位信息
DistributionDeliveryDetailsEntity distributionDeliveryDetailsEntity = inventoryMap.get(distributionStockListEntity.getId()).get(0);
Integer quantity = distributionDeliveryDetailsEntity.getQuantity();
map1.put("计划数量",quantity);
hejiNum += quantity;
tempMap.put("小计", quantity);
tempMap.put("货位", "");
tempMap.put("产品明细", map1);
tempMap.put("备货区", "");
ls.add(tempMap);
a++;
if (!mailNames.toString().contains(distributionStockListEntity.getMarketName())) {
if (!mailNames.toString().isEmpty()) {
mailNames.append(",");
}
mailNames.append(distributionStockListEntity.getMarketName());
}
if (!consigneeUnit.toString().contains(distributionStockListEntity.getMarketName())) {
if (!consigneeUnit.toString().isEmpty()) {
consigneeUnit.append(",");
}
consigneeUnit.append(distributionStockListEntity.getMarketName());
}
}
}
}
int a = 1;
// 构建产品明细的表头 -- 这里目前只处理了定制品和有数据的库存品,对于零担 还没有处理
List<Map<String, Object>> listMapTemp = new ArrayList<>();
Map<String, Object> m = new HashMap<>();
int hejiNum = 0;
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
if (StringUtils.isBlank(distributionParcelListEntity.getThirdProduct())) {
distributionParcelListEntity.setThirdProduct("其它");
@ -4952,98 +5002,111 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// 加入到集合中的去 目的是为了获取分类头部
listMapTemp.add(m);
if (!distrilbutionBillStockEntities.isEmpty()) {
List<Long> ids = distrilbutionBillStockEntities.stream().map(DistrilbutionBillStockEntity::getStockArticleId).collect(Collectors.toList());
// 得到所以的订单列表
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleMapper.selectBatchIds(ids);
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) {
Map<String, Object> tempMap = new HashMap<>();
// 需要从所有的包件的
List<DistributionParcelListEntity> ts = new ArrayList<>();
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
if (distributionParcelListEntity.getStockArticleId().equals(distributionStockArticleEntity.getId())) {
ts.add(distributionParcelListEntity);
}
}
for (DistributionStockArticleEntity distributionStockArticleEntity : distributionStockArticleEntities) {
// 需要从所有的包件的
List<DistributionParcelListEntity> ts = new ArrayList<>();
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
if (distributionParcelListEntity.getStockArticleId().equals(distributionStockArticleEntity.getId())) {
ts.add(distributionParcelListEntity);
}
}
if (!mailNames.toString().contains(distributionStockArticleEntity.getMallName())) {
if (!mailNames.toString().isEmpty()) {
mailNames.append(",");
}
mailNames.append(distributionStockArticleEntity.getMallName());
}
if (!consigneeUnit.toString().contains(distributionStockArticleEntity.getConsigneeUnit())) {
if (!consigneeUnit.toString().isEmpty()) {
consigneeUnit.append(",");
}
consigneeUnit.append(distributionStockArticleEntity.getConsigneeUnit());
}
if (!mailNames.toString().contains(distributionStockArticleEntity.getMallName())) {
if (!mailNames.toString().isEmpty()) {
mailNames.append(",");
}
mailNames.append(distributionStockArticleEntity.getMallName());
}
if (!consigneeUnit.toString().contains(distributionStockArticleEntity.getConsigneeUnit())) {
if (!consigneeUnit.toString().isEmpty()) {
consigneeUnit.append(",");
}
consigneeUnit.append(distributionStockArticleEntity.getConsigneeUnit());
}
Map<String, Object> tempMap = new HashMap<>();
tempMap.put("序号", a);
tempMap.put("运单号", distributionStockArticleEntity.getWaybillNumber());
tempMap.put("合同号", distributionStockArticleEntity.getOrderCode());
String materialNameStr = buildMaterialNameStr(distributionParcelListEntities);
tempMap.put("物料名称", materialNameStr);
tempMap.put("序号", a);
tempMap.put("运单号", distributionStockArticleEntity.getWaybillNumber());
tempMap.put("合同号", distributionStockArticleEntity.getOrderCode());
String materialNameStr = buildMaterialNameStr(distributionParcelListEntities);
tempMap.put("物料名称", materialNameStr);
// 构建产品明细 --对于每一个订单
buildProductDetail(tempMap, m, ts);
// 构建产品明细 --对于每一个订单
buildProductDetail(tempMap, m, ts);
Map<String, Object> os = (Map<String, Object>) tempMap.get("产品明细");
Map<String, Object> os = (Map<String, Object>) tempMap.get("产品明细");
Set<String> strings = os.keySet();
int sumNum = 0;
for (String string : strings) {
Object o = os.get(string);
sumNum += (o != null) ? (int) o : 0;
}
tempMap.put("小计", sumNum);
hejiNum += sumNum;
// 查询货物货位
Set<String> strings = os.keySet();
int sumNum = 0;
for (String string : strings) {
Object o = os.get(string);
sumNum += (o != null) ? (int) o : 0;
}
tempMap.put("小计", sumNum);
hejiNum += sumNum;
// 查询货物货位
//通过订单id和预约id查询对应包件的库位信息
List<String> orderPackageCodes = ts.stream()
.map(DistributionParcelListEntity::getOrderPackageCode) // 获取每个对象的orderPackageCode
.collect(Collectors.toList());
//通过订单id和预约id查询对应包件的库位信息
List<String> orderPackageCodes = ts.stream()
.map(DistributionParcelListEntity::getOrderPackageCode) // 获取每个对象的orderPackageCode
.collect(Collectors.toList());
List<Long> orderPackageIds = ts.stream()
.map(DistributionParcelListEntity::getId) // 获取每个对象的包件ID
.collect(Collectors.toList());
if (Func.isNotEmpty(orderPackageCodes)) {
List<String> allocationStrList = distributionParcelListMapper.selectAllocationInforByOrderPackageCode(orderPackageCodes, distrilbutionBillLadingEntity.getWarehouseId());
String allocationStr = StringUtils.join(allocationStrList, ",");
tempMap.put("货位", allocationStr);
}
List<Long> orderPackageIds = ts.stream()
.map(DistributionParcelListEntity::getId) // 获取每个对象的包件ID
.collect(Collectors.toList());
if (Func.isNotEmpty(orderPackageCodes)) {
List<String> allocationStrList = distributionParcelListMapper.selectAllocationInforByOrderPackageCode(orderPackageCodes, distrilbutionBillLadingEntity.getWarehouseId());
String allocationStr = StringUtils.join(allocationStrList, ",");
tempMap.put("货位", allocationStr);
}
//通过订单id和预约id查询对应包件的备货区信息
LambdaQueryWrapper<DistributionStockEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DistributionStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId())
.in(DistributionStockEntity::getParcelListId, orderPackageIds);
List<DistributionStockEntity> distributionStockEntities = distributionStockMapper.selectList(lambdaQueryWrapper);
//通过订单id和预约id查询对应包件的备货区信息
LambdaQueryWrapper<DistributionStockEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DistributionStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId())
.in(DistributionStockEntity::getParcelListId, orderPackageIds);
List<DistributionStockEntity> distributionStockEntities = distributionStockMapper.selectList(lambdaQueryWrapper);
Set<String> stockupAreaStrList = distributionStockEntities.stream().map(DistributionStockEntity::getStockupArea).collect(Collectors.toSet());
Set<String> stockupAreaStrList = distributionStockEntities.stream().map(DistributionStockEntity::getStockupArea).collect(Collectors.toSet());
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ",");
tempMap.put("备货区", stockupAreaStr);
String stockupAreaStr = StringUtils.join(stockupAreaStrList, ",");
tempMap.put("备货区", stockupAreaStr);
ls.add(tempMap);
a++;
ls.add(tempMap);
a++;
}
}
map.put("收货单单位", consigneeUnit.toString());
map.put("商场名称", mailNames.toString());
map.put("明细", ls);
Map<String, Object> m1 = new HashMap<>();
m1.put("产品明细", m);
if (!m.isEmpty()) {
m1.put("产品明细", m);
}
m1.put("合计数量", hejiNum);
map.put("合计", m1);
}
/**
* 构建分类明细
*

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

@ -1985,6 +1985,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setReplaceFee(distributionReservationDTO.getReplaceFee());
reservationEntity.setRemarks(distributionReservationDTO.getRemarks());
reservationEntity.setIsUrgent(distributionReservationDTO.getIsUrgent());
reservationEntity.setIsInstall(distributionReservationDTO.getIsInstall());
this.updateById(reservationEntity);
return R.status(true);
}

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -5196,14 +5196,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
jsonObjects.add(jsonObject);
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntity.getSigningUser()+"司机司机批量签收,装车方式:扫描装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
trunklinePackageTrackLog= handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),parcelListEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(),reservationEntity.getId(),reservationEntity.getReservationCode(),myCurrentWarehouse.getName(),user.getNickName());
} else {
//存在装车数据
if (distributionSignfor.getIsClerk()) {
loadscanEntities.setMsg("文员一键签收数据补录");
} else {
loadscanEntities.setMsg("司机一键签收数据补录");
}
loadscanEntities.setMsg("司机一键签收数据补录");
if (!loadscanEntities.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//已经进行过装车 这里不需要进行订制品订单在库数量扣减
loadscanEntities.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
@ -5218,7 +5214,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageLockIds.add(loadscanEntities.getPackageId());
content = "包件在"+myCurrentWarehouse.getName()+"由"+loadscanEntities.getSigningUser()+"司机批量签收,装车方式:补录装车,配送车次号:"+distributionDeliveryListEntity.getTrainNumber()+"预约任务号:"+reservationEntity.getReservationCode();
trunklinePackageTrackLog= handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),parcelListEntity.getOrderPackageCode(),content,WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(),distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
//推送扫描记录
distributionAsyncService.sendFactory(parcelListEntity, loadscanEntities.getSigningTime(),reservationEntity.getId(),reservationEntity.getReservationCode(),myCurrentWarehouse.getName(),user.getNickName());
}
}
@ -5234,7 +5231,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(packageIds)) {
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
//批量推送
distributionAsyncService.sendReviewFactory(distributionSignforEntity.getId(), myCurrentWarehouse.getName(), myCurrentWarehouse.getId());
// distributionAsyncService.sendReviewFactory(distributionSignforEntity.getId(), myCurrentWarehouse.getName(), myCurrentWarehouse.getId());
}
//备货库位下架
//TODO

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionReservationWrapper.java

@ -51,6 +51,7 @@ public class DistributionReservationWrapper extends BaseEntityWrapper<Distributi
reservationVO.setStockupStatusName(DictBizCache.getValue(DictBizConstant.RESERVATION_STOCKUP_STATUS,entity.getStockupStatus()));
reservationVO.setLoadingStatusName(DictBizCache.getValue(DictBizConstant.RESERVATION_LIST_LOADING_STATUS,entity.getLoadingStatus()));
reservationVO.setSigningStatusName(DictBizCache.getValue(DictBizConstant.RESERVATION_SIGNFOR_STATUS,entity.getSigningStatus()));
reservationVO.setIsInstallName(DictBizCache.getValue(DictBizConstant.YES_NO,entity.getIsInstall()));
return reservationVO;
}
}

36
blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java

@ -7,6 +7,7 @@ import com.logpm.report.dto.IndexDTO;
import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import com.logpm.report.vo.indexCount.IndexSignforDataVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -307,4 +308,39 @@ public class WarehouseIndexController {
}
@ResponseBody
@PostMapping("/signforData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "卸车异常数据", notes = "传入indexDTO")
public R signforData(@RequestBody IndexDTO indexDTO) {
String method = "###########unloadAbnormalData: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWarehouseList();
if (myWatchWarehouse.isEmpty()) {
warehouseIds = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
}
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
List<IndexSignforDataVO> indexDeliveryDataVO = warehouseIndexService.signforData(indexDTO);
return R.data(indexDeliveryDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
}

1
blade-service/logpm-report/src/main/java/com/logpm/report/dto/IndexDTO.java

@ -12,5 +12,6 @@ public class IndexDTO implements Serializable {
private List<Long> warehouseIds;
private Date startDate;
private Date endDate;
private String dayStr;
}

48
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java

@ -138,4 +138,52 @@ public interface WarehouseIndexMapper {
*/
BigDecimal findTripartiteTotalVolume(@Param("param")IndexDTO indexDTO);
/**
* 查询当天的签收数量
* @param indexDTO
* @return
*/
Integer findSignforDataByDay(@Param("param")IndexDTO indexDTO);
/**
* 查询当月签收数量
* @param indexDTO
* @return
*/
Integer findSignforDataByMonth(@Param("param")IndexDTO indexDTO);
/**
* 查询前天未签收件数
* @param indexDTO
* @return
*/
Integer findUnSignforDataByDay(@Param("param")IndexDTO indexDTO);
/**
* 查询当月未签收件数
* @param indexDTO
* @return
*/
Integer findUnSignforDataByMonth(@Param("param")IndexDTO indexDTO);
/**
* 查询当天文员复核数
* @param indexDTO
* @return
*/
Integer findClerkSignforNumByDay(@Param("param")IndexDTO indexDTO);
/**
* 查询当月文员复核数
* @param indexDTO
* @return
*/
Integer findClerkSignforNumByMonth(@Param("param")IndexDTO indexDTO);
/**
* 查询当天计划数
* @param indexDTO
* @return
*/
Integer findPlanNumByDay(@Param("param")IndexDTO indexDTO);
}

225
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -223,7 +223,7 @@
<select id="findBillLadingTotal" resultType="com.logpm.report.vo.indexCount.IndexDeliveryDataVO">
SELECT
3 AS type,
count( 1 )
count( 1 ) AS totalNum
FROM
logpm_distrilbution_bill_lading
<where>
@ -246,7 +246,7 @@
AND is_deleted = 0
AND delivery_type = #{type}
<if test="param.warehouseIds != null">
AND warehouse IN
AND warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -268,7 +268,7 @@
AND ldrp.packet_bar_status != 2
AND ldr.delivery_type = #{type}
<if test="param.warehouseIds != null">
AND ldr.warehouse IN
AND ldr.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -289,7 +289,7 @@
AND ldrp.packet_bar_status != 2
AND ldr.delivery_type = #{type}
<if test="param.warehouseIds != null">
AND ldr.warehouse IN
AND ldr.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -311,7 +311,7 @@
AND ldl.is_deleted = 0
AND ldr.delivery_type = #{type}
<if test="param.warehouseIds != null">
AND ldr.warehouse IN
AND ldr.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -329,7 +329,7 @@
AND ldbp.is_deleted = 0
AND ldbl.is_deleted = 0
<if test="param.warehouseIds != null">
AND ldbl.warehouse IN
AND ldbl.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -348,7 +348,7 @@
AND ldbp.is_deleted = 0
AND ldbl.is_deleted = 0
<if test="param.warehouseIds != null">
AND ldbl.warehouse IN
AND ldbl.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -367,7 +367,7 @@
AND ldbp.is_deleted = 0
AND ldbl.is_deleted = 0
<if test="param.warehouseIds != null">
AND ldbl.warehouse IN
AND ldbl.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@ -454,5 +454,214 @@
</if>
</where>
</select>
<select id="findSignforDataByDay" resultType="java.lang.Integer">
SELECT
((
SELECT
IFNULL( SUM( received_quantity ), 0 )
FROM
logpm_distribution_loadscan
<where>
signfor_state = 2
AND DATE_FORMAT( signing_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" )
AND is_deleted = 0
<if test="param.warehouseIds != null">
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
) + (
SELECT
IFNULL( SUM( quantity ), 0 )
FROM
logpm_distribution_bill_lading_scan
<where>
material_type = 2
AND DATE_FORMAT( create_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" )
AND is_deleted = 0
<if test="param.warehouseIds != null">
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)) AS num
</select>
<select id="findSignforDataByMonth" resultType="java.lang.Integer">
SELECT
((
SELECT
IFNULL( SUM( received_quantity ), 0 )
FROM
logpm_distribution_loadscan
<where>
signfor_state = 2
AND DATE_FORMAT( signing_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" )
AND is_deleted = 0
<if test="param.warehouseIds != null">
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
) + (
SELECT
IFNULL( SUM( quantity ), 0 )
FROM
logpm_distribution_bill_lading_scan
<where>
material_type = 2
AND DATE_FORMAT( create_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" )
AND is_deleted = 0
<if test="param.warehouseIds != null">
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)) AS num
</select>
<select id="findUnSignforDataByDay" resultType="java.lang.Integer">
SELECT
((
SELECT
IFNULL( sum( quantity ), 0 )
FROM
logpm_distribution_reservation_package AS ldrp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
<where>
ldpl.order_package_status != 70
AND ldrp.packet_bar_status != 2
AND ldrp.is_deleted = 0
AND DATE_FORMAT( ldrp.create_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" )
<if test="param.warehouseIds != null">
AND ldpl.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
) + (
SELECT
IFNULL( sum( quantity ), 0 )
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id
<where>
ldpl.order_package_status != 70
AND ldbp.packet_bar_status != 2
AND ldbp.is_deleted = 0
AND DATE_FORMAT( ldbp.create_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" )
<if test="param.warehouseIds != null">
AND ldpl.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
))
</select>
<select id="findUnSignforDataByMonth" resultType="java.lang.Integer">
SELECT
((
SELECT
IFNULL( sum( quantity ), 0 )
FROM
logpm_distribution_reservation_package AS ldrp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
<where>
ldpl.order_package_status != 70
AND ldrp.packet_bar_status != 2
AND ldrp.is_deleted = 0
AND DATE_FORMAT( ldrp.create_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" )
<if test="param.warehouseIds != null">
AND ldpl.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
) + (
SELECT
IFNULL( sum( quantity ), 0 )
FROM
logpm_distrilbution_bill_package AS ldbp
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id
<where>
ldpl.order_package_status != 70
AND ldbp.packet_bar_status != 2
AND ldbp.is_deleted = 0
AND DATE_FORMAT( ldbp.create_time, "%y%m" ) = DATE_FORMAT( #{param.dayStr}, "%y%m" )
<if test="param.warehouseIds != null">
AND ldpl.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
))
</select>
<select id="findClerkSignforNumByDay" resultType="java.lang.Integer">
SELECT
count( 1 )
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_signfor AS lds ON lds.reservation_id = ldr.id
<where>
ldr.reservation_status != 40
AND ldr.is_deleted = 0
AND lds.is_deleted = 0
AND lds.signing_status = 2
AND DATE_FORMAT(lds.signing_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" )
<if test="param.warehouseIds != null">
AND ldr.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findClerkSignforNumByMonth" resultType="java.lang.Integer">
SELECT
count( 1 )
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_signfor AS lds ON lds.reservation_id = ldr.id
<where>
ldr.reservation_status != 40
AND ldr.is_deleted = 0
AND lds.is_deleted = 0
AND lds.signing_status = 2
AND DATE_FORMAT(lds.signing_time, "%y%m%d" ) = DATE_FORMAT( #{param.dayStr}, "%y%m%d" )
<if test="param.warehouseIds != null">
AND ldr.warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="findPlanNumByDay" resultType="java.lang.Integer">
SELECT
count( 1 )
FROM
logpm_distribution_reservation
<where>
reservation_status != 40
AND is_deleted = 0
<if test="param.warehouseIds != null">
AND warehouse_id IN
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

8
blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java

@ -3,6 +3,7 @@ package com.logpm.report.service;
import com.logpm.report.dto.IndexDTO;
import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import com.logpm.report.vo.indexCount.IndexSignforDataVO;
import java.util.List;
@ -27,4 +28,11 @@ public interface IWarehouseIndexService {
* @return
*/
List<IndexDeliveryDataVO> deliveryData(IndexDTO indexDTO);
/**
* 查询当前签收率
* @param indexDTO
* @return
*/
List<IndexSignforDataVO> signforData(IndexDTO indexDTO);
}

61
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -6,6 +6,7 @@ import com.logpm.report.mapper.WarehouseIndexMapper;
import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import com.logpm.report.vo.indexCount.IndexSignforDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DistributionTypeConstant;
@ -14,6 +15,7 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
@ -278,18 +280,61 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
//查询外协信息
IndexDeliveryDataVO indexTripartiteDeliveryDataVO = warehouseIndexMapper.findTripartiteTotal(indexDTO);
if (Func.isNotEmpty(indexTripartiteDeliveryDataVO)) {
//查询自提总件数
//查询外协总件数
Integer tripartiteTotalNum = warehouseIndexMapper.findTripartiteTotalNum(indexDTO);
indexDeliveryDataVO.setTotalDeliveryNum(tripartiteTotalNum);
//查询总重量
indexTripartiteDeliveryDataVO.setTotalDeliveryNum(tripartiteTotalNum);
//查询外协总重量
BigDecimal tripartiteTotalWeight = warehouseIndexMapper.findTripartiteTotalWeight(indexDTO);
indexDeliveryDataVO.setTotalWeight(tripartiteTotalWeight);
//查询总包件体积
indexTripartiteDeliveryDataVO.setTotalWeight(tripartiteTotalWeight);
//查询外协总包件体积
BigDecimal tripartiteTotalVolume = warehouseIndexMapper.findTripartiteTotalVolume(indexDTO);
indexDeliveryDataVO.setTotalVolume(tripartiteTotalVolume);
indexDeliveryDataVOList.add(indexDeliveryDataVO);
indexTripartiteDeliveryDataVO.setTotalVolume(tripartiteTotalVolume);
indexDeliveryDataVOList.add(indexTripartiteDeliveryDataVO);
}
return indexDeliveryDataVOList;
}
@Override
public List<IndexSignforDataVO> signforData(IndexDTO indexDTO) {
List<IndexSignforDataVO> list = new ArrayList<>();
Date date = new Date();
SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
String day = dayFormat.format(date);
indexDTO.setDayStr(day);
IndexSignforDataVO indexSignforDayDataVO = new IndexSignforDataVO();
indexSignforDayDataVO.setType(1);
//查询当天签收数据
Integer daySignforNum = warehouseIndexMapper.findSignforDataByDay(indexDTO);
indexSignforDayDataVO.setSignNum(daySignforNum);
//查询当天未签收件数
Integer dayUnSignforNum = warehouseIndexMapper.findUnSignforDataByDay(indexDTO);
indexSignforDayDataVO.setUnSignNum(dayUnSignforNum);
//计算签收率
Double daySignforScale = (double) (daySignforNum / (daySignforNum + dayUnSignforNum) * 100);
indexSignforDayDataVO.setSignScale(daySignforScale);
//查询当天文员复核数
Integer dayClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByDay(indexDTO);
//查询当天计划数
Integer planByday = warehouseIndexMapper.findPlanNumByDay(indexDTO);
//计算文员签收率
indexSignforDayDataVO.setClerkSignNum(dayClerkSignforNum);
list.add(indexSignforDayDataVO);
IndexSignforDataVO indexSignforMonthDataVO = new IndexSignforDataVO();
indexSignforMonthDataVO.setType(2);
//查询当月签收数据
Integer monthSignforNum = warehouseIndexMapper.findSignforDataByMonth(indexDTO);
indexSignforMonthDataVO.setSignNum(monthSignforNum);
//查询当月未签收数据
Integer monthUnSignforNum = warehouseIndexMapper.findUnSignforDataByMonth(indexDTO);
indexSignforMonthDataVO.setUnSignNum(monthUnSignforNum);
//计算签收率
Double monthSignforScale = (double) (monthSignforNum / (monthUnSignforNum + monthSignforNum) * 100);
indexSignforMonthDataVO.setSignScale(monthSignforScale);
//查询当月文员复核数
Integer monthClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByMonth(indexDTO);
indexSignforMonthDataVO.setClerkSignNum(monthClerkSignforNum);
return list;
}
}

4
blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexDeliveryDataVO.java

@ -11,8 +11,8 @@ public class IndexDeliveryDataVO implements Serializable {
private String type ;
private Integer totalNum = 0;
private Integer totalDeliveryNum = 0;
private BigDecimal totalWeight ;
private BigDecimal totalVolume ;
private BigDecimal totalWeight = BigDecimal.ZERO;
private BigDecimal totalVolume = BigDecimal.ZERO;
private Integer totalRoadNum = 0;

27
blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java

@ -0,0 +1,27 @@
package com.logpm.report.vo.indexCount;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class IndexSignforDataVO implements Serializable {
private Integer type;
private Integer signNum;
private Integer UnSignNum;
private Double signScale;
private Integer clerkSignNum;
}
Loading…
Cancel
Save