短信替换成阿里云,小于100元自动审核(每5分钟),修复小程序或微信在一方注册,弄一方无法注册问题
This commit is contained in:
parent
6053399b02
commit
861a22b4b1
@ -121,6 +121,9 @@ public class SysUser extends BaseEntity
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
/** 菜单组 */
|
||||
private Long[] menuIds;
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
||||
@ -369,6 +372,16 @@ public class SysUser extends BaseEntity
|
||||
this.internetUserId = internetUserId;
|
||||
}
|
||||
|
||||
public Long[] getMenuIds() {
|
||||
|
||||
return menuIds;
|
||||
}
|
||||
|
||||
public void setMenuIds(Long[] menuIds) {
|
||||
|
||||
this.menuIds = menuIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
@ -14,10 +14,8 @@ import com.xhpc.common.security.annotation.PreAuthorize;
|
||||
import com.xhpc.system.api.domain.SysRole;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.api.model.LoginUser;
|
||||
import com.xhpc.system.service.ISysPermissionService;
|
||||
import com.xhpc.system.service.ISysPostService;
|
||||
import com.xhpc.system.service.ISysRoleService;
|
||||
import com.xhpc.system.service.ISysUserService;
|
||||
import com.xhpc.system.service.*;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -25,6 +23,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
@ -49,6 +49,11 @@ public class SysUserController extends BaseController {
|
||||
@Autowired
|
||||
private ISysPermissionService permissionService;
|
||||
|
||||
@Autowired
|
||||
private IXhpcDataDimensionService dataDimensionService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
@ -196,7 +201,7 @@ public class SysUserController extends BaseController {
|
||||
@PutMapping("/resetPwd")
|
||||
public AjaxResult resetPwd(@RequestBody SysUser user) {
|
||||
userService.checkUserAllowed(user);
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
user.setPassword(SecurityUtils.encryptPassword("123456"));
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(userService.resetPwd(user));
|
||||
}
|
||||
@ -238,5 +243,40 @@ public class SysUserController extends BaseController {
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单下拉树列表(已废弃)
|
||||
*/
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeselect(){
|
||||
return AjaxResult.success(dataDimensionService.buildMenuTreeSelect());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据维度(已废弃)
|
||||
*/
|
||||
@GetMapping(value = "/roleMenuTreeselect")
|
||||
public AjaxResult roleMenuTreeselect(String userId){
|
||||
|
||||
Long userIds = SecurityUtils.getUserId();
|
||||
SysUser user = userService.selectUserById(userIds);
|
||||
if("00".equals(user.getUserType())){
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
if("".equals(userId) || userId ==null){
|
||||
ajax.put("checkedKeys", new ArrayList<>());
|
||||
}else{
|
||||
ajax.put("checkedKeys", dataDimensionService.selectByUserId(Long.valueOf(userId)));
|
||||
}
|
||||
ajax.put("menus", dataDimensionService.buildMenuTreeSelect());
|
||||
return ajax;
|
||||
}
|
||||
AjaxResult ajax = AjaxResult.error();
|
||||
ajax.put("checkedKeys", new ArrayList<>());
|
||||
ajax.put("menus", new ArrayList<>());
|
||||
return ajax;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -73,7 +73,9 @@ public class XhpcUserPrivilegeController extends BaseController {
|
||||
Long userId = list.get(0).getUserId();
|
||||
iXhpcUserPrivilegeService.deleteByIds(userId);
|
||||
for (XhpcUserPrivilege xhpcUserPrivilege : list) {
|
||||
iXhpcUserPrivilegeService.insert(xhpcUserPrivilege);
|
||||
if(xhpcUserPrivilege.getChargingStationId() !=null){
|
||||
iXhpcUserPrivilegeService.insert(xhpcUserPrivilege);
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
package com.xhpc.system.domain;
|
||||
|
||||
import com.xhpc.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
/**
|
||||
* 数据维度
|
||||
* @author yuyang
|
||||
* @date 2021/10/26 14:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class XhpcDataDimension extends BaseEntity {
|
||||
|
||||
/** 数据维度ID */
|
||||
private Long dataDimensionId;
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
/** 场站ID */
|
||||
private Long chargingStationId;
|
||||
/** 状态(0显示 1隐藏) */
|
||||
private Integer status;
|
||||
/** 删除状态(0显示 1隐藏) */
|
||||
private Integer delFlag;
|
||||
|
||||
public Long getDataDimensionId() {
|
||||
|
||||
return dataDimensionId;
|
||||
}
|
||||
|
||||
public void setDataDimensionId(Long dataDimensionId) {
|
||||
|
||||
this.dataDimensionId = dataDimensionId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getChargingStationId() {
|
||||
|
||||
return chargingStationId;
|
||||
}
|
||||
|
||||
public void setChargingStationId(Long chargingStationId) {
|
||||
|
||||
this.chargingStationId = chargingStationId;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getDelFlag() {
|
||||
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(Integer delFlag) {
|
||||
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.xhpc.system.mapper;
|
||||
|
||||
import com.xhpc.system.domain.XhpcDataDimension;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2021/10/26 14:16
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface XhpcDataDimensionMapper {
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单树信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 选中菜单列表
|
||||
*/
|
||||
public List<Integer> selectByUserId(@Param("userId")Long userId);
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有运营商
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<Map<String,Object>> buildMenuTreeSelect();
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package com.xhpc.system.service;
|
||||
|
||||
import com.xhpc.system.domain.SysMenu;
|
||||
import com.xhpc.system.domain.XhpcDataDimension;
|
||||
import com.xhpc.system.domain.vo.TreeSelect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2021/10/26 14:15
|
||||
* @Version 1.0
|
||||
*/
|
||||
public interface IXhpcDataDimensionService {
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单树信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 选中菜单列表
|
||||
*/
|
||||
public List<Integer> selectByUserId(Long userId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询数据维度菜单列表
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<TreeSelect> buildMenuTreeSelect();
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.xhpc.system.service.impl;
|
||||
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import com.xhpc.system.domain.SysMenu;
|
||||
import com.xhpc.system.domain.XhpcDataDimension;
|
||||
import com.xhpc.system.domain.vo.TreeSelect;
|
||||
import com.xhpc.system.mapper.XhpcDataDimensionMapper;
|
||||
import com.xhpc.system.service.IXhpcDataDimensionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author yuyang
|
||||
* @date 2021/10/26 14:16
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
public class XhpcDataDimensionServiceImpl implements IXhpcDataDimensionService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private XhpcDataDimensionMapper xhpcDataDimensionMapper;
|
||||
|
||||
@Override
|
||||
public List<Integer> selectByUserId(Long userId) {
|
||||
|
||||
return xhpcDataDimensionMapper.selectByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeSelect> buildMenuTreeSelect() {
|
||||
List<TreeSelect> treeSelectList =new ArrayList<TreeSelect>();
|
||||
//拼接树
|
||||
//获取所有运营商和场站
|
||||
List<Map<String, Object>> list = xhpcDataDimensionMapper.buildMenuTreeSelect();
|
||||
|
||||
if(list !=null && list.size()>0){
|
||||
for (int i = 0; i <list.size() ; i++) {
|
||||
TreeSelect treeSelect =new TreeSelect();
|
||||
Map<String, Object> map = list.get(i);
|
||||
treeSelect.setId(Long.valueOf(map.get("operatorId").toString()));
|
||||
treeSelect.setLabel(map.get("operatorName").toString());
|
||||
if(map.get("chargingStationId") !=null){
|
||||
String[] ids = map.get("chargingStationId").toString().split(",");
|
||||
String[] names = map.get("chargingStationName").toString().split(",");
|
||||
List<TreeSelect> treeSelectList1 =new ArrayList<TreeSelect>();
|
||||
for (int j = 0; j <ids.length ; j++) {
|
||||
TreeSelect ts =new TreeSelect();
|
||||
ts.setId(Long.valueOf(ids[j]));
|
||||
ts.setLabel(names[j]);
|
||||
treeSelectList1.add(ts);
|
||||
}
|
||||
treeSelect.setChildren(treeSelectList1);
|
||||
}
|
||||
treeSelectList.add(treeSelect);
|
||||
}
|
||||
}
|
||||
return treeSelectList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
<?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.system.mapper.XhpcDataDimensionMapper">
|
||||
|
||||
<resultMap type="com.xhpc.system.domain.XhpcDataDimension" id="XhpcDataDimensionResult">
|
||||
<id property="dataDimensionId" column="data_dimension_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="chargingStationId" column="charging_station_id"/>
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectByUserId" resultType="Integer">
|
||||
select charging_station_id
|
||||
from xhpc_data_dimension
|
||||
where user_id = #{userId} and status=0 and del_flag=0
|
||||
order by charging_station_id
|
||||
</select>
|
||||
|
||||
<select id="buildMenuTreeSelect" resultType="map">
|
||||
SELECT
|
||||
concat("9999",opn.operator_id) operatorId,
|
||||
opn.name as operatorName,
|
||||
(select group_concat(charging_station_id) from xhpc_charging_station where operator_id=opn.operator_id and del_flag =0) chargingStationId,
|
||||
(select group_concat(name) from xhpc_charging_station where operator_id=opn.operator_id and del_flag =0) chargingStationName
|
||||
FROM
|
||||
xhpc_operator as opn
|
||||
WHERE
|
||||
opn.del_flag = 0
|
||||
ORDER BY operator_id desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -32,6 +32,8 @@
|
||||
<result property="imgId" column="img_id"/>
|
||||
<result property="businessInstructions" column="business_instructions"/>
|
||||
<result property="reminderInstructions" column="reminder_instructions"/>
|
||||
<result property="serviceTel" column="service_tel"/>
|
||||
<result property="parkNums" column="park_nums"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXhpcChargingStationVo">
|
||||
@ -240,6 +242,8 @@
|
||||
ct.reminder_instructions as reminderInstructions,
|
||||
ct.client_visible as clientVisible,
|
||||
ct.img_id as imgId,
|
||||
ct.service_tel as serviceTel,
|
||||
ct.park_nums as parkNums,
|
||||
GROUP_CONCAT(DISTINCT xdbs.dict_value ORDER BY xdbs.create_time ASC separator ',' ) serviceFacilitiesName,
|
||||
GROUP_CONCAT(DISTINCT xdbp.dict_value ORDER BY xdbp.create_time ASC separator ',' ) peripheryFacilitiesName
|
||||
from xhpc_charging_station as ct
|
||||
|
||||
@ -5,6 +5,7 @@ import com.xhpc.common.core.constant.ServiceNameConstants;
|
||||
import com.xhpc.common.core.domain.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Map;
|
||||
@ -18,6 +19,6 @@ import java.util.Map;
|
||||
public interface SmsService {
|
||||
|
||||
@PostMapping("/sms/send")
|
||||
R sendNotice(@RequestParam(value = "phone") String phone, @RequestParam(value = "content") String content, Map<String, String> paramMap);
|
||||
R sendNotice(@RequestBody Map<String, String> paramMap);
|
||||
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ public class SmsFallbackFactory implements FallbackFactory<SmsService> {
|
||||
logger.error("短信发送服务调用失败:{} //fallback", cause.getMessage());
|
||||
return new SmsService() {
|
||||
@Override
|
||||
public R sendNotice(String phone, String content, Map<String, String> paramMap) {
|
||||
public R sendNotice(Map<String, String> paramMap) {
|
||||
|
||||
return R.fail("短信发送失败:" + cause.getMessage());
|
||||
}
|
||||
|
||||
@ -31,11 +31,11 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
|
||||
/** 建设场所 */
|
||||
@Excel(name = "建设场所")
|
||||
private String constructionSite;
|
||||
private Integer constructionSite;
|
||||
|
||||
/** 电站类型 */
|
||||
@Excel(name = "电站类型")
|
||||
private String stationType;
|
||||
private Integer stationType;
|
||||
|
||||
/** 服务设施 */
|
||||
@Excel(name = "服务设施")
|
||||
@ -105,6 +105,18 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
*/
|
||||
private String operatorIdEvcs;
|
||||
|
||||
/**
|
||||
* 站点电话
|
||||
*/
|
||||
private String serviceTel;
|
||||
|
||||
|
||||
/**
|
||||
*侧位数量
|
||||
*/
|
||||
private String parkNums;
|
||||
|
||||
|
||||
public String getOperatorIdEvcs() {
|
||||
|
||||
return operatorIdEvcs;
|
||||
@ -151,19 +163,6 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setConstructionSite(String constructionSite)
|
||||
{
|
||||
this.constructionSite = constructionSite;
|
||||
}
|
||||
|
||||
public String getConstructionSite()
|
||||
{
|
||||
return constructionSite;
|
||||
}
|
||||
public void setServiceFacilities(String serviceFacilities)
|
||||
{
|
||||
this.serviceFacilities = serviceFacilities;
|
||||
}
|
||||
|
||||
public String getServiceFacilities()
|
||||
{
|
||||
@ -308,14 +307,49 @@ public class XhpcChargingStation extends BaseEntity {
|
||||
this.reminderInstructions = reminderInstructions;
|
||||
}
|
||||
|
||||
public String getStationType() {
|
||||
public Integer getConstructionSite() {
|
||||
|
||||
return constructionSite;
|
||||
}
|
||||
|
||||
public void setConstructionSite(Integer constructionSite) {
|
||||
|
||||
this.constructionSite = constructionSite;
|
||||
}
|
||||
|
||||
public Integer getStationType() {
|
||||
|
||||
return stationType;
|
||||
}
|
||||
|
||||
public void setStationType(String stationType) {
|
||||
public void setStationType(Integer stationType) {
|
||||
|
||||
this.stationType = stationType;
|
||||
}
|
||||
|
||||
public void setServiceFacilities(String serviceFacilities) {
|
||||
|
||||
this.serviceFacilities = serviceFacilities;
|
||||
}
|
||||
|
||||
public String getServiceTel() {
|
||||
|
||||
return serviceTel;
|
||||
}
|
||||
|
||||
public void setServiceTel(String serviceTel) {
|
||||
|
||||
this.serviceTel = serviceTel;
|
||||
}
|
||||
|
||||
public String getParkNums() {
|
||||
|
||||
return parkNums;
|
||||
}
|
||||
|
||||
public void setParkNums(String parkNums) {
|
||||
|
||||
this.parkNums = parkNums;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,14 +19,13 @@
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<!-- 阿里巴巴的短信服务依赖 -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>dysmsapi20170525</artifactId>
|
||||
<version>2.0.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
||||
@ -45,48 +45,33 @@ public class XhpcSmsController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping(value = "/send")
|
||||
public void send(@RequestParam(required = false) String phone, String content, @RequestBody Map<String, String> paramMap) {
|
||||
public void send(@RequestBody Map<String, String> paramMap) {
|
||||
|
||||
|
||||
String signatureName = null;
|
||||
String templateId = null;
|
||||
|
||||
//方便使用PostMan调用接口测试
|
||||
if (phone != null && content != null) {
|
||||
//判断内容是什么,调用相应的模板
|
||||
if (content.contains("电量为")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226945037";
|
||||
} else if (content.contains("总费用为")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226786374";
|
||||
} else if (content.contains("余额小于")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226935795";
|
||||
} else if (content.contains("设定的SOC")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_227005968";
|
||||
}
|
||||
} else {
|
||||
phone = paramMap.get("phone");
|
||||
content = paramMap.get("content");
|
||||
paramMap.remove("phone");
|
||||
paramMap.remove("content");
|
||||
//判断内容是什么,调用相应的模板
|
||||
if (content.contains("电量为")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226945037";
|
||||
} else if (content.contains("总费用为")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226786374";
|
||||
} else if (content.contains("余额小于")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226935795";
|
||||
} else if (content.contains("设定的SOC")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_227005968";
|
||||
}
|
||||
|
||||
String phone = paramMap.get("phone");
|
||||
String content = paramMap.get("content");
|
||||
paramMap.remove("phone");
|
||||
paramMap.remove("content");
|
||||
//判断内容是什么,调用相应的模板
|
||||
if (content.contains("电量为")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226945037";
|
||||
} else if (content.contains("总费用为")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226786374";
|
||||
} else if (content.contains("余额小于")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_226935795";
|
||||
} else if (content.contains("设定的SOC")) {
|
||||
signatureName = "小华充电";
|
||||
templateId = "SMS_227005968";
|
||||
}
|
||||
|
||||
xhpcSmsService.sendNotice(phone, signatureName, templateId, paramMap);
|
||||
}
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService {
|
||||
return AjaxResult.error(1012, "服务器繁忙,请稍后再试");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//e.printStackTrace();
|
||||
e.printStackTrace();
|
||||
xhpcSms.setStatus(3);
|
||||
xhpcSmsMapper.addXhpcSms(xhpcSms);
|
||||
return AjaxResult.error(1010,"服务器繁忙,请稍后再试");
|
||||
@ -195,12 +195,12 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService {
|
||||
//获取发送结果状态码
|
||||
String statusCode = sendSmsResponse.getBody().getCode();
|
||||
//获取短信的Biz号
|
||||
String bizId = sendSmsResponse.getBody().getBizId();
|
||||
//String bizId = sendSmsResponse.getBody().getBizId();
|
||||
//获取短信的发送日期,并将其转换为yyyyMMdd的格式
|
||||
String date = sendSmsResponse.getHeaders().get("date");
|
||||
Date realDate = new Date(date);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
String formatData = sdf.format(realDate);
|
||||
//String date = sendSmsResponse.getHeaders().get("date");
|
||||
//Date realDate = new Date(date);
|
||||
//SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
//String formatData = sdf.format(realDate);
|
||||
|
||||
//获取实际的模板内容
|
||||
String templateContent = getTemplateContent(templateId, paramMap);
|
||||
|
||||
@ -154,6 +154,14 @@ public class XhpcChargeOrderController extends BaseController {
|
||||
data.put("parkingInstructions","充电完成请尽快离场,超时车位占用费10元/小时");
|
||||
map.put("data", data);
|
||||
}else{
|
||||
try{
|
||||
String c = orderMessage.get("electricCurrent").toString();
|
||||
String v = orderMessage.get("voltage").toString();
|
||||
BigDecimal decimal1 = new BigDecimal(v).multiply(new BigDecimal(c)).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
orderMessage.put("power",decimal1);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
map.put("data",orderMessage);
|
||||
}
|
||||
JSONObject json = new JSONObject(map);
|
||||
|
||||
@ -80,7 +80,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
* 终端统计
|
||||
*/
|
||||
@GetMapping("/test3")
|
||||
//@Scheduled(cron = "0 0 12 * * ?")
|
||||
@Scheduled(cron = "0 0 12 * * ?")
|
||||
public void test3(){
|
||||
add(100,3);
|
||||
}
|
||||
@ -88,7 +88,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
* 场站统计
|
||||
*/
|
||||
@GetMapping("/test2")
|
||||
//@Scheduled(cron = "0 0 11 * * ?")
|
||||
@Scheduled(cron = "0 0 11 * * ?")
|
||||
public void test2(){
|
||||
add(100,2);
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
* 日期统计
|
||||
*/
|
||||
@GetMapping("/test1")
|
||||
//@Scheduled(cron = "0 0 00 * * ?")
|
||||
@Scheduled(cron = "0 0 00 * * ?")
|
||||
public void test1(){
|
||||
//获取500条待统计历史订单
|
||||
//跨时段,跨费率,计费模型
|
||||
@ -171,7 +171,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
* 小时统计
|
||||
*/
|
||||
@GetMapping("/test")
|
||||
//@Scheduled(cron = "0 */1 * * * ?")
|
||||
@Scheduled(cron = "0 */1 * * * ?")
|
||||
public void test(){
|
||||
//获取500条待统计历史订单
|
||||
//跨时段,跨费率,计费模型
|
||||
@ -275,7 +275,7 @@ public class XhpcHistoryOrderController extends BaseController {
|
||||
* 24小时异常订单自动结算
|
||||
*/
|
||||
@GetMapping("/test4")
|
||||
//@Scheduled(cron = "0 0/5 * * * ?")
|
||||
@Scheduled(cron = "0 0/5 * * * ?")
|
||||
public void test4(){
|
||||
//获取异常的订单 24小时之外的异常订单
|
||||
List<XhpcChargeOrder> xhpcChargeOrderList= chargeOrderService.getXhpcChargeOrderStatus(2, 0);
|
||||
|
||||
@ -380,13 +380,15 @@ public class XhpcHistoryOrderServiceImpl implements IXhpcHistoryOrderService {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("elec", xhpcChargeOrder.getEndSoc());
|
||||
paramMap.put("sumMoney", actPrice.toString());
|
||||
String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。";
|
||||
smsService.sendNotice(user.get("phone").toString(), content, paramMap);
|
||||
paramMap.put("phone", user.get("phone").toString());
|
||||
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
||||
smsService.sendNotice(paramMap);
|
||||
}else {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("sumMoney", actPrice.toString());
|
||||
String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。";
|
||||
smsService.sendNotice(user.get("phone").toString(), content, paramMap);
|
||||
paramMap.put("phone", user.get("phone").toString());
|
||||
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
||||
smsService.sendNotice(paramMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -386,13 +386,15 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("elec", xhpcChargeOrder.getEndSoc());
|
||||
paramMap.put("sumMoney", actPrice.toString());
|
||||
String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。";
|
||||
smsService.sendNotice(user.get("phone").toString(), content, paramMap);
|
||||
paramMap.put("phone", user.get("phone").toString());
|
||||
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,电量为:" + xhpcChargeOrder.getEndSoc() + "%,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
||||
smsService.sendNotice(paramMap);
|
||||
}else {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("sumMoney", actPrice.toString());
|
||||
String content = "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。";
|
||||
smsService.sendNotice(user.get("phone").toString(), content, paramMap);
|
||||
paramMap.put("phone", user.get("phone").toString());
|
||||
paramMap.put("content", "【小华停止充电】尊敬的用户,你的爱车已停止充电,总费用为:" + actPrice + "元,充电费用明细,请查询小华充电小程序,谢谢。");
|
||||
smsService.sendNotice(paramMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -569,6 +571,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
||||
}
|
||||
BigDecimal v = new BigDecimal(cacheRealtimeData.getWorkingVoltage()).divide(new BigDecimal(10));
|
||||
BigDecimal c = new BigDecimal(cacheRealtimeData.getWorkingCurrent()).divide(new BigDecimal(10));
|
||||
BigDecimal decimal1 = v.multiply(c).setScale(2, BigDecimal.ROUND_DOWN);
|
||||
xhpcRealTimeOrder.setVoltage(v);
|
||||
xhpcRealTimeOrder.setElectricCurrent(c);
|
||||
xhpcRealTimeOrder.setGunLineTemperature(cacheRealtimeData.getGunLineTemperature());
|
||||
@ -648,7 +651,7 @@ public class XhpcRealTimeOrderServiceImpl implements IXhpcRealTimeOrderService {
|
||||
data.put("chargingTime",xhpcRealTimeOrder.getChargingTime());
|
||||
data.put("electricCurrent",c);
|
||||
data.put("voltage", v);
|
||||
data.put("power", xhpcChargeOrder.getPower());
|
||||
data.put("power", decimal1);
|
||||
data.put("chargingDegree", chargingDegree);
|
||||
data.put("remainingTime",xhpcRealTimeOrder.getRemainingTime());
|
||||
data.put("serialNumber",orderNo.substring(0,16));
|
||||
|
||||
@ -92,10 +92,13 @@ public class WxPaymentController {
|
||||
}
|
||||
}
|
||||
//用户信息id
|
||||
String userId = StringUtils.valueOf(map.get("userId"));
|
||||
if (StringUtils.isEmpty(userId)) {
|
||||
return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
|
||||
if(map.get("userId") ==null || "".equals(map.get("userId").toString())){
|
||||
return AjaxResult.error(HttpStatus.NOT_NULL, "请在我的里面进行充值");
|
||||
}
|
||||
String userId = StringUtils.valueOf(map.get("userId"));
|
||||
// if (StringUtils.isEmpty(userId)) {
|
||||
// return AjaxResult.error(HttpStatus.NOT_NULL, "用户信息不能为空");
|
||||
// }
|
||||
Map<String, Object> refundOrder = iXhpcRefundOrderService.getNotRefundOrder(Long.parseLong(userId));
|
||||
if (StringUtils.isNotNull(refundOrder)) {
|
||||
return AjaxResult.error(HttpStatus.ALREADY_EXISTING, "用户存正在退款");
|
||||
|
||||
@ -36,8 +36,11 @@ import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.ssl.SSLContexts;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -72,6 +75,7 @@ public class XhpcRefundAuditController extends BaseController {
|
||||
@Autowired
|
||||
private Environment environment;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(XhpcRefundAuditController.class);
|
||||
/**
|
||||
* 退款审核
|
||||
*
|
||||
@ -83,6 +87,11 @@ public class XhpcRefundAuditController extends BaseController {
|
||||
@Transactional
|
||||
public AjaxResult info(@RequestBody XhpcRefundAudit xhpcRefundAudit) {
|
||||
|
||||
return getAjaxResult(xhpcRefundAudit);
|
||||
}
|
||||
|
||||
private AjaxResult getAjaxResult(XhpcRefundAudit xhpcRefundAudit) {
|
||||
|
||||
Long refundOrderId = xhpcRefundAudit.getRefundOrderId();
|
||||
Map<String, Object> map = iXhpcRefundOrderService.info(refundOrderId);
|
||||
|
||||
@ -499,4 +508,32 @@ public class XhpcRefundAuditController extends BaseController {
|
||||
refundOrder.setStatus(status);
|
||||
iXhpcRefundOrderService.update(refundOrder);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定时任务,每5分钟,扫描一次,退款订单金额小于100,自动审核通过
|
||||
*
|
||||
*/
|
||||
@Scheduled(cron = "0 */5 * * * ?")
|
||||
@GetMapping("/moneyPage")
|
||||
public void moneyPage(){
|
||||
try {
|
||||
List<Long> list = iXhpcRefundOrderService.moneyPage();
|
||||
if(list !=null && list.size()>0){
|
||||
for (int i = 0; i <list.size() ; i++) {
|
||||
Long aLong = list.get(i);
|
||||
XhpcRefundAudit xhpcRefundAudit =new XhpcRefundAudit();
|
||||
xhpcRefundAudit.setRefundOrderId(aLong);
|
||||
xhpcRefundAudit.setStatus(1);
|
||||
xhpcRefundAudit.setRemark("自动审核通过");
|
||||
getAjaxResult(xhpcRefundAudit);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
logger.info("++++++++++++自动审核异常++++++++++++++++");
|
||||
e.printStackTrace();
|
||||
//后期可以增加短信通知
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -91,4 +91,10 @@ public interface XhpcRefundOrderMapper {
|
||||
* 判断用户是否有异常订单未处理
|
||||
*/
|
||||
int countXhpcChargeOrder(@Param("userId")Long userId);
|
||||
|
||||
|
||||
/**
|
||||
* 定时任务,每1小时,扫描一次,退款订单金额小于100,自动审核通过
|
||||
*/
|
||||
public List<Long> moneyPage();
|
||||
}
|
||||
|
||||
@ -81,4 +81,8 @@ public interface IXhpcRefundOrderService {
|
||||
*/
|
||||
int countXhpcChargeOrder(Long userId);
|
||||
|
||||
/**
|
||||
* 定时任务,每5分钟,扫描一次,退款订单金额小于100,自动审核通过
|
||||
*/
|
||||
public List<Long> moneyPage();
|
||||
}
|
||||
@ -143,4 +143,10 @@ public class XhpcRefundOrderServiceImpl implements IXhpcRefundOrderService {
|
||||
return xhpcRefundOrderMapper.countXhpcChargeOrder(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> moneyPage() {
|
||||
|
||||
return xhpcRefundOrderMapper.moneyPage();
|
||||
}
|
||||
|
||||
}
|
||||
@ -231,4 +231,10 @@
|
||||
<select id="countXhpcChargeOrder" resultType="int">
|
||||
select count(charge_order_id) from xhpc_charge_order where user_id =#{userId} and status =2 and del_flag =0
|
||||
</select>
|
||||
|
||||
<select id="moneyPage" resultType="long">
|
||||
select xro.refund_order_id refundOrderId
|
||||
from xhpc_refund_order xro
|
||||
where xro.del_flag = 0 and xro.examine_status=0 and xro.status=0 and amount<=100
|
||||
</select>
|
||||
</mapper>
|
||||
@ -147,9 +147,9 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
if (r.getCode() == 200) {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("battery", stopSoc.toString());
|
||||
smsService.sendNotice(tel, "【小华充电】尊敬的用户,你的车辆已充电达至设定的SOC("
|
||||
.concat(stopSoc.toString())
|
||||
.concat("%)已自动停止充电,请您尽快将车辆挪走以方便他人使用充电桩,谢谢合作。"), paramMap);
|
||||
paramMap.put("phone", tel);
|
||||
paramMap.put("content", "【小华充电】尊敬的用户,你的车辆已充电达至设定的SOC("+stopSoc.toString()+"%)已自动停止充电,请您尽快将车辆挪走以方便他人使用充电桩,谢谢合作。");
|
||||
smsService.sendNotice(paramMap);
|
||||
cacheOrder.put("socalerted", "true");
|
||||
}
|
||||
}
|
||||
@ -160,7 +160,9 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
if (alerted == null && tel != null) {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("money", "5");
|
||||
smsService.sendNotice(tel, "【小华充电】尊敬的用户,你的账户余额小于5元,为不影响您的正常充电,请您尽快充值交费,谢谢。", paramMap);
|
||||
paramMap.put("phone", tel);
|
||||
paramMap.put("content", "【小华充电】尊敬的用户,你的账户余额小于5元,为不影响您的正常充电,请您尽快充值交费,谢谢。");
|
||||
smsService.sendNotice(paramMap);
|
||||
cacheOrder.put("lt5alerted", "true");
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class XhpcInternetUserController extends BaseController {
|
||||
Long[] role = new Long[1];
|
||||
role[0] = 4L;
|
||||
sysUser.setRoleIds(role);
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName()) > 0) {
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName(),null) > 0) {
|
||||
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ public class XhpcOperatorController extends BaseController {
|
||||
Long[] roleIds = new Long[1];
|
||||
roleIds[0] = 3L;
|
||||
sysUser.setRoleIds(roleIds);
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName()) > 0) {
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName(),null) > 0) {
|
||||
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
iXhpcOperatorService.insert(xhpcOperator);
|
||||
|
||||
@ -18,11 +18,12 @@ import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 运营商
|
||||
* 用户管理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@ -36,6 +37,7 @@ public class XhpcUserController extends BaseController {
|
||||
@Autowired
|
||||
private IXhpcOperatorService iXhpcOperatorService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取平台用户分页列表
|
||||
*/
|
||||
@ -54,7 +56,7 @@ public class XhpcUserController extends BaseController {
|
||||
@RequiresRoles("admin")
|
||||
@PostMapping("/pc/add")
|
||||
public AjaxResult pcAdd(@RequestBody SysUser sysUser) {
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName()) > 0) {
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName(),null) > 0) {
|
||||
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
SysRole role = new SysRole();
|
||||
@ -64,15 +66,16 @@ public class XhpcUserController extends BaseController {
|
||||
iXhpcUserService.insertRole(role);
|
||||
sysUser.setPhonenumber(sysUser.getUserName());
|
||||
sysUser.setDeptId(103L);
|
||||
sysUser.setDataPowerType(StatusConstants.SON_POWER_TYPE);
|
||||
sysUser.setDataPowerType(StatusConstants.ALL_POWER_TYPE);
|
||||
sysUser.setUserType(StatusConstants.SYSTEM_USER_TYPE);
|
||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||
sysUser.setPassword(sysUser.getUserName());
|
||||
sysUser.setAvatar("https://xhpc-bucket1.oss-cn-hangzhou.aliyuncs.com/avatar/logo.png");
|
||||
sysUser.setPassword("123456");
|
||||
Long[] roles = new Long[1];
|
||||
roles[0] = role.getRoleId();
|
||||
sysUser.setRoleIds(roles);
|
||||
iXhpcUserService.insertUser(sysUser);
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ -86,10 +89,11 @@ public class XhpcUserController extends BaseController {
|
||||
if (null == sysUser.getUserId()) {
|
||||
return AjaxResult.error(HttpStatus.NOT_NULL, "用户id不能为空");
|
||||
}
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName()) > 0) {
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName(),sysUser.getUserId()) > 0) {
|
||||
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
iXhpcUserService.insertUser(sysUser);
|
||||
|
||||
iXhpcUserService.updateUser(sysUser);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@ -126,7 +130,7 @@ public class XhpcUserController extends BaseController {
|
||||
if (null == sysUser.getOperatorId()) {
|
||||
return AjaxResult.error(HttpStatus.NOT_NULL, "所属运营商不能为空");
|
||||
}
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName()) > 0) {
|
||||
if (iXhpcUserService.checkUserNameUnique(sysUser.getUserName(),null) > 0) {
|
||||
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
|
||||
}
|
||||
SysRole role = new SysRole();
|
||||
@ -204,4 +208,44 @@ public class XhpcUserController extends BaseController {
|
||||
iXhpcOperatorService.removeUser(Long.parseLong(userId));
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@PostMapping("/reset")
|
||||
public AjaxResult reset(@RequestParam Long userId){
|
||||
|
||||
Long userIds = SecurityUtils.getUserId();
|
||||
SysUser sysUser = iXhpcUserService.pcInfo(userIds);
|
||||
if("00".equals(sysUser.getUserType())){
|
||||
SysUser user = iXhpcUserService.pcInfo(userId);
|
||||
user.setPassword("123456");
|
||||
iXhpcUserService.updateUser(user);
|
||||
}else{
|
||||
return AjaxResult.error("无访问权限");
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void addXhpcDataDimension(Long[] menuIds,Long userId){
|
||||
if(menuIds !=null){
|
||||
//添加数据维度
|
||||
System.out.println(menuIds.toString());
|
||||
if(menuIds !=null && menuIds.length>0){
|
||||
for (int i = 0; i <menuIds.length ; i++) {
|
||||
Long menuId =menuIds[i];
|
||||
//区分父级和子集
|
||||
if(menuId>99990 && "9999".equals(menuId.toString().substring(0,4))){
|
||||
continue;
|
||||
}
|
||||
iXhpcUserService.addXhpcDataDimension(userId,menuId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +128,20 @@ public interface XhpcUserMapper {
|
||||
* @param userName 用户名称
|
||||
* @return 结果
|
||||
*/
|
||||
public int checkUserNameUnique(String userName);
|
||||
public int checkUserNameUnique(@Param("userName")String userName,@Param("userId")Long userId);
|
||||
|
||||
|
||||
/**
|
||||
* 保存数据维度
|
||||
* @param userId
|
||||
* @param chargingStationId
|
||||
*/
|
||||
public void addXhpcDataDimension(@Param("userId")Long userId,@Param("chargingStationId")Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
* 删除数据维度
|
||||
* @param userId
|
||||
*/
|
||||
public void updateXhpcDataDimension(@Param("userId")Long userId);
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ public interface IXhpcUserService {
|
||||
* @param userId 用户id
|
||||
* @return 结果
|
||||
*/
|
||||
public Map<String, Object> pcInfo(Long userId);
|
||||
public SysUser pcInfo(Long userId);
|
||||
|
||||
/**
|
||||
* 获取运营商用户分页列表
|
||||
@ -105,7 +105,7 @@ public interface IXhpcUserService {
|
||||
* @param userName 账号
|
||||
* @return
|
||||
*/
|
||||
public int checkUserNameUnique(String userName);
|
||||
public int checkUserNameUnique(String userName,Long userId);
|
||||
|
||||
/**
|
||||
* 修改保存用户信息
|
||||
@ -114,4 +114,18 @@ public interface IXhpcUserService {
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUser(SysUser user);
|
||||
|
||||
/**
|
||||
* 保存数据维度
|
||||
* @param userId
|
||||
* @param chargingStationId
|
||||
*/
|
||||
public void addXhpcDataDimension(Long userId,Long chargingStationId);
|
||||
|
||||
|
||||
/**
|
||||
* 删除数据维度
|
||||
* @param userId
|
||||
*/
|
||||
public void updateXhpcDataDimension(Long userId);
|
||||
}
|
||||
|
||||
@ -126,6 +126,18 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
||||
}
|
||||
XhpcAppUser info = xhpcAppUserMapper.getAppUserByPhone(phone);
|
||||
if (StringUtils.isNotNull(info)) {
|
||||
//判断openid是否存在,不存在重新补充
|
||||
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
|
||||
if (StringUtils.isEmpty(info.getWeixinOpenId())) {
|
||||
info.setWeixinOpenId(openid);
|
||||
xhpcAppUserMapper.update(info);
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isEmpty(info.getAlipayOpenId())) {
|
||||
info.setAlipayOpenId(openid);
|
||||
xhpcAppUserMapper.update(info);
|
||||
}
|
||||
}
|
||||
return R.fail(HttpStatus.ALREADY_EXISTING, "账号已存在");
|
||||
}
|
||||
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
||||
|
||||
@ -58,8 +58,8 @@ public class XhpcUserServiceImpl implements IXhpcUserService {
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> pcInfo(Long userId) {
|
||||
return xhpcUserMapper.pcInfo(userId);
|
||||
public SysUser pcInfo(Long userId) {
|
||||
return xhpcUserMapper.selectUserByUserId(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -147,8 +147,8 @@ public class XhpcUserServiceImpl implements IXhpcUserService {
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int checkUserNameUnique(String userName) {
|
||||
return xhpcUserMapper.checkUserNameUnique(userName);
|
||||
public int checkUserNameUnique(String userName,Long userId) {
|
||||
return xhpcUserMapper.checkUserNameUnique(userName,userId);
|
||||
}
|
||||
|
||||
|
||||
@ -203,4 +203,16 @@ public class XhpcUserServiceImpl implements IXhpcUserService {
|
||||
public int updateUser(SysUser user) {
|
||||
return xhpcUserMapper.update(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addXhpcDataDimension(Long userId, Long chargingStationId) {
|
||||
xhpcUserMapper.addXhpcDataDimension(userId,chargingStationId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateXhpcDataDimension(Long userId) {
|
||||
xhpcUserMapper.updateXhpcDataDimension(userId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
</select>
|
||||
|
||||
<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.user_type userType,
|
||||
su.nick_name nickName, su.email,su.status,su.avatar,
|
||||
su.create_by createBy ,su.create_time createTime,su.`status` ,
|
||||
CASE WHEN su.`status` = 0 THEN '正常' else '禁用' end statusName,
|
||||
@ -127,7 +127,7 @@
|
||||
sdd.dict_label sexName,(select role_id from sys_user_role where user_id = su.user_id LIMIT 1) roleId
|
||||
from sys_user su
|
||||
LEFT JOIN xhpc_operator xo on xo.operator_id = su.operator_id
|
||||
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_value = su.sex
|
||||
WHERE su.del_flag = 0 and user_id = #{userId}
|
||||
</select>
|
||||
|
||||
@ -281,6 +281,18 @@
|
||||
</insert>
|
||||
|
||||
<select id="checkUserNameUnique" parameterType="java.lang.String" resultType="int">
|
||||
select count(1) from sys_user where user_name = #{userName} limit 1
|
||||
select count(1) from sys_user where user_name = #{userName}
|
||||
<if test="userId !=null">
|
||||
and user_id=#{userId}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="addXhpcDataDimension">
|
||||
insert into xhpc_data_dimension(user_id, charging_station_id) values(#{userId},#{chargingStationId})
|
||||
</insert>
|
||||
|
||||
<update id="updateXhpcDataDimension">
|
||||
update xhpc_data_dimension set del_flag = 1 where user_id = #{userId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user