From 7bba7cb56ded41e2e364945a6f7bdb5fbcc5315b Mon Sep 17 00:00:00 2001 From: zhangye <654600784@qq.com> Date: Wed, 18 Mar 2020 15:57:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=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/api/AbnormalController.java | 6 +- .../health/bean/po/JourneyAbnormal.java | 11 +++ .../bean/po/JourneyAbnormalExample.java | 70 +++++++++++++++++++ .../health/persist/dao/HealthAbnormalDao.java | 8 ++- .../health/persist/dao/HealthRecordsDao.java | 1 - .../persist/dao/JourneyAbnormalDao.java | 8 +++ .../health/service/AbnormalService.java | 49 +++++++++---- .../health/service/IAbnormalService.java | 4 +- .../ccsens/health/service/JourneyService.java | 16 +++-- .../mapper_dao/HealthAbnormalDao.xml | 48 +++++++++++++ .../mapper_raw/JourneyAbnormalMapper.xml | 28 ++++++-- .../java/com/ccsens/tall/bean/po/ProShow.java | 11 +++ .../ccsens/tall/bean/po/ProShowExample.java | 60 ++++++++++++++++ .../java/com/ccsens/tall/bean/vo/TaskVo.java | 2 + .../tall/service/ProTaskDetailService.java | 20 +++++- .../resources/mapper_raw/ProShowMapper.xml | 29 ++++++-- 16 files changed, 334 insertions(+), 37 deletions(-) create mode 100644 health/src/main/java/com/ccsens/health/persist/dao/JourneyAbnormalDao.java create mode 100644 health/src/main/resources/mapper_dao/HealthAbnormalDao.xml diff --git a/health/src/main/java/com/ccsens/health/api/AbnormalController.java b/health/src/main/java/com/ccsens/health/api/AbnormalController.java index cd81e391..bbdc1aa6 100644 --- a/health/src/main/java/com/ccsens/health/api/AbnormalController.java +++ b/health/src/main/java/com/ccsens/health/api/AbnormalController.java @@ -42,7 +42,7 @@ public class AbnormalController { @RequestMapping(value = "add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) public JsonResponse addAbnormal(@ApiParam @Validated @RequestBody QueryDto params) throws Exception { log.info("异常人员添加:{}",params); - abnormalService.AddAbnormal(params); + abnormalService.addAbnormal(params); return JsonResponse.newInstance().ok(); } @@ -52,8 +52,8 @@ public class AbnormalController { public JsonResponse> abnormalStatistics( @ApiParam @Validated @RequestBody QueryDto params) throws Exception { log.info("异常人员添加:{}",params); - List abnormalStatisticsVoList = abnormalService.AbnormalStatistics(params); - return JsonResponse.newInstance().ok(); + List abnormalStatisticsVoList = abnormalService.abnormalStatistics(params); + return JsonResponse.newInstance().ok(abnormalStatisticsVoList); } @MustLogin diff --git a/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormal.java b/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormal.java index d2a8d69e..3a642d2c 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormal.java +++ b/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormal.java @@ -14,6 +14,8 @@ public class JourneyAbnormal implements Serializable { private Long endTime; + private String description; + private Date createdAt; private Date updatedAt; @@ -62,6 +64,14 @@ public class JourneyAbnormal implements Serializable { this.endTime = endTime; } + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + public Date getCreatedAt() { return createdAt; } @@ -97,6 +107,7 @@ public class JourneyAbnormal implements Serializable { sb.append(", carNo=").append(carNo); sb.append(", startTime=").append(startTime); sb.append(", endTime=").append(endTime); + sb.append(", description=").append(description); sb.append(", createdAt=").append(createdAt); sb.append(", updatedAt=").append(updatedAt); sb.append(", recStatus=").append(recStatus); diff --git a/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormalExample.java b/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormalExample.java index 9e9f13b4..4f6b739d 100644 --- a/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormalExample.java +++ b/health/src/main/java/com/ccsens/health/bean/po/JourneyAbnormalExample.java @@ -425,6 +425,76 @@ public class JourneyAbnormalExample { return (Criteria) this; } + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + public Criteria andCreatedAtIsNull() { addCriterion("created_at is null"); return (Criteria) this; 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 index 48ac142d..6933fbb8 100644 --- a/health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java +++ b/health/src/main/java/com/ccsens/health/persist/dao/HealthAbnormalDao.java @@ -1,10 +1,16 @@ package com.ccsens.health.persist.dao; +import com.ccsens.health.bean.po.HealthAbnormal; +import com.ccsens.health.bean.vo.AbnormalVo; import com.ccsens.health.persist.mapper.HealthAbnormalMapper; +import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; +import java.util.List; + @Repository public interface HealthAbnormalDao extends HealthAbnormalMapper { -// List getAbnormalList(@Param("post") Integer post, @Param("department")String department, @Param("healthType")Integer healthType); + List getAbnormalList(@Param("post") Integer post, @Param("department")String department, @Param("healthType")Integer healthType); + } diff --git a/health/src/main/java/com/ccsens/health/persist/dao/HealthRecordsDao.java b/health/src/main/java/com/ccsens/health/persist/dao/HealthRecordsDao.java index 06df070f..56129aea 100644 --- a/health/src/main/java/com/ccsens/health/persist/dao/HealthRecordsDao.java +++ b/health/src/main/java/com/ccsens/health/persist/dao/HealthRecordsDao.java @@ -1,6 +1,5 @@ package com.ccsens.health.persist.dao; -import com.ccsens.health.bean.po.HealthRecords; import com.ccsens.health.bean.vo.HealthVo; import com.ccsens.health.bean.vo.UserVo; import com.ccsens.health.persist.mapper.HealthRecordsMapper; diff --git a/health/src/main/java/com/ccsens/health/persist/dao/JourneyAbnormalDao.java b/health/src/main/java/com/ccsens/health/persist/dao/JourneyAbnormalDao.java new file mode 100644 index 00000000..510338b7 --- /dev/null +++ b/health/src/main/java/com/ccsens/health/persist/dao/JourneyAbnormalDao.java @@ -0,0 +1,8 @@ +package com.ccsens.health.persist.dao; + +import com.ccsens.health.persist.mapper.JourneyAbnormalMapper; +import org.springframework.stereotype.Repository; + +@Repository +public interface JourneyAbnormalDao extends JourneyAbnormalMapper { +} 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 b1530ecf..3134c36f 100644 --- a/health/src/main/java/com/ccsens/health/service/AbnormalService.java +++ b/health/src/main/java/com/ccsens/health/service/AbnormalService.java @@ -3,6 +3,7 @@ package com.ccsens.health.service; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.lang.Snowflake; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; import com.ccsens.health.bean.dto.AbnormalDto; import com.ccsens.health.bean.po.HealthAbnormal; import com.ccsens.health.bean.vo.AbnormalVo; @@ -11,8 +12,6 @@ import com.ccsens.util.CodeEnum; import com.ccsens.util.bean.dto.QueryDto; import com.ccsens.util.exception.BaseException; import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; -import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -45,7 +44,7 @@ public class AbnormalService implements IAbnormalService{ * @param params */ @Override - public void AddAbnormal(QueryDto params) { + public void addAbnormal(QueryDto params) { AbnormalDto.AddAbnormal addAbnormal = params.getParam(); HealthAbnormal healthAbnormal = new HealthAbnormal(); healthAbnormal.setId(snowflake.nextId()); @@ -57,18 +56,14 @@ public class AbnormalService implements IAbnormalService{ * 异常人员统计 */ @Override - public List AbnormalStatistics(QueryDto params) { + public List abnormalStatistics(QueryDto params) { AbnormalDto.AbnormalStatisticsDto abnormalDto = params.getParam(); Integer page = abnormalDto.getPage() == null ? 1 : abnormalDto.getPage(); + PageHelper.startPage(page, 10); + List abnormalList = healthAbnormalDao.getAbnormalList(abnormalDto.getPost(), abnormalDto.getDepartment(), abnormalDto.getHealthType()); -// PageHelper.startPage(page, 10); -// List abnormalList = healthAbnormalDao.getAbnormalList(abnormalDto.getPost(), abnormalDto.getDepartment(), abnormalDto.getHealthType()); -// log.info("医生信息"); -// PageInfo pageInfo =new PageInfo<>(abnormalList); -// -// return abnormalList; - return null; + return abnormalList; } /** @@ -77,7 +72,37 @@ public class AbnormalService implements IAbnormalService{ */ @Override public void updateAbnormal(QueryDto params) { - + AbnormalDto.UpdateAbnormal updateAbnormal = params.getParam(); + HealthAbnormal healthAbnormal = healthAbnormalDao.selectByPrimaryKey(updateAbnormal.getId()); + if(ObjectUtil.isNull(healthAbnormal)){ + throw new BaseException(CodeEnum.PARAM_ERROR); + } + //修改信息 + if(StrUtil.isNotEmpty(updateAbnormal.getWkno())){ + healthAbnormal.setWkno(updateAbnormal.getWkno()); + } + if(StrUtil.isNotEmpty(updateAbnormal.getName())){ + healthAbnormal.setName(updateAbnormal.getName()); + } + if(StrUtil.isNotEmpty(updateAbnormal.getDepartment())){ + healthAbnormal.setDepartment(updateAbnormal.getDepartment()); + } + if(ObjectUtil.isNotNull(updateAbnormal.getAnimalHeat())){ + healthAbnormal.setAnimalHeat(updateAbnormal.getAnimalHeat()); + } + if(StrUtil.isNotEmpty(updateAbnormal.getReason())){ + healthAbnormal.setReason(updateAbnormal.getReason()); + } + if(ObjectUtil.isNotNull(updateAbnormal.getHealthType())){ + healthAbnormal.setHealthStatus((short) updateAbnormal.getHealthType()); + } + if(ObjectUtil.isNotNull(updateAbnormal.getStartTime())){ + healthAbnormal.setStartTime(updateAbnormal.getStartTime()); + } + if(ObjectUtil.isNotNull(updateAbnormal.getEndTime())){ + healthAbnormal.setEndTime(updateAbnormal.getEndTime()); + } + healthAbnormalDao.updateByPrimaryKeySelective(healthAbnormal); } /** diff --git a/health/src/main/java/com/ccsens/health/service/IAbnormalService.java b/health/src/main/java/com/ccsens/health/service/IAbnormalService.java index 00944b18..cea109fb 100644 --- a/health/src/main/java/com/ccsens/health/service/IAbnormalService.java +++ b/health/src/main/java/com/ccsens/health/service/IAbnormalService.java @@ -9,9 +9,9 @@ import java.util.List; public interface IAbnormalService { List abnormalOverview(QueryDto params); - void AddAbnormal(QueryDto params); + void addAbnormal(QueryDto params); - List AbnormalStatistics(QueryDto params); + List abnormalStatistics(QueryDto params); void updateAbnormal(QueryDto params); diff --git a/health/src/main/java/com/ccsens/health/service/JourneyService.java b/health/src/main/java/com/ccsens/health/service/JourneyService.java index 69f97007..e02ea0f8 100644 --- a/health/src/main/java/com/ccsens/health/service/JourneyService.java +++ b/health/src/main/java/com/ccsens/health/service/JourneyService.java @@ -9,9 +9,11 @@ import com.ccsens.health.bean.dto.JourneyDto; import com.ccsens.health.bean.po.Employee; import com.ccsens.health.bean.po.EmployeeExample; import com.ccsens.health.bean.po.Journey; +import com.ccsens.health.bean.po.JourneyAbnormal; import com.ccsens.health.bean.vo.JourneyVo; import com.ccsens.health.bean.vo.UserVo; import com.ccsens.health.persist.dao.EmployeeDao; +import com.ccsens.health.persist.dao.JourneyAbnormalDao; import com.ccsens.health.persist.dao.JourneyDao; import com.ccsens.util.CodeEnum; import com.ccsens.util.DateUtil; @@ -30,16 +32,14 @@ import java.util.List; @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public class JourneyService implements IJourneyService{ - @Autowired - private IUserService userService; @Autowired private Snowflake snowflake; @Autowired - private EmployeeDao employeeDao; - @Autowired private JourneyDao journeyDao; @Autowired private TallFeignClient tallFeignClient; + @Autowired + private JourneyAbnormalDao journeyAbnormalDao; /** * 上报行程 @@ -96,7 +96,11 @@ public class JourneyService implements IJourneyService{ */ @Override public void addAbnormalJourney(QueryDto params) { - + JourneyDto.AddAbnormalJourney addAbnormalJourney = params.getParam(); + JourneyAbnormal journeyAbnormal = new JourneyAbnormal(); + BeanUtil.copyProperties(addAbnormalJourney,journeyAbnormal); + journeyAbnormal.setId(snowflake.nextId()); + journeyAbnormalDao.insertSelective(journeyAbnormal); } /** @@ -124,6 +128,6 @@ public class JourneyService implements IJourneyService{ */ @Override public void deleteAbnormalJourney(QueryDto params) { - + JourneyAbnormal journeyAbnormal = journeyAbnormalDao.selectByPrimaryKey(params.getParam().getId()); } } diff --git a/health/src/main/resources/mapper_dao/HealthAbnormalDao.xml b/health/src/main/resources/mapper_dao/HealthAbnormalDao.xml new file mode 100644 index 00000000..969a12e4 --- /dev/null +++ b/health/src/main/resources/mapper_dao/HealthAbnormalDao.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/health/src/main/resources/mapper_raw/JourneyAbnormalMapper.xml b/health/src/main/resources/mapper_raw/JourneyAbnormalMapper.xml index c8e3c3e8..500148ca 100644 --- a/health/src/main/resources/mapper_raw/JourneyAbnormalMapper.xml +++ b/health/src/main/resources/mapper_raw/JourneyAbnormalMapper.xml @@ -7,6 +7,7 @@ + @@ -70,7 +71,8 @@ - id, trip_mode, car_no, start_time, end_time, created_at, updated_at, rec_status + id, trip_mode, car_no, start_time, end_time, description, created_at, updated_at, + rec_status select @@ -109,12 +110,14 @@ insert into t_pro_show (id, project_id, slide, filter, time_show, duration, - is_show_mvp, create_task, created_at, - updated_at, rec_status) + is_show_mvp, create_task, show_shortcuts, + created_at, updated_at, rec_status + ) values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{slide,jdbcType=TINYINT}, #{filter,jdbcType=TINYINT}, #{timeShow,jdbcType=VARCHAR}, #{duration,jdbcType=TINYINT}, - #{isShowMvp,jdbcType=TINYINT}, #{createTask,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, - #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + #{isShowMvp,jdbcType=TINYINT}, #{createTask,jdbcType=TINYINT}, #{showShortcuts,jdbcType=TINYINT}, + #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} + ) insert into t_pro_show @@ -143,6 +146,9 @@ create_task, + + show_shortcuts, + created_at, @@ -178,6 +184,9 @@ #{createTask,jdbcType=TINYINT}, + + #{showShortcuts,jdbcType=TINYINT}, + #{createdAt,jdbcType=TIMESTAMP}, @@ -222,6 +231,9 @@ create_task = #{record.createTask,jdbcType=TINYINT}, + + show_shortcuts = #{record.showShortcuts,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, @@ -246,6 +258,7 @@ duration = #{record.duration,jdbcType=TINYINT}, is_show_mvp = #{record.isShowMvp,jdbcType=TINYINT}, create_task = #{record.createTask,jdbcType=TINYINT}, + show_shortcuts = #{record.showShortcuts,jdbcType=TINYINT}, created_at = #{record.createdAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, rec_status = #{record.recStatus,jdbcType=TINYINT} @@ -277,6 +290,9 @@ create_task = #{createTask,jdbcType=TINYINT}, + + show_shortcuts = #{showShortcuts,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, @@ -298,6 +314,7 @@ duration = #{duration,jdbcType=TINYINT}, is_show_mvp = #{isShowMvp,jdbcType=TINYINT}, create_task = #{createTask,jdbcType=TINYINT}, + show_shortcuts = #{showShortcuts,jdbcType=TINYINT}, created_at = #{createdAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP}, rec_status = #{recStatus,jdbcType=TINYINT}