Merge branch 'master' of http://pms.dtyx.net:3000/cuizhibin/znpt-backend
This commit is contained in:
commit
39ec9a99bd
|
@ -1,17 +1,20 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
|
@ -82,6 +85,11 @@ public class ContractEntity extends AuditableEntity implements Serializable {
|
|||
@TableField("payment_date")
|
||||
private Date paymentDate;
|
||||
|
||||
@ExcelProperty("履约时间期限")
|
||||
@ApiModelProperty("履约时间期限")
|
||||
@TableField("performance_deadline")
|
||||
private Date performanceDeadline;
|
||||
|
||||
@ExcelProperty("付款地址/交付地址")
|
||||
@ApiModelProperty("付款地址/交付地址")
|
||||
@TableField("payment_address")
|
||||
|
@ -106,5 +114,10 @@ public class ContractEntity extends AuditableEntity implements Serializable {
|
|||
@ApiModelProperty("合同状态")
|
||||
@TableField("contract_status")
|
||||
private String contractStatus;
|
||||
|
||||
@ExcelProperty("合同内容")
|
||||
@ApiModelProperty("合同内容")
|
||||
@TableField("contract_text")
|
||||
private String contractText;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,10 @@ public class PostEntity extends AuditableEntity implements Serializable {
|
|||
@TableId(value = "post_id", type = IdType.ASSIGN_UUID)
|
||||
private String postId;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField("dept_id")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty("岗位名称")
|
||||
@TableField("post_name")
|
||||
private String postName;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
|
@ -57,6 +57,9 @@ public class ContractListReq implements Serializable {
|
|||
@ApiModelProperty("付款日期/交付日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ApiModelProperty("履约时间期限")
|
||||
private Date performanceDeadline;
|
||||
|
||||
@ApiModelProperty("付款地址/交付地址")
|
||||
private String paymentAddress;
|
||||
|
||||
|
@ -72,5 +75,8 @@ public class ContractListReq implements Serializable {
|
|||
@ApiModelProperty("合同状态")
|
||||
private String contractStatus;
|
||||
|
||||
@ApiModelProperty("合同内容")
|
||||
private String contractText;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
|
@ -62,6 +55,9 @@ public class ContractReq implements Serializable {
|
|||
@ApiModelProperty("付款日期/交付日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ApiModelProperty("履约时间期限")
|
||||
private Date performanceDeadline;
|
||||
|
||||
@ApiModelProperty("付款地址/交付地址")
|
||||
private String paymentAddress;
|
||||
|
||||
|
@ -76,5 +72,8 @@ public class ContractReq implements Serializable {
|
|||
|
||||
@ApiModelProperty("合同状态")
|
||||
private String contractStatus;
|
||||
|
||||
@ApiModelProperty("合同内容")
|
||||
private String contractText;
|
||||
}
|
||||
|
||||
|
|
|
@ -106,4 +106,8 @@ public class ImageListResp implements Serializable {
|
|||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("上传时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
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.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -60,4 +62,8 @@ public class ImageResp implements Serializable {
|
|||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("上传时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
* @date 2025/8/6/周三 14:37
|
||||
* @description
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("项目预算信息列表请求实体")
|
||||
public class PostListReq implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = -3911963210474319099L;
|
||||
|
||||
@ApiModelProperty("岗位名称")
|
||||
private String postName;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty("是否包含部门子节点")
|
||||
private Boolean includeDeptChildren;
|
||||
}
|
|
@ -21,6 +21,10 @@ public class PostReq implements Serializable {
|
|||
@Serial
|
||||
private static final long serialVersionUID = -149328762675637911L;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
@NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "部门id不能为空")
|
||||
private String deptId;
|
||||
|
||||
@NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "岗位名称不能为空")
|
||||
@Size(max = 30, groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "岗位名称长度不能超过30个字符")
|
||||
@ApiModelProperty("岗位名称")
|
||||
|
|
|
@ -22,6 +22,12 @@ public class PostResp implements Serializable {
|
|||
@ApiModelProperty("岗位id")
|
||||
private String postId;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("岗位名称")
|
||||
private String postName;
|
||||
|
||||
|
|
|
@ -2,6 +2,10 @@ package com.dite.znpt.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.PostEntity;
|
||||
import com.dite.znpt.domain.vo.PostListReq;
|
||||
import com.dite.znpt.domain.vo.PostResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Bear.G
|
||||
|
@ -9,4 +13,6 @@ import com.dite.znpt.domain.entity.PostEntity;
|
|||
* @description
|
||||
*/
|
||||
public interface PostMapper extends BaseMapper<PostEntity> {
|
||||
|
||||
List<PostResp> selectPostResp(PostListReq req);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.dite.znpt.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.PostEntity;
|
||||
import com.dite.znpt.domain.vo.PostListReq;
|
||||
import com.dite.znpt.domain.vo.PostReq;
|
||||
import com.dite.znpt.domain.vo.PostResp;
|
||||
|
||||
|
@ -14,9 +15,9 @@ import java.util.List;
|
|||
*/
|
||||
public interface PostService extends IService<PostEntity> {
|
||||
|
||||
List<PostResp> page(String postName);
|
||||
List<PostResp> page(PostListReq req);
|
||||
|
||||
List<PostResp> list(String postName);
|
||||
List<PostResp> list(PostListReq req);
|
||||
|
||||
PostResp detail(String postId);
|
||||
|
||||
|
|
|
@ -5,16 +5,20 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
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.DeptEntity;
|
||||
import com.dite.znpt.domain.entity.PostEntity;
|
||||
import com.dite.znpt.domain.vo.PostListReq;
|
||||
import com.dite.znpt.domain.vo.PostReq;
|
||||
import com.dite.znpt.domain.vo.PostResp;
|
||||
import com.dite.znpt.exception.ServiceException;
|
||||
import com.dite.znpt.mapper.DeptMapper;
|
||||
import com.dite.znpt.mapper.PostMapper;
|
||||
import com.dite.znpt.service.PostService;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -25,15 +29,18 @@ import java.util.List;
|
|||
@Service
|
||||
public class PostServiceImpl extends ServiceImpl<PostMapper, PostEntity> implements PostService {
|
||||
|
||||
@Resource
|
||||
private DeptMapper deptMapper;
|
||||
|
||||
@Override
|
||||
public List<PostResp> page(String postName) {
|
||||
public List<PostResp> page(PostListReq req) {
|
||||
PageUtil.startPage();
|
||||
return this.list(postName);
|
||||
return this.list(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PostResp> list(String postName) {
|
||||
return Converts.INSTANCE.toPostResp(this.list(Wrappers.lambdaQuery(PostEntity.class).like(StrUtil.isNotBlank(postName), PostEntity::getPostName, postName)));
|
||||
public List<PostResp> list(PostListReq req) {
|
||||
return this.baseMapper.selectPostResp(req);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,6 +53,9 @@
|
|||
<if test="paymentDate != null">
|
||||
and a.payment_date = #{paymentDate}
|
||||
</if>
|
||||
<if test="performanceDeadline != null">
|
||||
and a.performance_deadline = #{performanceDeadline}
|
||||
</if>
|
||||
<if test="paymentAddress != null and paymentAddress != ''">
|
||||
and a.payment_address like concat ('%', #{paymentAddress}, '%')
|
||||
</if>
|
||||
|
@ -68,6 +71,9 @@
|
|||
<if test="contractStatus != null and contractStatus != ''">
|
||||
and a.contract_status like concat ('%', #{contractStatus}, '%')
|
||||
</if>
|
||||
<if test="contractText != null">
|
||||
and a.contract_text like concat ('%', #{contractText}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
i.image_id, i.image_name, i.part_id, p.part_name, i.image_resolution, i.focal_distance, i.shooting_time, i.camera_manufacturer,
|
||||
i.camera_model, i.GPS, ic.weather, ic.humidness, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature, ic.wind_level,
|
||||
ic.shooting_method, ic.shooting_distance,ic.collector_name, i.image_type, i.image_path, ic.image_source, i.review_state, i.image_type_label,
|
||||
i.pre_image_path, i.project_id, i.pre_treatment
|
||||
i.pre_image_path, i.project_id, i.pre_treatment, i.create_time, i.create_by
|
||||
FROM image i
|
||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||
LEFT JOIN part p ON i.part_id = p.part_id
|
||||
|
@ -79,7 +79,7 @@
|
|||
i.focal_distance35, i.x_resolution, i.y_resolution, i.resolution_units, i.shooting_time, i.camera_manufacturer, i.camera_model,
|
||||
i.latitude, i.latitude, i.altitude, ic.collect_id, ic.weather, CONCAT(ic.temperature_min, '℃', '~',temperature_max, '℃') AS temperature,
|
||||
ic.wind_level, ic.shooting_method, ic.shooting_distance, ic.collector_name, ic.image_source, i.review_state, i.image_type, i.image_type_label,
|
||||
i.pre_treatment, i.project_id
|
||||
i.pre_treatment, i.project_id, i.create_time
|
||||
FROM image i
|
||||
LEFT JOIN image_collect ic ON i.collect_id = ic.collect_id
|
||||
WHERE i.image_id = #{imageId}
|
||||
|
|
|
@ -2,4 +2,30 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dite.znpt.mapper.PostMapper">
|
||||
|
||||
<select id="selectPostResp" resultType="com.dite.znpt.domain.vo.PostResp">
|
||||
SELECT p.*, d.dept_name FROM post p
|
||||
LEFT JOIN dept d ON p.dept_id = d.dept_id
|
||||
<where>
|
||||
<if test="postName != null and postName != ''">
|
||||
AND p.post_name LIKE concat('%',#{postName}, '%')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != ''">
|
||||
<choose >
|
||||
<when test="includeDeptChildren">
|
||||
AND p.dept_id IN (
|
||||
WITH RECURSIVE SubDepts AS (
|
||||
SELECT * FROM dept WHERE del_flag = '0' AND dept_id = #{deptId}
|
||||
UNION ALL
|
||||
SELECT d.* FROM dept d INNER JOIN SubDepts sd ON d.parent_id = sd.dept_id WHERE d.del_flag = '0'
|
||||
) SELECT dept_id FROM SubDepts
|
||||
)
|
||||
</when>
|
||||
<otherwise>
|
||||
AND p.dept_id = #{deptId}
|
||||
</otherwise>
|
||||
</choose>
|
||||
AND d.del_flag = '0'
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
|
@ -2,6 +2,7 @@ package com.dite.znpt.web.controller;
|
|||
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.vo.PostListReq;
|
||||
import com.dite.znpt.domain.vo.PostReq;
|
||||
import com.dite.znpt.domain.vo.PostResp;
|
||||
import com.dite.znpt.service.PostService;
|
||||
|
@ -28,14 +29,14 @@ public class PostController {
|
|||
|
||||
@ApiOperation(value = "分页查询岗位信息列表", httpMethod = "GET")
|
||||
@GetMapping("/page")
|
||||
public PageResult<PostResp> page(@RequestParam(value = "postName", required = false) String postName){
|
||||
return PageResult.ok(postService.page(postName));
|
||||
public PageResult<PostResp> page(PostListReq req){
|
||||
return PageResult.ok(postService.page(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询岗位信息列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public Result<List<PostResp>> list(@RequestParam(value = "postName", required = false) String postName){
|
||||
return Result.ok(postService.list(postName));
|
||||
public Result<List<PostResp>> list(PostListReq req){
|
||||
return Result.ok(postService.list(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询岗位信息详情", httpMethod = "GET")
|
||||
|
|
|
@ -14,7 +14,7 @@ spring:
|
|||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://39.99.201.243:3306/test01?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://39.99.201.243:3306/znpt_dev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: BUw8YW6%@^8q
|
||||
druid:
|
||||
|
|
Loading…
Reference in New Issue