|  |  | 
 |  |  |             "source_loc_no," + | 
 |  |  |             "loc_no," + | 
 |  |  |             "barcode," + | 
 |  |  |             "manu_type," + | 
 |  |  |             "appe_user," + | 
 |  |  |             "appe_time," + | 
 |  |  |             "modi_user," + | 
 |  |  |             "modi_time) " + | 
 |  |  |             "VALUES(#{wrkNo},#{wrkSts},#{ioType},#{ioTime},#{ioPri},#{sourceLocNo},#{locNo},#{barcode},#{appeUser},#{appeTime},#{modiUser},#{modiTime})") | 
 |  |  |             "VALUES(#{wrkNo},#{wrkSts},#{ioType},#{ioTime},#{ioPri},#{sourceLocNo},#{locNo},#{barcode},#{manuType},#{appeUser},#{appeTime},#{modiUser},#{modiTime})") | 
 |  |  |     int saveByWrkMast(AgvWrkMast agvWrkMast); | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |             "crn_no," + | 
 |  |  |             "barcode," + | 
 |  |  |             "whs_type," + | 
 |  |  |             "manu_type," + | 
 |  |  |             "appe_user," + | 
 |  |  |             "appe_time," + | 
 |  |  |             "modi_user," + | 
 |  |  |             "modi_time) " + | 
 |  |  |             "VALUES(#{wrkSts},#{ioType},#{ioTime},#{ioPri},#{sourceLocNo},#{locNo},#{crnNo},#{barcode},#{whsType},#{appeUser},#{appeTime},#{modiUser},#{modiTime})") | 
 |  |  |             "VALUES(#{wrkSts},#{ioType},#{ioTime},#{ioPri},#{sourceLocNo},#{locNo},#{crnNo},#{barcode},#{whsType},#{manuType},#{appeUser},#{appeTime},#{modiUser},#{modiTime})") | 
 |  |  |     public int insertByIncrease(AgvWrkMast agvWrkMast); | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |  | 
 |  |  |     public void updateWrkStsByWrkNo(int wrkNo, long wrkSts); | 
 |  |  |  | 
 |  |  |     public void updateWrkStsByWrkNo(int wrkNo, long wrkSts,String manuType,long userId); | 
 |  |  |  | 
 |  |  |     public int startWrk(AgvWrkMast agvWrkMast) throws IOException; | 
 |  |  |  | 
 |  |  |     public int containerMoveIn(List<AgvWrkMast> agvWrkMastList) throws IOException; | 
 
 |  |  | 
 |  |  | //            throw new CoolException("目标库位或者源库位暂未分配,无法取消"); | 
 |  |  | //        } | 
 |  |  |         //修改AGV工作档的工作状态为205.工作完成 | 
 |  |  |         agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),205); | 
 |  |  |         //agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),205); | 
 |  |  |  | 
 |  |  |         agvWrkMastService.updateWrkStsByWrkNo(wrkMast.getWrkNo(),205,"手动完成",userId); | 
 |  |  |  | 
 |  |  |         //出库任务 101.出库 || 103.拣料出库 || 107.盘点出库 | 
 |  |  |         if(wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103 || wrkMast.getIoType() == 107 || wrkMast.getIoType() == 111){ | 
 |  |  | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |         wrkMast.setModiUser(userId); | 
 |  |  |         wrkMast.setModiTime(new Date()); | 
 |  |  |         if (type == 2) { | 
 |  |  |             wrkMast.setManuType("手动取消(agv)"); | 
 |  |  |         } else { | 
 |  |  |             wrkMast.setManuType("手动取消"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         //保存工作档以及明细 | 
 |  |  |         agvWrkMastLogService.save(wrkMast); | 
 |  |  |         agvWrkDetlLogService.save(wrkMast.getWrkNo()); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         //删除工作档以及明细 | 
 |  |  |         if(!agvWrkMastService.deleteByWrkNo(wrkMast.getWrkNo()) || !agvWrkDetlService.deleteByWrkNo(wrkMast.getWrkNo())){ | 
 |  |  |             throw new CoolException("删除失败,请联系管理员"); | 
 
 |  |  | 
 |  |  |         this.updateById(agvWrkMast); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void updateWrkStsByWrkNo(int wrkNo, long wrkSts,String manuType,long userId) { | 
 |  |  |         Date now = new Date(); | 
 |  |  |         AgvWrkMast agvWrkMast = this.selectById(wrkNo); | 
 |  |  |         //判断要修改的工作档状态是否合理,如果不合理则抛出异常 | 
 |  |  |         checkWrkSts(agvWrkMast,wrkSts); | 
 |  |  |         agvWrkMast.setWrkSts(wrkSts); | 
 |  |  |         agvWrkMast.setManuType(manuType); | 
 |  |  |         agvWrkMast.setModiTime(now); | 
 |  |  |         agvWrkMast.setModiUser(userId); | 
 |  |  |         this.updateById(agvWrkMast); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // TODO 判断规则 | 
 |  |  |     private boolean checkWrkSts(AgvWrkMast agvWrkMast,long wrkSts){ | 
 |  |  |  |