Commit ad9ff1cf by 徐高华

Merge branch 'feature/xgh/202507迭代' into 'developer'

朋友圈门店分组

See merge request !3078
parents a39f01aa 54e4c30a
......@@ -38,6 +38,25 @@ public class GroupChatPlanLogDTO implements Serializable {
private java.util.Date createTime;
private java.util.Date updateTime;
private String wxChatId ;
private String storeGroupName ;
private String storeGroupId ;
public String getStoreGroupName() {
return storeGroupName;
}
public void setStoreGroupName(String storeGroupName) {
this.storeGroupName = storeGroupName;
}
public String getStoreGroupId() {
return storeGroupId;
}
public void setStoreGroupId(String storeGroupId) {
this.storeGroupId = storeGroupId;
}
public String getWxChatId() {
return wxChatId;
......
......@@ -42,6 +42,26 @@ public class GroupChatPlanOwnerLogDTO implements Serializable{
private int execType ;
private Date dataGetTime ;
private String storeGroupName ;
private String storeGroupId ;
public String getStoreGroupName() {
return storeGroupName;
}
public void setStoreGroupName(String storeGroupName) {
this.storeGroupName = storeGroupName;
}
public String getStoreGroupId() {
return storeGroupId;
}
public void setStoreGroupId(String storeGroupId) {
this.storeGroupId = storeGroupId;
}
public Date getDataGetTime() {
return dataGetTime;
}
......
......@@ -32,6 +32,29 @@ public class GroupChatPlanSearchQDTO implements Serializable {
// clerkTaskStatus 1待处理 2已处理/已失效
private int clerkTaskStatus ;
/**
* 门店分组
*/
private String storeGroupIds ;
private List<String> storeIdList ;
public String getStoreGroupIds() {
return storeGroupIds;
}
public void setStoreGroupIds(String storeGroupIds) {
this.storeGroupIds = storeGroupIds;
}
public List<String> getStoreIdList() {
return storeIdList;
}
public void setStoreIdList(List<String> storeIdList) {
this.storeIdList = storeIdList;
}
public String getSearchParamsLike() {
return searchParamsLike;
}
......
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.api.qdto.moment;
import com.gic.api.base.commons.BasePageInfo;
import java.util.Date;
import java.util.List;
public class PlanClerkListQDTO extends BasePageInfo {
......@@ -45,6 +46,16 @@ public class PlanClerkListQDTO extends BasePageInfo {
private Integer statusFlag ;
List<String> storeIdList ;
public List<String> getStoreIdList() {
return storeIdList;
}
public void setStoreIdList(List<String> storeIdList) {
this.storeIdList = storeIdList;
}
public Integer getStatusFlag() {
return statusFlag;
}
......
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.api.qdto.moment;
import com.gic.api.base.commons.BasePageInfo;
import java.util.Date;
import java.util.List;
public class PlanDataListQDTO extends BasePageInfo {
......@@ -44,6 +45,16 @@ public class PlanDataListQDTO extends BasePageInfo {
*/
private String sortType ;
List<String> storeIdList ;
public List<String> getStoreIdList() {
return storeIdList;
}
public void setStoreIdList(List<String> storeIdList) {
this.storeIdList = storeIdList;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
......
......@@ -100,6 +100,8 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
if (StringUtils.isNotBlank(storeId) && null != map.get(storeId)) {
dto.setStoreCode(map.get(storeId).getStoreCode());
dto.setStoreName(map.get(storeId).getStoreName());
dto.setStoreGroupId(map.get(storeId).getStoreGroupId());
dto.setStoreGroupName(map.get(storeId).getStoreGroupName());
}
});
}
......
......@@ -755,6 +755,8 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
if (StringUtils.isNotBlank(storeId) && null != map.get(storeId)) {
dto.setStoreCode(map.get(storeId).getStoreCode());
dto.setStoreName(map.get(storeId).getStoreName());
dto.setStoreGroupId(map.get(storeId).getStoreGroupId());
dto.setStoreGroupName(map.get(storeId).getStoreGroupName());
}
});
}
......
......@@ -103,9 +103,15 @@
and a.send_status = #{sendStatus}
</if>
</if>
<if test="null != startDate">
and a.create_time <![CDATA[>=]]> #{startDate} and a.create_time <![CDATA[<=]]> #{endDate}
</if>
<if test="null != storeIdList">
and b.store_id in (
<foreach collection="storeIdList" item="item" separator="," open="(" close=")" index="index">
#{item}
</foreach>
)
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -157,6 +157,13 @@
<if test="null != startDate">
and a.create_time <![CDATA[>=]]> #{startDate} and a.create_time <![CDATA[<=]]> #{endDate}
</if>
<if test="null != storeIdList">
and a.store_id in
<foreach collection="storeIdList" item="item" separator="," close=")" open="(">
#{item}
</foreach>
/>
</if>
order by a.create_time , a.owner_log_id
</select>
......
......@@ -82,6 +82,13 @@
<if test="sendStatus==2">
and a.task_status = 2
</if>
<if test="null != storeIdList">
and a.store_id in (
<foreach collection="storeIdList" separator="," item="item">
#{item}
</foreach>
)
</if>
and a.status_flag = #{statusFlag}
order by a.${sortColumn} ${sortType}
</select>
......
......@@ -81,6 +81,13 @@
order by a.comment_time desc
</if>
<if test="storeIdList !=null">
and a.store_id in
<foreach collection="storeIdList" item="item" separator="," index="index">
#{item}
</foreach>
</if>
</select>
<update id="batchInsert">
......
......@@ -4,6 +4,7 @@ import java.util.*;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.dto.chat.ChatContentDTO;
import com.gic.haoban.manage.web.controller.moment.QwMomentController;
import com.gic.haoban.manage.web.qo.ExcelSheet;
import com.gic.haoban.manage.web.utils.ExportSheetUtil;
import com.gic.haoban.manage.web.vo.ClerkVo;
......@@ -66,6 +67,8 @@ public class GroupChatPlanController {
private MaterialApiService materialApiService;
@Autowired
private StaffApiService staffApiService;
@Autowired
private QwMomentController qwMomentController;
@RequestMapping("add")
@GicLogRecord(value = "${#logValue}", category = GicLogRecordCategoryEnum.HB_QQF, optType = GicLogRecordOptTypeEnum.HB_1000_01, userFunc = LogRecordUserServiceImpl.class, optPage = "客户群群发")
......@@ -358,7 +361,12 @@ public class GroupChatPlanController {
return RestResponse.failure("9999", "活动ID空");
}
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
List<String> storeIdList = this.qwMomentController.getGicStoreId(qdto.getStoreGroupIds(), loginUser.getEnterpriseId()) ;
if(CollectionUtils.isNotEmpty(storeIdList) && storeIdList.size() ==1 && storeIdList.contains("-1")) {
return RestResponse.successResult(new Page<>());
}
qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
qdto.setStoreIdList(storeIdList);
ServiceResponse<Page<GroupChatPlanOwnerLogDTO>> resp = this.groupChatPlanApiService.listOwnerLogPage(planId,
qdto, basePageInfo);
if (!resp.isSuccess()) {
......@@ -373,7 +381,12 @@ public class GroupChatPlanController {
return RestResponse.failure("9999", "活动ID空");
}
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
List<String> storeIdList = this.qwMomentController.getGicStoreId(qdto.getStoreGroupIds(), loginUser.getEnterpriseId()) ;
if(CollectionUtils.isNotEmpty(storeIdList) && storeIdList.size() ==1 && storeIdList.contains("-1")) {
return RestResponse.successResult(new Page<>());
}
qdto.setWxEnterpriseId(loginUser.getWxEnterpriseId());
qdto.setStoreIdList(storeIdList);
ServiceResponse<Page<GroupChatPlanLogDTO>> resp = this.groupChatPlanApiService.listLogPage(planId, qdto,
basePageInfo);
if (!resp.isSuccess()) {
......
......@@ -13,6 +13,8 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.dto.StoreSearchDTO;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
......@@ -83,6 +85,8 @@ public class QwMomentController {
private StoreService storeService ;
@Autowired
private ESDataDynamicOperationApiService esDataDynamicOperationApiService ;
@Autowired
private StoreGroupService storeGroupService;
/**
* 新建任务
......@@ -368,7 +372,12 @@ public class QwMomentController {
*/
@RequestMapping("clerk-list")
public RestResponse<Page<QwMomentPlanAttendVO>> clerkList(@RequestBody PlanClerkListQO qo) {
List<String> storeIdList = this.getGicStoreId(qo.getStoreGroupIds(), AuthWebRequestUtil.getLoginUser().getEnterpriseId()) ;
if(CollectionUtils.isNotEmpty(storeIdList) && storeIdList.size() ==1 && storeIdList.contains("-1")) {
return RestResponse.successResult(new Page<>());
}
PlanClerkListQDTO qdto = EntityUtil.changeEntityByJSON(PlanClerkListQDTO.class,qo) ;
qdto.setStoreIdList(storeIdList);
ServiceResponse<Page<QwMomentPlanAttendDTO>> resp = this.qwMomentApiService.attendList(qdto) ;
Page<QwMomentPlanAttendVO> retPage = PageHelperUtils.changePageToCurrentPage(resp.getResult(), QwMomentPlanAttendVO.class);
List<QwMomentPlanAttendVO> list = retPage.getResult() ;
......@@ -394,7 +403,12 @@ public class QwMomentController {
@RequestMapping("data-list")
public RestResponse<Page<QwMomentPlanDataVO>> dataList(@RequestBody PlanDataListQO qo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
List<String> storeIdList = this.getGicStoreId(qo.getStoreGroupIds(), loginUser.getEnterpriseId()) ;
if(CollectionUtils.isNotEmpty(storeIdList) && storeIdList.size() ==1 && storeIdList.contains("-1")) {
return RestResponse.successResult(new Page<>());
}
PlanDataListQDTO qdto = EntityUtil.changeEntityByJSON(PlanDataListQDTO.class,qo) ;
qdto.setStoreIdList(storeIdList);
ServiceResponse<Page<QwMomentPlanDataDTO>> resp = this.qwMomentApiService.dataList(qdto) ;
Page<QwMomentPlanDataVO> retPage = PageHelperUtils.changePageToCurrentPage(resp.getResult(), QwMomentPlanDataVO.class);
List<QwMomentPlanDataVO> list = retPage.getResult() ;
......@@ -626,4 +640,29 @@ public class QwMomentController {
null);
return response.getRes();
}
public List<String> getGicStoreId(String groupIds , String enterpriseId) {
if(StringUtils.isBlank(groupIds)) {
return null;
}
List<String> groupIdList = Arrays.asList(groupIds.split(",")).stream().filter(StringUtils::isNotBlank).collect(Collectors.toList()) ;
if(CollectionUtils.isEmpty(groupIdList)) {
return null;
}
List<String> allGroupIds = storeGroupService.getStoreGroupIdsByParentGroupId(enterpriseId, groupIdList);
Page pageSearch = new Page<>();
pageSearch.setCurrentPage(-1);
StoreSearchDTO storeSearch = new StoreSearchDTO();
storeSearch.setStoreGroupIdList(allGroupIds);
storeSearch.setEnterpriseId(enterpriseId);
storeSearch.setStatus("2");
Page<com.gic.enterprise.api.dto.StoreDTO> resultPage = this.storeService.storeListPage(pageSearch, storeSearch);
List<com.gic.enterprise.api.dto.StoreDTO> storeList = resultPage.getResult();
List<String> storeIdList = storeList.stream().map(StoreDTO::getStoreId).distinct().collect(Collectors.toList());
if(CollectionUtils.isEmpty(storeIdList)) {
storeIdList = new ArrayList<>();
storeIdList.add("-1") ;
}
return storeIdList;
}
}
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