Commit 1860b8d3 by 墨竹

fix:查询详情和列表返回修改

parent 91143804
package com.gic.haoban.manage.api.dto.hm;
import java.io.Serializable;
/**
* @author xuwenqian
* @date 2022/7/15 14:40
*/
public class HmClerkDTO implements Serializable {
private static final long serialVersionUID = -5700709557914308777L;
private String clerkName;
private String clerkId;
private String clerkCode;
public String getClerkName() {
return clerkName;
}
public void setClerkName(String clerkName) {
this.clerkName = clerkName;
}
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getClerkCode() {
return clerkCode;
}
public void setClerkCode(String clerkCode) {
this.clerkCode = clerkCode;
}
}
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.hm; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.hm;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 活码(TabHaobanHmQrcode)实体类 * 活码(TabHaobanHmQrcode)实体类
...@@ -93,6 +94,10 @@ public class HmQrcodeDTO implements Serializable { ...@@ -93,6 +94,10 @@ public class HmQrcodeDTO implements Serializable {
private String memberLabelName; private String memberLabelName;
private String hmGroupName; private String hmGroupName;
private List<HmClerkDTO> clerkList;
private List<HmStoreDTO> storeList;
public Long getHmId() { public Long getHmId() {
return hmId; return hmId;
} }
...@@ -340,5 +345,21 @@ public class HmQrcodeDTO implements Serializable { ...@@ -340,5 +345,21 @@ public class HmQrcodeDTO implements Serializable {
public void setHmGroupName(String hmGroupName) { public void setHmGroupName(String hmGroupName) {
this.hmGroupName = hmGroupName; this.hmGroupName = hmGroupName;
} }
public List<HmClerkDTO> getClerkList() {
return clerkList;
}
public void setClerkList(List<HmClerkDTO> clerkList) {
this.clerkList = clerkList;
}
public List<HmStoreDTO> getStoreList() {
return storeList;
}
public void setStoreList(List<HmStoreDTO> storeList) {
this.storeList = storeList;
}
} }
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.hm; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.dto.hm;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author mozhu * @author mozhu
...@@ -78,6 +79,14 @@ public class HmQrcodeListDTO implements Serializable { ...@@ -78,6 +79,14 @@ public class HmQrcodeListDTO implements Serializable {
* 活码分组 * 活码分组
*/ */
private Long hmGroupId; private Long hmGroupId;
/**
* 新增总人数
*/
private Integer addNumT;
private List<HmClerkDTO> clerkList;
private List<HmStoreDTO> storeList;
public Long getHmId() { public Long getHmId() {
return hmId; return hmId;
...@@ -286,4 +295,28 @@ public class HmQrcodeListDTO implements Serializable { ...@@ -286,4 +295,28 @@ public class HmQrcodeListDTO implements Serializable {
public void setHmGroupId(Long hmGroupId) { public void setHmGroupId(Long hmGroupId) {
this.hmGroupId = hmGroupId; this.hmGroupId = hmGroupId;
} }
public Integer getAddNumT() {
return addNumT;
}
public void setAddNumT(Integer addNumT) {
this.addNumT = addNumT;
}
public List<HmClerkDTO> getClerkList() {
return clerkList;
}
public void setClerkList(List<HmClerkDTO> clerkList) {
this.clerkList = clerkList;
}
public List<HmStoreDTO> getStoreList() {
return storeList;
}
public void setStoreList(List<HmStoreDTO> storeList) {
this.storeList = storeList;
}
} }
package com.gic.haoban.manage.api.dto.hm;
import java.io.Serializable;
/**
* @author xuwenqian
* @date 2022/7/15 14:40
*/
public class HmStoreDTO implements Serializable {
private static final long serialVersionUID = -5700709557914308777L;
private String storeId;
private String storeName;
private String storeCode;
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public String getStoreCode() {
return storeCode;
}
public void setStoreCode(String storeCode) {
this.storeCode = storeCode;
}
}
package com.gic.haoban.manage.api.service.hm; package com.gic.haoban.manage.api.service.hm;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO; import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO; import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
...@@ -124,12 +126,13 @@ public interface HmQrcodeApiService { ...@@ -124,12 +126,13 @@ public interface HmQrcodeApiService {
/** /**
* 根据导购信息获取hmid * 根据导购信息获取hmid
* *
* @param basePageInfo 基本信息页
* @param hmId hm id * @param hmId hm id
* @return {@link List }<{@link HmClerkRelationDTO }> * @return {@link List }<{@link HmClerkRelationDTO }>
* @author mozhu * @author mozhu
* @date 2022-07-13 17:09:56 * @date 2022-07-15 14:31:03
*/ */
List<HmClerkRelationDTO> getHmClerkByHmId(Long hmId); Page<HmClerkRelationDTO> getHmClerkByHmId(BasePageInfo basePageInfo, Long hmId);
/** /**
......
package com.gic.haoban.manage.service.pojo.bo.hm; package com.gic.haoban.manage.service.pojo.bo.hm;
import com.gic.haoban.manage.api.dto.hm.HmClerkDTO;
import com.gic.haoban.manage.api.dto.hm.HmStoreDTO;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 活码(TabHaobanHmQrcode)实体类 * 活码(TabHaobanHmQrcode)实体类
...@@ -94,6 +98,10 @@ public class HmQrcodeBO implements Serializable { ...@@ -94,6 +98,10 @@ public class HmQrcodeBO implements Serializable {
private String memberLabelName; private String memberLabelName;
private String hmGroupName; private String hmGroupName;
private List<HmClerkDTO> clerkList;
private List<HmStoreDTO> storeList;
public Long getHmId() { public Long getHmId() {
return hmId; return hmId;
} }
...@@ -357,5 +365,21 @@ public class HmQrcodeBO implements Serializable { ...@@ -357,5 +365,21 @@ public class HmQrcodeBO implements Serializable {
public void setHmGroupName(String hmGroupName) { public void setHmGroupName(String hmGroupName) {
this.hmGroupName = hmGroupName; this.hmGroupName = hmGroupName;
} }
public List<HmClerkDTO> getClerkList() {
return clerkList;
}
public void setClerkList(List<HmClerkDTO> clerkList) {
this.clerkList = clerkList;
}
public List<HmStoreDTO> getStoreList() {
return storeList;
}
public void setStoreList(List<HmStoreDTO> storeList) {
this.storeList = storeList;
}
} }
...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.service.out.impl.hm; ...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.service.out.impl.hm;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON; 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.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
...@@ -10,8 +12,10 @@ import com.gic.commons.util.UniqueIdUtils; ...@@ -10,8 +12,10 @@ import com.gic.commons.util.UniqueIdUtils;
import com.gic.enterprise.api.dto.StoreDTO; import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.StoreService; import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon; import com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.hm.HmClerkDTO;
import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO; import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO; import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO; import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO;
...@@ -49,6 +53,8 @@ import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO; ...@@ -49,6 +53,8 @@ import com.gic.wechat.api.dto.qywx.response.QywxResponseDTO;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO; import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO;
import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO; import com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -446,6 +452,27 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -446,6 +452,27 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
if (memberTagDTO != null) { if (memberTagDTO != null) {
hmQrcodeBO.setMemberLabelName(memberTagDTO.getTagName()); hmQrcodeBO.setMemberLabelName(memberTagDTO.getTagName());
} }
Integer hmType = hmQrcodeBO.getHmType();
List<HmClerkDTO> clerkDTOList = new ArrayList<>();
if (hmType == 1) {
HmClerkDTO clerkDTO = new HmClerkDTO();
clerkDTO.setClerkName(hmQrcodeBO.getClerkName());
clerkDTO.setClerkId(hmQrcodeBO.getClerkId());
clerkDTO.setClerkCode(hmQrcodeBO.getClerkCode());
clerkDTOList.add(clerkDTO);
} else if (hmType == 2) {
List<HmClerkRelationBO> hmClerkRelationBOS = hmClerkRelationService.getHmClerkByHmId(hmId);
if (CollectionUtils.isNotEmpty(hmClerkRelationBOS)) {
for (HmClerkRelationBO hmClerkRelationBO : hmClerkRelationBOS) {
HmClerkDTO clerkDTO = new HmClerkDTO();
clerkDTO.setClerkName(hmClerkRelationBO.getClerkName());
clerkDTO.setClerkId(hmClerkRelationBO.getClerkId());
clerkDTO.setClerkCode(hmClerkRelationBO.getClerkCode());
clerkDTOList.add(clerkDTO);
}
}
}
hmQrcodeBO.setClerkList(clerkDTOList);
} }
return EntityUtil.changeEntityNew(HmQrcodeDTO.class, hmQrcodeBO); return EntityUtil.changeEntityNew(HmQrcodeDTO.class, hmQrcodeBO);
} }
...@@ -610,8 +637,10 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService { ...@@ -610,8 +637,10 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
} }
@Override @Override
public List<HmClerkRelationDTO> getHmClerkByHmId(Long hmId) { public Page<HmClerkRelationDTO> getHmClerkByHmId(BasePageInfo basePageInfo, Long hmId) {
return EntityUtil.changeEntityListNew(HmClerkRelationDTO.class,hmClerkRelationService.getHmClerkByHmId(hmId)); PageHelper.startPage(basePageInfo);
List<HmClerkRelationBO> hmClerkByHmId = hmClerkRelationService.getHmClerkByHmId(hmId);
return PageUtil.changePageHelperToCurrentPage(new PageInfo<>(hmClerkByHmId),HmClerkRelationDTO.class);
} }
/** /**
......
...@@ -10,9 +10,7 @@ import com.gic.commons.webapi.reponse.RestResponse; ...@@ -10,9 +10,7 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO; import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil; import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant; import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant;
import com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO; import com.gic.haoban.manage.api.dto.hm.*;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.WxUserAddLogDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO;
import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO; import com.gic.haoban.manage.api.dto.statistics.StatisticsDTO;
...@@ -22,6 +20,7 @@ import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService; ...@@ -22,6 +20,7 @@ import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService;
import com.gic.haoban.manage.api.util.DataHttpUtil; import com.gic.haoban.manage.api.util.DataHttpUtil;
import com.gic.haoban.manage.web.dto.HmOverviewDTO; import com.gic.haoban.manage.web.dto.HmOverviewDTO;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.hm.HmQrcodeDetailQO;
import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO; import com.gic.haoban.manage.web.qo.hm.HmQrcodeUpdateQO;
import com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO; import com.gic.haoban.manage.web.qo.hm.data.HmDetailClerkListQO;
import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO; import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO;
...@@ -127,7 +126,51 @@ public class HmQrcodeController { ...@@ -127,7 +126,51 @@ public class HmQrcodeController {
if (!storeList.contains("-1")) { if (!storeList.contains("-1")) {
hmQrcodeListQO.getInFields().setStoreId(storeList); hmQrcodeListQO.getInFields().setStoreId(storeList);
} }
StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_list, hmQrcodeListQO); StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_list, hmQrcodeListQO);
List<HmQrcodeListDTO> data = statisticsDTO.getData();
List<HmStoreDTO> storeDTOList = new ArrayList<>();
List<HmClerkDTO> clerkDTOList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(data)) {
for (HmQrcodeListDTO hmQrcodeListDTO : data) {
Long hmId = hmQrcodeListDTO.getHmId();
Integer hmType = hmQrcodeListDTO.getHmType();
if (hmType == 1) {
HmClerkDTO clerkDTO = new HmClerkDTO();
clerkDTO.setClerkName(hmQrcodeListDTO.getClerkName());
clerkDTO.setClerkId(hmQrcodeListDTO.getClerkId());
clerkDTO.setClerkCode(hmQrcodeListDTO.getClerkCode());
clerkDTOList.add(clerkDTO);
HmStoreDTO storeDTO = new HmStoreDTO();
storeDTO.setStoreId(hmQrcodeListDTO.getStoreId());
storeDTO.setStoreName(hmQrcodeListDTO.getStoreName());
storeDTO.setStoreCode(hmQrcodeListDTO.getStoreCode());
storeDTOList.add(storeDTO);
} else if (hmType == 2) {
BasePageInfo basePageInfo = new BasePageInfo();
basePageInfo.setPageNum(1);
basePageInfo.setPageNum(1000);
Page<HmClerkRelationDTO> hmClerkByHmId = hmQrcodeApiService.getHmClerkByHmId(basePageInfo, hmId);
List<HmClerkRelationDTO> hmClerkRelationDTOList = hmClerkByHmId.getResult();
if (CollectionUtils.isNotEmpty(hmClerkRelationDTOList)) {
for (HmClerkRelationDTO hmClerkRelationDTO : hmClerkRelationDTOList) {
HmClerkDTO clerkDTO = new HmClerkDTO();
clerkDTO.setClerkName(hmClerkRelationDTO.getClerkName());
clerkDTO.setClerkId(hmClerkRelationDTO.getClerkId());
clerkDTO.setClerkCode(hmClerkRelationDTO.getClerkCode());
clerkDTOList.add(clerkDTO);
HmStoreDTO storeDTO = new HmStoreDTO();
storeDTO.setStoreId(hmClerkRelationDTO.getStoreId());
storeDTO.setStoreName(hmClerkRelationDTO.getStoreName());
storeDTO.setStoreCode(hmClerkRelationDTO.getStoreCode());
storeDTOList.add(storeDTO);
}
}
}
hmQrcodeListDTO.setClerkList(clerkDTOList);
hmQrcodeListDTO.setStoreList(storeDTOList);
}
}
return RestResponse.successResult(statisticsDTO); return RestResponse.successResult(statisticsDTO);
} }
...@@ -190,7 +233,8 @@ public class HmQrcodeController { ...@@ -190,7 +233,8 @@ public class HmQrcodeController {
* @return * @return
*/ */
@RequestMapping(value = "detail-clerk-list", method = RequestMethod.GET) @RequestMapping(value = "detail-clerk-list", method = RequestMethod.GET)
public RestResponse detailClerkList(Long hmId) { public RestResponse detailClerkList(@RequestBody HmQrcodeDetailQO hmQrcodeDetailQO) {
Long hmId = hmQrcodeDetailQO.getHmId();
HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.queryById(hmId); HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.queryById(hmId);
if (hmQrcodeDTO == null) { if (hmQrcodeDTO == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_8.getCode()),HaoBanErrCode.ERR_8.getMsg()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_8.getCode()),HaoBanErrCode.ERR_8.getMsg());
...@@ -201,8 +245,11 @@ public class HmQrcodeController { ...@@ -201,8 +245,11 @@ public class HmQrcodeController {
HmDetailClerkListVO hmDetailClerkListVO = EntityUtil.changeEntityNew(HmDetailClerkListVO.class,hmQrcodeDTO); HmDetailClerkListVO hmDetailClerkListVO = EntityUtil.changeEntityNew(HmDetailClerkListVO.class,hmQrcodeDTO);
list.add(hmDetailClerkListVO); list.add(hmDetailClerkListVO);
} else if (hmType == 2) { } else if (hmType == 2) {
List<HmClerkRelationDTO> hmClerkByHmId = hmQrcodeApiService.getHmClerkByHmId(hmId); BasePageInfo basePageInfo = new BasePageInfo();
list = EntityUtil.changeEntityListNew(HmDetailClerkListVO.class, hmClerkByHmId); basePageInfo.setPageNum(hmQrcodeDetailQO.getPageNum());
basePageInfo.setPageSize(hmQrcodeDetailQO.getPageSize());
Page<HmClerkRelationDTO> hmClerkRelationDTOPage = hmQrcodeApiService.getHmClerkByHmId(basePageInfo, hmId);
list = EntityUtil.changeEntityListNew(HmDetailClerkListVO.class, hmClerkRelationDTOPage.getResult());
} }
return RestResponse.successResult(list); return RestResponse.successResult(list);
} }
......
package com.gic.haoban.manage.web.qo.hm;
import com.gic.api.base.commons.BasePageInfo;
import java.io.Serializable;
/**
* @author xuwenqian
* @date 2022/7/15 14:27
*/
public class HmQrcodeDetailQO extends BasePageInfo implements Serializable {
private static final long serialVersionUID = 6305747368824904637L;
private Long hmId;
public Long getHmId() {
return hmId;
}
public void setHmId(Long hmId) {
this.hmId = hmId;
}
}
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