修复
This commit is contained in:
parent
8e1aa06145
commit
70f079834e
@ -317,10 +317,11 @@ public class DownloadController {
|
|||||||
@ApiOperation(value = "按模版导出人员安全教育信息", notes = "按模版导出人员安全教育信息", httpMethod = "GET")
|
@ApiOperation(value = "按模版导出人员安全教育信息", notes = "按模版导出人员安全教育信息", httpMethod = "GET")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "workerId", value = "劳务人员ID", paramType = "query", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "workerId", value = "劳务人员ID", paramType = "query", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "projectSn", value = "劳务人员SN", paramType = "query", required = true, dataType = "String")
|
||||||
})
|
})
|
||||||
@GetMapping(value = "/exporExcelWorkerEducation")
|
@GetMapping(value = "/exporExcelWorkerEducation")
|
||||||
public void exporExcelWorkerEducation(HttpServletResponse response, String workerId, String workerEduId) {
|
public void exporExcelWorkerEducation(HttpServletResponse response, String workerId, String projectSn) {
|
||||||
workerInfoService.exporExcelWorkerEducation(response, workerId, workerEduId);
|
workerInfoService.exporExcelWorkerEducation(response, workerId, projectSn);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "题库导入模板下载", notes = "题库导入模板下载", httpMethod = "GET")
|
@ApiOperation(value = "题库导入模板下载", notes = "题库导入模板下载", httpMethod = "GET")
|
||||||
|
|||||||
@ -150,7 +150,7 @@ public class CarInfoServiceImpl extends ServiceImpl<CarInfoMapper, CarInfo> impl
|
|||||||
|
|
||||||
private void validTime(CarInfo c) {
|
private void validTime(CarInfo c) {
|
||||||
if (isReservationType(c) && DateUtil.compare(c.getReserveEndTime(), new Date()) < 0) {
|
if (isReservationType(c) && DateUtil.compare(c.getReserveEndTime(), new Date()) < 0) {
|
||||||
throw new OpenAlertException("预约时间已过期");
|
throw new OpenAlertException("预约时间已失效,车辆无法下发,请重新提交");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -235,4 +235,7 @@ public class WorkerInfoAuditRecord implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value="保险信息")
|
@ApiModelProperty(value="保险信息")
|
||||||
private String insuranceInfo;
|
private String insuranceInfo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="下发同步状态(0:待同步;1:下发失败;)")
|
||||||
|
private Integer asyncState;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public interface IWorkerInfoAuditRecordService extends IService<WorkerInfoAuditR
|
|||||||
|
|
||||||
void editWorkerInfoAuditRecord(WorkerInfoAuditRecord workerInfoAuditRecord);
|
void editWorkerInfoAuditRecord(WorkerInfoAuditRecord workerInfoAuditRecord);
|
||||||
|
|
||||||
void adoptWorkerInfo(Map<String, Object> map);
|
Long adoptWorkerInfo(Map<String, Object> map);
|
||||||
|
|
||||||
void rejectWorkerInfo(Map<String, Object> map);
|
void rejectWorkerInfo(Map<String, Object> map);
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
|
|||||||
|
|
||||||
void exporExcelWorkerTemplate(HttpServletResponse response, String projectSn);
|
void exporExcelWorkerTemplate(HttpServletResponse response, String projectSn);
|
||||||
|
|
||||||
void exporExcelWorkerEducation(HttpServletResponse response, String workerId, String workerEduId);
|
void exporExcelWorkerEducation(HttpServletResponse response, String workerId, String projectSn);
|
||||||
|
|
||||||
Result uploadExcelWorkerInfo(MultipartFile excelFile, String projectSn);
|
Result uploadExcelWorkerInfo(MultipartFile excelFile, String projectSn);
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public class WorkerInfoAuditRecordServiceImpl extends ServiceImpl<WorkerInfoAudi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adoptWorkerInfo(Map<String, Object> map) {
|
public Long adoptWorkerInfo(Map<String, Object> map) {
|
||||||
WorkerInfoAuditRecord workerInfoAuditRecord=workerInfoAuditRecordMapper.selectById(MapUtils.getString(map,"id"));
|
WorkerInfoAuditRecord workerInfoAuditRecord=workerInfoAuditRecordMapper.selectById(MapUtils.getString(map,"id"));
|
||||||
if(workerInfoAuditRecord==null){
|
if(workerInfoAuditRecord==null){
|
||||||
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
throw new OpenAlertException(MessageUtil.get("notFindErr"));
|
||||||
@ -125,7 +125,7 @@ public class WorkerInfoAuditRecordServiceImpl extends ServiceImpl<WorkerInfoAudi
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("同步人员信息失败:" + workerInfo.getWorkerName() + e.getMessage());
|
log.error("同步人员信息失败:" + workerInfo.getWorkerName() + e.getMessage());
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
return;
|
return workerInfoAuditRecord.getId();
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(workerInfoAuditRecord.getContractInfo())) {
|
if (StringUtils.isNotBlank(workerInfoAuditRecord.getContractInfo())) {
|
||||||
List<WorkerContract> workerContracts = JSONArray.parseArray(workerInfoAuditRecord.getContractInfo(), WorkerContract.class);
|
List<WorkerContract> workerContracts = JSONArray.parseArray(workerInfoAuditRecord.getContractInfo(), WorkerContract.class);
|
||||||
@ -152,6 +152,7 @@ public class WorkerInfoAuditRecordServiceImpl extends ServiceImpl<WorkerInfoAudi
|
|||||||
}
|
}
|
||||||
//删除审核表记录
|
//删除审核表记录
|
||||||
workerInfoAuditRecordMapper.deleteById(MapUtils.getString(map,"id"));
|
workerInfoAuditRecordMapper.deleteById(MapUtils.getString(map,"id"));
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gexin.fastjson.JSON;
|
import com.gexin.fastjson.JSON;
|
||||||
|
import com.zhgd.exception.CustomException;
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||||
@ -66,6 +67,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@ -1604,14 +1606,23 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exporExcelWorkerEducation(HttpServletResponse response, String workerId, String workerEduId) {
|
public void exporExcelWorkerEducation(HttpServletResponse response, String workerId, String projectSn) {
|
||||||
Map<String, Object> requestMap = new HashMap<>();
|
Map<String, Object> requestMap = new HashMap<>();
|
||||||
requestMap.put("workerId", workerId);
|
requestMap.put("workerId", workerId);
|
||||||
EntityMap entityMap = workerInfoMapper.viewWorkerInfoDetail(requestMap);
|
EntityMap entityMap = workerInfoMapper.viewWorkerInfoDetail(requestMap);
|
||||||
|
if (entityMap == null) {
|
||||||
|
throw new CustomException("该人员信息不存在!", HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
WorkerType workerType = workerTypeMapper.selectById(entityMap.get("workerTypeId"));
|
WorkerType workerType = workerTypeMapper.selectById(entityMap.get("workerTypeId"));
|
||||||
|
List<WorkerSafeEducation> workerSafeEducations = workerSafeEducationMapper.selectList(Wrappers.<WorkerSafeEducation>lambdaQuery()
|
||||||
|
.eq(WorkerSafeEducation::getProjectSn, projectSn)
|
||||||
|
.orderByDesc(WorkerSafeEducation::getAddTime));
|
||||||
|
if (workerSafeEducations == null || workerSafeEducations.size() == 0) {
|
||||||
|
throw new CustomException("该人员未参加过入场安全教育培训!", HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
WorkerSafeEducationWorker workerSafeEducationWorker = workerSafeEducationWorkerMapper.selectOne(Wrappers.<WorkerSafeEducationWorker>lambdaQuery()
|
WorkerSafeEducationWorker workerSafeEducationWorker = workerSafeEducationWorkerMapper.selectOne(Wrappers.<WorkerSafeEducationWorker>lambdaQuery()
|
||||||
.eq(WorkerSafeEducationWorker::getId, workerEduId));
|
.eq(WorkerSafeEducationWorker::getId, workerSafeEducations.get(0).getId()));
|
||||||
ExcelUtils.exporExcelWorkerEducation(response, entityMap, workerSafeEducationWorker, workerType);
|
ExcelUtils.exporExcelWorkerEducation(response, entityMap, workerSafeEducationWorker, workerType, basePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.zhgd.xmgl.modules.xz.controller;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.sun.corba.se.pept.transport.ContactInfo;
|
import com.sun.corba.se.pept.transport.ContactInfo;
|
||||||
@ -329,7 +330,13 @@ public class XzWorkerInfoAuditRecordController {
|
|||||||
paramMap.put("ufaceDevId", ufaceDevIds);
|
paramMap.put("ufaceDevId", ufaceDevIds);
|
||||||
paramMap.put("accountType", 2);
|
paramMap.put("accountType", 2);
|
||||||
paramMap.put("registerType", 2);
|
paramMap.put("registerType", 2);
|
||||||
workerInfoAuditRecordService.adoptWorkerInfo(paramMap);
|
Long workerId = workerInfoAuditRecordService.adoptWorkerInfo(paramMap);
|
||||||
|
if (workerId != null) {
|
||||||
|
LambdaUpdateWrapper<WorkerInfoAuditRecord> wrapper = Wrappers.<WorkerInfoAuditRecord>lambdaUpdate();
|
||||||
|
wrapper.set(WorkerInfoAuditRecord::getAsyncState, 1);
|
||||||
|
wrapper.eq(WorkerInfoAuditRecord::getId, workerId);
|
||||||
|
workerInfoAuditRecordService.update(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Result.ok();
|
return Result.ok();
|
||||||
|
|||||||
@ -252,7 +252,7 @@ public class ExcelUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void exporExcelWorkerEducation(HttpServletResponse response, Map<String, Object> map, WorkerSafeEducationWorker workerSafeEducationWorker, WorkerType workerType) {
|
public static void exporExcelWorkerEducation(HttpServletResponse response, Map<String, Object> map, WorkerSafeEducationWorker workerSafeEducationWorker, WorkerType workerType, String basePath) {
|
||||||
try {
|
try {
|
||||||
ClassPathResource classPathResource = new ClassPathResource("excel/工人教育档案.xlsx");
|
ClassPathResource classPathResource = new ClassPathResource("excel/工人教育档案.xlsx");
|
||||||
InputStream inputStream = classPathResource.getInputStream();
|
InputStream inputStream = classPathResource.getInputStream();
|
||||||
@ -280,9 +280,18 @@ public class ExcelUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
picture("C:\\jxj\\prod\\backEnd\\itbgpImage\\6661637a99ad0e050669d016.jpg", sheet, 9, 15, 13, 15);
|
String idCardBigPhotoUrl = MapUtils.getString(map, "idCardBigPhotoUrl");
|
||||||
picture("C:\\jxj\\prod\\backEnd\\itbgpImage\\6661637a99ad0e050669d016.jpg", sheet, 20, 28, 1, 7);
|
if (StringUtils.isNotBlank(idCardBigPhotoUrl)) {
|
||||||
picture("C:\\jxj\\prod\\backEnd\\itbgpImage\\6661637a99ad0e050669d016.jpg", sheet, 20, 28, 9, 15);
|
picture(basePath + idCardBigPhotoUrl, sheet, 9, 15, 13, 15);
|
||||||
|
}
|
||||||
|
String idCardUpPhotoUrl = MapUtils.getString(map, "idCardUpPhotoUrl");
|
||||||
|
if (StringUtils.isNotBlank(idCardBigPhotoUrl)) {
|
||||||
|
picture(basePath + idCardUpPhotoUrl, sheet, 20, 28, 1, 7);
|
||||||
|
}
|
||||||
|
String idCardDownPhotoUrl = MapUtils.getString(map, "idCardDownPhotoUrl");
|
||||||
|
if (StringUtils.isNotBlank(idCardDownPhotoUrl)) {
|
||||||
|
picture(basePath + idCardDownPhotoUrl, sheet, 20, 28, 9, 15);
|
||||||
|
}
|
||||||
downLoadExcel("工人教育档案.xlsx", response, workbook);
|
downLoadExcel("工人教育档案.xlsx", response, workbook);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.error("error:", e);
|
log.error("error:", e);
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user