Browse Source

删除错误的日志记录库

chenglong
pref_mail@163.com 1 year ago
parent
commit
0fedbf70a9
  1. 79
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

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