【admin】新增&优化 # 1、优化/user/center小程序这个接口返回省市区和技术等级字段 2、优化后台管理新增用户
parent
a253e2f104
commit
1f994e96e6
|
@ -39,6 +39,7 @@ public class RoutingInspectionOrderController {
|
||||||
PageResult<RoutingInspectionOrderListVo> list = iRoutingInspectionOrderService.list(pageParam, params);
|
PageResult<RoutingInspectionOrderListVo> list = iRoutingInspectionOrderService.list(pageParam, params);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 巡检订单详情
|
* 巡检订单详情
|
||||||
*
|
*
|
||||||
|
|
|
@ -345,4 +345,9 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
||||||
return formatDate + newOrderNo;
|
return formatDate + newOrderNo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//系统自动创建巡检单
|
||||||
|
public void autoOrder(){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,9 @@ import com.hcy.common.entity.system.SystemAuthMenu;
|
||||||
import com.hcy.common.entity.system.SystemAuthRole;
|
import com.hcy.common.entity.system.SystemAuthRole;
|
||||||
import com.hcy.common.entity.user.User;
|
import com.hcy.common.entity.user.User;
|
||||||
import com.hcy.common.entity.user.UserAuth;
|
import com.hcy.common.entity.user.UserAuth;
|
||||||
|
import com.hcy.common.entity.warehouse.Warehouse;
|
||||||
|
import com.hcy.common.enums.RoleEnum;
|
||||||
|
import com.hcy.common.enums.WarehouseEnum;
|
||||||
import com.hcy.common.enums.user.SystemAuthRoleEnum;
|
import com.hcy.common.enums.user.SystemAuthRoleEnum;
|
||||||
import com.hcy.common.enums.user.UserTypeEnum;
|
import com.hcy.common.enums.user.UserTypeEnum;
|
||||||
import com.hcy.common.exception.OperateException;
|
import com.hcy.common.exception.OperateException;
|
||||||
|
@ -38,6 +41,7 @@ import com.hcy.common.mapper.system.SystemAuthMenuMapper;
|
||||||
import com.hcy.common.mapper.system.SystemAuthRoleMapper;
|
import com.hcy.common.mapper.system.SystemAuthRoleMapper;
|
||||||
import com.hcy.common.mapper.user.UserAuthMapper;
|
import com.hcy.common.mapper.user.UserAuthMapper;
|
||||||
import com.hcy.common.mapper.user.UserMapper;
|
import com.hcy.common.mapper.user.UserMapper;
|
||||||
|
import com.hcy.common.mapper.warehouse.WarehouseMapper;
|
||||||
import com.hcy.common.utils.*;
|
import com.hcy.common.utils.*;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
@ -83,6 +87,9 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
||||||
@Resource
|
@Resource
|
||||||
UserAuthMapper userAuthMapper;
|
UserAuthMapper userAuthMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
WarehouseMapper warehouseMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据账号查找管理员
|
* 根据账号查找管理员
|
||||||
*
|
*
|
||||||
|
@ -379,6 +386,57 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
||||||
model.setEmail(systemAuthAdminParam.getEmail());
|
model.setEmail(systemAuthAdminParam.getEmail());
|
||||||
model.setTechnicalGrade(systemAuthAdminParam.getTechnicalGrade());
|
model.setTechnicalGrade(systemAuthAdminParam.getTechnicalGrade());
|
||||||
systemAuthAdminMapper.insert(model);
|
systemAuthAdminMapper.insert(model);
|
||||||
|
//获取管理员id
|
||||||
|
Long adminId = model.getId().longValue();
|
||||||
|
//新增用户的时候,角色是检修员或维修员,就在检修员仓库或者维修员仓库下新增一个仓库
|
||||||
|
Integer role = Integer.valueOf(systemAuthAdminParam.getRole()); //获取角色
|
||||||
|
Map<Long, String> regionMap = regionService.getRegionMap();
|
||||||
|
String province = regionMap.get(model.getProvinceId());
|
||||||
|
String city = regionMap.get(model.getCityId());
|
||||||
|
String district = regionMap.get(model.getDistrictId());
|
||||||
|
|
||||||
|
if(role == RoleEnum.OVERHAUL_RESULT.getStatus()){
|
||||||
|
Warehouse warehouse = new Warehouse();
|
||||||
|
warehouse.setPid(Long.valueOf(WarehouseEnum.MAINTANCE_WAREHOUSE.getStatus())); //仓库上级id
|
||||||
|
warehouse.setWarehouseName(systemAuthAdminParam.getNickname()); //仓库名称
|
||||||
|
warehouse.setWarehouseCoding(systemAuthAdminParam.getNickname() + "-" + systemAuthAdminParam.getPhone()); // 仓库编码
|
||||||
|
warehouse.setWarehouseAddress(province + city + district); // 仓库地址
|
||||||
|
warehouseMapper.insert(warehouse);
|
||||||
|
//获取仓库id
|
||||||
|
Long warehouseId = warehouse.getId().longValue();
|
||||||
|
//获取小程序用户id
|
||||||
|
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
||||||
|
new QueryWrapper<SystemAuthAdmin>()
|
||||||
|
.eq("id", adminId)
|
||||||
|
.eq("is_delete", 0));
|
||||||
|
User user= userMapper.selectOne(
|
||||||
|
new QueryWrapper<User>()
|
||||||
|
.eq("id", authAdmin.getUserId())
|
||||||
|
.eq("is_delete", 0));
|
||||||
|
user.setWarehouseId(warehouseId);
|
||||||
|
userMapper.updateById(user);//绑定仓库
|
||||||
|
|
||||||
|
}else if(role == RoleEnum.MAINTENANCE_MAN.getStatus()){
|
||||||
|
Warehouse warehouse = new Warehouse();
|
||||||
|
warehouse.setPid(Long.valueOf(WarehouseEnum.REPAIR_WAREHOUSE.getStatus())); //仓库上级id
|
||||||
|
warehouse.setWarehouseName(systemAuthAdminParam.getNickname()); //仓库名称
|
||||||
|
warehouse.setWarehouseCoding(systemAuthAdminParam.getNickname() + "-" + systemAuthAdminParam.getPhone()); // 仓库编码
|
||||||
|
warehouse.setWarehouseAddress(province + city + district); // 仓库地址
|
||||||
|
warehouseMapper.insert(warehouse);
|
||||||
|
//获取仓库id
|
||||||
|
Long warehouseId = warehouse.getId().longValue();
|
||||||
|
//获取小程序用户id
|
||||||
|
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
||||||
|
new QueryWrapper<SystemAuthAdmin>()
|
||||||
|
.eq("id", adminId)
|
||||||
|
.eq("is_delete", 0));
|
||||||
|
User user= userMapper.selectOne(
|
||||||
|
new QueryWrapper<User>()
|
||||||
|
.eq("id", authAdmin.getUserId())
|
||||||
|
.eq("is_delete", 0));
|
||||||
|
user.setWarehouseId(warehouseId);
|
||||||
|
userMapper.updateById(user);//绑定仓库
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,9 +14,8 @@ public class LargeDataVo implements Serializable {
|
||||||
|
|
||||||
private Integer clientSum; //客户总数
|
private Integer clientSum; //客户总数
|
||||||
private Integer equipmentSum; //设备总数
|
private Integer equipmentSum; //设备总数
|
||||||
private Integer orderSum; //工单总数
|
|
||||||
private Integer todayOrderSum; //今日工单总数
|
private Integer todayOrderSum; //今日工单总数
|
||||||
|
private Integer orderSum; //工单总数
|
||||||
private Integer doneOrderSum; //已完成订单数
|
private Integer doneOrderSum; //已完成订单数
|
||||||
private Integer underOverhaulOrderSum; //检修中订单数
|
private Integer underOverhaulOrderSum; //检修中订单数
|
||||||
private Integer underWarrantyOrderSum; //保修中订单数
|
private Integer underWarrantyOrderSum; //保修中订单数
|
||||||
|
|
|
@ -44,4 +44,5 @@ public class User implements Serializable {
|
||||||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||||
private String longitude; // 经度
|
private String longitude; // 经度
|
||||||
private String latitude; // 纬度
|
private String latitude; // 纬度
|
||||||
|
private Long warehouseId; // 仓库id
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.hcy.common.enums;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public enum RoleEnum {
|
||||||
|
// 角色名称: 6=检修员 7=维修员
|
||||||
|
OVERHAUL_RESULT(6, "检修员"),
|
||||||
|
MAINTENANCE_MAN(7, "维修员");
|
||||||
|
|
||||||
|
private final int status;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
RoleEnum(int status, String desc) {
|
||||||
|
this.status = status;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取状态码
|
||||||
|
*
|
||||||
|
* @return Long
|
||||||
|
* @author fzr
|
||||||
|
*/
|
||||||
|
public int getStatus() {
|
||||||
|
return this.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提示
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
* @author fzr
|
||||||
|
*/
|
||||||
|
public String getDesc() {
|
||||||
|
return this.desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<Integer, String> getMap() {
|
||||||
|
Map<Integer, String> map = Maps.newHashMap();
|
||||||
|
for (RoleEnum codeEnum : RoleEnum.values()) {
|
||||||
|
map.put(codeEnum.status, codeEnum.desc);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.hcy.common.enums;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public enum WarehouseEnum {
|
||||||
|
// 仓库名称:检修员仓、维修员仓
|
||||||
|
MAINTANCE_WAREHOUSE(4, "检修员"),
|
||||||
|
REPAIR_WAREHOUSE(1, "维修员");
|
||||||
|
|
||||||
|
private final Integer status;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
WarehouseEnum(Integer status, String desc) {
|
||||||
|
this.status = status;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取状态码
|
||||||
|
*
|
||||||
|
* @return Long
|
||||||
|
* @author fzr
|
||||||
|
*/
|
||||||
|
public Integer getStatus() {
|
||||||
|
return this.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提示
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
* @author fzr
|
||||||
|
*/
|
||||||
|
public String getDesc() {
|
||||||
|
return this.desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<Integer, String> getMap() {
|
||||||
|
Map<Integer, String> map = Maps.newHashMap();
|
||||||
|
for (WarehouseEnum codeEnum : WarehouseEnum.values()) {
|
||||||
|
map.put(codeEnum.status, codeEnum.desc);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
|
@ -43,7 +43,7 @@ public class EquipmentServiceImpl implements IEquipmentService {
|
||||||
* 设备管理详情
|
* 设备管理详情
|
||||||
*
|
*
|
||||||
* @author hcy
|
* @author hcy
|
||||||
* @param id 主键参数
|
* @param number 主键参数
|
||||||
* @return Equipment
|
* @return Equipment
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,6 +31,7 @@ import com.hcy.common.utils.*;
|
||||||
import com.hcy.front.FrontThreadLocal;
|
import com.hcy.front.FrontThreadLocal;
|
||||||
import com.hcy.front.config.FrontConfig;
|
import com.hcy.front.config.FrontConfig;
|
||||||
import com.hcy.front.service.IUserService;
|
import com.hcy.front.service.IUserService;
|
||||||
|
import com.hcy.front.service.region.IDevRegionService;
|
||||||
import com.hcy.front.validate.user.NewUserUpdateValidate;
|
import com.hcy.front.validate.user.NewUserUpdateValidate;
|
||||||
import com.hcy.front.validate.user.UserParam;
|
import com.hcy.front.validate.user.UserParam;
|
||||||
import com.hcy.front.vo.user.UserCenterVo;
|
import com.hcy.front.vo.user.UserCenterVo;
|
||||||
|
@ -71,6 +72,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||||
@Resource
|
@Resource
|
||||||
SystemAuthRoleMapper systemAuthRoleMapper;
|
SystemAuthRoleMapper systemAuthRoleMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IDevRegionService regionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人中心
|
* 个人中心
|
||||||
*
|
*
|
||||||
|
@ -96,7 +100,18 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||||
}else{
|
}else{
|
||||||
vo.setAvatar(UrlUtil.toAbsoluteUrl(user.getAvatar()));
|
vo.setAvatar(UrlUtil.toAbsoluteUrl(user.getAvatar()));
|
||||||
}
|
}
|
||||||
|
//省市区和技术等级字段
|
||||||
|
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(new QueryWrapper<SystemAuthAdmin>()
|
||||||
|
.eq("user_id", userId)
|
||||||
|
.last("limit 1"));
|
||||||
|
vo.setProvinceId(authAdmin.getProvinceId());
|
||||||
|
vo.setCityId(authAdmin.getCityId());
|
||||||
|
vo.setDistrictId(authAdmin.getDistrictId());
|
||||||
|
vo.setTechnicalGrade(authAdmin.getTechnicalGrade());
|
||||||
|
Map<Long, String> regionMap = regionService.getRegionMap();
|
||||||
|
vo.setProvince(regionMap.get(vo.getProvinceId()));
|
||||||
|
vo.setCity(regionMap.get(vo.getCityId()));
|
||||||
|
vo.setDistrict(regionMap.get(vo.getDistrictId()));
|
||||||
//设置客户id
|
//设置客户id
|
||||||
ClientContacts clientContacts = clientContactsMapper.selectOne(new LambdaQueryWrapper<ClientContacts>()
|
ClientContacts clientContacts = clientContactsMapper.selectOne(new LambdaQueryWrapper<ClientContacts>()
|
||||||
.eq(ClientContacts::getIsDelete, GlobalConstant.NOT_DELETE)
|
.eq(ClientContacts::getIsDelete, GlobalConstant.NOT_DELETE)
|
||||||
|
|
|
@ -24,5 +24,13 @@ public class UserCenterVo implements Serializable {
|
||||||
private Long clientId; //客户id
|
private Long clientId; //客户id
|
||||||
private Map<Integer,String> roleMap; //角色信息 key:id value:name
|
private Map<Integer,String> roleMap; //角色信息 key:id value:name
|
||||||
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
private Integer receiveOrderStatus; //接单状态(0=休假/停止接单中 1=作业中 2=可接单)
|
||||||
|
private Long provinceId; //省id
|
||||||
|
private Long cityId; //市id
|
||||||
|
private Long districtId; //区id
|
||||||
|
private String province; //省
|
||||||
|
private String city; //市
|
||||||
|
private String district; //区
|
||||||
|
private String technicalGrade; // 技术等级
|
||||||
|
private Integer warehouseId; // 仓库id
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class UserInfoVo implements Serializable {
|
||||||
private String openid;
|
private String openid;
|
||||||
private String createTime;
|
private String createTime;
|
||||||
private int integral; //积分
|
private int integral; //积分
|
||||||
|
private Integer warehouseId; // 仓库id
|
||||||
|
|
||||||
public void setSex(Integer sex) {
|
public void setSex(Integer sex) {
|
||||||
switch (sex) {
|
switch (sex) {
|
||||||
|
|
|
@ -51,6 +51,7 @@ public class UserVo implements Serializable {
|
||||||
private String unBindTime;
|
private String unBindTime;
|
||||||
|
|
||||||
private String userNo; //分销用户编号
|
private String userNo; //分销用户编号
|
||||||
|
private Integer warehouseId; // 仓库id
|
||||||
|
|
||||||
public void setSex(Integer sex) {
|
public void setSex(Integer sex) {
|
||||||
switch (sex) {
|
switch (sex) {
|
||||||
|
|
Loading…
Reference in New Issue