| | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private LocRuleService locRuleService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/locRule/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | @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(); |
| | | } |