39 changed files with 1360 additions and 43 deletions
			
			
		@ -0,0 +1,81 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.dto; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.Date; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色和事件标签关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-20 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class RoleEventsTagDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 主键 | 
				
			|||
     */ | 
				
			|||
	private String id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色ID | 
				
			|||
     */ | 
				
			|||
	private Long roleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 事件标签ID | 
				
			|||
     */ | 
				
			|||
	private String eventTagId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建人 | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新人 | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 删除标识 0:未删除,1:已删除 | 
				
			|||
     */ | 
				
			|||
	private String delFlag; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,32 @@ | 
				
			|||
package com.elink.esua.epdc.dto.epdc.form; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.Min; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author:liuchuang | 
				
			|||
 * @Date:2021/7/21 13:33 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class WorkUserEventTagRelationFormDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = -8443508933049274341L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 页码 | 
				
			|||
     */ | 
				
			|||
    @Min(value = 1, message = "页码必须大于0") | 
				
			|||
    private Integer pageIndex; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 页容量 | 
				
			|||
     */ | 
				
			|||
    @Min(value = 1, message = "页容量必须大于0") | 
				
			|||
    private Integer pageSize; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 事件标签ID | 
				
			|||
     */ | 
				
			|||
    private String eventTagId; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,44 @@ | 
				
			|||
package com.elink.esua.epdc.dto.epdc.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author:liuchuang | 
				
			|||
 * @Date:2021/7/21 13:34 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class WorkUserEventTagRelationResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = -5886159562245131518L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 用户ID | 
				
			|||
     */ | 
				
			|||
    private Long id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 姓名 | 
				
			|||
     */ | 
				
			|||
    private String realName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 头像 | 
				
			|||
     */ | 
				
			|||
    private String headUrl; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 性别   1:男   0:女    2:保密 | 
				
			|||
     */ | 
				
			|||
    private Integer gender; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 手机号 | 
				
			|||
     */ | 
				
			|||
    private String mobile; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 职务 | 
				
			|||
     */ | 
				
			|||
    private String position; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,103 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.controller; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.tools.page.PageData; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.Result; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; | 
				
			|||
import com.elink.esua.epdc.dto.RoleEventsTagDTO; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.form.WorkUserEventTagRelationFormDTO; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO; | 
				
			|||
import com.elink.esua.epdc.service.RoleEventsTagService; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.web.bind.annotation.*; | 
				
			|||
 | 
				
			|||
import javax.servlet.http.HttpServletResponse; | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色和事件标签关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-20 | 
				
			|||
 */ | 
				
			|||
@RestController | 
				
			|||
@RequestMapping("roleeventstag") | 
				
			|||
public class RoleEventsTagController { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private RoleEventsTagService roleEventsTagService; | 
				
			|||
 | 
				
			|||
    @GetMapping("page") | 
				
			|||
    public Result<PageData<RoleEventsTagDTO>> page(@RequestParam Map<String, Object> params){ | 
				
			|||
        PageData<RoleEventsTagDTO> page = roleEventsTagService.page(params); | 
				
			|||
        return new Result<PageData<RoleEventsTagDTO>>().ok(page); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @GetMapping("{id}") | 
				
			|||
    public Result<RoleEventsTagDTO> get(@PathVariable("id") String id){ | 
				
			|||
        RoleEventsTagDTO data = roleEventsTagService.get(id); | 
				
			|||
        return new Result<RoleEventsTagDTO>().ok(data); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @PostMapping | 
				
			|||
    public Result save(@RequestBody RoleEventsTagDTO dto){ | 
				
			|||
        //效验数据
 | 
				
			|||
        ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); | 
				
			|||
        roleEventsTagService.save(dto); | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @PutMapping | 
				
			|||
    public Result update(@RequestBody RoleEventsTagDTO dto){ | 
				
			|||
        //效验数据
 | 
				
			|||
        ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); | 
				
			|||
        roleEventsTagService.update(dto); | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @DeleteMapping | 
				
			|||
    public Result delete(@RequestBody String[] ids){ | 
				
			|||
        //效验数据
 | 
				
			|||
        AssertUtils.isArrayEmpty(ids, "id"); | 
				
			|||
        roleEventsTagService.delete(ids); | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 获取事件标签关联的工作端用户 | 
				
			|||
     * | 
				
			|||
     * @param formDto | 
				
			|||
     * @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO>> | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/21 13:47 | 
				
			|||
     */ | 
				
			|||
    @GetMapping("eventtagworkuser") | 
				
			|||
    public Result<List<WorkUserEventTagRelationResultDTO>> eventTagWorkUser(@RequestBody WorkUserEventTagRelationFormDTO formDto) { | 
				
			|||
        List<WorkUserEventTagRelationResultDTO> data = roleEventsTagService.eventTagWorkUser(formDto); | 
				
			|||
        return new Result<List<WorkUserEventTagRelationResultDTO>>().ok(data); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,66 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.dao; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.form.WorkUserEventTagRelationFormDTO; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO; | 
				
			|||
import com.elink.esua.epdc.entity.RoleEventsTagEntity; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色和事件标签关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-20 | 
				
			|||
 */ | 
				
			|||
@Mapper | 
				
			|||
public interface RoleEventsTagDao extends BaseDao<RoleEventsTagEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 删除角色对应的事件标签关系 | 
				
			|||
     * | 
				
			|||
     * @param roleId | 
				
			|||
     * @return void | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/20 14:58 | 
				
			|||
     */ | 
				
			|||
    void updateDelFlag(Long roleId); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 根据角色获取事件标签 | 
				
			|||
     * | 
				
			|||
     * @param roleId | 
				
			|||
     * @return java.util.List<java.lang.String> | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/20 15:02 | 
				
			|||
     */ | 
				
			|||
    List<String> selectListEventTagIdByRoleId(Long roleId); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 获取事件标签关联的工作端用户 | 
				
			|||
     * | 
				
			|||
     * @param formDto | 
				
			|||
     * @return java.util.List<com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO> | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/21 13:49 | 
				
			|||
     */ | 
				
			|||
    List<WorkUserEventTagRelationResultDTO> eventTagWorkUser(WorkUserEventTagRelationFormDTO formDto); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,51 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.entity; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.annotation.TableName; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; | 
				
			|||
import lombok.Data; | 
				
			|||
import lombok.EqualsAndHashCode; | 
				
			|||
 | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色和事件标签关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-20 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
@EqualsAndHashCode(callSuper=false) | 
				
			|||
@TableName("epdc_role_events_tag") | 
				
			|||
public class RoleEventsTagEntity extends BaseEpdcEntity { | 
				
			|||
 | 
				
			|||
	private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 角色ID | 
				
			|||
     */ | 
				
			|||
	private Long roleId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 事件标签ID | 
				
			|||
     */ | 
				
			|||
	private String eventTagId; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,129 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.service; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; | 
				
			|||
import com.elink.esua.epdc.commons.tools.page.PageData; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.Result; | 
				
			|||
import com.elink.esua.epdc.dto.RoleEventsTagDTO; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.form.WorkUserEventTagRelationFormDTO; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO; | 
				
			|||
import com.elink.esua.epdc.entity.RoleEventsTagEntity; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色和事件标签关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-20 | 
				
			|||
 */ | 
				
			|||
public interface RoleEventsTagService extends BaseService<RoleEventsTagEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认分页 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return PageData<RoleEventsTagDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-20 | 
				
			|||
     */ | 
				
			|||
    PageData<RoleEventsTagDTO> page(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认查询 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return java.util.List<RoleEventsTagDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-20 | 
				
			|||
     */ | 
				
			|||
    List<RoleEventsTagDTO> list(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 单条查询 | 
				
			|||
     * | 
				
			|||
     * @param id | 
				
			|||
     * @return RoleEventsTagDTO | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-20 | 
				
			|||
     */ | 
				
			|||
    RoleEventsTagDTO get(String id); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认保存 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-20 | 
				
			|||
     */ | 
				
			|||
    void save(RoleEventsTagDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认更新 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-20 | 
				
			|||
     */ | 
				
			|||
    void update(RoleEventsTagDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 批量删除 | 
				
			|||
     * | 
				
			|||
     * @param ids | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-20 | 
				
			|||
     */ | 
				
			|||
    void delete(String[] ids); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 保存角色授权的事件标签 | 
				
			|||
     * | 
				
			|||
     * @param roleId | 
				
			|||
     * @param eventsTagIdList | 
				
			|||
     * @return com.elink.esua.epdc.commons.tools.utils.Result | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/20 14:49 | 
				
			|||
     */ | 
				
			|||
    Result saveOrUpdateRoleEventTagRelation(Long roleId, List<String> eventsTagIdList); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 根据角色获取事件标签 | 
				
			|||
     * | 
				
			|||
     * @param roleId | 
				
			|||
     * @return java.util.List<java.lang.String> | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/20 15:02 | 
				
			|||
     */ | 
				
			|||
    List<String> getEventTagIdList(Long roleId); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 获取事件标签关联的工作端用户 | 
				
			|||
     * | 
				
			|||
     * @param formDto | 
				
			|||
     * @return java.util.List<com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO> | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/21 13:49 | 
				
			|||
     */ | 
				
			|||
    List<WorkUserEventTagRelationResultDTO> eventTagWorkUser(WorkUserEventTagRelationFormDTO formDto); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,136 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.service.impl; | 
				
			|||
 | 
				
			|||
import cn.hutool.core.collection.CollectionUtil; | 
				
			|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			|||
import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			|||
import com.elink.esua.epdc.commons.tools.constant.NumConstant; | 
				
			|||
import com.elink.esua.epdc.commons.tools.page.PageData; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; | 
				
			|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.Result; | 
				
			|||
import com.elink.esua.epdc.dao.RoleEventsTagDao; | 
				
			|||
import com.elink.esua.epdc.dto.RoleEventsTagDTO; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.form.WorkUserEventTagRelationFormDTO; | 
				
			|||
import com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO; | 
				
			|||
import com.elink.esua.epdc.entity.RoleEventsTagEntity; | 
				
			|||
import com.elink.esua.epdc.service.RoleEventsTagService; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
import org.springframework.transaction.annotation.Transactional; | 
				
			|||
 | 
				
			|||
import java.util.Arrays; | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 角色和事件标签关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-20 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class RoleEventsTagServiceImpl extends BaseServiceImpl<RoleEventsTagDao, RoleEventsTagEntity> implements RoleEventsTagService { | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public PageData<RoleEventsTagDTO> page(Map<String, Object> params) { | 
				
			|||
        IPage<RoleEventsTagEntity> page = baseDao.selectPage( | 
				
			|||
                getPage(params, FieldConstant.CREATED_TIME, false), | 
				
			|||
                getWrapper(params) | 
				
			|||
        ); | 
				
			|||
        return getPageData(page, RoleEventsTagDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<RoleEventsTagDTO> list(Map<String, Object> params) { | 
				
			|||
        List<RoleEventsTagEntity> entityList = baseDao.selectList(getWrapper(params)); | 
				
			|||
 | 
				
			|||
        return ConvertUtils.sourceToTarget(entityList, RoleEventsTagDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    private QueryWrapper<RoleEventsTagEntity> getWrapper(Map<String, Object> params){ | 
				
			|||
        String id = (String)params.get(FieldConstant.ID_HUMP); | 
				
			|||
 | 
				
			|||
        QueryWrapper<RoleEventsTagEntity> wrapper = new QueryWrapper<>(); | 
				
			|||
        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); | 
				
			|||
 | 
				
			|||
        return wrapper; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public RoleEventsTagDTO get(String id) { | 
				
			|||
        RoleEventsTagEntity entity = baseDao.selectById(id); | 
				
			|||
        return ConvertUtils.sourceToTarget(entity, RoleEventsTagDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void save(RoleEventsTagDTO dto) { | 
				
			|||
        RoleEventsTagEntity entity = ConvertUtils.sourceToTarget(dto, RoleEventsTagEntity.class); | 
				
			|||
        insert(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void update(RoleEventsTagDTO dto) { | 
				
			|||
        RoleEventsTagEntity entity = ConvertUtils.sourceToTarget(dto, RoleEventsTagEntity.class); | 
				
			|||
        updateById(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void delete(String[] ids) { | 
				
			|||
        // 逻辑删除(@TableLogic 注解)
 | 
				
			|||
        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public Result saveOrUpdateRoleEventTagRelation(Long roleId, List<String> eventsTagIdList) { | 
				
			|||
        if (null != roleId) { | 
				
			|||
            // 删除角色已关联的事件标签
 | 
				
			|||
            baseDao.updateDelFlag(roleId); | 
				
			|||
            // 插入新的关联关系
 | 
				
			|||
            for (String eventTagId: | 
				
			|||
                    eventsTagIdList) { | 
				
			|||
                RoleEventsTagEntity entity = new RoleEventsTagEntity(); | 
				
			|||
                entity.setRoleId(roleId); | 
				
			|||
                entity.setEventTagId(eventTagId); | 
				
			|||
                insert(entity); | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
 | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<String> getEventTagIdList(Long roleId) { | 
				
			|||
        return baseDao.selectListEventTagIdByRoleId(roleId); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<WorkUserEventTagRelationResultDTO> eventTagWorkUser(WorkUserEventTagRelationFormDTO formDto) { | 
				
			|||
        int pageIndex = (formDto.getPageIndex() - NumConstant.ONE) * formDto.getPageSize(); | 
				
			|||
        formDto.setPageIndex(pageIndex); | 
				
			|||
        return baseDao.eventTagWorkUser(formDto); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,33 @@ | 
				
			|||
<?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="com.elink.esua.epdc.dao.RoleEventsTagDao"> | 
				
			|||
 | 
				
			|||
    <update id="updateDelFlag"> | 
				
			|||
        UPDATE epdc_role_events_tag SET DEL_FLAG = '1' WHERE role_id = #{roleId} | 
				
			|||
    </update> | 
				
			|||
 | 
				
			|||
    <select id="selectListEventTagIdByRoleId" resultType="string"> | 
				
			|||
        SELECT EVENT_TAG_ID FROM epdc_role_events_tag WHERE DEL_FLAG = '0' AND role_id = #{roleId} | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
    <select id="eventTagWorkUser" resultType="com.elink.esua.epdc.dto.epdc.result.WorkUserEventTagRelationResultDTO"> | 
				
			|||
        SELECT | 
				
			|||
            u.id, | 
				
			|||
            u.real_name, | 
				
			|||
            u.head_url, | 
				
			|||
            u.gender, | 
				
			|||
            u.mobile, | 
				
			|||
            u.position | 
				
			|||
        FROM | 
				
			|||
            epdc_role_events_tag t | 
				
			|||
            LEFT JOIN sys_role_user ru ON ru.role_id = t.ROLE_ID | 
				
			|||
            LEFT JOIN sys_user u ON u.id = ru.user_id | 
				
			|||
        WHERE | 
				
			|||
            t.DEL_FLAG = '0' | 
				
			|||
          AND t.EVENT_TAG_ID = #{eventTagId} | 
				
			|||
          AND u.del_flag = 0 | 
				
			|||
          LIMIT #{pageIndex},#{pageSize} | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
@ -0,0 +1,81 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.dto; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.Date; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 事件工作人员关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-21 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class WorkUserEventsDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 主键 | 
				
			|||
     */ | 
				
			|||
	private String id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 工作人员ID | 
				
			|||
     */ | 
				
			|||
	private Long workUserId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 事件ID | 
				
			|||
     */ | 
				
			|||
	private String eventId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建人 | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新人 | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 删除标识 0:未删除,1:已删除 | 
				
			|||
     */ | 
				
			|||
	private String delFlag; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,84 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.modules.events.controller; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.tools.page.PageData; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.Result; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; | 
				
			|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; | 
				
			|||
import com.elink.esua.epdc.dto.WorkUserEventsDTO; | 
				
			|||
import com.elink.esua.epdc.modules.events.service.WorkUserEventsService; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.web.bind.annotation.*; | 
				
			|||
 | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 事件工作人员关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-21 | 
				
			|||
 */ | 
				
			|||
@RestController | 
				
			|||
@RequestMapping("workusereventstag") | 
				
			|||
public class WorkUserEventsController { | 
				
			|||
 | 
				
			|||
    @Autowired | 
				
			|||
    private WorkUserEventsService workUserEventsService; | 
				
			|||
 | 
				
			|||
    @GetMapping("page") | 
				
			|||
    public Result<PageData<WorkUserEventsDTO>> page(@RequestParam Map<String, Object> params){ | 
				
			|||
        PageData<WorkUserEventsDTO> page = workUserEventsService.page(params); | 
				
			|||
        return new Result<PageData<WorkUserEventsDTO>>().ok(page); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @GetMapping("{id}") | 
				
			|||
    public Result<WorkUserEventsDTO> get(@PathVariable("id") String id){ | 
				
			|||
        WorkUserEventsDTO data = workUserEventsService.get(id); | 
				
			|||
        return new Result<WorkUserEventsDTO>().ok(data); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @PostMapping | 
				
			|||
    public Result save(@RequestBody WorkUserEventsDTO dto){ | 
				
			|||
        //效验数据
 | 
				
			|||
        ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); | 
				
			|||
        workUserEventsService.save(dto); | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @PutMapping | 
				
			|||
    public Result update(@RequestBody WorkUserEventsDTO dto){ | 
				
			|||
        //效验数据
 | 
				
			|||
        ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); | 
				
			|||
        workUserEventsService.update(dto); | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @DeleteMapping | 
				
			|||
    public Result delete(@RequestBody String[] ids){ | 
				
			|||
        //效验数据
 | 
				
			|||
        AssertUtils.isArrayEmpty(ids, "id"); | 
				
			|||
        workUserEventsService.delete(ids); | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,33 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.modules.events.dao; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; | 
				
			|||
import com.elink.esua.epdc.modules.events.entity.WorkUserEventsEntity; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 事件工作人员关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-21 | 
				
			|||
 */ | 
				
			|||
@Mapper | 
				
			|||
public interface WorkUserEventsDao extends BaseDao<WorkUserEventsEntity> { | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,51 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.modules.events.entity; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.annotation.TableName; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; | 
				
			|||
import lombok.Data; | 
				
			|||
import lombok.EqualsAndHashCode; | 
				
			|||
 | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 事件工作人员关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-21 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
@EqualsAndHashCode(callSuper=false) | 
				
			|||
@TableName("epdc_work_user_events") | 
				
			|||
public class WorkUserEventsEntity extends BaseEpdcEntity { | 
				
			|||
 | 
				
			|||
	private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 工作人员ID | 
				
			|||
     */ | 
				
			|||
	private Long workUserId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 事件ID | 
				
			|||
     */ | 
				
			|||
	private String eventId; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,107 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.modules.events.service; | 
				
			|||
 | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; | 
				
			|||
import com.elink.esua.epdc.commons.tools.page.PageData; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.Result; | 
				
			|||
import com.elink.esua.epdc.dto.WorkUserEventsDTO; | 
				
			|||
import com.elink.esua.epdc.modules.events.entity.WorkUserEventsEntity; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 事件工作人员关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-21 | 
				
			|||
 */ | 
				
			|||
public interface WorkUserEventsService extends BaseService<WorkUserEventsEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认分页 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return PageData<WorkUserEventsTagDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-21 | 
				
			|||
     */ | 
				
			|||
    PageData<WorkUserEventsDTO> page(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认查询 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return java.util.List<WorkUserEventsTagDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-21 | 
				
			|||
     */ | 
				
			|||
    List<WorkUserEventsDTO> list(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 单条查询 | 
				
			|||
     * | 
				
			|||
     * @param id | 
				
			|||
     * @return WorkUserEventsTagDTO | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-21 | 
				
			|||
     */ | 
				
			|||
    WorkUserEventsDTO get(String id); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认保存 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-21 | 
				
			|||
     */ | 
				
			|||
    void save(WorkUserEventsDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认更新 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-21 | 
				
			|||
     */ | 
				
			|||
    void update(WorkUserEventsDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 批量删除 | 
				
			|||
     * | 
				
			|||
     * @param ids | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-07-21 | 
				
			|||
     */ | 
				
			|||
    void delete(String[] ids); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 保存事件与工作人员关系 | 
				
			|||
     * | 
				
			|||
     * @param eventId | 
				
			|||
     * @param workUserIds | 
				
			|||
     * @return com.elink.esua.epdc.commons.tools.utils.Result | 
				
			|||
     * @author liuchuang | 
				
			|||
     * @since 2021/7/21 14:28 | 
				
			|||
     */ | 
				
			|||
    Result saveWorkUserRelationEventInfo(String eventId, List<Long> workUserIds); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,117 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.elink.esua.epdc.modules.events.service.impl; | 
				
			|||
 | 
				
			|||
import cn.hutool.core.collection.CollectionUtil; | 
				
			|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			|||
import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			|||
import com.elink.esua.epdc.commons.tools.page.PageData; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; | 
				
			|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; | 
				
			|||
import com.elink.esua.epdc.commons.tools.utils.Result; | 
				
			|||
import com.elink.esua.epdc.dto.WorkUserEventsDTO; | 
				
			|||
import com.elink.esua.epdc.modules.events.dao.WorkUserEventsDao; | 
				
			|||
import com.elink.esua.epdc.modules.events.entity.WorkUserEventsEntity; | 
				
			|||
import com.elink.esua.epdc.modules.events.service.WorkUserEventsService; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
import org.springframework.transaction.annotation.Transactional; | 
				
			|||
 | 
				
			|||
import java.util.Arrays; | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 事件工作人员关系表 | 
				
			|||
 * | 
				
			|||
 * @author qu qu@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-07-21 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class WorkUserEventsServiceImpl extends BaseServiceImpl<WorkUserEventsDao, WorkUserEventsEntity> implements WorkUserEventsService { | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public PageData<WorkUserEventsDTO> page(Map<String, Object> params) { | 
				
			|||
        IPage<WorkUserEventsEntity> page = baseDao.selectPage( | 
				
			|||
                getPage(params, FieldConstant.CREATED_TIME, false), | 
				
			|||
                getWrapper(params) | 
				
			|||
        ); | 
				
			|||
        return getPageData(page, WorkUserEventsDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<WorkUserEventsDTO> list(Map<String, Object> params) { | 
				
			|||
        List<WorkUserEventsEntity> entityList = baseDao.selectList(getWrapper(params)); | 
				
			|||
 | 
				
			|||
        return ConvertUtils.sourceToTarget(entityList, WorkUserEventsDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    private QueryWrapper<WorkUserEventsEntity> getWrapper(Map<String, Object> params){ | 
				
			|||
        String id = (String)params.get(FieldConstant.ID_HUMP); | 
				
			|||
 | 
				
			|||
        QueryWrapper<WorkUserEventsEntity> wrapper = new QueryWrapper<>(); | 
				
			|||
        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); | 
				
			|||
 | 
				
			|||
        return wrapper; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public WorkUserEventsDTO get(String id) { | 
				
			|||
        WorkUserEventsEntity entity = baseDao.selectById(id); | 
				
			|||
        return ConvertUtils.sourceToTarget(entity, WorkUserEventsDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void save(WorkUserEventsDTO dto) { | 
				
			|||
        WorkUserEventsEntity entity = ConvertUtils.sourceToTarget(dto, WorkUserEventsEntity.class); | 
				
			|||
        insert(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void update(WorkUserEventsDTO dto) { | 
				
			|||
        WorkUserEventsEntity entity = ConvertUtils.sourceToTarget(dto, WorkUserEventsEntity.class); | 
				
			|||
        updateById(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void delete(String[] ids) { | 
				
			|||
        // 逻辑删除(@TableLogic 注解)
 | 
				
			|||
        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public Result saveWorkUserRelationEventInfo(String eventId, List<Long> workUserIds) { | 
				
			|||
        if (StringUtils.isNotEmpty(eventId) && CollectionUtil.isNotEmpty(workUserIds)) { | 
				
			|||
            for (Long workUserId: | 
				
			|||
                    workUserIds) { | 
				
			|||
                WorkUserEventsEntity entity = new WorkUserEventsEntity(); | 
				
			|||
                entity.setWorkUserId(workUserId); | 
				
			|||
                entity.setEventId(eventId); | 
				
			|||
                insert(entity); | 
				
			|||
            } | 
				
			|||
        } | 
				
			|||
 | 
				
			|||
        return new Result(); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,7 @@ | 
				
			|||
<?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="com.elink.esua.epdc.modules.events.dao.WorkUserEventsDao"> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue