Browse Source

Merge branch 'dev' into pre-production

master
pref_mail@163.com 10 months ago
parent
commit
536bcfdbf9
  1. 31
      blade-biz-common/src/main/java/org/springblade/common/constant/opFailRetryPushPackage/PushStatus.java
  2. 56
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpFailRetryPushPackageEntity.java
  3. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  4. 8
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java
  5. 69
      blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/OpFailPackageRetryJob.java
  6. 16
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpFailRetryPushPackageMapper.java
  7. 33
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpFailRetryPushPackageMapper.xml
  8. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOuPaiFactoryService.java
  9. 13
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/OpFailRetryPushPackageService.java
  10. 15
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/OpPushFailedPackageRecordService.java
  11. 96
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java
  12. 53
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpPushFailedPackageRecordServiceImpl.java
  13. 35
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java
  14. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IndexCountService.java
  15. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/InLibraryDeliverServiceImpl.java
  16. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/IndexCountServiceImpl.java

31
blade-biz-common/src/main/java/org/springblade/common/constant/opFailRetryPushPackage/PushStatus.java

@ -0,0 +1,31 @@
package org.springblade.common.constant.opFailRetryPushPackage;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum PushStatus {
wait("等待中", 1),
complete("已完成", 2),
expire("已过期", 3);
private String name;
private Integer value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
}

56
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpFailRetryPushPackageEntity.java

@ -0,0 +1,56 @@
package com.logpm.factory.oupai.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
@Data
@TableName("op_fail_retry_push_package")
@ApiModel(value = "opFailRetryPushPackage对象", description = "欧派失败重推包件")
@EqualsAndHashCode(callSuper = true)
public class OpFailRetryPushPackageEntity extends BaseEntity {
/** 预留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 ;
/** 预留5 */
@TableField("order_package_code")
@ApiModelProperty(name = "包件码",notes = "")
private String orderPackageCode;
/** 预留5 */
@ApiModelProperty(name = "执行参数",notes = "")
private String params ;
/** 预留5 */
@TableField("push_status")
@ApiModelProperty(name = "状态:1=待处理,2=已处理,3=已过期",notes = "")
private Integer pushStatus ;
/** 预留5 */
@ApiModelProperty(name = "类型:1=入库,2=出库",notes = "")
private Integer type ;
}

44
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -862,22 +862,22 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(i.getPallet())){
//托盘信息
if (ObjectUtils.isNotNull(i.getPallet()) && !wu.getPallet().contains(i.getPallet())) {
if (ObjectUtils.isNotNull(i.getPallet()) && ObjectUtils.isNotNull(wu.getPallet()) && !wu.getPallet().contains(i.getPallet())) {
wu.setPallet(wu.getPallet() + "," + i.getPallet());
}
}
if (Func.isNotEmpty(i.getTrayId())){
//托盘信息
if (ObjectUtils.isNotNull(i.getTrayId()) && !wu.getTrayId().contains(i.getTrayId())) {
if (ObjectUtils.isNotNull(i.getTrayId()) && ObjectUtils.isNotNull(wu.getTrayId())&& !wu.getTrayId().contains(i.getTrayId())) {
wu.setTrayId(wu.getTrayId() + "," + i.getTrayId());
}
}
//订单自编号信息
if (ObjectUtils.isNotNull(i.getOrderCode()) && !wu.getOrderCode().contains(i.getOrderCode())) {
if (ObjectUtils.isNotNull(i.getOrderCode()) && ObjectUtils.isNotNull(wu.getOrderCode())&&!wu.getOrderCode().contains(i.getOrderCode())) {
wu.setOrderCode(wu.getOrderCode() + "," + i.getOrderCode());
}
//订单id信息
if (ObjectUtils.isNotNull(wu.getStockArticleId()) && !wu.getStockArticleId().contains(i.getStockArticleId())) {
if (ObjectUtils.isNotNull(wu.getStockArticleId()) && ObjectUtils.isNotNull(wu.getStockArticleId())&&!wu.getStockArticleId().contains(i.getStockArticleId())) {
wu.setStockArticleId(wu.getStockArticleId() + "," + i.getStockArticleId());
}
if (wu.getPlanNum().equals(wu.getScanNum())) {
@ -1150,26 +1150,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
log.error("###########myCurrentWarehouse:{}",myCurrentWarehouse);
return null;
}
Long reservationId = stockupDTO.getReservationId();//预约单id
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Func.isEmpty(reservationEntity)){
log.error("###########查询预约失败reservationId:{}",reservationId);
return null;
}
String mallName = reservationEntity.getMallName();
if (Func.isBlank(mallName)){
//预约商场名称为空 查看是否存在商场ID
if (Func.isNotEmpty(reservationEntity.getMallId())){
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.getMallById(reservationEntity.getMallId());
mallName = basicdataClientEntity.getClientName();
}else {
log.error("###########预约单无商场信息:{}",reservationId);
}
}
if (stockupDTO.getTypeService().equals("3")) {
//自
List<DistributionStockupStockListVO> list = distributionStockupService.selectStockupSelf(reservationId);
List<DistributionStockupStockListVO> list = distributionStockupService.selectStockupSelf(stockupDTO.getReservationId());
list.forEach(i -> {
if (i.getPlanNum().equals(i.getRealNum())) {
i.setCompleteStact(true);
@ -1192,7 +1177,22 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
});
return list;
} else {
Long reservationId = stockupDTO.getReservationId();//预约单id
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Func.isEmpty(reservationEntity)){
log.error("###########查询预约失败reservationId:{}",reservationId);
return null;
}
String mallName = reservationEntity.getMallName();
if (Func.isBlank(mallName)){
//预约商场名称为空 查看是否存在商场ID
if (Func.isNotEmpty(reservationEntity.getMallId())){
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.getMallById(reservationEntity.getMallId());
mallName = basicdataClientEntity.getClientName();
}else {
log.error("###########预约单无商场信息:{}",reservationId);
}
}
//商,市
List<DistributionStockupStockListVO> list = distributionReservationService.selectStockupStockList(reservationId,myCurrentWarehouse.getId(),mallName);
for (DistributionStockupStockListVO distributionStockupStockListVO : list) {

8
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java

@ -197,7 +197,7 @@ public class ZbomFactoryOrderListener {
advanceEntity.setWaybillNo("");
advanceEntity.setTrainNumber(zbReceiptDTO.getDepartCode());
advanceEntity.setFreezeStatus("0");
advanceEntity.setLegacyStatus("0");
advanceEntity.setSenderFactory(zbReceiptDTO.getSenderName());
List<JSONObject> packageList = new ArrayList<>();
for (OrderPackageDTO orderPackageDTO : value) {
@ -210,12 +210,18 @@ public class ZbomFactoryOrderListener {
advanceEntity.setConsigneePerson(orderPackageDTO.getReceiverName());
advanceEntity.setConsigneeMobile(orderPackageDTO.getReceiverMobile());
advanceEntity.setConsigneeAddress(orderPackageDTO.getReceiverAddress());
// 封装包件
TrunklineAdvanceDetailEntity advanceDetailEntity = new TrunklineAdvanceDetailEntity();
advanceDetailEntity.setWarehouseId(startWarehouseId);
advanceDetailEntity.setWarehouseName(startWarehouseName);
// advanceDetailEntity.setIncomingWarehouseId(0L);
// advanceDetailEntity.setIncomingWarehouseName("");
// 根据志邦的一流单标识赋值
advanceEntity.setLegacyStatus("0");
if(ObjectUtil.equal(orderPackageDTO.getLegacyFlag(),"Y")){
advanceEntity.setLegacyStatus("1");
}
advanceDetailEntity.setOrderCode(orderPackageDTO.getPlatformOrderCode());
advanceDetailEntity.setBrand(zbReceiptDTO.getSenderName());

69
blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/OpFailPackageRetryJob.java

@ -0,0 +1,69 @@
package com.logpm.factory.jobhandler;
import com.logpm.factory.oupai.entity.OpFailRetryPushPackageEntity;
import com.logpm.factory.oupai.mapper.OpFailRetryPushPackageMapper;
import com.logpm.factory.oupai.service.OpFailRetryPushPackageService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.opFailRetryPushPackage.PushStatus;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
@Slf4j
@Component
@AllArgsConstructor
public class OpFailPackageRetryJob {
private final OpFailRetryPushPackageService opFailRetryPushPackageService;
private OpFailRetryPushPackageMapper opFailRetryPushPackageMapper;
// 是否开启多线程处理
private static final boolean IsMultithreadingHandle = false;
// 多线程批次处理的时候,每次最大处理的数据量
private static final Integer batchHandleQuantity = 1000;
/**
* 欧派数据推送失败的进行定时重推
* @return
*/
@XxlJob("opFailPackageRetryJob")
public ReturnT<String> execute(String param) {
try {
if (IsMultithreadingHandle) {
batchHandleData(null);
} else {
HashMap<String, Object> condition = new HashMap<>();
condition.put("push_status", PushStatus.wait.getValue());
List<OpFailRetryPushPackageEntity> opFailRetryPushPackageEntities = opFailRetryPushPackageMapper.selectByMap(condition);
opFailRetryPushPackageService.retry(opFailRetryPushPackageEntities);
}
}catch (Exception exception){
log.error("OpFailPackageRetryJob error:{}",exception.getMessage());
}
return ReturnT.SUCCESS;
}
/**
* 批次处理
* @param startId
*/
private void batchHandleData(Long startId) {
List<OpFailRetryPushPackageEntity> batchData = opFailRetryPushPackageMapper.selectWaitData(batchHandleQuantity, startId);
if (batchData.size() == batchHandleQuantity) {
batchHandleData(batchData.get(batchHandleQuantity - 1).getId());
}
opFailRetryPushPackageService.retry(batchData);
}
}

16
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpFailRetryPushPackageMapper.java

@ -0,0 +1,16 @@
package com.logpm.factory.oupai.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.factory.oupai.entity.OpFailRetryPushPackageEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface OpFailRetryPushPackageMapper extends BaseMapper<OpFailRetryPushPackageEntity>{
void updateStatusToCompleteByIds(List<Long> ids);
void updateStatusToExpireByIds(List<Long> ids, String date);
List<OpFailRetryPushPackageEntity> selectWaitData(Integer limit, Long startId);
}

33
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpFailRetryPushPackageMapper.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.factory.oupai.mapper.OpFailRetryPushPackageMapper">
<update id="updateStatusToCompleteByIds">
UPDATE logpm_factory.op_fail_retry_push_package
SET push_status = 2
WHERE id IN
<foreach collection="ids" item="id" open="(" separator="," close=")" >
#{id}
</foreach>
</update>
<update id="updateStatusToExpireByIds">
UPDATE logpm_factory.op_fail_retry_push_package
SET push_status = 3
WHERE id IN
<foreach collection="ids" item="id" open="(" separator="," close=")" >
#{id}
</foreach>
AND create_time <![CDATA[ < ]]> #{date}
</update>
<select id="selectWaitData" resultType="com.logpm.factory.oupai.entity.OpFailRetryPushPackageEntity">
SELECT * FROM logpm_factory.op_fail_retry_push_package
WHERE push_status = 1
<if test="startId != null">
id > #{startId}
</if>
ORDER BY id
LIMIT #{limit}
</select>
</mapper>

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/IOuPaiFactoryService.java

@ -40,5 +40,13 @@ public interface IOuPaiFactoryService {
*/
R handleStatusData(OrderStatusDTO orderStatusDTO);
/**
* 欧派推送包件状态
* @see IOuPaiFactoryService#handleStatusData
* @param orderStatusDTO
* @return
*/
boolean retryHandleStatusData(OrderStatusDTO orderStatusDTO);
R newSystemHandleStatusData(OrderStatusDTO orderStatusDTO);
}

13
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/OpFailRetryPushPackageService.java

@ -0,0 +1,13 @@
package com.logpm.factory.oupai.service;
import com.logpm.factory.oupai.entity.OpFailRetryPushPackageEntity;
import java.util.List;
public interface OpFailRetryPushPackageService {
/**
* 重推
*/
void retry(List<OpFailRetryPushPackageEntity> waitData);
}

15
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/OpPushFailedPackageRecordService.java

@ -0,0 +1,15 @@
package com.logpm.factory.oupai.service;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
public interface OpPushFailedPackageRecordService {
/**
* 记录失败的数据
*
* @param orderPackageCode 包条
* @param orderStatusDTO
*/
void record(String orderPackageCode, OrderStatusDTO orderStatusDTO);
}

96
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java

@ -0,0 +1,96 @@
package com.logpm.factory.oupai.service.impl;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.oupai.entity.OpFailRetryPushPackageEntity;
import com.logpm.factory.oupai.mapper.OpFailRetryPushPackageMapper;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import com.logpm.factory.oupai.service.OpFailRetryPushPackageService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.opFailRetryPushPackage.PushStatus;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* 欧派数据失败重推
*/
@Slf4j
@Service("one")
@AllArgsConstructor
public class OpFailRetryPushPackageServiceImpl implements OpFailRetryPushPackageService {
protected OpFailRetryPushPackageMapper opFailRetryPushPackageMapper;
protected IOuPaiFactoryService ouPaiFactoryService;
protected final int MAX_RETRY_TIMES = 3;
@Async
@Override
public void retry(List<OpFailRetryPushPackageEntity> waitData){
ArrayList<Long> completeIds = new ArrayList<>();
ArrayList<Long> failIds = new ArrayList<>();
waitData.forEach(opFailRetryPushPackageEntity -> executeRetry(opFailRetryPushPackageEntity, completeIds, failIds));
updatePushStatus(completeIds, failIds);
}
/**
* 更新推送状态
* @param completeIds
* @param failIds
*/
protected void updatePushStatus(ArrayList<Long> completeIds, ArrayList<Long> failIds){
if (!completeIds.isEmpty()) {
opFailRetryPushPackageMapper.updateStatusToCompleteByIds(completeIds);
}
if (!failIds.isEmpty()) {
opFailRetryPushPackageMapper.updateStatusToExpireByIds(failIds, getExpireTime());
}
}
/**
* 获取过期的时间
*
* @return
*/
protected String getExpireTime(){
Calendar calendar = Calendar.getInstance();
Date date = new Date();
calendar.setTime(date);
calendar.add(Calendar.DATE, -MAX_RETRY_TIMES);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(calendar.getTime());
}
/**
* 执行重试
* @param opFailRetryPushPackageEntity
* @param completeIds
*/
protected void executeRetry(OpFailRetryPushPackageEntity opFailRetryPushPackageEntity, ArrayList<Long> completeIds, ArrayList<Long> failIds) {
try {
OrderStatusDTO orderStatusDTO = new Gson().fromJson(opFailRetryPushPackageEntity.getParams(), OrderStatusDTO.class);
boolean res = ouPaiFactoryService.retryHandleStatusData(orderStatusDTO);
if (res) {
completeIds.add(opFailRetryPushPackageEntity.getId());
} else {
failIds.add(opFailRetryPushPackageEntity.getId());
}
} catch (Exception e) {
log.error("executeRetry error: {}", e.getMessage());
}
}
}

53
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpPushFailedPackageRecordServiceImpl.java

@ -0,0 +1,53 @@
package com.logpm.factory.oupai.service.impl;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.oupai.entity.OpFailRetryPushPackageEntity;
import com.logpm.factory.oupai.mapper.OpFailRetryPushPackageMapper;
import com.logpm.factory.oupai.service.OpPushFailedPackageRecordService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
@Slf4j
@Service
@AllArgsConstructor
public class OpPushFailedPackageRecordServiceImpl implements OpPushFailedPackageRecordService {
private OpFailRetryPushPackageMapper opFailRetryPushPackageMapper;
/**
* 记录失败的数据
*
* @param orderPackageCode 包条
* @param orderStatusDTO
*/
@Override
public void record(String orderPackageCode, OrderStatusDTO orderStatusDTO){
try {
OpFailRetryPushPackageEntity opFailRetryPushPackageEntity = new OpFailRetryPushPackageEntity();
opFailRetryPushPackageEntity.setOrderPackageCode(orderPackageCode);
opFailRetryPushPackageEntity.setParams(new Gson().toJson(orderStatusDTO));
opFailRetryPushPackageEntity.setCreateTime(new Date());
// 判重
// HashMap<String, Object> queryMap = new HashMap<>();
// queryMap.put("orderPackageCode", orderPackageCode);
// if (opFailRetryPushPackageMapper.selectByMap(queryMap) != null) {
// return;
// }
opFailRetryPushPackageMapper.insert(opFailRetryPushPackageEntity);
}catch (Exception e){
log.error(e.getMessage(),e);
}
}
}

35
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -94,6 +94,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
@Autowired
private IDistributionParcelListClient distributionParcelListClient;
@Autowired
private OpPushFailedPackageRecordService opPushFailedPackageRecordService;
@Override
public String saveOuPaiFactoryOrderDTOByCarCarNumber(String code) {
@ -403,9 +406,33 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
return orderCode;
}
@Override
public R handleStatusData(OrderStatusDTO orderStatusDTO) {
// 重写 handleStatusData, 增加重试参数
// 原调用执行
return handleStatusData(orderStatusDTO, false);
}
/**
* 重推
* @see #handleStatusData(OrderStatusDTO, boolean)
* @param orderStatusDTO
* @return
*/
public boolean retryHandleStatusData(OrderStatusDTO orderStatusDTO){
R res = handleStatusData(orderStatusDTO, true);
return res.getCode() == 200;
// 测试功能时使用
// return res.getCode() == 200 || Math.random() < 0.5;
}
/**
*
* @param orderStatusDTO
* @param isRetry 是否是重推调用
* @return
*/
private R handleStatusData(OrderStatusDTO orderStatusDTO, boolean isRetry) {
// 推送数据
String status = orderStatusDTO.getStatus();
String unitNo = orderStatusDTO.getUnitNo();
@ -439,6 +466,12 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
FactoryOrderEntity factoryOrder = factoryOrderService.selectEntityByOrderPackageCode(unitNo);
if (Objects.isNull(factoryOrder)) {
// 不是重试的时候,记录对应数据
if (!isRetry) {
opPushFailedPackageRecordService.record(unitNo, orderStatusDTO);
}
return Resp.fail(400, "未查询到该单据推送订单信息");
}
// 如何判断这个包间是非干仓配的数据

14
blade-service/logpm-report/src/main/java/com/logpm/report/service/IndexCountService.java

@ -10,18 +10,4 @@ import com.logpm.report.vo.indexCount.QuantityAbnormalWorkOrdersVO;
public interface IndexCountService {
IndexCountVO indexCount(Long warehouseId);
/**
* 当月异常工单数量
* @param warehouseId
* @return
*/
QuantityAbnormalWorkOrdersVO numberOfAbnormalWorkOrdersTheMonth(Long warehouseId);
/**
* 当月出入库数量
* @param warehouseId
* @return
*/
InboundAndOutboundQuantityVO inboundAndOutboundQuantityTheMonth(Long warehouseId);
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/InLibraryDeliverServiceImpl.java

@ -31,7 +31,7 @@ public class InLibraryDeliverServiceImpl implements InLibraryDeliverService {
/**
* 上架数量
* @param id
* @param order_package_grounding_status 状态 1=已上架2 = 未上架
* @param order_package_grounding_status 状态 2=已上架1 = 未上架
* @return
*/
public Integer theNumberOfShelvesInTheLibrary(Long id, Integer order_package_grounding_status){

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

@ -10,6 +10,7 @@ import lombok.AllArgsConstructor;
import org.springblade.common.constant.aftersales.WorkOrderStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.HashMap;
@ -33,6 +34,7 @@ public class IndexCountServiceImpl implements IndexCountService {
/**
* 首页统计数据
*/
@Cacheable(value = "indexCount=10", key = "#warehouseId")
public IndexCountVO indexCount(Long warehouseId) {
// 这里需要换这里的代码,测试是模拟请求携带仓库ID参数
// Long warehouseId = AuthUtil.getWarehouseId();
@ -52,8 +54,8 @@ public class IndexCountServiceImpl implements IndexCountService {
private InStoreDataVO inStoreData(Long warehouseId) {
InStoreDataVO inStoreDataVO = new InStoreDataVO();
Integer OnTheShelves = 1; // 上架
Integer NotOnTheShelves = 2; // 未上架
Integer OnTheShelves = 2; // 上架
Integer NotOnTheShelves = 1; // 未上架
inStoreDataVO.setAll(inLibraryDeliverService.indexCount(warehouseId));
inStoreDataVO.setOnTheShelves(inLibraryDeliverService.theNumberOfShelvesInTheLibrary(warehouseId, OnTheShelves));
@ -66,7 +68,6 @@ public class IndexCountServiceImpl implements IndexCountService {
/**
* 异常工单数据
*/
@Override
public QuantityAbnormalWorkOrdersVO numberOfAbnormalWorkOrdersTheMonth(Long warehouseId) {
String status = WorkOrderStatusConstant.daichuli.getValue();
@ -81,7 +82,6 @@ public class IndexCountServiceImpl implements IndexCountService {
*
* @param warehouseId
*/
@Override
public InboundAndOutboundQuantityVO inboundAndOutboundQuantityTheMonth(Long warehouseId) {
InboundAndOutboundQuantityVO inboundAndOutboundQuantityVO = new InboundAndOutboundQuantityVO();
String status = OrderPackageStatusConstant.yichuku.getValue();

Loading…
Cancel
Save