| | |
| | | |
| | | List<WorksheetMain> getInfoList2(Long userId, int statusExp); |
| | | |
| | | List<WorksheetMain> getInfoList3(Long userId, int statusExp); |
| | | |
| | | } |
| | |
| | | @Autowired |
| | | private ProductBomApprovingMapper approvingMapper; |
| | | |
| | | @Autowired |
| | | private ProductBomService bomService; |
| | | |
| | | @Autowired |
| | | private ProductBomHistoryService historyService; |
| | | |
| | | @Transactional |
| | | public void audit(WorksheetLink link) { |
| | |
| | | //增加->增加部件(增加记录,同时所有eVersion+1) |
| | | //修改->修改部件图纸,修改部件非图纸(增加记录,同时修改非原部件的所有eVersion+1) |
| | | //删除? TODO 需要约定逻辑 |
| | | //更新到product_bom_history |
| | | |
| | | //查询部件最新的版本号 |
| | | Integer version = bomService.getProduct(approvingList.get(0).getParentModel()).getVersion(); |
| | | if(version==null){ |
| | | version = 0; |
| | | } |
| | | Integer nextVersion = version+1; |
| | | //更新到product_bom_history,需要sVersion和eVersion |
| | | //增加所有部件,排查出相关的原部件,非也是更新 |
| | | //historyService.get |
| | | |
| | | //更新到product_bom |
| | | |
| | |
| | | public List<WorksheetMain> getInfoList2(Long userId, int statusExp) { |
| | | return linkMapper.getInfoList2(userId,statusExp); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param userId 总经理对应的userId |
| | | * @param statusExp 0:未审批,1:已审批(包含状态值1,2) |
| | | * @return |
| | | */ |
| | | public List<WorksheetMain> getInfoList3(Long userId, int statusExp) { |
| | | return linkMapper.getInfoList3(userId,statusExp); |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private ProductBomApprovingService approvingService; |
| | | |
| | | @Autowired |
| | | private ProductBomService bomService; |
| | | |
| | | @Transactional |
| | | public boolean submit(WorksheetMain main, DocUser user) { |
| | | List<ProductBomApproving> bomList = main.getApprovingBomList(); |
| | |
| | | return false; |
| | | } |
| | | //产品bom/图纸图片提交 |
| | | |
| | | //查询部件最新的版本号 |
| | | Integer version = bomService.getProduct(bomList.get(0).getParentModel()).getVersion(); |
| | | if(version==null){ |
| | | version = 0; |
| | | } |
| | | Integer finalVersion = version; |
| | | bomList.forEach(bom->{ |
| | | bom.setMainId(main.getId()); |
| | | bom.setVersion(finalVersion+1); |
| | | }); |
| | | approvingService.insert(bomList); |
| | | return true; |
| | |
| | | |
| | | public Response<PageInfo<WorksheetMain>> getHandledListPage(DocUser user, int pageNum, int pageSize) { |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | List<WorksheetMain> worksheetMainList = linkService.getInfoList2(user.getId(),1); |
| | | List<WorksheetMain> worksheetMainList = linkService.getInfoList3(user.getId(),1); |
| | | PageInfo<WorksheetMain> pageInfo = new PageInfo<>(worksheetMainList); |
| | | return new Response<PageInfo<WorksheetMain>>().set(1,pageInfo); |
| | | } |
| | |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | <select id="getInfoList3" resultMap="com.whyc.mapper.WorksheetMainMapper.Map_WorksheetMain"> |
| | | SELECT |
| | | m.id mid,m.*,l.deal_reason,l.deal_time |
| | | FROM |
| | | db_doc.tb_worksheet_main m, |
| | | db_doc.tb_worksheet_link l |
| | | WHERE |
| | | l.main_id = m.id |
| | | AND l.deal_user_id = #{userId} |
| | | <choose> |
| | | <when test="statusExp==0"> |
| | | AND link_status = 0 |
| | | </when> |
| | | <otherwise> |
| | | AND link_status in(1,2) |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | | </mapper> |