Browse Source

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

fix-sign
zhaoqiaobo 3 months ago
parent
commit
7dc4ac1da4
  1. 41
      blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  3. 3
      blade-service/logpm-distribution/src/main/resources/application-dev.yml
  4. 146
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java
  5. 4
      blade-service/logpm-report/pom.xml
  6. 99
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java
  7. 20
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java
  8. 70
      blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java
  9. 12
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml
  10. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml
  11. 17
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.java
  12. 16
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml
  13. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.java
  14. 20
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml
  15. 9
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java
  16. 32
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml
  17. 11
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.java
  18. 33
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml
  19. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/LargeScreenDataMapper.java
  20. 13
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.java
  21. 24
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml
  22. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.java
  23. 25
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml
  24. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBinLocationService.java
  25. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBusinessRationService.java
  26. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ICarsLoadDataService.java
  27. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IDeliveryDataService.java
  28. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/INodeDataService.java
  29. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ITrunkDataService.java
  30. 63
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java
  31. 32
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java
  32. 34
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java
  33. 48
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java
  34. 38
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java
  35. 42
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java
  36. 32
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java
  37. 37
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java
  38. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java
  39. 30
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java
  40. 33
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java
  41. 91
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java
  42. 47
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java
  43. 10
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java
  44. 37
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java
  45. 35
      blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java
  46. 11
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatio/ItemDataVO.java
  47. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatioDataVO.java
  48. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/DeptInfoVO.java
  49. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageDataVO.java
  50. 17
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageMonthDataVo.java
  51. 11
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/WarehouseDeptVO.java
  52. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineDataVO.java
  53. 33
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/DeliveryDataVO.java
  54. 66
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/XxlJobQueryVO.java
  55. 20
      blade-service/logpm-report/src/main/resources/application-dev.yml
  56. 10
      blade-service/logpm-report/src/main/resources/application-prod.yml
  57. 7
      blade-service/logpm-report/src/main/resources/application-test.yml
  58. 11
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  59. 2
      blade-service/logpm-warehouse/src/main/resources/luascript/resubmit.lua

41
blade-service-api/logpm-report-api/src/main/java/com/logpm/report/entity/LargeScreenDataEntity.java

@ -0,0 +1,41 @@
package com.logpm.report.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Map;
@Data
@TableName("logpm_large_screen_data")
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
public class LargeScreenDataEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
@ApiModelProperty(name = "数据",notes = "")
private Map<String, Object> data;
public LargeScreenDataEntity(Map<String, Object> data) {
this.data = data;
}
}

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

@ -8140,7 +8140,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人 //更新签收人
distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user); distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
//维护订单状态 //维护订单状态
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd()); JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog); aaa.add(trunklinePackageTrackLog);
} else { } else {

3
blade-service/logpm-distribution/src/main/resources/application-dev.yml

@ -45,6 +45,9 @@ spring:
datasource: datasource:
dynamic: dynamic:
druid: druid:
# connect-timeout: 60000
#通用校验配置 #通用校验配置
validation-query: select 1 validation-query: select 1
#启用sql日志拦截器 #启用sql日志拦截器

146
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OrderStatusHandler.java

@ -158,151 +158,5 @@ public class OrderStatusHandler {
log.info("##################orderStatusHandler: 未知品牌 type={}", type); log.info("##################orderStatusHandler: 未知品牌 type={}", type);
} }
// String status = orderStatusDTO.getStatus();
// if("2".equals(status)){
// String currentWarehouse = orderStatusDTO.getCurrentWarehouse();
// BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(Integer.parseInt(currentWarehouse));
// if(Objects.isNull(basicdataWarehouseEntity)){
// log.warn("####################orderStatusHandler: 仓库信息为空 basicdataWarehouseEntity={}",basicdataWarehouseEntity);
// return;
// }
// Long warehouseId = basicdataWarehouseEntity.getId();
// Integer oldId = basicdataWarehouseEntity.getOldId();
//
// Integer trayId = orderStatusDTO.getTrayId();
// if(Objects.isNull(trayId)){
// log.warn("####################orderStatusHandler: 托盘id为空 trayId={}",trayId);
// return;
// }
// BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode("T" + trayId);
// if(Objects.isNull(basicdataTrayEntity)){
// log.info("############syncTrayTypeData: 托盘信息不存在");
// //如果托盘不存在就去同步该托盘
// TrayEntity trayEntity = trayClient.getTrayById(trayId);
// basicdataTrayEntity = new BasicdataTrayEntity();
// basicdataTrayEntity.setTenantId("627683");
// basicdataTrayEntity.setCreateUser(1714696768639311873L);
// basicdataTrayEntity.setUpdateUser(1714696768639311873L);
// basicdataTrayEntity.setCreateDept(1649331096241836033L);
// basicdataTrayEntity.setPalletName(trayEntity.getTrayNo());
// basicdataTrayEntity.setPalletCode("T"+trayEntity.getId());
// basicdataTrayEntity.setWarehouseId(warehouseId);
// basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+"");
// basicdataTrayEntity.setType(1);
// basicdataTrayEntity.setOldId(trayId);
//// basicdataTrayEntity.setNowWarehouseId(nowNewWarehouseId);
// Long aLong = basicdataTrayClient.addTray(basicdataTrayEntity);
// basicdataTrayEntity.setId(aLong);
// }
//
// TrayScanDesEntity trayScanDesEntity = trayScanDesClient.findScanTypeId(trayId, unitNo, oldId);
// if(Objects.isNull(trayScanDesEntity)){
// log.warn("####################orderStatusHandler: 没有打托数据 trayId={}",trayId);
// return;
// }
// Integer trayScanId = trayScanDesEntity.getTrayScanId();
// TrayScanEntity trayScanEntity = trayScanClient.getEntityByTrayScanId(trayScanId);
// if(Objects.isNull(trayScanEntity)){
// log.warn("####################orderStatusHandler: 没有打托方式数据 trayScanId={}",trayScanId);
// return;
// }
// Integer trayType = trayScanEntity.getType();
//
// String newTrayType = "100";
// if(1==trayType){
// newTrayType = "60";
// }else if(2==trayType){
// newTrayType = "30";
// }else if(3==trayType){
// newTrayType = "50";
// }else if(4==trayType){
// newTrayType = "100";
// }else if(5==trayType){
// newTrayType = "10";
// }else if(6==trayType){
// newTrayType = "20";
// }
//
// //判断托盘是否有上架
// Long allocationId = taryAllocationClient.findAllocationByTrayId(basicdataTrayEntity.getId());
// if(Objects.isNull(allocationId)){
// //没有上架就直接打托
// Map<String,Object> m = new HashMap<>();
// m.put("trayType",newTrayType);
// m.put("trayCode","T"+trayId);
// m.put("warehouseId",warehouseId);
// m.put("orderPackageCode",unitNo);
//
// R response = warehouseTrayTypeClient.orderScanOrderPackageCodeReturnR(m);
// int code = response.getCode();
// if(code == 4001){
// log.info("####################orderStatusHandler: 包件已在当前托盘打托 unitNo={} trayCode={}",unitNo,"T"+trayId);
// }else if(code == 4002){
// log.info("####################orderStatusHandler: 包件已在其他托盘打托 unitNo={} ",unitNo);
// WarehouseTrayGoodsEntity trayGoodsEntity = warehouseTrayGoodsClient.findTrayCodeByOrderPackageCode(unitNo);
// if(Objects.isNull(trayGoodsEntity)){
// log.warn("####################orderStatusHandler: 包件未打托 unitNo={}",unitNo);
// }else{
// String oldTrayCode = trayGoodsEntity.getTrayCode();
// Long trayGoodsId = trayGoodsEntity.getId();
// Long wid = trayGoodsEntity.getWarehouseId();
// BasicdataTrayEntity oldTrayEntity = basicdataTrayClient.getTrayByTrayCode(oldTrayCode);
// Long oldTrayId = oldTrayEntity.getId();
// //判断托盘是否有上架
// Long oldAllocationId = taryAllocationClient.findAllocationByTrayId(oldTrayId);
// if (Objects.isNull(oldAllocationId)){
// //没有上架
// //直接解绑托盘
// warehouseTrayGoodsClient.delTrayGoodsById(trayGoodsId,wid);
// }else{
// //有上架
// //下架
// updownTypeClient.downPackage(unitNo,wid);
// }
// }
//
// boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m);
// if(!b1){
// log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
// }else{
// log.info("####################orderStatusHandler: 二次打托成功 unitNo={} trayCode={}",unitNo,"T"+trayId);
// }
// }else if(code == 4003){
// log.info("####################orderStatusHandler: 包件未打托已上架 unitNo={} ",unitNo);
// WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsClient.findEntityByOrderPackageCode(unitNo);
// if(Objects.isNull(updownGoodsEntity)){
// log.warn("####################orderStatusHandler: 包件未上架 unitNo={}",unitNo);
// }else{
// Long wid = updownGoodsEntity.getWarehouseId();
// updownTypeClient.downPackage(unitNo,wid);
// }
// boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m);
// if(!b1){
// log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
// }else{
// log.info("####################orderStatusHandler: 二次打托成功 unitNo={} trayCode={}",unitNo,"T"+trayId);
// }
// }else if(code == 4004){
// log.info("####################orderStatusHandler: 包件打托方式不正确 unitNo={} ",unitNo);
// //先去空置托盘再打托
// warehouseTrayTypeClient.trayToNull("T"+trayId);
// boolean b1 = warehouseTrayTypeClient.orderScanOrderPackageCode(m);
// if(!b1){
// log.warn("####################orderStatusHandler: 二次打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
// }
// }else{
// String msg1 = r.getMsg();
// int code1 = r.getCode();
// log.warn("######################orderStatusHandler: 打托失败 msg={} code={}",msg1,code1);
// log.warn("######################orderStatusHandler: 打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
// }
//
// }else{
// //有上架就上架
// updownTypeClient.upShelfPackage(unitNo,allocationId,warehouseId);
// }
// }
} }
} }

4
blade-service/logpm-report/pom.xml

@ -48,6 +48,10 @@
<artifactId>logpm-factory-data-api</artifactId> <artifactId>logpm-factory-data-api</artifactId>
<version>3.2.0.RELEASE</version> <version>3.2.0.RELEASE</version>
</dependency> </dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

99
blade-service/logpm-report/src/main/java/com/logpm/report/controller/LargeScreenController.java

@ -1,30 +1,69 @@
package com.logpm.report.controller; package com.logpm.report.controller;
import com.logpm.report.service.largeScreen.IBillingDataService; import com.logpm.report.service.largeScreen.*;
import com.logpm.report.service.largeScreen.IMapWarehouseService; import com.logpm.report.service.largeScreen.impl.BinLocationServiceImpl;
import com.logpm.report.vo.largeScreen.BillingDataVO; import com.logpm.report.vo.largeScreen.*;
import com.logpm.report.vo.largeScreen.MapWarehouseVO;
import com.logpm.report.vo.largeScreen.MonthBillingDataVO;
import com.logpm.report.vo.largeScreen.WarehouseBillingDataVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List; import java.util.List;
@RestController @RestController
@RequestMapping("/largeScreen") @RequestMapping("/largeScreen")
@Api(value = "大屏数据", tags = "大屏数据") @Api(value = "大屏数据", tags = "大屏数据")
@AllArgsConstructor
public class LargeScreenController{ public class LargeScreenController{
private static final Logger log = LoggerFactory.getLogger(LargeScreenController.class);
private final IMapWarehouseService mapWarehouseService; private final IMapWarehouseService mapWarehouseService;
private final IBillingDataService billingDataService; private final IBillingDataService billingDataService;
private final ICarsLoadDataService CarsLoad;
private final INodeDataService nodeData;
private final IBinLocationService BinLocation;
private final ITrunkDataService trunkData;
private final IDeliveryDataService deliveryDataService;
private final IBusinessRationService businessRatio;
public LargeScreenController(
// 正式使用是使用这个
// @Qualifier(value = "mapWarehouseServiceHttp") IMapWarehouseService mapWarehouseService,
// @Qualifier(value = "billingDataServiceHttp") IBillingDataService billingDataService,
// @Qualifier(value = "carsLoadDataServiceHttp") ICarsLoadDataService carsLoadDataService,
// @Qualifier(value = "nodeDataServiceHttp") INodeDataService nodeData,
// @Qualifier(value = "binLocationServiceHttp") IBinLocationService binLocation,
// @Qualifier(value = "trunkDataServiceHttp") ITrunkDataService trunkData,
// @Qualifier(value = "deliveryDataServiceHttp") IDeliveryDataService deliveryDataService,
// @Qualifier(value = "businessRationServiceHttp") IBusinessRationService businessRatio
IMapWarehouseService mapWarehouseService,
IBillingDataService billingDataService,
ICarsLoadDataService carsLoadDataService,
INodeDataService nodeData,
IBinLocationService binLocation,
ITrunkDataService trunkData,
IDeliveryDataService deliveryDataService,
IBusinessRationService businessRatio
) {
this.mapWarehouseService = mapWarehouseService;
this.billingDataService = billingDataService;
this.CarsLoad = carsLoadDataService;
this.nodeData = nodeData;
this.BinLocation = binLocation;
this.trunkData = trunkData;
this.deliveryDataService = deliveryDataService;
this.businessRatio = businessRatio;
}
/** /**
* 地图仓库数据 * 地图仓库数据
@ -62,7 +101,49 @@ public class LargeScreenController{
* 事业线配载件量趋势 * 事业线配载件量趋势
*/ */
@GetMapping("/careerLineData") @GetMapping("/careerLineData")
public R<List<MonthBillingDataVO>> getCareerLineData(){ public R<List<CareerLineDataVO>> getCareerLineData(@Param("isDelivery") Integer isDelivery){
return R.data(billingDataService.getMonthBillingData()); return R.data(CarsLoad.getCareerLineData(isDelivery));
}
/**
* 节点数据
*/
@GetMapping("/nodeData")
public R<NodeDataVO> getNodeData(){
return R.data(nodeData.getNodeData());
}
/**
* 库位数据
*/
@GetMapping("/binLocationData")
public R<BinLocationDataVO> getBinLocationData(){
return R.data(BinLocation.getBinLocationData());
}
/**
* 干线车次数据
*/
@GetMapping("/trunkData")
public R<TrunkDataVO> getTrunkData(){
return R.data(trunkData.getTrunkData());
}
/**
* 配送数据
* @param isYear 是否是年数据 1是
*/
@GetMapping("/deliveryData")
public R<DeliveryDataVO> getDeliveryData(@Param("isYear") Integer isYear){
log.info("getDeliveryData: isYear={}", isYear);
return R.data(deliveryDataService.getDeliveryAllData(isYear));
}
/**
* 业务占比
*/
@GetMapping("/businessRatio")
public R<BusinessRatioDataVO> getDeliveryData2B(){
return R.data(businessRatio.getBusinessRatioData());
} }
} }

20
blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportIncomingController.java

@ -8,9 +8,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -22,32 +20,32 @@ public class ReportIncomingController extends BladeController {
private final IReportIncomingService reportIncomingService; private final IReportIncomingService reportIncomingService;
@GetMapping("/deptIncomingPage") @PostMapping("/deptIncomingPage")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "营业部收入报表", notes = "营业部收入报表") @ApiOperation(value = "营业部收入报表", notes = "营业部收入报表")
public R deptIncomingPage(ReportIncomingDTO reportIncomingDTO) { public R deptIncomingPage(@RequestBody ReportIncomingDTO reportIncomingDTO) {
return reportIncomingService.deptIncomingPage(reportIncomingDTO); return reportIncomingService.deptIncomingPage(reportIncomingDTO);
} }
@GetMapping("/deptIncomingExport") @PostMapping("/deptIncomingExport")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "营业部收入报表导出", notes = "营业部收入报表导出") @ApiOperation(value = "营业部收入报表导出", notes = "营业部收入报表导出")
public void deptIncomingExport(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { public void deptIncomingExport(@RequestBody ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) {
reportIncomingService.deptIncomingExport(reportIncomingDTO,response); reportIncomingService.deptIncomingExport(reportIncomingDTO,response);
} }
@GetMapping("/consigineeIncomingPage") @PostMapping("/consigineeIncomingPage")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "收货单位收入报表", notes = "收货单位收入报表") @ApiOperation(value = "收货单位收入报表", notes = "收货单位收入报表")
public R consigineeIncomingPage(ReportIncomingDTO reportIncomingDTO) { public R consigineeIncomingPage(@RequestBody ReportIncomingDTO reportIncomingDTO) {
return reportIncomingService.consigineeIncomingPage(reportIncomingDTO); return reportIncomingService.consigineeIncomingPage(reportIncomingDTO);
} }
@GetMapping("/consigineeIncomingExport") @PostMapping("/consigineeIncomingExport")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@ApiOperation(value = "收货单位收入报表导出", notes = "收货单位收入报表导出") @ApiOperation(value = "收货单位收入报表导出", notes = "收货单位收入报表导出")
public void consigineeIncomingExport(ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) { public void consigineeIncomingExport(@RequestBody ReportIncomingDTO reportIncomingDTO, HttpServletResponse response) {
reportIncomingService.consigineeIncomingExport(reportIncomingDTO,response); reportIncomingService.consigineeIncomingExport(reportIncomingDTO,response);
} }

70
blade-service/logpm-report/src/main/java/com/logpm/report/job/LargeScreenQueryXxlJob.java

@ -0,0 +1,70 @@
package com.logpm.report.job;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.service.largeScreen.*;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;
import java.util.HashMap;
/**
* 大屏数据查询job
*/
@AllArgsConstructor
@Component
@Log4j2
public class LargeScreenQueryXxlJob {
private final IMapWarehouseService mapWarehouseService;
private final IBillingDataService billingDataService;
private final ICarsLoadDataService CarsLoad;
private final INodeDataService nodeData;
private final IBinLocationService BinLocation;
private final ITrunkDataService trunkData;
private final IDeliveryDataService deliveryDataService;
private final IBusinessRationService businessRatio;
private final LargeScreenDataMapper largeScreenDataMapper;
/**
* 数据查询
*/
@XxlJob("LargeScreenQuery")
public void query()
{
XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO();
xxlJobQueryVO.setMapWarehouse(mapWarehouseService.list());
xxlJobQueryVO.setBillingData(billingDataService.getBillingData());
xxlJobQueryVO.setCareerLineDeliveryData(CarsLoad.getCareerLineData(1));
xxlJobQueryVO.setCareerLineData(CarsLoad.getCareerLineData(0));
xxlJobQueryVO.setNodeData(nodeData.getNodeData());
xxlJobQueryVO.setBinLocationData(BinLocation.getBinLocationData());
xxlJobQueryVO.setTrunkData(trunkData.getTrunkData());
xxlJobQueryVO.setDeliveryData(deliveryDataService.getDeliveryAllData(0));
xxlJobQueryVO.setDeliveryYearData(deliveryDataService.getDeliveryAllData(1));
xxlJobQueryVO.setBusinessRatio(businessRatio.getBusinessRatioData());
xxlJobQueryVO.setWarehouseBillingData(billingDataService.getWarehouseBillingData());
xxlJobQueryVO.setMonthBillingData(billingDataService.getMonthBillingData());
HashMap<String, Object> data = new HashMap<>();
data.put("mapWarehouse", xxlJobQueryVO.getMapWarehouse());
data.put("billingData", xxlJobQueryVO.getBillingData());
data.put("warehouseBillingData", xxlJobQueryVO.getWarehouseBillingData());
data.put("monthBillingData", xxlJobQueryVO.getMonthBillingData());
data.put("careerLineData", xxlJobQueryVO.getCareerLineData());
data.put("careerLineDeliveryData", xxlJobQueryVO.getCareerLineDeliveryData());
data.put("nodeData", xxlJobQueryVO.getNodeData());
data.put("binLocationData", xxlJobQueryVO.getBinLocationData());
data.put("trunkData", xxlJobQueryVO.getTrunkData());
data.put("deliveryData", xxlJobQueryVO.getDeliveryData());
data.put("deliveryYearData", xxlJobQueryVO.getDeliveryYearData());
data.put("businessRatio", xxlJobQueryVO.getBusinessRatio());
largeScreenDataMapper.insert(new LargeScreenDataEntity(data));
}
}

12
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml

@ -36,7 +36,7 @@
</if> </if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 "> <if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 ">
and lww.departure_warehouse_id in and lww.departure_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> <foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
@ -90,7 +90,7 @@
</if> </if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 "> <if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 ">
and lww.departure_warehouse_id in and lww.departure_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> <foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
@ -152,7 +152,7 @@
</if> </if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 "> <if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 ">
and lww.departure_warehouse_id in and lww.departure_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> <foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
@ -214,7 +214,7 @@
</if> </if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 "> <if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 ">
and lww.departure_warehouse_id in and lww.departure_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> <foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
@ -272,7 +272,7 @@
</if> </if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 "> <if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 ">
and lww.departure_warehouse_id in and lww.departure_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> <foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
@ -337,7 +337,7 @@
</if> </if>
<if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 "> <if test="param.departureWarehouseIds != null and param.departureWarehouseIds.size() > 0 ">
and lww.departure_warehouse_id in and lww.departure_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")"> <foreach collection="param.departureWarehouseIds" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>

4
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BillingDataMapper.xml

@ -18,7 +18,7 @@
count(d.id) as value, count(d.id) as value,
w.destination_warehouse_id as warehouseId w.destination_warehouse_id as warehouseId
from logpm_platform.logpm_warehouse_waybill as w from logpm_platform.logpm_warehouse_waybill as w
INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.waybill_no = d.waybill_no INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.id = d.waybill_id
where w.freeze_status = 0 where w.freeze_status = 0
and w.create_time BETWEEN #{startTime} and #{endTime} and w.create_time BETWEEN #{startTime} and #{endTime}
group by w.destination_warehouse_id group by w.destination_warehouse_id
@ -30,7 +30,7 @@
count(d.id) as value, count(d.id) as value,
date_format(w.create_time, '%Y-%m') as month date_format(w.create_time, '%Y-%m') as month
from logpm_platform.logpm_warehouse_waybill as w from logpm_platform.logpm_warehouse_waybill as w
INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.waybill_no = d.waybill_no INNER JOIN logpm_platform.logpm_trunkline_advance_detail as d on w.id = d.waybill_id
where w.freeze_status = 0 where w.freeze_status = 0
and w.create_time BETWEEN #{startTime} and #{endTime} and w.create_time BETWEEN #{startTime} and #{endTime}
group by month group by month

17
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.java

@ -0,0 +1,17 @@
package com.logpm.report.mapper.largeScreen;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BinLocationMapper {
// 在库订单数
Integer getOrderNum();
// 包裹数
Integer getPackageNum();
// 货柜数
Integer getBinLocationNum();
// 使用货柜数
// 空闲货柜数
Integer getIdleBinLocationNum();
}

16
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BinLocationMapper.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.BinLocationMapper">
<select id="getOrderNum" resultType="java.lang.Integer">
select count(distinct order_code) from logpm_platform.logpm_distribution_parcel_list where order_package_status = '20'
</select>
<select id="getPackageNum" resultType="java.lang.Integer">
select count(distinct order_package_code) from logpm_platform.logpm_distribution_parcel_list where order_package_status = '20'
</select>
<select id="getBinLocationNum" resultType="java.lang.Integer">
select count(id) from logpm_platform.logpm_warehouse_goods_allocation where enable_status = 1
</select>
<select id="getIdleBinLocationNum" resultType="java.lang.Integer">
select count(*) from logpm_platform.logpm_warehouse_goods_allocation where enable_status = 1 AND allocation_status = 1
</select>
</mapper>

15
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.java

@ -0,0 +1,15 @@
package com.logpm.report.mapper.largeScreen;
import com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface BusinessRatioMapper {
List<ItemDataVO> getTypeData(String startTime, String endTime);
List<ItemDataVO> getBrandData(String startTime, String endTime);
}

20
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/BusinessRatioMapper.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.BusinessRatioMapper">
<select id="getTypeData" resultType="com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO">
select
service_type as name,
SUM(total_count) as value
from logpm_platform.logpm_warehouse_waybill
where create_time between #{startTime} and #{endTime}
group by service_type
</select>
<select id="getBrandData" resultType="com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO">
select
brand as name,
SUM(total_count) as value
from logpm_platform.logpm_warehouse_waybill
where create_time between #{startTime} and #{endTime}
group by brand
</select>
</mapper>

9
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.java

@ -1,14 +1,19 @@
package com.logpm.report.mapper.largeScreen; package com.logpm.report.mapper.largeScreen;
import com.logpm.report.vo.largeScreen.CareerLineData.CareerLineInfoVO; import com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO;
import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO;
import com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface CarsLoadDataMapper { public interface CarsLoadDataMapper {
public List<CareerLineInfoVO> getCareerLineInfo(); public List<DeptInfoVO> getDeptInfo();
public List<VehicleStowageDataVO> getVehicleStowageData(String startTime, String endTime);
public List<VehicleStowageDataVO> getDeliveryData(String startTime, String endTime);
public List<WarehouseDeptVO> getWarehouseDept();
} }

32
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/CarsLoadDataMapper.xml

@ -1,11 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.CarsLoadDataMapper"> <mapper namespace="com.logpm.report.mapper.largeScreen.CarsLoadDataMapper">
<select id="getCareerLineInfo" <select id="getDeptInfo"
resultType="com.logpm.report.vo.largeScreen.CareerLineData.CareerLineInfoVO"> resultType="com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO">
SELECT id, SELECT id,
dept_name as deptName dept_name as deptName,
parent_id as parentId
FROM logpm.blade_dept FROM logpm.blade_dept
WHERE dept_category = 2 AND dept_name like '%事业线%' </select>
<select id="getVehicleStowageData"
resultType="com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO">
select DATE_FORMAT(create_time, '%Y-%m') as createMonth,
SUBSTRING_INDEX(end_warehouse_ids, ',', -1) as warehouseId,
SUM(real_loading_number) as total
from logpm_platform.logpm_trunkline_cars_load
where create_time between #{startTime} and #{endTime}
group by createMonth, warehouseId
</select>
<select id="getWarehouseDept" resultType="com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO">
select
id as warehouseId,
department as dept
from logpm_platform.logpm_warehouse_warehouse
</select>
<select id="getDeliveryData" resultType="com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO">
select DATE_FORMAT(create_time, '%Y-%m') as createMonth,
warehouse_id as warehouseId,
SUM(delivery_number) as total
from logpm_platform.logpm_distribution_delivery_list
where create_time between #{startTime} and #{endTime}
group by createMonth, warehouseId
</select> </select>
</mapper> </mapper>

11
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.java

@ -0,0 +1,11 @@
package com.logpm.report.mapper.largeScreen;
import com.logpm.report.vo.largeScreen.DeliveryDataVO;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DeliveryDataMapper {
public DeliveryDataVO getDeliveryAllData(String startTime, String endTime);
public DeliveryDataVO getDelivery2BData(String startTime, String endTime);
public DeliveryDataVO getDelivery2CData(String startTime, String endTime);
}

33
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/DeliveryDataMapper.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.DeliveryDataMapper">
<select id="getDeliveryAllData" resultType="com.logpm.report.vo.largeScreen.DeliveryDataVO">
select
count(*) as total,
sum(case when delivery_status = '3' then 0 else 1 end) as toBeSigned
from logpm_platform.logpm_distribution_delivery_list
<if test="startTime != null">
where create_time between #{startTime} and #{endTime}
</if>
</select>
<select id="getDelivery2BData" resultType="com.logpm.report.vo.largeScreen.DeliveryDataVO">
select
count(*) as total2B,
sum(case when delivery_status = '3' then 0 else 1 end) as toBeSigned2B
from logpm_platform.logpm_distribution_delivery_list
where type = '1'
<if test="startTime != null">
and create_time between #{startTime} and #{endTime}
</if>
</select>
<select id="getDelivery2CData" resultType="com.logpm.report.vo.largeScreen.DeliveryDataVO">
select
count(*) as total2C,
sum(case when delivery_status = '3' then 0 else 1 end) as toBeSigned2C
from logpm_platform.logpm_distribution_delivery_list
where type = '2'
<if test="startTime != null">
and create_time between #{startTime} and #{endTime}
</if>
</select>
</mapper>

10
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/LargeScreenDataMapper.java

@ -0,0 +1,10 @@
package com.logpm.report.mapper.largeScreen;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.report.entity.LargeScreenDataEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface LargeScreenDataMapper extends BaseMapper<LargeScreenDataEntity> {
}

13
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.java

@ -0,0 +1,13 @@
package com.logpm.report.mapper.largeScreen;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface NodeDataMapper {
public Integer getWaybill(String startTime, String endTime);
public Integer getCarsLoadLoading(String startTime, String endTime);
public Integer getDeliveryLading(String startTime, String endTime);
public Integer getArrival(String startTime, String endTime);
public Integer getSign(String startTime, String endTime);
}

24
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/NodeDataMapper.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.NodeDataMapper">
<select id="getWaybill" resultType="java.lang.Integer">
select SUM(total_count) from logpm_platform.logpm_warehouse_waybill where create_time between #{startTime} and #{endTime}
</select>
<select id="getCarsLoadLoading" resultType="java.lang.Integer">
select SUM(real_loading_number) from logpm_platform.logpm_trunkline_cars_load where create_time between #{startTime} and #{endTime}
</select>
<select id="getDeliveryLading" resultType="java.lang.Integer">
select SUM(loaded_number) + SUM(loadedin_number) from logpm_platform.logpm_distribution_signfor where create_time between #{startTime} and #{endTime}
</select>
<select id="getArrival" resultType="java.lang.Integer">
select
count(*)
from logpm_platform.logpm_warehouse_waybill w
INNER JOIN logpm_platform.logpm_trunkline_cars_unload_log l on l.waybill_id = w.id
where l.create_time between #{startTime} and #{endTime}
</select>
<select id="getSign" resultType="java.lang.Integer">
select SUM(received_quantity) + SUM(receivedin_quantity) from logpm_platform.logpm_distribution_signfor where create_time between #{startTime} and #{endTime}
</select>
</mapper>

10
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.java

@ -0,0 +1,10 @@
package com.logpm.report.mapper.largeScreen;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TrunkDataMapper {
public Integer getTotal(String startTime, String endTime);
public Integer getOnTheWay();
public Integer getArrival(String startTime, String endTime);
}

25
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/largeScreen/TrunkDataMapper.xml

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.logpm.report.mapper.largeScreen.TrunkDataMapper">
<select id="getTotal" resultType="java.lang.Integer">
select count(*)
from logpm_platform.logpm_trunkline_cars_load
where
create_time between #{startTime} and #{endTime}
and load_status in ('0', '10', '20', '30', '40', '80')
</select>
<select id="getOnTheWay" resultType="java.lang.Integer">
select
count(*)
from logpm_platform.logpm_trunkline_cars_load
where load_status in ('10', '20', '30')
</select>
<select id="getArrival" resultType="java.lang.Integer">
select
count(*)
from logpm_platform.logpm_trunkline_cars_load
where
create_time between #{startTime} and #{endTime}
and load_status in ('40', '80')
</select>
</mapper>

7
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/IBinLocationService.java

@ -0,0 +1,7 @@
package com.logpm.report.service.largeScreen;
import com.logpm.report.vo.largeScreen.BinLocationDataVO;
public interface IBinLocationService {
BinLocationDataVO getBinLocationData();
}

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

@ -0,0 +1,8 @@
package com.logpm.report.service.largeScreen;
import com.logpm.report.vo.largeScreen.BusinessRatioDataVO;
public interface IBusinessRationService {
BusinessRatioDataVO getBusinessRatioData();
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/ICarsLoadDataService.java

@ -11,5 +11,5 @@ import java.util.List;
public interface ICarsLoadDataService { public interface ICarsLoadDataService {
public List<CareerLineDataVO> getCareerLineData(); public List<CareerLineDataVO> getCareerLineData(Integer isDelivery);
} }

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

@ -0,0 +1,8 @@
package com.logpm.report.service.largeScreen;
import com.logpm.report.vo.largeScreen.DeliveryDataVO;
public interface IDeliveryDataService {
DeliveryDataVO getDeliveryAllData(Integer isYear);
}

7
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/INodeDataService.java

@ -0,0 +1,7 @@
package com.logpm.report.service.largeScreen;
import com.logpm.report.vo.largeScreen.NodeDataVO;
public interface INodeDataService {
NodeDataVO getNodeData();
}

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

@ -0,0 +1,8 @@
package com.logpm.report.service.largeScreen;
import com.logpm.report.vo.largeScreen.TrunkDataVO;
public interface ITrunkDataService {
public TrunkDataVO getTrunkData();
}

63
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java

@ -0,0 +1,63 @@
package com.logpm.report.service.largeScreen.httpImpl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.BillingDataMapper;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.mapper.largeScreen.MapWarehouseMapper;
import com.logpm.report.service.largeScreen.IBillingDataService;
import com.logpm.report.vo.largeScreen.BillingDataVO;
import com.logpm.report.vo.largeScreen.MapWarehouse.WarehouseInfoVO;
import com.logpm.report.vo.largeScreen.MonthBillingDataVO;
import com.logpm.report.vo.largeScreen.WarehouseBillingDataVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import com.logpm.report.vo.largeScreen.billingData.BillingDataInfoVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service("billingDataServiceHttp")
@Log4j2
@AllArgsConstructor
public class BillingDataServiceImpl implements IBillingDataService {
private final LargeScreenDataMapper largeScreenDataMapper;
@Override
public BillingDataVO getBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getBillingData();
}
@Override
public List<WarehouseBillingDataVO> getWarehouseBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getWarehouseBillingData();
}
@Override
public List<MonthBillingDataVO> getMonthBillingData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new ArrayList<>();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getMonthBillingData();
}
}

32
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BinLocationServiceImpl.java

@ -0,0 +1,32 @@
package com.logpm.report.service.largeScreen.httpImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.BinLocationMapper;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.service.largeScreen.IBinLocationService;
import com.logpm.report.vo.largeScreen.BinLocationDataVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service("binLocationServiceHttp")
@Log4j2
public class BinLocationServiceImpl implements IBinLocationService {
private final LargeScreenDataMapper largeScreenDataMapper;
public BinLocationDataVO getBinLocationData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new BinLocationDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getBinLocationData();
}
}

34
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BusinessRationServiceImpl.java

@ -0,0 +1,34 @@
package com.logpm.report.service.largeScreen.httpImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.BusinessRatioMapper;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.service.largeScreen.IBusinessRationService;
import com.logpm.report.vo.largeScreen.BusinessRatioDataVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service("businessRationServiceHttp")
@Log4j2
public class BusinessRationServiceImpl implements IBusinessRationService {
private final LargeScreenDataMapper largeScreenDataMapper;
@Override
public BusinessRatioDataVO getBusinessRatioData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new BusinessRatioDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getBusinessRatio();
}
}

48
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/CarsLoadDataServiceImpl.java

@ -0,0 +1,48 @@
package com.logpm.report.service.largeScreen.httpImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.CarsLoadDataMapper;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.service.largeScreen.ICarsLoadDataService;
import com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO;
import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO;
import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageMonthDataVo;
import com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO;
import com.logpm.report.vo.largeScreen.CareerLineDataVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@AllArgsConstructor
@Service("carsLoadDataServiceHttp")
@Log4j2
public class CarsLoadDataServiceImpl implements ICarsLoadDataService {
private final LargeScreenDataMapper largeScreenDataMapper;
@Override
public List<CareerLineDataVO> getCareerLineData(Integer isDelivery) {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new ArrayList<>();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return isDelivery.equals(1)
? init.getCareerLineDeliveryData()
: init.getCareerLineData();
}
}

38
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/DeliveryDataServiceImpl.java

@ -0,0 +1,38 @@
package com.logpm.report.service.largeScreen.httpImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.DeliveryDataMapper;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.service.largeScreen.IDeliveryDataService;
import com.logpm.report.vo.largeScreen.DeliveryDataVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service("deliveryDataServiceHttp")
@Log4j2
public class DeliveryDataServiceImpl implements IDeliveryDataService {
private final LargeScreenDataMapper largeScreenDataMapper;
@Override
public DeliveryDataVO getDeliveryAllData(Integer isYear) {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new DeliveryDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return isYear.equals(1)
? init.getDeliveryYearData()
: init.getDeliveryData();
}
}

42
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/MapWarehouseServiceImpl.java

@ -0,0 +1,42 @@
package com.logpm.report.service.largeScreen.httpImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.mapper.largeScreen.MapWarehouseMapper;
import com.logpm.report.service.largeScreen.IMapWarehouseService;
import com.logpm.report.vo.largeScreen.MapWarehouse.LineInfoVO;
import com.logpm.report.vo.largeScreen.MapWarehouse.WarehouseInfoVO;
import com.logpm.report.vo.largeScreen.MapWarehouseVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@AllArgsConstructor
@Service("mapWarehouseServiceHttp")
@Slf4j
public class MapWarehouseServiceImpl implements IMapWarehouseService {
private final LargeScreenDataMapper largeScreenDataMapper;
@Override
public List<MapWarehouseVO> list() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new ArrayList<>();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getMapWarehouse();
}
}

32
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/NodeDataServiceImpl.java

@ -0,0 +1,32 @@
package com.logpm.report.service.largeScreen.httpImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.service.largeScreen.INodeDataService;
import com.logpm.report.vo.largeScreen.NodeDataVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Log4j2
@Service("nodeDataServiceHttp")
public class NodeDataServiceImpl implements INodeDataService {
private final LargeScreenDataMapper largeScreenDataMapper;
@Override
public NodeDataVO getNodeData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new NodeDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getNodeData();
}
}

37
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/TrunkDataServiceImpl.java

@ -0,0 +1,37 @@
package com.logpm.report.service.largeScreen.httpImpl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.report.entity.LargeScreenDataEntity;
import com.logpm.report.mapper.largeScreen.LargeScreenDataMapper;
import com.logpm.report.mapper.largeScreen.TrunkDataMapper;
import com.logpm.report.service.largeScreen.ITrunkDataService;
import com.logpm.report.vo.largeScreen.TrunkDataVO;
import com.logpm.report.vo.largeScreen.XxlJobQueryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service("trunkDataServiceHttp")
@Log4j2
public class TrunkDataServiceImpl implements ITrunkDataService {
private final LargeScreenDataMapper largeScreenDataMapper;
@Override
public TrunkDataVO getTrunkData() {
LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.<LargeScreenDataEntity>lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime));
if (largeScreenDataEntity == null) {
return new TrunkDataVO();
}
XxlJobQueryVO init = XxlJobQueryVO.init(largeScreenDataEntity.getData());
return init.getTrunkData();
}
}

4
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BillingDataServiceImpl.java

@ -11,14 +11,16 @@ import com.logpm.report.vo.largeScreen.WarehouseBillingDataVO;
import com.logpm.report.vo.largeScreen.billingData.BillingDataInfoVO; import com.logpm.report.vo.largeScreen.billingData.BillingDataInfoVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service("张三")
@Log4j2 @Log4j2
@AllArgsConstructor @AllArgsConstructor
@Primary
public class BillingDataServiceImpl implements IBillingDataService { public class BillingDataServiceImpl implements IBillingDataService {
private final BillingDataMapper billingDataMapper; private final BillingDataMapper billingDataMapper;

30
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BinLocationServiceImpl.java

@ -0,0 +1,30 @@
package com.logpm.report.service.largeScreen.impl;
import com.logpm.report.mapper.largeScreen.BinLocationMapper;
import com.logpm.report.service.largeScreen.IBinLocationService;
import com.logpm.report.vo.largeScreen.BinLocationDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
@AllArgsConstructor
@Service
@Log4j2
@Primary
public class BinLocationServiceImpl implements IBinLocationService {
private BinLocationMapper binLocationMapper;
public BinLocationDataVO getBinLocationData() {
BinLocationDataVO binLocationDataVO = new BinLocationDataVO();
binLocationDataVO.setOrderNum(binLocationMapper.getOrderNum());
binLocationDataVO.setPackageNum(binLocationMapper.getPackageNum());
binLocationDataVO.setBinLocationNum(binLocationMapper.getBinLocationNum());
binLocationDataVO.setUseBinLocationNum(binLocationMapper.getBinLocationNum() - binLocationMapper.getIdleBinLocationNum());
binLocationDataVO.setIdleBinLocationNum(binLocationMapper.getIdleBinLocationNum());
return binLocationDataVO;
}
}

33
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/BusinessRationServiceImpl.java

@ -0,0 +1,33 @@
package com.logpm.report.service.largeScreen.impl;
import com.logpm.report.mapper.largeScreen.BusinessRatioMapper;
import com.logpm.report.service.largeScreen.IBusinessRationService;
import com.logpm.report.vo.largeScreen.BusinessRatioDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service
@Log4j2
@Primary
public class BusinessRationServiceImpl implements IBusinessRationService {
private final BusinessRatioMapper businessRatioMapper;
@Override
public BusinessRatioDataVO getBusinessRatioData() {
String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00"));
String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59"));
BusinessRatioDataVO businessRatioDataVO = new BusinessRatioDataVO();
businessRatioDataVO.setType(businessRatioMapper.getTypeData(startTime, endTime));
businessRatioDataVO.setBrand(businessRatioMapper.getBrandData(startTime, endTime));
return businessRatioDataVO;
}
}

91
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/CarsLoadDataServiceImpl.java

@ -2,28 +2,107 @@ package com.logpm.report.service.largeScreen.impl;
import com.logpm.report.mapper.largeScreen.CarsLoadDataMapper; import com.logpm.report.mapper.largeScreen.CarsLoadDataMapper;
import com.logpm.report.service.largeScreen.ICarsLoadDataService; import com.logpm.report.service.largeScreen.ICarsLoadDataService;
import com.logpm.report.vo.largeScreen.CareerLineData.CareerLineInfoVO; import com.logpm.report.vo.largeScreen.CareerLineData.DeptInfoVO;
import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageDataVO;
import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageMonthDataVo;
import com.logpm.report.vo.largeScreen.CareerLineData.WarehouseDeptVO;
import com.logpm.report.vo.largeScreen.CareerLineDataVO; import com.logpm.report.vo.largeScreen.CareerLineDataVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collections; import java.time.LocalDate;
import java.util.List; import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@AllArgsConstructor @AllArgsConstructor
@Service @Service
@Log4j2 @Log4j2
@Primary
public class CarsLoadDataServiceImpl implements ICarsLoadDataService { public class CarsLoadDataServiceImpl implements ICarsLoadDataService {
private CarsLoadDataMapper carsLoadDataMapper; private CarsLoadDataMapper carsLoadDataMapper;
@Override @Override
public List<CareerLineDataVO> getCareerLineData() { public List<CareerLineDataVO> getCareerLineData(Integer isDelivery) {
List<CareerLineInfoVO> careerLineInfo = carsLoadDataMapper.getCareerLineInfo(); Map<Long, DeptInfoVO> careerLineMap = analysisCareerLineByDept(carsLoadDataMapper.getDeptInfo());
Map<Long, Long> warehouseDept = carsLoadDataMapper.getWarehouseDept().stream()
.filter(WarehouseDeptVO -> WarehouseDeptVO.getDept() != null)
.collect(Collectors.toMap(WarehouseDeptVO::getWarehouseId, WarehouseDeptVO::getDept));
String startTime = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00"));
String endTime = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59"));
List<VehicleStowageDataVO> vehicleStowageData = isDelivery.equals(1)
? carsLoadDataMapper.getDeliveryData(startTime, endTime)
: carsLoadDataMapper.getVehicleStowageData(startTime, endTime);
return Collections.emptyList(); HashMap<Long, CareerLineDataVO> resultMap = new HashMap<>();
for (VehicleStowageDataVO vehicleStowageDataVO : vehicleStowageData) {
Long DeptId = warehouseDept.get(vehicleStowageDataVO.getWarehouseId());
if (!careerLineMap.containsKey(DeptId)) {
log.info("未找到事业线:" + DeptId);
continue;
}
DeptInfoVO careerLine = careerLineMap.get(DeptId);
if (!resultMap.containsKey(careerLine.getId())) {
resultMap.put(careerLine.getId(), new CareerLineDataVO(careerLine.getDeptName(), monthDataInit()));
}
resultMap.get(careerLine.getId()).getMonthData().forEach(vehicleStowageMonthDataVo -> {
if (vehicleStowageDataVO.getCreateMonth().equals(vehicleStowageMonthDataVo.getCreateMonth())) {
vehicleStowageMonthDataVo.setTotal(vehicleStowageMonthDataVo.getTotal() + vehicleStowageDataVO.getTotal());
}
});
}
return new ArrayList<>(resultMap.values());
}
private List<VehicleStowageMonthDataVo> monthDataInit(){
String year = String.valueOf(LocalDate.now().getYear());
List<VehicleStowageMonthDataVo> vehicleStowageMonthDataVos = new ArrayList<>();
for (int i = 1; i <= 12; i++) {
vehicleStowageMonthDataVos.add(new VehicleStowageMonthDataVo(year + "-" + String.format("%02d", i), 0));
}
return vehicleStowageMonthDataVos;
}
/**
* 根据部门id获取事业线信息
* @param deptInfo 所有部门信息
*/
private Map<Long, DeptInfoVO> analysisCareerLineByDept(List<DeptInfoVO> deptInfo) {
Map<Long, DeptInfoVO> deptInfoVOMap = deptInfo.stream().collect(Collectors.toMap(DeptInfoVO::getId, deptInfoVO -> deptInfoVO));
Map<Long, DeptInfoVO> careerLineMap = new HashMap<>();
deptInfo.forEach(deptInfoVO -> {
if (deptInfoVO.getDeptName().contains("事业线")) {
careerLineMap.put(deptInfoVO.getId(), deptInfoVO);
return;
}
Long parentId = deptInfoVO.getParentId();
while (deptInfoVOMap.containsKey(parentId)) {
if (deptInfoVOMap.get(parentId).getDeptName().contains("事业线")) {
careerLineMap.put(deptInfoVO.getId(), deptInfoVOMap.get(parentId));
return;
}
parentId = deptInfoVOMap.get(parentId).getParentId();
}
careerLineMap.put(deptInfoVO.getId(), deptInfoVO);
});
return careerLineMap;
} }
} }

47
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/DeliveryDataServiceImpl.java

@ -0,0 +1,47 @@
package com.logpm.report.service.largeScreen.impl;
import com.logpm.report.mapper.largeScreen.DeliveryDataMapper;
import com.logpm.report.service.largeScreen.IDeliveryDataService;
import com.logpm.report.vo.largeScreen.DeliveryDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service
@Log4j2
@Primary
public class DeliveryDataServiceImpl implements IDeliveryDataService {
private final DeliveryDataMapper deliveryDataMapper;
@Override
public DeliveryDataVO getDeliveryAllData(Integer isYear) {
DeliveryDataVO deliveryDataVO = new DeliveryDataVO();
String startTime = isYear.equals(1) ? LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00")) : null;
String endTime = isYear.equals(1) ? LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59")) : null;
DeliveryDataVO deliveryAllData = deliveryDataMapper.getDeliveryAllData(startTime, endTime);
DeliveryDataVO delivery2CData = deliveryDataMapper.getDelivery2CData(startTime, endTime);
DeliveryDataVO delivery2BData = deliveryDataMapper.getDelivery2BData(startTime, endTime);
deliveryDataVO.setTotal(deliveryAllData.getTotal());
deliveryDataVO.setToBeSigned(deliveryAllData.getToBeSigned());
deliveryDataVO.setSigned(deliveryAllData.getTotal() - deliveryAllData.getToBeSigned());
deliveryDataVO.setTotal2B(delivery2BData.getTotal2B());
deliveryDataVO.setToBeSigned2B(delivery2BData.getToBeSigned2B());
deliveryDataVO.setSigned2B(delivery2BData.getTotal2B() - delivery2BData.getToBeSigned2B());
deliveryDataVO.setTotal2C(delivery2CData.getTotal2C());
deliveryDataVO.setToBeSigned2C(delivery2CData.getToBeSigned2C());
deliveryDataVO.setSigned2C(delivery2CData.getTotal2C() - delivery2CData.getToBeSigned2C());
return deliveryDataVO;
}
}

10
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/MapWarehouseServiceImpl.java

@ -9,14 +9,19 @@ import com.logpm.report.vo.largeScreen.MapWarehouse.WarehouseInfoVO;
import com.logpm.report.vo.largeScreen.MapWarehouseVO; import com.logpm.report.vo.largeScreen.MapWarehouseVO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@AllArgsConstructor @AllArgsConstructor
@Service @Service
@Slf4j @Slf4j
@Primary
public class MapWarehouseServiceImpl implements IMapWarehouseService { public class MapWarehouseServiceImpl implements IMapWarehouseService {
private final MapWarehouseMapper mapWarehouseMapper; private final MapWarehouseMapper mapWarehouseMapper;
@ -25,10 +30,9 @@ public class MapWarehouseServiceImpl implements IMapWarehouseService {
public List<MapWarehouseVO> list() { public List<MapWarehouseVO> list() {
List<WarehouseInfoVO> warehouselist = mapWarehouseMapper.warehouselist(); List<WarehouseInfoVO> warehouselist = mapWarehouseMapper.warehouselist();
List<LineInfoVO> lineInfoVOS = mapWarehouseMapper.lineInfolist( List<LineInfoVO> lineInfoVOS = mapWarehouseMapper.lineInfolist(
DateUtil.format(new Date(), "yyyy-10-dd 00:00:00"), LocalDateTime.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")),
DateUtil.format(new Date(), "yyyy-MM-dd 23:59:59") LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd 23:59:59"))
); );
log.info("lineInfoVOS:{}", lineInfoVOS);
Map<Long, List<LineInfoVO>> warehouseLine = lineInfoVOS.stream().collect(Collectors.groupingBy(LineInfoVO::getStartWarehouseId)); Map<Long, List<LineInfoVO>> warehouseLine = lineInfoVOS.stream().collect(Collectors.groupingBy(LineInfoVO::getStartWarehouseId));

37
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/NodeDataServiceImpl.java

@ -0,0 +1,37 @@
package com.logpm.report.service.largeScreen.impl;
import com.logpm.report.mapper.largeScreen.NodeDataMapper;
import com.logpm.report.service.largeScreen.INodeDataService;
import com.logpm.report.vo.largeScreen.NodeDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Log4j2
@Service
@Primary
public class NodeDataServiceImpl implements INodeDataService {
private final NodeDataMapper nodeDataMapper;
@Override
public NodeDataVO getNodeData() {
String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00"));
String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59"));
NodeDataVO nodeDataVO = new NodeDataVO();
nodeDataVO.setWaybill(nodeDataMapper.getWaybill(startTime, endTime));
nodeDataVO.setCarsLoadLoading(nodeDataMapper.getCarsLoadLoading(startTime, endTime));
nodeDataVO.setDeliveryLading(nodeDataMapper.getDeliveryLading(startTime, endTime));
nodeDataVO.setArrival(nodeDataMapper.getArrival(startTime, endTime));
nodeDataVO.setSign(nodeDataMapper.getSign(startTime, endTime));
return nodeDataVO;
}
}

35
blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/impl/TrunkDataServiceImpl.java

@ -0,0 +1,35 @@
package com.logpm.report.service.largeScreen.impl;
import com.logpm.report.mapper.largeScreen.TrunkDataMapper;
import com.logpm.report.service.largeScreen.ITrunkDataService;
import com.logpm.report.vo.largeScreen.TrunkDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@AllArgsConstructor
@Service
@Log4j2
@Primary
public class TrunkDataServiceImpl implements ITrunkDataService {
private final TrunkDataMapper trunkDataMapper;
@Override
public TrunkDataVO getTrunkData() {
String startTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-01-01 00:00:00"));
String endTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-12-31 23:59:59"));
TrunkDataVO trunkDataVO = new TrunkDataVO();
trunkDataVO.setTotal(trunkDataMapper.getTotal(startTime, endTime));
trunkDataVO.setOnTheWay(trunkDataMapper.getOnTheWay());
trunkDataVO.setArrival(trunkDataMapper.getArrival(startTime, endTime));
return trunkDataVO;
}
}

11
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatio/ItemDataVO.java

@ -0,0 +1,11 @@
package com.logpm.report.vo.largeScreen.BusinessRatio;
import lombok.Data;
@Data
public class ItemDataVO {
private String name;
private Integer value;
}

14
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/BusinessRatioDataVO.java

@ -0,0 +1,14 @@
package com.logpm.report.vo.largeScreen;
import com.logpm.report.vo.largeScreen.BusinessRatio.ItemDataVO;
import lombok.Data;
import java.util.List;
@Data
public class BusinessRatioDataVO {
private List<ItemDataVO> type;
private List<ItemDataVO> brand;
}

4
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/CareerLineInfoVO.java → blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/DeptInfoVO.java

@ -4,8 +4,10 @@ package com.logpm.report.vo.largeScreen.CareerLineData;
import lombok.Data; import lombok.Data;
@Data @Data
public class CareerLineInfoVO { public class DeptInfoVO {
public String deptName; public String deptName;
public Long parentId;
public Long id; public Long id;
} }

15
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageDataVO.java

@ -0,0 +1,15 @@
package com.logpm.report.vo.largeScreen.CareerLineData;
import lombok.Data;
import java.util.List;
@Data
public class VehicleStowageDataVO {
private Long warehouseId;
private String createMonth;
private Integer total;
}

17
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/VehicleStowageMonthDataVo.java

@ -0,0 +1,17 @@
package com.logpm.report.vo.largeScreen.CareerLineData;
import lombok.Data;
@Data
public class VehicleStowageMonthDataVo {
private String createMonth;
private Integer total;
public VehicleStowageMonthDataVo(String createMonth, Integer total){
this.createMonth = createMonth;
this.total = total;
}
}

11
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineData/WarehouseDeptVO.java

@ -0,0 +1,11 @@
package com.logpm.report.vo.largeScreen.CareerLineData;
import lombok.Data;
@Data
public class WarehouseDeptVO {
private Long dept;
private Long warehouseId;
}

15
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/CareerLineDataVO.java

@ -1,7 +1,22 @@
package com.logpm.report.vo.largeScreen; package com.logpm.report.vo.largeScreen;
import com.logpm.report.vo.largeScreen.CareerLineData.VehicleStowageMonthDataVo;
import lombok.Data;
import java.util.List;
/** /**
* 事业线车辆配载数据 * 事业线车辆配载数据
*/ */
@Data
public class CareerLineDataVO { public class CareerLineDataVO {
private String careerLineName;
private List<VehicleStowageMonthDataVo> monthData;
public CareerLineDataVO(String careerLineName, List<VehicleStowageMonthDataVo> monthData) {
this.careerLineName = careerLineName;
this.monthData = monthData;
}
} }

33
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/DeliveryDataVO.java

@ -11,4 +11,37 @@ public class DeliveryDataVO {
/** /**
* 配送总数 * 配送总数
*/ */
private Integer total;
/**
* 待签数
*/
private Integer toBeSigned;
/**
* 已签数
*/
private Integer signed;
/**
* 2B总数
*/
private Integer total2B;
/**
* 2B已签数
*/
private Integer signed2B;
/**
* 2B待签数
*/
private Integer toBeSigned2B;
/**
* 2C总数
*/
private Integer total2C;
/**
* 2C已签数
*/
private Integer signed2C;
/**
* 2C待签数
*/
private Integer toBeSigned2C;
} }

66
blade-service/logpm-report/src/main/java/com/logpm/report/vo/largeScreen/XxlJobQueryVO.java

@ -0,0 +1,66 @@
package com.logpm.report.vo.largeScreen;
import lombok.Data;
import java.util.List;
import java.util.Map;
@Data
public class XxlJobQueryVO {
List<MapWarehouseVO> mapWarehouse;
BillingDataVO billingData;
List<WarehouseBillingDataVO> warehouseBillingData;
List<MonthBillingDataVO> monthBillingData;
List<CareerLineDataVO> careerLineData;
List<CareerLineDataVO> careerLineDeliveryData;
NodeDataVO nodeData;
BinLocationDataVO binLocationData;
TrunkDataVO trunkData;
DeliveryDataVO deliveryData;
DeliveryDataVO deliveryYearData;
BusinessRatioDataVO businessRatio;
public static XxlJobQueryVO init(Map<String, Object> data){
XxlJobQueryVO xxlJobQueryVO = new XxlJobQueryVO();
data.forEach((k,v) -> {
if (k.equals("mapWarehouse")) {
xxlJobQueryVO.setMapWarehouse((List<MapWarehouseVO>) v);
}
if (k.equals("billingData")) {
xxlJobQueryVO.setBillingData((BillingDataVO) v);
}
if (k.equals("warehouseBillingData")) {
xxlJobQueryVO.setWarehouseBillingData((List<WarehouseBillingDataVO>) v);
}
if (k.equals("monthBillingData")) {
xxlJobQueryVO.setMonthBillingData((List<MonthBillingDataVO>) v);
}
if (k.equals("careerLineData")) {
xxlJobQueryVO.setCareerLineData((List<CareerLineDataVO>) v);
}
if (k.equals("careerLineDeliveryData")) {
xxlJobQueryVO.setCareerLineDeliveryData((List<CareerLineDataVO>) v);
}
if (k.equals("nodeData")) {
xxlJobQueryVO.setNodeData((NodeDataVO) v);
}
if (k.equals("binLocationData")) {
xxlJobQueryVO.setBinLocationData((BinLocationDataVO) v);
}
if (k.equals("trunkData")) {
xxlJobQueryVO.setTrunkData((TrunkDataVO) v);
}
if (k.equals("deliveryData")) {
xxlJobQueryVO.setDeliveryData((DeliveryDataVO) v);
}
if (k.equals("deliveryYearData")) {
xxlJobQueryVO.setDeliveryYearData((DeliveryDataVO) v);
}
if (k.equals("businessRatio")) {
xxlJobQueryVO.setBusinessRatio((BusinessRatioDataVO) v);
}
});
return xxlJobQueryVO;
}
}

20
blade-service/logpm-report/src/main/resources/application-dev.yml

@ -21,16 +21,32 @@ spring:
#启用sql日志拦截器 #启用sql日志拦截器
proxy-filters: proxy-filters:
- sqlLogInterceptor - sqlLogInterceptor
query-timeout: 60000 # query-timeout: 60000
#设置默认的数据源或者数据源组,默认值即为master # connect-timeout: 60000
# transaction-timeout: 60000
# max-wait: 60000
# time-between-eviction-runs-millis: 60000
# min-evictable-idle-time-millis: 300000
# connectTimeout: 60000
# socketTimeout: 60000
# queryTimeout: 60000
#设置默认的数据源或者数据源组,默认值即为master
primary: master primary: master
datasource: datasource:
master: master:
druid: druid:
#独立校验配置 #独立校验配置
validation-query: select 1 validation-query: select 1
queryTimeout: 60000
#oracle校验 #oracle校验
#validation-query: select 1 from dual #validation-query: select 1 from dual
url: ${blade.datasource.report.master.url} url: ${blade.datasource.report.master.url}
username: ${blade.datasource.report.master.username} username: ${blade.datasource.report.master.username}
password: ${blade.datasource.report.master.password} password: ${blade.datasource.report.master.password}
627683:
druid:
validation-query: select 1
queryTimeout: 60000
url: jdbc:mysql://192.168.2.46:3306/logpm_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&tinyInt1isBit=false&allowMultiQueries=true&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&socketTimeout=30000
username: root
password: 12345678

10
blade-service/logpm-report/src/main/resources/application-prod.yml

@ -21,9 +21,6 @@ spring:
#启用sql日志拦截器 #启用sql日志拦截器
proxy-filters: proxy-filters:
- sqlLogInterceptor - sqlLogInterceptor
query-timeout: 60000
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#设置默认的数据源或者数据源组,默认值即为master #设置默认的数据源或者数据源组,默认值即为master
primary: master primary: master
datasource: datasource:
@ -36,3 +33,10 @@ spring:
url: ${blade.datasource.report.master.url} url: ${blade.datasource.report.master.url}
username: ${blade.datasource.report.master.username} username: ${blade.datasource.report.master.username}
password: ${blade.datasource.report.master.password} password: ${blade.datasource.report.master.password}
627683:
druid:
validation-query: select 1
queryTimeout: 60000
url: ${blade.datasource.report.627683.url}
username: ${blade.datasource.report.627683.username}
password: ${blade.datasource.report.627683.password}

7
blade-service/logpm-report/src/main/resources/application-test.yml

@ -34,3 +34,10 @@ spring:
url: ${blade.datasource.report.master.url} url: ${blade.datasource.report.master.url}
username: ${blade.datasource.report.master.username} username: ${blade.datasource.report.master.username}
password: ${blade.datasource.report.master.password} password: ${blade.datasource.report.master.password}
627683:
druid:
validation-query: select 1
queryTimeout: 60000
url: ${blade.datasource.report.627683.url}
username: ${blade.datasource.report.627683.username}
password: ${blade.datasource.report.627683.password}

11
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -1780,16 +1780,19 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
redisScript.setResultType(Long.class); redisScript.setResultType(Long.class);
List<String> keys = Collections.singletonList(key); List<String> keys = Collections.singletonList(key);
List<String> args = Arrays.asList(value, String.valueOf(expireTime)); List<Object> args = Arrays.asList(value, expireTime);
Long result = redis.getRedisTemplate().execute(redisScript, keys, args); log.info("Keys: {}", keys);
log.info("Args: {}", args);
Long result = redis.getRedisTemplate().execute(redisScript, keys, args.toArray());
if (result == 1) { if (result == 1) {
log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId); log.warn("#########orderScanOrderPackageCode: 托盘正在保存打托方式 trayCode={} warehouseId={}", trayCode, warehouseId);
throw new CustomerException(405, "托盘信息正在更新,请重试"); throw new CustomerException(405, "托盘信息正在更新,请重试");
} }
redis.setEx(key,"1",5L); // redis.setEx(key,"1",5L);
WarehouseTrayTypeEntity trayTypeEntity = new WarehouseTrayTypeEntity(); WarehouseTrayTypeEntity trayTypeEntity = new WarehouseTrayTypeEntity();
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
@ -1879,7 +1882,7 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
//修改托盘的状态 //修改托盘的状态
basicdataTrayClient.updateTrayStatus(trayId, 2); basicdataTrayClient.updateTrayStatus(trayId, 2);
redis.del(key); // redis.del(key);
return trayTypeEntity; return trayTypeEntity;
} }

2
blade-service/logpm-warehouse/src/main/resources/luascript/resubmit.lua

@ -1,6 +1,6 @@
local key = KEYS[1] local key = KEYS[1]
local value = ARGV[1] local value = ARGV[1]
local expireTime = tonumber(ARGV[2]) local expireTime = ARGV[2]
local exists = redis.call("EXISTS", key) local exists = redis.call("EXISTS", key)

Loading…
Cancel
Save