Commit fe87cfca authored by 高建强's avatar 高建强

item:迁移今日值班列表

parent c93f621e
......@@ -332,6 +332,15 @@ public class View3dController extends BaseController {
return CommonResponseUtil.success(view3dService.listPointsByRegionId(regionId,type));
}
@Permission
@ApiOperation(value = "今日值班列表",notes = "今日值班列表")
@GetMapping(value = "dutyList")
public CommonResponse dutyList(){
ReginParams reginParams =getSelectedOrgInfo();
String orgCode = this.getOrgCode(reginParams);
return CommonResponseUtil.success(view3dService.dutyList(orgCode));
}
@Autowired
IRocketMQService rocketMQService;
......
......@@ -657,6 +657,80 @@ public class View3dServiceImpl implements IView3dService {
return pointList;
}
@Override
public List<Map<String, Object>> dutyList(String orgCode) {
Date curDate = new Date();
JSONObject param = new JSONObject();
param.put("dutyDate", curDate);
Toke toke = remoteSecurityService.getServerToken();
ArrayList<Map<String, Object>> list = new ArrayList<>();
CommonResponse commonResponse = dutyModeServer.dutyListByDate(toke.getAppKey(), toke.getProduct(), toke.getToke(), orgCode, param.toJSONString());
if ("SUCCESS".equals(commonResponse.getResult())) {
String JSONStr = JSON.toJSONString(commonResponse.getDataList());
JSONArray dataList = JSONObject.parseArray(JSONStr);
if (!ObjectUtils.isEmpty(dataList)) {
dataList.forEach(
x -> {
Map<String, Object> resultMap = new HashMap<>();
JSONObject obj = (JSONObject) x;
String postType = obj.getString("postType");
resultMap.put("postName", findPostName(postType));
resultMap.put("name", obj.getString("dutyName"));
resultMap.put("phone", obj.getString("mobile"));
list.add(resultMap);
}
);
}
}
return list;
}
private String findPostName(String postType) {
String postName ;
switch (postType) {
case "dutyLeader":
postName = "值班站长";
break;
case "deputyDutyLeader":
postName = "副值班长";
break;
case "dutyCivilian":
postName = "值班员";
break;
case "fireLeader":
postName = "驻站消防站长";
break;
case "firePerson":
postName = "消防员";
break;
case "safePerson":
postName = "保安";
break;
case "deputyDutyCivilian":
postName = "副值班员";
break;
case "fireDriver":
postName = "司机";
break;
case "fireSafetyPerson":
postName = "消防安全负责人";
break;
case "fireManagementPerson":
postName = "消防安全管理人";
break;
case "fireBrigadeLeader":
postName = "消防专职队队长";
break;
case "fireBrigadeMember":
postName = "消防专职队队员";
break;
default:
postName = "";
break;
}
return postName;
}
private List<Map<String, Object>> getPointsByRegionIds(List<Long> ids) {
return view3dMapper.getAllPointInRegions(ids);
......
......@@ -189,4 +189,10 @@ public interface IView3dService {
*/
List<Map<String, Object>> listPointsByRegionId(Long regionId, String type);
/**
* 今日值班列表
* @param orgCode
* @return
*/
List<Map<String, Object>> dutyList(String orgCode);
}
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