自动化立体仓库 - WMS系统
skyouc
1 天以前 d551f4cb37e271523644cc8a10a6a424a9ef26cd
src/main/java/com/zy/asrs/controller/LocAroundBindController.java
@@ -1,19 +1,23 @@
package com.zy.asrs.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.common.DateUtils;
import com.zy.asrs.entity.LocAroundBind;
import com.zy.asrs.entity.LocCache;
import com.zy.asrs.entity.LocDetl;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.param.InitDeviceLocParams;
import com.zy.asrs.enums.LocStsType;
import com.zy.asrs.service.LocAroundBindService;
import com.core.annotations.ManagerAuth;
import com.core.common.BaseRes;
import com.core.common.Cools;
import com.core.common.R;
import com.zy.asrs.service.LocDetlService;
import com.zy.asrs.service.impl.LocDetlServiceImpl;
import com.zy.asrs.service.impl.LocMastServiceImpl;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -25,6 +29,10 @@
    @Autowired
    private LocAroundBindService locAroundBindService;
    @Autowired
    private LocMastServiceImpl locMastService;
    @Autowired
    private LocDetlService locDetlService;
    @RequestMapping(value = "/locAroundBind/{id}/auth")
    @ManagerAuth
@@ -66,6 +74,22 @@
    @RequestMapping(value = "/locAroundBind/add/auth")
    @ManagerAuth
    public R add(LocAroundBind locAroundBind) {
        if (Objects.isNull(locAroundBind)) {
            return R.error("参数不能为空!!");
        }
        LocAroundBind aroundBind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>().eq("b_loc_no", locAroundBind.getBlocNo()));
        if (!Objects.isNull(aroundBind)) {
            return R.error("工位已绑定,不能重复绑定!");
        }
        LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locAroundBind.getBlocNo()));
        locMast.setLocSts(LocStsType.LOC_STS_TYPE_X.type);
        locMast.setDeleted(1);
        locMast.setFrozen(1);
        if (!locMastService.updateById(locMast)) {
            return R.error("原库禁用失败!!");
        }
        locAroundBindService.insert(locAroundBind);
        return R.ok();
    }
@@ -76,6 +100,11 @@
        if (Cools.isEmpty(locAroundBind) || null == locAroundBind.getId()) {
            return R.error();
        }
        if (locAroundBind.getLocType().equals(LocStsType.LOC_STS_TYPE_O.type)) {
            locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locAroundBind.getBlocNo()));
        }
        locAroundBindService.updateById(locAroundBind);
        return R.ok();
    }
@@ -128,9 +157,9 @@
    }
    /**
     * 台机绑定作业库位
     * 机台绑定作业库位
     *
     * @param locAroundBind
     * @param
     * @return
     */
    @ManagerAuth
@@ -140,7 +169,7 @@
            return R.error("参数不能为空");
        }
        if (Cools.isEmpty(params.getDevNo())) {
            return R.error("台机号不能为空");
            return R.error("机台号不能为空");
        }
        if (Cools.isEmpty(params.getStartRow())) {
            return R.error("起始排不能为空");