Commit 7aeb9181 by jiang'yun

修改

parent c694d146
......@@ -1952,6 +1952,15 @@ public class SjDjjcController extends BaseController
return sjDjjcService.saveZtxh(param);
}
/**
* 计算钻具组合
*/
@PostMapping("/saveZjzh")
public AjaxResult saveZjzh(@RequestBody CommonParam param) throws Exception{
return sjDjjcService.saveZjzh(param);
}
@PostMapping("/exportWord")
public void exportWord(long id,HttpServletResponse response) throws Exception {
SjDjjc sjDjjc = sjDjjcService.selectSjDjjcById(id);
......
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.SjFdsgcsLjzjzh;
import com.zjsgfa.project.zjsgfa.service.ISjFdsgcsLjzjzhService;
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-03
*/
@RestController
@RequestMapping("/system/sjFdsgcsLjzjzh")
public class SjFdsgcsLjzjzhController extends BaseController
{
@Autowired
private ISjFdsgcsLjzjzhService sjFdsgcsLjzjzhService;
/**
* 查询设计信息-分段施工措施-邻井钻具组合列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFdsgcsLjzjzh:list')")
@GetMapping("/list")
public TableDataInfo list(SjFdsgcsLjzjzh sjFdsgcsLjzjzh)
{
startPage();
List<SjFdsgcsLjzjzh> list = sjFdsgcsLjzjzhService.selectSjFdsgcsLjzjzhList(sjFdsgcsLjzjzh);
return getDataTable(list);
}
/**
* 导出设计信息-分段施工措施-邻井钻具组合列表
*/
@PreAuthorize("@ss.hasPermi('system:sjFdsgcsLjzjzh:export')")
@Log(title = "设计信息-分段施工措施-邻井钻具组合", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SjFdsgcsLjzjzh sjFdsgcsLjzjzh)
{
List<SjFdsgcsLjzjzh> list = sjFdsgcsLjzjzhService.selectSjFdsgcsLjzjzhList(sjFdsgcsLjzjzh);
ExcelUtil<SjFdsgcsLjzjzh> util = new ExcelUtil<SjFdsgcsLjzjzh>(SjFdsgcsLjzjzh.class);
util.exportExcel(response, list, "设计信息-分段施工措施-邻井钻具组合数据");
}
/**
* 获取设计信息-分段施工措施-邻井钻具组合详细信息
*/
@PreAuthorize("@ss.hasPermi('system:sjFdsgcsLjzjzh:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(sjFdsgcsLjzjzhService.selectSjFdsgcsLjzjzhById(id));
}
/**
* 新增设计信息-分段施工措施-邻井钻具组合
*/
@PreAuthorize("@ss.hasPermi('system:sjFdsgcsLjzjzh:add')")
@Log(title = "设计信息-分段施工措施-邻井钻具组合", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SjFdsgcsLjzjzh sjFdsgcsLjzjzh)
{
return toAjax(sjFdsgcsLjzjzhService.insertSjFdsgcsLjzjzh(sjFdsgcsLjzjzh));
}
/**
* 修改设计信息-分段施工措施-邻井钻具组合
*/
@PreAuthorize("@ss.hasPermi('system:sjFdsgcsLjzjzh:edit')")
@Log(title = "设计信息-分段施工措施-邻井钻具组合", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SjFdsgcsLjzjzh sjFdsgcsLjzjzh)
{
return toAjax(sjFdsgcsLjzjzhService.updateSjFdsgcsLjzjzh(sjFdsgcsLjzjzh));
}
/**
* 删除设计信息-分段施工措施-邻井钻具组合
*/
@PreAuthorize("@ss.hasPermi('system:sjFdsgcsLjzjzh:remove')")
@Log(title = "设计信息-分段施工措施-邻井钻具组合", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(sjFdsgcsLjzjzhService.deleteSjFdsgcsLjzjzhByIds(ids));
}
}
package com.zjsgfa.project.zjsgfa.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zjsgfa.framework.aspectj.lang.annotation.Excel;
import com.zjsgfa.framework.web.domain.BaseEntity;
import java.util.List;
/**
* 基础信息_特殊工具对象 jcxx_tsgj
*
* @author
* @date 2025-08-06
*/
@Data
public class JcxxTsgj extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -30,6 +34,8 @@ public class JcxxTsgj extends BaseEntity
@Excel(name = "使用指南")
private String syzn;
private List<String> gjmcs;
public void setId(Long id)
{
this.id = id;
......
package com.zjsgfa.project.zjsgfa.domain;
import java.math.BigDecimal;
import com.zjsgfa.framework.aspectj.lang.annotation.Excel;
import com.zjsgfa.framework.web.domain.BaseEntity;
import lombok.Data;
/**
* 设计信息-分段施工措施-邻井钻具组合对象 sj_fdsgcs_ljzjzh
*
* @author ruoyi
* @date 2025-09-03
*/
@Data
public class SjFdsgcsLjzjzh extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 井号 */
@Excel(name = "井号")
private String jh;
private String ljjh;
/** 开次 */
@Excel(name = "开次")
private String kc;
/** 钻具组合 */
@Excel(name = "钻具组合")
private String zjzh;
/** 进尺 */
@Excel(name = "进尺")
private Double jc;
/** 时效 */
@Excel(name = "时效")
private Double sx;
}
package com.zjsgfa.project.zjsgfa.mapper;
import java.util.List;
import com.zjsgfa.project.zjsgfa.domain.SjFdsgcsLjzjzh;
/**
* 设计信息-分段施工措施-邻井钻具组合Mapper接口
*
* @author ruoyi
* @date 2025-09-03
*/
public interface SjFdsgcsLjzjzhMapper
{
/**
* 查询设计信息-分段施工措施-邻井钻具组合
*
* @param id 设计信息-分段施工措施-邻井钻具组合主键
* @return 设计信息-分段施工措施-邻井钻具组合
*/
public SjFdsgcsLjzjzh selectSjFdsgcsLjzjzhById(Long id);
/**
* 查询设计信息-分段施工措施-邻井钻具组合列表
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 设计信息-分段施工措施-邻井钻具组合集合
*/
public List<SjFdsgcsLjzjzh> selectSjFdsgcsLjzjzhList(SjFdsgcsLjzjzh sjFdsgcsLjzjzh);
/**
* 新增设计信息-分段施工措施-邻井钻具组合
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 结果
*/
public int insertSjFdsgcsLjzjzh(SjFdsgcsLjzjzh sjFdsgcsLjzjzh);
/**
* 修改设计信息-分段施工措施-邻井钻具组合
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 结果
*/
public int updateSjFdsgcsLjzjzh(SjFdsgcsLjzjzh sjFdsgcsLjzjzh);
/**
* 删除设计信息-分段施工措施-邻井钻具组合
*
* @param id 设计信息-分段施工措施-邻井钻具组合主键
* @return 结果
*/
public int deleteSjFdsgcsLjzjzhById(Long id);
/**
* 批量删除设计信息-分段施工措施-邻井钻具组合
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSjFdsgcsLjzjzhByIds(Long[] ids);
int deleteSjFdsgcsLjzjzhByJh(String jh);
int insertSjFdsgcsLjzjzhBatch(List<SjFdsgcsLjzjzh> sjFdsgcsLjzjzhList);
}
......@@ -66,4 +66,6 @@ public interface ISjDjjcService
AjaxResult saveZtxh(CommonParam param);
AjaxResult saveZjzh(CommonParam param);
}
package com.zjsgfa.project.zjsgfa.service;
import java.util.List;
import com.zjsgfa.project.zjsgfa.domain.SjFdsgcsLjzjzh;
/**
* 设计信息-分段施工措施-邻井钻具组合Service接口
*
* @author ruoyi
* @date 2025-09-03
*/
public interface ISjFdsgcsLjzjzhService
{
/**
* 查询设计信息-分段施工措施-邻井钻具组合
*
* @param id 设计信息-分段施工措施-邻井钻具组合主键
* @return 设计信息-分段施工措施-邻井钻具组合
*/
public SjFdsgcsLjzjzh selectSjFdsgcsLjzjzhById(Long id);
/**
* 查询设计信息-分段施工措施-邻井钻具组合列表
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 设计信息-分段施工措施-邻井钻具组合集合
*/
public List<SjFdsgcsLjzjzh> selectSjFdsgcsLjzjzhList(SjFdsgcsLjzjzh sjFdsgcsLjzjzh);
/**
* 新增设计信息-分段施工措施-邻井钻具组合
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 结果
*/
public int insertSjFdsgcsLjzjzh(SjFdsgcsLjzjzh sjFdsgcsLjzjzh);
/**
* 修改设计信息-分段施工措施-邻井钻具组合
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 结果
*/
public int updateSjFdsgcsLjzjzh(SjFdsgcsLjzjzh sjFdsgcsLjzjzh);
/**
* 批量删除设计信息-分段施工措施-邻井钻具组合
*
* @param ids 需要删除的设计信息-分段施工措施-邻井钻具组合主键集合
* @return 结果
*/
public int deleteSjFdsgcsLjzjzhByIds(Long[] ids);
/**
* 删除设计信息-分段施工措施-邻井钻具组合信息
*
* @param id 设计信息-分段施工措施-邻井钻具组合主键
* @return 结果
*/
public int deleteSjFdsgcsLjzjzhById(Long id);
}
......@@ -65,6 +65,9 @@ public class SjDjjcServiceImpl implements ISjDjjcService
@Autowired
private SjSggyZjzhcsMapper sjSggyZjzhcsMapper;
@Autowired
private SjFdsgcsLjzjzhMapper sjFdsgcsLjzjzhMapper;
/**
* 查询设计信息-井基础信息
......@@ -310,87 +313,125 @@ public class SjDjjcServiceImpl implements ISjDjjcService
}
sjLjtjztList.add(sjLjtjzt);
});
if(collect.size()>0){
SjZtgjsj sjZtgjsj1 = collect.get(0);
sjZtxx.setJh(jh);
sjZtxx.setLb("邻井推荐");
sjZtxx.setKc(sjJsjg1.getKc());
sjZtxx.setZtxh(collect.get(0).getZtxh());
sjZtxxMapper.deleteSjZtxxByZtxx(sjZtxx);
sjZtxxMapper.insertSjZtxx(sjZtxx);
//施工参数
SjZjcsxx sjZjcsxx =new SjZjcsxx();
sjZjcsxx.setJh(jh);
sjZjcsxx.setKc(sjJsjg1.getKc());
sjZjcsxx.setJd(ksjs+"-"+sjJsjg1.getJs());
sjZjcsxx.setZtxh(sjZtgjsj1.getZtxh());
sjZjcsxx.setCc(sjZtgjsj1.getZtcc()+"");
sjZjcsxx.setSy(sjZtgjsj1.getPz()+"");
sjZjcsxx.setZjymd(sjZtgjsj1.getZjymd()+"");
sjZjcsxx.setZjpl(sjZtgjsj1.getPl()+"");
sjZjcsxx.setZjby(sjZtgjsj1.getLgby()+"");
//查询厂家
Djjc djjc = new Djjc();
djjc.setJh(sjZtgjsj1.getLjjh());
djjc.setKc(kc+"");
djjc.setJd(sjZtgjsj1.getJd());
djjc.setJxzs(sjZtgjsj1.getJxzs());
Djjc djjc1=djdcService.selectZtsj(djjc);
if(djjc1!=null){
sjZjcsxx.setCj(djjc1.getCj());
sjZjcsxx.setYj(djjc1.getZtyj()+"");
sjZjcsxx.setZjzy(djjc1.getZy());
sjZjcsxx.setZjzs(djjc1.getZs()+"");
// if(collect.size()>0){
// SjZtgjsj sjZtgjsj1 = collect.get(0);
// sjZtxx.setJh(jh);
// sjZtxx.setLb("邻井推荐");
// sjZtxx.setKc(sjJsjg1.getKc());
// sjZtxx.setZtxh(collect.get(0).getZtxh());
// sjZtxxMapper.deleteSjZtxxByZtxx(sjZtxx);
// sjZtxxMapper.insertSjZtxx(sjZtxx);
// //施工参数
// SjZjcsxx sjZjcsxx =new SjZjcsxx();
// sjZjcsxx.setJh(jh);
// sjZjcsxx.setKc(sjJsjg1.getKc());
// sjZjcsxx.setJd(ksjs+"-"+sjJsjg1.getJs());
// sjZjcsxx.setZtxh(sjZtgjsj1.getZtxh());
// sjZjcsxx.setCc(sjZtgjsj1.getZtcc()+"");
// sjZjcsxx.setSy(sjZtgjsj1.getPz()+"");
// sjZjcsxx.setZjymd(sjZtgjsj1.getZjymd()+"");
// sjZjcsxx.setZjpl(sjZtgjsj1.getPl()+"");
// sjZjcsxx.setZjby(sjZtgjsj1.getLgby()+"");
// //查询厂家
// Djjc djjc = new Djjc();
// djjc.setJh(sjZtgjsj1.getLjjh());
// djjc.setKc(kc+"");
// djjc.setJd(sjZtgjsj1.getJd());
// djjc.setJxzs(sjZtgjsj1.getJxzs());
// Djjc djjc1=djdcService.selectZtsj(djjc);
// if(djjc1!=null){
// sjZjcsxx.setCj(djjc1.getCj());
// sjZjcsxx.setYj(djjc1.getZtyj()+"");
// sjZjcsxx.setZjzy(djjc1.getZy());
// sjZjcsxx.setZjzs(djjc1.getZs()+"");
// }
// sjZjcsxxMapper.deleteSjZjcsxxByZjcsxx(sjZjcsxx);
// sjZjcsxxMapper.insertSjZjcsxx(sjZjcsxx);
// Jsfa jsfa =new Jsfa();
// jsfa.setJh(sjZtgjsj1.getLjjh());
// jsfa.setZjjd(sjZtgjsj1.getJd());
// Jsfa jsfa1=jsaaMapper.selectJsfa(jsfa);
// String zjzh="";
// if(jsfa1!=null){
// zjzh = jsfa1.getZjzh();
// }
// SjFdsgcs sjFdsgcs =new SjFdsgcs();
// sjFdsgcs.setJh(jh);
// sjFdsgcs.setKc(sjJsjg1.getKc());
// SjFdsgcs sjFdsgcs1 = sjFdsgcsMapper.selectSjFdsgcsByJhAndKc(sjFdsgcs);
// if(sjFdsgcs1!=null){
// sjFdsgcs1.setZjzh(zjzh);
// sjFdsgcsMapper.updateSjFdsgcs(sjFdsgcs1);
// }else {
// sjFdsgcs1=new SjFdsgcs();
// sjFdsgcs1.setJh(jh);
// sjFdsgcs1.setKc(sjJsjg1.getKc());
// sjFdsgcs1.setZjzh(zjzh);
// sjFdsgcsMapper.insertSjFdsgcs(sjFdsgcs1);
// }
// //概要施工参数
// SjSggyZjzhcs sjSggyZjzhcs=new SjSggyZjzhcs();
// sjSggyZjzhcs.setJh(jh);
// sjSggyZjzhcs.setKc(sjJsjg1.getKc());
// sjSggyZjzhcs.setJd(ksjs+"-"+sjJsjg1.getJs());
// sjSggyZjzhcs.setZtxh(sjZtgjsj1.getZtxh());
// sjSggyZjzhcs.setCc(sjZtgjsj1.getZtcc()+"");
// sjSggyZjzhcs.setSy(sjZtgjsj1.getPz()+"");
// sjSggyZjzhcs.setZjymd(sjZtgjsj1.getZjymd()+"");
// sjSggyZjzhcs.setZjpl(sjZtgjsj1.getPl()+"");
// sjSggyZjzhcs.setZjby(sjZtgjsj1.getLgby()+"");
// sjSggyZjzhcs.setZjjg(zjzh);
// if(djjc1!=null){
// sjSggyZjzhcs.setCj(djjc1.getCj());
// sjSggyZjzhcs.setYj(djjc1.getZtyj()+"");
// sjSggyZjzhcs.setZjzy(djjc1.getZy());
// sjSggyZjzhcs.setZjzs(djjc1.getZs()+"");
// }
// sjSggyZjzhcsMapper.deleteSjSggyZjzhcsByZjzhcs(sjSggyZjzhcs);
// sjSggyZjzhcsMapper.insertSjSggyZjzhcs(sjSggyZjzhcs);
// }
}
sjZjcsxxMapper.deleteSjZjcsxxByZjcsxx(sjZjcsxx);
sjZjcsxxMapper.insertSjZjcsxx(sjZjcsxx);
Jsfa jsfa =new Jsfa();
jsfa.setJh(sjZtgjsj1.getLjjh());
jsfa.setZjjd(sjZtgjsj1.getJd());
Jsfa jsfa1=jsaaMapper.selectJsfa(jsfa);
String zjzh="";
if(jsfa1!=null){
zjzh = jsfa1.getZjzh();
if(sjLjtjztList.size()>0){
sjLjtjztMapper.deleteSjLjtjztByJh(jh);
sjLjtjztMapper.insertSjLjtjztBatch(sjLjtjztList);
}
SjFdsgcs sjFdsgcs =new SjFdsgcs();
sjFdsgcs.setJh(jh);
sjFdsgcs.setKc(sjJsjg1.getKc());
SjFdsgcs sjFdsgcs1 = sjFdsgcsMapper.selectSjFdsgcsByJhAndKc(sjFdsgcs);
if(sjFdsgcs1!=null){
sjFdsgcs1.setZjzh(zjzh);
sjFdsgcsMapper.updateSjFdsgcs(sjFdsgcs1);
}else {
sjFdsgcs1=new SjFdsgcs();
sjFdsgcs1.setJh(jh);
sjFdsgcs1.setKc(sjJsjg1.getKc());
sjFdsgcs1.setZjzh(zjzh);
sjFdsgcsMapper.insertSjFdsgcs(sjFdsgcs1);
return AjaxResult.success("计算成功");
}
//概要施工参数
SjSggyZjzhcs sjSggyZjzhcs=new SjSggyZjzhcs();
sjSggyZjzhcs.setJh(jh);
sjSggyZjzhcs.setKc(sjJsjg1.getKc());
sjSggyZjzhcs.setJd(ksjs+"-"+sjJsjg1.getJs());
sjSggyZjzhcs.setZtxh(sjZtgjsj1.getZtxh());
sjSggyZjzhcs.setCc(sjZtgjsj1.getZtcc()+"");
sjSggyZjzhcs.setSy(sjZtgjsj1.getPz()+"");
sjSggyZjzhcs.setZjymd(sjZtgjsj1.getZjymd()+"");
sjSggyZjzhcs.setZjpl(sjZtgjsj1.getPl()+"");
sjSggyZjzhcs.setZjby(sjZtgjsj1.getLgby()+"");
sjSggyZjzhcs.setZjjg(zjzh);
if(djjc1!=null){
sjSggyZjzhcs.setCj(djjc1.getCj());
sjSggyZjzhcs.setYj(djjc1.getZtyj()+"");
sjSggyZjzhcs.setZjzy(djjc1.getZy());
sjSggyZjzhcs.setZjzs(djjc1.getZs()+"");
@Override
public AjaxResult saveZjzh(CommonParam param) {
//查询邻井
SjLjjw sjLjjw=new SjLjjw();
sjLjjw.setJh(param.getJh());
List<SjLjjw> sjLjjwList = sjLjjwMapper.selectSjLjjwList(sjLjjw);
if(sjLjjwList.size()>0){
List<String> collect = sjLjjwList.stream().map(SjLjjw::getLjjh).collect(Collectors.toList());
CommonParam param1=new CommonParam();
String[] collectArray = sjLjjwList.stream()
.map(SjLjjw::getLjjh)
.toArray(String[]::new);
param1.setJhs(collectArray);
List<DjZjzhfx> zjzhfxList = djdcService.getZjzhfxList(param1);
if(zjzhfxList.size()>3){
zjzhfxList=zjzhfxList.subList(0,3);
}
sjSggyZjzhcsMapper.deleteSjSggyZjzhcsByZjzhcs(sjSggyZjzhcs);
sjSggyZjzhcsMapper.insertSjSggyZjzhcs(sjSggyZjzhcs);
List<SjFdsgcsLjzjzh> sjFdsgcsLjzjzhList = new ArrayList<>();
for (DjZjzhfx it:zjzhfxList) {
SjFdsgcsLjzjzh sjFdsgcsLjzjzh = new SjFdsgcsLjzjzh();
sjFdsgcsLjzjzh.setJh(param.getJh());
sjFdsgcsLjzjzh.setKc(it.getKc());
sjFdsgcsLjzjzh.setLjjh(it.getJh());
sjFdsgcsLjzjzh.setZjzh(it.getZjzh());
sjFdsgcsLjzjzh.setSx(it.getZb());
sjFdsgcsLjzjzh.setJc(it.getJc());
sjFdsgcsLjzjzhList.add(sjFdsgcsLjzjzh);
}
if(sjFdsgcsLjzjzhList.size()>0){
sjFdsgcsLjzjzhMapper.deleteSjFdsgcsLjzjzhByJh(param.getJh());
sjFdsgcsLjzjzhMapper.insertSjFdsgcsLjzjzhBatch(sjFdsgcsLjzjzhList);
}
if(sjLjtjztList.size()>0){
sjLjtjztMapper.deleteSjLjtjztByJh(jh);
sjLjtjztMapper.insertSjLjtjztBatch(sjLjtjztList);
}
return AjaxResult.success("计算成功");
......
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.SjFdsgcsLjzjzhMapper;
import com.zjsgfa.project.zjsgfa.domain.SjFdsgcsLjzjzh;
import com.zjsgfa.project.zjsgfa.service.ISjFdsgcsLjzjzhService;
/**
* 设计信息-分段施工措施-邻井钻具组合Service业务层处理
*
* @author ruoyi
* @date 2025-09-03
*/
@Service
public class SjFdsgcsLjzjzhServiceImpl implements ISjFdsgcsLjzjzhService
{
@Autowired
private SjFdsgcsLjzjzhMapper sjFdsgcsLjzjzhMapper;
/**
* 查询设计信息-分段施工措施-邻井钻具组合
*
* @param id 设计信息-分段施工措施-邻井钻具组合主键
* @return 设计信息-分段施工措施-邻井钻具组合
*/
@Override
public SjFdsgcsLjzjzh selectSjFdsgcsLjzjzhById(Long id)
{
return sjFdsgcsLjzjzhMapper.selectSjFdsgcsLjzjzhById(id);
}
/**
* 查询设计信息-分段施工措施-邻井钻具组合列表
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 设计信息-分段施工措施-邻井钻具组合
*/
@Override
public List<SjFdsgcsLjzjzh> selectSjFdsgcsLjzjzhList(SjFdsgcsLjzjzh sjFdsgcsLjzjzh)
{
return sjFdsgcsLjzjzhMapper.selectSjFdsgcsLjzjzhList(sjFdsgcsLjzjzh);
}
/**
* 新增设计信息-分段施工措施-邻井钻具组合
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 结果
*/
@Override
public int insertSjFdsgcsLjzjzh(SjFdsgcsLjzjzh sjFdsgcsLjzjzh)
{
return sjFdsgcsLjzjzhMapper.insertSjFdsgcsLjzjzh(sjFdsgcsLjzjzh);
}
/**
* 修改设计信息-分段施工措施-邻井钻具组合
*
* @param sjFdsgcsLjzjzh 设计信息-分段施工措施-邻井钻具组合
* @return 结果
*/
@Override
public int updateSjFdsgcsLjzjzh(SjFdsgcsLjzjzh sjFdsgcsLjzjzh)
{
return sjFdsgcsLjzjzhMapper.updateSjFdsgcsLjzjzh(sjFdsgcsLjzjzh);
}
/**
* 批量删除设计信息-分段施工措施-邻井钻具组合
*
* @param ids 需要删除的设计信息-分段施工措施-邻井钻具组合主键
* @return 结果
*/
@Override
public int deleteSjFdsgcsLjzjzhByIds(Long[] ids)
{
return sjFdsgcsLjzjzhMapper.deleteSjFdsgcsLjzjzhByIds(ids);
}
/**
* 删除设计信息-分段施工措施-邻井钻具组合信息
*
* @param id 设计信息-分段施工措施-邻井钻具组合主键
* @return 结果
*/
@Override
public int deleteSjFdsgcsLjzjzhById(Long id)
{
return sjFdsgcsLjzjzhMapper.deleteSjFdsgcsLjzjzhById(id);
}
}
package com.zjsgfa.project.zjsgfa.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import com.zjsgfa.project.zjsgfa.domain.JcxxTsgj;
import com.zjsgfa.project.zjsgfa.domain.SjFl;
import com.zjsgfa.project.zjsgfa.mapper.JcxxTsgjMapper;
import com.zjsgfa.project.zjsgfa.mapper.SjFlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zjsgfa.project.zjsgfa.mapper.SjFdsgcsTsgjMapper;
......@@ -19,6 +25,12 @@ public class SjFdsgcsTsgjServiceImpl implements ISjFdsgcsTsgjService
@Autowired
private SjFdsgcsTsgjMapper sjFdsgcsTsgjMapper;
@Autowired
private JcxxTsgjMapper jcxxTsgjMapper;
@Autowired
private SjFlMapper sjFlMapper;
/**
* 查询设计-分段施工措施_特殊工具
*
......@@ -52,7 +64,41 @@ public class SjFdsgcsTsgjServiceImpl implements ISjFdsgcsTsgjService
@Override
public int insertSjFdsgcsTsgj(SjFdsgcsTsgj sjFdsgcsTsgj)
{
return sjFdsgcsTsgjMapper.insertSjFdsgcsTsgj(sjFdsgcsTsgj);
int i = sjFdsgcsTsgjMapper.insertSjFdsgcsTsgj(sjFdsgcsTsgj);
SjFdsgcsTsgj sjFdsgcsTsgj1 =new SjFdsgcsTsgj();
sjFdsgcsTsgj1.setJh(sjFdsgcsTsgj.getJh());
List<SjFdsgcsTsgj> sjFdsgcsTsgjs = selectSjFdsgcsTsgjList(sjFdsgcsTsgj1);
List<String> collect = sjFdsgcsTsgjs.stream().map(SjFdsgcsTsgj::getGjmc).distinct().collect(Collectors.toList());
JcxxTsgj jcxxTsgj =new JcxxTsgj();
jcxxTsgj.setGjmcs(collect);
List<JcxxTsgj> jcxxTsgjs = jcxxTsgjMapper.selectJcxxTsgjList(jcxxTsgj);
if(jcxxTsgjs.size()>0){
SjFl sjFl=new SjFl();
sjFl.setJh(sjFdsgcsTsgj.getJh());
List<SjFl> sjFls = sjFlMapper.selectSjFlList(sjFl);
if(sjFls.size()>0){
SjFl sjFl1 = sjFls.get(0);
List<String> collect1 = jcxxTsgjs.stream().map(JcxxTsgj::getSyzn).distinct().collect(Collectors.toList());
String syzn=String.join( ",",collect1);
sjFl1.setJh(sjFdsgcsTsgj.getJh());
sjFl1.setSyzn(syzn);
sjFlMapper.updateSjFl(sjFl1);
}else {
List<String> collect1 = jcxxTsgjs.stream().map(JcxxTsgj::getSyzn).distinct().collect(Collectors.toList());
String syzn=String.join( ",",collect1);
SjFl sjFl1=new SjFl();
sjFl1.setJh(sjFdsgcsTsgj.getJh());
sjFl1.setSyzn(syzn);
sjFlMapper.insertSjFl(sjFl1);
}
}
return i;
}
/**
......@@ -64,7 +110,38 @@ public class SjFdsgcsTsgjServiceImpl implements ISjFdsgcsTsgjService
@Override
public int updateSjFdsgcsTsgj(SjFdsgcsTsgj sjFdsgcsTsgj)
{
return sjFdsgcsTsgjMapper.updateSjFdsgcsTsgj(sjFdsgcsTsgj);
int i = sjFdsgcsTsgjMapper.updateSjFdsgcsTsgj(sjFdsgcsTsgj);
SjFdsgcsTsgj sjFdsgcsTsgj1 =new SjFdsgcsTsgj();
sjFdsgcsTsgj1.setJh(sjFdsgcsTsgj.getJh());
List<SjFdsgcsTsgj> sjFdsgcsTsgjs = selectSjFdsgcsTsgjList(sjFdsgcsTsgj1);
List<String> collect = sjFdsgcsTsgjs.stream().map(SjFdsgcsTsgj::getGjmc).distinct().collect(Collectors.toList());
JcxxTsgj jcxxTsgj =new JcxxTsgj();
jcxxTsgj.setGjmcs(collect);
List<JcxxTsgj> jcxxTsgjs = jcxxTsgjMapper.selectJcxxTsgjList(jcxxTsgj);
if(jcxxTsgjs.size()>0){
SjFl sjFl=new SjFl();
sjFl.setJh(sjFdsgcsTsgj.getJh());
List<SjFl> sjFls = sjFlMapper.selectSjFlList(sjFl);
if(sjFls.size()>0){
SjFl sjFl1 = sjFls.get(0);
List<String> collect1 = jcxxTsgjs.stream().map(JcxxTsgj::getSyzn).distinct().collect(Collectors.toList());
String syzn=String.join( ",",collect1);
sjFl1.setJh(sjFdsgcsTsgj.getJh());
sjFl1.setSyzn(syzn);
sjFlMapper.updateSjFl(sjFl1);
}else {
List<String> collect1 = jcxxTsgjs.stream().map(JcxxTsgj::getSyzn).distinct().collect(Collectors.toList());
String syzn=String.join( ",",collect1);
SjFl sjFl1=new SjFl();
sjFl1.setJh(sjFdsgcsTsgj.getJh());
sjFl1.setSyzn(syzn);
sjFlMapper.insertSjFl(sjFl1);
}
}
return i;
}
/**
......
......@@ -21,6 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="gjmc != null and gjmc != ''"> and gjmc = #{gjmc}</if>
<if test="ggxh != null and ggxh != ''"> and ggxh = #{ggxh}</if>
<if test="syzn != null and syzn != ''"> and syzn = #{syzn}</if>
<if test="gjmcs != null">
and gjmc in
<foreach item="gjmc" collection="gjmcs" open="(" separator="," close=")">
#{gjmc}
</foreach>
</if>
</where>
</select>
......
<?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.SjFdsgcsLjzjzhMapper">
<resultMap type="SjFdsgcsLjzjzh" id="SjFdsgcsLjzjzhResult">
<result property="id" column="id" />
<result property="jh" column="jh" />
<result property="ljjh" column="ljjh" />
<result property="kc" column="kc" />
<result property="zjzh" column="zjzh" />
<result property="jc" column="jc" />
<result property="sx" column="sx" />
</resultMap>
<sql id="selectSjFdsgcsLjzjzhVo">
select id, jh, ljjh, kc, zjzh, jc, sx from sj_fdsgcs_ljzjzh
</sql>
<select id="selectSjFdsgcsLjzjzhList" parameterType="SjFdsgcsLjzjzh" resultMap="SjFdsgcsLjzjzhResult">
<include refid="selectSjFdsgcsLjzjzhVo"/>
<where>
<if test="jh != null and jh != ''"> and jh = #{jh}</if>
<if test="ljjh != null and ljjh != ''"> and ljjh = #{ljjh}</if>
<if test="kc != null and kc != ''"> and kc = #{kc}</if>
<if test="zjzh != null and zjzh != ''"> and zjzh = #{zjzh}</if>
<if test="jc != null "> and jc = #{jc}</if>
<if test="sx != null "> and sx = #{sx}</if>
</where>
</select>
<select id="selectSjFdsgcsLjzjzhById" parameterType="Long" resultMap="SjFdsgcsLjzjzhResult">
<include refid="selectSjFdsgcsLjzjzhVo"/>
where id = #{id}
</select>
<insert id="insertSjFdsgcsLjzjzh" parameterType="SjFdsgcsLjzjzh" useGeneratedKeys="true" keyProperty="id">
insert into sj_fdsgcs_ljzjzh
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jh != null">jh,</if>
<if test="ljjh != null">ljjh,</if>
<if test="kc != null">kc,</if>
<if test="zjzh != null">zjzh,</if>
<if test="jc != null">jc,</if>
<if test="sx != null">sx,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jh != null">#{jh},</if>
<if test="ljjh != null">#{ljjh},</if>
<if test="kc != null">#{kc},</if>
<if test="zjzh != null">#{zjzh},</if>
<if test="jc != null">#{jc},</if>
<if test="sx != null">#{sx},</if>
</trim>
</insert>
<insert id="insertSjFdsgcsLjzjzhBatch">
insert into sj_fdsgcs_ljzjzh (jh,ljjh,kc,zjzh,jc,sx) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.jh},#{item.ljjh},#{item.kc},#{item.zjzh},#{item.jc},#{item.sx})
</foreach>
</insert>
<update id="updateSjFdsgcsLjzjzh" parameterType="SjFdsgcsLjzjzh">
update sj_fdsgcs_ljzjzh
<trim prefix="SET" suffixOverrides=",">
<if test="jh != null">jh = #{jh},</if>
<if test="ljjh != null">ljjh = #{ljjh},</if>
<if test="kc != null">kc = #{kc},</if>
<if test="zjzh != null">zjzh = #{zjzh},</if>
<if test="jc != null">jc = #{jc},</if>
<if test="sx != null">sx = #{sx},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSjFdsgcsLjzjzhById" parameterType="Long">
delete from sj_fdsgcs_ljzjzh where id = #{id}
</delete>
<delete id="deleteSjFdsgcsLjzjzhByIds" parameterType="String">
delete from sj_fdsgcs_ljzjzh where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deleteSjFdsgcsLjzjzhByJh">
delete from sj_fdsgcs_ljzjzh where jh = #{jh}
</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