| | |
| | | @Autowired |
| | | private ScreenAccountService screenAccountService; |
| | | |
| | | @Autowired |
| | | private ProjectProgressService projectProgressService; |
| | | |
| | | |
| | | @ApiOperation(value = "获取项目/委托方列表",response = LoginNameVo.class) |
| | | @GetMapping("/getLoginNameVoList") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取项目最新进度",response = ProjectProgress.class) |
| | | @GetMapping("/getProjectProgress/{projectId}") |
| | | public R<ProjectProgress> getProjectProgress(@PathVariable Integer projectId) { |
| | | ProjectProgress projectProgress = projectProgressService.getOne(new LambdaQueryWrapper<ProjectProgress>().eq(ProjectProgress::getProjectId, projectId).eq(ProjectProgress::getDeleted,0).orderByDesc(ProjectProgress::getTime).last("limit 1")); |
| | | return R.ok(projectProgress); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取项目进度历史列表",response = ProjectProgress.class) |
| | | @PostMapping("/getProjectProgressList") |
| | | public R<Page<ProjectProgress>> getProjectProgressList(@Valid @RequestBody ProjectProgressQuery query) { |
| | | LambdaQueryWrapper<ProjectProgress> wrapper = new LambdaQueryWrapper<ProjectProgress>().eq(ProjectProgress::getProjectId, query.getProjectId()).eq(ProjectProgress::getDeleted, 0); |
| | | if(query.getContent()!=null && !query.getContent().isEmpty()){ |
| | | wrapper.like(ProjectProgress::getDetail, query.getContent()); |
| | | } |
| | | if(query.getStartTime()!=null && !query.getStartTime().isEmpty()){ |
| | | wrapper.ge(ProjectProgress::getTime, query.getStartTime()); |
| | | } |
| | | if(query.getEndTime()!=null && !query.getEndTime().isEmpty()){ |
| | | wrapper.le(ProjectProgress::getTime, query.getEndTime()); |
| | | } |
| | | |
| | | wrapper.orderByDesc(ProjectProgress::getTime); |
| | | Page<ProjectProgress> page = projectProgressService.page(new Page<>(query.getPageNum(), query.getPageSize()),wrapper); |
| | | return R.ok(page); |
| | | } |
| | | @ApiOperation(value = "获取项目进度详情",response = ProjectProgress.class) |
| | | @GetMapping("/getProjectProgressDetail/{id}") |
| | | public R<ProjectProgress> getProjectProgressDetail(@PathVariable Integer id) { |
| | | return R.ok(projectProgressService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取项目详情",response = Project.class) |
| | | @GetMapping("/getProjectDetail/{id}") |
| New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.system.model.ProjectProgress; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目进度 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administratorProjectProgressMapper.xml |
| | | * @since 2026-01-26 |
| | | */ |
| | | public interface ProjectProgressMapper extends BaseMapper<ProjectProgress> { |
| | | |
| | | Page<ProjectProgress> pageList(@Param("page") Page<ProjectProgress> page, @Param("name") String name, @Param("clientId") Integer clientId, @Param("sTime") String sTime, @Param("eTime") String eTime); |
| | | |
| | | ProjectProgress detail(@Param("id") Integer id); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | |
| | | 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.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目进度 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2026-01-26 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("project_progress") |
| | | public class ProjectProgress extends Model<ProjectProgress> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | @TableField("client_id") |
| | | @NotNull(message = "委托方ID不能为空") |
| | | private Integer clientId; |
| | | @TableField("project_id") |
| | | @NotNull(message = "项目ID不能为空") |
| | | private Integer projectId; |
| | | @ApiModelProperty("进度说明") |
| | | @NotBlank(message = "进度说明不能为空") |
| | | private String detail; |
| | | @TableField("time") |
| | | @ApiModelProperty("进度更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @NotNull(message = "进度更新时间不能为空") |
| | | private Date time; |
| | | @ApiModelProperty("进度url链接") |
| | | @NotBlank(message = "进度url链接不能为空") |
| | | private String url; |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | | |
| | | private Integer deleted; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("委托方名称") |
| | | private String clientName; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("项目名称") |
| | | private String projectName; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.ruoyi.common.core.domain.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "项目进度查询参数") |
| | | public class ProjectProgressQuery extends BasePage { |
| | | @ApiModelProperty(value = "内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | private String startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | private String endTime; |
| | | |
| | | @ApiModelProperty(value = "项目id") |
| | | @NotNull(message = "项目id不能为空") |
| | | private Integer projectId; |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.ProjectProgress; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目进度 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2026-01-26 |
| | | */ |
| | | public interface ProjectProgressService extends IService<ProjectProgress> { |
| | | |
| | | Page<ProjectProgress> pageList(Page<ProjectProgress> page, String name, Integer clientId, String time); |
| | | |
| | | ProjectProgress detail(Integer id); |
| | | |
| | | } |
| New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.ProjectProgressMapper; |
| | | import com.ruoyi.system.model.ProjectProgress; |
| | | import com.ruoyi.system.service.ProjectProgressService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 项目进度 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2026-01-26 |
| | | */ |
| | | @Service |
| | | public class ProjectProgressServiceImpl extends ServiceImpl<ProjectProgressMapper, ProjectProgress> implements ProjectProgressService { |
| | | |
| | | @Override |
| | | public Page<ProjectProgress> pageList(Page<ProjectProgress> page, String name, Integer clientId, String time) { |
| | | String sTime = null; |
| | | String eTime = null; |
| | | if(time!=null && !time.isEmpty()){ |
| | | String[] times = time.split(" - "); |
| | | sTime = times[0] + " 00:00:00"; |
| | | eTime = times[1] + " 23:59:59"; |
| | | |
| | | } |
| | | return this.baseMapper.pageList(page,name,clientId,sTime,eTime); |
| | | } |
| | | |
| | | @Override |
| | | public ProjectProgress detail(Integer id) { |
| | | return this.baseMapper.detail(id); |
| | | } |
| | | } |
| New file |
| | |
| | | <?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"> |
| | | <mapper namespace="com.ruoyi.system.mapper.ProjectProgressMapper"> |
| | | |
| | | |
| | | <select id="pageList" resultType="com.ruoyi.system.model.ProjectProgress"> |
| | | select t1.id,t1.detail,t1.time,t2.name as clientName,t3.name as projectName |
| | | from project_progress t1 |
| | | left join client t2 on t1.client_id = t2.id |
| | | left join project t3 on t1.project_id = t3.id |
| | | where t1.deleted= 0 |
| | | <if test="name != null and name != ''"> |
| | | and t3.name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="clientId != null"> |
| | | and t1.client_id = #{clientId} |
| | | </if> |
| | | <if test="sTime != null and sTime != ''"> |
| | | and t1.time between #{sTime} and #{eTime} |
| | | </if> |
| | | order by t1.time desc |
| | | </select> |
| | | <select id="detail" resultType="com.ruoyi.system.model.ProjectProgress"> |
| | | select t1.id,t1.detail,t1.time,t2.name as clientName,t3.name as projectName |
| | | from project_progress t1 |
| | | left join client t2 on t1.client_id = t2.id |
| | | left join project t3 on t1.project_id = t3.id |
| | | where t1.deleted= 0 and t1.id = #{id} |
| | | |
| | | |
| | | </select> |
| | | </mapper> |