Browse Source

Merge remote-tracking branch 'origin/dev' into dev

single_db
caoyizhong 1 year ago
parent
commit
641c78d990
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java
  2. 8
      blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java
  3. 2
      blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java
  4. 2
      blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java
  5. 28
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java
  6. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  7. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  8. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  9. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  10. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  11. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/StockupStateUpdateHandler.java
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  13. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  14. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  15. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  16. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java
  17. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.xml

2
blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java

@ -67,7 +67,7 @@ public interface LauncherConstant {
/**
* sentinel prod 地址
*/
String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
String SENTINEL_PROD_ADDR = "172.16.128.145:8858";
/**
* sentinel test 地址

8
blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java

@ -41,10 +41,10 @@ public class LauncherServiceImpl implements LauncherService {
PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile));
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos");
// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123");
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos");
// PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos");
PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123");
PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile));

2
blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java

@ -199,6 +199,8 @@ public class FileUtil extends TimerTask {
while ((n = in.read(buff)) >= 0) {
out.write(buff, 0, n);
}
out.close();
in.close();
}

2
blade-service/logpm-basic/src/main/java/com/logpm/basic/service/impl/BasicMaterialServiceImpl.java

@ -72,9 +72,11 @@ public class BasicMaterialServiceImpl extends BaseServiceImpl<BasicMaterialMappe
@Override
@Transactional(rollbackFor = Exception.class)
public void importMaterial(List<BasicMaterialExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}",data);
ArrayList<BasicMaterialEntity> arrayList = new ArrayList<>();
for (BasicMaterialExcel datum : data) {
if(ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getProductCode())){
//去重
List<BasicMaterialEntity> basicMaterialEntities = baseMapper.selectList(new QueryWrapper<BasicMaterialEntity>().lambda()

28
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java

@ -34,29 +34,24 @@ import com.logpm.basicdata.service.IBasicdataVehicleService;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.driver.DriverTypeStatusConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springblade.system.feign.IUserSearchClient;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.alibaba.fastjson.JSONPatch.OperationType.copy;
/**
* 司机信息表 服务实现类
*
@ -157,10 +152,13 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
* @param data
*/
@Override
@Transactional
public void importDriverArtery(List<BasicdataDriverArteryImproterExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}", data);
outerLoop:
for (BasicdataDriverArteryImproterExcel datum : data) {
try {
List<BasicdataDrivermiddleEntity> driverMiddleEntity = new ArrayList<>();
//检查数据是否为空
@ -168,14 +166,14 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
// log.error("必填数据不能为空");
// continue;
throw new ServiceException("用户"+datum.getName() +"必填数据不能为空!");
throw new ServiceException("必填数据不能为空!");
}
if (!ObjectUtils.isEmpty(datum.getPhone())) {
R<User> userR = userClient.userInfoByPhone("627683", datum.getPhone());
if (userR.getData() == null) {
// log.error("未找到用户");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到用户!");
throw new ServiceException("未找到用户!");
} else {
datum.setUserId(userR.getData().getId());
}
@ -187,7 +185,7 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
if (carListByName.isEmpty()) {
// log.error("未找到可绑定的车辆");
throw new ServiceException("用户"+datum.getName() +"未找到可绑定的车辆!");
throw new ServiceException("未找到可绑定的车辆!");
} else {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId());
@ -202,7 +200,7 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
if (ObjectUtils.isEmpty(basicdataCarrierEntities)) {
// log.error("未找到承运商");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到承运商!");
throw new ServiceException("未找到承运商!");
} else {
datum.setCarrierId(basicdataCarrierEntities.get(0).getId());
}
@ -213,7 +211,7 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
if (ObjectUtils.isEmpty(byName)) {
// log.error("未找到仓库");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到仓库!");
throw new ServiceException("未找到仓库!");
} else {
datum.setWarehouseId(String.valueOf(byName.getId()));
}
@ -240,6 +238,14 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
basicdataDrivermiddleEntity.setDriverId(copy.getId());
basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity);
}
} catch (DataAccessException e) {
throw new ServiceException("用户" + datum.getName() + "数据长度异常");
} catch (ServiceException e) {
throw new ServiceException("用户" + datum.getName() + e.getMessage());
} catch (Exception e) {
throw new RuntimeException("用户" + datum.getName() + "数据错误" + e.getMessage());
}
}
}

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

@ -245,6 +245,7 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override
public BasicdataWarehouseEntity getMyCurrentWarehouse() {
// 根据当前登陆人的信息和角色判断查询是所属仓库 还是服务仓库
try {
BladeUser user = AuthUtil.getUser();
String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));
if (StringUtil.isBlank(json)) {
@ -257,6 +258,13 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
}
BasicdataWarehouseEntity o = JSONObject.parseObject(json, BasicdataWarehouseEntity.class);
return o;
} catch (Exception e) {
log.error(">>>>>> 获取仓库信息错误",e);
}
return null;
}
@Override

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -65,6 +65,7 @@ import org.springblade.common.constant.reservation.ReservationPackageStatusConst
import org.springblade.common.constant.reservation.ReservationSigningStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.exception.ServiceException;
@ -1505,6 +1506,8 @@ public class DistributionStockupAppController extends BladeController {
*/
@NotNull
private R stockupScanByCustom(StockupDTO stockupDTO) {
//包件扫描
String orderCode = stockupDTO.getOrderCode();//订单自编号
String packetBarCode = stockupDTO.getPacketBarCode();//包件码
@ -1589,9 +1592,16 @@ public class DistributionStockupAppController extends BladeController {
map.put("logId", entity.getId());
map.put("messageData", entity);
map.put("createTime", new Date().getTime());
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
log.info(">>>> find bug myCurrentWarehouse {}",myCurrentWarehouse);
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
//将消息携带绑定键值
rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map);
//查询是否货位数据是否该下架
Map<String, Object> mapState = new HashMap<>();
mapState.put("messageId", CommonUtil.getUUID());
@ -1601,6 +1611,7 @@ public class DistributionStockupAppController extends BladeController {
mapState.put("reservationId", stockupDTO.getReservationId());
mapState.put("logId", entity.getId());
mapState.put("messageData", entity);
mapState.put("warehouseId",myCurrentWarehouse.getId());
mapState.put("createTime", new Date().getTime());

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -465,7 +465,6 @@
INNER JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id
INNER JOIN logpm_distribution_reservation AS ldr ON ldr.id = lds.reservation_id
<where>
ldr.reservation_status != '40'
<if test="id!='' and id != null">
and lddl.id = #{id}
</if>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java

@ -301,4 +301,12 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @return
*/
DistributionSignforEntity getByReservationId(@Param("reservationId") Long id);
/**
* 查询配送任务下任务
* @param id
* @param k
* @return
*/
DistributionSignforEntity selectByDeliveryIdAndMallName(@Param("reservationId")Long deliveryId,@Param("mallName") String mallName);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -1226,4 +1226,8 @@
<select id="getByReservationId" resultType="com.logpm.distribution.entity.DistributionSignforEntity">
SELECT * FROM logpm_distribution_signfor WHERE reservation_id = #{reservationId}
</select>
<select id="selectByDeliveryIdAndMallName"
resultType="com.logpm.distribution.entity.DistributionSignforEntity">
SELECT * FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id WHERE lds.delivery_id = #{deliveryId} AND ldr.mall_mame = #{mallName}
</select>
</mapper>

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

@ -40,6 +40,7 @@ public class StockupStateUpdateHandler {
messageData.setStockupId((Long) map.get("stockupId"));
messageData.setTypeService(String.valueOf( map.get("typeService")));
messageData.setReservationId((Long) map.get("reservationId"));
messageData.setWarehouseId((Long)map.get("warehouseId"));
//查询是否货位数据是否该下架
distributionAsyncService.stockupSelfOffShelf(messageData);
log.info("######STOCKUP_STATE_UPDATE_QUEUE:备货下架查询成功");

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -155,7 +155,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
List<DisStockListDetailVO> selectDistributionAppDeliverywrapIn( DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
/**
* 修改配送任务
* 修改商配配送任务
* @param deliveryListDTO
* @return
*/

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -643,11 +643,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
*/
@Override
public void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
log.info(">>>> find bug {}",myCurrentWarehouse);
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
//判断类型
List<DistributionStockupSelfVO> distributionStockupSelfVO = new ArrayList<>();
@ -656,7 +652,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
distributionStockupSelfVO = distributionStockupMapper.stockupSelfOffShelf(stockupDTO);
} else {
//商 市
log.info(">>>> find bug {}",stockupDTO);
log.info(">>>> find bug stockupDTO {}",stockupDTO);
distributionStockupSelfVO = distributionStockupMapper.stockupOffShelf(stockupDTO);
}
//有
@ -678,7 +674,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
if (a.get() == b.get()) {
//下架
list.forEach(i -> {
warehouseUpdownTypeClient.downPackage(i, myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downPackage(i, stockupDTO.getWarehouseId());
});
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -2964,9 +2964,20 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
stockupInfoEntity.setStockUpType("1");
distributionStockupInfoService.save(stockupInfoEntity);
} else {
//根据配送计划和运单号查询出该预约
// DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomer(deliveryListEntityId, k);
DistributionReservationEntity reservationEntity = baseMapper.selectReservationByDeliveryListIdAndCustomerUnit(deliveryListEntityId, k);
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getReservationId, reservationEntity.getId())
.eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId())
);
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId());
throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单");
}
//查询出该预约下的订单信息
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleMapper.selectList(Wrappers.<DistributionReservationStockarticleEntity>query().lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()).ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
Map<Long, List<DistributionReservationStockarticleEntity>> oldOrder = reservationStockarticleEntityList.stream().collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getStockArticleId));

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -2317,7 +2317,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
reservationEntity.setReservationNum(packageTotal.get());
this.updateById(reservationEntity);
deliveryPackageTotal.getAndAdd(reservationEntity.getReservationNum());
if (Func.isNotEmpty(reservationEntity.getReservationStockListNum())){
inventoryNub.getAndAdd(reservationEntity.getReservationStockListNum());
}
DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
distributionSignforEntity.setReservationId(reservationEntity.getId());
distributionSignforEntity.setTrainNumber(trainNumberMa);
@ -3586,6 +3588,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
String[] split = distributionCancelReservationPackageDTO.getPackageIds().split(",");
List<DistributionParcelListEntity> distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionCancelReservationPackageDTO.getReservationId());
String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(","));
for (String s : split) {
if (Func.isNotEmpty(distributionParcelListEntities)){
List<DistributionParcelListEntity> cancelPackage = distributionParcelListEntities.stream().filter(p -> p.getId().equals(Long.parseLong(s))).collect(Collectors.toList());
@ -3617,6 +3620,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
}
}
}
distributionStockArticleService.maintenanceOrderInfo(orderCodes,myCurrentWarehouse.getId());
//维护预约单状态
this.maintenanceReservationInfo(distributionCancelReservationPackageDTO.getReservationId());
//维护预约单数量

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/DistributionDatarepair.java

@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
public class DistributionDatarepair {
private final ISyncDistributionParcelListService distributionParcelListService;
// private final ISyncDistributionParcelListService distributionParcelListService;
/**
* 预约状态修复
* @param param

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/SyncServiceTypeMapper.xml

@ -12,7 +12,7 @@
ldsa.mall_name = COALESCE(lbc.client_name, ldsa.mall_name),
ldsa.type_service = COALESCE(lbsb.type_service, ldsa.type_service),
ldsa.consignee_unit = #{mallName}
WHERE ldsa.id = #{stockArticleId};
WHERE ldsa.id = #{stockArticleId} and ldsa.is_deleted = 0;
</update>
<update id="syncServiceTypeByWarehouseName">

Loading…
Cancel
Save