skyouc
2025-03-20 b051c20595c8563df49a50092a11468c8a99de46
rsf-server/src/main/java/com/vincent/rsf/server/manager/controller/LocTypeController.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vincent.rsf.framework.common.Cools;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.common.utils.ExcelUtil;
import com.vincent.rsf.server.common.annotation.OperationLog;
import com.vincent.rsf.server.common.domain.BaseParam;
@@ -55,10 +56,14 @@
    @OperationLog("Create loc type")
    @PostMapping("/locType/save")
    public R save(@RequestBody LocType locType) {
        if (Objects.isNull(locType.getName())) {
            throw new CoolException("库位类型不能为空!!");
        }
        if (Objects.isNull(locType.getRegex())) {
            throw new CoolException("库位规则表达式不能为空!!");
        }
        locType.setCreateBy(getLoginUserId());
        locType.setCreateTime(new Date());
        locType.setUpdateBy(getLoginUserId());
        locType.setUpdateTime(new Date());
        if (!locTypeService.save(locType)) {
            return R.error("Save Fail");
        }