Commit e6e2a615 authored by wanglong's avatar wanglong

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

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