Commit e6e2a615 authored by wanglong's avatar wanglong

解决项目 焊工添加 设备添加等问题

parent 9f0c274d
......@@ -165,8 +165,8 @@ public class EquipmentController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "设备数据名称查询", notes = "设备数据名称查询")
@GetMapping(value = "/selectName")
public ResponseModel<List<JSONObject>> selectName(@RequestParam(value = "code")String code) {
return ResponseHelper.buildResponse(equipmentServiceImpl.selectName(code));
public ResponseModel<List<JSONObject>> selectName() {
return ResponseHelper.buildResponse(equipmentServiceImpl.selectName());
}
/**
......
......@@ -153,8 +153,8 @@ public class MaterialController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "材料信息表列表全部数据查询", notes = "材料信息表列表全部数据查询")
@GetMapping(value = "/selectName")
public ResponseModel<List<JSONObject>> selectName(@RequestParam(value = "unitId")String installationUnitId) {
return ResponseHelper.buildResponse(materialServiceImpl.selectName(installationUnitId));
public ResponseModel<List<JSONObject>> selectName() {
return ResponseHelper.buildResponse(materialServiceImpl.selectName());
}
/**
* 新增材料+附件
......
......@@ -79,15 +79,16 @@ public class WelderController extends BaseController {
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/selectWelder")
@ApiOperation(httpMethod = "GET", value = "获取焊工信息", notes = "获取焊工信息")
public ResponseModel<List<JSONObject>> selectWelder(@RequestParam("code") String code) {
public ResponseModel<List<JSONObject>> selectWelder() {
List<JSONObject> jsonObjectList=new ArrayList<>();
LambdaQueryWrapper<Project> wrapper=new LambdaQueryWrapper<>();
wrapper.eq(Project::getCode,code);
Project project = projectMapper.selectOne(wrapper);
List<Map> info = orgService.getInfo(String.valueOf(project.getCompanyId()),null).getRecords();
// LambdaQueryWrapper<Project> wrapper=new LambdaQueryWrapper<>();
// wrapper.eq(Project::getCode,code);
// Project project = projectMapper.selectOne(wrapper);
//根据登录人获取登录人单位下焊工
List<Map> info = orgService.getCompanyWelder(null).getRecords();
for (Map<String,Object> map:info){
JSONObject jsonObject=new JSONObject();
jsonObject.put("name",map.get("name"));
......
......@@ -65,19 +65,24 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
*
* @return
*/
public List<JSONObject> selectName(String code) {
@BusinessIdentify
public List<JSONObject> selectName() {
List<JSONObject> names = new ArrayList<>();
Long companySequenceNbr = orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr();
LambdaQueryWrapper<Equipment> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Equipment::getCompanyId,companySequenceNbr);
List<Equipment> equipment = equipmentMapper.selectList(wrapper);
//添加查询条件
// QueryWrapper<Equipment> wrapper = new QueryWrapper<>();
// wrapper.eq("company_id", installationUnitId);
//获取项目的安装单位id
LambdaQueryWrapper<Project> wrapper=new LambdaQueryWrapper<>();
wrapper.eq(Project::getCode,code);
Project project = projectMapper.selectOne(wrapper);
//获取项目的安装单位id进行查询
QueryWrapper<Equipment> wrapperEquipment= new QueryWrapper<>();
wrapperEquipment.eq("company_id", project.getInstallationUnitId());
List<Equipment> equipment = equipmentMapper.selectList(wrapperEquipment);
// LambdaQueryWrapper<Project> wrapper=new LambdaQueryWrapper<>();
// wrapper.eq(Project::getCode,code);
// Project project = projectMapper.selectOne(wrapper);
// //获取项目的安装单位id进行查询
// QueryWrapper<Equipment> wrapperEquipment= new QueryWrapper<>();
// wrapperEquipment.eq("company_id", project.getInstallationUnitId());
// List<Equipment> equipment = equipmentMapper.selectList(wrapperEquipment);
for (Equipment i : equipment) {
JSONObject name = new JSONObject();
......
......@@ -57,11 +57,16 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
/**
* 获取材料名称跟企业id
*/
public List<JSONObject> selectName(String installationUnitId) {
@BusinessIdentify
public List<JSONObject> selectName() {
List<JSONObject> names = new ArrayList<>();
//添加查询条件
QueryWrapper<Material> wrapper = new QueryWrapper<>();
wrapper.eq("company_id", installationUnitId);
Long companySequenceNbr = orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr();
LambdaQueryWrapper<Material> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Material::getCompanyId,companySequenceNbr);
// List<Equipment> equipment = equipmentMapper.selectList(wrapper);
// QueryWrapper<Material> wrapper = new QueryWrapper<>();
// wrapper.eq("company_id", installationUnitId);
List<Material> materials = baseMapper.selectList(wrapper);
......
......@@ -105,10 +105,15 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
/**
* 查询项目名称
*/
@BusinessIdentify
public List<JSONObject> selectName() {
List<JSONObject> names = new ArrayList<>();
Long companySequenceNbr = orgService.getReginParams().getBusinessInfo().getCompanySequenceNbr();
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Project::getCompanyId,companySequenceNbr);
//查询所有项目
List<Project> projects = projectMapper.selectList(null);
List<Project> projects = projectMapper.selectList(wrapper);
for (Project i : projects) {
JSONObject name = new JSONObject();
name.put("name", i.getName());
......
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