Commit cfad4cb1 authored by wanglong's avatar wanglong

添加 焊口信息,项目设备列表,项目管材列表

parent 9440bb1b
......@@ -184,16 +184,43 @@ public class ProjectResourceController extends BaseController {
}
/**
* 绑定设备跟项目
* 绑定项目所用到的设备管材
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "POST",value = "绑定设备跟项目", notes = "绑定设备跟项目")
@ApiOperation(httpMethod = "POST",value = "绑定项目所用到的设备管材", notes = "绑定项目所用到的设备管材")
@PostMapping(value = "/saveId")
public ResponseModel<ProjectResource> saveId(@RequestBody JSONObject jsonObject) {
return ResponseHelper.buildResponse(projectResourceServiceImpl.saveIds(jsonObject));
}
/**
* 根据项目id获取项目使用到的设备
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/projectEquipment")
@ApiOperation(httpMethod = "GET" ,value = "根据项目id获取项目使用到的设备" , notes = "根据项目id获取项目使用到的设备")
public ResponseModel<List<ProjectResource>> projectEquipment(@RequestParam String projectId){
return ResponseHelper.buildResponse(projectResourceServiceImpl.getProjectEquipment(projectId));
}
/**
* 根据项目ID获取项目使用到的管材
* @param projectId
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/projectMaterial")
@ApiOperation( httpMethod = "GET",value = "根据项目ID获取项目使用到的管材", notes = "根据项目ID获取项目使用到的管材")
public ResponseModel<List<ProjectResource>> projectMaterial(@RequestParam String projectId){
return ResponseHelper.buildResponse(projectResourceServiceImpl.getProjectMaterial(projectId));
}
/**
* 项目管材分页列表,根据名称、编号查询
*/
......
......@@ -107,6 +107,18 @@ public class WeldController extends BaseController {
}
/**
* 根据焊口编码获取焊口信息
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/getWeldInfo")
@ApiOperation(httpMethod = "GET", value = "根据焊口编码获取焊口信息" , notes = "根据焊口编码获取焊口信息")
public ResponseModel<Weld> getWeldInfo(@RequestParam String code){
return ResponseHelper.buildResponse(weldServiceImpl.getWeldInfo(code));
}
/**
* 更新焊口编码任务状态
* @return
*/
......
......@@ -136,7 +136,7 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
}
/**
* 存储项目设备关系
* 绑定项目所用到的设备管材
*/
public ProjectResource saveIds(JSONObject jsonObject) {
JSONArray subForm = jsonObject.getJSONArray("subForm");
......@@ -173,6 +173,40 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
/**
* 根据项目id获取项目使用到的设备
* @param projectId
* @return
*/
public List<ProjectResource> getProjectEquipment(String projectId){
return getProjectResources(projectId, 设备资源);
}
/**
* 根据项目ID获取项目使用到的管材
* @param projectId
* @return
*/
public List<ProjectResource> getProjectMaterial(String projectId){
return getProjectResources(projectId, 管材资源);
}
/**
* 根据项目id获取项目公共接口
* @param projectId
* @param 资源
* @return
*/
private List<ProjectResource> getProjectResources(String projectId, ProjectResourceEnum 资源) {
LambdaQueryWrapper<ProjectResource> wrapper=new LambdaQueryWrapper<>();
wrapper.eq(ProjectResource::getProjectId,projectId);
wrapper.eq(ProjectResource::getType, 资源.getCode());
List<ProjectResource> projectResources = projectResourceMapper.selectList(wrapper);
return projectResources;
}
/**
* 获取当前登录人所在单位下的所有项目列表
* @return
*/
......
......@@ -14,8 +14,10 @@ import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.SuperviseRuleMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IWeldService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.ArrayList;
......@@ -170,6 +172,17 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
return welds;
}
/**
* 根据焊口编码获取焊口信息
*/
public Weld getWeldInfo( String code){
LambdaQueryWrapper<Weld> wrapper = new LambdaQueryWrapper<>();
LambdaQueryWrapper<Weld> eq = wrapper.eq(Weld::getCode, code);
Weld weld = weldMapper.selectOne(eq);
return weld;
}
/**
* 通过项目id获取数据
* @param projectId
......
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