Commit b425bb44 authored by liwei's avatar liwei

修改了小程序切换商家的问题

parent ec93bf0c
......@@ -274,11 +274,11 @@ public class SysUnitController extends CyPaginationController<SysUnit> {
*/
@ApiOperation(value = "当前登录人所属商家信息", notes = "当前登录人所属商家信息")
@GetMapping(value = "/getUnitInfo")
public CyResult getUnitInfo() {
public CyResult getUnitInfo(String wechatType) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
sysUnitServiceImpl.findUnitByUnit());
sysUnitServiceImpl.findUnitByUnit(wechatType));
}
......
......@@ -49,7 +49,7 @@ public interface SysUnitRepository extends CyBaseMapper<SysUnit> {
* @param userId
* @return
*/
List<SysUnit> findUnitByUnit(String userId);
List<SysUnit> findUnitByUnit(@Param("userId") String userId,@Param("wechatType") String wechatType);
void deleteTheUserByMerchantId(@Param("sysUnit") SysUnit sysUnit);
......@@ -91,7 +91,7 @@ public interface SysUnitRepository extends CyBaseMapper<SysUnit> {
ArrayList<Integer> findUserId(Integer unitId);
List<SysUnit> findUnit(String userId);
List<SysUnit> findUnit(@Param("userId") String userId,@Param("wechatType") String wechatType);
List<SysUnit> findAllUnit();
}
......
......@@ -88,7 +88,7 @@ public interface SysUnitService {
SysUnit statistics(SysUnit sysUnit);
List<SysUnit> findUnitByUnit();
List<SysUnit> findUnitByUnit(String wechatType);
List<StatisticsDto> statisticsByTypeBarChart(SysUnit sysUnit);
......
......@@ -258,7 +258,7 @@ public class SysUnitServiceImpl extends ServiceImpl<SysUnitRepository, SysUnit>
* @return
*/
@Override
public List<SysUnit> findUnitByUnit() {
public List<SysUnit> findUnitByUnit(String wechatType) {
String userId = CyUserUtil.getAuthenBusinessId();
if (StringUtils.isEmpty(userId)) {
throw new CyServiceException(ResultServiceEnums.NOT_LOGIN.getCode(),
......@@ -274,10 +274,11 @@ public class SysUnitServiceImpl extends ServiceImpl<SysUnitRepository, SysUnit>
}
//商家
if (cyInitComp.unit[0].equals(CyUserUtil.getAuthenRoleIds())) {
return baseMapper.findUnit(userId);
List<SysUnit> unit = baseMapper.findUnit(userId,wechatType);
return unit;
}
//根据用户id查询当前人的商家信息 (代言人)
return baseMapper.findUnitByUnit(userId);
return baseMapper.findUnitByUnit(userId,wechatType);
}
@Override
......
......@@ -190,6 +190,9 @@
<if test="userId !=null and userId != '' ">
AND su.business_id = #{userId}
</if>
<if test="wechatType !=null and wechatType != '' ">
AND su.wechat_type = #{wechatType}
</if>
AND su.del_flag = 0
AND su.flag =1
AND sun.del_flag = 0
......@@ -330,6 +333,9 @@
<if test="userId !=null and userId != '' ">
AND sun.user_id = #{userId}
</if>
<if test="wechatType !=null and wechatType != '' ">
AND sun.wechat_type = #{wechatType}
</if>
AND sun.del_flag = 0
AND sun.flag = 1
</select>
......
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