Commit fce8f2f4 by 墨竹

fix:查询绑定导购修改

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