¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | package org.springblade.mdm.program.controller; |
| | | |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | 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.system.feign.ISysClient; |
| | | import org.springblade.system.pojo.entity.Dept; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æµç¨ç®¡çæ¥å£ |
| | | * |
| | | * @author Chill |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @RequestMapping("/system/") |
| | | @AllArgsConstructor |
| | | @Tag(name = "MDMç³»ç»æ¥å£", description = "å¼å
¥blade-systemçæ¥å£") |
| | | @Slf4j |
| | | public class MdmSystemController { |
| | | private final ISysClient sysClient; |
| | | |
| | | @GetMapping("/dept/lazy-list") |
| | | @ApiOperationSupport(order = 2) |
| | | @Operation(summary = "è·ååæ°å¼") |
| | | public R<List<Dept>> deptLazyList(@Parameter(description = "æºæç¶èç¹id") @RequestParam Long deptId) { |
| | | try { |
| | | if(deptId == null){ |
| | | deptId = 0L; |
| | | } |
| | | return sysClient.getDeptChild(deptId); |
| | | }catch (Exception e){ |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <sql id="all_columns">id,tenant_id,name,parent_id,node_type,status,create_dept,is_deleted,create_time,create_user,update_time,update_user</sql> |
| | | <sql id="all_columns_n">n.id,n.tenant_id,n.name,n.parent_id,n.node_type,n.description,n.remark,n.status,n.create_dept,n.is_deleted,n.create_time,n.create_user,n.update_time,n.update_user</sql> |
| | | <select id="lazyList" resultType="org.springblade.mdm.program.vo.NcNodeVO"> |
| | | select <include refid="all_columns_n"/>,u.name create_user_name,( |
| | | select <include refid="all_columns_n"/>,dt.dict_value as node_type_name,u.name create_user_name,( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | mdm_nc_node |
| | | WHERE |
| | | parent_id = n.id and is_deleted = 0 |
| | | ) AS "has_children" from mdm_nc_node n left join blade_user u on n.create_user=u.id where n.is_deleted=0 and n.parent_id=#{parentId} |
| | | ) AS "has_children" from mdm_nc_node n left join blade_user u on n.create_user=u.id |
| | | left join blade_dict_biz dt on n.node_type=dt.dict_key and dt.code='nc_node_type' |
| | | where n.is_deleted=0 and n.parent_id=#{parentId} |
| | | </select> |
| | | |
| | | |
| | |
| | | |
| | | /** |
| | | * åç(å级工åºç次),å级工åºçæ¬ï¼å
æ¬ç¨åºåå
¶ä»éä»¶ï¼ |
| | | * @param bindNodeid ç¨åºæä»¶ç»å®çèç¹id |
| | | * @param bindNcNodeId ç¨åºæä»¶ç»å®çèç¹id |
| | | * @param newProcessEdition æ°ç次 |
| | | */ |
| | | public void upgradeProcessEdition(long bindNcNodeid,String newProcessEdition) { |
| | | public void upgradeProcessEdition(Long bindNcNodeId,String newProcessEdition) { |
| | | //NcProgram prog = this.getById(id); |
| | | NcProgram prog = getByBindNodeId(bindNcNodeid); |
| | | NcProgram prog = getByBindNodeId(bindNcNodeId); |
| | | |
| | | //å°ç°æç¨åºæ´æ°ä¸ºéææ°çæ¬ |
| | | this.update(Wrappers.lambdaUpdate(NcProgram.class).eq(NcProgram::getBindNcNodeId,bindNcNodeid).set(NcProgram::getIsLastEdition,0)); |
| | | this.update(Wrappers.lambdaUpdate(NcProgram.class).eq(NcProgram::getBindNcNodeId,bindNcNodeId).set(NcProgram::getIsLastEdition,0)); |
| | | |
| | | NcProgram newVerProg = new NcProgram(); |
| | | BeanUtils.copyProperties(prog, newVerProg); |