Browse Source

conflict

pt
zhizhi wu 5 years ago
parent
commit
b90b904f85
  1. 1
      .gitignore
  2. 27
      tall/src/main/java/com/ccsens/tall/bean/vo/TaskVo.java
  3. 5
      tall/src/main/resources/application.yml
  4. 2
      tall/src/main/resources/mapper_raw/ProRoleMapper.xml
  5. 2
      util/src/test/java/com/ccsens/util/Base64Test.java
  6. 54
      wisdomcar/src/main/java/com/ccsens/wisdomcar/api/OtherRecordsController.java
  7. 33
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/OtherRecordsDto.java
  8. 106
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientInformationRecord.java
  9. 691
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientInformationRecordExample.java
  10. 26
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/OtherRecordsVo.java
  11. 11
      wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/PatientWisdomCarDao.java
  12. 30
      wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/PatientInformationRecordMapper.java
  13. 24
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/IOtherRecordsService.java
  14. 96
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java
  15. 2
      wisdomcar/src/main/resources/application-dev.yml
  16. 17
      wisdomcar/src/main/resources/mapper_dao/PatientWisdomCarDao.xml
  17. 259
      wisdomcar/src/main/resources/mapper_raw/PatientInformationRecordMapper.xml
  18. 4
      wisdomcar/src/main/resources/mapper_raw/PatientWisdomCarMapper.xml

1
.gitignore

@ -40,3 +40,4 @@ gen
hs_err_pid*
mbg.xml
resources/mbg.xml
resources/application.yml

27
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;

5
tall/src/main/resources/application.yml

@ -1,5 +1,6 @@
spring:
profiles:
active: prod
include: util-prod,common
active: test
include: util-test,common

2
tall/src/main/resources/mapper_raw/ProRoleMapper.xml

@ -86,7 +86,7 @@
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">

2
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;

54
wisdomcar/src/main/java/com/ccsens/wisdomcar/api/OtherRecordsController.java

@ -0,0 +1,54 @@
package com.ccsens.wisdomcar.api;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.wisdomcar.bean.dto.OtherRecordsDto;
import com.ccsens.wisdomcar.bean.dto.RecordDto;
import com.ccsens.wisdomcar.bean.vo.OtherRecordsVo;
import com.ccsens.wisdomcar.bean.vo.RecordVo;
import com.ccsens.wisdomcar.service.IOtherRecordsService;
import com.ccsens.wisdomcar.service.IRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@Slf4j
@Api(tags = "上传图片和记录" , description = "")
@RestController
@RequestMapping("/otherRecords")
public class OtherRecordsController {
@Resource
private IOtherRecordsService iOtherRecordsService;
@ApiOperation(value = "上传图片和记录", notes = "")
@RequestMapping(value = "/upload", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse upload(@ApiParam @Validated @RequestBody QueryDto<OtherRecordsDto.PicturesAndRecords> params){
log.info("上传图片和记录:{}", params);
iOtherRecordsService.upload(params.getParam());
log.info("上传图片和记录成功");
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "查询上传图片和记录", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<OtherRecordsVo.Query>> query(@ApiParam @Validated @RequestBody QueryDto<OtherRecordsDto.Query> params){
log.info("查询上传图片和记录:{}", params);
List<OtherRecordsVo.Query> list = iOtherRecordsService.query(params.getParam());
log.info("查询上传图片和记录成功");
return JsonResponse.newInstance().ok(list);
}
}

33
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/OtherRecordsDto.java

@ -0,0 +1,33 @@
package com.ccsens.wisdomcar.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @description: 上传图片和记录
* @author:
* @time:
*/
@Data
public class OtherRecordsDto {
@Data
@ApiModel("上传图片和记录")
public static class PicturesAndRecords {
@ApiModelProperty("分解任务id")
private Long id;
@ApiModelProperty("上传图片")
private List<String> pictures;
@ApiModelProperty("上传记录")
private String records;
}
@Data
@ApiModel("查询上传图片和记录")
public static class Query {
@ApiModelProperty("分解任务id")
private Long id;
}
}

106
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientInformationRecord.java

@ -0,0 +1,106 @@
package com.ccsens.wisdomcar.bean.po;
import java.io.Serializable;
import java.util.Date;
public class PatientInformationRecord implements Serializable {
private Long id;
private Long patientCarId;
private Long taskSubId;
private Byte informationType;
private String content;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPatientCarId() {
return patientCarId;
}
public void setPatientCarId(Long patientCarId) {
this.patientCarId = patientCarId;
}
public Long getTaskSubId() {
return taskSubId;
}
public void setTaskSubId(Long taskSubId) {
this.taskSubId = taskSubId;
}
public Byte getInformationType() {
return informationType;
}
public void setInformationType(Byte informationType) {
this.informationType = informationType;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", patientCarId=").append(patientCarId);
sb.append(", taskSubId=").append(taskSubId);
sb.append(", informationType=").append(informationType);
sb.append(", content=").append(content);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

691
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/po/PatientInformationRecordExample.java

@ -0,0 +1,691 @@
package com.ccsens.wisdomcar.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class PatientInformationRecordExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PatientInformationRecordExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andPatientCarIdIsNull() {
addCriterion("patient_car_id is null");
return (Criteria) this;
}
public Criteria andPatientCarIdIsNotNull() {
addCriterion("patient_car_id is not null");
return (Criteria) this;
}
public Criteria andPatientCarIdEqualTo(Long value) {
addCriterion("patient_car_id =", value, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdNotEqualTo(Long value) {
addCriterion("patient_car_id <>", value, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdGreaterThan(Long value) {
addCriterion("patient_car_id >", value, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdGreaterThanOrEqualTo(Long value) {
addCriterion("patient_car_id >=", value, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdLessThan(Long value) {
addCriterion("patient_car_id <", value, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdLessThanOrEqualTo(Long value) {
addCriterion("patient_car_id <=", value, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdIn(List<Long> values) {
addCriterion("patient_car_id in", values, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdNotIn(List<Long> values) {
addCriterion("patient_car_id not in", values, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdBetween(Long value1, Long value2) {
addCriterion("patient_car_id between", value1, value2, "patientCarId");
return (Criteria) this;
}
public Criteria andPatientCarIdNotBetween(Long value1, Long value2) {
addCriterion("patient_car_id not between", value1, value2, "patientCarId");
return (Criteria) this;
}
public Criteria andTaskSubIdIsNull() {
addCriterion("task_sub_id is null");
return (Criteria) this;
}
public Criteria andTaskSubIdIsNotNull() {
addCriterion("task_sub_id is not null");
return (Criteria) this;
}
public Criteria andTaskSubIdEqualTo(Long value) {
addCriterion("task_sub_id =", value, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdNotEqualTo(Long value) {
addCriterion("task_sub_id <>", value, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdGreaterThan(Long value) {
addCriterion("task_sub_id >", value, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdGreaterThanOrEqualTo(Long value) {
addCriterion("task_sub_id >=", value, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdLessThan(Long value) {
addCriterion("task_sub_id <", value, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdLessThanOrEqualTo(Long value) {
addCriterion("task_sub_id <=", value, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdIn(List<Long> values) {
addCriterion("task_sub_id in", values, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdNotIn(List<Long> values) {
addCriterion("task_sub_id not in", values, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdBetween(Long value1, Long value2) {
addCriterion("task_sub_id between", value1, value2, "taskSubId");
return (Criteria) this;
}
public Criteria andTaskSubIdNotBetween(Long value1, Long value2) {
addCriterion("task_sub_id not between", value1, value2, "taskSubId");
return (Criteria) this;
}
public Criteria andInformationTypeIsNull() {
addCriterion("information_type is null");
return (Criteria) this;
}
public Criteria andInformationTypeIsNotNull() {
addCriterion("information_type is not null");
return (Criteria) this;
}
public Criteria andInformationTypeEqualTo(Byte value) {
addCriterion("information_type =", value, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeNotEqualTo(Byte value) {
addCriterion("information_type <>", value, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeGreaterThan(Byte value) {
addCriterion("information_type >", value, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("information_type >=", value, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeLessThan(Byte value) {
addCriterion("information_type <", value, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeLessThanOrEqualTo(Byte value) {
addCriterion("information_type <=", value, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeIn(List<Byte> values) {
addCriterion("information_type in", values, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeNotIn(List<Byte> values) {
addCriterion("information_type not in", values, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeBetween(Byte value1, Byte value2) {
addCriterion("information_type between", value1, value2, "informationType");
return (Criteria) this;
}
public Criteria andInformationTypeNotBetween(Byte value1, Byte value2) {
addCriterion("information_type not between", value1, value2, "informationType");
return (Criteria) this;
}
public Criteria andContentIsNull() {
addCriterion("content is null");
return (Criteria) this;
}
public Criteria andContentIsNotNull() {
addCriterion("content is not null");
return (Criteria) this;
}
public Criteria andContentEqualTo(String value) {
addCriterion("content =", value, "content");
return (Criteria) this;
}
public Criteria andContentNotEqualTo(String value) {
addCriterion("content <>", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThan(String value) {
addCriterion("content >", value, "content");
return (Criteria) this;
}
public Criteria andContentGreaterThanOrEqualTo(String value) {
addCriterion("content >=", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThan(String value) {
addCriterion("content <", value, "content");
return (Criteria) this;
}
public Criteria andContentLessThanOrEqualTo(String value) {
addCriterion("content <=", value, "content");
return (Criteria) this;
}
public Criteria andContentLike(String value) {
addCriterion("content like", value, "content");
return (Criteria) this;
}
public Criteria andContentNotLike(String value) {
addCriterion("content not like", value, "content");
return (Criteria) this;
}
public Criteria andContentIn(List<String> values) {
addCriterion("content in", values, "content");
return (Criteria) this;
}
public Criteria andContentNotIn(List<String> values) {
addCriterion("content not in", values, "content");
return (Criteria) this;
}
public Criteria andContentBetween(String value1, String value2) {
addCriterion("content between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andContentNotBetween(String value1, String value2) {
addCriterion("content not between", value1, value2, "content");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

26
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/OtherRecordsVo.java

@ -0,0 +1,26 @@
package com.ccsens.wisdomcar.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @description: 上传图片和记录
* @author:
* @time:
*/
@Data
public class OtherRecordsVo {
@Data
@ApiModel("查询上传图片和记录")
public static class Query {
@ApiModelProperty("类型(0-图片,1-文本)")
private byte type;
@ApiModelProperty("内容")
private String comment;
}
}

11
wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/PatientWisdomCarDao.java

@ -0,0 +1,11 @@
package com.ccsens.wisdomcar.persist.dao;
import com.ccsens.wisdomcar.persist.mapper.PatientWisdomCarMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface PatientWisdomCarDao extends PatientWisdomCarMapper {
List<Long> queryByNew(@Param("id")Long id);
}

30
wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/mapper/PatientInformationRecordMapper.java

@ -0,0 +1,30 @@
package com.ccsens.wisdomcar.persist.mapper;
import com.ccsens.wisdomcar.bean.po.PatientInformationRecord;
import com.ccsens.wisdomcar.bean.po.PatientInformationRecordExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface PatientInformationRecordMapper {
long countByExample(PatientInformationRecordExample example);
int deleteByExample(PatientInformationRecordExample example);
int deleteByPrimaryKey(Long id);
int insert(PatientInformationRecord record);
int insertSelective(PatientInformationRecord record);
List<PatientInformationRecord> selectByExample(PatientInformationRecordExample example);
PatientInformationRecord selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") PatientInformationRecord record, @Param("example") PatientInformationRecordExample example);
int updateByExample(@Param("record") PatientInformationRecord record, @Param("example") PatientInformationRecordExample example);
int updateByPrimaryKeySelective(PatientInformationRecord record);
int updateByPrimaryKey(PatientInformationRecord record);
}

24
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/IOtherRecordsService.java

@ -0,0 +1,24 @@
package com.ccsens.wisdomcar.service;
import com.ccsens.wisdomcar.bean.dto.Message.CarRecordMessageDto;
import com.ccsens.wisdomcar.bean.dto.OtherRecordsDto;
import com.ccsens.wisdomcar.bean.vo.OtherRecordsVo;
import java.util.List;
public interface IOtherRecordsService {
/**
* 上传图片和记录
* @param
* @throws
*/
void upload(OtherRecordsDto.PicturesAndRecords param);
/**
* 查询上传图片和记录
* @param
* @throws
*/
List<OtherRecordsVo.Query> query(OtherRecordsDto.Query param);
}

96
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/OtherRecordsService.java

@ -0,0 +1,96 @@
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;
import com.ccsens.wisdomcar.bean.po.PatientWisdomCar;
import com.ccsens.wisdomcar.bean.po.PatientWisdomCarExample;
import com.ccsens.wisdomcar.bean.vo.OtherRecordsVo;
import com.ccsens.wisdomcar.persist.dao.PatientWisdomCarDao;
import com.ccsens.wisdomcar.persist.mapper.PatientInformationRecordMapper;
import com.ccsens.wisdomcar.persist.mapper.PatientWisdomCarMapper;
import com.ccsens.wisdomcar.persist.mapper.WisdomCarMapper;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.management.ObjectName;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class OtherRecordsService implements IOtherRecordsService {
@Resource
private PatientWisdomCarMapper patientWisdomCarMapper;
@Resource
private PatientWisdomCarDao patientWisdomCarDao;
@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<Long> longs = patientWisdomCarDao.queryByNew(param.getId()); //拿到患者平车id
if(ObjectUtil.isNotNull(longs)){
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.insertSelective(patientInformationRecord);
}
}
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.insertSelective(patientInformationRecord);
}
}
}
@Override
public List<OtherRecordsVo.Query> query(OtherRecordsDto.Query param) {
List<OtherRecordsVo.Query> patientInformationRecordList = new ArrayList<>();
//通过任务id 找到创建的最新的
List<Long> longs = patientWisdomCarDao.queryByNew(param.getId()); //拿到患者平车id
if(ObjectUtil.isNotNull(longs)){
PatientInformationRecordExample patientInformationRecordExample = new PatientInformationRecordExample();
patientInformationRecordExample.createCriteria().andPatientCarIdEqualTo(longs.get(0)).andTaskSubIdEqualTo(param.getId());
List<PatientInformationRecord> patientInformationRecords = patientInformationRecordMapper.selectByExample(patientInformationRecordExample);
for (PatientInformationRecord patientInformationRecord : patientInformationRecords) {
OtherRecordsVo.Query query = new OtherRecordsVo.Query();
query.setComment(patientInformationRecord.getContent());
query.setType(patientInformationRecord.getInformationType());
patientInformationRecordList.add(query);
}
}
return patientInformationRecordList;
}
}

2
wisdomcar/src/main/resources/application-dev.yml

@ -10,7 +10,7 @@ spring:
rabbitmq:
# host: 192.144.182.42
# host: test.tall.wiki
host: 192.168.0.99
host: 192.168.4.113
password: 111111
port: 5672
username: admin

17
wisdomcar/src/main/resources/mapper_dao/PatientWisdomCarDao.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.wisdomcar.persist.dao.PatientWisdomCarDao">
<select id="queryByNew" parameterType="java.util.Map" resultType="Long">
Select
c.id
From
`t_patient_wisdom_car` c
WHERE c.task_sub_id=#{id}
order by
c.`created_at`
desc
limit 1
</select>
</mapper>

259
wisdomcar/src/main/resources/mapper_raw/PatientInformationRecordMapper.xml

@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.wisdomcar.persist.mapper.PatientInformationRecordMapper">
<resultMap id="BaseResultMap" type="com.ccsens.wisdomcar.bean.po.PatientInformationRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="patient_car_id" jdbcType="BIGINT" property="patientCarId" />
<result column="task_sub_id" jdbcType="BIGINT" property="taskSubId" />
<result column="information_type" jdbcType="TINYINT" property="informationType" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, patient_car_id, task_sub_id, information_type, content, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.wisdomcar.bean.po.PatientInformationRecordExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_patient_information_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_patient_information_record
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_patient_information_record
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.wisdomcar.bean.po.PatientInformationRecordExample">
delete from t_patient_information_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.wisdomcar.bean.po.PatientInformationRecord">
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>
<insert id="insertSelective" parameterType="com.ccsens.wisdomcar.bean.po.PatientInformationRecord">
insert into t_patient_information_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="patientCarId != null">
patient_car_id,
</if>
<if test="taskSubId != null">
task_sub_id,
</if>
<if test="informationType != null">
information_type,
</if>
<if test="content != null">
content,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="patientCarId != null">
#{patientCarId,jdbcType=BIGINT},
</if>
<if test="taskSubId != null">
#{taskSubId,jdbcType=BIGINT},
</if>
<if test="informationType != null">
#{informationType,jdbcType=TINYINT},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.wisdomcar.bean.po.PatientInformationRecordExample" resultType="java.lang.Long">
select count(*) from t_patient_information_record
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_patient_information_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.patientCarId != null">
patient_car_id = #{record.patientCarId,jdbcType=BIGINT},
</if>
<if test="record.taskSubId != null">
task_sub_id = #{record.taskSubId,jdbcType=BIGINT},
</if>
<if test="record.informationType != null">
information_type = #{record.informationType,jdbcType=TINYINT},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.wisdomcar.bean.po.PatientInformationRecord">
update t_patient_information_record
<set>
<if test="patientCarId != null">
patient_car_id = #{patientCarId,jdbcType=BIGINT},
</if>
<if test="taskSubId != null">
task_sub_id = #{taskSubId,jdbcType=BIGINT},
</if>
<if test="informationType != null">
information_type = #{informationType,jdbcType=TINYINT},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.wisdomcar.bean.po.PatientInformationRecord">
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}
</update>
</mapper>

4
wisdomcar/src/main/resources/mapper_raw/PatientWisdomCarMapper.xml

@ -73,7 +73,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, patient_id, task_sub_id, car_id, start_time, end_time, is_demo, created_at, updated_at,
id, patient_id, task_sub_id, car_id, start_time, end_time, is_demo, created_at, updated_at,
rec_status, binding_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCarExample" resultMap="BaseResultMap">
@ -109,7 +109,7 @@
<insert id="insert" parameterType="com.ccsens.wisdomcar.bean.po.PatientWisdomCar">
insert into t_patient_wisdom_car (id, patient_id, task_sub_id,
car_id, start_time, end_time,
is_demo, created_at, updated_at,
is_demo, created_at, updated_at,
rec_status, binding_status)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{taskSubId,jdbcType=BIGINT},
#{carId,jdbcType=BIGINT}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT},

Loading…
Cancel
Save