From 96b9532b3615b71b4beb1b8d34a7112716c4f728 Mon Sep 17 00:00:00 2001 From: hyy-alt <1041001226@qq.com> Date: Tue, 1 Jun 2021 20:33:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=92=8C=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../resources/mapper_raw/ProRoleMapper.xml | 2 +- .../wisdomcar/api/OtherRecordsController.java | 54 ++ .../wisdomcar/bean/dto/OtherRecordsDto.java | 33 + .../bean/po/PatientInformationRecord.java | 106 +++ .../po/PatientInformationRecordExample.java | 691 +++++++++++++++ .../wisdomcar/bean/po/PatientWisdomCar.java | 128 +++ .../bean/po/PatientWisdomCarExample.java | 801 ++++++++++++++++++ .../wisdomcar/bean/vo/OtherRecordsVo.java | 26 + .../persist/dao/PatientWisdomCarDao.java | 11 + .../PatientInformationRecordMapper.java | 30 + .../mapper/PatientWisdomCarMapper.java | 30 + .../service/IOtherRecordsService.java | 24 + .../service/OtherRecordsService.java | 91 ++ .../mapper_dao/PatientWisdomCarDao.xml | 17 + .../PatientInformationRecordMapper.xml | 259 ++++++ .../mapper_raw/PatientWisdomCarMapper.xml | 291 +++++++ 17 files changed, 2594 insertions(+), 2 deletions(-) create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/api/OtherRecordsController.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/OtherRecordsDto.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientInformationRecord.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientInformationRecordExample.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientWisdomCar.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientWisdomCarExample.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/OtherRecordsVo.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/PatientWisdomCarDao.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/PatientInformationRecordMapper.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/PatientWisdomCarMapper.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/service/IOtherRecordsService.java create mode 100644 wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java create mode 100644 wisdomcar/src/main/resources/mapper_dao/PatientWisdomCarDao.xml create mode 100644 wisdomcar/src/main/resources/mapper_raw/PatientInformationRecordMapper.xml create mode 100644 wisdomcar/src/main/resources/mapper_raw/PatientWisdomCarMapper.xml diff --git a/pom.xml b/pom.xml index 6cdeb874..6a98bbc6 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ game mt - + wisdomcar beneficiation diff --git a/tall/src/main/resources/mapper_raw/ProRoleMapper.xml b/tall/src/main/resources/mapper_raw/ProRoleMapper.xml index 1e28879b..489aa8c5 100644 --- a/tall/src/main/resources/mapper_raw/ProRoleMapper.xml +++ b/tall/src/main/resources/mapper_raw/ProRoleMapper.xml @@ -86,7 +86,7 @@ - order by ${orderByClause} + order by ${orderByClause} + Select + c.id + From + `t_patient_wisdom_car` c + WHERE c.task_sub_id=#{id} + order by + c.`created_at` + desc + limit 1 + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/PatientInformationRecordMapper.xml b/wisdomcar/src/main/resources/mapper_raw/PatientInformationRecordMapper.xml new file mode 100644 index 00000000..f3ae6ac9 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/PatientInformationRecordMapper.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, patient_car_id, task_sub_id, information_type, content, created_at, updated_at, + rec_status + + + + + delete from t_patient_information_record + where id = #{id,jdbcType=BIGINT} + + + delete from t_patient_information_record + + + + + + insert into t_patient_information_record (id, patient_car_id, task_sub_id, + information_type, content, created_at, + updated_at, rec_status) + values (#{id,jdbcType=BIGINT}, #{patientCarId,jdbcType=BIGINT}, #{taskSubId,jdbcType=BIGINT}, + #{informationType,jdbcType=TINYINT}, #{content,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, + #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}) + + + insert into t_patient_information_record + + + id, + + + patient_car_id, + + + task_sub_id, + + + information_type, + + + content, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{patientCarId,jdbcType=BIGINT}, + + + #{taskSubId,jdbcType=BIGINT}, + + + #{informationType,jdbcType=TINYINT}, + + + #{content,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_patient_information_record + + + id = #{record.id,jdbcType=BIGINT}, + + + patient_car_id = #{record.patientCarId,jdbcType=BIGINT}, + + + task_sub_id = #{record.taskSubId,jdbcType=BIGINT}, + + + information_type = #{record.informationType,jdbcType=TINYINT}, + + + content = #{record.content,jdbcType=VARCHAR}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_patient_information_record + set id = #{record.id,jdbcType=BIGINT}, + patient_car_id = #{record.patientCarId,jdbcType=BIGINT}, + task_sub_id = #{record.taskSubId,jdbcType=BIGINT}, + information_type = #{record.informationType,jdbcType=TINYINT}, + content = #{record.content,jdbcType=VARCHAR}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_patient_information_record + + + patient_car_id = #{patientCarId,jdbcType=BIGINT}, + + + task_sub_id = #{taskSubId,jdbcType=BIGINT}, + + + information_type = #{informationType,jdbcType=TINYINT}, + + + content = #{content,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_patient_information_record + set patient_car_id = #{patientCarId,jdbcType=BIGINT}, + task_sub_id = #{taskSubId,jdbcType=BIGINT}, + information_type = #{informationType,jdbcType=TINYINT}, + content = #{content,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/wisdomcar/src/main/resources/mapper_raw/PatientWisdomCarMapper.xml b/wisdomcar/src/main/resources/mapper_raw/PatientWisdomCarMapper.xml new file mode 100644 index 00000000..58b112e9 --- /dev/null +++ b/wisdomcar/src/main/resources/mapper_raw/PatientWisdomCarMapper.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, patient_id, task_sub_id, car_id, start_time, end_time, is_demo, created_at, updated_at, + rec_status + + + + + delete from t_patient_wisdom_car + where id = #{id,jdbcType=BIGINT} + + + delete from t_patient_wisdom_car + + + + + + insert into t_patient_wisdom_car (id, patient_id, task_sub_id, + car_id, start_time, end_time, + is_demo, created_at, updated_at, + rec_status) + values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{taskSubId,jdbcType=BIGINT}, + #{carId,jdbcType=BIGINT}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, + #{isDemo,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, + #{recStatus,jdbcType=TINYINT}) + + + insert into t_patient_wisdom_car + + + id, + + + patient_id, + + + task_sub_id, + + + car_id, + + + start_time, + + + end_time, + + + is_demo, + + + created_at, + + + updated_at, + + + rec_status, + + + + + #{id,jdbcType=BIGINT}, + + + #{patientId,jdbcType=BIGINT}, + + + #{taskSubId,jdbcType=BIGINT}, + + + #{carId,jdbcType=BIGINT}, + + + #{startTime,jdbcType=BIGINT}, + + + #{endTime,jdbcType=BIGINT}, + + + #{isDemo,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=TIMESTAMP}, + + + #{updatedAt,jdbcType=TIMESTAMP}, + + + #{recStatus,jdbcType=TINYINT}, + + + + + + update t_patient_wisdom_car + + + id = #{record.id,jdbcType=BIGINT}, + + + patient_id = #{record.patientId,jdbcType=BIGINT}, + + + task_sub_id = #{record.taskSubId,jdbcType=BIGINT}, + + + car_id = #{record.carId,jdbcType=BIGINT}, + + + start_time = #{record.startTime,jdbcType=BIGINT}, + + + end_time = #{record.endTime,jdbcType=BIGINT}, + + + is_demo = #{record.isDemo,jdbcType=TINYINT}, + + + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{record.recStatus,jdbcType=TINYINT}, + + + + + + + + update t_patient_wisdom_car + set id = #{record.id,jdbcType=BIGINT}, + patient_id = #{record.patientId,jdbcType=BIGINT}, + task_sub_id = #{record.taskSubId,jdbcType=BIGINT}, + car_id = #{record.carId,jdbcType=BIGINT}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT}, + is_demo = #{record.isDemo,jdbcType=TINYINT}, + created_at = #{record.createdAt,jdbcType=TIMESTAMP}, + updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{record.recStatus,jdbcType=TINYINT} + + + + + + update t_patient_wisdom_car + + + patient_id = #{patientId,jdbcType=BIGINT}, + + + task_sub_id = #{taskSubId,jdbcType=BIGINT}, + + + car_id = #{carId,jdbcType=BIGINT}, + + + start_time = #{startTime,jdbcType=BIGINT}, + + + end_time = #{endTime,jdbcType=BIGINT}, + + + is_demo = #{isDemo,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=TIMESTAMP}, + + + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + + + rec_status = #{recStatus,jdbcType=TINYINT}, + + + where id = #{id,jdbcType=BIGINT} + + + update t_patient_wisdom_car + set patient_id = #{patientId,jdbcType=BIGINT}, + task_sub_id = #{taskSubId,jdbcType=BIGINT}, + car_id = #{carId,jdbcType=BIGINT}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT}, + is_demo = #{isDemo,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=TIMESTAMP}, + updated_at = #{updatedAt,jdbcType=TIMESTAMP}, + rec_status = #{recStatus,jdbcType=TINYINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file From 2d23aa8691e3c51f85289b348ef4c4051fdbac42 Mon Sep 17 00:00:00 2001 From: hyy-alt <1041001226@qq.com> Date: Tue, 1 Jun 2021 23:03:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=92=8C=E8=AE=B0=E5=BD=95=E6=B5=8B=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/OtherRecordsService.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java b/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java index a0db7e57..8d8d7570 100644 --- a/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java +++ b/wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java @@ -1,6 +1,8 @@ package com.ccsens.wisdomcar.service; +import cn.hutool.core.lang.Snowflake; import cn.hutool.core.util.ObjectUtil; +import com.ccsens.util.StringUtil; import com.ccsens.wisdomcar.bean.dto.OtherRecordsDto; import com.ccsens.wisdomcar.bean.po.PatientInformationRecord; import com.ccsens.wisdomcar.bean.po.PatientInformationRecordExample; @@ -39,31 +41,36 @@ public class OtherRecordsService implements IOtherRecordsService { @Resource private PatientInformationRecordMapper patientInformationRecordMapper; + @Resource + private Snowflake snowflake; + @Override public void upload(OtherRecordsDto.PicturesAndRecords param) { //通过t_patient_information_record里面的分解任务id 找到患者平车id 最新的 拿到患者平车id t_patient_information_record List longs = patientWisdomCarDao.queryByNew(param.getId()); //拿到患者平车id if(ObjectUtil.isNotNull(longs)){ - if(param.getPictures().isEmpty()){ //判断是否是图片是否为空 + if(param.getPictures().size()!=0){ //判断是否是图片是否为空 for (int i = 0; i < param.getPictures().size(); i++) { PatientInformationRecord patientInformationRecord = new PatientInformationRecord(); + patientInformationRecord.setId(snowflake.nextId()); patientInformationRecord.setPatientCarId(longs.get(0)); patientInformationRecord.setTaskSubId(param.getId()); patientInformationRecord.setInformationType((byte) 0); //上传图片 patientInformationRecord.setContent(param.getPictures().get(i)); //拿到图片 存到库里面 patientInformationRecord.setRecStatus((byte) 0); - patientInformationRecordMapper.insert(patientInformationRecord); + patientInformationRecordMapper.insertSelective(patientInformationRecord); } } - if(param.getRecords().isEmpty()) { //判断是否是记录是否为空 + if(!StringUtil.isEmpty(param.getRecords())) { //判断是否是记录是否为空 PatientInformationRecord patientInformationRecord = new PatientInformationRecord(); + patientInformationRecord.setId(snowflake.nextId()); patientInformationRecord.setPatientCarId(longs.get(0)); patientInformationRecord.setTaskSubId(param.getId()); patientInformationRecord.setInformationType((byte) 1); //上传记录 patientInformationRecord.setContent(param.getRecords()); //拿到记录 存到库里面 patientInformationRecord.setRecStatus((byte) 0); - patientInformationRecordMapper.insert(patientInformationRecord); + patientInformationRecordMapper.insertSelective(patientInformationRecord); } } } @@ -77,13 +84,11 @@ public class OtherRecordsService implements IOtherRecordsService { PatientInformationRecordExample patientInformationRecordExample = new PatientInformationRecordExample(); patientInformationRecordExample.createCriteria().andPatientCarIdEqualTo(longs.get(0)).andTaskSubIdEqualTo(param.getId()); List patientInformationRecords = patientInformationRecordMapper.selectByExample(patientInformationRecordExample); - int i=0; for (PatientInformationRecord patientInformationRecord : patientInformationRecords) { OtherRecordsVo.Query query = new OtherRecordsVo.Query(); query.setComment(patientInformationRecord.getContent()); query.setType(patientInformationRecord.getInformationType()); - i++; - patientInformationRecordList.set(i,query); + patientInformationRecordList.add(query); } } return patientInformationRecordList; From 400d75e2d282986bd4b0e2838eb8723c0bd2cbb4 Mon Sep 17 00:00:00 2001 From: zy_Java <654600784@qq.com> Date: Tue, 1 Jun 2021 23:13:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=BF=9B=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + pom.xml | 2 +- .../java/com/ccsens/tall/bean/vo/TaskVo.java | 27 +++++++++++++++++++ tall/src/main/resources/application.yml | 4 +-- .../test/java/com/ccsens/util/Base64Test.java | 2 -- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index bb34a739..073a0423 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ gen hs_err_pid* mbg.xml resources/mbg.xml +resources/application.yml diff --git a/pom.xml b/pom.xml index 6cdeb874..6a98bbc6 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ game mt - + wisdomcar beneficiation diff --git a/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java b/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java index acd62ac0..44e5c8c2 100644 --- a/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java +++ b/tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java @@ -85,6 +85,7 @@ public class TaskVo { } return null; } + } @ApiModel @Data @@ -137,6 +138,8 @@ public class TaskVo { private BigDecimal money; @ApiModelProperty("状态:0-未开始,1-进行中,2-已完成") private int process; + @ApiModelProperty("任务进行状态:0-未开始,1-进行中,2-已结束") + private int taskProgress; @ApiModelProperty("子项目id") private Long subProjectId; @ApiModelProperty("子项目名字") @@ -178,6 +181,30 @@ public class TaskVo { @ApiModelProperty("任务创建人(userId)") private String buildUser; + public int getTaskProgress() { + long now = System.currentTimeMillis(); + if(delay == 2){ + if(realBeginTime != null && realBeginTime != 0){ + if(realEndTime == null || realEndTime == 0){ + return 1; + } + return 2; + } + } + if(delay == 0){ + if(beginTime != null && endTime != null){ + if(beginTime > now){ + return 0; + } + if(endTime < now){ + return 2; + } + return 1; + } + } + return taskProgress; + } + public Long getDuration(){ if(ObjectUtil.isNotNull(beginTime) && ObjectUtil.isNotNull(endTime)) { return endTime - beginTime; diff --git a/tall/src/main/resources/application.yml b/tall/src/main/resources/application.yml index b5408a3a..ebc544af 100644 --- a/tall/src/main/resources/application.yml +++ b/tall/src/main/resources/application.yml @@ -1,5 +1,5 @@ spring: profiles: - active: dev - include: util-dev,common + active: test + include: util-test,common diff --git a/util/src/test/java/com/ccsens/util/Base64Test.java b/util/src/test/java/com/ccsens/util/Base64Test.java index 1a3ad02a..a987ed96 100644 --- a/util/src/test/java/com/ccsens/util/Base64Test.java +++ b/util/src/test/java/com/ccsens/util/Base64Test.java @@ -2,11 +2,9 @@ package com.ccsens.util; import cn.hutool.core.codec.Base64; import cn.hutool.core.util.ZipUtil; -import cn.hutool.core.util.ObjectUtil; import com.ccsens.util.exception.BaseException; import lombok.extern.slf4j.Slf4j; import org.junit.Test; -import org.springframework.util.ResourceUtils; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder;