Browse Source

Merge branch 'dev' into pre-production

visual
zhaoqiaobo 3 months ago
parent
commit
b8737d3e66
  1. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java
  2. 33
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java
  3. 351
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml
  4. 128
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java
  5. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  6. 32
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  7. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  9. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportDeliveryController.java
  10. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/BillDataMapper.xml
  11. 6
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/IndexCountMapper.xml
  12. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapeer.java
  13. 73
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapper.xml
  14. 43
      blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryDetailV2Reader.java
  15. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IAsyncService.java
  16. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java
  17. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/AsyncServiceImpl.java
  18. 27
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java
  19. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml
  20. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java
  21. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.xml
  22. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseStockMapper.xml
  23. 22
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsLogMapper.xml
  24. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWarehousingEntryMapper.xml
  25. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseConfigServiceImpl.java
  26. 107
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

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("导入失败");
}

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

@ -624,7 +624,7 @@
ldsl.sku,
ldsl.source_type,
ldrs.reservation_num,
count(ldsld.stock_package_code) AS stockupNum,
(SELECT IFNULL(SUM(stock_quantity),0) FROM logpm_distribution_stock WHERE reservation_id = ldrs.reservation_id AND stock_list_id = ldrs.stocklist_id) AS stockupNum,
(SELECT lds.stockup_area FROM logpm_distribution_stockup_info AS ldsi INNER JOIN logpm_distribution_stockup AS
lds ON ldsi.stockup_id = lds.id WHERE ldsi.reservation_id = ldrs.reservation_id) AS stockupArea
FROM
@ -632,7 +632,11 @@
INNER JOIN logpm_distribution_stock_list AS ldsl ON ldrs.stocklist_id = ldsl.id
INNER JOIN logpm_dis_stock_list_detail AS ldsld ON ldrs.reservation_id = ldsld.reservation_id and
ldrs.stocklist_id = ldsl.id
WHERE ldrs.reservation_id = #{reservationId}
WHERE
ldrs.is_deleted = 0
AND ldrs.reservation_id = #{reservationId}
AND ldrs.stock_list_status != 2
GROUP BY ldsl.id
</select>
<select id="getMarketReservationInfo" resultType="com.logpm.distribution.entity.DistributionReservationEntity">

32
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -1153,11 +1153,11 @@
lds.stockup_code stockupCode,
COALESCE(GROUP_CONCAT(DISTINCT lwug.position_code SEPARATOR ','), '') stockipAllocation,
COALESCE(GROUP_CONCAT(DISTINCT lwtg.tray_code SEPARATOR ','), '') pallet
from logpm_platform.logpm_distribution_stockup lds
LEFT JOIN logpm_platform.logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_platform.logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_platform.logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id
LEFT JOIN logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldrp.parce_list_id
from logpm_distribution_stockup lds
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldrp.parce_list_id
<where>
lds.is_deleted = 0
and lds.type_service = #{paramMap.typeService}
@ -1203,12 +1203,12 @@
COALESCE ( group_concat( DISTINCT ldr.consignee SEPARATOR ',' ), '' ) AS consignee,
COALESCE ( group_concat( DISTINCT ldr.delivery_address SEPARATOR ',' ), '' ) AS deliveryAddress,
(SELECT GROUP_CONCAT(ldsa.order_code) FROM logpm_distribution_reservation_stockarticle AS ldrs LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldrs.stock_article_id = ldsa.id WHERE ldrs.reservation_id = ldr.id GROUP BY ldrs.reservation_id) As orderCodes
from logpm_platform.logpm_distribution_stockup lds
LEFT JOIN logpm_platform.logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
from logpm_distribution_stockup lds
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_distribution_reservation AS ldr ON ldsi.reservation_id = ldr.id
LEFT JOIN logpm_platform.logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_platform.logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id
LEFT JOIN logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.reservation_id = ldsi.reservation_id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldrp.parce_list_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldrp.parce_list_id
<where>
lds.is_deleted = 0
and lds.type_service = #{paramMap.typeService}
@ -1246,12 +1246,12 @@
lds.stockup_code stockupCode,
COALESCE(GROUP_CONCAT(DISTINCT lwug.position_code SEPARATOR ','), '') stockipAllocation,
COALESCE(GROUP_CONCAT(DISTINCT lwtg.tray_code SEPARATOR ','), '') pallet
from logpm_platform.logpm_distribution_stockup lds
LEFT JOIN logpm_platform.logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_platform.logpm_distrilbution_bill_stock ldbs on ldbs.bill_lading_id = ldsi.reservation_id
LEFT JOIN logpm_platform.logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id
LEFT JOIN logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_platform.logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
from logpm_distribution_stockup lds
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.stockup_id = lds.id
LEFT JOIN logpm_distrilbution_bill_stock ldbs on ldbs.bill_lading_id = ldsi.reservation_id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.stock_article_id = ldbs.stock_article_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
<where>
lds.is_deleted = 0
and lds.type_service = #{paramMap.typeService}

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());

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

@ -3829,7 +3829,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
entity.setAllocationId(stockupDTO.getAllocationId());
}
entity.setConditions("0");
entity.setType(2);
entity.setType(1);
entity.setOutboundType(distributionStockupEntity.getTypeService());
//修改订单备货状态
distributionAsyncService.updateStockArticleStock(one.getStockArticleId());

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")

2
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/BillDataMapper.xml

@ -6,7 +6,7 @@
<select id="billCount" resultType="java.lang.Integer">
select count(*) billCount
from
logpm_platform.logpm_warehouse_waybill
logpm_warehouse_waybill
where freeze_status = 0
<where>
<if test="item != null">

6
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/IndexCountMapper.xml

@ -5,7 +5,7 @@
select
count(*)
FROM
logpm_platform.logpm_aftersales_work_order
logpm_aftersales_work_order
where
create_time > MONTH(CURRENT_DATE())
</sql>
@ -24,8 +24,8 @@
</if>
</select>
<sql id="boundQuantity">
select count(*) count,b.type_service as typeService from logpm_platform.logpm_distribution_parcel_list as a
inner join logpm_platform.logpm_distribution_stock_article as b on a.stock_article_id = b.id
select count(*) count,b.type_service as typeService from logpm_distribution_parcel_list as a
inner join logpm_distribution_stock_article as b on a.stock_article_id = b.id
where
a.create_time > MONTH(CURRENT_DATE())
<if test="warehouseId != null">

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);
}

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

@ -500,6 +500,74 @@
<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,
case
when sign_type = 1 then '司机扫描签收'
when sign_type = 2 then '司机批量签收'
when sign_type = 1 then '文员批量签收' end sign_type,
case
when load_type = 2 then '按件装车'
when load_type = 3 then '按订单装车'
when load_type = 4 then '一键装车'
when load_type = 5 then '补录装车' end 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 +905,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/TrunklineBillladingWaybillMapper.xml

@ -51,7 +51,7 @@
left join (select IFNULL(ltad.waybill_no,'————') waybillNo,
COUNT(ltbp.id) num
from logpm_trunkline_billlading_package ltbp
left join logpm_platform.logpm_trunkline_advance_detail ltad on ltbp.order_package_code = ltad.order_package_code
left join logpm_trunkline_advance_detail ltad on ltbp.order_package_code = ltad.order_package_code
where ltbp.billlading_id=#{billladingId}
group by IFNULL(ltad.waybill_no,'————')) t on t.waybillNo = ltbw.waybill_no
left join logpm_trunkline_billlading ltb on ltb.id = ltbw.billlading_id
@ -140,7 +140,7 @@
left join (select IFNULL(ltad.waybill_no,'————') waybillNo,
COUNT(ltbp.id) num
from logpm_trunkline_billlading_package ltbp
left join logpm_platform.logpm_trunkline_advance_detail ltad on ltbp.order_package_code = ltad.order_package_code
left join logpm_trunkline_advance_detail ltad on ltbp.order_package_code = ltad.order_package_code
where ltbp.billlading_id=#{billladingId}
group by IFNULL(ltad.waybill_no,'————')) t on t.waybillNo = ltbw.waybill_no
left join logpm_trunkline_billlading ltb on ltb.id = ltbw.billlading_id

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java

@ -182,6 +182,7 @@ public class WarehouseWarehousingEntryController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入warehouseWarehousingEntry")
public R submit(@Valid @RequestBody WarehouseWarehousingEntryDTO warehouseWarehousingEntryDTO) {
return R.status(warehouseWarehousingEntryService.saveOrUpdateOwn(warehouseWarehousingEntryDTO));
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseRetentionRecordMapper.xml

@ -91,7 +91,7 @@
remark,
cancel_retention_user_name,
cancel_remark
from logpm_platform.logpm_warehouse_retention_record lwrr
from logpm_warehouse_retention_record lwrr
<where>
lwrr.is_deleted = 0
<!--

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseStockMapper.xml

@ -705,7 +705,7 @@
</select>
<select id="exportWarehouseStock" resultType="com.logpm.warehouse.excel.WarehouseStockExcel">
select distinct * from logpm_platform.view_scan_record vsr
select distinct * from view_scan_record vsr
<where>
vsr.is_deleted = 0
<if test="paramMap.warehouseId != null and paramMap.warehouseId != ''">

22
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseUpdownGoodsLogMapper.xml

@ -178,9 +178,9 @@
lwtg.tray_code palletCode,
ldpl.warehouse logWarehouseName,
lwup.create_time createTime
FROM logpm_platform.logpm_warehouse_updown_goods_log lwup
join logpm_platform.logpm_distribution_parcel_list ldpl on ldpl.id = lwup.association_id
left join logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwup.association_id
FROM logpm_warehouse_updown_goods_log lwup
join logpm_distribution_parcel_list ldpl on ldpl.id = lwup.association_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwup.association_id
<where>
lwup.is_deleted = 0
<if test="paramMap.warehouseId != null and paramMap.warehouseId != ''">
@ -224,10 +224,10 @@
lwup.create_user createUser,
lwup.create_time createTime,
lww.name logWarehouseName
FROM logpm_platform.logpm_warehouse_updown_goods_log lwup
join logpm_platform.logpm_basicdata_material lbm on lbm.id = lwup.association_id
left join logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwup.association_id
left join logpm_platform.logpm_warehouse_warehouse lww on lwup.warehouse_id = lww.id
FROM logpm_warehouse_updown_goods_log lwup
join logpm_basicdata_material lbm on lbm.id = lwup.association_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwup.association_id
left join logpm_warehouse_warehouse lww on lwup.warehouse_id = lww.id
<where>
lwup.is_deleted = 0
<if test="paramMap.warehouseId != null and paramMap.warehouseId != ''">
@ -257,10 +257,10 @@
lwup.create_user createUserName,
lwup.create_time createTime,
lww.name logWarehouseName
FROM logpm_platform.logpm_warehouse_updown_goods_log lwup
join logpm_platform.logpm_distribution_stock_article ldsa on ldsa.id = lwup.association_id
left join logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwup.association_id
left join logpm_platform.logpm_warehouse_warehouse lww on lwup.warehouse_id = lww.id
FROM logpm_warehouse_updown_goods_log lwup
join logpm_distribution_stock_article ldsa on ldsa.id = lwup.association_id
left join logpm_warehouse_tray_goods lwtg on lwtg.association_id = lwup.association_id
left join logpm_warehouse_warehouse lww on lwup.warehouse_id = lww.id
<where>
lwup.is_deleted = 0
<if test="paramMap.warehouseId != null and paramMap.warehouseId != ''">

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWarehousingEntryMapper.xml

@ -60,7 +60,7 @@
license_plate,
service_type,
conditions
from logpm_platform.logpm_warehouse_warehousing_entry lwwe
from logpm_warehouse_warehousing_entry lwwe
<where>
<if test="paramMap.orderNumber !=null and paramMap.orderNumber != ''">
and lwwe.order_number = #{paramMap.orderNumber}
@ -80,8 +80,8 @@
<if test="paramMap.conditions !=null and paramMap.conditions != ''">
and lwwe.conditions = #{paramMap.conditions}
</if>
<if test="paramMap.warehouse !=null and paramMap.warehouse != ''">
and lwwe.warehouse = #{paramMap.warehouse}
<if test="paramMap.warehouseId !=null ">
and lwwe.warehouse_id = #{paramMap.warehouseId}
</if>
<if test="paramMap.customerName !=null and paramMap.customerName != ''">
and lwwe.customer_name = #{paramMap.customerName}

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseConfigServiceImpl.java

@ -53,6 +53,7 @@ public class WarehouseConfigServiceImpl extends BaseServiceImpl<WarehouseConfigM
//关闭配置进行默认库位的清理
flag = basicdataGoodsAllocationClient.closeDefaultAllocation(goodsAllocationEntity.getId());
warehouseConfigEntity.setDefaultAllocation("");
this.updateById(warehouseConfigEntity);
return R.status(flag);
}

107
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -131,6 +131,28 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
if (ObjectUtils.isNull(warehouseWarehousingEntryDTO.getType())) {
throw new ServiceException("入库类型不能为空!!");
}
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("#####操作人,当前未查询到仓库信息");
return false;
}
int isAutoWarehouse;
BasicdataGoodsAllocationEntity defaultGoodsAllocation;
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(basicdataWarehouseEntity.getId());
if (!Objects.isNull(warehouseConfig)) {
isAutoWarehouse = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0;
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse) {
//查询此仓库的默认库位
defaultGoodsAllocation = basicdataGoodsAllocationClient.findDefaultGoodsAllocation(basicdataWarehouseEntity.getId());
} else {
defaultGoodsAllocation = null;
}
} else {
defaultGoodsAllocation = null;
isAutoWarehouse = 0;
}
if ("2".equals(warehouseWarehousingEntryDTO.getType())) {
//直接入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
@ -147,33 +169,33 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
entryEntity.setId(warehouseWarehousingEntryDTO.getId());
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("#####操作人,当前未查询到仓库信息");
return false;
}
warehouseWarehousingEntry.setWarehouseId(basicdataWarehouseEntity.getId());
warehouseWarehousingEntry.setWarehouse(basicdataWarehouseEntity.getName());
warehouseWarehousingEntry.setSource("添加");
warehouseWarehousingEntry.setConditions("3");
if (Objects.isNull(warehouseWarehousingEntry.getPositions())) {
//查看是否存在有默认入库的配置
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse && !Objects.isNull(defaultGoodsAllocation)) {
warehouseWarehousingEntry.setPositions(defaultGoodsAllocation.getQrCode());
warehouseWarehousingEntry.setRemark("自动入库");
}
}
this.save(warehouseWarehousingEntry);
list.forEach(i -> {
//添加库存品
addInventory(i.getCreateInventory(), warehouseWarehousingEntryDTO, i);
});
//添加入库明细
// Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
// while (iterator.hasNext()){
// if(ObjectUtils.isNotNull(iterator.next().getConditions() ) && iterator.next().getConditions().equals("3")){
// iterator.remove();
// }
// }
if (!list.isEmpty()) {
list.forEach(i -> {
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("3");
if (Objects.isNull(i.getAllocationName())) {
//查看是否存在有默认入库的配置
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse && !Objects.isNull(defaultGoodsAllocation)) {
i.setAllocationName(defaultGoodsAllocation.getQrCode());
i.setAllocationId(defaultGoodsAllocation.getId());
i.setLoadingType(1);
}
}
//添加库存品
addInventory(i.getCreateInventory(), warehouseWarehousingEntryDTO, i);
}
);
warehouseWarehousingDetailService.saveBatch(list);
@ -263,14 +285,13 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.deleteLogic(detailEntityList);
}
}
} else {
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("#####操作人,当前未查询到仓库信息");
return false;
if (Objects.isNull(warehouseWarehousingEntry.getPositions())) {
//查看是否存在有默认入库的配置
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse && !Objects.isNull(defaultGoodsAllocation)) {
warehouseWarehousingEntry.setPositions(defaultGoodsAllocation.getQrCode());
warehouseWarehousingEntry.setRemark("自动入库");
}
}
warehouseWarehousingEntry.setWarehouseId(basicdataWarehouseEntity.getId());
warehouseWarehousingEntry.setWarehouse(basicdataWarehouseEntity.getName());
@ -288,6 +309,14 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
if (!list.isEmpty()) {
list.forEach(i -> {
if (Objects.isNull(i.getAllocationName())) {
//查看是否存在有默认入库的配置
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse && !Objects.isNull(defaultGoodsAllocation)) {
i.setAllocationName(defaultGoodsAllocation.getQrCode());
i.setAllocationId(defaultGoodsAllocation.getId());
i.setLoadingType(1);
}
}
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("1");
}
@ -540,22 +569,22 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
// WarehouseWarehousingEntryEntity entryEntity = JSONObject.parseObject(JSONObject.toJSONString(k), WarehouseWarehousingEntryEntity.class);
Integer isAutoWarehouse;
if (!Objects.isNull(entryEntity.getWarehouseId())){
if (!Objects.isNull(entryEntity.getWarehouseId())) {
//查询是否开启自动上架配置
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(entryEntity.getWarehouseId());
if (!Objects.isNull(warehouseConfig)){
isAutoWarehouse = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0;
if (!Objects.isNull(warehouseConfig)) {
isAutoWarehouse = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0;
} else {
isAutoWarehouse = 0;
}
} else {
isAutoWarehouse = 0;
}
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse){
isAutoWarehouse = 0;
}
} else {
isAutoWarehouse = 0;
}
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse) {
//查询默认备货库位
BasicdataGoodsAllocationEntity defaultGoodsAllocation = basicdataGoodsAllocationClient.findDefaultGoodsAllocation(entryEntity.getWarehouseId());
if (!Objects.isNull(defaultGoodsAllocation)){
if (Objects.isNull(entryEntity.getPositions())){
if (!Objects.isNull(defaultGoodsAllocation)) {
if (Objects.isNull(entryEntity.getPositions())) {
entryEntity.setPositions(defaultGoodsAllocation.getQrCode());
}
}
@ -596,8 +625,8 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
detail.setTrayName(basicdataTrayEntity.getPalletName());
}
}
}else {
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse){
} else {
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse) {
//库位
WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity = warehouseGoodsAllocationClient.findByAllocationQrCode(entryEntity.getPositions());
if (Func.isNotEmpty(warehouseGoodsAllocationEntity)) {
@ -670,7 +699,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
break;
default:
s.setConditions("未知");
return ;
return;
}
BeanUtil.copyProperties(s, excel);
listExcel.add(excel);

Loading…
Cancel
Save