diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java index 882e01181..3643b74fe 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java @@ -130,6 +130,12 @@ public class DistributionReservationEntity extends TenantEntity { @ApiModelProperty(value = "时段;1-上午、2-下午、3-全天") private String periodOfTime; + /** + * 预约数量 + */ + @ApiModelProperty(value = "预约数量") + private Integer reservationNum; + /** * 费用汇总 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java index ae0a303ec..78c7e8145 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java @@ -186,8 +186,6 @@ public class DistributionStockArticleEntity extends TenantEntity { */ @ApiModelProperty(value = "老系统advanceId") private Integer advanceId; - - /** * 预约数量 */ @@ -205,7 +203,7 @@ public class DistributionStockArticleEntity extends TenantEntity { @ApiModelProperty(value = "收货单位") private Integer consigneeUnit; /** - * 预约数量 + * 到付费用 */ @ApiModelProperty(value = "到付费用") private BigDecimal collectFee; diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java index dabe0e0d7..5ae1c0a46 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java @@ -58,4 +58,7 @@ public interface IServiceNumClient { @GetMapping(API_PREFIX + "/findByserviceNum") ServiceNumEntity findByserviceNum(@RequestParam String sn); + + @PostMapping(API_PREFIX + "/update") + void updateServiceNum(@RequestBody ServiceNumEntity serviceNum); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java index f2186145a..e5b7f2ba0 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java @@ -162,7 +162,7 @@ public class BasicdataWarehouseController extends BladeController { @PostMapping("/remove") @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam List ids) { + public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { boolean result = warehouseService.removeWarehouse(ids); if (result){ return R.status(result); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java index c09050d47..ec61d2d60 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java @@ -52,9 +52,17 @@ public interface BasicdataWarehouseMapper extends BaseMapper exportWarehouseWarehouse(@Param("ew") Wrapper queryWrapper); + /** + * 获取仓库下的货区信息 + * @return + */ List getWarehouseAndGoodsAreaInfo(); + /** + * 获取所有仓库列表 + * @return + */ List getWarehouseList(); @@ -65,6 +73,11 @@ public interface BasicdataWarehouseMapper extends BaseMapper selectWarehouseWarehouseDictionary(); - Integer removeWarehouse(String id); + /** + * 删除仓库 + * @param id + * @return + */ + Integer removeWarehouse(Long id); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml index 6841415d9..437f62423 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml @@ -53,12 +53,12 @@ + UPDATE logpm_warehouse_warehouse SET is_deleted = 1 WHERE NOT EXISTS ( SELECT b.id FROM logpm_warehouse_goods_area b WHERE b.warehouse_id = #{id} AND b.is_deleted = 0) - AND NOT EXISTS (SELECT f.id FROM logpm_basic_team_group f WHERE f.belong_to=#{id} AND f.is_deleted = 0 ) AND id = #{id} diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java index c9a65c3c0..7b0d48986 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java @@ -71,7 +71,7 @@ public interface IBasicdataWarehouseService extends BaseService ids); + boolean removeWarehouse(String ids); /** * diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java index 1af025f76..d02fad357 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java @@ -81,19 +81,21 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl ids) { + public boolean removeWarehouse(String ids) { // //仓库涉及众多表,取消批量删除,这里只针对仓库下是否存在有托盘、货区、班组等下级资源 if (Func.isEmpty(ids)){ log.error("传入参数异常["+ids+"]"); return false; } + List longs = Func.toLongList(ids); boolean result = false; - for (String id : ids) { + for (Long id : longs) { result = SqlHelper.retBool(warehouseMapper.removeWarehouse(id)); if (!result){ return result; } } + return result; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java index 997342712..29d4c11c9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java @@ -110,8 +110,9 @@ public class DistributionReservationController extends BladeController { @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入distrbutionReservation") - public R update(@Valid @RequestBody DistributionReservationEntity distrbutionReservation) { - return R.status(reservationService.updateById(distrbutionReservation)); + public R update(@Valid @RequestBody DistributionReservationDTO distributionReservationDTO) { + boolean result = reservationService.updateReservation(distributionReservationDTO); + return R.status(result); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index 75d16dc7d..8aaf10ebf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -258,4 +258,9 @@ public class DistributionStockArticleController extends BladeController { return result; } + + + + + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java index 5a331b089..917a945b9 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java @@ -16,6 +16,7 @@ */ package com.logpm.distribution.controller; +import com.logpm.distribution.vo.DistributionStockArticleVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -147,4 +148,15 @@ public class DistributionStockListController extends BladeController { ExcelUtil.export(response, "库存品管理数据" + DateUtil.time(), "库存品管理数据表", list, DistributionStockListExcel.class); } + /** + * 获取批量在库订单信息 + */ + @GetMapping("/packageList") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R getPackageList(@RequestParam String id) { + R> result = distributionStockListService.getPackageList(id); + return result; + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 4712a6dbd..9243c30a2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -28,7 +28,7 @@ - + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 267cabab2..39ef3dcfa 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -99,8 +99,16 @@ public interface IDistributionReservationService extends BaseService getReservationInfo(String reservationId); + + /** + * 修改预约计划 + * @param distributionReservationDTO + * @return + */ + boolean updateReservation(DistributionReservationDTO distributionReservationDTO); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java index 8ca06e851..4eef3bbc4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java @@ -18,10 +18,13 @@ package com.logpm.distribution.service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.logpm.distribution.entity.DistributionStockListEntity; +import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.DistributionStockListVO; import com.logpm.distribution.excel.DistributionStockListExcel; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.tool.api.R; + import java.util.List; /** @@ -49,4 +52,10 @@ public interface IDistributionStockListService extends BaseService exportDistributionStockList(Wrapper queryWrapper); + /** + * 查询订单下的包件信息 + * @param id + * @return + */ + R> getPackageList(String id); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index a578a18ad..c3d92254e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -76,8 +76,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl selectDistrbutionReservationPage(IPage page, DistributionReservationVO distrbutionReservation) { return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation)); @@ -122,14 +120,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl arrayList = new ArrayList<>(); AtomicReference initTotal = new AtomicReference<>(BigDecimal.ZERO); //存在订单构建预约订单关联信息 - if (!Func.isEmpty(stockArticleList)){ - stockArticleList.forEach(s->{ + if (!Func.isEmpty(stockArticleList)) { + stockArticleList.forEach(s -> { //修改订单状态为已预约 s.setState(2); stockArticleCount.getAndAdd(s.getReservationNum()); distributionStockArticleService.updateById(s); + //拼接订单自编号 arrayList.add(s.getOrderSelfNumbering()); - initTotal.accumulateAndGet(new BigDecimal(s.getFee().toString()),BigDecimal::add); - initTotal.accumulateAndGet(new BigDecimal(s.getRate().toString()),BigDecimal::add); + //订单增值服务费 + initTotal.accumulateAndGet(new BigDecimal(s.getFee().toString()), BigDecimal::add); + //订单协商费用 + initTotal.accumulateAndGet(new BigDecimal(s.getRate().toString()), BigDecimal::add); + //订单到付费用 + initTotal.accumulateAndGet(new BigDecimal(s.getCollectFee().toString()), BigDecimal::add); + //仓储费用 + initTotal.accumulateAndGet(new BigDecimal(s.getStorageFee().toString()), BigDecimal::add); Long stockArticleId = s.getId(); DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity(); distributionReservationStockarticleEntity.setReservationId(reservationId); @@ -159,8 +166,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl{ + if (!Func.isEmpty(inventoryList)) { + inventoryList.forEach(i -> { distributionStockListService.updateById(i); Long stocklistId = i.getId(); stockListCount.getAndAdd(i.getReservationNum()); @@ -182,6 +189,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl q = Condition.getQueryWrapper(new HashMap(),DistributionReservationStockarticleEntity.class); - q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId,reservationEntity.getId()); + QueryWrapper q = Condition.getQueryWrapper(new HashMap(), DistributionReservationStockarticleEntity.class); + q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId()); List reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q); - QueryWrapper w = Condition.getQueryWrapper(new HashMap(),DistributionReservationStocklistEntity.class); - w.lambda().eq(DistributionReservationStocklistEntity::getReservationId,reservationEntity.getId()); + QueryWrapper w = Condition.getQueryWrapper(new HashMap(), DistributionReservationStocklistEntity.class); + w.lambda().eq(DistributionReservationStocklistEntity::getReservationId, reservationEntity.getId()); List reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w); - if (!Func.isEmpty(reservationStockarticleEntityList)){ + if (!Func.isEmpty(reservationStockarticleEntityList)) { List stockArticleEntityList = new ArrayList<>(); - reservationStockarticleEntityList.forEach(a->{ - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(a.getStockarticleId()); - stockArticleEntity.setReservationNum(a.getReservationNum()); + reservationStockarticleEntityList.forEach(a1 -> { + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(a1.getStockarticleId()); + stockArticleEntity.setReservationNum(a1.getReservationNum()); stockArticleEntityList.add(stockArticleEntity); }); - //查询出库存信息 + //查询出 库存信息 reservationVO.setStockArticleList(stockArticleEntityList); } - if (!Func.isEmpty(reservationStocklistEntityList)){ + if (!Func.isEmpty(reservationStocklistEntityList)) { List stockArticleEntityList = new ArrayList<>(); - reservationStocklistEntityList.forEach(a->{ - DistributionStockListEntity stockListEntity = distributionStockListService.getById(a.getStocklistId()); - stockListEntity.setReservationNum(a.getReservationNum()); + reservationStocklistEntityList.forEach(a2 -> { + DistributionStockListEntity stockListEntity = distributionStockListService.getById(a2.getStocklistId()); + stockListEntity.setReservationNum(a2.getReservationNum()); stockArticleEntityList.add(stockListEntity); }); - //查询出库存信息 + //查询出 库存信息 reservationVO.setInventoryList(stockArticleEntityList); } return R.data(reservationVO); } + + @Override + @Transactional + public boolean updateReservation(DistributionReservationDTO distributionReservationDTO) { + //修改预约信息 + if (Func.isEmpty(distributionReservationDTO)) { + log.error("参数异常+{" + distributionReservationDTO + "}"); + return false; + } + //删除原有 + DistributionReservationEntity distributionReservationEntity = this.getById(distributionReservationDTO.getId()); + Func.copy(distributionReservationDTO, distributionReservationEntity); + QueryWrapper q = Condition.getQueryWrapper(new HashMap(), DistributionReservationStockarticleEntity.class); + q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, distributionReservationEntity.getId()); + QueryWrapper w = Condition.getQueryWrapper(new HashMap(), DistributionReservationStocklistEntity.class); + q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, distributionReservationEntity.getId()); + //查询已有的中间表信息 + List reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q); + List reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w); + if (!Func.isEmpty(reservationStockarticleEntityList)) { + //对已有预约信息的订单包件数量进行清理 + reservationStockarticleEntityList.forEach(s1 -> { + int delete = distributionReservationStockarticleService.getBaseMapper().delete(q); + }); + } + if (!Func.isEmpty(reservationStocklistEntityList)) { + //对已有预约信息的订单包件数量进行清理 + reservationStocklistEntityList.forEach(r1 -> { + int delete = distributionReservationStocklistService.getBaseMapper().delete(w); + }); + } + //包件数量累加 + AtomicInteger count = new AtomicInteger(); + //计算总费用 + AtomicReference initTotal = new AtomicReference<>(BigDecimal.ZERO); + //订单自编号拼接 + HashSet hashSet = new HashSet<>(); + List stockArticleList = distributionReservationDTO.getStockArticleList(); + if (!Func.isEmpty(stockArticleList)) { + //这里判断修改内容是否存在订单信息,如果存在则进行中间表数据的重新插入 + stockArticleList.forEach(s -> { + DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity(); + //构建预约订单中间表信息 + distributionReservationStockarticleEntity.setReservationNum(s.getReservationNum()); + distributionReservationStockarticleEntity.setStockarticleId(s.getId()); + distributionReservationStockarticleEntity.setReservationId(distributionReservationEntity.getId()); + distributionReservationStockarticleService.save(distributionReservationStockarticleEntity); + //统计订单包件数量 + count.getAndAdd(s.getReservationNum()); + //订单到付费用 + initTotal.getAndAccumulate(new BigDecimal(s.getCollectFee().toString()), BigDecimal::add); + //订单仓储费 + initTotal.getAndAccumulate(new BigDecimal(s.getStorageFee().toString()), BigDecimal::add); + //协商费用 + initTotal.getAndAccumulate(new BigDecimal(s.getRate().toString()), BigDecimal::add); + hashSet.add(s.getOrderSelfNumbering()); + }); + } + List inventoryList = distributionReservationDTO.getInventoryList(); + if (!Func.isEmpty(inventoryList)) { + //重新构建备货信息 + inventoryList.forEach(i -> { + DistributionReservationStocklistEntity distributionReservationStocklistEntity = new DistributionReservationStocklistEntity(); + distributionReservationStocklistEntity.setReservationId(distributionReservationEntity.getId()); + distributionReservationStocklistEntity.setReservationNum(i.getReservationNum()); + distributionReservationStocklistEntity.setStocklistId(i.getId()); + distributionReservationStocklistService.save(distributionReservationStocklistEntity); + count.getAndAdd(i.getReservationNum()); + hashSet.add(i.getOrderSelfNumbering()); + }); + } + String orderId = String.join(",", hashSet); + distributionReservationEntity.setFee(initTotal.get()); + distributionReservationEntity.setReservationNum(count.get()); + distributionReservationEntity.setStockArticleId(orderId); + distributionReservationMapper.updateById(distributionReservationEntity); + return true; + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index 2b9826dc3..30ea75e5e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -17,11 +17,13 @@ package com.logpm.distribution.service.impl; import com.logpm.distribution.entity.DistributionStockListEntity; +import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.DistributionStockListVO; import com.logpm.distribution.excel.DistributionStockListExcel; import com.logpm.distribution.mapper.DistributionStockListMapper; import com.logpm.distribution.service.IDistributionStockListService; import lombok.AllArgsConstructor; +import org.springblade.core.tool.api.R; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -53,4 +55,10 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl> getPackageList(String id) { + + return null; + } + } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java index db3576f03..b0dd4754f 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java @@ -240,13 +240,13 @@ public class AsyncDataServiceImpl implements IAsyncDataService { // serviceNum.setCreateTime(LocalDate.now()); serviceNum.setDeleteTime(0); serviceNumEntityList.add(serviceNum); + serviceNumClient.addServiceNum(serviceNumEntityList); }else{ log.info("#############handlerDataToHt: 当前服务号已存在数据serviceNum={}",sn); + serviceNum.setTotal(Integer.parseInt(serviceNum.getTotal())+1+""); + serviceNumClient.updateServiceNum(serviceNum); } } - if(!serviceNumEntityList.isEmpty()){ - serviceNumClient.addServiceNum(serviceNumEntityList); - } log.info("##############handlerDataToHt: 处理数据完成"); } @@ -374,7 +374,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService { advanceDetailEntity.setDate6("");//车辆离厂时间 advanceDetailEntity.setCreateTime(LocalDate.now());//创建时间 advanceDetailEntity.setDeleteTime(0);//删除时间 - advanceDetailEntity.setServiceNum("");//服务号 + advanceDetailEntity.setServiceNum(StringUtil.isBlank(mtFactoryOrder.getMainOrderCode())?"":mtFactoryOrder.getMainOrderCode());//服务号 advanceDetailEntity.setAdmin("");// advanceDetailEntity.setAdministratorsId(0);//导入人 // advanceDetailEntity.setDueDate(0);//交期 @@ -408,12 +408,14 @@ public class AsyncDataServiceImpl implements IAsyncDataService { // serviceNum.setCreateTime(LocalDate.now()); serviceNum.setDeleteTime(0); serviceNumEntityList.add(serviceNum); + serviceNumClient.addServiceNum(serviceNumEntityList); }else{ log.info("#############handlerMtDataToHt: 当前服务号已存在数据serviceNum={}",sn); + serviceNum.setTotal(Integer.parseInt(serviceNum.getTotal())+1+""); + serviceNumClient.updateServiceNum(serviceNum); } } - serviceNumClient.addServiceNum(serviceNumEntityList); log.info("##############handlerMtDataToHt: 处理数据完成"); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtOrderStatusDTO.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtOrderStatusDTO.java index 60939ceeb..a700e516f 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtOrderStatusDTO.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtOrderStatusDTO.java @@ -24,7 +24,7 @@ public class MtOrderStatusDTO implements Serializable { @JsonProperty("操作时间") private Date operationTime; - @JsonProperty("中心仓编号") + @JsonProperty("仓库编号") private String warehouse; @JsonProperty("经销商名称") diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java index 17927a9e6..86ecd354b 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java @@ -95,6 +95,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService { //判断是否有新的包件 if(packageInfos.size() == 0){ //如果没有新增包件就直接下一条数据 + log.info("##################dealWithData: 没有新增包件,所以当前数据不保存 invoiceOrderCode={}",invoiceOrderCode); continue; } //如果有新增包件就去存入订单发车单,和订单信息 diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java index f14f17b33..91301f5d9 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java @@ -52,6 +52,12 @@ public class ServiceNumClient implements IServiceNumClient { return serviceNumService.findByserviceNum(sn); } + @Override + @PostMapping(API_PREFIX + "/updateServiceNum") + public void updateServiceNum(ServiceNumEntity serviceNum) { + serviceNumService.updateServiceNum(serviceNum); + } + // @Override // @GetMapping(TOP) // public BladePage top(Integer current, Integer size) { diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IServiceNumService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IServiceNumService.java index ecbeb14ed..7856a855d 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IServiceNumService.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IServiceNumService.java @@ -34,4 +34,5 @@ public interface IServiceNumService { ServiceNumEntity findByserviceNum(String sn); + void updateServiceNum(ServiceNumEntity serviceNum); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java index 6a807fde3..3db7f7679 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java @@ -52,4 +52,9 @@ public class ServiceNumServiceImpl implements IServiceNumService { queryWrapper.eq("serviceNum",sn); return serviceNumMapper.selectOne(queryWrapper); } + + @Override + public void updateServiceNum(ServiceNumEntity serviceNum) { + serviceNumMapper.updateById(serviceNum); + } }