Commit b3f83a8c authored by xinglei's avatar xinglei

*)增加查询安全指令书编号接口

parent 7c30d7b3
...@@ -30,6 +30,8 @@ public interface InspectionService { ...@@ -30,6 +30,8 @@ public interface InspectionService {
JSONObject getSafetySupervisionCode(String bizTable); JSONObject getSafetySupervisionCode(String bizTable);
JSONObject getSafetySupervisionCodeMap(String bizTable, String mapKey, String mapValue);
JSONObject getSafetySupervisionInfo(); JSONObject getSafetySupervisionInfo();
Page<JSONObject> getMapByRegion(Long regionSeq, String tableId, String type); Page<JSONObject> getMapByRegion(Long regionSeq, String tableId, String type);
......
...@@ -96,6 +96,19 @@ public class InspectionController { ...@@ -96,6 +96,19 @@ public class InspectionController {
} }
/** /**
* 获取所有安全监察指令书编号
*
* @param bizTable
* @return
*/
@GetMapping("/getSafetySupervisionCodeMap")
@ApiOperation(value = "获取所有安全监察指令书编号")
@TycloudOperation(ApiLevel = UserType.AGENCY)
public ResponseModel<JSONObject> getSafetySupervisionCodeMap(@RequestParam String bizTable, @RequestParam String mapKey, @RequestParam String mapValue) {
return ResponseHelper.buildResponse(inspectionService.getSafetySupervisionCodeMap(bizTable, mapKey, mapValue));
}
/**
* 查询行政复议机构和行政诉讼机构 * 查询行政复议机构和行政诉讼机构
* *
* @return * @return
......
...@@ -155,6 +155,17 @@ public class InspectionServiceImpl implements InspectionService { ...@@ -155,6 +155,17 @@ public class InspectionServiceImpl implements InspectionService {
} }
@Override @Override
public JSONObject getSafetySupervisionCodeMap(String bizTable, String mapKey, String mapValue) {
JSONObject jsonObject = new JSONObject();
String sql = String.format("SELECT `%s`, `%s` FROM %s", mapKey, mapValue, bizTable);
List<Map<String, Object>> list = bizJdbcTemplate.queryForList(sql);
list.forEach(x -> {
jsonObject.put(x.get(mapKey).toString(), x.get(mapValue));
});
return jsonObject;
}
@Override
public JSONObject getSafetySupervisionInfo() { public JSONObject getSafetySupervisionInfo() {
AgencyUserModel agencyUserModel = Privilege.agencyUserClient.getme().getResult(); AgencyUserModel agencyUserModel = Privilege.agencyUserClient.getme().getResult();
Object companyId = JsonValueUtils.getValueByKey(JSONObject.parse(JSON.toJSONString(agencyUserModel)), "companys", "companys.0.sequenceNbr"); Object companyId = JsonValueUtils.getValueByKey(JSONObject.parse(JSON.toJSONString(agencyUserModel)), "companys", "companys.0.sequenceNbr");
...@@ -197,7 +208,7 @@ public class InspectionServiceImpl implements InspectionService { ...@@ -197,7 +208,7 @@ public class InspectionServiceImpl implements InspectionService {
jsonObject.put(regionName, objectMap.get(regionName)); jsonObject.put(regionName, objectMap.get(regionName));
}); });
if (!ValidationUtil.isEmpty(jsonObject)){ if (!ValidationUtil.isEmpty(jsonObject)) {
page.setTotal(1); page.setTotal(1);
List<JSONObject> list = new ArrayList(); List<JSONObject> list = new ArrayList();
list.add(jsonObject); list.add(jsonObject);
......
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