Browse Source

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

visual
pref_mail@163.com 3 months ago
parent
commit
ae27ceafec
  1. 3
      blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java
  2. 18
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java
  3. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java
  4. 33
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java
  5. 351
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml
  6. 128
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  8. 81
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  9. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  10. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportDeliveryController.java
  11. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapeer.java
  12. 66
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapper.xml
  13. 43
      blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryDetailV2Reader.java
  14. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IAsyncService.java
  15. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java
  16. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/AsyncServiceImpl.java
  17. 27
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java
  18. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml
  19. 35
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

3
blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java

@ -93,6 +93,9 @@ public class OldSystemDataPushConfig {
//茂名仓
warehourseIds.add("152");
//兴义仓
warehourseIds.add("155");
}

18
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java

@ -221,4 +221,22 @@ public class BasicdataDriverArteryEntity extends TenantEntity {
@ApiModelProperty(value = "仓库名称")
private String warehouseName;
/**
* 结算渠道
*/
@ApiModelProperty(value = "结算渠道 1-微信 2-支付宝 3-银行卡 4-现金")
private Integer settlementChannel ;
/**
* 结算渠道
*/
@ApiModelProperty(value = "结算账号")
private String settlementAccount ;
/**
* 合同
*/
@ApiModelProperty(value = "合同")
private String contract;
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java

@ -32,7 +32,11 @@ import lombok.EqualsAndHashCode;
public class BasicdataVehicleDTO extends BasicdataVehicleEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "车辆所属")
private String vehicleOwners;
/**
* 页面类型 0-全部 1-保险临期 2-保险到期 3-年审临期 4-年审到期
*/
private Integer pageType;
}

33
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java

@ -70,4 +70,37 @@ public interface BasicdataVehicleMapper extends BaseMapper<BasicdataVehicleEntit
* @return
*/
BasicdataVehicleVO getVehicleDetail(@Param("id")Long id);
/**
* 保险临期车辆
* @param page
* @param basicdataVehicle
* @return
*/
IPage<BasicdataVehicleVO> selectInsuranceDeadlineBasicdataVehiclePage(IPage<BasicdataVehicleVO> page,@Param("param") BasicdataVehicleDTO basicdataVehicle);
/**
* 保险到期
* @param page
* @param basicdataVehicle
* @return
*/
IPage<BasicdataVehicleVO> selectInsuranceExpireBasicdataVehiclePage(IPage<BasicdataVehicleVO> page,@Param("param") BasicdataVehicleDTO basicdataVehicle);
/**
* 年审临期
* @param page
* @param basicdataVehicle
* @return
*/
IPage<BasicdataVehicleVO> selectAnnualDeadlineBasicdataVehiclePage(IPage<BasicdataVehicleVO> page,@Param("param") BasicdataVehicleDTO basicdataVehicle);
/**
* 年审到期
* @param page
* @param basicdataVehicle
* @return
*/
IPage<BasicdataVehicleVO> selectAnnualExpireBasicdataVehiclePage(IPage<BasicdataVehicleVO> page,@Param("param") BasicdataVehicleDTO basicdataVehicle);
}

351
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml

@ -331,6 +331,357 @@
lbv.id = #{id}
AND is_deleted = 0
</select>
<select id="selectInsuranceDeadlineBasicdataVehiclePage"
resultType="com.logpm.basicdata.vo.BasicdataVehicleVO">
SELECT
lbv.id id,
lbv.tenant_id tenantId,
lbv.create_user createUser,
lbv.create_time createTime,
lbv.update_user updateUser,
lbv.update_time updateTime,
lbv.STATUS STATUS,
lbv.create_dept createDept,
lbv.vehicle_nub vehicleNub,
lbv.vehicle_source vehicleSource,
lbv.is_head isHead,
lbv.trailer_type trailerType,
lbv.vehicle_model vehicleModel,
lbv.car_type carType,
lbv.carrier_name carrierName,
lbv.vehicle_commander vehicleCommander,
lbv.vehicle_height vehicleHeight,
lbv.payment_method paymentMethod,
lbv.approved_volume approvedVolume,
lbv.license_plate_color licensePlateColor,
lbv.vehicle_color vehicleColor,
lbv.energy_type energyType,
lbv.license_plate_type licensePlateType,
lbv.notes notes,
lbv.vehicle_owner vehicleOwner,
lbv.vehicle_brand vehicleBrand,
lbv.vehicle_code vehicleCode,
lbv.engine_code engineCode,
lbv.vehicle_quality vehicleQuality,
lbv.curb_weight curbWeight,
lbv.load_mass loadMass,
lbv.outer_width outerWidth,
lbv.expiration_time expirationTime,
lbv.road_transport roadTransport,
lbv.business_license businessLicense,
lbv.vehicle_unit vehicleUnit,
lbv.vehicle_unit_phone vehicleUnitPhone,
lbv.vehicle_owner_phone vehicleOwnerPhone,
lbv.vehicle_owner_card vehicleOwnerCard,
lbv.driving_license_photo drivingLicensePhoto,
lbv.driving_license_photo_back drivingLicensePhotoBack,
lbv.license_photo licensePhoto,
lbv.vehicle_photo vehiclePhoto,
lbv.vehicle_rear_photo vehicleRearPhoto,
lbv.road_transport_photo roadTransportPhoto,
lbv.vehicle_people_photo vehiclePeoplePhoto,
lbv.insurance_card_photo insuranceCardPhoto,
lbv.carrier_id carrierId,
lbv.review_time reviewTime,
lbv.review_validity reviewValidity,
lbv.insurance_start_time insuranceStartTime,
lbv.insurance_end_time insuranceEndTime,
lbv.body_advertising bodyAdvertising,
lbv.advertisements_new_times advertisementsNewTimes,
lbv.vehicle_parking_company vehicleParkingCompany,
lbv.with_gps withGps,
lbv.gps_service_provider gpsServiceProvider,
lbv.gps_model gpsModel,
(
SELECT
group_concat(lbvp.photo_url)
FROM
logpm_basicdata_vehicle_photo lbvp
where
lbvp.master_id = lbv.id
AND lbvp.create_time &lt;= DATE_SUB( CURDATE(), INTERVAL 1 YEAR )
ORDER BY
lbvp.create_time
LIMIT 3
) historicPhotos,
(SELECT GROUP_CONCAT(driver_id SEPARATOR ',') from logpm_basicdata_drivermiddle lbd WHERE lbd.brand_id = lbv.id and lbd.is_deleted = 0) vehicleOwners
FROM
logpm_basicdata_vehicle lbv
<where>
lbv.is_deleted = 0
AND lbv.insurance_end_time IS NOT null
AND DATEDIFF(DATE_FORMAT(lbv.insurance_end_time,'%y%m%d'),DATE_FORMAT(NOW(),'%y%m%d')) BETWEEN 1 AND 90
<if test="param.vehicleNub != null ">and lbv.vehicle_nub like concat('%',#{param.vehicleNub},'%')</if>
<if test="param.vehicleSource != null ">and lbv.vehicle_source = #{param.vehicleSource}</if>
<if test="param.trailerType != null ">and lbv.trailer_type = #{param.trailerType}</if>
<if test="param.vehicleModel != null ">and lbv.vehicle_model = #{param.vehicleModel}</if>
<if test="param.paymentMethod != null ">and lbv.payment_method = #{param.paymentMethod}</if>
<if test="param.carrierId != null ">and lbv.carrier_id = #{param.carrierId}</if>
</where>
</select>
<select id="selectInsuranceExpireBasicdataVehiclePage"
resultType="com.logpm.basicdata.vo.BasicdataVehicleVO">
SELECT
lbv.id id,
lbv.tenant_id tenantId,
lbv.create_user createUser,
lbv.create_time createTime,
lbv.update_user updateUser,
lbv.update_time updateTime,
lbv.STATUS STATUS,
lbv.create_dept createDept,
lbv.vehicle_nub vehicleNub,
lbv.vehicle_source vehicleSource,
lbv.is_head isHead,
lbv.trailer_type trailerType,
lbv.vehicle_model vehicleModel,
lbv.car_type carType,
lbv.carrier_name carrierName,
lbv.vehicle_commander vehicleCommander,
lbv.vehicle_height vehicleHeight,
lbv.payment_method paymentMethod,
lbv.approved_volume approvedVolume,
lbv.license_plate_color licensePlateColor,
lbv.vehicle_color vehicleColor,
lbv.energy_type energyType,
lbv.license_plate_type licensePlateType,
lbv.notes notes,
lbv.vehicle_owner vehicleOwner,
lbv.vehicle_brand vehicleBrand,
lbv.vehicle_code vehicleCode,
lbv.engine_code engineCode,
lbv.vehicle_quality vehicleQuality,
lbv.curb_weight curbWeight,
lbv.load_mass loadMass,
lbv.outer_width outerWidth,
lbv.expiration_time expirationTime,
lbv.road_transport roadTransport,
lbv.business_license businessLicense,
lbv.vehicle_unit vehicleUnit,
lbv.vehicle_unit_phone vehicleUnitPhone,
lbv.vehicle_owner_phone vehicleOwnerPhone,
lbv.vehicle_owner_card vehicleOwnerCard,
lbv.driving_license_photo drivingLicensePhoto,
lbv.driving_license_photo_back drivingLicensePhotoBack,
lbv.license_photo licensePhoto,
lbv.vehicle_photo vehiclePhoto,
lbv.vehicle_rear_photo vehicleRearPhoto,
lbv.road_transport_photo roadTransportPhoto,
lbv.vehicle_people_photo vehiclePeoplePhoto,
lbv.insurance_card_photo insuranceCardPhoto,
lbv.carrier_id carrierId,
lbv.review_time reviewTime,
lbv.review_validity reviewValidity,
lbv.insurance_start_time insuranceStartTime,
lbv.insurance_end_time insuranceEndTime,
lbv.body_advertising bodyAdvertising,
lbv.advertisements_new_times advertisementsNewTimes,
lbv.vehicle_parking_company vehicleParkingCompany,
lbv.with_gps withGps,
lbv.gps_service_provider gpsServiceProvider,
lbv.gps_model gpsModel,
(
SELECT
group_concat(lbvp.photo_url)
FROM
logpm_basicdata_vehicle_photo lbvp
where
lbvp.master_id = lbv.id
AND lbvp.create_time &lt;= DATE_SUB( CURDATE(), INTERVAL 1 YEAR )
ORDER BY
lbvp.create_time
LIMIT 3
) historicPhotos,
(SELECT GROUP_CONCAT(driver_id SEPARATOR ',') from logpm_basicdata_drivermiddle lbd WHERE lbd.brand_id = lbv.id and lbd.is_deleted = 0) vehicleOwners
FROM
logpm_basicdata_vehicle lbv
<where>
lbv.is_deleted = 0
AND lbv.insurance_end_time IS NOT null
AND DATEDIFF(DATE_FORMAT(lbv.insurance_end_time,'%y%m%d'),DATE_FORMAT(NOW(),'%y%m%d')) &lt;= 0
<if test="param.vehicleNub != null ">and lbv.vehicle_nub like concat('%',#{param.vehicleNub},'%')</if>
<if test="param.vehicleSource != null ">and lbv.vehicle_source = #{param.vehicleSource}</if>
<if test="param.trailerType != null ">and lbv.trailer_type = #{param.trailerType}</if>
<if test="param.vehicleModel != null ">and lbv.vehicle_model = #{param.vehicleModel}</if>
<if test="param.paymentMethod != null ">and lbv.payment_method = #{param.paymentMethod}</if>
<if test="param.carrierId != null ">and lbv.carrier_id = #{param.carrierId}</if>
</where>
</select>
<select id="selectAnnualDeadlineBasicdataVehiclePage"
resultType="com.logpm.basicdata.vo.BasicdataVehicleVO">
SELECT
lbv.id id,
lbv.tenant_id tenantId,
lbv.create_user createUser,
lbv.create_time createTime,
lbv.update_user updateUser,
lbv.update_time updateTime,
lbv.STATUS STATUS,
lbv.create_dept createDept,
lbv.vehicle_nub vehicleNub,
lbv.vehicle_source vehicleSource,
lbv.is_head isHead,
lbv.trailer_type trailerType,
lbv.vehicle_model vehicleModel,
lbv.car_type carType,
lbv.carrier_name carrierName,
lbv.vehicle_commander vehicleCommander,
lbv.vehicle_height vehicleHeight,
lbv.payment_method paymentMethod,
lbv.approved_volume approvedVolume,
lbv.license_plate_color licensePlateColor,
lbv.vehicle_color vehicleColor,
lbv.energy_type energyType,
lbv.license_plate_type licensePlateType,
lbv.notes notes,
lbv.vehicle_owner vehicleOwner,
lbv.vehicle_brand vehicleBrand,
lbv.vehicle_code vehicleCode,
lbv.engine_code engineCode,
lbv.vehicle_quality vehicleQuality,
lbv.curb_weight curbWeight,
lbv.load_mass loadMass,
lbv.outer_width outerWidth,
lbv.expiration_time expirationTime,
lbv.road_transport roadTransport,
lbv.business_license businessLicense,
lbv.vehicle_unit vehicleUnit,
lbv.vehicle_unit_phone vehicleUnitPhone,
lbv.vehicle_owner_phone vehicleOwnerPhone,
lbv.vehicle_owner_card vehicleOwnerCard,
lbv.driving_license_photo drivingLicensePhoto,
lbv.driving_license_photo_back drivingLicensePhotoBack,
lbv.license_photo licensePhoto,
lbv.vehicle_photo vehiclePhoto,
lbv.vehicle_rear_photo vehicleRearPhoto,
lbv.road_transport_photo roadTransportPhoto,
lbv.vehicle_people_photo vehiclePeoplePhoto,
lbv.insurance_card_photo insuranceCardPhoto,
lbv.carrier_id carrierId,
lbv.review_time reviewTime,
lbv.review_validity reviewValidity,
lbv.insurance_start_time insuranceStartTime,
lbv.insurance_end_time insuranceEndTime,
lbv.body_advertising bodyAdvertising,
lbv.advertisements_new_times advertisementsNewTimes,
lbv.vehicle_parking_company vehicleParkingCompany,
lbv.with_gps withGps,
lbv.gps_service_provider gpsServiceProvider,
lbv.gps_model gpsModel,
(
SELECT
group_concat(lbvp.photo_url)
FROM
logpm_basicdata_vehicle_photo lbvp
where
lbvp.master_id = lbv.id
AND lbvp.create_time &lt;= DATE_SUB( CURDATE(), INTERVAL 1 YEAR )
ORDER BY
lbvp.create_time
LIMIT 3
) historicPhotos,
(SELECT GROUP_CONCAT(driver_id SEPARATOR ',') from logpm_basicdata_drivermiddle lbd WHERE lbd.brand_id = lbv.id and lbd.is_deleted = 0) vehicleOwners
FROM
logpm_basicdata_vehicle lbv
<where>
lbv.is_deleted = 0
AND lbv.review_validity IS NOT null
AND DATEDIFF(DATE_FORMAT(lbv.review_validity,'%y%m%d'),DATE_FORMAT(NOW(),'%y%m%d')) BETWEEN 1 AND 90
<if test="param.vehicleNub != null ">and lbv.vehicle_nub like concat('%',#{param.vehicleNub},'%')</if>
<if test="param.vehicleSource != null ">and lbv.vehicle_source = #{param.vehicleSource}</if>
<if test="param.trailerType != null ">and lbv.trailer_type = #{param.trailerType}</if>
<if test="param.vehicleModel != null ">and lbv.vehicle_model = #{param.vehicleModel}</if>
<if test="param.paymentMethod != null ">and lbv.payment_method = #{param.paymentMethod}</if>
<if test="param.carrierId != null ">and lbv.carrier_id = #{param.carrierId}</if>
</where>
</select>
<select id="selectAnnualExpireBasicdataVehiclePage" resultType="com.logpm.basicdata.vo.BasicdataVehicleVO">
SELECT
lbv.id id,
lbv.tenant_id tenantId,
lbv.create_user createUser,
lbv.create_time createTime,
lbv.update_user updateUser,
lbv.update_time updateTime,
lbv.STATUS STATUS,
lbv.create_dept createDept,
lbv.vehicle_nub vehicleNub,
lbv.vehicle_source vehicleSource,
lbv.is_head isHead,
lbv.trailer_type trailerType,
lbv.vehicle_model vehicleModel,
lbv.car_type carType,
lbv.carrier_name carrierName,
lbv.vehicle_commander vehicleCommander,
lbv.vehicle_height vehicleHeight,
lbv.payment_method paymentMethod,
lbv.approved_volume approvedVolume,
lbv.license_plate_color licensePlateColor,
lbv.vehicle_color vehicleColor,
lbv.energy_type energyType,
lbv.license_plate_type licensePlateType,
lbv.notes notes,
lbv.vehicle_owner vehicleOwner,
lbv.vehicle_brand vehicleBrand,
lbv.vehicle_code vehicleCode,
lbv.engine_code engineCode,
lbv.vehicle_quality vehicleQuality,
lbv.curb_weight curbWeight,
lbv.load_mass loadMass,
lbv.outer_width outerWidth,
lbv.expiration_time expirationTime,
lbv.road_transport roadTransport,
lbv.business_license businessLicense,
lbv.vehicle_unit vehicleUnit,
lbv.vehicle_unit_phone vehicleUnitPhone,
lbv.vehicle_owner_phone vehicleOwnerPhone,
lbv.vehicle_owner_card vehicleOwnerCard,
lbv.driving_license_photo drivingLicensePhoto,
lbv.driving_license_photo_back drivingLicensePhotoBack,
lbv.license_photo licensePhoto,
lbv.vehicle_photo vehiclePhoto,
lbv.vehicle_rear_photo vehicleRearPhoto,
lbv.road_transport_photo roadTransportPhoto,
lbv.vehicle_people_photo vehiclePeoplePhoto,
lbv.insurance_card_photo insuranceCardPhoto,
lbv.carrier_id carrierId,
lbv.review_time reviewTime,
lbv.review_validity reviewValidity,
lbv.insurance_start_time insuranceStartTime,
lbv.insurance_end_time insuranceEndTime,
lbv.body_advertising bodyAdvertising,
lbv.advertisements_new_times advertisementsNewTimes,
lbv.vehicle_parking_company vehicleParkingCompany,
lbv.with_gps withGps,
lbv.gps_service_provider gpsServiceProvider,
lbv.gps_model gpsModel,
(
SELECT
group_concat(lbvp.photo_url)
FROM
logpm_basicdata_vehicle_photo lbvp
where
lbvp.master_id = lbv.id
AND lbvp.create_time &lt;= DATE_SUB( CURDATE(), INTERVAL 1 YEAR )
ORDER BY
lbvp.create_time
LIMIT 3
) historicPhotos,
(SELECT GROUP_CONCAT(driver_id SEPARATOR ',') from logpm_basicdata_drivermiddle lbd WHERE lbd.brand_id = lbv.id and lbd.is_deleted = 0) vehicleOwners
FROM
logpm_basicdata_vehicle lbv
<where>
lbv.is_deleted = 0
AND lbv.review_validity IS NOT null
AND DATEDIFF(DATE_FORMAT(lbv.review_validity,'%y%m%d'),DATE_FORMAT(NOW(),'%y%m%d')) &lt;= 0
<if test="param.vehicleNub != null ">and lbv.vehicle_nub like concat('%',#{param.vehicleNub},'%')</if>
<if test="param.vehicleSource != null ">and lbv.vehicle_source = #{param.vehicleSource}</if>
<if test="param.trailerType != null ">and lbv.trailer_type = #{param.trailerType}</if>
<if test="param.vehicleModel != null ">and lbv.vehicle_model = #{param.vehicleModel}</if>
<if test="param.paymentMethod != null ">and lbv.payment_method = #{param.paymentMethod}</if>
<if test="param.carrierId != null ">and lbv.carrier_id = #{param.carrierId}</if>
</where>
</select>
</mapper>

128
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java

@ -42,6 +42,7 @@ import com.logpm.basicdata.vo.BasicdataCarrierVO;
import com.logpm.basicdata.vo.BasicdataVehicleVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.PhoneCheckUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -51,10 +52,7 @@ import org.springblade.core.tool.utils.StringUtil;
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.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -75,14 +73,42 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
private final BasicdataDriverArteryMapper basicdataDriverArteryMapper;
private final IBasicdataCarrierService basicdataCarrierService;
@Override
public IPage<BasicdataVehicleVO> selectBasicdataVehiclePage(IPage<BasicdataVehicleVO> page, BasicdataVehicleDTO basicdataVehicle) {
return page.setRecords(baseMapper.selectBasicdataVehiclePage(page, basicdataVehicle));
if (Objects.isNull(basicdataVehicle.getPageType())) {
throw new CustomerException("pageType参数缺失!!!");
}
switch (basicdataVehicle.getPageType()) {
case 0:
//全部
List<BasicdataVehicleVO> basicdataVehicleVOS = baseMapper.selectBasicdataVehiclePage(page, basicdataVehicle);
return page.setRecords(basicdataVehicleVOS);
case 1:
//保险临期
IPage<BasicdataVehicleVO> insuranceDeadlineBasicdataVehicleVOS = baseMapper.selectInsuranceDeadlineBasicdataVehiclePage(page, basicdataVehicle);
return insuranceDeadlineBasicdataVehicleVOS;
case 2:
//保险到期
IPage<BasicdataVehicleVO> insuranceExpireBasicdataVehicleVOS = baseMapper.selectInsuranceExpireBasicdataVehiclePage(page, basicdataVehicle);
return insuranceExpireBasicdataVehicleVOS;
case 3:
//年审临期
IPage<BasicdataVehicleVO> annualDeadlineBasicdataVehicleVOS = baseMapper.selectAnnualDeadlineBasicdataVehiclePage(page, basicdataVehicle);
return annualDeadlineBasicdataVehicleVOS;
case 4:
//年审到期
IPage<BasicdataVehicleVO> expireDeadlineBasicdataVehicleVOS = baseMapper.selectAnnualExpireBasicdataVehiclePage(page, basicdataVehicle);
return expireDeadlineBasicdataVehicleVOS;
default:
log.error("未知的车辆类型>>>>>>>>>>>>>");
return null;
}
}
@Override
public List<BasicdataVehicleReadingFriendlyExcel> exportBasicdataVehicle(String ids) {
public List<BasicdataVehicleReadingFriendlyExcel> exportBasicdataVehicle(String ids) {
List<BasicdataVehicleReadingFriendlyExcel> basicdataVehicleList = baseMapper.exportBasicdataVehicle(ids.isEmpty() ? null : Func.toLongList(ids));
// List<BasicdataCarrierVO> basicdataCarrierVOS = basicdataCarrierService.selectBasicdataCarrierDictionary();
@ -106,7 +132,7 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
@Override
public List<BasicdataVehicleVO> selectBasicdataVehicleDictionary(String vehicleNub) {
if(StringUtil.isBlank(vehicleNub)){
if (StringUtil.isBlank(vehicleNub)) {
vehicleNub = null;
}
return baseMapper.selectBasicdataDictionary(vehicleNub);
@ -116,30 +142,30 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
public Integer updateOwners(BasicdataVehicleDTO basicdataVehicle) {
//删除原有绑定关系
int delete = basicdataDrivermiddleMapper.delete(new QueryWrapper<BasicdataDrivermiddleEntity>().lambda().eq(BasicdataDrivermiddleEntity::getBrandId, basicdataVehicle.getId()));
if (basicdataVehicle.getVehicleOwners().isEmpty()){
if (basicdataVehicle.getVehicleOwners().isEmpty()) {
return delete;
}
//新增现有的数据
// if (delete>0){
List<String> bindOwners = Arrays.asList(basicdataVehicle.getVehicleOwners().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindOwners.forEach(e->{
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(basicdataVehicle.getId());
basicdataDrivermiddleEntity.setDriverId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
// }
// if (delete>0){
List<String> bindOwners = Arrays.asList(basicdataVehicle.getVehicleOwners().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindOwners.forEach(e -> {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(basicdataVehicle.getId());
basicdataDrivermiddleEntity.setDriverId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
// }
return delete;
}
@Override
public boolean saveVehicle(BasicdataVehicleDTO basicdataVehicle) {
if (Func.isNotEmpty(basicdataVehicle.getCarrierId())){
if (Func.isNotEmpty(basicdataVehicle.getCarrierId())) {
BasicdataCarrierEntity carrierEntity = basicdataCarrierService.getById(basicdataVehicle.getCarrierId());
if (Func.isNotEmpty(carrierEntity)){
if (Func.isNotEmpty(carrierEntity)) {
basicdataVehicle.setCarrierName(carrierEntity.getCarrierName());
}
@ -152,7 +178,7 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
List<BasicdataVehicleEntity> list = this.list();
List<BasicdataVehicleVO> basicdataVehicleVOS = new ArrayList<>();
if(Func.isEmpty(list)){
if (Func.isEmpty(list)) {
return null;
}
// 查询所有的iD
@ -168,22 +194,22 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
.collect(Collectors.groupingBy(BasicdataDrivermiddleEntity::getBrandId));
QueryWrapper queryWrapper1 = new QueryWrapper();
queryWrapper1.eq("is_deleted",0);
queryWrapper1.eq("is_deleted", 0);
List<BasicdataDriverArteryEntity> basicdataDriverArteryEntities1 = basicdataDriverArteryMapper.selectList(queryWrapper1);
if (Func.isNotEmpty(list)){
list.forEach(l->{
if (Func.isNotEmpty(list)) {
list.forEach(l -> {
BasicdataVehicleVO vehicleVO = Func.copy(l, BasicdataVehicleVO.class);
List<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = groupedEntities.get(vehicleVO.getId());
if(Func.isNotEmpty(basicdataDrivermiddleEntities)){
if (Func.isNotEmpty(basicdataDrivermiddleEntities)) {
List<Long> driverIds = basicdataDrivermiddleEntities.
stream().filter(f -> Func.isNotEmpty(f.getDriverId())).map(BasicdataDrivermiddleEntity::getDriverId).collect(Collectors.toList());
if (Func.isNotEmpty(driverIds)){
if (Func.isNotEmpty(driverIds)) {
List<BasicdataDriverArteryEntity> basicdataDriverArteryEntities = new ArrayList();
for (Long driverId : driverIds) {
basicdataDriverArteryEntities1.forEach(e->{
if (driverId.equals(e.getId())){
basicdataDriverArteryEntities1.forEach(e -> {
if (driverId.equals(e.getId())) {
basicdataDriverArteryEntities.add(e);
}
});
@ -210,56 +236,56 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
@Transactional
public void importDriverArtery(List<BasicdataVehicleImportExcel> data) {
String method = "#############BasicdataVehicleServiceImpl.importDriverArtery";
log.info("车辆模板导入信息>>>>{}",data);
log.info("车辆模板导入信息>>>>{}", data);
try {
List<BasicdataDrivermiddleEntity>drivermiddleEntities = new ArrayList<>();
List<BasicdataDrivermiddleEntity> drivermiddleEntities = new ArrayList<>();
//对导入数据进行处理
for (BasicdataVehicleImportExcel datum : data) {
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = null;
BasicdataVehicleEntity entity = this.getOne(Wrappers.<BasicdataVehicleEntity>query().lambda().eq(BasicdataVehicleEntity::getVehicleNub, datum.getVehicleNub()));
if (Func.isNotEmpty(entity)){
if (Func.isNotEmpty(entity)) {
continue;
}
//查询模板信息是否合法
//车牌号是否合法
if (Func.isEmpty(datum.getVehicleNub())){
if (Func.isEmpty(datum.getVehicleNub())) {
//车牌号为空
throw new ServiceException("请填写车牌号!");
}
//查看是否填写了电话号码,如果填写了电话号码进行校验号码是否有效
if (Func.isNotEmpty(datum.getVehicleUnitPhone())){
if (Func.isNotEmpty(datum.getVehicleUnitPhone())) {
//车辆所属单位电话校验
boolean a = PhoneCheckUtil.checkPhone(datum.getVehicleUnitPhone());
if (a){
if (a) {
throw new ServiceException("请填写正确手机号码!");
}
}
}
if (Func.isNotEmpty(datum.getVehicleOwnerPhone())){
if (Func.isNotEmpty(datum.getVehicleOwnerPhone())) {
//车辆所属人电话校验
boolean b = PhoneCheckUtil.checkPhone(datum.getVehicleOwnerPhone());
if (b){
boolean b = PhoneCheckUtil.checkPhone(datum.getVehicleOwnerPhone());
if (b) {
throw new ServiceException("请填写正确手机号码!");
}
//进行关系司机绑定
//进行关系司机绑定
//查询是否存在司机
if (!StringUtil.isBlank(datum.getVehicleOwner())){
BasicdataDriverArteryEntity driverArteryEntity = basicdataDriverArteryMapper.findDriverListByPhone(datum.getVehicleOwner().trim(),datum.getVehicleOwnerPhone().trim());
if (!StringUtil.isBlank(datum.getVehicleOwner())) {
BasicdataDriverArteryEntity driverArteryEntity = basicdataDriverArteryMapper.findDriverListByPhone(datum.getVehicleOwner().trim(), datum.getVehicleOwnerPhone().trim());
if (BeanUtil.isEmpty(driverArteryEntity)) {
log.info(method+ "查询到司机信息,进行绑定!>>>:{}",driverArteryEntity.getName());
log.info(method+ "查询到司机信息,进行绑定!>>>:{}",driverArteryEntity.getPhone());
log.info(method + "查询到司机信息,进行绑定!>>>:{}", driverArteryEntity.getName());
log.info(method + "查询到司机信息,进行绑定!>>>:{}", driverArteryEntity.getPhone());
//绑定用户
basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setDriverId(driverArteryEntity.getId());
}
}
}
}
if (Func.isNotEmpty(datum.getCarrierName())){
if (Func.isNotEmpty(datum.getCarrierName())) {
//存在承运商,进行承运商的校验
//找到数据库内的承运商
List<BasicdataCarrierEntity> basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.<BasicdataCarrierEntity>lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName, datum.getCarrierName()));
@ -279,16 +305,16 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
vehicleEntity.setInsuranceStartTime(datum.getInsuranceStartTime());
vehicleEntity.setInsuranceEndTime(datum.getInsuranceEndTime());
this.save(vehicleEntity);
if (Func.isNotEmpty(basicdataDrivermiddleEntity)){
if (Func.isNotEmpty(basicdataDrivermiddleEntity)) {
basicdataDrivermiddleEntity.setBrandId(vehicleEntity.getId());
drivermiddleEntities.add(basicdataDrivermiddleEntity);
}
}
if (!drivermiddleEntities.isEmpty()){
if (!drivermiddleEntities.isEmpty()) {
basicdataDrivermiddleService.saveBatch(drivermiddleEntities);
}
}catch (Exception e){
log.error("车辆导入失败",e);
} catch (Exception e) {
log.error("车辆导入失败", e);
throw new RuntimeException("导入失败");
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -775,7 +775,7 @@
AND ldpll.warehouse_id = #{par.warehouseId}
AND ldsa.type_service = #{par.typeService}
<if test="par.orderCode != null and par.orderCode != '' ">
and ldpll.order_code like concat(#{par.orderCode},'%')
and ldpll.order_code like concat('%',#{par.orderCode},'%')
</if>
GROUP BY ldpll.stock_article_id
HAVING SUM(ldpll.quantity) > 0

81
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -28,8 +28,10 @@ import com.google.zxing.WriterException;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.DistributionParcelListDTO;
import com.logpm.distribution.dto.app.StockupDTO;
@ -60,14 +62,14 @@ import com.logpm.distribution.vo.PackageStockupVO;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import com.logpm.warehouse.feign.*;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageLoadingStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
@ -126,6 +128,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private IBasicdataWarehouseClient basicdataWarehouseClient;
@Autowired
private IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient;
@Autowired
private IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Autowired
private IWarehouseTrayGoodsClient warehouseTrayGoodsClient;
@Autowired
@ -163,6 +168,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private IUserClient userClient;
@Autowired
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Autowired
private IWarehouseConfigClient warehouseConfigClient;
@Autowired
private IBasicdataGoodsAllocationClient allocationClient;
// private final IDistributionStockArticleService distributionStockArticleService;
@Override
@ -511,7 +521,27 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("请选择仓库!");
}
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
BasicdataGoodsAllocationEntity defaultGoodsAllocation;
Integer isAutoWarehouse;
if (!Objects.isNull(warehouseConfig)){
if (!Objects.isNull(warehouseConfig.getIsAutoWarehouse())){
//查询备货库位
isAutoWarehouse = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0;
if (isAutoWarehouse == Integer.parseInt(IsOrNoConstant.yes.getValue())){
defaultGoodsAllocation = allocationClient.findDefaultGoodsAllocation(myCurrentWarehouse.getId());
} else {
defaultGoodsAllocation = null;
}
} else {
defaultGoodsAllocation = null;
isAutoWarehouse = 0;
}
} else {
defaultGoodsAllocation = null;
isAutoWarehouse = 0;
}
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
String s = String.valueOf(o);
if (s.contains(",")) {
String[] split = s.split(",");
@ -541,33 +571,6 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
int sum = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
List<Long> packageIds = new ArrayList<>();
v.forEach(i -> {
//查询有没有打托数据
// //查询包件有没有物料
// List<DistributionParcelDetailsEntity> list = distributionParcelDetailsService.list(Wrappers.<DistributionParcelDetailsEntity>query().lambda()
// .eq(DistributionParcelDetailsEntity::getParcelListId, i.getId())
// );
// if (!list.isEmpty()) {
// //有
// list.stream().collect(Collectors.groupingBy(DistributionParcelDetailsEntity::getEncoded))
// .forEach((kk, vv) -> {
// DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
// BeanUtil.copyProperties(vv.get(0), parcelListEntity);
// parcelListEntity.setQuantity(sum);
// parcelListEntity.setMaterialName(vv.get(0).getName());
// parcelListEntity.setMaterialCode(vv.get(0).getEncoded());
// parcelListEntity.setMaterialUnit(vv.get(0).getUnit());
// // 添加库存品信息
// //查询在库订单信息
// DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
// if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) {
// throw new ServiceException("订单的客户数据异常,无法转换!!");
// }
// addStockList(distributionStockArticleEntity, parcelListEntity, 1);
// });
// }
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
BeanUtil.copyProperties(i, parcelListEntity);
@ -594,6 +597,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getNickName()+"转库存品,"+"批次号:"+i.getOrderCode()+"物料名称:"+i.getMaterialName()+"物料编码:"+i.getMaterialCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), i.getOrderPackageCode(), content, WorkNodeEnums.STOCK_TRANSFER.getCode());
aaa.add(js);
//查询当前仓是否存在有自动入库的配置
if (isAutoWarehouse == Integer.parseInt(IsOrNoConstant.yes.getValue()) && !Objects.isNull(defaultGoodsAllocation)){
//进行此包件的默认上架
warehouseUpdownTypeClient.upShelfPackage( i.getOrderPackageCode(),defaultGoodsAllocation.getId(),myCurrentWarehouse.getId(),"自动上架");
}
});
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
BeanUtil.copyProperties(v.get(0), parcelListEntity);
@ -631,22 +639,11 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo); //修改
stockArticleEntity.setId(oo);
stockArticleEntity.setGenre(2);
// stockArticleEntity.setTotalNumber(stockArticleEntity.getTotalNumber() - list1.size());
stockArticleEntity.setHandQuantity(0);
distributionStockArticleMapper.updateById(stockArticleEntity);
} else {
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(oo);
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() - list1.size());
// distributionStockArticleEntity.setTotalNumber(distributionStockArticleEntity.getTotalNumber() - list1.size());
//统计订单在库数量
// List<DistributionParcelListEntity> parcelListEntities = this.list(Wrappers.<DistributionParcelListEntity>query().lambda()
// .eq(DistributionParcelListEntity::getStockArticleId, oo)
// .eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
// );
// int sum = parcelListEntities.stream().filter(p -> "1".equals(p.getConditions())).mapToInt(DistributionParcelListEntity::getQuantity).sum();
// distributionStockArticleEntity.setHandQuantity(sum);
// distributionStockArticleEntity.setIncomingNum(sum);
distributionStockArticleMapper.updateById(distributionStockArticleEntity);
}
});

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

@ -3948,11 +3948,18 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//扣减库存品计划取消数量
log.info("##############扣减库存品计划数量:{}", disStockListDetailEntity);
int a = distributionReservationStocklistMapper.deductionStockListReservationNum(disStockListDetailEntity.getReservationId(), disStockListDetailEntity.getStockListId(), disStockListDetailEntity.getNum());
//进行对应库存品的数量扣减
DistributionStockListEntity stockListEntity = distributionStockListService.getById(disStockListDetailEntity.getStockListId());
if (Objects.isNull(stockListEntity)){
throw new CustomerException("查询库存品信息错误");
}
int QuantityOccupied = stockListEntity.getQuantityOccupied() - disStockListDetailEntity.getNum();
stockListEntity.setQuantityOccupied(QuantityOccupied);
distributionStockListService.updateById(stockListEntity);
}
//维护对应库存品信息
distributionReservationStocklistService.maintenanceReservationStockList(distributionCancelReservationPackageDTO.getReservationId());
break;
}
//维护预约单状态
this.maintenanceReservationInfo(distributionCancelReservationPackageDTO.getReservationId());

14
blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportDeliveryController.java

@ -90,6 +90,13 @@ public class ReportDeliveryController extends BladeController {
IPage<ReportDetailVO> pages = reportDeliverService.detailsPage(vo, query);
return R.data(pages);
}
@GetMapping("/details/v2")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "配送明细报表v2", notes = "配送明细报表v2")
public R<IPage<ReportDetailVO>> detailsPageV2(ReportDetailVO vo, DevilerDetailsQuery query) {
IPage<ReportDetailVO> pages = reportDeliverService.detailsPageV2(vo, query);
return R.data(pages);
}
@GetMapping("/exportDetails")
@ApiOperationSupport(order = 6)
@ -97,6 +104,13 @@ public class ReportDeliveryController extends BladeController {
public void exportDetails(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query) {
reportDeliverService.exportDetails(response, vo, query);
}
@GetMapping("/exportDetails/v2")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "导出配送明细报表v2", notes = "导出配送明细报表v2")
public void exportDetailsV2(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query) {
reportDeliverService.exportDetailsV2(response, vo, query);
}
@GetMapping("/stockOrder")

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

@ -70,6 +70,9 @@ public interface ReportDeliverMapeer extends BaseMapper {
List<DeliveryTrainLoadedScanDTO> getDeliveryTrainLoadSacnInvnByIds(@Param("idBatch") List<Long> idBatch);
Long getDetailsPageCount(@Param("ew") Wrapper query);
Long getDetailsV2PageCount(@Param("ew") Wrapper query);
List<ReportDetailVO> getDetailsPageExport(@Param("ew") Wrapper queryWrapper, @Param("current") Integer current, @Param("size") Integer size);
List<ReportDetailVO> getDetailsPageV2(IPage<ReportDetailVO> page, @Param("ew") Wrapper queryWrapper);
}

66
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapper.xml

@ -500,6 +500,67 @@
<select id="getDetailsPage" resultType="com.logpm.report.vo.ReportDetailVO">
<include refid="detailsPageSql"/>
</select>
<select id="getDetailsPageV2" resultType="com.logpm.report.vo.ReportDetailVO">
<include refid="detailsPageV2Sql"/>
</select>
<sql id="detailsPageV2Sql">
select *
from (select plan_train_number train_number,
plan_reservation_code reservation_code,
delivery_time task_time,
warehouse_name warehouse_name,
warehouse_id warehouse_id,
delivery_type type,
delivery_kind kind,
vehicle_name vehicle_name,
driver_name driver_name,
distribution_company distribution_company,
custom_name dr_consignee,
custom_phone delivery_phone,
custom_address delivery_address,
consignee_unit consignee,
consignee_person consignee_name,
consignee_mobile consignee_mobile,
waybill_number waybill_no,
order_code stock_article_id,
order_package_code order_package_code,
train_number customer_train,
case
when conditions = 1 then '订制品'
when conditions = 2 then '零担'
when conditions = 3 then '库存品' end conditions,
firsts_product firsts,
second_product decond,
third_product third_product,
materiel_code material_code,
materiel_name material_name,
begin_warehouse_name start_war,
begin_warehouse_in_time start_war_in_time,
begin_warehouse_out_time start_war_out_time,
end_warehouse_in_time warehouse_entry_time_end,
case
when sign_status = 1 then '已签收'
when sign_status = 0 then '未签收'
when sign_status = -1 then '已回库' end driver_signing,
load_time unload_time,
load_user_name un_administrators_name,
sign_time sjsigning_time,
sign_user_name lds_signee_name,
case when review_time is null then '未复核' else '已复核' end signing_status,
review_time signing_time,
sign_num sign_num,
sign_type sign_type,
load_type loading_mode,
brand_name brand,
review_user_name examine_user_name,
case
when plan_reservation_code = sign_reservation_code then '否'
when plan_reservation_code != sign_reservation_code then '是'
else '' end abnormal_signing
from logpm_quality_deliver
order by id desc
) t ${ew.customSqlSegment}
</sql>
<sql id="detailsZeroPage">
select
id,
@ -837,6 +898,11 @@
<include refid="detailsPageSql"></include>
) t
</select>
<select id="getDetailsV2PageCount" resultType="java.lang.Long">
select count(*) from (
<include refid="detailsPageV2Sql"></include>
) t
</select>
<select id="getDetailsPageExport" resultType="com.logpm.report.vo.ReportDetailVO">
<include refid="detailsPageSql"></include>

43
blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryDetailV2Reader.java

@ -0,0 +1,43 @@
package com.logpm.report.reader;
import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.report.mapper.ReportDeliverMapeer;
import com.logpm.report.service.ExportReader;
import com.logpm.report.service.IAsyncService;
import io.prometheus.client.CollectorRegistry;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zhaoqiaobo
* @create 2024-03-08 9:50
*/
@Component
public class DeliveryDetailV2Reader implements ExportReader {
@Resource
private ReportDeliverMapeer reportDeliverMapeer;
@Autowired
private CollectorRegistry collectorRegistry;
@Autowired
private IAsyncService asyncService;
@Override
public Long getCount(Wrapper query) {
Page page = new Page(1, 1);
Long detailsPageCount = reportDeliverMapeer.getDetailsV2PageCount(query);
return detailsPageCount;
}
@Override
public List<T> findList(Page page, Wrapper query) {
return asyncService.detailsPageV2(page, query, Convert.toInt(page.getCurrent()), Convert.toInt(page.getSize()));
}
}

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

@ -23,4 +23,6 @@ public interface IAsyncService {
List<ReportDetailVO> getdetailPages(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size);
List<ReportDetailVO> getdetailPagesExport(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size);
List<ReportDetailVO> detailsPageV2(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size);
}

5
blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java

@ -96,4 +96,9 @@ public interface ReportDeliverService {
List<T> getDeliveryTrainPageReader(Page page, Wrapper query);
List<DeliveryTrainLoadedScanDTO> getDeliveryTrainLoadSacnInvnByIds(List<Long> idBatch);
IPage<ReportDetailVO> detailsPageV2(ReportDetailVO vo, DevilerDetailsQuery query);
void exportDetailsV2(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query);
}

5
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/AsyncServiceImpl.java

@ -177,5 +177,10 @@ public class AsyncServiceImpl implements IAsyncService {
return detailsPage;
}
@Override
public List<ReportDetailVO> detailsPageV2(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size) {
return reportDeliverMapeer.getDetailsPageV2(page, queryWrapper);
}
}

27
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

@ -18,6 +18,7 @@ import com.logpm.report.query.ReportDevilerQuery;
import com.logpm.report.query.StockOrderQuery;
import com.logpm.report.reader.DeliveryCustomerReader;
import com.logpm.report.reader.DeliveryDetailReader;
import com.logpm.report.reader.DeliveryDetailV2Reader;
import com.logpm.report.reader.DeliveryTrainReader;
import com.logpm.report.reader.StockOrderReader;
import com.logpm.report.service.IAsyncService;
@ -64,6 +65,7 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
private final DeliveryTrainReader deliveryTrainReader;
private final DeliveryCustomerReader deliveryCustomerReader;
private final DeliveryDetailReader deliveryDetailReader;
private final DeliveryDetailV2Reader deliveryDetailV2Reader;
private final StockOrderReader stockOrderReader;
private final IBasicdataWarehouseClient warehouseClient;
private final ReportDataService reportDataService;
@ -406,4 +408,29 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
return reportDeliverMapeer.getDeliveryTrainLoadSacnInvnByIds(idBatch);
}
@Override
public IPage<ReportDetailVO> detailsPageV2(ReportDetailVO vo, DevilerDetailsQuery query) {
// 添加时间校验
checkDetailDate(vo, query);
Integer current = query.getCurrent();
Integer size = query.getSize();
IPage<ReportDetailVO> page = Condition.getPage(query);
QueryWrapper<ReportDetailVO> queryWrapper = QueryUtil.buildQueryWrapper(vo, ReportDetailVO.class);
detailsCustomQuery(query, queryWrapper);
// 仓库权限
ReportUtil.buildReportWarehouseAuth(vo.getWarehouseName(), query.getWarehouseNameRange(), queryWrapper, warehouseClient);
List<ReportDetailVO> detailsPage = anAsyncService.detailsPageV2(page, queryWrapper, current, size);
return page.setRecords(detailsPage);
}
@Override
public void exportDetailsV2(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query) {
checkDetailDate(vo, query);
QueryWrapper<ReportDetailVO> queryWrapper = QueryUtil.buildQueryWrapper(vo, ReportDetailVO.class);
detailsCustomQuery(query, queryWrapper);
// 仓库权限
ReportUtil.buildReportWarehouseAuth(vo.getWarehouseName(), query.getWarehouseNameRange(), queryWrapper, warehouseClient);
reportExcelUtil.export(response, deliveryDetailV2Reader, ReportDetailVO.class, queryWrapper, "配送明细报表");
}
}

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml

@ -45,12 +45,12 @@
and ltlso.load_id = #{param.loadId}
</if>
<if test="param.signStatus != null and param.signStatus == '20'">
and ltlso.sign_status = '20'
and ltlso.sign_status in ('20','30')
and ltlso.sign_time &gt;= #{param.enterTimeStart}
and ltlso.sign_time &lt;= #{param.enterTimeEnd}
</if>
<if test="param.signStatus != null and param.signStatus == '10'">
and ltlso.sign_status != '20'
and ltlso.sign_status not in ('20','30')
and ltlso.create_time &gt;= #{param.enterTimeStart}
and ltlso.create_time &lt;= #{param.enterTimeEnd}
</if>

35
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -1684,12 +1684,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<TrunklineAdvanceMergeEntity> addList = new ArrayList<>();//需要加入合包码的数据集合
mergeDataListMap.keySet().forEach(mergeCode ->{
List<ImportCustomizedOuPaiDTO> ls = mergeDataListMap.get(mergeCode);
//取出第一条放入需要处理的集合
ImportCustomizedOuPaiDTO importCustomizedOuPaiDTO = ls.get(0);
if(!Objects.isNull(importCustomizedOuPaiDTO)){
importCustomizedOuPaiDTO.setOrderPackageCode(mergeCode);
addSourceList.add(importCustomizedOuPaiDTO);
}
ls.forEach(item ->{
TrunklineAdvanceMergeEntity trunklineAdvanceMergeEntity = new TrunklineAdvanceMergeEntity();
trunklineAdvanceMergeEntity.setMergeCode(mergeCode);
@ -1698,6 +1692,17 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
addList.add(trunklineAdvanceMergeEntity);
});
});
mergeDataListMap.keySet().forEach(mergeCode ->{
List<ImportCustomizedOuPaiDTO> ls = mergeDataListMap.get(mergeCode);
//取出第一条放入需要处理的集合
ImportCustomizedOuPaiDTO importCustomizedOuPaiDTO = ls.get(0);
if(!Objects.isNull(importCustomizedOuPaiDTO)){
importCustomizedOuPaiDTO.setOrderPackageCode(mergeCode);
addSourceList.add(importCustomizedOuPaiDTO);
}
});
importCustomizedOuPaiDTOS.addAll(addSourceList);
@ -2018,12 +2023,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
List<TrunklineAdvanceMergeEntity> addList = new ArrayList<>();//需要加入合包码的数据集合
mergeDataListMap.keySet().forEach(mergeCode ->{
List<ImportStandardOuPaiDTO> ls = mergeDataListMap.get(mergeCode);
//取出第一条放入需要处理的集合
ImportStandardOuPaiDTO importStandardOuPaiDTO = ls.get(0);
if(!Objects.isNull(importStandardOuPaiDTO)){
importStandardOuPaiDTO.setOrderPackageCode(mergeCode);
addSourceList.add(importStandardOuPaiDTO);
}
ls.forEach(item ->{
TrunklineAdvanceMergeEntity trunklineAdvanceMergeEntity = new TrunklineAdvanceMergeEntity();
trunklineAdvanceMergeEntity.setMergeCode(mergeCode);
@ -2032,6 +2032,17 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
addList.add(trunklineAdvanceMergeEntity);
});
});
mergeDataListMap.keySet().forEach(mergeCode ->{
List<ImportStandardOuPaiDTO> ls = mergeDataListMap.get(mergeCode);
//取出第一条放入需要处理的集合
ImportStandardOuPaiDTO importStandardOuPaiDTO = ls.get(0);
if(!Objects.isNull(importStandardOuPaiDTO)){
importStandardOuPaiDTO.setOrderPackageCode(mergeCode);
addSourceList.add(importStandardOuPaiDTO);
}
});
importStandardOuPaiDTOS.addAll(addSourceList);
//把importStandardOuPaiDTOS转成以orderPacakgeCode为一个Set集合

Loading…
Cancel
Save