Commit e3551669 by jinxin

Merge remote-tracking branch 'origin/feature/导购code替换' into feature/五月二期

parents 2824ae76 38749865
......@@ -18,6 +18,13 @@ public interface StaffClerkRelationApiService {
*/
void bindLogMq(String params);
/**
*
* @param wxEnterpriseId
* @param enterpriseId
* @param clerkCodeList 改为传导购idList
* @return
*/
List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
......
......@@ -31,10 +31,8 @@ public interface TabHaobanStaffClerkRelationMapper {
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 {
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);
......
......@@ -132,7 +132,8 @@ public class AuditApiServiceImpl implements AuditApiService {
//门店导购绑定
String oldValue = tab.getOldValue();
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 storeId = tab.getCommitStoreId();
String clerkId = obj.getClerkId();
......
......@@ -500,9 +500,10 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
} else if (type == 2) {
logger.info("导购门店转移,新的导购和门店,clerkId={},storeId={}", clerkId, clerkSyncQDTO.getStoreId());
StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getStaffClerkRelationDTO(clerkCode, enterpriseId);
//统一处理:导购code替换为导购id
StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getStaffClerkRelationDTO(oldClerkId, enterpriseId);
if (null == oldRelationDTO) {
logger.info("导购未关联成员,clerkCode={}", clerkCode);
logger.info("导购未关联成员,oldClerkId={}", oldClerkId);
return;
}
/* StaffClerkRelationDTO oldRelationDTO = staffClerkRelationService.getByClerkId(oldClerkId);
......
......@@ -57,7 +57,7 @@
<include refid="leftJoinStaffSQL"/>
where a.enterprise_id = #{enterpriseId}
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=",">
#{id,jdbcType=VARCHAR}
</foreach>
......@@ -87,7 +87,7 @@
<include refid="leftJoinStaffSQL"/>
where a.status_flag = 1 and b.status_flag = 1
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 id="getStaffClerkRelationDTO" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
......@@ -95,7 +95,7 @@
where a.status_flag = 1 and b.status_flag = 1
and a.manage_flag = 0
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>
......@@ -107,15 +107,7 @@
and status_flag != #{status}
</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">
<include refid="leftJoinStaffSQL"/>
where a.status_flag=1 and b.status_flag = 1
......@@ -173,12 +165,6 @@
and a.staff_id = #{staffId} and a.status_flag=1 and b.status_flag=1
</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 a.staff_id
......
......@@ -270,7 +270,8 @@ public class AuditController extends WebBaseController {
//审核同意
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);
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (have != null) {
......
......@@ -229,7 +229,8 @@ public class WxStaffController extends WebBaseController {
if (CollectionUtils.isEmpty(clerkDTOS)) {
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,
enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
......@@ -943,7 +944,8 @@ public class WxStaffController extends WebBaseController {
String clerkCode = clerk.getClerkCode();
String enterpriseId = clerk.getEnterpriseId();
String wxUserId = staff.getWxUserId();
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode,
//统一替换导购code
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkId,
enterpriseId);
if (auditType == 2) {
......@@ -992,7 +994,8 @@ public class WxStaffController extends WebBaseController {
audit.setCommitTime(new Date());
audit.setAuditType(2);
auditApiService.insert(audit);
StaffClerkRelationDTO resultDTO = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode,
//统一替换导购code
StaffClerkRelationDTO resultDTO = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkId,
clerk.getEnterpriseId());
return resultResponse(HaoBanErrCode.ERR_1, resultDTO);
} else {
......@@ -1058,7 +1061,8 @@ public class WxStaffController extends WebBaseController {
if (staff == null) {
return resultResponse(HaoBanErrCode.ERR_10006);
}
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkCode,
//统一替换导购code
StaffClerkRelationDTO staffClerkRelation = staffClerkRelationApiService.getByCodeAndEnterpriseId(clerkId,
enterpriseId);
if (staffClerkRelation == null) {
return resultResponse(HaoBanErrCode.ERR_111145);
......@@ -1082,7 +1086,8 @@ public class WxStaffController extends WebBaseController {
if (CollectionUtils.isEmpty(list)) {
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,
enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream()
......@@ -1130,7 +1135,8 @@ public class WxStaffController extends WebBaseController {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_10016.getCode()),
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,
enterpriseId, clerkCodeList);
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