| | |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.WaitPakinService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitPakin/update/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth |
| | | public R update(WaitPakin waitPakin){ |
| | | if (Cools.isEmpty(waitPakin)){ |
| | | return R.error(); |
| | | } |
| | | waitPakinService.updateById(waitPakin); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitPakin/update/beBatch/auth") |
| | | @ManagerAuth |
| | | public R updateBeBatch(@RequestBody Map<String, Object> param) { |
| | | String zpallet = (String) param.get("zpallet"); |
| | | Integer beBatch = Integer.parseInt(param.get("beBatch").toString()); |
| | | |
| | | if (Cools.isEmpty(zpallet)) { |
| | | return R.error("托盘码不能为空"); |
| | | } |
| | | |
| | | boolean result = waitPakinService.updateBeBatchByZpallet(zpallet, beBatch); |
| | | |
| | | if (result) { |
| | | return R.ok("修改成功"); |
| | | } else { |
| | | return R.error("修改失败"); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitPakin/delete/auth") |
| | |
| | | waitPakinService.delete(new EntityWrapper<>(entity)); |
| | | //订单关联,修改订单作业数量 |
| | | if (!Cools.isEmpty(entity.getOrderNo())) { |
| | | if (!orderDetlService.decrease(entity.getOrderNo(), entity.getMatnr(), entity.getBatch(), entity.getAnfme())) { |
| | | return R.error("订单数据回滚失败"); |
| | | } |
| | | // if (!orderDetlService.decrease(entity.getOrderNo(), entity.getMatnr(), entity.getBatch(), entity.getAnfme())) { |
| | | // return R.error("订单数据回滚失败"); |
| | | // } |
| | | OrderInAndOutUtil.decrease(Boolean.TRUE, entity.getOrderNo(), entity.getMatnr(), entity.getBatch(),entity.getBrand() |
| | | ,entity.getStandby1(),entity.getStandby2(),entity.getStandby3() |
| | | ,entity.getBoxType1(),entity.getBoxType2(),entity.getBoxType3() |
| | | , entity.getAnfme()); |
| | | } |
| | | } |
| | | return R.ok(); |