Commit b5745127 authored by chenzhao's avatar chenzhao

修改代码

parent 508a3dfd
......@@ -960,4 +960,12 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(orgUsr.getBizOrgCode());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询单位基本信息", notes = "查询单位基本信息")
@GetMapping(value = "/getCompanyInfo")
public ResponseModel<OrgUsr> getCompanyInfo(String companyId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getByIduser(companyId));
}
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.patrol.business.feign.EquipFeign;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
import com.yeejoin.amos.patrol.business.vo.PointInputItemNewVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -89,6 +90,9 @@ public class PointController extends AbstractBaseController {
@Autowired
private EquipFeign equipFeign;
@Autowired
private JcsFeignClient jcsFeignClient;
/**
*
......@@ -548,6 +552,39 @@ public class PointController extends AbstractBaseController {
return CommonResponseUtil.success();
}
/**新加接口**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "导入导入模板新", notes = "导入模板新")
@PostMapping(value = "/exportTemplateNew", produces = "application/json;charset=UTF-8")
public CommonResponse exportTemplateNew(HttpServletResponse response) {
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
String fileName = "巡检点导入模板"; //模板名称
String[] handers = {"点编号","点名称","是否为移动点","计划外巡检是否评分","是否允许离线巡检","参考地址","最少拍照数量","最多拍照数量","风险等级","备注说明","检查项目","是否室内"}; //列标题
List<String[]> downData = new ArrayList();
String[] isScore = {"否","是"};
String[] isFixed = {"否","是"};
String[] offline = {"否","是"};
String[] isIndoor = {"否","是"};
String[] level = {"一级","二级","三级","四级","五级"};
// String[] catalog = catalogTreeService.getCataLogList(loginOrgCode);
downData.add(isFixed);
downData.add(isScore);
downData.add(offline);
downData.add(level);
// downData.add(catalog);
downData.add(isIndoor);
String [] downRows = {"2","3","4", "8","11"}; //下拉的列序号数组(序号从0开始)
try {
FileHelper.createExcelTemplate(fileName, handers, downData, downRows, response);
} catch (Exception e) {
CommonResponseUtil.failure(e.getMessage());
}
return CommonResponseUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询巡检点信息", notes = "查询巡检点信息")
@PostMapping(value = "/exportListPoint", produces = "application/json;charset=UTF-8")
......@@ -1076,8 +1113,12 @@ public class PointController extends AbstractBaseController {
String loginOrgCode = getOrgCode(reginParams);
point.setOrgCode(loginOrgCode); //点归属于公司
point.setCreatorId(user.getUserId());
point.setBizOrgCode(reginParams.getPersonIdentity().getBizOrgCode());
point.setBizOrgName(reginParams.getPersonIdentity().getCompanyName());
Object result = jcsFeignClient.getCompanyInfo(point.getChargeDeptId()).getResult();
String bizOrgCode = ((Map<String, Object>) result).get("bizOrgCode").toString();
String bizOrgName = ((Map<String, Object>) result).get("bizOrgName").toString();
point.setBizOrgCode(bizOrgCode);
point.setBizOrgName(bizOrgName);
iPointService.addPointNew(point);
return CommonResponseUtil.success();
} catch (Exception e) {
......
......@@ -60,5 +60,8 @@ public interface JcsFeignClient {
@PostMapping (value = "/org-person/getUserList")
FeignClientResult<List<Map<String, Object>>> selectByIdList(@RequestBody List<String> id);
@GetMapping(value = "/org-usr/getCompanyInfo")
ResponseModel<Object> getCompanyInfo(String companyId);
}
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