Commit 26fd714a authored by 耿迪迪's avatar 耿迪迪

工艺流程图与场站关联

parent 04dd1a4e
...@@ -119,6 +119,12 @@ public class TSiteStationInfoController extends BaseController ...@@ -119,6 +119,12 @@ public class TSiteStationInfoController extends BaseController
return toAjax(tSiteStationInfoService.updateTSiteStationInfo(tSiteStationInfo)); return toAjax(tSiteStationInfoService.updateTSiteStationInfo(tSiteStationInfo));
} }
@Log(title = "场站信息", businessType = BusinessType.UPDATE)
@PostMapping("/editStationAndProcessInfo")
public AjaxResult editStationAndProcessInfo(@RequestBody TSiteStationInfo tSiteStationInfo) {
return toAjax(tSiteStationInfoService.updateStationAndProcessInfo(tSiteStationInfo));
}
/** /**
* 删除场站信息 * 删除场站信息
*/ */
......
package com.zehong.web.controller.baseinfo;
import java.util.List;
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.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TStationTechnologyProcessRelation;
import com.zehong.system.service.ITStationTechnologyProcessRelationService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 场站工艺流程关联Controller
*
* @author zehong
* @date 2026-09-23
*/
@RestController
@RequestMapping("/station/process")
public class TStationTechnologyProcessRelationController extends BaseController
{
@Autowired
private ITStationTechnologyProcessRelationService tStationTechnologyProcessRelationService;
/**
* 查询场站工艺流程关联列表
*/
//@PreAuthorize("@ss.hasPermi('system:relation:list')")
@GetMapping("/list")
public TableDataInfo list(TStationTechnologyProcessRelation tStationTechnologyProcessRelation)
{
startPage();
List<TStationTechnologyProcessRelation> list = tStationTechnologyProcessRelationService.selectTStationTechnologyProcessRelationList(tStationTechnologyProcessRelation);
return getDataTable(list);
}
/**
* 导出场站工艺流程关联列表
*/
//@PreAuthorize("@ss.hasPermi('system:relation:export')")
@Log(title = "场站工艺流程关联", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TStationTechnologyProcessRelation tStationTechnologyProcessRelation)
{
List<TStationTechnologyProcessRelation> list = tStationTechnologyProcessRelationService.selectTStationTechnologyProcessRelationList(tStationTechnologyProcessRelation);
ExcelUtil<TStationTechnologyProcessRelation> util = new ExcelUtil<TStationTechnologyProcessRelation>(TStationTechnologyProcessRelation.class);
return util.exportExcel(list, "场站工艺流程关联数据");
}
/**
* 获取场站工艺流程关联详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:relation:query')")
@GetMapping(value = "/{relationId}")
public AjaxResult getInfo(@PathVariable("relationId") Long relationId)
{
return AjaxResult.success(tStationTechnologyProcessRelationService.selectTStationTechnologyProcessRelationById(relationId));
}
/**
* 新增场站工艺流程关联
*/
//@PreAuthorize("@ss.hasPermi('system:relation:add')")
@Log(title = "场站工艺流程关联", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TStationTechnologyProcessRelation tStationTechnologyProcessRelation)
{
return toAjax(tStationTechnologyProcessRelationService.insertTStationTechnologyProcessRelation(tStationTechnologyProcessRelation));
}
/**
* 修改场站工艺流程关联
*/
//@PreAuthorize("@ss.hasPermi('system:relation:edit')")
@Log(title = "场站工艺流程关联", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TStationTechnologyProcessRelation tStationTechnologyProcessRelation)
{
return toAjax(tStationTechnologyProcessRelationService.updateTStationTechnologyProcessRelation(tStationTechnologyProcessRelation));
}
/**
* 删除场站工艺流程关联
*/
//@PreAuthorize("@ss.hasPermi('system:relation:remove')")
@Log(title = "场站工艺流程关联", businessType = BusinessType.DELETE)
@DeleteMapping("/{relationIds}")
public AjaxResult remove(@PathVariable Long[] relationIds)
{
return toAjax(tStationTechnologyProcessRelationService.deleteTStationTechnologyProcessRelationByIds(relationIds));
}
}
...@@ -45,6 +45,13 @@ public class TTechnologyProcessController extends BaseController ...@@ -45,6 +45,13 @@ public class TTechnologyProcessController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/technologyProcessInfoList")
public AjaxResult technologyProcessInfoList(TTechnologyProcess tTechnologyProcess){
List<TTechnologyProcess> list = tTechnologyProcessService.selectTTechnologyProcessList(tTechnologyProcess);
return AjaxResult.success(list);
}
/** /**
* 导出工业流程图列表 * 导出工业流程图列表
*/ */
......
...@@ -2,12 +2,16 @@ package com.zehong.system.domain; ...@@ -2,12 +2,16 @@ package com.zehong.system.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel; import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity; import com.zehong.common.core.domain.BaseEntity;
import javax.validation.constraints.Size;
/** /**
* 场站信息对象 t_site_station_info * 场站信息对象 t_site_station_info
* *
...@@ -102,6 +106,13 @@ public class TSiteStationInfo extends BaseEntity ...@@ -102,6 +106,13 @@ public class TSiteStationInfo extends BaseEntity
private Long taskId; private Long taskId;
/** 工艺流程 */
private List<TStationTechnologyProcessRelation> processRelationList;
/** 工艺流程图标题 */
@Excel(name = "工艺流程图")
private String technologyProcess;
public Long getTaskId() { public Long getTaskId() {
return taskId; return taskId;
} }
...@@ -316,6 +327,22 @@ public class TSiteStationInfo extends BaseEntity ...@@ -316,6 +327,22 @@ public class TSiteStationInfo extends BaseEntity
return remarks; return remarks;
} }
public List<TStationTechnologyProcessRelation> getProcessRelationList() {
return processRelationList;
}
public void setProcessRelationList(List<TStationTechnologyProcessRelation> processRelationList) {
this.processRelationList = processRelationList;
}
public String getTechnologyProcess() {
return technologyProcess;
}
public void setTechnologyProcess(String technologyProcess) {
this.technologyProcess = technologyProcess;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 场站工艺流程关联对象 t_station_technology_process_relation
*
* @author zehong
* @date 2026-09-23
*/
public class TStationTechnologyProcessRelation extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long relationId;
/** 场站主键 */
@Excel(name = "场站主键")
private Long stationId;
/** 流程图主键 */
@Excel(name = "流程图主键")
private Long processId;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
/** 流程工艺标题 */
private String title;
/** 流程工艺内容 */
private String content;
/** 流程工艺附件 */
private String attachment;
public void setRelationId(Long relationId)
{
this.relationId = relationId;
}
public Long getRelationId()
{
return relationId;
}
public void setStationId(Long stationId)
{
this.stationId = stationId;
}
public Long getStationId()
{
return stationId;
}
public void setProcessId(Long processId)
{
this.processId = processId;
}
public Long getProcessId()
{
return processId;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getAttachment() {
return attachment;
}
public void setAttachment(String attachment) {
this.attachment = attachment;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("relationId", getRelationId())
.append("stationId", getStationId())
.append("processId", getProcessId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TStationTechnologyProcessRelation;
/**
* 场站工艺流程关联Mapper接口
*
* @author zehong
* @date 2026-09-23
*/
public interface TStationTechnologyProcessRelationMapper
{
/**
* 查询场站工艺流程关联
*
* @param relationId 场站工艺流程关联ID
* @return 场站工艺流程关联
*/
public TStationTechnologyProcessRelation selectTStationTechnologyProcessRelationById(Long relationId);
/**
* 查询场站工艺流程关联列表
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 场站工艺流程关联集合
*/
public List<TStationTechnologyProcessRelation> selectTStationTechnologyProcessRelationList(TStationTechnologyProcessRelation tStationTechnologyProcessRelation);
/**
* 新增场站工艺流程关联
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 结果
*/
public int insertTStationTechnologyProcessRelation(TStationTechnologyProcessRelation tStationTechnologyProcessRelation);
/**
* 批量新增工艺流程
* @param processRelationList 工艺流程
* @return
*/
int batchInsertTStationTechnologyProcessRelation(List<TStationTechnologyProcessRelation> processRelationList);
/**
* 修改场站工艺流程关联
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 结果
*/
public int updateTStationTechnologyProcessRelation(TStationTechnologyProcessRelation tStationTechnologyProcessRelation);
/**
* 删除场站工艺流程关联
*
* @param relationId 场站工艺流程关联ID
* @return 结果
*/
public int deleteTStationTechnologyProcessRelationById(Long relationId);
/**
* 批量删除场站工艺流程关联
*
* @param relationIds 需要删除的数据ID
* @return 结果
*/
public int deleteTStationTechnologyProcessRelationByIds(Long[] relationIds);
/**
* 根据stationId删除关联信息
* @param stationId 场站主键
* @return
*/
int deleteTStationTechnologyProcessRelationByStationId(Long stationId);
/**
* 根据场站主键批量查询工艺流程信息
* @param stationIds 场站主键集合
* @return
*/
List<TStationTechnologyProcessRelation> batchSelectTStationTechnologyProcessRelationList(List<Long> stationIds);
}
...@@ -53,6 +53,9 @@ public interface ITSiteStationInfoService ...@@ -53,6 +53,9 @@ public interface ITSiteStationInfoService
*/ */
public int updateTSiteStationInfo(TSiteStationInfo tSiteStationInfo); public int updateTSiteStationInfo(TSiteStationInfo tSiteStationInfo);
int updateStationAndProcessInfo(TSiteStationInfo tSiteStationInfo);
/** /**
* 批量删除场站信息 * 批量删除场站信息
* *
......
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TStationTechnologyProcessRelation;
/**
* 场站工艺流程关联Service接口
*
* @author zehong
* @date 2026-09-23
*/
public interface ITStationTechnologyProcessRelationService
{
/**
* 查询场站工艺流程关联
*
* @param relationId 场站工艺流程关联ID
* @return 场站工艺流程关联
*/
public TStationTechnologyProcessRelation selectTStationTechnologyProcessRelationById(Long relationId);
/**
* 查询场站工艺流程关联列表
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 场站工艺流程关联集合
*/
public List<TStationTechnologyProcessRelation> selectTStationTechnologyProcessRelationList(TStationTechnologyProcessRelation tStationTechnologyProcessRelation);
/**
* 新增场站工艺流程关联
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 结果
*/
public int insertTStationTechnologyProcessRelation(TStationTechnologyProcessRelation tStationTechnologyProcessRelation);
/**
* 修改场站工艺流程关联
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 结果
*/
public int updateTStationTechnologyProcessRelation(TStationTechnologyProcessRelation tStationTechnologyProcessRelation);
/**
* 批量删除场站工艺流程关联
*
* @param relationIds 需要删除的场站工艺流程关联ID
* @return 结果
*/
public int deleteTStationTechnologyProcessRelationByIds(Long[] relationIds);
/**
* 删除场站工艺流程关联信息
*
* @param relationId 场站工艺流程关联ID
* @return 结果
*/
public int deleteTStationTechnologyProcessRelationById(Long relationId);
}
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.system.domain.TStationTechnologyProcessRelation;
import com.zehong.system.mapper.TStationTechnologyProcessRelationMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TSiteStationInfoMapper; import com.zehong.system.mapper.TSiteStationInfoMapper;
import com.zehong.system.domain.TSiteStationInfo; import com.zehong.system.domain.TSiteStationInfo;
import com.zehong.system.service.ITSiteStationInfoService; import com.zehong.system.service.ITSiteStationInfoService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
/** /**
* 场站信息Service业务层处理 * 场站信息Service业务层处理
...@@ -19,9 +28,12 @@ import com.zehong.system.service.ITSiteStationInfoService; ...@@ -19,9 +28,12 @@ import com.zehong.system.service.ITSiteStationInfoService;
@Service @Service
public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
{ {
@Autowired @Resource
private TSiteStationInfoMapper tSiteStationInfoMapper; private TSiteStationInfoMapper tSiteStationInfoMapper;
@Resource
private TStationTechnologyProcessRelationMapper tStationTechnologyProcessRelationMapper;
/** /**
* 查询场站信息 * 查询场站信息
* *
...@@ -29,9 +41,13 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService ...@@ -29,9 +41,13 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
* @return 场站信息 * @return 场站信息
*/ */
@Override @Override
public TSiteStationInfo selectTSiteStationInfoById(Long siteStationId) public TSiteStationInfo selectTSiteStationInfoById(Long siteStationId) {
{ TSiteStationInfo siteStationInfo = tSiteStationInfoMapper.selectTSiteStationInfoById(siteStationId);
return tSiteStationInfoMapper.selectTSiteStationInfoById(siteStationId); TStationTechnologyProcessRelation tStationTechnologyProcessRelation = new TStationTechnologyProcessRelation();
tStationTechnologyProcessRelation.setStationId(siteStationId);
List<TStationTechnologyProcessRelation> processRelationList = tStationTechnologyProcessRelationMapper.selectTStationTechnologyProcessRelationList(tStationTechnologyProcessRelation);
if(!CollectionUtils.isEmpty(processRelationList)) siteStationInfo.setProcessRelationList(processRelationList);
return siteStationInfo;
} }
@Override @Override
...@@ -47,9 +63,26 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService ...@@ -47,9 +63,26 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
* @return 场站信息 * @return 场站信息
*/ */
@Override @Override
public List<TSiteStationInfo> selectTSiteStationInfoList(TSiteStationInfo tSiteStationInfo) public List<TSiteStationInfo> selectTSiteStationInfoList(TSiteStationInfo tSiteStationInfo) {
{ List<TSiteStationInfo> siteStationInfoList = tSiteStationInfoMapper.selectTSiteStationInfoList(tSiteStationInfo);
return tSiteStationInfoMapper.selectTSiteStationInfoList(tSiteStationInfo); // 场站id集合
List<Long> stationIds = siteStationInfoList.stream()
.map(TSiteStationInfo::getSiteStationId)
.collect(Collectors.toList());
//查询工业流程图
List<TStationTechnologyProcessRelation> processRelationList = tStationTechnologyProcessRelationMapper.batchSelectTStationTechnologyProcessRelationList(stationIds);
if(!CollectionUtils.isEmpty(processRelationList)){
//按场站id分组
Map<Long,List<TStationTechnologyProcessRelation>> processGroup = processRelationList.stream()
.collect(Collectors.groupingBy(TStationTechnologyProcessRelation::getStationId,Collectors.toList()));
//场站组装流程工艺信息
for(TSiteStationInfo siteStationInfo : siteStationInfoList){
if(processGroup.containsKey(siteStationInfo.getSiteStationId())){
siteStationInfo.setProcessRelationList(processGroup.get(siteStationInfo.getSiteStationId()));
}
}
}
return siteStationInfoList;
} }
/** /**
...@@ -70,10 +103,13 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService ...@@ -70,10 +103,13 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public int insertTSiteStationInfo(TSiteStationInfo tSiteStationInfo) public int insertTSiteStationInfo(TSiteStationInfo tSiteStationInfo)
{ {
tSiteStationInfo.setCreateTime(DateUtils.getNowDate()); tSiteStationInfo.setCreateTime(DateUtils.getNowDate());
return tSiteStationInfoMapper.insertTSiteStationInfo(tSiteStationInfo); int result = tSiteStationInfoMapper.insertTSiteStationInfo(tSiteStationInfo);
addProcess(tSiteStationInfo);
return result;
} }
/** /**
...@@ -83,12 +119,39 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService ...@@ -83,12 +119,39 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateTSiteStationInfo(TSiteStationInfo tSiteStationInfo) @Transactional(rollbackFor = Exception.class)
{ public int updateTSiteStationInfo(TSiteStationInfo tSiteStationInfo) {
tSiteStationInfo.setUpdateTime(DateUtils.getNowDate()); tSiteStationInfo.setUpdateTime(DateUtils.getNowDate());
return tSiteStationInfoMapper.updateTSiteStationInfo(tSiteStationInfo); return tSiteStationInfoMapper.updateTSiteStationInfo(tSiteStationInfo);
} }
@Override
@Transactional(rollbackFor = Exception.class)
public int updateStationAndProcessInfo(TSiteStationInfo tSiteStationInfo){
tSiteStationInfo.setUpdateTime(DateUtils.getNowDate());
//删除关联关系
tStationTechnologyProcessRelationMapper.deleteTStationTechnologyProcessRelationByStationId(tSiteStationInfo.getSiteStationId());
//新增工艺流程关联关系
addProcess(tSiteStationInfo);
return tSiteStationInfoMapper.updateTSiteStationInfo(tSiteStationInfo);
}
/**
* 批量新增流程工艺关联信息
* @param tSiteStationInfo
*/
private void addProcess(TSiteStationInfo tSiteStationInfo){
List<TStationTechnologyProcessRelation> processRelationList = tSiteStationInfo.getProcessRelationList();
if(CollectionUtils.isEmpty(processRelationList)) return;
String nickName = SecurityUtils.getLoginUser().getUser().getNickName();
processRelationList.forEach(s -> {
s.setStationId(tSiteStationInfo.getSiteStationId());
s.setCreateBy(nickName);
s.setCreateTime(new Date());
});
tStationTechnologyProcessRelationMapper.batchInsertTStationTechnologyProcessRelation(processRelationList);
}
/** /**
* 批量删除场站信息 * 批量删除场站信息
* *
...@@ -96,8 +159,11 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService ...@@ -96,8 +159,11 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteTSiteStationInfoByIds(Long[] siteStationIds) @Transactional(rollbackFor = Exception.class)
{ public int deleteTSiteStationInfoByIds(Long[] siteStationIds) {
for(Long stationId : siteStationIds){
tStationTechnologyProcessRelationMapper.deleteTStationTechnologyProcessRelationByStationId(stationId);
}
return tSiteStationInfoMapper.deleteTSiteStationInfoByIds(siteStationIds); return tSiteStationInfoMapper.deleteTSiteStationInfoByIds(siteStationIds);
} }
...@@ -108,8 +174,9 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService ...@@ -108,8 +174,9 @@ public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteTSiteStationInfoById(Long siteStationId) @Transactional(rollbackFor = Exception.class)
{ public int deleteTSiteStationInfoById(Long siteStationId) {
tStationTechnologyProcessRelationMapper.deleteTStationTechnologyProcessRelationByStationId(siteStationId);
return tSiteStationInfoMapper.deleteTSiteStationInfoById(siteStationId); return tSiteStationInfoMapper.deleteTSiteStationInfoById(siteStationId);
} }
} }
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TStationTechnologyProcessRelationMapper;
import com.zehong.system.domain.TStationTechnologyProcessRelation;
import com.zehong.system.service.ITStationTechnologyProcessRelationService;
/**
* 场站工艺流程关联Service业务层处理
*
* @author zehong
* @date 2026-09-23
*/
@Service
public class TStationTechnologyProcessRelationServiceImpl implements ITStationTechnologyProcessRelationService
{
@Autowired
private TStationTechnologyProcessRelationMapper tStationTechnologyProcessRelationMapper;
/**
* 查询场站工艺流程关联
*
* @param relationId 场站工艺流程关联ID
* @return 场站工艺流程关联
*/
@Override
public TStationTechnologyProcessRelation selectTStationTechnologyProcessRelationById(Long relationId)
{
return tStationTechnologyProcessRelationMapper.selectTStationTechnologyProcessRelationById(relationId);
}
/**
* 查询场站工艺流程关联列表
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 场站工艺流程关联
*/
@Override
public List<TStationTechnologyProcessRelation> selectTStationTechnologyProcessRelationList(TStationTechnologyProcessRelation tStationTechnologyProcessRelation)
{
return tStationTechnologyProcessRelationMapper.selectTStationTechnologyProcessRelationList(tStationTechnologyProcessRelation);
}
/**
* 新增场站工艺流程关联
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 结果
*/
@Override
public int insertTStationTechnologyProcessRelation(TStationTechnologyProcessRelation tStationTechnologyProcessRelation)
{
tStationTechnologyProcessRelation.setCreateTime(DateUtils.getNowDate());
return tStationTechnologyProcessRelationMapper.insertTStationTechnologyProcessRelation(tStationTechnologyProcessRelation);
}
/**
* 修改场站工艺流程关联
*
* @param tStationTechnologyProcessRelation 场站工艺流程关联
* @return 结果
*/
@Override
public int updateTStationTechnologyProcessRelation(TStationTechnologyProcessRelation tStationTechnologyProcessRelation)
{
tStationTechnologyProcessRelation.setUpdateTime(DateUtils.getNowDate());
return tStationTechnologyProcessRelationMapper.updateTStationTechnologyProcessRelation(tStationTechnologyProcessRelation);
}
/**
* 批量删除场站工艺流程关联
*
* @param relationIds 需要删除的场站工艺流程关联ID
* @return 结果
*/
@Override
public int deleteTStationTechnologyProcessRelationByIds(Long[] relationIds)
{
return tStationTechnologyProcessRelationMapper.deleteTStationTechnologyProcessRelationByIds(relationIds);
}
/**
* 删除场站工艺流程关联信息
*
* @param relationId 场站工艺流程关联ID
* @return 结果
*/
@Override
public int deleteTStationTechnologyProcessRelationById(Long relationId)
{
return tStationTechnologyProcessRelationMapper.deleteTStationTechnologyProcessRelationById(relationId);
}
}
...@@ -33,7 +33,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -33,7 +33,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTSiteStationInfoVo"> <sql id="selectTSiteStationInfoVo">
select site_station_id, site_station_type, picture_address, site_station_name, beyond_enterprise_id, beyond_enterprise_name, station_detail, longitude, latitude, address, enable_tiem, contacts, phone, gas_source, big_storage, big_provide, dangerous_level, dangerous_name, volume, create_by, create_time, update_by, update_time, is_del, remarks from t_site_station_info SELECT
site_station_id,
site_station_type,
picture_address,
site_station_name,
beyond_enterprise_id,
beyond_enterprise_name,
station_detail,
longitude,
latitude,
address,
enable_tiem,
contacts,
phone,
gas_source,
big_storage,
big_provide,
dangerous_level,
dangerous_name,
volume,
create_by,
create_time,
update_by,
update_time,
is_del,
remarks,
(select GROUP_CONCAT(pro.title SEPARATOR '|') from t_station_technology_process_relation re,t_technology_process pro where re.process_id = pro.process_id and re.station_id = site_station_id) as technologyProcess
FROM
t_site_station_info
</sql> </sql>
<select id="selectTSiteStationInfoList" parameterType="TSiteStationInfo" resultMap="TSiteStationInfoResult"> <select id="selectTSiteStationInfoList" parameterType="TSiteStationInfo" resultMap="TSiteStationInfoResult">
......
<?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.zehong.system.mapper.TStationTechnologyProcessRelationMapper">
<resultMap type="TStationTechnologyProcessRelation" id="TStationTechnologyProcessRelationResult">
<result property="relationId" column="relation_id" />
<result property="stationId" column="station_id" />
<result property="processId" column="process_id" />
<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="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTStationTechnologyProcessRelationVo">
SELECT
relation.relation_id,
relation.station_id,
relation.process_id,
relation.create_by,
relation.create_time,
relation.update_by,
relation.update_time,
relation.is_del,
relation.remarks,
process.title,
process.attachment,
process.content
FROM
t_station_technology_process_relation relation
LEFT JOIN t_technology_process process ON process.process_id = relation.process_id
</sql>
<select id="selectTStationTechnologyProcessRelationList" parameterType="TStationTechnologyProcessRelation" resultMap="TStationTechnologyProcessRelationResult">
<include refid="selectTStationTechnologyProcessRelationVo"/>
<where>
<if test="stationId != null "> and relation.station_id = #{stationId}</if>
<if test="processId != null "> and relation.process_id = #{processId}</if>
<if test="isDel != null and isDel != ''"> and relation.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and relation.remarks = #{remarks}</if>
</where>
</select>
<select id="batchSelectTStationTechnologyProcessRelationList" parameterType="Long" resultMap="TStationTechnologyProcessRelationResult">
<include refid="selectTStationTechnologyProcessRelationVo"/>
where station_id in
<foreach item="stationId" collection="list" open="(" separator="," close=")">
#{stationId}
</foreach>
</select>
<select id="selectTStationTechnologyProcessRelationById" parameterType="Long" resultMap="TStationTechnologyProcessRelationResult">
<include refid="selectTStationTechnologyProcessRelationVo"/>
where relation.relation_id = #{relationId}
</select>
<insert id="insertTStationTechnologyProcessRelation" parameterType="TStationTechnologyProcessRelation" useGeneratedKeys="true" keyProperty="relationId">
insert into t_station_technology_process_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stationId != null">station_id,</if>
<if test="processId != null">process_id,</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="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stationId != null">#{stationId},</if>
<if test="processId != null">#{processId},</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="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<insert id="batchInsertTStationTechnologyProcessRelation" parameterType="TStationTechnologyProcessRelation" useGeneratedKeys="true" keyProperty="relationId">
insert into t_station_technology_process_relation (
station_id,
process_id,
create_by,
create_time,
remarks
)values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.stationId},
#{item.processId},
#{item.createBy},
#{item.createTime},
#{item.remarks}
)
</foreach>
</insert>
<update id="updateTStationTechnologyProcessRelation" parameterType="TStationTechnologyProcessRelation">
update t_station_technology_process_relation
<trim prefix="SET" suffixOverrides=",">
<if test="stationId != null">station_id = #{stationId},</if>
<if test="processId != null">process_id = #{processId},</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="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where relation_id = #{relationId}
</update>
<delete id="deleteTStationTechnologyProcessRelationById" parameterType="Long">
delete from t_station_technology_process_relation where relation_id = #{relationId}
</delete>
<delete id="deleteTStationTechnologyProcessRelationByStationId" parameterType="Long">
delete from t_station_technology_process_relation where station_id = #{stationId}
</delete>
<delete id="deleteTStationTechnologyProcessRelationByIds" parameterType="String">
delete from t_station_technology_process_relation where relation_id in
<foreach item="relationId" collection="array" open="(" separator="," close=")">
#{relationId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -60,3 +60,12 @@ export function exportInfo(query) { ...@@ -60,3 +60,12 @@ export function exportInfo(query) {
params: query params: query
}) })
} }
export function editStationAndProcessInfo(data) {
return request({
url: '/baseInfo/station/editStationAndProcessInfo',
method: 'post',
data: data
})
}
...@@ -51,3 +51,13 @@ export function exportProcess(query) { ...@@ -51,3 +51,13 @@ export function exportProcess(query) {
params: query params: query
}) })
} }
// 所有流程工艺信息
export function technologyProcessInfoList(query) {
return request({
url: '/safe/process/technologyProcessInfoList',
method: 'get',
params: query
})
}
...@@ -88,6 +88,16 @@ ...@@ -88,6 +88,16 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="工艺流程图">
<span>{{ detailInfo.technologyProcess }}</span>
</el-form-item>
</el-col>
</el-row>
<!--<el-row> <!--<el-row>
<el-col :span="12"> <el-col :span="12">
......
...@@ -267,6 +267,24 @@ ...@@ -267,6 +267,24 @@
</el-col> </el-col>
</el-row> </el-row>
<el-col :span="24">
<el-form-item label="工艺流程图">
<el-select
v-model="selectProcessList"
multiple
placeholder="请选择工艺流程图"
style="width: 100%"
>
<el-option
v-for="item in processList"
:key="item.processId"
:label="item.title"
:value="item.processId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-row> <!-- <el-row>
&lt;!&ndash;<el-col :span="12"> &lt;!&ndash;<el-col :span="12">
<el-form-item label="储罐容积" prop="volume"> <el-form-item label="储罐容积" prop="volume">
...@@ -296,10 +314,11 @@ ...@@ -296,10 +314,11 @@
</template> </template>
<script> <script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/baseinfo/stationInfo"; import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo, editStationAndProcessInfo } from "@/api/baseinfo/stationInfo";
import GetPos from '@/components/GetPos'; import GetPos from '@/components/GetPos';
import ImageUpload from "@/components/ImageUpload"; import ImageUpload from "@/components/ImageUpload";
import DetailInfo from "./components/DetailInfo"; import DetailInfo from "./components/DetailInfo";
import { technologyProcessInfoList } from "@/api/safe/process";
export default { export default {
name: "Info", name: "Info",
components: { components: {
...@@ -404,7 +423,9 @@ export default { ...@@ -404,7 +423,9 @@ export default {
gasSource: [], gasSource: [],
dangerousLevel: [], dangerousLevel: [],
dialogTableVisibles: false, dialogTableVisibles: false,
devicePos: [] devicePos: [],
processList: [],
selectProcessList: []
}; };
}, },
created() { created() {
...@@ -455,8 +476,10 @@ export default { ...@@ -455,8 +476,10 @@ export default {
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
isDel: null, isDel: null,
remarks: null remarks: null,
processRelationList: []
}; };
this.selectProcessList = [];
this.resetForm("form"); this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
...@@ -479,6 +502,8 @@ export default { ...@@ -479,6 +502,8 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
//获取流程工艺信息
this.getProcessList();
this.open = true; this.open = true;
this.title = "添加场站信息"; this.title = "添加场站信息";
}, },
...@@ -491,6 +516,11 @@ export default { ...@@ -491,6 +516,11 @@ export default {
if(this.form.longitude){ if(this.form.longitude){
this.devicePos = [this.form.longitude,this.form.latitude]; this.devicePos = [this.form.longitude,this.form.latitude];
} }
if(this.form.processRelationList){
this.selectProcessList = this.form.processRelationList.map(p => p.processId);
}
//获取流程工艺信息
this.getProcessList();
this.open = true; this.open = true;
this.title = "修改场站信息"; this.title = "修改场站信息";
}); });
...@@ -499,8 +529,14 @@ export default { ...@@ -499,8 +529,14 @@ export default {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.form.processRelationList = [];
if(this.selectProcessList){
this.selectProcessList.forEach(p =>{
this.form.processRelationList.push({processId:p})
})
}
if (this.form.siteStationId != null) { if (this.form.siteStationId != null) {
updateInfo(this.form).then(response => { editStationAndProcessInfo(this.form).then(response => {
this.msgSuccess("修改成功"); this.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -608,6 +644,15 @@ export default { ...@@ -608,6 +644,15 @@ export default {
//详情 //详情
handleDetail(row){ handleDetail(row){
this.$refs.detail.getDetailInfo(row.siteStationId); this.$refs.detail.getDetailInfo(row.siteStationId);
},
//获取流程图信息
getProcessList(){
technologyProcessInfoList().then(res =>{
if(res.code == 200){
this.processList = res.data;
console.log("<<<<<<<<<<<>>>>>>>>>>",res.data);
}
})
} }
} }
}; };
......
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