Commit ada3b161 authored by tangwei's avatar tangwei

点状态,更新

parent a85fe42f
package com.yeejoin.amos.bank.controller; package com.yeejoin.amos.bank.controller;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.yeejoin.amos.bank.service.InspectionService; import com.yeejoin.amos.bank.service.InspectionService;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel; import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import com.yeejoin.amos.op.core.common.response.CommonResponse; import com.yeejoin.amos.op.core.common.response.CommonResponse;
import com.yeejoin.amos.op.core.util.CommonResponseUtil; import com.yeejoin.amos.op.core.util.CommonResponseUtil;
import com.yeejoin.amos.spc.business.controller.BaseController; import com.yeejoin.amos.spc.business.controller.BaseController;
import com.yeejoin.amos.spc.business.param.ReginParams; import com.yeejoin.amos.spc.business.param.ReginParams;
import com.yeejoin.amos.spc.business.remote.RemoteSecurityService; import com.yeejoin.amos.spc.business.remote.RemoteSecurityService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
/** /**
* 巡检controller * 巡检controller
* @author DELL * @author DELL
* *
*/ */
@RestController @RestController
@RequestMapping(value = "/bank/inspection") @RequestMapping(value = "/bank/inspection")
@Api(value = "/bank/inspection", tags = {"巡检API"}) @Api(value = "/bank/inspection", tags = {"巡检API"})
public class InspectionController extends BaseController{ public class InspectionController extends BaseController{
@Autowired @Autowired
private InspectionService inspectionService; private InspectionService inspectionService;
@Autowired @Autowired
RemoteSecurityService remoteSecurityService; RemoteSecurityService remoteSecurityService;
@GetMapping(value = "/rightTopChart", produces = "application/json;charset=UTF-8") @GetMapping(value = "/rightTopChart", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "查询主页右上角图片", notes = "查询主页右上角图片") @ApiOperation(value = "查询主页右上角图片", notes = "查询主页右上角图片")
public CommonResponse rightTopChartData(@ApiParam(value = "公司id", required = false)String companyId) { public CommonResponse rightTopChartData(@ApiParam(value = "公司id", required = false)String companyId) {
// if(companyId == null || "".equals(companyId)) { // if(companyId == null || "".equals(companyId)) {
// ReginParams reginParams = getSelectedOrgInfo(); // ReginParams reginParams = getSelectedOrgInfo();
// companyId = getCompanyId(reginParams); // companyId = getCompanyId(reginParams);
// //
// return CommonResponseUtil.failure(); // return CommonResponseUtil.failure();
// } // }
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
companyId = getCompanyId(reginParams); companyId = getCompanyId(reginParams);
return CommonResponseUtil.success(inspectionService.queryRightTopChart(companyId)); return CommonResponseUtil.success(inspectionService.queryRightTopChart(companyId));
} }
@GetMapping(value = "/bottomTable", produces = "application/json;charset=UTF-8") @GetMapping(value = "/bottomTable", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "查询主页右下角table", notes = "查询主页右下角table") @ApiOperation(value = "查询主页右下角table", notes = "查询主页右下角table")
public CommonResponse bottomTableData() { public CommonResponse bottomTableData() {
return CommonResponseUtil.success(inspectionService.queryBottomTableData()); return CommonResponseUtil.success(inspectionService.queryBottomTableData());
} }
@ApiOperation(value = "巡检计划执行情况列表", notes = "巡检计划执行情况列表") @ApiOperation(value = "巡检计划执行情况列表", notes = "巡检计划执行情况列表")
@GetMapping(value = "/patrolPlanList") @GetMapping(value = "/patrolPlanList")
public CommonResponse patrolPlanList(@ApiParam(value = "当前条数", required = true) @RequestParam Integer start, public CommonResponse patrolPlanList(@ApiParam(value = "当前条数", required = true) @RequestParam Integer start,
@ApiParam(value = "到条数", required = true) @RequestParam Integer end, @ApiParam(value = "到条数", required = true) @RequestParam Integer end,
@ApiParam(value = "部门编号") @RequestParam(required = false) String deptId, @ApiParam(value = "部门编号") @RequestParam(required = false) String deptId,
@ApiParam(value = "部门编号") @RequestParam(required = false) String deptName) { @ApiParam(value = "部门编号") @RequestParam(required = false) String deptName) {
try { try {
return CommonResponseUtil.success(inspectionService.queryRightTopChartlist(start, end, deptId,deptName)); return CommonResponseUtil.success(inspectionService.queryRightTopChartlist(start, end, deptId,deptName));
} catch (Exception e) { } catch (Exception e) {
return CommonResponseUtil.failure("查询异常"); return CommonResponseUtil.failure("查询异常");
} }
} }
@GetMapping(value = "/getporint", produces = "application/json;charset=UTF-8") @GetMapping(value = "/getporint", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "点的状态", notes = "点的状态") @ApiOperation(value = "点的状态", notes = "点的状态")
public CommonResponse getporint(@ApiParam(value = "公司id", required = false)String pointid) { public CommonResponse getporint(@ApiParam(value = "公司id", required = false)String pointid) {
java.util.HashMap<String, Object> map=inspectionService.getporint(pointid); java.util.HashMap<String, Object> map=inspectionService.getporint(pointid);
List<DictionarieValueModel> listDictionaryByDictCode = remoteSecurityService.listDictionaryByDictCode("BANK_ORG"); List<DictionarieValueModel> listDictionaryByDictCode = remoteSecurityService.listDictionaryByDictCode("BANK_ORG");
String xian=""; String xian="";
String xianyang=""; String xianyang="";
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (DictionarieValueModel e : listDictionaryByDictCode) { for (DictionarieValueModel e : listDictionaryByDictCode) {
if("xian".equals(e.getDictDataKey())) { if("xian".equals(e.getDictDataKey())) {
xian=e.getDictDataValue(); xian=e.getDictDataValue();
} }
if("xianyang".equals(e.getDictDataKey())) { if("xianyang".equals(e.getDictDataKey())) {
xianyang=e.getDictDataValue(); xianyang=e.getDictDataValue();
} }
} }
java.util.HashMap<String, Object> map1 =new java.util.HashMap<>(); java.util.HashMap<String, Object> map1 =new java.util.HashMap<>();
if(map!=null){ if(map!=null){
int status= Integer.valueOf(map.get("status").toString()); int status= Integer.valueOf(map.get("status").toString());
String code= map.get("code").toString(); String code= map.get("code").toString();
if(status==2){ if(status==1){
map1.put("pointtype", true); map1.put("pointtype", true);
}else{ }else{
map1.put("pointtype",false ); map1.put("pointtype",false );
} }
if (code.indexOf(xian)!=-1){ if (code.indexOf(xian)!=-1){
map1.put("cstype","xian" ); map1.put("cstype","xian" );
} }
if (code.indexOf(xianyang)!=-1){ if (code.indexOf(xianyang)!=-1){
map1.put("cstype","xianyang" ); map1.put("cstype","xianyang" );
} }
} }
return CommonResponseUtil.success(map1); return CommonResponseUtil.success(map1);
} }
} }
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