增加任务管理
parent
a2ad6bce52
commit
6b29ab9a30
10
pom.xml
10
pom.xml
|
@ -28,12 +28,12 @@
|
|||
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
|
||||
<druid.version>1.2.16</druid.version>
|
||||
<dynamic-ds.version>3.5.2</dynamic-ds.version>
|
||||
<commons.io.version>2.11.0</commons.io.version>
|
||||
<commons.io.version>2.13.0</commons.io.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<fastjson.version>2.0.23</fastjson.version>
|
||||
<jjwt.version>0.9.1</jjwt.version>
|
||||
<minio.version>8.2.2</minio.version>
|
||||
<poi.version>4.1.2</poi.version>
|
||||
<poi.version>5.3.0</poi.version>
|
||||
<pinyin4j.version>2.5.1</pinyin4j.version>
|
||||
<weixin.mp.version>4.0.6.B</weixin.mp.version>
|
||||
<weixin.miniapp.version>4.0.6.B</weixin.miniapp.version>
|
||||
|
@ -223,6 +223,12 @@
|
|||
<version>${yanzhu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sf.mpxj</groupId>
|
||||
<artifactId>mpxj</artifactId>
|
||||
<version>13.0.2</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ spring:
|
|||
# 服务注册地址
|
||||
server-addr: @discovery.server-addr@
|
||||
# 服务分组
|
||||
group: JiangYuQi
|
||||
group: lijun
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: @discovery.server-addr@
|
||||
|
|
|
@ -0,0 +1,348 @@
|
|||
package com.yanzhu.manage.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.yanzhu.common.core.annotation.Excel;
|
||||
import com.yanzhu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 计划管理对象 pro_plan
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-11-03
|
||||
*/
|
||||
public class ProPlan extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 公司ID */
|
||||
@Excel(name = "公司ID")
|
||||
private Long comid;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
/** 任务ID */
|
||||
@Excel(name = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
/** 任务唯一ID */
|
||||
@Excel(name = "任务唯一ID")
|
||||
private String taskUniqueId;
|
||||
|
||||
/** 父任务ID */
|
||||
@Excel(name = "父任务ID")
|
||||
private Long parentId;
|
||||
|
||||
/** 任务类型(FS,SS,FF,SF) */
|
||||
@Excel(name = "任务类型", readConverterExp = "F=S,SS,FF,SF")
|
||||
private String taskType;
|
||||
|
||||
/** 任务级别 */
|
||||
@Excel(name = "任务级别")
|
||||
private Long taskOutlineLevel;
|
||||
|
||||
/** 任务名称 */
|
||||
@Excel(name = "任务名称")
|
||||
private String taskName;
|
||||
|
||||
/** 任务工期 */
|
||||
@Excel(name = "任务工期")
|
||||
private Double taskDuation;
|
||||
|
||||
/** 任务开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "任务开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/** 任务结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "任务结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date finishDate;
|
||||
|
||||
/** 任务流 */
|
||||
@Excel(name = "任务流")
|
||||
private String predecessors;
|
||||
|
||||
/** 计划开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date planStartDate;
|
||||
|
||||
/** 计划结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date planFinishDate;
|
||||
|
||||
/** BIM ID */
|
||||
@Excel(name = "BIM ID")
|
||||
private String bimId;
|
||||
|
||||
/** 负责人 */
|
||||
@Excel(name = "负责人")
|
||||
private String operator;
|
||||
|
||||
/** 负责人ID */
|
||||
@Excel(name = "负责人ID")
|
||||
private Long operatorId;
|
||||
|
||||
/** 班组ID */
|
||||
@Excel(name = "班组ID")
|
||||
private Long groupId;
|
||||
|
||||
/** 班组名称 */
|
||||
@Excel(name = "班组名称")
|
||||
private String groupName;
|
||||
|
||||
private String compName;
|
||||
|
||||
public String getCompName() {
|
||||
return compName;
|
||||
}
|
||||
|
||||
public void setCompName(String compName) {
|
||||
this.compName = compName;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
private String projectName;
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Long isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setComid(Long comid)
|
||||
{
|
||||
this.comid = comid;
|
||||
}
|
||||
|
||||
public Long getComid()
|
||||
{
|
||||
return comid;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setTaskUniqueId(String taskUniqueId)
|
||||
{
|
||||
this.taskUniqueId = taskUniqueId;
|
||||
}
|
||||
|
||||
public String getTaskUniqueId()
|
||||
{
|
||||
return taskUniqueId;
|
||||
}
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
public void setTaskType(String taskType)
|
||||
{
|
||||
this.taskType = taskType;
|
||||
}
|
||||
|
||||
public String getTaskType()
|
||||
{
|
||||
return taskType;
|
||||
}
|
||||
public void setTaskOutlineLevel(Long taskOutlineLevel)
|
||||
{
|
||||
this.taskOutlineLevel = taskOutlineLevel;
|
||||
}
|
||||
|
||||
public Long getTaskOutlineLevel()
|
||||
{
|
||||
return taskOutlineLevel;
|
||||
}
|
||||
public void setTaskName(String taskName)
|
||||
{
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public String getTaskName()
|
||||
{
|
||||
return taskName;
|
||||
}
|
||||
public void setTaskDuation(Double taskDuation)
|
||||
{
|
||||
this.taskDuation = taskDuation;
|
||||
}
|
||||
|
||||
public Double getTaskDuation()
|
||||
{
|
||||
return taskDuation;
|
||||
}
|
||||
public void setStartDate(Date startDate)
|
||||
{
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Date getStartDate()
|
||||
{
|
||||
return startDate;
|
||||
}
|
||||
public void setFinishDate(Date finishDate)
|
||||
{
|
||||
this.finishDate = finishDate;
|
||||
}
|
||||
|
||||
public Date getFinishDate()
|
||||
{
|
||||
return finishDate;
|
||||
}
|
||||
public void setPredecessors(String predecessors)
|
||||
{
|
||||
this.predecessors = predecessors;
|
||||
}
|
||||
|
||||
public String getPredecessors()
|
||||
{
|
||||
return predecessors;
|
||||
}
|
||||
public void setPlanStartDate(Date planStartDate)
|
||||
{
|
||||
this.planStartDate = planStartDate;
|
||||
}
|
||||
|
||||
public Date getPlanStartDate()
|
||||
{
|
||||
return planStartDate;
|
||||
}
|
||||
public void setPlanFinishDate(Date planFinishDate)
|
||||
{
|
||||
this.planFinishDate = planFinishDate;
|
||||
}
|
||||
|
||||
public Date getPlanFinishDate()
|
||||
{
|
||||
return planFinishDate;
|
||||
}
|
||||
public void setBimId(String bimId)
|
||||
{
|
||||
this.bimId = bimId;
|
||||
}
|
||||
|
||||
public String getBimId()
|
||||
{
|
||||
return bimId;
|
||||
}
|
||||
public void setOperator(String operator)
|
||||
{
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperator()
|
||||
{
|
||||
return operator;
|
||||
}
|
||||
public void setOperatorId(Long operatorId)
|
||||
{
|
||||
this.operatorId = operatorId;
|
||||
}
|
||||
|
||||
public Long getOperatorId()
|
||||
{
|
||||
return operatorId;
|
||||
}
|
||||
public void setGroupId(Long groupId)
|
||||
{
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public Long getGroupId()
|
||||
{
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupName(String groupName)
|
||||
{
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
public String getGroupName()
|
||||
{
|
||||
return groupName;
|
||||
}
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("comid", getComid())
|
||||
.append("projectId", getProjectId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("taskUniqueId", getTaskUniqueId())
|
||||
.append("parentId", getParentId())
|
||||
.append("taskType", getTaskType())
|
||||
.append("taskOutlineLevel", getTaskOutlineLevel())
|
||||
.append("taskName", getTaskName())
|
||||
.append("taskDuation", getTaskDuation())
|
||||
.append("startDate", getStartDate())
|
||||
.append("finishDate", getFinishDate())
|
||||
.append("predecessors", getPredecessors())
|
||||
.append("planStartDate", getPlanStartDate())
|
||||
.append("planFinishDate", getPlanFinishDate())
|
||||
.append("bimId", getBimId())
|
||||
.append("operator", getOperator())
|
||||
.append("operatorId", getOperatorId())
|
||||
.append("groupId", getGroupId())
|
||||
.append("groupName", getGroupName())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.yanzhu.manage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.ProPlan;
|
||||
|
||||
/**
|
||||
* 计划管理Mapper接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-11-03
|
||||
*/
|
||||
public interface ProPlanMapper
|
||||
{
|
||||
/**
|
||||
* 查询计划管理
|
||||
*
|
||||
* @param id 计划管理主键
|
||||
* @return 计划管理
|
||||
*/
|
||||
public ProPlan selectProPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 查询计划管理列表
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 计划管理集合
|
||||
*/
|
||||
public List<ProPlan> selectProPlanList(ProPlan proPlan);
|
||||
|
||||
/**
|
||||
* 新增计划管理
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProPlan(ProPlan proPlan);
|
||||
|
||||
/**
|
||||
* 修改计划管理
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProPlan(ProPlan proPlan);
|
||||
|
||||
/**
|
||||
* 删除计划管理
|
||||
*
|
||||
* @param id 计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除计划管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProPlanByIds(Long[] ids);
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
<?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.yanzhu.manage.mapper.ProPlanMapper">
|
||||
|
||||
<resultMap type="ProPlan" id="ProPlanResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="comid" column="comid" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="taskUniqueId" column="task_unique_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="taskType" column="task_type" />
|
||||
<result property="taskOutlineLevel" column="task_outline_level" />
|
||||
<result property="taskName" column="task_name" />
|
||||
<result property="taskDuation" column="task_duation" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="finishDate" column="finish_date" />
|
||||
<result property="predecessors" column="predecessors" />
|
||||
<result property="planStartDate" column="plan_start_date" />
|
||||
<result property="planFinishDate" column="plan_finish_date" />
|
||||
<result property="bimId" column="bim_id" />
|
||||
<result property="operator" column="operator" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="groupName" column="group_name" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="compName" column="comp_name"/>
|
||||
<result property="projectName" column="project_name"/>
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProPlanVo">
|
||||
select pp.id, pp.comid, pp.project_id, pp.task_id, pp.task_unique_id, pp.parent_id, pp.task_type,
|
||||
pp.task_outline_level, pp.task_name, pp.task_duation, pp.start_date, pp.finish_date,
|
||||
pp.predecessors, pp.plan_start_date, pp.plan_finish_date, pp.bim_id, pp.operator, pp.operator_id,
|
||||
pp.group_id, pp.group_name, pp.is_del, pp.create_by, pp.create_time, pp.update_by, pp.update_time, pp.remark,
|
||||
dp.`dept_name` comp_name,pi.`project_name`
|
||||
from pro_plan pp
|
||||
LEFT JOIN sys_dept dp ON pp.`comid`=dp.`dept_id`
|
||||
LEFT JOIN pro_project_info pi ON pp.`project_id`=pi.`id`
|
||||
</sql>
|
||||
|
||||
<select id="selectProPlanList" parameterType="ProPlan" resultMap="ProPlanResult">
|
||||
<include refid="selectProPlanVo"/>
|
||||
<where>
|
||||
<if test="comid != null "> and pp.comid = #{comid}</if>
|
||||
<if test="projectId != null "> and pp.project_id = #{projectId}</if>
|
||||
<if test="taskId != null "> and pp.task_id = #{taskId}</if>
|
||||
<if test="taskUniqueId != null "> and pp.task_unique_id = #{taskUniqueId}</if>
|
||||
<if test="parentId != null "> and pp.parent_id = #{parentId}</if>
|
||||
<if test="taskType != null and taskType != ''"> and pp.task_type = #{taskType}</if>
|
||||
<if test="taskOutlineLevel != null "> and pp.task_outline_level = #{taskOutlineLevel}</if>
|
||||
<if test="taskName != null and taskName != ''"> and pp.task_name like concat('%', #{taskName}, '%')</if>
|
||||
<if test="taskDuation != null "> and pp.task_duation = #{taskDuation}</if>
|
||||
<if test="startDate != null "> and pp.start_date = #{startDate}</if>
|
||||
<if test="finishDate != null "> and pp.finish_date = #{finishDate}</if>
|
||||
<if test="predecessors != null and predecessors != ''"> and pp.predecessors = #{predecessors}</if>
|
||||
<if test="planStartDate != null "> and pp.plan_start_date = #{planStartDate}</if>
|
||||
<if test="planFinishDate != null "> and pp.plan_finish_date = #{planFinishDate}</if>
|
||||
<if test="bimId != null and bimId != ''"> and pp.bim_id = #{bimId}</if>
|
||||
<if test="operator != null and operator != ''"> and pp.operator = #{operator}</if>
|
||||
<if test="operatorId != null "> and pp.operator_id = #{operatorId}</if>
|
||||
<if test="groupId != null "> and pp.group_id = #{groupId}</if>
|
||||
<if test="groupName != null and groupName != ''"> and pp.group_name like concat('%', #{groupName}, '%')</if>
|
||||
<if test="isDel != null "> and pp.is_del = #{isDel}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProPlanById" parameterType="Long" resultMap="ProPlanResult">
|
||||
<include refid="selectProPlanVo"/>
|
||||
where pp.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProPlan" parameterType="ProPlan" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into pro_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="comid != null">comid,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="taskUniqueId != null">task_unique_id,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="taskType != null">task_type,</if>
|
||||
<if test="taskOutlineLevel != null">task_outline_level,</if>
|
||||
<if test="taskName != null">task_name,</if>
|
||||
<if test="taskDuation != null">task_duation,</if>
|
||||
<if test="startDate != null">start_date,</if>
|
||||
<if test="finishDate != null">finish_date,</if>
|
||||
<if test="predecessors != null">predecessors,</if>
|
||||
<if test="planStartDate != null">plan_start_date,</if>
|
||||
<if test="planFinishDate != null">plan_finish_date,</if>
|
||||
<if test="bimId != null">bim_id,</if>
|
||||
<if test="operator != null">operator,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="groupId != null">group_id,</if>
|
||||
<if test="groupName != null">group_name,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="comid != null">#{comid},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="taskUniqueId != null">#{taskUniqueId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="taskType != null">#{taskType},</if>
|
||||
<if test="taskOutlineLevel != null">#{taskOutlineLevel},</if>
|
||||
<if test="taskName != null">#{taskName},</if>
|
||||
<if test="taskDuation != null">#{taskDuation},</if>
|
||||
<if test="startDate != null">#{startDate},</if>
|
||||
<if test="finishDate != null">#{finishDate},</if>
|
||||
<if test="predecessors != null">#{predecessors},</if>
|
||||
<if test="planStartDate != null">#{planStartDate},</if>
|
||||
<if test="planFinishDate != null">#{planFinishDate},</if>
|
||||
<if test="bimId != null">#{bimId},</if>
|
||||
<if test="operator != null">#{operator},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="groupName != null">#{groupName},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProPlan" parameterType="ProPlan">
|
||||
update pro_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="comid != null">comid = #{comid},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="taskUniqueId != null">task_unique_id = #{taskUniqueId},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="taskType != null">task_type = #{taskType},</if>
|
||||
<if test="taskOutlineLevel != null">task_outline_level = #{taskOutlineLevel},</if>
|
||||
<if test="taskName != null">task_name = #{taskName},</if>
|
||||
<if test="taskDuation != null">task_duation = #{taskDuation},</if>
|
||||
<if test="startDate != null">start_date = #{startDate},</if>
|
||||
<if test="finishDate != null">finish_date = #{finishDate},</if>
|
||||
<if test="predecessors != null">predecessors = #{predecessors},</if>
|
||||
<if test="planStartDate != null">plan_start_date = #{planStartDate},</if>
|
||||
<if test="planFinishDate != null">plan_finish_date = #{planFinishDate},</if>
|
||||
<if test="bimId != null">bim_id = #{bimId},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="groupId != null">group_id = #{groupId},</if>
|
||||
<if test="groupName != null">group_name = #{groupName},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProPlanById" parameterType="Long">
|
||||
delete from pro_plan where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProPlanByIds" parameterType="String">
|
||||
delete from pro_plan where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -16,7 +16,7 @@ spring:
|
|||
# 服务注册地址
|
||||
server-addr: @discovery.server-addr@
|
||||
# 服务分组
|
||||
group: JiangYuQi
|
||||
group: lijun
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: @discovery.server-addr@
|
||||
|
|
|
@ -16,7 +16,7 @@ spring:
|
|||
# 服务注册地址
|
||||
server-addr: @discovery.server-addr@
|
||||
# 服务分组
|
||||
group: JiangYuQi
|
||||
group: lijun
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: @discovery.server-addr@
|
||||
|
|
|
@ -16,7 +16,7 @@ spring:
|
|||
# 服务注册地址
|
||||
server-addr: @discovery.server-addr@
|
||||
# 服务分组
|
||||
group: JiangYuQi
|
||||
group: lijun
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: @discovery.server-addr@
|
||||
|
|
Binary file not shown.
|
@ -91,6 +91,14 @@
|
|||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>aspose-tasks</artifactId>
|
||||
<version>24.10</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${pom.basedir}\libs\aspose-tasks-24.10-jdk17.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -99,6 +107,9 @@
|
|||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
|
|
@ -0,0 +1,183 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import java.io.File;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.util.DateUtils;
|
||||
import com.aspose.tasks.Project;
|
||||
import com.aspose.tasks.TableCollection;
|
||||
import com.aspose.tasks.Task;
|
||||
import com.aspose.tasks.TaskCollection;
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import com.yanzhu.manage.domain.ProPlan;
|
||||
import com.yanzhu.manage.service.IProPlanService;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
/**
|
||||
* 计划管理Controller
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-11-03
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/plan")
|
||||
public class ProPlanController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProPlanService proPlanService;
|
||||
|
||||
/**
|
||||
* 查询计划管理列表
|
||||
*/
|
||||
@RequiresPermissions("manage:plan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProPlan proPlan)
|
||||
{
|
||||
startPage();
|
||||
List<ProPlan> list = proPlanService.selectProPlanList(proPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计划管理列表
|
||||
*/
|
||||
@RequiresPermissions("manage:plan:export")
|
||||
@Log(title = "计划管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProPlan proPlan)
|
||||
{
|
||||
List<ProPlan> list = proPlanService.selectProPlanList(proPlan);
|
||||
ExcelUtil<ProPlan> util = new ExcelUtil<ProPlan>(ProPlan.class);
|
||||
util.exportExcel(response, list, "计划管理数据");
|
||||
}
|
||||
|
||||
@RequiresPermissions("manage:plan:import")
|
||||
@Log(title = "计划管理", businessType = BusinessType.IMPORT)
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file, Long compId,Long projectId) throws Exception {
|
||||
try {
|
||||
Project prj=new Project(file.getInputStream());
|
||||
List<ProPlan> proPlans=new ArrayList<>();
|
||||
tasksToPlans(prj.getRootTask().getChildren(),proPlans);
|
||||
for(ProPlan proPlan:proPlans){
|
||||
proPlan.setComid(compId);
|
||||
proPlan.setProjectId(projectId);
|
||||
}
|
||||
proPlanService.addTasks(proPlans);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
private void tasksToPlans(TaskCollection children, List<ProPlan> proPlans) {
|
||||
for(Task task :children){
|
||||
ProPlan proPlan=taskToPlan(task);
|
||||
proPlans.add(proPlan);
|
||||
tasksToPlans(task.getChildren(),proPlans);
|
||||
}
|
||||
}
|
||||
|
||||
private static ProPlan taskToPlan(Task task) {
|
||||
ProPlan plan=new ProPlan();
|
||||
plan.setTaskId(task.getId()*1l);
|
||||
plan.setTaskName(task.getName());
|
||||
plan.setTaskOutlineLevel(task.getOutlineLevel()*1l);
|
||||
plan.setTaskUniqueId(task.getGuid());
|
||||
plan.setParentId(task.getParentTask().getId()*1l);
|
||||
plan.setTaskDuation(task.getDuration().toDouble());
|
||||
plan.setStartDate(task.getStart());
|
||||
plan.setFinishDate(task.getFinish());
|
||||
TaskCollection task_predecessors = task.getPredecessors();
|
||||
//4. 获取前置任务(任务流)
|
||||
StringBuilder beforeTaskId = new StringBuilder();
|
||||
StringBuilder beforeTaskType = new StringBuilder();
|
||||
if(task_predecessors != null){
|
||||
if(task_predecessors.size() > 0){
|
||||
for(Task relation : task_predecessors){
|
||||
Integer targetTaskId = relation.getId();
|
||||
if(beforeTaskId.length() == 0){
|
||||
beforeTaskId.append(targetTaskId);
|
||||
beforeTaskType.append(relation.getType());
|
||||
}else{
|
||||
beforeTaskId.append("," + targetTaskId);
|
||||
beforeTaskType.append("," + relation.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String task_predecessors_str = beforeTaskId.toString();
|
||||
String task_predecessors_str_type = beforeTaskType.toString();
|
||||
plan.setPredecessors(task_predecessors_str);
|
||||
plan.setTaskType(task_predecessors_str_type);
|
||||
plan.setPlanStartDate(task.getActualStart());
|
||||
plan.setPlanFinishDate(task.getActualFinish());
|
||||
return plan;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计划管理详细信息
|
||||
*/
|
||||
@RequiresPermissions("manage:plan:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(proPlanService.selectProPlanById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划管理
|
||||
*/
|
||||
@RequiresPermissions("manage:plan:add")
|
||||
@Log(title = "计划管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProPlan proPlan)
|
||||
{
|
||||
return toAjax(proPlanService.insertProPlan(proPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划管理
|
||||
*/
|
||||
@RequiresPermissions("manage:plan:edit")
|
||||
@Log(title = "计划管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProPlan proPlan)
|
||||
{
|
||||
return toAjax(proPlanService.updateProPlan(proPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划管理
|
||||
*/
|
||||
@RequiresPermissions("manage:plan:remove")
|
||||
@Log(title = "计划管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(proPlanService.deleteProPlanByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.yanzhu.manage.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.yanzhu.manage.domain.ProPlan;
|
||||
|
||||
/**
|
||||
* 计划管理Service接口
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-11-03
|
||||
*/
|
||||
public interface IProPlanService
|
||||
{
|
||||
/**
|
||||
* 查询计划管理
|
||||
*
|
||||
* @param id 计划管理主键
|
||||
* @return 计划管理
|
||||
*/
|
||||
public ProPlan selectProPlanById(Long id);
|
||||
public ProPlan selectProPlanByUniqueId(String UniqueId);
|
||||
/**
|
||||
* 查询计划管理列表
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 计划管理集合
|
||||
*/
|
||||
public List<ProPlan> selectProPlanList(ProPlan proPlan);
|
||||
|
||||
/**
|
||||
* 新增计划管理
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProPlan(ProPlan proPlan);
|
||||
|
||||
/**
|
||||
* 修改计划管理
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProPlan(ProPlan proPlan);
|
||||
|
||||
/**
|
||||
* 批量删除计划管理
|
||||
*
|
||||
* @param ids 需要删除的计划管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProPlanByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除计划管理信息
|
||||
*
|
||||
* @param id 计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProPlanById(Long id);
|
||||
|
||||
/**
|
||||
* 批量增加
|
||||
* @param proPlans
|
||||
*/
|
||||
public void addTasks(List<ProPlan> proPlans);
|
||||
|
||||
}
|
|
@ -0,0 +1,162 @@
|
|||
package com.yanzhu.manage.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.yanzhu.manage.mapper.ProPlanMapper;
|
||||
import com.yanzhu.manage.domain.ProPlan;
|
||||
import com.yanzhu.manage.service.IProPlanService;
|
||||
|
||||
/**
|
||||
* 计划管理Service业务层处理
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2024-11-03
|
||||
*/
|
||||
@Service
|
||||
public class ProPlanServiceImpl implements IProPlanService
|
||||
{
|
||||
@Autowired
|
||||
private ProPlanMapper proPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询计划管理
|
||||
*
|
||||
* @param id 计划管理主键
|
||||
* @return 计划管理
|
||||
*/
|
||||
@Override
|
||||
public ProPlan selectProPlanById(Long id)
|
||||
{
|
||||
return proPlanMapper.selectProPlanById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProPlan selectProPlanByUniqueId(String uniqueId) {
|
||||
ProPlan where=new ProPlan();
|
||||
where.setTaskUniqueId(uniqueId);
|
||||
List<ProPlan> list=selectProPlanList(where);
|
||||
return list.size()>0?list.get(0):null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询计划管理列表
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 计划管理
|
||||
*/
|
||||
@Override
|
||||
public List<ProPlan> selectProPlanList(ProPlan proPlan)
|
||||
{
|
||||
return proPlanMapper.selectProPlanList(proPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计划管理
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertProPlan(ProPlan proPlan)
|
||||
{
|
||||
proPlan.setCreateBy(SecurityContextHolder.getUserName());
|
||||
proPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return proPlanMapper.insertProPlan(proPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计划管理
|
||||
*
|
||||
* @param proPlan 计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateProPlan(ProPlan proPlan)
|
||||
{
|
||||
proPlan.setUpdateBy(SecurityContextHolder.getUserName());
|
||||
proPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return proPlanMapper.updateProPlan(proPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除计划管理
|
||||
*
|
||||
* @param ids 需要删除的计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProPlanByIds(Long[] ids)
|
||||
{
|
||||
return proPlanMapper.deleteProPlanByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计划管理信息
|
||||
*
|
||||
* @param id 计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteProPlanById(Long id)
|
||||
{
|
||||
return proPlanMapper.deleteProPlanById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTasks(List<ProPlan> proPlans) {
|
||||
if(proPlans.size()==0){
|
||||
return;
|
||||
}
|
||||
//获取原项目数据
|
||||
ProPlan where=new ProPlan();
|
||||
where.setProjectId(proPlans.get(0).getProjectId());
|
||||
where.setComid(proPlans.get(0).getComid());
|
||||
List<ProPlan> oldList=selectProPlanList(where);
|
||||
//保存增加的UniqueId
|
||||
List<String> addId=new ArrayList<String>();
|
||||
for (ProPlan proPlan : proPlans) {
|
||||
//增加UniqueId
|
||||
addId.add(proPlan.getTaskUniqueId());
|
||||
//获取原数据
|
||||
ProPlan old=findInList(proPlan.getTaskUniqueId(),oldList);
|
||||
if(old!=null){
|
||||
//有原数据进行修改
|
||||
old.setParentId(proPlan.getParentId());
|
||||
old.setTaskName(proPlan.getTaskName());
|
||||
old.setTaskId(proPlan.getTaskId());
|
||||
old.setTaskType(proPlan.getTaskType());
|
||||
old.setTaskOutlineLevel(proPlan.getTaskOutlineLevel());
|
||||
old.setTaskDuation(proPlan.getTaskDuation());
|
||||
old.setPredecessors(proPlan.getPredecessors());
|
||||
old.setStartDate(proPlan.getStartDate());
|
||||
old.setFinishDate(proPlan.getFinishDate());
|
||||
old.setPlanStartDate(proPlan.getPlanStartDate());
|
||||
old.setPlanFinishDate(proPlan.getPlanFinishDate());
|
||||
updateProPlan(old);
|
||||
}else{
|
||||
//没有原数据进行插入
|
||||
insertProPlan(proPlan);
|
||||
}
|
||||
}
|
||||
//删除无用的数据
|
||||
for(ProPlan proPlan:oldList){
|
||||
if(!addId.contains(proPlan.getTaskUniqueId())){
|
||||
deleteProPlanById(proPlan.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ProPlan findInList(String taskUniqueId, List<ProPlan> oldList) {
|
||||
for (ProPlan proPlan : oldList) {
|
||||
if(taskUniqueId.equals(proPlan.getTaskUniqueId())){
|
||||
return proPlan;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ spring:
|
|||
# 服务注册地址
|
||||
server-addr: @discovery.server-addr@
|
||||
# 服务分组
|
||||
group: JiangYuQi
|
||||
group: lijun
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: @discovery.server-addr@
|
||||
|
|
|
@ -16,7 +16,7 @@ spring:
|
|||
# 服务注册地址
|
||||
server-addr: @discovery.server-addr@
|
||||
# 服务分组
|
||||
group: JiangYuQi
|
||||
group: lijun
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: @discovery.server-addr@
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询计划管理列表
|
||||
export function listPlan(query) {
|
||||
return request({
|
||||
url: '/manage/plan/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询计划管理详细
|
||||
export function getPlan(id) {
|
||||
return request({
|
||||
url: '/manage/plan/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增计划管理
|
||||
export function addPlan(data) {
|
||||
return request({
|
||||
url: '/manage/plan',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改计划管理
|
||||
export function updatePlan(data) {
|
||||
return request({
|
||||
url: '/manage/plan',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除计划管理
|
||||
export function delPlan(id) {
|
||||
return request({
|
||||
url: '/manage/plan/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -133,7 +133,7 @@
|
|||
</template>
|
||||
|
||||
<script setup name="Attendance_cfg">
|
||||
import { listAttendance_cfg, getAttendance_cfg, delAttendance_cfg, addAttendance_cfg, updateAttendance_cfg } from "@/api/manage/attendanceCfg";
|
||||
import { listAttendance_cfg, getAttendance_cfg, delAttendance_cfg, addAttendance_cfg, updateAttendance_cfg } from "@/api/manage/attendancecfg";
|
||||
import { findMyProjectList } from "@/api/publics";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import ubiDeviceDrawer from '../attendance_ubi_device/ubiDeviceDrawer.vue'
|
||||
|
|
|
@ -137,7 +137,8 @@
|
|||
</template>
|
||||
|
||||
<script setup name="Attendance_ubi_device">
|
||||
import { listAttendance_ubi_device, getAttendance_ubi_device, delAttendance_ubi_device, addAttendance_ubi_device, updateAttendance_ubi_device,authAttendance_ubi_device } from "@/api/manage/attendanceUbiDevice";
|
||||
import { listAttendance_ubi_device, getAttendance_ubi_device, delAttendance_ubi_device, addAttendance_ubi_device,
|
||||
updateAttendance_ubi_device,authAttendance_ubi_device } from "@/api/manage/attendanceubidevice";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { findMyProjectList } from "@/api/publics";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
</template>
|
||||
|
||||
<script setup name="DeviceDrawer">
|
||||
import { listAttendance_ubi_device, getAttendance_ubi_device, delAttendance_ubi_device, addAttendance_ubi_device, updateAttendance_ubi_device, authAttendance_ubi_device } from "@/api/manage/attendanceUbiDevice";
|
||||
import { listAttendance_ubi_device, getAttendance_ubi_device, delAttendance_ubi_device, addAttendance_ubi_device, updateAttendance_ubi_device, authAttendance_ubi_device } from "@/api/manage/attendanceubidevice";
|
||||
|
||||
import { findMyProjectList } from "@/api/publics";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
|
|
@ -0,0 +1,302 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="项目" prop="projectId">
|
||||
<el-select :disabled="data.projectId" v-model="queryParams.projectId" placeholder="请选择项目" style="width: 120px;" clearable
|
||||
@change="handleQuery">
|
||||
<el-option v-for="prj in data.projects" :key="prj.id" :label="prj.projectName" :value="prj.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8" v-if="queryParams.projectId">
|
||||
<!--
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['manage:plan:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['manage:plan:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['manage:plan:remove']">删除</el-button>
|
||||
</el-col>
|
||||
-->
|
||||
<el-col :span="1.5" >
|
||||
<el-upload ref="uploadRef" :limit="1" accept=".mpp" :headers="upload.headers"
|
||||
:action="upload.url+'?compId='+data.compId+'&projectId='+queryParams.projectId" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="true">
|
||||
<el-button type="primary" >导入(Project)</el-button>
|
||||
</el-upload>
|
||||
</el-col>
|
||||
<el-col :span="1.5" v-if="planList.length>0">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['manage:plan:export']">导出(Project)</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" v-if="1==2"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="planList" row-key="taskId" default-expand-all>
|
||||
<el-table-column label="任务名称" align="left" prop="taskName" />
|
||||
<el-table-column label="任务工期" align="center" prop="taskDuation" width="120">
|
||||
<template #default="scope">{{scope.row.taskDuation}}d</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划开始时间" align="center" prop="startDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="计划结束时间" align="center" prop="finishDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.finishDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="BIM ID" align="center" prop="bimId" width="120"/>
|
||||
<el-table-column label="负责人" align="center" prop="operator" width="120"/>
|
||||
<el-table-column label="班组名称" align="center" prop="groupName" width="120"/>
|
||||
</el-table>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Plan">
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/manage/plan";
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import { findMyProjectList } from "@/api/publics";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore()
|
||||
const planList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
/*** 用户导入参数 */
|
||||
const upload = reactive({
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: import.meta.env.VITE_APP_BASE_API + "/manage/plan/importData"
|
||||
});
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
comid: null,
|
||||
projectId: null,
|
||||
taskId: null,
|
||||
taskUniqueId: null,
|
||||
parentId: null,
|
||||
taskType: null,
|
||||
taskOutlineLevel: null,
|
||||
taskName: null,
|
||||
taskDuation: null,
|
||||
startDate: null,
|
||||
finishDate: null,
|
||||
predecessors: null,
|
||||
planStartDate: null,
|
||||
planFinishDate: null,
|
||||
bimId: null,
|
||||
operator: null,
|
||||
operatorId: null,
|
||||
groupId: null,
|
||||
groupName: null,
|
||||
isDel: null,
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
compId:'',
|
||||
projectId:''
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
function buildTree(all,id){
|
||||
let tmps=all.filter(d=>d.parentId==id);
|
||||
if(tmps.length>0){
|
||||
tmps.forEach(it=>{
|
||||
it.children=buildTree(all,it.taskId);
|
||||
});
|
||||
}
|
||||
return tmps;
|
||||
}
|
||||
|
||||
/** 查询计划管理列表 */
|
||||
function getList() {
|
||||
if(!queryParams.value.projectId){
|
||||
planList.value=[];
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
listPlan(queryParams.value).then(response => {
|
||||
let tmps= response.rows||[];
|
||||
let objs= buildTree(tmps,0)
|
||||
planList.value =objs;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 查询项目列表 */
|
||||
function getProjectList() {
|
||||
findMyProjectList({ pageNum: 1, pageSize: 100 }).then(response => {
|
||||
data.projects = response.rows;
|
||||
});
|
||||
}
|
||||
|
||||
/**文件上传中处理 */
|
||||
const handleFileUploadProgress = (event, file, fileList) => {
|
||||
upload.isUploading = true;
|
||||
};
|
||||
|
||||
/** 文件上传成功处理 */
|
||||
const handleFileSuccess = (response, file, fileList) => {
|
||||
debugger
|
||||
};
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
comid: null,
|
||||
projectId: null,
|
||||
taskId: null,
|
||||
taskUniqueId: null,
|
||||
parentId: null,
|
||||
taskType: null,
|
||||
taskOutlineLevel: null,
|
||||
taskName: null,
|
||||
taskDuation: null,
|
||||
startDate: null,
|
||||
finishDate: null,
|
||||
predecessors: null,
|
||||
planStartDate: null,
|
||||
planFinishDate: null,
|
||||
bimId: null,
|
||||
operator: null,
|
||||
operatorId: null,
|
||||
groupId: null,
|
||||
groupName: null,
|
||||
isDel: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
proxy.resetForm("planRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
let prjId=queryParams.value.projectId;
|
||||
if(prjId){
|
||||
let tmps=data.projects.filter(d=>d.id==prjId);
|
||||
data.compId=tmps.length>0?tmps[0].comId||'':''
|
||||
}else{
|
||||
data.compId="";
|
||||
}
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加计划管理";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getPlan(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改计划管理";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["planRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updatePlan(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addPlan(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除计划管理编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delPlan(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/plan/export', {
|
||||
...queryParams.value
|
||||
}, `plan_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
data.projectId=userStore.currentProId;
|
||||
data.compId=userStore.currentComId;
|
||||
getList();
|
||||
getProjectList();
|
||||
</script>
|
Loading…
Reference in New Issue