1修改nacos本的连接
2将判断状态类型值设置常量 3修改错误返回时code码
This commit is contained in:
parent
0f8a2fa234
commit
b93671cece
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -86,4 +86,31 @@ public class HttpStatus
|
|||||||
* 接口未实现
|
* 接口未实现
|
||||||
*/
|
*/
|
||||||
public static final int NOT_IMPLEMENTED = 501;
|
public static final int NOT_IMPLEMENTED = 501;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不能为空
|
||||||
|
*/
|
||||||
|
public static final Integer NOT_NULL = 1006;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已经存在
|
||||||
|
*/
|
||||||
|
public static final Integer ALREADY_EXISTING = 1007;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户未登录
|
||||||
|
*/
|
||||||
|
public static final Integer USER_LOGIN = 1008;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据不存在
|
||||||
|
*/
|
||||||
|
public static final Integer DATA_ERROR = 1009;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条件错误
|
||||||
|
*/
|
||||||
|
public static final Integer ERROR_STATUS = 1010;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,165 @@
|
|||||||
|
package com.xhpc.common.core.constant;
|
||||||
|
|
||||||
|
public class StatusConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信操作渠道
|
||||||
|
*/
|
||||||
|
public static final String OPERATION_WX_TYPE = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝操作渠道
|
||||||
|
*/
|
||||||
|
public static final String OPERATION_ALI_PAY_TYPE = "2";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未进入黑名单
|
||||||
|
*/
|
||||||
|
public static final Integer IS_BLACK = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进如黑名单
|
||||||
|
*/
|
||||||
|
public static final Integer BLACK = 1;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统用户类型
|
||||||
|
*/
|
||||||
|
public static final String SYSTEM_USER_TYPE = "00";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商用户类型
|
||||||
|
*/
|
||||||
|
public static final String OPERATION_USER_TYPE = "01";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量用户类型
|
||||||
|
*/
|
||||||
|
public static final String INTERNET_USER_TYPE = "02";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商子账号用户类型
|
||||||
|
*/
|
||||||
|
public static final String OPERATION_SON_USER_TYPE = "03";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全部权限类型
|
||||||
|
*/
|
||||||
|
public static final Integer ALL_POWER_TYPE = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运营商权限类型
|
||||||
|
*/
|
||||||
|
public static final Integer OPERATION_POWER_TYPE = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子账号权限类型
|
||||||
|
*/
|
||||||
|
public static final Integer SON_POWER_TYPE = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流量账号权限类型
|
||||||
|
*/
|
||||||
|
public static final Integer INTERNET_POWER_TYPE = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期时间半个小时
|
||||||
|
*/
|
||||||
|
public static final Integer EXPIRE_TIME = 5 * 60 * 1000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0待支付 1充值成功,2充值失败)
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单状态待支付
|
||||||
|
*/
|
||||||
|
public static final Integer RECHARGE_ORDER_STATUS_WAIT = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单状态充值成功
|
||||||
|
*/
|
||||||
|
public static final Integer RECHARGE_ORDER_STATUS_SUCCESS = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单状态充值失败
|
||||||
|
*/
|
||||||
|
public static final Integer RECHARGE_ORDER_STATUS_ERROR = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款订单状态退款中
|
||||||
|
*/
|
||||||
|
public static final Integer REFUND_ORDER_STATUS_WAIT = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款订单状态成功
|
||||||
|
*/
|
||||||
|
public static final Integer REFUND_ORDER_STATUS_SUCCESS = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款订单状态失败
|
||||||
|
*/
|
||||||
|
public static final Integer REFUND_ORDER_STATUS_ERROR = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流水类型充值
|
||||||
|
*/
|
||||||
|
public static final Integer FLOWING_WATER_RECHARGE = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流水类型退款
|
||||||
|
*/
|
||||||
|
public static final Integer FLOWING_WATER_REFUND = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流水类型充电
|
||||||
|
*/
|
||||||
|
public static final Integer FLOWING_WATER_CHARGE = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对账状态待确认
|
||||||
|
*/
|
||||||
|
public static final Integer RECONCILIATION_STATUS_WAIT = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对账状态已确认
|
||||||
|
*/
|
||||||
|
public static final Integer RECONCILIATION_STATUS_CONFIRMED = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对账状态待提交
|
||||||
|
*/
|
||||||
|
public static final Integer RECONCILIATION_STATUS_SUBMITTRD = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对账状态待审核
|
||||||
|
*/
|
||||||
|
public static final Integer RECONCILIATION_STATUS_EXAMINE = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清分状态待清分
|
||||||
|
*/
|
||||||
|
public static final Integer SORTING_STATUS_WAIT = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清分状态已确认
|
||||||
|
*/
|
||||||
|
public static final Integer SORTING_STATUS_CONFIRMED = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清分状态已提现
|
||||||
|
*/
|
||||||
|
public static final Integer SORTING_STATUS_WITHDRAWAL = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清分状态待提交
|
||||||
|
*/
|
||||||
|
public static final Integer SORTING_STATUS_SUBMITTRD = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清分状态待审核
|
||||||
|
*/
|
||||||
|
public static final Integer SORTING_STATUS_EXAMINE = 4;
|
||||||
|
}
|
||||||
@ -13,10 +13,10 @@ public class UserConstants
|
|||||||
public static final String SYS_USER = "SYS_USER";
|
public static final String SYS_USER = "SYS_USER";
|
||||||
|
|
||||||
/** 正常状态 */
|
/** 正常状态 */
|
||||||
public static final String NORMAL = "0";
|
public static final Integer NORMAL = 0;
|
||||||
|
|
||||||
/** 异常状态 */
|
/** 异常状态 */
|
||||||
public static final String EXCEPTION = "1";
|
public static final Integer EXCEPTION = 1;
|
||||||
|
|
||||||
/** 用户封禁状态 */
|
/** 用户封禁状态 */
|
||||||
public static final String USER_DISABLE = "1";
|
public static final String USER_DISABLE = "1";
|
||||||
@ -75,4 +75,20 @@ public class UserConstants
|
|||||||
public static final int PASSWORD_MIN_LENGTH = 5;
|
public static final int PASSWORD_MIN_LENGTH = 5;
|
||||||
|
|
||||||
public static final int PASSWORD_MAX_LENGTH = 20;
|
public static final int PASSWORD_MAX_LENGTH = 20;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录状态
|
||||||
|
*/
|
||||||
|
public static final Integer LOGIN = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未登录状态
|
||||||
|
*/
|
||||||
|
public static final Integer NO_LOGIN = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除状态
|
||||||
|
*/
|
||||||
|
public static final Integer DEL_FLAG = 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.xhpc.common.core.constant;
|
|||||||
import org.apache.http.client.HttpClient;
|
import org.apache.http.client.HttpClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 常量
|
* 微信支付常量
|
||||||
*/
|
*/
|
||||||
public class WXPayConstants {
|
public class WXPayConstants {
|
||||||
|
|
||||||
|
|||||||
@ -16,10 +16,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
@ -35,7 +35,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
dataId: sentinel-ruoyi-gateway
|
dataId: sentinel-ruoyi-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -14,10 +14,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.xhpc.general.mapper.XhpcDictBizMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.xhpc.common.domain.XhpcDictBiz">
|
||||||
|
<result property="dictBizId" column="dict_biz_id"/>
|
||||||
|
<result property="parentId" column="parent_id"/>
|
||||||
|
<result property="code" column="code"/>
|
||||||
|
<result property="dictKey" column="dict_key"/>
|
||||||
|
<result property="dictValue" column="dict_value"/>
|
||||||
|
<result property="sort" column="sort"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
</resultMap>
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
|
||||||
|
<select id="getCode" resultMap="BaseResultMap">
|
||||||
|
select code, dict_key, dict_value, sort, remark from xhpc_dict_biz where code = #{code} and parent_id > 0 and del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.order.controller;
|
package com.xhpc.order.controller;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.common.core.web.controller.BaseController;
|
import com.xhpc.common.core.web.controller.BaseController;
|
||||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||||
@ -22,16 +23,21 @@ public class XhpcHistoryOrderReconciliationStatusController extends BaseControll
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改对账状态
|
* 修改对账状态
|
||||||
*
|
|
||||||
* @param historyOrderIds
|
|
||||||
* @param status
|
|
||||||
* @param remark
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/status")
|
@PostMapping("/status")
|
||||||
@ApiOperation(value = "修改对账状态")
|
@ApiOperation(value = "修改对账状态")
|
||||||
public AjaxResult status(@RequestParam String historyOrderIds, @RequestParam Integer status, @RequestParam String remark) {
|
public AjaxResult status(@RequestBody Map<String, Object> map) {
|
||||||
return iXhpcHistoryOrderReconciliationStatusService.status(historyOrderIds, status, remark);
|
String historyOrderIds = StringUtils.valueOf(map.get("historyOrderIds"));
|
||||||
|
if (StringUtils.isEmpty(historyOrderIds)) {
|
||||||
|
AjaxResult.error("历史订单信息不能为空");
|
||||||
|
}
|
||||||
|
String status = StringUtils.valueOf(map.get("status"));
|
||||||
|
if (StringUtils.isEmpty(status)) {
|
||||||
|
AjaxResult.error("状态不能为空");
|
||||||
|
}
|
||||||
|
String remark = StringUtils.valueOf(map.get("remark"));
|
||||||
|
return iXhpcHistoryOrderReconciliationStatusService.status(historyOrderIds, Integer.parseInt(status), remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.xhpc.order.controller;
|
package com.xhpc.order.controller;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.common.core.web.controller.BaseController;
|
import com.xhpc.common.core.web.controller.BaseController;
|
||||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||||
import com.xhpc.common.core.web.page.TableDataInfo;
|
import com.xhpc.common.core.web.page.TableDataInfo;
|
||||||
@ -23,16 +25,21 @@ public class XhpcHistoryOrderSortingStatusController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改清分状态
|
* 修改清分状态
|
||||||
*
|
|
||||||
* @param historyOrderIds
|
|
||||||
* @param status
|
|
||||||
* @param remark
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/status")
|
@PostMapping("/status")
|
||||||
@ApiOperation(value = "修改清分状态")
|
@ApiOperation(value = "修改清分状态")
|
||||||
public AjaxResult status(@RequestParam String historyOrderIds, @RequestParam Integer status, @RequestParam String remark) {
|
public AjaxResult status(@RequestBody Map<String, Object> map) {
|
||||||
return iXhpcHistoryOrderSortingStatusService.status(historyOrderIds, status, remark);
|
String historyOrderIds = StringUtils.valueOf(map.get("historyOrderIds"));
|
||||||
|
if (StringUtils.isEmpty(historyOrderIds)) {
|
||||||
|
AjaxResult.error(HttpStatus.NOT_NULL, "历史订单信息不能为空");
|
||||||
|
}
|
||||||
|
String status = StringUtils.valueOf(map.get("status"));
|
||||||
|
if (StringUtils.isEmpty(status)) {
|
||||||
|
AjaxResult.error(HttpStatus.NOT_NULL, "状态不能为空");
|
||||||
|
}
|
||||||
|
String remark = StringUtils.valueOf(map.get("remark"));
|
||||||
|
return iXhpcHistoryOrderSortingStatusService.status(historyOrderIds, Integer.parseInt(status), remark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.xhpc.order.service.impl;
|
package com.xhpc.order.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||||
import com.xhpc.common.redis.service.RedisService;
|
import com.xhpc.common.redis.service.RedisService;
|
||||||
@ -53,21 +55,21 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis
|
|||||||
public AjaxResult status(String historyOrderIds, Integer status, String remark) {
|
public AjaxResult status(String historyOrderIds, Integer status, String remark) {
|
||||||
for (String historyOrderId : historyOrderIds.split(",")) {
|
for (String historyOrderId : historyOrderIds.split(",")) {
|
||||||
XhpcHistoryOrder xhpcHistoryOrder = xhpcHistoryOrderMapper.info(Long.parseLong(historyOrderId));
|
XhpcHistoryOrder xhpcHistoryOrder = xhpcHistoryOrderMapper.info(Long.parseLong(historyOrderId));
|
||||||
if ("0".equals(status)) {
|
if (StatusConstants.RECONCILIATION_STATUS_WAIT == status) {
|
||||||
if (3 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.RECONCILIATION_STATUS_EXAMINE != xhpcHistoryOrder.getReconciliationStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
} else if ("1".equals(status)) {
|
} else if (StatusConstants.RECONCILIATION_STATUS_CONFIRMED == status) {
|
||||||
if (0 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.RECONCILIATION_STATUS_WAIT != xhpcHistoryOrder.getReconciliationStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
} else if ("2".equals(status)) {
|
} else if (StatusConstants.RECONCILIATION_STATUS_SUBMITTRD == status) {
|
||||||
if (0 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.RECONCILIATION_STATUS_WAIT != xhpcHistoryOrder.getReconciliationStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
} else if ("3".equals(status)) {
|
} else if (StatusConstants.RECONCILIATION_STATUS_EXAMINE == status) {
|
||||||
if (2 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.RECONCILIATION_STATUS_SUBMITTRD != xhpcHistoryOrder.getReconciliationStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XhpcHistoryOrderReconciliationStatus xhpcHistoryOrderReconciliationStatus = new XhpcHistoryOrderReconciliationStatus();
|
XhpcHistoryOrderReconciliationStatus xhpcHistoryOrderReconciliationStatus = new XhpcHistoryOrderReconciliationStatus();
|
||||||
@ -91,10 +93,10 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis
|
|||||||
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
||||||
if (StringUtils.isNotNull(map)) {
|
if (StringUtils.isNotNull(map)) {
|
||||||
String privilege = StringUtils.valueOf(map.get("privilege"));
|
String privilege = StringUtils.valueOf(map.get("privilege"));
|
||||||
if ("1".equals(privilege)) {
|
if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
||||||
return AjaxResult.success(xhpcHistoryOrderReconciliationStatusMapper.internetUser(userId, operatorId, null));
|
return AjaxResult.success(xhpcHistoryOrderReconciliationStatusMapper.internetUser(userId, operatorId, null));
|
||||||
} else if ("2".equals(privilege)) {
|
} else if (StatusConstants.SON_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
return AjaxResult.success(xhpcHistoryOrderReconciliationStatusMapper.internetUser(userId, null, "privilege"));
|
return AjaxResult.success(xhpcHistoryOrderReconciliationStatusMapper.internetUser(userId, null, "privilege"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,10 +120,10 @@ public class XhpcHistoryOrderReconciliationStatusServiceImpl implements IXhpcHis
|
|||||||
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
||||||
if (StringUtils.isNotNull(map)) {
|
if (StringUtils.isNotNull(map)) {
|
||||||
String privilege = StringUtils.valueOf(map.get("privilege"));
|
String privilege = StringUtils.valueOf(map.get("privilege"));
|
||||||
if ("1".equals(privilege)) {
|
if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
||||||
return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null);
|
return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null);
|
||||||
} else if ("2".equals(privilege)) {
|
} else if (StatusConstants.SON_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, "privilege");
|
return xhpcHistoryOrderReconciliationStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, "privilege");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.xhpc.order.service.impl;
|
package com.xhpc.order.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||||
import com.xhpc.common.redis.service.RedisService;
|
import com.xhpc.common.redis.service.RedisService;
|
||||||
@ -53,21 +55,21 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd
|
|||||||
public AjaxResult status(String historyOrderIds, Integer status, String remark) {
|
public AjaxResult status(String historyOrderIds, Integer status, String remark) {
|
||||||
for (String historyOrderId : historyOrderIds.split(",")) {
|
for (String historyOrderId : historyOrderIds.split(",")) {
|
||||||
XhpcHistoryOrder xhpcHistoryOrder = xhpcHistoryOrderMapper.info(Long.parseLong(historyOrderId));
|
XhpcHistoryOrder xhpcHistoryOrder = xhpcHistoryOrderMapper.info(Long.parseLong(historyOrderId));
|
||||||
if ("1".equals(status)) {
|
if (StatusConstants.SORTING_STATUS_CONFIRMED == status) {
|
||||||
if (4 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.SORTING_STATUS_EXAMINE != xhpcHistoryOrder.getSortingStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
} else if ("2".equals(status)) {
|
} else if (StatusConstants.SORTING_STATUS_WITHDRAWAL == status) {
|
||||||
if (1 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.SORTING_STATUS_CONFIRMED != xhpcHistoryOrder.getSortingStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
} else if ("3".equals(status)) {
|
} else if (StatusConstants.SORTING_STATUS_SUBMITTRD == status) {
|
||||||
if (1 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.SORTING_STATUS_CONFIRMED != xhpcHistoryOrder.getSortingStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
} else if ("4".equals(status)) {
|
} else if (StatusConstants.SORTING_STATUS_EXAMINE == status) {
|
||||||
if (3 != xhpcHistoryOrder.getReconciliationStatus()) {
|
if (StatusConstants.SORTING_STATUS_SUBMITTRD != xhpcHistoryOrder.getSortingStatus()) {
|
||||||
return AjaxResult.error("状态异常");
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "状态异常");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XhpcHistoryOrderSortingStatus xhpcHistoryOrderSortingStatus = new XhpcHistoryOrderSortingStatus();
|
XhpcHistoryOrderSortingStatus xhpcHistoryOrderSortingStatus = new XhpcHistoryOrderSortingStatus();
|
||||||
@ -91,10 +93,10 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd
|
|||||||
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
||||||
if (StringUtils.isNotNull(map)) {
|
if (StringUtils.isNotNull(map)) {
|
||||||
String privilege = StringUtils.valueOf(map.get("privilege"));
|
String privilege = StringUtils.valueOf(map.get("privilege"));
|
||||||
if ("1".equals(privilege)) {
|
if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
||||||
return AjaxResult.success(xhpcHistoryOrderSortingStatusMapper.operatorUser(userId, operatorId, null));
|
return AjaxResult.success(xhpcHistoryOrderSortingStatusMapper.operatorUser(userId, operatorId, null));
|
||||||
} else if ("2".equals(privilege)) {
|
} else if (StatusConstants.SON_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
return AjaxResult.success(xhpcHistoryOrderSortingStatusMapper.operatorUser(userId, null, "privilege"));
|
return AjaxResult.success(xhpcHistoryOrderSortingStatusMapper.operatorUser(userId, null, "privilege"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -119,10 +121,10 @@ public class XhpcHistoryOrderSortingStatusServiceImpl implements IXhpcHistoryOrd
|
|||||||
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
Map<String, Object> map = redisService.getCacheMap(userId + ":privilege");
|
||||||
if (StringUtils.isNotNull(map)) {
|
if (StringUtils.isNotNull(map)) {
|
||||||
String privilege = StringUtils.valueOf(map.get("privilege"));
|
String privilege = StringUtils.valueOf(map.get("privilege"));
|
||||||
if ("1".equals(privilege)) {
|
if (StatusConstants.OPERATION_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
||||||
return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null);
|
return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, operatorId, null);
|
||||||
} else if ("2".equals(privilege)) {
|
} else if (StatusConstants.SON_POWER_TYPE == Integer.parseInt(privilege)) {
|
||||||
return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, "privilege");
|
return xhpcHistoryOrderSortingStatusMapper.page(userId, serialNumber, createTimeStart, createTimeEnd, chargingStationName, status, null, "privilege");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,10 +18,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.xhpc.payment.controller;
|
package com.xhpc.payment.controller;
|
||||||
|
|
||||||
import com.xhpc.common.core.constant.HttpStatus;
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.listener.ConfigListener;
|
import com.xhpc.common.core.listener.ConfigListener;
|
||||||
import com.xhpc.common.core.utils.DateUtils;
|
import com.xhpc.common.core.utils.DateUtils;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
@ -72,23 +73,23 @@ public class WxPaymentController {
|
|||||||
public AjaxResult payment(HttpServletRequest servletRequest, @RequestBody Map<String, Object> map) throws Exception {
|
public AjaxResult payment(HttpServletRequest servletRequest, @RequestBody Map<String, Object> map) throws Exception {
|
||||||
String openid = StringUtils.valueOf(map.get("openid"));
|
String openid = StringUtils.valueOf(map.get("openid"));
|
||||||
if (StringUtils.isNull(openid)) {
|
if (StringUtils.isNull(openid)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "openid不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "openid不能为空");
|
||||||
}
|
}
|
||||||
//总金额(是)订单总金额,单位为分
|
//总金额(是)订单总金额,单位为分
|
||||||
String amount = StringUtils.valueOf(map.get("amount"));
|
String amount = StringUtils.valueOf(map.get("amount"));
|
||||||
if (StringUtils.isNull(amount)) {
|
if (StringUtils.isNull(amount)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "充值金额不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能为空");
|
||||||
}
|
}
|
||||||
//用户信息id
|
//用户信息id
|
||||||
String userId = StringUtils.valueOf(map.get("userId"));
|
String userId = StringUtils.valueOf(map.get("userId"));
|
||||||
if (StringUtils.isNull(userId)) {
|
if (StringUtils.isNull(userId)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "用户信息不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
|
||||||
}
|
}
|
||||||
Double amount1 = Double.parseDouble(amount) * 100;
|
Double amount1 = Double.parseDouble(amount) * 100;
|
||||||
String orderNumber = "wx" + DateUtils.timePath();
|
String orderNumber = "wx" + DateUtils.timePath();
|
||||||
|
|
||||||
if (0.0 == amount1) {
|
if (0.0 == amount1) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "充值金额不能为0");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能为0");
|
||||||
}
|
}
|
||||||
//生成充值订单
|
//生成充值订单
|
||||||
XhpcRechargeOrder xhpcRechargeOrder = iXhpcRechargeOrderService.addRechargeOrder(userId, BigDecimal.valueOf(Double.parseDouble(amount)), "1", orderNumber);
|
XhpcRechargeOrder xhpcRechargeOrder = iXhpcRechargeOrderService.addRechargeOrder(userId, BigDecimal.valueOf(Double.parseDouble(amount)), "1", orderNumber);
|
||||||
@ -107,7 +108,7 @@ public class WxPaymentController {
|
|||||||
//微信过期时间格式
|
//微信过期时间格式
|
||||||
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMddHHmmss");
|
SimpleDateFormat format1 = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||||
//过期时间半个小时
|
//过期时间半个小时
|
||||||
Date expireTime = new Date(date.getTime() + 5 * 60 * 1000);
|
Date expireTime = new Date(date.getTime() + StatusConstants.EXPIRE_TIME);
|
||||||
String timeStr = format1.format(expireTime);
|
String timeStr = format1.format(expireTime);
|
||||||
//发送请求
|
//发送请求
|
||||||
PrintWriter out = null;
|
PrintWriter out = null;
|
||||||
@ -340,16 +341,11 @@ public class WxPaymentController {
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void paymentCallback(String out_trade_no, String transaction_id) {
|
public void paymentCallback(String out_trade_no, String transaction_id) {
|
||||||
System.out.println("+++++++++进入回调+" + out_trade_no);
|
|
||||||
System.out.println("+++++++++进入回调+" + transaction_id);
|
|
||||||
int flag = 0;
|
|
||||||
//支付订单编号
|
//支付订单编号
|
||||||
XhpcRechargeOrder xhpcRechargeOrder = iXhpcRechargeOrderService.infoRechargeOrderNumber(out_trade_no);
|
XhpcRechargeOrder xhpcRechargeOrder = iXhpcRechargeOrderService.infoRechargeOrderNumber(out_trade_no);
|
||||||
if (StringUtils.isNotNull(xhpcRechargeOrder)) {
|
if (StringUtils.isNotNull(xhpcRechargeOrder)) {
|
||||||
xhpcRechargeOrder.setPrepayId(transaction_id);
|
|
||||||
xhpcRechargeOrder.setStatus(1);
|
|
||||||
//修改充值订单状态
|
//修改充值订单状态
|
||||||
iXhpcRechargeOrderService.updateRechargeOrder(xhpcRechargeOrder.getRechargeOrderId(), "1", "1", transaction_id);
|
iXhpcRechargeOrderService.updateRechargeOrder(xhpcRechargeOrder.getRechargeOrderId(), StatusConstants.OPERATION_WX_TYPE, StatusConstants.RECHARGE_ORDER_STATUS_SUCCESS, transaction_id);
|
||||||
}
|
}
|
||||||
Map<String, Object> appUserInfo = xhpcUserAccountStatementMapper.appUserInfo(xhpcRechargeOrder.getUserId());
|
Map<String, Object> appUserInfo = xhpcUserAccountStatementMapper.appUserInfo(xhpcRechargeOrder.getUserId());
|
||||||
if (StringUtils.isNotNull(appUserInfo)) {
|
if (StringUtils.isNotNull(appUserInfo)) {
|
||||||
@ -432,16 +428,26 @@ public class WxPaymentController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/enterpriseCheckOut")
|
@PostMapping("/enterpriseCheckOut")
|
||||||
@ApiOperation(value = "企业退款")
|
@ApiOperation(value = "企业退款")
|
||||||
public Object enterpriseCheckOut(@RequestBody Map<String, Object> map) {
|
public synchronized Object enterpriseCheckOut(@RequestBody Map<String, Object> map) {
|
||||||
//用户信息id
|
//用户信息id
|
||||||
String refundOrderId = StringUtils.valueOf(map.get("refundOrderId"));
|
String refundOrderId = StringUtils.valueOf(map.get("refundOrderId"));
|
||||||
if (StringUtils.isNull(refundOrderId)) {
|
if (StringUtils.isNull(refundOrderId)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "订单信息不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "订单信息不能为空");
|
||||||
}
|
}
|
||||||
Map<String, Object> xhpcRefundOrder = iXhpcRefundOrderService.info(Long.parseLong(refundOrderId));
|
Map<String, Object> xhpcRefundOrder = iXhpcRefundOrderService.info(Long.parseLong(refundOrderId));
|
||||||
if (StringUtils.isNull(xhpcRefundOrder)) {
|
if (StringUtils.isNull(xhpcRefundOrder)) {
|
||||||
return AjaxResult.error("订单不存在");
|
return AjaxResult.error(HttpStatus.DATA_ERROR, "订单不存在");
|
||||||
}
|
}
|
||||||
|
String examineStatus = StringUtils.valueOf(xhpcRefundOrder.get("examineStatus"));
|
||||||
|
if ("1".equals(examineStatus)) {
|
||||||
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单状态不能退款");
|
||||||
|
}
|
||||||
|
|
||||||
|
String status = StringUtils.valueOf(xhpcRefundOrder.get("status"));
|
||||||
|
if ("0".equals(status)) {
|
||||||
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单状态不能退款");
|
||||||
|
}
|
||||||
|
|
||||||
CloseableHttpClient httpClient = null;
|
CloseableHttpClient httpClient = null;
|
||||||
try {
|
try {
|
||||||
//证书的地址
|
//证书的地址
|
||||||
@ -458,9 +464,19 @@ public class WxPaymentController {
|
|||||||
Double value = amount * 100;
|
Double value = amount * 100;
|
||||||
Integer refund_fee = value.intValue();
|
Integer refund_fee = value.intValue();
|
||||||
if (refund_fee <= 0) {
|
if (refund_fee <= 0) {
|
||||||
return "订单金额出错";
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单金额出错");
|
||||||
}
|
}
|
||||||
|
String userId = StringUtils.valueOf(map.get("userId"));
|
||||||
|
Map<String, Object> appUserInfo = xhpcUserAccountStatementMapper.appUserInfo(Long.parseLong(userId));
|
||||||
|
String balance = StringUtils.valueOf(appUserInfo.get("balance"));
|
||||||
|
|
||||||
|
if (StringUtils.isNotNull(appUserInfo)) {
|
||||||
|
return AjaxResult.error(HttpStatus.DATA_ERROR, "用户不存在");
|
||||||
|
}
|
||||||
|
BigDecimal surplus = BigDecimal.valueOf(Double.valueOf(balance)).subtract(BigDecimal.valueOf(amount));
|
||||||
|
if (surplus.compareTo(BigDecimal.ZERO) == -1) {
|
||||||
|
return AjaxResult.error(HttpStatus.ERROR_STATUS, "余额不足");
|
||||||
|
}
|
||||||
String result = "";
|
String result = "";
|
||||||
HttpPost httpPost = new HttpPost(environment.getProperty("WXTRANSFERS"));
|
HttpPost httpPost = new HttpPost(environment.getProperty("WXTRANSFERS"));
|
||||||
StringEntity postEntity = new StringEntity(creatXMLParam(orderOutNumber, refund_fee.toString(), "退款申请", openId), "UTF-8");
|
StringEntity postEntity = new StringEntity(creatXMLParam(orderOutNumber, refund_fee.toString(), "退款申请", openId), "UTF-8");
|
||||||
@ -482,7 +498,7 @@ public class WxPaymentController {
|
|||||||
} finally {
|
} finally {
|
||||||
httpPost.abort();
|
httpPost.abort();
|
||||||
}
|
}
|
||||||
return parseXml(result, Long.parseLong(refundOrderId), amount);
|
return parseXml(result, Long.parseLong(refundOrderId), surplus, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -568,16 +584,21 @@ public class WxPaymentController {
|
|||||||
* @param result 请求后的结果
|
* @param result 请求后的结果
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private AjaxResult parseXml(String result, Long id, Double amount) {
|
private AjaxResult parseXml(String result, Long id, BigDecimal amount, String userId) {
|
||||||
try {
|
try {
|
||||||
Map<String, String> map = WXPayUtil.xmlToMap(result);
|
Map<String, String> map = WXPayUtil.xmlToMap(result);
|
||||||
String return_code = map.get("return_code");
|
String result_code = map.get("result_code");
|
||||||
if ("FAIL".equals(return_code)) {
|
if ("FAIL".equals(result_code)) {
|
||||||
return AjaxResult.error(map.get("return_msg"));
|
return AjaxResult.error(map.get("err_code_des"));
|
||||||
} else {
|
} else {
|
||||||
//退款成功修改订单
|
//退款成功修改订单
|
||||||
iXhpcRefundOrderService.updateRefundOrder(id, "1", "1");
|
iXhpcRefundOrderService.updateRefundOrder(id, StatusConstants.OPERATION_WX_TYPE, StatusConstants.REFUND_ORDER_STATUS_SUCCESS);
|
||||||
return AjaxResult.success(map);
|
//减少用户余额
|
||||||
|
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
||||||
|
xhpcAppUser.setAppUserId(Long.parseLong(userId));
|
||||||
|
xhpcAppUser.setBalance(amount);
|
||||||
|
xhpcUserAccountStatementMapper.updateAppUserBalance(xhpcAppUser);
|
||||||
|
return AjaxResult.success("退款成功");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
AjaxResult.error(e.getMessage());
|
AjaxResult.error(e.getMessage());
|
||||||
|
|||||||
@ -25,30 +25,30 @@ public class XhpcRefundOrderController extends BaseController {
|
|||||||
private IXhpcRefundOrderService iXhpcRefundOrderService;
|
private IXhpcRefundOrderService iXhpcRefundOrderService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款
|
* 申请退款
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkOut")
|
@PostMapping("/checkOut")
|
||||||
@ApiOperation(value = "退款")
|
@ApiOperation(value = "申请退款")
|
||||||
public AjaxResult enterpriseCheckOut(@RequestBody Map<String, Object> map) {
|
public AjaxResult enterpriseCheckOut(@RequestBody Map<String, Object> map) {
|
||||||
String amount = StringUtils.valueOf(map.get("amount"));
|
String amount = StringUtils.valueOf(map.get("amount"));
|
||||||
if (StringUtils.isNull(amount)) {
|
if (StringUtils.isNull(amount)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "充值金额不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "充值金额不能为空");
|
||||||
}
|
}
|
||||||
//用户信息id
|
//用户信息id
|
||||||
String userId = StringUtils.valueOf(map.get("userId"));
|
String userId = StringUtils.valueOf(map.get("userId"));
|
||||||
if (StringUtils.isNull(userId)) {
|
if (StringUtils.isNull(userId)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "用户信息不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
|
||||||
}
|
}
|
||||||
//openid
|
//openid
|
||||||
String openid = StringUtils.valueOf(map.get("openid"));
|
String openid = StringUtils.valueOf(map.get("openid"));
|
||||||
if (StringUtils.isNull(userId)) {
|
if (StringUtils.isNull(userId)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "用户信息不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
|
||||||
}
|
}
|
||||||
String type = StringUtils.valueOf(map.get("type"));
|
String type = StringUtils.valueOf(map.get("type"));
|
||||||
if (StringUtils.isNull(type)) {
|
if (StringUtils.isNull(type)) {
|
||||||
return AjaxResult.error(HttpStatus.BAD_REQUEST, "退款渠道不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "退款渠道不能为空");
|
||||||
}
|
}
|
||||||
//生成退款订单
|
//生成退款订单
|
||||||
String orderOutNumber = "wxOut" + DateUtils.timePath();
|
String orderOutNumber = "wxOut" + DateUtils.timePath();
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public interface IXhpcRechargeOrderService {
|
|||||||
* @param type 充值渠道(1微信 2支付宝)
|
* @param type 充值渠道(1微信 2支付宝)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void updateRechargeOrder(Long rechargeOrderId, String type, String status, String paymentNumber);
|
public void updateRechargeOrder(Long rechargeOrderId, String type, Integer status, String paymentNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值订单详情
|
* 充值订单详情
|
||||||
|
|||||||
@ -58,5 +58,5 @@ public interface IXhpcRefundOrderService {
|
|||||||
* @param type 退款渠道(1微信 2支付宝)
|
* @param type 退款渠道(1微信 2支付宝)
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public void updateRefundOrder(Long refundOrderId, String type, String status);
|
public void updateRefundOrder(Long refundOrderId, String type, Integer status);
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.payment.service.impl;
|
package com.xhpc.payment.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.payment.domain.XhpcRechargeOrder;
|
import com.xhpc.payment.domain.XhpcRechargeOrder;
|
||||||
import com.xhpc.payment.mapper.XhpcRechargeOrderMapper;
|
import com.xhpc.payment.mapper.XhpcRechargeOrderMapper;
|
||||||
@ -90,16 +91,16 @@ public class XhpcRechargeOrderServiceImpl implements IXhpcRechargeOrderService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateRechargeOrder(Long rechargeOrderId, String type, String status, String paymentNumber) {
|
public void updateRechargeOrder(Long rechargeOrderId, String type, Integer status, String paymentNumber) {
|
||||||
XhpcRechargeOrder xhpcRechargeOrder = new XhpcRechargeOrder();
|
XhpcRechargeOrder xhpcRechargeOrder = new XhpcRechargeOrder();
|
||||||
xhpcRechargeOrder.setRechargeOrderId(rechargeOrderId);
|
xhpcRechargeOrder.setRechargeOrderId(rechargeOrderId);
|
||||||
xhpcRechargeOrder.setStatus(Integer.parseInt(status));
|
xhpcRechargeOrder.setStatus(status);
|
||||||
if ("1".equals(type)) {
|
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
|
||||||
xhpcRechargeOrder.setPrepayId(paymentNumber);
|
xhpcRechargeOrder.setPrepayId(paymentNumber);
|
||||||
} else {
|
} else {
|
||||||
xhpcRechargeOrder.setAlipayNumber(paymentNumber);
|
xhpcRechargeOrder.setAlipayNumber(paymentNumber);
|
||||||
}
|
}
|
||||||
if (1 == xhpcRechargeOrder.getStatus()) {
|
if (StatusConstants.RECHARGE_ORDER_STATUS_SUCCESS == xhpcRechargeOrder.getStatus()) {
|
||||||
Map<String, Object> map = xhpcRechargeOrderMapper.info(rechargeOrderId);
|
Map<String, Object> map = xhpcRechargeOrderMapper.info(rechargeOrderId);
|
||||||
String amount = StringUtils.valueOf(map.get("amount"));
|
String amount = StringUtils.valueOf(map.get("amount"));
|
||||||
String userId = StringUtils.valueOf(map.get("userId"));
|
String userId = StringUtils.valueOf(map.get("userId"));
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.payment.service.impl;
|
package com.xhpc.payment.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.payment.domain.XhpcRefundAudit;
|
import com.xhpc.payment.domain.XhpcRefundAudit;
|
||||||
import com.xhpc.payment.domain.XhpcRefundOrder;
|
import com.xhpc.payment.domain.XhpcRefundOrder;
|
||||||
@ -40,11 +41,11 @@ public class XhpcRefundAuditServiceImpl implements IXhpcRefundAuditService {
|
|||||||
xhpcRefundOrder.setRefundOrderId(xhpcRefundAudit.getRefundOrderId());
|
xhpcRefundOrder.setRefundOrderId(xhpcRefundAudit.getRefundOrderId());
|
||||||
xhpcRefundOrder.setExamineStatus(xhpcRefundAudit.getStatus());
|
xhpcRefundOrder.setExamineStatus(xhpcRefundAudit.getStatus());
|
||||||
xhpcRefundOrderMapper.update(xhpcRefundOrder);
|
xhpcRefundOrderMapper.update(xhpcRefundOrder);
|
||||||
if ("1".equals(xhpcRefundOrder.getStatus())) {
|
if (StatusConstants.REFUND_ORDER_STATUS_SUCCESS == xhpcRefundOrder.getStatus()) {
|
||||||
Map<String, Object> map = xhpcRefundOrderMapper.info(xhpcRefundOrder.getRefundOrderId());
|
Map<String, Object> map = xhpcRefundOrderMapper.info(xhpcRefundOrder.getRefundOrderId());
|
||||||
String amount = "-" + StringUtils.valueOf(map.get("amount"));
|
String amount = "-" + StringUtils.valueOf(map.get("amount"));
|
||||||
String userId = StringUtils.valueOf(map.get("userId"));
|
String userId = StringUtils.valueOf(map.get("userId"));
|
||||||
xhpcUserAccountStatementService.add(xhpcRefundAudit.getRefundOrderId(), amount, userId, 2);
|
xhpcUserAccountStatementService.add(xhpcRefundAudit.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND);
|
||||||
}
|
}
|
||||||
return xhpcRefundAuditMapper.insert(xhpcRefundAudit);
|
return xhpcRefundAuditMapper.insert(xhpcRefundAudit);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.payment.service.impl;
|
package com.xhpc.payment.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.payment.domain.XhpcRefundOrder;
|
import com.xhpc.payment.domain.XhpcRefundOrder;
|
||||||
import com.xhpc.payment.mapper.XhpcRefundOrderMapper;
|
import com.xhpc.payment.mapper.XhpcRefundOrderMapper;
|
||||||
import com.xhpc.payment.service.IXhpcRefundOrderService;
|
import com.xhpc.payment.service.IXhpcRefundOrderService;
|
||||||
@ -21,7 +22,6 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private XhpcRefundOrderMapper xhpcRefundOrderMapper;
|
private XhpcRefundOrderMapper xhpcRefundOrderMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新 退款订单
|
* 更新 退款订单
|
||||||
*
|
*
|
||||||
@ -73,7 +73,7 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
|||||||
xhpcRefundOrder.setAmount(amount);
|
xhpcRefundOrder.setAmount(amount);
|
||||||
xhpcRefundOrder.setRefundOrderNumber(refundOrderNumber);
|
xhpcRefundOrder.setRefundOrderNumber(refundOrderNumber);
|
||||||
xhpcRefundOrder.setType(Integer.parseInt(type));
|
xhpcRefundOrder.setType(Integer.parseInt(type));
|
||||||
if (1 == Integer.parseInt(type)) {
|
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
|
||||||
xhpcRefundOrder.setOpenId(openid);
|
xhpcRefundOrder.setOpenId(openid);
|
||||||
} else {
|
} else {
|
||||||
xhpcRefundOrder.setAlipayId(openid);
|
xhpcRefundOrder.setAlipayId(openid);
|
||||||
@ -91,10 +91,11 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void updateRefundOrder(Long refundOrderId, String type, String status) {
|
public void updateRefundOrder(Long refundOrderId, String type, Integer status) {
|
||||||
XhpcRefundOrder xhpcRefundOrder = new XhpcRefundOrder();
|
XhpcRefundOrder xhpcRefundOrder = new XhpcRefundOrder();
|
||||||
xhpcRefundOrder.setRefundOrderId(refundOrderId);
|
xhpcRefundOrder.setRefundOrderId(refundOrderId);
|
||||||
xhpcRefundOrder.setStatus(Integer.parseInt(status));
|
xhpcRefundOrder.setStatus(status);
|
||||||
xhpcRefundOrderMapper.update(xhpcRefundOrder);
|
xhpcRefundOrderMapper.update(xhpcRefundOrder);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.payment.service.impl;
|
package com.xhpc.payment.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.payment.domain.XhpcUserAccountStatement;
|
import com.xhpc.payment.domain.XhpcUserAccountStatement;
|
||||||
import com.xhpc.payment.mapper.XhpcUserAccountStatementMapper;
|
import com.xhpc.payment.mapper.XhpcUserAccountStatementMapper;
|
||||||
@ -54,9 +55,9 @@ public class XhpcUserAccountStatementServiceImpl implements IXhpcUserAccountStat
|
|||||||
public void add(Long id, String amount, String userId, Integer type) {
|
public void add(Long id, String amount, String userId, Integer type) {
|
||||||
XhpcUserAccountStatement xhpcUserAccountStatement = new XhpcUserAccountStatement();
|
XhpcUserAccountStatement xhpcUserAccountStatement = new XhpcUserAccountStatement();
|
||||||
xhpcUserAccountStatement.setAmount(BigDecimal.valueOf(Double.valueOf(amount)));
|
xhpcUserAccountStatement.setAmount(BigDecimal.valueOf(Double.valueOf(amount)));
|
||||||
if (1 == type) {
|
if (StatusConstants.FLOWING_WATER_RECHARGE == type) {
|
||||||
xhpcUserAccountStatement.setRechargeOrderId(id);
|
xhpcUserAccountStatement.setRechargeOrderId(id);
|
||||||
} else if (2 == type) {
|
} else if (StatusConstants.FLOWING_WATER_REFUND == type) {
|
||||||
xhpcUserAccountStatement.setRefundOrderId(id);
|
xhpcUserAccountStatement.setRefundOrderId(id);
|
||||||
} else {
|
} else {
|
||||||
xhpcUserAccountStatement.setChargeOrderId(id);
|
xhpcUserAccountStatement.setChargeOrderId(id);
|
||||||
|
|||||||
@ -18,10 +18,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<insert id="insert" parameterType="com.xhpc.payment.domain.XhpcRefundAudit" useGeneratedKeys="true"
|
<insert id="insert" parameterType="com.xhpc.payment.domain.XhpcRefundAudit" useGeneratedKeys="true"
|
||||||
keyProperty="refundAuditId">
|
keyProperty="refundAuditId">
|
||||||
INSERT INTO xhpc_recharge_order
|
INSERT INTO xhpc_refund_audit
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="null != refundOrderId and '' != refundOrderId">
|
<if test="null != refundOrderId and '' != refundOrderId">
|
||||||
refund_order_id,
|
refund_order_id,
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<insert id="insert" parameterType="com.xhpc.payment.domain.XhpcRefundOrder" useGeneratedKeys="true"
|
<insert id="insert" parameterType="com.xhpc.payment.domain.XhpcRefundOrder" useGeneratedKeys="true"
|
||||||
keyProperty="refundOrderId">
|
keyProperty="refundOrderId">
|
||||||
INSERT INTO xhpc_recharge_order
|
INSERT INTO xhpc_refund_order
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="null != refundOrderNumber and '' != refundOrderNumber">
|
<if test="null != refundOrderNumber and '' != refundOrderNumber">
|
||||||
refund_order_number,
|
refund_order_number,
|
||||||
@ -116,7 +116,7 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="update" parameterType="com.xhpc.payment.domain.XhpcRefundOrder">
|
<update id="update" parameterType="com.xhpc.payment.domain.XhpcRefundOrder">
|
||||||
UPDATE xhpc_recharge_order
|
UPDATE xhpc_refund_order
|
||||||
<set>
|
<set>
|
||||||
<if test="null != refundOrderNumber and '' != refundOrderNumber">refund_order_number =
|
<if test="null != refundOrderNumber and '' != refundOrderNumber">refund_order_number =
|
||||||
#{refundOrderNumber},
|
#{refundOrderNumber},
|
||||||
|
|||||||
@ -18,10 +18,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.alipay.api.AlipayClient;
|
|||||||
import com.alipay.api.DefaultAlipayClient;
|
import com.alipay.api.DefaultAlipayClient;
|
||||||
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
|
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
|
||||||
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
|
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.core.utils.HttpUtils;
|
import com.xhpc.common.core.utils.HttpUtils;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
@ -134,9 +135,9 @@ public class XhpcAppUserController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/jscode2session")
|
@PostMapping("/jscode2session")
|
||||||
@ApiOperation(value = "获取微信权限标识", notes = "jsCode")
|
@ApiOperation(value = "获取微信权限标识", notes = "jsCode")
|
||||||
public Object jsCode(String jsCode, String encryptedData, String iv) {
|
public R<?> jsCode(String jsCode, String encryptedData, String iv) {
|
||||||
if (StringUtils.isEmpty(jsCode)) {
|
if (StringUtils.isEmpty(jsCode)) {
|
||||||
return "信息不完整";
|
return R.fail(HttpStatus.NOT_NULL, "信息不完整");
|
||||||
}
|
}
|
||||||
String url = environment.getProperty("WXGETJSCODE") + jsCode + "&grant_type=authorization_code";
|
String url = environment.getProperty("WXGETJSCODE") + jsCode + "&grant_type=authorization_code";
|
||||||
String result = HttpUtils.get(url);
|
String result = HttpUtils.get(url);
|
||||||
@ -145,10 +146,10 @@ public class XhpcAppUserController extends BaseController {
|
|||||||
String openid = json.getString("openid");
|
String openid = json.getString("openid");
|
||||||
String sessionKey = json.getString("session_key");
|
String sessionKey = json.getString("session_key");
|
||||||
if (StringUtils.isNull(openid)) {
|
if (StringUtils.isNull(openid)) {
|
||||||
return "openid获取失败";
|
return R.fail(HttpStatus.ERROR_STATUS, "openid获取失败");
|
||||||
}
|
}
|
||||||
if (StringUtils.isNull(sessionKey)) {
|
if (StringUtils.isNull(sessionKey)) {
|
||||||
return "sessionKey获取失败";
|
return R.fail(HttpStatus.ERROR_STATUS, "openid获取失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>(16);
|
Map<String, Object> map = new HashMap<>(16);
|
||||||
@ -163,9 +164,9 @@ public class XhpcAppUserController extends BaseController {
|
|||||||
map.put("phone", jsonObject.get("purePhoneNumber"));
|
map.put("phone", jsonObject.get("purePhoneNumber"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return map;
|
return R.ok(map);
|
||||||
}
|
}
|
||||||
return "openid获取失败";
|
return R.fail(HttpStatus.ERROR_STATUS, "openid获取失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.xhpc.user.controller;
|
package com.xhpc.user.controller;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.SecurityUtils;
|
import com.xhpc.common.core.utils.SecurityUtils;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.common.core.web.controller.BaseController;
|
import com.xhpc.common.core.web.controller.BaseController;
|
||||||
@ -50,8 +52,8 @@ public class XhpcInternetUserController extends BaseController {
|
|||||||
sysUser.setPhonenumber(xhpcInternetUser.getPhone());
|
sysUser.setPhonenumber(xhpcInternetUser.getPhone());
|
||||||
sysUser.setDeptId(103l);
|
sysUser.setDeptId(103l);
|
||||||
sysUser.setSex("0");
|
sysUser.setSex("0");
|
||||||
sysUser.setUserType("02");
|
sysUser.setUserType(StatusConstants.INTERNET_USER_TYPE);
|
||||||
sysUser.setDataPowerType(3);
|
sysUser.setDataPowerType(StatusConstants.INTERNET_POWER_TYPE);
|
||||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(xhpcInternetUser.getPhone()));
|
sysUser.setPassword(SecurityUtils.encryptPassword(xhpcInternetUser.getPhone()));
|
||||||
AjaxResult ajaxResult = remoteSystemService.addUser(sysUser);
|
AjaxResult ajaxResult = remoteSystemService.addUser(sysUser);
|
||||||
@ -76,7 +78,7 @@ public class XhpcInternetUserController extends BaseController {
|
|||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
public AjaxResult edit(@Valid @RequestBody XhpcInternetUser xhpcInternetUser) {
|
public AjaxResult edit(@Valid @RequestBody XhpcInternetUser xhpcInternetUser) {
|
||||||
if (null == xhpcInternetUser.getInternetUserId()) {
|
if (null == xhpcInternetUser.getInternetUserId()) {
|
||||||
return AjaxResult.error("用户id不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户id不能为空");
|
||||||
}
|
}
|
||||||
SysUser sysUser = new SysUser();
|
SysUser sysUser = new SysUser();
|
||||||
sysUser.setUserName(xhpcInternetUser.getPhone());
|
sysUser.setUserName(xhpcInternetUser.getPhone());
|
||||||
@ -84,8 +86,8 @@ public class XhpcInternetUserController extends BaseController {
|
|||||||
sysUser.setPhonenumber(xhpcInternetUser.getPhone());
|
sysUser.setPhonenumber(xhpcInternetUser.getPhone());
|
||||||
sysUser.setDeptId(103l);
|
sysUser.setDeptId(103l);
|
||||||
sysUser.setSex("0");
|
sysUser.setSex("0");
|
||||||
sysUser.setUserType("02");
|
sysUser.setUserType(StatusConstants.INTERNET_USER_TYPE);
|
||||||
sysUser.setDataPowerType(3);
|
sysUser.setDataPowerType(StatusConstants.INTERNET_POWER_TYPE);
|
||||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(xhpcInternetUser.getPhone()));
|
sysUser.setPassword(SecurityUtils.encryptPassword(xhpcInternetUser.getPhone()));
|
||||||
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
||||||
@ -101,8 +103,12 @@ public class XhpcInternetUserController extends BaseController {
|
|||||||
@ApiOperation("删除流量用户")
|
@ApiOperation("删除流量用户")
|
||||||
//@PreAuthorize(hasPermi = "user:internet:remove")
|
//@PreAuthorize(hasPermi = "user:internet:remove")
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@RequestBody Map<String, Object> map) {
|
||||||
iXhpcInternetUserService.deleteByIds(ids);
|
String ids = StringUtils.valueOf(map.get("ids"));
|
||||||
|
if (StringUtils.isEmpty(ids)) {
|
||||||
|
return AjaxResult.error(HttpStatus.NOT_NULL, "流量用户信息不能为空");
|
||||||
|
}
|
||||||
|
iXhpcInternetUserService.deleteByIds(ids.split(","));
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,8 +139,12 @@ public class XhpcInternetUserController extends BaseController {
|
|||||||
@ApiOperation("禁用/启用流量用户")
|
@ApiOperation("禁用/启用流量用户")
|
||||||
//@PreAuthorize(hasPermi = "user:internet:status")
|
//@PreAuthorize(hasPermi = "user:internet:status")
|
||||||
@PostMapping("/status")
|
@PostMapping("/status")
|
||||||
public AjaxResult status(@RequestParam Long internetUserId) {
|
public AjaxResult status(@RequestBody Map<String, Object> map) {
|
||||||
iXhpcInternetUserService.status(internetUserId);
|
String internetUserId = StringUtils.valueOf(map.get("internetUserId"));
|
||||||
|
if (StringUtils.isEmpty(internetUserId)) {
|
||||||
|
return AjaxResult.error(HttpStatus.NOT_NULL, "流量用户信息不能为空");
|
||||||
|
}
|
||||||
|
iXhpcInternetUserService.status(Long.parseLong(internetUserId));
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.xhpc.user.controller;
|
package com.xhpc.user.controller;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.constant.UserConstants;
|
import com.xhpc.common.core.constant.UserConstants;
|
||||||
import com.xhpc.common.core.utils.SecurityUtils;
|
import com.xhpc.common.core.utils.SecurityUtils;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
@ -64,7 +66,7 @@ public class XhpcOperatorController extends BaseController {
|
|||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
if (UserConstants.NOT_UNIQUE.equals(iXhpcOperatorService.checkAccountUnique(xhpcOperator))) {
|
if (UserConstants.NOT_UNIQUE.equals(iXhpcOperatorService.checkAccountUnique(xhpcOperator))) {
|
||||||
return AjaxResult.error("用户'" + xhpcOperator.getPhone() + "'失败,登录账号已存在");
|
return AjaxResult.error(HttpStatus.ALREADY_EXISTING, "用户'" + xhpcOperator.getPhone() + "'失败,登录账号已存在");
|
||||||
}
|
}
|
||||||
iXhpcOperatorService.insert(xhpcOperator);
|
iXhpcOperatorService.insert(xhpcOperator);
|
||||||
SysUser sysUser1 = iXhpcUserService.selectUserByUserName(sysUser.getUserName());
|
SysUser sysUser1 = iXhpcUserService.selectUserByUserName(sysUser.getUserName());
|
||||||
@ -84,7 +86,7 @@ public class XhpcOperatorController extends BaseController {
|
|||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
public AjaxResult edit(@Valid @RequestBody XhpcOperator xhpcOperator) {
|
public AjaxResult edit(@Valid @RequestBody XhpcOperator xhpcOperator) {
|
||||||
if (null == xhpcOperator.getOperatorId()) {
|
if (null == xhpcOperator.getOperatorId()) {
|
||||||
return AjaxResult.error("运营商id不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "运营商id不能为空");
|
||||||
}
|
}
|
||||||
SysUser sysUser = new SysUser();
|
SysUser sysUser = new SysUser();
|
||||||
sysUser.setUserName(xhpcOperator.getPhone());
|
sysUser.setUserName(xhpcOperator.getPhone());
|
||||||
@ -93,8 +95,8 @@ public class XhpcOperatorController extends BaseController {
|
|||||||
sysUser.setPhonenumber(xhpcOperator.getPhone());
|
sysUser.setPhonenumber(xhpcOperator.getPhone());
|
||||||
sysUser.setDeptId(103l);
|
sysUser.setDeptId(103l);
|
||||||
sysUser.setSex("0");
|
sysUser.setSex("0");
|
||||||
sysUser.setUserType("01");
|
sysUser.setDataPowerType(StatusConstants.OPERATION_POWER_TYPE);
|
||||||
sysUser.setDataPowerType(1);
|
sysUser.setUserType(StatusConstants.OPERATION_USER_TYPE);
|
||||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(xhpcOperator.getPhone()));
|
sysUser.setPassword(SecurityUtils.encryptPassword(xhpcOperator.getPhone()));
|
||||||
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
||||||
@ -102,7 +104,7 @@ public class XhpcOperatorController extends BaseController {
|
|||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
if (UserConstants.NOT_UNIQUE.equals(iXhpcOperatorService.checkAccountUnique(xhpcOperator))) {
|
if (UserConstants.NOT_UNIQUE.equals(iXhpcOperatorService.checkAccountUnique(xhpcOperator))) {
|
||||||
return AjaxResult.error("用户'" + xhpcOperator.getPhone() + "'失败,登录账号已存在");
|
return AjaxResult.error(HttpStatus.ALREADY_EXISTING, "用户'" + xhpcOperator.getPhone() + "'失败,登录账号已存在");
|
||||||
}
|
}
|
||||||
return toAjax(iXhpcOperatorService.update(xhpcOperator));
|
return toAjax(iXhpcOperatorService.update(xhpcOperator));
|
||||||
}
|
}
|
||||||
@ -113,7 +115,11 @@ public class XhpcOperatorController extends BaseController {
|
|||||||
@ApiOperation("删除运营商")
|
@ApiOperation("删除运营商")
|
||||||
//@PreAuthorize(hasPermi = "user:operator:remove")
|
//@PreAuthorize(hasPermi = "user:operator:remove")
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@RequestBody Map<String, Object> map) {
|
||||||
|
String ids = StringUtils.valueOf(map.get("ids"));
|
||||||
|
if (StringUtils.isEmpty(ids)) {
|
||||||
|
return AjaxResult.error(HttpStatus.NOT_NULL, "运营商信息不能为空");
|
||||||
|
}
|
||||||
iXhpcOperatorService.deleteByIds(ids);
|
iXhpcOperatorService.deleteByIds(ids);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@ -145,8 +151,12 @@ public class XhpcOperatorController extends BaseController {
|
|||||||
@ApiOperation("禁用/启用运营商")
|
@ApiOperation("禁用/启用运营商")
|
||||||
//@PreAuthorize(hasPermi = "user:operator:status")
|
//@PreAuthorize(hasPermi = "user:operator:status")
|
||||||
@PostMapping("/status")
|
@PostMapping("/status")
|
||||||
public AjaxResult status(@RequestParam Long operatorId) {
|
public AjaxResult status(@RequestBody Map<String, Object> map) {
|
||||||
iXhpcOperatorService.status(operatorId);
|
String operatorId = StringUtils.valueOf(map.get("operatorId"));
|
||||||
|
if (StringUtils.isEmpty(operatorId)) {
|
||||||
|
return AjaxResult.error(HttpStatus.NOT_NULL, "运营商信息不能为空");
|
||||||
|
}
|
||||||
|
iXhpcOperatorService.status(Long.parseLong(operatorId));
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.xhpc.user.controller;
|
package com.xhpc.user.controller;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.SecurityUtils;
|
import com.xhpc.common.core.utils.SecurityUtils;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.common.core.web.controller.BaseController;
|
import com.xhpc.common.core.web.controller.BaseController;
|
||||||
@ -56,8 +58,8 @@ public class XhpcUserController extends BaseController {
|
|||||||
public AjaxResult pcAdd(@RequestBody SysUser sysUser) {
|
public AjaxResult pcAdd(@RequestBody SysUser sysUser) {
|
||||||
sysUser.setPhonenumber(sysUser.getUserName());
|
sysUser.setPhonenumber(sysUser.getUserName());
|
||||||
sysUser.setDeptId(103l);
|
sysUser.setDeptId(103l);
|
||||||
sysUser.setDataPowerType(1);
|
sysUser.setDataPowerType(StatusConstants.SON_POWER_TYPE);
|
||||||
sysUser.setUserType("00");
|
sysUser.setUserType(StatusConstants.SYSTEM_USER_TYPE);
|
||||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
AjaxResult ajaxResult = remoteSystemService.addUser(sysUser);
|
AjaxResult ajaxResult = remoteSystemService.addUser(sysUser);
|
||||||
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
||||||
@ -81,7 +83,7 @@ public class XhpcUserController extends BaseController {
|
|||||||
@PostMapping("/pc/edit")
|
@PostMapping("/pc/edit")
|
||||||
public AjaxResult pcEdit(@RequestBody SysUser sysUser) {
|
public AjaxResult pcEdit(@RequestBody SysUser sysUser) {
|
||||||
if (null == sysUser.getUserId()) {
|
if (null == sysUser.getUserId()) {
|
||||||
return AjaxResult.error("用户id不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户id不能为空");
|
||||||
}
|
}
|
||||||
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
||||||
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
||||||
@ -121,12 +123,12 @@ public class XhpcUserController extends BaseController {
|
|||||||
@PostMapping("/operator/add")
|
@PostMapping("/operator/add")
|
||||||
public AjaxResult operatorAdd(@RequestBody SysUser sysUser) {
|
public AjaxResult operatorAdd(@RequestBody SysUser sysUser) {
|
||||||
if (null == sysUser.getOperatorId()) {
|
if (null == sysUser.getOperatorId()) {
|
||||||
return AjaxResult.error("所属运营商不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "所属运营商不能为空");
|
||||||
}
|
}
|
||||||
sysUser.setPhonenumber(sysUser.getUserName());
|
sysUser.setPhonenumber(sysUser.getUserName());
|
||||||
sysUser.setDeptId(103l);
|
sysUser.setDeptId(103l);
|
||||||
sysUser.setDataPowerType(1);
|
sysUser.setDataPowerType(StatusConstants.SON_POWER_TYPE);
|
||||||
sysUser.setUserType("03");
|
sysUser.setUserType(StatusConstants.OPERATION_SON_USER_TYPE);
|
||||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
AjaxResult ajaxResult = remoteSystemService.addUser(sysUser);
|
AjaxResult ajaxResult = remoteSystemService.addUser(sysUser);
|
||||||
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
||||||
@ -150,10 +152,10 @@ public class XhpcUserController extends BaseController {
|
|||||||
@PostMapping("/operator/edit")
|
@PostMapping("/operator/edit")
|
||||||
public AjaxResult operatorEdit(@RequestBody SysUser sysUser) {
|
public AjaxResult operatorEdit(@RequestBody SysUser sysUser) {
|
||||||
if (null == sysUser.getUserId()) {
|
if (null == sysUser.getUserId()) {
|
||||||
return AjaxResult.error("用户id不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户id不能为空");
|
||||||
}
|
}
|
||||||
if (null == sysUser.getOperatorId()) {
|
if (null == sysUser.getOperatorId()) {
|
||||||
return AjaxResult.error("所属运营上不能为空");
|
return AjaxResult.error(HttpStatus.NOT_NULL, "所属运营上不能为空");
|
||||||
}
|
}
|
||||||
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
AjaxResult ajaxResult = remoteSystemService.editUser(sysUser);
|
||||||
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
if (StringUtils.isNotNull(ajaxResult) && !"200".equals(StringUtils.valueOf(ajaxResult.get("code")))) {
|
||||||
@ -178,8 +180,12 @@ public class XhpcUserController extends BaseController {
|
|||||||
@ApiOperation("禁用/启用平台和运营商子账号")
|
@ApiOperation("禁用/启用平台和运营商子账号")
|
||||||
//@PreAuthorize(hasPermi = "user:pc:status")
|
//@PreAuthorize(hasPermi = "user:pc:status")
|
||||||
@PostMapping("/status")
|
@PostMapping("/status")
|
||||||
public AjaxResult status(@RequestParam Long userId) {
|
public AjaxResult status(@RequestBody Map<String, Object> map) {
|
||||||
iXhpcUserService.status(userId);
|
String userId = StringUtils.valueOf(map.get("userId"));
|
||||||
|
if (StringUtils.isEmpty(userId)) {
|
||||||
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
|
||||||
|
}
|
||||||
|
iXhpcUserService.status(Long.parseLong(userId));
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,8 +195,12 @@ public class XhpcUserController extends BaseController {
|
|||||||
@ApiOperation("禁用/启用平台和运营商子账号")
|
@ApiOperation("禁用/启用平台和运营商子账号")
|
||||||
//@PreAuthorize(hasPermi = "user:pc:status")
|
//@PreAuthorize(hasPermi = "user:pc:status")
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
public AjaxResult remove(@RequestParam Long userId) {
|
public AjaxResult remove(@RequestBody Map<String, Object> map) {
|
||||||
iXhpcOperatorService.removeUser(userId);
|
String userId = StringUtils.valueOf(map.get("userId"));
|
||||||
|
if (StringUtils.isEmpty(userId)) {
|
||||||
|
return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
|
||||||
|
}
|
||||||
|
iXhpcOperatorService.removeUser(Long.parseLong(userId));
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public interface XhpcInternetUserMapper {
|
|||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteByIds(Long[] ids);
|
public int deleteByIds(String[] ids);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public interface XhpcOperatorMapper {
|
|||||||
* @param ids 需要删除的数据ID
|
* @param ids 需要删除的数据ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteByIds(Long[] ids);
|
public int deleteByIds(String[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验账号是否唯一
|
* 校验账号是否唯一
|
||||||
@ -91,10 +91,10 @@ public interface XhpcOperatorMapper {
|
|||||||
/**
|
/**
|
||||||
* 通过用户ID删除用户
|
* 通过用户ID删除用户
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param sysUser 用户
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteUserById(@Param("userId") Long userId, @Param("delFlag") String delFlag);
|
public int deleteUserById(SysUser sysUser);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过运营商ID查询用户
|
* 通过运营商ID查询用户
|
||||||
|
|||||||
@ -78,4 +78,12 @@ public interface XhpcUserMapper {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public SysUser selectUserByUserName(@Param("userName") String userName);
|
public SysUser selectUserByUserName(@Param("userName") String userName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过创建账号查询用户子账号
|
||||||
|
*
|
||||||
|
* @param createBy 用户账号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public List<SysUser> selectUserByCreateBy(@Param("createBy") String createBy);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public interface IXhpcInternetUserService {
|
|||||||
* @param ids 需要删除的流量用户ID
|
* @param ids 需要删除的流量用户ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteByIds(Long[] ids);
|
public void deleteByIds(String[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流量用户详情
|
* 流量用户详情
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public interface IXhpcOperatorService {
|
|||||||
* @param ids 需要删除的运营商ID
|
* @param ids 需要删除的运营商ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public void deleteByIds(Long[] ids);
|
public void deleteByIds(String ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验账号是否唯一
|
* 校验账号是否唯一
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
package com.xhpc.user.service.impl;
|
package com.xhpc.user.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.HttpStatus;
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.constant.UserConstants;
|
import com.xhpc.common.core.constant.UserConstants;
|
||||||
import com.xhpc.common.core.domain.R;
|
import com.xhpc.common.core.domain.R;
|
||||||
import com.xhpc.common.core.enums.UserStatus;
|
import com.xhpc.common.core.enums.UserStatus;
|
||||||
import com.xhpc.common.core.exception.BaseException;
|
|
||||||
import com.xhpc.common.core.exception.CaptchaException;
|
|
||||||
import com.xhpc.common.core.utils.SecurityUtils;
|
import com.xhpc.common.core.utils.SecurityUtils;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.common.redis.service.RedisService;
|
import com.xhpc.common.redis.service.RedisService;
|
||||||
@ -87,7 +87,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
String status = StringUtils.valueOf(map.get("status"));
|
String status = StringUtils.valueOf(map.get("status"));
|
||||||
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
||||||
xhpcAppUser.setAppUserId(appUserId);
|
xhpcAppUser.setAppUserId(appUserId);
|
||||||
xhpcAppUser.setStatus("0".equals(status) ? 1 : 0);
|
xhpcAppUser.setStatus(UserConstants.NORMAL == Integer.parseInt(status) ? UserConstants.EXCEPTION : UserConstants.NORMAL);
|
||||||
update(xhpcAppUser);
|
update(xhpcAppUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,11 +104,11 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
String type = StringUtils.valueOf(map.get("type"));
|
String type = StringUtils.valueOf(map.get("type"));
|
||||||
String openid = StringUtils.valueOf(map.get("openid"));
|
String openid = StringUtils.valueOf(map.get("openid"));
|
||||||
if (StringUtils.isEmpty(openid)) {
|
if (StringUtils.isEmpty(openid)) {
|
||||||
throw new CaptchaException("openid不能为空");
|
return R.fail(HttpStatus.NOT_NULL, "openid不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isEmpty(code)) {
|
if (StringUtils.isEmpty(code)) {
|
||||||
throw new CaptchaException("验证码不能为空");
|
return R.fail(HttpStatus.NOT_NULL, "验证码不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*String verifyKey = Constants.CAPTCHA_CODE_KEY + phone;
|
/*String verifyKey = Constants.CAPTCHA_CODE_KEY + phone;
|
||||||
@ -117,11 +117,11 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
|
|
||||||
if (!code.equalsIgnoreCase(captcha))
|
if (!code.equalsIgnoreCase(captcha))
|
||||||
{
|
{
|
||||||
throw new CaptchaException("验证码错误");
|
R.fail(HttpStatus.ERROR_STATUS,"openid不能为空");
|
||||||
}*/
|
}*/
|
||||||
XhpcAppUser info = xhpcAppUserMapper.getAppUserByPhone(phone);
|
XhpcAppUser info = xhpcAppUserMapper.getAppUserByPhone(phone);
|
||||||
if (StringUtils.isNotNull(info)) {
|
if (StringUtils.isNotNull(info)) {
|
||||||
throw new CaptchaException("账号已存在");
|
return R.fail(HttpStatus.ALREADY_EXISTING, "账号已存在");
|
||||||
}
|
}
|
||||||
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
||||||
xhpcAppUser.setPhone(phone);
|
xhpcAppUser.setPhone(phone);
|
||||||
@ -143,11 +143,11 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
String phone = StringUtils.valueOf(map.get("phone"));
|
String phone = StringUtils.valueOf(map.get("phone"));
|
||||||
String type = StringUtils.valueOf(map.get("type"));
|
String type = StringUtils.valueOf(map.get("type"));
|
||||||
if (StringUtils.isEmpty(code)) {
|
if (StringUtils.isEmpty(code)) {
|
||||||
throw new CaptchaException("验证码不能为空");
|
return R.fail(HttpStatus.NOT_NULL, "验证码不能为空");
|
||||||
}
|
}
|
||||||
String openid = StringUtils.valueOf(map.get("openid"));
|
String openid = StringUtils.valueOf(map.get("openid"));
|
||||||
if (StringUtils.isEmpty(openid)) {
|
if (StringUtils.isEmpty(openid)) {
|
||||||
throw new CaptchaException("openid不能为空");
|
return R.fail(HttpStatus.NOT_NULL, "openid不能为空");
|
||||||
}
|
}
|
||||||
/*String verifyKey = Constants.CAPTCHA_CODE_KEY + phone;
|
/*String verifyKey = Constants.CAPTCHA_CODE_KEY + phone;
|
||||||
String captcha = redisService.getCacheObject(verifyKey);
|
String captcha = redisService.getCacheObject(verifyKey);
|
||||||
@ -155,7 +155,7 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
|
|
||||||
if (!code.equalsIgnoreCase(captcha))
|
if (!code.equalsIgnoreCase(captcha))
|
||||||
{
|
{
|
||||||
throw new CaptchaException("验证码错误");
|
R.fail(HttpStatus.ERROR_STATUS,"openid不能为空");
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
return appLogin(phone, type, openid);
|
return appLogin(phone, type, openid);
|
||||||
@ -167,17 +167,17 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
public R<?> appLogin(String username, String type, String openid) {
|
public R<?> appLogin(String username, String type, String openid) {
|
||||||
// 用户名或密码为空 错误
|
// 用户名或密码为空 错误
|
||||||
if (StringUtils.isAnyBlank(username)) {
|
if (StringUtils.isAnyBlank(username)) {
|
||||||
throw new BaseException("用户必须填写");
|
return R.fail(HttpStatus.NOT_NULL, "用户必须填写");
|
||||||
}
|
}
|
||||||
// 用户名不在指定范围内 错误
|
// 用户名不在指定范围内 错误
|
||||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||||
throw new BaseException("用户名不在指定范围");
|
return R.fail(HttpStatus.ERROR_STATUS, "用户名不在指定范围");
|
||||||
}
|
}
|
||||||
// 查询用户信息
|
// 查询用户信息
|
||||||
XhpcAppUser user = xhpcAppUserMapper.getAppUserByPhone(username);
|
XhpcAppUser user = xhpcAppUserMapper.getAppUserByPhone(username);
|
||||||
if (StringUtils.isNull(user)) {
|
if (StringUtils.isNull(user)) {
|
||||||
throw new BaseException("登录用户:" + username + " 不存在");
|
return R.fail(HttpStatus.DATA_ERROR, "登录用户:" + username + " 不存在");
|
||||||
}
|
}
|
||||||
LoginUser userInfo = new LoginUser();
|
LoginUser userInfo = new LoginUser();
|
||||||
SysUser sysUser = new SysUser();
|
SysUser sysUser = new SysUser();
|
||||||
@ -185,21 +185,21 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
sysUser.setUserId(user.getAppUserId());
|
sysUser.setUserId(user.getAppUserId());
|
||||||
userInfo.setSysUser(sysUser);
|
userInfo.setSysUser(sysUser);
|
||||||
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
||||||
throw new BaseException("对不起,您的账号:" + username + " 已被删除");
|
return R.fail(HttpStatus.DATA_ERROR, "对不起,您的账号:" + username + " 已被删除");
|
||||||
}
|
}
|
||||||
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
||||||
throw new BaseException("对不起,您的账号:" + username + " 已停用");
|
return R.fail(HttpStatus.DATA_ERROR, "对不起,您的账号:" + username + " 已停用");
|
||||||
}
|
}
|
||||||
if ("1".equals(type)) {
|
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
|
||||||
if (StringUtils.isNull(user.getWeixinOpenId())) {
|
if (StringUtils.isNull(user.getWeixinOpenId())) {
|
||||||
user.setWeixinOpenId(openid);
|
user.setWeixinOpenId(openid);
|
||||||
}
|
}
|
||||||
user.setWeixinLogin(1);
|
user.setWeixinLogin(UserConstants.LOGIN);
|
||||||
} else {
|
} else {
|
||||||
if (StringUtils.isNull(user.getAlipayOpenId())) {
|
if (StringUtils.isNull(user.getAlipayOpenId())) {
|
||||||
user.setAlipayOpenId(openid);
|
user.setAlipayOpenId(openid);
|
||||||
}
|
}
|
||||||
user.setAlipayLogin(1);
|
user.setAlipayLogin(UserConstants.LOGIN);
|
||||||
}
|
}
|
||||||
xhpcAppUserMapper.update(user);
|
xhpcAppUserMapper.update(user);
|
||||||
// 获取登录token
|
// 获取登录token
|
||||||
@ -221,10 +221,10 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
tokenService.delLoginUser(loginUser.getToken());
|
tokenService.delLoginUser(loginUser.getToken());
|
||||||
XhpcAppUser user = xhpcAppUserMapper.getAppUserByPhone(username);
|
XhpcAppUser user = xhpcAppUserMapper.getAppUserByPhone(username);
|
||||||
if (!StringUtils.isNull(user)) {
|
if (!StringUtils.isNull(user)) {
|
||||||
if ("1".equals(type)) {
|
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
|
||||||
user.setWeixinLogin(0);
|
user.setWeixinLogin(UserConstants.NO_LOGIN);
|
||||||
} else {
|
} else {
|
||||||
user.setAlipayLogin(0);
|
user.setAlipayLogin(UserConstants.NO_LOGIN);
|
||||||
}
|
}
|
||||||
xhpcAppUserMapper.update(user);
|
xhpcAppUserMapper.update(user);
|
||||||
}
|
}
|
||||||
@ -244,15 +244,15 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
|||||||
String openid = StringUtils.valueOf(map.get("openid"));
|
String openid = StringUtils.valueOf(map.get("openid"));
|
||||||
XhpcAppUser user = xhpcAppUserMapper.getAppUserByOpenid(openid);
|
XhpcAppUser user = xhpcAppUserMapper.getAppUserByOpenid(openid);
|
||||||
if (StringUtils.isNull(user)) {
|
if (StringUtils.isNull(user)) {
|
||||||
throw new BaseException("用户不存在");
|
return R.fail(HttpStatus.DATA_ERROR, "用户不存在");
|
||||||
}
|
}
|
||||||
if ("2".equals(type)) {
|
if (StatusConstants.OPERATION_ALI_PAY_TYPE.equals(type)) {
|
||||||
if ("0".equals(StringUtils.valueOf(user.getWeixinLogin()))) {
|
if (UserConstants.NO_LOGIN == user.getWeixinLogin()) {
|
||||||
return R.fail(400, "用户未登录");
|
return R.fail(HttpStatus.USER_LOGIN, "用户未登录");
|
||||||
}
|
}
|
||||||
} else if ("1".equals(type)) {
|
} else if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
|
||||||
if ("0".equals(StringUtils.valueOf(user.getWeixinLogin()))) {
|
if (UserConstants.NO_LOGIN == user.getWeixinLogin()) {
|
||||||
return R.fail(400, "用户未登录");
|
return R.fail(HttpStatus.USER_LOGIN, "用户未登录");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return appLogin(user.getPhone(), type, openid);
|
return appLogin(user.getPhone(), type, openid);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.user.service.impl;
|
package com.xhpc.user.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.UserConstants;
|
||||||
import com.xhpc.system.api.domain.SysUser;
|
import com.xhpc.system.api.domain.SysUser;
|
||||||
import com.xhpc.user.domain.XhpcInternetUser;
|
import com.xhpc.user.domain.XhpcInternetUser;
|
||||||
import com.xhpc.user.mapper.XhpcInternetUserMapper;
|
import com.xhpc.user.mapper.XhpcInternetUserMapper;
|
||||||
@ -56,14 +57,15 @@ public class XhpcInternetUserServiceImpl implements IXhpcInternetUserService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(Long[] ids) {
|
public void deleteByIds(String[] ids) {
|
||||||
for (Long id : ids) {
|
for (String id : ids) {
|
||||||
SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(id);
|
SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(Long.parseLong(id));
|
||||||
// 删除用户与角色关联
|
// 删除用户与角色关联
|
||||||
xhpcOperatorMapper.deleteUserRoleByUserId(sysUser.getUserId());
|
xhpcOperatorMapper.deleteUserRoleByUserId(sysUser.getUserId());
|
||||||
// 删除用户与岗位表
|
// 删除用户与岗位表
|
||||||
xhpcOperatorMapper.deleteUserPostByUserId(sysUser.getUserId());
|
xhpcOperatorMapper.deleteUserPostByUserId(sysUser.getUserId());
|
||||||
xhpcOperatorMapper.deleteUserById(sysUser.getUserId(), "2");
|
sysUser.setDelFlag(String.valueOf(UserConstants.DEL_FLAG));
|
||||||
|
xhpcOperatorMapper.deleteUserById(sysUser);
|
||||||
}
|
}
|
||||||
xhpcInternetUserMapper.deleteByIds(ids);
|
xhpcInternetUserMapper.deleteByIds(ids);
|
||||||
}
|
}
|
||||||
@ -101,11 +103,11 @@ public class XhpcInternetUserServiceImpl implements IXhpcInternetUserService {
|
|||||||
@Override
|
@Override
|
||||||
public void status(Long internetUserId) {
|
public void status(Long internetUserId) {
|
||||||
SysUser sysUser = xhpcInternetUserMapper.getUserByInternetUserId(internetUserId);
|
SysUser sysUser = xhpcInternetUserMapper.getUserByInternetUserId(internetUserId);
|
||||||
sysUser.setStatus("1".equals(sysUser.getStatus()) ? "0" : "1");
|
sysUser.setStatus(String.valueOf(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL));
|
||||||
xhpcUserMapper.update(sysUser);
|
xhpcUserMapper.update(sysUser);
|
||||||
XhpcInternetUser xhpcInternetUser = new XhpcInternetUser();
|
XhpcInternetUser xhpcInternetUser = new XhpcInternetUser();
|
||||||
xhpcInternetUser.setInternetUserId(internetUserId);
|
xhpcInternetUser.setInternetUserId(internetUserId);
|
||||||
xhpcInternetUser.setStatus("0".equals(sysUser.getStatus()) ? 1 : 0);
|
xhpcInternetUser.setStatus(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL);
|
||||||
update(xhpcInternetUser);
|
update(xhpcInternetUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.user.service.impl;
|
package com.xhpc.user.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.user.domain.XhpcOperatorInternetBlacklist;
|
import com.xhpc.user.domain.XhpcOperatorInternetBlacklist;
|
||||||
import com.xhpc.user.mapper.XhpcInternetUserMapper;
|
import com.xhpc.user.mapper.XhpcInternetUserMapper;
|
||||||
@ -64,13 +65,13 @@ public class XhpcOperatorInternetBlacklistServiceImpl implements IXhpcOperatorIn
|
|||||||
bool = true;
|
bool = true;
|
||||||
}
|
}
|
||||||
for (Map<String, Object> map : list) {
|
for (Map<String, Object> map : list) {
|
||||||
map.put("isBlack", 0);
|
map.put("isBlack", StatusConstants.IS_BLACK);
|
||||||
if (bool) {
|
if (bool) {
|
||||||
for (Map<String, Object> map1 : blacklist) {
|
for (Map<String, Object> map1 : blacklist) {
|
||||||
String internetUserId = StringUtils.valueOf(map.get("internetUserId"));
|
String internetUserId = StringUtils.valueOf(map.get("internetUserId"));
|
||||||
String internetUserId1 = StringUtils.valueOf(map1.get("internetUserId"));
|
String internetUserId1 = StringUtils.valueOf(map1.get("internetUserId"));
|
||||||
if (internetUserId.equals(internetUserId1)) {
|
if (internetUserId.equals(internetUserId1)) {
|
||||||
map.put("isBlack", 1);
|
map.put("isBlack", StatusConstants.BLACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -54,12 +54,12 @@ public class XhpcOperatorServiceImpl implements IXhpcOperatorService {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteByIds(Long[] ids) {
|
public void deleteByIds(String ids) {
|
||||||
for (Long id : ids) {
|
for (String id : ids.split(",")) {
|
||||||
SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(id);
|
SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(Long.parseLong(id));
|
||||||
removeUser(sysUser.getUserId());
|
removeUser(sysUser.getUserId());
|
||||||
}
|
}
|
||||||
xhpcOperatorMapper.deleteByIds(ids);
|
xhpcOperatorMapper.deleteByIds(ids.split(","));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -120,7 +120,10 @@ public class XhpcOperatorServiceImpl implements IXhpcOperatorService {
|
|||||||
// 删除用户与岗位表
|
// 删除用户与岗位表
|
||||||
xhpcOperatorMapper.deleteRoleByName(userName);
|
xhpcOperatorMapper.deleteRoleByName(userName);
|
||||||
}
|
}
|
||||||
return xhpcOperatorMapper.deleteUserById(userId, "2");
|
SysUser sysUser = new SysUser();
|
||||||
|
sysUser.setUserId(userId);
|
||||||
|
sysUser.setDelFlag(String.valueOf(UserConstants.DEL_FLAG));
|
||||||
|
return xhpcOperatorMapper.deleteUserById(sysUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,13 +135,18 @@ public class XhpcOperatorServiceImpl implements IXhpcOperatorService {
|
|||||||
@Override
|
@Override
|
||||||
public void status(Long operatorId) {
|
public void status(Long operatorId) {
|
||||||
SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(operatorId);
|
SysUser sysUser = xhpcOperatorMapper.getUserByOperatorId(operatorId);
|
||||||
sysUser.setStatus("1".equals(sysUser.getStatus()) ? "0" : "1");
|
sysUser.setStatus(String.valueOf(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL));
|
||||||
xhpcUserMapper.update(sysUser);
|
xhpcUserMapper.update(sysUser);
|
||||||
Map<String, Object> map = xhpcOperatorMapper.info(operatorId);
|
List<SysUser> sysUserList = xhpcUserMapper.selectUserByCreateBy(sysUser.getUserName());
|
||||||
String status = StringUtils.valueOf(map.get("status"));
|
if (null != sysUserList && sysUserList.size() > 0) {
|
||||||
|
for (SysUser user : sysUserList) {
|
||||||
|
user.setStatus(String.valueOf(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL));
|
||||||
|
xhpcUserMapper.update(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
XhpcOperator xhpcOperator = new XhpcOperator();
|
XhpcOperator xhpcOperator = new XhpcOperator();
|
||||||
xhpcOperator.setOperatorId(operatorId);
|
xhpcOperator.setOperatorId(operatorId);
|
||||||
xhpcOperator.setStatus("0".equals(sysUser.getStatus()) ? 1 : 0);
|
xhpcOperator.setStatus(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL);
|
||||||
update(xhpcOperator);
|
update(xhpcOperator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xhpc.user.service.impl;
|
package com.xhpc.user.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
import com.xhpc.common.core.utils.StringUtils;
|
import com.xhpc.common.core.utils.StringUtils;
|
||||||
import com.xhpc.user.domain.XhpcStationInternetBlacklist;
|
import com.xhpc.user.domain.XhpcStationInternetBlacklist;
|
||||||
import com.xhpc.user.mapper.XhpcOperatorMapper;
|
import com.xhpc.user.mapper.XhpcOperatorMapper;
|
||||||
@ -68,13 +69,13 @@ public class XhpcStationInternetBlacklistServiceImpl implements IXhpcStationInte
|
|||||||
List<Map<String, Object>> listXhpcChargingStation = xhpcStationInternetBlacklistMapper.getXhpcChargingStation(Long.parseLong(operatorId));
|
List<Map<String, Object>> listXhpcChargingStation = xhpcStationInternetBlacklistMapper.getXhpcChargingStation(Long.parseLong(operatorId));
|
||||||
if (null != listXhpcChargingStation && listXhpcChargingStation.size() > 0) {
|
if (null != listXhpcChargingStation && listXhpcChargingStation.size() > 0) {
|
||||||
for (Map<String, Object> xhpcChargingStation : listXhpcChargingStation) {
|
for (Map<String, Object> xhpcChargingStation : listXhpcChargingStation) {
|
||||||
xhpcChargingStation.put("isBlack", 0);
|
xhpcChargingStation.put("isBlack", StatusConstants.IS_BLACK);
|
||||||
if (bool) {
|
if (bool) {
|
||||||
for (Map<String, Object> map1 : blacklist) {
|
for (Map<String, Object> map1 : blacklist) {
|
||||||
String chargingStationId = StringUtils.valueOf(xhpcChargingStation.get("chargingStationId"));
|
String chargingStationId = StringUtils.valueOf(xhpcChargingStation.get("chargingStationId"));
|
||||||
String chargingStationId1 = StringUtils.valueOf(map1.get("chargingStationId"));
|
String chargingStationId1 = StringUtils.valueOf(map1.get("chargingStationId"));
|
||||||
if (chargingStationId.equals(chargingStationId1)) {
|
if (chargingStationId.equals(chargingStationId1)) {
|
||||||
xhpcChargingStation.put("isBlack", 1);
|
xhpcChargingStation.put("isBlack", StatusConstants.BLACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.xhpc.user.service.impl;
|
package com.xhpc.user.service.impl;
|
||||||
|
|
||||||
|
import com.xhpc.common.core.constant.StatusConstants;
|
||||||
|
import com.xhpc.common.core.constant.UserConstants;
|
||||||
import com.xhpc.common.core.utils.SecurityUtils;
|
import com.xhpc.common.core.utils.SecurityUtils;
|
||||||
import com.xhpc.system.api.domain.SysUser;
|
import com.xhpc.system.api.domain.SysUser;
|
||||||
import com.xhpc.user.mapper.XhpcUserMapper;
|
import com.xhpc.user.mapper.XhpcUserMapper;
|
||||||
@ -66,7 +68,7 @@ public class XhpcUserServiceImpl implements IXhpcUserService {
|
|||||||
public List<Map<String, Object>> selectOperatorUserList(String userName, String nickName, Long operatorId) {
|
public List<Map<String, Object>> selectOperatorUserList(String userName, String nickName, Long operatorId) {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId);
|
SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId);
|
||||||
if ("00".equals(sysUser.getUserType())) {
|
if (StatusConstants.SYSTEM_USER_TYPE.equals(sysUser.getUserType())) {
|
||||||
return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId, null);
|
return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId, null);
|
||||||
} else {
|
} else {
|
||||||
return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId, sysUser.getUserName());
|
return xhpcUserMapper.selectOperatorUserList(userName, nickName, operatorId, sysUser.getUserName());
|
||||||
@ -93,7 +95,7 @@ public class XhpcUserServiceImpl implements IXhpcUserService {
|
|||||||
@Override
|
@Override
|
||||||
public void status(Long userId) {
|
public void status(Long userId) {
|
||||||
SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId);
|
SysUser sysUser = xhpcUserMapper.selectUserByUserId(userId);
|
||||||
sysUser.setStatus("1".equals(sysUser.getStatus()) ? "0" : "1");
|
sysUser.setStatus(String.valueOf(UserConstants.NORMAL == Integer.parseInt(sysUser.getStatus()) ? UserConstants.EXCEPTION : UserConstants.NORMAL));
|
||||||
xhpcUserMapper.update(sysUser);
|
xhpcUserMapper.update(sysUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,10 +18,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 118.24.137.203:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
@ -214,10 +214,10 @@
|
|||||||
WHERE internet_user_id = #{internetUserId}
|
WHERE internet_user_id = #{internetUserId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteByIds" parameterType="java.lang.Long">
|
<delete id="deleteByIds" parameterType="java.lang.String">
|
||||||
delete from xhpc_internet_user where internet_user_id in
|
delete from xhpc_internet_user where internet_user_id in
|
||||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
<foreach collection="array" item="ids" open="(" separator="," close=")">
|
||||||
#{internetUserId}
|
#{ids}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|||||||
@ -250,17 +250,17 @@
|
|||||||
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
|
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
|
||||||
<if test="null != createTime ">create_time = #{createTime},</if>
|
<if test="null != createTime ">create_time = #{createTime},</if>
|
||||||
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
|
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
|
||||||
<if test="null != updateTime a">update_time = #{updateTime},</if>
|
<if test="null != updateTime">update_time = #{updateTime},</if>
|
||||||
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
|
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
|
||||||
<if test="null != remark and '' != remark">remark = #{remark}</if>
|
<if test="null != remark and '' != remark">remark = #{remark}</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE operator_id = #{operatorId}
|
WHERE operator_id = #{operatorId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteByIds" parameterType="java.lang.Long">
|
<delete id="deleteByIds" parameterType="java.lang.String">
|
||||||
delete from xhpc_operator where user_id in
|
delete from xhpc_operator where operator_id in
|
||||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
<foreach collection="array" item="ids" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{ids}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
@ -282,7 +282,8 @@
|
|||||||
|
|
||||||
<select id="selectOperatorList" parameterType="java.lang.Long" resultType="java.util.Map">
|
<select id="selectOperatorList" parameterType="java.lang.Long" resultType="java.util.Map">
|
||||||
select xo.operator_id operatorId, xo.name, xo.contact_name contactName, xo.duty_paragraph dutyParagraph,
|
select xo.operator_id operatorId, xo.name, xo.contact_name contactName, xo.duty_paragraph dutyParagraph,
|
||||||
xo.contact_phone contactPhone, xo.phone, xo.attribute,`xo`.create_time createTime,
|
xo.contact_phone contactPhone, xo.phone, xo.attribute,`xo`.create_time createTime,`xo`.status,
|
||||||
|
CASE WHEN xo.`status` = 0 THEN '正常' else '禁用' end statusName,
|
||||||
xdb.dict_value attributenName
|
xdb.dict_value attributenName
|
||||||
from xhpc_operator `xo`
|
from xhpc_operator `xo`
|
||||||
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute
|
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute
|
||||||
@ -313,12 +314,33 @@
|
|||||||
delete from sys_user_post where user_id=#{userId}
|
delete from sys_user_post where user_id=#{userId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="deleteUserById" parameterType="java.lang.Long">
|
<update id="deleteUserById" parameterType="com.xhpc.system.api.domain.SysUser">
|
||||||
update sys_user set del_flag = #{delFlag} where user_id = #{userId}
|
update sys_user set del_flag = #{delFlag} where user_id = #{userId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="getUserByOperatorId" parameterType="java.lang.Long" resultType="com.xhpc.system.api.domain.SysUser">
|
<select id="getUserByOperatorId" 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
|
from sys_user
|
||||||
where del_flag = 0
|
where del_flag = 0
|
||||||
and operator_id = #{operatorId}
|
and operator_id = #{operatorId}
|
||||||
|
|||||||
@ -72,8 +72,9 @@
|
|||||||
|
|
||||||
<select id="selectPcUserList" parameterType="java.lang.String" resultType="java.util.Map">
|
<select id="selectPcUserList" parameterType="java.lang.String" resultType="java.util.Map">
|
||||||
select user_id userId,user_name userName,
|
select user_id userId,user_name userName,
|
||||||
nick_name nickName, email,
|
nick_name nickName, email,status,
|
||||||
create_by createBy ,create_time createTime
|
create_by createBy ,create_time createTime,
|
||||||
|
CASE WHEN `status` = 0 THEN '正常' else '禁用' end statusName
|
||||||
from sys_user
|
from sys_user
|
||||||
WHERE del_flag = 0 and user_type = '00'
|
WHERE del_flag = 0 and user_type = '00'
|
||||||
<if test="userName != null and userName != ''">
|
<if test="userName != null and userName != ''">
|
||||||
@ -87,9 +88,9 @@
|
|||||||
|
|
||||||
<select id="pcInfo" parameterType="java.lang.Long" resultType="java.util.Map">
|
<select id="pcInfo" parameterType="java.lang.Long" resultType="java.util.Map">
|
||||||
select su.user_id userId,su.user_name userName,
|
select su.user_id userId,su.user_name userName,
|
||||||
su.nick_name nickName, su.email,
|
su.nick_name nickName, su.email,status,
|
||||||
su.create_by createBy ,su.create_time createTime,su.`status` ,
|
su.create_by createBy ,su.create_time createTime,su.`status` ,
|
||||||
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName,
|
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName
|
||||||
sdd.dict_label sexName
|
sdd.dict_label sexName
|
||||||
from sys_user su
|
from sys_user su
|
||||||
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = "sys_user_sex" and sdd.dict_code = su.sex
|
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = "sys_user_sex" and sdd.dict_code = su.sex
|
||||||
@ -159,4 +160,31 @@
|
|||||||
from sys_user
|
from sys_user
|
||||||
where user_name = #{userName}
|
where user_name = #{userName}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectUserByCreateBy" parameterType="java.lang.String" resultType="com.xhpc.system.api.domain.SysUser">
|
||||||
|
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 create_by = #{createBy}
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user