Browse Source

add: 增加出入库单据一键设置库位;

master1
龚宝雄 4 months ago
parent
commit
e6855f4b8d
  1. 27
      nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java
  2. 14
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillDetailService.java
  3. 46
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java

27
nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java

@ -54,17 +54,36 @@ public class EasOutInBillDetailController {
/** /**
* 修改库位 * 修改库位
* *
* @param entity 传入修改对象包含主键{"id":"1", "name":"熊二" } * @param entityList 传入修改对象包含主键{"id":"1", "name":"熊二" }
* @return 修改结果 * @return 修改结果
*/ */
@PostMapping("/update") @PostMapping("/update")
@Log("修改") @Log("修改")
//@SaCheckPermission("@el.check(EasOutInBillDetail:edit')") //@SaCheckPermission("@el.check(EasOutInBillDetail:update')")
public CommonResult update(@RequestBody List<EasOutInBillDetailVO> entity) { public CommonResult update(@RequestBody List<EasOutInBillDetailVO> entityList) {
return RestBusinessTemplate.execute(() -> easOutInBillDetailService.update(entity)); return RestBusinessTemplate.execute(() -> easOutInBillDetailService.update(entityList));
} }
/**
* 批量修改库位信息
*
* @param entityList 传入修改对象包含主键{"id":"1", "name":"熊二" }
* @return 修改结果
*/
@PostMapping("/updateBillDetail")
@Log("批量修改库位信息")
//@SaCheckPermission("@el.check(EasOutInBillDetail:updateBillDetail')")
public CommonResult updateBillDetail(@RequestBody List<EasOutInBillDetailVO> entityList) {
return RestBusinessTemplate.execute(() -> easOutInBillDetailService.updateBillDetail(entityList));
}
/** /**
* 出入库明细分页查询 * 出入库明细分页查询
* *

14
nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillDetailService.java

@ -61,9 +61,19 @@ public interface IeasOutInBillDetailService extends IService<EasOutInBillDetail>
/** /**
* 编辑 * 编辑
* *
* @param entity / * @param entityList /
*/
void update(List<EasOutInBillDetailVO> entityList);
/**
* 批量修改库位信息
*
* @param entityList /
*/ */
void update(List<EasOutInBillDetailVO> entity); void updateBillDetail(List<EasOutInBillDetailVO> entityList);
/** /**

46
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java

@ -1,34 +1,30 @@
package org.nl.wms.database.eas.service.impl; package org.nl.wms.database.eas.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.common.base.CommonPage;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.wms.database.eas.dao.*; import org.nl.wms.database.eas.dao.EasOutInBillDetail;
import org.nl.wms.database.eas.dto.*; import org.nl.wms.database.eas.dao.InventoryInfo;
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper; import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
import org.nl.wms.database.eas.dto.EasOutInBillDetailVO;
import org.nl.wms.database.eas.service.IeasOutInBillDetailService; import org.nl.wms.database.eas.service.IeasOutInBillDetailService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.wms.database.eas.service.IeasOutInBillService; import org.nl.wms.database.eas.service.IeasOutInBillService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import cn.hutool.core.util.ObjectUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.nl.common.base.CommonPage;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -42,7 +38,6 @@ import java.util.stream.Collectors;
public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetailMapper, EasOutInBillDetail> implements IeasOutInBillDetailService { public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetailMapper, EasOutInBillDetail> implements IeasOutInBillDetailService {
@Resource @Resource
private EasOutInBillDetailMapper easOutInBillDetailMapper; private EasOutInBillDetailMapper easOutInBillDetailMapper;
@ -50,8 +45,6 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
private IeasOutInBillService ieasOutInBillService; private IeasOutInBillService ieasOutInBillService;
/** /**
* 分页查询 * 分页查询
* *
@ -185,6 +178,24 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
} }
/**
* 批量修改库位信息
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateBillDetail(List<EasOutInBillDetailVO> entityList) {
if (CollectionUtils.isNotEmpty(entityList)) {
UpdateWrapper<EasOutInBillDetail> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("flid", entityList.stream().map(EasOutInBillDetailVO::getFlid).collect(Collectors.toSet()));
updateWrapper.set("kwbm", entityList.get(0).getKwbm());
updateWrapper.set("update_id", SecurityUtils.getCurrentUserId());
updateWrapper.set("update_name", SecurityUtils.getCurrentNickName());
updateWrapper.set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd"));
easOutInBillDetailMapper.update(null, updateWrapper);
}
}
/** /**
* 编辑 * 编辑
*/ */
@ -270,9 +281,6 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl<EasOutInBillDetai
} }
/** /**
* 多选删除 * 多选删除
* *

Loading…
Cancel
Save