| | |
| | | @Transactional |
| | | public boolean submit(WorksheetMain main, DocUser user) { |
| | | List<ProductBomApproving> bomList = main.getApprovingBomList(); |
| | | int rejectVersion=-1; |
| | | //提交主表 |
| | | main.setCreateUserId(user.getId()); |
| | | //提交人角色来判断工作流层级 |
| | | if(user.getRoleId().equals("1001")){ |
| | | main.setLevel(2); |
| | | main.setStatus(1); |
| | | mainMapper.insert(main); |
| | | if(main.getId()==null) { |
| | | main.setLevel(2); |
| | | main.setStatus(1); |
| | | mainMapper.insert(main); |
| | | }else { |
| | | rejectVersion = approvingService.getRejectVersion(main.getId()); |
| | | } |
| | | //提交子表 |
| | | WorksheetLink link =new WorksheetLink(); |
| | | link.setMainId(main.getId()); |
| | |
| | | link.setDealDesc(main.getDealDesc()); |
| | | link.setLinkStatus(0); |
| | | link.setEnableArchive(0); |
| | | link.setRejectVersion(rejectVersion+1); |
| | | linkMapper.insert(link); |
| | | } |
| | | else if(user.getRoleId().equals("1002")){ |
| | | main.setLevel(1); |
| | | main.setStatus(2); |
| | | mainMapper.insert(main); |
| | | if(main.getId()==null) { |
| | | main.setLevel(1); |
| | | main.setStatus(2); |
| | | mainMapper.insert(main); |
| | | }else { |
| | | rejectVersion = approvingService.getRejectVersion(main.getId()); |
| | | } |
| | | //提交子表 |
| | | WorksheetLink link =new WorksheetLink(); |
| | | link.setMainId(main.getId()); |
| | |
| | | link.setDealDesc(main.getDealDesc()); |
| | | link.setLinkStatus(0); |
| | | link.setEnableArchive(1); |
| | | link.setRejectVersion(rejectVersion+1); |
| | | linkMapper.insert(link); |
| | | } |
| | | else if(user.getRoleId().equals("1003")){ |
| | |
| | | } |
| | | //产品bom/图纸图片提交 |
| | | //查询当前驳回版本 |
| | | int rejectVersion = approvingService.getRejectVersion(main.getId()); |
| | | int nextRejectVersion = rejectVersion+1; |
| | | bomList.forEach(bom->{ |
| | | bom.setMainId(main.getId()); |