Browse Source

heart-work:主办方列表、进行中活动列表api

dev_shibei_match
yinzuomei 5 years ago
parent
commit
e8f05c0bb6
  1. 23
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java
  2. 44
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java
  3. 71
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java
  4. 29
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java
  5. 37
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  6. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
  7. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  8. 125
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  9. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  10. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  11. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java
  12. 28
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java
  13. 10
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  14. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  15. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  16. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
  17. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  18. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  19. 24
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

23
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.form.work;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 21:21
*/
@Data
public class ActListCommonFormDTO implements Serializable {
private static final long serialVersionUID = -8014343076037268806L;
public interface AddUserInternalGroup {}
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class })
private String customerId;
}

44
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java

@ -0,0 +1,44 @@
/**
* 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.epmet.dto.result.work;
import lombok.Data;
import java.io.Serializable;
/**
* 添加组织-接口返参
*
* @author sun
*/
@Data
public class Grid implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 网格Id
*/
private String gridId = "";
/**
* 机关-网格名称
*/
private String agencyGridName = "";
}

71
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java

@ -0,0 +1,71 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 21:23
*/
@Data
public class InProgressActResultDTO implements Serializable {
private static final long serialVersionUID = -2631607663760353230L;
/**
*活动id
*/
private String actId;
/**
*活动标题
*/
private String title;
/**
* 活动封面
*/
private String coverPic;
/**
* 活动状态报名中signing_up截止报名: end_sign_up; 已开始 in_progress; 已报满 enough
*/
private String status="";
/**
* 活动预计开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actStartTime;
/**
* 活动预计结束时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actEndTime;
/**
* true:固定名额 false 不限制名额
*/
private Boolean actQuotaCategory;
/**
* 活动名额人数
*/
private Integer actQuota;
/**
* 已报名人数
*/
private Integer signedUp;
@JsonIgnore
private Date signUpEndTime;
@JsonIgnore
private Date signUpStartTime;
}

29
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.result.work;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 20:23
*/
@Data
public class SponsorResultDTO implements Serializable {
private static final long serialVersionUID = 2781093523201803701L;
/**
* 机关组织Id
*/
private String agencyId = "";
/**
* 机关组织名称
*/
private String agencyName = "";
/**
* 机关下网格列表信息
*/
private List<Grid> agencyGridList;
}

37
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java

@ -1,8 +1,18 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO;
import com.epmet.service.WorkActService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 工作端-发布活动相关api
*
@ -12,4 +22,31 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/work/act")
public class WorkActController {
@Autowired
private WorkActService workActService;
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.SponsorResultDTO>
* @param
* @author yinzuomei
* @description 活动主办方
* @Date 2020/7/23 20:37
**/
@PostMapping("sponsorlist")
public Result<SponsorResultDTO> querySponsorList(){
return new Result<SponsorResultDTO>().ok(workActService.querySponsorList());
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.InProgressActResultDTO>
* @param formDTO
* @author yinzuomei
* @description 进行中活动列表
* @Date 2020/7/23 21:24
**/
@PostMapping("inprogresslist")
public Result<List<InProgressActResultDTO>> queryInProgressList(ActListCommonFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class);
return new Result<List<InProgressActResultDTO>>().ok(workActService.queryInProgressList(formDTO));
}
}

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java

@ -25,6 +25,7 @@ import com.epmet.dto.form.resi.ResiLatestActFormDTO;
import com.epmet.dto.form.resi.ResiMyActFormDTO;
import com.epmet.dto.result.resi.*;
import com.epmet.dto.result.work.ActSignUpStatResultDTO;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.entity.ActInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -225,4 +226,13 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
* @Date 17:17 2020-07-23
**/
Integer checkActTime(ActInfoDTO actInfoDTO);
/**
* @return java.util.List<com.epmet.dto.result.work.InProgressActResultDTO>
* @param customerId
* @author yinzuomei
* @description 查询正在进行中的活动列表
* @Date 2020/7/23 21:58
**/
List<InProgressActResultDTO> selectInprogress(String customerId);
}

33
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java

@ -0,0 +1,33 @@
package com.epmet.service;
import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 20:36
*/
public interface WorkActService {
/**
* @return com.epmet.dto.result.work.SponsorResultDTO
* @param
* @author yinzuomei
* @description 活动主办方
* @Date 2020/7/23 20:37
**/
SponsorResultDTO querySponsorList();
/**
* @return com.epmet.dto.result.work.InProgressActResultDTO
* @param formDTO
* @author yinzuomei
* @description 进行中活动列表
* @Date 2020/7/23 21:24
**/
List<InProgressActResultDTO> queryInProgressList(ActListCommonFormDTO formDTO);
}

125
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -0,0 +1,125 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.ActInfoDao;
import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.work.Grid;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.WorkActService;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 20:37
*/
@Service
public class WorkActServiceImpl implements WorkActService {
private Logger logger = LogManager.getLogger(WorkActServiceImpl.class);
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private LoginUserUtil loginUserUtil;
@Autowired
private ActInfoDao actInfoDao;
/**
* @return com.epmet.dto.result.work.SponsorResultDTO
* @author yinzuomei
* @description 活动主办方
* @Date 2020/7/23 20:37
**/
@Override
public SponsorResultDTO querySponsorList() {
String staffId=loginUserUtil.getLoginUserId();
if(StringUtils.isNotBlank(staffId)){
Result<ActSponsorResultDTO> result=govOrgOpenFeignClient.querySponsorList(staffId);
if(result.success()&&null!=result.getData()){
SponsorResultDTO sponsorResultDTO=new SponsorResultDTO();
sponsorResultDTO.setAgencyId(result.getData().getAgencyId());
sponsorResultDTO.setAgencyName(result.getData().getAgencyName());
sponsorResultDTO.setAgencyGridList(ConvertUtils.sourceToTarget(result.getData().getAgencyGridList(), Grid.class));
return sponsorResultDTO;
}
}
logger.error("当前用户id获取为空");
return null;
}
/**
* @param formDTO
* @return com.epmet.dto.result.work.InProgressActResultDTO
* @author yinzuomei
* @description 进行中活动列表
* @Date 2020/7/23 21:24
**/
@Override
public List<InProgressActResultDTO> queryInProgressList(ActListCommonFormDTO formDTO) {
List<InProgressActResultDTO> list = actInfoDao.selectInprogress(formDTO.getCustomerId());
Date nowDate = new Date();
for (InProgressActResultDTO inProgressActResultDTO : list) {
// 活动状态:报名中:signing_up;截止报名: end_sign_up; 已开始: in_progress; 已报满: enough
if (nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == -1
|| nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == 0) {
//截止报名时间之前(包含报名时间截止时间点)
if (!inProgressActResultDTO.getActQuotaCategory()) {
//如果是不限制名额,则显示报名中
inProgressActResultDTO.setStatus("signing_up");
continue;
} else {
//固定名额,且已报名人数<活动需要人数显示报名中
if (inProgressActResultDTO.getActQuota() > inProgressActResultDTO.getSignedUp()) {
inProgressActResultDTO.setStatus("signing_up");
continue;
} else if (inProgressActResultDTO.getActQuota().equals(inProgressActResultDTO.getSignedUp())) {
inProgressActResultDTO.setStatus("enough");
continue;
}
}
} else if (nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == 1
|| nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == -1) {
//活动报名截止-活动预计开始之间显示截止报名
inProgressActResultDTO.setStatus("end_sign_up");
continue;
} else if (nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == 1
|| nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == 0) {
//活动预计开始时间点之后,包含活动预计开始时间点,显示 已开始
inProgressActResultDTO.setStatus("in_progress");
continue;
}
}
return list;
}
public static void main(String[] args) {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date date1=format.parse("2020-07-23 13:00:00");
Date yesterDate=format.parse("2020-07-22 13:00:00");
Date date2=format.parse("2020-07-23 13:00:00");
Date tommorrow=format.parse("2020-07-24 13:00:00");
System.out.println(new Date().compareTo(yesterDate));
System.out.println(date1.compareTo(tommorrow));
System.out.println(date1.compareTo(date2));
} catch (ParseException e) {
e.printStackTrace();
}
}
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java

@ -365,6 +365,10 @@ public class WorkActUserServiceImpl implements WorkActUserService {
return ;
}
ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId());
if(null==actInfo){
logger.error("查询活动为空actId="+actUserRelationEntity.getActId());
return;
}
if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}
@ -403,6 +407,10 @@ public class WorkActUserServiceImpl implements WorkActUserService {
return ;
}
ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId());
if(null==actInfo){
logger.error("查询活动为空actId="+actUserRelationEntity.getActId());
return;
}
if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}

31
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -457,4 +457,35 @@
AND ((#{actStartTime} BETWEEN ACT_START_TIME AND ACT_END_TIME OR #{actEndTime} BETWEEN ACT_START_TIME AND ACT_END_TIME)
or (ACT_START_TIME BETWEEN #{actStartTime} AND #{actEndTime} OR ACT_END_TIME BETWEEN #{actStartTime} AND #{actEndTime}));
</select>
<!-- 查询正在进行中的活动列表 -->
<select id="selectInprogress" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.InProgressActResultDTO">
SELECT
ai.id AS actId,
ai.TITLE AS title,
ai.COVER_PIC AS coverPic,
ai.ACT_QUOTA AS actQuota,
ai.ACT_QUOTA_CATEGORY AS actQuotaCategory,
ai.ACT_START_TIME AS actStartTime,
ai.ACT_END_TIME AS actEndTime,
(
SELECT
count( aur.id )
FROM
act_user_relation aur
WHERE
aur.ACT_ID = ai.ID
AND aur.DEL_FLAG = '0'
AND ( aur.`STATUS` = 'auditing' OR aur.`STATUS` = 'passed' )
) AS signedUp,
ai.SIGN_UP_END_TIME as signUpEndTime,
ai.SIGN_UP_START_TIME as signUpStartTime
FROM
act_info ai
WHERE
ai.DEL_FLAG = '0'
AND ai.ACT_STATUS = 'published'
and ai.CUSTOMER_ID=#{customerId}
order by ai.CREATED_TIME desc
</select>
</mapper>

25
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java

@ -0,0 +1,25 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 20:58
*/
@Data
public class ActSponsorGridInfo implements Serializable {
private static final long serialVersionUID = -2797565581047800011L;
/**
* 网格Id
*/
private String gridId = "";
/**
* 机关-网格名称
*/
private String agencyGridName = "";
}

28
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 20:46
*/
@Data
public class ActSponsorResultDTO implements Serializable {
/**
* 机关组织Id
*/
private String agencyId = "";
/**
* 机关组织名称
*/
private String agencyName = "";
/**
* 机关下网格列表信息
*/
private List<ActSponsorGridInfo> agencyGridList;
}

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

@ -156,4 +156,14 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/grid/gridsbystaffid/{staffId}")
Result<List<GridByStaffResultDTO>> listGridsbystaffid(@PathVariable("staffId") String staffId);
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ActSponsorResultDTO>
* @param staffId
* @author yinzuomei
* @description 发布活动-主办方列表
* @Date 2020/7/23 20:47
**/
@PostMapping("/gov/org/customeragency/querysponsorlist/{staffId}")
Result<ActSponsorResultDTO> querySponsorList(@PathVariable("staffId") String staffId);
}

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -90,4 +90,16 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result<List<GridByStaffResultDTO>> listGridsbystaffid(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "listGridsbystaffid", staffId);
}
/**
* @param staffId
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ActSponsorResultDTO>
* @author yinzuomei
* @description 发布活动-主办方列表
* @Date 2020/7/23 20:47
**/
@Override
public Result<ActSponsorResultDTO> querySponsorList(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "querySponsorList", staffId);
}
}

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

@ -181,4 +181,16 @@ public class CustomerAgencyController {
public Result<PublishAgencyListResultDTO> getPublishAgencyList(@PathVariable("staffId") String staffId) {
return new Result<PublishAgencyListResultDTO>().ok(customerAgencyService.getPublishAgencyList(staffId));
}
/**
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.ActSponsorResultDTO>
* @param staffId
* @author yinzuomei
* @description 发布活动-主办方列表
* @Date 2020/7/23 20:50
**/
@PostMapping("querysponsorlist/{staffId}")
Result<ActSponsorResultDTO> querySponsorList(@PathVariable("staffId") String staffId){
return new Result<ActSponsorResultDTO>().ok(customerAgencyService.querySponsorList(staffId));
}
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java

@ -18,7 +18,9 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerStaffAgencyDTO;
import com.epmet.dto.result.ActSponsorGridInfo;
import com.epmet.dto.result.StaffListResultDTO;
import com.epmet.entity.CustomerStaffAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
@ -80,4 +82,22 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @Description 根据staffId查询数据
**/
CustomerStaffAgencyDTO selectByStaffId(CustomerStaffAgencyDTO dto);
/**
* @return com.epmet.dto.result.ActSponsorResultDTO
* @param staffId
* @author yinzuomei
* @description 根据staffId查询我所在的网格信息
* @Date 2020/7/23 21:04
**/
List<ActSponsorGridInfo> selectActSponsorGrid(String staffId);
/**
* @return com.epmet.dto.CustomerAgencyDTO
* @param staffId
* @author yinzuomei
* @description 根据staffId查询我所属的组织信息
* @Date 2020/7/23 21:10
**/
CustomerAgencyDTO selectMyAgency(String staffId);
}

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

@ -169,4 +169,13 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位
**/
PublishAgencyListResultDTO getPublishAgencyList(String staffId);
/**
* @return com.epmet.dto.result.ActSponsorResultDTO
* @param staffId
* @author yinzuomei
* @description 发布活动-主办方列表
* @Date 2020/7/23 20:50
**/
ActSponsorResultDTO querySponsorList(String staffId);
}

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

@ -810,5 +810,25 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return returnDTO;
}
/**
* @param staffId
* @return com.epmet.dto.result.ActSponsorResultDTO
* @author yinzuomei
* @description 发布活动-主办方列表
* @Date 2020/7/23 20:50
**/
@Override
public ActSponsorResultDTO querySponsorList(String staffId) {
ActSponsorResultDTO resultDTO=new ActSponsorResultDTO();
CustomerAgencyDTO customerAgency=customerStaffAgencyDao.selectMyAgency(staffId);
if(null!=customerAgency){
resultDTO.setAgencyId(customerAgency.getId());
resultDTO.setAgencyName(customerAgency.getOrganizationName());
}
List<ActSponsorGridInfo> list=customerStaffAgencyDao.selectActSponsorGrid(staffId);
resultDTO.setAgencyGridList(list);
return resultDTO;
}
}

24
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -117,4 +117,28 @@
</if>
</select>
<!-- 根据staffId查询我所在的网格信息 -->
<select id="selectActSponsorGrid" resultType="com.epmet.dto.result.ActSponsorGridInfo" parameterType="java.lang.String">
SELECT
csg.GRID_ID,
CONCAT( ca.ORGANIZATION_NAME, '-', cg.GRID_NAME ) AS agencyGridName,
FROM
customer_staff_grid csg
LEFT JOIN customer_grid cg ON ( csg.GRID_ID = cg.ID AND cg.DEL_FLAG = '0' )
LEFT JOIN customer_agency ca ON ( cg.PID = ca.ID AND ca.DEL_FLAG = '0' )
WHERE
csg.DEL_FLAG = '0'
AND csg.USER_ID =#{staffId}
</select>
<!-- 根据staffId,查询我所属的组织信息 -->
<select id="selectMyAgency" resultType="com.epmet.dto.CustomerAgencyDTO" parameterType="java.lang.String">
SELECT
ca.*
FROM
customer_staff_agency csa
LEFT JOIN customer_agency ca ON ( csa.AGENCY_ID = ca.id AND ca.DEL_FLAG = '0' )
WHERE
csa.DEL_FLAG = '0'
AND csa.USER_ID = #{staffId}
</select>
</mapper>
Loading…
Cancel
Save