Commit fce8f2f4 by 墨竹

fix:查询绑定导购修改

parent bfa986b9
......@@ -18,7 +18,7 @@ public interface StaffClerkRelationApiService {
*/
void bindLogMq(String params);
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
......
......@@ -14,7 +14,9 @@ public interface TabHaobanStaffClerkRelationMapper {
TabHaobanStaffClerkRelation selectByPrimaryKey(String staffClerkRelationId);
List<TabHaobanStaffClerkRelation> listBindCode(@Param("enterpriseId") String enterpriseId, @Param("clerkCodeList") Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCode(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("enterpriseId") String enterpriseId,
@Param("clerkCodeList") Set<String> clerkCodeList);
List<TabHaobanStaffClerkRelation> listBindCodeByStaffId(@Param("enterpriseIdList") List<String> enterpriseIdList, @Param("staffId") String staffId);
......
......@@ -10,7 +10,7 @@ import java.util.Set;
public interface StaffClerkRelationService {
List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList);
List<StaffClerkRelationDTO> listBindCodeByStaffId(List<String> enterpriseIdList, String staffId);
......
......@@ -68,8 +68,8 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
private ClerkService clerkService;
@Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCode(enterpriseId, clerkCodeList));
public List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList) {
return EntityUtil.changeEntityListByJSON(StaffClerkRelationDTO.class, mapper.listBindCode(wxEnterpriseId,enterpriseId, clerkCodeList));
}
@Override
......
......@@ -122,8 +122,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public List<StaffClerkRelationDTO> listBindCode(String enterpriseId, Set<String> clerkCodeList) {
return staffClerkRelationService.listBindCode(enterpriseId, clerkCodeList);
public List<StaffClerkRelationDTO> listBindCode(String wxEnterpriseId,String enterpriseId, Set<String> clerkCodeList) {
return staffClerkRelationService.listBindCode(wxEnterpriseId,enterpriseId, clerkCodeList);
}
@Override
......
......@@ -17,7 +17,8 @@
<result column="clerk_type" property="clerkType" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
staff_clerk_relation_id, staff_id, wx_enterprise_id, enterprise_id, store_id,
staff_clerk_relation_id
, staff_id, wx_enterprise_id, enterprise_id, store_id,
clerk_id, clerk_code, status_flag, create_time, update_time,open_concat_flag,manage_flag,clerk_type
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
......@@ -31,12 +32,14 @@
insert into tab_haoban_staff_clerk_relation (staff_clerk_relation_id, staff_id, wx_enterprise_id,
enterprise_id, store_id,
clerk_id, clerk_code, status_flag,
create_time, update_time,open_concat_flag,manage_flag,clerk_type)
create_time, update_time, open_concat_flag, manage_flag,
clerk_type)
values (#{staffClerkRelationId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR},
#{enterpriseId,jdbcType=VARCHAR}, #{storeId,jdbcType=VARCHAR},
#{clerkId,jdbcType=VARCHAR}, #{clerkCode,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{openConcatFlag},#{manageFlag},#{clerkType})
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{openConcatFlag}, #{manageFlag},
#{clerkType})
</insert>
......@@ -45,7 +48,7 @@
<include refid="Base_Column_List"/>
from tab_haoban_staff_clerk_relation
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and status_flag = 1
and clerk_code in
<foreach collection="clerkCodeList" item="id" index="index" open="(" close=")" separator=",">
#{id,jdbcType=VARCHAR}
......@@ -118,7 +121,8 @@
and status_flag = 1
</update>
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO" parameterType="java.lang.String">
<select id="listByClerkIds" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"
parameterType="java.lang.String">
select
a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId,
......@@ -231,7 +235,7 @@
select staff_id
from tab_haoban_staff_clerk_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag =1
and status_flag = 1
</select>
<select id="lisByStaffId" resultMap="BaseResultMap">
......@@ -260,8 +264,7 @@
</select>
<select id="listBindByStoreId" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
select
a.staff_clerk_relation_id staffClerkRelationId,
select a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
......@@ -269,13 +272,13 @@
a.clerk_id clerkId,
a.clerk_code clerkCode,
a.status_flag statusFlag,
b.wx_user_id qwUserId ,
b.wx_user_id qwUserId,
b.wx_open_user_id openUserId
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and a.store_id=#{storeId}
and a.status_flag =1
and a.store_id = #{storeId}
and a.status_flag = 1
</select>
<select id="listBindByStoreIds" resultMap="BaseResultMap">
......@@ -508,21 +511,26 @@
</select>
<update id="deleteByEnterpriseId">
update tab_haoban_staff_clerk_relation set status_flag = 0 , update_time=now() where enterprise_id = #{enterpriseId}
update tab_haoban_staff_clerk_relation
set status_flag = 0,
update_time=now()
where enterprise_id = #{enterpriseId}
</update>
<select id="getBindByManage" resultType="java.lang.Integer">
select
count(*)
select count(*)
from tab_haoban_staff_clerk_relation
where status_flag=1 and enterprise_id = #{enterpriseId} and manage_flag = 1
where status_flag = 1
and enterprise_id = #{enterpriseId}
and manage_flag = 1
</select>
<select id="getBindByStaffIdAndEnterpriseId" resultType="java.lang.Integer">
select
count(*)
select count(*)
from tab_haoban_staff_clerk_relation
where status_flag=1 and enterprise_id = #{enterpriseId} and staff_id = #{staffId}
where status_flag = 1
and enterprise_id = #{enterpriseId}
and staff_id = #{staffId}
</select>
......
......@@ -177,7 +177,7 @@ public class ClerkController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_10016);
}
Set<String> clerkCodeList = clerkDTOS.stream().map(ClerkDTO::getClerkCode).collect(Collectors.toSet());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(enterpriseId, clerkCodeList);
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream().collect(Collectors.toMap(StaffClerkRelationDTO::getClerkCode, s -> s));
List<StoreClerkVO> resultList = new ArrayList<>();
for (ClerkDTO dto : clerkDTOS) {
......@@ -897,7 +897,7 @@ public class ClerkController extends WebBaseController {
ServiceResponse serviceResponse = staffClerkRelationApiService.wxBindStaffClerk(staffClerkRelation, staffId, ChannelCodeEnum.SELF_BIND.getCode());
if (!serviceResponse.isSuccess()) {
return resultResponse(HaoBanErrCode.ERR_DEFINE, serviceResponse.getMessage(),null,serviceResponse.getMessage());
return resultResponse(HaoBanErrCode.ERR_DEFINE, serviceResponse.getMessage(), null, serviceResponse.getMessage());
}
//无需审核
......@@ -979,7 +979,7 @@ public class ClerkController extends WebBaseController {
//解绑
@RequestMapping("unbind-staff")
public HaobanResponse unBindStaff(String clerkId, String clerkCode, String staffId, String storeId,String enterpriseId,Integer manageFlag) {
public HaobanResponse unBindStaff(String clerkId, String clerkCode, String staffId, String storeId, String enterpriseId, Integer manageFlag) {
logger.info("解绑 操作人:{},备操作人:{},操作门店:{}", staffId, clerkId, storeId);
if (StringUtils.isAnyBlank(clerkId, clerkCode, staffId)) {
return resultResponse(HaoBanErrCode.ERR_2);
......@@ -1009,12 +1009,14 @@ public class ClerkController extends WebBaseController {
*/
@RequestMapping("store-clerk-list")
public HaobanResponse storeClerkList(String storeId, String enterpriseId) {
WellDoneLoginDTO loginUser = this.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
List<ClerkDTO> list = clerkService.listClerkByNameOrCode(enterpriseId, null, Collections.singletonList(storeId));
if (CollectionUtils.isEmpty(list)) {
return resultResponse(HaoBanErrCode.ERR_10016);
}
Set<String> clerkCodeList = list.stream().map(ClerkDTO::getClerkCode).collect(Collectors.toSet());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(enterpriseId, clerkCodeList);
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream().collect(Collectors.toMap(StaffClerkRelationDTO::getClerkCode, s -> s));
List<BindClerkVO> bindList = new ArrayList<>();
List<BindClerkVO> unBindList = new ArrayList<>();
......@@ -1046,12 +1048,14 @@ public class ClerkController extends WebBaseController {
*/
@RequestMapping("clerk-manage-list")
public RestResponse clerkManageList(String enterpriseId) {
WellDoneLoginDTO loginUser = this.getLoginUser();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
List<ClerkDTO> list = clerkService.listClerkEnableHaoban(Collections.singletonList(enterpriseId), null);
if (CollectionUtils.isEmpty(list)) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_10016.getCode()), HaoBanErrCode.ERR_10016.getMsg());
}
Set<String> clerkCodeList = list.stream().map(ClerkDTO::getClerkCode).collect(Collectors.toSet());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(enterpriseId, clerkCodeList);
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCode(wxEnterpriseId, enterpriseId, clerkCodeList);
Map<String, StaffClerkRelationDTO> bindCodeMap = bindRelationList.stream().collect(Collectors.toMap(StaffClerkRelationDTO::getClerkCode, s -> s));
List<BindClerkVO> bindList = new ArrayList<>();
List<BindClerkVO> unBindList = 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