| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.modules.activiti.entity.ActivitiDefinition; |
| | | import org.jeecg.modules.activiti.request.ActivitiDefinitionRequest; |
| | |
| | | |
| | | @AutoLog(value = "DNCæµç¨é
ç½®-ä¿®æ¹é
ç½®") |
| | | @ApiOperation(value = "DNCæµç¨é
ç½®-ä¿®æ¹é
ç½®", notes = "DNCæµç¨é
ç½®-ä¿®æ¹é
ç½®") |
| | | @PutMapping("/edit/{id}") |
| | | public ResponseResult editDefinition(@PathVariable("id") String id, @RequestBody ActivitiDefinition definition) { |
| | | boolean b = definitionService.editDefinition(id, definition); |
| | | @PutMapping("/edit") |
| | | public ResponseResult editDefinition( @RequestBody ActivitiDefinition definition) { |
| | | boolean b = definitionService.updateById(definition); |
| | | if(b) |
| | | return new ResponseResult(CommonCode.SUCCESS); |
| | | return new ResponseResult(CommonCode.FAIL); |
| | |
| | | |
| | | @AutoLog(value = "DNCæµç¨é
ç½®-å页æ¥è¯¢é
ç½®å表") |
| | | @ApiOperation(value = "DNCæµç¨é
ç½®-å页æ¥è¯¢é
ç½®å表", notes = "DNCæµç¨é
ç½®-å页æ¥è¯¢é
ç½®å表") |
| | | @GetMapping("/find/page/{page}/{size}") |
| | | public QueryPageResponseResult<ActivitiDefinition> findPageList(@PathVariable("page") int page, @PathVariable("size") int size, ActivitiDefinitionRequest request) { |
| | | return definitionService.findPageList(page, size, request); |
| | | @GetMapping("/find/page") |
| | | public Result<?> findPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | ActivitiDefinitionRequest request) { |
| | | return definitionService.findPageList(pageNo, pageSize, request); |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.modules.activiti.entity.AssignFileStream; |
| | | import org.jeecg.modules.activiti.ext.ActTaskExt; |
| | |
| | | |
| | | @AutoLog(value = "DNCæµç¨æä½-å·²åå表è·å") |
| | | @ApiOperation(value = "DNCæµç¨æä½-å·²åå表è·å", notes = "DNCæµç¨æä½-å·²åå表è·å") |
| | | @GetMapping("/find/page/{page}/{size}") |
| | | public QueryPageResponseResult<AssignFileStreamExt> findPageList(@PathVariable("page") int page, @PathVariable("size") int size, AssignFileStreamQueryRequest request) { |
| | | return assignFileStreamService.findPageList(page, size, request); |
| | | @GetMapping("/find/page") |
| | | public Result<?> findPageList(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, AssignFileStreamQueryRequest request) { |
| | | return assignFileStreamService.findPageList(pageNo, pageSize, request); |
| | | } |
| | | |
| | | @AutoLog(value = "DNCæµç¨æä½-æ¥è¯¢ææ¡£ç审æ¹è®°å½") |
| | |
| | | package org.jeecg.modules.activiti.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | @TableField(value = "act_name") |
| | | private String actName; |
| | | @TableField(value = "depart_id") |
| | | @Dict(dictTable = "sys_department",dicCode = "depart_id",dicText = "depart_name") |
| | | private String departId; |
| | | @TableField(value = "approve_users") |
| | | @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") |
| | | private String approveUsers; |
| | | @JsonIgnore |
| | | @TableField(value = "create_time", select = false, fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | @JsonIgnore |
| | | @TableField(value = "update_time", select = false, fill = FieldFill.UPDATE) |
| | | @TableField(value = "update_time", fill = FieldFill.UPDATE) |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | private Date updateTime; |
| | | @JsonIgnore |
| | | @TableField(value = "create_user", select = false, fill = FieldFill.INSERT) |
| | |
| | | import io.swagger.annotations.Api; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | private Date approveTime; |
| | | @TableField(value = "status") |
| | | @Dict(dicCode = "dnc_assign_stream_status") |
| | | private Integer status; |
| | | @JsonIgnore |
| | | @TableField(value = "create_time", select = false, fill = FieldFill.INSERT) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.jeecg.modules.activiti.mapper.AssignFileStreamMapper"> |
| | | <select id="getAssignFileStreamDetail" resultType="org.jeecg.modules.activiti.ext.AssignFileStreamExt" parameterType="String"> |
| | | select a.stream_id |
| | | , a.product_id |
| | | , a.component_id |
| | | , a.parts_id |
| | | , a.process_id |
| | | , a.doc_id |
| | | , a.file_id |
| | | , a.device_id |
| | | , a.apply_user_id |
| | | , a.apply_reason |
| | | , a.apply_time |
| | | , a.approve_user_id |
| | | , a.approve_content |
| | | , a.approve_time |
| | | , a.status |
| | | , u1.realname as applyUser |
| | | , u2.realname as approveUser |
| | | , p.product_name as productName |
| | | , c.component_name as componentName |
| | | , pt.parts_name as partsName |
| | | , dc.doc_name as docName |
| | | , dc.publish_version as version |
| | | , dc.doc_suffix as docSuffix |
| | | , de.device_name as deviceName |
| | | from (select * from nc_assign_file_stream where stream_id=#{streamId}) a |
| | | left join sys_user u1 |
| | | on a.apply_user_id=u1.id |
| | | left join sys_user u2 |
| | | on a.approve_user_id=u2.id |
| | | left join nc_product_info p |
| | | on a.product_id=p.product_id |
| | | left join nc_component_info c |
| | | on a.component_id=c.component_id |
| | | left join nc_parts_info pt |
| | | on a.parts_id=pt.parts_id |
| | | left join nc_doc_info dc |
| | | on a.doc_id=dc.doc_id |
| | | left join nc_device_info de |
| | | on a.device_id=de.device_id |
| | | |
| | | </select> |
| | | |
| | | <select id="findByPage" resultType="org.jeecg.modules.activiti.ext.AssignFileStreamExt" parameterType="String"> |
| | | select a.stream_id |
| | | , a.product_id |
| | | , a.component_id |
| | | , a.parts_id |
| | | , a.process_id |
| | | , a.doc_id |
| | | , a.file_id |
| | | , a.device_id |
| | | , a.apply_user_id |
| | | , a.apply_reason |
| | | , a.apply_time |
| | | , a.approve_user_id |
| | | , a.approve_content |
| | | , a.approve_time |
| | | , a.status |
| | | , u1.realname as applyUser |
| | | , u2.realname as approveUser |
| | | , p.product_name as productName |
| | | , c.component_name as componentName |
| | | , pt.parts_name as partsName |
| | | , dc.doc_name as docName |
| | | , dc.publish_version as version |
| | | , dc.doc_suffix as docSuffix |
| | | , de.device_name as deviceName |
| | | from (select * from nc_assign_file_stream where delete_flag=0 and approve_time is not null) a |
| | | left join sys_user u1 |
| | | on a.apply_user_id=u1.id |
| | | left join sys_user u2 |
| | | on a.approve_user_id=u2.id |
| | | left join nc_product_info p |
| | | on a.product_id=p.product_id |
| | | left join nc_component_info c |
| | | on a.component_id=c.component_id |
| | | left join nc_parts_info pt |
| | | on a.parts_id=pt.parts_id |
| | | left join nc_doc_info dc |
| | | on a.doc_id=dc.doc_id |
| | | left join nc_device_info de |
| | | on a.device_id=de.device_id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.activiti.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.activiti.entity.ActivitiDefinition; |
| | | import org.jeecg.modules.activiti.request.ActivitiDefinitionRequest; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | |
| | | * @param request |
| | | * @return |
| | | */ |
| | | QueryPageResponseResult<ActivitiDefinition> findPageList(int page, int size, ActivitiDefinitionRequest request); |
| | | Result<?> findPageList(int page, int size, ActivitiDefinitionRequest request); |
| | | |
| | | /** |
| | | * è·åå¤ä¸ªé¨é¨ç审æ¹äºº å»é |
| | |
| | | package org.jeecg.modules.activiti.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.activiti.entity.AssignFileStream; |
| | | import org.jeecg.modules.activiti.ext.ActTaskExt; |
| | | import org.jeecg.modules.activiti.ext.AssignFileStreamExt; |
| | |
| | | * @param size |
| | | * @return |
| | | */ |
| | | QueryPageResponseResult<AssignFileStreamExt> findPageList(int page, int size, AssignFileStreamQueryRequest request); |
| | | Result<?> findPageList(int page, int size, AssignFileStreamQueryRequest request); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææ¡£ç审æ¹è®°å½ |
| | |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.activiti.entity.ActivitiDefinition; |
| | | import org.jeecg.modules.activiti.mapper.ActivitiDefinitionMapper; |
| | | import org.jeecg.modules.activiti.request.ActivitiDefinitionRequest; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public QueryPageResponseResult<ActivitiDefinition> findPageList(int page, int size, ActivitiDefinitionRequest request) { |
| | | public Result<?> findPageList(int page, int size, ActivitiDefinitionRequest request) { |
| | | if(page < 1 || size < 1) { |
| | | ExceptionCast.cast(CommonCode.INVALID_PAGE); |
| | | } |
| | |
| | | if(ValidateUtil.validateString(request.getActName())) { |
| | | lambdaQuery.like(ActivitiDefinition::getActName, request.getActName()); |
| | | } |
| | | |
| | | if(ValidateUtil.validateString(request.getAscStr())) { |
| | | String[] ascArr = request.getAscStr().split(","); |
| | | // ((Page<ActivitiDefinition>) pageData).setAsc(ascArr); |
| | | } |
| | | if(ValidateUtil.validateString(request.getDescStr())) { |
| | | String[] descStr = request.getDescStr().split(","); |
| | | // ((Page<ActivitiDefinition>) pageData).setDesc(descStr); |
| | | } |
| | | } |
| | | lambdaQuery.orderByDesc(ActivitiDefinition::getCreateTime); |
| | | IPage<ActivitiDefinition> definitionIPage = lambdaQuery.page(pageData); |
| | | return new QueryPageResponseResult<>(CommonCode.SUCCESS, definitionIPage); |
| | | return Result.ok(definitionIPage); |
| | | |
| | | } |
| | | |
| | |
| | | import org.activiti.engine.task.Task; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.activiti.entity.AssignFileStream; |
| | | import org.jeecg.modules.activiti.entity.ToEquipmentTask; |
| | |
| | | |
| | | @Override |
| | | public List<ActTaskExt> getUndoTaskList() { |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | if(!ValidateUtil.validateString(userId)) |
| | | return null; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public QueryPageResponseResult<AssignFileStreamExt> findPageList(int page, int size, AssignFileStreamQueryRequest request) { |
| | | public Result<?> findPageList(int page, int size, AssignFileStreamQueryRequest request) { |
| | | if(page < 1 || size < 1) { |
| | | ExceptionCast.cast(CommonCode.INVALID_PAGE); |
| | | } |
| | |
| | | } |
| | | } |
| | | IPage<AssignFileStreamExt> streamExtIPage = super.getBaseMapper().findByPage(pageData, lambdaQueryWrapper); |
| | | return new QueryPageResponseResult<>(CommonCode.SUCCESS, streamExtIPage); |
| | | return Result.ok(streamExtIPage); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.dnc.request.DepartmentRequest; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.IDepartmentService; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.model.SysDepartTreeModel; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | list = Collections.emptyList(); |
| | | return new QueryListResponseResult<>(CommonCode.SUCCESS, list); |
| | | } |
| | | |
| | | |
| | | @AutoLog(value = "DNCé¨é¨ç®¡ç-è·åæ ç»æ") |
| | | @ApiOperation(value = "DNCé¨é¨ç®¡ç-è·åæ ç»æ", notes = "DNCé¨é¨ç®¡ç-è·åæ ç»æ") |
| | | @GetMapping("/load/queryTreeList") |
| | | public QueryListResponseResult<CommonJsonTree> queryTreeList() { |
| | | List<CommonJsonTree> tree = departmentService.loadTree(); |
| | | if(tree == null) |
| | | tree = Collections.emptyList(); |
| | | return new QueryListResponseResult(CommonCode.SUCCESS, tree); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ°æ® æ¥åºææé¨é¨,并以æ ç»ææ°æ®æ ¼å¼ååºç»å端 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "/queryTreeList") |
| | | public Result<List<DepartmentTreeModel>> queryTreeList(@RequestParam(name = "ids", required = false) String ids) { |
| | | Result<List<DepartmentTreeModel>> result = new Result<>(); |
| | | try { |
| | | // ä»å
åä¸è¯»å |
| | | // List<SysDepartTreeModel> list =FindsDepartsChildrenUtil.getSysDepartTreeList(); |
| | | // if (CollectionUtils.isEmpty(list)) { |
| | | // list = sysDepartService.queryTreeList(); |
| | | // } |
| | | if(oConvertUtils.isNotEmpty(ids)){ |
| | | List<DepartmentTreeModel> departList = departmentService.queryTreeList(ids); |
| | | result.setResult(departList); |
| | | }else{ |
| | | List<DepartmentTreeModel> list = departmentService.queryTreeList(); |
| | | result.setResult(list); |
| | | } |
| | | result.setSuccess(true); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * <p> |
| | | * é¨é¨æç´¢åè½æ¹æ³,æ ¹æ®å
³é®åæ¨¡ç³æç´¢ç¸å
³é¨é¨ |
| | | * </p> |
| | | * |
| | | * @param keyWord |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/searchBy", method = RequestMethod.GET) |
| | | public Result<List<DepartmentTreeModel>> searchBy(@RequestParam(name = "keyWord", required = true) String keyWord,@RequestParam(name = "myDeptSearch", required = false) String myDeptSearch) { |
| | | Result<List<DepartmentTreeModel>> result = new Result<List<DepartmentTreeModel>>(); |
| | | //é¨é¨æ¥è¯¢ï¼myDeptSearch为1æ¶ä¸ºæçé¨é¨æ¥è¯¢ï¼ç»å½ç¨æ·ä¸ºä¸çº§æ¶æ¥åªæ¥è´è´£é¨é¨ä¸æ°æ® |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String departIds = null; |
| | | if(oConvertUtils.isNotEmpty(user.getUserIdentity()) && user.getUserIdentity().equals( CommonConstant.USER_IDENTITY_2 )){ |
| | | departIds = user.getDepartIds(); |
| | | } |
| | | List<DepartmentTreeModel> treeList = this.departmentService.searchByKeyWord(keyWord,myDeptSearch,departIds); |
| | | if (treeList == null || treeList.size() == 0) { |
| | | result.setSuccess(false); |
| | | result.setMessage("æªæ¥è¯¢å¹é
æ°æ®ï¼"); |
| | | return result; |
| | | } |
| | | result.setResult(treeList); |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.dnc.entity.DocFile; |
| | |
| | | @AutoLog(value = "ææ¡£è¡¨-å页æ¥è¯¢æ¥å£") |
| | | @ApiOperation(value = "ææ¡£è¡¨-å页æ¥è¯¢æ¥å£", notes = "ææ¡£è¡¨-å页æ¥è¯¢æ¥å£") |
| | | @GetMapping("/find/page/{page}/{size}") |
| | | public QueryPageResponseResult<DocInfo> findPageList(@PathVariable("page") int page, @PathVariable("size") int size, DocInfoQueryRequest docQuery) { |
| | | public Result<?> findPageList(@PathVariable("page") int page, @PathVariable("size") int size, DocInfoQueryRequest docQuery) { |
| | | return docInfoService.findPageList(page, size, docQuery); |
| | | } |
| | | |
| | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | |
| | | import java.util.Date; |
| | | /** |
| | |
| | | @TableField(value = "doc_suffix") |
| | | private String docSuffix; |
| | | @TableField(value = "doc_status") |
| | | @Dict(dicCode = "dnc_product_status") |
| | | private Integer docStatus; |
| | | @TableField(value = "publish_file_id") |
| | | private String publishFileId; |
| | |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | private Date updateTime; |
| | | @TableField(value = "create_user",fill = FieldFill.INSERT) |
| | | @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") |
| | | private String createUser; |
| | | @TableField(value = "update_user", fill = FieldFill.UPDATE) |
| | | @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname") |
| | | private String updateUser; |
| | | @JsonIgnore |
| | | @TableLogic |
| | |
| | | @TableField(exist = false) |
| | | private String docClassCode; |
| | | @TableField(exist = false) |
| | | @Dict(dicCode = "dnc_pull_status") |
| | | private Integer pullStatus; |
| | | @TableField(exist = false) |
| | | private String pullUser; |
| | |
| | | private String classificationId; |
| | | //åæ¥ç¶æ 1 æªåæ¥ 2 已忥 |
| | | @TableField(exist = false) |
| | | @Dict(dicCode = "dnc_doc_sync_status") |
| | | private Integer syncStatus; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.response; |
| | | |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | import org.jeecg.modules.system.model.SysDepartTreeModel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * é¨é¨è¡¨ å°è£
æ ç»æçé¨é¨çåç§°çå®ä½ç±» |
| | | * <p> |
| | | * |
| | | * @Author Steve |
| | | * @Since 2019-01-22 |
| | | * |
| | | */ |
| | | public class DepartmentModel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | private String key; |
| | | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | private String title; |
| | | |
| | | private List<DepartmentModel> children = new ArrayList<>(); |
| | | |
| | | /** |
| | | * å°departmentTreeModelçé¨åæ°æ®æ¾å¨è¯¥å¯¹è±¡å½ä¸ |
| | | * @param departmentTreeModel |
| | | * @return |
| | | */ |
| | | public DepartmentModel convert(DepartmentTreeModel departmentTreeModel) { |
| | | this.key = departmentTreeModel.getDepartId(); |
| | | this.value = departmentTreeModel.getDepartId(); |
| | | this.title = departmentTreeModel.getDepartName(); |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * è¯¥æ¹æ³ä¸ºç¨æ·é¨é¨çå®ç°ç±»æä½¿ç¨ |
| | | * @param department |
| | | * @return |
| | | */ |
| | | public DepartmentModel convertByUserDepart(Department department) { |
| | | this.key = department.getDepartId(); |
| | | this.value = department.getDepartId(); |
| | | this.title = department.getDepartName(); |
| | | return this; |
| | | } |
| | | |
| | | public List<DepartmentModel> getChildren() { |
| | | return children; |
| | | } |
| | | |
| | | public void setChildren(List<DepartmentModel> children) { |
| | | this.children = children; |
| | | } |
| | | |
| | | public static long getSerialVersionUID() { |
| | | return serialVersionUID; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(String value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.dnc.response.CommonJsonTree; |
| | | import org.jeecg.modules.dnc.response.DepartmentTreeModel; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.dnc.request.DepartmentRequest; |
| | | import org.jeecg.modules.system.model.SysDepartTreeModel; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | boolean assignRemoveApproveUser(String departId, Integer relativeFlag, String[] userIds); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææé¨é¨ä¿¡æ¯,å¹¶åèç¹è¿è¡æ¾ç¤º |
| | | * @return |
| | | */ |
| | | List<DepartmentTreeModel> queryTreeList(); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ææé¨é¨ä¿¡æ¯,å¹¶åèç¹è¿è¡æ¾ç¤º |
| | | * @param ids å¤ä¸ªé¨é¨id |
| | | * @return |
| | | */ |
| | | List<DepartmentTreeModel> queryTreeList(String ids); |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®å
³é®åæç´¢ç¸å
³çé¨é¨æ°æ® |
| | | * @param keyWord |
| | | * @param myDeptSearch |
| | | * @param departIds å¤ä¸ªé¨é¨id |
| | | * @return |
| | | */ |
| | | List<DepartmentTreeModel> searchByKeyWord(String keyWord,String myDeptSearch,String departIds); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.DocFile; |
| | | import org.jeecg.modules.dnc.entity.DocInfo; |
| | | import org.jeecg.modules.dnc.entity.ProcessStream; |
| | |
| | | * @param docQuery |
| | | * @return |
| | | */ |
| | | QueryPageResponseResult<DocInfo> findPageList(int page, int size, DocInfoQueryRequest docQuery); |
| | | Result<?> findPageList(int page, int size, DocInfoQueryRequest docQuery); |
| | | |
| | | /** |
| | | * |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import io.netty.util.internal.StringUtil; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.activiti.entity.ActivitiDefinition; |
| | | import org.jeecg.modules.activiti.service.IActivitiDefinitionService; |
| | | import org.jeecg.modules.dnc.dto.DepartApproveUser; |
| | |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.DepartmentMapper; |
| | | import org.jeecg.modules.dnc.request.DepartmentRequest; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.response.CommonJsonTree; |
| | | import org.jeecg.modules.dnc.response.DepartmentCode; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.service.support.DepartmentTreeWrapper; |
| | | import org.jeecg.modules.dnc.service.support.FindsDepartmentChildrenUtil; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.model.SysDepartTreeModel; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecg.modules.system.util.FindsDepartsChildrenUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ææé¨é¨ä¿¡æ¯,å¹¶åèç¹è¿è¡æ¾ç¤º |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DepartmentTreeModel> queryTreeList(){ |
| | | LambdaQueryWrapper<Department> query = new LambdaQueryWrapper<Department>(); |
| | | query.eq(Department::getDeleteFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(Department::getPriority); |
| | | List<Department> list = this.list(query); |
| | | List<DepartmentTreeModel> listResult = FindsDepartmentChildrenUtil.wrapTreeDataToTreeList(list); |
| | | return listResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ææé¨é¨ä¿¡æ¯,å¹¶åèç¹è¿è¡æ¾ç¤º |
| | | * @param ids å¤ä¸ªé¨é¨id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DepartmentTreeModel> queryTreeList(String ids){ |
| | | List<DepartmentTreeModel> listResult=new ArrayList<>(); |
| | | LambdaQueryWrapper<Department> query = new LambdaQueryWrapper<Department>(); |
| | | query.eq(Department::getDeleteFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | if(oConvertUtils.isNotEmpty(ids)){ |
| | | query.in(true,Department::getDepartId,ids.split(",")); |
| | | } |
| | | query.orderByAsc(Department::getPriority); |
| | | List<Department> list= this.list(query); |
| | | for (Department department : list) { |
| | | listResult.add(new DepartmentTreeModel(department)); |
| | | } |
| | | return listResult; |
| | | } |
| | | |
| | | /** |
| | | * <p> |
| | | * æ ¹æ®å
³é®åæç´¢ç¸å
³çé¨é¨æ°æ® |
| | | * </p> |
| | | */ |
| | | @Override |
| | | public List<DepartmentTreeModel> searchByKeyWord(String keyWord,String myDeptSearch,String departIds) { |
| | | LambdaQueryWrapper<Department> query = new LambdaQueryWrapper<Department>(); |
| | | List<DepartmentTreeModel> newList = new ArrayList<>(); |
| | | query.like(Department::getDepartName, keyWord); |
| | | //update-begin--Author:huangzhilin Date:20140417 forï¼[bugfreeå·]ç»ç»æºææç´¢åæ¾ä¼å-------------------- |
| | | DepartmentTreeModel model = new DepartmentTreeModel(); |
| | | List<Department> departList = this.list(query); |
| | | if(departList.size() > 0) { |
| | | for(Department depart : departList) { |
| | | model = new DepartmentTreeModel(depart); |
| | | model.setChildren(null); |
| | | //update-end--Author:huangzhilin Date:20140417 forï¼[bugfreeå·]ç»ç»æºææç´¢ååæ¾ä¼å---------------------- |
| | | newList.add(model); |
| | | } |
| | | return newList; |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.DocInfoMapper; |
| | |
| | | |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public QueryPageResponseResult<DocInfo> findPageList(int page, int size, DocInfoQueryRequest docQuery) { |
| | | public Result<?> findPageList(int page, int size, DocInfoQueryRequest docQuery) { |
| | | if(page < 1 || size < 1) { |
| | | ExceptionCast.cast(CommonCode.INVALID_PAGE); |
| | | } |
| | |
| | | // ((Page<DocInfo>) pageData).setDesc(descStr); |
| | | } |
| | | IPage<DocInfo> docInfoIPage = super.getBaseMapper().findDocExtList(pageData, queryWrapper); |
| | | return new QueryPageResponseResult<>(CommonCode.SUCCESS, docInfoIPage); |
| | | return Result.ok(docInfoIPage); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public List<CommonGenericTree> loadProductTree(String userId) { |
| | | //todo ç¿»è¯å建人修æ¹äºº |
| | | //产å |
| | | List<ProductInfo> productInfoList = getByUserPerms(userId); |
| | | if(productInfoList == null || productInfoList.isEmpty()) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.support; |
| | | |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.dnc.response.DepartmentModel; |
| | | import org.jeecg.modules.dnc.response.DepartmentTreeModel; |
| | | import org.jeecg.modules.dnc.ucenter.Department; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | public class FindsDepartmentChildrenUtil { |
| | | //é¨é¨æ ä¿¡æ¯-æ ç»æ |
| | | //private static List<DepartmentTreeModel> sysDepartTreeList = new ArrayList<DepartmentTreeModel>(); |
| | | |
| | | //é¨é¨æ id-æ ç»æ |
| | | //private static List<DepartmentModel> idList = new ArrayList<>(); |
| | | |
| | | |
| | | /** |
| | | * queryTreeListçåæ¹æ³ ====1===== |
| | | * è¯¥æ¹æ³æ¯så°SysDepartç±»åçlistéåè½¬æ¢æSysDepartTreeModelç±»åçéå |
| | | */ |
| | | public static List<DepartmentTreeModel> wrapTreeDataToTreeList(List<Department> recordList) { |
| | | // å¨è¯¥æ¹æ³æ¯è¯·æ±ä¸æ¬¡,é½è¦å¯¹å
¨å±listéåè¿è¡ä¸æ¬¡æ¸
ç |
| | | //idList.clear(); |
| | | List<DepartmentModel> idList = new ArrayList<DepartmentModel>(); |
| | | List<DepartmentTreeModel> records = new ArrayList<>(); |
| | | for (int i = 0; i < recordList.size(); i++) { |
| | | Department depart = recordList.get(i); |
| | | records.add(new DepartmentTreeModel(depart)); |
| | | } |
| | | List<DepartmentTreeModel> tree = findChildren(records, idList); |
| | | setEmptyChildrenAsNull(tree); |
| | | return tree; |
| | | } |
| | | |
| | | /** |
| | | * è·å DepartmentModel |
| | | * @param recordList |
| | | * @return |
| | | */ |
| | | public static List<DepartmentModel> wrapTreeDataToDepartIdTreeList(List<Department> recordList) { |
| | | // å¨è¯¥æ¹æ³æ¯è¯·æ±ä¸æ¬¡,é½è¦å¯¹å
¨å±listéåè¿è¡ä¸æ¬¡æ¸
ç |
| | | //idList.clear(); |
| | | List<DepartmentModel> idList = new ArrayList<DepartmentModel>(); |
| | | List<DepartmentTreeModel> records = new ArrayList<>(); |
| | | for (int i = 0; i < recordList.size(); i++) { |
| | | Department depart = recordList.get(i); |
| | | records.add(new DepartmentTreeModel(depart)); |
| | | } |
| | | findChildren(records, idList); |
| | | return idList; |
| | | } |
| | | |
| | | /** |
| | | * queryTreeListçåæ¹æ³ ====2===== |
| | | * è¯¥æ¹æ³æ¯æ¾å°å¹¶å°è£
顶级ç¶ç±»çèç¹å°TreeListéå |
| | | */ |
| | | private static List<DepartmentTreeModel> findChildren(List<DepartmentTreeModel> recordList, |
| | | List<DepartmentModel> departIdList) { |
| | | |
| | | List<DepartmentTreeModel> treeList = new ArrayList<>(); |
| | | for (int i = 0; i < recordList.size(); i++) { |
| | | DepartmentTreeModel branch = recordList.get(i); |
| | | if (oConvertUtils.isEmpty(branch.getParentId())) { |
| | | treeList.add(branch); |
| | | DepartmentModel DepartmentModel = new DepartmentModel().convert(branch); |
| | | departIdList.add(DepartmentModel); |
| | | } |
| | | } |
| | | getGrandChildren(treeList,recordList,departIdList); |
| | | |
| | | //idList = departIdList; |
| | | return treeList; |
| | | } |
| | | |
| | | /** |
| | | * queryTreeListçåæ¹æ³====3==== |
| | | *è¯¥æ¹æ³æ¯æ¾å°é¡¶çº§ç¶ç±»ä¸çææåèç¹éåå¹¶å°è£
å°TreeListéå |
| | | */ |
| | | private static void getGrandChildren(List<DepartmentTreeModel> treeList,List<DepartmentTreeModel> recordList,List<DepartmentModel> idList) { |
| | | |
| | | for (int i = 0; i < treeList.size(); i++) { |
| | | DepartmentTreeModel model = treeList.get(i); |
| | | DepartmentModel idModel = idList.get(i); |
| | | for (int i1 = 0; i1 < recordList.size(); i1++) { |
| | | DepartmentTreeModel m = recordList.get(i1); |
| | | if (m.getParentId()!=null && m.getParentId().equals(model.getDepartId())) { |
| | | model.getChildren().add(m); |
| | | DepartmentModel dim = new DepartmentModel().convert(m); |
| | | idModel.getChildren().add(dim); |
| | | } |
| | | } |
| | | getGrandChildren(treeList.get(i).getChildren(), recordList, idList.get(i).getChildren()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * queryTreeListçåæ¹æ³ ====4==== |
| | | * è¯¥æ¹æ³æ¯å°åèç¹ä¸ºç©ºçListéå设置为Nullå¼ |
| | | */ |
| | | private static void setEmptyChildrenAsNull(List<DepartmentTreeModel> treeList) { |
| | | |
| | | for (int i = 0; i < treeList.size(); i++) { |
| | | DepartmentTreeModel model = treeList.get(i); |
| | | if (model.getChildren().size() == 0) { |
| | | model.setChildren(null); |
| | | }else{ |
| | | setEmptyChildrenAsNull(model.getChildren()); |
| | | } |
| | | } |
| | | // sysDepartTreeList = treeList; |
| | | } |
| | | } |