Commit 08951b0f by 徐高华

活码查询

parent e6f99e63
package com.gic.haoban.manage.api.service.hm;
import java.util.List;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
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.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import java.util.List;
/**
* @author mozhu
* @date 2022/7/5 09:33
......@@ -207,5 +208,16 @@ public interface HmQrcodeApiService {
* @date 2022-07-15 17:24:01
*/
HmClerkRelationDTO getOneHmClerkByHmIdAndStaffId(Long hmId,String staffId);
/**
*
* @Title: listHmIdForIndex
* @Description: 返回活码id列表,用于首页列表查询
* @author xugh
* @param qdto
* @return
* @throws
*/
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ;
}
......@@ -204,5 +204,7 @@ public interface TabHaobanHmQrcodeMapper {
List<HmQrcodeClerkBO> listCanAddClerk(@Param("wxEnterpriseId")String wxEnterpriseId , @Param("enterpriseId")String enterpriseId , @Param("storeIdList")List<String> storeIdList);
List<String> getHmStoreForWxa(@Param("enterpriseId") String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
}
package com.gic.haoban.manage.service.service.hm;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
......@@ -182,4 +183,6 @@ public interface HmQrcodeService {
List<HmQrcodeClerkBO> listCanAddClerk(String wxEnterpriseId , String enterpriseId , String clerkId) ;
List<String> getHmStoreForWxa(String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
}
......@@ -174,5 +174,10 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
public List<String> getHmStoreForWxa(String enterpriseId) {
return tabHaobanHmQrcodeMapper.getHmStoreForWxa(enterpriseId) ;
}
@Override
public List<String> listHmIdForIndex(HmQrcodeListQDTO qdto) {
return tabHaobanHmQrcodeMapper.listHmIdForIndex(qdto) ;
}
}
......@@ -20,6 +20,7 @@ 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.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.hm.HmQrcodeApiService;
......@@ -746,4 +747,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
public HmClerkRelationDTO getOneHmClerkByHmIdAndStaffId(Long hmId, String staffId) {
return EntityUtil.changeEntityNew(HmClerkRelationDTO.class, hmClerkRelationService.getHmClerkByHmIdAndStaffId(hmId, staffId));
}
@Override
public ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) {
return ServiceResponse.success(hmQrcodeService.listHmIdForIndex(qdto));
}
}
......@@ -326,7 +326,52 @@
where enterprise_id = #{enterpriseId} and status_flag = 1 and over_flag = 0 and store_id is not null
</select>
<select id="listHmIdForIndex" resultType="String" parameterType="com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO">
select distinct(a.hm_id)
from tab_haoban_hm_qrcode a left join tab_haoban_hm_clerk_relation b on a.hm_id = b.hm_id and b.status = 1
<if test="null != clerkSelect and '' != clerkSelect">
and b.clerk_id = #{clerkSelect}
</if>
<if test="null != storeSelect and '' != storeSelect">
and b.store_id = #{storeSelect}
</if>
<if test="storeId != null and storeId.size > 0">
and b.store_id IN
<foreach collection="storeId" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
where a.enterprise_id = #{enterpriseId} and a.status_flag != 0
<if test="null != hmSelect and '' != hmSelect ">
and (a.hm_code=#{hmSelect} or a.name like '%${hmSelect}%' or a.creator_name like '%${hmSelect}%' )
</if>
<if test="null != clerkSelect and '' != clerkSelect">
and a.clerk_id = #{clerkSelect}
</if>
<if test="null != storeSelect and '' != storeSelect">
and a.store_id = #{storeSelect}
</if>
<if test="storeId != null and storeId.size > 0">
and a.store_id IN
<foreach collection="storeId" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</if>
<if test="null != statusFlagInt">
and a.status_flag = #{statusFlagInt}
</if>
<if test="null != hmTypeInt">
and a.hm_type=#{hmTypeInt}
</if>
<if test="null != hmGroupId">
and a.hm_group_id=#{hmGroupId}
</if>
<if test="null != startTime">
and a.create_time >=#{startTime} and a.create_Time <![CDATA[<=]]> #{endTime}
</if>
</select>
<select id="getGroupIdNumByEnterpriseId" resultType="com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO">
select hm_group_id as hmGroupId,
COUNT(hm_id) as num
......
......@@ -9,11 +9,9 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON;
import com.gic.haoban.manage.web.qo.hm.data.HmLinkChartQO;
import com.gic.haoban.manage.web.qo.hm.data.HmLinkClerkListQO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -47,12 +45,13 @@ import com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService;
import com.gic.haoban.manage.api.service.out.WelcomeApiService;
import com.gic.haoban.manage.api.util.DataHttpUtil;
import com.gic.haoban.manage.web.log.LogRecordUserServiceImpl;
import com.gic.haoban.manage.web.qo.hm.data.HmLinkChartQO;
import com.gic.haoban.manage.web.qo.hm.data.HmLinkClerkListQO;
import com.gic.haoban.manage.web.utils.statistics.DataStatisticsParamUtils;
import com.gic.haoban.manage.web.vo.hm.HmLinkListVO;
import com.gic.haoban.manage.web.vo.hm.HmLinkVO;
import com.gic.haoban.manage.web.vo.hm.WxUserAddLogVO;
import com.gic.log.record.anno.GicLogRecord;
import com.gic.log.record.service.LogRecordUserService;
import com.gic.log.record.util.GicLogRecordCategoryEnum;
import com.gic.log.record.util.GicLogRecordEvaluationContext;
import com.gic.log.record.util.GicLogRecordOptTypeEnum;
......@@ -72,8 +71,7 @@ import com.gic.member.tag.api.service.MemberTagApiService;
@RequestMapping("/hm/link")
public class HmLinkController {
private static final Logger logger = LoggerFactory.getLogger(HmLinkController.class);
private static org.apache.logging.log4j.Logger logger = LogManager.getLogger(HmLinkController.class);
@Autowired
private HmLinkApiService hmLinkApiService;
@Autowired
......
package com.gic.haoban.manage.web.controller.hm;
import cn.hutool.core.convert.Convert;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
......@@ -10,7 +21,13 @@ import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant;
import com.gic.haoban.manage.api.dto.hm.*;
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.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.hm.HmStoreDTO;
import com.gic.haoban.manage.api.dto.hm.WxUserAddLogDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
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.statistics.StatisticsDTO;
......@@ -28,16 +45,8 @@ import com.gic.haoban.manage.web.qo.hm.data.HmQrcodeListQO;
import com.gic.haoban.manage.web.qo.hm.data.HmTrendQO;
import com.gic.haoban.manage.web.vo.hm.HmDetailClerkListVO;
import com.gic.haoban.manage.web.vo.hm.HmTrendVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import cn.hutool.core.convert.Convert;
/**
* 活码(TabHaobanHmQrcode)表控制层
......@@ -48,6 +57,9 @@ import java.util.Map;
@RestController
@RequestMapping("/hm/qrcode")
public class HmQrcodeController {
private static org.apache.logging.log4j.Logger logger = LogManager.getLogger(HmQrcodeController.class);
@Autowired
private HmQrcodeApiService hmQrcodeApiService;
@Autowired
......@@ -132,7 +144,10 @@ public class HmQrcodeController {
storeList.forEach(c-> stringBuffer.append(c).append(","));
hmQrcodeListQO.getInFields().setStoreId(stringBuffer.toString());
}
HmQrcodeListQDTO qdto = EntityUtil.changeEntityByJSON(HmQrcodeListQDTO.class, hmQrcodeListQO.getInFields()) ;
qdto.setStoreId(storeList);
ServiceResponse<List<String>> listResp = this.hmQrcodeApiService.listHmIdForIndex(qdto) ;
logger.info("HMid列表={}",JSON.toJSONString(listResp));
StatisticsDTO statisticsDTO = DataHttpUtil.post(StatisticsApolloKeyConstant.data_haoban_hm_list, hmQrcodeListQO);
List<HmQrcodeListDTO> data = JSON.parseArray(JSON.toJSONString(statisticsDTO.getData()), HmQrcodeListDTO.class);
List<HmStoreDTO> storeDTOList = new ArrayList<>();
......
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