Commit a9b9267e by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents c199a27d f307c1f6
package com.gic.auth.dto;
import java.io.Serializable;
import java.util.Date;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:42
*/
public class OrderAppResourceDTO implements Serializable {
private static final long serialVersionUID = 7478354440089304864L;
/**
*
*/
private Integer orderAppResourceId;
/**
*
*/
private Integer enterpriseId;
/**
* 类型 1:订单 2:应用
*/
private Integer type;
/**
* json内容
*/
private String content;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer status;
public Integer getOrderAppResourceId() {
return orderAppResourceId;
}
public void setOrderAppResourceId(Integer orderAppResourceId) {
this.orderAppResourceId = orderAppResourceId;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
......@@ -2,6 +2,8 @@ package com.gic.auth.qo;
import com.gic.enterprise.qo.PageQO;
import java.util.List;
/**
*
* @Description:
......@@ -14,6 +16,7 @@ public class AuditorListQO extends PageQO {
private String auditorName;
private Integer auditedGroupId;
private Integer isUse;
private List<Integer> auditorIdList;
public Integer getEnterpriseId() {
return enterpriseId;
......@@ -46,4 +49,12 @@ public class AuditorListQO extends PageQO {
public void setIsUse(Integer isUse) {
this.isUse = isUse;
}
public void setAuditorIdList(List<Integer> auditorIdList) {
this.auditorIdList = auditorIdList;
}
public List<Integer> getAuditorIdList() {
return auditorIdList;
}
}
......@@ -82,4 +82,29 @@ public interface AuditorApiService {
* @throws
*/
ServiceResponse<List<AuditorDTO>> listAuditor(AuditorListQO auditorListQO);
/**
* 查所有的审核员
* @Title: listAuditorByProject
* @Description:
* @author zhiwj
* @param projectItemId 审批项id
* @param userId 管理员id
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.AuditorDTO>>
* @throws
*/
ServiceResponse<List<AuditorDTO>> listAuditorByProject(Integer projectItemId, Integer userId, Integer enterpriseId);
/**
* 审核员审核受审项目审批项
* @Title: genAuditProject
* @Description:
* @author zhiwj
* @param projectItemId 审批项id
* @param userId 管理员id
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> genAuditProject(Integer projectItemId, Integer userId, Integer enterpriseId);
}
package com.gic.auth.service;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.OrderAppResourceDTO;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:52
*/
public interface OrderAppResourceApiService {
/**
*
* @Title: saveOrUpdate
* @Description:
* @author zhiwj
* @param orderAppResourceDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Integer>
* @throws
*/
ServiceResponse<Integer> saveOrUpdate(OrderAppResourceDTO orderAppResourceDTO);
/**
*
* @Title: getById
* @Description:
* @author zhiwj
* @param orderAppResourceId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.auth.dto.OrderAppResourceDTO>
* @throws
*/
ServiceResponse<OrderAppResourceDTO> getById(Integer orderAppResourceId);
}
......@@ -5,6 +5,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.UserDTO;
import com.gic.auth.dto.UserListDTO;
import com.gic.auth.qo.UserListQO;
import com.gic.enterprise.utils.UserDetail;
import java.util.List;
......@@ -100,4 +101,6 @@ public interface UserApiService {
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.auth.dto.UserDTO>>


 */
ServiceResponse<List<UserDTO>> listUserByIdList(List<Integer> userIdList);
ServiceResponse<UserDetail> getUserDetail(String token);
}
......@@ -65,4 +65,6 @@ public interface TabAuditedGroupUserRelMapper {
List<Map<Integer,Object>> getUserCountByAuditedGroup(@Param("ids") List<Integer> auditedGroupIds);
List<TabAuditedGroupUserRel> listAuditedGroup(AuditedGroupUserRelDTO groupUserRel);
List<Integer> listAuditedGroupByUserId(@Param("enterpriseId") Integer enterpriseId, @Param("userId") Integer userId);
}
\ No newline at end of file
......@@ -67,4 +67,8 @@ public interface TabAuditorAuditedGroupRelMapper {
List<TabAuditorAuditedGroupRel> listRel(AuditorAuditedGroupRelDTO auditorAuditedGroupRel);
List<Map<String,Object>> getCountByAuditorIds(@Param("ids") List<Integer> auditorIdList);
List<Integer> listRelByAuditedGroupIdAndAuditId(@Param("enterpriseId") Integer enterpriseId, @Param("auditedGroupIds") List<Integer> auditedGroupIds, @Param("projectAuditorIds") List<Integer> projectAuditorIds);
}
\ No newline at end of file
......@@ -64,4 +64,6 @@ public interface TabAuditorProjectItemRelMapper {
List<TabAuditorProjectItemRel> listRelByAuditorId(TabAuditorProjectItemRel auditorProjectItemRel);
List<Map<String,Object>> getCountByAuditorIds(@Param("ids") List<Integer> auditorIdList);
List<Integer> listAuditorIdByProjectId(@Param("enterpriseId") Integer enterpriseId, @Param("projectId") Integer projectId);
}
\ No newline at end of file
package com.gic.auth.dao.mapper;
import com.gic.auth.entity.TabSysOrderAppResource;
public interface TabSysOrderAppResourceMapper {
/**
* 根据主键删除
*
* @param orderAppResourceId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer orderAppResourceId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabSysOrderAppResource record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabSysOrderAppResource record);
/**
* 根据主键查询
*
* @param orderAppResourceId 主键
* @return 实体对象
*/
TabSysOrderAppResource selectByPrimaryKey(Integer orderAppResourceId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabSysOrderAppResource record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysOrderAppResource record);
}
\ No newline at end of file
package com.gic.auth.entity;
import java.util.Date;
/**
* tab_sys_order_app_resource
*/
public class TabSysOrderAppResource {
/**
*
*/
private Integer orderAppResourceId;
/**
*
*/
private Integer enterpriseId;
/**
* 类型 1:订单 2:应用
*/
private Integer type;
/**
* json内容
*/
private String content;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer status;
public Integer getOrderAppResourceId() {
return orderAppResourceId;
}
public void setOrderAppResourceId(Integer orderAppResourceId) {
this.orderAppResourceId = orderAppResourceId;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
\ No newline at end of file
......@@ -22,4 +22,6 @@ public interface AuditedGroupUserRelService {
List<TabAuditedGroupUserRel> listAuditedGroup(Integer auditedGroupId);
List<TabAuditedGroupUserRel> getUserIdListByAuditedGroup(List<Integer> auditedGroupIds);
List<Integer> listAuditedGroupByUserId(Integer enterpriseId, Integer userId);
}
......@@ -22,4 +22,6 @@ public interface AuditorAuditedGroupRelService {
List<TabAuditorAuditedGroupRel> listRelByAuditorId(Integer auditorId);
Map<Integer,Integer> getUserCountByAuditorIds(List<Integer> auditorIdList);
List<Integer> listRelByAuditedGroupIdAndAuditId(Integer enterpriseId, List<Integer> auditedGroupIds, List<Integer> projectAuditorIds);
}
......@@ -19,4 +19,6 @@ public interface AuditorProjectItemRelService {
List<TabAuditorProjectItemRel> listRelByAuditorId(Integer auditorId);
Map<Integer,Integer> getCountByAuditorIds(List<Integer> auditorIdList);
List<Integer> listAuditorIdByProjectId(Integer enterpriseId, Integer projectId);
}
......@@ -31,4 +31,6 @@ public interface AuditorService {
Page<TabAuditor> pageAuditor(AuditorListQO auditorListQO);
List<TabAuditor> listAuditor(AuditorListQO auditorListQO);
TabAuditor getAuditorByUserId(Integer enterpriseId, Integer userId);
}
package com.gic.auth.service;
import com.gic.auth.dto.OrderAppResourceDTO;
import com.gic.auth.entity.TabSysOrderAppResource;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:53
*/
public interface OrderAppResourceService {
Integer save(OrderAppResourceDTO orderAppResourceDTO);
Integer update(OrderAppResourceDTO orderAppResourceDTO);
Integer del(Integer orderAppResourceId);
TabSysOrderAppResource getById(Integer orderAppResourceId);
}
......@@ -72,4 +72,9 @@ public class AuditedGroupUserRelServiceImpl implements AuditedGroupUserRelServic
groupUserRel.setAuditedGroupIdList(auditedGroupIds);
return this.tabAuditedGroupUserRelMapper.listAuditedGroup(groupUserRel);
}
@Override
public List<Integer> listAuditedGroupByUserId(Integer enterpriseId, Integer userId) {
return tabAuditedGroupUserRelMapper.listAuditedGroupByUserId(enterpriseId, userId);
}
}
......@@ -95,6 +95,11 @@ public class AuditorAuditedGroupRelServiceImpl implements AuditorAuditedGroupRel
return resultMap;
}
@Override
public List<Integer> listRelByAuditedGroupIdAndAuditId(Integer enterpriseId, List<Integer> auditedGroupIds, List<Integer> projectAuditorIds) {
return tabAuditorAuditedGroupRelMapper.listRelByAuditedGroupIdAndAuditId(enterpriseId, auditedGroupIds, projectAuditorIds);
}
private Map<Integer, Integer> getAuditedGroupBelongAuditor(List<TabAuditorAuditedGroupRel> relList) {
Map<Integer, Integer> groupAuditorMap = new HashMap<>();
for (TabAuditorAuditedGroupRel tabAuditorAuditedGroupRel : relList) {
......
......@@ -57,10 +57,15 @@ public class AuditorProjectItemRelServiceImpl implements AuditorProjectItemRelSe
@Override
public Map<Integer, Integer> getCountByAuditorIds(List<Integer> auditorIdList) {
List<Map<String, Object>> mapList = tabAuditorProjectItemRelMapper.getCountByAuditorIds(auditorIdList);
HashMap<Integer, Integer> resultMap = new HashMap<>();
HashMap<Integer, Integer> resultMap = new HashMap<>(mapList.size());
for (Map<String, Object> map : mapList) {
resultMap.put(Integer.valueOf(map.get("auditorId").toString()), Integer.valueOf(map.get("projectItemCount").toString()));
}
return resultMap;
}
@Override
public List<Integer> listAuditorIdByProjectId(Integer enterpriseId, Integer projectId) {
return tabAuditorProjectItemRelMapper.listAuditorIdByProjectId(enterpriseId, projectId);
}
}
......@@ -107,4 +107,12 @@ public class AuditorServiceImpl implements AuditorService {
public List<TabAuditor> listAuditor(AuditorListQO auditorListQO) {
return tabAuditorMapper.listAuditor(auditorListQO);
}
@Override
public TabAuditor getAuditorByUserId(Integer enterpriseId, Integer userId) {
AuditorDTO auditorDTO = new AuditorDTO();
auditorDTO.setEnterpriseId(enterpriseId);
auditorDTO.setUserId(userId);
return tabAuditorMapper.getFirstAuditor(auditorDTO);
}
}
package com.gic.auth.service.impl;
import com.gic.auth.dao.mapper.TabSysOrderAppResourceMapper;
import com.gic.auth.dto.OrderAppResourceDTO;
import com.gic.auth.entity.TabSysOrderAppResource;
import com.gic.auth.service.OrderAppResourceService;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GlobalInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:53
*/
@Service
public class OrderAppResourceServiceImpl implements OrderAppResourceService {
@Autowired
private TabSysOrderAppResourceMapper tabSysOrderAppResourceMapper;
@Override
public Integer save(OrderAppResourceDTO orderAppResourceDTO) {
TabSysOrderAppResource resource = EntityUtil.changeEntityByJSON(TabSysOrderAppResource.class, orderAppResourceDTO);
resource.setCreateTime(new Date());
resource.setStatus(GlobalInfo.DATA_STATUS_NORMAL);
tabSysOrderAppResourceMapper.insertSelective(resource);
return resource.getOrderAppResourceId();
}
@Override
public Integer update(OrderAppResourceDTO orderAppResourceDTO) {
TabSysOrderAppResource orderAppResource = new TabSysOrderAppResource();
orderAppResource.setOrderAppResourceId(orderAppResourceDTO.getOrderAppResourceId());
orderAppResource.setContent(orderAppResourceDTO.getContent());
return tabSysOrderAppResourceMapper.updateByPrimaryKeySelective(orderAppResource);
}
@Override
public Integer del(Integer orderAppResourceId) {
TabSysOrderAppResource orderAppResource = new TabSysOrderAppResource();
orderAppResource.setOrderAppResourceId(orderAppResourceId);
orderAppResource.setStatus(GlobalInfo.DATA_STATUS_DELETE);
return tabSysOrderAppResourceMapper.updateByPrimaryKeySelective(orderAppResource);
}
@Override
public TabSysOrderAppResource getById(Integer orderAppResourceId) {
return tabSysOrderAppResourceMapper.selectByPrimaryKey(orderAppResourceId);
}
}
......@@ -3,12 +3,11 @@ package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.AuditorDTO;
import com.gic.auth.entity.TabAuditor;
import com.gic.auth.entity.TabAuditorAuditedGroupRel;
import com.gic.auth.entity.TabAuditorProjectItemRel;
import com.gic.auth.entity.*;
import com.gic.auth.qo.AuditorListQO;
import com.gic.auth.service.*;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GlobalInfo;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.dto.ProjectItemDTO;
import com.gic.enterprise.error.ErrorCode;
......@@ -26,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -48,6 +48,8 @@ public class AuditorApiServiceImpl implements AuditorApiService {
@Autowired
private AuditorAuditedGroupRelService auditorAuditedGroupRelService;
@Autowired
private AuditedGroupUserRelService auditedGroupUserRelService;
@Autowired
private ProjectItemApiService projectItemApiService;
@Autowired
private AuditedGroupService auditedGroupService;
......@@ -55,6 +57,8 @@ public class AuditorApiServiceImpl implements AuditorApiService {
private WeixinBaseFunService weixinBaseFunService;
@Autowired
private ServiceUserApiService serviceUserApiService;
@Autowired
private UserService userService;
public static final String APPKEY = "wxc6fd9beaf9a9dbe9";
......@@ -211,11 +215,52 @@ public class AuditorApiServiceImpl implements AuditorApiService {
return ServiceResponse.success(EntityUtil.changeEntityListByJSON(AuditorDTO.class, list));
}
@Override
public ServiceResponse<List<AuditorDTO>> listAuditorByProject(Integer projectItemId, Integer userId, Integer enterpriseId) {
ServiceResponse<ProjectItemDTO> projectItemResponse = projectItemApiService.getById(projectItemId);
if (projectItemResponse.isSuccess()) {
ProjectItemDTO projectItemDTO = projectItemResponse.getResult();
Integer projectId = projectItemDTO.getProjectId();
// 找到审批项对应的审核员
List<Integer> projectAuditorIds = auditorProjectItemRelService.listAuditorIdByProjectId(enterpriseId, projectId);
if (CollectionUtils.isNotEmpty(projectAuditorIds)) {
// 找到管理员所在的受审组
List<Integer> auditedGroupIds = auditedGroupUserRelService.listAuditedGroupByUserId(enterpriseId, userId);
if (CollectionUtils.isNotEmpty(auditedGroupIds)) {
List<Integer> auditorIds = auditorAuditedGroupRelService.listRelByAuditedGroupIdAndAuditId(enterpriseId, auditedGroupIds, projectAuditorIds);
if (CollectionUtils.isNotEmpty(auditorIds)) {
AuditorListQO listQO = new AuditorListQO();
listQO.setEnterpriseId(enterpriseId);
listQO.setIsUse(GlobalInfo.DATA_STATUS_NORMAL);
listQO.setAuditorIdList(auditorIds);
List<TabAuditor> auditorList = this.auditorService.listAuditor(listQO);
if (CollectionUtils.isNotEmpty(auditorList)) {
return ServiceResponse.success(EntityUtil.changeEntityListByJSON(AuditorDTO.class, auditorList));
}
}
}
}
AuditorDTO adminAuditor = this.getAdminAuditor(enterpriseId);
return ServiceResponse.success(Collections.singletonList(adminAuditor));
} else {
return ServiceResponse.failure(projectItemResponse.getCode(), projectItemResponse.getMessage());
}
}
@Override
public ServiceResponse<Void> genAuditProject(Integer projectItemId, Integer userId, Integer enterpriseId) {
ServiceResponse<List<AuditorDTO>> serviceResponse = this.listAuditorByProject(projectItemId, userId, enterpriseId);
if (serviceResponse.isSuccess()) {
List<AuditorDTO> auditorList = serviceResponse.getResult();
// todo 发送微信模板消息
// todo 如果审核员是管理员 插入后台待办事项
return ServiceResponse.success();
} else {
return EnterpriseServiceResponse.failure(serviceResponse.getCode(), serviceResponse.getMessage());
}
}
private String getTempQrCodeUrl(Integer auditorId) {
// String enterpriseId = GlobalVar.ctxPropertiesMap.get("data_security_enterpriseId");
// EnterpriseDTO enterpriseDTO = this.enterpriseService.getEnterpriseById(enterpriseId);
// String qrCodeUrl = this.weixinBaseFunService.getTemporaryQRcodeURL(enterpriseDTO.getAppkey(), "auditor_"+auditorId, 300);
// return qrCodeUrl;
logger.info("生成临时带参二维码 auditorId:{}", auditorId);
ServiceResponse<String> serviceResponse = weixinBaseFunService.getTemporaryQRcodeURL(APPKEY, "auditor_" + auditorId, 300);
if (serviceResponse.isSuccess()) {
......@@ -227,4 +272,21 @@ public class AuditorApiServiceImpl implements AuditorApiService {
}
// return "qrCodeUrl";
}
private AuditorDTO getAdminAuditor(Integer enterpriseId) {
TabSysUser adminUser = userService.getUserByEnterpriseId(enterpriseId);
TabAuditor auditor = auditorService.getAuditorByUserId(enterpriseId, adminUser.getUserId());
if (auditor == null) {
// 如果超级管理员不是审核员, 就封装一个
AuditorDTO auditorDTO = new AuditorDTO();
auditorDTO.setEnterpriseId(adminUser.getEnterpriseId());
auditorDTO.setAuditorName(adminUser.getUserName());
auditorDTO.setPhone(adminUser.getPhoneNumber());
auditorDTO.setUserId(adminUser.getUserId());
return auditorDTO;
} else {
return EntityUtil.changeEntityByJSON(AuditorDTO.class, auditor);
}
}
}
package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.OrderAppResourceDTO;
import com.gic.auth.entity.TabSysOrderAppResource;
import com.gic.auth.service.OrderAppResourceApiService;
import com.gic.auth.service.OrderAppResourceService;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* @Description:
* @author zhiwj
* @date 2019-09-25 15:52
*/
@Service("orderAppResourceApiService")
public class OrderAppResourceApiServiceImpl implements OrderAppResourceApiService {
@Autowired
private OrderAppResourceService orderAppResourceService;
@Override
public ServiceResponse<Integer> saveOrUpdate(OrderAppResourceDTO orderAppResourceDTO) {
if (orderAppResourceDTO.getOrderAppResourceId() == null) {
orderAppResourceService.save(orderAppResourceDTO);
} else {
orderAppResourceService.update(orderAppResourceDTO);
}
return ServiceResponse.success(orderAppResourceDTO.getOrderAppResourceId());
}
@Override
public ServiceResponse<OrderAppResourceDTO> getById(Integer orderAppResourceId) {
TabSysOrderAppResource orderAppResource = orderAppResourceService.getById(orderAppResourceId);
if (orderAppResource != null) {
return ServiceResponse.success(EntityUtil.changeEntityByJSON(OrderAppResourceDTO.class, orderAppResource));
} else {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
}
}
\ No newline at end of file
......@@ -14,7 +14,10 @@ import com.gic.auth.service.*;
import com.gic.auth.utils.ValidSplitUtils;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.constants.Constants;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.utils.UserDetail;
import com.gic.redis.data.util.RedisUtil;
import com.gic.store.utils.valid.ValidUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
......@@ -256,6 +259,16 @@ public class UserApiServiceImpl implements UserApiService {
return ServiceResponse.success(new ArrayList<>());
}
@Override
public ServiceResponse<UserDetail> getUserDetail(String token) {
String key = Constants.TOKEN_KEY + token;
Object cache = RedisUtil.getCache(key);
if(cache == null){
return ServiceResponse.success();
}
return ServiceResponse.success((UserDetail) cache);
}
/**
* 保存关联数据,角色关联、资源关联
* @Title: saveRole

......
......@@ -183,6 +183,17 @@
#{item}
</foreach>
</if>
</select>
<select id="listAuditedGroupByUserId" resultType="java.lang.Integer">
select
audited_group_id
from tab_audited_group_user_rel
where status = 1
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
<if test="userId != null ">
and user_id = #{userId}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -195,4 +195,25 @@
</if>
group by auditor_id
</select>
<select id="listRelByAuditedGroupIdAndAuditId" resultType="java.lang.Integer">
select
auditor_id
from tab_auditor_audited_group_rel
where status = 1
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
<if test="null != auditedGroupIds">
and audited_group_id in
<foreach collection="auditedGroupIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="null != projectAuditorIds">
and auditor_id in
<foreach collection="projectAuditorIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -173,6 +173,9 @@
<if test="openid != null and openid != '' ">
and openid = #{openid}
</if>
<if test="userId != null ">
and user_id = #{userId}
</if>
limit 1
</select>
<update id="delAuditor">
......@@ -195,5 +198,11 @@
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
<if test="null != auditorIdList">
and auditor_id in
<foreach collection="auditorIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -183,4 +183,16 @@
</if>
group by auditor_id
</select>
<select id="listAuditorIdByProjectId" resultType="java.lang.Integer">
select
auditor_id
from tab_auditor_project_item_rel
where status = 1
<if test="enterpriseId != null ">
and enterprise_id = #{enterpriseId}
</if>
<if test="projectId != null ">
and project_id = #{projectId}
</if>
</select>
</mapper>
\ No newline at end of file
<?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.gic.auth.dao.mapper.TabSysOrderAppResourceMapper">
<resultMap id="BaseResultMap" type="com.gic.auth.entity.TabSysOrderAppResource">
<id column="order_app_resource_id" jdbcType="INTEGER" property="orderAppResourceId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Base_Column_List">
order_app_resource_id, enterprise_id, type, content, create_time, update_time, status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_order_app_resource
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_order_app_resource
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysOrderAppResource">
insert into tab_sys_order_app_resource (order_app_resource_id, enterprise_id,
type, content, create_time,
update_time, status)
values (#{orderAppResourceId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysOrderAppResource">
<selectKey keyProperty="orderAppResourceId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_sys_order_app_resource
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderAppResourceId != null">
order_app_resource_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="type != null">
type,
</if>
<if test="content != null">
content,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="status != null">
status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderAppResourceId != null">
#{orderAppResourceId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,jdbcType=INTEGER},
</if>
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.auth.entity.TabSysOrderAppResource">
update tab_sys_order_app_resource
<set>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
</if>
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
</set>
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.auth.entity.TabSysOrderAppResource">
update tab_sys_order_app_resource
set enterprise_id = #{enterpriseId,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
where order_app_resource_id = #{orderAppResourceId,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment