提交 f3833cc9 authored 作者: 133's avatar 133

[zjm] zjm负责的模块代码提交

上级 8f8e8cd2
...@@ -184,10 +184,10 @@ public enum LogType { ...@@ -184,10 +184,10 @@ public enum LogType {
SEND_BACK_23(100013,SEND_BACK.id, SEND_BACK_1212.id,END.id , "清退统计任务已办结"), SEND_BACK_23(100013,SEND_BACK.id, SEND_BACK_1212.id,END.id , "清退统计任务已办结"),
SEND_BACK_24(100014,SEND_BACK_STATISTICAL.id, SEND_BACK_1204.id,SEND_BACK_1212.id , "市清退统计任务待办结"), SEND_BACK_24(100014,SEND_BACK_STATISTICAL.id, SEND_BACK_1204.id,SEND_BACK_1212.id , "市清退统计任务待办结"),
SEND_BACK_25(100015,SEND_BACK_STATISTICAL.id, SEND_BACK_1200.id,SEND_BACK_1212.id , "省清退统计任务待办结"), SEND_BACK_25(100015,SEND_BACK_STATISTICAL.id, SEND_BACK_1200.id,SEND_BACK_1212.id , "省清退统计任务待办结"),
SEND_BACK_26(100016,SEND_BACK.id, SEND_BACK_1214.id,END.id , "清退装备任务,上传了回执单据"), SEND_BACK_26(100016,SEND_BACK.id, SEND_BACK_1214.id,END.id , "清退装备任务,上传了回执单据,任务结束"),
SEND_BACK_27(100017,SEND_BACK.id, SEND_BACK_1202.id,SEND_BACK_1213.id , "省直属单位清退装备选择完成,等待签字单据上传"), SEND_BACK_27(100017,SEND_BACK.id, SEND_BACK_1202.id,SEND_BACK_1213.id , "省直属单位清退装备选择完成,等待签字单据上传"),
SEND_BACK_28(100018,SEND_BACK.id, SEND_BACK_1213.id,END.id , "上传了直属单位清退签字单据"), SEND_BACK_28(100018,SEND_BACK.id, SEND_BACK_1213.id,END.id , "上传了直属单位清退签字单据"),
SEND_BACK_29(100019,SEND_BACK.id, SEND_BACK_1209.id,SEND_BACK_1215.id , "单据未上传,继续等待单据上传"), SEND_BACK_29(100019,SEND_BACK.id, SEND_BACK_1209.id,SEND_BACK_1215.id , "单据未上传,继续等待签收单据上传"),
SEND_BACK_30(100020,SEND_BACK.id, SEND_BACK_1208.id,SEND_BACK_1217.id , "调用电子签章,等待审核"), SEND_BACK_30(100020,SEND_BACK.id, SEND_BACK_1208.id,SEND_BACK_1217.id , "调用电子签章,等待审核"),
SEND_BACK_31(100021,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1219.id , "电之签章调用审核通过,等待盖章出库"), SEND_BACK_31(100021,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1219.id , "电之签章调用审核通过,等待盖章出库"),
SEND_BACK_32(100022,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1208.id , "电之签章调用审核不通过,等待重新出库"), SEND_BACK_32(100022,SEND_BACK.id, SEND_BACK_1217.id,SEND_BACK_1208.id , "电之签章调用审核不通过,等待重新出库"),
...@@ -199,6 +199,7 @@ public enum LogType { ...@@ -199,6 +199,7 @@ public enum LogType {
SEND_BACK_38(100028,SEND_BACK.id, SEND_BACK_1203.id,END.id , "本次提交任务无装备,任务结束"), SEND_BACK_38(100028,SEND_BACK.id, SEND_BACK_1203.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_39(100029,SEND_BACK.id, SEND_BACK_1206.id,END.id , "本次提交任务无装备,任务结束"), SEND_BACK_39(100029,SEND_BACK.id, SEND_BACK_1206.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_40(100030,SEND_BACK.id, SEND_BACK_1208.id,END.id , "本次提交任务无装备,任务结束"), SEND_BACK_40(100030,SEND_BACK.id, SEND_BACK_1208.id,END.id , "本次提交任务无装备,任务结束"),
SEND_BACK_41(100031,SEND_BACK.id, SEND_BACK_1215.id,END.id , "清退装备任务,上传了签收单据,任务结束"),
......
...@@ -197,7 +197,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe ...@@ -197,7 +197,7 @@ public class DeviceDestroyBusinessServiceImpl implements DeviceDestroyBusinessSe
List<Integer> userIds = new ArrayList<>(); List<Integer> userIds = new ArrayList<>();
userIds.add(userId); userIds.add(userId);
userIds.add(0); userIds.add(0);
return taskService.start(new TaskBto(StatusEnum.DESTROY_2.id, "销毁设备任务", null, ".", repelDetailId, BusinessEnum.DESTROY.id, unitId, 1, "country", userIds)); return taskService.start(new TaskBto(StatusEnum.DESTROY_2.id, "销毁设备任务", null, ".", repelDetailId, BusinessEnum.DESTROY.id, unitId, 1, "", userIds));
} }
private List<String> scriptListToStringList(DeviceDestroyBillVo deviceDestroyBillVo){ private List<String> scriptListToStringList(DeviceDestroyBillVo deviceDestroyBillVo){
......
...@@ -11,6 +11,7 @@ import org.springframework.util.ResourceUtils; ...@@ -11,6 +11,7 @@ import org.springframework.util.ResourceUtils;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*; import java.io.*;
import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.UUID; import java.util.UUID;
...@@ -100,22 +101,69 @@ public class UseReportFIleServiceImpl implements UseReportFIleService { ...@@ -100,22 +101,69 @@ public class UseReportFIleServiceImpl implements UseReportFIleService {
@Override @Override
public void download(String url, String name, HttpServletResponse response, HttpServletRequest httpServletRequest) { public void download(String url, String name, HttpServletResponse response, HttpServletRequest httpServletRequest) {
String fileName = name;
// response.setHeader("content-type", "application/octet-stream"); // response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/x-download"); // response.setContentType("application/x-download");
// try {
// response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("utf-8"), "utf-8"));
// } catch (UnsupportedEncodingException e) {
// e.printStackTrace();
// }
//
// setFileDownloadHeader(httpServletRequest, response, fileName);
// OutputStream os = null;
// InputStream is = null;
// BufferedInputStream bs = null;
// byte[] buffer = new byte[1024];
// try {
// is = new FileInputStream(new File(url));
// bs = new BufferedInputStream(is);
// os = response.getOutputStream();
// int i = bs.read(buffer);
// while (i != -1) {
// os.write(buffer, 0, i);
// i = bs.read(buffer);
// }
// os.flush();
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// } finally {
// try {
// if (bs!=null) {
// bs.close();
// }
// if (is != null) {
// is.close();
// }
// if (os != null) {
// os.close();
// }
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
if(name != null){
response.setHeader("content-type", "application/octet-stream");
response.setContentType("application/octet-stream");
try { try {
response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes("utf-8"), "utf-8")); response.setHeader("Content-Disposition", "attachment;filename="+new String(name.getBytes("utf-8"),"utf-8"));
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
e.printStackTrace(); e.printStackTrace();
} }
File file = new File(url);
setFileDownloadHeader(httpServletRequest, response, fileName); long fileLength = file.length();
response.setHeader("Content-Length", fileLength + "");
//如果文件存在,返回文件,文件不存在,返回文件不存在提示
if(fileLength != 0 ){
setFileDownloadHeader(httpServletRequest,response,name);
OutputStream os = null; OutputStream os = null;
InputStream is = null; InputStream is = null;
BufferedInputStream bs = null; BufferedInputStream bs = null;
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
try { try {
is = new FileInputStream(new File(url)); is = new FileInputStream(file);
bs = new BufferedInputStream(is); bs = new BufferedInputStream(is);
os = response.getOutputStream(); os = response.getOutputStream();
int i = bs.read(buffer); int i = bs.read(buffer);
...@@ -124,26 +172,35 @@ public class UseReportFIleServiceImpl implements UseReportFIleService { ...@@ -124,26 +172,35 @@ public class UseReportFIleServiceImpl implements UseReportFIleService {
i = bs.read(buffer); i = bs.read(buffer);
} }
os.flush(); os.flush();
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
log.error(file.getAbsolutePath() + "文件不存在");
e.printStackTrace(); e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
//log.error(file.getAbsolutePath() + "文件读取异常");
log.error(file.getAbsolutePath() + "文件用户终止下载");
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
try { try {
if (bs!=null) {
bs.close(); bs.close();
}
if (is != null) {
is.close(); is.close();
}
if (os != null) {
os.close(); os.close();
}
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); log.error("用户终止下载");
//e.printStackTrace();
} }
} }
}else {
log.info(url + "该文件不存在");
} }
}else {
log.error("请求的文件名为空");
}
}
/** /**
* 解决中文名称 * 解决中文名称
......
...@@ -109,11 +109,17 @@ public class DeviceRepel extends BaseEntity { ...@@ -109,11 +109,17 @@ public class DeviceRepel extends BaseEntity {
private String seqNumbers; private String seqNumbers;
/** /**
* type为123时使用 * 导入申请任务使用 市下面区县单位对象
*/ */
@Column(name = "equipment_involving_unit",columnDefinition = "TEXT") @Column(name = "equipment_involving_unit",columnDefinition = "TEXT")
private String equipmentInvolvingUnit; private String equipmentInvolvingUnit;
/**
* 市下面区县单位装备id集合
*/
@Column(name = "equipment_involving_unit_dev_ids",columnDefinition = "TEXT")
private String equipmentInvolvingUnitDevIds;
/** /**
* 清退任务是否办结 * 清退任务是否办结
*/ */
......
...@@ -137,16 +137,21 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -137,16 +137,21 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
deviceRepel.setFielding(StringUtils.ListToString(deviceRepel.getFieldingIds())); deviceRepel.setFielding(StringUtils.ListToString(deviceRepel.getFieldingIds()));
deviceRepel.setTaskScope(StringUtils.ListToString(deviceRepel.getTaskScopes())); deviceRepel.setTaskScope(StringUtils.ListToString(deviceRepel.getTaskScopes()));
deviceRepel.setFiles(FilesUtil.stringFileToList(deviceRepel.getFileRets())); deviceRepel.setFiles(FilesUtil.stringFileToList(deviceRepel.getFileRets()));
Map<String,Integer> unitNameMap=new HashMap<>(); Map<String,List<Integer>> unitNameMap=new HashMap<>();
List<Integer> ids=new ArrayList<>();
List<String> seqNumbers=DeviceSeqUtil.selectDeviceSeqs(deviceRepel.getSeqNumbers()); List<String> seqNumbers=DeviceSeqUtil.selectDeviceSeqs(deviceRepel.getSeqNumbers());
if (seqNumbers.size()!=0){ if (seqNumbers.size()!=0){
log.info("申请任务触发清退任务"); log.info("申请任务触发清退任务");
deviceLibraryService.findAllBySeqNumber(seqNumbers).forEach( deviceLibraryService.findAllBySeqNumber(seqNumbers).forEach(
deviceLibrary -> { deviceLibrary -> {
if (!unitNameMap.containsKey(deviceLibrary.getOwnUnit())){ if (unitNameMap.containsKey(deviceLibrary.getOwnUnit())){
unitNameMap.put(deviceLibrary.getOwnUnit(),0); List<Integer> ids =unitNameMap.get(deviceLibrary.getOwnUnit());
ids.add(deviceLibrary.getId());
unitNameMap.put(deviceLibrary.getOwnUnit(),ids);
}else {
List<Integer> ids =new ArrayList<>();
ids.add(deviceLibrary.getId());
unitNameMap.put(deviceLibrary.getOwnUnit(),ids);
} }
} }
); );
...@@ -185,6 +190,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -185,6 +190,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
List<Integer> unitList=new ArrayList<>(); List<Integer> unitList=new ArrayList<>();
unitList.addAll(supervisorMap.keySet()); unitList.addAll(supervisorMap.keySet());
deviceRepel.setTaskScopes(unitList); deviceRepel.setTaskScopes(unitList);
// deviceRepel.setEquipmentInvolvingUnitDevIds(JacksonUtil.toJSon(unitNameMap));
deviceRepel.setEquipmentInvolvingUnit(JacksonUtil.toJSon(supervisorMap)); deviceRepel.setEquipmentInvolvingUnit(JacksonUtil.toJSon(supervisorMap));
} }
DeviceRepel deviceRepel1= deviceRepelService.saveDeviceRepel(deviceRepel); DeviceRepel deviceRepel1= deviceRepelService.saveDeviceRepel(deviceRepel);
...@@ -195,7 +201,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -195,7 +201,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
//给本单位其他专管员阅知 //给本单位其他专管员阅知
// addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"发起清退任务["+deviceRepel1.getTitle()+"]",gainThisUser(userId,units.getUnitId()))); // addMessage(new MessageBto(taskBto.getId(),taskBto.getBusinessType(),user.getName()+"发起清退任务["+deviceRepel1.getTitle()+"]",gainThisUser(userId,units.getUnitId())));
List<RepelTaskStatistical> list=new ArrayList<>(); List<RepelTaskStatistical> list=new ArrayList<>();
deviceRepel.getTaskScopes().forEach( deviceRepel.getTaskScopes().forEach(
unisId-> { unisId-> {
Units units1 = unitsService.findById(unisId); Units units1 = unitsService.findById(unisId);
...@@ -203,6 +208,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -203,6 +208,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
if (units1.getType() == 2) { if (units1.getType() == 2) {
directlUnderUnit.set(true); directlUnderUnit.set(true);
directlUnderUnitNames.add(units1.getName()); directlUnderUnitNames.add(units1.getName());
// directlUnderUnitDeviceIds.addAll(unitNameMap.get(units1.getName()));
} else if (units1.getType() == 1) { } else if (units1.getType() == 1) {
Area area1 = areaService.findByid(units1.getAreaId()); Area area1 = areaService.findByid(units1.getAreaId());
deviceRepelDetail.setSendUnit(units1.getName()); deviceRepelDetail.setSendUnit(units1.getName());
...@@ -211,6 +217,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -211,6 +217,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
long time=System.currentTimeMillis(); long time=System.currentTimeMillis();
Integer count=deviceLibraryService.countAllRepel(deviceRepel.getFieldingIds(),unitsService.findBySubordinateUnitName(units1.getUnitId()), seqNumbers,lifeStatus); Integer count=deviceLibraryService.countAllRepel(deviceRepel.getFieldingIds(),unitsService.findBySubordinateUnitName(units1.getUnitId()), seqNumbers,lifeStatus);
if (count!=0) { if (count!=0) {
// deviceRepelDetail.setDeviceIds(StringUtils.ListToString(unitNameMap.get(units1.getName())));
TaskBto taskBto1 = cityRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId(), userId); TaskBto taskBto1 = cityRepelTask(unisId, deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), deviceRepel.getTitle(), taskBto.getId(), userId);
list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), "")); list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(), repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), ""));
} }
...@@ -246,7 +253,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -246,7 +253,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
private Integer repelStatusJudgeCount(Integer repelStatus,Integer count){ private Integer repelStatusJudgeCount(Integer repelStatus,Integer count){
if (repelStatus==1){ if (repelStatus==1){
return count; return 0;
}else { }else {
return 0; return 0;
} }
...@@ -280,6 +287,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -280,6 +287,7 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical); repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
taskService.moveToSpecial(currentTask,StatusEnum.SEND_BACK_1206); taskService.moveToSpecial(currentTask,StatusEnum.SEND_BACK_1206);
DeviceRepel deviceRepelCurrent=deviceRepelService.findDeviceRepel(deviceRepelDetail1.getRepelId()); DeviceRepel deviceRepelCurrent=deviceRepelService.findDeviceRepel(deviceRepelDetail1.getRepelId());
if (deviceRepelCurrent.getEquipmentInvolvingUnit()!=null){ if (deviceRepelCurrent.getEquipmentInvolvingUnit()!=null){
Map<Integer,List<SupervisorVo>> integerListMap=JacksonUtil.readValue(deviceRepelCurrent.getEquipmentInvolvingUnit(), new TypeReference<Map<Integer,List<SupervisorVo>>>() {}); Map<Integer,List<SupervisorVo>> integerListMap=JacksonUtil.readValue(deviceRepelCurrent.getEquipmentInvolvingUnit(), new TypeReference<Map<Integer,List<SupervisorVo>>>() {});
if (integerListMap.containsKey(units.getUnitId())){ if (integerListMap.containsKey(units.getUnitId())){
...@@ -311,21 +319,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -311,21 +319,6 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(),repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), "")); list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, area1.getName(),repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), ""));
} }
} }
// else {
// //添加本级清退任务
// //后面和区县的一起提交给省
// deviceRepelDetail.setId(null);
// deviceRepelDetail.setSendUnit(units.getName());
// deviceRepelDetail.setSendUnitId(units.getUnitId());
// deviceRepelDetail.setRepelType(3);
// List<String> unitNames=new ArrayList<>();
// unitNames.add(units.getName());
// Integer count=deviceLibraryService.countAllRepel(deviceRepel.getFieldingIds(),unitNames, DeviceSeqUtil.selectDeviceSeqs(deviceRepel.getSeqNumbers()),lifeStatus);
// if(count!=0) {
// TaskBto taskBto1 = cityDeclaredTask(units.getUnitId(), deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail).getId(), taskBto.getId(), units.getName(),userId);
// list.add(new RepelTaskStatistical(deviceRepel1.getId(), taskBto.getId(), taskBto1.getId(), 0, "省本级", repelStatusJudgeCount(deviceRepel.getRepelStatus(),count), ""));
// }
// }
} }
); );
if (list==null||list.size()==0){ if (list==null||list.size()==0){
...@@ -464,16 +457,17 @@ public class RepelBusinessServiceImpl implements RepelBusinessService { ...@@ -464,16 +457,17 @@ public class RepelBusinessServiceImpl implements RepelBusinessService {
DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId()); DeviceRepelDetail deviceRepelDetail= deviceRepelDetailService.findDeviceRepelDetailNoDev(taskBto.getBillId());
RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId()); RepelTaskStatistical repelTaskStatistical= repelTaskStatisticalService.findRepelTaskStatistical(taskBto.getId(),deviceRepelDetail.getRepelId());
repelTaskStatistical.setCount(resolveConfirm.getDevIds().size()); repelTaskStatistical.setCount(resolveConfirm.getDevIds().size());
repelTaskStatistical.setDes(resolveConfirm.getDes());
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
//装备状态改为锁定 //装备状态改为锁定
if (resolveConfirm.getDevIds()!=null&&resolveConfirm.getDevIds().size()!=0) { if (resolveConfirm.getDevIds()!=null&&resolveConfirm.getDevIds().size()!=0) {
deviceLibraryDao.upDateLockStatus(1, resolveConfirm.getDevIds()); deviceLibraryDao.upDateLockStatus(1, resolveConfirm.getDevIds());
} }
deviceRepelDetail.setDeviceIds(StringUtils.ListToString(resolveConfirm.getDevIds())); deviceRepelDetail.setDeviceIds(StringUtils.ListToString(resolveConfirm.getDevIds()));
if (resolveConfirm.getDes()!=null&&resolveConfirm.getDes().equals("")) { if (resolveConfirm.getDes()!=null&&!resolveConfirm.getDes().equals("")) {
deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes()); deviceRepelDetail.setSubmitDescription(resolveConfirm.getDes());
repelTaskStatistical.setDes(resolveConfirm.getDes());
} }
repelTaskStatisticalService.saveRepelTaskStatistical(repelTaskStatistical);
deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail); deviceRepelDetailService.saveDeviceRepelDetail(deviceRepelDetail);
log.info("提交装备接口结束{}",System.currentTimeMillis()-stime); log.info("提交装备接口结束{}",System.currentTimeMillis()-stime);
} }
......
...@@ -71,10 +71,13 @@ public class TrainJobController { ...@@ -71,10 +71,13 @@ public class TrainJobController {
@Autowired @Autowired
UnitsService unitsService; UnitsService unitsService;
@Autowired @Autowired
UnitsDao unitsDao; UnitsDao unitsDao;
@Autowired @Autowired
UserService userService; UserService userService;
@Autowired @Autowired
TaskService taskService; TaskService taskService;
@Autowired @Autowired
...@@ -340,17 +343,22 @@ public class TrainJobController { ...@@ -340,17 +343,22 @@ public class TrainJobController {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResponseEntity gradeeEntry(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody GradeEntryVo gradeEntryVo) { public ResponseEntity gradeeEntry(@ApiIgnore @AuthenticationPrincipal SecurityUser securityUser, @RequestBody GradeEntryVo gradeEntryVo) {
//向专管员证书表中添加数据 //向专管员证书表中添加数据
if (gradeEntryVo.getIsCertificate()==0) { CompletableFuture.runAsync(()-> {
log.info("[培训] 异步添加人员,证书以及人员日志");
if (gradeEntryVo.getIsCertificate() == 0) {
gradeEntryVo.getGradeEntryList().forEach( gradeEntryVo.getGradeEntryList().forEach(
gradeEntry -> { gradeEntry -> {
if (gradeEntry.getCertificate() == 0) { if (gradeEntry.getCertificate() == 0) {
User user = userService.findByUser(gradeEntry.getUserId());
user.setTrainStatus(0);
userService.save(user);
mgrcertService.save(gradeEntry.toDo()); mgrcertService.save(gradeEntry.toDo());
userLogService.save(new UserLog(gradeEntry.getUserId(), new Date(), "通过培训获得证书")); userLogService.save(new UserLog(gradeEntry.getUserId(), new Date(), "通过培训获得证书"));
} }
} }
); );
} }
});
TrainTheme trainTheme = trainThemeService.findById(gradeEntryVo.getTrainThemeId()); TrainTheme trainTheme = trainThemeService.findById(gradeEntryVo.getTrainThemeId());
//给培训报名的人员都发起一个通知,查看自己都证书 //给培训报名的人员都发起一个通知,查看自己都证书
TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(trainTheme.getTrainId(), BusinessEnum.TRAIN.id); TaskBto taskBto = trainTaskService.selectFatherIsNullAndBillidAndBillType(trainTheme.getTrainId(), BusinessEnum.TRAIN.id);
......
...@@ -17,6 +17,7 @@ import javax.persistence.*; ...@@ -17,6 +17,7 @@ import javax.persistence.*;
import java.time.Instant; import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date; import java.util.Date;
/** /**
...@@ -196,12 +197,14 @@ public class TrainUser { ...@@ -196,12 +197,14 @@ public class TrainUser {
trainUserExcelVo.setLeaveMealString("晚饭"); trainUserExcelVo.setLeaveMealString("晚饭");
break; break;
} }
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
Instant instant = this.getLeaveTime().toInstant(); Instant instant = this.getLeaveTime().toInstant();
ZoneId zoneId = ZoneId.systemDefault(); ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime LeaveTime=instant.atZone(zoneId).toLocalDateTime(); LocalDateTime LeaveTime=instant.atZone(zoneId).toLocalDateTime();
Instant instant1 = this.getArriveTime().toInstant(); Instant instant1 = this.getArriveTime().toInstant();
LocalDateTime ArriveTime=instant1.atZone(zoneId).toLocalDateTime(); LocalDateTime ArriveTime=instant1.atZone(zoneId).toLocalDateTime();
trainUserExcelVo.setArriveTime(ArriveTime.format(df));
trainUserExcelVo.setLeaveTime(LeaveTime.format(df));
int daysNum=(int)(LeaveTime.toLocalDate().toEpochDay() - ArriveTime.toLocalDate().toEpochDay()); int daysNum=(int)(LeaveTime.toLocalDate().toEpochDay() - ArriveTime.toLocalDate().toEpochDay());
if (daysNum>1){ if (daysNum>1){
......
...@@ -99,6 +99,12 @@ public class TrainDetailsVo { ...@@ -99,6 +99,12 @@ public class TrainDetailsVo {
@ApiModelProperty(value = "主讲人") @ApiModelProperty(value = "主讲人")
private String speakerUserId; private String speakerUserId;
/**
* 培训简介
*/
@ApiModelProperty(value = "trainSynopsis")
private String trainSynopsis;
/** /**
* 培训资料名称 * 培训资料名称
......
...@@ -61,24 +61,14 @@ public class TrainUserExcelVo { ...@@ -61,24 +61,14 @@ public class TrainUserExcelVo {
private String positionString; private String positionString;
/**
* 考勤
*/
@ApiModelProperty(value = "考勤", name = "attendance")
@Excel(name = "考勤", orderNum = "1", width = 30, needMerge = true)
private String attendance;
@ApiModelProperty(value = "到达时间", name = "arriveTime") @ApiModelProperty(value = "到达时间", name = "arriveTime")
@Excel(name = "到达时间", orderNum = "1", width = 30, needMerge = true) @Excel(name = "到达时间", orderNum = "1", width = 30, needMerge = true)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private String arriveTime;
private LocalDateTime arriveTime;
@ApiModelProperty(value = "离开时间", name = "leaveTime") @ApiModelProperty(value = "离开时间", name = "leaveTime")
@Excel(name = "离开时间", orderNum = "1", width = 30, needMerge = true) @Excel(name = "离开时间", orderNum = "1", width = 30, needMerge = true)
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private String leaveTime;
private LocalDateTime leaveTime;
@ApiModelProperty(value = "到达就餐 0.无 1.午饭 2.晚饭", name = "arriveMeal") @ApiModelProperty(value = "到达就餐 0.无 1.午饭 2.晚饭", name = "arriveMeal")
......
...@@ -117,6 +117,8 @@ public class User { ...@@ -117,6 +117,8 @@ public class User {
@ApiModelProperty(value = "性别", name = "sex", example = "12321L") @ApiModelProperty(value = "性别", name = "sex", example = "12321L")
private Integer sex; private Integer sex;
/** /**
* 用户单位 * 用户单位
*/ */
......
...@@ -27,6 +27,8 @@ import org.springframework.http.ResponseEntity; ...@@ -27,6 +27,8 @@ import org.springframework.http.ResponseEntity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -304,9 +306,20 @@ public class UserServiceImpl implements UserService { ...@@ -304,9 +306,20 @@ public class UserServiceImpl implements UserService {
unitIds = unitsDao.findAllByType(2).stream().map(Units::getUnitId).collect(Collectors.toList()); unitIds = unitsDao.findAllByType(2).stream().map(Units::getUnitId).collect(Collectors.toList());
} }
predicateBuilder.in("unitsId",unitIds.toArray()); predicateBuilder.in("unitsId",unitIds.toArray());
}else { }else if (userConditionsVo.getType()==2){
predicateBuilder.eq("unitsId",userConditionsVo.getUnitsId()); predicateBuilder.eq("unitsId",userConditionsVo.getUnitsId());
} }
if (userConditionsVo.getDim() != null) {
Class<User> deviceLibraryEntity = User.class;
Field[] declaredFields = deviceLibraryEntity.getDeclaredFields();
PredicateBuilder<User> p = Specifications.or();
for (Field field : declaredFields) {
if (field.getType().equals(String.class) && field.getAnnotation(Transient.class) == null) {
p.like(field.getName(), "%" + userConditionsVo.getDim() + "%");
}
}
predicateBuilder.predicate(p.build());
}
return predicateBuilder.build(); return predicateBuilder.build();
} }
......
...@@ -89,14 +89,14 @@ public class DeviceUseReportController { ...@@ -89,14 +89,14 @@ public class DeviceUseReportController {
Instant instant = deviceUseReportDetailVo.getCreateTime().toInstant(); Instant instant = deviceUseReportDetailVo.getCreateTime().toInstant();
ZoneId zone = ZoneId.systemDefault(); ZoneId zone = ZoneId.systemDefault();
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone); LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
wrodParameter.setTime(localDateTime.getYear()+"年"+localDateTime.getMonth()+"月"+localDateTime.getDayOfMonth()+"日"); wrodParameter.setTime(localDateTime.getYear()+"年"+localDateTime.getMonthValue()+"月"+localDateTime.getDayOfMonth()+"日");
wrodParameter.setTitleUnitName(deviceUseReportDetailVo.getUnit()); wrodParameter.setTitleUnitName(deviceUseReportDetailVo.getUnit());
Instant instant1 = deviceUseReportDetailVo.getStartTime().toInstant(); Instant instant1 = deviceUseReportDetailVo.getStartTime().toInstant();
Instant instant2 = deviceUseReportDetailVo.getEndTime().toInstant(); Instant instant2 = deviceUseReportDetailVo.getEndTime().toInstant();
LocalDateTime localDateTime1 = LocalDateTime.ofInstant(instant1, zone); LocalDateTime localDateTime1 = LocalDateTime.ofInstant(instant1, zone);
LocalDateTime localDateTime2 = LocalDateTime.ofInstant(instant2, zone); LocalDateTime localDateTime2 = LocalDateTime.ofInstant(instant2, zone);
String startTime= localDateTime1.getYear()+"年"+localDateTime1.getMonth()+"月"+localDateTime1.getDayOfMonth()+"日"; String startTime= localDateTime1.getYear()+"年"+localDateTime1.getMonthValue()+"月"+localDateTime1.getDayOfMonth()+"日";
String endTime= localDateTime2.getYear()+"年"+localDateTime2.getMonth()+"月"+localDateTime2.getDayOfMonth()+"日"; String endTime= localDateTime2.getYear()+"年"+localDateTime2.getMonthValue()+"月"+localDateTime2.getDayOfMonth()+"日";
wrodParameter.setTitleTimeStart(startTime); wrodParameter.setTitleTimeStart(startTime);
wrodParameter.setTitleTimeEnd(endTime); wrodParameter.setTitleTimeEnd(endTime);
wrodParameter.setBackPackNum(deviceUseReportDetailVo.getRetiredNum()); wrodParameter.setBackPackNum(deviceUseReportDetailVo.getRetiredNum());
......
...@@ -39,43 +39,35 @@ public class DeviceUseReport { ...@@ -39,43 +39,35 @@ public class DeviceUseReport {
*/ */
@ApiModelProperty(value = "报告标题") @ApiModelProperty(value = "报告标题")
private String title; private String title;
/** /**
* 报告所属单位 * 报告所属单位
*/ */
@ApiModelProperty(value = "报告所属单位") @ApiModelProperty(value = "报告所属单位")
private String unit; private String unit;
/** /**
* 报告详情(入库数x退回数x退装数x维修数x销毁数x配发数x列装数) * 报告详情(入库数x退回数x退装数x维修数x销毁数x配发数x列装数)
*/ */
@ApiModelProperty(value = "报告详情(入库数x退回数x退装数x维修数x销毁数x配发数x列装数)") @ApiModelProperty(value = "报告详情(入库数x退回数x退装数x维修数x销毁数x配发数x列装数)")
private String reportDetail; private String reportDetail;
/**
* 创建用户id
*/
@CreatedBy @CreatedBy
@ApiModelProperty(value = "创建用户id") @ApiModelProperty(value = "创建用户id")
private Integer createUserId; private Integer createUserId;
/**
* 创建时间
*/
@CreatedDate @CreatedDate
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
/**
* 更新用户id
*/
@LastModifiedBy @LastModifiedBy
@ApiModelProperty(value = "更新用户id") @ApiModelProperty(value = "更新用户id")
private Integer updateUserId; private Integer updateUserId;
/**
* 更新时间
*/
@LastModifiedDate @LastModifiedDate
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Date updateTime; private Date updateTime;
/**
* 删除标记(0:未删除,1:已删除)
*/
@ApiModelProperty(value = "删除标记(0:未删除,1:已删除)") @ApiModelProperty(value = "删除标记(0:未删除,1:已删除)")
private Integer deleteTag = 0; private Integer deleteTag = 0;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论