Commit 3cea8fc9 by zhiwj

好办导购

parent af3b1e87
......@@ -239,9 +239,9 @@ public interface ClerkApiService {
* @author zhiwj
* @param enterpriseIdList
* @param keyword
* @param storeIdList
* @param storeInfoIdList
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.store.dto.ClerkDTO>>
* @throws
*/
ServiceResponse<List<ClerkDTO>> listHaobanClerk(List<Integer> enterpriseIdList, String keyword, List<Integer> storeIdList);
ServiceResponse<List<ClerkDTO>> listHaobanClerk(List<Integer> enterpriseIdList, String keyword, List<Integer> storeInfoIdList);
}
......@@ -80,4 +80,6 @@ public interface TabClerkMapper {
Map<Integer, Map<String, Object>> countMapByPosition(@Param("enterpriseId") Integer enterpriseId, @Param("ids") List<Integer> positionList);
void updatePosition(@Param("enterpriseId") Integer enterpriseId, @Param("positionId") Integer clerkPositionId, @Param("positionName") String positionName);
List<TabClerk> listHaobanClerk(@Param("enterpriseIdList") List<Integer> enterpriseIdList, @Param("keyword") String keyword, @Param("storeInfoIdList") List<Integer> storeInfoIdList);
}
\ No newline at end of file
......@@ -114,6 +114,8 @@ public interface ClerkService {
List<TabClerk> listClerkByIds(Integer enterpriseId, String clerkIds);
List<TabClerk> listClerkByIds(List<Integer> clerkIdList);
TabClerk getById(Integer clerkId);
List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, String search);
......@@ -125,4 +127,6 @@ public interface ClerkService {
Map<Integer, Integer> countMapByPosition(Integer enterpriseId, List<Integer> positionList);
void updatePosition(Integer enterpriseId, Integer clerkPositionId, String positionName);
List<TabClerk> listHaobanClerk(List<Integer> enterpriseIdList, String keyword, List<Integer> storeInfoIdList);
}
......@@ -143,6 +143,11 @@ public class ClerkServiceImpl implements ClerkService {
}
@Override
public List<TabClerk> listClerkByIds(List<Integer> clerkIdList) {
return tabClerkMapper.listClerkByIds(null, clerkIdList);
}
@Override
public TabClerk getById(Integer clerkId) {
return this.tabClerkMapper.selectByPrimaryKey(clerkId);
}
......@@ -177,4 +182,9 @@ public class ClerkServiceImpl implements ClerkService {
tabClerkMapper.updatePosition(enterpriseId, clerkPositionId, positionName);
}
@Override
public List<TabClerk> listHaobanClerk(List<Integer> enterpriseIdList, String keyword, List<Integer> storeInfoIdList) {
return tabClerkMapper.listHaobanClerk(enterpriseIdList, keyword, storeInfoIdList);
}
}
......@@ -802,13 +802,32 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
@Override
public ServiceResponse<List<ClerkDTO>> listHaobanClerk(List<Integer> clerkIds) {
return null;
public ServiceResponse<List<ClerkDTO>> listHaobanClerk(List<Integer> clerkIdList) {
List<TabClerk> clerkList = this.clerkService.listClerkByIds(clerkIdList);
return haobanClerk(clerkList);
}
@Override
public ServiceResponse<List<ClerkDTO>> listHaobanClerk(List<Integer> enterpriseIdList, String keyword, List<Integer> storeIdList) {
return null;
public ServiceResponse<List<ClerkDTO>> listHaobanClerk(List<Integer> enterpriseIdList, String keyword, List<Integer> storeInfoIdList) {
List<TabClerk> clerkList = this.clerkService.listHaobanClerk(enterpriseIdList, keyword, storeInfoIdList);
return haobanClerk(clerkList);
}
private ServiceResponse<List<ClerkDTO>> haobanClerk(List<TabClerk> clerkList) {
List<ClerkDTO> clerkDTOS = EntityUtil.changeEntityListByJSON(ClerkDTO.class, clerkList);
if (CollectionUtils.isNotEmpty(clerkDTOS)) {
List<Integer> storeInfoIdList = clerkDTOS.stream().map(ClerkDTO::getStoreInfoId).collect(Collectors.toList());
StoreSearchDBDTO storeSearchDBDTO = new StoreSearchDBDTO();
storeSearchDBDTO.setStoreInfoIdList(storeInfoIdList);
com.github.pagehelper.Page<StoreDTO> listStore = storeService.listStore(storeSearchDBDTO, 1, Integer.MAX_VALUE);
if (CollectionUtils.isNotEmpty(listStore)) {
Map<Integer, String> map = listStore.getResult().stream().collect(Collectors.toMap(StoreDTO::getStoreInfoId, StoreDTO::getStoreName, (e1, e2) -> e1));
for (ClerkDTO clerkDTO : clerkDTOS) {
clerkDTO.setStoreName(map.get(clerkDTO.getStoreInfoId()));
}
}
}
return ServiceResponse.success(clerkDTOS);
}
private void asynClerkInfoToWeimobMQ(Integer wmMallStoreId, Integer enterpriseId, WeimobGuiderSynDTO wmGuiderDTO) {
......
......@@ -357,8 +357,30 @@
</if>
group by position_id
</select>
<!-- void updatePosition(@Param("clerkPositionId") Integer clerkPositionId, @Param("positionName") String positionName);-->
<update id="updatePosition">
update tab_clerk set position_name = #{positionName} where position_id = #{positionId} and enterprise_id = #{enterpriseId}
</update>
<!-- List<TabClerk> listHaobanClerk(@Param("enterpriseIdList") List<Integer> enterpriseIdList, @Param("keyword") String keyword, @Param("storeInfoIdList") List<Integer> storeInfoIdList);-->
<select id="listHaobanClerk" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_clerk
<where>
<if test="null != enterpriseIdList and enterpriseIdList.size > 0">
and enterprise_id in
<foreach collection="enterpriseIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="null != storeInfoIdList and storeInfoIdList.size > 0">
and store_info_id in
<foreach collection="storeInfoIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="keyword != null and keyword != '' ">
and (clerk_code like concat('%',#{keyword}, '%') or phone_number like concat('%',#{keyword}, '%') )
</if>
</where>
</select>
</mapper>
\ No newline at end of file
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