| | |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.impl.WrkDetlServiceImpl; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | EntityWrapper<WrkMast> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(WrkMast.class, param.keySet(), wrapper, condition); |
| | | |
| | | if (!Cools.isEmpty(orderNo)) { |
| | | List<WrkDetl> detls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("order_no", orderNo)); |
| | | if (!Cools.isEmpty(detls)) { |
| | |
| | | return R.error("请至少选择一行数据"); |
| | | } |
| | | for (WrkMast entity : list){ |
| | | entity.setIoPri(entity.getIoPri() + 1); |
| | | if (!wrkMastService.update(entity, new EntityWrapper<WrkMast>().eq("wrk_no", entity.getWrkNo()))) { |
| | | throw new CoolException("优先级更新失败!"); |
| | | } |
| | | entity.setIoPri(entity.getIoPri() + 1); |
| | | if (!wrkMastService.update(entity, new EntityWrapper<WrkMast>().eq("wrk_no", entity.getWrkNo()))) { |
| | | throw new CoolException("优先级更新失败!"); |
| | | } |
| | | } |
| | | // wrkMastService.updateBatchById(list); |
| | | return R.ok(); |
| | |
| | | |
| | | @RequestMapping(value = "/wrkMast/red/pri/auth") |
| | | @ManagerAuth(memo = "工作档降低优先级") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | |
| | | public R redPri(@RequestBody List<WrkMast> list) { |
| | | if (list.isEmpty()) { |
| | | return R.error("请至少选择一行数据"); |
| | | } |
| | | for (WrkMast entity : list){ |
| | | entity.setIoPri(entity.getIoPri() - 1); |
| | | if (!wrkMastService.update(entity, new EntityWrapper<WrkMast>().eq("wrk_no", entity.getWrkNo()))) { |
| | | throw new CoolException("优先级更新失败!"); |
| | | } |
| | | } |
| | | wrkMastService.updateBatchById(list); |
| | | // wrkMastService.updateBatchById(list); |
| | | return R.ok(); |
| | | } |
| | | |