Browse Source

heart-work:已结束、已取消活动列表api

master
yinzuomei 5 years ago
parent
commit
ddbff44121
  1. 55
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java
  2. 56
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java
  3. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  4. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
  5. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  6. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  7. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

55
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java

@ -0,0 +1,55 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 23:09
*/
@Data
public class CanceledActResultDTO implements Serializable {
private static final long serialVersionUID = 7026227776577088524L;
/**
*活动id
*/
private String actId;
/**
*活动标题
*/
private String title;
/**
* 活动封面
*/
private String coverPic;
/**
* 活动预计开始时间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;
/**
* 取消活动的时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date cancelTime;
/**
* 活动取消的原因
*/
private String cancelReason;
}

56
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java

@ -0,0 +1,56 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 23:19
*/
@Data
public class FinishedActResultDTO implements Serializable {
private static final long serialVersionUID = -8967999331248723146L;
/**
*活动id
*/
private String actId;
/**
*活动标题
*/
private String title;
/**
* 活动封面
*/
private String coverPic;
/**
* 活动预计开始时间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;
/**
* 活动实际开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actualStartTime;
/**
* 活动实际结束时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actualEndTime;
}

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

@ -3,11 +3,14 @@ package com.epmet.controller;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.work.ActListCommonFormDTO; import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.work.CanceledActResultDTO;
import com.epmet.dto.result.work.FinishedActResultDTO;
import com.epmet.dto.result.work.InProgressActResultDTO; import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO; import com.epmet.dto.result.work.SponsorResultDTO;
import com.epmet.service.WorkActService; import com.epmet.service.WorkActService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -45,8 +48,34 @@ public class WorkActController {
* @Date 2020/7/23 21:24 * @Date 2020/7/23 21:24
**/ **/
@PostMapping("inprogresslist") @PostMapping("inprogresslist")
public Result<List<InProgressActResultDTO>> queryInProgressList(ActListCommonFormDTO formDTO){ public Result<List<InProgressActResultDTO>> queryInProgressList(@RequestBody ActListCommonFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class);
return new Result<List<InProgressActResultDTO>>().ok(workActService.queryInProgressList(formDTO)); return new Result<List<InProgressActResultDTO>>().ok(workActService.queryInProgressList(formDTO));
} }
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.work.CanceledActResultDTO>>
* @param formDTO
* @author yinzuomei
* @description 已取消-活动列表
* @Date 2020/7/23 23:11
**/
@PostMapping("canceledlist")
public Result<List<CanceledActResultDTO>> queryCanceledlist(@RequestBody ActListCommonFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class);
return new Result<List<CanceledActResultDTO>>().ok(workActService.queryCanceledList(formDTO));
}
/**
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.work.FinishedActResultDTO>>
* @param formDTO
* @author yinzuomei
* @description 已结束-活动列表
* @Date 2020/7/23 23:21
**/
@PostMapping("finishedlist")
public Result<List<FinishedActResultDTO>> queryFinishedList(@RequestBody ActListCommonFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class);
return new Result<List<FinishedActResultDTO>>().ok(workActService.queryFinishedList(formDTO));
}
} }

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

@ -25,6 +25,8 @@ import com.epmet.dto.form.resi.ResiLatestActFormDTO;
import com.epmet.dto.form.resi.ResiMyActFormDTO; import com.epmet.dto.form.resi.ResiMyActFormDTO;
import com.epmet.dto.result.resi.*; import com.epmet.dto.result.resi.*;
import com.epmet.dto.result.work.ActSignUpStatResultDTO; import com.epmet.dto.result.work.ActSignUpStatResultDTO;
import com.epmet.dto.result.work.CanceledActResultDTO;
import com.epmet.dto.result.work.FinishedActResultDTO;
import com.epmet.dto.result.work.InProgressActResultDTO; import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActInfoEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -235,4 +237,22 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
* @Date 2020/7/23 21:58 * @Date 2020/7/23 21:58
**/ **/
List<InProgressActResultDTO> selectInprogress(String customerId); List<InProgressActResultDTO> selectInprogress(String customerId);
/**
* @return java.util.List<com.epmet.dto.result.work.CanceledActResultDTO>
* @param customerId
* @author yinzuomei
* @description 已取消-活动列表
* @Date 2020/7/23 23:13
**/
List<CanceledActResultDTO> selectCanceledList(String customerId);
/**
* @return java.util.List<com.epmet.dto.result.work.FinishedActResultDTO>
* @param customerId
* @author yinzuomei
* @description 已结束-活动列表
* @Date 2020/7/23 23:21
**/
List<FinishedActResultDTO> selectFinishedList(String customerId);
} }

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

@ -1,6 +1,8 @@
package com.epmet.service; package com.epmet.service;
import com.epmet.dto.form.work.ActListCommonFormDTO; import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.work.CanceledActResultDTO;
import com.epmet.dto.result.work.FinishedActResultDTO;
import com.epmet.dto.result.work.InProgressActResultDTO; import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO; import com.epmet.dto.result.work.SponsorResultDTO;
@ -30,4 +32,22 @@ public interface WorkActService {
* @Date 2020/7/23 21:24 * @Date 2020/7/23 21:24
**/ **/
List<InProgressActResultDTO> queryInProgressList(ActListCommonFormDTO formDTO); List<InProgressActResultDTO> queryInProgressList(ActListCommonFormDTO formDTO);
/**
* @return java.util.List<com.epmet.dto.result.work.CanceledActResultDTO>
* @param formDTO
* @author yinzuomei
* @description 已取消-活动列表
* @Date 2020/7/23 23:11
**/
List<CanceledActResultDTO> queryCanceledList(ActListCommonFormDTO formDTO);
/**
* @return java.util.List<com.epmet.dto.result.work.FinishedActResultDTO>
* @param formDTO
* @author yinzuomei
* @description 已结束-活动列表
* @Date 2020/7/23 23:21
**/
List<FinishedActResultDTO> queryFinishedList(ActListCommonFormDTO formDTO);
} }

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

@ -6,9 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActInfoDao;
import com.epmet.dto.form.work.ActListCommonFormDTO; import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.result.ActSponsorResultDTO; import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.work.Grid; import com.epmet.dto.result.work.*;
import com.epmet.dto.result.work.InProgressActResultDTO;
import com.epmet.dto.result.work.SponsorResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.WorkActService; import com.epmet.service.WorkActService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -106,6 +104,30 @@ public class WorkActServiceImpl implements WorkActService {
return list; return list;
} }
/**
* @param formDTO
* @return java.util.List<com.epmet.dto.result.work.CanceledActResultDTO>
* @author yinzuomei
* @description 已取消-活动列表
* @Date 2020/7/23 23:11
**/
@Override
public List<CanceledActResultDTO> queryCanceledList(ActListCommonFormDTO formDTO) {
return actInfoDao.selectCanceledList(formDTO.getCustomerId());
}
/**
* @param formDTO
* @return java.util.List<com.epmet.dto.result.work.FinishedActResultDTO>
* @author yinzuomei
* @description 已结束-活动列表
* @Date 2020/7/23 23:21
**/
@Override
public List<FinishedActResultDTO> queryFinishedList(ActListCommonFormDTO formDTO) {
return actInfoDao.selectFinishedList(formDTO.getCustomerId());
}
public static void main(String[] args) { public static void main(String[] args) {
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

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

@ -488,4 +488,44 @@
and ai.CUSTOMER_ID=#{customerId} and ai.CUSTOMER_ID=#{customerId}
order by ai.CREATED_TIME desc order by ai.CREATED_TIME desc
</select> </select>
<!-- 已取消-活动列表 -->
<select id="selectCanceledList" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.CanceledActResultDTO">
SELECT
ai.id AS actId,
ai.TITLE AS title,
ai.COVER_PIC AS coverPic,
ai.ACT_START_TIME AS actStartTime,
ai.ACT_END_TIME AS actEndTime,
ai.CANCEL_TIME AS cancelTime,
ai.CANCEL_REASON AS cancelReason
FROM
act_info ai
WHERE
ai.DEL_FLAG = '0'
AND ai.ACT_STATUS = 'canceled'
AND ai.CUSTOMER_ID = #{customerId}
ORDER BY
ai.CANCEL_TIME DESC
</select>
<!-- 已结束-活动列表 -->
<select id="selectFinishedList" parameterType="java.lang.String" resultType="com.epmet.dto.result.work.FinishedActResultDTO">
SELECT
ai.id AS actId,
ai.TITLE AS title,
ai.COVER_PIC AS coverPic,
ai.ACT_START_TIME AS actStartTime,
ai.ACT_END_TIME AS actEndTime,
ai.ACTUAL_START_TIME as actualStartTime,
ai.ACTUAL_END_TIME as actualEndTime
FROM
act_info ai
WHERE
ai.DEL_FLAG = '0'
AND ai.ACT_STATUS = 'finished'
AND ai.CUSTOMER_ID = #{customerId}
ORDER BY
ai.ACTUAL_END_TIME DESC
</select>
</mapper> </mapper>

Loading…
Cancel
Save