自动化立体仓库 - WMS系统
zyx
2023-10-02 cda03cb23bc12f582029ac8d6df103d86e61fc8b
src/main/java/com/zy/asrs/controller/LocRuleController.java
@@ -10,6 +10,7 @@
import com.core.common.DateUtils;
import com.core.common.R;
import com.zy.asrs.entity.LocRule;
import com.zy.asrs.service.LocMastService;
import com.zy.asrs.service.LocRuleService;
import com.zy.common.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +23,8 @@
    @Autowired
    private LocRuleService locRuleService;
    @Autowired
    private LocMastService locMastService;
    @RequestMapping(value = "/locRule/{id}/auth")
    @ManagerAuth
@@ -76,7 +79,14 @@
        locRule.setCreateTime(now);
        locRule.setUpdateBy(getUserId());
        locRule.setUpdateTime(now);
        Integer locType2 = 1;//单品区域
        if (locRule.getMixed() == 1) {
            //混载
            locRule.setMatnr("00000000");
            locType2 = 2;//混放区域
        }
        locRuleService.insert(locRule);
        locMastService.updateLocType2ByRBL(locType2, locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
        return R.ok();
    }
@@ -98,6 +108,14 @@
        locRule.setUpdateBy(getUserId());
        locRule.setUpdateTime(new Date());
        locRuleService.updateById(locRule);
        Integer locType2 = 1;//单品区域
        if (locRule.getMixed() == 0) {
            locRuleService.updateKeepGoByMatnr(locRule.getMatnr(), locRule.getKeepGo());
        }else {//混载
            locRuleService.updateKeepGoByMixed(locRule.getKeepGo());
            locType2 = 2;//混放区域
        }
        locMastService.updateLocType2ByRBL(locType2, locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
        return R.ok();
    }
@@ -105,7 +123,9 @@
    @ManagerAuth
    public R delete(@RequestParam(value="ids[]") Long[] ids){
         for (Long id : ids){
            locRuleService.deleteById(id);
             LocRule locRule = locRuleService.selectById(id);
             locMastService.updateLocType2ByRBL(1, locRule.getRowBeg(), locRule.getRowEnd(), locRule.getBayBeg(), locRule.getBayEnd(), locRule.getLevBeg(), locRule.getLevEnd());
             locRuleService.deleteById(id);
        }
        return R.ok();
    }