skyouc
2025-03-21 f22911d5eaf2cc7da49bd720853c229ecfaa32fa
库位修改,库位类型未空管
4个文件已修改
39 ■■■■ 已修改文件
rsf-admin/.env 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/common/domain/PageParam.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocTypeController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rsf-admin/.env
@@ -1,3 +1,3 @@
VITE_BASE_IP=192.168.4.16
VITE_BASE_IP=127.0.0.1
#VITE_BASE_IP=47.76.147.249
VITE_BASE_PORT=8080
rsf-server/src/main/java/com/vincent/rsf/server/common/domain/PageParam.java
@@ -98,9 +98,9 @@
                    key = Utils.toSymbolCase(key, '_');
                }
                if (like) {
                    queryWrapper.like(key, val);
                    queryWrapper.like("`" +  key + "`", val);
                } else {
                    queryWrapper.eq(key, val);
                    queryWrapper.eq("`" +  key + "`", val);
                }
            }
        }
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocController.java
@@ -100,7 +100,9 @@
        loc.setUpdateBy(getLoginUserId());
        String join = StringUtils.join(loc.getTypeIds(), ",");
        loc.setType(join);
        if (Objects.isNull(loc.getTypeIds())) {
            throw new CoolException("库位类型不能为空!!");
        }
        if (!locService.updateById(loc)) {
            return R.error("Update Fail");
        }
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocTypeController.java
@@ -11,10 +11,12 @@
import com.vincent.rsf.server.common.domain.KeyValVo;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.manager.entity.LocType;
import com.vincent.rsf.server.manager.entity.MatnrGroup;
import com.vincent.rsf.server.manager.service.LocTypeService;
import com.vincent.rsf.server.system.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@@ -65,8 +67,20 @@
        if (Objects.isNull(locType.getRegex())) {
            throw new CoolException("库位规则表达式不能为空!!");
        }
        locType.setCreateBy(getLoginUserId());
        locType.setUpdateBy(getLoginUserId());
        List<LocType> list = locTypeService.list(new LambdaQueryWrapper<LocType>()
                .eq(LocType::getCode, locType.getCode()));
        if (!list.isEmpty()) {
            throw new CoolException("编码不能重复!!");
        }
        List<LocType> groups = locTypeService.list(new LambdaQueryWrapper<LocType>()
                .eq(LocType::getName, locType.getName()));
        if (!groups.isEmpty()) {
            throw new CoolException("名称已存在,请勿重复添加!!");
        }
        if (!locTypeService.save(locType)) {
            return R.error("Save Fail");
        }
@@ -76,6 +90,7 @@
    @PreAuthorize("hasAuthority('manager:locType:update')")
    @OperationLog("Update loc type")
    @PostMapping("/locType/update")
    @Transactional(rollbackFor = Exception.class)
    public R update(@RequestBody LocType locType) {
        if (Objects.isNull(locType.getName())) {
            throw new CoolException("库位类型不能为空!!");
@@ -86,6 +101,20 @@
        if (Objects.isNull(locType.getRegex())) {
            throw new CoolException("库位规则表达式不能为空!!");
        }
        LocType locType1 = locTypeService.getById(locType.getId());
        if (!locType.getName().equals(locType1.getName())) {
            List<LocType> areasList = locTypeService.list(new LambdaQueryWrapper<LocType>().eq(LocType::getName, locType.getName()));
            if (!areasList.isEmpty()) {
                throw new CoolException("仓库名已存在!!");
            }
        }
        if (!locType.getCode().equals(locType1.getCode())) {
            List<LocType> locTypeList = locTypeService.list(new LambdaQueryWrapper<LocType>().eq(LocType::getCode, locType.getCode()));
            if (!locTypeList.isEmpty()) {
                throw new CoolException("仓库编码已存在!!");
            }
        }
        locType.setUpdateBy(getLoginUserId());
        if (!locTypeService.updateById(locType)) {
            return R.error("Update Fail");