| | |
| | | * æ°å¢ |
| | | */ |
| | | @PostMapping("/save") |
| | | @Operation(summary = "æ°å¢", description = "æºåºç»ä¿¡æ¯") |
| | | @Operation(summary = "æ°å¢", description = "æºåºä¿¡æ¯") |
| | | public R<Boolean> save(@RequestBody MachineSaveVO vo) { |
| | | |
| | | service.saveMachine(vo); |
| | |
| | | list.add(excelVO); |
| | | }); |
| | | |
| | | ExcelUtil.export(response, "æºåºæ°æ®" + DateUtil.time(), "ç¨æ·æ°æ®è¡¨", list, MachineExcelVO.class); |
| | | ExcelUtil.export(response, "æºåºæ°æ®" + DateUtil.time(), "æºåºæ°æ®è¡¨", list, MachineExcelVO.class); |
| | | } |
| | | |
| | | @Operation(summary = "äº§çæºåºåä¼ ç»ææ ", description = "äº§çæºåºåä¼ ç»ææ ") |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @GetMapping("overtime-list") |
| | | @ApiOperationSupport(order = 3) |
| | | @Operation(summary = "è¶
æ¶æ¥è¯¢", description = "æ¥è¯¢ææè¶
æ¶ä»»å¡") |
| | | public R<IPage<BladeFlow>> overtimeList(@Parameter(description = "æ§è¡äººå") String assigneeName, @Parameter(description = "å
³é®å") String keyword, Query query) { |
| | | IPage<BladeFlow> pages = businessService.selectOvertimePage(Condition.getPage(query), assigneeName,keyword); |
| | | public R<IPage<BladeFlow>> overtimeList(@Parameter(description = "ä»»å¡å°è¾¾æ¶é´å¼å§") LocalDate createTimeBegin, @Parameter(description = "ä»»å¡å°è¾¾æ¶é´æªæ¢")LocalDate createTimeEnd, @Parameter(description = "æ§è¡äººå") String assigneeName, @Parameter(description = "å
³é®å") String keyword, Query query) { |
| | | IPage<BladeFlow> pages = businessService.selectOvertimePage(Condition.getPage(query), createTimeBegin,createTimeEnd,assigneeName,keyword); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | * @param keyword |
| | | * @return |
| | | */ |
| | | public IPage<BladeFlow> selectOvertimePage(IPage<BladeFlow> page, String assigneeName,String keyword) { |
| | | public IPage<BladeFlow> selectOvertimePage(IPage<BladeFlow> page,LocalDate createTimeBegin,LocalDate createTimeEnd, String assigneeName,String keyword) { |
| | | |
| | | List<BladeFlow> flowList = new LinkedList<>(); |
| | | Date now = new Date(); |
| | | TaskQuery todoQuery = taskService.createTaskQuery().taskDueBefore(now).active().includeProcessVariables(); |
| | | if(Func.isNotEmpty(createTimeBegin)) { |
| | | todoQuery.taskCreatedAfter(DateUtil.toDate(createTimeBegin)); |
| | | } |
| | | if(Func.isNotEmpty(createTimeEnd)) { |
| | | todoQuery.taskCreatedBefore(DateUtil.toDate(createTimeEnd.plusDays(1))); |
| | | } |
| | | |
| | | if(Func.isNotEmpty(keyword)) { |
| | | todoQuery.taskVariableValueLike("assigneeName", "%"+assigneeName+"%"); |
| | |
| | | /** |
| | | * 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.controller; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | package org.springblade.mdm.program.controller; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | 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.NcNodeService; |
| | | import org.springblade.mdm.program.vo.NcNodeVO; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * ç¨åºèç¹ |
| | | * |
| | | * @author yangys |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("/program/node") |
| | | @AllArgsConstructor |
| | | @Tag(name = "ç¨åºèç¹", description = "ç¨åºèç¹") |
| | | @Slf4j |
| | | public class NcNodeController { |
| | | |
| | | private final NcNodeService ncNodeService; |
| | | |
| | | /** |
| | | * æ°å¢ |
| | | */ |
| | | @PostMapping("/save") |
| | | @Operation(summary = "æ°å¢", description = "èç¹ä¿¡æ¯") |
| | | public R<Boolean> save(@RequestBody NcNodeVO vo) { |
| | | |
| | | ncNodeService.saveNcCode(vo); |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ |
| | | */ |
| | | @PostMapping("/update") |
| | | @Operation(summary = "ä¿®æ¹", description = "èç¹ä¿¡æ¯") |
| | | public R<Boolean> update(@RequestBody NcNodeVO vo) { |
| | | |
| | | ncNodeService.updateNcCode(vo); |
| | | return R.<Boolean>status(true); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.time.LocalDateTime; |
| | | |
| | | @Setter |
| | | @Getter |
| | | @TableName("mdm_nc_node") |
| | | public class NcNode extends BizEntity { |
| | | private String name; |
| | | private Long parentId; |
| | | /** |
| | | * ç¨åºå
å |
| | | */ |
| | | private String nodeType; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.mp.mapper.BladeMapper; |
| | | import org.springblade.mdm.program.entity.NcNode; |
| | | import org.springblade.mdm.program.entity.NcProgram; |
| | | |
| | | public interface NcNodeMapper extends BladeMapper<NcNode> { |
| | | |
| | | /** |
| | | * è·åææ°åºåç¨åº |
| | | * @param partNo é¶ç»ä»¶å· |
| | | * @param machineGroupCode æºåºç»ä»£ç |
| | | * @return |
| | | */ |
| | | //NcProgram getCuredNcProgram(@Param("partNo")String partNo,@Param("machineGroupCode")String machineGroupCode); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.NcNodeMapper"> |
| | | <resultMap id="BaseResultMap" type="org.springblade.mdm.program.entity.NcNode"> |
| | | <id column="id" property="id"/> |
| | | <result column="name" property="name"/> |
| | | <result column="parent_id" property="parentId"/> |
| | | <result column="node_type" property="nodeType"/> |
| | | <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="pageQuery" resultType="org.springblade.mdm.basesetting.machine.vo.MachineVO"> |
| | | select m.id,m.name,m.code,g.dict_key machine_group_code,g.dict_value machine_group_name,m.machine_spec,m.manufacturer,m.operator |
| | | from mdm_machine m join blade_dict_biz g on m.machine_group_code=g.dict_key and g.code='machine_group' and g.is_deleted=0 |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | --> |
| | | |
| | | |
| | | <!-- <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, |
| | | 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> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | package org.springblade.mdm.program.service; |
| | | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.flowable.engine.*; |
| | | import org.springblade.core.mp.base.BizServiceImpl; |
| | | 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.mapper.NcNodeMapper; |
| | | import org.springblade.mdm.program.vo.NcNodeVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * ç¨åºèç¹ |
| | | * |
| | | * @author yangys |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class NcNodeService extends BizServiceImpl<NcNodeMapper, NcNode> { |
| | | |
| | | |
| | | public void saveNcCode(NcNodeVO vo) { |
| | | NcNode ncNode = new NcNode(); |
| | | |
| | | BeanUtils.copyProperties(vo, ncNode); |
| | | ncNode.setId(null); |
| | | |
| | | this.save(ncNode); |
| | | } |
| | | |
| | | |
| | | public void updateNcCode(NcNodeVO vo) { |
| | | NcNode ncNode = this.getById(vo.getId()); |
| | | ncNode.setName(vo.getName()); |
| | | ncNode.setNodeType(vo.getNodeType()); |
| | | |
| | | this.updateById(ncNode); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.springblade.mdm.program.vo; |
| | | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springblade.mdm.commons.vo.BaseVO; |
| | | |
| | | @Setter |
| | | @Getter |
| | | public class NcNodeVO extends BaseVO { |
| | | private String name; |
| | | private Long parentId; |
| | | /** |
| | | * ç¨åºå
å |
| | | */ |
| | | private String nodeType; |
| | | |
| | | } |