Browse Source

增加类

pull/7/head
chenlong 1 year ago
parent
commit
8444e9a453
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 15
      blade-biz-common/src/main/java/org/springblade/common/constant/opFailRetryPushPackage/PushStatus.java
  3. 56
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/oupai/entity/OpFailRetryPushPackageEntity.java
  4. 11
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/mapper/OpFailRetryPushPackageMapper.java
  5. 19
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/OpFailRetryPushPackageService.java
  6. 61
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OpFailRetryPushPackageServiceImpl.java
  7. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IndexCountService.java
  8. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/InLibraryDeliverServiceImpl.java
  9. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/IndexCountServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -8,7 +8,7 @@ public interface ModuleNameConstant {
/**
* 如果不需要 ""
*/
public static final String DEVAUTH ="";
public static final String DEVAUTH ="-chenlong";
/**
* 工厂对接服务名称

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

@ -0,0 +1,15 @@
package org.springblade.common.constant.opFailRetryPushPackage;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
enum PushStatus {
wait("等待中", 1),
complete("已完成", 2),
expire("已过期", 3);
private final String name;
private final Integer 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 ;
}

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

@ -0,0 +1,11 @@
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;
@Mapper
public interface OpFailRetryPushPackageMapper extends BaseMapper<OpFailRetryPushPackageEntity>{
}

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

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

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

@ -0,0 +1,61 @@
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.OpFailRetryPushPackageService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* 欧派数据失败重推
*/
@Slf4j
@Service
@AllArgsConstructor
public class OpFailRetryPushPackageServiceImpl implements OpFailRetryPushPackageService {
private OpFailRetryPushPackageMapper opFailRetryPushPackageMapper;
private static boolean isRetrying = false;
private static List<String> retryData;
@Override
public void record(String orderPackageCode, OrderStatusDTO orderStatusDTO) {
if (isRetrying) {
return;
}
try {
OpFailRetryPushPackageEntity opFailRetryPushPackageEntity = new OpFailRetryPushPackageEntity();
opFailRetryPushPackageEntity.setOrderPackageCode(orderPackageCode);
opFailRetryPushPackageEntity.setParams(new Gson().toJson(orderStatusDTO));
opFailRetryPushPackageMapper.insert(opFailRetryPushPackageEntity);
}catch (Exception e){
log.error(e.getMessage(),e);
}
}
@Override
public synchronized void retry() {
isRetrying = true;
retryData = new ArrayList<>();
// ......
HashMap<String, Object> condition = new HashMap<>();
condition.put("status", PushStatus.wait);
opFailRetryPushPackageMapper.selectByMap(condition);
retryData = null;
}
}

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