1修改账号相关接口

This commit is contained in:
fengjundan 2021-07-30 17:23:38 +08:00
parent a179b2f704
commit b0ef15d6a8
17 changed files with 91 additions and 70 deletions

View File

@ -157,6 +157,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getRoleByUserID" parameterType="Long" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_key=#{roleKey} ORDER BY r.update_time DESC limit 1
where u.user_id = #{userId} ORDER BY r.update_time DESC limit 1
</select>
</mapper>

View File

@ -37,11 +37,12 @@
</select>
<select id="getOperatorId" parameterType="java.lang.String" resultType="java.util.Map">
select xo.operator_id operatorId, xo.name, xo.contact_name contactName,
select distinct xo.operator_id operatorId, xo.name, xo.contact_name contactName,
xo.contact_phone contactPhone, xo.phone, xo.attribute,
xdb.dict_value attributenName
from xhpc_operator `xo`
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute
JOIN xhpc_charging_station xcs on xcs.operator_id = xo.operator_id
where xo.del_flag = 0
<if test="null != operatorIds and '' != operatorIds">
operator_id in
@ -85,12 +86,12 @@
and xcs.operator_id = #{operatorId}
</if>
GROUP BY `pxa`.pcode
)
) and code != 100000
</select>
<select id="groupCityByOperatorId" parameterType="java.lang.String" resultType="java.util.Map">
select `code` ,`name` from xhpc_area where `code` in (
select `pxa`.code city
select `xa`.pcode city
from xhpc_charging_station xcs
LEFT JOIN xhpc_area `xa` on `xa`.`code` = xcs.area_code
LEFT JOIN xhpc_area pxa on `xa`.pcode = pxa.`code`
@ -124,7 +125,7 @@
and xcs.operator_id = #{operatorId}
</if>
<if test="null != cityCode and '' != cityCode">
and pxa.code = #{cityCode}
and xa.pcode = #{cityCode}
</if>
GROUP BY `xa`.code
)

View File

@ -67,6 +67,13 @@
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common-datascope</artifactId>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>xhpc-common</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@ -74,6 +74,13 @@
<artifactId>alipay-sdk-java</artifactId>
<version>${alipay.sdk}</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>xhpc-common</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

View File

@ -86,8 +86,7 @@ public class WxPaymentController {
return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
}
Double amount1 = Double.parseDouble(amount) * 100;
String orderNumber = "wx" + DateUtils.timePath();
String orderNumber = String.format("%07d", userId) + DateUtils.timePath() + 1 + 1 + (int) (1 + Math.random() * (10 - 1 + 1));
if (0.0 == amount1) {
return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能为0");
}
@ -161,7 +160,6 @@ public class WxPaymentController {
return AjaxResult.success(sign);
}
/**
* 生成签名
*

View File

@ -51,7 +51,7 @@ public class XhpcRefundOrderController extends BaseController {
return AjaxResult.error(HttpStatus.NOT_NULL, "退款渠道不能为空");
}
//生成退款订单
String orderOutNumber = "wxOut" + DateUtils.timePath();
String orderOutNumber = String.format("%07d", userId) + DateUtils.timePath() + type + 2 + (int) (1 + Math.random() * (10 - 1 + 1));
iXhpcRefundOrderService.addRefundOrder(userId, BigDecimal.valueOf(Double.parseDouble(amount)), type, orderOutNumber, openid);
return AjaxResult.success();
}

View File

@ -59,7 +59,8 @@ public class XhpcInternetUserController extends BaseController {
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
}
iXhpcInternetUserService.insert(xhpcInternetUser);
sysUser = iXhpcUserService.insertUser(sysUser);
sysUser.setInternetUserId(xhpcInternetUser.getInternetUserId());
iXhpcUserService.insertUser(sysUser);
return AjaxResult.success();
}

View File

@ -132,4 +132,14 @@ public class XhpcOperatorController extends BaseController {
iXhpcOperatorService.status(Long.parseLong(operatorId));
return AjaxResult.success();
}
/**
* 获取运营商分页列表
*/
//@PreAuthorize(hasPermi = "system:operator:page")
@GetMapping("/list")
public AjaxResult list(String name, String contactName, String contactPhone, String createTimeStart, String createTimeEnd) {
List<Map<String, Object>> list = iXhpcOperatorService.selectOperatorList(name, contactName, contactPhone, createTimeStart, createTimeEnd);
return AjaxResult.success(list);
}
}

View File

@ -130,12 +130,5 @@ public interface XhpcUserMapper {
*/
public int checkUserNameUnique(String userName);
/**
* 修改用户信息
*
* @param user 用户信息
* @return 结果
*/
public int updateUser(SysUser user);
}

View File

@ -59,13 +59,15 @@ public class XhpcInternetUserServiceImpl implements IXhpcInternetUserService {
@Override
public void deleteByIds(String[] ids) {
for (String id : ids) {
SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(Long.parseLong(id));
// 删除用户与角色关联
xhpcOperatorMapper.deleteUserRoleByUserId(sysUser.getUserId());
// 删除用户与岗位表
xhpcOperatorMapper.deleteUserPostByUserId(sysUser.getUserId());
sysUser.setDelFlag(String.valueOf(UserConstants.DEL_FLAG));
xhpcOperatorMapper.deleteUserById(sysUser);
SysUser sysUser = xhpcInternetUserMapper.getUserByInternetUserId(Long.parseLong(id));
if (null != sysUser) {
// 删除用户与角色关联
xhpcOperatorMapper.deleteUserRoleByUserId(sysUser.getUserId());
// 删除用户与岗位表
xhpcOperatorMapper.deleteUserPostByUserId(sysUser.getUserId());
sysUser.setDelFlag(String.valueOf(UserConstants.DEL_FLAG));
xhpcOperatorMapper.deleteUserById(sysUser);
}
}
xhpcInternetUserMapper.deleteByIds(ids);
}
@ -103,12 +105,14 @@ public class XhpcInternetUserServiceImpl implements IXhpcInternetUserService {
@Override
public void status(Long internetUserId) {
SysUser sysUser = xhpcInternetUserMapper.getUserByInternetUserId(internetUserId);
sysUser.setStatus(String.valueOf(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL));
xhpcUserMapper.update(sysUser);
XhpcInternetUser xhpcInternetUser = new XhpcInternetUser();
xhpcInternetUser.setInternetUserId(internetUserId);
xhpcInternetUser.setStatus(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL);
update(xhpcInternetUser);
if (null != sysUser) {
sysUser.setStatus(String.valueOf(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL));
xhpcUserMapper.update(sysUser);
XhpcInternetUser xhpcInternetUser = new XhpcInternetUser();
xhpcInternetUser.setInternetUserId(internetUserId);
xhpcInternetUser.setStatus(Integer.parseInt(sysUser.getStatus()));
update(xhpcInternetUser);
}
}
/**

View File

@ -9,6 +9,7 @@ import com.xhpc.user.service.IXhpcStationInternetBlacklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -58,6 +59,7 @@ public class XhpcStationInternetBlacklistServiceImpl implements IXhpcStationInte
@Override
public List<Map<String, Object>> list(String internetUserId) {
List<Map<String, Object>> list = xhpcOperatorMapper.getOperatorId();
List<Map<String, Object>> xhpcOperatorList = new ArrayList<>();
if (null != list && list.size() > 0) {
List<Map<String, Object>> blacklist = xhpcStationInternetBlacklistMapper.list(Long.parseLong(internetUserId));
boolean bool = false;
@ -81,9 +83,10 @@ public class XhpcStationInternetBlacklistServiceImpl implements IXhpcStationInte
}
}
map.put("listXhpcChargingStation", listXhpcChargingStation);
xhpcOperatorList.add(map);
}
}
}
return list;
return xhpcOperatorList;
}
}

View File

@ -199,6 +199,6 @@ public class XhpcUserServiceImpl implements IXhpcUserService {
@Override
@Transactional
public int updateUser(SysUser user) {
return xhpcUserMapper.updateUser(user);
return xhpcUserMapper.update(user);
}
}

View File

@ -134,10 +134,10 @@
<if test="null != phone and '' != phone">phone = #{phone},</if>
<if test="null != weixinOpenId and '' != weixinOpenId">weixin_open_id = #{weixinOpenId},</if>
<if test="null != alipayOpenId and '' != alipayOpenId">alipay_open_id = #{alipayOpenId},</if>
<if test="null != weixinLogin and ''">weixin_login = #{weixinLogin},</if>
<if test="null != alipayLogin and ''">alipay_login = #{alipayLogin},</if>
<if test="null != weixinLogin ">weixin_login = #{weixinLogin},</if>
<if test="null != alipayLogin ">alipay_login = #{alipayLogin},</if>
<if test="null != avatar and '' != avatar">avatar = #{avatar},</if>
<if test="null != balance and '' != balance">balance = #{balance},</if>
<if test="null != balance ">balance = #{balance},</if>
<if test="null != password and '' != password">password = #{password},</if>
<if test="null != status">status = #{status},</if>
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>

View File

@ -195,11 +195,11 @@
<if test="null != cooperationEndTime">cooperation_end_time =
#{cooperationEndTime},
</if>
<if test="null != balance and '' != balance">balance = #{balance},</if>
<if test="null != balance ">balance = #{balance},</if>
<if test="null != areaCode and '' != areaCode">area_code = #{areaCode},</if>
<if test="null != address and '' != address">address = #{address},</if>
<if test="null != detailedAddress and '' != detailedAddress">detailed_address = #{detailedAddress},</if>
<if test="null != commissionType and ''">commission_type = #{commissionType},</if>
<if test="null != commissionType ">commission_type = #{commissionType},</if>
<if test="null != commissionRate and '' != commissionRate">commission_rate = #{commissionRate},</if>
<if test="null != longitude and '' != longitude">longitude = #{longitude},</if>
<if test="null != latitude and '' != latitude">latitude = #{latitude},</if>
@ -265,12 +265,33 @@
<if test="createTimeEnd != null and createTimeEnd != ''"><!-- 结束时间检索 -->
AND xiu.create_time &lt;= #{createTimeEnd}
</if>
ORDER BY xiu.update_time DESC
ORDER BY xiu.create_time DESC
</select>
<select id="getUserByInternetUserId" parameterType="java.lang.Long"
resultType="com.xhpc.system.api.domain.SysUser">
select *
select user_id userId,
dept_id deptid,
user_name userName,
nick_name nickName,
user_type userType,
email,
phonenumber,
operator_id operatorId,
internet_user_id internetUserId,
sex,
avatar,
password,
data_power_type dataPowerType,
status,
del_flag delFlag,
login_ip loginIp,
login_date loginDate,
create_by createBy,
create_time createTime,
update_by updateBy,
update_time updateTime,
remark
from sys_user
where del_flag = 0
and internet_user_id = #{internetUserId}

View File

@ -226,7 +226,7 @@
<if test="null != contactName and '' != contactName">contact_name = #{contactName},</if>
<if test="null != contactPhone and '' != contactPhone">contact_phone = #{contactPhone},</if>
<if test="null != phone and '' != phone">phone = #{phone},</if>
<if test="null != attribute and '' != attribute">attribute = #{attribute},</if>
<if test="null != attribute ">attribute = #{attribute},</if>
<if test="null != openBank and '' != openBank">open_bank = #{openBank},</if>
<if test="null != cardNumber">card_number = #{cardNumber},</if>
<if test="null != areaCode and '' != areaCode">area_code = #{areaCode},</if>

View File

@ -90,7 +90,7 @@
<select id="getXhpcChargingStation" parameterType="java.lang.Long" resultType="java.util.Map">
select
charging_station_id chargingStationId, `name `,operator_id operatorId
charging_station_id chargingStationId, `name`,operator_id operatorId
from xhpc_charging_station
WHERE del_flag = 0
<if test="operatorId != null and operatorId != ''">

View File

@ -42,7 +42,7 @@
<if test="null != sex and '' != sex">sex = #{sex},</if>
<if test="null != avatar and '' != avatar">avatar = #{avatar},</if>
<if test="null != password and '' != password">password = #{password},</if>
<if test="null != dataPowerType and '' != dataPowerType">data_power_type = #{dataPowerType},</if>
<if test="null != dataPowerType ">data_power_type = #{dataPowerType},</if>
<if test="null != status">status = #{status},</if>
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
<if test="null != loginIp and '' != loginIp">login_ip = #{loginIp},</if>
@ -88,7 +88,7 @@
<select id="pcInfo" parameterType="java.lang.Long" resultType="java.util.Map">
select su.user_id userId,su.user_name userName,
su.nick_name nickName, su.email,su.status,
su.nick_name nickName, su.email,su.status,su.avatar,
su.create_by createBy ,su.create_time createTime,su.`status` ,
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName,
sdd.dict_label sexName
@ -120,7 +120,7 @@
<select id="operatorInfo" parameterType="java.lang.Long" resultType="java.util.Map">
select su.user_id userId,su.user_name userName,
su.nick_name nickName, su.email,su.sex,
su.nick_name nickName, su.email,su.sex,su.avatar,
su.create_by createBy ,su.create_time createTime,xo.operator_id operatorId,
xo.`name` operatorName,su.`status` ,
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName,
@ -238,7 +238,7 @@
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="userTpe != null and userTpe != ''">user_type,</if>
<if test="userType != null and userType != ''">user_type,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
@ -256,7 +256,7 @@
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="userTpe != null and userTpe != ''">#{userTpe},</if>
<if test="userType != null and userType != ''">#{userType},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>
@ -273,30 +273,6 @@
)
</insert>
<update id="updateUser" parameterType="com.xhpc.system.api.domain.SysUser">
update sys_user
<set>
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
<if test="email != null ">email = #{email},</if>
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
<if test="operatorId != null and operatorId != ''">operator_id = #{operatorId},</if>
<if test="internetUserId != null and internetUserId != ''">internet_user_id = #{internetUserId},</if>
<if test="dataPowerType != null and dataPowerType != ''">data_power_type = #{dataPowerType},</if>
<if test="sex != null and sex != ''">sex = #{sex},</if>
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
<if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
update_time = sysdate()
</set>
where user_id = #{userId}
</update>
<insert id="batchUserRole">
insert into sys_user_role(user_id, role_id) values
<foreach item="item" index="index" collection="list" separator=",">