增加人员性质
This commit is contained in:
parent
381561f3a4
commit
75fb6e4b97
@ -22,13 +22,16 @@ import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatDevMapper;
|
||||
import com.zhgd.xmgl.modules.safetyhat.mapper.SafetyHatFenceMapper;
|
||||
import com.zhgd.xmgl.modules.safetyhat.service.ISafetyHatDevService;
|
||||
import com.zhgd.xmgl.modules.vehicleposition.entity.vo.CountVehiclePositionDevVo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.EnterpriseInfoMapper;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||
import com.zhgd.xmgl.util.ExcelUtils;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -61,6 +64,8 @@ public class SafetyHatDevServiceImpl extends ServiceImpl<SafetyHatDevMapper, Saf
|
||||
private SafetyHatFenceMapper safetyHatFenceMapper;
|
||||
@Autowired
|
||||
private WorkerInfoMapper workerInfoMapper;
|
||||
@Autowired
|
||||
private EnterpriseInfoMapper enterpriseInfoMapper;
|
||||
|
||||
@Override
|
||||
public IPage<SafetyHatDev> queryPageList(HashMap<String, Object> paramMap) {
|
||||
@ -85,6 +90,14 @@ public class SafetyHatDevServiceImpl extends ServiceImpl<SafetyHatDevMapper, Saf
|
||||
}
|
||||
|
||||
private List<SafetyHatDev> dealList(List<SafetyHatDev> list) {
|
||||
List<EnterpriseInfo> enterpriseInfos = enterpriseInfoMapper.selectList(null);
|
||||
for (SafetyHatDev safetyHatDev : list) {
|
||||
List<EnterpriseInfo> collect = enterpriseInfos.stream().filter(e -> StringUtils.isNotBlank(safetyHatDev.getEnterpriseIds())
|
||||
&& safetyHatDev.getEnterpriseIds().contains(e.getId().toString())).collect(Collectors.toList());
|
||||
if (collect.size() > 0) {
|
||||
safetyHatDev.setEnterpriseName(collect.stream().map(c -> c.getEnterpriseName()).collect(Collectors.joining(",")));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@ -767,4 +767,14 @@ public class WorkerInfoController {
|
||||
public Result<List<TrainRecordVo>> getTrainRecordsByWorkerId(@ApiIgnore @RequestBody Map<String, Object> param) {
|
||||
return Result.success(workerInfoService.getTrainRecordsByWorkerId(param));
|
||||
}
|
||||
|
||||
@OperLog(operModul = "劳务管理", operType = "导出", operDesc = "根据人员性质统计")
|
||||
@ApiOperation(value = "根据人员性质统计", notes = "根据人员性质统计", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/getWorkerByNature")
|
||||
public Result<List<Map<String, Object>>> getWorkerByNature(@ApiIgnore @RequestBody Map<String, Object> param) {
|
||||
return Result.success(workerInfoService.getWorkerByNature(param));
|
||||
}
|
||||
}
|
||||
|
||||
@ -343,6 +343,11 @@ public class WorkerInfo implements Serializable {
|
||||
private Integer sendSuccessStatus;
|
||||
@ApiModelProperty(value = "退场的安全分数")
|
||||
private Double exitSafeScore;
|
||||
@ApiModelProperty(value = "人员性质")
|
||||
private Integer workerNature;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "人员性质")
|
||||
private String workerNatureName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "人脸分数")
|
||||
private java.lang.Integer faceScore;
|
||||
|
||||
@ -577,4 +577,12 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
|
||||
* @return
|
||||
*/
|
||||
List<TrainRecordVo> getTrainRecordsByWorkerId(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 根据人员性质统计
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getWorkerByNature(Map<String, Object> param);
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.call.HikvisionCall;
|
||||
import com.zhgd.xmgl.constant.Cts;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Company;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.DictionaryItem;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.enums.CompanyTypeEnum;
|
||||
import com.zhgd.xmgl.modules.basicdata.enums.SystemUserAccountTypeEnum;
|
||||
@ -1312,6 +1313,13 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
public Map<String, Object> viewWorkerInfoDetail(Map<String, Object> map) {
|
||||
Map<String, Object> data = new HashMap<>(16);
|
||||
EntityMap info = workerInfoMapper.viewWorkerInfoDetail(map);
|
||||
Object nature = info.get("workerNature");
|
||||
if (nature != null) {
|
||||
String workerNature = String.valueOf(nature);
|
||||
List<DictionaryItem> dictList = dictionaryItemService.getDictList("worker_nature", info.get("projectSn"));
|
||||
List<DictionaryItem> itemList = dictList.stream().filter(d -> d.getData().equals(workerNature)).collect(Collectors.toList());
|
||||
info.put("workerNatureName", itemList.size() > 0 ? itemList.get(0).getName() : "");
|
||||
}
|
||||
map.put("personSn", MapUtils.getString(info, "personSn"));
|
||||
int totalAttendanceDay = workerAttendanceMapper.getWorkerAttendanceCountDay(map);
|
||||
map.put("idCard", MapUtils.getString(info, "idCard"));
|
||||
@ -2631,6 +2639,23 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
return rtList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getWorkerByNature(Map<String, Object> param) {
|
||||
String projectSn = MapUtils.getString(param, "projectSn");
|
||||
List<WorkerInfo> workerInfos = this.list(Wrappers.<WorkerInfo>lambdaQuery()
|
||||
.eq(WorkerInfo::getProjectSn, projectSn));
|
||||
List<DictionaryItem> dictionaryItems = dictionaryItemService.getDictList("worker_nature", projectSn);
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
dictionaryItems.forEach(w -> {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("name", w.getName());
|
||||
map.put("num", workerInfos.stream().filter(i -> i.getWorkerNature() != null &&
|
||||
i.getWorkerNature().toString().equals(w.getData())).count());
|
||||
resultList.add(map);
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否合格
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user