From dd578827739548ff29c71cffa24b1b49759402b6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 19 Feb 2024 16:40:34 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=80=83=E6=A0=B8-=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E8=80=83=E6=A0=B8=E7=A7=AF=E5=88=86=202.?= =?UTF-8?q?=E5=B9=B2=E7=BA=BF-=E4=BF=AE=E5=A4=8D=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/IDistributionParcelListClient.java | 3 + blade-service-api/logpm-supervise-api/pom.xml | 7 ++ .../supervise/dto/ImportClassifyDTO.java | 29 +++++++ .../com/logpm/supervise/vo/ClassifyVO.java | 1 + .../com/logpm/supervise/vo/IndicatorsVO.java | 2 + .../com/logpm/trunkline/dto/LoadCarsDTO.java | 23 +++++ .../trunkline/vo/CarsLoadAllOrderVO.java | 1 + .../feign/DistributionParcelListClient.java | 5 ++ .../IDistributionParcelListService.java | 3 + .../DistributionParcelListServiceImpl.java | 12 ++- .../controller/ClassifyController.java | 19 +++++ .../supervise/service/IClassifyService.java | 4 + .../service/impl/ClassifyServiceImpl.java | 83 ++++++++++++++++++- .../service/impl/IndicatorsServiceImpl.java | 11 +++ .../api/BillladingApiController.java | 7 +- .../trunkline/api/CarsLoadApiController.java | 2 +- .../controller/BillladingController.java | 7 +- .../controller/CarsLoadController.java | 34 +++++++- .../mapper/TrunklineAdvanceMapper.xml | 20 ++--- .../mapper/TrunklineBillladingMapper.java | 3 + .../mapper/TrunklineBillladingMapper.xml | 16 +++- .../TrunklineBillladingPackageMapper.java | 1 + .../TrunklineBillladingPackageMapper.xml | 7 ++ .../mapper/TrunklineCarsLoadMapper.xml | 42 +++++++++- .../service/ITrunklineAdvanceService.java | 2 +- .../ITrunklineBillladingPackageServicie.java | 2 + .../service/ITrunklineBillladingService.java | 3 +- .../service/ITrunklineCarsLoadService.java | 4 +- .../service/impl/InComingServiceImpl.java | 34 +++++--- .../service/impl/OpenOrderServiceImpl.java | 8 +- .../impl/TrunklineAdvanceServiceImpl.java | 5 +- ...TrunklineBillladingPackageServiceImpl.java | 5 ++ .../impl/TrunklineBillladingServiceImpl.java | 16 ++-- .../impl/TrunklineCarsLoadServiceImpl.java | 83 +++++++++++++++++-- 34 files changed, 447 insertions(+), 57 deletions(-) create mode 100644 blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/dto/ImportClassifyDTO.java diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index 701ceaf91..5fe692394 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -140,4 +140,7 @@ public interface IDistributionParcelListClient { @GetMapping(API_PREFIX+"/findByWaybillNumber") List findByWaybillNumber(@RequestParam String waybillNumber); + + @GetMapping(API_PREFIX+"/findEntityListByOrderCodeAndStatus") + List findEntityListByOrderCodeAndStatus(@RequestParam String orderCode, @RequestParam Long warehouseId, @RequestParam String packageStatus); } diff --git a/blade-service-api/logpm-supervise-api/pom.xml b/blade-service-api/logpm-supervise-api/pom.xml index cd2462bc2..51108a2bf 100644 --- a/blade-service-api/logpm-supervise-api/pom.xml +++ b/blade-service-api/logpm-supervise-api/pom.xml @@ -13,5 +13,12 @@ logpm-supervise-api 3.2.0.RELEASE + + + org.springblade + blade-starter-excel + + + diff --git a/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/dto/ImportClassifyDTO.java b/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/dto/ImportClassifyDTO.java new file mode 100644 index 000000000..fd0104dc4 --- /dev/null +++ b/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/dto/ImportClassifyDTO.java @@ -0,0 +1,29 @@ +package com.logpm.supervise.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ImportClassifyDTO implements Serializable { + + @ExcelProperty(value = "指标分类") + private String parentClassifyName; + + @ExcelProperty(value = "指标分类描述") + private String parentClassifyDesc; + + @ExcelProperty(value = "指标分类备注") + private String parentClassifyRemark; + + @ExcelProperty(value = "指标名称") + private String classifyName; + + @ExcelProperty(value = "指标描述") + private String classifyDesc; + + @ExcelProperty(value = "积分值") + private String points; + +} diff --git a/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java b/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java index cb17f4033..1fe20325e 100644 --- a/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java +++ b/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/ClassifyVO.java @@ -36,6 +36,7 @@ public class ClassifyVO extends ClassifyEntity { private static final long serialVersionUID = 1L; private String parentClassifyName; + private String createDeptName; private List pointsEntities = new ArrayList<>(); diff --git a/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/IndicatorsVO.java b/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/IndicatorsVO.java index 8022a430d..d389318a3 100644 --- a/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/IndicatorsVO.java +++ b/blade-service-api/logpm-supervise-api/src/main/java/com/logpm/supervise/vo/IndicatorsVO.java @@ -15,6 +15,8 @@ public class IndicatorsVO extends IndicatorsEntity { private String classifyName; + private String createDeptName; + private Long parentClassifyId; private String createdUserName; diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java index 48951da86..c3bbd3312 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java @@ -8,6 +8,7 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.Date; import java.util.List; @Data @@ -87,4 +88,26 @@ public class LoadCarsDTO implements Serializable { private String signOrderIds; + private String openTimeStartStr; + private String openTimeEndStr; + + private Date openTimeStart; + private Date openTimeEnd; + + + private String enterTimeStartStr; + private String enterTimeEndStr; + + private Date enterTimeStart; + private Date enterTimeEnd; + + private String destination; + + private String destinationWarehouseName; + private String productName; + private String shipper; + private String consignee; + private String customerTrain; + private String remark; + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java index e79fd0553..917f9d485 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java @@ -34,5 +34,6 @@ public class CarsLoadAllOrderVO implements Serializable { private BigDecimal freight;//运费 private String productName;//品类 private String type;//类型 + private Date warehouseEntryTimeEnd;//入库时间 } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index fae7ea68f..674d6d19b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -294,4 +294,9 @@ public class DistributionParcelListClient implements IDistributionParcelListClie public List findByWaybillNumber(String waybillNumber) { return distributionParcelListService.findByWaybillNumber(waybillNumber); } + + @Override + public List findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus) { + return distributionParcelListService.findEntityListByOrderCodeAndStatus(orderCode,warehouseId,packageStatus); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index 31277e93a..850e64c7d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -193,4 +193,7 @@ public interface IDistributionParcelListService extends BaseService findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index 0eccbf572..8491ef481 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -34,7 +34,6 @@ import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionParcelListExcel; import com.logpm.distribution.mapper.DistributionParcelListMapper; -import com.logpm.distribution.mapper.DistributionParcelNumberMapper; import com.logpm.distribution.mapper.DistributionStockArticleMapper; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; @@ -1020,4 +1019,15 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl findEntityListByOrderCodeAndStatus(String orderCode, Long warehouseId, String packageStatus) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("order_code",orderCode) + .eq("warehouse_id",warehouseId) + .eq("order_package_status",packageStatus) + .eq("is_transfer",1) + .eq("is_deleted",0); + return baseMapper.selectList(queryWrapper); + } + } diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/ClassifyController.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/ClassifyController.java index e3e2b59de..6e343d0df 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/ClassifyController.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/controller/ClassifyController.java @@ -35,6 +35,7 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import springfox.documentation.annotations.ApiIgnore; import javax.validation.Valid; @@ -247,6 +248,24 @@ public class ClassifyController extends BladeController { } } + @PostMapping("/importClassify") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "导入考核指标", notes = "传入indicatorsDTO") + public R importClassify(@RequestParam(value = "file") MultipartFile file) { + String method = "##############selectPointList: "; + log.info(method+"导入考核指标"); + + try{ + return classifyService.importClassify(file); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } + } diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java index 7124048c2..e4726b4dd 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/IClassifyService.java @@ -25,7 +25,9 @@ import com.logpm.supervise.vo.IndicatorsVO; import com.logpm.supervise.vo.api.ClassifyApiVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -100,4 +102,6 @@ public interface IClassifyService extends BaseService { */ R deptList(); + R importClassify(MultipartFile file) throws IOException; + } diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java index bf9b4cca6..096c3b4ea 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/ClassifyServiceImpl.java @@ -16,11 +16,13 @@ */ package com.logpm.supervise.service.impl; +import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.logpm.supervise.dto.ClassifyDTO; +import com.logpm.supervise.dto.ImportClassifyDTO; import com.logpm.supervise.dto.IndicatorsDTO; import com.logpm.supervise.entity.ClassifyEntity; import com.logpm.supervise.entity.IndicatorsAnnexEntity; @@ -42,6 +44,7 @@ import com.logpm.supervise.wrapper.IndicatorsWrapper; import com.logpm.supervise.wrapper.PointsWrapper; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.exception.CustomerException; import org.springblade.common.utils.CommonUtil; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.BladeUser; @@ -58,7 +61,10 @@ import org.springblade.system.feign.ISysClient; import org.springblade.system.feign.IUserClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.io.InputStream; import java.util.*; import java.util.stream.Collectors; @@ -106,8 +112,12 @@ public class ClassifyServiceImpl extends BaseServiceImpl pages = baseMapper.pageList(page, classifyDTO); List records = pages.getRecords(); - if (!"1".equals(isPid)) { - for (ClassifyVO record : records) { + + for (ClassifyVO record : records) { + Long deptId = record.getCreateDept(); + String deptName = deptClient.findNameById(deptId); + record.setCreateDeptName(deptName); + if (!"1".equals(isPid)) { Long classifyId = record.getId(); Long pId1 = record.getPId(); ClassifyEntity classifyEntity = getById(pId1); @@ -410,6 +420,75 @@ public class ClassifyServiceImpl extends BaseServiceImpl importClassifyDTOS = EasyExcel.read(inputStream).head(ImportClassifyDTO.class).sheet(0).headRowNumber(1).doReadSync(); + + for (ImportClassifyDTO importClassifyDTO : importClassifyDTOS) { + String parentClassifyName = importClassifyDTO.getParentClassifyName(); + String parentClassifyDesc = importClassifyDTO.getParentClassifyDesc(); + String parentClassifyRemark = importClassifyDTO.getParentClassifyRemark(); + //判断指标分类是否已经存在 + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("name",parentClassifyName) + .eq("p_id",0) + .eq("is_deleted",0); + ClassifyEntity parnetClassifyEntity = baseMapper.selectOne(queryWrapper); + if(Objects.isNull(parnetClassifyEntity)){ + parnetClassifyEntity = new ClassifyEntity(); + parnetClassifyEntity.setName(parentClassifyName); + parnetClassifyEntity.setDescription(parentClassifyDesc); + parnetClassifyEntity.setRemark(parentClassifyRemark); + parnetClassifyEntity.setPId(0L); + }else{ + parnetClassifyEntity.setDescription(parentClassifyDesc); + parnetClassifyEntity.setRemark(parentClassifyRemark); + } + boolean pb = saveOrUpdate(parnetClassifyEntity); + if(!pb){ + log.warn("#############importClassify: 保存指标分类失败"); + throw new CustomerException(405,"保存指标分类失败"); + } + Long parentClassifyId = parnetClassifyEntity.getId(); + + String classifyName = importClassifyDTO.getClassifyName(); + String classifyDesc = importClassifyDTO.getClassifyDesc(); + + ClassifyEntity classifyEntity = new ClassifyEntity(); + classifyEntity.setName(classifyName); + classifyEntity.setDescription(classifyDesc); + classifyEntity.setPId(parentClassifyId); + boolean b = save(classifyEntity); + if(!b){ + log.warn("#############importClassify: 保存指标失败"); + throw new CustomerException(405,"保存指标失败"); + } + Long classifyId = classifyEntity.getId(); + + String points = importClassifyDTO.getPoints(); + points = points.replaceAll(",",","); + String[] pointArray = points.split(","); + + List ls = new ArrayList<>(); + for (String point : pointArray) { + PointsEntity pointsEntity = new PointsEntity(); + pointsEntity.setClassifyId(classifyId); + pointsEntity.setPoint(Integer.parseInt(point)); + ls.add(pointsEntity); + } + pointsService.saveBatch(ls); + } + + return R.success("导入成功"); + } + private List getClassifyList(Long pid) { return baseMapper.selectAllClassifyList(pid); } diff --git a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java index e749fbc57..ec689a30e 100644 --- a/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java +++ b/blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java @@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.common.utils.CommonUtil; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; +import org.springblade.system.feign.IDeptClient; import org.springframework.stereotype.Service; import java.util.Date; @@ -27,6 +28,8 @@ public class IndicatorsServiceImpl extends BaseServiceImpl pages = baseMapper.pageList(page,indicatorsDTO); + List records = pages.getRecords(); + + for (IndicatorsVO record : records) { + Long deptId = record.getCreateDept(); + String deptName = deptClient.findNameById(deptId); + record.setCreateDeptName(deptName); + } + pages.setRecords(records); return R.data(pages); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java index de2d892a6..901235716 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java @@ -7,7 +7,6 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.trunkline.dto.BillladingDTO; import com.logpm.trunkline.service.ITrunklineBillladingService; import com.logpm.trunkline.vo.TrunklineBillladingDetailListVO; -import com.logpm.trunkline.vo.TrunklineBillladingDetailVO; import com.logpm.trunkline.vo.TrunklineBillladingVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -78,9 +77,11 @@ public class BillladingApiController { } billladingDTO.setWarehouseId(myCurrentWarehouse.getId()); - IPage pages = billladingService.billladingList(billladingDTO); +// IPage pages = billladingService.billladingList(billladingDTO); +// return R.data(pages); + + return billladingService.billladingList(billladingDTO); - return R.data(pages); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java index 3cb5b9f62..6e2c9aeaa 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java @@ -391,7 +391,7 @@ public class CarsLoadApiController { return R.fail(405,"包件码不能为空"); } - return carsLoadService.loadingScan(loadId,myCurrentWarehouse.getId(),orderPackageCode,loadCarsDTO.getTrayCode()); + return carsLoadService.loadingScan(loadId,myCurrentWarehouse.getId(),orderPackageCode,loadCarsDTO.getTrayCode(),"正常装车"); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java index efed69832..818666152 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java @@ -50,10 +50,11 @@ public class BillladingController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(!Objects.isNull(myCurrentWarehouse)){ -// log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); -// return R.fail(403,"仓库信息为空"); - billladingDTO.setWarehouseId(myCurrentWarehouse.getId()); + log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); + return R.fail(403,"仓库信息为空"); } + billladingDTO.setWarehouseId(myCurrentWarehouse.getId()); + IPage pages = trunklineBillladingService.pageList(billladingDTO); return R.data(pages); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java index f024ee787..e246d7eb2 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java @@ -13,7 +13,6 @@ import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.exception.CustomerException; -import org.springblade.core.redis.lock.RedisLock; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.StringUtil; import org.springframework.web.bind.annotation.*; @@ -1905,4 +1904,37 @@ public class CarsLoadController { } } + @ResponseBody + @PostMapping("/manualLoading") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "手动装车", notes = "传入loadCarsDTO") + public R manualLoading(@RequestBody LoadCarsDTO loadCarsDTO) { + String method = "############manualLoading: "; + log.info(method + "请求参数{}", loadCarsDTO); + Long loadId = loadCarsDTO.getLoadId(); + + try{ + + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); + return R.fail(405,"仓库信息为空"); + } + loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId()); + if(Objects.isNull(loadId)){ + log.warn(method+"配载id为空 loadId={}",loadId); + return R.fail(405,"配载id为空"); + } + + return carsLoadService.manualLoading(loadCarsDTO,"PC手动一键装车"); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml index 007d76d8c..b94510d65 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml @@ -24,34 +24,34 @@ and lta.has_package = #{param.hasPackage} - and lta.order_code like concat('%',${param.orderCode},'%') + and lta.order_code like concat('%',#{param.orderCode},'%') - and lta.dealer_name like concat('%',${param.dealerName},'%') + and lta.dealer_name like concat('%',#{param.dealerName},'%') - and lta.store_name like concat('%',${param.storeName},'%') + and lta.store_name like concat('%',#{param.storeName},'%') - and lta.site_name like concat('%',${param.siteName},'%') + and lta.site_name like concat('%',#{param.siteName},'%') - and lta.train_number like concat('%',${param.trainNumber},'%') + and lta.train_number like concat('%',#{param.trainNumber},'%') - and lta.service_num like concat('%',${param.serviceNum},'%') + and lta.service_num like concat('%',#{param.serviceNum},'%') - and lta.brand like concat('%',${param.brand},'%') + and lta.brand like concat('%',#{param.brand},'%') - and lta.customer_name like concat('%',${param.customerName},'%') + and lta.customer_name like concat('%',#{param.customerName},'%') - and lta.customer_phone like concat('%',${param.customerPhone},'%') + and lta.customer_phone like concat('%',#{param.customerPhone},'%') - and lta.customer_address like concat('%',${param.customerAddress},'%') + and lta.customer_address like concat('%',#{param.customerAddress},'%') diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java index 4299100db..8454098cc 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java @@ -13,6 +13,7 @@ import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; +import java.util.Map; @Mapper public interface TrunklineBillladingMapper extends BaseMapper { @@ -26,4 +27,6 @@ public interface TrunklineBillladingMapper extends BaseMapper billladingList(IPage page, @Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr); IPage findAdvanceDetailList(IPage page, @Param("orderCode") String orderCode); + + Map billladingNum(@Param("warehouseId") Long warehouseId, @Param("startByDateStr") Date startByDateStr, @Param("endByDateStr") Date endByDateStr); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml index 50a7852c0..69134681b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml @@ -109,9 +109,10 @@ select ldsa.service_number serviceNum, ldsa.order_code orderCode, ldsa.total_number totalNum, - ldsa.incoming_num scanNum + IFNULL(ldsa.incoming_num,0) scanNum from logpm_distribution_stock_article ldsa - where ldsa.warehouse_entry_time >= #{startByDateStr} + where ldsa.is_zero != 1 + and ldsa.warehouse_entry_time >= #{startByDateStr} and ldsa.warehouse_entry_time <= #{endByDateStr} and warehouse_id = #{warehouseId} @@ -123,4 +124,15 @@ where order_code = #{orderCode} + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.java index d75faa40a..8aa78ecac 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.java @@ -13,4 +13,5 @@ public interface TrunklineBillladingPackageMapper extends BaseMapper findBillladingPackageDetail(IPage page, @Param("param") BillladingDTO billladingDTO); + TrunklineBillladingPackageEntity findBillladingPackage(@Param("packageCode") String packageCode); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.xml index 8251fdcf0..266da73c7 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingPackageMapper.xml @@ -57,4 +57,11 @@ + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index 58ab2f34e..d54e84d3d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml @@ -22,6 +22,7 @@ ltcl.create_user_name createUserName, ltcl.create_time createTime, ltcl.now_warehouse_id nowWarehouseId, + ltcl.count_transport_cost countTransportCost, sum(ltcll.now_transport_cost) nowTransportCost, sum(ltcll.oil_cost) oilCost, sum(ltcll.back_transport_cost) backTransportCost, @@ -56,7 +57,8 @@ ltcl.end_warehouse_names, ltcl.arrive_time, ltcl.start_time, - ltcl.now_warehouse_id + ltcl.now_warehouse_id, + ltcl.count_transport_cost @@ -119,6 +121,7 @@