Browse Source

Merge branch 'test' into pre-production

dev-warehouse
zhenghaoyu 2 years ago
parent
commit
3b609ffc1c
  1. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  2. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java
  3. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IServiceNumClient.java
  4. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  5. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java
  6. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml
  7. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java
  8. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  9. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  10. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  11. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  13. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  14. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  15. 156
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  16. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  17. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  18. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtOrderStatusDTO.java
  19. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  20. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/ServiceNumClient.java
  21. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IServiceNumService.java
  22. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/ServiceNumServiceImpl.java

6
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;
/**
* 费用汇总
*/

4
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;

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

2
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<String> ids) {
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
boolean result = warehouseService.removeWarehouse(ids);
if (result){
return R.status(result);

15
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.java

@ -52,9 +52,17 @@ public interface BasicdataWarehouseMapper extends BaseMapper<BasicdataWarehouseE
*/
List<BasicdataWarehouseExcel> exportWarehouseWarehouse(@Param("ew") Wrapper<BasicdataWarehouseEntity> queryWrapper);
/**
* 获取仓库下的货区信息
* @return
*/
List<BasicdataWarehouseVO> getWarehouseAndGoodsAreaInfo();
/**
* 获取所有仓库列表
* @return
*/
List<BasicdataWarehouseVO> getWarehouseList();
@ -65,6 +73,11 @@ public interface BasicdataWarehouseMapper extends BaseMapper<BasicdataWarehouseE
*/
List<BasicdataWarehouseVO> selectWarehouseWarehouseDictionary();
Integer removeWarehouse(String id);
/**
* 删除仓库
* @param id
* @return
*/
Integer removeWarehouse(Long id);
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml

@ -53,12 +53,12 @@
<!-- <result column="manage_code" property="manageCode"/>-->
<result column="payment_code_url" property="paymentCodeUrl"/>
</resultMap>
<!-- AND NOT EXISTS (SELECT f.id FROM logpm_basic_team_group f WHERE f.belong_to=#{id} AND f.is_deleted = 0 )-->
<update id="removeWarehouse">
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}
</update>

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

@ -71,7 +71,7 @@ public interface IBasicdataWarehouseService extends BaseService<BasicdataWarehou
* @param ids
* @return
*/
boolean removeWarehouse(List<String> ids);
boolean removeWarehouse(String ids);
/**
*

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -81,19 +81,21 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override
@Transactional
public boolean removeWarehouse(List<String> ids) {
public boolean removeWarehouse(String ids) {
// //仓库涉及众多表,取消批量删除,这里只针对仓库下是否存在有托盘、货区、班组等下级资源
if (Func.isEmpty(ids)){
log.error("传入参数异常["+ids+"]");
return false;
}
List<Long> 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;
}

5
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);
}
/**

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -258,4 +258,9 @@ public class DistributionStockArticleController extends BladeController {
return result;
}
}

12
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<List<DistributionStockArticleVO>> result = distributionStockListService.getPackageList(id);
return result;
}
}

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

@ -28,7 +28,7 @@
<result column="order_source" property="orderSource"/>
<result column="stockup_status" property="stockupStatus"/>
<result column="goods_shelf_id" property="goodsAreaId"/>
<!-- <result column="reservation_id" property="reservationId"/>-->
<result column="reservation_num" property="reservationNum"/>
<result column="period_of_time" property="periodOfTime"/>
<result column="fee" property="fee"/>
<result column="reserve1" property="reserve1"/>

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -99,8 +99,16 @@ public interface IDistributionReservationService extends BaseService<Distributio
/**
* 查询指定预约信息
* @param id
* @param reservationId
* @return
*/
R<DistributionReservationVO> getReservationInfo(String reservationId);
/**
* 修改预约计划
* @param distributionReservationDTO
* @return
*/
boolean updateReservation(DistributionReservationDTO distributionReservationDTO);
}

9
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<DistributionS
*/
List<DistributionStockListExcel> exportDistributionStockList(Wrapper<DistributionStockListEntity> queryWrapper);
/**
* 查询订单下的包件信息
* @param id
* @return
*/
R<List<DistributionStockArticleVO>> getPackageList(String id);
}

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

@ -76,8 +76,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private final IDistributionReservationStocklistService distributionReservationStocklistService;
@Override
public IPage<DistributionReservationVO> selectDistrbutionReservationPage(IPage<DistributionReservationVO> page, DistributionReservationVO distrbutionReservation) {
return page.setRecords(baseMapper.selectDistrbutionReservationPage(page, distrbutionReservation));
@ -122,14 +120,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Override
@Transactional
public boolean insertReservation(DistributionReservationDTO distributionReservationDTO) {
if (Func.isEmpty(distributionReservationDTO)){
if (Func.isEmpty(distributionReservationDTO)) {
log.error("参数错误+{" + distributionReservationDTO + "}");
return false;
return false;
}
//构建预约单
DistributionReservationEntity reservationEntity = new DistributionReservationEntity();
Func.copy(distributionReservationDTO,reservationEntity);
Func.copy(distributionReservationDTO, reservationEntity);
//新建预约单为待确认状态
reservationEntity.setReservationStatus("1");
//新建预约单订单处于未备货状态
reservationEntity.setStockupStatus("1");
this.save(reservationEntity);
//获取新增预约信息的编号
@ -141,15 +141,22 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<String> arrayList = new ArrayList<>();
AtomicReference<BigDecimal> 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<Distribu
});
}
//存在库存品构建预约库存品关联信息
if (!Func.isEmpty(inventoryList)){
inventoryList.forEach(i->{
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<Distribu
//统计数量
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee);
int count = stockArticleCount.get() + stockListCount.get();
reservationEntity.setReservationNum(count);
distributionReservationMapper.updateById(reservationEntity);
return true;
}
@ -273,9 +282,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
log.error("预约参数错误+{" + ids + "}");
return R.fail("预约信息错误!!!");
}
String text = "4564654654";
String[] split = text.split(",");
//判断是自主配送还是三方配送
String tripartiteSource = (String) deliveryInfo.get("tripartiteSource");
boolean result = false;
@ -297,7 +303,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionTripartiteDeliveryEntity.setDriverPhone((String) deliveryInfo.get("driverPhone"));
distributionTripartiteDeliveryEntity.setDriverName((String) deliveryInfo.get("driverName"));
distributionTripartiteDeliveryEntity.setVehicleNum((String) deliveryInfo.get("vehicleNum"));
distributionTripartiteDeliveryEntity.setDeliveryFee(new BigDecimal((String) deliveryInfo.get("deliveryFee")) );
distributionTripartiteDeliveryEntity.setDeliveryFee(new BigDecimal((String) deliveryInfo.get("deliveryFee")));
distributionTripartiteDeliveryEntity.setReservationIds(idsStr);
result = distributionTripartiteDeliveryService.save(distributionTripartiteDeliveryEntity);
Long distributionTripartiteDeliveryEntityId = distributionTripartiteDeliveryEntity.getId();
@ -308,7 +314,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
stockupEntity.setStockupStatus("2");
stockupEntity.setStockupArea((String) deliveryInfo.get("goodsAreaId"));
stockupEntity.setStockupUser(AuthUtil.getUser().getUserId().toString());
stockupEntity.setLoader(Long.parseLong((String) deliveryInfo.get("loader")) );
stockupEntity.setLoader(Long.parseLong((String) deliveryInfo.get("loader")));
stockupEntity.setAssignStatus("2");
stockupEntity.setAssignTime(new Date());
String stockUpdate = (String) deliveryInfo.get("stockupDate");
@ -326,7 +332,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//对预约信息进行备货状态修改
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(id);
String stockupStatus = reservationEntity.getStockupStatus();
if (!stockupStatus.equals("1")){
if (!stockupStatus.equals("1")) {
//预约任务处于未备货状态
//预约信息编号拼接
reservationIdBuffer.append(reservationEntity.getId()).append(",");
@ -367,16 +373,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setWarehouseId(warehouseName.get());
String masterDriverName = (String) deliveryInfo.get("masterDriverName");
String slaveDriverNames = (String) deliveryInfo.get("slaveDriverNames");
if (Func.isBlank(masterDriverName)){
if (Func.isBlank(masterDriverName)) {
//这里就是外协配送的方式
distributionDeliveryListEntity.setDriverName((String) deliveryInfo.get("driverName"));
distributionDeliveryListEntity.setKind("2");
distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNum"));
}else {
} else {
distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNums"));
distributionDeliveryListEntity.setVehicleId((String) deliveryInfo.get("vehicleIds"));
distributionDeliveryListEntity.setDriverName(masterDriverName+","+slaveDriverNames);
distributionDeliveryListEntity.setDriverName(masterDriverName + "," + slaveDriverNames);
distributionDeliveryListEntity.setDriverId((String) deliveryInfo.get("driverIds"));
distributionDeliveryListEntity.setKind("1");
}
@ -388,7 +394,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error("异常错误+{"+e.getMessage()+"}");
log.error("异常错误+{" + e.getMessage() + "}");
return R.fail("操作失败!!!");
}
return R.status(result);
@ -399,34 +405,112 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//查询出预约信息
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(reservationId);
DistributionReservationVO reservationVO = new DistributionReservationVO();
Func.copy(reservationEntity,reservationVO);
Func.copy(reservationEntity, reservationVO);
//查询出订单信息
QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(),DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId,reservationEntity.getId());
QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId());
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(),DistributionReservationStocklistEntity.class);
w.lambda().eq(DistributionReservationStocklistEntity::getReservationId,reservationEntity.getId());
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStocklistEntity.class);
w.lambda().eq(DistributionReservationStocklistEntity::getReservationId, reservationEntity.getId());
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w);
if (!Func.isEmpty(reservationStockarticleEntityList)){
if (!Func.isEmpty(reservationStockarticleEntityList)) {
List<DistributionStockArticleEntity> 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<DistributionStockListEntity> 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<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, distributionReservationEntity.getId());
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStocklistEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, distributionReservationEntity.getId());
//查询已有的中间表信息
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
List<DistributionReservationStocklistEntity> 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<BigDecimal> initTotal = new AtomicReference<>(BigDecimal.ZERO);
//订单自编号拼接
HashSet<String> hashSet = new HashSet<>();
List<DistributionStockArticleEntity> 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<DistributionStockListEntity> 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;
}
}

8
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<Distributi
return distributionStockListList;
}
@Override
public R<List<DistributionStockArticleVO>> getPackageList(String id) {
return null;
}
}

12
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: 处理数据完成");
}

2
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("经销商名称")

1
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;
}
//如果有新增包件就去存入订单发车单,和订单信息

6
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<ServiceNumEntity> top(Integer current, Integer size) {

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

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

Loading…
Cancel
Save