Commit 9064c384 authored by wanglong's avatar wanglong

更新接口信息

parent 493ed597
package com.yeejoin.amos.boot.module.ugp.biz.controller;
import com.alibaba.fastjson.JSONObject;
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.biz.service.impl.OrgServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@RestController
@Api(tags = "焊工信息")
@RequestMapping(value = "/welder")
public class WelderController extends BaseController {
@Autowired
OrgServiceImpl orgService;
/**
* 新增焊工信息
......@@ -27,4 +38,19 @@ public class WelderController extends BaseController {
return ResponseHelper.buildResponse(null);
}
/**
* 获取焊工信息
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectWelder")
@ApiOperation(httpMethod = "GET", value = "新增焊工信息", notes = "新增焊工信息")
public ResponseModel<List<Map>> selectWelder(@RequestParam("unitId") String companyId) {
List<Map> info = orgService.getInfo(companyId);
return ResponseHelper.buildResponse(info);
}
}
......@@ -56,7 +56,7 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
for (Equipment i : equipment) {
JSONObject name = new JSONObject();
name.put("name", i.getName());
name.put("company_id", i.getCompanyId());
name.put("code", i.getCode());
names.add(name);
}
......
......@@ -51,7 +51,7 @@ public class MaterialServiceImpl extends BaseService<MaterialDto, Material, Mate
for (Material i : materials) {
JSONObject name = new JSONObject();
name.put("name", i.getName());
name.put("company_id", i.getCompanyId());
name.put("code", i.getCode());
names.add(name);
}
......
......@@ -57,8 +57,10 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,
for (Object json2 : subForm) {
String select = JSON.parseObject(JSON.toJSONString(json2)).getString("select");
String companyId = jsonObject.getString("company_id");
// if (!jsonObject.getString("sequenceNbr").isEmpty()){
// jsonObject.getString("sequenceNbr");
// }
String code = jsonObject.getString("code");
String type = jsonObject.getString("type");
if (type.equals(设备资源.getStatus())) {
projectResource.setType(设备资源.getState());
......@@ -69,7 +71,7 @@ public class ProjectResourceServiceImpl extends BaseService<ProjectResourceDto,
if (type.equals(管材资源.getStatus())) {
projectResource.setType(管材资源.getState());
}
projectResource.setProjectId(Long.valueOf(companyId));
projectResource.setProjectId(Long.valueOf(code));
projectResource.setResourceId(Long.valueOf(select));
this.save(projectResource);
......
......@@ -48,7 +48,7 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
for (Project i : projects) {
JSONObject name = new JSONObject();
name.put("name", i.getName());
name.put("company_id", i.getCompanyId());
name.put("sequenceNbr", i.getSequenceNbr());
names.add(name);
}
......
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