Browse Source

Merge branch 'dev' into pre-production

visual
pref_mail@163.com 3 months ago
parent
commit
d1f5920fea
  1. 2
      blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java
  2. 11
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java
  3. 38
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java
  4. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  5. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java
  6. 13
      blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java
  7. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  8. 31
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java

2
blade-service-api/logpm-business-api/src/main/java/com/logpm/business/feign/IBusinessPreOrderClient.java

@ -23,6 +23,6 @@ public interface IBusinessPreOrderClient {
Integer inOrderByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("carNum") String carNum); Integer inOrderByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode, @RequestParam("carNum") String carNum);
@PostMapping(SAVEOTHERDATABASENEW) @PostMapping(SAVEOTHERDATABASENEW)
void saveOtherDataBaseNew(@RequestParam("userId") String tenantId, @RequestBody List<BusinessPreOrderEntity> dataResult, @RequestParam("mallName") String mallName); void saveOtherDataBaseNew(@RequestParam("tenantId") String tenantId, @RequestBody List<BusinessPreOrderEntity> dataResult, @RequestParam("mallName") String mallName);
} }

11
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java

@ -38,11 +38,12 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
if (tenant1.isSuccess()) { if (tenant1.isSuccess()) {
Tenant tenant = tenant1.getData(); Tenant tenant = tenant1.getData();
if (ObjectUtil.isEmpty(tenant)) { if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在"); log.warn(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return; return;
} }
if (dataResult.isEmpty()) { if (dataResult.isEmpty()) {
log.info(" saveOtherDataBaseNew dataResult 参数错误"); log.warn(" saveOtherDataBaseNew dataResult 参数错误");
return;
} }
LambdaQueryWrapper<BusinessPreOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BusinessPreOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -50,7 +51,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
lambdaQueryWrapper.in(BusinessPreOrderEntity::getOrderCode, orderCodeList); lambdaQueryWrapper.in(BusinessPreOrderEntity::getOrderCode, orderCodeList);
List<BusinessPreOrderEntity> list = businessPreOrderService.list(lambdaQueryWrapper); List<BusinessPreOrderEntity> list = businessPreOrderService.list(lambdaQueryWrapper);
log.info(" saveOtherDataBaseNew list {} :", list);
// 找到已经推送的包件信息 并将其标记为删除状态 // 找到已经推送的包件信息 并将其标记为删除状态
List<Long> temsp = new ArrayList<>(); List<Long> temsp = new ArrayList<>();
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) { for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
@ -69,7 +70,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
} else { } else {
temsp.add(distributionBusinessPreOrderEntity.getId()); temsp.add(distributionBusinessPreOrderEntity.getId());
} }
}else if(distributionBusinessPreOrderEntity.getConditions().equals(3) &&distributionBusinessPreOrderEntity.getFirsts().equals(businessPreOrderEntity.getFirsts())){ } else if (distributionBusinessPreOrderEntity.getConditions().equals(3) && distributionBusinessPreOrderEntity.getFirsts().equals(businessPreOrderEntity.getFirsts())) {
if (distributionBusinessPreOrderEntity.getInWarehouse().equals(1)) { if (distributionBusinessPreOrderEntity.getInWarehouse().equals(1)) {
// 需要删除集合中的数据 // 需要删除集合中的数据
dataResult.remove(i); dataResult.remove(i);
@ -88,7 +89,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : dataResult) { for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : dataResult) {
distributionBusinessPreOrderEntity.setTenantId(tenant.getTenantId()); distributionBusinessPreOrderEntity.setTenantId(tenant.getTenantId());
} }
log.info(" saveBatch dataResult {} :", dataResult);
// 执行保存操作 // 执行保存操作
businessPreOrderService.saveBatch(dataResult); businessPreOrderService.saveBatch(dataResult);

38
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -102,7 +102,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
BusinessSanDTO businessSanDTO = new BusinessSanDTO(); BusinessSanDTO businessSanDTO = new BusinessSanDTO();
businessSanDTO.setOrderPackageCode(distributionBusinessPreOrderEntity.getOrderPackageCode()); businessSanDTO.setOrderPackageCode(distributionBusinessPreOrderEntity.getOrderPackageCode());
businessSanDTO.setInWarehouseException(0); businessSanDTO.setInWarehouseException(0);
businessSanDTO.setConditions(distributionBusinessPreOrderEntity.getConditions()+""); businessSanDTO.setConditions(distributionBusinessPreOrderEntity.getConditions() + "");
businessSanDTO.setDistrCarNumber(distributionBusinessPreOrderEntity.getDistrCarNumber()); businessSanDTO.setDistrCarNumber(distributionBusinessPreOrderEntity.getDistrCarNumber());
R r = inOrderWarehourse(businessSanDTO); R r = inOrderWarehourse(businessSanDTO);
if (r.isSuccess()) { if (r.isSuccess()) {
@ -234,13 +234,13 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
// 异常入库 // 异常入库
if (1 == businessSanDTO.getInWarehouseException()) { if (1 == businessSanDTO.getInWarehouseException()) {
Resp a = handleExceptionalWarehourse(businessSanDTO, list, orderPackageCode, distrCarNumber); Resp a = handleExceptionalWarehourse(businessSanDTO, list, orderPackageCode, distrCarNumber);
if (a != null){ if (a != null) {
return a; return a;
} }
} else { } else {
//正常入口 //正常入口
Resp scanFail = handleNormalWarehourse(businessSanDTO, orderPackageCode, list, distrCarNumber); Resp scanFail = handleNormalWarehourse(businessSanDTO, orderPackageCode, list, distrCarNumber);
if (scanFail != null){ if (scanFail != null) {
return scanFail; return scanFail;
} }
@ -287,7 +287,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId.setWarehouse(myCurrentWarehouse.getName()); distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId.setWarehouse(myCurrentWarehouse.getName());
Long id =distributionParcelListClient.addReturnId(distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId); Long id = distributionParcelListClient.addReturnId(distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId);
// 增加logpm_distribution_parcel_number 的数据 // 增加logpm_distribution_parcel_number 的数据
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
@ -304,22 +304,21 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
ls.add(parcelNumberEntity); ls.add(parcelNumberEntity);
distributionParcelNumberClient.addBatch(ls); distributionParcelNumberClient.addBatch(ls);
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity()==null?0:distributionStockArticleEntity.getHandQuantity() + businessSanDTO.getUnloadNum()); distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() == null ? 0 : distributionStockArticleEntity.getHandQuantity() + businessSanDTO.getUnloadNum());
distributionStockArticleEntity.setIncomingNum(distributionStockArticleEntity.getIncomingNum()==null?0:distributionStockArticleEntity.getIncomingNum() + businessSanDTO.getUnloadNum()); distributionStockArticleEntity.setIncomingNum(distributionStockArticleEntity.getIncomingNum() == null ? 0 : distributionStockArticleEntity.getIncomingNum() + businessSanDTO.getUnloadNum());
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity); distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
// distributionParcelNumberClient.add(new DistributionParcelNumberEntity(distributionParcelListEntityByOrderCodeAndFirstName.getId(), distributionParcelListEntityByOrderCodeAndFirstName.getOrderPackageCode(), distributionParcelListEntityByOrderCodeAndFirstName.getOrderPackageReservationStatus(), distributionParcelListEntityByOrderCodeAndFirstName.getQuantity())); // distributionParcelNumberClient.add(new DistributionParcelNumberEntity(distributionParcelListEntityByOrderCodeAndFirstName.getId(), distributionParcelListEntityByOrderCodeAndFirstName.getOrderPackageCode(), distributionParcelListEntityByOrderCodeAndFirstName.getOrderPackageReservationStatus(), distributionParcelListEntityByOrderCodeAndFirstName.getQuantity()));
temp = businessSanDTO.getUnloadNum(); temp = businessSanDTO.getUnloadNum();
} }
} else { } else {
// 修改其入库数量 // 修改其入库数量
if(distributionParcelListEntityByOrderCodeAndFirstName.getQuantity()<businessSanDTO.getUnloadNum()){ if (distributionParcelListEntityByOrderCodeAndFirstName.getQuantity() < businessSanDTO.getUnloadNum()) {
temp = distributionParcelListEntityByOrderCodeAndFirstName.getQuantity() - businessSanDTO.getUnloadNum(); temp = distributionParcelListEntityByOrderCodeAndFirstName.getQuantity() - businessSanDTO.getUnloadNum();
}else{ } else {
temp = businessSanDTO.getUnloadNum() - distributionParcelListEntityByOrderCodeAndFirstName.getQuantity(); temp = businessSanDTO.getUnloadNum() - distributionParcelListEntityByOrderCodeAndFirstName.getQuantity();
} }
@ -336,7 +335,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
businessPreOrderEntity.setInWarehouse(1); businessPreOrderEntity.setInWarehouse(1);
businessPreOrderEntity.setUnloadNum(businessSanDTO.getUnloadNum()); businessPreOrderEntity.setUnloadNum(businessSanDTO.getUnloadNum());
this.updateById(businessPreOrderEntity); this.updateById(businessPreOrderEntity);
return Resp.scanSuccess("操作成功", "入库"+businessSanDTO.getUnloadNum()+"件"); return Resp.scanSuccess("操作成功", "入库" + businessSanDTO.getUnloadNum() + "件");
} else { } else {
@ -546,6 +545,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
t.setAcceptWarehouseName(distributionBusinessPreOrderEntity.getAcceptWarehouseName()); t.setAcceptWarehouseName(distributionBusinessPreOrderEntity.getAcceptWarehouseName());
t.setSendWarehouseId(distributionBusinessPreOrderEntity.getSendWarehouseId()); t.setSendWarehouseId(distributionBusinessPreOrderEntity.getSendWarehouseId());
t.setSendWarehouseName(distributionBusinessPreOrderEntity.getSendWarehouseName()); t.setSendWarehouseName(distributionBusinessPreOrderEntity.getSendWarehouseName());
t.setTaskTime(distributionBusinessPreOrderEntity.getTaskTime());
this.save(t); this.save(t);
} }
R r = inOrderWarehourseByFeign(businessSanDTO); R r = inOrderWarehourseByFeign(businessSanDTO);
@ -814,10 +814,10 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
for (BusinessPreOrderEntity businessPreOrderEntity : list) { for (BusinessPreOrderEntity businessPreOrderEntity : list) {
BusinessPreOrderVO t = businessPreOrderList.stream().filter(a->businessPreOrderEntity.getId().equals(a.getId())).findFirst().get(); BusinessPreOrderVO t = businessPreOrderList.stream().filter(a -> businessPreOrderEntity.getId().equals(a.getId())).findFirst().get();
if (1 == businessPreOrderEntity.getInWarehouse()) { if (1 == businessPreOrderEntity.getInWarehouse()) {
throw new CustomerException( businessPreOrderEntity.getFirsts() + "已入库"); throw new CustomerException(businessPreOrderEntity.getFirsts() + "已入库");
} }
// 构建 订单 // 构建 订单
@ -847,7 +847,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId.setStockArticleId(distributionStockArticleEntity.getId()); distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId.setStockArticleId(distributionStockArticleEntity.getId());
// distributionParcelListClient.add(distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId); // distributionParcelListClient.add(distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId);
Long id =distributionParcelListClient.addReturnId(distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId); Long id = distributionParcelListClient.addReturnId(distributionParcelListEntityByOrderCodeAndFirstNameAndTenantId);
// 增加logpm_distribution_parcel_number 的数据 // 增加logpm_distribution_parcel_number 的数据
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
@ -865,8 +865,8 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
ls.add(parcelNumberEntity); ls.add(parcelNumberEntity);
distributionParcelNumberClient.addBatch(ls); distributionParcelNumberClient.addBatch(ls);
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity()==null?0:distributionStockArticleEntity.getHandQuantity() + t.getUnloadNum()); distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() == null ? 0 : distributionStockArticleEntity.getHandQuantity() + t.getUnloadNum());
distributionStockArticleEntity.setIncomingNum(distributionStockArticleEntity.getIncomingNum()==null?0:distributionStockArticleEntity.getIncomingNum() + t.getUnloadNum()); distributionStockArticleEntity.setIncomingNum(distributionStockArticleEntity.getIncomingNum() == null ? 0 : distributionStockArticleEntity.getIncomingNum() + t.getUnloadNum());
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity); distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
temp = t.getUnloadNum(); temp = t.getUnloadNum();
@ -874,16 +874,16 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
} else { } else {
// 修改其入库数量 // 修改其入库数量
if(distributionParcelListEntityByOrderCodeAndFirstName.getQuantity()<t.getUnloadNum()){ if (distributionParcelListEntityByOrderCodeAndFirstName.getQuantity() < t.getUnloadNum()) {
temp = distributionParcelListEntityByOrderCodeAndFirstName.getQuantity() - t.getUnloadNum(); temp = distributionParcelListEntityByOrderCodeAndFirstName.getQuantity() - t.getUnloadNum();
}else{ } else {
temp = t.getUnloadNum() - distributionParcelListEntityByOrderCodeAndFirstName.getQuantity(); temp = t.getUnloadNum() - distributionParcelListEntityByOrderCodeAndFirstName.getQuantity();
} }
distributionParcelListEntityByOrderCodeAndFirstName.setQuantity(t.getUnloadNum()); distributionParcelListEntityByOrderCodeAndFirstName.setQuantity(t.getUnloadNum());
distributionParcelListClient.update(distributionParcelListEntityByOrderCodeAndFirstName); distributionParcelListClient.update(distributionParcelListEntityByOrderCodeAndFirstName);
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity()==null?0:distributionStockArticleEntity.getHandQuantity() + t.getUnloadNum()); distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() == null ? 0 : distributionStockArticleEntity.getHandQuantity() + t.getUnloadNum());
distributionStockArticleEntity.setIncomingNum(distributionStockArticleEntity.getIncomingNum()==null?0:distributionStockArticleEntity.getIncomingNum() + t.getUnloadNum()); distributionStockArticleEntity.setIncomingNum(distributionStockArticleEntity.getIncomingNum() == null ? 0 : distributionStockArticleEntity.getIncomingNum() + t.getUnloadNum());
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity); distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
} }

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java

@ -91,7 +91,6 @@ public class QualityDeliverListener {
if (StrUtil.isEmpty(msg)) { if (StrUtil.isEmpty(msg)) {
return; return;
} }
Thread.sleep(1000*10);
ReportQualityDeliverDTO bean = JSONUtil.toBean(msg, ReportQualityDeliverDTO.class); ReportQualityDeliverDTO bean = JSONUtil.toBean(msg, ReportQualityDeliverDTO.class);
String data = bean.getData(); String data = bean.getData();
QualityDeliverEntity qualityDeliverEntity = JSONUtil.toBean(data, QualityDeliverEntity.class); QualityDeliverEntity qualityDeliverEntity = JSONUtil.toBean(data, QualityDeliverEntity.class);

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/ReservationPlanReportListener.java

@ -54,7 +54,7 @@ public class ReservationPlanReportListener {
exchange = @Exchange(name = FanoutConstants.reservation.OwnReservation.EXCHANGE, type = ExchangeTypes.FANOUT) exchange = @Exchange(name = FanoutConstants.reservation.OwnReservation.EXCHANGE, type = ExchangeTypes.FANOUT)
)) ))
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void buildReport(String msg) { public void buildReport(String msg) throws InterruptedException {
log.info("预约计划生成明细报表: {}", msg); log.info("预约计划生成明细报表: {}", msg);
@ -105,13 +105,13 @@ public class ReservationPlanReportListener {
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) { if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.CMP)) {
qualityDeliverEntity.setConditions(1); qualityDeliverEntity.setConditions(1);
qualityDeliverEntity.setPlanNum(1); qualityDeliverEntity.setPlanNum(1);
sendReport(bizOperation, qualityDeliverEntity,BizOperationEnums.MODIFY); sendReport(bizOperation, qualityDeliverEntity, BizOperationEnums.MODIFY);
} }
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) { if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.LTL)) {
qualityDeliverEntity.setOrderCode(detail.getOrderCode()); qualityDeliverEntity.setOrderCode(detail.getOrderCode());
qualityDeliverEntity.setCategory(detail.getProductName()); qualityDeliverEntity.setCategory(detail.getProductName());
qualityDeliverEntity.setConditions(2); qualityDeliverEntity.setConditions(2);
sendReport(bizOperation, qualityDeliverEntity,BizOperationEnums.MODIFY); sendReport(bizOperation, qualityDeliverEntity, BizOperationEnums.MODIFY);
} }
if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) { if (ObjectUtil.equals(detail.getPackageType(), PackageTypeEnums.INV)) {
qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch()); qualityDeliverEntity.setIncomingBatch(detail.getPickupBatch());

13
blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java

@ -11,11 +11,13 @@ import com.logpm.distribution.service.impl.DistributionSignforServiceImpl;
import com.logpm.distribution.vo.print.PrintPreviewVO; import com.logpm.distribution.vo.print.PrintPreviewVO;
import com.logpm.factory.comfac.dto.OrderStatusDTO; import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.oupai.entity.FactoryOrderEntity; import com.logpm.factory.oupai.entity.FactoryOrderEntity;
import io.jsonwebtoken.Claims;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.test.BladeBootTest; import org.springblade.core.test.BladeBootTest;
import org.springblade.core.test.BladeSpringExtension; import org.springblade.core.test.BladeSpringExtension;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -175,6 +177,17 @@ public class TestService {
} }
@Test
public void test201(){
String a ="bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRfaWQiOiI2Mjc2ODMiLCJ1c2VyX25hbWUiOiIxODA0ODk4MjkwNiIsInJlYWxfbmFtZSI6IuadjuaelyIsImF2YXRhciI6IiIsImF1dGhvcml0aWVzIjpbIuaLo-i0p-WRmCIsIuS7k-W6k-aWh-WRmCJdLCJjbGllbnRfaWQiOiJzYWJlciIsInJvbGVfbmFtZSI6IuS7k-W6k-aWh-WRmCzmi6PotKflkZgiLCJsaWNlbnNlIjoicG93ZXJlZCBieSBibGFkZXgiLCJwb3N0X2lkIjoiMTcxMjM2MzU1NjE2MDI1Mzk1NCwxNzEyMzY0OTE0MTA4MTE2OTkzIiwidXNlcl9pZCI6IjE3NzExMDMxMDEwNjgxMDc3NzgiLCJyb2xlX2lkIjoiMTcxMjM2NjA5OTgyOTQ2OTE4NSwxNzEzNzk0MDI1NTE5MDU4OTQ1Iiwic2NvcGUiOlsiYWxsIl0sIm5pY2tfbmFtZSI6IuadjuaelyIsIm9hdXRoX2lkIjoiIiwiZGV0YWlsIjp7InR5cGUiOiJ3ZWIifSwiZXhwIjoxNzI4NzkzNjAyLCJkZXB0X2lkIjoiMTc2MTkxODgyNDIwNDAxMzU2OSIsImp0aSI6IjEzZTBiYmI0LTQ5YWItNGJkNi1iODM3LTVhMGNjOWNhNmE3MyIsImFjY291bnQiOiIxODA0ODk4MjkwNiJ9.NQ9CJC38PDgLptqn6moHwGEuMHBana23r68eWsIAJq0";
String token = AuthUtil.getToken(a);
Claims claims = AuthUtil.parseJWT(token);
System.out.println(claims);
}
} }

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -357,10 +357,14 @@
IFNULL(lbc.name,'其他') goodsName, IFNULL(lbc.name,'其他') goodsName,
ltad.* ltad.*
from logpm_trunkline_advance_detail ltad from logpm_trunkline_advance_detail ltad
left join logpm_basicdata_factory_category lbfc on lbfc.brand = ltad.brand and lbfc.firsts = ltad.first_pack_name and lbfc.seconds = ltad.second_pack_name and lbfc.thirds = ltad.third_pack_name LEFT JOIN logpm_basicdata_factory_category lbfc ON lbfc.brand = ltad.brand
left join logpm_basicdata_category lbc on lbc.id = lbfc.category_id AND IFNULL(lbfc.firsts,1) = IFNULL(ltad.first_pack_name,1)
AND IFNULL(lbfc.seconds,2) = IFNULL(ltad.second_pack_name,2)
AND IFNULL(lbfc.thirds,3) = IFNULL(ltad.third_pack_name,3)
AND IFNULL(lbfc.materiel_name,4) = IFNULL(ltad.material_name,4)
AND lbfc.is_deleted = 0
LEFT JOIN logpm_basicdata_category lbc ON lbc.id = lbfc.category_id
where ltad.is_deleted = 0 where ltad.is_deleted = 0
and lbfc.is_deleted=0
and ltad.advance_id in and ltad.advance_id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")"> <foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item} #{item}

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

@ -95,17 +95,17 @@ public class AsyncServiceImpl implements IAsyncService {
if (tenantFeign.isSuccess()) { if (tenantFeign.isSuccess()) {
tenant = tenantFeign.getData(); tenant = tenantFeign.getData();
} }
String mallName = tenant.getTenantName(); // String mallName = tenant.getTenantName();
log.info(">>> 执行保存数据到商家数据的功能 商家名称{}",tenant.getTenantName()); log.info(">>> 执行保存数据到商家数据的功能 商家名称{}", tenant.getTenantName());
for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) { for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) {
List<TrunklineAdvanceDetailEntity> t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(trunklineAdvanceEntity.getId())).collect(Collectors.toList()); List<TrunklineAdvanceDetailEntity> t = trunklineAdvanceDetailEntities.stream().filter(trunklineAdvanceDetailEntity -> trunklineAdvanceDetailEntity.getAdvanceId().equals(trunklineAdvanceEntity.getId())).collect(Collectors.toList());
saveTrunklineAdvanceEntity(trunklineAdvanceEntity, mallName); saveTrunklineAdvanceEntity(trunklineAdvanceEntity, tenant);
// 保存暂存子表 // 保存暂存子表
saveTrunklineAdvanceDetailEntity(t, trunklineAdvanceEntity, mallName); saveTrunklineAdvanceDetailEntity(t, trunklineAdvanceEntity, tenant);
} }
List<Long> collect = trunklineAdvanceEntities.stream().map(TrunklineAdvanceEntity::getId).distinct().collect(Collectors.toList()); List<Long> collect = trunklineAdvanceEntities.stream().map(TrunklineAdvanceEntity::getId).distinct().collect(Collectors.toList());
@ -113,7 +113,7 @@ public class AsyncServiceImpl implements IAsyncService {
List<TrunklineAdvanceDetailVO> listByAdvanceIds = advanceDetailService.findAdvanceDetailVoByAdvanceIds(collect); List<TrunklineAdvanceDetailVO> listByAdvanceIds = advanceDetailService.findAdvanceDetailVoByAdvanceIds(collect);
// 保存运单 // 保存运单
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName); BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName());
List<TrunklineWaybillOrderEntity> collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList()); List<TrunklineWaybillOrderEntity> collect1 = trunklineWaybillOrderEntities.stream().filter(trunklineWaybillOrderEntity -> trunklineWaybillOrderEntity.getWaybillId().equals(waybillBilllByWaybillNo.getId())).collect(Collectors.toList());
@ -254,7 +254,7 @@ public class AsyncServiceImpl implements IAsyncService {
trunklineWaybillTrackEntity.setWaybillId(waybillBilllByWaybillNo.getId()); trunklineWaybillTrackEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillTrackEntity.setTenantId(tenant.getTenantId()); trunklineWaybillTrackEntity.setTenantId(tenant.getTenantId());
BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(mallName); BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(tenant.getTenantName());
trunklineWaybillTrackEntity.setWarehouseId(basicdataWarehouseEntity1.getId()); trunklineWaybillTrackEntity.setWarehouseId(basicdataWarehouseEntity1.getId());
trunklineWaybillTrackEntity.setWarehouseName(basicdataWarehouseEntity1.getName()); trunklineWaybillTrackEntity.setWarehouseName(basicdataWarehouseEntity1.getName());
trunklineWaybillTrackService.save(trunklineWaybillTrackEntity); trunklineWaybillTrackService.save(trunklineWaybillTrackEntity);
@ -264,11 +264,11 @@ public class AsyncServiceImpl implements IAsyncService {
@ChangeAsync() @ChangeAsync()
@Override @Override
public void deleteWaybillData(String tenantId, String waybillNo,String consignee) { public void deleteWaybillData(String tenantId, String waybillNo, String consignee) {
try{ try {
log.info("执行删除商场推送数据清理动作 商场名称:{}",consignee); log.info("执行删除商场推送数据清理动作 商场名称:{}", consignee);
// 根据运单号删除运单logpm_trunkline_waybill_package 的数据 // 根据运单号删除运单logpm_trunkline_waybill_package 的数据
trunklineWaybillPackageService.deleteByWaybillNo(waybillNo); trunklineWaybillPackageService.deleteByWaybillNo(waybillNo);
// 根据运单号删除 logpm_trunkline_waybill_order 的数据 // 根据运单号删除 logpm_trunkline_waybill_order 的数据
@ -288,12 +288,11 @@ public class AsyncServiceImpl implements IAsyncService {
// 根据运单号 删除 logpm_trunkline_waybill_track // 根据运单号 删除 logpm_trunkline_waybill_track
trunklineWaybillTrackService.deleteByWaybillNo(waybillNo); trunklineWaybillTrackService.deleteByWaybillNo(waybillNo);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) { private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) {
@ -306,8 +305,7 @@ public class AsyncServiceImpl implements IAsyncService {
return basicdataWarehouseEntity; return basicdataWarehouseEntity;
} }
private void saveTrunklineAdvanceDetailEntity(List<TrunklineAdvanceDetailEntity> t, TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) { private void saveTrunklineAdvanceDetailEntity(List<TrunklineAdvanceDetailEntity> t, TrunklineAdvanceEntity trunklineAdvanceEntity, Tenant tenant) {
Tenant tenant = changeDataBase(mallName);
List<Long> ids = Collections.singletonList(trunklineAdvanceEntity.getId()); List<Long> ids = Collections.singletonList(trunklineAdvanceEntity.getId());
@ -333,7 +331,7 @@ public class AsyncServiceImpl implements IAsyncService {
trunklineAdvanceDetailEntity.setTenantId(tenant.getTenantId()); trunklineAdvanceDetailEntity.setTenantId(tenant.getTenantId());
trunklineAdvanceDetailEntity.setIncomingWarehouseId(null); trunklineAdvanceDetailEntity.setIncomingWarehouseId(null);
trunklineAdvanceDetailEntity.setIncomingWarehouseName(null); trunklineAdvanceDetailEntity.setIncomingWarehouseName(null);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName); BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName());
if (basicdataWarehouseEntity != null) { if (basicdataWarehouseEntity != null) {
trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId()); trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName()); trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName());
@ -346,8 +344,7 @@ public class AsyncServiceImpl implements IAsyncService {
} }
private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) { private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, Tenant tenant) {
Tenant tenant = changeDataBase(mallName);
// 查找商户的暂存单是否存在改制 // 查找商户的暂存单是否存在改制
QueryWrapper<TrunklineAdvanceEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<TrunklineAdvanceEntity> queryWrapper = new QueryWrapper<>();
@ -355,7 +352,7 @@ public class AsyncServiceImpl implements IAsyncService {
queryWrapper.eq("waybill_no", trunklineAdvanceEntity.getWaybillNo()) queryWrapper.eq("waybill_no", trunklineAdvanceEntity.getWaybillNo())
.last("limit 1"); .last("limit 1");
TrunklineAdvanceEntity trunklineAdvanceEntity1 = advanceService.getOne(queryWrapper); TrunklineAdvanceEntity trunklineAdvanceEntity1 = advanceService.getOne(queryWrapper);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName); BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName());
if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) { if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) {
// 保存对象 // 保存对象
if (basicdataWarehouseEntity != null) { if (basicdataWarehouseEntity != null) {

Loading…
Cancel
Save