parent
f169e4e723
commit
4639da5dc5
|
@ -19,5 +19,6 @@ public class Message implements Serializable {
|
||||||
public static final String PROJECT_ID_IS_NOT_EXIST = "项目id不存在";
|
public static final String PROJECT_ID_IS_NOT_EXIST = "项目id不存在";
|
||||||
public static final String TURBINE_ID_IS_NOT_EXIST = "机组id不存在";
|
public static final String TURBINE_ID_IS_NOT_EXIST = "机组id不存在";
|
||||||
public static final String PART_ID_IS_NOT_EXIST = "部件id不存在";
|
public static final String PART_ID_IS_NOT_EXIST = "部件id不存在";
|
||||||
public static final String IMAGE_SOURCE_I_NOT_EXIST_OR_ILLEGAL = "部件id不存在";
|
public static final String IMAGE_SOURCE_ID_NOT_EXIST_OR_ILLEGAL = "部件id不存在";
|
||||||
|
public static final String USER_ID_NOT_EXIST = "部件id不存在";
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,4 +38,8 @@ public interface Converts {
|
||||||
PartEntity toPartEntity(PartReq req);
|
PartEntity toPartEntity(PartReq req);
|
||||||
|
|
||||||
PartResp toPartResp(PartEntity entity);
|
PartResp toPartResp(PartEntity entity);
|
||||||
|
|
||||||
|
UserResp toUserResp(UserEntity entity);
|
||||||
|
|
||||||
|
UserEntity toUserEntity(UserReq req);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,8 +99,8 @@ public class ProjectEntity extends AuditableEntity implements Serializable {
|
||||||
private String projectManagerId;
|
private String projectManagerId;
|
||||||
|
|
||||||
@ApiModelProperty("施工组长id")
|
@ApiModelProperty("施工组长id")
|
||||||
@TableField("construction_team_leader_id")
|
@TableField("construct_team_leader_id")
|
||||||
private String constructionTeamLeaderId;
|
private String constructTeamLeaderId;
|
||||||
|
|
||||||
@ApiModelProperty("技术方案图片,多个用逗号隔开")
|
@ApiModelProperty("技术方案图片,多个用逗号隔开")
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.dite.znpt.domain.entity;
|
package com.dite.znpt.domain.entity;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
@ -39,11 +40,31 @@ public class UserEntity extends AuditableEntity implements Serializable {
|
||||||
@TableField("avatar")
|
@TableField("avatar")
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
|
@ExcelProperty("密码")
|
||||||
|
@ApiModelProperty("密码")
|
||||||
|
@TableField("password")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@ExcelProperty("加密盐")
|
||||||
|
@ApiModelProperty("加密盐")
|
||||||
|
@TableField("salt")
|
||||||
|
private String salt;
|
||||||
|
|
||||||
|
@ExcelProperty("1正常0禁用")
|
||||||
|
@ApiModelProperty("1正常0禁用")
|
||||||
|
@TableField("status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
@ExcelProperty("姓名")
|
@ExcelProperty("姓名")
|
||||||
@ApiModelProperty("姓名")
|
@ApiModelProperty("姓名")
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ExcelProperty("身份证")
|
||||||
|
@ApiModelProperty("身份证")
|
||||||
|
@TableField("identity_card")
|
||||||
|
private String identityCard;
|
||||||
|
|
||||||
@ExcelProperty("性别")
|
@ExcelProperty("性别")
|
||||||
@ApiModelProperty("性别")
|
@ApiModelProperty("性别")
|
||||||
@TableField("gender")
|
@TableField("gender")
|
||||||
|
@ -59,20 +80,30 @@ public class UserEntity extends AuditableEntity implements Serializable {
|
||||||
@TableField("email")
|
@TableField("email")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@ExcelProperty("密码")
|
@ExcelProperty("入职日期")
|
||||||
@ApiModelProperty("密码")
|
@ApiModelProperty("入职日期")
|
||||||
@TableField("password")
|
@TableField("hiredate")
|
||||||
private String password;
|
private LocalDate hiredate;
|
||||||
|
|
||||||
@ExcelProperty("加密盐")
|
@ExcelProperty("出生日期")
|
||||||
@ApiModelProperty("加密盐")
|
@ApiModelProperty("出生日期")
|
||||||
@TableField("salt")
|
@TableField("birthdate")
|
||||||
private String salt;
|
private LocalDate birthdate;
|
||||||
|
|
||||||
@ExcelProperty("1正常0禁用")
|
@ExcelProperty("学历")
|
||||||
@ApiModelProperty("1正常0禁用")
|
@ApiModelProperty("学历")
|
||||||
@TableField("status")
|
@TableField("education")
|
||||||
private Integer status;
|
private String education;
|
||||||
|
|
||||||
|
@ExcelProperty("专业")
|
||||||
|
@ApiModelProperty("专业")
|
||||||
|
@TableField("major_field")
|
||||||
|
private String majorField;
|
||||||
|
|
||||||
|
@ExcelProperty("工作方向")
|
||||||
|
@ApiModelProperty("工作方向")
|
||||||
|
@TableField("work_field")
|
||||||
|
private String workField;
|
||||||
|
|
||||||
@ExcelProperty("最后登录ip")
|
@ExcelProperty("最后登录ip")
|
||||||
@ApiModelProperty("最后登录ip")
|
@ApiModelProperty("最后登录ip")
|
||||||
|
|
|
@ -20,10 +20,10 @@ public class PartListReq implements Serializable {
|
||||||
@ApiModelProperty("查询关键字")
|
@ApiModelProperty("查询关键字")
|
||||||
private String keyword;
|
private String keyword;
|
||||||
|
|
||||||
@ApiModelProperty(name = "项目id", required = true)
|
@ApiModelProperty(name = "projectId", required = true)
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
@ApiModelProperty(name = "机组id", required = true)
|
@ApiModelProperty(name = "turbineId", required = true)
|
||||||
private String turbineId;
|
private String turbineId;
|
||||||
|
|
||||||
@ApiModelProperty("类型,枚举PartTypeEnum")
|
@ApiModelProperty("类型,枚举PartTypeEnum")
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class TurbineListReq implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 141552424945497346L;
|
private static final long serialVersionUID = 141552424945497346L;
|
||||||
|
|
||||||
@ApiModelProperty(name = "项目id", required = true)
|
@ApiModelProperty(name = "projectId", required = true)
|
||||||
private String projectId;
|
private String projectId;
|
||||||
|
|
||||||
@ApiModelProperty("查询关键字")
|
@ApiModelProperty("查询关键字")
|
||||||
|
|
|
@ -17,9 +17,6 @@ public class UserListReq implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -10363935468256543L;
|
private static final long serialVersionUID = -10363935468256543L;
|
||||||
|
|
||||||
@ApiModelProperty("查询关键字")
|
|
||||||
private String keyword;
|
|
||||||
|
|
||||||
@ApiModelProperty("账号")
|
@ApiModelProperty("账号")
|
||||||
private String account;
|
private String account;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author huise23
|
||||||
|
* @date 2025/04/11 23:17
|
||||||
|
* @Description: 用户信息请求实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("用户信息列表响应实体")
|
||||||
|
public class UserListResp implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -3462421684738077713L;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户id")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("账号")
|
||||||
|
private String account;
|
||||||
|
|
||||||
|
@ApiModelProperty("头像地址")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty("1正常0禁用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("身份证")
|
||||||
|
private String identityCard;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
@ApiModelProperty("手机号码")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@ApiModelProperty("入职日期")
|
||||||
|
private LocalDate hiredate;
|
||||||
|
|
||||||
|
@ApiModelProperty("出生日期")
|
||||||
|
private LocalDate birthdate;
|
||||||
|
|
||||||
|
@ApiModelProperty("学历")
|
||||||
|
private String education;
|
||||||
|
|
||||||
|
@ApiModelProperty("专业方向")
|
||||||
|
private String majorField;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,9 +1,61 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: gaoxiong
|
* @Author: gaoxiong
|
||||||
* @Date: 2025/5/15 23:14
|
* @Date: 2025/5/15 23:14
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
public class UserReq {
|
@Data
|
||||||
|
@ApiModel("用户信息请求实体")
|
||||||
|
public class UserReq implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -5491849652107338027L;
|
||||||
|
|
||||||
|
@ApiModelProperty("头像地址")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty("1正常0禁用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("身份证")
|
||||||
|
private String identityCard;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
@ApiModelProperty("手机号码")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("邮箱")
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty("入职日期")
|
||||||
|
private LocalDate hiredate;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty("出生日期")
|
||||||
|
private LocalDate birthdate;
|
||||||
|
|
||||||
|
@ApiModelProperty("学历")
|
||||||
|
private String education;
|
||||||
|
|
||||||
|
@ApiModelProperty("专业")
|
||||||
|
private String majorField;
|
||||||
|
|
||||||
|
@ApiModelProperty("工作方向")
|
||||||
|
private String workField;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package com.dite.znpt.domain.vo;
|
package com.dite.znpt.domain.vo;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import com.dite.znpt.domain.entity.UserEntity;
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author huise23
|
* @author huise23
|
||||||
|
@ -11,8 +13,22 @@ import com.dite.znpt.domain.entity.UserEntity;
|
||||||
* @Description: 用户信息响应实体
|
* @Description: 用户信息响应实体
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ApiModel("用户信息响应实体")
|
@ApiModel("用户信息响应实体")
|
||||||
public class UserResp extends UserEntity {
|
public class UserResp extends UserReq implements Serializable{
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -2831232930040845716L;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户名")
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("账号")
|
||||||
|
private String account;
|
||||||
|
|
||||||
|
@ApiModelProperty("学历描述")
|
||||||
|
private String educationLabel;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.dite.znpt.enums;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/5/18 21:57
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum EducationEnum {
|
||||||
|
PRIMARY_SCHOOL("primary_school","小学"),
|
||||||
|
MIDDLE_SCHOOL("middle_school","初中"),
|
||||||
|
HIGH_SCHOOL(" high_school","高中"),
|
||||||
|
SECONDARY("secondary","中专"),
|
||||||
|
JUNIOR_COLLEGE("junior_college","大专"),
|
||||||
|
BACHELOR("bachelor","本科"),
|
||||||
|
MASTER("master","硕士"),
|
||||||
|
DOCTOR("doctor","博士");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
EducationEnum(String code, String desc){
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static EducationEnum getByCode(String code){
|
||||||
|
for (EducationEnum e : EducationEnum.values() ) {
|
||||||
|
if(e.code.equals(code)){
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDescByCode(String code){
|
||||||
|
EducationEnum e = getByCode(code);
|
||||||
|
return null == e ? null : e.desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<JSONObject> list(){
|
||||||
|
List<JSONObject> list = new ArrayList<>(EducationEnum.values().length);
|
||||||
|
for (EducationEnum e : EducationEnum.values() ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.set(e.code, e.desc);
|
||||||
|
list.add(jsonObject);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.dite.znpt.enums;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: gaoxiong
|
||||||
|
* @Date: 2025/5/18 22:47
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum GenderEnum {
|
||||||
|
MALE("male","男"),
|
||||||
|
FEMALE("female","女"),
|
||||||
|
UNKNOWN("unknown","未知");
|
||||||
|
private final String code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
GenderEnum(String code, String desc){
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static GenderEnum getByCode(String code){
|
||||||
|
for (GenderEnum e : GenderEnum.values() ) {
|
||||||
|
if(e.code.equals(code)){
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDescByCode(String code){
|
||||||
|
GenderEnum e = getByCode(code);
|
||||||
|
return null == e ? null : e.desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<JSONObject> list(){
|
||||||
|
List<JSONObject> list = new ArrayList<>(GenderEnum.values().length);
|
||||||
|
for (GenderEnum e : GenderEnum.values() ) {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.set(e.code, e.desc);
|
||||||
|
list.add(jsonObject);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,7 +18,6 @@ import com.dite.znpt.service.ImageService;
|
||||||
import com.dite.znpt.service.PartService;
|
import com.dite.znpt.service.PartService;
|
||||||
import com.dite.znpt.util.EXIFUtil;
|
import com.dite.znpt.util.EXIFUtil;
|
||||||
import com.dite.znpt.util.PageUtil;
|
import com.dite.znpt.util.PageUtil;
|
||||||
import lombok.Getter;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -145,7 +144,7 @@ public class ImageServiceImpl extends ServiceImpl<ImageMapper, ImageEntity> impl
|
||||||
}
|
}
|
||||||
ImageSourceEnum imageSourceEnum = ImageSourceEnum.getByCode(imageSource);
|
ImageSourceEnum imageSourceEnum = ImageSourceEnum.getByCode(imageSource);
|
||||||
if(null == imageSourceEnum || imageSourceEnum.isDefectImage()){
|
if(null == imageSourceEnum || imageSourceEnum.isDefectImage()){
|
||||||
throw new ServiceException(Message.IMAGE_SOURCE_I_NOT_EXIST_OR_ILLEGAL);
|
throw new ServiceException(Message.IMAGE_SOURCE_ID_NOT_EXIST_OR_ILLEGAL);
|
||||||
}
|
}
|
||||||
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
String path_prefix = permPath.concat(StrUtil.BACKSLASH).concat(imageSource).concat(StrUtil.BACKSLASH).concat(dateStr).concat(StrUtil.BACKSLASH);
|
String path_prefix = permPath.concat(StrUtil.BACKSLASH).concat(imageSource).concat(StrUtil.BACKSLASH).concat(dateStr).concat(StrUtil.BACKSLASH);
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class PartServiceImpl extends ServiceImpl<PartMapper, PartEntity> impleme
|
||||||
if(StrUtil.isNotEmpty(resp.getTurbineId())){
|
if(StrUtil.isNotEmpty(resp.getTurbineId())){
|
||||||
TurbineEntity turbine = turbineService.getById(resp.getTurbineId());
|
TurbineEntity turbine = turbineService.getById(resp.getTurbineId());
|
||||||
if(null != turbine){
|
if(null != turbine){
|
||||||
resp.setTurbineId(turbine.getTurbineName());
|
resp.setTurbineName(turbine.getTurbineName());
|
||||||
if(StrUtil.isNotEmpty(turbine.getProjectId())){
|
if(StrUtil.isNotEmpty(turbine.getProjectId())){
|
||||||
ProjectEntity project = projectService.getById(turbine.getProjectId());
|
ProjectEntity project = projectService.getById(turbine.getProjectId());
|
||||||
if(null != project){
|
if(null != project){
|
||||||
|
|
|
@ -1,15 +1,20 @@
|
||||||
package com.dite.znpt.service.impl;
|
package com.dite.znpt.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dite.znpt.constant.Message;
|
||||||
|
import com.dite.znpt.converts.Converts;
|
||||||
import com.dite.znpt.domain.entity.UserEntity;
|
import com.dite.znpt.domain.entity.UserEntity;
|
||||||
import com.dite.znpt.domain.vo.UserListReq;
|
import com.dite.znpt.domain.vo.UserListReq;
|
||||||
import com.dite.znpt.domain.vo.UserReq;
|
import com.dite.znpt.domain.vo.UserReq;
|
||||||
import com.dite.znpt.domain.vo.UserResp;
|
import com.dite.znpt.domain.vo.UserResp;
|
||||||
|
import com.dite.znpt.enums.EducationEnum;
|
||||||
|
import com.dite.znpt.exception.ServiceException;
|
||||||
import com.dite.znpt.service.UserService;
|
import com.dite.znpt.service.UserService;
|
||||||
import com.dite.znpt.mapper.UserMapper;
|
import com.dite.znpt.mapper.UserMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import com.dite.znpt.util.PageUtil;
|
import com.dite.znpt.util.PageUtil;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -32,7 +37,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public List<UserResp> page(UserListReq req) {
|
public List<UserResp> page(UserListReq req) {
|
||||||
return null;
|
PageUtil.startPage();
|
||||||
|
return this.list(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +54,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
||||||
PageUtil.startPage();
|
PageUtil.startPage();
|
||||||
List<UserResp> userRespList= this.baseMapper.queryBySelective(req);
|
List<UserResp> userRespList= this.baseMapper.queryBySelective(req);
|
||||||
userRespList.forEach(resp -> {
|
userRespList.forEach(resp -> {
|
||||||
|
resp.setEducationLabel(EducationEnum.getDescByCode(resp.getEducation()));
|
||||||
});
|
});
|
||||||
return userRespList;
|
return userRespList;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +69,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public UserResp detail(String userId) {
|
public UserResp detail(String userId) {
|
||||||
return null;
|
UserEntity entity = this.getById(userId);
|
||||||
|
return Converts.INSTANCE.toUserResp(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,9 +80,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
||||||
* @author huise23
|
* @author huise23
|
||||||
* @date 2025/04/11 23:17
|
* @date 2025/04/11 23:17
|
||||||
**/
|
**/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void save(UserReq req) {
|
public void save(UserReq req) {
|
||||||
|
UserEntity entity = Converts.INSTANCE.toUserEntity(req);
|
||||||
|
this.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,9 +95,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
||||||
* @author huise23
|
* @author huise23
|
||||||
* @date 2025/04/11 23:17
|
* @date 2025/04/11 23:17
|
||||||
**/
|
**/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void update(String userId, UserReq req) {
|
public void update(String userId, UserReq req) {
|
||||||
|
if(null == this.getById(userId)){
|
||||||
|
throw new ServiceException(Message.USER_ID_NOT_EXIST);
|
||||||
|
}
|
||||||
|
UserEntity entity = Converts.INSTANCE.toUserEntity(req);
|
||||||
|
entity.setUserId(userId);
|
||||||
|
this.updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,9 +113,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
|
||||||
* @author huise23
|
* @author huise23
|
||||||
* @date 2025/04/11 23:17
|
* @date 2025/04/11 23:17
|
||||||
**/
|
**/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public void deleteById(String userId) {
|
public void deleteById(String userId) {
|
||||||
|
if(null == this.getById(userId)){
|
||||||
|
throw new ServiceException(Message.USER_ID_NOT_EXIST);
|
||||||
|
}
|
||||||
|
this.removeById(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class JobAntiThunderWorkServiceImpl extends ServiceImpl<JobAntiThunderWor
|
||||||
} else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) {
|
} else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) {
|
||||||
workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()));
|
workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()));
|
||||||
jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal());
|
jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal());
|
||||||
} else if (project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
} else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ public class JobAntiThunderWorkServiceImpl extends ServiceImpl<JobAntiThunderWor
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
||||||
} else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())
|
} else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())
|
||||||
|| Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())
|
|| Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())
|
||||||
|| project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
|| project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class JobInWorkServiceImpl extends ServiceImpl<JobInWorkMapper, JobInWork
|
||||||
} else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) {
|
} else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) {
|
||||||
workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()));
|
workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()));
|
||||||
jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal());
|
jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal());
|
||||||
} else if (project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
} else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ public class JobInWorkServiceImpl extends ServiceImpl<JobInWorkMapper, JobInWork
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
||||||
} else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())
|
} else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())
|
||||||
|| Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())
|
|| Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())
|
||||||
|| project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
|| project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -250,7 +250,7 @@ public class JobOutWorkServiceImpl extends ServiceImpl<JobOutWorkMapper, JobOutW
|
||||||
} else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) {
|
} else if (Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())) {
|
||||||
workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()));
|
workList.forEach(item -> item.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal()));
|
||||||
jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal());
|
jobInfo.setQualityOfficerStatus(Enums.EAuthStatus.APPROVAL.getVal());
|
||||||
} else if (project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
} else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ public class JobOutWorkServiceImpl extends ServiceImpl<JobOutWorkMapper, JobOutW
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
||||||
} else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())
|
} else if (Enums.ERoleCode.SafetyOfficer.getName().equals(UserContext.getRoleCode())
|
||||||
|| Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())
|
|| Enums.ERoleCode.QualityOfficer.getName().equals(UserContext.getRoleCode())
|
||||||
|| project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
|| project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ public class JobSummaryWorkServiceImpl extends ServiceImpl<JobSummaryWorkMapper,
|
||||||
if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) {
|
if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.MANAGER_APPROVAL.getValue());
|
||||||
} else if (project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
} else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.LEADER_SUBMITTED.getValue());
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ public class JobSummaryWorkServiceImpl extends ServiceImpl<JobSummaryWorkMapper,
|
||||||
if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) {
|
if (Enums.ERoleCode.ProjectManager.getName().equals(UserContext.getRoleCode())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.SUBMITTED.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.SUBMITTED.getValue());
|
||||||
} else if (project.getConstructionTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
} else if (project.getConstructTeamLeaderId().equals(UserContext.getUserInfo().getUserId())) {
|
||||||
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
workList.forEach(item -> item.setStatus(Enums.EWorkStatus.DRAFT.getValue()));
|
||||||
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
jobInfo.setStatus(Enums.EWorkStatus.DRAFT.getValue());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.dite.znpt.mapper.ProjectMapper">
|
<mapper namespace="com.dite.znpt.mapper.ProjectMapper">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectListResp">
|
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ProjectListResp">
|
||||||
SELECT
|
SELECT
|
||||||
prj.project_id, prj.project_name, prj.farm_name, prj.status, prj.cover_url, prj.farm_address, prj.client, prj.client_contact, prj.client_phone, prj.inspection_unit,
|
prj.project_id, prj.project_name, prj.farm_name, prj.status, prj.cover_url, prj.farm_address, prj.client, prj.client_contact, prj.client_phone, prj.inspection_unit,
|
||||||
prj.inspection_contact, prj.inspection_phone, prj.scale, prj.turbine_model, prj.project_manager_id, prj.constructor_ids,
|
prj.inspection_contact, prj.inspection_phone, prj.scale, prj.turbine_model, prj.project_manager_id, pm.name AS project_manager_name, prj.constructor_ids,
|
||||||
prj.create_time
|
GROUP_CONCAT(DISTINCT con.name) AS constructor_name, prj.create_time
|
||||||
FROM project prj
|
FROM project prj
|
||||||
|
LEFT JOIN user pm ON pm.user_id = prj.project_manager_id
|
||||||
|
LEFT JOIN user con ON FIND_IN_SET(con.user_id,prj.constructor_ids) > 0 AND con.del_flag = '0'
|
||||||
<where>
|
<where>
|
||||||
<if test="projectName != null and projectName != ''">
|
<if test="projectName != null and projectName != ''">
|
||||||
AND prj.project_name LIKE concat ('%', #{projectName}, '%')
|
AND prj.project_name LIKE concat ('%', #{projectName}, '%')
|
||||||
|
@ -31,7 +30,7 @@
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY prj.project_id, prj.project_name, prj.farm_name, prj.status, prj.cover_url, prj.farm_address, prj.client, prj.client_contact, prj.client_phone, prj.inspection_unit,
|
GROUP BY prj.project_id, prj.project_name, prj.farm_name, prj.status, prj.cover_url, prj.farm_address, prj.client, prj.client_contact, prj.client_phone, prj.inspection_unit,
|
||||||
prj.inspection_contact, prj.inspection_phone, prj.scale, prj.turbine_model, prj.project_manager_id, prj.constructor_ids,
|
prj.inspection_contact, prj.inspection_phone, prj.scale, prj.turbine_model, prj.project_manager_id, pm.name, prj.constructor_ids,
|
||||||
prj.create_time
|
prj.create_time
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -17,6 +17,12 @@
|
||||||
<if test="turbineDesc != null and turbineDesc != ''">
|
<if test="turbineDesc != null and turbineDesc != ''">
|
||||||
and t.turbine_desc like concat ('%', #{turbineDesc}, '%')
|
and t.turbine_desc like concat ('%', #{turbineDesc}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="turbineManufacturer != null and turbineManufacturer != ''">
|
||||||
|
and t.turbine_manufacturer like concat ('%', #{turbineManufacturer}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="turbineModel != null and turbineModel != ''">
|
||||||
|
and t.turbine_model like concat ('%', #{turbineModel}, '%')
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,24 @@
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.UserResp">
|
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.UserResp">
|
||||||
select
|
SELECT
|
||||||
<include refid="Base_Column_List"/>
|
u.user_id, u.account, u.avatar, u.status, u.name, u.identity_card, u.gender, u.mobile, u.email, u.hiredate, u.birthdate, u.education, major_field
|
||||||
from user a
|
FROM user u
|
||||||
<where>
|
<where>
|
||||||
|
<if test="account != null and account != ''">
|
||||||
|
AND a.account LIKE concat ('%', #{account}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
AND a.name LIKE concat ('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="mobile != null and mobile != ''">
|
||||||
|
AND a.mobile LIKE concat ('%', #{mobile}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="email != null and email != ''">
|
||||||
|
AND a.email LIKE concat ('%', #{email}, '%')
|
||||||
|
</if>
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
and a.status = #{status}
|
AND a.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -81,14 +81,28 @@ public class CommonController {
|
||||||
public Result listWeather(){
|
public Result listWeather(){
|
||||||
return Result.ok(WeatherEnum.listAll());
|
return Result.ok(WeatherEnum.listAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询通用图片来源", httpMethod = "GET")
|
@ApiOperation(value = "查询通用图片来源", httpMethod = "GET")
|
||||||
@GetMapping("/list/common-image-source")
|
@GetMapping("/list/common-image-source")
|
||||||
public Result listCommonImageSource(){
|
public Result listCommonImageSource(){
|
||||||
return Result.ok(ImageSourceEnum.list(Boolean.FALSE));
|
return Result.ok(ImageSourceEnum.list(Boolean.FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "查询学历", httpMethod = "GET")
|
||||||
|
@GetMapping("/list/education")
|
||||||
|
public Result listEducation(){
|
||||||
|
return Result.ok(EducationEnum.list());
|
||||||
|
}
|
||||||
|
@ApiOperation(value = "查询性别", httpMethod = "GET")
|
||||||
|
@GetMapping("/list/gender")
|
||||||
|
public Result listGender(){
|
||||||
|
return Result.ok(GenderEnum.list());
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "上传图片", httpMethod = "POST")
|
@ApiOperation(value = "上传图片", httpMethod = "POST")
|
||||||
@PostMapping("/upload-image/{imageSource}")
|
@PostMapping("/upload-image/{imageSource}")
|
||||||
public Result uploadImage(@PathVariable String imageSource, MultipartFile file) throws IOException {
|
public Result uploadImage(@PathVariable String imageSource, MultipartFile file) throws IOException {
|
||||||
return Result.ok(imageService.uploadCommonImage(imageSource, file));
|
return Result.ok(imageService.uploadCommonImage(imageSource, file));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue