Browse Source

Merge remote-tracking branch 'origin/dev' into dev

single_db
pref_mail@163.com 1 year ago
parent
commit
135de8dd0f
  1. 5
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java
  3. 83
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

5
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesProcessingMoneyEntity.java

@ -98,6 +98,11 @@ public class AftersalesProcessingMoneyEntity extends TenantEntity {
*/
@ApiModelProperty(value = "处理结果名称")
private String resultName;
/**
* 支付单位
*/
@ApiModelProperty(value = "支付单位")
private String paymentUnit;
/**
* 类型
*/

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

@ -252,7 +252,7 @@ public class DistrilbutionBillLadingController extends BladeController {
return R.status(distrilbutionBillLadingService.updateById(distrilbutionBillLading));
}
/**
* 提货单 自己修改
* 提货单 自己修改 签收
*/
@PostMapping("/updateOwn")
@ApiOperationSupport(order = 5)

83
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -17,12 +17,8 @@
package com.logpm.distribution.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
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;
@ -30,7 +26,6 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.bean.Resp;
import com.logpm.distribution.config.RedissonConfig;
@ -39,18 +34,15 @@ import com.logpm.distribution.dto.DistributionStockListDTO;
import com.logpm.distribution.dto.DistrilbutionBillLadingDTO;
import com.logpm.distribution.dto.app.BillLadingAppDTO;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionStockArticleExcel;
import com.logpm.distribution.excel.DistrilbutionBillLadingExcel;
import com.logpm.distribution.mapper.DistrilbutionBillLadingMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.*;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.codec.Charsets;
import org.redisson.api.RLock;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.billLading.BillLadingStatusConstant;
@ -58,20 +50,16 @@ import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStockupStatusConstant;
import org.springblade.common.constant.pda.PdaAudioLingoStatus;
import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
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.constant.BladeConstant;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.cache.DictBizCache;
@ -79,21 +67,16 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static org.bouncycastle.math.ec.custom.gm.SM2P256V1Curve.q;
/**
* 提货单 服务实现类
*
@ -164,12 +147,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
public Boolean ownSaveOrUpdate(DistrilbutionBillLadingDTO distrilbutionBillLading) {
Boolean las = false;
if (ObjectUtils.isNotNull(distrilbutionBillLading.getId())) {
//判断是否已签收
DistrilbutionBillLadingEntity billLadingEntity = baseMapper.selectById(distrilbutionBillLading.getId());
if(ObjectUtils.isNotNull(billLadingEntity) && billLadingEntity.getConditions().equals(BillLadingStatusConstant.yiqianshou.getValue())){
throw new ServiceException("已签收,无法修改计划!!!");
}
las = true;
//修改
this.updateById(distrilbutionBillLading);
if(!distrilbutionBillLading.getBillPackageEntityList().isEmpty() || !distrilbutionBillLading.getUnBillPackageEntityList().isEmpty()){
//修改新增包件
//todo 还没有改
//todo
updateBillPackeg(distrilbutionBillLading);
}
//修改零担数据
@ -1456,7 +1444,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
return Resp.scanFail("3000", "参数不完整!!");
} else {
DistrilbutionBillLadingEntity billLadingEntity1 = baseMapper.selectById((Serializable) billLadingId);
if(ObjectUtils.isNotNull(billLadingEntity1) && billLadingEntity1.getConditions().equals("20")){
if(ObjectUtils.isNotNull(billLadingEntity1) && "20".equals(billLadingEntity1.getConditions())){
return Resp.scanFail("提货任务已完成!", "提货任务已完成!");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
@ -1565,6 +1553,16 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//修改备货订单状态
distributionAsyncService.getBillStock(one1.getId());
}
//修改在库数量
if(ObjectUtils.isNotNull( one.getHandQuantity()) && one.getHandQuantity() > 0){
int i = one.getHandQuantity() - 1;
int i2 = ObjectUtils.isNull(one.getSigninQuantity()) ? 1 : one.getSigninQuantity() + 1;
distributionStockArticleService.update(Wrappers.<DistributionStockArticleEntity>update()
.eq("id",one.getId())
.set("hand_quantity",i)
.set("signin_quantity", i2)
);
}
//修改包件状态
distributionAsyncService.getSelfPickup(list1.get(0).getId());
distributionBillLadingScan.setParcelListId(list1.get(0).getId());
@ -1691,17 +1689,29 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//修改订单状态
List<DistrilbutionBillStockEntity> list = distrilbutionBillStockService.list(Wrappers.<DistrilbutionBillStockEntity>query().lambda()
.eq(DistrilbutionBillStockEntity::getBillLadingId, s)
.eq(DistrilbutionBillStockEntity::getOrderStatus, "1")
.or(ew -> ew.eq(DistrilbutionBillStockEntity::getBillLadingId, s).eq(DistrilbutionBillStockEntity::getOrderStatus, "2"))
.apply("order_status in ( 1 , 2)")
// .or(ew -> ew.eq(DistrilbutionBillStockEntity::getBillLadingId, s).apply(DistrilbutionBillStockEntity::getOrderStatus, "2"))
);
if (!list.isEmpty()) {
list.forEach(li -> {
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
stockArticleEntity.setId(li.getStockArticleId());
List<DistributionParcelListEntity> list2 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getStockArticleId, li.getStockArticleId())
.apply("order_package_status != 70 ")
);
if(list2.isEmpty()){
stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
}else{
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
//回退包件数据
Integer i1 = updatePack(li.getStockArticleId(), Long.valueOf(s));
if(i1 > 0){
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue());
}
distributionStockArticleService.updateById(stockArticleEntity);
//添加签收包件数据
updatePack(li.getStockArticleId(), Long.valueOf(s));
});
}
//处理库存品签收数据
@ -1748,13 +1758,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
* 修改包件签收状态
*/
@Transactional(rollbackFor = Exception.class)
public void updatePack(Long ids,Long billId){
public Integer updatePack(Long ids,Long billId){
List<DistrilbutionBillPackageEntity> list = distrilbutionBillPackageService.list(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getBillLadingId, billId)
.eq(DistrilbutionBillPackageEntity::getStockArticleId, ids)
);
List<DistributionBillLadingScanEntity> scanEntityList = new ArrayList<>();
AtomicReference<Integer> num = new AtomicReference<>(0);
if(ObjectUtils.isNotNull(list) && !list.isEmpty()){
//签收记录
List<DistributionBillLadingScanEntity> list1 = distributionBillLadingScanService.list(Wrappers.<DistributionBillLadingScanEntity>query().lambda()
@ -1792,26 +1803,16 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
parcelListEntity.setId(i.getParceListId());
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
//修改订单状态
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setId(i.getStockArticleId());
stockArticleEntity.setOrderReceiveStatus(OrderReservationStatusConstant.bufenyuyue.getValue());
distributionStockArticleService.updateById(stockArticleEntity);
// DistributionBillLadingScanEntity billLadingScan = new DistributionBillLadingScanEntity();
// billLadingScan.setMaterialType("2");
// billLadingScan.setScanType(2);
// billLadingScan.setParcelListId(i.getParceListId());
// billLadingScan.setStockArticleId(i.getStockArticleId());
// billLadingScan.setBillLadingId(billId);
// billLadingScan.setPacketBarCode( i.getPacketBarCode());
// billLadingScan.setQuantity(i.getPacketNumber());
// scanEntityList.add(billLadingScan);
num.getAndSet(num.get() + 1);
});
// if(!scanEntityList.isEmpty()){
// distributionBillLadingScanService.saveBatch(scanEntityList);
// }
}
return num.get();
}

Loading…
Cancel
Save