Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

pt
hyy-alt 4 years ago
parent
commit
812df8147c
  1. 2
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/ProjectDto.java
  2. 2
      recovery/src/main/java/com/ccsens/recovery/api/PatientController.java
  3. 2
      recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java
  4. 35
      recovery/src/main/java/com/ccsens/recovery/service/PatientService.java
  5. 2
      recovery/src/main/resources/application-dev.yml
  6. 4
      recovery/src/main/resources/application.yml
  7. 8
      recovery/src/main/resources/mapper_dao/PatientDao.xml
  8. 10
      recovery/src/main/resources/mapper_dao/RecDrillDao.xml
  9. 6
      tall/src/main/java/com/ccsens/tall/service/ProjectService.java
  10. 8
      tall/src/main/resources/application-dev.yml
  11. 4
      tall/src/main/resources/application.yml
  12. 1
      util/src/main/java/com/ccsens/util/baidu/BaiDuDto.java
  13. 47
      wisdomcar/src/main/java/com/ccsens/wisdomcar/api/ProjectController.java
  14. 2
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/CreateCaseDto.java
  15. 16
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/ProjectDto.java
  16. 47
      wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/ProjectVo.java
  17. 14
      wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/PatientDataDao.java
  18. 2
      wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/StepDao.java
  19. 7
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/IProjectService.java
  20. 11
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/ProjectService.java
  21. 5
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java
  22. 28
      wisdomcar/src/main/java/com/ccsens/wisdomcar/service/WisdomCarService.java
  23. 13
      wisdomcar/src/main/java/com/ccsens/wisdomcar/util/Constant.java
  24. 11
      wisdomcar/src/main/resources/mapper_dao/PatientDataDao.xml
  25. 3
      wisdomcar/src/main/resources/mapper_dao/StepDao.xml
  26. 2
      wisdomcar/src/main/resources/mapper_dao/StepTaskDao.xml

2
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/ProjectDto.java

@ -19,5 +19,7 @@ public class ProjectDto {
@NotNull(message = "请选择要复制得项目")
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("新项目名字")
private String projectName;
}
}

2
recovery/src/main/java/com/ccsens/recovery/api/PatientController.java

@ -102,7 +102,7 @@ public class PatientController {
}
@MustLogin
@ApiOperation(value = "开训练", notes = "zy:")
@ApiOperation(value = "开始一个训练", notes = "zy:")
@RequestMapping(value = "/start", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PatientVo.RecipeRecordId> startDrill(@ApiParam @Validated @RequestBody QueryDto<PatientDto.StartDrill> params) throws Exception {
log.info("开启训练:{}",params);

2
recovery/src/main/java/com/ccsens/recovery/bean/dto/PatientDto.java

@ -32,7 +32,7 @@ public class PatientDto {
@Data
@ApiModel("任务详情id")
public static class TaskDetailId{
@NotNull(message = "任务详情id")
@NotNull(message = "任务详情id不能为空")
@ApiModelProperty("任务详情id")
private Long detailId;
}

35
recovery/src/main/java/com/ccsens/recovery/service/PatientService.java

@ -50,6 +50,8 @@ public class PatientService implements IPatientService{
@Resource
private RecipeRecordMapper recipeRecordMapper;
@Resource
private RecipeProjectMapper recipeProjectMapper;
@Resource
private RecDrillDao recDrillDao;
@Resource
private RecoveryDoctorMapper recoveryDoctorMapper;
@ -105,7 +107,7 @@ public class PatientService implements IPatientService{
PatientRobot patientRobot = new PatientRobot();
patientRobot.setId(snowflake.nextId());
patientRobot.setPatientId(patient.getId());
patientRobot.setPatientId(robot.getId());
patientRobot.setRobotId(param.getRobotId());
patientRobot.setStartTime(System.currentTimeMillis());
patientRobotMapper.insertSelective(patientRobot);
@ -118,9 +120,19 @@ public class PatientService implements IPatientService{
@Override
public PatientVo.RecipeRecordId startDrill(PatientDto.StartDrill param, Long userId) throws Exception {
//查找患者
Patient patient = patientDao.selectByPrimaryKey(param.getPatientId());
if(ObjectUtil.isNull(patient)){
return null;
}
RecipeProject recipeProject = recipeProjectMapper.selectByPrimaryKey(param.getRecipeProjectId());
if(ObjectUtil.isNull(recipeProject)){
return null;
}
//存储一条训练记录
RecipeRecord recRecord = new RecipeRecord();
recRecord.setId(snowflake.nextId());
recRecord.setPatientId(param.getPatientId());
recRecord.setStartTime(System.currentTimeMillis());
recRecord.setDecomposeId(param.getRecipeProjectId());
recRecord.setRecoveryDoctorId(param.getSceneDoctorId());
@ -137,11 +149,14 @@ public class PatientService implements IPatientService{
data.setGameId(param.getGameId());
recoveryWithStartDrill.setData(data);
//查询患者当前关联的机器人
RecoveryRobot recoveryRobot = patientDao.getRobotByPatientId(param.getPatientId());
//查询接收者
Set<String> userIdSet = new HashSet<>();
userIdSet.add(recoveryRobot.getUserid().toString());
userIdSet.add(param.getPatientId().toString());
RecoveryRobot recoveryRobot = patientDao.getRobotByPatientId(param.getPatientId());
if(ObjectUtil.isNotNull(recoveryRobot)){
userIdSet.add(recoveryRobot.getUserid().toString());
}
//封装成inMessage
MessageRule messageRule = MessageRule.defaultRule(MessageConstant.DomainType.User);
messageRule.setAckRule(MessageRule.AckRule.NONE);
@ -215,17 +230,21 @@ public class PatientService implements IPatientService{
@Override
public PatientVo.PatientFullScreen fullScreen(PatientDto.TaskDetailId param, Long userId) {
PatientVo.PatientFullScreen patientFullScreen = patientDao.getPatientFllScreen(param.getDetailId());
List<RecipeVo.Game> gameList = recDrillDao.getGameByDrillId(patientFullScreen.getDrillId());
if (CollectionUtil.isNotEmpty(gameList)) {
patientFullScreen.setGameId(gameList.get(0).getId());
patientFullScreen.setGameName(gameList.get(0).getName());
patientFullScreen.setGameUrl(gameList.get(0).getGameUrl());
if(ObjectUtil.isNotNull(patientFullScreen)) {
List<RecipeVo.Game> gameList = recDrillDao.getGameByDrillId(patientFullScreen.getDrillId());
if (CollectionUtil.isNotEmpty(gameList)) {
patientFullScreen.setGameId(gameList.get(0).getId());
patientFullScreen.setGameName(gameList.get(0).getName());
patientFullScreen.setGameUrl(gameList.get(0).getGameUrl());
}
}
return patientFullScreen;
}
@Override
public void completeRecovery(PatientDto.EndRecovery param, Long userId) throws Exception {
//TODO 给患者和机器人关联的记录添加结束时间
//TODO 将处方项目关联的任务设为完成
//发送消息,让机器人切回康复中心的项目
Set<String> userIdSet = new HashSet<>();

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

@ -11,7 +11,7 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: test.tall.wiki
host: 192.168.4.113
# host: 127.0.0.1
password: 111111
port: 5672

4
recovery/src/main/resources/application.yml

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

8
recovery/src/main/resources/mapper_dao/PatientDao.xml

@ -137,15 +137,19 @@
FROM
t_patient p,
t_doctor d,
t_recipe re,
t_recipe_project rp,
t_recipe_project_decompose rpd,
t_rec_drill rd
WHERE
p.doctor_id = d.id
and re.patient_id = p.id
and re.id = rp.recipe_id
and rp.id = rpd.recipe_project_id
and rp.drill_id = rd.id
and p.rec_status = 0
and d.rec_status = 0
and re.rec_status = 0
and rp.rec_status = 0
and rpd.rec_status = 0
and rd.rec_status = 0
@ -172,7 +176,7 @@
p.`name` as `name`,
p.sex as sex,
p.age as age,
p.id_card as idCord,
p.id_card as idCard,
p.phone as phone,
p.address as address,
c.id as recoveryCentreId,
@ -189,7 +193,7 @@
and p.rec_status = 0
and d.rec_status = 0
and c.rec_status = 0
and c.id = #{recoveryCentreId}
and c.id = #{centreId}
and p.id_card like concat('%',#{idCard},'%')
</select>
</mapper>

10
recovery/src/main/resources/mapper_dao/RecDrillDao.xml

@ -5,11 +5,13 @@
<select id="getGameByDrillId" resultType="com.ccsens.recovery.bean.vo.RecipeVo$Game">
SELECT
*
g.id,
g.`name`,
g.game_url as gameUrl
FROM
t_rec_drill d
LEFT JOIN t_rec_drill_game dg on d.id = dg.drill_id and dg.rec_status = 0
LEFT JOIN t_rec_game g on g.id = dg.game_id = and g.rec_status = 0
t_rec_game g
LEFT JOIN t_rec_drill_game dg on g.id = dg.game_id and dg.rec_status = 0
LEFT JOIN t_rec_drill d on d.id = dg.drill_id and d.rec_status = 0
WHERE
d.rec_status = 0
and d.id = #{drillId}

6
tall/src/main/java/com/ccsens/tall/service/ProjectService.java

@ -1516,7 +1516,11 @@ public class ProjectService implements IProjectService {
BeanUtil.copyProperties(oldProject,newProject);
newProject.setId(snowflake.nextId());
newProject.setCreatorId(userId);
newProject.setName(oldProject.getName()+"-副本");
if (StrUtil.isNotBlank(param.getProjectName())){
newProject.setName(param.getProjectName());
}else{
newProject.setName(oldProject.getName()+"-副本");
}
newProject.setTemplate((byte)0);
newProject.setBeginTime(currentTime);
newProject.setEndTime(currentTime+timeDifference);

8
tall/src/main/resources/application-dev.yml

@ -11,11 +11,11 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 192.168.4.113
# host: 127.0.0.1
password: 111111
# host: 192.168.4.113
host: 127.0.0.1
password: guest
port: 5672
username: admin
username: guest
redis:
database: 0
host: 127.0.0.1

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

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

1
util/src/main/java/com/ccsens/util/baidu/BaiDuDto.java

@ -15,5 +15,6 @@ public class BaiDuDto {
public static class GeneralBasic{
private String image;
private String url;
private String detect_direction = "true";
}
}

47
wisdomcar/src/main/java/com/ccsens/wisdomcar/api/ProjectController.java

@ -1,23 +1,33 @@
package com.ccsens.wisdomcar.api;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ImageUtil;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.baidu.BaiDuDto;
import com.ccsens.util.baidu.BaiDuUtil;
import com.ccsens.util.baidu.BaiDuVo;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.wisdomcar.bean.dto.ProjectDto;
import com.ccsens.wisdomcar.bean.vo.ProjectVo;
import com.ccsens.wisdomcar.service.IProjectService;
import com.ccsens.wisdomcar.util.Constant;
import com.fasterxml.jackson.core.JsonProcessingException;
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 org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.Part;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
@ -52,6 +62,35 @@ public class ProjectController {
log.info("查询称重和剂量:{}", list);
return JsonResponse.newInstance().ok(list);
}
@MustLogin
@ApiOperation(value = "查询开始时间", notes = "whj")
@RequestMapping(value = "/getStartTime", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ProjectVo.GetStartTime> getStartTime(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.GetStartTime> params){
log.info("查询开始时间:{}", params);
ProjectVo.GetStartTime time = projectService.getStartTime(params.getParam(), params.getUserId());
log.info("查询开始时间结束:{}", time);
return JsonResponse.newInstance().ok(time);
}
// @MustLogin
@ApiOperation(value = "图像识别", notes = "whj")
@RequestMapping(value = "/identifyWords", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ProjectVo.PersonMsg> identifyWords(@RequestParam(required = true) Part part) throws IOException {
log.info("图像识别");
// 压缩图像
ByteArrayOutputStream out = new ByteArrayOutputStream();
ImageUtil.scale(ImageIO.read(part.getInputStream()), out, 0.5f);
String img = Base64.encode(out.toByteArray());
// 图像识别
BaiDuDto.GeneralBasic basic = new BaiDuDto.GeneralBasic();
basic.setImage(img);
BaiDuVo.GeneralBasic words = BaiDuUtil.accurateBasic(Constant.BaiDu.APP_KEY, Constant.BaiDu.SECRET_KEY, basic);
// 返回图像
ProjectVo.PersonMsg personMsg = new ProjectVo.PersonMsg();
personMsg.toMsg(words.getWordsResult());
log.info("图像识别结束:{}", personMsg);
return JsonResponse.newInstance().ok(personMsg);
}
@MustLogin

2
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/CreateCaseDto.java

@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Pattern;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -26,6 +27,7 @@ public class CreateCaseDto {
private int patientAge;
@ApiModelProperty("患者身份证号")
private String patientIdCard;
@Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号")
@ApiModelProperty("患者手机号")
private String patientPhone;
@ApiModelProperty("患者病案号")

16
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/dto/ProjectDto.java

@ -32,6 +32,22 @@ public class ProjectDto {
private Long taskSubId;
}
@Data
@ApiModel("查询任务开始时间--请求")
public static class GetStartTime {
@NotNull(message="请说明您的任务")
@ApiModelProperty("分解任务ID")
private Long taskSubId;
}
@Data
@ApiModel("图像识别--请求")
public static class Img {
@NotNull
@ApiModelProperty("文件路径")
private String url;
}
@Data
@ApiModel("切换项目")
public static class SwitchProject {

47
wisdomcar/src/main/java/com/ccsens/wisdomcar/bean/vo/ProjectVo.java

@ -1,9 +1,16 @@
package com.ccsens.wisdomcar.bean.vo;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdcardUtil;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.baidu.BaiDuVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @description:
* @author: whj
@ -40,4 +47,44 @@ public class ProjectVo {
private Long endTime;
}
@Data
@ApiModel("查询任务开始时间--响应")
public static class GetStartTime {
@ApiModelProperty("任务ID")
private Long taskSubId;
@ApiModelProperty("开始时间")
private Long startTime;
}
@Data
@ApiModel("身份信息")
public static class PersonMsg {
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("性别")
private byte sex;
@ApiModelProperty("身份证号")
private String idCardNo;
@ApiModelProperty("年龄")
private int age;
public void toMsg(List<BaiDuVo.GeneralWord> words) {
if (CollectionUtil.isEmpty(words)) {
return;
}
words.forEach(wordNode ->{
String word = wordNode.getWords();
if (word.startsWith("姓名")) {
this.name = word.substring(2);
} else if (word.startsWith("性别")) {
String sexWord = word.substring(2,3);
this.sex = "女".equals(sexWord) ? (byte)0 : (byte)1;
} else if (word.startsWith("公民身份号码")) {
this.idCardNo = word.substring(6);
this.age = IdcardUtil.getAgeByIdCard(this.idCardNo);
}
});
}
}
}

14
wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/PatientDataDao.java

@ -2,6 +2,7 @@ package com.ccsens.wisdomcar.persist.dao;
import com.ccsens.wisdomcar.bean.po.PatientData;
import com.ccsens.wisdomcar.bean.po.PatientDataExample;
import com.ccsens.wisdomcar.bean.vo.ProjectVo;
import com.ccsens.wisdomcar.persist.mapper.PatientDataMapper;
import org.apache.ibatis.annotations.Param;
@ -12,4 +13,17 @@ import java.util.List;
*/
public interface PatientDataDao extends PatientDataMapper {
/**
* 为和taskSubId中一批的尚无消息平车信息的记录添加平车记录
* @param carId 患者绑定平车ID
* @param taskSubId 任务ID
*/
void updateCarId(@Param("carId") Long carId, @Param("taskSubId") Long taskSubId);
/**
* 查询任务开始时间
* @param taskSubId 任务ID
* @return 开始时间
*/
ProjectVo.GetStartTime getStartTime(@Param("taskSubId") Long taskSubId);
}

2
wisdomcar/src/main/java/com/ccsens/wisdomcar/persist/dao/StepDao.java

@ -36,5 +36,5 @@ public interface StepDao extends StepMapper {
* @param patientCarId 患者平车id
* @return 环节信息
*/
List<StepVo.StepStatus> findStepIsOver(Long patientCarId);
List<StepVo.StepStatus> findStepIsOver(@Param("patientCarId") Long patientCarId);
}

7
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/IProjectService.java

@ -36,6 +36,13 @@ public interface IProjectService {
*/
void saveData(Long startTime, StepTask stepTask, Long operationId, byte operation);
/**
* 查询开始时间
* @param param 任务ID
* @param userId userId
* @return 开始时间
*/
ProjectVo.GetStartTime getStartTime(ProjectDto.GetStartTime param, Long userId);
/**
* 选择历史患者切换项目
* @param param 项目id

11
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/ProjectService.java

@ -72,11 +72,9 @@ public class ProjectService implements IProjectService {
if (step != null && max != null && step.getSequence() != null && step.getSequence().intValue() == max.intValue()) {
// 修改平车结束时间点
ProjectVo.BindCar bindCar = stepTaskDao.getBindCarTaskId(stepTask.getTaskSubId());
if (bindCar == null) {
boolean needModifyEndTime = bindCar != null && (bindCar.getEndTime() == null || bindCar.getEndTime() == 0);
if (needModifyEndTime) {
log.info("出现异常,未找到绑定平车:{}", stepTask.getTaskSubId());
throw new BaseException(CodeEnum.PARAM_ERROR);
}
if (bindCar.getEndTime() == null || bindCar.getEndTime() == 0) {
PatientWisdomCar patientWisdomCar = new PatientWisdomCar();
patientWisdomCar.setId(bindCar.getId());
patientWisdomCar.setEndTime(startTime);
@ -119,6 +117,11 @@ public class ProjectService implements IProjectService {
asyncService.pushTime(stepTask, data);
}
@Override
public ProjectVo.GetStartTime getStartTime(ProjectDto.GetStartTime param, Long userId) {
return patientDataDao.getStartTime(param.getTaskSubId());
}
@Override
public List<ProjectVo.Record> queryWeight(ProjectDto.Weight param, Long userId) {
ProjectVo.BindCar bindCar = stepTaskDao.getBindCarTaskId(param.getTaskSubId());

5
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/RecordService.java

@ -157,7 +157,10 @@ public class RecordService implements IRecordService{
if (carRecordMessageDto.getType() == Constant.CAR_RECORD_RFID && step != null && step.getStepType() == Constant.STEP_TYPE_REAL) {
// TODO 异步推送数据
StepTask stepTask = stepTaskDao.getByCarAndStep(wisdomCarRecord.getCarId(), step.getId(), wisdomCarRecord.getTime());
projectService.saveData(wisdomCarRecord.getTime(), stepTask, wisdomCarRecord.getId(), Constant.OPERATION_CAR);
if (stepTask != null) {
projectService.saveData(wisdomCarRecord.getTime(), stepTask, wisdomCarRecord.getId(), Constant.OPERATION_CAR);
}
}
}

28
wisdomcar/src/main/java/com/ccsens/wisdomcar/service/WisdomCarService.java

@ -1,6 +1,7 @@
package com.ccsens.wisdomcar.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException;
@ -65,7 +66,8 @@ public class WisdomCarService implements IWisdomCarService {
private IProjectService projectService;
@Resource
private PatientDoctorDao patientDoctorDao;
@Resource
private PatientDataDao patientDataDao;
@Override
public void createCase(CreateCaseDto.PatientInfo param, Long userId) {
@ -175,9 +177,15 @@ public class WisdomCarService implements IWisdomCarService {
}
//新项目名字
String newProjectName = "";
newProjectName = patient.getMedicalRecordNum()+"-"+Constant.PROJECT_NAME;
if (StrUtil.isNotBlank(param.getPatientName())){
newProjectName +="-"+param.getPatientName();
}
ProjectDto.CopyProject copyProject = new ProjectDto.CopyProject();
copyProject.setProjectId(Constant.TEMPLATE_PROJECT);
copyProject.setProjectId((Long) redisUtil.get(Constant.TEMPLATE_PROJECT_KEY));
copyProject.setProjectName(newProjectName);
log.info("调用tall内的复制项目:{}",copyProject);
QueryDto<ProjectDto.CopyProject> dto = new QueryDto<>();
dto.setParam(copyProject);
@ -285,14 +293,16 @@ public class WisdomCarService implements IWisdomCarService {
if (CollectionUtil.isEmpty(carRecords)) {
pc.setBindingStatus(Constant.PUSH_STATUS_SUCCESS);
patientWisdomCarDao.insertSelective(pc);
return;
} else {
carRecords.forEach(record -> {
projectService.saveData(record.getTime(), record.getStepTask(), record.getId(), Constant.OPERATION_CAR);
});
pc.setBindingStatus(Constant.PUSH_STATUS_SUCCESS);
patientWisdomCarDao.insertSelective(pc);
}
carRecords.forEach(record -> {
projectService.saveData(record.getTime(), record.getStepTask(), record.getId(), Constant.OPERATION_CAR);
});
pc.setBindingStatus(Constant.PUSH_STATUS_SUCCESS);
patientWisdomCarDao.insertSelective(pc);
// 更新患者数据中,尚未绑定平车的数据
patientDataDao.updateCarId(pc.getId(), param.getTaskSubId());
}
@Override

13
wisdomcar/src/main/java/com/ccsens/wisdomcar/util/Constant.java

@ -52,7 +52,12 @@ public class Constant {
/**
* 智慧平车,模板项目id
*/
public static final Long TEMPLATE_PROJECT = 1399649478197252096L;
public static final String TEMPLATE_PROJECT_KEY = "template_project_key";
// public static final Long TEMPLATE_PROJECT = 1399649478197252096L;
/**
* 项目名字
*/
public static final String PROJECT_NAME = "卒中急救流程";
/**
* 角色名称:患者家属
@ -124,4 +129,10 @@ public class Constant {
* 调用Tall异常
*/
public static final Byte TASK_DETAIL_LEVEL_TWO = 2;
public static class BaiDu{
public static final String APP_KEY = "F43SLi3hDra3EgWiSi8bIH8c";
public static final String SECRET_KEY = "wGhbTXGsrbxfuCQT7WyLDndYRxrSYqbD";
public static final String KEY = "key";
public static final String NUM = "num";
}
}

11
wisdomcar/src/main/resources/mapper_dao/PatientDataDao.xml

@ -2,4 +2,15 @@
<!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.PatientDataDao">
<update id="updateCarId">
update t_patient_data set patient_car_id = #{carId} where task_sub_id in
(select t2.id from t_step_task t1, t_step_task t2
where t1.patient_id = t2.patient_id and t1.batch = t2.batch
and t1.task_sub_id = #{taskSubId}
and t1.rec_status = 0 and t2.rec_status = 0)
and patient_car_id = 0 and rec_status = 0
</update>
<select id="getStartTime" resultType="com.ccsens.wisdomcar.bean.vo.ProjectVo$GetStartTime">
select task_sub_id as taskSubId, start_time as startTime from t_patient_data where task_sub_id = #{taskSubId} and rec_status = 0
</select>
</mapper>

3
wisdomcar/src/main/resources/mapper_dao/StepDao.xml

@ -51,10 +51,11 @@
FROM
t_step AS s
LEFT JOIN t_patient_data AS pd ON s.id = pd.step_id
AND pd.patient_car_id = 0
AND pd.patient_car_id = #{patientCarId}
LEFT JOIN t_hospital_member AS hm ON pd.user_id = hm.user_id
WHERE
s.step_type = 0
ORDER BY s.`code`+1
</select>

2
wisdomcar/src/main/resources/mapper_dao/StepTaskDao.xml

@ -23,7 +23,7 @@
AND st.batch = st2.batch
AND st2.step_id = #{stepId}
AND pc.car_id = #{carId}
AND pc.start_time $lt;= #{time} AND pc.end_time = 0 AND pc.start_time > #{time - 2 * 60 * 60 * 1000}
AND pc.start_time $lt;= #{time} AND pc.end_time = 0 AND pc.start_time + 2 * 60 * 60 * 1000 > #{time}
order by pc.created_at desc limit 1
</select>
</mapper>
Loading…
Cancel
Save