Commit 4678325d authored by srx's avatar srx

Merge remote-tracking branch 'origin/developer' into developer

parents 4654253e 4d6ad98c
...@@ -143,8 +143,8 @@ public class EquipmentController extends BaseController { ...@@ -143,8 +143,8 @@ public class EquipmentController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "设备数据名称查询", notes = "设备数据名称查询") @ApiOperation(httpMethod = "GET", value = "设备数据名称查询", notes = "设备数据名称查询")
@GetMapping(value = "/selectName") @GetMapping(value = "/selectName")
public ResponseModel<List<JSONObject>> selectName(@RequestParam(value = "unitId")String installationUnitId) { public ResponseModel<List<JSONObject>> selectName(@RequestParam(value = "code")String code) {
return ResponseHelper.buildResponse(equipmentServiceImpl.selectName(installationUnitId)); return ResponseHelper.buildResponse(equipmentServiceImpl.selectName(code));
} }
/** /**
......
...@@ -14,9 +14,11 @@ import io.swagger.annotations.Api; ...@@ -14,9 +14,11 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -174,8 +176,12 @@ public class ProjectController extends BaseController { ...@@ -174,8 +176,12 @@ public class ProjectController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "查询当前登陆人所在单位下的所以项目列表", notes = "查询当前登陆人所在单位下的所以项目列表") @ApiOperation(httpMethod = "GET", value = "查询当前登陆人所在单位下的所以项目列表", notes = "查询当前登陆人所在单位下的所以项目列表")
@GetMapping(value = "/getCompanyProjects") @GetMapping(value = "/getCompanyProjects")
public ResponseModel<List<Project>> getCompanyProjects(){ public ResponseModel<List<Project>> getCompanyProjects(){
Long companyId = orgServiceImpl.getCompanyId();
if(ValidationUtil.isEmpty(companyId)){
return ResponseHelper.buildResponse(new ArrayList<>());
}
LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Project> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Project::getConstructionUnitId,orgServiceImpl.getCompanyId()); wrapper.eq(Project::getConstructionUnitId,companyId);
return ResponseHelper.buildResponse(projectServiceImpl.list(wrapper)); return ResponseHelper.buildResponse(projectServiceImpl.list(wrapper));
} }
} }
package com.yeejoin.amos.boot.module.ugp.biz.controller; package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto; import com.yeejoin.amos.boot.module.ugp.api.dto.WelderDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl; import com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -24,6 +27,8 @@ import java.util.stream.Collectors; ...@@ -24,6 +27,8 @@ import java.util.stream.Collectors;
public class WelderController extends BaseController { public class WelderController extends BaseController {
@Autowired @Autowired
OrgServiceImpl orgService; OrgServiceImpl orgService;
@Autowired
ProjectMapper projectMapper;
/** /**
...@@ -47,10 +52,20 @@ public class WelderController extends BaseController { ...@@ -47,10 +52,20 @@ public class WelderController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectWelder") @GetMapping(value = "/selectWelder")
@ApiOperation(httpMethod = "GET", value = "新增焊工信息", notes = "新增焊工信息") @ApiOperation(httpMethod = "GET", value = "新增焊工信息", notes = "新增焊工信息")
public ResponseModel<List<Map>> selectWelder(@RequestParam("unitId") String companyId) { public ResponseModel<List<JSONObject>> selectWelder(@RequestParam("code") String code) {
List<Map> info = orgService.getInfo(companyId); 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()));
for (Map<String,Object> map:info){
JSONObject jsonObject=new JSONObject();
jsonObject.put("name",map.get("name"));
jsonObject.put("sequenceNbr",map.get("sequenceNbr"));
jsonObjectList.add(jsonObject);
}
return ResponseHelper.buildResponse(info); return ResponseHelper.buildResponse(jsonObjectList);
} }
} }
package com.yeejoin.amos.boot.module.ugp.biz.service.impl; package com.yeejoin.amos.boot.module.ugp.biz.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment; import com.yeejoin.amos.boot.module.ugp.api.entity.Equipment;
import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper; import com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper;
import com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper;
import com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService; import com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService;
import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto; import com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -31,6 +34,8 @@ import java.util.stream.Collectors; ...@@ -31,6 +34,8 @@ import java.util.stream.Collectors;
public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, EquipmentMapper> implements IEquipmentService { public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, EquipmentMapper> implements IEquipmentService {
@Autowired @Autowired
EquipmentMapper equipmentMapper; EquipmentMapper equipmentMapper;
@Autowired
ProjectMapper projectMapper;
@Autowired @Autowired
AttachmentServiceImpl attachmentServiceImpl; AttachmentServiceImpl attachmentServiceImpl;
...@@ -57,13 +62,19 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E ...@@ -57,13 +62,19 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
* *
* @return * @return
*/ */
public List<JSONObject> selectName(String installationUnitId) { public List<JSONObject> selectName(String code) {
List<JSONObject> names = new ArrayList<>(); List<JSONObject> names = new ArrayList<>();
//添加查询条件 //添加查询条件
QueryWrapper<Equipment> wrapper = new QueryWrapper<>(); // QueryWrapper<Equipment> wrapper = new QueryWrapper<>();
wrapper.eq("company_id", installationUnitId); // wrapper.eq("company_id", installationUnitId);
//获取项目的安装单位id
List<Equipment> equipment = equipmentMapper.selectList(wrapper); 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) { for (Equipment i : equipment) {
JSONObject name = new JSONObject(); JSONObject name = new JSONObject();
......
...@@ -239,6 +239,10 @@ public class OrgServiceImpl { ...@@ -239,6 +239,10 @@ public class OrgServiceImpl {
public Long getCompanyId(){ public Long getCompanyId(){
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr())); wrapper.eq(OrgUsr :: getAmosOrgId,String.valueOf(getReginParams().getCompany().getSequenceNbr()));
return orgUsrServiceImpl.getOne(wrapper).getSequenceNbr(); OrgUsr orgUsr = orgUsrServiceImpl.getOne(wrapper);
if(ValidationUtil.isEmpty(orgUsr)){
return null;
}
return orgUsr.getSequenceNbr();
} }
} }
...@@ -130,8 +130,9 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P ...@@ -130,8 +130,9 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
// if (!jsonObject.getString("sequenceNbr").isEmpty()){ // if (!jsonObject.getString("sequenceNbr").isEmpty()){
// jsonObject.getString("sequenceNbr"); // jsonObject.getString("sequenceNbr");
// } // }
String SequenceNbr = jsonObject.getString("SequenceNbr"); Long SequenceNbr = Long.valueOf(jsonObject.getString("sequenceNbr"));
String type = jsonObject.getString("type"); String type = jsonObject.getString("type");
//判断资源类型并插入
if (type.equals(设备资源.getStatus())) { if (type.equals(设备资源.getStatus())) {
projectResource.setType(设备资源.getState()); projectResource.setType(设备资源.getState());
} }
...@@ -141,7 +142,7 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P ...@@ -141,7 +142,7 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,P
if (type.equals(管材资源.getStatus())) { if (type.equals(管材资源.getStatus())) {
projectResource.setType(管材资源.getState()); projectResource.setType(管材资源.getState());
} }
projectResource.setProjectId(Long.valueOf(SequenceNbr)); projectResource.setProjectId(SequenceNbr);
projectResource.setResourceId(Long.valueOf(select)); projectResource.setResourceId(Long.valueOf(select));
this.save(projectResource); this.save(projectResource);
......
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