Commit 73294561 by 徐高华

朋友圈

parent a3c9d779
......@@ -43,7 +43,24 @@
<select id="list" resultType="com.gic.haoban.manage.api.dto.moment.QwMomentPlanDataDTO"
parameterType="com.gic.haoban.manage.api.qdto.moment.PlanDataListQDTO">
select <include refid="Base_Column_List" /> from tab_haoban_qw_moment_plan_data a left join tab_haoban_staff b on a.staff_id = b.staff_id where a.plan_id=#{planId} and a.delete_flag = 0
select
b.staff_name staffName ,
a.data_id,
a.plan_id,
a.wx_enterprise_id,
a.enterprise_id,
a.staff_id,
a.clerk_id,
a.store_id,
a.member_id,
a.create_time,
a.update_time,
a.delete_flag,
a.comment_time,
a.like_time,
a.comment_flag,
a.like_flag
from tab_haoban_qw_moment_plan_data a left join tab_haoban_staff b on a.staff_id = b.staff_id where a.plan_id=#{planId} and a.delete_flag = 0
<if test="null != staffNameLike">
and b.staff_name like #{staffNameLike}
</if>
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO;
......@@ -20,10 +21,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.*;
@Service
public class MomentClerkExcelHandler extends DownloadHandlerAbstract<MomentClerkExcelVO> {
......@@ -36,12 +34,31 @@ public class MomentClerkExcelHandler extends DownloadHandlerAbstract<MomentClerk
BasePageInfo pageInfo = new BasePageInfo() ;
pageInfo.setPageSize(this.getPageSize());
pageInfo.setPageNum(currentPage);
ServiceResponse<QwMomentPlanDTO> detaiResp = this.qwMomentApiService.detail(qdto.getPlanId()) ;
boolean isEnd = detaiResp.getResult().getStatusFlag()==2 || detaiResp.getResult().getEndDate().getTime()<System.currentTimeMillis() ;
ServiceResponse<Page<QwMomentPlanAttendDTO>> pageResp = this.qwMomentApiService.attendList(qdto);
List<MomentClerkExcelVO> voList = new ArrayList<>();
if (null != pageResp && CollectionUtils.isNotEmpty(pageResp.getResult().getResult())) {
EnterpriseDTO en = this.enterpriseService.getEnterpriseById(qdto.getEnterpriseId()) ;
for(QwMomentPlanAttendDTO item : pageResp.getResult().getResult()) {
MomentClerkExcelVO vo = EntityUtil.changeEntityByJSON(MomentClerkExcelVO.class,item) ;
if(StringUtils.isNotBlank(storeId)) {
StoreDTO store = this.storeService.getStore(storeId);
vo.setStoreName(store.getStoreName());
vo.setStoreCode(store.getStoreCode());
}
Date sendTime = vo.getSendTime() ;
if(null != sendTime) {
vo.setSendTimeExcel(DateUtil.dateToStr(sendTime,"yyyy-MM-dd HH:mm:ss"));
}
int taskStatus = vo.getTaskStatus();
String taskStatusExcel = "未完成" ;
if(taskStatus==2) {
taskStatusExcel = "已完成" ;
}else {
if(isEnd) {
taskStatusExcel = "已失效" ;
}
}
voList.add(vo) ;
}
}
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO;
......@@ -41,6 +42,12 @@ public class MomentDataExcelHandler extends DownloadHandlerAbstract<MomentDataEx
EnterpriseDTO en = this.enterpriseService.getEnterpriseById(qdto.getEnterpriseId()) ;
for(QwMomentPlanDataDTO item : pageResp.getResult().getResult()) {
MomentDataExcelVO vo = EntityUtil.changeEntityByJSON(MomentDataExcelVO.class,item) ;
if(qdto.getType()==1 && null != vo.getLikeTime()) {
vo.setTimeExcel(DateUtil.dateToStr(vo.getLikeTime(),"yyyy-MM-dd HH:mm:ss"));
}
if(qdto.getType()==2 && null != vo.getCommentTime()) {
vo.setTimeExcel(DateUtil.dateToStr(vo.getCommentTime(),"yyyy-MM-dd HH:mm:ss"));
}
voList.add(vo) ;
}
}
......
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