Browse Source

党建声音-政府端-下线文章接口首次提交

master
sunyuchao 5 years ago
parent
commit
0cfb04b5dc
  1. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java
  2. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java
  3. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  4. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  5. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  6. 35
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OffLineArticleFormDTO.java
  7. 25
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java
  8. 20
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  9. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java
  10. 9
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java
  11. 119
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  12. 11
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml
  13. 14
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java
  14. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java
  15. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  16. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  17. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  18. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  19. 10
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

10
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/GovOrgSelfFeignClient.java

@ -2,6 +2,7 @@ package com.epmet.dto.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.feign.fallback.GovOrgSelfFeignClientFallBack;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
@ -34,4 +35,13 @@ public interface GovOrgSelfFeignClient {
**/
@PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<PublishAgencyListResultDTO> getPublishAgencyList(@PathVariable("staffId") String staffId);
/**
* @param staffId
* @return
* @Author sun
* @Description 根据工作人员Id查询对应的组织信息
**/
@PostMapping(value = "gov/org/customeragency/getagencybystaffId/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<CustomerAgencyDTO> getAgencyByStaffId(@PathVariable("staffId") String staffId);
}

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/feign/fallback/GovOrgSelfFeignClientFallBack.java

@ -3,6 +3,7 @@ package com.epmet.dto.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.feign.GovOrgSelfFeignClient;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
@ -24,4 +25,9 @@ public class GovOrgSelfFeignClientFallBack implements GovOrgSelfFeignClient {
public Result<PublishAgencyListResultDTO> getPublishAgencyList(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId);
}
@Override
public Result<CustomerAgencyDTO> getAgencyByStaffId(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyByStaffId", staffId);
}
}

11
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -185,4 +185,15 @@ public class CustomerAgencyController {
return new Result<PublishAgencyListResultDTO>().ok(customerAgencyService.getPublishAgencyList(staffId));
}
/**
* @param staffId
* @return
* @Author sun
* @Description 根据工作人员Id查询对应的组织信息
**/
@PostMapping("getagencybystaffId/{staffId}")
public Result<CustomerAgencyDTO> getAgencyByStaffId(@PathVariable("staffId") String staffId) {
return new Result<CustomerAgencyDTO>().ok(customerAgencyService.getAgencyByStaffId(staffId));
}
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -172,4 +172,12 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位
**/
PublishAgencyListResultDTO getPublishAgencyList(String staffId);
/**
* @param staffId
* @return
* @Author sun
* @Description 根据工作人员Id查询对应的组织信息
**/
CustomerAgencyDTO getAgencyByStaffId(String staffId);
}

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -806,4 +806,21 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return returnDTO;
}
/**
* @param staffId
* @return
* @Author sun
* @Description 根据工作人员Id查询对应的组织信息
**/
@Override
public CustomerAgencyDTO getAgencyByStaffId(String staffId) {
//调用现有方法查询工作人员对应组织信息
CustomerStaffAgencyDTO staffAgencyDTO = new CustomerStaffAgencyDTO();
staffAgencyDTO.setUserId(staffId);
staffAgencyDTO = customerStaffAgencyDao.selectByStaffId(staffAgencyDTO);
CustomerAgencyEntity entity = baseDao.selectById(staffAgencyDTO.getAgencyId());
CustomerAgencyDTO dto = ConvertUtils.sourceToTarget(entity, CustomerAgencyDTO.class);
return dto;
}
}

35
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/OffLineArticleFormDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
/**
* @Description 党建声音-政府端-下线文章-接口入参
* @Author sun
*/
@Data
public class OffLineArticleFormDTO implements Serializable {
private static final long serialVersionUID = 4859779755214502427L;
/**
* 添加用户操作的内部异常分组
* 出现错误会提示给前端7000错误码返回信息为服务器开小差...
*/
public interface AddUserInternalGroup {}
@NotBlank(message = "文章Id不能为空", groups = { AddUserInternalGroup.class })
private String articleId;
@Size(min = 1, message = "项目人员关联Id不能为空", groups = {AddUserInternalGroup.class})
private List<String> gridIdList;
private String customerId;
private String staffId;
}

25
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java

@ -14,4 +14,29 @@ package com.epmet.constant;
* @since 1.0.0
*/
public interface ArticleConstant {
/**
* 发布状态-已发布
*/
String PUBLISHED = "published";
/**
* 发布状态-已下线
*/
String OFFLINE = "offline";
/**
* 文章发布范围内已全部下线不能再调用此接口
*/
String RANGE_DATA_EXCEPTION = "发布范围内无可下线文章";
/**
* 调用epmet-user服务查询工作人员基本信息失败
*/
String SELECT_STAFF_EXCEPTION = "获取用户基本信息失败";
/**
* 调用gov-org服务查询工作人员组织信息失败
*/
String SELECT_AGRNCY_EXCEPTION = "获取用户组织信息失败";
/**
* 下线文章(用于拼接操作表字段值)
*/
String OFF_LINE_ARTICLE = "下线文章";
}

20
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -30,10 +30,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.ArticleDTO;
import com.epmet.dto.form.ArticleOperationFormDTO;
import com.epmet.dto.form.DraftContentFromDTO;
import com.epmet.dto.form.DraftDetailFormDTO;
import com.epmet.dto.form.GovArticleDetailFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.ArticleOperationResultDTO;
@ -204,4 +201,19 @@ public class ArticleController {
return new Result<PublishAgencyListResultDTO>().ok(articleService.publishAgencyList(tokenDTO));
}
/**
* @param tokenDTO formDTO
* @return
* @Author sun
* @Description 党建声音-政府端-下线文章
**/
@PostMapping("offlinearticle")
public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class);
articleService.offLineArticle(formDTO);
return new Result();
}
}

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticlePublishRangeDao.java

@ -18,9 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ArticlePublishRangeDTO;
import com.epmet.entity.ArticlePublishRangeEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 文章发布范围表
*
@ -30,4 +33,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ArticlePublishRangeDao extends BaseDao<ArticlePublishRangeEntity> {
/**
* @param rangeEntity
* @return
* @Author sun
* @Description 根据文章Id查询发布范围数据
**/
List<ArticlePublishRangeEntity> selectByArticleId(ArticlePublishRangeEntity rangeEntity);
}

9
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.ArticleDTO;
import com.epmet.dto.form.DraftContentFromDTO;
import com.epmet.dto.form.OffLineArticleFormDTO;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.GovArticleDetailResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
@ -132,4 +133,12 @@ public interface ArticleService extends BaseService<ArticleEntity> {
* @Description 党建声音-政府端-可选发布单位
**/
PublishAgencyListResultDTO publishAgencyList(TokenDto tokenDTO);
/**
* @param formDTO
* @return
* @Author sun
* @Description 党建声音-政府端-下线文章
**/
void offLineArticle(OffLineArticleFormDTO formDTO);
}

119
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -31,20 +31,26 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.constant.ArticleConstant;
import com.epmet.dao.ArticleDao;
import com.epmet.dao.ArticlePublishRangeDao;
import com.epmet.dao.DraftContentDao;
import com.epmet.dao.DraftDao;
import com.epmet.dto.ArticleDTO;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.feign.GovOrgSelfFeignClient;
import com.epmet.dto.form.DraftContentFromDTO;
import com.epmet.dto.form.OffLineArticleFormDTO;
import com.epmet.dto.result.ArticleGridResultDTO;
import com.epmet.dto.result.GovArticleContentDTO;
import com.epmet.dto.result.GovArticleDetailResultDTO;
import com.epmet.dto.result.PublishAgencyListResultDTO;
import com.epmet.entity.ArticleEntity;
import com.epmet.entity.DraftContentEntity;
import com.epmet.entity.DraftEntity;
import com.epmet.entity.*;
import com.epmet.feign.EpmetUserSelfFeignClient;
import com.epmet.redis.ArticleRedis;
import com.epmet.service.ArticleOperateRecordService;
import com.epmet.service.ArticlePublishRangeService;
import com.epmet.service.ArticleService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
@ -55,6 +61,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* 文章表
@ -73,6 +80,14 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
private DraftDao draftDao;
@Autowired
private DraftContentDao draftContentDao;
@Autowired
private ArticlePublishRangeService articlePublishRangeService;
@Autowired
private ArticlePublishRangeDao articlePublishRangeDao;
@Autowired
private EpmetUserSelfFeignClient epmetUserSelfFeignClient;
@Autowired
private ArticleOperateRecordService articleOperateRecordService;
@Override
public PageData<ArticleDTO> page(Map<String, Object> params) {
@ -137,17 +152,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
Result<ArticleGridResultDTO> result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId());
return result.getData();
}
/**
* @param tokenDTO
* @return
* @Author sun
* @Description 党建声音-政府端-可选发布范围
**/
@Override
public ArticleGridResultDTO agencyGridList(TokenDto tokenDTO) {
Result<ArticleGridResultDTO> result = govOrgSelfFeignClient.getAgencyGridList(tokenDTO.getUserId());
return result.getData();
}
/**
* @param tokenDTO
@ -254,4 +258,91 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
return newContentList;
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 党建声音-政府端-下线文章
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void offLineArticle(OffLineArticleFormDTO formDTO) {
//1:根据文章Id查询全部(已发布、已下线)发布范围数据
ArticlePublishRangeEntity rangeEntity = new ArticlePublishRangeEntity();
rangeEntity.setArticleId(formDTO.getArticleId());
List<ArticlePublishRangeEntity> rangeEntityList = articlePublishRangeDao.selectByArticleId(rangeEntity);
if (null == rangeEntityList || rangeEntityList.size() < NumConstant.ONE) {
throw new RenException(ArticleConstant.RANGE_DATA_EXCEPTION);
}
//2:批量更新发布范围数据,将前台勾选的文章网格列表数据置为下线状态
Date date = new Date();
//还未下线的发布范围列表
List<ArticlePublishRangeEntity> publishedList = new ArrayList<>();
//将要下线的发布范围列表
List<ArticlePublishRangeEntity> offLineList = new ArrayList<>();
rangeEntityList.forEach(entity -> {
if (entity.getPublishStatus().equals(ArticleConstant.PUBLISHED)) {
//是否下线(true:是)
AtomicBoolean isOffLine = new AtomicBoolean(false);
formDTO.getGridIdList().forEach(gridId -> {
if (entity.getGridId().equals(gridId)) {
isOffLine.set(true);
entity.setOffLineTime(date);
entity.setPublishStatus(ArticleConstant.OFFLINE);
offLineList.add(entity);
}
});
if (!isOffLine.get()) {
publishedList.add(entity);
}
}
});
//2.1:批量更新发布范围表数据
articlePublishRangeService.updateBatchById(offLineList);
//3:根据是否全部下线更新文章主表数据
ArticleEntity entity = new ArticleEntity();
entity.setId(formDTO.getArticleId());
StringBuffer publishRangeDesc = new StringBuffer();
if (null == publishedList || publishedList.size() < NumConstant.ONE) {
entity.setStatusFlag(ArticleConstant.OFFLINE);
entity.setOffLineTime(date);
rangeEntityList.forEach(range -> {
publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : "");
publishRangeDesc.append(range.getAgencyGridName());
});
} else {
publishedList.forEach(pub -> {
publishRangeDesc.append(publishRangeDesc.length() > NumConstant.ZERO ? "、" : "");
publishRangeDesc.append(pub.getAgencyGridName());
});
}
entity.setPublishRangeDesc(publishRangeDesc.toString());
baseDao.updateById(entity);
//4:文章操作记录表新增数据
//4.1:调用epmet-user服务,查询工作人员信息
Result<CustomerStaffDTO> resultStaff = epmetUserSelfFeignClient.getCustomerStaff(formDTO.getStaffId());
if (null == resultStaff.getData()) {
throw new RenException(ArticleConstant.SELECT_STAFF_EXCEPTION);
}
CustomerStaffDTO staffDTO = resultStaff.getData();
//4.2:调用gov-org服务,查询当前人员所属组织机构信息
Result<CustomerAgencyDTO> resultAgency = govOrgSelfFeignClient.getAgencyByStaffId(formDTO.getStaffId());
if (null == resultAgency.getData()) {
throw new RenException(ArticleConstant.SELECT_AGRNCY_EXCEPTION);
}
CustomerAgencyDTO agencyDTO = resultAgency.getData();
//4.3:新增操作表数据
ArticleOperateRecordEntity recordEntity = new ArticleOperateRecordEntity();
recordEntity.setCustomerId(formDTO.getCustomerId());
recordEntity.setArticleId(formDTO.getArticleId());
recordEntity.setOpUser(agencyDTO.getOrganizationName() + "-" + staffDTO.getRealName());
recordEntity.setContent(recordEntity.getOpUser() + ArticleConstant.OFF_LINE_ARTICLE);
recordEntity.setOpType(ArticleConstant.OFFLINE);
recordEntity.setOpTime(date);
articleOperateRecordService.insert(recordEntity);
}
}

11
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticlePublishRangeDao.xml

@ -3,5 +3,14 @@
<mapper namespace="com.epmet.dao.ArticlePublishRangeDao">
<select id="selectByArticleId" resultType="com.epmet.entity.ArticlePublishRangeEntity">
SELECT
*
FROM
article_publish_range
WHERE
del_flag = '0'
AND article_id = #{articleId}
ORDER BY created_time ASC
</select>
</mapper>

14
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserSelfFeignClient.java

@ -2,11 +2,14 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.feign.fallback.EpmetUserSelfFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@ -24,6 +27,15 @@ public interface EpmetUserSelfFeignClient {
* @Description 根据客户Id和staffId查询一个员工在指定客户下的角色列表
**/
@PostMapping("/epmetuser/staffrole/getcustomerstaffrolelist")
Result<List<CustomerStaffRoleListResultDTO>> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO);
Result<List<CustomerStaffRoleListResultDTO>> getCustomerStaffRoleList(@RequestBody CustomerStaffRoleListFormDTO formDTO);
/**
* @param staffId
* @return
* @Author sun
* @Description 根据staffId查询工作人员基本信息
**/
@PostMapping("/epmetuser/customerstaff/getcustomerstaff/{staffId}")
Result<CustomerStaffDTO> getCustomerStaff(@PathVariable("staffId") String staffId);
}

6
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserSelfFeignClientFallBack.java

@ -3,6 +3,7 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.feign.EpmetUserSelfFeignClient;
@ -21,4 +22,9 @@ public class EpmetUserSelfFeignClientFallBack implements EpmetUserSelfFeignClien
public Result<List<CustomerStaffRoleListResultDTO>> getCustomerStaffRoleList(CustomerStaffRoleListFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffRoleList", formDTO);
}
@Override
public Result<CustomerStaffDTO> getCustomerStaff(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaff", staffId);
}
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -273,4 +273,15 @@ public class CustomerStaffController {
return new Result<CustomerStaffListResultDTO>().ok(customerStaffService.getCustomerStaffList(staffIdList));
}
/**
* @param staffId
* @return
* @Author sun
* @Description 根据staffId查询工作人员基本信息
**/
@PostMapping(value = "getcustomerstaff/{staffId}")
public Result<CustomerStaffDTO> getCustomerStaff(@PathVariable("staffId") String staffId){
return new Result<CustomerStaffDTO>().ok(customerStaffService.getCustomerStaff(staffId));
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -132,4 +132,12 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @Description 根据staffId集合查询工作人员基础信息
**/
List<StaffListResultDTO> selectStaffByIds(@Param("staffIdList") List<String> staffIdList);
/**
* @param staffId
* @return
* @Author sun
* @Description 根据staffId查询工作人员基本信息
**/
CustomerStaffDTO selectByStaffId(@Param("staffId") String staffId);
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -225,4 +225,11 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
**/
CustomerStaffListResultDTO getCustomerStaffList(List<String> staffIdList);
/**
* @param staffId
* @return
* @Author sun
* @Description 根据staffId查询工作人员基本信息
**/
CustomerStaffDTO getCustomerStaff(String staffId);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -424,4 +424,15 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
return list;
}
/**
* @param staffId
* @return
* @Author sun
* @Description 根据staffId查询工作人员基本信息
**/
@Override
public CustomerStaffDTO getCustomerStaff(String staffId) {
return baseDao.selectByStaffId(staffId);
}
}

10
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -193,4 +193,14 @@
user_id = #{userId}
</foreach>
</select>
<select id="selectByStaffId" resultType="com.epmet.dto.CustomerStaffDTO">
SELECT
*
FROM
customer_staff
WHERE
del_flag = '0'
AND user_id = #{staffId}
</select>
</mapper>
Loading…
Cancel
Save