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. 9
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java
  3. 2
      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. 2
      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. 21
      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);
@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);
}

9
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()) {
Tenant tenant = tenant1.getData();
if (ObjectUtil.isEmpty(tenant)) {
log.info(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
log.warn(">>>>>>>>>>>>> saveOtherDataBaseNew 租户不存在");
return;
}
if (dataResult.isEmpty()) {
log.info(" saveOtherDataBaseNew dataResult 参数错误");
log.warn(" saveOtherDataBaseNew dataResult 参数错误");
return;
}
LambdaQueryWrapper<BusinessPreOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
@ -50,7 +51,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
lambdaQueryWrapper.in(BusinessPreOrderEntity::getOrderCode, orderCodeList);
List<BusinessPreOrderEntity> list = businessPreOrderService.list(lambdaQueryWrapper);
log.info(" saveOtherDataBaseNew list {} :", list);
// 找到已经推送的包件信息 并将其标记为删除状态
List<Long> temsp = new ArrayList<>();
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
@ -88,7 +89,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : dataResult) {
distributionBusinessPreOrderEntity.setTenantId(tenant.getTenantId());
}
log.info(" saveBatch dataResult {} :", dataResult);
// 执行保存操作
businessPreOrderService.saveBatch(dataResult);

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

@ -311,7 +311,6 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
// distributionParcelNumberClient.add(new DistributionParcelNumberEntity(distributionParcelListEntityByOrderCodeAndFirstName.getId(), distributionParcelListEntityByOrderCodeAndFirstName.getOrderPackageCode(), distributionParcelListEntityByOrderCodeAndFirstName.getOrderPackageReservationStatus(), distributionParcelListEntityByOrderCodeAndFirstName.getQuantity()));
temp = businessSanDTO.getUnloadNum();
}
@ -546,6 +545,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
t.setAcceptWarehouseName(distributionBusinessPreOrderEntity.getAcceptWarehouseName());
t.setSendWarehouseId(distributionBusinessPreOrderEntity.getSendWarehouseId());
t.setSendWarehouseName(distributionBusinessPreOrderEntity.getSendWarehouseName());
t.setTaskTime(distributionBusinessPreOrderEntity.getTaskTime());
this.save(t);
}
R r = inOrderWarehourseByFeign(businessSanDTO);

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)) {
return;
}
Thread.sleep(1000*10);
ReportQualityDeliverDTO bean = JSONUtil.toBean(msg, ReportQualityDeliverDTO.class);
String data = bean.getData();
QualityDeliverEntity qualityDeliverEntity = JSONUtil.toBean(data, QualityDeliverEntity.class);

2
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)
))
@Transactional(rollbackFor = Exception.class)
public void buildReport(String msg) {
public void buildReport(String msg) throws InterruptedException {
log.info("预约计划生成明细报表: {}", msg);

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.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.oupai.entity.FactoryOrderEntity;
import io.jsonwebtoken.Claims;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.utils.CommonUtil;
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.BladeSpringExtension;
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,
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_category lbc on lbc.id = lbfc.category_id
LEFT JOIN logpm_basicdata_factory_category lbfc ON lbfc.brand = ltad.brand
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
and lbfc.is_deleted=0
and ltad.advance_id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item}

21
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()) {
tenant = tenantFeign.getData();
}
String mallName = tenant.getTenantName();
// String mallName = tenant.getTenantName();
log.info(">>> 执行保存数据到商家数据的功能 商家名称{}", tenant.getTenantName());
for (TrunklineAdvanceEntity trunklineAdvanceEntity : trunklineAdvanceEntities) {
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());
@ -113,7 +113,7 @@ public class AsyncServiceImpl implements IAsyncService {
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());
@ -254,7 +254,7 @@ public class AsyncServiceImpl implements IAsyncService {
trunklineWaybillTrackEntity.setWaybillId(waybillBilllByWaybillNo.getId());
trunklineWaybillTrackEntity.setTenantId(tenant.getTenantId());
BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(mallName);
BasicdataWarehouseEntity basicdataWarehouseEntity1 = getBasicdataWarehouseEntity(tenant.getTenantName());
trunklineWaybillTrackEntity.setWarehouseId(basicdataWarehouseEntity1.getId());
trunklineWaybillTrackEntity.setWarehouseName(basicdataWarehouseEntity1.getName());
trunklineWaybillTrackService.save(trunklineWaybillTrackEntity);
@ -293,7 +293,6 @@ public class AsyncServiceImpl implements IAsyncService {
}
}
private BasicdataWarehouseEntity getBasicdataWarehouseEntity(String mallName) {
@ -306,8 +305,7 @@ public class AsyncServiceImpl implements IAsyncService {
return basicdataWarehouseEntity;
}
private void saveTrunklineAdvanceDetailEntity(List<TrunklineAdvanceDetailEntity> t, TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
private void saveTrunklineAdvanceDetailEntity(List<TrunklineAdvanceDetailEntity> t, TrunklineAdvanceEntity trunklineAdvanceEntity, Tenant tenant) {
List<Long> ids = Collections.singletonList(trunklineAdvanceEntity.getId());
@ -333,7 +331,7 @@ public class AsyncServiceImpl implements IAsyncService {
trunklineAdvanceDetailEntity.setTenantId(tenant.getTenantId());
trunklineAdvanceDetailEntity.setIncomingWarehouseId(null);
trunklineAdvanceDetailEntity.setIncomingWarehouseName(null);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName());
if (basicdataWarehouseEntity != null) {
trunklineAdvanceDetailEntity.setWarehouseId(basicdataWarehouseEntity.getId());
trunklineAdvanceDetailEntity.setWarehouseName(basicdataWarehouseEntity.getName());
@ -346,8 +344,7 @@ public class AsyncServiceImpl implements IAsyncService {
}
private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, String mallName) {
Tenant tenant = changeDataBase(mallName);
private TrunklineAdvanceEntity saveTrunklineAdvanceEntity(TrunklineAdvanceEntity trunklineAdvanceEntity, Tenant tenant) {
// 查找商户的暂存单是否存在改制
QueryWrapper<TrunklineAdvanceEntity> queryWrapper = new QueryWrapper<>();
@ -355,7 +352,7 @@ public class AsyncServiceImpl implements IAsyncService {
queryWrapper.eq("waybill_no", trunklineAdvanceEntity.getWaybillNo())
.last("limit 1");
TrunklineAdvanceEntity trunklineAdvanceEntity1 = advanceService.getOne(queryWrapper);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(mallName);
BasicdataWarehouseEntity basicdataWarehouseEntity = getBasicdataWarehouseEntity(tenant.getTenantName());
if (ObjectUtil.isEmpty(trunklineAdvanceEntity1)) {
// 保存对象
if (basicdataWarehouseEntity != null) {

Loading…
Cancel
Save