Browse Source

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

dev
zhaoqiaobo 1 month ago
parent
commit
cabb6033df
  1. 5
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java
  2. 7
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java
  3. 18
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java
  4. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java
  5. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/IndexDTO.java
  6. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java
  7. 12
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  8. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java
  9. 81
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  10. 8
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderIncomeVO.java
  11. 5
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java
  12. 67
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java
  13. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  14. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java
  15. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java
  16. 313
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  17. 31
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  18. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  19. 26
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

5
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/StatisticsBalanceRecordDTO.java

@ -12,4 +12,9 @@ public class StatisticsBalanceRecordDTO extends StatisticsBalanceRecordEntity {
private List<StatisticsBalanceRecordPhotoEntity> recordPhotoEntityList = new ArrayList<>();
/**
* 结算单ID集合
*/
private List<Long> balanceOrderInfoIds;
}

7
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java

@ -1,9 +1,6 @@
package com.logpm.trunkline.vo;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity;
import com.logpm.trunkline.entity.*;
import lombok.Data;
import java.math.BigDecimal;
@ -58,4 +55,6 @@ public class TrunklineCarsLoadVO extends TrunklineCarsLoadEntity {
private Integer isStartPhoto;
private Integer isUnloadPhoto;
private List<TrunklineCarsLoadLinePhotoEntity> carsLoadLinePhotoEntities = new ArrayList<>();
}

18
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java

@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@ -71,6 +70,23 @@ public class WarehouseConfigEntity extends TenantEntity {
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 是否干线上传装车图片
*/
@ApiModelProperty(value = "是否干线上传装车图片")
private Integer isTrunklineLoadingPhoto;
/**
* 是否干线上传发车图片
*/
@ApiModelProperty(value = "是否干线上传发车图片")
private Integer isTrunklineStartPhoto;
/**
* 是否干线上传卸车图片
*/
@ApiModelProperty(value = "是否干线上传卸车图片")
private Integer isTrunklineUnloadPhoto;
}

4
blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java

@ -91,8 +91,8 @@ public class WarehouseIndexController {
List<Long> warehouseIds = warehouseClient.getWarehouseIds();
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = warehouseIndexService.openOrderIncome(indexDTO);
return R.data(indexOpenOrderIncomeVO);
List<IndexOpenOrderIncomeVO> indexOpenOrderIncomeVOs = warehouseIndexService.openOrderIncome(indexDTO);
return R.data(indexOpenOrderIncomeVOs);
} catch (CustomerException e) {
log.warn(e.message);
return R.fail(e.code, e.message);

2
blade-service/logpm-report/src/main/java/com/logpm/report/dto/IndexDTO.java

@ -10,6 +10,7 @@ import java.util.List;
public class IndexDTO implements Serializable {
private List<Long> warehouseIds;
private Long warehouseId;
private Date startDate;
private Date endDate;
private String dayStr;
@ -18,6 +19,7 @@ public class IndexDTO implements Serializable {
public String toString() {
return "IndexDTO{" +
"warehouseIds=" + warehouseIds +
", warehouseId=" + warehouseId +
", startDate=" + startDate +
", endDate=" + endDate +
", dayStr='" + dayStr + '\'' +

3
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java

@ -11,14 +11,13 @@ import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Mapper
public interface WarehouseIndexMapper {
IndexOpenItemDataVO findTotalNum(@Param("param") IndexDTO indexDTO);
BigDecimal findTotalFee(@Param("param") IndexDTO indexDTO);
BigDecimal findTotalFee(@Param("warehouseId") Long warehouseId);
JSONObject findFeeByDate(@Param("param") IndexDTO indexDTO);

12
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -24,10 +24,8 @@
select IFNULL(sum(IFNULL(x_pay,0)+IFNULL(d_pay,0)+IFNULL(y_pay,0)+IFNULL(h_pay,0)),0)
from logpm_warehouse_waybill
where 1=1
and destination_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and destination_warehouse_id = #{warehouseId}
</select>
<select id="findFeeByDate" resultType="com.alibaba.fastjson.JSONObject">
@ -45,10 +43,8 @@
<if test="param.endDate != null">
and create_time &lt;= #{param.endDate}
</if>
and destination_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and destination_warehouse_id = #{param.warehouseId}
</select>

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java

@ -11,7 +11,7 @@ import java.util.Map;
public interface IWarehouseIndexService {
IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO);
IndexOpenOrderIncomeVO openOrderIncome(IndexDTO indexDTO);
List<IndexOpenOrderIncomeVO> openOrderIncome(IndexDTO indexDTO);
IndexHandOrderDataVO handOrderData(IndexDTO indexDTO);

81
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -7,7 +7,6 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.report.dto.IndexDTO;
import com.logpm.report.mapper.WarehouseIndexMapper;
import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.typepage.TimeType;
import com.logpm.report.vo.*;
import com.logpm.report.vo.indexCount.IndexDeliveryDataVO;
import com.logpm.report.vo.indexCount.IndexOpenItemDataByWarWarehouseIdVO;
@ -15,19 +14,16 @@ import com.logpm.report.vo.indexCount.IndexOpenItemDataVO;
import com.logpm.report.vo.indexCount.IndexSignforDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.redis.cache.BladeRedis;
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.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -196,45 +192,48 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
}
@Override
public IndexOpenOrderIncomeVO openOrderIncome(IndexDTO indexDTO) {
//增加缓存
BladeUser user = AuthUtil.getUser();
String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "openOrderIncome" + ":" + indexDTO.toString());
IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = bladeRedis.get(key);
if (Objects.isNull(indexOpenOrderIncomeVO)) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
indexOpenOrderIncomeVO = new IndexOpenOrderIncomeVO();
if (warehouseIds.isEmpty()) {
return indexOpenOrderIncomeVO;
public List<IndexOpenOrderIncomeVO> openOrderIncome(IndexDTO indexDTO) {
List<IndexOpenOrderIncomeVO> data = new ArrayList<>();
for (Long warehouseId : indexDTO.getWarehouseIds()) {
String key = CacheNames.tenantKey(AuthUtil.getTenantId(), "openOrderIncome", "warehouseId:" + warehouseId);
// 查询每个仓库的数据
IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = bladeRedis.get(key);
if (Objects.isNull(indexOpenOrderIncomeVO)) {
indexOpenOrderIncomeVO = new IndexOpenOrderIncomeVO();
BigDecimal totalFee = warehouseIndexMapper.findTotalFee(warehouseId);
//总收入
indexOpenOrderIncomeVO.setTotalFee(totalFee);
//获取当天的开始时间
indexDTO.setStartDate(CommonUtil.getDayStart());
indexDTO.setEndDate(CommonUtil.getDayEnd());
indexDTO.setWarehouseId(warehouseId);
JSONObject incomeDay = warehouseIndexMapper.findFeeByDate(indexDTO);
indexOpenOrderIncomeVO.setDayFee(incomeDay.getBigDecimal("fee"));
indexOpenOrderIncomeVO.setDayBillladingFee(incomeDay.getBigDecimal("billladingFee"));
indexOpenOrderIncomeVO.setDayInstallFee(incomeDay.getBigDecimal("installFee"));
indexOpenOrderIncomeVO.setDayTrunklineFee(incomeDay.getBigDecimal("trunklineFee"));
indexOpenOrderIncomeVO.setDayWarehouseFee(incomeDay.getBigDecimal("warehouseFee"));
indexOpenOrderIncomeVO.setDayDistributionFee(incomeDay.getBigDecimal("distributionFee"));
//获取当月的开始时间
indexDTO.setStartDate(CommonUtil.getMonthDayStart());
indexDTO.setEndDate(CommonUtil.getMonthDayEnd());
JSONObject incomeMonth = warehouseIndexMapper.findFeeByDate(indexDTO);
indexOpenOrderIncomeVO.setMonthFee(incomeMonth.getBigDecimal("fee"));
indexOpenOrderIncomeVO.setMonthBillladingFee(incomeMonth.getBigDecimal("billladingFee"));
indexOpenOrderIncomeVO.setMonthInstallFee(incomeMonth.getBigDecimal("installFee"));
indexOpenOrderIncomeVO.setMonthTrunklineFee(incomeMonth.getBigDecimal("trunklineFee"));
indexOpenOrderIncomeVO.setMonthWarehouseFee(incomeMonth.getBigDecimal("warehouseFee"));
indexOpenOrderIncomeVO.setMonthDistributionFee(incomeMonth.getBigDecimal("distributionFee"));
indexOpenOrderIncomeVO.setWarehouseId(warehouseId);
indexOpenOrderIncomeVO.setWarehouseName(getCacheWarehouseName(warehouseId));
}
//总收入
indexOpenOrderIncomeVO.setTotalFee(warehouseIndexMapper.findTotalFee(indexDTO));
//获取当天的开始时间
indexDTO.setStartDate(CommonUtil.getDayStart());
indexDTO.setEndDate(CommonUtil.getDayEnd());
JSONObject incomeDay = warehouseIndexMapper.findFeeByDate(indexDTO);
indexOpenOrderIncomeVO.setDayFee(incomeDay.getBigDecimal("fee"));
indexOpenOrderIncomeVO.setDayBillladingFee(incomeDay.getBigDecimal("billladingFee"));
indexOpenOrderIncomeVO.setDayInstallFee(incomeDay.getBigDecimal("installFee"));
indexOpenOrderIncomeVO.setDayTrunklineFee(incomeDay.getBigDecimal("trunklineFee"));
indexOpenOrderIncomeVO.setDayWarehouseFee(incomeDay.getBigDecimal("warehouseFee"));
indexOpenOrderIncomeVO.setDayDistributionFee(incomeDay.getBigDecimal("distributionFee"));
//获取当月的开始时间
indexDTO.setStartDate(CommonUtil.getMonthDayStart());
indexDTO.setEndDate(CommonUtil.getMonthDayEnd());
JSONObject incomeMonth = warehouseIndexMapper.findFeeByDate(indexDTO);
indexOpenOrderIncomeVO.setMonthFee(incomeMonth.getBigDecimal("fee"));
indexOpenOrderIncomeVO.setMonthBillladingFee(incomeMonth.getBigDecimal("billladingFee"));
indexOpenOrderIncomeVO.setMonthInstallFee(incomeMonth.getBigDecimal("installFee"));
indexOpenOrderIncomeVO.setMonthTrunklineFee(incomeMonth.getBigDecimal("trunklineFee"));
indexOpenOrderIncomeVO.setMonthWarehouseFee(incomeMonth.getBigDecimal("warehouseFee"));
indexOpenOrderIncomeVO.setMonthDistributionFee(incomeMonth.getBigDecimal("distributionFee"));
bladeRedis.setEx(key, indexOpenOrderIncomeVO, 3600L);
data.add(indexOpenOrderIncomeVO);
}
return indexOpenOrderIncomeVO;
return data;
}
@Override

8
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderIncomeVO.java

@ -21,6 +21,14 @@ public class IndexOpenOrderIncomeVO implements Serializable {
private BigDecimal dayDistributionFee = BigDecimal.ZERO;
private BigDecimal dayBillladingFee = BigDecimal.ZERO;
private BigDecimal dayInstallFee = BigDecimal.ZERO;
/**
* 仓库名称
*/
private String warehouseName;
/**
* 仓库ID
*/
private Long warehouseId;
}

5
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java

@ -15,6 +15,7 @@ import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Objects;
@Slf4j
@ -190,8 +191,8 @@ public class MerchantBalanceController {
log.info(method+"请求参数{}",balanceRecordDTO);
try{
Long balanceOrderInfoId = balanceRecordDTO.getBalanceOrderInfoId();
if(Objects.isNull(balanceOrderInfoId)){
List<Long> balanceOrderInfoId = balanceRecordDTO.getBalanceOrderInfoIds();
if(Objects.isNull(balanceOrderInfoId) || balanceOrderInfoId.isEmpty()){
log.warn(method+"请选择正确的结算单 balanceOrderInfoId={}",balanceOrderInfoId);
return R.fail(405,"请选择正确的结算单");
}

67
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsBalanceOrderInfoServiceImpl.java

@ -288,41 +288,42 @@ public R findBalanceDetail(Long balanceOrderId) {
@Override
public R enterBalance(StatisticsBalanceRecordDTO balanceRecordDTO) {
Long balanceOrderInfoId = balanceRecordDTO.getBalanceOrderInfoId();
StatisticsBalanceOrderInfoEntity statisticsBalanceOrderInfoEntity = baseMapper.selectById(balanceOrderInfoId);
BigDecimal noBalanceFee = statisticsBalanceOrderInfoEntity.getNoBalanceFee();
if(noBalanceFee.compareTo(BigDecimal.ZERO) != 0){
log.warn("#############enterBalance: 结算金额不为0");
return R.fail(405, "结算金额不为0");
}
statisticsBalanceOrderInfoEntity.setBalanceStatus(2);
updateById(statisticsBalanceOrderInfoEntity);
// 更新运单状态
// 获取结算单对应的运单ID
LambdaQueryWrapper<StatisticsOrderInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StatisticsOrderInfoEntity::getBalanceOrderId, balanceOrderInfoId);
List<StatisticsOrderInfoEntity> list = statisticsOrderInfoService.list(queryWrapper);
List<Long> waybillIds = list.stream().map(StatisticsOrderInfoEntity::getWaybillId).collect(Collectors.toList());
// 更新运单的状态
List<WarehouseWaybillEntity> data = new ArrayList<>();
waybillIds.forEach(id ->{
WarehouseWaybillEntity t = new WarehouseWaybillEntity();
t.setId(id);
// t.setPayStatus("30");
t.setSettlementStatus("30");
data.add(t);
});
warehouseWaybillClient.updateList(data);
List<Long> balanceOrderInfoIds = balanceRecordDTO.getBalanceOrderInfoIds();
List<StatisticsBalanceOrderInfoEntity> statisticsBalanceOrderInfoEntitys = baseMapper.selectBatchIds(balanceOrderInfoIds);
for (StatisticsBalanceOrderInfoEntity statisticsBalanceOrderInfoEntity : statisticsBalanceOrderInfoEntitys) {
BigDecimal noBalanceFee = statisticsBalanceOrderInfoEntity.getNoBalanceFee();
if(noBalanceFee.compareTo(BigDecimal.ZERO) != 0){
log.warn("#############enterBalance: 结算金额不为0");
return R.fail(405, "待结算金额不为0");
}
if(statisticsBalanceOrderInfoEntity.getBalanceStatus().equals(2)){
log.warn("#############enterBalance: 结算单信息不存在 statisticsBalanceOrderInfoEntity={}", statisticsBalanceOrderInfoEntity);
return R.fail(405, statisticsBalanceOrderInfoEntity.getBalanceOrderNo()+"已结算");
}
statisticsBalanceOrderInfoEntity.setBalanceStatus(2);
updateById(statisticsBalanceOrderInfoEntity);
// 更新运单状态
// 获取结算单对应的运单ID
LambdaQueryWrapper<StatisticsOrderInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StatisticsOrderInfoEntity::getBalanceOrderId, statisticsBalanceOrderInfoEntity.getId());
List<StatisticsOrderInfoEntity> list = statisticsOrderInfoService.list(queryWrapper);
List<Long> waybillIds = list.stream().map(StatisticsOrderInfoEntity::getWaybillId).collect(Collectors.toList());
// 更新运单的状态
List<WarehouseWaybillEntity> data = new ArrayList<>();
waybillIds.forEach(id ->{
WarehouseWaybillEntity t = new WarehouseWaybillEntity();
t.setId(id);
t.setSettlementStatus("30");
data.add(t);
});
warehouseWaybillClient.updateList(data);
}
return R.success("结算成功");
}

9
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -278,7 +278,9 @@
lww.waybill_type type,
IFNULL( t.stock_num, 0 )-IFNULL( l.planNum,0) stockNum,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0) price,
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0)*(IFNULL( t.stock_num, 0 )-IFNULL( l.planNum,0)) freight
IFNULL(TRUNCATE(lww.total_freight/lww.total_count,4),0)*(IFNULL( t.stock_num, 0 )-IFNULL( l.planNum,0)) freight,
IF
( NOW() > DATE_ADD( t.entry_time_start, INTERVAL 48 HOUR ), 1, 0 ) AS isTimeOut
from (select ldpl.order_code,
ldpl.waybill_id,
ldpl.waybill_number,
@ -286,8 +288,7 @@
IF(ldsa.is_zero = 1,ldsa.hand_quantity,count(ldpl.id)) stock_num,
max(ldpl.warehouse_entry_time_end) entry_time_end,
min(ldpl.warehouse_entry_time_end) entry_time_start,
IF(ldsa.is_zero = 1,ldsa.trays,GROUP_CONCAT(DISTINCT ldpl.pallet)) tray_name,
if( NOW() > DATE_ADD(ldsa.warehouse_entry_time, INTERVAL 48 HOUR), 1,0) isTimeOut
IF(ldsa.is_zero = 1,ldsa.trays,GROUP_CONCAT(DISTINCT ldpl.pallet)) tray_name
from logpm_distribution_stock_article ldsa
left join logpm_distribution_parcel_list ldpl on ldsa.order_code = ldpl.order_code
where ldpl.is_deleted = 0
@ -387,7 +388,7 @@
and t.tray_name like concat('%',#{param.trayName},'%')
</if>
<if test=" param.isTimeOut != null ">
and (NOW() > DATE_ADD(ldsa.warehouse_entry_time, INTERVAL 48 HOUR))= ${param.isTimeOut}
and (NOW() > DATE_ADD(t.entry_time_start, INTERVAL 48 HOUR))= ${param.isTimeOut}
</if>
order by t.entry_time_end asc

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLinePhotoService.java

@ -9,4 +9,7 @@ public interface ITrunklineCarsLoadLinePhotoService extends BaseService<Trunklin
Integer findNumByLoadIdAndNodeIdAndTypeAndPosition(Long loadId, Long carsLoadLineId, Integer type, Integer position);
List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position);
List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdListAndWarehouseId(List<Long> idList, Long warehouseId);
}

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLinePhotoEntityServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.entity.TrunklineCarsLoadLinePhotoEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadLinePhotoMapper;
import com.logpm.trunkline.service.ITrunklineCarsLoadLinePhotoService;
@ -25,4 +26,13 @@ public class TrunklineCarsLoadLinePhotoEntityServiceImpl extends BaseServiceImpl
public List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdAndWarehouseId(Long loadId, Long warehouseId, Integer type, Integer position) {
return baseMapper.findListByLoadIdAndWarehouseId(loadId,warehouseId, type, position);
}
@Override
public List<TrunklineCarsLoadLinePhotoEntity> findListByLoadIdListAndWarehouseId(List<Long> idList, Long warehouseId) {
QueryWrapper<TrunklineCarsLoadLinePhotoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("load_id",idList)
.eq("warehouse_id",warehouseId);
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = baseMapper.selectList(queryWrapper);
return trunklineCarsLoadLinePhotoEntities;
}
}

313
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -45,14 +45,8 @@ import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.feign.*;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
import com.logpm.warehouse.vo.WaybillOrderTotalWeightAndVolumeVO;
import lombok.AllArgsConstructor;
@ -139,6 +133,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
private final IBasicdataTripartiteMallClient tripartiteMallClient;
private final IBasicMaterialClient basicMaterialClient;
private final IBasicdataBrandClient basicdataBrandClient;
private final IWarehouseConfigClient warehouseConfigClient;
@Override
@ -267,6 +262,20 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// throw new CustomerException(400, "节点还未上传发车前图片");
// }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineStartPhoto = warehouseConfig.getIsTrunklineStartPhoto();
if(NumberUtil.equals(isTrunklineStartPhoto,1)){
//限制装车之前上传图片
Integer isStartPhoto = currentCarsLoadLineEntity.getIsStartPhoto();
if(NumberUtil.equals(isStartPhoto,0)){
log.warn("##############startCarByLoadId: 节点还未上传发车前图片 isStartPhoto={}", isStartPhoto);
throw new CustomerException(405, "节点还未上传发车前图片");
}
}
}
if (StringUtil.isNotBlank(fullLoadRate)) {
carsLoadEntity.setFullLoadRate(new BigDecimal(fullLoadRate));
}
@ -2307,174 +2316,44 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
public R findLinePhoto(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
List<Map<String, Object>> resultList = new ArrayList<>();
List<TrunklineCarsLoadLinePhotoEntity> linePhotoEntityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, null, null, null);
//把linePhotoEntityList中所有元素的loadLineId放入一个Set集合
Set<Long> loadLineIdSet = linePhotoEntityList.stream().map(TrunklineCarsLoadLinePhotoEntity::getLoadLineId).collect(Collectors.toSet());
if(CollUtil.isNotEmpty(loadLineIdSet)){
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id",loadLineIdSet);
List<TrunklineCarsLoadLineEntity> carsLoadLineList = trunklineCarsLoadLineService.list(queryWrapper);
//把carsLoadLineList转化为以id为key的map
Map<Long, TrunklineCarsLoadLineEntity> carsLoadLineMap = carsLoadLineList.stream().collect(Collectors.toMap(TrunklineCarsLoadLineEntity::getId, Function.identity()));
//把linePhotoEntityList中所有元素以loadLineId进行分组
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId));
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId));
List<TrunklineCarsLoadLineEntity> loadLineEntityList = trunklineCarsLoadLineService.findListByLoadId(loadId);
List<Map<String, Object>> resultList = new ArrayList<>();
linePhotoMap.keySet().forEach(loadLineId -> {
Map<String,Object> map = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId);
TrunklineCarsLoadLineEntity trunklineCarsLoadLineEntity = carsLoadLineMap.get(loadLineId);
map.put("carsLoadLineEntity",trunklineCarsLoadLineEntity);
Map<String,Object> loadingMap = new HashMap<>();
//把trunklineCarsLoadLinePhotoEntities通过type=10进行过滤
List<TrunklineCarsLoadLinePhotoEntity> ls = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(10)).collect(Collectors.toList());
//把qualityList通过position进行分组
// List<TrunklineCarsLoadLinePhotoEntity> listQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> listHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> listZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> listYou = new ArrayList<>();
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> listMap = ls.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// listMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = listMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// listQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// listHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// listZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// listYou.addAll(list);
// }
// });
//
// loadingMap.put("listQian",listQian);
// loadingMap.put("listHou",listHou);
// loadingMap.put("listZuo",listZuo);
// loadingMap.put("listYou",listYou);
// Map<String,Object> loadingObject = new HashMap<>();
// loadingObject.put("loadingList",ls);
map.put("loadingObject",ls);
//发车
// Map<String,Object> qualityMap = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> qualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(20)).collect(Collectors.toList());
//把qualityList通过position进行分组
// List<TrunklineCarsLoadLinePhotoEntity> qualityListQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> qualityListHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> qualityListZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> qualityListYou = new ArrayList<>();
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> qualityListMap = qualityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// qualityListMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = qualityListMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// qualityListQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// qualityListHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// qualityListZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// qualityListYou.addAll(list);
// }
// });
//
// qualityMap.put("qualityListQian",qualityListQian);
// qualityMap.put("qualityListHou",qualityListHou);
// qualityMap.put("qualityListZuo",qualityListZuo);
// qualityMap.put("qualityListYou",qualityListYou);
// Map<String,Object> yubuMap = new HashMap<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> yubuListYou = new ArrayList<>();
List<TrunklineCarsLoadLinePhotoEntity> yubuList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(21)).collect(Collectors.toList());
//把qualityList通过position进行分组
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> yubuListMap = yubuList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// yubuListMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = yubuListMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// yubuListQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// yubuListHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// yubuListZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// yubuListYou.addAll(list);
// }
// });
//
// yubuMap.put("yubuListQian",yubuListQian);
// yubuMap.put("yubuListHou",yubuListHou);
// yubuMap.put("yubuListZuo",yubuListZuo);
// yubuMap.put("yubuListYou",yubuListYou);
// Map<String,Object> startObject = new HashMap<>();
// startObject.put("qualityList",qualityList);
// startObject.put("yubuList",yubuList);
map.put("startObject",qualityList.addAll(yubuList));
//卸车
Map<String,Object> unloadQualityMap = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> unloadQualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(30)).collect(Collectors.toList());
//把qualityList通过position进行分组
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListQian = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListHou = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListZuo = new ArrayList<>();
// List<TrunklineCarsLoadLinePhotoEntity> unloadQualityListYou = new ArrayList<>();
// Map<Integer, List<TrunklineCarsLoadLinePhotoEntity>> unloadQualityListMap = unloadQualityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getPosition));
// qualityListMap.keySet().forEach(key -> {
// List<TrunklineCarsLoadLinePhotoEntity> list = unloadQualityListMap.get(key);
// if(NumberUtil.equals(1,key)){//后
// unloadQualityListQian.addAll(list);
// }else if(NumberUtil.equals(2,key)){//后
// unloadQualityListHou.addAll(list);
// }else if(NumberUtil.equals(3,key)){
// unloadQualityListZuo.addAll(list);
// }else if(NumberUtil.equals(4,key)){
// unloadQualityListYou.addAll(list);
// }
// });
//
// unloadQualityMap.put("unloadQualityListQian",unloadQualityListQian);
// unloadQualityMap.put("unloadQualityListHou",unloadQualityListHou);
// unloadQualityMap.put("unloadQualityListZuo",unloadQualityListZuo);
// unloadQualityMap.put("unloadQualityListYou",unloadQualityListYou);
// Map<String,Object> protectionMap = new HashMap<>();
List<TrunklineCarsLoadLinePhotoEntity> protectionList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(31)).collect(Collectors.toList());
if(CollUtil.isNotEmpty(loadLineEntityList)){
// protectionMap.put("protectionList",protectionList);
loadLineEntityList.forEach(loadLineEntity -> {
Long loadLineId = loadLineEntity.getId();
// Map<String,Object> unloadObject = new HashMap<>();
// unloadObject.put("unloadQualityList",unloadQualityList);
// unloadObject.put("protectionList",protectionList);
Map<String,Object> map = new HashMap<>();
map.put("carsLoadLineEntity",loadLineEntity);
map.put("unloadObject",unloadQualityList.addAll(protectionList));
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId);
if(CollUtil.isNotEmpty(trunklineCarsLoadLinePhotoEntities)){
List<TrunklineCarsLoadLinePhotoEntity> ls = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(10)).collect(Collectors.toList());
map.put("loadingObject",ls);
List<TrunklineCarsLoadLinePhotoEntity> qualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(20)).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> yubuList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(21)).collect(Collectors.toList());
qualityList.addAll(yubuList);
map.put("startObject",qualityList);
List<TrunklineCarsLoadLinePhotoEntity> unloadQualityList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(30)).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> protectionList = trunklineCarsLoadLinePhotoEntities.stream().filter(item -> item.getType().equals(31)).collect(Collectors.toList());
unloadQualityList.addAll(protectionList);
map.put("unloadObject",unloadQualityList);
}
resultList.add(map);
});
}
}
return R.data(resultList);
}
@ -3560,6 +3439,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// return R.fail(405, "当前节点还未上传装车前照片");
// }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = carsLoadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############loadingScan: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("##################loadingScan: 仓库信息不存在 warehouseId={}", warehouseId);
@ -3942,6 +3834,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// return R.fail(405, "当前节点还未上传装车前照片");
// }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = carsLoadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############loadingZero: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
Long trayId = null;
String trayName = null;
if (!StringUtil.isBlank(trayCode)) {
@ -4304,6 +4209,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
page.setCurrent(loadCarsDTO.getPageNum());
page.setSize(loadCarsDTO.getPageSize());
Integer type = loadCarsDTO.getType();
Long warehouseId = loadCarsDTO.getWarehouseId();
Date start = CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate());
Date end = CommonUtil.getEndByDateStr(loadCarsDTO.getEndDate());
@ -4312,6 +4218,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<TrunklineCarsLoadVO> pageList = baseMapper.carsLoadPageList(page, loadCarsDTO);
List<TrunklineCarsLoadVO> records = pageList.getRecords();
//把records中所有元素的id放入一个List
List<Long> idList = records.stream().map(TrunklineCarsLoadVO::getId).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> carsLoadLinePhotoEntities = carsLoadLinePhotoService.findListByLoadIdListAndWarehouseId(idList,warehouseId);
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> map = new HashMap<>();
if(CollUtil.isNotEmpty(carsLoadLinePhotoEntities)){
//把carsLoadLinePhotoEntities中所有元素通过loadId进行分组
map = carsLoadLinePhotoEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadId));
}
//循环records,获取字典值
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) {
String loadStatus = trunklineCarsLoadVO.getLoadStatus();
@ -4321,6 +4236,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer stockCarsNum = trunklineCarsLoadVO.getStockNumber();
trunklineCarsLoadVO.setRealLoadingNumber(stockCarsNum);
trunklineCarsLoadVO.setLoadStatus(value);
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = map.get(trunklineCarsLoadVO.getId());
trunklineCarsLoadVO.setCarsLoadLinePhotoEntities(trunklineCarsLoadLinePhotoEntities);
}
pageList.setRecords(records);
return R.data(pageList);
@ -7405,6 +7323,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "当前网点已经卸车确认");
}
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineUnloadPhoto = warehouseConfig.getIsTrunklineUnloadPhoto();
if(NumberUtil.equals(isTrunklineUnloadPhoto,1)){
//限制装车之前上传图片
Integer isUnloadPhoto = loadLineEntity.getIsUnloadPhoto();
if(NumberUtil.equals(isUnloadPhoto,0)){
log.warn("##############batchUnload: 节点还未上传卸车前图片 isUnloadPhoto={}", isUnloadPhoto);
return R.fail(405, "节点还未上传卸车前图片");
}
}
}
// Long nowWarehouseId = carsLoadEntity.getNowWarehouseId();
// if (!warehouseId.equals(nowWarehouseId)) {
// log.warn("############batchUnload: 当前节点还未到车 loadId={} warehouseId={}", loadId, warehouseId);
@ -9069,12 +9002,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划节点信息不存在");
}
//限制装车之前上传图片
// Integer isLoadingPhoto = loadLineEntity.getIsLoadingPhoto();
// if(NumberUtil.equals(isLoadingPhoto,0)){
// log.warn("##############manualLoading: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
// return R.fail(405, "当前节点还未上传装车前照片");
// }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = loadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############manualLoading: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
String tenantId = AuthUtil.getTenantId();
Long userId = AuthUtil.getUserId();
@ -10609,6 +10548,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// return R.fail(405, "当前节点还未上传装车前照片");
// }
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineLoadingPhoto = warehouseConfig.getIsTrunklineLoadingPhoto();
if(NumberUtil.equals(isTrunklineLoadingPhoto,1)){
//限制装车之前上传图片
Integer isLoadingPhoto = carsLoadLineEntity.getIsLoadingPhoto();
if(NumberUtil.equals(isLoadingPhoto,0)){
log.warn("##############loadingTray: 当前节点还未上传装车前照片 isLoadingPhoto={}", isLoadingPhoto);
return R.fail(405, "当前节点还未上传装车前照片");
}
}
}
Integer pacakagNum = 0;
Integer zeroNum = 0;
@ -11308,6 +11260,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<TrunklineCarsLoadVO> pageList = baseMapper.arriveUnloadPageList(page, loadCarsDTO);
List<TrunklineCarsLoadVO> records = pageList.getRecords();
//把records中所有元素的id放入一个List
List<Long> idList = records.stream().map(TrunklineCarsLoadVO::getId).collect(Collectors.toList());
List<TrunklineCarsLoadLinePhotoEntity> carsLoadLinePhotoEntities = carsLoadLinePhotoService.findListByLoadIdListAndWarehouseId(idList,warehouseId);
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> map = new HashMap<>();
if(CollUtil.isNotEmpty(carsLoadLinePhotoEntities)){
//把carsLoadLinePhotoEntities中所有元素通过loadId进行分组
map = carsLoadLinePhotoEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadId));
}
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) {
Long loadId = trunklineCarsLoadVO.getId();
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId);
@ -11338,6 +11299,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer stockCarNumber = trunklineCarsLoadVO.getStockNumber();
trunklineCarsLoadVO.setRealLoadingNumber(stockCarNumber);
trunklineCarsLoadVO.setTotalLoadingNum(realLoadingNumber);
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = map.get(loadId);
trunklineCarsLoadVO.setCarsLoadLinePhotoEntities(trunklineCarsLoadLinePhotoEntities);
}
pageList.setRecords(records);
return R.data(pageList);
@ -11510,6 +11474,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("############unloadPackage: 配载计划节点信息不存在 loadId={} warehouseId={}", loadId, warehouseId);
return R.fail(405, "配载计划节点信息不存在");
}
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(warehouseId);
if(!Objects.isNull(warehouseConfig)){
Integer isTrunklineUnloadPhoto = warehouseConfig.getIsTrunklineUnloadPhoto();
if(NumberUtil.equals(isTrunklineUnloadPhoto,1)){
//限制装车之前上传图片
Integer isUnloadPhoto = carsLoadLineEntity.getIsUnloadPhoto();
if(NumberUtil.equals(isUnloadPhoto,0)){
log.warn("##############unloadPackage: 节点还未上传卸车前图片 isUnloadPhoto={}", isUnloadPhoto);
return R.fail(405, "节点还未上传卸车前图片");
}
}
}
String unloadStatus = carsLoadLineEntity.getUnloadStatus();
Integer unloadNumber = carsLoadLineEntity.getUnloadNumber();
if (!"0".equals(unloadStatus)) {

31
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java

@ -83,6 +83,37 @@ public class WarehouseTrayTypeApiController {
}
}
@ResponseBody
@PostMapping("/createTray")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "创建托盘", notes = "传入trayTypeDTO")
public R createTray(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########orderScanTrayCode: ";
log.info(method+"订单扫码托盘 trayTypeDTO={}",trayTypeDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
BasicdataTrayEntity trayEntity = warehouseTrayTypeService.createTray(myCurrentWarehouse.getId(),myCurrentWarehouse.getWarehouseCode());
return R.data(trayEntity);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
/**
* 公用的扫托盘方法
* @param trayTypeDTO

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -2,6 +2,7 @@ package com.logpm.warehouse.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.warehouse.dto.DownPackageCodeDTO;
import com.logpm.warehouse.dto.NoDataStockListDTO;
@ -125,4 +126,6 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R findPackageTrayInfo(String orderPackageCode, Long warehouseId);
R downPackageCodes(List<DownPackageCodeDTO> downPackageCodeDTOS, Long warehouseId);
BasicdataTrayEntity createTray(Long warehouseId, String warehouseCode);
}

26
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -39,10 +39,7 @@ import com.logpm.warehouse.service.*;
import com.logpm.warehouse.vo.*;
import com.logpm.warehouse.wrapper.WarehouseTrayTypeWrapper;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.*;
import org.springblade.common.constant.apiwarehouse.PalletProductTypeConstant;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.order.OrderFreezeStatusConstant;
@ -141,6 +138,8 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
private IWarehousePackageTrackLogService warehousePackageTrackLogService;
@Autowired
private IBasicdataBrandClient basicdataBrandClient;
@Autowired
private IBasicdataCodeClient iBasicdataCodeClient;
@Override
@ -1040,6 +1039,25 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
return R.success("解绑成功");
}
@Override
public BasicdataTrayEntity createTray(Long warehouseId, String warehouseCode) {
BasicdataTrayEntity basicdataTrayEntity = new BasicdataTrayEntity();
String trayInfo = iBasicdataCodeClient.getCodeByType(CodeNumConstant.TRAYS,warehouseCode,"465897");
String[] split = trayInfo.split("&&");
basicdataTrayEntity.setReserve1("1");
basicdataTrayEntity.setPalletCode(split[0]);
basicdataTrayEntity.setPalletName(split[1]);
basicdataTrayEntity.setWarehouseId(warehouseId);
basicdataTrayEntity.setTrayStatus("1");
basicdataTrayEntity.setType(1);
Long newTrayId = basicdataTrayClient.addTray(basicdataTrayEntity);
basicdataTrayEntity.setId(newTrayId);
return basicdataTrayEntity;
}
@Override
public R orderScanOrderPackageCodeSyncJd(Long trayId,String trayType, String trayCode,String trayName, String orderPackageCode, Long warehouseId) {

Loading…
Cancel
Save