Commit 1446d2e9 authored by 韩桐桐's avatar 韩桐桐

需求【3197】

parent 7cbce420
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
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.LambdaQueryWrapper;
...@@ -14,7 +15,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipmentClassifyDto; ...@@ -14,7 +15,6 @@ import com.yeejoin.amos.boot.module.jg.api.dto.EquipmentClassifyDto;
import com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto; import com.yeejoin.amos.boot.module.jg.api.dto.UseFlagParamDto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory; import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage; import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper; import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgCertificateReplenishService; import com.yeejoin.amos.boot.module.jg.api.service.IJgCertificateReplenishService;
import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService; import com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService;
...@@ -67,6 +67,11 @@ public class CommonController extends BaseController { ...@@ -67,6 +67,11 @@ public class CommonController extends BaseController {
private final IJgCertificateReplenishService iJgCertificateReplenishService; private final IJgCertificateReplenishService iJgCertificateReplenishService;
private final CodeUtil codeUtil; private final CodeUtil codeUtil;
/**
* 监管机构
*/
public static final String COMPANY_TYPE_SUPERVISION_NAME = "监管机构";
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/currentLoginInfo") @GetMapping(value = "/currentLoginInfo")
@ApiOperation(httpMethod = "GET", value = "当前登录人信息", notes = "当前登录人信息") @ApiOperation(httpMethod = "GET", value = "当前登录人信息", notes = "当前登录人信息")
...@@ -143,6 +148,30 @@ public class CommonController extends BaseController { ...@@ -143,6 +148,30 @@ public class CommonController extends BaseController {
return ResponseHelper.buildResponse(commonService.getUnitListByType(type, business)); return ResponseHelper.buildResponse(commonService.getUnitListByType(type, business));
} }
/**
* 需求 【3197】
* 根据当前登录人获取使用单位列表(用作设备列表查询)
* 当前登录人:监管 -> 获取所有使用单位
* 其他 -> 当前登录人所在单位
* @return unitLists
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUseUnitListByCurrentLoginUser")
@ApiOperation(httpMethod = "GET", value = "根据当前登录人获取使用单位列表(用作设备列表查询)", notes = "根据当前登录人获取使用单位列表(用作设备列表查询)")
public ResponseModel<List<Map<String, Object>>> getUseUnitListByCurrentLoginUser() {
String companyType = getSelectedOrgInfo().getCompany().getCompanyType();
List<Map<String, Object>> result = new ArrayList<>();
if (COMPANY_TYPE_SUPERVISION_NAME.equals(companyType)) {
result = commonService.getUnitListByType("use", null);
}else {
result.add(MapBuilder.<String, Object>create()
.put("useCode", getSelectedOrgInfo().getCompany().getCompanyCode())
.put("useUnit", getSelectedOrgInfo().getCompany().getCompanyName())
.build());
}
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getMessage") @GetMapping(value = "/getMessage")
......
...@@ -41,6 +41,7 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -41,6 +41,7 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
...@@ -81,6 +82,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -81,6 +82,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
public static final String ORG_BRANCH_CODE = "orgBranchCode"; public static final String ORG_BRANCH_CODE = "orgBranchCode";
// 设备基本信息表单id // 设备基本信息表单id
private static final String EQUIP_INFO_FORM_ID = "equipInfo"; private static final String EQUIP_INFO_FORM_ID = "equipInfo";
public static final String USE_UNIT_CREDIT_CODE = "useUnitCreditCode";
@Resource @Resource
private IdxBizJgUseInfoServiceImpl useInfoService; private IdxBizJgUseInfoServiceImpl useInfoService;
@Resource @Resource
...@@ -251,7 +253,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP ...@@ -251,7 +253,7 @@ public class IdxBizJgProjectContraptionServiceImpl extends BaseService<IdxBizJgP
street= street.split("_")[0]; street= street.split("_")[0];
} }
//获取街道 //获取街道
String useUnitCreditCode = params.get("useUnitCreditCode"); String useUnitCreditCode = params.get(USE_UNIT_CREDIT_CODE);
if(!StringUtils.isEmpty(useUnitCreditCode) && useUnitCreditCode.contains("_")){ if(!StringUtils.isEmpty(useUnitCreditCode) && useUnitCreditCode.contains("_")){
useUnitCreditCode= useUnitCreditCode.split("_")[0]; useUnitCreditCode= useUnitCreditCode.split("_")[0];
} }
......
...@@ -2638,7 +2638,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -2638,7 +2638,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
if(companyLevel.equals(BaseController.COMPANY_TYPE_SUPERVISION)) { // 监管 右模糊查询 if(companyLevel.equals(BaseController.COMPANY_TYPE_SUPERVISION)) { // 监管 右模糊查询
boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(map.getString("ORG_BRANCH_CODE")) + "*")); boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(map.getString("ORG_BRANCH_CODE")) + "*"));
} else { // 企业 等于查询 } else { // 企业 等于查询
boolMust.must(QueryBuilders.termQuery("ORG_BRANCH_CODE.keyword", map.getString("ORG_BRANCH_CODE"))); boolMust.must(QueryBuilders.wildcardQuery("ORG_BRANCH_CODE.keyword", QueryParser.escape(map.getString("ORG_BRANCH_CODE")) + "*"));
} }
} }
builder.query(boolMust); builder.query(boolMust);
......
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