地质所 沉降监测网建设项目
suerwei
2024-05-21 3282abd1d4dd2dd4a4167e027e609a52ceb8c728
人员管理模块
9个文件已修改
432 ■■■■ 已修改文件
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectPersonController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/ProjectPerson.java 189 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IProjectPersonService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/ProjectPersonServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/ProjectPersonMapper.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/upload.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/add.html 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/projectPerson.html 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/ProjectPersonController.java
@@ -19,6 +19,9 @@
import com.javaweb.common.core.domain.AjaxResult;
import com.javaweb.common.utils.poi.ExcelUtil;
import com.javaweb.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
/**
 * 项目人员Controller
@@ -118,4 +121,13 @@
    public AjaxResult remove(String ids) {
        return toAjax(projectPersonService.deleteProjectPersonByIds(ids));
    }
    /**
     * 上传图片
     */
    @PostMapping("/uploadImg")
    @ResponseBody
    public AjaxResult uploadImg(MultipartFile file, HttpServletRequest request){
        return projectPersonService.uploadImg(file,request);
    }
}
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/domain/ProjectPerson.java
@@ -5,107 +5,154 @@
import com.javaweb.common.annotation.Excel;
import com.javaweb.common.core.domain.BaseEntity;
import java.util.Date;
/**
 * 项目人员对象 js_project_person
 * 
 * @author cxy
 * @date 2024-05-16
 */
public class ProjectPerson extends BaseEntity
{
public class ProjectPerson extends BaseEntity {
    private static final long serialVersionUID = 1L;
    /** id */
    /**
     * id
     */
    private String ids;
    /** 项目id */
    /**
     * 项目id
     */
    private String projectId;
    /** 钻孔id */
    /**
     * 钻孔id
     */
    private String holeId;
    /** 人员名称 */
    /**
     * 人员名称
     */
    @Excel(name = "人员名称")
    private String name;
    /** 类型 */
    /**
     * 类型
     */
    @Excel(name = "类型")
    private String type;
    /** 手机号 */
    /**
     * 手机号
     */
    @Excel(name = "手机号")
    private String phone;
    /** 身份证号 */
    /**
     * 身份证号
     */
    @Excel(name = "身份证号")
    private String idCard;
    /** 人员分组 */
    /**
     * 人员分组
     */
    @Excel(name = "人员分组")
    private String personGroup;
    /** 职责 */
    /**
     * 职责
     */
    @Excel(name = "职责")
    private String responsibility;
    /** 状态 */
    /**
     * 进场时间
     */
    @Excel(name = "进场时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date inSiteTime;
    /**
     * 出场时间
     */
    @Excel(name = "出场时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date outSiteTime;
    /**
     * 证件类型
     */
    @Excel(name = "证件类型")
    private String documentType;
    /**
     * 证件编号
     */
    @Excel(name = "证件编号")
    private String documentCode;
    /**
     * 证件url
     */
    @Excel(name = "证件url")
    private String documentPath;
    /**
     * 状态
     */
    private String status;
    /** 是否删除(0 未删除 1删除) */
    /**
     * 是否删除(0 未删除 1删除)
     */
    private String isDeleted;
    public void setIds(String ids)
    {
    public void setIds(String ids) {
        this.ids = ids;
    }
    public String getIds()
    {
    public String getIds() {
        return ids;
    }
    public void setProjectId(String projectId)
    {
    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }
    public String getProjectId()
    {
    public String getProjectId() {
        return projectId;
    }
    public void setHoleId(String holeId)
    {
    public void setHoleId(String holeId) {
        this.holeId = holeId;
    }
    public String getHoleId()
    {
    public String getHoleId() {
        return holeId;
    }
    public void setName(String name)
    {
    public void setName(String name) {
        this.name = name;
    }
    public String getName()
    {
    public String getName() {
        return name;
    }
    public void setType(String type)
    {
    public void setType(String type) {
        this.type = type;
    }
    public String getType()
    {
    public String getType() {
        return type;
    }
    public void setPhone(String phone)
    {
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getPhone()
    {
    public String getPhone() {
        return phone;
    }
@@ -125,31 +172,70 @@
        this.personGroup = personGroup;
    }
    public void setResponsibility(String responsibility)
    {
    public void setResponsibility(String responsibility) {
        this.responsibility = responsibility;
    }
    public String getResponsibility()
    {
    public String getResponsibility() {
        return responsibility;
    }
    public void setStatus(String status)
    {
    public Date getInSiteTime() {
        return inSiteTime;
    }
    public void setInSiteTime(Date inSiteTime) {
        this.inSiteTime = inSiteTime;
    }
    public void setOutSiteTime(Date outSiteTime) {
        this.outSiteTime = outSiteTime;
    }
    public Date getOutSiteTime() {
        return outSiteTime;
    }
    public void setDocumentType(String documentType) {
        this.documentType = documentType;
    }
    public String getDocumentType() {
        return documentType;
    }
    public void setDocumentCode(String documentCode) {
        this.documentCode = documentCode;
    }
    public String getDocumentCode() {
        return documentCode;
    }
    public void setDocumentPath(String documentPath) {
        this.documentPath = documentPath;
    }
    public String getDocumentPath() {
        return documentPath;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getStatus()
    {
    public String getStatus() {
        return status;
    }
    public void setIsDeleted(String isDeleted)
    {
    public void setIsDeleted(String isDeleted) {
        this.isDeleted = isDeleted;
    }
    public String getIsDeleted()
    {
    public String getIsDeleted() {
        return isDeleted;
    }
@@ -163,6 +249,11 @@
            .append("type", getType())
            .append("phone", getPhone())
            .append("responsibility", getResponsibility())
                .append("inSiteTime", getInSiteTime())
                .append("outSiteTime", getOutSiteTime())
                .append("documentType", getDocumentType())
                .append("documentCode", getDocumentCode())
                .append("documentPath", getDocumentPath())
            .append("status", getStatus())
            .append("isDeleted", getIsDeleted())
            .append("createBy", getCreateBy())
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IProjectPersonService.java
@@ -1,6 +1,10 @@
package com.javaweb.geo.service;
import com.javaweb.common.core.domain.AjaxResult;
import com.javaweb.geo.domain.ProjectPerson;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@@ -58,4 +62,9 @@
     * @return 结果
     */
    public int deleteProjectPersonById(String ids);
    /**
     * 上传图片
     */
    AjaxResult uploadImg(MultipartFile file, HttpServletRequest request);
}
javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/ProjectPersonServiceImpl.java
@@ -1,6 +1,8 @@
package com.javaweb.geo.service.impl;
import java.util.List;
import com.javaweb.common.core.domain.AjaxResult;
import com.javaweb.common.utils.DateUtils;
import com.javaweb.common.utils.IdGenerate;
import org.springframework.beans.factory.annotation.Autowired;
@@ -10,6 +12,9 @@
import com.javaweb.geo.service.IProjectPersonService;
import com.javaweb.common.core.text.Convert;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
/**
 * 项目人员Service业务层处理
@@ -98,4 +103,26 @@
    {
        return projectPersonMapper.deleteProjectPersonById(ids);
    }
    /**
     * 上传图片
     */
    @Override
    public AjaxResult uploadImg(MultipartFile file, HttpServletRequest request) {
        String originalFilename = file.getOriginalFilename();
        //传入的钻孔的id
        String projectId = request.getParameter("projectId");
        //获取后缀.zip  保存的文件名
        String substring = originalFilename.substring(originalFilename.lastIndexOf("."));
        String UID = IdGenerate.nextId();
        String dFileName = UID + substring;
        return null;
    }
}
javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/ProjectPersonMapper.xml
@@ -14,6 +14,11 @@
        <result property="idCard"    column="id_card"    />
        <result property="personGroup"    column="person_group"    />
        <result property="responsibility"    column="responsibility"    />
        <result property="inSiteTime"    column="in_site_time"    />
        <result property="outSiteTime"    column="out_site_time"    />
        <result property="documentType"    column="document_type"    />
        <result property="documentCode"    column="document_code"    />
        <result property="documentPath"    column="document_path"    />
        <result property="status"    column="status"    />
        <result property="isDeleted"    column="is_deleted"    />
        <result property="createBy"    column="create_by"    />
@@ -24,17 +29,25 @@
    </resultMap>
    <sql id="selectProjectPersonVo">
        select ids, project_id, hole_id, name, type, phone, id_card , person_group , responsibility, status, is_deleted, create_by, create_time, update_by, update_time, remark from js_project_person
        select ids, project_id, hole_id, name, type, phone, id_card , person_group , responsibility, in_site_time, out_site_time, document_type, document_code, document_path,  status, is_deleted, create_by, create_time, update_by, update_time, remark from js_project_person
    </sql>
    <select id="selectProjectPersonList" parameterType="ProjectPerson" resultMap="ProjectPersonResult">
        <include refid="selectProjectPersonVo"/>
        <where>
            <if test="projectId != null and projectId != ''"> and project_id = #{projectId}</if>
            <if test="holeId != null  and holeId != ''"> and hole_id = #{holeId}</if>
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
            <if test="personGroup != null  and personGroup != ''"> and person_group = #{personGroup}</if>
            <if test="responsibility != null  and responsibility != ''"> and responsibility = #{responsibility}</if>
            <if test="inSiteTime != null "> and in_site_time = #{inSiteTime}</if>
            <if test="outSiteTime != null "> and out_site_time = #{outSiteTime}</if>
            <if test="documentType != null  and documentType != ''"> and document_type = #{documentType}</if>
            <if test="documentCode != null  and documentCode != ''"> and document_code = #{documentCode}</if>
            <if test="documentPath != null  and documentPath != ''"> and document_path = #{documentPath}</if>
        </where>
    </select>
    
@@ -55,6 +68,11 @@
            <if test="idCard != null  and idCard != ''">id_card,</if>
            <if test="personGroup != null  and personGroup != ''">person_group,</if>
            <if test="responsibility != null  and responsibility != ''">responsibility,</if>
            <if test="inSiteTime != null ">in_site_time,</if>
            <if test="outSiteTime != null ">out_site_time,</if>
            <if test="documentType != null  and documentType != ''">document_type,</if>
            <if test="documentCode != null  and documentCode != ''">document_code,</if>
            <if test="documentPath != null  and documentPath != ''">document_path,</if>
            <if test="status != null  and status != ''">status,</if>
            <if test="isDeleted != null  and isDeleted != ''">is_deleted,</if>
            <if test="createBy != null  and createBy != ''">create_by,</if>
@@ -73,6 +91,11 @@
            <if test="idCard != null and idCard != ''">#{idCard},</if>
            <if test="personGroup != null  and personGroup != ''">#{personGroup},</if>
            <if test="responsibility != null  and responsibility != ''">#{responsibility},</if>
            <if test="inSiteTime != null ">#{inSiteTime},</if>
            <if test="outSiteTime != null ">#{outSiteTime},</if>
            <if test="documentType != null  and documentType != ''">#{documentType},</if>
            <if test="documentCode != null  and documentCode != ''">#{documentCode},</if>
            <if test="documentPath != null  and documentPath != ''">#{documentPath},</if>
            <if test="status != null  and status != ''">#{status},</if>
            <if test="isDeleted != null  and isDeleted != ''">#{isDeleted},</if>
            <if test="createBy != null  and createBy != ''">#{createBy},</if>
@@ -94,6 +117,11 @@
            <if test="idCard != null  and idCard != ''">id_card = #{idCard},</if>
            <if test="personGroup != null  and personGroup != ''">person_group = #{personGroup},</if>
            <if test="responsibility != null  and responsibility != ''">responsibility = #{responsibility},</if>
            <if test="inSiteTime != null ">in_site_time = #{inSiteTime},</if>
            <if test="outSiteTime != null ">out_site_time = #{outSiteTime},</if>
            <if test="documentType != null  and documentType != ''">document_type = #{documentType},</if>
            <if test="documentCode != null  and documentCode != ''">document_code = #{documentCode},</if>
            <if test="documentPath != null  and documentPath != ''">document_path = #{documentPath},</if>
            <if test="status != null  and status != ''">status = #{status},</if>
            <if test="isDeleted != null  and isDeleted != ''">is_deleted = #{isDeleted},</if>
            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectData/upload.html
@@ -20,7 +20,7 @@
                             </li>  
                             
                             <li>
                                 <a class="btn btn-primary btn-rounded btn-sm" onclick="upload()"><i class="fa fa-search"></i>&nbsp;上传</a>
                                 <a class="btn btn-primary btn-rounded btn-sm" onclick="upload()"><i class="fa fa-upload"></i>&nbsp;上传</a>
                             </li>
                        </ul>
                    </div>
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/add.html
@@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增项目人员')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
@@ -44,9 +45,60 @@
                    <input name="responsibility" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">进场时间:</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="inSiteTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">出场时间:</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="outSiteTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">证件类型:</label>
                <div class="col-sm-8">
                    <input name="documentType" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">证件编号:</label>
                <div class="col-sm-8">
                    <input name="documentCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">上传证件:</label>
                <div class="col-sm-8">
                    <form id="formId"  enctype="multipart/form-data">
                        <div class="select-list">
                            <ul>
                                <li>
                                    <input type="file" id="file" name="file"/>
                                </li>
                                <li>
                                    <a class="btn btn-primary btn-rounded btn-sm" onclick="upload()"><i class="fa fa-upload"></i>&nbsp;上传</a>
                                </li>
                            </ul>
                        </div>
                    </form>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "geo/projectPerson"
        var projectId = [[${projectId}]];
@@ -62,6 +114,52 @@
                $.operate.save(prefix + "/add", data);
            }
        }
        $("input[name='inSiteTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        $("input[name='outSiteTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        function upload(){
            var file = $('#file').val();
            if (file == '' || (!$.common.endWith(file, '.png'))){
                $.modal.msgWarning("请选择待上传的文件");
                return false;
            }
            var formData = new FormData();
            formData.append("file", $('#file')[0].files[0]);
            formData.append("projectId", projectId);
            $.modal.loading("数据上传解析中");
            $.ajax({
                url: ctx + "geo/projectPerson/uploadImg",
                data: formData,
                cache: false,
                contentType: false,
                processData: false,
                type: 'POST',
                success: function (result) {
                    if (result.code == web_status.SUCCESS) {
                        $.modal.closeLoading();
                        $.modal.alertSuccess(result.msg);
                    } else if (result.code == web_status.WARNING) {
                        $.modal.closeLoading();
                        $.modal.alertWarning(result.msg)
                    } else {
                        $.modal.closeLoading();
                        $.modal.alertError(result.msg);
                    }
                }
            });
        }
    </script>
</body>
</html>
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html
@@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改项目人员')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
@@ -45,9 +46,40 @@
                    <input name="responsibility" th:field="*{responsibility}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">进场时间:</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="inSiteTime" th:value="${#dates.format(projectPerson.inSiteTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">出场时间:</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="outSiteTime" th:value="${#dates.format(projectPerson.outSiteTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">证件类型:</label>
                <div class="col-sm-8">
                    <input name="documentType" th:field="*{documentType}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">证件编号:</label>
                <div class="col-sm-8">
                    <input name="documentCode" th:field="*{documentCode}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "geo/projectPerson";
        $("#form-projectPerson-edit").validate({
@@ -59,6 +91,19 @@
                $.operate.save(prefix + "/edit", $('#form-projectPerson-edit').serialize());
            }
        }
        $("input[name='inSiteTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        $("input[name='outSiteTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/projectPerson.html
@@ -105,6 +105,24 @@
                    title : '职责'
                },
                {
                        field : 'inSiteTime',
                        title : '进场时间'
                    },
                    {
                        field : 'outSiteTime',
                        title : '出场时间'
                    },
                    {
                        field : 'documentType',
                        title : '证件类型',
                        visible: false
                    },
                    {
                        field : 'documentCode',
                        title : '证件编号',
                        visible: false
                    },
                {
                    field : 'remark', 
                    title : '备注'
                },