Commit bc24c0d0 by jiang'yun

修改

parent 5a873c1c
...@@ -200,6 +200,8 @@ public class SjDjjcController extends BaseController ...@@ -200,6 +200,8 @@ public class SjDjjcController extends BaseController
@Autowired @Autowired
private SjZjcsxxMapper sjZjcsxxMapper; private SjZjcsxxMapper sjZjcsxxMapper;
@Autowired
private SjFdfxMapper sjFdfxMapper;
...@@ -378,7 +380,7 @@ public class SjDjjcController extends BaseController ...@@ -378,7 +380,7 @@ public class SjDjjcController extends BaseController
@PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:importData')") @PreAuthorize("@ss.hasPermi('designInformation:sjDjjc:importData')")
@PostMapping("/importData") @PostMapping("/importData")
@ResponseBody @ResponseBody
public AjaxResult importData(MultipartFile file, boolean updateSupport,String jh) throws Exception public AjaxResult importData(MultipartFile file, boolean updateSupport,SjDjjc sjDjjc) throws Exception
{ {
XSSFWorkbook workbook = null; XSSFWorkbook workbook = null;
try { try {
...@@ -387,6 +389,8 @@ public class SjDjjcController extends BaseController ...@@ -387,6 +389,8 @@ public class SjDjjcController extends BaseController
// 获取井基础信息表,下标从0开始 // 获取井基础信息表,下标从0开始
XSSFSheet sheet = workbook.getSheetAt(0); XSSFSheet sheet = workbook.getSheetAt(0);
int lastRowNum = sheet.getLastRowNum(); int lastRowNum = sheet.getLastRowNum();
String jh = sjDjjc.getJh();
Long id =sjDjjc.getId();
// 通过循环,逐行取出表中每行数据 // 通过循环,逐行取出表中每行数据
for(int i=0;i<=lastRowNum;i++){ for(int i=0;i<=lastRowNum;i++){
//跳过第一行 //跳过第一行
...@@ -1789,6 +1793,18 @@ public class SjDjjcController extends BaseController ...@@ -1789,6 +1793,18 @@ public class SjDjjcController extends BaseController
CommonParam param =new CommonParam(); CommonParam param =new CommonParam();
param.setJh(jh); param.setJh(jh);
List<SjDcfxDzfc> dzfcList = djdcService.getDzfcList2(param); List<SjDcfxDzfc> dzfcList = djdcService.getDzfcList2(param);
List<SjFdfx> sjFdfxList=new ArrayList<>();
for (SjDcfxDzfc sjDcfxDzfc : dzfcList){
SjFdfx sjFdfx = new SjFdfx();
BeanUtils.copyProperties(sjDcfxDzfc,sjFdfx);
sjFdfx.setZbid(id);
sjFdfxList.add(sjFdfx);
}
if(sjFdfxList.size()>0){
sjFdfxMapper.deleteSjFdfxByZbid(id);
sjFdfxMapper.insertSjFdfxBatch(sjFdfxList);
}
if(dzfcList.size()>0){ if(dzfcList.size()>0){
sjDcfxDzfcMapper.deleteSjDcfxDzfcByJh(jh); sjDcfxDzfcMapper.deleteSjDcfxDzfcByJh(jh);
sjDcfxDzfcMapper.insertSjDcfxDzfcBatch(dzfcList); sjDcfxDzfcMapper.insertSjDcfxDzfcBatch(dzfcList);
......
package com.zjsgfa.project.zjsgfa.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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 com.zjsgfa.framework.aspectj.lang.annotation.Log;
import com.zjsgfa.framework.aspectj.lang.enums.BusinessType;
import com.zjsgfa.project.zjsgfa.domain.SjFdfx;
import com.zjsgfa.project.zjsgfa.service.ISjFdfxService;
import com.zjsgfa.framework.web.controller.BaseController;
import com.zjsgfa.framework.web.domain.AjaxResult;
import com.zjsgfa.common.utils.poi.ExcelUtil;
import com.zjsgfa.framework.web.page.TableDataInfo;
/**
* 设计-分段分析Controller
*
* @author ruoyi
* @date 2025-09-11
*/
@RestController
@RequestMapping("/system/sjFdfx")
public class SjFdfxController extends BaseController
{
@Autowired
private ISjFdfxService sjFdfxService;
/**
* 查询设计-分段分析列表
*/
//@PreAuthorize("@ss.hasPermi('system:sjFdfx:list')")
@GetMapping("/list")
public TableDataInfo list(SjFdfx sjFdfx)
{
startPage();
List<SjFdfx> list = sjFdfxService.selectSjFdfxList(sjFdfx);
return getDataTable(list);
}
/**
* 导出设计-分段分析列表
*/
//@PreAuthorize("@ss.hasPermi('system:sjFdfx:export')")
@Log(title = "设计-分段分析", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjFdfx sjFdfx)
{
List<SjFdfx> list = sjFdfxService.selectSjFdfxList(sjFdfx);
ExcelUtil<SjFdfx> util = new ExcelUtil<SjFdfx>(SjFdfx.class);
util.exportExcel(response, list, "设计-分段分析数据");
}
/**
* 获取设计-分段分析详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:sjFdfx:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjFdfxService.selectSjFdfxById(id));
}
/**
* 新增设计-分段分析
*/
//@PreAuthorize("@ss.hasPermi('system:sjFdfx:add')")
@Log(title = "设计-分段分析", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjFdfx sjFdfx)
{
return toAjax(sjFdfxService.insertSjFdfx(sjFdfx));
}
/**
* 修改设计-分段分析
*/
//@PreAuthorize("@ss.hasPermi('system:sjFdfx:edit')")
@Log(title = "设计-分段分析", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjFdfx sjFdfx)
{
return toAjax(sjFdfxService.updateSjFdfx(sjFdfx));
}
/**
* 删除设计-分段分析
*/
//@PreAuthorize("@ss.hasPermi('system:sjFdfx:remove')")
@Log(title = "设计-分段分析", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjFdfxService.deleteSjFdfxByIds(ids));
}
}
package com.zjsgfa.project.zjsgfa.domain;
import com.zjsgfa.framework.aspectj.lang.annotation.Excel;
import com.zjsgfa.framework.web.domain.BaseEntity;
import lombok.Data;
/**
* 设计-分段分析对象 sj_fdfx
*
* @author ruoyi
* @date 2025-09-11
*/
@Data
public class SjFdfx extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 主表id */
@Excel(name = "主表id")
private Long zbid;
/** 井号 */
@Excel(name = "井号")
private String jh;
/** 地质分层 */
@Excel(name = "地质分层")
private String dzfc;
/** 垂深 */
@Excel(name = "垂深")
private Double cs;
/** 井身 */
@Excel(name = "井身")
private Double xs;
/** 岩性提示 */
@Excel(name = "岩性提示")
private String yxts;
/** 油气水提示 */
@Excel(name = "油气水提示")
private String yqsts;
/** 故障提示 */
@Excel(name = "故障提示")
private String gzts;
/** 工程地质分段合并id */
@Excel(name = "工程地质分段合并id")
private String gcdzfdid;
/** 工程地质分段 */
@Excel(name = "工程地质分段")
private String gcdzfd;
/** 划分依据合并id */
@Excel(name = "划分依据合并id")
private String hfyjid;
/** 划分依据 */
@Excel(name = "划分依据")
private String hfyj;
}
package com.zjsgfa.project.zjsgfa.mapper;
import java.util.List;
import com.zjsgfa.project.zjsgfa.domain.SjFdfx;
/**
* 设计-分段分析Mapper接口
*
* @author ruoyi
* @date 2025-09-11
*/
public interface SjFdfxMapper
{
/**
* 查询设计-分段分析
*
* @param id 设计-分段分析主键
* @return 设计-分段分析
*/
public SjFdfx selectSjFdfxById(Long id);
/**
* 查询设计-分段分析列表
*
* @param sjFdfx 设计-分段分析
* @return 设计-分段分析集合
*/
public List<SjFdfx> selectSjFdfxList(SjFdfx sjFdfx);
/**
* 新增设计-分段分析
*
* @param sjFdfx 设计-分段分析
* @return 结果
*/
public int insertSjFdfx(SjFdfx sjFdfx);
/**
* 修改设计-分段分析
*
* @param sjFdfx 设计-分段分析
* @return 结果
*/
public int updateSjFdfx(SjFdfx sjFdfx);
/**
* 删除设计-分段分析
*
* @param id 设计-分段分析主键
* @return 结果
*/
public int deleteSjFdfxById(Long id);
/**
* 批量删除设计-分段分析
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjFdfxByIds(Long[] ids);
int deleteSjFdfxByZbid(Long zbid);
int insertSjFdfxBatch(List<SjFdfx> sjFdfxList);
}
package com.zjsgfa.project.zjsgfa.service;
import java.util.List;
import com.zjsgfa.project.zjsgfa.domain.SjFdfx;
/**
* 设计-分段分析Service接口
*
* @author ruoyi
* @date 2025-09-11
*/
public interface ISjFdfxService
{
/**
* 查询设计-分段分析
*
* @param id 设计-分段分析主键
* @return 设计-分段分析
*/
public SjFdfx selectSjFdfxById(Long id);
/**
* 查询设计-分段分析列表
*
* @param sjFdfx 设计-分段分析
* @return 设计-分段分析集合
*/
public List<SjFdfx> selectSjFdfxList(SjFdfx sjFdfx);
/**
* 新增设计-分段分析
*
* @param sjFdfx 设计-分段分析
* @return 结果
*/
public int insertSjFdfx(SjFdfx sjFdfx);
/**
* 修改设计-分段分析
*
* @param sjFdfx 设计-分段分析
* @return 结果
*/
public int updateSjFdfx(SjFdfx sjFdfx);
/**
* 批量删除设计-分段分析
*
* @param ids 需要删除的设计-分段分析主键集合
* @return 结果
*/
public int deleteSjFdfxByIds(Long[] ids);
/**
* 删除设计-分段分析信息
*
* @param id 设计-分段分析主键
* @return 结果
*/
public int deleteSjFdfxById(Long id);
}
package com.zjsgfa.project.zjsgfa.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zjsgfa.project.zjsgfa.mapper.SjFdfxMapper;
import com.zjsgfa.project.zjsgfa.domain.SjFdfx;
import com.zjsgfa.project.zjsgfa.service.ISjFdfxService;
/**
* 设计-分段分析Service业务层处理
*
* @author ruoyi
* @date 2025-09-11
*/
@Service
public class SjFdfxServiceImpl implements ISjFdfxService
{
@Autowired
private SjFdfxMapper sjFdfxMapper;
/**
* 查询设计-分段分析
*
* @param id 设计-分段分析主键
* @return 设计-分段分析
*/
@Override
public SjFdfx selectSjFdfxById(Long id)
{
return sjFdfxMapper.selectSjFdfxById(id);
}
/**
* 查询设计-分段分析列表
*
* @param sjFdfx 设计-分段分析
* @return 设计-分段分析
*/
@Override
public List<SjFdfx> selectSjFdfxList(SjFdfx sjFdfx)
{
return sjFdfxMapper.selectSjFdfxList(sjFdfx);
}
/**
* 新增设计-分段分析
*
* @param sjFdfx 设计-分段分析
* @return 结果
*/
@Override
public int insertSjFdfx(SjFdfx sjFdfx)
{
return sjFdfxMapper.insertSjFdfx(sjFdfx);
}
/**
* 修改设计-分段分析
*
* @param sjFdfx 设计-分段分析
* @return 结果
*/
@Override
public int updateSjFdfx(SjFdfx sjFdfx)
{
return sjFdfxMapper.updateSjFdfx(sjFdfx);
}
/**
* 批量删除设计-分段分析
*
* @param ids 需要删除的设计-分段分析主键
* @return 结果
*/
@Override
public int deleteSjFdfxByIds(Long[] ids)
{
return sjFdfxMapper.deleteSjFdfxByIds(ids);
}
/**
* 删除设计-分段分析信息
*
* @param id 设计-分段分析主键
* @return 结果
*/
@Override
public int deleteSjFdfxById(Long id)
{
return sjFdfxMapper.deleteSjFdfxById(id);
}
}
...@@ -153,7 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -153,7 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
</insert> </insert>
<update id="updateSjDjjc" parameterType="SjDjjc"> <update id="updateSjDjjc" parameterType="SjDjjc" useGeneratedKeys="true" keyProperty="id">
update sj_djjc update sj_djjc
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="jb != null">jb = #{jb},</if> <if test="jb != null">jb = #{jb},</if>
......
<?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.zjsgfa.project.zjsgfa.mapper.SjFdfxMapper">
<resultMap type="SjFdfx" id="SjFdfxResult">
<result property="id" column="id" />
<result property="zbid" column="zbid" />
<result property="jh" column="jh" />
<result property="dzfc" column="dzfc" />
<result property="cs" column="cs" />
<result property="xs" column="xs" />
<result property="yxts" column="yxts" />
<result property="yqsts" column="yqsts" />
<result property="gzts" column="gzts" />
<result property="gcdzfdid" column="gcdzfdid" />
<result property="gcdzfd" column="gcdzfd" />
<result property="hfyjid" column="hfyjid" />
<result property="hfyj" column="hfyj" />
</resultMap>
<sql id="selectSjFdfxVo">
select id, zbid, jh, dzfc, cs, xs, yxts, yqsts, gzts, gcdzfdid, gcdzfd, hfyjid, hfyj from sj_fdfx
</sql>
<select id="selectSjFdfxList" parameterType="SjFdfx" resultMap="SjFdfxResult">
<include refid="selectSjFdfxVo"/>
<where>
<if test="zbid != null "> and zbid = #{zbid}</if>
<if test="jh != null and jh != ''"> and jh = #{jh}</if>
<if test="dzfc != null and dzfc != ''"> and dzfc = #{dzfc}</if>
<if test="cs != null "> and cs = #{cs}</if>
<if test="xs != null "> and xs = #{xs}</if>
<if test="yxts != null and yxts != ''"> and yxts = #{yxts}</if>
<if test="yqsts != null and yqsts != ''"> and yqsts = #{yqsts}</if>
<if test="gzts != null and gzts != ''"> and gzts = #{gzts}</if>
<if test="gcdzfdid != null and gcdzfdid != ''"> and gcdzfdid = #{gcdzfdid}</if>
<if test="gcdzfd != null and gcdzfd != ''"> and gcdzfd = #{gcdzfd}</if>
<if test="hfyjid != null and hfyjid != ''"> and hfyjid = #{hfyjid}</if>
<if test="hfyj != null and hfyj != ''"> and hfyj = #{hfyj}</if>
</where>
</select>
<select id="selectSjFdfxById" parameterType="Long" resultMap="SjFdfxResult">
<include refid="selectSjFdfxVo"/>
where id = #{id}
</select>
<insert id="insertSjFdfx" parameterType="SjFdfx" useGeneratedKeys="true" keyProperty="id">
insert into sj_fdfx
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="zbid != null">zbid,</if>
<if test="jh != null">jh,</if>
<if test="dzfc != null">dzfc,</if>
<if test="cs != null">cs,</if>
<if test="xs != null">xs,</if>
<if test="yxts != null">yxts,</if>
<if test="yqsts != null">yqsts,</if>
<if test="gzts != null">gzts,</if>
<if test="gcdzfdid != null">gcdzfdid,</if>
<if test="gcdzfd != null">gcdzfd,</if>
<if test="hfyjid != null">hfyjid,</if>
<if test="hfyj != null">hfyj,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="zbid != null">#{zbid},</if>
<if test="jh != null">#{jh},</if>
<if test="dzfc != null">#{dzfc},</if>
<if test="cs != null">#{cs},</if>
<if test="xs != null">#{xs},</if>
<if test="yxts != null">#{yxts},</if>
<if test="yqsts != null">#{yqsts},</if>
<if test="gzts != null">#{gzts},</if>
<if test="gcdzfdid != null">#{gcdzfdid},</if>
<if test="gcdzfd != null">#{gcdzfd},</if>
<if test="hfyjid != null">#{hfyjid},</if>
<if test="hfyj != null">#{hfyj},</if>
</trim>
</insert>
<insert id="insertSjFdfxBatch">
insert into sj_fdfx (zbid,jh,dzfc,cs,xs,yxts,yqsts,gzts,gcdzfdid,gcdzfd,hfyjid,hfyj) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.zbid},#{item.jh},#{item.dzfc},#{item.cs},#{item.xs},#{item.yxts},#{item.yqsts},#{item.gzts},#{item.gcdzfdid},#{item.gcdzfd},#{item.hfyjid},#{item.hfyj})
</foreach>
</insert>
<update id="updateSjFdfx" parameterType="SjFdfx">
update sj_fdfx
<trim prefix="SET" suffixOverrides=",">
<if test="zbid != null">zbid = #{zbid},</if>
<if test="jh != null">jh = #{jh},</if>
<if test="dzfc != null">dzfc = #{dzfc},</if>
<if test="cs != null">cs = #{cs},</if>
<if test="xs != null">xs = #{xs},</if>
<if test="yxts != null">yxts = #{yxts},</if>
<if test="yqsts != null">yqsts = #{yqsts},</if>
<if test="gzts != null">gzts = #{gzts},</if>
<if test="gcdzfdid != null">gcdzfdid = #{gcdzfdid},</if>
<if test="gcdzfd != null">gcdzfd = #{gcdzfd},</if>
<if test="hfyjid != null">hfyjid = #{hfyjid},</if>
<if test="hfyj != null">hfyj = #{hfyj},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjFdfxById" parameterType="Long">
delete from sj_fdfx where id = #{id}
</delete>
<delete id="deleteSjFdfxByIds" parameterType="String">
delete from sj_fdfx where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSjFdfxByZbid">
delete from sj_fdfx where zbid = #{zbid}
</delete>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment