| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.handler.WorkLogHandler; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.model.LocDto; |
| | | import com.zy.common.model.TaskDto; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private PackService packService; |
| | | |
| | | |
| | | // 商品上架 |
| | | @RequestMapping("/mat/onSale/auth") |
| | | //@ManagerAuth |
| | | public R matOnSale(@RequestBody CombParam combParam){ |
| | | mobileService.onSale(combParam); |
| | | return R.ok("上架成功"); |
| | | } |
| | | // 商品下架 |
| | | |
| | | // 组托 ---------------------------------------------------------------------------------------------------- |
| | | |
| | |
| | | if (wrkMast != null) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | // 去除已出库确认的明细 |
| | | wrkDetls.removeIf(wrkDetl -> wrkDetl.getInspect() == 1); |
| | | wrkDetls.removeIf(wrkDetl -> wrkDetl.getInspect() != null && wrkDetl.getInspect() != 0); |
| | | return R.ok().add(Cools.add("wrkNo", wrkMast.getWrkNo()).add("ioType", wrkMast.getIoType()).add("list", wrkDetls)); |
| | | } |
| | | return R.ok(); |
| | |
| | | if (Cools.isEmpty(list)) { |
| | | return R.ok(); |
| | | } |
| | | // todo:luxiaotao 拣料出库可修改工作档明细 |
| | | Set<Integer> wrkNos = new HashSet<>(); |
| | | List<WrkDto> dtos = new ArrayList<>(); |
| | | for (WrkDetl wrkDetl : list) { |
| | | wrkNos.add(wrkDetl.getWrkNo()); |
| | | wrkDetlService.updateInspect(wrkDetl.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | if (wrkNos.contains(wrkDetl.getWrkNo())) { |
| | | for (WrkDto dto : dtos) { |
| | | if (dto.getWrkNo().equals(wrkDetl.getWrkNo())) { |
| | | dto.getWrkDetls().add(wrkDetl); |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | wrkNos.add(wrkDetl.getWrkNo()); |
| | | dtos.add(new WrkDto(wrkDetl.getWrkNo(), wrkDetl)); |
| | | } |
| | | } |
| | | |
| | | for (WrkDto dto : dtos) { |
| | | WrkMast wrkMast = wrkMastService.selectById(dto.getWrkNo()); |
| | | if (wrkMast != null) { |
| | | // 101 |
| | | if (wrkMast.getIoType() == 101) { |
| | | for (WrkDetl wrkDetl : dto.getWrkDetls()) { |
| | | wrkDetlService.updateInspect(wrkDetl.getWrkNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
| | | } |
| | | } |
| | | // 103 |
| | | if (wrkMast.getIoType() == 103) { |
| | | if (!wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()))) { |
| | | throw new CoolException("拣料出库确认失败"); |
| | | } |
| | | for (WrkDetl wrkDetl : dto.getWrkDetls()) { |
| | | wrkDetl.setInspect(1); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("拣料出库确认失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (Integer wrkNo : wrkNos) { |
| | | WrkMast wrkMast = wrkMastService.selectById(wrkNo); |
| | | if (wrkMast.getWrkSts() == 14 && (Cools.isEmpty(wrkMast.getInvWh()) || wrkMast.getInvWh().equals("N"))) { |
| | |
| | | return R.ok("盘点成功"); |
| | | } |
| | | |
| | | @PostMapping("/order/out/pakout/auth") |
| | | @ManagerAuth(memo = "订单出库") |
| | | public synchronized R pakoutByOrder(@RequestBody JSONObject param) { |
| | | if(!param.containsKey("staNo") || !param.containsKey("orderNo")){ |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | mobileService.pakoutByOrder(param,getUserId()); |
| | | return R.ok("出库成功"); |
| | | } |
| | | |
| | | |
| | | /*...........................赣州新增..............以下.............赣州新增...........................*/ |
| | | @PostMapping("/test/startUp/auth") |
| | | @ManagerAuth(memo = "申请PACK测试") |
| | | public synchronized R startUpTestPACK(@RequestBody TestMast testMast) { |
| | | if (Cools.isEmpty(testMast)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | mobileService.startUpTestPACK(testMast); //提交测试系统 |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/test/suspend/auth") |
| | | @ManagerAuth(memo = "暂停测试") |
| | | public synchronized R suspendTestPACK() { |
| | | mobileService.suspendTestPACK(); //请求暂停测试 |
| | | return R.ok(); |
| | | } |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | |
| | | |
| | | } |