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. 174
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java
  6. 28
      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. 6
      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()

174
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;
/**
* 司机信息表 服务实现类
*
@ -68,9 +63,9 @@ import static com.alibaba.fastjson.JSONPatch.OperationType.copy;
@Slf4j
public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataDriverArteryMapper, BasicdataDriverArteryEntity> implements IBasicdataDriverArteryService {
private final BasicdataVehicleMapper basicdataVehicleMapper;
private final BasicdataVehicleMapper basicdataVehicleMapper;
private final IBasicdataVehicleService basicdataVehicleService;
private final IBasicdataVehicleService basicdataVehicleService;
private final BasicdataDrivermiddleMapper basicdataDrivermiddleMapper;
@ -103,18 +98,18 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
public Integer updateVehicle(BasicdataDriverArteryDTO basicdataDriverArtery) {
//删除原有绑定关系
int delete = basicdataDrivermiddleMapper.delete(new QueryWrapper<BasicdataDrivermiddleEntity>().lambda().eq(BasicdataDrivermiddleEntity::getDriverId, basicdataDriverArtery.getId()));
if (basicdataDriverArtery.getBindVehicles().equals(""))return delete;
if (basicdataDriverArtery.getBindVehicles().equals("")) return delete;
//新增现有的数据
//if (delete>0){
List<String> bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindVehicles.forEach(e->{
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId());
basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
List<String> bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindVehicles.forEach(e -> {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId());
basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
//}
return delete;
}
@ -127,23 +122,23 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
@Override
public List<BasicdataDriverArteryVO> getDriverList() {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("################getDriverList 无当前登录人仓库信息:{}",myCurrentWarehouse);
if (Func.isEmpty(myCurrentWarehouse)) {
log.error("################getDriverList 无当前登录人仓库信息:{}", myCurrentWarehouse);
return null;
}
log.info("################ getDriverList 仓库信息:{}",myCurrentWarehouse);
log.info("################ getDriverList 仓库信息:{}", myCurrentWarehouse);
ArrayList<BasicdataDriverArteryVO> basicdataDriverArteryVOS = new ArrayList<>();
List<BasicdataDriverArteryEntity> list = this.list();
log.info("################getDriverList list:{}",list);
log.info("################getDriverList list:{}", list);
//Stream<BasicdataDriverArteryEntity> basicdataDriverArteryEntityStream = list.stream().filter(l -> l.getWarehouseId().contains(myCurrentWarehouse.getId().toString()));
Stream<BasicdataDriverArteryEntity> basicdataDriverArteryEntityStream = list.stream().filter(l -> Func.isNotEmpty(l.getWarehouseId()) && l.getWarehouseId().contains(myCurrentWarehouse.getId().toString()));
if (Func.isNotEmpty(basicdataDriverArteryEntityStream)){
basicdataDriverArteryEntityStream.forEach(l->{
if (Func.isNotEmpty(basicdataDriverArteryEntityStream)) {
basicdataDriverArteryEntityStream.forEach(l -> {
BasicdataDriverArteryVO driverArteryVO = Func.copy(l, BasicdataDriverArteryVO.class);
List<Long> vehicleIds = basicdataDrivermiddleService.list(Wrappers.<BasicdataDrivermiddleEntity>query().lambda()
.eq(BasicdataDrivermiddleEntity::getDriverId, l.getId())).stream().filter(f -> Func.isNotEmpty(f.getBrandId())).map(BasicdataDrivermiddleEntity::getBrandId).collect(Collectors.toList());
if (Func.isNotEmpty(vehicleIds)){
driverArteryVO.setVehicleVOList(basicdataVehicleService.list(Wrappers.<BasicdataVehicleEntity>query().lambda().in(BasicdataVehicleEntity::getId,vehicleIds)));
if (Func.isNotEmpty(vehicleIds)) {
driverArteryVO.setVehicleVOList(basicdataVehicleService.list(Wrappers.<BasicdataVehicleEntity>query().lambda().in(BasicdataVehicleEntity::getId, vehicleIds)));
}
basicdataDriverArteryVOS.add(driverArteryVO);
});
@ -157,89 +152,100 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
* @param data
*/
@Override
public void importDriverArtery(List<BasicdataDriverArteryImproterExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}",data);
@Transactional
public void importDriverArtery(List<BasicdataDriverArteryImproterExcel> data) {
log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}", data);
outerLoop:
for (BasicdataDriverArteryImproterExcel datum : data) {
List<BasicdataDrivermiddleEntity> driverMiddleEntity = new ArrayList<>();
//检查数据是否为空
if (ObjectUtils.isEmpty(datum.getPhone())|| ObjectUtils.isEmpty(datum.getName())|| ObjectUtils.isEmpty(datum.getWarehouseName())|| ObjectUtils.isEmpty(datum.getCarrierName())) {
try {
List<BasicdataDrivermiddleEntity> driverMiddleEntity = new ArrayList<>();
//检查数据是否为空
if (ObjectUtils.isEmpty(datum.getPhone()) || ObjectUtils.isEmpty(datum.getName()) || ObjectUtils.isEmpty(datum.getWarehouseName()) || ObjectUtils.isEmpty(datum.getCarrierName())) {
// log.error("必填数据不能为空");
// continue;
throw new ServiceException("用户"+datum.getName() +"必填数据不能为空!");
}
if(!ObjectUtils.isEmpty(datum.getPhone())){
R<User> userR = userClient.userInfoByPhone("627683", datum.getPhone());
if (userR.getData() == null){
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() +"未找到用户!");
}else {
datum.setUserId(userR.getData().getId());
throw new ServiceException("未找到用户!");
} else {
datum.setUserId(userR.getData().getId());
}
}
}
if (!ObjectUtils.isEmpty(datum.getBindVehicle())){
String[] car = datum.getBindVehicle().split(",");
for (String s : car) {
List<BasicdataVehicleEntity> carListByName = basicdataVehicleService.findCarListByName(s);
if (!ObjectUtils.isEmpty(datum.getBindVehicle())) {
String[] car = datum.getBindVehicle().split(",");
for (String s : car) {
List<BasicdataVehicleEntity> carListByName = basicdataVehicleService.findCarListByName(s);
if (carListByName.isEmpty()){
if (carListByName.isEmpty()) {
// log.error("未找到可绑定的车辆");
throw new ServiceException("用户"+datum.getName() +"未找到可绑定的车辆!");
}else{
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId());
driverMiddleEntity.add(basicdataDrivermiddleEntity);
throw new ServiceException("未找到可绑定的车辆!");
} else {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId());
driverMiddleEntity.add(basicdataDrivermiddleEntity);
}
}
}
}
if (!ObjectUtils.isEmpty(datum.getCarrierName())){
//找到数据库内的承运商
List<BasicdataCarrierEntity> basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.<BasicdataCarrierEntity>lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName,datum.getCarrierName()));
if (!ObjectUtils.isEmpty(datum.getCarrierName())) {
//找到数据库内的承运商
List<BasicdataCarrierEntity> basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.<BasicdataCarrierEntity>lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName, datum.getCarrierName()));
if (ObjectUtils.isEmpty(basicdataCarrierEntities)){
if (ObjectUtils.isEmpty(basicdataCarrierEntities)) {
// log.error("未找到承运商");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到承运商!");
}else{
datum.setCarrierId(basicdataCarrierEntities.get(0).getId());
throw new ServiceException("未找到承运商!");
} else {
datum.setCarrierId(basicdataCarrierEntities.get(0).getId());
}
}
}
if (!ObjectUtils.isEmpty(datum.getWarehouseName())){
//在数据库找到仓库名字对应
BasicdataWarehouseEntity byName = warehouseClient.findByName(datum.getWarehouseName());
if (ObjectUtils.isEmpty(byName)){
if (!ObjectUtils.isEmpty(datum.getWarehouseName())) {
//在数据库找到仓库名字对应
BasicdataWarehouseEntity byName = warehouseClient.findByName(datum.getWarehouseName());
if (ObjectUtils.isEmpty(byName)) {
// log.error("未找到仓库");
// continue;
throw new ServiceException("用户"+datum.getName() +"未找到仓库!");
}else{
datum.setWarehouseId(String.valueOf(byName.getId()));
throw new ServiceException("未找到仓库!");
} else {
datum.setWarehouseId(String.valueOf(byName.getId()));
}
}
}
//根据手机号去重 如果有手机号相同 就删除老数据
if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) {
List<BasicdataDriverArteryEntity> basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper<BasicdataDriverArteryEntity>().lambda()
.eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone()));
if (!basicdataVehicleEntities.isEmpty()){
basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone());
//根据手机号去重 如果有手机号相同 就删除老数据
if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) {
List<BasicdataDriverArteryEntity> basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper<BasicdataDriverArteryEntity>().lambda()
.eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone()));
if (!basicdataVehicleEntities.isEmpty()) {
basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone());
}
}
}
BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class);
//连接到前端后取消注释
BladeUser user = AuthUtil.getUser();
copy.setTenantId(user.getTenantId());// 租户号
copy.setUserId(user.getUserId()); // 创建人
copy.setUpdateUser(user.getUserId());// 更新人
log.info("复制后>>>>>>>>>>>>{}",copy);
BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class);
//连接到前端后取消注释
BladeUser user = AuthUtil.getUser();
copy.setTenantId(user.getTenantId());// 租户号
copy.setUserId(user.getUserId()); // 创建人
copy.setUpdateUser(user.getUserId());// 更新人
log.info("复制后>>>>>>>>>>>>{}", copy);
this.save(copy);
//车辆和司机绑定关系
for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) {
basicdataDrivermiddleEntity.setDriverId(copy.getId());
basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity);
for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) {
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());
}
}
}

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

@ -168,7 +168,7 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
// 最大的管理员
if(StringUtil.isBlank(user.getRoleId())){
if (StringUtil.isBlank(user.getRoleId())) {
return null;
}
@ -245,18 +245,26 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override
public BasicdataWarehouseEntity getMyCurrentWarehouse() {
// 根据当前登陆人的信息和角色判断查询是所属仓库 还是服务仓库
BladeUser user = AuthUtil.getUser();
String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));
if (StringUtil.isBlank(json)) {
List<BasicdataWarehouseEntity> myWarehouseList = getMyWarehouseList();
if (myWarehouseList != null) {
if (myWarehouseList.size() == 1) {
return myWarehouseList.get(0);
try {
BladeUser user = AuthUtil.getUser();
String json = redis.get(CacheNames.tenantKeyObj(user.getTenantId(), CacheNames.USER_WAREHOUSE_KEY, user.getUserId()));
if (StringUtil.isBlank(json)) {
List<BasicdataWarehouseEntity> myWarehouseList = getMyWarehouseList();
if (myWarehouseList != null) {
if (myWarehouseList.size() == 1) {
return myWarehouseList.get(0);
}
}
}
BasicdataWarehouseEntity o = JSONObject.parseObject(json, BasicdataWarehouseEntity.class);
return o;
} catch (Exception e) {
log.error(">>>>>> 获取仓库信息错误",e);
}
BasicdataWarehouseEntity o = JSONObject.parseObject(json, BasicdataWarehouseEntity.class);
return o;
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));

6
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());
inventoryNub.getAndAdd(reservationEntity.getReservationStockListNum());
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