| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.mapper.ProductBomApprovingMapper; |
| | | import com.whyc.mapper.WorksheetLinkMapper; |
| | | import com.whyc.pojo.DocUser; |
| | | import com.whyc.pojo.ProductBomApproving; |
| | | import com.whyc.pojo.WorksheetLink; |
| | | import com.whyc.util.CommonUtil; |
| | | import org.aspectj.util.FileUtil; |
| | | import com.whyc.pojo.WorksheetMain; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.naming.CommunicationException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | @Autowired |
| | | private ProductBomApprovingMapper approvingMapper; |
| | | |
| | | @Autowired |
| | | private ProductBomService bomService; |
| | | |
| | | @Autowired |
| | | private ProductBomHistoryService historyService; |
| | | |
| | | @Transactional |
| | | public void audit(WorksheetLink link) { |
| | |
| | | query.eq("main_id",link.getMainId()); |
| | | List<ProductBomApproving> approvingList = approvingMapper.selectList(query); |
| | | |
| | | //增加->增加部件(增加记录,同时所有eVersion+1) |
| | | //修改->修改部件图纸,修改部件非图纸(增加记录,同时修改非原部件的所有eVersion+1) |
| | | //删除? TODO 需要约定逻辑 |
| | | |
| | | //查询部件最新的版本号 |
| | | 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 |
| | | |
| | | /*String projectDir = CommonUtil.getProjectDir(); |
| | | FileUtil.copyDir()*/ |
| | | |
| | |
| | | public List<WorksheetLink> getInfoList(Long id) { |
| | | return linkMapper.getInfoList(id); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param userId 总经理对应的userId |
| | | * @param statusExp 0:未审批,1:已审批(包含状态值1,2) |
| | | * @return |
| | | */ |
| | | 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); |
| | | } |
| | | |
| | | public DocUser getApprovingUser(Integer mainId) { |
| | | return linkMapper.getApprovingUser(mainId); |
| | | } |
| | | } |