javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/controller/HoleLogController.java
New file @@ -0,0 +1,120 @@ package com.javaweb.geo.controller; import java.util.List; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.javaweb.common.annotation.Log; import com.javaweb.common.enums.BusinessType; import com.javaweb.geo.domain.HoleLog; import com.javaweb.geo.service.IHoleLogService; import com.javaweb.common.core.controller.BaseController; import com.javaweb.common.core.domain.AjaxResult; import com.javaweb.common.utils.poi.ExcelUtil; import com.javaweb.common.core.page.TableDataInfo; /** * 钻孔日志Controller * * @author cxy * @date 2024-05-21 */ @Controller @RequestMapping("/geo/holeLog") public class HoleLogController extends BaseController { private String prefix = "geo/holeLog"; @Autowired private IHoleLogService holeLogService; @RequiresPermissions("geo:holeLog:view") @GetMapping() public String holeLog(String id, ModelMap mmap) { mmap.put("projectId", id); return prefix + "/holeLog"; } /** * 查询钻孔日志列表 */ @RequiresPermissions("geo:holeLog:list") @PostMapping("/list") @ResponseBody public TableDataInfo list(HoleLog holeLog) { startPage(); List<HoleLog> list = holeLogService.selectHoleLogList(holeLog); return getDataTable(list); } /** * 导出钻孔日志列表 */ @RequiresPermissions("geo:holeLog:export") @Log(title = "钻孔日志", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody public AjaxResult export(HoleLog holeLog) { List<HoleLog> list = holeLogService.selectHoleLogList(holeLog); ExcelUtil<HoleLog> util = new ExcelUtil<HoleLog>(HoleLog.class); return util.exportExcel(list, "holeLog"); } /** * 新增钻孔日志 */ @GetMapping("/add") public String add(String projectId, ModelMap mmap) { mmap.put("projectId", projectId); return prefix + "/add"; } /** * 新增保存钻孔日志 */ @RequiresPermissions("geo:holeLog:add") @Log(title = "钻孔日志", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(HoleLog holeLog) { return toAjax(holeLogService.insertHoleLog(holeLog)); } /** * 修改钻孔日志 */ @GetMapping("/edit/{id}") public String edit(@PathVariable("id") String id, ModelMap mmap) { HoleLog holeLog = holeLogService.selectHoleLogById(id); mmap.put("holeLog", holeLog); return prefix + "/edit"; } /** * 修改保存钻孔日志 */ @RequiresPermissions("geo:holeLog:edit") @Log(title = "钻孔日志", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(HoleLog holeLog) { return toAjax(holeLogService.updateHoleLog(holeLog)); } /** * 删除钻孔日志 */ @RequiresPermissions("geo:holeLog:remove") @Log(title = "钻孔日志", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) { return toAjax(holeLogService.deleteHoleLogByIds(ids)); } } javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/mapper/HoleLogMapper.java
New file @@ -0,0 +1,61 @@ package com.javaweb.geo.mapper; import com.javaweb.geo.domain.HoleLog; import java.util.List; /** * 钻孔日志Mapper接口 * * @author cxy * @date 2024-05-21 */ public interface HoleLogMapper { /** * 查询钻孔日志 * * @param id 钻孔日志ID * @return 钻孔日志 */ public HoleLog selectHoleLogById(String id); /** * 查询钻孔日志列表 * * @param holeLog 钻孔日志 * @return 钻孔日志集合 */ public List<HoleLog> selectHoleLogList(HoleLog holeLog); /** * 新增钻孔日志 * * @param holeLog 钻孔日志 * @return 结果 */ public int insertHoleLog(HoleLog holeLog); /** * 修改钻孔日志 * * @param holeLog 钻孔日志 * @return 结果 */ public int updateHoleLog(HoleLog holeLog); /** * 删除钻孔日志 * * @param id 钻孔日志ID * @return 结果 */ public int deleteHoleLogById(String id); /** * 批量删除钻孔日志 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteHoleLogByIds(String[] ids); } javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/IHoleLogService.java
New file @@ -0,0 +1,61 @@ package com.javaweb.geo.service; import com.javaweb.geo.domain.HoleLog; import java.util.List; /** * 钻孔日志Service接口 * * @author cxy * @date 2024-05-21 */ public interface IHoleLogService { /** * 查询钻孔日志 * * @param id 钻孔日志ID * @return 钻孔日志 */ public HoleLog selectHoleLogById(String id); /** * 查询钻孔日志列表 * * @param holeLog 钻孔日志 * @return 钻孔日志集合 */ public List<HoleLog> selectHoleLogList(HoleLog holeLog); /** * 新增钻孔日志 * * @param holeLog 钻孔日志 * @return 结果 */ public int insertHoleLog(HoleLog holeLog); /** * 修改钻孔日志 * * @param holeLog 钻孔日志 * @return 结果 */ public int updateHoleLog(HoleLog holeLog); /** * 批量删除钻孔日志 * * @param ids 需要删除的数据ID * @return 结果 */ public int deleteHoleLogByIds(String ids); /** * 删除钻孔日志信息 * * @param id 钻孔日志ID * @return 结果 */ public int deleteHoleLogById(String id); } javaweb-plus/javaweb-cms/src/main/java/com/javaweb/geo/service/impl/HoleLogServiceImpl.java
New file @@ -0,0 +1,94 @@ package com.javaweb.geo.service.impl; import java.util.List; import com.javaweb.common.utils.DateUtils; import com.javaweb.common.utils.IdGenerate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.javaweb.geo.mapper.HoleLogMapper; import com.javaweb.geo.domain.HoleLog; import com.javaweb.geo.service.IHoleLogService; import com.javaweb.common.core.text.Convert; import org.springframework.util.ObjectUtils; /** * 钻孔日志Service业务层处理 * * @author cxy * @date 2024-05-21 */ @Service public class HoleLogServiceImpl implements IHoleLogService { @Autowired private HoleLogMapper holeLogMapper; /** * 查询钻孔日志 * * @param id 钻孔日志ID * @return 钻孔日志 */ @Override public HoleLog selectHoleLogById(String id) { return holeLogMapper.selectHoleLogById(id); } /** * 查询钻孔日志列表 * * @param holeLog 钻孔日志 * @return 钻孔日志 */ @Override public List<HoleLog> selectHoleLogList(HoleLog holeLog) { return holeLogMapper.selectHoleLogList(holeLog); } /** * 新增钻孔日志 * * @param holeLog 钻孔日志 * @return 结果 */ @Override public int insertHoleLog(HoleLog holeLog) { if(ObjectUtils.isEmpty(holeLog.getId())){ holeLog.setId(IdGenerate.nextId()); } return holeLogMapper.insertHoleLog(holeLog); } /** * 修改钻孔日志 * * @param holeLog 钻孔日志 * @return 结果 */ @Override public int updateHoleLog(HoleLog holeLog) { return holeLogMapper.updateHoleLog(holeLog); } /** * 删除钻孔日志对象 * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int deleteHoleLogByIds(String ids) { return holeLogMapper.deleteHoleLogByIds(Convert.toStrArray(ids)); } /** * 删除钻孔日志信息 * * @param id 钻孔日志ID * @return 结果 */ @Override public int deleteHoleLogById(String id) { return holeLogMapper.deleteHoleLogById(id); } } javaweb-plus/javaweb-cms/src/main/resources/mapper/geo/HoleLogMapper.xml
New file @@ -0,0 +1,105 @@ <?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.javaweb.geo.mapper.HoleLogMapper"> <resultMap type="HoleLog" id="HoleLogResult"> <result property="id" column="id" /> <result property="projectId" column="project_id" /> <result property="holeId" column="hole_id" /> <result property="code" column="code" /> <result property="beginDepth" column="begin_depth" /> <result property="endDepth" column="end_depth" /> <result property="createTime" column="create_time" /> <result property="recordPerson" column="record_person" /> <result property="description" column="description" /> <result property="isDelete" column="is_delete" /> </resultMap> <sql id="selectHoleLogVo"> select id, project_id, hole_id, code, begin_depth, end_depth, create_time, record_person, description, is_delete from js_hole_log </sql> <select id="selectHoleLogList" parameterType="HoleLog" resultMap="HoleLogResult"> <include refid="selectHoleLogVo"/> <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="code != null and code != ''"> and code = #{code}</if> <if test="beginDepth != null "> and begin_depth = #{beginDepth}</if> <if test="endDepth != null "> and end_depth = #{endDepth}</if> <if test="recordPerson != null and recordPerson != ''"> and record_person = #{recordPerson}</if> <if test="description != null and description != ''"> and description = #{description}</if> <!-- 开始时间检索 --> <if test="params.beginTime != null and params.beginTime != ''"> and date_format(create_time,'%y%m%d') >= date_format(#{params.beginCreateTime},'%y%m%d') </if> <!-- 结束时间检索 --> <if test="params.endTime != null and params.endTime != ''"> and date_format(create_time,'%y%m%d') <= date_format(#{params.endCreateTime},'%y%m%d') </if> </where> </select> <select id="selectHoleLogById" parameterType="String" resultMap="HoleLogResult"> <include refid="selectHoleLogVo"/> where id = #{id} </select> <insert id="insertHoleLog" parameterType="HoleLog"> insert into js_hole_log <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null and id != ''">id,</if> <if test="projectId != null and projectId != ''">project_id,</if> <if test="holeId != null and holeId != ''">hole_id,</if> <if test="code != null and code != ''">code,</if> <if test="beginDepth != null ">begin_depth,</if> <if test="endDepth != null ">end_depth,</if> <if test="createTime != null ">create_time,</if> <if test="recordPerson != null and recordPerson != ''">record_person,</if> <if test="description != null and description != ''">description,</if> <if test="isDelete != null and isDelete != ''">is_delete,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null and id != ''">#{id},</if> <if test="projectId != null and projectId != ''">#{projectId},</if> <if test="holeId != null and holeId != ''">#{holeId},</if> <if test="code != null and code != ''">#{code},</if> <if test="beginDepth != null ">#{beginDepth},</if> <if test="endDepth != null ">#{endDepth},</if> <if test="createTime != null ">#{createTime},</if> <if test="recordPerson != null and recordPerson != ''">#{recordPerson},</if> <if test="description != null and description != ''">#{description},</if> <if test="isDelete != null and isDelete != ''">#{isDelete},</if> </trim> </insert> <update id="updateHoleLog" parameterType="HoleLog"> update js_hole_log <trim prefix="SET" suffixOverrides=","> <if test="projectId != null and projectId != ''">project_id = #{projectId},</if> <if test="holeId != null and holeId != ''">hole_id = #{holeId},</if> <if test="code != null and code != ''">code = #{code},</if> <if test="beginDepth != null ">begin_depth = #{beginDepth},</if> <if test="endDepth != null ">end_depth = #{endDepth},</if> <if test="createTime != null ">create_time = #{createTime},</if> <if test="recordPerson != null and recordPerson != ''">record_person = #{recordPerson},</if> <if test="description != null and description != ''">description = #{description},</if> <if test="isDelete != null and isDelete != ''">is_delete = #{isDelete},</if> </trim> where id = #{id} </update> <delete id="deleteHoleLogById" parameterType="String"> delete from js_hole_log where id = #{id} </delete> <delete id="deleteHoleLogByIds" parameterType="String"> delete from js_hole_log where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper> javaweb-plus/javaweb-cms/src/main/resources/templates/geo/holeLog/add.html
New file @@ -0,0 +1,76 @@ <!DOCTYPE html> <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"> <form class="form-horizontal m" id="form-holeLog-add"> <div class="form-group"> <label class="col-sm-3 control-label">钻孔编号:</label> <div class="col-sm-8"> <input name="code" 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="beginDepth" 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="endDepth" 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="createTime" 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="recordPerson" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">描述备注:</label> <div class="col-sm-8"> <textarea name="description" class="form-control"></textarea> </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/holeLog" var projectId = [[${projectId}]]; $("#form-holeLog-add").validate({ focusCleanup: true }); $("input[name='createTime']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", autoclose: true }); function submitHandler() { if ($.validate.form()) { let formData = $('#form-holeLog-add').serialize(); let data = formData + "&projectId=" + projectId; $.operate.save(prefix + "/add", data); } } </script> </body> </html> javaweb-plus/javaweb-cms/src/main/resources/templates/geo/holeLog/edit.html
New file @@ -0,0 +1,73 @@ <!DOCTYPE html> <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"> <form class="form-horizontal m" id="form-holeLog-edit" th:object="${holeLog}"> <input name="id" th:field="*{id}" type="hidden"> <div class="form-group"> <label class="col-sm-3 control-label">钻孔编号:</label> <div class="col-sm-8"> <input name="code" th:field="*{code}" 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="beginDepth" th:field="*{beginDepth}" 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="endDepth" th:field="*{endDepth}" 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="createTime" th:value="${#dates.format(holeLog.createTime, '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="recordPerson" th:field="*{recordPerson}" class="form-control" type="text"> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label">描述备注:</label> <div class="col-sm-8"> <textarea name="description" class="form-control">[[*{description}]]</textarea> </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/holeLog"; $("#form-holeLog-edit").validate({ focusCleanup: true }); $("input[name='createTime']").datetimepicker({ format: "yyyy-mm-dd", minView: "month", autoclose: true }); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-holeLog-edit').serialize()); } } </script> </body> </html> javaweb-plus/javaweb-cms/src/main/resources/templates/geo/holeLog/holeLog.html
New file @@ -0,0 +1,120 @@ <!DOCTYPE html> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <th:block th:include="include :: header('钻孔日志列表')" /> </head> <body class="gray-bg"> <div class="container-div"> <div class="row"> <div class="col-sm-12 search-collapse"> <form id="formId"> <div class="select-list"> <ul> <li> <p>钻孔编号:</p> <input type="text" name="code"/> </li> <li class="select-time"> <p>记录保存时间:</p> <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/> <span>-</span> <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/> </li> <li> <p>描述员:</p> <input type="text" name="recordPerson"/> </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> </form> </div> <div class="btn-group-sm" id="toolbar" role="group"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="geo:holeLog:add"> <i class="fa fa-plus"></i> 添加 </a> <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="geo:holeLog:edit"> <i class="fa fa-edit"></i> 修改 </a> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="geo:holeLog:remove"> <i class="fa fa-remove"></i> 删除 </a> <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="geo:holeLog:export">--> <!-- <i class="fa fa-download"></i> 导出--> <!-- </a>--> </div> <div class="col-sm-12 select-table table-striped"> <table id="bootstrap-table"></table> </div> </div> </div> <th:block th:include="include :: footer" /> <script th:inline="javascript"> var editFlag = [[${@permission.hasPermi('geo:holeLog:edit')}]]; var removeFlag = [[${@permission.hasPermi('geo:holeLog:remove')}]]; var prefix = ctx + "geo/holeLog"; var projectId=[[${projectId}]]; $(function() { var options = { url: prefix + "/list?projectId=" + projectId, createUrl: prefix + "/add?projectId=" + projectId, updateUrl: prefix + "/edit/{id}", removeUrl: prefix + "/remove", exportUrl: prefix + "/export", modalName: "钻孔日志", columns: [{ checkbox: true }, { field : 'id', title : '主键', visible: false }, { field : 'code', title : '钻孔编号' }, { field : 'beginDepth', title : '起始深度', sortable: true }, { field : 'endDepth', title : '终止深度', sortable: true }, { field : 'createTime', title : '记录保存时间', sortable: true }, { field : 'recordPerson', title : '描述员' }, { field : 'description', title : '描述备注' }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); return actions.join(''); } }] }; $.table.init(options); }); </script> </body> </html> javaweb-plus/javaweb-cms/src/main/resources/templates/geo/project/navigate.html
@@ -31,6 +31,11 @@ </div> <div class="box-header "> <div class="box-title"> <i class="glyphicon glyphicon-map-marker"></i> <a class="afont" th:href="@{/geo/holeLog(id=${project.ids})}" target="mainFrame" onclick="selected(this)">钻孔日志</a> </div> </div> <div class="box-header "> <div class="box-title"> <i class="glyphicon glyphicon-user"></i> <a class="afont" th:href="@{/geo/projectPerson(id=${project.ids})}" target="mainFrame" onclick="selected(this)">人员管理</a> </div> </div>