1.密码修改
2.gettoken
This commit is contained in:
parent
2b01d14ea5
commit
1cf0151633
|
@ -34,6 +34,7 @@ import com.ruoyi.system.service.*;
|
||||||
import com.wechat.pay.java.service.refund.model.Refund;
|
import com.wechat.pay.java.service.refund.model.Refund;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -257,7 +258,7 @@ public class AppController extends BaseController
|
||||||
if(modelId != null){
|
if(modelId != null){
|
||||||
list = etFeeRuleService.selectRuleInfoListByModelId(etFeeRule.getModelId());
|
list = etFeeRuleService.selectRuleInfoListByModelId(etFeeRule.getModelId());
|
||||||
}else{
|
}else{
|
||||||
list = etFeeRuleService.selectEtFeeRuleListByAreaId(etFeeRule.getAreaId());
|
list = etFeeRuleService.selectEtFeeRuleList(etFeeRule);
|
||||||
}
|
}
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1615,4 +1615,19 @@ public class AppVerifyController extends BaseController
|
||||||
int result = deptMapper.updateDept(sysDept);
|
int result = deptMapper.updateDept(sysDept);
|
||||||
return toAjax(result);
|
return toAjax(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改运营区
|
||||||
|
*/
|
||||||
|
@Log(title = "运营区", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/areaEdit")
|
||||||
|
public AjaxResult edit(@RequestBody EtOperatingArea etOperatingArea)
|
||||||
|
{
|
||||||
|
if (!etOperatingAreaService.checkAreaNameUnique(etOperatingArea))
|
||||||
|
{
|
||||||
|
return error("修改运营区'" + etOperatingArea.getAreaName() + "'失败,该运营区已存在");
|
||||||
|
}
|
||||||
|
return toAjax(etOperatingAreaService.updateEtOperatingArea(etOperatingArea));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class EtFeeRuleController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 新增收费方式
|
* 新增收费方式
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:fee:add')")
|
// @PreAuthorize("@ss.hasPermi('system:fee:add')")
|
||||||
@Log(title = "收费方式", businessType = BusinessType.INSERT)
|
@Log(title = "收费方式", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody EtFeeRule etFeeRule)
|
public AjaxResult add(@RequestBody EtFeeRule etFeeRule)
|
||||||
|
@ -85,7 +85,7 @@ public class EtFeeRuleController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 修改收费方式
|
* 修改收费方式
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:fee:edit')")
|
// @PreAuthorize("@ss.hasPermi('system:fee:edit')")
|
||||||
@Log(title = "收费方式", businessType = BusinessType.UPDATE)
|
@Log(title = "收费方式", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody EtFeeRule etFeeRule)
|
public AjaxResult edit(@RequestBody EtFeeRule etFeeRule)
|
||||||
|
@ -96,7 +96,7 @@ public class EtFeeRuleController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 删除收费方式
|
* 删除收费方式
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:fee:remove')")
|
// @PreAuthorize("@ss.hasPermi('system:fee:remove')")
|
||||||
@Log(title = "收费方式", businessType = BusinessType.DELETE)
|
@Log(title = "收费方式", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ruleIds}")
|
@DeleteMapping("/{ruleIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ruleIds)
|
public AjaxResult remove(@PathVariable Long[] ruleIds)
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ruoyi.web.controller.system;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.ruoyi.system.service.IAsDeviceService;
|
import com.ruoyi.system.service.IAsDeviceService;
|
||||||
import com.ruoyi.system.service.IEtFeeRuleService;
|
import com.ruoyi.system.service.IEtFeeRuleService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
@ -56,6 +57,16 @@ public class EtModelController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有车辆型号列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/allList")
|
||||||
|
public AjaxResult allList()
|
||||||
|
{
|
||||||
|
List<EtModel> list = etModelService.selectAllEtModelList();
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出车辆型号列表
|
* 导出车辆型号列表
|
||||||
*/
|
*/
|
||||||
|
@ -72,7 +83,7 @@ public class EtModelController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 获取车辆型号详细信息
|
* 获取车辆型号详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:model:query')")
|
// @PreAuthorize("@ss.hasPermi('system:model:query')")
|
||||||
@GetMapping(value = "/{modelId}")
|
@GetMapping(value = "/{modelId}")
|
||||||
public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
|
public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
|
||||||
{
|
{
|
||||||
|
@ -86,7 +97,7 @@ public class EtModelController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 新增车辆型号
|
* 新增车辆型号
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:model:add')")
|
// @PreAuthorize("@ss.hasPermi('system:model:add')")
|
||||||
@Log(title = "车辆型号", businessType = BusinessType.INSERT)
|
@Log(title = "车辆型号", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody EtModel etModel)
|
public AjaxResult add(@RequestBody EtModel etModel)
|
||||||
|
@ -97,18 +108,19 @@ public class EtModelController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 修改车辆型号
|
* 修改车辆型号
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:model:edit')")
|
// @PreAuthorize("@ss.hasPermi('system:model:edit')")
|
||||||
@Log(title = "车辆型号", businessType = BusinessType.UPDATE)
|
@Log(title = "车辆型号", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody EtModel etModel)
|
public AjaxResult edit(@RequestBody EtModel etModel)
|
||||||
{
|
{
|
||||||
|
logger.info("修改车辆型号:{}", JSON.toJSON(etModel));
|
||||||
return toAjax(etModelService.updateEtModel(etModel));
|
return toAjax(etModelService.updateEtModel(etModel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除车辆型号
|
* 删除车辆型号
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('system:model:remove')")
|
// @PreAuthorize("@ss.hasPermi('system:model:remove')")
|
||||||
@Log(title = "车辆型号", businessType = BusinessType.DELETE)
|
@Log(title = "车辆型号", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{modelIds}")
|
@DeleteMapping("/{modelIds}")
|
||||||
public AjaxResult remove(@PathVariable Long[] modelIds)
|
public AjaxResult remove(@PathVariable Long[] modelIds)
|
||||||
|
|
|
@ -100,6 +100,21 @@ public class SysLoginController
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getToken
|
||||||
|
*
|
||||||
|
* @return 用户信息
|
||||||
|
*/
|
||||||
|
@GetMapping("getToken")
|
||||||
|
public AjaxResult getToken(Long userId)
|
||||||
|
{
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
// 生成令牌
|
||||||
|
String token = loginService.getToken(userId);
|
||||||
|
ajax.put(Constants.TOKEN, token);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取app用户信息
|
* 获取app用户信息
|
||||||
*
|
*
|
||||||
|
|
|
@ -162,6 +162,7 @@ public class SysUserController extends BaseController
|
||||||
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
user.setCreateBy(getUsername());
|
user.setCreateBy(getUsername());
|
||||||
|
user.setInitPassword(user.getPassword());
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
return toAjax(userService.insertUser(user));
|
return toAjax(userService.insertUser(user));
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,6 +155,17 @@ public class SysUser extends BaseEntity
|
||||||
/** 可提现金额 */
|
/** 可提现金额 */
|
||||||
public BigDecimal withdrawableAmount;
|
public BigDecimal withdrawableAmount;
|
||||||
|
|
||||||
|
/** 初始密码 */
|
||||||
|
private String initPassword;
|
||||||
|
|
||||||
|
public String getInitPassword() {
|
||||||
|
return initPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInitPassword(String initPassword) {
|
||||||
|
this.initPassword = initPassword;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCollectionCode() {
|
public String getCollectionCode() {
|
||||||
return collectionCode;
|
return collectionCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -454,4 +454,34 @@ public class SysLoginService
|
||||||
asUserService.updateUserPwd(user.getUserId(), newPassword);
|
asUserService.updateUserPwd(user.getUserId(), newPassword);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getToken(Long userId) {
|
||||||
|
AsUser user = asUserService.selectUserById(userId);
|
||||||
|
if(ObjectUtils.isEmpty(user)) {
|
||||||
|
throw new ServiceException("未查询到用户信息");
|
||||||
|
}
|
||||||
|
Authentication authentication = null; // 用户验证
|
||||||
|
try {
|
||||||
|
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(user.getWxopenid(), Constants.CUSTOM_LOGIN_WX);
|
||||||
|
// 用户名和密码等信息保存在一个上下文中,只要是同一线程等会就能拿到用户名和密码,也就是能在loadUserByUsername(String username)方法中进行密码验证等
|
||||||
|
AuthenticationContextHolder.setContext(authenticationToken);
|
||||||
|
// 把用户类型放在上下文中的details属性中,在UserDetailsServiceImpl.loadUserByUsername中获取
|
||||||
|
authenticationToken.setDetails(Constants.USER_TYPE_APP);
|
||||||
|
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
|
||||||
|
authentication = authenticationManager.authenticate(authenticationToken);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
if (e instanceof BadCredentialsException) {
|
||||||
|
throw new UserPasswordNotMatchException(); //抛出账号或者密码错误的异常
|
||||||
|
} else {
|
||||||
|
throw new ServiceException(e.getMessage()); //抛出其他异常
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
AuthenticationContextHolder.clearContext();
|
||||||
|
}
|
||||||
|
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||||
|
recordAppLoginInfo(loginUser.getUserId());
|
||||||
|
return tokenService.createToken(loginUser);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,13 @@ public interface IEtModelService
|
||||||
*/
|
*/
|
||||||
public List<EtModel> selectEtModelList(EtModel etModel);
|
public List<EtModel> selectEtModelList(EtModel etModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有车辆型号列表
|
||||||
|
*
|
||||||
|
* @return 车辆型号集合
|
||||||
|
*/
|
||||||
|
public List<EtModel> selectAllEtModelList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增车辆型号
|
* 新增车辆型号
|
||||||
*
|
*
|
||||||
|
|
|
@ -20,6 +20,7 @@ import com.ruoyi.system.mapper.SysDeptMapper;
|
||||||
import com.ruoyi.system.service.IAsDeviceService;
|
import com.ruoyi.system.service.IAsDeviceService;
|
||||||
import com.ruoyi.system.service.IEtModelService;
|
import com.ruoyi.system.service.IEtModelService;
|
||||||
import com.ruoyi.system.service.IEtOperatingAreaService;
|
import com.ruoyi.system.service.IEtOperatingAreaService;
|
||||||
|
import com.ruoyi.system.service.IWxPayService;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -65,6 +66,10 @@ public class EtModelServiceImpl implements IEtModelService
|
||||||
@Autowired
|
@Autowired
|
||||||
private ScheduledExecutorService scheduledExecutorService;
|
private ScheduledExecutorService scheduledExecutorService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IWxPayService wxPayService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询车辆型号
|
* 查询车辆型号
|
||||||
|
@ -113,6 +118,17 @@ public class EtModelServiceImpl implements IEtModelService
|
||||||
return etModels;
|
return etModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有车辆型号列表
|
||||||
|
*
|
||||||
|
* @return 车辆型号
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EtModel> selectAllEtModelList() {
|
||||||
|
return etModelMapper.selectEtModelList(new EtModel());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增车辆型号
|
* 新增车辆型号
|
||||||
*
|
*
|
||||||
|
@ -124,10 +140,10 @@ public class EtModelServiceImpl implements IEtModelService
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertEtModel(EtModel etModel)
|
public int insertEtModel(EtModel etModel)
|
||||||
{
|
{
|
||||||
if(etModel.getOperator() == null){
|
if(ObjectUtil.isNotNull(etModel.getAreaId())){
|
||||||
SysUser currentUser = SecurityUtils.getLoginUser().getUser();//获取当前系统用户
|
SysDept deptObjByAreaId = wxPayService.getDeptObjByAreaId(etModel.getAreaId());
|
||||||
if(!currentUser.isAdmin()){
|
if(ObjectUtil.isNotNull(deptObjByAreaId)){
|
||||||
etModel.setOperator(currentUser.getDeptId());
|
etModel.setOperator(deptObjByAreaId.getDeptId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
etModel.setCreateTime(DateUtils.getNowDate());
|
etModel.setCreateTime(DateUtils.getNowDate());
|
||||||
|
@ -171,10 +187,10 @@ public class EtModelServiceImpl implements IEtModelService
|
||||||
@Transactional
|
@Transactional
|
||||||
public int updateEtModel(EtModel etModel)
|
public int updateEtModel(EtModel etModel)
|
||||||
{
|
{
|
||||||
if(etModel.getOperator() != null){
|
if(ObjectUtil.isNotNull(etModel.getAreaId())){
|
||||||
SysUser currentUser = SecurityUtils.getLoginUser().getUser();//获取当前系统用户
|
SysDept deptObjByAreaId = wxPayService.getDeptObjByAreaId(etModel.getAreaId());
|
||||||
if(!currentUser.isAdmin()){
|
if(ObjectUtil.isNotNull(deptObjByAreaId)){
|
||||||
etModel.setOperator(currentUser.getDeptId());
|
etModel.setOperator(deptObjByAreaId.getDeptId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
etModel.setUpdateTime(DateUtils.getNowDate());
|
etModel.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.common.annotation.DataScope;
|
import com.ruoyi.common.annotation.DataScope;
|
||||||
import com.ruoyi.common.constant.ServiceConstants;
|
import com.ruoyi.common.constant.ServiceConstants;
|
||||||
import com.ruoyi.common.constant.UserConstants;
|
import com.ruoyi.common.constant.UserConstants;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
@ -21,10 +22,7 @@ import com.ruoyi.system.mapper.AsDeviceMapper;
|
||||||
import com.ruoyi.system.mapper.EtAreaDeptMapper;
|
import com.ruoyi.system.mapper.EtAreaDeptMapper;
|
||||||
import com.ruoyi.system.mapper.EtAreaRuleMapper;
|
import com.ruoyi.system.mapper.EtAreaRuleMapper;
|
||||||
import com.ruoyi.system.mapper.EtOperatingAreaMapper;
|
import com.ruoyi.system.mapper.EtOperatingAreaMapper;
|
||||||
import com.ruoyi.system.service.IAsDeviceService;
|
import com.ruoyi.system.service.*;
|
||||||
import com.ruoyi.system.service.IEtFeeRuleService;
|
|
||||||
import com.ruoyi.system.service.IEtOperatingAreaService;
|
|
||||||
import com.ruoyi.system.service.IEtParkingAreaService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.locationtech.jts.geom.Coordinate;
|
import org.locationtech.jts.geom.Coordinate;
|
||||||
import org.locationtech.jts.geom.Geometry;
|
import org.locationtech.jts.geom.Geometry;
|
||||||
|
@ -71,6 +69,10 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl<EtOperatingAreaMappe
|
||||||
@Resource
|
@Resource
|
||||||
private IEtParkingAreaService etParkingAreaService;
|
private IEtParkingAreaService etParkingAreaService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IWxPayService wxPayService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询运营区
|
* 查询运营区
|
||||||
|
@ -193,22 +195,16 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl<EtOperatingAreaMappe
|
||||||
String wkt = GeoUtils.wkt(geometry);
|
String wkt = GeoUtils.wkt(geometry);
|
||||||
etOperatingArea.setBoundary(wkt);
|
etOperatingArea.setBoundary(wkt);
|
||||||
int i = dao.updateById(etOperatingArea);
|
int i = dao.updateById(etOperatingArea);
|
||||||
// Long[] ruleIds = etOperatingArea.getRuleIds();
|
if(etOperatingArea.getAreaId() == null){
|
||||||
// if(ObjectUtil.isNotNull(ruleIds)){
|
throw new ServiceException("运营区id没有传");
|
||||||
// etAreaRuleMapper.deleteAreaRuleByAreaId(etOperatingArea.getAreaId());
|
|
||||||
// if(ObjectUtil.isNotNull(ruleIds)){
|
|
||||||
// for (Long ruleId:ruleIds){
|
|
||||||
// etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etOperatingArea.getAreaId()).ruleId(ruleId).build());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
Long deptId = SecurityUtils.getDeptId();
|
|
||||||
if(deptId == 100){
|
|
||||||
deptId = etOperatingArea.getDeptId();
|
|
||||||
}
|
}
|
||||||
if(!ObjectUtil.isNotNull(etOperatingArea.getDeptId()) && deptId == 100){
|
Long areaId = etOperatingArea.getAreaId();
|
||||||
throw new ServiceException("请选择运营商");
|
SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId);
|
||||||
|
if(ObjectUtil.isNull(sysDept)){
|
||||||
|
throw new ServiceException("根据运营区查询运营商为空:areaId = "+areaId);
|
||||||
}
|
}
|
||||||
|
Long deptId = sysDept.getDeptId();
|
||||||
|
etOperatingArea.setDeptId(deptId);
|
||||||
int i1 = etAreaDeptMapper.deleteAreaDeptByAreaId(etOperatingArea.getAreaId());
|
int i1 = etAreaDeptMapper.deleteAreaDeptByAreaId(etOperatingArea.getAreaId());
|
||||||
if(i1 > 0){
|
if(i1 > 0){
|
||||||
etAreaDeptMapper.insert(EtAreaDept.builder().areaId(etOperatingArea.getAreaId()).deptId(deptId).build());
|
etAreaDeptMapper.insert(EtAreaDept.builder().areaId(etOperatingArea.getAreaId()).deptId(deptId).build());
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
@ -431,13 +432,14 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
sysUser.setNickName(dept.getPhone());
|
sysUser.setNickName(dept.getPhone());
|
||||||
sysUser.setPhonenumber(dept.getPhone());
|
sysUser.setPhonenumber(dept.getPhone());
|
||||||
sysUser.setUserType("00");
|
sysUser.setUserType("00");
|
||||||
String password = configService.selectConfigByKey("sys.user.initPassword");
|
String password = IdUtils.randomUUIDByDigit(8);
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
sysUser.setEmail(dept.getEmail());
|
sysUser.setEmail(dept.getEmail());
|
||||||
sysUser.setStatus("0");
|
sysUser.setStatus("0");
|
||||||
sysUser.setDelFlag("0");
|
sysUser.setDelFlag("0");
|
||||||
sysUser.setCreateBy(SecurityUtils.getUsername());
|
sysUser.setCreateBy(SecurityUtils.getUsername());
|
||||||
sysUser.setCreateTime(DateUtils.getNowDate());
|
sysUser.setCreateTime(DateUtils.getNowDate());
|
||||||
|
sysUser.setInitPassword(password);
|
||||||
int rows = userMapper.insertUser(sysUser);
|
int rows = userMapper.insertUser(sysUser);
|
||||||
|
|
||||||
// 添加运营商角色
|
// 添加运营商角色
|
||||||
|
|
|
@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="balance" column="balance" />
|
<result property="balance" column="balance" />
|
||||||
<result property="userType" column="user_type" />
|
<result property="userType" column="user_type" />
|
||||||
<result property="collectionCode" column="collection_code" />
|
<result property="collectionCode" column="collection_code" />
|
||||||
|
<result property="initPassword" column="init_password" />
|
||||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
@ -68,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip,
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip,
|
||||||
u.login_date, u.create_by, u.create_time, u.remark, u.area_id,u.dividend_proportion,u.dividend_item,u.app_user_id, u.cooperation_time,
|
u.login_date, u.create_by, u.create_time, u.remark, u.area_id,u.dividend_proportion,u.dividend_item,u.app_user_id, u.cooperation_time,u.init_password,
|
||||||
u.dividend_status,u.balance, d.dept_name, d.leader,a.area_name areaName from sys_user u
|
u.dividend_status,u.balance, d.dept_name, d.leader,a.area_name areaName from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
left join et_operating_area a on u.area_id = a.area_id
|
left join et_operating_area a on u.area_id = a.area_id
|
||||||
|
@ -188,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="appUserId != null and appUserId != ''">app_user_id,</if>
|
<if test="appUserId != null and appUserId != ''">app_user_id,</if>
|
||||||
<if test="cooperationTime != null">cooperation_time,</if>
|
<if test="cooperationTime != null">cooperation_time,</if>
|
||||||
<if test="dividendStatus != null and dividendStatus != ''">dividend_status,</if>
|
<if test="dividendStatus != null and dividendStatus != ''">dividend_status,</if>
|
||||||
|
<if test="initPassword != null and initPassword != ''">init_password,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="userId != null and userId != ''">#{userId},</if>
|
<if test="userId != null and userId != ''">#{userId},</if>
|
||||||
|
@ -209,6 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="appUserId != null and appUserId != ''">#{appUserId},</if>
|
<if test="appUserId != null and appUserId != ''">#{appUserId},</if>
|
||||||
<if test="cooperationTime != null">#{cooperationTime},</if>
|
<if test="cooperationTime != null">#{cooperationTime},</if>
|
||||||
<if test="dividendStatus != null and dividendStatus != ''">#{dividendStatus},</if>
|
<if test="dividendStatus != null and dividendStatus != ''">#{dividendStatus},</if>
|
||||||
|
<if test="initPassword != null and initPassword != ''">#{initPassword},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
@ -237,6 +240,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="cooperationTime != null">cooperation_time = #{cooperationTime},</if>
|
<if test="cooperationTime != null">cooperation_time = #{cooperationTime},</if>
|
||||||
<if test="dividendStatus != null">dividend_status = #{dividendStatus},</if>
|
<if test="dividendStatus != null">dividend_status = #{dividendStatus},</if>
|
||||||
<if test="collectionCode != null">collection_code = #{collectionCode},</if>
|
<if test="collectionCode != null">collection_code = #{collectionCode},</if>
|
||||||
|
<if test="initPassword != null">init_password = #{initPassword},</if>
|
||||||
update_time = sysdate()
|
update_time = sysdate()
|
||||||
</set>
|
</set>
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
|
@ -265,6 +269,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="appUserId != null">app_user_id = #{appUserId},</if>
|
<if test="appUserId != null">app_user_id = #{appUserId},</if>
|
||||||
<if test="cooperationTime != null">cooperation_time = #{cooperationTime},</if>
|
<if test="cooperationTime != null">cooperation_time = #{cooperationTime},</if>
|
||||||
<if test="dividendStatus != null">dividend_status = #{dividendStatus},</if>
|
<if test="dividendStatus != null">dividend_status = #{dividendStatus},</if>
|
||||||
|
<if test="initPassword != null">init_password = #{initPassword},</if>
|
||||||
update_time = sysdate()
|
update_time = sysdate()
|
||||||
</set>
|
</set>
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user