Commit 38749865 by jinxin

导购code替换为导购id

parent 27fcc0a3
...@@ -18,6 +18,13 @@ public interface StaffClerkRelationApiService { ...@@ -18,6 +18,13 @@ public interface StaffClerkRelationApiService {
*/ */
void bindLogMq(String params); void bindLogMq(String params);
/**
*
* @param wxEnterpriseId
* @param enterpriseId
* @param clerkCodeList 改为传导购idList
* @return
*/
List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList); List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId); List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
......
...@@ -31,10 +31,8 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -31,10 +31,8 @@ public interface TabHaobanStaffClerkRelationMapper {
int changeStatusByClerkId(@Param("clerkId") String clerkId, @Param("status") Integer status); int changeStatusByClerkId(@Param("clerkId") String clerkId, @Param("status") Integer status);
/** //无效接口删除
* 解绑 // void delByStoreIdAndCode(@Param("storeId") String storeId, @Param("clerkCode") String clerkCode);
*/
void delByStoreIdAndCode(@Param("storeId") String storeId, @Param("clerkCode") String clerkCode);
/** /**
* 解绑 * 解绑
...@@ -49,7 +47,8 @@ public interface TabHaobanStaffClerkRelationMapper { ...@@ -49,7 +47,8 @@ public interface TabHaobanStaffClerkRelationMapper {
List<StaffClerkRelationDTO> lisByStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId, @Param("storeIdList") List<String> storeIdList); List<StaffClerkRelationDTO> lisByStaffId(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("staffId") String staffId, @Param("storeIdList") List<String> storeIdList);
StaffClerkRelationDTO getByCodeAndStoreId(@Param("clerkCode") String clerkCode, @Param("storeId") String storeId); //无效接口删除
// StaffClerkRelationDTO getByCodeAndStoreId(@Param("clerkCode") String clerkCode, @Param("storeId") String storeId);
List<String> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId); List<String> listByWxEnterpriseId(@Param("wxEnterpriseId") String wxEnterpriseId);
......
...@@ -132,7 +132,8 @@ public class AuditApiServiceImpl implements AuditApiService { ...@@ -132,7 +132,8 @@ public class AuditApiServiceImpl implements AuditApiService {
//门店导购绑定 //门店导购绑定
String oldValue = tab.getOldValue(); String oldValue = tab.getOldValue();
AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class); AuditStaffDTO obj = JSONObject.parseObject(oldValue, AuditStaffDTO.class);
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkCode(), tab.getEnterpriseId()); //统一替换导购code
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(obj.getClerkId(), tab.getEnterpriseId());
String staffId = obj.getStaffId(); String staffId = obj.getStaffId();
String storeId = tab.getCommitStoreId(); String storeId = tab.getCommitStoreId();
String clerkId = obj.getClerkId(); String clerkId = obj.getClerkId();
......
...@@ -500,9 +500,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe ...@@ -500,9 +500,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
} }
} else if (type == 2) { } else if (type == 2) {
logger.info("导购门店转移,新的导购和门店,clerkId={},storeId={}", clerkId, clerkSyncQDTO.getStoreId()); logger.info("导购门店转移,新的导购和门店,clerkId={},storeId={}", clerkId, clerkSyncQDTO.getStoreId());
StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getStaffClerkRelationDTO(clerkCode, enterpriseId); //统一处理:导购code替换为导购id
StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getStaffClerkRelationDTO(oldClerkId, enterpriseId);
if (null == oldRelationDTO) { if (null == oldRelationDTO) {
logger.info("导购未关联成员,clerkCode={}", clerkCode); logger.info("导购未关联成员,oldClerkId={}", oldClerkId);
return; return;
} }
/* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId); /* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId);
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<include refid="leftJoinStaffSQL"/> <include refid="leftJoinStaffSQL"/>
where a.enterprise_id = #{enterpriseId} where a.enterprise_id = #{enterpriseId}
and a.wx_enterprise_id = #{wxEnterpriseId} and a.status_flag = 1 and b.status_flag = 1 and a.wx_enterprise_id = #{wxEnterpriseId} and a.status_flag = 1 and b.status_flag = 1
and a.clerk_code in and a.clerk_id in
<foreach collection="clerkCodeList" item="id" index="index" open="(" close=")" separator=","> <foreach collection="clerkCodeList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR} #{id,jdbcType=VARCHAR}
</foreach> </foreach>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<include refid="leftJoinStaffSQL"/> <include refid="leftJoinStaffSQL"/>
where a.status_flag = 1 and b.status_flag = 1 where a.status_flag = 1 and b.status_flag = 1
and a.enterprise_id = #{enterpriseId} and a.enterprise_id = #{enterpriseId}
and a.clerk_code = #{clerkCode} order by a.create_time desc limit 1 and a.clerk_id = #{clerkCode} order by a.create_time desc limit 1
</select> </select>
<select id="getStaffClerkRelationDTO" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"> <select id="getStaffClerkRelationDTO" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
where a.status_flag = 1 and b.status_flag = 1 where a.status_flag = 1 and b.status_flag = 1
and a.manage_flag = 0 and a.manage_flag = 0
and a.enterprise_id = #{enterpriseId} and a.enterprise_id = #{enterpriseId}
and a.clerk_code = #{clerkCode} order by a.create_time desc limit 1 and a.clerk_id = #{clerkCode} order by a.create_time desc limit 1
</select> </select>
...@@ -107,14 +107,6 @@ ...@@ -107,14 +107,6 @@
and status_flag != #{status} and status_flag != #{status}
</update> </update>
<update id="delByStoreIdAndCode">
update tab_haoban_staff_clerk_relation
set status_flag = 0,
update_time = now()
where clerk_code = #{clerkCode,jdbcType=VARCHAR}
and store_id = #{storeId,jdbcType=VARCHAR}
and status_flag = 1
</update>
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"> <select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
<include refid="leftJoinStaffSQL"/> <include refid="leftJoinStaffSQL"/>
...@@ -173,12 +165,6 @@ ...@@ -173,12 +165,6 @@
and a.staff_id = #{staffId} and a.status_flag=1 and b.status_flag=1 and a.staff_id = #{staffId} and a.status_flag=1 and b.status_flag=1
</select> </select>
<select id="getByCodeAndStoreId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
<include refid="leftJoinStaffSQL" />
where a.clerk_code = #{clerkCode}
and a.store_id = #{storeId}
and a.status_flag = 1 and b.status_flag=1
</select>
<select id="listByWxEnterpriseId" resultType="String"> <select id="listByWxEnterpriseId" resultType="String">
select a.staff_id select a.staff_id
......
...@@ -270,7 +270,8 @@ public class AuditController extends WebBaseController { ...@@ -270,7 +270,8 @@ public class AuditController extends WebBaseController {
//审核同意 //审核同意
if (audit.getAuditType() == AuditType.CLERK_BIND.getCode()) { if (audit.getAuditType() == AuditType.CLERK_BIND.getCode()) {
//导购绑定 //导购绑定
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode, enterpriseId); //统一替换导购code
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkId, enterpriseId);
StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, auditStaffId); StaffClerkRelationDTO have = staffClerkRelationApiService.getOneByStoreIdAndStaffId(storeId, auditStaffId);
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (have != null) { if (have != null) {
......
...@@ -229,7 +229,8 @@ public class WxStaffController extends WebBaseController { ...@@ -229,7 +229,8 @@ public class WxStaffController extends WebBaseController {
if (CollectionUtils.isEmpty(clerkDTOS)) { if (CollectionUtils.isEmpty(clerkDTOS)) {
return resultResponse(HaoBanErrCode.ERR_10016); return resultResponse(HaoBanErrCode.ERR_10016);
} }
Set<String> clerkCodeList = clerkDTOS.stream().map(ClerkDTO::getClerkCode).collect(Collectors.toSet()); //统一处理:导购code替换为导购id
Set<String> clerkCodeList = clerkDTOS.stream().map(ClerkDTO::getClerkId).collect(Collectors.toSet());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId,
enterpriseId, clerkCodeList); enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream() Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
...@@ -943,7 +944,8 @@ public class WxStaffController extends WebBaseController { ...@@ -943,7 +944,8 @@ public class WxStaffController extends WebBaseController {
String clerkCode = clerk.getClerkCode(); String clerkCode = clerk.getClerkCode();
String enterpriseId = clerk.getEnterpriseId(); String enterpriseId = clerk.getEnterpriseId();
String wxUserId = staff.getWxUserId(); String wxUserId = staff.getWxUserId();
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode, //统一替换导购code
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkId,
enterpriseId); enterpriseId);
if (auditType == 2) { if (auditType == 2) {
...@@ -992,7 +994,8 @@ public class WxStaffController extends WebBaseController { ...@@ -992,7 +994,8 @@ public class WxStaffController extends WebBaseController {
audit.setCommitTime(new Date()); audit.setCommitTime(new Date());
audit.setAuditType(2); audit.setAuditType(2);
auditApiService.insert(audit); auditApiService.insert(audit);
StaffClerkRelationDTO resultDTO = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode, //统一替换导购code
StaffClerkRelationDTO resultDTO = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkId,
clerk.getEnterpriseId()); clerk.getEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_1, resultDTO); return resultResponse(HaoBanErrCode.ERR_1, resultDTO);
} else { } else {
...@@ -1058,7 +1061,8 @@ public class WxStaffController extends WebBaseController { ...@@ -1058,7 +1061,8 @@ public class WxStaffController extends WebBaseController {
if (staff == null) { if (staff == null) {
return resultResponse(HaoBanErrCode.ERR_10006); return resultResponse(HaoBanErrCode.ERR_10006);
} }
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode, //统一替换导购code
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkId,
enterpriseId); enterpriseId);
if (staffClerkRelation == null) { if (staffClerkRelation == null) {
return resultResponse(HaoBanErrCode.ERR_111145); return resultResponse(HaoBanErrCode.ERR_111145);
...@@ -1082,7 +1086,8 @@ public class WxStaffController extends WebBaseController { ...@@ -1082,7 +1086,8 @@ public class WxStaffController extends WebBaseController {
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return resultResponse(HaoBanErrCode.ERR_10016); return resultResponse(HaoBanErrCode.ERR_10016);
} }
Set<String> clerkCodeList = list.stream().map(ClerkDTO::getClerkCode).collect(Collectors.toSet()); //统一处理:导购code替换为导购id
Set<String> clerkCodeList = list.stream().map(ClerkDTO::getClerkId).collect(Collectors.toSet());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId,
enterpriseId, clerkCodeList); enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream() Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
...@@ -1130,7 +1135,8 @@ public class WxStaffController extends WebBaseController { ...@@ -1130,7 +1135,8 @@ public class WxStaffController extends WebBaseController {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_10016.getCode()), return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_10016.getCode()),
HaoBanErrCode.ERR_10016.getMsg()); HaoBanErrCode.ERR_10016.getMsg());
} }
Set<String> clerkCodeList = list.stream().map(ClerkDTO::getClerkCode).collect(Collectors.toSet()); //统一处理:导购code替换为导购id
Set<String> clerkCodeList = list.stream().map(ClerkDTO::getClerkId).collect(Collectors.toSet());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId,
enterpriseId, clerkCodeList); enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream() Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
......
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