已修改21个文件
已删除1个文件
已添加14个文件
| | |
| | | <artifactId>tika-core</artifactId> |
| | | <version>3.2.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <!--<dependency> |
| | | <groupId>org.springblade</groupId> |
| | | <artifactId>blade-starter-transaction</artifactId> |
| | |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.engine.TaskService; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.api.R; |
| | |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.mdm.flow.excution.StartDispatcher; |
| | | import org.springblade.mdm.flow.vo.TaskAssignVO; |
| | | import org.springblade.mdm.program.service.ProcessProgRefService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | private StartDispatcher dispatcher; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | @Autowired |
| | | private ProcessProgRefService processProgRefService; |
| | | /** |
| | | * æ°å¢ |
| | | */ |
| | | @PostMapping("/start") |
| | | @Operation(summary = "ä»»å¡è®¡å(派工æµç¨)", description = "å¯å¨æ´¾å·¥æµç¨") |
| | | public R<Boolean> save(@RequestBody TaskAssignVO startVO) { |
| | | public R<Boolean> start(@RequestBody TaskAssignVO startVO) { |
| | | dispatcher.start(startVO); |
| | | return R.status(true); |
| | | } |
| | | |
| | | @Operation(summary = "宿任å¡", description = "æµåä¸ä¸ä¸ªèç¹") |
| | | @PostMapping("completeTask") |
| | | public R<Void> completeTask(String taskId, String processInstanceId, String comment, @Parameter(name = "variables", description = "ä»»å¡åé") @RequestBody Map<String, Object> variables) { |
| | | public R<Void> completeTask(String taskId, String processInstanceId, String comment,@Parameter(description = "对åºçç¨åºid,éå·åé") String programIds, @Parameter(name = "variables", description = "ä»»å¡åé") @RequestBody Map<String, Object> variables) { |
| | | // å¢å è¯è®º |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |
| | | taskService.addComment(taskId, processInstanceId, comment); |
| | |
| | | if (Func.isEmpty(variables)) { |
| | | variables = Kv.create(); |
| | | } |
| | | if(StringUtils.isNotEmpty(programIds)) { |
| | | processProgRefService.addRelations(processInstanceId,Func.toLongList(programIds)); |
| | | } |
| | | |
| | | //å å
¥å®¡æ¹ç¨æ· |
| | | variables.put("approveUserNickName",AuthUtil.getNickName()); |
| | | if(variables.containsKey("assignee")){ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.flow.excution; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.flowable.engine.RuntimeService; |
| | | import org.flowable.engine.delegate.DelegateExecution; |
| | | import org.flowable.engine.history.HistoricProcessInstance; |
| | | import org.springblade.mdm.program.entity.NcProgramApproved; |
| | | import org.springblade.mdm.program.entity.ProcessProgRef; |
| | | import org.springblade.mdm.program.service.NcProgramApprovedService; |
| | | import org.springblade.mdm.program.service.ProcessProgRefService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.event.EventListener; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 派工审æ¹å®ææ§è¡çäºä»¶ï¼åè½ï¼æå
¥å®¡æ¹è¡¨æ°æ® |
| | | */ |
| | | @Slf4j |
| | | @Component("dispatchFinishListener") |
| | | public class DispatchFinishListener { |
| | | @Autowired |
| | | RuntimeService runtimeService; |
| | | @Autowired |
| | | ProcessProgRefService processProgRefService; |
| | | @Autowired |
| | | NcProgramApprovedService approvedService; |
| | | public void handle(DelegateExecution execution) { |
| | | String instId = execution.getProcessInstanceId(); |
| | | log.info("{}ï¼instid={}" , runtimeService,instId); |
| | | //å°å
³è表ä¸çæ°æ®æå
¥å®¡æ¹è¡¨ |
| | | LambdaQueryWrapper<ProcessProgRef> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(ProcessProgRef::getProcessInstanceId, instId); |
| | | List<ProcessProgRef> reflist = processProgRefService.list(wrapper); |
| | | for (ProcessProgRef ref : reflist) { |
| | | NcProgramApproved approved = new NcProgramApproved(); |
| | | approved.setNcProgramId(ref.getNcProgramId()); |
| | | |
| | | approvedService.save(approved); |
| | | } |
| | | |
| | | // æ§è¡ä¸å¡é»è¾ |
| | | System.out.println("æµç¨å·²å®æ"); |
| | | } |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.flowable.engine.RuntimeService; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service("startDispatcher") |
| | |
| | | |
| | | vars.put("craftEdition",startVO.getCraftEdition()); |
| | | vars.put("planStartTime",startVO.getPlanStartTime()); |
| | | vars.put("drawingNo",startVO.getDrawingNo()); |
| | | vars.put("drawingNoEdition",startVO.getDrawingNoEdition()); |
| | | vars.put("partNo",startVO.getPartNo()); |
| | | vars.put("partNoEdition",startVO.getPartNoEdition()); |
| | | vars.put("planLockDays",startVO.getPlanLockDays()); |
| | | |
| | | //é¶ç»ä»¶ä»£ç |
| | | String partNo = generatePartNo(startVO); |
| | | vars.put("partNo",partNo); |
| | | |
| | | NcProgram curedNcProgram = ncProgramService.getCuredNcProgram(partNo,startVO.getMachineCode()); |
| | | vars.put("curedNcProgram",curedNcProgram); |
| | | List<NcProgram> curedNcProgram = ncProgramService.getCuredNcProgram(partNo,startVO.getMachineCode()); |
| | | //vars.put("curedNcProgram",curedNcProgram); |
| | | |
| | | //设置æ¯å¦æåºåç¨åºæ è®° |
| | | vars.put("hasCuredProgram",curedNcProgram != null ? "Y":"N"); |
| | | vars.put("hasCuredProgram",!curedNcProgram.isEmpty() ? "Y":"N"); |
| | | |
| | | String businessKey = "0";//ä¸å¡è¡¨key |
| | | |
| | |
| | | String generatePartNo(TaskAssignVO startVO){ |
| | | //TODO è¿ä¸ªæ ¼å¼æªç¡®å®ï¼éè¦ç¡®è®¤ |
| | | return String.format("%s-%s-%s-%s-%s-%s", |
| | | startVO.getDrawingNo(), |
| | | startVO.getDrawingNoEdition(), |
| | | startVO.getPartNo(), |
| | | startVO.getPartNoEdition(), |
| | | startVO.getProcessNo(), |
| | | startVO.getProcessName(), |
| | | startVO.getCraftEdition(), |
| | |
| | | //log.info() |
| | | } |
| | | |
| | | /** |
| | | * çæé¶ç»ä»¶ç¼å· |
| | | * å¾å·ãå¾å·ç次ãå·¥åºå·ãå·¥åºåç§°ãå·¥èºç次ãå·¥åºç次 ç»åèµ·æ¥è·å¾é¶ç»ä»¶å· |
| | | * @param startVO |
| | | * @return |
| | | */ |
| | | String generatePartNo(TaskAssignVO startVO){ |
| | | //TODO è¿ä¸ªæ ¼å¼æªç¡®å®ï¼éè¦ç¡®è®¤ |
| | | return String.format("%s-%s-%s-%s-%s-%s", |
| | | startVO.getDrawingNo(), |
| | | startVO.getDrawingNoEdition(), |
| | | startVO.getProcessNo(), |
| | | startVO.getProcessName(), |
| | | startVO.getCraftEdition(), |
| | | startVO.getProcessEdition()); |
| | | } |
| | | } |
| | |
| | | @Data |
| | | @Schema(description = "ä»»å¡è®¡å") |
| | | public class TaskAssignVO { |
| | | @Schema(description = "å¾å·") |
| | | private String drawingNo; |
| | | @Schema(description = "å¾å·ç次") |
| | | private String drawingNoEdition; |
| | | @Schema(description = "é¶ç»ä»¶/å¾å·") |
| | | private String partNo; |
| | | @Schema(description = "å¾å·ç次/è®¾è®¡çæ¬¡") |
| | | private String partNoEdition; |
| | | @Schema(description = "å·¥åºå·") |
| | | private String processNo; |
| | | @Schema(description = "å·¥åºåç§°") |
| | |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | /* |
| | | @Operation(summary = "ç¨åºå页æ¥è¯¢", description = "ç¨äºå¨ç¼å¶èç¹éæ©æµç¨å¯¹åºçç¨åº") |
| | | @GetMapping("/programpickpage") |
| | | public R<IPage<NcNodeProgramVO>> page(NcNodeProgramQueryVO query) { |
| | | IPage<NcNodeProgramVO> pages = ncNodeService.programPageQuery(query); |
| | | return R.data(pages); |
| | | } |
| | | */ |
| | | |
| | | } |
| | |
| | | |
| | | package org.springblade.mdm.program.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.mdm.program.entity.NcProgram; |
| | | import org.springblade.mdm.program.service.NcProgramService; |
| | | import org.springblade.mdm.program.service.ProcessProgRefService; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramQueryVO; |
| | | import org.springblade.mdm.program.vo.NcProgramUploadVO; |
| | | import org.springblade.mdm.program.vo.NcProgramVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | public class NcProgramController { |
| | | |
| | | private final NcProgramService ncProgramService; |
| | | |
| | | private final ProcessProgRefService ncProcessProgRefService; |
| | | @PostMapping("/upload") |
| | | @Operation(summary = "ä¸ä¼ æä»¶", description = "ä¸ä¼ ç¨åº/éä»¶æä»¶") |
| | | public R<Boolean> upload(NcProgramUploadVO uploadVO) { |
| | |
| | | public R<List<NcProgramVO>> listByNode(@Parameter(description="æå±èç¹ID")@RequestParam Long nodeId) { |
| | | return R.data(ncProgramService.listByNode(nodeId)); |
| | | } |
| | | |
| | | @PostMapping("/upgrade-process-edition") |
| | | @Operation(summary = "åç", description = "å级工åºç次") |
| | | public R<Boolean> upgradeProcessEdition(Long id,String newProcessEdition ) { |
| | | ncProgramService.upgradeProcessEdition(id,newProcessEdition); |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | | @Operation(summary = "ç¨åºå页æ¥è¯¢", description = "ç¨äºå¨ç¼å¶èç¹éæ©æµç¨å¯¹åºçç¨åº") |
| | | @GetMapping("/programpickpage") |
| | | public R<IPage<NcProgramVO>> page(NcNodeProgramQueryVO query) { |
| | | IPage<NcProgramVO> pages = ncProgramService.pageQuery(query); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | @GetMapping("/list-by-process") |
| | | @Operation(summary = "èç¹ç¨åºæä»¶å表", description = "æèç¹å
çç¨åºå表ï¼ä»
âç¨åºå
âåå
¸å¼60") |
| | | public R<List<NcProgramVO>> listByProcess(@Parameter(description="æå±èç¹ID")@RequestParam String processInstanceId) { |
| | | return R.data(ncProcessProgRefService.listByProcess(processInstanceId)); |
| | | } |
| | | } |
| | |
| | | |
| | | package org.springblade.mdm.program.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.mdm.program.service.NcProgramApprovedService; |
| | | import org.springblade.mdm.program.service.NcProgramService; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramQueryVO; |
| | | import org.springblade.mdm.program.vo.NcProgramExportDncPageVO; |
| | | import org.springblade.mdm.program.vo.NcProgramExportDncQueryVO; |
| | | import org.springblade.mdm.program.vo.NcProgramVO; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | @RestController |
| | | @RequestMapping("/program/exchange") |
| | | @AllArgsConstructor |
| | | @Tag(name = "导åºDNC", description = "æ¶å¯ç½æ²ç¼å¯¼åºDNC") |
| | | @Tag(name = "导åºDNC", description = "æ¶å¯ç½ç¨åºå¯¼åºDNC") |
| | | @Slf4j |
| | | public class NcProgramExportDNCController { |
| | | |
| | | private final NcProgramService ncProgramService; |
| | | private final NcProgramApprovedService ncProgramApprovedService; |
| | | @Operation(summary = "ç¨åºå¯¼åºDNCå页æ¥è¯¢", description = "å页æ¥è¯¢ï¼ä¾ç¨æ·éæ©æ°æ®") |
| | | @GetMapping("/export-dnc-page") |
| | | public R<IPage<NcProgramExportDncPageVO>> page(NcProgramExportDncQueryVO query) { |
| | | //IPage<NcProgramVO> pages = ncProgramService.pageQuery(query); |
| | | return R.data(ncProgramApprovedService.exportDncPageQuery(query)); |
| | | } |
| | | |
| | | @PostMapping("/export-dnc") |
| | | @Operation(summary = "æ°æ§ç¨åºå¯¼åºdnc", description = "æ°æ§ç¨åºå¯¼åºå°å·¥æ§ç½") |
| | |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String machineCode; |
| | | /** |
| | | * å¾å· |
| | | */ |
| | | private String drawingNo; |
| | | /** |
| | | * å¾å·ç次 |
| | | */ |
| | | private String drawingNoEdition; |
| | | |
| | | |
| | | |
| | | /** |
| | | * å·¥åºï¼å¦âç²¾é£â |
| | |
| | | */ |
| | | private String craftEdition; |
| | | /** |
| | | * é¶ç»ä»¶å· |
| | | * é¶ç»ä»¶å·/å¾å· |
| | | */ |
| | | private String partNo; |
| | | /** |
| | | * å¾å·ç次 |
| | | */ |
| | | private String partNoEdition; |
| | | |
| | | /** |
| | | * æ¯å¦åºå |
| | |
| | | * æå±èç¹idï¼å¿
é¡»æªâç¨åºå
å"çèç¹ |
| | | */ |
| | | private long ncNodeId; |
| | | /** |
| | | * ç¨åºå
å |
| | | */ |
| | | //private String packageName; |
| | | |
| | | /** |
| | | * æä»¶å°å |
| | | */ |
| | |
| | | * æ¯å¦ä¸ºææ¬ç±»å |
| | | */ |
| | | private Boolean isTextFile; |
| | | /** |
| | | * å¾å· |
| | | */ |
| | | private String drawingNo; |
| | | |
| | | /** |
| | | * å·¥åºï¼å¦âç²¾é£â |
| | | */ |
| | |
| | | */ |
| | | private String machineCode; |
| | | /** |
| | | * é¶ç»ä»¶å· |
| | | * é¶ç»ä»¶å·/å¾å· |
| | | */ |
| | | //private String partNo; |
| | | private String partNo; |
| | | |
| | | /** |
| | | * æè¿° |
| | | */ |
| | | private String description; |
| | | /** |
| | | * æ¯å¦åºå |
| | | */ |
| | | //private Integer isCured; |
| | | private Integer isCured; |
| | | /** |
| | | * è¿ææ¥æ |
| | | */ |
| | |
| | | /** |
| | | * å·¥åºç次 |
| | | */ |
| | | //private String processEdition; |
| | | private String processEdition; |
| | | /** |
| | | * æ¯å¦ææ°ç次ï¼1ï¼ææ°ç次ï¼0:åå²ç次 |
| | | */ |
| | | //private Integer isLastEdition; |
| | | private Integer isLastEdition = 1; |
| | | /** |
| | | * æ¯å¦éå® |
| | | */ |
| | | private Integer isLocked; |
| | | private Integer isLocked = 0; |
| | | /** |
| | | * æ¯å¦æµè¯ç¨åº |
| | | */ |
| | | private Integer isTest = 0; |
| | | /** |
| | | * ä»»å¡åæ´¾æ¶é´ |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.base.BizEntity; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * æ°æ§ç¨åºå®¡æ¹è¡¨ |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | @TableName("mdm_nc_program_approved") |
| | | public class NcProgramApproved extends BizEntity { |
| | | /* |
| | | * æå±èç¹idï¼å¿
é¡»æªâç¨åºå
å"çèç¹ |
| | | */ |
| | | private long ncProgramId; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.base.BizEntity; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Setter |
| | | @Getter |
| | | @TableName("mdm_process_prog_ref") |
| | | public class ProcessProgRef extends BizEntity { |
| | | /** |
| | | * æä»¶å |
| | | */ |
| | | private String processInstanceId; |
| | | /** |
| | | * 对象åå¨ä¸çåç§° |
| | | */ |
| | | private Long ncProgramId; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.base.BizEntity; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | |
| | | @Setter |
| | | @Getter |
| | | @TableName("mdm_program_seq") |
| | | public class ProgramSeq { |
| | | private long id; |
| | | private Date createTime; |
| | | } |
| | |
| | | public interface NcNodeMapper extends BladeMapper<NcNode> { |
| | | List<NcNodeVO> lazyList(Long parentId); |
| | | |
| | | IPage<NcNodeProgramVO> programPageQuery(@Param("page")IPage<NcNodeProgramVO> page, @Param("query") NcNodeProgramQueryVO query); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åç§°è·åææ°çç¨åºå
èç¹ |
| | |
| | | <!-- <select id="parentTree" resultMap="treeNodeResultMap">--> |
| | | <!-- select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 and parent_id = 0--> |
| | | <!-- </select>--> |
| | | <sql id="prog_all_columns">id,tenant_id,nc_node_id,code,name,package_name,machine_code,part_no,is_cured, |
| | | <sql id="prog_all_columns">id,tenant_id,nc_node_id,code,name,machine_code,part_no,is_cured, |
| | | expire_date,process_edition,is_last_edition,is_locked,task_assign_time,status,create_dept,is_deleted,create_time,create_user,update_time,update_user</sql> |
| | | <select id="getCuredNcProgram" resultMap="BaseResultMap"> |
| | | select <include refid="prog_all_columns"/> from mdm_nc_program |
| | |
| | | parent_id = n.id and is_deleted = 0 |
| | | ) AS "has_children" from mdm_nc_node n where is_deleted=0 and parent_id=#{parentId} |
| | | </select> |
| | | <select id="programPageQuery" resultType="org.springblade.mdm.program.vo.NcNodeProgramVO"> |
| | | select id,parent_id,machine_code,drawing_no,drawing_no_edition,part_no,process_name,craft_edition from mdm_nc_node n |
| | | <where> |
| | | <if test="query.name!=null and query.name!=''"> |
| | | and n.name like CONCAT('%', #{query.name,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <!--è·å ææ°çæ¬çç¨åºï¼å³ç¨åºå
å èç¹ node_type=60ï¼--> |
| | | <select id="getLastProgramNode" resultType="org.springblade.mdm.program.entity.NcNode"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.mp.mapper.BladeMapper; |
| | | import org.springblade.mdm.program.entity.NcProgramApproved; |
| | | import org.springblade.mdm.program.vo.*; |
| | | |
| | | public interface NcProgramApprovedMapper extends BladeMapper<NcProgramApproved> { |
| | | |
| | | |
| | | IPage<NcProgramExportDncPageVO> exportDncPageQuery(@Param("page")IPage<NcProgramExportDncPageVO> page, @Param("query") NcProgramExportDncQueryVO query); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.mdm.program.mapper.NcProgramApprovedMapper"> |
| | | <resultMap id="BaseResultMap" type="org.springblade.mdm.program.entity.NcProgramApproved"> |
| | | <id column="id" property="id"/> |
| | | |
| | | |
| | | <result column="status" property="status"/> |
| | | <result column="create_time" property="createTime"/> |
| | | <result column="update_time" property="updateTime"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap> |
| | | <select id="exportDncPageQuery" resultType="org.springblade.mdm.program.vo.NcProgramExportDncPageVO"> |
| | | select a.id,a.nc_program_id,p.name,p.nc_node_id,a.create_time,p.process_name from mdm_nc_program_approved a inner join mdm_nc_program p on a.nc_program_id=p.id |
| | | where a.is_deleted=0 |
| | | <where> |
| | | <if test="query.name!=null and query.name!=''"> |
| | | and p.name like CONCAT('%', #{query.name,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | |
| | | <if test="query.passTimeBegin!=null"> |
| | | and a.create_time >= #{query.passTimeBegin} |
| | | </if> |
| | | <if test="query.passTimeEnd!=null"> |
| | | and a.create_time <= #{query.passTimeEnd} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | import org.springblade.mdm.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineVO; |
| | | import org.springblade.mdm.program.entity.NcProgram; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramQueryVO; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramVO; |
| | | import org.springblade.mdm.program.vo.NcProgramVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface NcProgramMapper extends BladeMapper<NcProgram> { |
| | | |
| | |
| | | * @param machineGroupCode æºåºç»ä»£ç |
| | | * @return |
| | | */ |
| | | NcProgram getCuredNcProgram(@Param("partNo")String partNo,@Param("machineGroupCode")String machineGroupCode); |
| | | List<NcProgram> getCuredNcProgram( @Param("partNo")String partNo,@Param("machineGroupCode")String machineGroupCode); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨åºåç§°ï¼è·åææ°çç¨åºå®ä½ |
| | | * @param name ç¨åºåç§° |
| | | * @return ncç¨åº |
| | | */ |
| | | //NcProgram getLastNcProgram(String name); |
| | | IPage<NcProgramVO> pageQuery(@Param("page")IPage<NcNodeProgramVO> page, @Param("query") NcNodeProgramQueryVO query); |
| | | } |
| | |
| | | <!-- <select id="parentTree" resultMap="treeNodeResultMap">--> |
| | | <!-- select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict where is_deleted = 0 and parent_id = 0--> |
| | | <!-- </select>--> |
| | | <sql id="all_columns">id,tenant_id,nc_node_id,code,name,package_name,machine_code,part_no,is_cured, |
| | | <sql id="all_columns">id,tenant_id,nc_node_id,code,name,machine_code,part_no,is_cured, |
| | | expire_date,process_edition,is_last_edition,is_locked,task_assign_time,status,create_dept,is_deleted,create_time,create_user,update_time,update_user</sql> |
| | | <select id="getCuredNcProgram" resultMap="BaseResultMap"> |
| | | select <include refid="all_columns"/> from mdm_nc_program |
| | | where is_deleted=0 and is_cured=1 and part_no=#{partNo} and is_last_edition=1 |
| | | and machine_code in (select code from mdm_machine where machine_group_code=#{machineGroupCode}) |
| | | order by create_time desc |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="pageQuery" resultType="org.springblade.mdm.program.vo.NcProgramVO"> |
| | | select id,nc_node_id,name,machine_code,part_no,part_no_edition,process_name,craft_edition from mdm_nc_program p |
| | | where is_deleted=0 and is_last_edition=1 and (category='program' or category='subprogram') |
| | | <where> |
| | | |
| | | <if test="query.name!=null and query.name!=''"> |
| | | and p.name like CONCAT('%', #{query.name,jdbcType=VARCHAR},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <!-- |
| | | <select id="getLastNcProgram" resultType="org.springblade.mdm.program.entity.NcProgram"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.mapper; |
| | | |
| | | import org.springblade.core.mp.mapper.BladeMapper; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.entity.ProcessProgRef; |
| | | import org.springblade.mdm.program.vo.NcNodeVO; |
| | | import org.springblade.mdm.program.vo.NcProgramVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProcessProgRefMapper extends BladeMapper<ProcessProgRef> { |
| | | |
| | | List<NcProgramVO> listByProcess(String processInstanceId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.mdm.program.mapper.ProcessProgRefMapper"> |
| | | |
| | | |
| | | <select id="listByProcess" resultType="org.springblade.mdm.program.vo.NcProgramVO"> |
| | | select p.id,p.name,url,code from mdm_process_prog_ref r join mdm_nc_program p on r.nc_program_id=p.id |
| | | where process_instance_id=#{processInstanceId} and p.is_deleted=0 |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.mapper; |
| | | |
| | | import org.springblade.mdm.program.entity.ProgramSeq; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ProgramSeqMapper{ |
| | | void insert(ProgramSeq entity); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.mdm.program.mapper.ProgramSeqMapper"> |
| | | |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id"> |
| | | INSERT INTO mdm_program_seq(create_time) |
| | | VALUES(current_time) |
| | | </insert> |
| | | </mapper> |
| | |
| | | return baseMapper.lazyList(parentId); |
| | | } |
| | | |
| | | /** |
| | | * ç¨åºèç¹ |
| | | * @param query |
| | | * @return |
| | | */ |
| | | public IPage<NcNodeProgramVO> programPageQuery(NcNodeProgramQueryVO query) { |
| | | return this.getBaseMapper().programPageQuery(Condition.getPage(query),query); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç°æåºåçç¨åºï¼æå®æ¡ä»¶ï¼é¶ç»ä»¶å·ç¸åï¼ä¸æ¯å䏿ºåºç» |
| | |
| | | public NcNode getLastProgramNode(String name) { |
| | | return this.getBaseMapper().getLastProgramNode(name); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | package org.springblade.mdm.program.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.mdm.program.entity.NcProgramApproved; |
| | | import org.springblade.mdm.program.mapper.NcProgramApprovedMapper; |
| | | import org.springblade.mdm.program.vo.DncSendBackData; |
| | | import org.springblade.mdm.program.vo.NcProgramExportDncPageVO; |
| | | import org.springblade.mdm.program.vo.NcProgramExportDncQueryVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * ä¸å/åä¼ ç¨åºç»è®¡ |
| | | * |
| | | * @author yangys |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class NcProgramApprovedService extends BizServiceImpl<NcProgramApprovedMapper, NcProgramApproved> { |
| | | |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * @param query æ¥è¯¢åæ° |
| | | * @return |
| | | */ |
| | | public IPage<NcProgramExportDncPageVO> exportDncPageQuery(NcProgramExportDncQueryVO query) { |
| | | |
| | | IPage<NcProgramExportDncPageVO> page = this.getBaseMapper().exportDncPageQuery(Condition.getPage(query),query); |
| | | |
| | | return page; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | package org.springblade.mdm.program.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.flowable.engine.*; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.mdm.basesetting.machine.MachineService; |
| | | import org.springblade.mdm.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.entity.ProgramSeq; |
| | | import org.springblade.mdm.program.mapper.NcProgramMapper; |
| | | import org.springblade.mdm.program.entity.NcProgram; |
| | | import org.springblade.mdm.program.mapper.ProgramSeqMapper; |
| | | import org.springblade.mdm.program.vo.DncSendBackData; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramQueryVO; |
| | | import org.springblade.mdm.program.vo.NcProgramUploadVO; |
| | | import org.springblade.mdm.program.vo.NcProgramVO; |
| | | import org.springblade.mdm.utils.FileContentUtil; |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | private final OssTemplate ossTemplate; |
| | | private final NcNodeService nodeService; |
| | | |
| | | private final ProgramSeqMapper seqMapper; |
| | | /** |
| | | * æ¥è¯¢ç°æåºåçç¨åºï¼æå®æ¡ä»¶ï¼é¶ç»ä»¶å·ç¸åï¼ä¸æ¯å䏿ºåºç» |
| | | * @param partNo |
| | | * @param machineCode |
| | | * @return |
| | | */ |
| | | public NcProgram getCuredNcProgram(String partNo,String machineCode) { |
| | | public List<NcProgram> getCuredNcProgram(String partNo,String machineCode) { |
| | | Machine machine = machineService.getByCode(machineCode); |
| | | return this.getBaseMapper().getCuredNcProgram(partNo,machine.getMachineGroupCode()); |
| | | } |
| | |
| | | |
| | | /** |
| | | * ä¸ä¼ ç¨åºæä»¶å°æå®èç¹ |
| | | * @param file |
| | | * @param nodeId |
| | | * @param category æä»¶åç±»ï¼ç¨åºæä»¶/å
¶ä»æä»¶ï¼ |
| | | * @param uploadVO ä¸ä¼ æä»¶è¡¨åæ°æ® |
| | | */ |
| | | public void uploadProgramFile(NcProgramUploadVO uploadVO) { |
| | | |
| | | |
| | | MultipartFile file = uploadVO.getFile(); |
| | | BladeFile bfile = ossTemplate.putFile(uploadVO.getFile()); |
| | | String link = bfile.getLink(); |
| | | //ä¿åprofame |
| | | NcProgram prog = new NcProgram(); |
| | | prog.setCode(generageCode()); |
| | | prog.setName(file.getOriginalFilename()); |
| | | prog.setNcNodeId(uploadVO.getNodeId()); |
| | | prog.setOssName(bfile.getName()); |
| | | prog.setDrawingNo(uploadVO.getDrawingNo()); |
| | | prog.setPartNo(uploadVO.getPartNo()); |
| | | prog.setProcessEdition(uploadVO.getProcessEdition()); |
| | | prog.setIsLastEdition(1); |
| | | boolean isTextFile = false; |
| | | try { |
| | | isTextFile = FileContentUtil.isTextFile(file.getInputStream()); |
| | |
| | | this.save(prog); |
| | | } |
| | | |
| | | String generageCode(){ |
| | | ProgramSeq program = new ProgramSeq(); |
| | | seqMapper.insert(program); |
| | | |
| | | DecimalFormat df = new DecimalFormat("0000000000"); |
| | | return df.format(program.getId()); |
| | | } |
| | | /** |
| | | * å é¤ä¸ä¸ªç¨åº |
| | | * @param id |
| | |
| | | |
| | | public List<NcProgramVO> listByNode(Long nodeId) { |
| | | NcNode node = nodeService.getById(nodeId); |
| | | List<NcProgram> pList = this.list(Wrappers.lambdaQuery(NcProgram.class).eq(NcProgram::getNcNodeId, nodeId).orderByDesc(NcProgram::getCreateTime)); |
| | | List<NcProgram> pList = this.list(Wrappers.lambdaQuery(NcProgram.class).eq(NcProgram::getNcNodeId, nodeId).eq(NcProgram::getIsLastEdition,1).orderByDesc(NcProgram::getCreateTime)); |
| | | |
| | | List<NcProgramVO> result = new ArrayList<>(); |
| | | |
| | |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * åç(å级工åºç次),å级工åºçæ¬ï¼å
æ¬ç¨åºåå
¶ä»éä»¶ï¼ |
| | | * @param id ç¨åºæä»¶id |
| | | * @param newProcessEdition æ°ç次 |
| | | */ |
| | | public void upgradeProcessEdition(long id,String newProcessEdition) { |
| | | NcProgram prog = this.getById(id); |
| | | //å°ç°æç¨åºæ´æ°ä¸ºéææ°çæ¬ |
| | | this.update(Wrappers.lambdaUpdate(NcProgram.class).eq(NcProgram::getId,id).set(NcProgram::getIsLastEdition,0)); |
| | | |
| | | NcProgram newVerProg = new NcProgram(); |
| | | BeanUtils.copyProperties(prog, newVerProg); |
| | | newVerProg.setId(null); |
| | | newVerProg.setIsLastEdition(1); |
| | | newVerProg.setProcessEdition(newProcessEdition); |
| | | |
| | | this.save(newVerProg); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ï¼ç¨äºå®¡æ¹æ¶éæ©ç¨åº |
| | | * @param query |
| | | * @return |
| | | */ |
| | | public IPage<NcProgramVO> pageQuery(NcNodeProgramQueryVO query) { |
| | | return this.getBaseMapper().pageQuery(Condition.getPage(query),query); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * BladeX Commercial License Agreement |
| | | * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved. |
| | | * <p> |
| | | * Use of this software is governed by the Commercial License Agreement |
| | | * obtained after purchasing a license from BladeX. |
| | | * <p> |
| | | * 1. This software is for development use only under a valid license |
| | | * from BladeX. |
| | | * <p> |
| | | * 2. Redistribution of this software's source code to any third party |
| | | * without a commercial license is strictly prohibited. |
| | | * <p> |
| | | * 3. Licensees may copyright their own code but cannot use segments |
| | | * from this software for such purposes. Copyright of this software |
| | | * remains with BladeX. |
| | | * <p> |
| | | * Using this software signifies agreement to this License, and the software |
| | | * must not be used for illegal purposes. |
| | | * <p> |
| | | * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
| | | * not liable for any claims arising from secondary or illegal development. |
| | | * <p> |
| | | * Author: Chill Zhuang (bladejava@qq.com) |
| | | */ |
| | | package org.springblade.mdm.program.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.oss.OssTemplate; |
| | | import org.springblade.core.oss.model.BladeFile; |
| | | import org.springblade.mdm.basesetting.machine.MachineService; |
| | | import org.springblade.mdm.basesetting.machine.entity.Machine; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.entity.NcProgram; |
| | | import org.springblade.mdm.program.entity.ProcessProgRef; |
| | | import org.springblade.mdm.program.entity.ProgramSeq; |
| | | import org.springblade.mdm.program.mapper.NcProgramMapper; |
| | | import org.springblade.mdm.program.mapper.ProcessProgRefMapper; |
| | | import org.springblade.mdm.program.mapper.ProgramSeqMapper; |
| | | import org.springblade.mdm.program.vo.NcNodeProgramQueryVO; |
| | | import org.springblade.mdm.program.vo.NcProgramUploadVO; |
| | | import org.springblade.mdm.program.vo.NcProgramVO; |
| | | import org.springblade.mdm.utils.FileContentUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 工使µæå¡å®ç°ç±» |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class ProcessProgRefService extends BizServiceImpl<ProcessProgRefMapper, ProcessProgRef> { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç°æåºåçç¨åºï¼æå®æ¡ä»¶ï¼é¶ç»ä»¶å·ç¸åï¼ä¸æ¯å䏿ºåºç» |
| | | * @param processInstanceId æµç¨å®ä¾id |
| | | * @param programIds ç¨åºid |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public void addRelations(String processInstanceId, List<Long> programIds) { |
| | | if(programIds == null || programIds.isEmpty()) { |
| | | return; |
| | | } |
| | | |
| | | this.lambdaUpdate().eq(ProcessProgRef::getProcessInstanceId, processInstanceId).remove(); |
| | | List<ProcessProgRef> entities = new ArrayList<>(); |
| | | for (Long programId : programIds) { |
| | | ProcessProgRef entity = new ProcessProgRef(); |
| | | entity.setProcessInstanceId(processInstanceId); |
| | | entity.setNcProgramId(programId); |
| | | |
| | | entities.add(entity); |
| | | } |
| | | this.saveBatch(entities); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æµç¨å
³èçç¨åºiäºæ |
| | | * @param processInstanceId |
| | | * @return |
| | | */ |
| | | public List<NcProgramVO> listByProcess(String processInstanceId) { |
| | | return this.getBaseMapper().listByProcess(processInstanceId); |
| | | } |
| | | } |
| | |
| | | @Schema(description = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | @Schema(description = "å¾å·") |
| | | private String drawingNo; |
| | | |
| | | @Schema(description = "å¾å·ç次") |
| | | private String drawingNoEdition; |
| | | |
| | |
| | | @Schema(description = "å·¥èºç次") |
| | | private String craftEdition; |
| | | |
| | | @Schema(description = "é¶ç»ä»¶å·") |
| | | @Schema(description = "é¶ç»ä»¶å·/å¾å·") |
| | | private String partNo; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.mdm.commons.vo.BaseVO; |
| | | |
| | | /** |
| | | * NCç¨åºVO |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | public class NcProgramExportDncPageVO extends BaseVO { |
| | | @Schema(description = "ç¨åºåç§°") |
| | | private String name; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.support.Query; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å页æçº¿å¢ |
| | | */ |
| | | |
| | | @Schema(description = "æºåºåä¼ æä»¶æ¥è¯¢å¯¹è±¡") |
| | | @Setter |
| | | @Getter |
| | | public class NcProgramExportDncQueryVO extends Query { |
| | | @Schema(description = "ç¨åºåç§°") |
| | | private String name; |
| | | @Schema(description = "éè¿æ¶é´å¼å§") |
| | | private Date passTimeBegin; |
| | | @Schema(description = "éè¿æ¶é´æªæ¢") |
| | | private Date passTimeEnd; |
| | | } |
| | |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | public class NcProgramUploadVO extends BaseVO { |
| | | public class NcProgramUploadVO { |
| | | @Schema(description = "æå±èç¹id") |
| | | private Long nodeId; |
| | | |
| | |
| | | @Schema(description = "设å¤ç¼å·") |
| | | private MultipartFile file; |
| | | |
| | | @Schema(description = "å¾å·") |
| | | private String drawingNo; |
| | | |
| | | @Schema(description = "é¶ç»ä»¶å·/å¾å·") |
| | | private String partNo; |
| | | |
| | | @Schema(description = "å·¥åºï¼å¦âç²¾é£â") |
| | | private String processName; |
| | | |
| | | @Schema(description = "æä»¶åç±»ï¼ä½¿ç¨åå
¸(node_file_type)") |
| | | private String category; |
| | | |
| | | @Schema(description = "å·¥åºçæ¬") |
| | | private String processEdition; |
| | | |
| | | /** |
| | | * æ¯å¦æµè¯ç¨åºã1æ¯ï¼0å¦ |
| | | */ |
| | | private Integer isTest; |
| | | } |
| | |
| | | @Schema(description = "夿³¨") |
| | | private String remark; |
| | | |
| | | @Schema(description = "å¾å·") |
| | | private String drawingNo; |
| | | |
| | | @Schema(description = "å¾å·ç次") |
| | | private String drawingNoEdition; |
| | | |
| | | @Schema(description = "å·¥åºï¼å¦âç²¾é£â") |
| | | private String processName; |
| | | |
| | | @Schema(description = "å·¥èºç次") |
| | | private String craftEdition; |
| | | |
| | | @Schema(description = "é¶ç»ä»¶å·") |
| | | @Schema(description = "é¶ç»ä»¶å·/å¾å·") |
| | | private String partNo; |
| | | @Schema(description = "é¶ç»ä»¶å·/å¾å·ç次") |
| | | private String partNoEdition; |
| | | |
| | | @Schema(description = "æ¯å¦æµè¯ç¨åº.1æ¯;0å¦") |
| | | private Integer isTest; |
| | | } |
| | |
| | | <userTask id="programmingTask" name="ç¼å¶" flowable:assignee="${assignee}"/> |
| | | <userTask id="check" name="æ ¡å¯¹" flowable:assignee="${assignee}"/> |
| | | <userTask id="approveTask" name="é«å¸å®¡æ¹" flowable:assignee="${assignee}"/> |
| | | <endEvent id="approveEnd" name="审æ¹å®æ"/> |
| | | <endEvent id="approveEnd" name="审æ¹å®æ"> |
| | | <extensionElements> |
| | | <flowable:executionListener expression="${dispatchFinishListener.handle(execution)}" event="end"/> |
| | | </extensionElements> |
| | | </endEvent> |
| | | <sequenceFlow id="programingToCheck" sourceRef="programmingTask" targetRef="check" name="ç¼å¶å®æç»æ ¡å¯¹"> |
| | | <conditionExpression xsi:type="tFormalExpression">${approve=='Y'}</conditionExpression> |
| | | </sequenceFlow> |
| | |
| | | <conditionExpression xsi:type="tFormalExpression">${approve=='Y' && hasCuredProgram=='Y'}</conditionExpression> |
| | | </sequenceFlow> |
| | | <sequenceFlow id="sid-353381d5-35c7-47b0-bf5b-2bafe865ab5e" sourceRef="cureCheckServiceTask" targetRef="confirmIsUseableTask"/> |
| | | <sequenceFlow id="sid-d144dad0-dc94-4a2b-96d6-9d8451b05ec1" sourceRef="confirmIsUseableTask" targetRef="sid-82237034-5cb2-45c7-9a74-e2d5abb3b398" name="åºåç¨åºå¯ç¨"> |
| | | <sequenceFlow id="sid-d144dad0-dc94-4a2b-96d6-9d8451b05ec1" sourceRef="confirmIsUseableTask" targetRef="check" name="åºåç¨åºå¯ç¨"> |
| | | <conditionExpression>${approve=='Y'}</conditionExpression> |
| | | </sequenceFlow> |
| | | <sequenceFlow id="sid-d4133565-1a45-4bb6-b603-9b9e4db1cdbb" sourceRef="approveTask" targetRef="check"> |
| | | <conditionExpression>${approve=='N'}</conditionExpression> |
| | | </sequenceFlow> |
| | | <exclusiveGateway id="sid-82237034-5cb2-45c7-9a74-e2d5abb3b398" name="å¯ç¨ç¨åºæµè½¬ç½å
³"/> |
| | | <sequenceFlow id="sid-b15dcf6a-a48c-4e01-b6bc-5c2a74ca817e" sourceRef="sid-82237034-5cb2-45c7-9a74-e2d5abb3b398" targetRef="check" name="å·¥åºç次ä¸è´å¹¶ä¸å¯ç¨"> |
| | | <conditionExpression xsi:type="tFormalExpression">${processEditionEqual=='Y'}</conditionExpression> |
| | | </sequenceFlow> |
| | | <sequenceFlow id="sid-6249886b-7c4a-4904-9b0b-cf743932be9f" sourceRef="sid-82237034-5cb2-45c7-9a74-e2d5abb3b398" targetRef="emptyUpgradeProcessEdtionServiceTask"> |
| | | <conditionExpression xsi:type="tFormalExpression">${processEditionEqual=='N'}</conditionExpression> |
| | | </sequenceFlow> |
| | | <sequenceFlow id="sid-598e1dbe-85b3-40d0-89c8-bd2580ecbfc5" sourceRef="emptyUpgradeProcessEdtionServiceTask" targetRef="check"/> |
| | | <sequenceFlow id="sid-80b50f96-7601-4ba2-8c32-968923170d25" sourceRef="confirmIsUseableTask" targetRef="programmingTask"> |
| | | <conditionExpression>${approve=='N'}</conditionExpression> |
| | | </sequenceFlow> |
| | | <serviceTask id="emptyUpgradeProcessEdtionServiceTask" flowable:exclusive="true" name="空åç" flowable:expression="programEmptyUpgradeProcessEdtionTask.execute(execution)"/> |
| | | </process> |
| | | <bpmndi:BPMNDiagram id="BPMNDiagram_dispatch"> |
| | | <bpmndi:BPMNPlane bpmnElement="dispatch" id="BPMNPlane_dispatch"> |
| | |
| | | <omgdc:Bounds x="130.0" y="-135.0" width="60.0" height="55.0"/> |
| | | </bpmndi:BPMNShape> |
| | | <bpmndi:BPMNShape id="shape-a42e90ff-9c82-4d5b-8f5b-0804754e89a6" bpmnElement="approveTask"> |
| | | <omgdc:Bounds x="220.0" y="-14.0" width="50.0" height="45.0"/> |
| | | <omgdc:Bounds x="130.0" y="-4.0" width="50.0" height="45.0"/> |
| | | </bpmndi:BPMNShape> |
| | | <bpmndi:BPMNShape id="shape-f14acaf6-9747-4d52-87a1-d4c5b8f3d166" bpmnElement="approveEnd"> |
| | | <omgdc:Bounds x="245.0" y="51.0" width="30.0" height="30.0"/> |
| | | <omgdc:Bounds x="295.0" y="-6.5" width="30.0" height="30.0"/> |
| | | </bpmndi:BPMNShape> |
| | | <bpmndi:BPMNEdge id="edge-6f05f47f-7804-4dd0-b6d2-e435b9efaa3c" bpmnElement="programingToCheck"> |
| | | <omgdi:waypoint x="12.5" y="-92.5"/> |
| | |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-d05b5f9f-9108-4a41-9e48-4db1e1b1e325" bpmnElement="flowToSeriorTask"> |
| | | <omgdi:waypoint x="190.0" y="-93.75"/> |
| | | <omgdi:waypoint x="270.0" y="-2.75"/> |
| | | <omgdi:waypoint x="180.0" y="7.25"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-715efa53-6c03-407b-87ec-640f99c481a0" bpmnElement="sid-c0b195e7-17e5-44bf-8115-8b7126cb3ab3"> |
| | | <omgdi:waypoint x="270.0" y="19.749996"/> |
| | | <omgdi:waypoint x="245.0" y="58.5"/> |
| | | <omgdi:waypoint x="180.0" y="29.749996"/> |
| | | <omgdi:waypoint x="295.0" y="1.0"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNShape id="shape-8455618d-c1b9-4e6a-bca4-de965cc81633" bpmnElement="cureCheckServiceTask"> |
| | | <omgdc:Bounds x="-275.0" y="37.500004" width="65.0" height="39.999996"/> |
| | | </bpmndi:BPMNShape> |
| | | <bpmndi:BPMNShape id="shape-8f7064fc-4838-44cc-bf6d-ca15932a1e2e" bpmnElement="confirmIsUseableTask"> |
| | | <omgdc:Bounds x="-165.0" y="37.5" width="55.0" height="40.0"/> |
| | | <omgdc:Bounds x="-135.0" y="37.5" width="55.0" height="40.0"/> |
| | | </bpmndi:BPMNShape> |
| | | <bpmndi:BPMNEdge id="edge-0408fc3c-c133-40e3-9006-c315b12e9790" bpmnElement="sid-46ccac64-2d48-4933-88a6-f2941ae131dd"> |
| | | <omgdi:waypoint x="-192.5" y="-92.500015"/> |
| | | <omgdi:waypoint x="-132.5" y="-100.0"/> |
| | | <omgdi:waypoint x="-72.49999" y="-107.50001"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-d8883eca-269a-42cd-b2d4-134da6596afb" bpmnElement="sid-af92e6ab-bc80-43ed-8b09-1d3ec54cc9e7"> |
| | |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-44016aa6-bf48-4c73-8aaa-4cedf795d68b" bpmnElement="sid-353381d5-35c7-47b0-bf5b-2bafe865ab5e"> |
| | | <omgdi:waypoint x="-210.0" y="57.5"/> |
| | | <omgdi:waypoint x="-165.0" y="57.5"/> |
| | | <omgdi:waypoint x="-135.0" y="57.5"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-64e64024-1ffd-4cdf-be8f-4c5e4911a5bb" bpmnElement="sid-d144dad0-dc94-4a2b-96d6-9d8451b05ec1"> |
| | | <omgdi:waypoint x="-110.0" y="47.5"/> |
| | | <omgdi:waypoint x="-60.0" y="0.0"/> |
| | | <omgdi:waypoint x="-80.0" y="47.5"/> |
| | | <omgdi:waypoint x="145.0" y="-80.00001"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-7a5135fe-5eb1-425c-b920-3e2b5bf18454" bpmnElement="sid-d4133565-1a45-4bb6-b603-9b9e4db1cdbb"> |
| | | <omgdi:waypoint x="257.5" y="-14.0"/> |
| | | <omgdi:waypoint x="167.5" y="-4.0"/> |
| | | <omgdi:waypoint x="175.0" y="-80.0"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNShape id="shape-50f64465-52e3-4ba9-b36d-ebac41ab8b22" bpmnElement="sid-82237034-5cb2-45c7-9a74-e2d5abb3b398"> |
| | | <omgdc:Bounds x="-60.0" y="-20.0" width="40.0" height="40.0"/> |
| | | </bpmndi:BPMNShape> |
| | | <bpmndi:BPMNEdge id="edge-4b95c6df-601d-48e8-a9a4-98499ae5ddf3" bpmnElement="sid-b15dcf6a-a48c-4e01-b6bc-5c2a74ca817e"> |
| | | <omgdi:waypoint x="-20.0" y="0.0"/> |
| | | <omgdi:waypoint x="130.0" y="-93.75"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-dbb7a807-e493-42fe-b229-b9f2ec25b5ee" bpmnElement="sid-6249886b-7c4a-4904-9b0b-cf743932be9f"> |
| | | <omgdi:waypoint x="-40.0" y="20.0"/> |
| | | <omgdi:waypoint x="30.0" y="57.5"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-092f7d8d-2467-4794-af93-fdc9ad503923" bpmnElement="sid-598e1dbe-85b3-40d0-89c8-bd2580ecbfc5"> |
| | | <omgdi:waypoint x="86.25" y="30.0"/> |
| | | <omgdi:waypoint x="145.0" y="-79.99999"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNEdge id="edge-223da197-47f2-44ef-847e-40d1fae1009b" bpmnElement="sid-80b50f96-7601-4ba2-8c32-968923170d25"> |
| | | <omgdi:waypoint x="-123.75" y="37.5"/> |
| | | <omgdi:waypoint x="-93.75" y="37.5"/> |
| | | <omgdi:waypoint x="-51.25" y="-77.5"/> |
| | | </bpmndi:BPMNEdge> |
| | | <bpmndi:BPMNShape id="shape-0fe942f6-dea9-427c-aef6-0db9c3e3707b" bpmnElement="emptyUpgradeProcessEdtionServiceTask"> |
| | | <omgdc:Bounds x="30.0" y="30.0" width="75.0" height="55.0"/> |
| | | </bpmndi:BPMNShape> |
| | | </bpmndi:BPMNPlane> |
| | | </bpmndi:BPMNDiagram> |
| | | </definitions> |
| | |
| | | `id` bigint NOT NULL, |
| | | `tenant_id` varchar(6) DEFAULT NULL COMMENT 'æå±ç§æ·', |
| | | `name` varchar(100) NOT NULL COMMENT 'èç¹åç§°', |
| | | `drawing_no` varchar(40) NULL COMMENT 'å¾å·', |
| | | `process_name` varchar(20) NULL COMMENT 'å·¥åºåç§°', |
| | | `machine_code` varchar(100) DEFAULT NULL COMMENT '设å¤ç¼å·/æºåºç¼å·', |
| | | `part_no` varchar(100) NULL COMMENT 'é¶ç»ä»¶ç¼å·', |
| | | `part_no` varchar(100) NULL COMMENT 'é¶ç»ä»¶ç¼å·/å¾å·', |
| | | `is_cured` int DEFAULT NULL COMMENT 'æ¯å¦åºå,1æ¯;0å¦', |
| | | `expire_date` date DEFAULT NULL COMMENT 'å°ææ¶é´,æ ¹æ®ææææ¶é¿è®¡ç®èæ¥', |
| | | `process_edition` varchar(40) DEFAULT NULL COMMENT 'å·¥åºç次ï¼åçå°±æ¯åæ´æ¹è¯¥å段ï¼éè¦ä¿çåå²è®°å½', |
| | |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='ç¨åºèç¹ç®å½'; |
| | | |
| | | /**æµç¨å®ä¾ä¸èç¹å
³è表ï¼è®°å½åå»ºæ¶æºï¼ç¨æ·å¨ç¨åºç¼å¶èç¹æå¨å
³è*/ |
| | | DROP TABLE IF EXISTS `mdm_process_node_ref`; |
| | | CREATE TABLE `mdm_process_node_ref` ( |
| | | DROP TABLE IF EXISTS `mdm_process_prog_ref`; |
| | | CREATE TABLE `mdm_process_prog_ref` ( |
| | | `id` bigint NOT NULL, |
| | | `tenant_id` varchar(6) DEFAULT NULL COMMENT 'æå±ç§æ·', |
| | | `nc_node_id` bigint DEFAULT NULL COMMENT 'èç¹idï¼å¯¹åº ç¨åºå
å èç¹id', |
| | | `process_instance_id` varchar(100) NOT NULL COMMENT 'æµç¨å®ä¾id', |
| | | `process_instance_id` varchar(64) NOT NULL COMMENT 'æµç¨å®ä¾id', |
| | | `nc_program_id` bigint DEFAULT NULL COMMENT 'æ°æ§ç¨åºid', |
| | | `status` int DEFAULT NULL COMMENT 'ä¸å¡ç¶æ', |
| | | `create_dept` bigint DEFAULT NULL COMMENT 'å建åä½', |
| | | `is_deleted` int DEFAULT NULL, |
| | |
| | | `update_time` datetime DEFAULT NULL COMMENT 'æ´æ°æ¶é´', |
| | | `update_user` bigint DEFAULT NULL COMMENT 'æ´æ°äºº', |
| | | PRIMARY KEY (`id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='æµç¨å®ä¾ä¸èç¹å
³è表'; |
| | | |
| | | |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='æµç¨å®ä¾ä¸ç¨åºå
³è表'; |
| | | |
| | | DROP TABLE IF EXISTS `mdm_nc_program`; |
| | | CREATE TABLE `mdm_nc_program` ( |
| | | `id` bigint NOT NULL, |
| | | `tenant_id` varchar(6) DEFAULT NULL COMMENT 'æå±ç§æ·', |
| | | `nc_node_id` bigint DEFAULT NULL COMMENT 'æå±èç¹idï¼åºè¯¥å±äºæä¸ªæ°æ§ç¨åºèç¹', |
| | | `code` varchar(100) NOT NULL COMMENT 'ç¨åºç¼å·', |
| | | `code` varchar(100) NULL COMMENT 'ç¨åºç¼å·', |
| | | `name` varchar(100) NOT NULL COMMENT 'ç¨åºåç§°', |
| | | `oss_name` varchar(100) NULL COMMENT 'ossä¸çæä»¶å', |
| | | `category` varchar(2) NULL COMMENT 'æä»¶åç±»', |
| | | |
| | | `drawing_no` varchar(40) NULL COMMENT 'å¾å·', |
| | | `process_name` varchar(20) NULL COMMENT 'å·¥åºåç§°', |
| | | `remark` varchar(100) NULL COMMENT '夿³¨', |
| | | `is_text_file` int DEFAULT NULL COMMENT 'æ¯å¦ææ¬æä»¶', |
| | | `url` varchar(400) NOT NULL COMMENT 'æä»¶å°å', |
| | | `machine_code` varchar(100) DEFAULT NULL COMMENT '设å¤ç¼å·/æºåºç¼å·', |
| | | `part_no` varchar(100) NULL COMMENT 'é¶ç»ä»¶ç¼å·', |
| | | `part_no` varchar(100) NULL COMMENT 'é¶ç»ä»¶ç¼å·/å¾å·', |
| | | `is_cured` int DEFAULT NULL COMMENT 'æ¯å¦åºå,1æ¯;0å¦', |
| | | `expire_date` date DEFAULT NULL COMMENT 'å°ææ¶é´,æ ¹æ®ææææ¶é¿è®¡ç®èæ¥', |
| | | `process_edition` varchar(40) DEFAULT NULL COMMENT 'å·¥åºç次ï¼åçå°±æ¯åæ´æ¹è¯¥å段ï¼éè¦ä¿çåå²è®°å½', |
| | | `is_last_edition` int NOT NULL COMMENT 'æ¯å¦ææ°ç次ï¼1ï¼ææ°ç次ï¼0:åå²ç次ï¼ä¸»è¦åè¯¥åæ®µ=1çæ°æ®ï¼0æ¯åå²ç次', |
| | | `is_locked` int DEFAULT NULL COMMENT 'éå®ç¶æï¼1ï¼éå®ï¼0:æ£å¸¸', |
| | | `is_test` int DEFAULT NULL COMMENT 'æ¯å¦æµè¯ç¨åºï¼1ï¼æ¯ï¼0:å¦', |
| | | `task_assign_time` datetime DEFAULT NULL COMMENT 'ç¨åºçä»»å¡ä¸åçæ¶é´ï¼ç¨äºæ£æ¥æ¯å¦ä¸ºéå¤çä»»å¡ï¼', |
| | | `status` int DEFAULT NULL COMMENT 'ä¸å¡ç¶æ', |
| | | `create_dept` bigint DEFAULT NULL COMMENT 'å建åä½', |