Commit 9d346334 by guojx

Merge remote-tracking branch 'origin/developer' into developer

parents ad65461b f21b6fe9
...@@ -150,7 +150,7 @@ public class StaffClerkRelationDTO implements Serializable { ...@@ -150,7 +150,7 @@ public class StaffClerkRelationDTO implements Serializable {
public Integer getOpenConcatFlag() { public Integer getOpenConcatFlag() {
if(null == openConcatFlag) { if(null == openConcatFlag) {
return 0 ; return 1 ;
} }
return openConcatFlag; return openConcatFlag;
} }
......
...@@ -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.List; import java.util.List;
import java.util.Map;
/** /**
* *
...@@ -17,6 +18,7 @@ public class HmLinkWxaDTO implements Serializable { ...@@ -17,6 +18,7 @@ public class HmLinkWxaDTO implements Serializable {
private static final long serialVersionUID = 6473795387449522116L; private static final long serialVersionUID = 6473795387449522116L;
private Long pageId ; private Long pageId ;
private Long hmId ;
private HmPageDTO page; private HmPageDTO page;
// 二维码 // 二维码
private String hmQrcode; private String hmQrcode;
...@@ -29,8 +31,16 @@ public class HmLinkWxaDTO implements Serializable { ...@@ -29,8 +31,16 @@ public class HmLinkWxaDTO implements Serializable {
// 推荐的门店列表 // 推荐的门店列表
private List<HmLinkStoreDTO> storeList; private List<HmLinkStoreDTO> storeList;
// 说明 // 说明
private String sm ; private Map<String,String> remarkMap ;
public Long getHmId() {
return hmId;
}
public void setHmId(Long hmId) {
this.hmId = hmId;
}
public HmPageDTO getPage() { public HmPageDTO getPage() {
return page; return page;
} }
...@@ -46,13 +56,14 @@ public class HmLinkWxaDTO implements Serializable { ...@@ -46,13 +56,14 @@ public class HmLinkWxaDTO implements Serializable {
public void setPageId(Long pageId) { public void setPageId(Long pageId) {
this.pageId = pageId; this.pageId = pageId;
} }
public String getSm() { public Map<String, String> getRemarkMap() {
return sm; return remarkMap;
} }
public void setSm(String sm) { public void setRemarkMap(Map<String, String> remarkMap) {
this.sm = sm; this.remarkMap = remarkMap;
} }
public String getHmQrcode() { public String getHmQrcode() {
......
package com.gic.haoban.manage.api.service.hm; 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.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
...@@ -11,6 +9,8 @@ import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO; ...@@ -11,6 +9,8 @@ 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.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import java.util.List;
/** /**
* @author mozhu * @author mozhu
* @date 2022/7/5 09:33 * @date 2022/7/5 09:33
...@@ -88,7 +88,7 @@ public interface HmQrcodeApiService { ...@@ -88,7 +88,7 @@ public interface HmQrcodeApiService {
* @author mozhu * @author mozhu
* @date 2022-07-06 15:39:01 * @date 2022-07-06 15:39:01
*/ */
ServiceResponse delByClerkId(String clerkId,String enterpriseId); ServiceResponse delByClerkId(String clerkId,String enterpriseId,String wxEnterpriseId);
/** /**
...@@ -219,5 +219,7 @@ public interface HmQrcodeApiService { ...@@ -219,5 +219,7 @@ public interface HmQrcodeApiService {
* @throws * @throws
*/ */
ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ; ServiceResponse<List<String>> listHmIdForIndex(HmQrcodeListQDTO qdto) ;
ServiceResponse<List<String>> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
} }
...@@ -129,5 +129,16 @@ public interface TabHaobanHmClerkRelationMapper { ...@@ -129,5 +129,16 @@ public interface TabHaobanHmClerkRelationMapper {
* @return * @return
*/ */
TabHaobanHmClerkRelation getHmClerkByHmIdAndStaffId(@Param("hmId") Long hmId, @Param("staffId") String staffId); TabHaobanHmClerkRelation getHmClerkByHmIdAndStaffId(@Param("hmId") Long hmId, @Param("staffId") String staffId);
/**
* 更新状态通过id
*
* @param status
* @param relationId
* @return int
* @author mozhu
* @date 2022-07-21 16:32:43
*/
int updateStatusById(@Param("status") Integer status, @Param("relationId") Long relationId);
} }
...@@ -168,7 +168,7 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -168,7 +168,7 @@ public interface TabHaobanHmQrcodeMapper {
* @author mozhu * @author mozhu
* @date 2022-07-12 17:39:12 * @date 2022-07-12 17:39:12
*/ */
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(@Param("enterpriseId") String enterpriseId,@Param("groupIds") List<Long> groupIds, @Param("hmIds") List<String> hmIds); List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("enterpriseId") String enterpriseId,@Param("groupIds") List<Long> groupIds, @Param("hmIds") List<String> hmIds);
/** /**
* 获取总数 * 获取总数
...@@ -178,7 +178,7 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -178,7 +178,7 @@ public interface TabHaobanHmQrcodeMapper {
* @author mozhu * @author mozhu
* @date 2022-07-12 15:10:09 * @date 2022-07-12 15:10:09
*/ */
int getTotalByEnterpriseId(@Param("enterpriseId") String enterpriseId, @Param("hmIds") List<String> hmIds); int getTotalByEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("enterpriseId") String enterpriseId, @Param("hmIds") List<String> hmIds);
/** /**
* 批量修改 活码所属分组 * 批量修改 活码所属分组
...@@ -206,5 +206,17 @@ public interface TabHaobanHmQrcodeMapper { ...@@ -206,5 +206,17 @@ public interface TabHaobanHmQrcodeMapper {
List<String> getHmStoreForWxa(@Param("enterpriseId") String enterpriseId); List<String> getHmStoreForWxa(@Param("enterpriseId") String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto); List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
/**
*
* @Title: listHasQrcodeClerk
* @Description: 返回已有单人活码的clerkId
* @author xugh
* @param enterpriseId
* @param clerkId
* @return
* @throws
*/
List<String> listHasQrcodeClerk(@Param("enterpriseId")String enterpriseId , @Param("clerkIdList")List<String> clerkIdList) ;
} }
...@@ -147,4 +147,16 @@ public interface HmClerkRelationService { ...@@ -147,4 +147,16 @@ public interface HmClerkRelationService {
*/ */
HmClerkRelationBO getHmClerkByHmIdAndStaffId(Long hmId,String staffId); HmClerkRelationBO getHmClerkByHmIdAndStaffId(Long hmId,String staffId);
/**
* 更新状态通过id
*
* @param status 状态
* @param relationId 关系id
* @return int
* @author mozhu
* @date 2022-07-21 16:32:14
*/
int updateStatusById(Integer status, Long relationId);
} }
package com.gic.haoban.manage.service.service.hm; package com.gic.haoban.manage.service.service.hm;
import com.gic.api.base.commons.Page; 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.HmQrcodeListQDTO;
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.service.pojo.bo.hm.HmQrcodeBO; import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
...@@ -10,6 +9,8 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO; ...@@ -10,6 +9,8 @@ import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
/** /**
* 活码(TabHaobanHmQrcode)表服务接口 * 活码(TabHaobanHmQrcode)表服务接口
...@@ -157,7 +158,7 @@ public interface HmQrcodeService { ...@@ -157,7 +158,7 @@ public interface HmQrcodeService {
* @author mozhu * @author mozhu
* @date 2022-07-12 17:38:43 * @date 2022-07-12 17:38:43
*/ */
List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId,List<Long> groupIds, List<String> hmIds); List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupIds, List<String> hmIds);
/** /**
* 获取总数 * 获取总数
...@@ -167,7 +168,7 @@ public interface HmQrcodeService { ...@@ -167,7 +168,7 @@ public interface HmQrcodeService {
* @author mozhu * @author mozhu
* @date 2022-07-12 15:08:35 * @date 2022-07-12 15:08:35
*/ */
int getTotalByEnterpriseId(String enterpriseId, List<String> hmIds); int getTotalByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<String> hmIds);
/** /**
* 批量修改活码分组 * 批量修改活码分组
...@@ -185,4 +186,6 @@ public interface HmQrcodeService { ...@@ -185,4 +186,6 @@ public interface HmQrcodeService {
List<String> getHmStoreForWxa(String enterpriseId); List<String> getHmStoreForWxa(String enterpriseId);
List<String> listHmIdForIndex(HmQrcodeListQDTO qdto); List<String> listHmIdForIndex(HmQrcodeListQDTO qdto);
List<String> listHasQrcodeClerk(String enterpriseId , List<String> clerkIdList) ;
} }
...@@ -106,4 +106,9 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService { ...@@ -106,4 +106,9 @@ public class HmClerkRelationServiceImpl implements HmClerkRelationService {
public HmClerkRelationBO getHmClerkByHmIdAndStaffId(Long hmId, String staffId) { public HmClerkRelationBO getHmClerkByHmIdAndStaffId(Long hmId, String staffId) {
return EntityUtil.changeEntityByOrika(HmClerkRelationBO.class,tabHaobanHmClerkRelationMapper.getHmClerkByHmIdAndStaffId(hmId,staffId)); return EntityUtil.changeEntityByOrika(HmClerkRelationBO.class,tabHaobanHmClerkRelationMapper.getHmClerkByHmIdAndStaffId(hmId,staffId));
} }
@Override
public int updateStatusById(Integer status, Long relationId) {
return tabHaobanHmClerkRelationMapper.updateStatusById(status,relationId);
}
} }
...@@ -123,13 +123,13 @@ public class HmQrcodeServiceImpl implements HmQrcodeService { ...@@ -123,13 +123,13 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
} }
@Override @Override
public List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String enterpriseId, List<Long> groupIds, List<String> hmIds) { public List<HmQrcodeGroupNumBO> getGroupIdNumByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupIds, List<String> hmIds) {
return tabHaobanHmQrcodeMapper.getGroupIdNumByEnterpriseId(enterpriseId, groupIds, hmIds); return tabHaobanHmQrcodeMapper.getGroupIdNumByEnterpriseId(wxEnterpriseId, enterpriseId, groupIds, hmIds);
} }
@Override @Override
public int getTotalByEnterpriseId(String enterpriseId, List<String> hmIds) { public int getTotalByEnterpriseId(String wxEnterpriseId, String enterpriseId, List<String> hmIds) {
return tabHaobanHmQrcodeMapper.getTotalByEnterpriseId(enterpriseId, hmIds); return tabHaobanHmQrcodeMapper.getTotalByEnterpriseId(wxEnterpriseId, enterpriseId, hmIds);
} }
@Override @Override
...@@ -179,5 +179,10 @@ public class HmQrcodeServiceImpl implements HmQrcodeService { ...@@ -179,5 +179,10 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
public List<String> listHmIdForIndex(HmQrcodeListQDTO qdto) { public List<String> listHmIdForIndex(HmQrcodeListQDTO qdto) {
return tabHaobanHmQrcodeMapper.listHmIdForIndex(qdto) ; return tabHaobanHmQrcodeMapper.listHmIdForIndex(qdto) ;
} }
@Override
public List<String> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList) {
return this.tabHaobanHmQrcodeMapper.listHasQrcodeClerk(enterpriseId, clerkIdList);
}
} }
...@@ -82,7 +82,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -82,7 +82,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
staffClerkBindLogService.pushToMq(clerkRelation.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), chanelCode, clerkRelation.getStaffClerkRelationId()); staffClerkBindLogService.pushToMq(clerkRelation.getStaffId(), optStaffId, BindTypeEnum.UNBIND.getVal(), chanelCode, clerkRelation.getStaffClerkRelationId());
//废弃活码 //废弃活码
hmQrcodeApiService.delByClerkId(clerkId, clerkRelation.getEnterpriseId()); hmQrcodeApiService.delByClerkId(clerkId, clerkRelation.getEnterpriseId(),clerkRelation.getWxEnterpriseId());
} }
return b; return b;
} }
...@@ -133,6 +133,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -133,6 +133,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
Date now = new Date(); Date now = new Date();
dto.setStaffClerkRelationId(ToolUtil.randomUUID()); dto.setStaffClerkRelationId(ToolUtil.randomUUID());
dto.setStatusFlag(1); dto.setStatusFlag(1);
dto.setOpenConcatFlag(1);
dto.setCreateTime(now); dto.setCreateTime(now);
dto.setUpdateTime(now); dto.setUpdateTime(now);
int insert = mapper.insert(EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, dto)); int insert = mapper.insert(EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, dto));
...@@ -189,6 +190,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService ...@@ -189,6 +190,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
staffClerkRelation.setCreateTime(new Date()); staffClerkRelation.setCreateTime(new Date());
staffClerkRelation.setUpdateTime(new Date()); staffClerkRelation.setUpdateTime(new Date());
staffClerkRelation.setStatusFlag(1); staffClerkRelation.setStatusFlag(1);
staffClerkRelation.setOpenConcatFlag(1);
TabHaobanStaffClerkRelation relation = EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, staffClerkRelation); TabHaobanStaffClerkRelation relation = EntityUtil.changeEntityByJSON(TabHaobanStaffClerkRelation.class, staffClerkRelation);
mapper.insert(relation); mapper.insert(relation);
return uuid; return uuid;
......
...@@ -323,7 +323,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -323,7 +323,9 @@ public class StaffApiServiceImpl implements StaffApiService {
if (staffThirdWxEnterpriseId.contains(corpid)) { if (staffThirdWxEnterpriseId.contains(corpid)) {
user = qywxUserApiService.getWorkWxUser(corpid, config.getWxSuiteid(), userId); user = qywxUserApiService.getWorkWxUser(corpid, config.getWxSuiteid(), userId);
UserDTO userSelf = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), user.getOpen_userid()); UserDTO userSelf = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), user.getOpen_userid());
user.setName(userSelf.getName()); if (user != null && userSelf != null) {
user.setName(userSelf.getName());
}
} else { } else {
user = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), userId); user = qywxUserApiService.getSelfWorkWxUser(corpid, secretSetting.getSecretVal(), userId);
} }
......
...@@ -399,7 +399,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -399,7 +399,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
//删除主门店 //删除主门店
clerkMainStoreRelatedService.delMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId); clerkMainStoreRelatedService.delMainStore(staffId, staffClerkRelation.getStoreId(), wxEnterpriseId);
//废弃活码 //废弃活码
hmQrcodeApiService.delByClerkId(clerkId,staffClerkRelation.getEnterpriseId()); hmQrcodeApiService.delByClerkId(clerkId,staffClerkRelation.getEnterpriseId(),wxEnterpriseId);
} }
@Override @Override
...@@ -485,7 +485,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -485,7 +485,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
ClerkSyncQDTO clerkSyncQDTO = JSON.parseObject(param, ClerkSyncQDTO.class); ClerkSyncQDTO clerkSyncQDTO = JSON.parseObject(param, ClerkSyncQDTO.class);
Integer type = clerkSyncQDTO.getType(); Integer type = clerkSyncQDTO.getType();
String clerkId = clerkSyncQDTO.getClerkId(); String clerkId = clerkSyncQDTO.getClerkId();
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId,-1);
if (clerkDTO == null) { if (clerkDTO == null) {
logger.error("导购为空"); logger.error("导购为空");
return; return;
......
...@@ -105,7 +105,6 @@ public class HmGroupApiServiceImpl implements HmGroupApiService { ...@@ -105,7 +105,6 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
HmGroupInfoQO groupInfoQo = new HmGroupInfoQO(); HmGroupInfoQO groupInfoQo = new HmGroupInfoQO();
BeanUtils.copyProperties(groupQueryDTO, groupInfoQo); BeanUtils.copyProperties(groupQueryDTO, groupInfoQo);
groupInfoQo.setWxEnterpriseId(null);
groupInfoQo.setStatus(HmGroupStatus.ENABLE.getCode()); groupInfoQo.setStatus(HmGroupStatus.ENABLE.getCode());
Page<HmGroupSettingBO> groupSettingPage = groupService.queryGroupSettingList(groupInfoQo); Page<HmGroupSettingBO> groupSettingPage = groupService.queryGroupSettingList(groupInfoQo);
...@@ -123,16 +122,25 @@ public class HmGroupApiServiceImpl implements HmGroupApiService { ...@@ -123,16 +122,25 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
log.info("导购拥有的门店权限 clerkId:{}, storeIds:{}", groupQueryDTO.getClerkId(), JSON.toJSONString(storeList)); log.info("导购拥有的门店权限 clerkId:{}, storeIds:{}", groupQueryDTO.getClerkId(), JSON.toJSONString(storeList));
if (!CollectionUtils.isEmpty(storeList)) { if (!CollectionUtils.isEmpty(storeList)) {
List<String> hmIds = null; List<String> hmIds = null;
boolean isStatic = Boolean.TRUE;
if (!storeList.contains("-1")) { if (!storeList.contains("-1")) {
HmQrcodeListQDTO hmQrcodeListQDTO = new HmQrcodeListQDTO(); // 非超关权限
hmQrcodeListQDTO.setEnterpriseId(groupQueryDTO.getEnterpriseId()); HmQrcodeListQDTO hmQrcodeListQdto = new HmQrcodeListQDTO();
hmQrcodeListQDTO.setStoreId(storeList); hmQrcodeListQdto.setEnterpriseId(groupQueryDTO.getEnterpriseId());
hmIds = qrcodeService.listHmIdForIndex(hmQrcodeListQDTO); hmQrcodeListQdto.setStoreId(storeList);
hmQrcodeListQdto.setWxEnterpriseId(groupQueryDTO.getWxEnterpriseId());
hmIds = qrcodeService.listHmIdForIndex(hmQrcodeListQdto);
log.info("HMid列表={}", JSON.toJSONString(hmIds));
if (CollectionUtils.isEmpty(hmIds)){
isStatic = false;
}
} }
List<HmQrcodeGroupNumBO> qrcodeGroupNumBoList = qrcodeService.getGroupIdNumByEnterpriseId(groupQueryDTO.getEnterpriseId(), groupIds, hmIds); if (isStatic) {
if (CollectionUtils.isNotEmpty(qrcodeGroupNumBoList)) { List<HmQrcodeGroupNumBO> qrcodeGroupNumBoList = qrcodeService.getGroupIdNumByEnterpriseId(groupQueryDTO.getWxEnterpriseId(), groupQueryDTO.getEnterpriseId(), groupIds, hmIds);
qrcodeGroupNumMap = qrcodeGroupNumBoList.stream() if (CollectionUtils.isNotEmpty(qrcodeGroupNumBoList)) {
.collect(Collectors.toMap(HmQrcodeGroupNumBO::getHmGroupId, HmQrcodeGroupNumBO::getNum, (v1, v2) -> v1)); qrcodeGroupNumMap = qrcodeGroupNumBoList.stream()
.collect(Collectors.toMap(HmQrcodeGroupNumBO::getHmGroupId, HmQrcodeGroupNumBO::getNum, (v1, v2) -> v1));
}
} }
} }
for (HmGroupDTO groupDTO : result) { for (HmGroupDTO groupDTO : result) {
...@@ -193,11 +201,15 @@ public class HmGroupApiServiceImpl implements HmGroupApiService { ...@@ -193,11 +201,15 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
HmQrcodeListQDTO hmQrcodeListQDTO = new HmQrcodeListQDTO(); HmQrcodeListQDTO hmQrcodeListQDTO = new HmQrcodeListQDTO();
hmQrcodeListQDTO.setEnterpriseId(enterpriseId); hmQrcodeListQDTO.setEnterpriseId(enterpriseId);
hmQrcodeListQDTO.setStoreId(storeList); hmQrcodeListQDTO.setStoreId(storeList);
hmQrcodeListQDTO.setWxEnterpriseId(wxEnterpriseId);
hmIds = qrcodeService.listHmIdForIndex(hmQrcodeListQDTO); hmIds = qrcodeService.listHmIdForIndex(hmQrcodeListQDTO);
log.info("导购拥有的活码权限列表:{}", JSON.toJSONString(hmIds)); log.info("导购拥有的活码权限列表:{}", JSON.toJSONString(hmIds));
if (CollectionUtils.isEmpty(hmIds)){
return ServiceResponse.success(0);
}
} }
} }
int totalReferCount = qrcodeService.getTotalByEnterpriseId(enterpriseId, hmIds); int totalReferCount = qrcodeService.getTotalByEnterpriseId(wxEnterpriseId, enterpriseId, hmIds);
return ServiceResponse.success(totalReferCount); return ServiceResponse.success(totalReferCount);
} }
......
...@@ -182,5 +182,13 @@ ...@@ -182,5 +182,13 @@
where hm_id = #{hmId} and staff_id = #{staffId} and status = 1 limit 1 where hm_id = #{hmId} and staff_id = #{staffId} and status = 1 limit 1
</select> </select>
<update id="updateStatusById">
update tab_haoban_hm_clerk_relation
<set>
status = #{status},update_time = now()
</set>
where relation_id = #{relationId}
</update>
</mapper> </mapper>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</update> </update>
<update id="resetAddNumAndOverFlag"> <update id="resetAddNumAndOverFlag">
update update tab_haoban_hm_qrcode
<set> <set>
add_num = 0,over_flag = 0,update_time = now() add_num = 0,over_flag = 0,update_time = now()
</set> </set>
...@@ -329,7 +329,10 @@ ...@@ -329,7 +329,10 @@
<select id="listHmIdForIndex" resultType="String" parameterType="com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO"> <select id="listHmIdForIndex" resultType="String" parameterType="com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO">
select distinct(a.hm_id) 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 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
where a.enterprise_id = #{enterpriseId} and a.status_flag != 0 where a.enterprise_id = #{enterpriseId} and a.status_flag != 0
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and a.wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="null != hmSelect and '' != hmSelect "> <if test="null != hmSelect and '' != hmSelect ">
and (a.hm_code=#{hmSelect} or a.name like '%${hmSelect}%' or a.creator_name like '%${hmSelect}%' ) and (a.hm_code=#{hmSelect} or a.name like '%${hmSelect}%' or a.creator_name like '%${hmSelect}%' )
</if> </if>
...@@ -371,6 +374,9 @@ ...@@ -371,6 +374,9 @@
from tab_haoban_hm_qrcode from tab_haoban_hm_qrcode
where status_flag != 0 where status_flag != 0
and enterprise_id = #{enterpriseId} and enterprise_id = #{enterpriseId}
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="groupIds != null and groupIds.size > 0"> <if test="groupIds != null and groupIds.size > 0">
and hm_group_id IN and hm_group_id IN
<foreach collection="groupIds" item="id" index="index" open="(" close=")" separator=","> <foreach collection="groupIds" item="id" index="index" open="(" close=")" separator=",">
...@@ -391,6 +397,9 @@ ...@@ -391,6 +397,9 @@
from tab_haoban_hm_qrcode from tab_haoban_hm_qrcode
where status_flag != 0 where status_flag != 0
and enterprise_id = #{enterpriseId} and enterprise_id = #{enterpriseId}
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
<if test="hmIds != null and hmIds.size > 0"> <if test="hmIds != null and hmIds.size > 0">
and hm_id in and hm_id in
<foreach collection="hmIds" open="(" close=")" separator="," item="hmId"> <foreach collection="hmIds" open="(" close=")" separator="," item="hmId">
...@@ -422,7 +431,7 @@ ...@@ -422,7 +431,7 @@
<sql id="canAddClerkSql"> <sql id="canAddClerkSql">
tab_haoban_staff_clerk_relation a LEFT JOIN tab_haoban_hm_qrcode b ON a.clerk_id = b.clerk_id and b.hm_type = 1 and b.status_flag in (1,3) tab_haoban_staff_clerk_relation a LEFT JOIN tab_haoban_hm_qrcode b ON a.clerk_id = b.clerk_id and b.hm_type = 1 and b.status_flag in (1,3)
WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 0 WHERE a.enterprise_id = #{enterpriseId} AND a.status_flag = 1 AND a.open_concat_flag = 1
<if test="null != storeIdList"> <if test="null != storeIdList">
and a.store_id in and a.store_id in
<foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=","> <foreach collection="storeIdList" item="id" index="index" open="(" close=")" separator=",">
...@@ -432,6 +441,15 @@ ...@@ -432,6 +441,15 @@
and a.wx_enterprise_id = #{wxEnterpriseId} and a.wx_enterprise_id = #{wxEnterpriseId}
and b.hm_id is null and b.hm_id is null
</sql> </sql>
<select id="listHasQrcodeClerk" resultType="String">
select clerk_id from tab_haoban_hm_qrcode where enterprise_id=#{enterpriseId}
and clerk_id in
<foreach collection="clerkIdList" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
and hm_type = 1 and status_flag in (1,3)
</select>
</mapper> </mapper>
...@@ -137,6 +137,7 @@ public class HmQrcodeController { ...@@ -137,6 +137,7 @@ public class HmQrcodeController {
public RestResponse<StatisticsDTO> list(@RequestBody HmQrcodeListQO hmQrcodeListQO) { public RestResponse<StatisticsDTO> list(@RequestBody HmQrcodeListQO hmQrcodeListQO) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
hmQrcodeListQO.getInFields().setEnterpriseId(loginUser.getEnterpriseId()); hmQrcodeListQO.getInFields().setEnterpriseId(loginUser.getEnterpriseId());
hmQrcodeListQO.getInFields().setWxEnterpriseId(loginUser.getWxEnterpriseId());
List<String> storeList = staffApiService.getHaoBanStoreIdsRolesByClerkId(loginUser.getClerkId(), loginUser.getWxEnterpriseId()); List<String> storeList = staffApiService.getHaoBanStoreIdsRolesByClerkId(loginUser.getClerkId(), loginUser.getWxEnterpriseId());
if (CollectionUtils.isEmpty(storeList)) { if (CollectionUtils.isEmpty(storeList)) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_100007.getCode()), HaoBanErrCode.ERR_100007.getMsg()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_100007.getCode()), HaoBanErrCode.ERR_100007.getMsg());
......
...@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.BasePageInfo; import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkStoreListDTO; import com.gic.clerk.api.dto.ClerkStoreListDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
...@@ -31,7 +32,6 @@ import com.gic.enterprise.api.service.StoreService; ...@@ -31,7 +32,6 @@ import com.gic.enterprise.api.service.StoreService;
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.dto.StaffClerkRelationDTO; import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO; import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
...@@ -72,6 +72,7 @@ public class HmStoreController { ...@@ -72,6 +72,7 @@ public class HmStoreController {
@ResponseBody @ResponseBody
public RestResponse<Object> listStoreClerk(HttpServletRequest request, BasePageInfo basePageInfo) { public RestResponse<Object> listStoreClerk(HttpServletRequest request, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId(); String wxEnterpriseId = loginUser.getWxEnterpriseId();
// 分组id // 分组id
String storeGroupId = request.getParameter("storeGroupId"); String storeGroupId = request.getParameter("storeGroupId");
...@@ -80,7 +81,7 @@ public class HmStoreController { ...@@ -80,7 +81,7 @@ public class HmStoreController {
// 导购参数 // 导购参数
String clerkSearchParams = request.getParameter("clerkSearchParams"); String clerkSearchParams = request.getParameter("clerkSearchParams");
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("enterpriseId", loginUser.getEnterpriseId()); params.put("enterpriseId", enterpriseId);
// 2线上 // 2线上
params.put("status", 2); params.put("status", 2);
params.put("storeGroupId", storeGroupId); params.put("storeGroupId", storeGroupId);
...@@ -117,12 +118,12 @@ public class HmStoreController { ...@@ -117,12 +118,12 @@ public class HmStoreController {
retPage.setTotalPage(page.getTotalPage()); retPage.setTotalPage(page.getTotalPage());
List<ClerkStoreListVO> result = EntityUtil.changeEntityListByJSON(ClerkStoreListVO.class, page.getResult()); List<ClerkStoreListVO> result = EntityUtil.changeEntityListByJSON(ClerkStoreListVO.class, page.getResult());
// 好办状态 // 好办状态
this.haobanStatus(result, wxEnterpriseId); this.haobanStatus(result, wxEnterpriseId, enterpriseId);
retPage.setResult(result); retPage.setResult(result);
return RestResponse.successResult(retPage); return RestResponse.successResult(retPage);
} }
private void haobanStatus(List<ClerkStoreListVO> list, String wxEnterpriseId) { private void haobanStatus(List<ClerkStoreListVO> list, String wxEnterpriseId, String enterpriseId) {
List<String> clerkIdList = new ArrayList<>(); List<String> clerkIdList = new ArrayList<>();
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return; return;
...@@ -156,21 +157,16 @@ public class HmStoreController { ...@@ -156,21 +157,16 @@ public class HmStoreController {
} }
} }
if (CollectionUtils.isNotEmpty(statusList)) { if (CollectionUtils.isNotEmpty(statusList)) {
List<HmQrcodeListDTO> hmList = new ArrayList<>(); ServiceResponse<List<String>> hmClerkResp = this.hmQrcodeApiService.listHasQrcodeClerk(enterpriseId,
if (CollectionUtils.isNotEmpty(hmList)) { statusList);
status2List.addAll(hmList.stream().filter(dto -> dto.getStatusFlag() == 3).map(dto -> dto.getClerkId()) if (CollectionUtils.isNotEmpty(hmClerkResp.getResult())) {
.collect(Collectors.toList())); status3List.addAll(hmClerkResp.getResult());
status3List.addAll(hmList.stream().filter(dto -> dto.getStatusFlag() == 1).map(dto -> dto.getClerkId())
.collect(Collectors.toList()));
} }
status4List status4List
.addAll(statusList.stream().filter(id -> (!status2List.contains(id) && !status3List.contains(id))) .addAll(statusList.stream().filter(id -> (!status3List.contains(id)))
.collect(Collectors.toList())); .collect(Collectors.toList()));
} }
logger.info("导购列表未开启客户联系的={} , 已有单人活码的={}, 可以创建单人活码的={}", status2List, status3List, status4List);
logger.info("导购列表={}", status2List);
logger.info("导购列表={}", status3List);
logger.info("导购列表={}", status4List);
list.stream().forEach(item -> { list.stream().forEach(item -> {
for (ClerkListVO clerk : item.getClerkList()) { for (ClerkListVO clerk : item.getClerkList()) {
if (status2List.contains(clerk.getClerkId())) { if (status2List.contains(clerk.getClerkId())) {
...@@ -201,7 +197,7 @@ public class HmStoreController { ...@@ -201,7 +197,7 @@ public class HmStoreController {
@ResponseBody @ResponseBody
public RestResponse<Object> listStore(HttpServletRequest request, BasePageInfo basePageInfo) { public RestResponse<Object> listStore(HttpServletRequest request, BasePageInfo basePageInfo) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId() ; String wxEnterpriseId = loginUser.getWxEnterpriseId();
String enterpriseId = loginUser.getEnterpriseId(); String enterpriseId = loginUser.getEnterpriseId();
String clerkId = loginUser.getClerkId(); String clerkId = loginUser.getClerkId();
// 如果有权限控制,进行管辖门店过0滤 // 如果有权限控制,进行管辖门店过0滤
...@@ -240,7 +236,7 @@ public class HmStoreController { ...@@ -240,7 +236,7 @@ public class HmStoreController {
page.setPageSize(basePageInfo.getPageSize()); page.setPageSize(basePageInfo.getPageSize());
page.setCurrentPage(basePageInfo.getPageNum()); page.setCurrentPage(basePageInfo.getPageNum());
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("searchDto", searchDTO) ; params.put("searchDto", searchDTO);
page.setParams(params); page.setParams(params);
logger.info("查询条件={}", JSON.toJSONString(page)); logger.info("查询条件={}", JSON.toJSONString(page));
Map<String, Object> result = storeService.getStoreListPage(page); Map<String, Object> result = storeService.getStoreListPage(page);
......
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