| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Resource |
| | | private LocDetlMapper locDetlMapper; |
| | | |
| | | @Resource |
| | | private CommonService commonService; |
| | | |
| | | @Resource |
| | | private WrkMastLogService wrkMastLogService; |
| | | |
| | | @Resource |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | |
| | | @RequestMapping(value = "/locMast/init/pwd") |
| | | public R locMastInitPwd(@RequestParam(required = false) String pwd) { |
| | |
| | | if (oldLocMast.getLocSts().equals("R") || oldLocMast.getLocSts().equals("F") || oldLocMast.getLocSts().equals("S")) { |
| | | if (locMast.getLocSts().equals("O") || locMast.getLocSts().equals("D")) { |
| | | List<LocDetl> locDetls = locDetlService.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo())); |
| | | // 添加历史工作主档 |
| | | WrkMastLog wrkMastLog = new WrkMastLog(); |
| | | wrkMastLog.setWrkNo(commonService.getWorkNo(3)); |
| | | wrkMastLog.setIoTime(now); |
| | | wrkMastLog.setWrkSts(5); |
| | | wrkMastLog.setIoType(19); |
| | | wrkMastLog.setIoPri(13D); // 优先级 |
| | | wrkMastLog.setCrnNo(locMast.getCrnNo()); |
| | | wrkMastLog.setSourceLocNo(locMast.getLocNo()); |
| | | wrkMastLog.setLocNo(locMast.getLocNo()); |
| | | wrkMastLog.setBarcode(locMast.getBarcode()); // 托盘码 |
| | | wrkMastLog.setFullPlt("Y"); // 满板:Y |
| | | wrkMastLog.setPicking("N"); // 拣料 |
| | | wrkMastLog.setExitMk("N"); // 退出 |
| | | wrkMastLog.setEmptyMk("N"); // 空板 |
| | | wrkMastLog.setLinkMis("Y"); |
| | | // 操作人员数据 |
| | | wrkMastLog.setAppeTime(now); |
| | | wrkMastLog.setModiTime(now); |
| | | wrkMastLog.setAppeUser(getUserId()); |
| | | wrkMastLog.setModiUser(getUserId()); |
| | | boolean res = wrkMastLogService.insert(wrkMastLog); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | for (LocDetl locDetl : locDetls) { |
| | | // 保存调整记录 |
| | | AdjDetl adjDetl = new AdjDetl(); |
| | |
| | | adjDetl.setAppeUser(getUserId()); |
| | | if (!adjDetlService.insert(adjDetl)) { |
| | | throw new CoolException("服务器错误,请联系管理员"); |
| | | } |
| | | |
| | | // 添加历史工作明细 |
| | | WrkDetlLog wrkDetl = new WrkDetlLog(); |
| | | wrkDetl.sync(locDetl); |
| | | wrkDetl.setWrkNo(wrkMastLog.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMastLog.getIoTime()); |
| | | wrkDetl.setAnfme(0.0); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkMastLog.setAppeUser(getUserId()); |
| | | wrkMastLog.setModiUser(getUserId()); |
| | | if (!wrkDetlLogService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | } |
| | | if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()))) { |
| | |
| | | public R query(String condition) { |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("loc_no", condition); |
| | | Page<LocMast> page = locMastService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<LocMast> page = locMastService.selectPage(new Page<>(0, 10000), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (LocMast locMast : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |