whycxzp
2022-07-26 d4e2085bc9792233e55791a380ebfec6262dff73
src/main/java/com/whyc/service/WorksheetLinkService.java
@@ -30,6 +30,11 @@
    @Autowired
    private ProductBomApprovingMapper approvingMapper;
    @Autowired
    private ProductBomService bomService;
    @Autowired
    private ProductBomHistoryService historyService;
    @Transactional
    public void audit(WorksheetLink link) {
@@ -98,7 +103,16 @@
            //增加->增加部件(增加记录,同时所有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
@@ -128,4 +142,14 @@
    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);
    }
}