From 088eb000ad31b6e79b93b44c756ddfe2c8f8341d Mon Sep 17 00:00:00 2001 From: zhangye <654600784@qq.com> Date: Tue, 17 Mar 2020 17:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=8F=92=E4=BB=B6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccsens/health/bean/dto/StudentDto.java | 12 ++- .../com/ccsens/health/bean/dto/UserDto.java | 2 +- .../com/ccsens/health/bean/vo/AbnormalVo.java | 4 + .../com/ccsens/health/bean/vo/StudentVo.java | 6 +- .../com/ccsens/health/bean/vo/UserVo.java | 2 +- .../health/persist/dao/HealthAbnormalDao.java | 8 ++ .../health/service/AbnormalService.java | 16 +++- .../ccsens/health/service/ClockService.java | 28 ++++++- health/src/main/resources/application.yml | 4 +- .../tall/persist/dao/ProPluginConfigDao.java | 8 ++ .../com/ccsens/tall/service/ExcelService.java | 2 + .../tall/service/IWbsSubSheetService.java | 2 + .../tall/service/WbsSubSheetService.java | 76 ++++++++++++++++++- 13 files changed, 155 insertions(+), 15 deletions(-) create mode 100644 health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java create mode 100644 tall/src/main/java/com/ccsens/tall/persist/dao/ProPluginConfigDao.java diff --git a/health/src/main/java/com/ccsens/health/bean/dto/StudentDto.java b/health/src/main/java/com/ccsens/health/bean/dto/StudentDto.java index fb597323..5c4e61ed 100644 --- a/health/src/main/java/com/ccsens/health/bean/dto/StudentDto.java +++ b/health/src/main/java/com/ccsens/health/bean/dto/StudentDto.java @@ -13,13 +13,15 @@ public class StudentDto { @ApiModelProperty("姓名") private String name; @ApiModelProperty("学号") - private String mkno; + private String wkno; @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("开始时间") private String startTime; @ApiModelProperty("结束时间") private String endTime; + @ApiModelProperty("健康状态 0发烧 1其他") + private int type; } @Data @@ -32,8 +34,14 @@ public class StudentDto { @ApiModelProperty("姓名") private String name; @ApiModelProperty("学号") - private String mkno; + private String wkno; + @ApiModelProperty("班级(所在机构)") + private String department; @ApiModelProperty("车次号") private String carNo; + @ApiModelProperty("开始时间") + private String startTime; + @ApiModelProperty("结束时间") + private String endTime; } } diff --git a/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java b/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java index 955e3453..8299c908 100644 --- a/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java +++ b/health/src/main/java/com/ccsens/health/bean/dto/UserDto.java @@ -29,7 +29,7 @@ public class UserDto { @ApiModelProperty("姓名") private String name; @ApiModelProperty("学号") - private String mkno; + private String wkno; @ApiModelProperty("开始时间") private String startTime; @ApiModelProperty("结束时间") diff --git a/health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java b/health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java index b6a12a87..02150d56 100644 --- a/health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java +++ b/health/src/main/java/com/ccsens/health/bean/vo/AbnormalVo.java @@ -13,8 +13,12 @@ public class AbnormalVo { @Data @ApiModel("疫情概览") public static class AbnormalOverview{ + @ApiModelProperty("异常状态类型 0健康打卡 1人员异常 2行程异常") + private int abnormalType; @ApiModelProperty("异常状态名称") private String abnormalName; + @ApiModelProperty("异常状态code") + private String code; @ApiModelProperty("数量") private Long number; } diff --git a/health/src/main/java/com/ccsens/health/bean/vo/StudentVo.java b/health/src/main/java/com/ccsens/health/bean/vo/StudentVo.java index 56641388..a85dd533 100644 --- a/health/src/main/java/com/ccsens/health/bean/vo/StudentVo.java +++ b/health/src/main/java/com/ccsens/health/bean/vo/StudentVo.java @@ -19,7 +19,7 @@ public class StudentVo { @ApiModelProperty("姓名") private String name; @ApiModelProperty("学号") - private String mkno; + private String wkno; @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("上报健康的时间") @@ -55,7 +55,7 @@ public class StudentVo { @ApiModelProperty("姓名") private String name; @ApiModelProperty("学号") - private String mkno; + private String wkno; @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("上报健康的时间") @@ -101,7 +101,7 @@ public class StudentVo { @ApiModelProperty("姓名") private String name; @ApiModelProperty("学号") - private String mkno; + private String wkno; @ApiModelProperty("班级(所在机构)") private String department; @ApiModelProperty("'出行方式'") diff --git a/health/src/main/java/com/ccsens/health/bean/vo/UserVo.java b/health/src/main/java/com/ccsens/health/bean/vo/UserVo.java index 61834a41..d070917b 100644 --- a/health/src/main/java/com/ccsens/health/bean/vo/UserVo.java +++ b/health/src/main/java/com/ccsens/health/bean/vo/UserVo.java @@ -46,7 +46,7 @@ public class UserVo { @ApiModelProperty("学生姓名") private String name; @ApiModelProperty("学号") - private String mkno; + private String wkno; @ApiModelProperty("打卡记录") private ClockIn clockInList; } diff --git a/health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java b/health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java new file mode 100644 index 00000000..67a23039 --- /dev/null +++ b/health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java @@ -0,0 +1,8 @@ +package com.ccsens.health.persist.dao; + +import com.ccsens.health.persist.mapper.HealthAbnormalMapper; +import org.springframework.stereotype.Repository; + +@Repository +public interface HealthAbnormalDao extends HealthAbnormalMapper { +} diff --git a/health/src/main/java/com/ccsens/health/service/AbnormalService.java b/health/src/main/java/com/ccsens/health/service/AbnormalService.java index 37d39a92..56b3e9ac 100644 --- a/health/src/main/java/com/ccsens/health/service/AbnormalService.java +++ b/health/src/main/java/com/ccsens/health/service/AbnormalService.java @@ -1,14 +1,24 @@ package com.ccsens.health.service; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.lang.Snowflake; import com.ccsens.health.bean.dto.AbnormalDto; +import com.ccsens.health.bean.po.HealthAbnormal; import com.ccsens.health.bean.vo.AbnormalVo; +import com.ccsens.health.persist.dao.HealthAbnormalDao; import com.ccsens.util.bean.dto.QueryDto; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class AbnormalService implements IAbnormalService{ + @Autowired + private Snowflake snowflake; + @Autowired + private HealthAbnormalDao healthAbnormalDao; + /** * 疫情概览 * @param params @@ -25,7 +35,11 @@ public class AbnormalService implements IAbnormalService{ */ @Override public void AddAbnormal(QueryDto params) { - + AbnormalDto.AddAbnormal addAbnormal = params.getParam(); + HealthAbnormal healthAbnormal = new HealthAbnormal(); + healthAbnormal.setId(snowflake.nextId()); + BeanUtil.copyProperties(addAbnormal,healthAbnormal); + healthAbnormalDao.insertSelective(healthAbnormal); } /** diff --git a/health/src/main/java/com/ccsens/health/service/ClockService.java b/health/src/main/java/com/ccsens/health/service/ClockService.java index 56da7699..ac601d76 100644 --- a/health/src/main/java/com/ccsens/health/service/ClockService.java +++ b/health/src/main/java/com/ccsens/health/service/ClockService.java @@ -207,7 +207,12 @@ public class ClockService implements IClockService { */ @Override public void delSite(Long id) { - + Site site = siteDao.selectByPrimaryKey(id); + if(ObjectUtil.isNull(site)){ + throw new BaseException(CodeEnum.NOT_SITE); + } + site.setRecStatus((byte) 2); + siteDao.updateByPrimaryKeySelective(site); } /** @@ -216,7 +221,26 @@ public class ClockService implements IClockService { */ @Override public void updateSite(JourneyDto.UpdateSite param) { - + Site site = siteDao.selectByPrimaryKey(param.getId()); + if(ObjectUtil.isNull(site)){ + throw new BaseException(CodeEnum.NOT_SITE); + } + if(StrUtil.isNotEmpty(param.getSiteName())){ + site.setSiteName(param.getSiteName()); + } + if(StrUtil.isNotEmpty(param.getSiteCode())){ + site.setSiteCode(param.getSiteCode()); + } + if(ObjectUtil.isNotNull(param.getLongitude())){ + site.setLongitude(param.getLongitude()); + } + if(ObjectUtil.isNotNull(param.getLatitude())){ + site.setLatitude(param.getLatitude()); + } + if(StrUtil.isNotEmpty(param.getParentCode())){ + site.setParentCode(param.getParentCode()); + } + siteDao.updateByPrimaryKeySelective(site); } @Override diff --git a/health/src/main/resources/application.yml b/health/src/main/resources/application.yml index 5c2cd5c4..5889ff7f 100644 --- a/health/src/main/resources/application.yml +++ b/health/src/main/resources/application.yml @@ -1,4 +1,4 @@ spring: profiles: - active: dev - include: common, util-dev \ No newline at end of file + active: test + include: common, util-test \ No newline at end of file diff --git a/tall/src/main/java/com/ccsens/tall/persist/dao/ProPluginConfigDao.java b/tall/src/main/java/com/ccsens/tall/persist/dao/ProPluginConfigDao.java new file mode 100644 index 00000000..5569c964 --- /dev/null +++ b/tall/src/main/java/com/ccsens/tall/persist/dao/ProPluginConfigDao.java @@ -0,0 +1,8 @@ +package com.ccsens.tall.persist.dao; + +import com.ccsens.tall.persist.mapper.ProPluginConfigMapper; +import org.springframework.stereotype.Repository; + +@Repository +public interface ProPluginConfigDao extends ProPluginConfigMapper { +} diff --git a/tall/src/main/java/com/ccsens/tall/service/ExcelService.java b/tall/src/main/java/com/ccsens/tall/service/ExcelService.java index ff0dafff..5de26eb1 100644 --- a/tall/src/main/java/com/ccsens/tall/service/ExcelService.java +++ b/tall/src/main/java/com/ccsens/tall/service/ExcelService.java @@ -142,6 +142,8 @@ public class ExcelService implements IExcelService { saveProTaskSubTime(taskDetails); //读取插件表 readPlugin(xssfWorkbook, taskDetails, proRoles, hasGroupMap); + //读取插件配置表 + wbsSubSheetService.getPluginConfig(sysProject.getId(),xssfWorkbook,taskDetails); //读取签到信息表 wbsSubSheetService.getSigninSheet(sysProject.getId(),xssfWorkbook,taskDetails); return sysProject; diff --git a/tall/src/main/java/com/ccsens/tall/service/IWbsSubSheetService.java b/tall/src/main/java/com/ccsens/tall/service/IWbsSubSheetService.java index 6cdbe9e6..e350110a 100644 --- a/tall/src/main/java/com/ccsens/tall/service/IWbsSubSheetService.java +++ b/tall/src/main/java/com/ccsens/tall/service/IWbsSubSheetService.java @@ -16,4 +16,6 @@ public interface IWbsSubSheetService { List taskDetails, List proMembers, String deliverCell, Map> hasGroupMap); void getSigninSheet(Long projectId,XSSFWorkbook xssfWorkbook, List taskDetails); + + void getPluginConfig(Long id, XSSFWorkbook xssfWorkbook, List taskDetails); } diff --git a/tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java b/tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java index 0d2315f8..2a7bc7ed 100644 --- a/tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java +++ b/tall/src/main/java/com/ccsens/tall/service/WbsSubSheetService.java @@ -45,6 +45,8 @@ public class WbsSubSheetService implements IWbsSubSheetService { private ProPluginSigninDao proPluginSigninDao; @Autowired private ProPluginSigninFuzzyDao pluginSigninFuzzyDao; + @Autowired + private ProPluginConfigDao proPluginConfigDao; /** * 读取子任务表 @@ -169,7 +171,7 @@ public class WbsSubSheetService implements IWbsSubSheetService { subTask.setDescription(descriptionCell); if (StrUtil.isNotEmpty(repeatCell)) { subTask.setCycle(repeatCell); - }else { + } else { if (StrUtil.isNotEmpty(beginCell)) { subTask.setBeginTime(Long.valueOf(beginCell)); } @@ -224,12 +226,13 @@ public class WbsSubSheetService implements IWbsSubSheetService { /** * 签到信息表 + * * @param projectId * @param xssfWorkbook * @param taskDetails */ @Override - public void getSigninSheet(Long projectId,XSSFWorkbook xssfWorkbook, List taskDetails) { + public void getSigninSheet(Long projectId, XSSFWorkbook xssfWorkbook, List taskDetails) { XSSFSheet signSheet = xssfWorkbook.getSheet("签到信息表"); if (ObjectUtil.isNotNull(signSheet)) { int fuzzyStart = 0; @@ -346,7 +349,6 @@ public class WbsSubSheetService implements IWbsSubSheetService { } - private Long getTaskPluginId(String taskDetailName, String sysPluginName, List taskDetails) { Long taskPluginId = null; //任务详情id @@ -382,4 +384,72 @@ public class WbsSubSheetService implements IWbsSubSheetService { } return taskPluginId; } + + + /** + * 读取插件配置表 + * + * @param id + * @param xssfWorkbook + * @param taskDetails + */ + @Override + public void getPluginConfig(Long id, XSSFWorkbook xssfWorkbook, List taskDetails) { + XSSFSheet pluginConfigSheet = xssfWorkbook.getSheet("插件配置"); + if (ObjectUtil.isNotNull(pluginConfigSheet)) { + for (int i = 2; i <= pluginConfigSheet.getLastRowNum(); i++) { + String taskName = ExcelUtil.getCellValue(pluginConfigSheet.getRow(i).getCell(1)); + String webPath = ExcelUtil.getCellValue(pluginConfigSheet.getRow(i).getCell(2)); + String pluginName = ExcelUtil.getCellValue(pluginConfigSheet.getRow(i).getCell(3)); + String placeLocation = ExcelUtil.getCellValue(pluginConfigSheet.getRow(i).getCell(4)); + String routineLocation = ExcelUtil.getCellValue(pluginConfigSheet.getRow(i).getCell(5)); + String importParam = ExcelUtil.getCellValue(pluginConfigSheet.getRow(i).getCell(6)); + + //获取任务id + if (StrUtil.isNotEmpty(taskName)) { + Long taskId = null; + for (ProTaskDetail taskDetail : taskDetails) { + if (taskDetail.getName().equalsIgnoreCase(taskName)) { + taskId = taskDetail.getId(); + break; + } + } + if (taskId == null) { + throw new BaseException(CodeEnum.NOT_TASK); + } + //获取插件id + Long pluginId = 0L; + if (StrUtil.isNotEmpty(pluginName)) { + SysPluginExample sysPluginExample = new SysPluginExample(); + sysPluginExample.createCriteria().andNameEqualTo(pluginName); + List pluginList = sysPluginDao.selectByExample(sysPluginExample); + if (CollectionUtil.isNotEmpty(pluginList)) { + pluginId = pluginList.get(0).getId(); + } else { + throw new BaseException(CodeEnum.WBS_NOT_PLUGIN); + } + } + ProPluginConfig proPluginConfig = new ProPluginConfig(); + proPluginConfig.setId(snowflake.nextId()); + proPluginConfig.setTaskId(taskId); + proPluginConfig.setPluginId(pluginId); + if (StrUtil.isNotEmpty(webPath)) { + proPluginConfig.setWebPath(webPath); + } + if (StrUtil.isNotEmpty(placeLocation)) { + int a = Integer.parseInt(placeLocation); + proPluginConfig.setPlaceLocation((byte) a); + } + if (StrUtil.isNotEmpty(routineLocation)) { + int a = Integer.parseInt(routineLocation); + proPluginConfig.setRoutineLocation((byte) a); + } + if (StrUtil.isNotEmpty(importParam)) { + proPluginConfig.setImportParam(importParam); + } + proPluginConfigDao.insertSelective(proPluginConfig); + } + } + } + } }