Browse Source

1.拉取诗尼曼工厂运单数据逻辑优化

2.解析诗尼曼工厂运单数据逻辑优化
test
zhenghaoyu 1 year ago
parent
commit
a2e6934390
  1. 55
      blade-biz-common/src/main/java/org/springblade/common/constant/PackagesTypeEnum.java
  2. 18
      blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  3. 5
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/StaorderPackagesEntity.java
  4. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceEntity.java
  5. 154
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/WarehouseEntity.java
  6. 5
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java
  7. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java
  8. 4
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java
  9. 48
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWarehouseClient.java
  10. 34
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/WarehouseVO.java
  11. 167
      blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java
  12. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/GroupByPackagesDTO.java
  13. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StaorderPackagesMapper.java
  14. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StaorderPackagesMapper.xml
  15. 13
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StationlinenumMapper.java
  16. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StationlinenumMapper.xml
  17. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IStaorderPackagesService.java
  18. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IStationlinenumService.java
  19. 3
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/OrderServiceImpl.java
  20. 6
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/StaorderPackagesServiceImpl.java
  21. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/StationlinenumServiceImpl.java
  22. 45
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WarehouseClient.java
  23. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
  24. 44
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.java
  25. 46
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.xml
  26. 43
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWarehouseService.java
  27. 50
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WarehouseServiceImpl.java

55
blade-biz-common/src/main/java/org/springblade/common/constant/PackagesTypeEnum.java

@ -0,0 +1,55 @@
package org.springblade.common.constant;
/**
* 包件类型
*/
public enum PackagesTypeEnum {
GT("GT","柜体"),
BB("BB","背板"),
BC("BC","标抽"),
WJ("WJ","五金"),
MM("MM","柜门"),
MK("MK","柜门"),
LK("LK","柜门"),
XS("XS","柜门"),
PM("PM","柜门"),
QM("QM","柜门");
private String typeCode;
private String typeMes;
PackagesTypeEnum(String typeCode, String typeMes) {
this.typeCode = typeCode;
this.typeMes = typeMes;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getTypeMes() {
return typeMes;
}
public void setTypeMes(String typeMes) {
this.typeMes = typeMes;
}
public static String getMes(String typeCode){
PackagesTypeEnum[] values = PackagesTypeEnum.values();
for(PackagesTypeEnum packagesTypeEnum:values){
if(packagesTypeEnum.getTypeCode().equals(typeCode)){
return packagesTypeEnum.getTypeMes();
}
}
return "特排";
}
}

18
blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@ -16,11 +16,29 @@
*/
package org.springblade.common.utils;
import lombok.extern.log4j.Log4j2;
import org.springframework.util.StringUtils;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
/**
* 通用工具类
*
* @author Chill
*/
@Log4j2
public class CommonUtil {
public static LocalDate stringToLocalDate(String time){
if(!StringUtils.hasLength(time)){
log.warn("############传入值为空:"+time);
return null;
}
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDate parse = LocalDate.parse(time, df);
return parse;
}
}

5
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/StaorderPackagesEntity.java

@ -17,13 +17,11 @@
package com.logpm.factory.snm.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* 寺尼曼运单 实体类
@ -79,5 +77,4 @@ public class StaorderPackagesEntity extends BaseEntity {
@ApiModelProperty(value = "是否更新到老系统 1 是 2 否")
private String identification;
}

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/AdvanceEntity.java

@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -242,6 +242,7 @@ public class AdvanceEntity {
* 删除时间
*/
@ApiModelProperty(value = "删除时间")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date updateTime;
/**
* 派车单--snm

154
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/WarehouseEntity.java

@ -0,0 +1,154 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.entity;
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.tenant.mp.TenantEntity;
/**
* 仓库 实体类
*
* @author BladeX
* @since 2023-05-24
*/
@Data
@TableName("ht_warehouse")
@ApiModel(value = "Warehouse对象", description = "仓库")
@EqualsAndHashCode(callSuper = true)
public class WarehouseEntity extends TenantEntity {
/**
* 代码
*/
@ApiModelProperty(value = "代码")
private String no;
/**
* 公司id
*/
@ApiModelProperty(value = "公司id")
private Integer companyId;
/**
* 事业线
*/
@ApiModelProperty(value = "事业线")
private Integer businessLineId;
/**
*
*/
@ApiModelProperty(value = "")
private Integer provinceId;
/**
* 商场id
*/
@ApiModelProperty(value = "商场id")
private String storeId;
/**
*
*/
@ApiModelProperty(value = "")
private Integer cityId;
/**
*
*/
@ApiModelProperty(value = "")
private String areaId;
/**
* 仓库名称
*/
@ApiModelProperty(value = "仓库名称")
private String title;
/**
* 简称
*/
@ApiModelProperty(value = "简称")
private String shortTitle;
/**
* 单位
*/
@ApiModelProperty(value = "单位")
private String unit;
/**
* 仓库类型1=基地仓0=中心仓
*/
@ApiModelProperty(value = "仓库类型:1=基地仓,0=中心仓")
private Byte isBase;
/**
* 仓库地址
*/
@ApiModelProperty(value = "仓库地址")
private String address;
/**
* 仓库电话
*/
@ApiModelProperty(value = "仓库电话")
private String phone;
/**
* 仓库联系人
*/
@ApiModelProperty(value = "仓库联系人")
private String contactName;
/**
* 经度
*/
@ApiModelProperty(value = "经度")
private String lng;
/**
* 维度
*/
@ApiModelProperty(value = "维度")
private String lat;
/**
* 仓库备注
*/
@ApiModelProperty(value = "仓库备注")
private String remark;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private Integer administratorsId;
/**
* 删除时间
*/
@ApiModelProperty(value = "删除时间")
private Integer deleteTime;
/**
* 营业部收款码
*/
@ApiModelProperty(value = "营业部收款码")
private String paymentCode;
/**
* 打印机模板版本
*/
@ApiModelProperty(value = "打印机模板版本")
private Byte printVision;
/**
* 欧派仓库Token
*/
@ApiModelProperty(value = "欧派仓库Token")
private String opaiWarehouseToken;
/**
* 欧派仓
*/
@ApiModelProperty(value = "欧派仓")
private String opaiWarehouse;
}

5
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java

@ -19,6 +19,7 @@ package com.logpm.oldproject.feign;
import com.logpm.oldproject.dto.AdvanceDTO;
import com.logpm.oldproject.entity.AdvanceEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -32,7 +33,7 @@ import java.util.List;
* @since 2023-05-10
*/
@FeignClient(
value = "logpm-old-project-cyz"
value = "logpm-old-project"
)
public interface IAdvanceClient {
@ -65,7 +66,7 @@ public interface IAdvanceClient {
* @return
*/
@GetMapping(API_PREFIX + "/queryData")
List<AdvanceEntity> getQueryData(AdvanceDTO advanceDTO);
List<AdvanceEntity> getQueryData(@SpringQueryMap AdvanceDTO advanceDTO);
/**

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java

@ -17,7 +17,6 @@
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import org.springblade.common.constant.LauncherConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -29,7 +28,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @since 2023-05-10
*/
@FeignClient(
value = "logpm-old-project-cyz"
value = "logpm-old-project"
)
public interface IAdvanceDetailClient {

4
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java

@ -17,7 +17,6 @@
package com.logpm.oldproject.feign;
import com.logpm.oldproject.entity.ServiceNumEntity;
import org.springblade.common.constant.LauncherConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -31,7 +30,7 @@ import java.util.List;
* @since 2023-05-10
*/
@FeignClient(
value = "logpm-old-project-cyz"
value = "logpm-old-project"
)
public interface IServiceNumClient {
@ -54,5 +53,4 @@ public interface IServiceNumClient {
*/
@PostMapping(API_PREFIX + "/addServiceNum")
Boolean addServiceNum(@RequestBody List<ServiceNumEntity> serviceNumEntity);
}

48
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IWarehouseClient.java

@ -0,0 +1,48 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 仓库 Feign接口类
*
* @author BladeX
* @since 2023-05-10
*/
@FeignClient(
value = "logpm-old-project"
)
public interface IWarehouseClient {
String API_PREFIX = "/client";
String TOP = API_PREFIX + "/top3";
// /**
// * 获取包内产品明细列表
// * @param current 页号
// * @param size 页数
// * @return BladePage
// */
// @GetMapping(TOP)
// BladePage<ServiceNumEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
@GetMapping("/selectIdByName")
Integer selectIdByName(@RequestParam String siteName);
}

34
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/WarehouseVO.java

@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.vo;
import com.logpm.oldproject.entity.WarehouseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 仓库 视图实体类
*
* @author BladeX
* @since 2023-05-24
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class WarehouseVO extends WarehouseEntity {
private static final long serialVersionUID = 1L;
}

167
blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/FactoryXxlJob.java

@ -3,35 +3,30 @@ package com.logpm.factory.jobhandler;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.factory.snm.dto.GroupByPackagesDTO;
import com.logpm.factory.snm.entity.OrderLogEntity;
import com.logpm.factory.snm.entity.StaorderPackagesEntity;
import com.logpm.factory.snm.entity.StationOrderEntity;
import com.logpm.factory.snm.entity.StationlinenumEntity;
import com.logpm.factory.snm.service.*;
import com.logpm.oldproject.dto.AdvanceDTO;
import com.logpm.oldproject.dto.DetailProductDTO;
import com.logpm.oldproject.entity.AdvanceDetailEntity;
import com.logpm.oldproject.entity.AdvanceEntity;
import com.logpm.oldproject.entity.DetailProductEntity;
import com.logpm.oldproject.entity.ServiceNumEntity;
import com.logpm.oldproject.feign.IAdvanceClient;
import com.logpm.oldproject.feign.IAdvanceDetailClient;
import com.logpm.oldproject.feign.IDetailProductClient;
import com.logpm.oldproject.feign.IServiceNumClient;
import com.logpm.oldproject.feign.*;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.core.log.XxlJobLogger;
import io.jsonwebtoken.lang.Strings;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.constant.LogpmDataStatusEnum;
import org.springblade.common.constant.PackagesTypeEnum;
import org.springblade.common.utils.CommonUtil;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.awt.datatransfer.StringSelection;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@ -65,6 +60,7 @@ public class FactoryXxlJob {
private IAdvanceDetailClient advanceDetailClient;
private IDetailProductClient detailProductClient;
private IServiceNumClient serviceNumClient;
private IWarehouseClient warehouseClient;
/**
@ -116,6 +112,9 @@ public class FactoryXxlJob {
List<StationOrderEntity> dataList = map.get(StationOrderEntity.class.getName());
if(dataList.size()==0){
XxlJobLogger.log("本次解析操作没有数据");
//更新数据库请求日志状态
orderLogEntity.setStatus(0);
orderLogService.updateById(orderLogEntity);
return;
}
@ -191,10 +190,16 @@ public class FactoryXxlJob {
if(staorderPackagesList.size() > 0){
map.put(k,staorderPackagesList);
}
//查询基地名称
StationlinenumEntity stationlinenumEntity = stationlinenumService.selectNameByNumber(","+v.getTcWlb006()+",");
String siteName = Objects.isNull(stationlinenumEntity) ? null : stationlinenumEntity.getLogisticsLineName();
Integer warehouseId = warehouseClient.selectIdByName(siteName);
logger.info("###########resoveFactoryData: warehouseId={}",warehouseId);
//添加订单信息
AdvanceEntity advanceEntity = new AdvanceEntity();
advanceEntity.setOrderSelfNum(v.getTcWlb008()); //订单自编号
advanceEntity.setSiteName(v.getTcPoa061()); // 基地
advanceEntity.setSiteName(siteName); // 基地
advanceEntity.setArea(""); // 区域
advanceEntity.setOrderTypeName(""); //订单类型名称 可以为空
advanceEntity.setOrderClassName(""); //订单类型 可以为空
@ -204,12 +209,12 @@ public class FactoryXxlJob {
advanceEntity.setMtdsNo("");// MTDS单号 可以为空
advanceEntity.setFirstPackName(""); //一级品类
advanceEntity.setFirstPackCode(""); //一级品类
advanceEntity.setDealerName(""); //商场名称
advanceEntity.setDealerName(v.getOcc02()); //商场名称
advanceEntity.setDealerCode(""); //商场编码
advanceEntity.setDueDate(""); // 交期
advanceEntity.setIsOpai(0); //是否干仓配
advanceEntity.setOrderNum("");//MSCS订单号 可以为空
advanceEntity.setCarrierName("");//承运商 可以为空
advanceEntity.setCarrierName(v.getTcBmb003());//承运商 可以为空
advanceEntity.setCustomerName(v.getTcWlb010()); //顾客名称
advanceEntity.setCustomerPhone(v.getTcWlb011()); // 顾客电话
advanceEntity.setCustomerRoad(v.getOcc02());//顾客地址
@ -217,19 +222,19 @@ public class FactoryXxlJob {
advanceEntity.setStoreNo(""); //门店编码
advanceEntity.setStoreName(v.getOcc02()); //门店名称
advanceEntity.setSerialKey(""); //序列号
advanceEntity.setServiceNum(v.getTcWlb007()); //服务号
advanceEntity.setServiceNum(v.getTcWlb008()); //服务号
advanceEntity.setMatingCode("");//齐套模式 可以为空
advanceEntity.setContractNum("");//合同号 可以为空
advanceEntity.setLeaveBehind("");//遗留:Y=是,N=否
advanceEntity.setSenderMobile("");//发货人电话 可以为空
advanceEntity.setSenderAddress(""); //发货地址 可以为空
advanceEntity.setSenderName(""); //发货工厂名称 可以为空
advanceEntity.setAdministratorsId(0);// 导入人
advanceEntity.setAdministratorsId(851);// 导入人
advanceEntity.setCreateTime(LocalDate.now()); //添加时间
advanceEntity.setCarsNum(v.getTcWla001()); //派车单--snm 可以为空
advanceEntity.setDeleteTime(0); // 删除时间
advanceEntity.setWaybillNo("");//运单号 可以为空
advanceEntity.setWarehouseId(0); //导入人仓库id
advanceEntity.setWarehouseId(Objects.isNull(warehouseId)?0:warehouseId); //导入人仓库id
advanceEntity.setWaybillStatus(Byte.parseByte("1"));//开单状态:1=未开单,2=已开单
advanceEntity.setOldId(0);//
advanceEntity.setFreeze(Byte.parseByte("1"));//冻结状态:1=正常,2=冻结
@ -244,79 +249,87 @@ public class FactoryXxlJob {
});
//TODO 插入到老系统的的数据库
map.forEach((k,v) ->{
Integer aLong = longIntegerMap.get(k);//订单ID
StationOrderEntity stationOrderEntity = collect.get(k); // 订单
Integer aLong = longIntegerMap.get(k);//订单ID
//查询基地名称
StationlinenumEntity stationlinenumEntity = stationlinenumService.selectNameByNumber(","+stationOrderEntity.getTcWlb006()+",");
//添加订单明细
AdvanceDetailEntity advanceDetailEntity = new AdvanceDetailEntity();
advanceDetailEntity.setAdvanceId(aLong);//预仓id
advanceDetailEntity.setIsPay(Byte.parseByte("0"));//
advanceDetailEntity.setLineID("");//线下订单明细标时 可以为空
advanceDetailEntity.setSerialKey("");//序列号 可以为空
advanceDetailEntity.setArea("");//区域
advanceDetailEntity.setOrderSelfNum(stationOrderEntity.getTcWlb008());//订单自编号
advanceDetailEntity.setType("诗尼曼");//订单来源
advanceDetailEntity.setSystemType("线上");//订单类型
advanceDetailEntity.setOrderNum("");//MSCS单号 可以为空
advanceDetailEntity.setIsOpai(0);//是否干仓配:1=是,0=否
advanceDetailEntity.setMtdsNo("");//MTDS单号 可以为空
advanceDetailEntity.setFirstPackName("");//一级品类
advanceDetailEntity.setFirstPackCode("");//二级品类
advanceDetailEntity.setSiteName("");//基地名称
advanceDetailEntity.setSiteCode("");//基地编码
advanceDetailEntity.setProductCode("");//货品名称 可以为空
advanceDetailEntity.setSecondPackName("");//二级品类名称
advanceDetailEntity.setSecondPackCode("");//二级品类
advanceDetailEntity.setThirdPackName("");//三级品类名称
advanceDetailEntity.setThirdPackCode("");//三级品类
advanceDetailEntity.setGoodName("");//v产品类型 可以为空
advanceDetailEntity.setIsAddin("Y");//例放:N=正常,Y=例放
advanceDetailEntity.setIsThirdAddin("N");//三级例放:N=正常,Y=例放
advanceDetailEntity.setIsSuppin("N");//补进:N=正常,Y=例放
advanceDetailEntity.setMscsNum("");//发货数量
advanceDetailEntity.setMtdsNum(0);//销售数量
advanceDetailEntity.setVolume("");//体积
advanceDetailEntity.setUnitNo("");//包条码
advanceDetailEntity.setMctsTruck("");//车次号
advanceDetailEntity.setMctsTruckNo("");//车牌号
// advanceDetailEntity.setDate100(0);//基地发货日期
advanceDetailEntity.setDate2("");//预约到厂时间
advanceDetailEntity.setDate3("");//实际到厂时间
advanceDetailEntity.setDate4("");//开始装车时间
advanceDetailEntity.setDate5("");//完成装车时间
advanceDetailEntity.setDate6("");//车辆离厂时间
advanceDetailEntity.setCreateTime(LocalDate.now());//创建时间
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum(stationOrderEntity.getTcWlb007());//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
List<GroupByPackagesDTO> groupByPackages = staorderPackagesService.selectGroupByLxAndPackNumByOrderId(k);
groupByPackages.forEach(gpd->{
//添加订单明细
AdvanceDetailEntity advanceDetailEntity = new AdvanceDetailEntity();
advanceDetailEntity.setAdvanceId(aLong);//预仓id
advanceDetailEntity.setIsPay(Byte.parseByte("0"));//
advanceDetailEntity.setLineID("");//线下订单明细标时 可以为空
advanceDetailEntity.setSerialKey("");//序列号 可以为空
advanceDetailEntity.setArea("");//区域
advanceDetailEntity.setOrderSelfNum(stationOrderEntity.getTcWlb008());//订单自编号
advanceDetailEntity.setType("诗尼曼");//订单来源
advanceDetailEntity.setSystemType("线上");//订单类型
advanceDetailEntity.setOrderNum("");//MSCS单号 可以为空
advanceDetailEntity.setIsOpai(0);//是否干仓配:1=是,0=否
advanceDetailEntity.setMtdsNo("");//MTDS单号 可以为空
advanceDetailEntity.setFirstPackName(PackagesTypeEnum.getMes(gpd.getLx()));//一级品类
advanceDetailEntity.setFirstPackCode("");//二级品类
advanceDetailEntity.setSiteName(Objects.isNull(stationlinenumEntity)?null:stationlinenumEntity.getLogisticsLineName());//基地名称
advanceDetailEntity.setSiteCode("");//基地编码
advanceDetailEntity.setProductCode("");//货品名称 可以为空
advanceDetailEntity.setSecondPackName(PackagesTypeEnum.getMes(gpd.getLx()));//二级品类名称
advanceDetailEntity.setSecondPackCode("");//二级品类
advanceDetailEntity.setThirdPackName(PackagesTypeEnum.getMes(gpd.getLx()));//三级品类名称
advanceDetailEntity.setThirdPackCode(gpd.getLx());//三级品类
advanceDetailEntity.setGoodName("");//v产品类型 可以为空
advanceDetailEntity.setIsAddin("Y");//例放:N=正常,Y=例放
advanceDetailEntity.setIsThirdAddin("N");//三级例放:N=正常,Y=例放
advanceDetailEntity.setIsSuppin("N");//补进:N=正常,Y=例放
advanceDetailEntity.setMscsNum(gpd.getTotal().toString());//发货数量
advanceDetailEntity.setMtdsNum(0);//销售数量
advanceDetailEntity.setVolume("");//体积
advanceDetailEntity.setUnitNo(gpd.getPackagenum());//包条码
advanceDetailEntity.setMctsTruck(stationOrderEntity.getTcWla001());//车次号
advanceDetailEntity.setMctsTruckNo("");//车牌号
advanceDetailEntity.setDate100(CommonUtil.stringToLocalDate(stationOrderEntity.getTcWla002()));//基地发货日期
advanceDetailEntity.setDate2("");//预约到厂时间
advanceDetailEntity.setDate3("");//实际到厂时间
advanceDetailEntity.setDate4("");//开始装车时间
advanceDetailEntity.setDate5("");//完成装车时间
advanceDetailEntity.setDate6("");//车辆离厂时间
advanceDetailEntity.setCreateTime(LocalDate.now());//创建时间
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum(stationOrderEntity.getTcWlb008());//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//
boolean b = advanceDetailClient.addAdvanceDetail(advanceDetailEntity);
XxlJobLogger.log("addAdvanceDetail 添加状态 {}", b);
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//
boolean b = advanceDetailClient.addAdvanceDetail(advanceDetailEntity);
XxlJobLogger.log("addAdvanceDetail 添加状态 {}", b);
});
// 添加包件信息
DetailProductEntity detailProductEntity = new DetailProductEntity();
detailProductEntity.setUnitNo("");//包条码
detailProductEntity.setProductcode("");//货品代码
detailProductEntity.setProductname("");//货品名称
detailProductEntity.setSalenum(0);//销售数量
detailProductEntity.setDelivernum(1);//发货数量
detailProductEntity.setProducttype("");// 口可以为空
detailProductEntity.setBuyTime("");//下单日期 可以为空
detailProductEntity.setCreateTime(LocalDate.now());//创建时间
detailProductEntity.setAdministratorsId(0);//创建人
detailProductEntity.setDeleteTime(0);//删除时间
Boolean aBoolean11 = detailProductClient.addDetailProduct(detailProductEntity);
XxlJobLogger.log("addDetailProduct 添加状态 {}", aBoolean11);
// DetailProductEntity detailProductEntity = new DetailProductEntity();
// detailProductEntity.setUnitNo("");//包条码
// detailProductEntity.setProductcode("");//货品代码
// detailProductEntity.setProductname("");//货品名称
// detailProductEntity.setSalenum(0);//销售数量
// detailProductEntity.setDelivernum(1);//发货数量
// detailProductEntity.setProducttype("");// 口可以为空
// detailProductEntity.setBuyTime("");//下单日期 可以为空
// detailProductEntity.setCreateTime(LocalDate.now());//创建时间
// detailProductEntity.setAdministratorsId(0);//创建人
// detailProductEntity.setDeleteTime(0);//删除时间
// Boolean aBoolean11 = detailProductClient.addDetailProduct(detailProductEntity);
// XxlJobLogger.log("addDetailProduct 添加状态 {}", aBoolean11);
ServiceNumEntity serviceNum = new ServiceNumEntity();
serviceNum.setServiceNum(stationOrderEntity.getTcWlb007()); //服务号
serviceNum.setTotal(stationOrderEntity.getTcWlb009().toString()); //订单数量
serviceNum.setDetailTotal(stationOrderEntity.getTcWlb009().toString()); // 包数量
serviceNum.setStoreName(""); //商场名
serviceNum.setStoreName(stationOrderEntity.getOcc02()); //商场名
serviceNum.setStoreNo(""); // 商场编号
serviceNum.setCustomerName(stationOrderEntity.getTcWlb010()); //顾客姓名
serviceNum.setCustomerPhone(stationOrderEntity.getTcWlb011()); //顾客电话

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/dto/GroupByPackagesDTO.java

@ -0,0 +1,12 @@
package com.logpm.factory.snm.dto;
import lombok.Data;
@Data
public class GroupByPackagesDTO {
private String packagenum;
private String lx;
private Integer total;
}

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StaorderPackagesMapper.java

@ -16,10 +16,13 @@
*/
package com.logpm.factory.snm.mapper;
import com.logpm.factory.snm.dto.GroupByPackagesDTO;
import com.logpm.factory.snm.entity.StaorderPackagesEntity;
import com.logpm.factory.snm.vo.StaorderPackagesVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@ -42,4 +45,5 @@ public interface StaorderPackagesMapper extends BaseMapper<StaorderPackagesEntit
List<StaorderPackagesVO> selectIdentification(StaorderPackagesVO staorderPackagesVO);
List<GroupByPackagesDTO> selectGroupByLxAndPackNumByOrderId(@Param("orderId") Long orderId);
}

17
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StaorderPackagesMapper.xml

@ -22,6 +22,13 @@
</resultMap>
<resultMap id="groupByLxAndPackNumByOrderIdResultMap" type="com.logpm.factory.snm.dto.GroupByPackagesDTO">
<result column="packagenum" property="packagenum"/>
<result column="lx" property="lx"/>
<result column="total" property="total"/>
</resultMap>
<select id="selectStaorderPackagesPage" resultMap="staorderPackagesResultMap">
select * from snm_staorder_packages where is_deleted = 0
</select>
@ -31,4 +38,14 @@
</select>
<select id="selectGroupByLxAndPackNumByOrderId" resultMap="groupByLxAndPackNumByOrderIdResultMap">
select packagenum,
lx,
count(*) as total
from snm_staorder_packages
where order_id = ${orderId}
group by packagenum,lx
</select>
</mapper>

13
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StationlinenumMapper.java

@ -16,17 +16,16 @@
*/
package com.logpm.factory.snm.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.factory.snm.entity.StationlinenumEntity;
import com.logpm.factory.snm.excel.StationlinenumExcel;
import com.logpm.factory.snm.vo.StationlinenumVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 诗尼曼线路 Mapper 接口
*
@ -51,4 +50,6 @@ public interface StationlinenumMapper extends BaseMapper<StationlinenumEntity> {
* @return
*/
List<StationlinenumExcel> exportStationlinenum(@Param("ew") Wrapper<StationlinenumEntity> queryWrapper);
StationlinenumEntity selectNameByNumber(String number);
}

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/mapper/StationlinenumMapper.xml

@ -25,5 +25,10 @@
</select>
<select id="selectNameByNumber" resultMap="stationlinenumResultMap" parameterType="String">
SELECT * FROM snm_stationlinenum where logistics_line_number like concat('%',#{number},'%')
</select>
</mapper>

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IStaorderPackagesService.java

@ -16,6 +16,7 @@
*/
package com.logpm.factory.snm.service;
import com.logpm.factory.snm.dto.GroupByPackagesDTO;
import com.logpm.factory.snm.entity.StaorderPackagesEntity;
import com.logpm.factory.snm.vo.StaorderPackagesVO;
import org.springblade.core.mp.base.BaseService;
@ -42,4 +43,5 @@ public interface IStaorderPackagesService extends BaseService<StaorderPackagesEn
List<StaorderPackagesVO> selectIdentification(StaorderPackagesVO staorderPackagesVO);
List<GroupByPackagesDTO> selectGroupByLxAndPackNumByOrderId(Long orderId);
}

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/IStationlinenumService.java

@ -51,4 +51,5 @@ public interface IStationlinenumService extends BaseService<StationlinenumEntity
*/
List<StationlinenumExcel> exportStationlinenum(Wrapper<StationlinenumEntity> queryWrapper);
StationlinenumEntity selectNameByNumber(String number);
}

3
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/OrderServiceImpl.java

@ -3,7 +3,6 @@ package com.logpm.factory.snm.service.impl;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factory.jobhandler.FactoryXxlJob;
import com.logpm.factory.props.FactorySnmdataProperties;
import com.logpm.factory.snm.entity.OrderLogEntity;
import com.logpm.factory.snm.entity.StaorderPackagesEntity;
@ -11,7 +10,7 @@ import com.logpm.factory.snm.entity.StationOrderEntity;
import com.logpm.factory.snm.service.IOrderLogService;
import com.logpm.factory.snm.service.IOrderService;
import com.logpm.factory.snm.service.IStationOrderService;
import com.logpm.factory.snm.vo.*;
import com.logpm.factory.snm.vo.SystemSign;
import com.logpm.factory.snm.vo.request.RequestLineNumberVo;
import com.logpm.factory.snm.vo.request.RequestOrderPackageInfoVo;
import com.logpm.factory.snm.vo.request.RequestSecBaseVo;

6
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/StaorderPackagesServiceImpl.java

@ -16,6 +16,7 @@
*/
package com.logpm.factory.snm.service.impl;
import com.logpm.factory.snm.dto.GroupByPackagesDTO;
import com.logpm.factory.snm.entity.StaorderPackagesEntity;
import com.logpm.factory.snm.vo.StaorderPackagesVO;
import com.logpm.factory.snm.mapper.StaorderPackagesMapper;
@ -45,5 +46,10 @@ public class StaorderPackagesServiceImpl extends BaseServiceImpl<StaorderPackage
return null;
}
@Override
public List<GroupByPackagesDTO> selectGroupByLxAndPackNumByOrderId(Long orderId) {
return baseMapper.selectGroupByLxAndPackNumByOrderId(orderId);
}
}

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/StationlinenumServiceImpl.java

@ -51,4 +51,9 @@ public class StationlinenumServiceImpl extends BaseServiceImpl<StationlinenumMap
return stationlinenumList;
}
@Override
public StationlinenumEntity selectNameByNumber(String number) {
return baseMapper.selectNameByNumber(number);
}
}

45
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/WarehouseClient.java

@ -0,0 +1,45 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.feign;
import com.logpm.oldproject.service.IWarehouseService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 仓库 Feign实现类
*
* @author BladeX
* @since 2023-05-24
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class WarehouseClient implements IWarehouseClient {
private final IWarehouseService warehouseService;
@Override
@GetMapping("/selectIdByName")
public Integer selectIdByName(String siteName) {
return warehouseService.selectIdByName(siteName);
}
}

1
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml

@ -12,7 +12,6 @@
<where>
delete_administrators_id = 0 and
create_time between DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW()
<if test=""></if>
</where>
</select>
<select id="advanceEntityOne" resultMap="advanceResultMap">

44
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.java

@ -0,0 +1,44 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.oldproject.entity.WarehouseEntity;
import com.logpm.oldproject.vo.WarehouseVO;
import java.util.List;
/**
* 仓库 Mapper 接口
*
* @author BladeX
* @since 2023-05-24
*/
public interface WarehouseMapper extends BaseMapper<WarehouseEntity> {
/**
* 自定义分页
*
* @param page
* @param warehouse
* @return
*/
List<WarehouseVO> selectWarehousePage(IPage page, WarehouseVO warehouse);
Integer selectIdByName(String siteName);
}

46
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/WarehouseMapper.xml

@ -0,0 +1,46 @@
<?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.oldproject.mapper.WarehouseMapper">
<!-- 通用查询映射结果 -->
<resultMap id="warehouseResultMap" type="com.logpm.oldproject.entity.WarehouseEntity">
<result column="id" property="id"/>
<result column="no" property="no"/>
<result column="company_id" property="companyId"/>
<result column="business_line_id" property="businessLineId"/>
<result column="province_id" property="provinceId"/>
<result column="store_id" property="storeId"/>
<result column="city_id" property="cityId"/>
<result column="area_id" property="areaId"/>
<result column="title" property="title"/>
<result column="short_title" property="shortTitle"/>
<result column="unit" property="unit"/>
<result column="is_base" property="isBase"/>
<result column="status" property="status"/>
<result column="address" property="address"/>
<result column="phone" property="phone"/>
<result column="contact_name" property="contactName"/>
<result column="lng" property="lng"/>
<result column="lat" property="lat"/>
<result column="remark" property="remark"/>
<result column="administrators_id" property="administratorsId"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="payment_code" property="paymentCode"/>
<result column="print_vision" property="printVision"/>
<result column="opai_warehouse_token" property="opaiWarehouseToken"/>
<result column="opai_warehouse" property="opaiWarehouse"/>
</resultMap>
<select id="selectWarehousePage" resultMap="warehouseResultMap">
select * from ht_warehouse where is_deleted = 0
</select>
<select id="selectIdByName" resultType="Integer">
select id from ht_warehouse where short_title like concat('%',#{siteName},'%') limit 1
</select>
</mapper>

43
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IWarehouseService.java

@ -0,0 +1,43 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.oldproject.entity.WarehouseEntity;
import com.logpm.oldproject.vo.WarehouseVO;
import org.springblade.core.mp.base.BaseService;
/**
* 仓库 服务类
*
* @author BladeX
* @since 2023-05-24
*/
public interface IWarehouseService extends BaseService<WarehouseEntity> {
/**
* 自定义分页
*
* @param page
* @param warehouse
* @return
*/
IPage<WarehouseVO> selectWarehousePage(IPage<WarehouseVO> page, WarehouseVO warehouse);
Integer selectIdByName(String siteName);
}

50
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/WarehouseServiceImpl.java

@ -0,0 +1,50 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.oldproject.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.oldproject.entity.WarehouseEntity;
import com.logpm.oldproject.mapper.WarehouseMapper;
import com.logpm.oldproject.service.IWarehouseService;
import com.logpm.oldproject.vo.WarehouseVO;
import lombok.extern.log4j.Log4j2;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
/**
* 仓库 服务实现类
*
* @author BladeX
* @since 2023-05-24
*/
@Log4j2
@Service
public class WarehouseServiceImpl extends BaseServiceImpl<WarehouseMapper, WarehouseEntity> implements IWarehouseService {
@Override
public IPage<WarehouseVO> selectWarehousePage(IPage<WarehouseVO> page, WarehouseVO warehouse) {
return page.setRecords(baseMapper.selectWarehousePage(page, warehouse));
}
@Override
public Integer selectIdByName(String siteName) {
log.info("##########selectIdByName: siteName="+siteName);
return baseMapper.selectIdByName(siteName);
}
}
Loading…
Cancel
Save