Browse Source

Merge branch 'dev' into pre-production

master
pref_mail@163.com 1 year ago
parent
commit
566563cf33
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/cache/CacheNames.java
  2. 20
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  3. 1
      blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java
  4. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  5. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java
  6. 105
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  7. 79
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

4
blade-biz-common/src/main/java/org/springblade/common/cache/CacheNames.java vendored

@ -74,4 +74,8 @@ public interface CacheNames {
* 用户选择仓库的key
*/
String USER_WAREHOUSE_KEY = "logpm:user:warehouse:select:";
/**
* 用户能操作的仓库
*/
String USER_WAREHOUSE_OWN = "logpm:user:warehouse:own:";
}

20
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -107,9 +107,6 @@
<if test="param.first != null and param.first != '' ">and lawo.first like concat('%', #{param.first },'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and lawo.secondary like concat('%', #{param.secondary },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<!-- create_time >= unix_timestamp('2013-10-24 00:00:00') and create_time <= unix_timestamp('2013-10-24 23:59:59')
date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
-->
<if test="param.brandName !=null and param.brandName !='' " >and lawo.brand_name like concat('%', #{param.brandName },'%') </if>
<if test="param.deliverGoodsTime != null ">and date_format(from_unixtime( lawo.deliver_goods_time),'%Y-%m-%d') = date_format(#{param.deliverGoodsTime },'%Y-%m-%d') </if>
<if test="param.discoveryTime != null ">and date_format(from_unixtime(lawo.discovery_time),'%Y-%m-%d') = date_format( #{param.discoveryTime},'%Y-%m-%d') </if>
@ -130,7 +127,7 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.customerServiceName != null and param.customerServiceName != '' ">and lawo.customer_service_name like concat('%', #{param.customerServiceName },'%') </if>
<if test="param.waybillMallId != null and param.waybillMallId != '' ">and lawo.waybill_mall_id = #{param.waybillMallId } </if>
<if test="param.problemDescription != null and param.problemDescription != '' ">and lawo.problem_description = #{param.problemDescription} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20">and lawo.warehouse_id = #{param.warehouseId} </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != null ">and (lap.warehouse_id = #{param.warehouseId} OR lap.business_id = #{param.warehouseId}) </if>
<if test="param.personResponsible != null and param.personResponsible != '' ">and lawo.person_responsible = #{param.personResponsible } </if>
<if test="param.processNumber != null and param.processNumber != '' ">and lawo.process_number = #{param.processNumber } </if>
<if test="param.reviewedBy != null and param.reviewedBy != '' ">and lawo.reviewed_by = #{param.reviewedBy } </if>
@ -143,7 +140,11 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.customerIdentification != null and param.customerIdentification == 1 ">
and lawo.work_order_status IN ( '10', '20', '21', '30', '40', '50', '60', '70', '80', '90' ,'100','110')
</if>
<if test="param.handleStatus != null "> or 1=1 </if>
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30"> and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and ((lawo.work_order_status in (80,100,70) OR lacr.warehouse_id=#{param.warehouseId}) AND lawo.warehouse_id =#{param.warehouseId} ) </if>
<if test="param.workOrderType != null and param.workOrderType != '' ">and lawo.work_order_type = #{param.workOrderType } </if>
<if test="param.discoveryNode != null and param.discoveryNode != '' ">and lawo.discovery_node = #{param.discoveryNode } </if>
<if test="param.workOrderNumber != null and param.workOrderNumber != '' ">and lawo.work_order_number like concat('%',#{param.workOrderNumber },'%') </if>
@ -153,15 +154,8 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.first != null and param.first != '' ">and lawo.first like concat('%', #{param.first },'%') </if>
<if test="param.secondary != null and param.secondary != '' ">and lawo.secondary like concat('%', #{param.secondary },'%') </if>
<if test="param.vehicleRoute != null and param.vehicleRoute != '' ">and lawo.vehicle_route like concat('%', #{param.vehicleRoute },'%') </if>
<if test="param.warehouseId != null and param.warehouseId != '' and param.handleStatus != 20 "> and lap.business_id = #{param.warehouseId} </if>
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<!-- <if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null "> and lawo.work_order_status in ( #{param.workOrderStatus }) and lap.types_of = '2' </if>-->
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100,70) and lacr.warehouse_id=#{param.warehouseId} </if>
<if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
<if test="param.customerServiceState!= null and param.customerServiceState == 80 ">and lawo.work_order_status in ('10') </if>
ORDER BY lawo.create_time DESC
</where>

1
blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java

@ -89,6 +89,7 @@ public class BasicMaterialController extends BladeController {
return R.data(pages);
}
/**
* 物料基础信息 自定义分页
*/

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

@ -291,13 +291,8 @@ public class BasicdataWarehouseController extends BladeController {
@GetMapping("/getMyWarehouseList")
@ApiOperationSupport(order = 3)
public R<List<BasicdataWarehouseEntity>> getMyWarehouseList() {
BladeUser user = AuthUtil.getUser();
List<BasicdataWarehouseEntity> basicdataGoodsShelfVOList = CacheUtil.get(CacheObjNames.basic_data_warehourse_list.getCacheName(), CacheObjNames.basic_data_warehourse_list.getKeyPrefix(), user.getUserId(),List.class);
if(ObjectUtils.isNull(basicdataGoodsShelfVOList)){
basicdataGoodsShelfVOList = warehouseService.getMyWarehouseList();
CacheUtil.put(CacheObjNames.basic_data_warehourse_list.getCacheName(), CacheObjNames.basic_data_warehourse_list.getKeyPrefix(),user.getUserId(),basicdataGoodsShelfVOList);
}
return R.data(basicdataGoodsShelfVOList);
List<BasicdataWarehouseEntity> myWarehouseList = warehouseService.getMyWarehouseList();
return R.data(myWarehouseList);
}
/**

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehicleImportExcel.java

@ -83,14 +83,14 @@ public class BasicdataVehicleImportExcel implements Serializable {
/**
* 车长;单位M
*/
@ColumnWidth(20)
@ColumnWidth(25)
@ExcelProperty(index = 6,value ="车长;单位(M)")
private BigDecimal vehicleCommander;
/**
* 外廓高
*/
@ColumnWidth(20)
@ExcelProperty(index = 7,value ="外廓高")
@ColumnWidth(25)
@ExcelProperty(index = 7,value ="外廓高;单位(M)")
private BigDecimal vehicleHeight;
/**
* 车牌颜色;1-黄色,2-蓝色,3-绿色,4-蓝绿色,5-其他
@ -143,7 +143,7 @@ public class BasicdataVehicleImportExcel implements Serializable {
/**
* 核定体积
*/
@ColumnWidth(20)
@ColumnWidth(30)
@ExcelProperty("核定体积;单位(方)")
private BigDecimal approvedVolume;
/**

105
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -159,74 +159,77 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override
public List<BasicdataWarehouseEntity> getMyWarehouseList() {
Set<Long> deptIds = new HashSet<>();
// 获取当前登陆人
BladeUser user = AuthUtil.getUser();
List<BasicdataWarehouseEntity> results = null;
// 获取缓存中的仓库
List<BasicdataWarehouseEntity> results = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_OWN, user.getUserId()));
if(ObjectUtil.isEmpty(results)){
Set<Long> deptIds = new HashSet<>();
// 获取当前登陆人
String defaultRoleId = DictBizCache.getValue(DictBizConstant.DEFAULT_MALL_ROLE_ID, DictBizConstant.DEFAULT_MALL_ROLE_ID);
String defaultRoleId = DictBizCache.getValue(DictBizConstant.DEFAULT_MALL_ROLE_ID, DictBizConstant.DEFAULT_MALL_ROLE_ID);
log.info(">>>>>>> 当前登录的人 {} 角色信息 {}",user.getAccount(),user.getRoleId());
// 最大的管理员
if (ObjectUtil.isEmpty(user.getRoleId())) {
return null;
}
log.info(">>>>>>> 当前登录的人 {} 角色信息 {}",user.getAccount(),user.getRoleId());
// 最大的管理员
if (ObjectUtil.isEmpty(user.getRoleId())) {
return null;
}
if (user.getRoleId().contains(defaultRoleId)) {
// 当前这登录的用户为商场用户
// 根据当前登录人查询商场信息
List<BasicdataClientUserEntity> basicdataClientUserEntityListByUserIds = basicdataClientUserMapper.getBasicdataClientUserEntityListByUserId(user.getUserId());
List clientIds = null;
if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) {
clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList());
}
// 根据商场信息查询商场的服务仓库
LambdaQueryWrapper<BasicdataStorageServicesEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(BasicdataStorageServicesEntity::getClientId, clientIds);
// 得到仓库列表
List<BasicdataStorageServicesEntity> basicdataStorageServicesEntities = basicdataStorageServicesMapper.selectList(lambdaQueryWrapper);
if (basicdataStorageServicesEntities != null && !basicdataStorageServicesEntities.isEmpty()) {
results = new ArrayList<>();
for (BasicdataStorageServicesEntity basicdataStorageServicesEntity : basicdataStorageServicesEntities) {
BasicdataWarehouseEntity basicdataWarehouseEntity = new BasicdataWarehouseEntity();
basicdataWarehouseEntity.setId(basicdataStorageServicesEntity.getServeWarehouseId());
basicdataWarehouseEntity.setName(basicdataStorageServicesEntity.getServeWarehouseName());
results.add(basicdataWarehouseEntity);
}
}
if (user.getRoleId().contains(defaultRoleId)) {
} else {
//查询出部门表
String deptId = user.getDeptId();
log.info(">>> 部门 {}",deptId);
String[] split = deptId.split(",");
for (String s : split) {
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s));
if (Func.isEmpty(userDeptNode)) {
continue;
} else {
userDeptNode.forEach(u -> {
deptIds.add(u.getId());
});
}
deptIds.add(Long.parseLong(s));
// 当前这登录的用户为商场用户
// 根据当前登录人查询商场信息
List<BasicdataClientUserEntity> basicdataClientUserEntityListByUserIds = basicdataClientUserMapper.getBasicdataClientUserEntityListByUserId(user.getUserId());
List clientIds = null;
if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) {
clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList());
}
// 根据商场信息查询商场的服务仓库
LambdaQueryWrapper<BasicdataStorageServicesEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(BasicdataStorageServicesEntity::getClientId, clientIds);
// 得到仓库列表
List<BasicdataStorageServicesEntity> basicdataStorageServicesEntities = basicdataStorageServicesMapper.selectList(lambdaQueryWrapper);
if (basicdataStorageServicesEntities != null && !basicdataStorageServicesEntities.isEmpty()) {
results = new ArrayList<>();
for (BasicdataStorageServicesEntity basicdataStorageServicesEntity : basicdataStorageServicesEntities) {
BasicdataWarehouseEntity basicdataWarehouseEntity = new BasicdataWarehouseEntity();
basicdataWarehouseEntity.setId(basicdataStorageServicesEntity.getServeWarehouseId());
basicdataWarehouseEntity.setName(basicdataStorageServicesEntity.getServeWarehouseName());
results.add(basicdataWarehouseEntity);
}
}
} else {
//查询出部门表
String deptId = user.getDeptId();
log.info(">>> 部门 {}",deptId);
String[] split = deptId.split(",");
for (String s : split) {
List<Dept> userDeptNode = deptClient.getUserDeptNode(Long.parseLong(s));
if (Func.isEmpty(userDeptNode)) {
continue;
} else {
userDeptNode.forEach(u -> {
deptIds.add(u.getId());
});
if (deptIds.isEmpty()) {
return null;
}
deptIds.add(Long.parseLong(s));
assert results != null;
results.addAll(baseMapper.selectList(Wrappers.<BasicdataWarehouseEntity>query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds))) ;
}
if (deptIds.isEmpty()) {
return null;
}
results = baseMapper.selectList(Wrappers.<BasicdataWarehouseEntity>query().lambda().in(BasicdataWarehouseEntity::getDepartment, deptIds));
redis.setEx(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_OWN, user.getUserId()),results,3600L);
}
return results;
}

79
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -31,7 +31,6 @@ import com.logpm.factory.pan.service.IPanPackageInfoService;
import com.logpm.factory.pan.service.IPanPackageListService;
import com.logpm.factory.props.PanFactoryProperties;
import com.logpm.factory.snm.bean.Resp;
import com.logpm.factory.snm.entity.OrderStatusLog;
import com.logpm.factory.snm.entity.PanFactoryOrder;
import com.logpm.factory.snm.entity.PanPackageInfo;
import com.logpm.factory.snm.entity.PanPackageList;
@ -51,8 +50,7 @@ import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*;
import org.springblade.common.constant.orderpackage.*;
@ -73,7 +71,6 @@ import java.util.*;
@Service
public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
private static final Logger logger = LoggerFactory.getLogger(PanFactoryDataServiceImpl.class);
private final IPanFactoryOrderService factoryOrderService;
@ -125,7 +122,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// .eq("appsecret",appSecret);
// FactoryAccount factoryAccount = factoryAccountService.getOne(queryWrapper);
// if(Objects.isNull(factoryAccount)){
// logger.warn("未存在对应账户corpid={},appkey={},appsecret={}",corpId,appKey,appSecret);
// log.warn("未存在对应账户corpid={},appkey={},appsecret={}",corpId,appKey,appSecret);
// throw new CustomerException(400,"未存在对应账户,请联系管理员");
// }
//
@ -170,7 +167,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
queryWrapper.eq("delivery_number", orderInfoDTO.getDeliveryNumber());
PanFactoryOrder panFactoryOrder = factoryOrderService.getOne(queryWrapper);
if (Objects.isNull(panFactoryOrder)) {
logger.info("#############handleData: 未找到订单数据 合同自编码orderNo={}", orderNo);
log.info("#############handleData: 未找到订单数据 合同自编码orderNo={}", orderNo);
return R.fail(400, "未找到订单数据");
}
String plantId = panFactoryOrder.getPlantId();//工厂id
@ -180,7 +177,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//判断数据是都已存在
if (!orderInfoDTO.verifyData()) {
logger.info("#############handleData: 数据不齐全 orderInfoDTO={}", orderInfoDTO);
log.info("#############handleData: 数据不齐全 orderInfoDTO={}", orderInfoDTO);
return R.fail(405, "数据不齐全");
}
@ -195,7 +192,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
String panToken = getPanToken();
//请求参数
logger.info("##############handleData: 推送包件状态请求参数 {}", s);
log.info("##############handleData: 推送包件状态请求参数 {}", s);
//处理逻辑
String result = HttpRequest.post(panFactoryProperties.getUrl() + "/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_MID_RECEIVE")
.header("Authorization", "Bearer " + panToken)
@ -203,7 +200,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############handleData: 推送包件状态返回参数 {}", result);
log.info("##############handleData: 推送包件状态返回参数 {}", result);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
@ -212,7 +209,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
Integer code = payload.getInteger("code");
String message = payload.getString("data");
if (code.equals(1)) {
logger.info("##########handleData: 物流状态传递成功");
log.info("##########handleData: 物流状态传递成功");
} else {
return R.fail(405, message);
}
@ -234,7 +231,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
String status = orderStatusDTO.getStatus();
if ("1".equals(status) || "2".equals(status) || "5".equals(status) || "6".equals(status) || "8".equals(status) || "9".equals(status)) {
logger.info("#############handleStatusData: 当前数据的状态不推送 status={}", status);
log.info("#############handleStatusData: 当前数据的状态不推送 status={}", status);
return Resp.fail(400, "当前数据的状态不推送");
}
@ -245,7 +242,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
packageInfoQueryWrapper.eq("unit_no", unitNo);
PanPackageInfo one = panPackageInfoService.getOne(packageInfoQueryWrapper);
if (Objects.isNull(one)) {
logger.info("#############handleStatusData: 当前包条码未找到对应数据unitNo={}", unitNo);
log.info("#############handleStatusData: 当前包条码未找到对应数据unitNo={}", unitNo);
return Resp.fail(400, "未找到包件数据");
}
String plantId = one.getPlantId();
@ -268,7 +265,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//判断数据是都已存在
if (!orderStatusDTO.verifyData()) {
logger.info("#############handleStatusData: 数据不齐全 orderStatusDTO={}", orderStatusDTO);
log.info("#############handleStatusData: 数据不齐全 orderStatusDTO={}", orderStatusDTO);
return Resp.fail(405, "数据不齐全");
}
@ -283,7 +280,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
String panToken = getPanToken();
//请求参数
logger.info("##############handleStatusData: 推送包件状态请求参数 {}", s);
log.info("##############handleStatusData: 推送包件状态请求参数 {}", s);
//处理逻辑
String result = HttpRequest.post(panFactoryProperties.getUrl() + "/hitf/v1/rest/invoke?namespace=HZERO&serverCode=OPEN&interfaceCode=HUITONG_RECEIVE")
.header("Authorization", "Bearer " + panToken)
@ -291,7 +288,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
.body(s).timeout(5 * 1000)
.execute().body();
logger.info("##############handleStatusData: 推送包件状态返回参数 {}", result);
log.info("##############handleStatusData: 推送包件状态返回参数 {}", result);
//把结果字符串转为json对象
JSONObject jsonObject = JSONObject.parseObject(result);
@ -300,7 +297,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
Integer code = payload.getInteger("code");
String message = payload.getString("data");
if (code.equals(1)) {
logger.info("##########handleStatusData: 物流状态传递成功");
log.info("##########handleStatusData: 物流状态传递成功");
} else {
return Resp.fail(405, message);
}
@ -324,7 +321,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
statusName = "签收";
break;
default:
logger.info("###########statusName: 未知的类型");
log.info("###########statusName: 未知的类型");
}
return statusName;
}
@ -341,7 +338,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
.execute()
.body();
logger.info("##############getPanToken: 获取皮阿诺token返回参数 {}", result);
log.info("##############getPanToken: 获取皮阿诺token返回参数 {}", result);
//获取的结果转成json对象
JSONObject jsonObject = JSONObject.parseObject(result);
@ -357,7 +354,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
@Transactional
@Override
public void handleDataToPlatform(String unitNo, String operationTime) {
logger.info("############handleDataToPlatform: 处理数据到platform unitNo={}", unitNo);
log.info("############handleDataToPlatform: 处理数据到platform unitNo={}", unitNo);
//先查询包件是否已存入到新系统数据库
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCode(unitNo);
if (Objects.isNull(distributionParcelListEntity)) {
@ -365,7 +362,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//1.根据包条码去老系统数据库找到对应的包条信息
AdvanceDetailEntity advanceDetailEntity = advanceDetailClient.getOneByUnitNo(unitNo);
if (Objects.isNull(advanceDetailEntity)) {
logger.warn("#################handleDataToPlatform: 未找到对应的包条信息 unitNo={}", unitNo);
log.warn("#################handleDataToPlatform: 未找到对应的包条信息 unitNo={}", unitNo);
throw new CustomerException(405, "未找到对应的包条信息");
}
//2.根据包条信息拿到订单信息
@ -374,7 +371,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//2.1 因为会存在相同订单自编码的订单,所以为了区分订单只有通过id查询
AdvanceEntity advanceEntity = advanceClient.fingById(advanceId);
if (Objects.isNull(advanceEntity)) {
logger.warn("#################handleDataToPlatform: 未找到对应的订单信息 advanceId={}", advanceId);
log.warn("#################handleDataToPlatform: 未找到对应的订单信息 advanceId={}", advanceId);
throw new CustomerException(405, "未找到对应的订单信息");
}
@ -395,7 +392,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// OrderDetailEntity orderDetailEntity = orderDetailClient.findByUnitNo(unitNo);
// if(Objects.isNull(orderDetailEntity)){
// logger.warn("############handleDataToPlatform: 包条信息不存在 unitNo={}",unitNo);
// log.warn("############handleDataToPlatform: 包条信息不存在 unitNo={}",unitNo);
// throw new CustomerException(405, "包条信息不存在");
// }
// Integer oldId = orderDetailEntity.getNowWarehouseId();
@ -403,7 +400,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// 查询数据对应的仓库名称
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse);
if(Objects.isNull(basicdataWarehouseEntity)){
logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse);
log.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse);
throw new CustomerException(405, "仓库信息不存在");
}
Long warehouseId = basicdataWarehouseEntity.getId();
@ -425,7 +422,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
if(StringUtil.isNoneBlank(operationTime)){
date = CommonUtil.StringToDate(operationTime);
}
logger.info("#################handleDataToPlatform.waybillNoNum: {}", waybillNoNum);
log.info("#################handleDataToPlatform.waybillNoNum: {}", waybillNoNum);
distributionStockArticleEntity = new DistributionStockArticleEntity();
distributionStockArticleEntity.setOrderCode(orderSelfNum);
@ -454,14 +451,14 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
} else {
distributionStockArticleEntity.setCompleteSet(0);
}
logger.info("############basicdataWarehouseEntity {}", basicdataWarehouseEntity);
log.info("############basicdataWarehouseEntity {}", basicdataWarehouseEntity);
distributionStockArticleEntity.setCreateDept(basicdataWarehouseEntity.getDepartment());
WayBillEntity wayBillEntity = wayBillClient.getByWayBillByOrderCode(orderSelfNum);
if(Objects.isNull(wayBillEntity)){
logger.error("包条同步失败 ----> 数据异常 包条对应的运单不存在 包件 {} 运单对象 {},",unitNo,wayBillEntity);
log.error("包条同步失败 ----> 数据异常 包条对应的运单不存在 包件 {} 运单对象 {},",unitNo,wayBillEntity);
return ;
@ -498,7 +495,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//通过客户名称去查询客户的服务类型、
distributionStockArticleEntity.setTypeService("1");//默认商配
BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName);
logger.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity);
log.info("订单同步出现的客户编号{} 匹配的客户", basicdataClientEntity);
if (!Objects.isNull(basicdataClientEntity)) {
//商城
distributionStockArticleEntity.setMallId(basicdataClientEntity.getId());
@ -507,7 +504,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// todo 这里需要去查询门店 和新系统的门店ID 进行绑定
String peisongType = getPeisongTypeByClientId(basicdataClientEntity.getId());
logger.info("订单同步peisongType {} ", peisongType);
log.info("订单同步peisongType {} ", peisongType);
if (StringUtil.isNoneBlank(peisongType)) {
distributionStockArticleEntity.setTypeService(peisongType);
@ -548,7 +545,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
id = distributionStockArticleClient.addData(distributionStockArticleEntity);
distributionStockArticleEntity.setId(id);
if (id == 0) {
logger.warn("#################handleDataToPlatform: 保存订单信息失败 orderSelfNum={}", orderSelfNum);
log.warn("#################handleDataToPlatform: 保存订单信息失败 orderSelfNum={}", orderSelfNum);
throw new CustomerException(405, "保存订单信息失败");
}
}else{
@ -559,10 +556,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//保存包件信息
saveOrderPackage(unitNo, distributionStockArticleEntity, basicdataWarehouseEntity, waybillNoNum,operationTime,basicdataWarehouseEntity.getOldId());
logger.info("#################handleDataToPlatform: 数据处理完成");
log.info("#################handleDataToPlatform: 数据处理完成");
} else {
//已存在包件信息那就不处理
logger.info("#################handleDataToPlatform: 包件信息已存在,不用处理 unitNo={}", unitNo);
log.info("#################handleDataToPlatform: 包件信息已存在,不用处理 unitNo={}", unitNo);
}
//存入包条缓存
@ -611,7 +608,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
boolean b = warehouseTrayTypeClient.orderScanOrderPackageCode(map);
if(!b){
logger.error("################saveTrayTypeInfoPackage: 包件打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
log.error("################saveTrayTypeInfoPackage: 包件打托失败 unitNo={} trayCode={}",unitNo,"T"+trayId);
// throw new CustomerException(403,"包件打托失败");
}
@ -646,7 +643,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
*/
private String getPeisongTypeByClientId(Long id) {
BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(id, 3);
logger.info(">>>>>>> 查询客户的配送类型{}", basicdataStoreBusinessEntity);
log.info(">>>>>>> 查询客户的配送类型{}", basicdataStoreBusinessEntity);
if(ObjectUtil.isEmpty(basicdataStoreBusinessEntity)){
return null;
}
@ -677,7 +674,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//// WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(Objects.isNull(vo)){
logger.warn("##############saveOrderPackage: 未在老系统查询到包件数据 unitNo={}",unitNo);
log.warn("##############saveOrderPackage: 未在老系统查询到包件数据 unitNo={}",unitNo);
throw new CustomerException(405,"未在老系统查询到包件数据");
}else{
@ -741,10 +738,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
}
boolean b = distributionParcelListClient.add(entity);
if (!b) {
logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode());
log.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode());
throw new CustomerException(405, "保存包件信息失败");
}else{
logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
log.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
// Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
// Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
//
@ -764,7 +761,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
}
private void saveWaybillEntity(String waybillNo) {
logger.info("#################handleDataToPlatform.saveWaybillEntity: {}", waybillNo);
log.info("#################handleDataToPlatform.saveWaybillEntity: {}", waybillNo);
if (StringUtil.isBlank(waybillNo)) {
return;
@ -777,15 +774,15 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//通过运单号先去查询新系统是否存在这个运单号
WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
logger.info("#################handleDataToPlatform.warehouseWaybill: {}", warehouseWaybill);
log.info("#################handleDataToPlatform.warehouseWaybill: {}", warehouseWaybill);
if (Objects.isNull(warehouseWaybill)) {
redis.setEx("dealwithWaybillNo:"+waybillNo,waybillNo,30L);
//如果新系统中不存在这个运单,那么就去查询老系统的运单数据
WayBillEntity wayBillEntity = wayBillClient.getByWaybillNo(waybillNo);
logger.info("#################handleDataToPlatform.wayBillEntity: {}", wayBillEntity);
log.info("#################handleDataToPlatform.wayBillEntity: {}", wayBillEntity);
if (Objects.isNull(wayBillEntity)) {
logger.warn("##############saveWaybillEntity: 老系统中未找到对应运单waybillNo={}", waybillNo);
log.warn("##############saveWaybillEntity: 老系统中未找到对应运单waybillNo={}", waybillNo);
throw new CustomerException("老系统中未找到对应运单");
}
String startSite = wayBillEntity.getStartSite();//始发仓名称
@ -1145,7 +1142,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
factoryOrderDTO.setORDER_ATTRIBUTES(order_attributes);
if (order_attributes.isEmpty()) {
logger.info("###########saveData: 没有新增包件,不保存信息");
log.info("###########saveData: 没有新增包件,不保存信息");
return null;
}
}

Loading…
Cancel
Save