|
|
@@ -107,7 +107,8 @@ public class KwoTransportDemandService {
|
|
|
*/
|
|
|
private KwoTransportDemand getById(Long id) {
|
|
|
LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
|
|
|
- wrapper.eq(KwoTransportDemand::getId, id).eq(KwoTransportDemand::getDelFlag, Global.NO).last("LIMIT 1");
|
|
|
+ wrapper.eq(KwoTransportDemand::getId, id).eq(KwoTransportDemand::getEntId,LoginUserHolder.getEntId())
|
|
|
+ .eq(KwoTransportDemand::getDelFlag, Global.NO).last("LIMIT 1");
|
|
|
return kwoTransportDemandMapper.selectOne(wrapper);
|
|
|
}
|
|
|
|
|
|
@@ -123,12 +124,6 @@ public class KwoTransportDemandService {
|
|
|
if (Objects.isNull(demand)) {
|
|
|
throw new BusinessException("数据不存在!");
|
|
|
}
|
|
|
- if (!Objects.equals(demand.getEntId(), LoginUserHolder.getEntId())) {
|
|
|
- throw new BusinessException("无操作权限!");
|
|
|
- }
|
|
|
- if (!Objects.equals(String.valueOf(demand.getStatus()), DictEnum.TRANSPORT_DEMAND_STATUS_0.getValue())) {
|
|
|
- checkParams(param);
|
|
|
- }
|
|
|
BeanUtils.copyProperties(param, demand);
|
|
|
kwoTransportDemandMapper.updateById(demand);
|
|
|
}
|
|
|
@@ -313,23 +308,19 @@ public class KwoTransportDemandService {
|
|
|
* @Param id:
|
|
|
* @return: void
|
|
|
*/
|
|
|
- public void putOnShelves(Long id) {
|
|
|
- KwoTransportDemand demand = getById(id);
|
|
|
- if (Objects.isNull(demand)) {
|
|
|
- throw new BusinessException("数据不存在!");
|
|
|
- }
|
|
|
- if (!Objects.equals(demand.getEntId(), LoginUserHolder.getEntId())) {
|
|
|
- throw new BusinessException("无操作权限!");
|
|
|
- }
|
|
|
- if (Objects.equals(String.valueOf(demand.getStatus()), DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue())) {
|
|
|
+ public void batchPutOnShelves(List<Long> ids) {
|
|
|
+ LambdaQueryWrapper<KwoTransportDemand> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.in(KwoTransportDemand::getId, ids)
|
|
|
+ .ne(KwoTransportDemand::getStatus, Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue()))
|
|
|
+ .eq(KwoTransportDemand::getEntId, LoginUserHolder.getEntId()).eq(KwoTransportDemand::getDelFlag, Global.NO);
|
|
|
+ List<KwoTransportDemand> list = kwoTransportDemandMapper.selectList(wrapper);
|
|
|
+ if (!Objects.equals(ids.size(), list.size())) {
|
|
|
throw new BusinessException("上架操作仅针对“已下架”“草稿”状态的单据!");
|
|
|
}
|
|
|
- if (Objects.equals(String.valueOf(demand.getStatus()), DictEnum.TRANSPORT_DEMAND_STATUS_0.getValue())) {
|
|
|
- UpdateTransportDemandParam param = BeanUtils.copyProperties(demand, UpdateTransportDemandParam.class);
|
|
|
- checkParams(param);
|
|
|
- }
|
|
|
- demand.setStatus(Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue()));
|
|
|
- kwoTransportDemandMapper.updateById(demand);
|
|
|
+ LambdaUpdateWrapper<KwoTransportDemand> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
+ updateWrapper.set(KwoTransportDemand::getStatus, Integer.valueOf(DictEnum.TRANSPORT_DEMAND_STATUS_1.getValue()))
|
|
|
+ .in(KwoTransportDemand::getId, ids);
|
|
|
+ kwoTransportDemandMapper.update(null, updateWrapper);
|
|
|
}
|
|
|
|
|
|
/**
|