New file |
| | |
| | | package com.whyc.config; |
| | | |
| | | public enum EnumWorksheetType { |
| | | ProductBom(1,"产品Bom"), |
| | | Component(2,"散装件"), |
| | | ComponentProduct(3,"散装件-产品"); |
| | | |
| | | EnumWorksheetType(Integer type, String typeName) { |
| | | this.type = type; |
| | | this.typeName = typeName; |
| | | } |
| | | |
| | | private Integer type; |
| | | private String typeName; |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getTypeName() { |
| | | return typeName; |
| | | } |
| | | |
| | | public void setTypeName(String typeName) { |
| | | this.typeName = typeName; |
| | | } |
| | | } |
| | |
| | | @PostMapping("approve") |
| | | @ApiOperation(value = "总经理审批",notes = "传参:int id,int linkStatus,String dealReason,int mainId,int rejectVersion;" + |
| | | "linkStatus:1通过,2驳回,驳回到员工,通知经理;dealReason:审核意见") |
| | | public Response approve(@RequestBody WorksheetLink link,Integer componentProductFlag){ |
| | | service.approve(link,componentProductFlag); |
| | | public Response approve(@RequestBody WorksheetLink link){ |
| | | service.approve(link); |
| | | return new Response().setII(1,"审批完成"); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.whyc.config.EnumWorksheetType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.ibatis.type.Alias; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.util.Date; |
| | | import java.util.LinkedList; |
| | |
| | | private Integer status; |
| | | @ApiModelProperty("工单结束意见") |
| | | private String endReason; |
| | | |
| | | /** |
| | | * {@link EnumWorksheetType#getType()} |
| | | */ |
| | | @ApiModelProperty("工单类型:1-bom,2-散装件,3-bom-散装件") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("流程的下个处理人") |
| | | @TableField(exist = false) |
| | |
| | | public void setApprovingUser(DocUser approvingUser) { |
| | | this.approvingUser = approvingUser; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.config.EnumWorksheetType; |
| | | import com.whyc.mapper.ProductBomApprovingMapper; |
| | | import com.whyc.mapper.WorksheetLinkMapper; |
| | | import com.whyc.pojo.*; |
| | |
| | | } |
| | | |
| | | @Transactional |
| | | public void approve(WorksheetLink link, Integer componentProductFlag) { |
| | | public void approve(WorksheetLink link) { |
| | | //根据节点,查询主表类型 |
| | | Integer type = mainService.getInfoById(link.getMainId()).getType(); |
| | | link.setDealTime(new Date()); |
| | | //更新节点信息 |
| | | linkMapper.updateById(link); |
| | |
| | | }else { |
| | | //审批通过,更新主表状态 |
| | | mainService.updateEndStatusById(link.getMainId(), "完结", 5); |
| | | if (componentProductFlag == null) { //产品审批 |
| | | if (type.intValue() == EnumWorksheetType.ProductBom.getType()) { //产品审批 |
| | | //将产品文件复制至正式路径 |
| | | QueryWrapper<ProductBomApproving> query = Wrappers.query(); |
| | | query.eq("main_id", link.getMainId()); |
| | |
| | | }); |
| | | //更新正式bom的对应url |
| | | bomService.updateUrl(fileBomApprovingList); |
| | | }else{ //更新散装件-产品关系 |
| | | } |
| | | else if(type.intValue() == EnumWorksheetType.Component.getType()){ //散装件 TODO |
| | | |
| | | } |
| | | else if(type.intValue() == EnumWorksheetType.ComponentProduct.getType()){ //更新散装件-产品关系 |
| | | //查找到对应的散装件-产品关系数据 |
| | | List<ComponentProductApproving> cpAList = cpAService.getListByMainId(link.getMainId()); |
| | | //查询部件最新的版本号 |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.config.EnumWorksheetType; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.WorksheetMainDTO; |
| | | import com.whyc.mapper.DocUserMapper; |
| | |
| | | |
| | | @Transactional |
| | | public boolean submit(WorksheetMain main, DocUser user) { |
| | | main.setType(1); |
| | | List<ProductBomApproving> bomList = main.getApprovingBomList(); |
| | | int rejectVersion=-1; |
| | | //提交主表 |
| | |
| | | List<ComponentProductApproving> replacedList = mainDTO.getReplacedList(); |
| | | List<ComponentProductApproving> removedList = mainDTO.getRemovedList(); |
| | | |
| | | main.setType(EnumWorksheetType.ComponentProduct.getType()); |
| | | //提交主表 |
| | | main.setCreateUserId(user.getId()); |
| | | //提交人角色来判断工作流层级 |