包头bug修复

This commit is contained in:
guoshengxiong 2025-01-16 20:20:55 +08:00
parent 06cb1c6bdf
commit ea23c4f2e8
22 changed files with 247 additions and 122 deletions

View File

@ -1,16 +1,14 @@
package com.zhgd.xmgl.modules.baotou.controller;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroup;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo;
import com.zhgd.xmgl.modules.baotou.service.IProjectGroupService;
import com.zhgd.xmgl.modules.baotou.service.impl.ProjectGroupServiceImpl;
import com.zhgd.xmgl.modules.project.service.IProjectEnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -29,12 +27,14 @@ import java.util.List;
public class HomeOverviewController {
@Autowired
private IProjectGroupService projectGroupService;
@Autowired
private IProjectEnterpriseService projectEnterpriseService;
@ApiOperation(value = "施工队伍单位统计", notes = "施工队伍单位统计", httpMethod = "GET")
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String")
@GetMapping(value = "/countEnterprise")
public Result<CountEnterpriseVo> countEnterprise(@ApiIgnore @RequestParam HashMap<String, Object> param) {
return Result.success(projectGroupService.countEnterprise(param));
return Result.success(projectEnterpriseService.countEnterpriseType(param));
}
@ApiOperation(value = "施工队伍单位列表", notes = "施工队伍单位列表", httpMethod = "GET")

View File

@ -1,35 +1,33 @@
package com.zhgd.xmgl.modules.baotou.mapper;
import java.util.HashMap;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.DataScope;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroup;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.zhgd.xmgl.modules.baotou.entity.ProjectGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.HashMap;
import java.util.List;
/**
* @Description: 项目组管理
* @author pds
* @date 2024-08-06
* @date 2024-08-06
* @version V1.0
*/
@Mapper
@DataScope
public interface ProjectGroupMapper extends BaseMapper<ProjectGroup> {
IPage<ProjectGroup> queryList(Page<ProjectGroup> page,@Param(Constants.WRAPPER) QueryWrapper<ProjectGroup> queryWrapper);
IPage<ProjectGroup> queryList(Page<ProjectGroup> page, @Param(Constants.WRAPPER) QueryWrapper<ProjectGroup> queryWrapper);
List<ProjectGroup> queryList(@Param(Constants.WRAPPER)QueryWrapper<ProjectGroup> queryWrapper);
CountEnterpriseVo countEnterprise(HashMap<String, Object> param);
List<ProjectGroup> queryList(@Param(Constants.WRAPPER) QueryWrapper<ProjectGroup> queryWrapper);
List<EnterpriseListVo> getEnterpriseList(HashMap<String, Object> param);
}

View File

@ -16,18 +16,6 @@
group by t.id
order by t.create_date desc
</select>
<select id="countEnterprise" resultType="com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo">
select
count(distinct ei.id) as epc,
count(distinct ei2.id) as supervise,
count(distinct ei3.id) as construction
from project_group t
join project_group_unit pgu on t.id = pgu.project_group_id
join enterprise_info ei on ei.id=pgu.epc_contractor_id
join enterprise_info ei2 on ei2.id=pgu.supervising_unit_id
join enterprise_info ei3 on find_in_set(ei3.id,pgu.construction_unit_ids)
where t.project_sn=#{projectSn}
</select>
<select id="getEnterpriseList" resultType="com.zhgd.xmgl.modules.baotou.entity.vo.EnterpriseListVo">
select

View File

@ -207,6 +207,12 @@ public class XzSecurityQualityInspectionRecordServiceImpl extends ServiceImpl<Xz
return null;
}
setProblemDescription(vo);
ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, vo.getInstanceId());
List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
if (CollUtil.isNotEmpty(progress)) {
String nodeId = progress.get(progress.size() - 1).getNodeId();
vo.setNodeId(nodeId);
}
return vo;
}

View File

@ -59,8 +59,6 @@ public interface IProjectGroupService extends IService<ProjectGroup> {
ProjectGroupEnterpriseVo getProjectGroupEnterpriseList(HashMap<String, Object> param);
CountEnterpriseVo countEnterprise(HashMap<String, Object> param);
List<EnterpriseListVo> getEnterpriseList(HashMap<String, Object> param);
List<Map<String ,Object>> getTreeList(HashMap<String, Object> param);

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.baotou.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -22,7 +23,9 @@ import com.zhgd.xmgl.util.FlowUtil;
import com.zhgd.xmgl.util.PageUtil;
import com.zhgd.xmgl.util.RefUtil;
import org.apache.commons.collections.MapUtils;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -49,6 +52,8 @@ public class CivilizeConstructionServiceImpl extends ServiceImpl<CivilizeConstru
private ProcessInstanceService processService;
@Autowired
private IWorkerInfoService workerInfoService;
@Autowired
private HistoryService historyService;
@Override
public IPage<CivilizeConstruction> queryPageList(HashMap<String, Object> param) {
@ -109,6 +114,12 @@ public class CivilizeConstructionServiceImpl extends ServiceImpl<CivilizeConstru
if (entity == null) {
throw new OpenAlertException("未找到对应实体");
}
ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, entity.getInstanceId());
List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
if (CollUtil.isNotEmpty(progress)) {
String nodeId = progress.get(progress.size() - 1).getNodeId();
entity.setNodeId(nodeId);
}
return entity;
}

View File

@ -204,10 +204,6 @@ public class ProjectGroupServiceImpl extends ServiceImpl<ProjectGroupMapper, Pro
return vo;
}
@Override
public CountEnterpriseVo countEnterprise(HashMap<String, Object> param) {
return baseMapper.countEnterprise(param);
}
@Override
public List<EnterpriseListVo> getEnterpriseList(HashMap<String, Object> param) {

View File

@ -1,5 +1,4 @@
package com.zhgd.xmgl.modules.baotou.service.impl;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@ -20,6 +19,7 @@ import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @Description: 宣传视频
@ -36,7 +36,7 @@ public class PromotionalVideoServiceImpl extends ServiceImpl<PromotionalVideoMap
public IPage<PromotionalVideo> queryPageList(HashMap<String, Object> param) {
QueryWrapper<PromotionalVideo> queryWrapper = this.getQueryWrapper(param);
Page<PromotionalVideo> page = PageUtil.getPage(param);
IPage<PromotionalVideo> pageList = baseMapper.queryList(page, queryWrapper,param);
IPage<PromotionalVideo> pageList = baseMapper.queryList(page, queryWrapper, param);
pageList.setRecords(this.dealList(pageList.getRecords()));
return pageList;
}
@ -44,12 +44,12 @@ public class PromotionalVideoServiceImpl extends ServiceImpl<PromotionalVideoMap
@Override
public List<PromotionalVideo> queryList(HashMap<String, Object> param) {
QueryWrapper<PromotionalVideo> queryWrapper = getQueryWrapper(param);
return dealList(baseMapper.queryList(queryWrapper,param));
return dealList(baseMapper.queryList(queryWrapper, param));
}
private QueryWrapper<PromotionalVideo> getQueryWrapper(HashMap<String, Object> param) {
QueryWrapper<PromotionalVideo> queryWrapper = QueryGenerator.initPageQueryWrapper(PromotionalVideo.class, param, true);
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(PromotionalVideo::getIsPin),RefUtil.fieldNameUlc(PromotionalVideo::getId));
queryWrapper.orderByDesc(RefUtil.fieldNameUlc(PromotionalVideo::getIsPin), RefUtil.fieldNameUlc(PromotionalVideo::getId));
return queryWrapper;
}
@ -104,11 +104,14 @@ public class PromotionalVideoServiceImpl extends ServiceImpl<PromotionalVideoMap
@Override
public void addFromFlow(Map<String, Object> map) {
PromotionalVideo e = new PromotionalVideo();
e.setVideoName(FlowUtil.getString(map,"videoName"));
e.setAttachmentUrl(FlowUtil.getFileUrl(map,"attachmentUrl"));
e.setAttachmentFileName(FlowUtil.getFileUrl(map,"attachmentFileName"));
e.setIsPin(FlowUtil.getPullDownInteger(map,"isPin"));
e.setProjectSn(FlowUtil.getString(map,"projectSn"));
e.setVideoName(FlowUtil.getString(map, "videoName"));
e.setAttachmentUrl(FlowUtil.getFileUrl(map, "attachmentUrl"));
e.setAttachmentFileName(FlowUtil.getFileOriginFileName(map,"attachmentUrl"));
e.setIsPin(FlowUtil.getPullDownInteger(map, "isPin"));
e.setProjectSn(FlowUtil.getString(map, "projectSn"));
if (Objects.equals(e.getIsPin(), 1)) {
baseMapper.update(null, new LambdaUpdateWrapper<PromotionalVideo>().set(PromotionalVideo::getIsPin, 0).eq(PromotionalVideo::getProjectSn, e.getProjectSn()));
}
baseMapper.insert(e);
}

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.baotou.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -157,6 +158,12 @@ public class QualityProblemServiceImpl extends ServiceImpl<QualityProblemMapper,
if (entity == null) {
throw new OpenAlertException("未找到对应实体");
}
ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, entity.getInstanceId());
List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
if (CollUtil.isNotEmpty(progress)) {
String nodeId = progress.get(progress.size() - 1).getNodeId();
entity.setNodeId(nodeId);
}
return entity;
}

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.baotou.service.impl;
import java.util.Date;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -157,6 +158,12 @@ public class QualitySuperviseServiceImpl extends ServiceImpl<QualitySuperviseMap
if (entity == null) {
throw new OpenAlertException("未找到对应实体");
}
ProcessProgressVo instanceProgress = processService.getInstanceProgress(null, entity.getInstanceId());
List<ProcessProgressVo.ProgressNode> progress = instanceProgress.getProgress();
if (CollUtil.isNotEmpty(progress)) {
String nodeId = progress.get(progress.size() - 1).getNodeId();
entity.setNodeId(nodeId);
}
return entity;
}

View File

@ -997,7 +997,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
if (count > 0) {
throw new OpenAlertException(MessageUtil.get("existsAccountErr"));
}
String password = systemUser.getPassword();
String password = systemUser.getShowPassword();
if (StringUtils.isEmpty(password)) {
throw new OpenAlertException(MessageUtil.get("passwordEmptyErr"));
}

View File

@ -1,5 +1,4 @@
package com.zhgd.xmgl.modules.file.service.impl;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zhgd.jeecg.common.execption.OpenAlertException;
@ -15,9 +14,10 @@ import com.zhgd.xmgl.modules.file.entity.ProjectFile;
import com.zhgd.xmgl.modules.file.mapper.ProjectFileMapper;
import com.zhgd.xmgl.modules.file.service.IFiletransferService;
import com.zhgd.xmgl.security.util.SecurityUtils;
import com.zhgd.xmgl.util.MinioUtils;
import com.zhgd.xmgl.util.PathUtil;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
@ -27,16 +27,18 @@ import java.util.Objects;
@Service
public class FiletransferServiceImpl implements IFiletransferService {
// @Value("${basePath}")
// private String basePath;
@Autowired
MinioUtils minioUtils;
@Autowired
private ProjectFileMapper projectFileMapper;
@Autowired
private ProjectFileAuthMapper projectFileAuthMapper;
// @Value("${basePath}")
// private String basePath;
@Override
public void uploadFile(HttpServletRequest request, UploadFileDTO uploadFileDTO) {
public void
uploadFile(HttpServletRequest request, UploadFileDTO uploadFileDTO) {
UploadFile uploadFile = new UploadFile();
uploadFile.setChunkNumber(uploadFileDTO.getChunkNumber());
uploadFile.setChunkSize(uploadFileDTO.getChunkSize());
@ -45,42 +47,43 @@ public class FiletransferServiceImpl implements IFiletransferService {
uploadFile.setTotalSize(uploadFileDTO.getTotalSize());
uploadFile.setCurrentChunkSize(uploadFileDTO.getCurrentChunkSize());
Uploader uploader = new ChunkUploaderFactory().getUploader(uploadFile);
// List<UploadFile> uploadFileList = uploader.upload(request, basePath);
// checkParams(uploadFileDTO, uploadFile);
// for (int i = 0; i < uploadFileList.size(); i++) {
// uploadFile = uploadFileList.get(i);
// if (uploadFile.getSuccess() == 1) {
// ProjectFile userFile = new ProjectFile();
// userFile.setExtendName(uploadFile.getFileType());
// userFile.setFileName(uploadFile.getFileName());
// userFile.setFilePath(uploadFileDTO.getFilePath());
// userFile.setProjectSn(uploadFileDTO.getProjectSn());
// userFile.setIsDir(0);
// userFile.setFileUrl(uploadFile.getUrl());
// userFile.setFileSize(uploadFile.getFileSize() + "");
// userFile.setUploadTime(DateUtil.getCurrentTime());
// projectFileMapper.insert(userFile);
// if (SecurityUtils.getUser() != null) {
// if (Objects.equals(SystemUserAccountTypeEnum.PROJECT_SUB_ACCOUNT.getValue(), SecurityUtils.getUser().getAccountType())) {
// Long userId = SecurityUtils.getUser().getUserId();
// ProjectFileAuth auth = new ProjectFileAuth();
// auth.setIsUpload(1);
// auth.setIsCreateNewFolder(1);
// auth.setIsPreview(1);
// auth.setIsSetPermission(1);
// auth.setIsDelete(1);
// auth.setIsMove(1);
// auth.setIsRename(1);
// auth.setIsDownload(1);
// auth.setIsView(1);
// auth.setProjectFileId(userFile.getFileId());
// auth.setUserId(userId);
// auth.setProjectSn(uploadFileDTO.getProjectSn());
// projectFileAuthMapper.insert(auth);
// }
// }
// }
// }
checkParams(uploadFileDTO, uploadFile);
List<UploadFile> uploadFileList = uploader.upload(request, PathUtil.getBasePath() + "/");
minioUtils.uploadBySameName(uploadFile.getUrl());
for (int i = 0; i < uploadFileList.size(); i++) {
uploadFile = uploadFileList.get(i);
if (uploadFile.getSuccess() == 1) {
ProjectFile userFile = new ProjectFile();
userFile.setExtendName(uploadFile.getFileType());
userFile.setFileName(uploadFile.getFileName());
userFile.setFilePath(uploadFileDTO.getFilePath());
userFile.setProjectSn(uploadFileDTO.getProjectSn());
userFile.setIsDir(0);
userFile.setFileUrl(uploadFile.getUrl());
userFile.setFileSize(uploadFile.getFileSize() + "");
userFile.setUploadTime(DateUtil.getCurrentTime());
projectFileMapper.insert(userFile);
if (SecurityUtils.getUser() != null) {
if (Objects.equals(SystemUserAccountTypeEnum.PROJECT_SUB_ACCOUNT.getValue(), SecurityUtils.getUser().getAccountType())) {
Long userId = SecurityUtils.getUser().getUserId();
ProjectFileAuth auth = new ProjectFileAuth();
auth.setIsUpload(1);
auth.setIsCreateNewFolder(1);
auth.setIsPreview(1);
auth.setIsSetPermission(1);
auth.setIsDelete(1);
auth.setIsMove(1);
auth.setIsRename(1);
auth.setIsDownload(1);
auth.setIsView(1);
auth.setProjectFileId(userFile.getFileId());
auth.setUserId(userId);
auth.setProjectSn(uploadFileDTO.getProjectSn());
projectFileAuthMapper.insert(auth);
}
}
}
}
}
private void checkParams(UploadFileDTO uploadFileDTO, UploadFile uploadFile) {

View File

@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.project.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import com.zhgd.xmgl.modules.xz.entity.XzProjectOrg;
@ -10,6 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -87,4 +89,12 @@ public interface ProjectEnterpriseMapper extends BaseMapper<ProjectEnterprise> {
* @return
*/
List<XzProjectOrg> getChildren(Long id);
/**
* 统计epc监理施工的单位的数量
*
* @param param
* @return
*/
CountEnterpriseVo countEnterpriseType(HashMap<String, Object> param);
}

View File

@ -231,4 +231,14 @@
select * from project_enterprise
where find_in_set(#{id}, ancestors)
</select>
<select id="countEnterpriseType" resultType="com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo">
select
ifnull(sum(if(pe.enterprise_type_id=3,1,0)),0) as epc
,ifnull(sum(if(pe.enterprise_type_id=7,1,0)),0) as supervise
,ifnull(sum(if(pe.enterprise_type_id=11,1,0)),0) as construction
from enterprise_info ei
join project_enterprise pe on pe.enterprise_id=ei.id
where pe.project_sn=#{projectSn}
</select>
</mapper>

View File

@ -3,9 +3,11 @@ package com.zhgd.xmgl.modules.project.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -83,4 +85,10 @@ public interface IProjectEnterpriseService extends IService<ProjectEnterprise> {
*/
void deleteBatch(Map<String, Object> map);
/**
* 施工队伍单位统计
* @param param
* @return
*/
CountEnterpriseVo countEnterpriseType(HashMap<String, Object> param);
}

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.execption.OpenAlertException;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.constant.Cts;
import com.zhgd.xmgl.modules.baotou.entity.vo.CountEnterpriseVo;
import com.zhgd.xmgl.modules.basicdata.enums.SystemUserAccountTypeEnum;
import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise;
import com.zhgd.xmgl.modules.project.mapper.ProjectEnterpriseMapper;
@ -221,4 +222,11 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
delete(id);
}
}
@Override
public CountEnterpriseVo countEnterpriseType(HashMap<String, Object> param) {
return baseMapper.countEnterpriseType(param);
}
}

View File

@ -777,7 +777,7 @@ public class WorkerInfoController {
return Result.success(workerInfoService.getTrainRecordsByWorkerId(param));
}
@ApiOperation(value = "人员区域分类统计", notes = "人员区域分类统计", httpMethod = "POST")
@ApiOperation(value = "劳务管理", notes = "人员区域分类统计", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
})
@ -786,7 +786,7 @@ public class WorkerInfoController {
return Result.success(workerInfoService.countDeviceUnit(map));
}
@ApiOperation(value = "按岗位分析", notes = "按岗位分析", httpMethod = "POST")
@ApiOperation(value = "劳务管理", notes = "按岗位分析", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
})
@ -795,5 +795,16 @@ public class WorkerInfoController {
return Result.success(workerInfoService.countDeviceUnit(map));
}
@ApiOperation(value = "劳务管理", notes = "查询岗位(工种)列表(对应原来的劳务工种、管理部门)", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
@ApiImplicitParam(name = "enterpriseId", value = "企业id", paramType = "body", required = true, dataType = "String"),
})
@PostMapping(value = "/getPostWorkTypeList")
public Result<List<HashMap<String ,Object>>> getPostWorkTypeList(@RequestBody Map<String, Object> map) {
return Result.success(workerInfoService.getPostWorkTypeList(map));
}
}

View File

@ -357,6 +357,8 @@ public class WorkerInfo implements Serializable {
private java.lang.String entryDeadline;
@ApiModelProperty(value = "EPC承包商")
private java.lang.Long epcCbs;
@ApiModelProperty(value = "包头部门")
private java.lang.String btDepartment;
@TableField(exist = false)
@ApiModelProperty(value = "人脸分数")
private java.lang.Integer faceScore;
@ -431,6 +433,9 @@ public class WorkerInfo implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "EPC承包商名称")
private java.lang.String epcCbsName;
@TableField(exist = false)
@ApiModelProperty(value = "工种id")
private java.lang.Long workerTypeId;
public String toExistString() {
return "WorkerInfo{" +
", workerName='" + workerName + '\'' +

View File

@ -3,9 +3,15 @@
<mapper namespace="com.zhgd.xmgl.modules.worker.mapper.DepartmentInfoMapper">
<select id="getDepartmentInfoList" resultType="com.zhgd.xmgl.modules.worker.entity.DepartmentInfo" parameterType="map">
SELECT a.*,IFNULL(b.worker_num,0) worker_num
from department_info a LEFT JOIN
(SELECT department_id,COUNT(1) worker_num FROM worker_info
SELECT a.*
,IFNULL(b.worker_num,0) worker_num
,ei.enterprise_name
from department_info a
LEFT JOIN enterprise_info ei on ei.id = a.enterprise_id
LEFT JOIN (SELECT
department_id
,COUNT(1) worker_num
FROM worker_info
WHERE project_sn=#{projectSn}
<if test="personType != null and personType != ''">
and person_type = #{personType}

View File

@ -588,4 +588,6 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
SectorVo countDeviceUnit(Map<String, Object> map);
void updateWorkerEnter(WorkerInfo workerInfo);
List<HashMap<String ,Object>> getPostWorkTypeList(Map<String, Object> map);
}

View File

@ -500,6 +500,28 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
if (count2 > 0) {
throw new OpenAlertException(MessageUtil.get("AttendanceCardExistErr"));
}
//如果没有传班组id则通过工种相同名字生成一个班组
if (workerInfo.getPersonType() == 1) {
if (workerInfo.getTeamId() != null) {
WorkerType workerType = workerTypeService.getById(workerInfo.getWorkerTypeId());
List<TeamInfo> teamInfos = teamInfoService.list(new LambdaQueryWrapper<TeamInfo>()
.eq(TeamInfo::getProjectSn, workerInfo.getProjectSn())
.eq(TeamInfo::getEnterpriseId, workerInfo.getEnterpriseId())
.eq(TeamInfo::getTeamName, workerType.getTypeName()));
if (CollUtil.isEmpty(teamInfos)) {
TeamInfo teamInfo = new TeamInfo();
teamInfo.setTeamName(workerType.getTypeName());
teamInfo.setWorkerTypeId(workerInfo.getWorkerTypeId());
teamInfo.setProjectSn(workerInfo.getProjectSn());
teamInfo.setTeamSn(UUID.randomUUID().toString().replace("-", "").toUpperCase());
teamInfo.setEnterpriseId(workerInfo.getEnterpriseId());
teamInfoService.saveTeamInfo(teamInfo);
workerInfo.setTeamId(teamInfo.getId());
} else {
workerInfo.setTeamId(teamInfos.get(0).getId());
}
}
}
String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
workerInfo.setPersonSn(uuid);
workerInfo.setAddTime(new Date());
@ -2935,6 +2957,30 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
this.editWorkerInfo(workerInfo);
}
@Override
public List<HashMap<String, Object>> getPostWorkTypeList(Map<String, Object> map) {
String projectSn = MapUtils.getString(map, "projectSn");
String enterpriseId = MapUtils.getString(map, "enterpriseId");
List<HashMap<String, Object>> maps = workerTypeService.list(new LambdaQueryWrapper<WorkerType>()
.eq(WorkerType::getProjectSn, projectSn)).stream().map(workerType -> {
HashMap<String, Object> map1 = new HashMap<>();
map1.put("id", workerType.getId());
map1.put("name", workerType.getTypeName());
map1.put("personType", 1);
return map1;
}).collect(Collectors.toList());
List<HashMap<String, Object>> maps1 = departmentInfoService.list(new LambdaQueryWrapper<DepartmentInfo>()
.eq(DepartmentInfo::getProjectSn, projectSn).eq(StrUtil.isNotBlank(enterpriseId), DepartmentInfo::getEnterpriseId, enterpriseId)).stream().map(dp -> {
HashMap<String, Object> map1 = new HashMap<>();
map1.put("id", dp.getId());
map1.put("name", dp.getDepartmentName());
map1.put("personType", 2);
return map1;
}).collect(Collectors.toList());
maps.addAll(maps1);
return maps;
}
/**
* 获取是否合格
*

View File

@ -37,6 +37,22 @@ public class MinioUtils {
@Value("${spring.file-storage.minio[0].bucket-name:}")
private String bucketName;
/**
* 从mino下载到本地文件
*
* @param path 文件后面的路径不要桶677219be3215a4045d74714f.xlsx
* @return
*/
public static File downloadFile(String path) {
File file = new File(PathUtil.getBasePath() + "/" + path);
try {
HttpUtil.download(PathUtil.getDomain() + path, new FileOutputStream(file), true);
} catch (FileNotFoundException e) {
log.error("" + e);
}
return file;
}
@PostConstruct
public void createBucket() {
existBucket(bucketName);
@ -76,24 +92,6 @@ public class MinioUtils {
return true;
}
/**
* 删除存储bucket
*
* @param bucketName 存储bucket名称
* @return Boolean
*/
public Boolean removeBucket(String bucketName) {
try {
minioClient.removeBucket(RemoveBucketArgs.builder()
.bucket(bucketName)
.build());
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
/**
* description: 下载文件
*
@ -220,6 +218,24 @@ public class MinioUtils {
// return results;
// }
/**
* 删除存储bucket
*
* @param bucketName 存储bucket名称
* @return Boolean
*/
public Boolean removeBucket(String bucketName) {
try {
minioClient.removeBucket(RemoveBucketArgs.builder()
.bucket(bucketName)
.build());
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
/**
* 删除文件
*
@ -237,25 +253,11 @@ public class MinioUtils {
}
/**
* 从mino下载到本地文件
* 上传本地文件到minio
*
* @param path 文件后面的路径不要桶677219be3215a4045d74714f.xlsx
* @return
*/
public static File downloadFile(String path) {
File file = new File(PathUtil.getBasePath() + "/" + path);
try {
HttpUtil.download(PathUtil.getDomain() + path, new FileOutputStream(file), true);
} catch (FileNotFoundException e) {
log.error("" + e);
}
return file;
}
/**
* @param path 文件后面的路径不要桶677219be3215a4045d74714f.xlsx
* @return
*/
public String uploadGetName(String path) {
String savePath;
if (!path.contains(separator)) {