Browse Source

1.干线导入逻辑修改

master
zhenghaoyu 9 months ago
parent
commit
86b2b0cc42
  1. 6
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCodeClient.java
  2. 46
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/ImportOrderNoPackageExcelDTO.java
  3. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java
  4. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataCodeService.java
  5. 59
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java
  6. 11
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java
  7. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  8. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java
  9. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java
  10. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  11. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  12. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java
  13. 817
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  14. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

6
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataCodeClient.java

@ -5,6 +5,8 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@FeignClient(
value = ModuleNameConstant.APPLICATION_BASICDATA_NAME
)
@ -15,4 +17,8 @@ public interface IBasicdataCodeClient {
@GetMapping(API_PREFIX+"/getCodeByType")
String getCodeByType(@RequestParam Integer type,@RequestParam String warehouseCode,@RequestParam String orderCode);
@GetMapping(API_PREFIX+"/getBatchPackageCodeByType")
List<String> getBatchPackageCodeByType(@RequestParam String warehouseCode, @RequestParam String orderCode,@RequestParam Integer num);
}

46
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/ImportOrderNoPackageExcelDTO.java

@ -8,35 +8,57 @@ import java.io.Serializable;
@Data
public class ImportOrderNoPackageExcelDTO implements Serializable {
@ExcelProperty(value = "下单日期")
private String orderTime;
@ExcelProperty(value = "商场名称")
private String dealerName;
@ExcelProperty(value = "服务号")
private String serviceNum ;
@ExcelProperty(value = "订单自编号")
private String orderCode;
@ExcelProperty(value = "品牌")
private String brand ;
@ExcelProperty(value = "一级品类")
private String firsts;
@ExcelProperty(value = "二级品类")
private String seconds;
@ExcelProperty(value = "三级品类")
private String thirds;
@ExcelProperty(value = "物料名称")
private String materialName;
@ExcelProperty(value = "物料编码")
private String materialCode;
@ExcelProperty(value = "单位")
private String unit;
@ExcelProperty(value = "销售数量")
private String num;
@ExcelProperty(value = "合计件数")
private String count;
@ExcelProperty(value = "体积")
private String volume;
@ExcelProperty(value = "重量")
private String weight;
@ExcelProperty(value = "车次号")
private String trainNumber ;
@ExcelProperty(value = "商场编码")
private String dealerCode;
@ExcelProperty(value = "商场名称")
private String dealerName;
@ExcelProperty(value = "商场收货人")
private String consigneePerson;
@ExcelProperty(value = "商场收货人电话")
private String consigneeMobile;
@ExcelProperty(value = "商场收货地址")
private String consigneeAddress;
@ExcelProperty(value = "发货人")
private String shipperPerson;
@ExcelProperty(value = "发货人电话")
private String shipperMobile;
@ExcelProperty(value = "发货人地址")
private String shipperAddress;
@ExcelProperty(value = "收货人")
private String customerName ;
@ExcelProperty(value = "联系电话")
private String customerPhone ;
@ExcelProperty(value = "地址")
private String customerAddress ;
@ExcelProperty(value = "车次")
private String trainNumber ;
@ExcelProperty(value = "发货日期")
private String sendDateStr ;
@ExcelProperty(value = "品牌")
private String brand ;
@ExcelProperty(value = "配送区域")
private String area ;
@ExcelProperty(value = "服务号")
private String serviceNum ;
}

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataCodeClient.java

@ -1,11 +1,12 @@
package com.logpm.basicdata.feign;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.service.IBasicdataCodeService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ApiIgnore()
@RestController
@AllArgsConstructor
@ -18,4 +19,9 @@ public class BasicdataCodeClient implements IBasicdataCodeClient {
return basicdataCodeService.getCodeByType(type,warehouseCode,orderCode);
}
@Override
public List<String> getBatchPackageCodeByType(String warehouseCode, String orderCode, Integer num) {
return basicdataCodeService.getBatchPackageCodeByType(warehouseCode,orderCode,num);
}
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataCodeService.java

@ -1,7 +1,10 @@
package com.logpm.basicdata.service;
import java.util.List;
public interface IBasicdataCodeService {
String getCodeByType(Integer type,String warehouseCode,String orderCode);
List<String> getBatchPackageCodeByType(String warehouseCode, String orderCode, Integer num);
}

59
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java

@ -18,9 +18,7 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.Date;
import java.util.Objects;
import java.util.*;
@Service
@AllArgsConstructor
@ -93,6 +91,61 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService {
return code;
}
@Override
public List<String> getBatchPackageCodeByType(String warehouseCode, String orderCode, Integer num) {
if(!StringUtil.hasLength(warehouseCode)){
log.warn("############getBatchPackageCodeByType: 仓库编码为空warehouseCode={}",warehouseCode);
return null;
}
if(!StringUtil.hasLength(orderCode)){
log.warn("############getBatchPackageCodeByType: 订单号为空orderCode={}",orderCode);
return null;
}
//包条 HT+仓库拼音/超管/职能+年月日时分秒+订单索引+包条个数索引
String haxCodeByLong = CommonUtil.getHaxCodeByLong(orderCode, 8);
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseService.getWarehouseEntityByWarehouseCode(warehouseCode);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("############getWayBillNo: 仓库信息不存在 warehouseCode={}",warehouseCode);
return null;
}
Calendar calendar = Calendar.getInstance();
//获取年份
Integer year = calendar.get(Calendar.YEAR);
// 获取月份(注意月份从0开始计数)
Integer month = calendar.get(Calendar.MONTH) + 1;
BasicdataCodeRecordEntity basicdataCodeRecordEntity = basicdataCodeRecordService.findEntityByCodeTypeAndWarehouseCodeAndYearAndMonth(CodeNumConstant.PACKAGE,warehouseCode,year+"",month+"");
if(Objects.isNull(basicdataCodeRecordEntity)){
basicdataCodeRecordEntity = new BasicdataCodeRecordEntity();
basicdataCodeRecordEntity.setCodeType(CodeNumConstant.PACKAGE);
basicdataCodeRecordEntity.setWarehouseId(basicdataWarehouseEntity.getId());
basicdataCodeRecordEntity.setWarehouseName(basicdataWarehouseEntity.getName());
basicdataCodeRecordEntity.setWarehouseCode(warehouseCode);
basicdataCodeRecordEntity.setYear(year+"");
basicdataCodeRecordEntity.setMonth(month+"");
basicdataCodeRecordEntity.setNum(0);
basicdataCodeRecordService.save(basicdataCodeRecordEntity);
}
Integer oldNum = basicdataCodeRecordEntity.getNum();
List<String> packageCodes = new ArrayList<>();
for (int i = 0; i < num; i++) {
oldNum = oldNum + 1;
String packageCode = "HT" + warehouseCode + year + CommonUtil.geFourNumber(month.longValue(),2) + haxCodeByLong + CommonUtil.geFourNumber(oldNum.longValue(),6);
packageCodes.add(packageCode);
}
basicdataCodeRecordEntity.setNum(oldNum);
basicdataCodeRecordService.updateById(basicdataCodeRecordEntity);
return packageCodes;
}
private String generateTrunklineLoadSignCode(Integer type, String warehouseCode, String orderCode) {
if(!StringUtil.hasLength(warehouseCode)){

11
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/InterceptorAdapterConfig.java

@ -7,7 +7,6 @@ import com.logpm.factory.interceptor.ZbFactoryAccountsInterceptor;
import com.logpm.factory.props.ZbFactoryProperties;
import lombok.AllArgsConstructor;
import org.springblade.core.redis.cache.BladeRedis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
@ -22,6 +21,8 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
private final BladeRedis redis;
private final ZbFactoryProperties zbFactoryProperties;
private final Environment environment;
@ -32,8 +33,12 @@ public class InterceptorAdapterConfig implements WebMvcConfigurer {
excludePathPatterns("/factory/auth/token").
excludePathPatterns("/factory/oupai/**").
excludePathPatterns("/factory/zb/**")
.excludePathPatterns("/factory/common/**");
registry=interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,environment));
.excludePathPatterns("/factory/common/**").order(1);
InterceptorRegistration registryZbFactory = interceptorRegistry.addInterceptor(new ZbFactoryAccountsInterceptor(zbFactoryProperties));
registryZbFactory.addPathPatterns("/factory/zb/**").order(2);
registry=interceptorRegistry.addInterceptor(new LocalServerLoginAccountsInterceptor(redis,environment)).addPathPatterns("/**").order(3);
}
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -1060,7 +1060,7 @@ public class OpenOrderController {
return R.fail(403,"仓库信息为空");
}
return openOrderService.batchOpenLabel(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file);
return openOrderService.batchOpenLabel(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),myCurrentWarehouse.getWarehouseCode(),file);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
@ -1119,7 +1119,7 @@ public class OpenOrderController {
return R.fail(403,"仓库信息为空");
}
R<List<TrunklineAdvanceEntity>> listR = openOrderService.importOrderNoPackage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),file);
R<List<TrunklineAdvanceEntity>> listR = openOrderService.importOrderNoPackage(myCurrentWarehouse.getId(),myCurrentWarehouse.getName(),myCurrentWarehouse.getWarehouseCode(),file);
// List<TrunklineAdvanceEntity> data = listR.getData();
// if(!CollUtil.isEmpty(data)){
// for (TrunklineAdvanceEntity datum : data) {

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.trunkline.dto.AdvanceDTO;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.vo.CustomerInfoVO;
import com.logpm.trunkline.vo.OpenOrderVO;
@ -13,7 +12,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Set;
@Mapper
public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntity> {
@ -40,5 +38,5 @@ public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntit
Integer findAllNumByOrderCode(@Param("orderCode") String orderCode);
List<TrunklineAdvanceEntity> findListByExistsAndOrderCodeSet(@Param("orderCodeSet") Set<String> orderCodeSet);
List<TrunklineAdvanceEntity> findListByExistsAndOrderCodeSet(@Param("orderCodeSet") List<String> orderCodeSet);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java

@ -1,6 +1,7 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@ -9,4 +10,5 @@ public interface IAsyncService {
CompletableFuture<Boolean> getResponseFromCp(List<TrunklineAdvanceDetailEntity> list, int queryType);
CompletableFuture<Boolean> saveAdvanceEntity(List<TrunklineAdvanceEntity> list, int queryType);
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java

@ -58,11 +58,11 @@ public interface IOpenOrderService {
R findBrandList(OpenOrderDTO openOrderDTO);
R batchOpenLabel(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R batchOpenLabel(Long warehouseId, String warehouseName, String warehouseCode, MultipartFile file) throws IOException;
R findPayWayByClientId(Long clientId);
R<List<TrunklineAdvanceEntity>> importOrderNoPackage(Long warehouseId, String warehouseName, MultipartFile file) throws IOException;
R<List<TrunklineAdvanceEntity>> importOrderNoPackage(Long warehouseId, String warehouseName, String warehouseCode, MultipartFile file) throws IOException;
R checkWaybill(OpenOrderDTO openOrderDTO);

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java

@ -11,7 +11,6 @@ import com.logpm.trunkline.vo.TrunklineAdvanceVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
import java.util.Set;
public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEntity> {
@ -39,5 +38,5 @@ public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEn
List<String> incomingPackageBatch(Long advanceId, Long warehouseId, List<TrunklineAdvanceDetailEntity> detailList, Long userId, Long deptId, String tenantId);
List<TrunklineAdvanceEntity> findListByExistsAndOrderCodeSet(Set<String> orderCodeSet);
List<TrunklineAdvanceEntity> findListByExistsAndOrderCodeSet(List<String> orderCodeSet);
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java

@ -1,8 +1,10 @@
package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.service.IAsyncService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -13,6 +15,8 @@ import java.util.concurrent.CompletableFuture;
@Service
public class AsyncServiceImpl implements IAsyncService {
@Autowired
private ITrunklineAdvanceService advanceService;
@Autowired
private ITrunklineAdvanceDetailService advanceDetailService;
@ -25,4 +29,13 @@ public class AsyncServiceImpl implements IAsyncService {
);
}
@Async("asyncExecutor")
@Override
public CompletableFuture<Boolean> saveAdvanceEntity(List<TrunklineAdvanceEntity> list, int queryType) {
return CompletableFuture
.completedFuture(
advanceService.saveBatch(list)
);
}
}

817
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

File diff suppressed because it is too large Load Diff

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -631,7 +631,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
}
@Override
public List<TrunklineAdvanceEntity> findListByExistsAndOrderCodeSet(Set<String> orderCodeSet) {
public List<TrunklineAdvanceEntity> findListByExistsAndOrderCodeSet(List<String> orderCodeSet) {
return baseMapper.findListByExistsAndOrderCodeSet(orderCodeSet);
}

Loading…
Cancel
Save