中铁十一局调整
This commit is contained in:
parent
786e6d1106
commit
645d4dfdd2
110
src/main/java/com/zhgd/xmgl/modules/external/controller/ZtWorkerController.java
vendored
Normal file
110
src/main/java/com/zhgd/xmgl/modules/external/controller/ZtWorkerController.java
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
package com.zhgd.xmgl.modules.external.controller;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneAlarm;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ICrawlerCraneAlarmService;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 中铁十一局劳务人员外部接口调用
|
||||
* @author: pengj
|
||||
* @date: 2024-11-12
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/ztWorker")
|
||||
@Slf4j
|
||||
@Api(tags = "中铁十一局劳务人员外部接口调用")
|
||||
public class ZtWorkerController {
|
||||
|
||||
/**
|
||||
* 获取当天各⼯种出勤⼈数统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "中铁十一局劳务人员外部接口调用", operType = "分页查询", operDesc = "获取当天各⼯种出勤⼈数统计")
|
||||
@ApiOperation(value = " 获取当天各⼯种出勤⼈数统计", notes = "获取当天各工种出勤⼈数统计", httpMethod = "GET")
|
||||
@GetMapping(value = "/workerCount")
|
||||
public Result<Object> workerCount() {
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
requestMap.put("tenant_id", "1833147242533949441");
|
||||
requestMap.put("project_id", "1833149331474493441");
|
||||
requestMap.put("device_numbers", "E03C1CB19B121805,E03C1CB19F7A1805");
|
||||
String post = HttpUtil.post("http://spm3.1357.cn/hewu-api/api/worker-count", JSON.toJSONString(requestMap));
|
||||
return Result.success(JSONObject.parseObject(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当天各⼯种在册总⼈数统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "中铁十一局劳务人员外部接口调用", operType = "分页查询", operDesc = "获取当天各⼯种在册总⼈数统计")
|
||||
@ApiOperation(value = " 获取当天各⼯种在册总⼈数统计", notes = "获取当天各⼯种在册总⼈数统计", httpMethod = "GET")
|
||||
@GetMapping(value = "/workerType")
|
||||
public Result<Object> workerType() {
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
requestMap.put("tenant_id", "1833147242533949441");
|
||||
requestMap.put("project_id", "1833149331474493441");
|
||||
requestMap.put("team_id", "7239893512265666560");
|
||||
String post = HttpUtil.post("http://spm3.1357.cn/hewu-api/api/worker-type-count-by-team", JSON.toJSONString(requestMap));
|
||||
return Result.success(JSONObject.parseObject(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 总览接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "中铁十一局劳务人员外部接口调用", operType = "分页查询", operDesc = "总览接口")
|
||||
@ApiOperation(value = "总览接口", notes = "总览接口", httpMethod = "GET")
|
||||
@GetMapping(value = "workerOverview")
|
||||
public Result<Object> workerOverview() {
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
requestMap.put("tenant_id", "1833147242533949441");
|
||||
requestMap.put("project_id", "1833149331474493441");
|
||||
requestMap.put("device_numbers", "E03C1CB19B121805,E03C1CB19F7A1805");
|
||||
requestMap.put("team_id", "7239893512265666560");
|
||||
String post = HttpUtil.post("http://spm3.1357.cn/hewu-api/api/worker-overview", JSON.toJSONString(requestMap));
|
||||
return Result.success(JSONObject.parseObject(post));
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时进出记录接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "中铁十一局劳务人员外部接口调用", operType = "分页查询", operDesc = "实时进出记录接口")
|
||||
@ApiOperation(value = "实时进出记录接口", notes = "实时进出记录接口", httpMethod = "GET")
|
||||
@GetMapping(value = "realtimeRecords")
|
||||
public Result<Object> realtimeRecords() {
|
||||
Map<String, Object> requestMap = new HashMap<>();
|
||||
requestMap.put("tenant_id", "1833147242533949441");
|
||||
requestMap.put("project_id", "1833149331474493441");
|
||||
requestMap.put("device_numbers", "E03C1CB19B121805,E03C1CB19F7A1805");
|
||||
String post = HttpUtil.post("http://spm3.1357.cn/hewu-api/api/realtime-records", JSON.toJSONString(requestMap));
|
||||
return Result.success(JSONArray.parseArray(post));
|
||||
}
|
||||
|
||||
}
|
||||
@ -93,4 +93,16 @@ public class InspectTaskRecordController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统计任务自检数据(中铁十一局)
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目自检管理", operType = "统计任务自检数据", operDesc = "统计任务自检数据")
|
||||
@ApiOperation(value = "统计任务自检数据", notes = "统计任务自检数据", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String")
|
||||
@PostMapping(value = "/ztTaskStat")
|
||||
public Result<Map<String, Object>> ztTaskStat(@RequestBody Map<String,Object> map) {
|
||||
return Result.success(inspectTaskRecordService.ztTaskStat(MapUtils.getString(map,"projectSn")));
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,4 +44,6 @@ public interface IInspectTaskRecordService extends IService<InspectTaskRecord> {
|
||||
* @return
|
||||
*/
|
||||
EntityMap getTodayInfo(String projectSn);
|
||||
|
||||
Map<String, Object> ztTaskStat(String projectSn);
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import cn.hutool.core.util.NumberUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
@ -219,4 +220,25 @@ public class InspectTaskRecordServiceImpl extends ServiceImpl<InspectTaskRecordM
|
||||
entityMap.put("no_rectification_ratio", totalNum != 0 ? NumberUtil.div(MapUtil.getInt(entityMap, "noRectificationNum"), totalNum, 2) : 0);
|
||||
return entityMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> ztTaskStat(String projectSn) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<InspectTaskRecord> inspectTaskRecords = baseMapper.selectList(Wrappers.<InspectTaskRecord>lambdaQuery().eq(InspectTaskRecord::getSn, projectSn));
|
||||
List<String> userIdList = inspectTaskRecords.stream().map(i -> i.getInspectUser()).collect(Collectors.toList());
|
||||
List<Long> taskIdList = inspectTaskRecords.stream().map(i -> i.getId()).collect(Collectors.toList());
|
||||
taskIdList.add(0L);
|
||||
Set<String> userIds = new HashSet<>();
|
||||
for (String s : userIdList) {
|
||||
List<String> list = Arrays.asList(s.split(","));
|
||||
userIds.addAll(list);
|
||||
}
|
||||
resultMap.put("userCount", userIds.size());
|
||||
Integer taskItemCount = inspectTaskItemRecordMapper.selectCount(Wrappers.<InspectTaskItemRecord>lambdaQuery().in(InspectTaskItemRecord::getTaskId, taskIdList));
|
||||
resultMap.put("taskItemCount", taskItemCount);
|
||||
int passCount = hiddenDangerInspectRecordService.count(Wrappers.<HiddenDangerInspectRecord>lambdaQuery().in(HiddenDangerInspectRecord::getTaskId, taskIdList)
|
||||
.eq(HiddenDangerInspectRecord::getStatus, 4));
|
||||
resultMap.put("passCount", passCount);
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1330,6 +1330,12 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
@Override
|
||||
public Map<String, Object> viewWorkerInfoDetail(Map<String, Object> map) {
|
||||
Map<String, Object> data = new HashMap<>(16);
|
||||
if (StringUtils.isNotBlank(MapUtils.getString(map, "phoneNumber"))) {
|
||||
List<WorkerInfo> workerInfoList = workerInfoMapper.selectList(Wrappers.<WorkerInfo>lambdaQuery().eq(WorkerInfo::getPhoneNumber, MapUtils.getString(map, "phoneNumber")));
|
||||
if (workerInfoList.size() > 0) {
|
||||
map.put("workerId", workerInfoList.get(0).getId());
|
||||
}
|
||||
}
|
||||
EntityMap info = workerInfoMapper.viewWorkerInfoDetail(map);
|
||||
Object nature = info.get("workerNature");
|
||||
if (nature != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user