已重命名4个文件
已修改4个文件
已删除3个文件
已添加3个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.basesetting.producedivision.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.mdm.basesetting.producedivision.service.ProduceDivisionService; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.ProduceDivisionVO; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.ProduceDivisionViewVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/producedivision") |
| | | @Tag(name = "主å¶å工表", description = "主å¶å工表") |
| | | public class ProduceDivisionController { |
| | | |
| | | @Autowired |
| | | private ProduceDivisionService service; |
| | | |
| | | /** |
| | | * æ°å¢ |
| | | */ |
| | | @PostMapping("/save") |
| | | @Operation(summary = "æ°å¢", description = "主å¶è®¡å表") |
| | | public R<Boolean> save(@RequestBody ProduceDivisionVO vo) { |
| | | |
| | | service.savePlan(vo); |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹", description = "主å¶è®¡å表") |
| | | @PostMapping("/update") |
| | | public R<Boolean> update(@RequestBody ProduceDivisionVO vo) { |
| | | |
| | | return R.<Boolean>status(service.updatePlan(vo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ |
| | | */ |
| | | @Operation(summary = "å é¤", description = "å é¤") |
| | | @PostMapping("/remove") |
| | | public R<Void> remove(@RequestParam String ids) { |
| | | try { |
| | | return R.status(service.removeBatchByIds(Func.toLongList(ids))); |
| | | } catch (Exception e) { |
| | | log.error("å é¤å¼å¸¸",e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å页 |
| | | */ |
| | | @Operation(summary = "å页æ¥è¯¢", description = "å§å") |
| | | @GetMapping("/page") |
| | | public R<IPage<ProduceDivisionViewVO>> page(String name, Query query) { |
| | | |
| | | IPage<ProduceDivisionViewVO> pages = service.pageQuery(name,query); |
| | | return R.data(pages); |
| | | } |
| | | } |
ÎļþÃû´Ó blade-service/blade-mdm/src/main/java/org/springblade/mdm/basesetting/produceplan/entity/ProducePlan.java ÐÞ¸Ä |
| | |
| | | package org.springblade.mdm.basesetting.produceplan.entity; |
| | | package org.springblade.mdm.basesetting.producedivision.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | |
| | | import org.springblade.core.mp.base.BizEntity; |
| | | |
| | | /** |
| | | * 主å¶è®¡å表 |
| | | * 主å¶å工表 |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | @TableName("mdm_produce_plan") |
| | | public class ProducePlan extends BizEntity { |
| | | @TableName("mdm_produce_division") |
| | | public class ProduceDivision extends BizEntity { |
| | | /** |
| | | * ä¸ä¸ç»é¿id |
| | | */ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.basesetting.producedivision.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.basesetting.producedivision.entity.ProduceDivision; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.ProduceDivisionViewVO; |
| | | |
| | | public interface ProduceDivisionMapper extends BladeMapper<ProduceDivision> { |
| | | |
| | | IPage<ProduceDivisionViewVO> pageQuery(@Param("page")IPage<ProduceDivision> page, @Param("name")String name); |
| | | //pageMachine |
| | | } |
ÎļþÃû´Ó blade-service/blade-mdm/src/main/java/org/springblade/mdm/basesetting/produceplan/mapper/ProducePlanMapper.xml ÐÞ¸Ä |
| | |
| | | <?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.basesetting.produceplan.mapper.ProducePlanMapper"> |
| | | <mapper namespace="org.springblade.mdm.basesetting.producedivision.mapper.ProduceDivisionMapper"> |
| | | <!-- |
| | | <!– éç¨æ¥è¯¢æ å°ç»æ –> |
| | | <resultMap id="BaseResultMap" type="org.springblade.mdm.basesetting.machine.entity.Machine"> |
| | |
| | | <result column="updateTime" property="update_time"/> |
| | | <result column="is_deleted" property="isDeleted"/> |
| | | </resultMap>--> |
| | | <select id="pageQuery" resultType="org.springblade.mdm.basesetting.produceplan.vo.ProducePlanViewVO"> |
| | | <select id="pageQuery" resultType="org.springblade.mdm.basesetting.producedivision.vo.ProduceDivisionViewVO"> |
| | | select p.id,p.team_leader_id,p.programmer_id,p.checker_id,p.senior_id,l.name team_leader_name,pro.name programmer_name,c.name checker_name,s.name seniorName |
| | | from mdm_produce_plan p join blade_user l on p.team_leader_id=l.id and l.is_deleted=0 |
| | | join blade_user pro on p.programmer_id=pro.id and pro.is_deleted=0 |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.basesetting.producedivision.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.mdm.basesetting.producedivision.entity.ProduceDivision; |
| | | import org.springblade.mdm.basesetting.producedivision.mapper.ProduceDivisionMapper; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.ProduceDivisionVO; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.ProduceDivisionViewVO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | @Service |
| | | public class ProduceDivisionService extends BizServiceImpl<ProduceDivisionMapper, ProduceDivision> { |
| | | |
| | | @Transactional |
| | | public void savePlan(ProduceDivisionVO vo){ |
| | | //TODO |
| | | ProduceDivision plan = new ProduceDivision(); |
| | | BeanUtil.copyProperties(vo, plan); |
| | | this.save(plan); |
| | | } |
| | | |
| | | public boolean updatePlan(ProduceDivisionVO vo) { |
| | | ProduceDivision plan = this.getById(vo.getId()); |
| | | |
| | | plan.setTeamLeaderId(vo.getTeamLeaderId()); |
| | | plan.setProgrammerId(vo.getProgrammerId()); |
| | | plan.setCheckerId(vo.getCheckerId()); |
| | | plan.setSeniorId(vo.getSeniorId()); |
| | | return this.updateById(plan); |
| | | } |
| | | /** |
| | | * æ¥è¯¢å页 |
| | | * @param query æ¥è¯¢åæ° |
| | | * @return åé¡µæ°æ® |
| | | */ |
| | | public IPage<ProduceDivisionViewVO> pageQuery(String name, Query query) { |
| | | |
| | | LambdaQueryWrapper<ProduceDivision> queryWrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | |
| | | |
| | | return this.getBaseMapper().pageQuery(Condition.getPage(query),name); |
| | | } |
| | | } |
ÎļþÃû´Ó blade-service/blade-mdm/src/main/java/org/springblade/mdm/basesetting/produceplan/vo/ProducePlanVO.java ÐÞ¸Ä |
| | |
| | | package org.springblade.mdm.basesetting.produceplan.vo; |
| | | package org.springblade.mdm.basesetting.producedivision.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.core.mp.base.BizEntity; |
| | | import org.springblade.mdm.commons.vo.BaseVO; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | public class ProducePlanVO extends BaseVO { |
| | | public class ProduceDivisionVO extends BaseVO { |
| | | /** |
| | | * ä¸ä¸ç»é¿id |
| | | */ |
ÎļþÃû´Ó blade-service/blade-mdm/src/main/java/org/springblade/mdm/basesetting/produceplan/vo/ProducePlanViewVO.java ÐÞ¸Ä |
| | |
| | | package org.springblade.mdm.basesetting.produceplan.vo; |
| | | package org.springblade.mdm.basesetting.producedivision.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Getter; |
| | |
| | | */ |
| | | @Setter |
| | | @Getter |
| | | public class ProducePlanViewVO extends BaseVO { |
| | | public class ProduceDivisionViewVO extends BaseVO { |
| | | |
| | | @Schema(description = "ä¸ä¸ç»é¿id") |
| | | private Long teamLeaderId; |
| | |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.mdm.basesetting.machine.vo.MachineSaveVO; |
| | | import org.springblade.mdm.flow.excution.StartDispatcher; |
| | | import org.springblade.mdm.flow.vo.TaskAssignVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private StartDispatcher dispatcher; |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | /** |
| | | * æ°å¢ |
| | | */ |
| | |
| | | @Operation(summary = "ä»»å¡è®¡å(派工æµç¨)", description = "å¯å¨æ´¾å·¥æµç¨") |
| | | public R<Boolean> save(@RequestBody TaskAssignVO startVO) { |
| | | dispatcher.start(startVO); |
| | | return R.<Boolean>status(true); |
| | | 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(name = "variables", description = "ä»»å¡åé") @RequestBody Map<String, Object> variables) { |
| | | // å¢å è¯è®º |
| | | if (StringUtil.isNoneBlank(processInstanceId, comment)) { |
| | | taskService.addComment(taskId, processInstanceId, comment); |
| | |
| | | package org.springblade.mdm.flow.excution; |
| | | |
| | | import org.springblade.mdm.basesetting.produceplan.entity.ProducePlan; |
| | | import org.springblade.mdm.basesetting.produceplan.mapper.ProducePlanMapper; |
| | | import org.springblade.mdm.basesetting.producedivision.entity.ProduceDivision; |
| | | import org.springblade.mdm.basesetting.producedivision.mapper.ProduceDivisionMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @Service |
| | | public class AutoAssignUsersService { |
| | | @Autowired |
| | | private ProducePlanMapper planMapper; |
| | | private ProduceDivisionMapper planMapper; |
| | | |
| | | public Map<String,Object> autoAssignUsers(long producePlanId){ |
| | | ProducePlan pplan = planMapper.selectById(producePlanId); |
| | | ProduceDivision pplan = planMapper.selectById(producePlanId); |
| | | Map<String,Object> result = new HashMap<String,Object>(); |
| | | result.put("teamLeader",pplan.getTeamLeaderId()); |
| | | result.put("programmer",pplan.getProgrammerId()); |
| | |
| | | ProcessInstance pinst = runtimeService.startProcessInstanceByKey(PROCESS_KEY,businessKey,vars); |
| | | |
| | | int a=1; |
| | | a =2; |
| | | //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()); |
| | | |
| | | } |
| | | } |
| | |
| | | UNIQUE KEY `uniqueCodeIndex` (`code`,`is_deleted`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='æºåº'; |
| | | |
| | | CREATE TABLE `mdm_produce_plan` ( |
| | | CREATE TABLE `mdm_produce_division` ( |
| | | `id` bigint NOT NULL, |
| | | `team_leader_id` bigint NOT NULL COMMENT 'ä¸ä¸ç»é¿è´¦å·', |
| | | `programmer_id` bigint NOT NULL COMMENT 'ç¼å¶åè´¦å·', |