diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java index 7a2960d..fdfbbe0 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java +++ b/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 修改结果 */ @PostMapping("/update") @Log("修改") - //@SaCheckPermission("@el.check(EasOutInBillDetail:edit')") - public CommonResult update(@RequestBody List entity) { - return RestBusinessTemplate.execute(() -> easOutInBillDetailService.update(entity)); + //@SaCheckPermission("@el.check(EasOutInBillDetail:update')") + public CommonResult update(@RequestBody List entityList) { + 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 entityList) { + return RestBusinessTemplate.execute(() -> easOutInBillDetailService.updateBillDetail(entityList)); + } + + + + + + + /** * 出入库明细分页查询 * diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillDetailService.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillDetailService.java index 095f34a..b82876f 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillDetailService.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/IeasOutInBillDetailService.java @@ -61,9 +61,19 @@ public interface IeasOutInBillDetailService extends IService /** * 编辑 * - * @param entity / + * @param entityList / + */ + void update(List entityList); + + + /** + * 批量修改库位信息 + * + * @param entityList / */ - void update(List entity); + void updateBillDetail(List entityList); + + /** diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java index 3765269..2f56900 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillDetailServiceImpl.java +++ b/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; 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.QueryWrapper; 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.lang3.StringUtils; +import org.nl.common.base.CommonPage; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; -import org.nl.wms.database.eas.dao.*; -import org.nl.wms.database.eas.dto.*; +import org.nl.wms.database.eas.dao.EasOutInBillDetail; +import org.nl.wms.database.eas.dao.InventoryInfo; 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 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.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import cn.hutool.core.util.ObjectUtil; import org.springframework.beans.BeanUtils; - -import javax.annotation.Resource; - -import org.nl.common.base.CommonPage; -import org.springframework.transaction.annotation.Propagation; +import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.math.BigDecimal; import java.util.*; -import java.util.concurrent.CompletableFuture; import java.util.function.Function; import java.util.stream.Collectors; @@ -42,7 +38,6 @@ import java.util.stream.Collectors; public class EasOutInBillDetailServiceImpl extends ServiceImpl implements IeasOutInBillDetailService { - @Resource private EasOutInBillDetailMapper easOutInBillDetailMapper; @@ -50,8 +45,6 @@ public class EasOutInBillDetailServiceImpl extends ServiceImpl entityList) { + if (CollectionUtils.isNotEmpty(entityList)) { + UpdateWrapper 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