Browse Source

Merge branch 'pref-0731' into dev

dist.1.3.0
pref_mail@163.com 8 months ago
parent
commit
83f1f6e414
  1. 9
      blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverApprovedDrivingModelConstant.java
  2. 9
      blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverBankTypeConverter.java
  3. 9
      blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverPositionTypeConstant.java
  4. 13
      blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverTypeStatusConstant.java
  5. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java
  6. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java
  7. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDriverArteryExcel.java
  8. 187
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataExportDriverArteryExcel.java
  9. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml
  10. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java
  11. 76
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java
  12. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java
  13. 81
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallStockController.java
  14. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  15. 66
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

9
blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverApprovedDrivingModelConstant.java

@ -40,4 +40,13 @@ public enum DriverApprovedDrivingModelConstant {
public void setValue(String value) {
this.value = value;
}
public static String getName(String value) {
for (DriverApprovedDrivingModelConstant t : DriverApprovedDrivingModelConstant.values()) {
if (t.getValue().equals(value)) {
return t.getName();
}
}
return null;
}
}

9
blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverBankTypeConverter.java

@ -45,4 +45,13 @@ public enum DriverBankTypeConverter {
public void setValue(String value) {
this.value = value;
}
public static String getName(String value) {
for (DriverBankTypeConverter t : DriverBankTypeConverter.values()) {
if (t.getValue().equals(value)) {
return t.getName();
}
}
return null;
}
}

9
blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverPositionTypeConstant.java

@ -33,4 +33,13 @@ public enum DriverPositionTypeConstant {
this.value = value;
}
public static String getName(String value) {
for (DriverPositionTypeConstant t : DriverPositionTypeConstant.values()) {
if (t.getValue().equals(value)) {
return t.getName();
}
}
return null;
}
}

13
blade-biz-common/src/main/java/org/springblade/common/constant/driver/DriverTypeStatusConstant.java

@ -5,6 +5,8 @@ package org.springblade.common.constant.driver;
* @Create 2024/1/12 15:19
*/
import org.springblade.common.constant.WorkNodeEnums;
/**
* 司机类型的状态
*/
@ -17,6 +19,9 @@ public enum DriverTypeStatusConstant {
private String name;
private String value;
DriverTypeStatusConstant(String name, String value) {
this.name = name;
this.value = value;
@ -37,4 +42,12 @@ public enum DriverTypeStatusConstant {
public void setValue(String value) {
this.value = value;
}
public static String getName(String value) {
for (DriverTypeStatusConstant t : DriverTypeStatusConstant.values()) {
if (t.getValue().equals(value)) {
return t.getName();
}
}
return null;
}
}

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java

@ -25,6 +25,7 @@ import com.logpm.basicdata.entity.BasicdataDriverWarehouseEntity;
import com.logpm.basicdata.excel.BasicdataDriverArteryExcel;
import com.logpm.basicdata.excel.BasicdataDriverArteryImporter;
import com.logpm.basicdata.excel.BasicdataDriverArteryImproterExcel;
import com.logpm.basicdata.excel.BasicdataExportDriverArteryExcel;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
import com.logpm.basicdata.service.IBasicdataDriverWarehouseService;
import com.logpm.basicdata.service.IBasicdataDrivermiddleService;
@ -244,8 +245,8 @@ public class BasicdataDriverArteryController extends BladeController {
public void exportBasicdataDriverArtery(BasicdataDriverArteryDTO basicdataDriverArtery, HttpServletResponse response) {
// QueryWrapper<BasicdataDriverArteryEntity> queryWrapper = Condition.getQueryWrapper(basicdataDriverArtery, BasicdataDriverArteryEntity.class);
// queryWrapper.lambda().eq(BasicdataDriverArteryEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<BasicdataDriverArteryExcel> list = basicdataDriverArteryService.exportBasicdataDriverArtery(basicdataDriverArtery);
ExcelUtil.export(response, "司机信息表数据" + DateUtil.time(), "司机信息表数据表", list, BasicdataDriverArteryExcel.class);
List<BasicdataExportDriverArteryExcel> list = basicdataDriverArteryService.exportBasicdataDriverArtery(basicdataDriverArtery);
ExcelUtil.export(response, "司机信息表数据" + DateUtil.time(), "司机信息表数据表", list, BasicdataExportDriverArteryExcel.class);
}
/**

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java

@ -42,5 +42,7 @@ public class BasicdataDriverArteryDTO extends BasicdataDriverArteryEntity {
private List<Long> warehouseIds = new ArrayList<>();
private List<Long> ids;
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDriverArteryExcel.java

@ -68,7 +68,7 @@ public class BasicdataDriverArteryExcel implements Serializable {
*/
@ColumnWidth(40)
@ExcelProperty("职务类型;1-干线,2-配送")
private Integer jobType;
private String jobType;
/**
* 准驾车型;1-A1,2-A2,3-A3,4-B1,5-B2,6-C1,7-C2
*/

187
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataExportDriverArteryExcel.java

@ -0,0 +1,187 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import lombok.Data;
import java.io.Serializable;
/**
* 司机信息导出
*
* @author lmy
* @since 2023-05-15
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BasicdataExportDriverArteryExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 司机姓名
*/
@ColumnWidth(40)
@ExcelProperty("司机姓名")
private String name;
/**
* 司机手机号码
*/
@ColumnWidth(40)
@ExcelProperty("司机手机号码")
private String phone;
/**
* 司机类型;1-自有,2-加盟,3-外调,4-临调
*/
@ColumnWidth(40)
@ExcelProperty("司机类型")
private String type;
/**
* 职务类型;1-干线,2-配送
*/
@ColumnWidth(40)
@ExcelProperty("职务类型")
private String jobType;
/**
* 准驾车型;1-A1,2-A2,3-A3,4-B1,5-B2,6-C1,7-C2
*/
@ColumnWidth(40)
@ExcelProperty("准驾车型")
private String drivingType;
/**
* 车辆信息
*/
@ColumnWidth(40)
@ExcelProperty("车辆信息")
private String bindVehicles;
/**
* 合同开始时间
*/
@ColumnWidth(40)
@ExcelProperty("合同开始时间")
private String contractStartTime;
/**
* 合同结束时间
*/
@ColumnWidth(40)
@ExcelProperty("合同结束时间")
private String contractEndTime;
/**
* 身份证号
*/
@ColumnWidth(40)
@ExcelProperty("身份证号")
private String idCard;
/**
* 性别
*/
@ColumnWidth(40)
@ExcelProperty("性别")
private String gender;
/**
* 仓库
*/
@ColumnWidth(40)
@ExcelProperty("仓库")
private String warehouseName;
/**
* 居住地址
*/
@ColumnWidth(40)
@ExcelProperty("居住地址")
private String residentialAddress;
/**
* 银行类型;1-工商银行,2-建设银行,3-农业银行,4-邮政银行,5-中国银行,6-交通银行,7-其他
*/
@ColumnWidth(40)
@ExcelProperty("银行类型")
private String bankType;
/**
* 银行卡号
*/
@ColumnWidth(40)
@ExcelProperty("银行卡号")
private String bankCardNub;
/**
* 驾驶证号
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证号")
private String driverLicenseNub;
/**
* 驾驶证发证机关
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证发证机关")
private String driverLicenseOrgan;
/**
* 驾驶证起始日期
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证起始日期")
private String driverLicenseStartTime;
/**
* 驾驶证到期日期
*/
@ColumnWidth(40)
@ExcelProperty("驾驶证到期日期")
private String driverLicenseEndTime;
/**
* 从业资格证编号
*/
@ColumnWidth(40)
@ExcelProperty("从业资格证编号")
private String employeeQualificationNub;
/**
* 道路经营许可证号
*/
@ColumnWidth(40)
@ExcelProperty("道路经营许可证号")
private String roadOperationLicenseNub;
/**
* 关联承运商Id
*/
@ColumnWidth(40)
@ExcelProperty("关联承运商")
private String carrierName;
/**
* 运输协议
*/
@ColumnWidth(40)
@ExcelProperty("运输协议")
private String transportationAgreement;
/**
* 备注
*/
@ColumnWidth(40)
@ExcelProperty("备注")
private String notes;
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml

@ -104,6 +104,13 @@
</if>
<if test="param.jobType != null ">and lbda.job_type like concat('%',#{param.jobType},'%')</if>
<if test="param.carrierId != null ">and lbda.carrier_id = #{param.carrierId}</if>
<if test="param.ids != null and param.ids.size() > 0">
and lbda.id in
<foreach collection="param.ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java

@ -21,6 +21,7 @@ import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.excel.BasicdataDriverArteryExcel;
import com.logpm.basicdata.excel.BasicdataDriverArteryImproterExcel;
import com.logpm.basicdata.excel.BasicdataExportDriverArteryExcel;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
import org.springblade.core.mp.base.BaseService;
@ -49,7 +50,7 @@ public interface IBasicdataDriverArteryService extends BaseService<BasicdataDriv
* @param basicdataDriverArteryDTO
* @return
*/
List<BasicdataDriverArteryExcel> exportBasicdataDriverArtery(BasicdataDriverArteryDTO basicdataDriverArteryDTO);
List<BasicdataExportDriverArteryExcel> exportBasicdataDriverArtery(BasicdataDriverArteryDTO basicdataDriverArteryDTO);
/**
* 修改
*

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

@ -21,11 +21,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.excel.BasicdataDriverArteryExcel;
import com.logpm.basicdata.excel.BasicdataDriverArteryImproterExcel;
import com.logpm.basicdata.excel.BasicdataExportDriverArteryExcel;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper;
import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper;
@ -34,16 +36,26 @@ import com.logpm.basicdata.service.IBasicdataCarrierService;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
import com.logpm.basicdata.service.IBasicdataDriverWarehouseService;
import com.logpm.basicdata.service.IBasicdataVehicleService;
import com.logpm.basicdata.vo.BasicdataCarrierVO;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
import com.logpm.basicdata.vo.BasicdataDriverWarehouseVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.driver.DriverApprovedDrivingModelConstant;
import org.springblade.common.constant.driver.DriverBankTypeConverter;
import org.springblade.common.constant.driver.DriverPositionTypeConstant;
import org.springblade.common.constant.driver.DriverTypeStatusConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springframework.dao.DataAccessException;
@ -94,13 +106,65 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
@Override
public List<BasicdataDriverArteryExcel> exportBasicdataDriverArtery(BasicdataDriverArteryDTO basicdataDriverArteryDTO) {
List<BasicdataDriverArteryExcel> basicdataDriverArteryList = baseMapper.exportBasicdataDriverArtery(basicdataDriverArteryDTO);
//basicdataDriverArteryList.forEach(basicdataDriverArtery -> {
// basicdataDriverArtery.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataDriverArtery.getType()));
//});
public List<BasicdataExportDriverArteryExcel> exportBasicdataDriverArtery(BasicdataDriverArteryDTO basicdataDriverArteryDTO) {
List<BasicdataDriverArteryVO> basicdataDriverArteryVOS = baseMapper.selectBasicdataDriverArteryPage(null, basicdataDriverArteryDTO);
return basicdataDriverArteryList;
List<BasicdataExportDriverArteryExcel> data = new ArrayList<>();
// 查找承运商
List<BasicdataCarrierVO> basicdataCarrierVOS = basicdataCarrierService.selectBasicdataCarrierDictionary();
for (BasicdataDriverArteryVO basicdataDriverArteryVO : basicdataDriverArteryVOS) {
BasicdataExportDriverArteryExcel t = new BasicdataExportDriverArteryExcel();
BeanUtil.copy(basicdataDriverArteryVO, t);
List<BasicdataDriverWarehouseVO> ls = basicdataDriverWarehouseService.findByDriverId(basicdataDriverArteryVO.getId());
if(!ls.isEmpty()){
t.setWarehouseName(ls.stream().map(BasicdataDriverWarehouseVO::getWarehouseName).collect(Collectors.joining(",")));
}
// 根据获取枚举类型的值
t.setType(DriverTypeStatusConstant.getName(basicdataDriverArteryVO.getType()));
t.setGender(basicdataDriverArteryVO.getGender()==null?"未知": "0".equals(basicdataDriverArteryVO.getGender()) ? "女" : "男");
t.setDrivingType(DriverApprovedDrivingModelConstant.getName(basicdataDriverArteryVO.getDrivingType()));
if(StringUtils.isNotBlank(basicdataDriverArteryVO.getJobType())){
String [] jobTypes = basicdataDriverArteryVO.getJobType().split(",");
StringBuffer sb = new StringBuffer();
for (String jobType : jobTypes) {
if(!sb.toString().isEmpty()){
sb.append(",");
}
sb.append(DriverPositionTypeConstant.getName(jobType));
}
t.setJobType(sb.toString());
}
BasicdataCarrierVO basicdataCarrierVO =checkBasicdataCarrierVO(basicdataCarrierVOS,basicdataDriverArteryVO.getCarrierId());
t.setCarrierName(basicdataCarrierVO==null?"":basicdataCarrierVO.getCarrierName());
t.setBankType(DriverBankTypeConverter.getName(basicdataDriverArteryVO.getBankType()));
t.setContractStartTime(Objects.isNull(basicdataDriverArteryVO.getContractStartTime())?"":DateUtil.formatDate(basicdataDriverArteryVO.getContractStartTime()));
t.setContractEndTime(Objects.isNull(basicdataDriverArteryVO.getContractEndTime())?"":DateUtil.formatDate(basicdataDriverArteryVO.getContractEndTime()));
data.add(t);
}
return data;
}
private BasicdataCarrierVO checkBasicdataCarrierVO(List<BasicdataCarrierVO> basicdataCarrierVOS, Long carrierId) {
if(basicdataCarrierVOS!= null && !basicdataCarrierVOS.isEmpty()){
for (BasicdataCarrierVO basicdataCarrierVO : basicdataCarrierVOS) {
if(basicdataCarrierVO.getId().equals(carrierId)){
return basicdataCarrierVO;
}
}
}
return null;
}
@Override

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallOrderController.java

@ -42,15 +42,15 @@ import java.util.stream.Collectors;
@RestController
@Slf4j
@AllArgsConstructor
@RequestMapping("/maill")
@Api(value = "商场在库订单", tags = "配送在库订单接口")
@RequestMapping("/mall/order/")
@Api(value = "商场在库订单", tags = "商场在库订单")
public class MallOrderController extends BladeController {
private final IDistributionStockArticleService distributionStockArticleService;
private final IBasicdataClientClient basicdataClientClient;
private IBasicdataWarehouseClient warehouseClient;
@GetMapping("/clientList")
@GetMapping("/page")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
public R<IPage<DistributionStockArticleVO>> clientList(@ApiIgnore DistributionStockArticleVO distributionStockArticle, Query query) {
@ -77,7 +77,7 @@ public class MallOrderController extends BladeController {
/**
* 导出数据
*/
@GetMapping("/export-maillOrder")
@GetMapping("/export-order")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出已签订单数据", notes = "传入distributionStockArticle")
public void exportMaillOrder(@ApiIgnore @RequestParam Map<String, Object> paramMap, BladeUser bladeUser, HttpServletResponse response) {

81
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/MallStockController.java

@ -0,0 +1,81 @@
package com.logpm.distribution.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.excel.DistributionStockArticleExcel;
import com.logpm.distribution.excel.DistributionStockListExcel;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 商家库存品控制器
* @date 2019/07/01
* @author pref
*/
@RestController
@Slf4j
@AllArgsConstructor
@RequestMapping("/mall/stock")
@Api(value = "商场库存品", tags = "商场库存品")
public class MallStockController extends BladeController {
private final IDistributionStockArticleService distributionStockArticleService;
private final IBasicdataClientClient basicdataClientClient;
private final IDistributionStockListService distributionStockListService;
private IBasicdataWarehouseClient warehouseClient;
/**
* 库存品管理 商城客户查询列表
*/
@GetMapping("/page")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionStockList")
public R<IPage<DistributionStockListVO>> page(@ApiIgnore @RequestParam Map<String, Object> distributionStockList, Query query) {
IPage<DistributionStockListVO> pages = distributionStockListService.pageClient(Condition.getPage(query), distributionStockList);
return R.data(pages);
}
/**
* 导出数据
*/
@GetMapping("/export-stock")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出在库库存品数据")
public void exportStock(@ApiIgnore @RequestParam Map<String, Object> distributionStockList, BladeUser bladeUser, HttpServletResponse response) {
List<DistributionStockListExcel> list = distributionStockListService.exportStock(distributionStockList);
ExcelUtil.export(response, "商场库存品管理数据" + DateUtil.time(), "商场库存品管理数据表", list, DistributionStockListExcel.class);
}
}

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

@ -218,6 +218,8 @@ public interface IDistributionStockListService extends BaseService<DistributionS
void clearAllocationByIds(List<Long> clearAllocationStockListIds);
List<DistributionStockListExcel> exportStock(Map<String, Object> distributionStockList);
// /**

66
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -52,6 +52,7 @@ import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
@ -151,7 +152,6 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
@Override
public List<DistributionStockListExcel> exportDistributionStockList(Map<String, Object> distributionStockList) {
Object o = distributionStockList.get("row");
Object ids = distributionStockList.get("ids");
if(ObjectUtils.isNotNull(ids)){
distributionStockList.remove("ids");
@ -168,7 +168,71 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
if(ObjectUtils.isNotNull(ids)){
queryWrapper.in(ObjectUtils.isNotNull(ids),"id",String.valueOf(ids).split(","));
}
List<DistributionStockListEntity> distributionStockListEntities = baseMapper.exportDistributionStockList(queryWrapper);
List<DistributionStockListExcel> excelList = new ArrayList<>();
distributionStockListEntities.forEach(stockList -> {
// stockList.setServiceType(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, stockList.getServiceType()));
DistributionStockListExcel distributionStockListExcel = new DistributionStockListExcel();
BeanUtil.copyProperties(stockList,distributionStockListExcel);
String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, stockList.getServiceType());
distributionStockListExcel.setServiceTypeName(value);
distributionStockListExcel.setUnpack(stockList.getUnpack() ? "是":"否");
//查询包装数量
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(stockList.getMaterialId());
if(ObjectUtils.isNotNull(materialOwnId)){
distributionStockListExcel.setPackNum(materialOwnId.getPackageNum());
}
//查询托盘信息
WarehouseTrayGoodsEntity warehouseTrayGoodsEntity = new WarehouseTrayGoodsEntity();
warehouseTrayGoodsEntity.setMarketId(stockList.getMarketId());
warehouseTrayGoodsEntity.setWarehouseId(myCurrentWarehouse.getId());
warehouseTrayGoodsEntity.setIncomingBatch(stockList.getIncomingBatch());
warehouseTrayGoodsEntity.setAssociationId(stockList.getMaterialId());
warehouseTrayGoodsEntity.setAssociationType("4");
List<WarehouseTrayGoodsEntity> trayList = warehouseTrayGoodsClient.getTrayList(warehouseTrayGoodsEntity);
if(!trayList.isEmpty()){
distributionStockListExcel.setTrayCode(trayList.stream().map(WarehouseTrayGoodsEntity::getTrayCode).collect(Collectors.joining(",")));
}
excelList.add(distributionStockListExcel);
});
return excelList;
}
@Override
public List<DistributionStockListExcel> exportStock(Map<String, Object> distributionStockList) {
Object ids = distributionStockList.get("ids");
if(ObjectUtils.isNotNull(ids)){
distributionStockList.remove("ids");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
distributionStockList.put("warehouseId",myCurrentWarehouse.getId());
}else{
throw new ServiceException("请选择仓库,在进行导出数据!!!");
}
QueryWrapper<DistributionStockListEntity> queryWrapper = Condition.getQueryWrapper(distributionStockList, DistributionStockListEntity.class);
queryWrapper.lambda().eq(DistributionStockListEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
if(ObjectUtils.isNotNull(ids)){
queryWrapper.in(ObjectUtils.isNotNull(ids),"id",String.valueOf(ids).split(","));
}
List<BasicdataClientUserEntity> basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId());
List<Long> clientIds = null;
if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) {
clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList());
queryWrapper.in("market_id",clientIds);
} else {
throw new CustomerException("当前账号没有绑定商场");
}
List<DistributionStockListEntity> distributionStockListEntities = baseMapper.exportDistributionStockList(queryWrapper);
List<DistributionStockListExcel> excelList = new ArrayList<>();
distributionStockListEntities.forEach(stockList -> {
// stockList.setServiceType(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, stockList.getServiceType()));

Loading…
Cancel
Save