Commit 6cb61c56 authored by 赵啸非's avatar 赵啸非

修改用户登录,数据库表等

parent 34cd5ee0
...@@ -5,7 +5,10 @@ import com.mortals.xhx.feign.req.BaseUserQuery; ...@@ -5,7 +5,10 @@ import com.mortals.xhx.feign.req.BaseUserQuery;
import com.mortals.xhx.feign.req.BaseUserReq; import com.mortals.xhx.feign.req.BaseUserReq;
import com.mortals.xhx.feign.rsp.ApiResp; import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.feign.rsp.UserRsp; import com.mortals.xhx.feign.rsp.UserRsp;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/** /**
...@@ -14,7 +17,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -14,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
* @author: zxfei * @author: zxfei
* @date: 2022/5/30 10:40 * @date: 2022/5/30 10:40
*/ */
@FeignClient(name = "base-manager", path = "/zwfw") @FeignClient(name = "base-manager", path = "/zwfw", fallback = AreaFeignFallbackFactory.class)
public interface IApiAreaFeign extends IFeign { public interface IApiAreaFeign extends IFeign {
/** /**
...@@ -25,7 +28,24 @@ public interface IApiAreaFeign extends IFeign { ...@@ -25,7 +28,24 @@ public interface IApiAreaFeign extends IFeign {
*/ */
@GetMapping(value = "/area/getListByParentId") @GetMapping(value = "/area/getListByParentId")
String getListByParentId(@RequestParam(value = "parentId") String parentId, String getListByParentId(@RequestParam(value = "parentId") String parentId,
@RequestHeader(name = "Authorization",required = true) String token); @RequestHeader(name = "Authorization", required = true) String token);
} }
@Slf4j
@Component
class AreaFeignFallbackFactory implements FallbackFactory<IApiAreaFeign> {
@Override
public IApiAreaFeign create(Throwable t) {
return new IApiAreaFeign() {
@Override
public String getListByParentId(String parentId, String token) {
log.error("暂时无法获取区域信息,请稍后再试!parentId:{},token:{}", parentId, token);
log.error(t.getMessage());
return null;
}
};
}
}
This diff is collapsed.
This diff is collapsed.
-- ----------------------------
-- 操作日志业务参数 SQL
-- ----------------------------
-- ----------------------------
-- 参数信息业务参数 SQL
-- ----------------------------
-- ----------------------------
-- 资源信息业务参数 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_param` VALUES (null, '权限类型', 'Resource', 'authType', '0', '无限制', 1, 4, 0, 'authType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '权限类型', 'Resource', 'authType', '1', '无需登录查看', 1, 4, 0, 'authType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '权限类型', 'Resource', 'authType', '2', '需要登录查看', 1, 4, 0, 'authType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '权限类型', 'Resource', 'authType', '3', '需要角色权限查看', 1, 4, 0, 'authType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '资源类型', 'Resource', 'sourceType', '0', '系统资源', 1, 4, 0, 'sourceType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '资源类型', 'Resource', 'sourceType', '1', '开放资源', 1, 4, 0, 'sourceType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '用户类型', 'Resource', 'userType', '0', '系统用户', 1, 4, 0, 'userType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '用户类型', 'Resource', 'userType', '1', '代理商用户', 1, 4, 0, 'userType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '用户类型', 'Resource', 'userType', '2', '品牌商用户', 1, 4, 0, 'userType', NULL, NULL, NULL);
-- ----------------------------
-- 任务信息业务参数 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_param` VALUES (null, '任务状态,', 'Task', 'status', '1', '执行中', 1, 4, 0, 'status', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '执行策略', 'Task', 'excuteStrategy', '1', '按日', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '执行策略', 'Task', 'excuteStrategy', '2', '按周', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '执行策略', 'Task', 'excuteStrategy', '3', '按月', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '执行策略', 'Task', 'excuteStrategy', '4', '按间隔时间', 1, 4, 0, 'excuteStrategy', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '临时执行状态,', 'Task', 'interimExcuteStatus', '0', '未启用', 1, 4, 0, 'interimExcuteStatus', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '临时执行状态,', 'Task', 'interimExcuteStatus', '1', '立即执行并保留', 1, 4, 0, 'interimExcuteStatus', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '临时执行状态,', 'Task', 'interimExcuteStatus', '2', '立即执行并删除', 1, 4, 0, 'interimExcuteStatus', NULL, NULL, NULL);
-- ----------------------------
-- 上传文件业务参数 SQL
-- ----------------------------
INSERT INTO `mortals_xhx_param` VALUES (null, '文件类型,', 'Uploadfile', 'fileType', '1', 'excel', 1, 4, 0, 'fileType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '文件类型,', 'Uploadfile', 'fileType', '2', 'img', 1, 4, 0, 'fileType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '文件类型,', 'Uploadfile', 'fileType', '3', 'zip', 1, 4, 0, 'fileType', NULL, NULL, NULL);
INSERT INTO `mortals_xhx_param` VALUES (null, '文件类型,', 'Uploadfile', 'fileType', '4', 'pdf', 1, 4, 0, 'fileType', NULL, NULL, NULL);
This diff is collapsed.
...@@ -16,7 +16,10 @@ import com.mortals.framework.util.StringUtils; ...@@ -16,7 +16,10 @@ import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.valid.service.ValidCodeService; import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.common.key.RedisKey; import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.menu.service.MenuService; import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.resource.service.ResourceService; import com.mortals.xhx.module.resource.service.ResourceService;
import com.mortals.xhx.module.user.model.UserEntity; import com.mortals.xhx.module.user.model.UserEntity;
import com.mortals.xhx.module.user.service.UserService; import com.mortals.xhx.module.user.service.UserService;
...@@ -31,7 +34,9 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -31,7 +34,9 @@ import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
@RestController @RestController
...@@ -42,8 +47,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -42,8 +47,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired @Autowired
private ValidCodeService validCodeService;
@Autowired
private ResourceService resourceService; private ResourceService resourceService;
@Autowired @Autowired
private MenuService menuService; private MenuService menuService;
...@@ -52,17 +55,16 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -52,17 +55,16 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
@Autowired @Autowired
private ICacheService cacheService; private ICacheService cacheService;
@Autowired @Autowired
private ModelService modelService;
@Autowired
private IAuthTokenService authTokenService; private IAuthTokenService authTokenService;
private static Log logger = LogFactory.getLog(LoginController.class);
@RequestMapping("login") @RequestMapping("login")
public String login(@RequestBody LoginForm loginForm) throws Exception { public String login(@RequestBody LoginForm loginForm) throws Exception {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
Map<String, Object> data = new HashMap<>();
String loginName = loginForm.getLoginName(); String loginName = loginForm.getLoginName();
String password = loginForm.getPassword(); String password = loginForm.getPassword();
String securityCode = loginForm.getSecurityCode();
String ip = super.getRequestIP(request); String ip = super.getRequestIP(request);
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) { if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
...@@ -72,55 +74,34 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -72,55 +74,34 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
UserEntity userEntity = null; UserEntity userEntity = null;
try { try {
loginForm.validate(); loginForm.validate();
boolean result = validCodeService.doCheckImageValidCode(request.getSession().getId(), ip, securityCode);
if ("8888".equals(securityCode)) {
result = true;
}
if (!result) {
recordSysLog(request, userEntity, "登录验证码不正确或已过期!");
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "登录验证码不正确或已过期!");
return ret.toJSONString();
}
userEntity = userService.doLogin(loginName, password, ip); userEntity = userService.doLogin(loginName, password, ip);
userEntity.setLastLoginAddress(ip); userEntity.setLastLoginAddress(ip);
recordSysLog(request, userEntity, "用户登录系统成功!"); recordSysLog(request, userEntity, "用户登录系统成功!");
// 返回拥有的菜单数据 // 返回拥有的菜单数据
Set<String> urls = resourceService.findUrlSetByUserId(userEntity.getId()); Set<String> urls = resourceService.findUrlSetByUserId(userEntity.getId());
//List<MenuEntity> outlookBarList = menuService.findTreeMenu(userEntity, urls); //菜单列表
String currUserName = userEntity.getRealName(); List<MenuEntity> menuList = menuService.findTreeMenu(userEntity, urls);
if (currUserName == null || currUserName.trim().length() == 0) { userEntity.setMenuList(menuList);
currUserName = "管理员"; List<ModelEntity> modelList = this.service.findModelList(userEntity.getId());
} userEntity.setModelList(modelList);
JSONObject data = new JSONObject();
data.put("currUserName", currUserName);
//data.put("barList", outlookBarList);
data.put("id", userEntity.getId());
data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis()); userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID()); userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime()); userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
userEntity.setMenuUrl(generateMenuUrlCode(urls)); userEntity.setMenuUrl(generateMenuUrlCode(urls));
String token = authTokenService.createToken(userEntity); String token = authTokenService.createToken(userEntity);
data.put("token", token);
//设置token 和过期时间
//data.put("expiresTime", DateUtils.addCurrDate(7).getTime());
generateMenuUrlCode(urls); generateMenuUrlCode(urls);
//this.generateBlackCookie(request, response, loginName, urls); //this.generateBlackCookie(request, response, loginName, urls);
data.put("token", token);
data.put("user", userEntity);
ret.put(KEY_RESULT_DATA, data); ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!"); ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
// ret.put("resources", urls); ret.put("resources", urls);
return ret.toJSONString(); return ret.toJSONString();
} catch (Exception e) { } catch (Exception e) {
log.error("login error ", e); log.error("login error ", e);
if (userEntity == null) {
userEntity = new UserEntity();
userEntity.setLoginName(loginName);
}
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e)); ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString(); return ret.toJSONString();
...@@ -128,28 +109,27 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -128,28 +109,27 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
} }
@RequestMapping("logout") @RequestMapping("logout")
public void logout(HttpServletRequest request, HttpServletResponse response) throws Exception { public void logout() throws Exception {
recordSysLog(request, "退出登录"); recordSysLog(request, "退出登录");
authTokenService.delUser(authTokenService.getToken(request));
super.removeCurrUser(request); super.removeCurrUser(request);
this.deleteBlackCookie(request, response);
} }
@RequestMapping("index") @RequestMapping("index")
public String index(HttpServletRequest request, HttpServletResponse response) throws Exception { public String index() throws Exception {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
IUser user = this.getCurUser(); IUser user = this.getCurUser();
if (user == null) { if (user == null) {
return ""; return "";
} }
Set<String> urls = resourceService.findUrlSetByUserId(user.getId()); Set<String> urls = resourceService.findUrlSetByUserId(user.getId());
// List<MenuEntity> outlookBarList = menuService.findTreeMenu(user, urls); List<MenuEntity> outlookBarList = menuService.findTreeMenu(user, urls);
String currUserName = user.getRealName(); String currUserName = user.getRealName();
if (currUserName == null || currUserName.trim().length() == 0) { if (currUserName == null || currUserName.trim().length() == 0) {
currUserName = "管理员"; currUserName = "管理员";
} }
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
data.put("currUserName", currUserName); data.put("barList", outlookBarList);
// data.put("barList", outlookBarList);
data.put("id", user.getId()); data.put("id", user.getId());
data.put("userType", user.getUserType()); data.put("userType", user.getUserType());
ret.put(KEY_RESULT_DATA, data); ret.put(KEY_RESULT_DATA, data);
...@@ -203,56 +183,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -203,56 +183,6 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
} }
} }
@RequestMapping("validcode")
public String validCode(HttpServletRequest request, HttpServletResponse response, LoginForm loginForm) {
JSONObject ret = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "登录名或密码为空");
}
UserEntity user = null;
try {
user = userService.doCheckUser(loginName, password);
if (user == null) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "用户名或密码不正确");
} else if (StringUtils.isEmpty(user.getMobile())) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "用户无正确的手机号");
} else {
String mobile = StringUtils.trim(user.getMobile());
String sessionId = request.getSession().getId();
String ip = super.getRequestIP(request);
boolean result = validCodeService.createSmsValidCode(sessionId, ip, mobile);
if (result) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} else {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "验证码发送失败,请稍后在试!");
}
}
} catch (Exception e) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "验证码发送失败:" + super.convertException(e));
} finally {
if (user == null) {
user = new UserEntity();
user.setLoginName(loginName);
}
recordSysLog(request, user, "用户获取短信验证码");
}
return ret.toJSONString();
}
protected void deleteBlackCookie(HttpServletRequest request, HttpServletResponse response) {
try {
CookieService.deleteCookieForAuth(request, response);
} catch (Throwable e) {
}
}
@RequestMapping("parseToken") @RequestMapping("parseToken")
public IUser parseToken() throws Exception { public IUser parseToken() throws Exception {
......
...@@ -11,11 +11,10 @@ public class LoginForm { ...@@ -11,11 +11,10 @@ public class LoginForm {
private String password; private String password;
private String securityCode;
@Override @Override
public String toString() { public String toString() {
return "loginName:" + this.loginName + " password:" + this.password + " securityCode:" + this.securityCode; return "loginName:" + this.loginName + " password:" + this.password;
} }
public boolean validate() throws AppException { public boolean validate() throws AppException {
...@@ -25,9 +24,6 @@ public class LoginForm { ...@@ -25,9 +24,6 @@ public class LoginForm {
if (password == null || password.trim().length() == 0) { if (password == null || password.trim().length() == 0) {
throw new AppException("密码不能为空!"); throw new AppException("密码不能为空!");
} }
if (securityCode == null || securityCode.trim().length() == 0) {
throw new AppException("验证码不能为空!");
}
return true; return true;
} }
} }
...@@ -38,8 +38,8 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity ...@@ -38,8 +38,8 @@ public class MenuServiceImpl extends AbstractCRUDServiceImpl<MenuDao, MenuEntity
@Override @Override
public List<MenuEntity> findTreeMenu(IUser user, Set<String> urls) throws AppException { public List<MenuEntity> findTreeMenu(IUser user, Set<String> urls) throws AppException {
Set<Long> authIds = new HashSet<Long>(); Set<Long> authIds = new HashSet<>();
Map<Long, MenuEntity> menuMap = new HashMap<Long, MenuEntity>(); Map<Long, MenuEntity> menuMap = new HashMap<>();
List<MenuEntity> userModuleList = this.findAllEnable(); List<MenuEntity> userModuleList = this.findAllEnable();
for (MenuEntity sysModule : userModuleList) { for (MenuEntity sysModule : userModuleList) {
if (sysModule == null) { if (sysModule == null) {
......
package com.mortals.xhx.module.model.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.model.model.ModelEntity;
import java.util.List;
/**
* 系统模块Dao
* 系统模块 DAO接口
*
* @author zxfei
* @date 2022-06-01
*/
public interface ModelDao extends ICRUDDao<ModelEntity,Long>{
}
package com.mortals.xhx.module.model.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.model.dao.ModelDao;
import com.mortals.xhx.module.model.model.ModelEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 系统模块DaoImpl DAO接口
*
* @author zxfei
* @date 2022-06-01
*/
@Repository("modelDao")
public class ModelDaoImpl extends BaseCRUDDaoMybatis<ModelEntity,Long> implements ModelDao {
}
package com.mortals.xhx.module.model.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.model.model.vo.ModelVo;
/**
* 系统模块实体对象
*
* @author zxfei
* @date 2022-06-01
*/
public class ModelEntity extends ModelVo {
private static final long serialVersionUID = 1L;
/**
* 系统模块名称
*/
private String modelName;
/**
* 模块编码
*/
private String modelCode;
/**
* 模块图标
*/
private String modelIcon;
/**
* 地址
*/
private String modelUrl;
/**
* 备注信息
*/
private String remark;
/**
* 排序
*/
private Integer sort;
public ModelEntity(){}
/**
* 获取 系统模块名称
* @return String
*/
public String getModelName(){
return modelName;
}
/**
* 设置 系统模块名称
* @param modelName
*/
public void setModelName(String modelName){
this.modelName = modelName;
}
/**
* 获取 模块编码
* @return String
*/
public String getModelCode(){
return modelCode;
}
/**
* 设置 模块编码
* @param modelCode
*/
public void setModelCode(String modelCode){
this.modelCode = modelCode;
}
/**
* 获取 模块图标
* @return String
*/
public String getModelIcon(){
return modelIcon;
}
/**
* 设置 模块图标
* @param modelIcon
*/
public void setModelIcon(String modelIcon){
this.modelIcon = modelIcon;
}
/**
* 获取 地址
* @return String
*/
public String getModelUrl(){
return modelUrl;
}
/**
* 设置 地址
* @param modelUrl
*/
public void setModelUrl(String modelUrl){
this.modelUrl = modelUrl;
}
/**
* 获取 备注信息
* @return String
*/
public String getRemark(){
return remark;
}
/**
* 设置 备注信息
* @param remark
*/
public void setRemark(String remark){
this.remark = remark;
}
/**
* 获取 排序
* @return Integer
*/
public Integer getSort(){
return sort;
}
/**
* 设置 排序
* @param sort
*/
public void setSort(Integer sort){
this.sort = sort;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof ModelEntity) {
ModelEntity tmp = (ModelEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",modelName:").append(getModelName());
sb.append(",modelCode:").append(getModelCode());
sb.append(",modelIcon:").append(getModelIcon());
sb.append(",modelUrl:").append(getModelUrl());
sb.append(",remark:").append(getRemark());
sb.append(",sort:").append(getSort());
return sb.toString();
}
public void initAttrValue(){
this.modelName = "";
this.modelCode = "";
this.modelIcon = "";
this.modelUrl = "";
this.remark = "";
this.sort = 1;
}
}
\ No newline at end of file
package com.mortals.xhx.module.model.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.model.model.ModelEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* 系统模块视图对象
*
* @author zxfei
* @date 2022-06-01
*/
@Data
public class ModelVo extends BaseEntityLong {
}
\ No newline at end of file
package com.mortals.xhx.module.model.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.model.model.ModelEntity;
/**
* ModelService
*
* 系统模块 service接口
*
* @author zxfei
* @date 2022-06-01
*/
public interface ModelService extends ICRUDService<ModelEntity,Long>{
}
\ No newline at end of file
package com.mortals.xhx.module.model.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.model.dao.ModelDao;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.service.ModelService;
/**
* ModelService
* 系统模块 service实现
*
* @author zxfei
* @date 2022-06-01
*/
@Service("modelService")
public class ModelServiceImpl extends AbstractCRUDServiceImpl<ModelDao, ModelEntity, Long> implements ModelService {
}
\ No newline at end of file
package com.mortals.xhx.module.model.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 系统模块
*
* @author zxfei
* @date 2022-06-01
*/
@RestController
@RequestMapping("model")
public class ModelController extends BaseCRUDJsonBodyMappingController<ModelService,ModelEntity,Long> {
@Autowired
private ParamService paramService;
public ModelController(){
super.setFormClass(ModelForm.class);
super.setModuleDesc( "系统模块");
}
@Override
protected void init(Map<String, Object> model, Context context) {
super.init(model, context);
}
}
\ No newline at end of file
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.user.model; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.user.model;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
...@@ -12,7 +14,7 @@ import com.mortals.xhx.module.user.model.vo.UserVo; ...@@ -12,7 +14,7 @@ import com.mortals.xhx.module.user.model.vo.UserVo;
* 用户信息业务实体对象 * 用户信息业务实体对象
* *
* @author zxfei * @author zxfei
* @date 2022-05-26 * @date 2022-06-01
*/ */
public class UserEntity extends UserVo implements IUser { public class UserEntity extends UserVo implements IUser {
...@@ -25,10 +27,12 @@ public class UserEntity extends UserVo implements IUser { ...@@ -25,10 +27,12 @@ public class UserEntity extends UserVo implements IUser {
/** /**
* 登录密码,使用md5双次加密 * 登录密码,使用md5双次加密
*/ */
@JSONField(serialize=false)
private String loginPwd; private String loginPwd;
/** /**
* 登录限制地址,多个IP地址用逗号分隔,可以使用IP段匹配,如:172.17.*非空:则只能该值内的IP可以登录 * 登录限制地址,多个IP地址用逗号分隔,可以使用IP段匹配,如:172.17.*非空:则只能该值内的IP可以登录
*/ */
@JSONField(serialize=false)
private String loginLimitAddress; private String loginLimitAddress;
/** /**
* 用户名 * 用户名
...@@ -51,7 +55,7 @@ public class UserEntity extends UserVo implements IUser { ...@@ -51,7 +55,7 @@ public class UserEntity extends UserVo implements IUser {
*/ */
private String qq; private String qq;
/** /**
* 用户类型,0:系统用户 1:普通用户 2:工作人员,默认2 * 用户类型(0.系统用户,1.普通用户,2.工作人员)
*/ */
private Integer userType; private Integer userType;
/** /**
...@@ -59,24 +63,37 @@ public class UserEntity extends UserVo implements IUser { ...@@ -59,24 +63,37 @@ public class UserEntity extends UserVo implements IUser {
*/ */
private String siteIds; private String siteIds;
/** /**
* 用户状态,0:停用,1:正常,2:冻结,3:销户,4:离职,默认1 * 所属区域code,多个逗号分隔
*/
private String areaCodes;
/**
* 拥有系统模块,多个逗号分隔
*/ */
private String modeIds;
/**
* 用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)
*/
@JSONField(serialize=false)
private Integer status; private Integer status;
/** /**
* 客户ID * 客户ID
*/ */
@JSONField(serialize=false)
private Long customerId; private Long customerId;
/** /**
* 创建用户名称 * 创建用户名称
*/ */
@JSONField(serialize=false)
private String createUserName; private String createUserName;
/** /**
* 最后一次登录时间 * 最后一次登录时间
*/ */
@JSONField(serialize=false)
private Date lastLoginTime; private Date lastLoginTime;
/** /**
* 最后一次登录地址 * 最后一次登录地址
*/ */
@JSONField(serialize=false)
private String lastLoginAddress; private String lastLoginAddress;
...@@ -211,14 +228,14 @@ public class UserEntity extends UserVo implements IUser { ...@@ -211,14 +228,14 @@ public class UserEntity extends UserVo implements IUser {
this.qq = qq; this.qq = qq;
} }
/** /**
* 获取 用户类型,0:系统用户 1:普通用户 2:工作人员,默认2 * 获取 用户类型(0.系统用户,1.普通用户,2.工作人员)
* @return Integer * @return Integer
*/ */
public Integer getUserType(){ public Integer getUserType(){
return userType; return userType;
} }
/** /**
* 设置 用户类型,0:系统用户 1:普通用户 2:工作人员,默认2 * 设置 用户类型(0.系统用户,1.普通用户,2.工作人员)
* @param userType * @param userType
*/ */
public void setUserType(Integer userType){ public void setUserType(Integer userType){
...@@ -250,14 +267,42 @@ public class UserEntity extends UserVo implements IUser { ...@@ -250,14 +267,42 @@ public class UserEntity extends UserVo implements IUser {
this.siteIds = siteIds; this.siteIds = siteIds;
} }
/** /**
* 获取 用户状态,0:停用,1:正常,2:冻结,3:销户,4:离职,默认1 * 获取 所属区域code,多个逗号分隔
* @return String
*/
public String getAreaCodes(){
return areaCodes;
}
/**
* 设置 所属区域code,多个逗号分隔
* @param areaCodes
*/
public void setAreaCodes(String areaCodes){
this.areaCodes = areaCodes;
}
/**
* 获取 拥有系统模块,多个逗号分隔
* @return String
*/
public String getModeIds(){
return modeIds;
}
/**
* 设置 拥有系统模块,多个逗号分隔
* @param modeIds
*/
public void setModeIds(String modeIds){
this.modeIds = modeIds;
}
/**
* 获取 用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)
* @return Integer * @return Integer
*/ */
public Integer getStatus(){ public Integer getStatus(){
return status; return status;
} }
/** /**
* 设置 用户状态,0:停用,1:正常,2:冻结,3:销户,4:离职,默认1 * 设置 用户状态(0.停用,1.正常,2.冻结,3.销户,4.离职)
* @param status * @param status
*/ */
public void setStatus(Integer status){ public void setStatus(Integer status){
...@@ -337,9 +382,6 @@ public class UserEntity extends UserVo implements IUser { ...@@ -337,9 +382,6 @@ public class UserEntity extends UserVo implements IUser {
this.lastLoginAddress = lastLoginAddress; this.lastLoginAddress = lastLoginAddress;
} }
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -368,6 +410,8 @@ public class UserEntity extends UserVo implements IUser { ...@@ -368,6 +410,8 @@ public class UserEntity extends UserVo implements IUser {
sb.append(",qq:").append(getQq()); sb.append(",qq:").append(getQq());
sb.append(",userType:").append(getUserType()); sb.append(",userType:").append(getUserType());
sb.append(",siteIds:").append(getSiteIds()); sb.append(",siteIds:").append(getSiteIds());
sb.append(",areaCodes:").append(getAreaCodes());
sb.append(",modeIds:").append(getModeIds());
sb.append(",status:").append(getStatus()); sb.append(",status:").append(getStatus());
sb.append(",customerId:").append(getCustomerId()); sb.append(",customerId:").append(getCustomerId());
sb.append(",createUserName:").append(getCreateUserName()); sb.append(",createUserName:").append(getCreateUserName());
...@@ -398,6 +442,10 @@ public class UserEntity extends UserVo implements IUser { ...@@ -398,6 +442,10 @@ public class UserEntity extends UserVo implements IUser {
this.siteIds = ""; this.siteIds = "";
this.areaCodes = "";
this.modeIds = "";
this.status = 1; this.status = 1;
this.customerId = null; this.customerId = null;
......
package com.mortals.xhx.module.user.model.vo; package com.mortals.xhx.module.user.model.vo;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.user.model.UserEntity; import com.mortals.xhx.module.user.model.UserEntity;
import lombok.Data; import lombok.Data;
...@@ -17,7 +19,7 @@ public class UserVo extends BaseEntityLong { ...@@ -17,7 +19,7 @@ public class UserVo extends BaseEntityLong {
/** /**
* 站点名称 * 站点名称
*/ */
private String siteName; //private String siteName;
/** /**
* 唯一标识 * 唯一标识
*/ */
...@@ -36,4 +38,14 @@ public class UserVo extends BaseEntityLong { ...@@ -36,4 +38,14 @@ public class UserVo extends BaseEntityLong {
* 过期时间 * 过期时间
*/ */
private Long expireTime; private Long expireTime;
/**
* 模块列表
*/
private List<ModelEntity> modelList;
/**
* 菜单列表
*/
private List<MenuEntity> menuList;
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import com.mortals.framework.model.Result; ...@@ -4,6 +4,7 @@ import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.xhx.module.menu.model.MenuEntity; import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.user.model.UserEntity; import com.mortals.xhx.module.user.model.UserEntity;
import java.util.List; import java.util.List;
...@@ -56,6 +57,7 @@ public interface UserService extends ICRUDService<UserEntity,Long>{ ...@@ -56,6 +57,7 @@ public interface UserService extends ICRUDService<UserEntity,Long>{
*/ */
List<MenuEntity> findOutlookBarList(IUser user); List<MenuEntity> findOutlookBarList(IUser user);
/** /**
* 查询用户所有有权限的菜单ID * 查询用户所有有权限的菜单ID
* *
...@@ -76,21 +78,6 @@ public interface UserService extends ICRUDService<UserEntity,Long>{ ...@@ -76,21 +78,6 @@ public interface UserService extends ICRUDService<UserEntity,Long>{
*/ */
Result<UserEntity> find(Long platformId, UserEntity params, int currPage, int prePageResult) throws AppException; Result<UserEntity> find(Long platformId, UserEntity params, int currPage, int prePageResult) throws AppException;
/**
* 为客户创建用户
*
* @param currUser 当前用户
* @param customerId 客户ID
* @param customerName 客户名称
* @param loginName
* @param password
* @param userName
* @param mobile
* @return
* @throws AppException
*/
UserEntity createUser(IUser currUser, Long customerId, String customerName, String loginName, String password,
String userName, String mobile) throws AppException;
/** /**
* 用户修改密码 * 用户修改密码
...@@ -104,4 +91,13 @@ public interface UserService extends ICRUDService<UserEntity,Long>{ ...@@ -104,4 +91,13 @@ public interface UserService extends ICRUDService<UserEntity,Long>{
boolean updateUserPwd(String loginName, String oldPwd, String newPwd) throws AppException; boolean updateUserPwd(String loginName, String oldPwd, String newPwd) throws AppException;
/**
* 通过登录用户获取模块
*
* @param userId
* @return
*/
List<ModelEntity> findModelList(Long userId);
} }
\ No newline at end of file
package com.mortals.xhx.module.user.service.impl; package com.mortals.xhx.module.user.service.impl;
import com.mortals.framework.ap.SysConstains; import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.code.UserType; import com.mortals.framework.common.code.UserType;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -10,6 +11,9 @@ import com.mortals.framework.util.SecurityUtil; ...@@ -10,6 +11,9 @@ import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.module.menu.model.MenuEntity; import com.mortals.xhx.module.menu.model.MenuEntity;
import com.mortals.xhx.module.menu.service.MenuService; import com.mortals.xhx.module.menu.service.MenuService;
import com.mortals.xhx.module.model.model.ModelEntity;
import com.mortals.xhx.module.model.model.ModelQuery;
import com.mortals.xhx.module.model.service.ModelService;
import com.mortals.xhx.module.resource.model.ResourceEntity; import com.mortals.xhx.module.resource.model.ResourceEntity;
import com.mortals.xhx.module.resource.service.ResourceService; import com.mortals.xhx.module.resource.service.ResourceService;
import com.mortals.xhx.module.user.model.UserQuery; import com.mortals.xhx.module.user.model.UserQuery;
...@@ -25,18 +29,20 @@ import java.util.*; ...@@ -25,18 +29,20 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* UserService * UserService
* 用户信息业务 service实现 * 用户信息业务 service实现
* *
* @author zxfei * @author zxfei
* @date 2022-05-25 * @date 2022-05-25
*/ */
@Service("userService") @Service("userService")
public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity, Long> implements UserService { public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity, Long> implements UserService {
@Autowired @Autowired
private MenuService menuService; private MenuService menuService;
@Autowired @Autowired
private ResourceService resourceService; private ResourceService resourceService;
@Autowired
private ModelService modelService;
private void doHandlerUser(UserEntity entity) throws AppException { private void doHandlerUser(UserEntity entity) throws AppException {
if (StringUtils.isNotEmpty(entity.getLoginPwd())) { if (StringUtils.isNotEmpty(entity.getLoginPwd())) {
...@@ -195,33 +201,6 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity ...@@ -195,33 +201,6 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
return super.find(params, pageInfo, null); return super.find(params, pageInfo, null);
} }
@Override
public UserEntity createUser(IUser currUser, Long customerId, String customerName, String loginName, String password,
String userName, String mobile) throws AppException {
try {
UserEntity entity = new UserEntity();
entity.initAttrValue();
entity.setLoginName(loginName);
entity.setRealName(userName);
entity.setCustomerId(customerId);
entity.setLoginPwd(password);
entity.setMobile(mobile);
entity.setUserType(UserType.CUSTOMER.getValue());
entity.setCreateTime(new Date());
if (currUser != null) {
entity.setCreateUser(currUser.getLoginName());
entity.setCreateUserName(currUser.getRealName());
}
this.doHandlerUser(entity);
dao.insert(entity);
return entity;
} catch (Exception e) {
log.error("给客户创建用户异常-->customerId:" + customerId + ",customerName:" + customerName + ",loginName:" + loginName +
"-->原因:" + e.getMessage());
return null;
}
}
@Override @Override
public boolean existUser(String loginName, Long userId) throws AppException { public boolean existUser(String loginName, Long userId) throws AppException {
UserEntity sysUser = this.findByLoginName(loginName); UserEntity sysUser = this.findByLoginName(loginName);
...@@ -249,11 +228,6 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity ...@@ -249,11 +228,6 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
} }
try { try {
sysUser.setLoginPwd(SecurityUtil.md5DoubleEncoding(newPwd)); sysUser.setLoginPwd(SecurityUtil.md5DoubleEncoding(newPwd));
// sysUser.setLoginPwd3(sysUser.getLoginPwd2());
// sysUser.setLoginPwd2(sysUser.getLoginPwd1());
// sysUser.setLoginPwd1(sysUser.getLoginPwd());
// sysUser.setLastModPwdTime(new Date());
} catch (Exception e) { } catch (Exception e) {
throw new AppException("密码转换异常!", e); throw new AppException("密码转换异常!", e);
} }
...@@ -261,14 +235,19 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity ...@@ -261,14 +235,19 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
return true; return true;
} }
@Override @Override
protected void findAfter(UserEntity params, PageInfo pageInfo, Context context, List<UserEntity> list) throws AppException { public List<ModelEntity> findModelList(Long userId) {
super.findAfter(params, pageInfo, context, list); UserEntity userEntity = this.get(userId);
// list.stream().peek(item->{ if (!ObjectUtils.isEmpty(userEntity)) {
// if(!ObjectUtils.isEmpty(item.getSiteId())&&item.getSiteId()!=0L){ List<Long> modeIdList = Arrays.asList(userEntity.getModeIds().split(",")).stream().filter(f -> !ObjectUtils.isEmpty(f)).map(Long::parseLong).collect(Collectors.toList());
// item.setSiteName(siteService.get(item.getSiteId()).getSiteName()); if (!ObjectUtils.isEmpty(modeIdList)) {
// } ModelQuery modelQuery = new ModelQuery();
// }).count(); modelQuery.setIdList(modeIdList);
List<ModelEntity> modelEntities = modelService.find(modelQuery);
return modelEntities == null ? new ArrayList<>() : modelEntities;
}
}
return new ArrayList<>();
} }
} }
\ No newline at end of file
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<result property="qq" column="qq" /> <result property="qq" column="qq" />
<result property="userType" column="userType" /> <result property="userType" column="userType" />
<result property="siteIds" column="siteIds" /> <result property="siteIds" column="siteIds" />
<result property="areaCodes" column="areaCodes" />
<result property="modeIds" column="modeIds" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="customerId" column="customerId" /> <result property="customerId" column="customerId" />
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
...@@ -63,6 +65,12 @@ ...@@ -63,6 +65,12 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteIds') or colPickMode == 1 and data.containsKey('siteIds')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteIds') or colPickMode == 1 and data.containsKey('siteIds')))">
a.siteIds, a.siteIds,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaCodes') or colPickMode == 1 and data.containsKey('areaCodes')))">
a.areaCodes,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('modeIds') or colPickMode == 1 and data.containsKey('modeIds')))">
a.modeIds,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
a.status, a.status,
</if> </if>
...@@ -89,18 +97,18 @@ ...@@ -89,18 +97,18 @@
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_user insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteIds,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress) (loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteIds,areaCodes,modeIds,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress)
VALUES VALUES
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{siteIds},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress}) (#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{siteIds},#{areaCodes},#{modeIds},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_user insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteIds,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress) (loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,siteIds,areaCodes,modeIds,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.siteIds},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress}) (#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.siteIds},#{item.areaCodes},#{item.modeIds},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress})
</foreach> </foreach>
</insert> </insert>
...@@ -143,6 +151,12 @@ ...@@ -143,6 +151,12 @@
<if test="(colPickMode==0 and data.containsKey('siteIds')) or (colPickMode==1 and !data.containsKey('siteIds'))"> <if test="(colPickMode==0 and data.containsKey('siteIds')) or (colPickMode==1 and !data.containsKey('siteIds'))">
a.siteIds=#{data.siteIds}, a.siteIds=#{data.siteIds},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('areaCodes')) or (colPickMode==1 and !data.containsKey('areaCodes'))">
a.areaCodes=#{data.areaCodes},
</if>
<if test="(colPickMode==0 and data.containsKey('modeIds')) or (colPickMode==1 and !data.containsKey('modeIds'))">
a.modeIds=#{data.modeIds},
</if>
<if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))"> <if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
a.status=#{data.status}, a.status=#{data.status},
</if> </if>
...@@ -260,6 +274,20 @@ ...@@ -260,6 +274,20 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="areaCodes=(case" suffix="ELSE areaCodes end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('areaCodes')) or (colPickMode==1 and !item.containsKey('areaCodes'))">
when a.id=#{item.id} then #{item.areaCodes}
</if>
</foreach>
</trim>
<trim prefix="modeIds=(case" suffix="ELSE modeIds end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('modeIds')) or (colPickMode==1 and !item.containsKey('modeIds'))">
when a.id=#{item.id} then #{item.modeIds}
</if>
</foreach>
</trim>
<trim prefix="status=(case" suffix="ELSE status end),"> <trim prefix="status=(case" suffix="ELSE status end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
...@@ -602,6 +630,36 @@ ...@@ -602,6 +630,36 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('areaCodes')">
<if test="conditionParamRef.areaCodes != null and conditionParamRef.areaCodes != ''">
${_conditionType_} a.areaCodes like #{${_conditionParam_}.areaCodes}
</if>
<if test="conditionParamRef.areaCodes == null">
${_conditionType_} a.areaCodes is null
</if>
</if>
<if test="conditionParamRef.containsKey('areaCodesList')">
${_conditionType_} a.areaCodes in
<foreach collection="conditionParamRef.areaCodesList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('modeIds')">
<if test="conditionParamRef.modeIds != null and conditionParamRef.modeIds != ''">
${_conditionType_} a.modeIds like #{${_conditionParam_}.modeIds}
</if>
<if test="conditionParamRef.modeIds == null">
${_conditionType_} a.modeIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('modeIdsList')">
${_conditionType_} a.modeIds in
<foreach collection="conditionParamRef.modeIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('status')"> <if test="conditionParamRef.containsKey('status')">
<if test="conditionParamRef.status != null "> <if test="conditionParamRef.status != null ">
${_conditionType_} a.status = #{${_conditionParam_}.status} ${_conditionType_} a.status = #{${_conditionParam_}.status}
...@@ -793,6 +851,16 @@ ...@@ -793,6 +851,16 @@
<if test='orderCol.siteIds != null and "DESC".equalsIgnoreCase(orderCol.siteIds)'>DESC</if> <if test='orderCol.siteIds != null and "DESC".equalsIgnoreCase(orderCol.siteIds)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('areaCodes')">
a.areaCodes
<if test='orderCol.areaCodes != null and "DESC".equalsIgnoreCase(orderCol.areaCodes)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('modeIds')">
a.modeIds
<if test='orderCol.modeIds != null and "DESC".equalsIgnoreCase(orderCol.modeIds)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('status')"> <if test="orderCol.containsKey('status')">
a.status a.status
<if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if> <if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if>
......
{ {
"local": { "portal-local": {
"baseUrl": "http://127.0.0.1:17311/zwfw" "baseUrl": "http://127.0.0.1:17212/zwfw"
}, },
"dev": { "portal-dev": {
"baseUrl": "http://192.168.0.217:17311/zwfw" "baseUrl": "http://192.168.0.217:17212/zwfw"
}, },
"test": { "portal-test": {
"baseUrl": "http://192.168.0.98:11071/zwfw" "baseUrl": "http://192.168.0.98:17212/zwfw"
} }
} }
\ No newline at end of file
...@@ -16,21 +16,21 @@ Authorization: {{authToken}} ...@@ -16,21 +16,21 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"name":"3trs3r", "name":"gtpo3x",
"url":"xrbayn", "url":"bzap53",
"parentId":601, "parentId":841,
"orderId":831, "orderId":493,
"status":1, "status":1,
"linkType":0, "linkType":0,
"groupId":1, "groupId":1,
"groupName":"l1cb09", "groupName":"kozt1p",
"imgPath":"7vx2e3", "imgPath":"768q4p",
"buttonImgPath":"jl6h2u", "buttonImgPath":"8n3owa",
"imgCommPath":"o9s99x", "imgCommPath":"1uozri",
"commMenu":0, "commMenu":0,
"menuType":0, "menuType":0,
"authType":3, "authType":3,
"createUserName":"l2jfb9" "createUserName":"ncx9is"
} }
> {% > {%
......
...@@ -16,15 +16,15 @@ Authorization: {{authToken}} ...@@ -16,15 +16,15 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"platformMark":"p6u2db", "platformMark":"famkaa",
"userId":392, "userId":915,
"userName":"g9643m", "userName":"yprv3n",
"loginName":"ymarlx", "loginName":"pcui4v",
"requestUrl":"7jeyja", "requestUrl":"b25eh5",
"content":"8yciyz", "content":"a45ur4",
"ip":"0s5jyc", "ip":"jjzv5q",
"logDate":"1653408000000", "logDate":"1654012800000",
"operType":264 "operType":502
} }
> {% > {%
......
...@@ -16,16 +16,16 @@ Authorization: {{authToken}} ...@@ -16,16 +16,16 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"name":"uzmb1h", "name":"8rql7o",
"firstOrganize":"26mjzx", "firstOrganize":"pjyp42",
"secondOrganize":"m6q15i", "secondOrganize":"gf5pjy",
"paramKey":"kgob3u", "paramKey":"kj2rte",
"paramValue":"0yeqxi", "paramValue":"43x9fh",
"validStatus":1, "validStatus":1,
"modStatus":4, "modStatus":4,
"displayType":0, "displayType":0,
"remark":"0rc34v", "remark":"icbvr4",
"createUserName":"tnev3i" "createUserName":"z877o6"
} }
> {% > {%
......
...@@ -16,12 +16,12 @@ Authorization: {{authToken}} ...@@ -16,12 +16,12 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"name":"01takc", "name":"bbhhiu",
"url":"7d2wh0", "url":"78p8sn",
"authType":3, "authType":3,
"sourceType":0, "sourceType":0,
"createUserName":"dhe3wq", "createUserName":"pmsggn",
"userType":337 "userType":792
} }
> {% > {%
......
...@@ -16,8 +16,8 @@ Authorization: {{authToken}} ...@@ -16,8 +16,8 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"roleId":447, "roleId":919,
"resourceId":826 "resourceId":633
} }
> {% > {%
......
...@@ -16,10 +16,10 @@ Authorization: {{authToken}} ...@@ -16,10 +16,10 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"name":"8r6f57", "name":"5ndoco",
"remark":"0yezau", "remark":"qkazii",
"roleType":2, "roleType":2,
"createUserName":"8cbh3c" "createUserName":"5i3n9e"
} }
> {% > {%
......
...@@ -16,8 +16,8 @@ Authorization: {{authToken}} ...@@ -16,8 +16,8 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"roleId":559, "roleId":383,
"userId":162 "userId":148
} }
> {% > {%
......
###登录
POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
}
> {%
client.global.set("SmsSet_id", JSON.parse(response.body).data.id);
client.global.set("authToken", JSON.parse(response.body).data.token);
%}
###首页
POST {{baseUrl}}/login/index
Authorization: {{authToken}}
Content-Type: application/json
{}
...@@ -16,15 +16,15 @@ Authorization: {{authToken}} ...@@ -16,15 +16,15 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"systemServiceName":"bmop16", "systemServiceName":"o99s5u",
"systemServiceCode":"zs20fh", "systemServiceCode":"nhelz5",
"systemServiceUrl":"r5b6s9", "systemServiceUrl":"to7p8j",
"apiName":"86sw8q", "apiName":"a9jpo2",
"apiUrl":"0", "apiUrl":"0",
"apiVersion":"qks3ye", "apiVersion":"soe6c6",
"apiStatus":1, "apiStatus":1,
"lapseTime":"1653408000000", "lapseTime":"1654012800000",
"apiRemark":"xna6nr" "apiRemark":"6rriap"
} }
> {% > {%
......
...@@ -16,15 +16,15 @@ Authorization: {{authToken}} ...@@ -16,15 +16,15 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"systemServiceName":"p0yf4g", "systemServiceName":"pd2nfe",
"systemServiceCode":"18418z", "systemServiceCode":"eluken",
"systemServiceUrl":"509vfm", "systemServiceUrl":"qtc1t4",
"packageName":"2sgr33", "packageName":"ebrlei",
"packagePath":"ragnhb", "packagePath":"cn24qd",
"packageVersion":"lsip63", "packageVersion":"bja5qr",
"apiStatus":421, "apiStatus":784,
"lapseTime":"1653408000000", "lapseTime":"1654012800000",
"packageRemark":"orlq3y" "packageRemark":"jp04vd"
} }
> {% > {%
......
...@@ -16,8 +16,8 @@ Authorization: {{authToken}} ...@@ -16,8 +16,8 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"tableName":"693q8e", "tableName":"clftc5",
"tableMark":"l3et19", "tableMark":"recb1y",
} }
> {% > {%
......
...@@ -16,20 +16,20 @@ Authorization: {{authToken}} ...@@ -16,20 +16,20 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"name":"41b4fh", "name":"dkuwwq",
"taskKey":"3l4pit", "taskKey":"n1cdz1",
"status":0, "status":0,
"excuteService":"nqgteq", "excuteService":"fcwbaz",
"excuteParam":"5zi9vb", "excuteParam":"lhbsxc",
"excuteHost":"rzjd27", "excuteHost":"jq9not",
"excuteStrategy":1, "excuteStrategy":1,
"excuteDate":0, "excuteDate":0,
"excuteTime":"00:00", "excuteTime":"00:00",
"remark":"siu7eb", "remark":"w7enx5",
"lastExcuteHost":"qbpag4", "lastExcuteHost":"qejiuf",
"lastExcuteTime":"1653408000000", "lastExcuteTime":"1654012800000",
"interimExcuteStatus":0, "interimExcuteStatus":0,
"createUserName":"u089fu" "createUserName":"wead9t"
} }
> {% > {%
......
...@@ -16,9 +16,9 @@ Authorization: {{authToken}} ...@@ -16,9 +16,9 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"fileName":"a4vhpb", "fileName":"op4s3p",
"filePath":"jm7tb7", "filePath":"3laab2",
"fileType":261, "fileType":635,
} }
> {% > {%
......
...@@ -16,21 +16,21 @@ Authorization: {{authToken}} ...@@ -16,21 +16,21 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"loginName":"8dgoiw", "loginName":"4yywad",
"loginPwd":"j8fnyb", "loginPwd":"1g4iy0",
"loginLimitAddress":"wl98ae", "loginLimitAddress":"20w7ix",
"realName":"cduvjh", "realName":"am6aml",
"mobile":"u4xqi3", "mobile":"gcznhn",
"phone":"ip3qkh", "phone":"wvq3ct",
"email":"mbs3hu", "email":"lxbz24",
"qq":"a5qkzc", "qq":"a037x3",
"userType":132, "userType":442,
"siteInfo":"p5sp0g", "siteIds":"o48orv",
"status":1, "status":1,
"customerId":109, "customerId":121,
"createUserName":"n57b9k", "createUserName":"6kavzr",
"lastLoginTime":"1653408000000", "lastLoginTime":"1654012800000",
"lastLoginAddress":"ccdf1t" "lastLoginAddress":"hed4ia"
} }
> {% > {%
......
...@@ -16,14 +16,14 @@ Authorization: {{authToken}} ...@@ -16,14 +16,14 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"code":"sk1nnu", "code":"8ejstz",
"url":"9w0alr", "url":"rd1w9i",
"mobile":"cy1jca", "mobile":"o14fm7",
"email":"4bq8qx", "email":"jx8ynm",
"type":0, "type":0,
"sessionId":"vzj0o8", "sessionId":"skrkmf",
"ip":"hb2nqm", "ip":"4jsqg0",
"lapseTime":"1653408000000" "lapseTime":"1654012800000"
} }
> {% > {%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment