Browse Source

配送取消包件日志增加

dist.1.3.0
汤建军 10 months ago
parent
commit
381b317b9d
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationPackageService.java
  2. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationPackageServiceImpl.java
  3. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

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

@ -99,7 +99,7 @@ public interface IDistributionReservationPackageService extends BaseService<Dist
* @param packageId
* @return
*/
boolean cancelReservationPackage(Long reservationId, Long packageId);
boolean cancelReservationPackage(Long reservationId, Long packageId,String reservationCode);
String getConcatMaterialName(Long reservationId, Long stockArticleId);

38
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationPackageServiceImpl.java

@ -32,18 +32,24 @@ import com.logpm.distribution.service.IDistributionReservationPackageService;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppParcelListVO;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -59,6 +65,7 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
private IDistributionParcelListService parcelListService;
private IBasicdataWarehouseClient warehouseClient;
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Override
@ -158,8 +165,12 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
@Override
@Transactional
public boolean cancelReservationPackage(Long reservationId, Long packageId) {
public boolean cancelReservationPackage(Long reservationId, Long packageId,String reservationCode) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("取消配送包件未进行仓库选择");
return false;
}
//取消预约
List<DistributionReservationPackageEntity> packageEntityList = this.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, reservationId)
@ -169,10 +180,15 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
if (packageEntityList.size() == 1){
//执行计划的包件取消
List<JSONObject> aaa = new ArrayList<>();
DistributionReservationPackageEntity distributionReservationPackageEntity = packageEntityList.get(0);
distributionReservationPackageEntity.setCancelStatus(1);
distributionReservationPackageEntity.setCancelRemark(AuthUtil.getNickName()+"进行配车计划取消订制品");
distributionReservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
this.updateById(distributionReservationPackageEntity);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消配车计划,操作方式:配送详情进行客户包件批量选中取消,预约任务号:"+reservationCode;
aaa.add(handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),distributionReservationPackageEntity.getPacketBarCode(),content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode()));
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}else {
//计划出现查询该包件记录错误,
return false;
@ -192,5 +208,23 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
return baseMapper.getConcatMaterialName(reservationId,stockArticleId);
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",warehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;
}
}

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

@ -3444,6 +3444,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
log.error(method+"packageId参数缺失");
return R.fail("请联系管理员....");
}
DistributionReservationEntity reservationEntity = this.getById(distributionCancelReservationPackageDTO.getReservationId());
if (Func.isEmpty(reservationEntity)){
log.error(method+"查询预约计划信息错误>>>>>>>>>>>>>>>>>>reservationId:{}",distributionCancelReservationPackageDTO.getReservationId());
return R.fail("请联系管理员....");
}
List<Long> list = Func.toLongList(distributionCancelReservationPackageDTO.getPackageIds());
log.info(method+"取消包件>>>>:{}",distributionCancelReservationPackageDTO.getPackageIds());
switch (distributionCancelReservationPackageDTO.getType()){
@ -3478,7 +3483,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
/**
* 取消指定预约下包件
*/
boolean flag = distributionReservationPackageService.cancelReservationPackage(distributionCancelReservationPackageDTO.getReservationId(),Long.parseLong(s));
boolean flag = distributionReservationPackageService.cancelReservationPackage(distributionCancelReservationPackageDTO.getReservationId(),Long.parseLong(s),reservationEntity.getReservationCode());
if (flag){
//任务包件取消成功
//维护此预约下的订单计划状态

Loading…
Cancel
Save