|
@ -3,9 +3,8 @@ package com.yihu.wlyy.service.template;
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
|
|
import com.yihu.wlyy.entity.template.DoctorGuidanceTemp;
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
|
|
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
@ -21,6 +20,21 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
DoctorGuidanceTempDao guidanceTempDao;
|
|
DoctorGuidanceTempDao guidanceTempDao;
|
|
|
|
@Autowired
|
|
|
|
JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 记录医生健康指导模板使用次数
|
|
|
|
* @param modelCode 健康指导模板编码
|
|
|
|
*/
|
|
|
|
public void countSend(String modelCode){
|
|
|
|
synchronized (this){
|
|
|
|
String sql = "UPDATE wlyy_doctor_guidance_temp " +
|
|
|
|
"SET send_times=send_times+1 " +
|
|
|
|
"WHERE CODE=?";
|
|
|
|
jdbcTemplate.update(sql,modelCode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加指导模板
|
|
* 添加指导模板
|
|
@ -29,7 +43,7 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
* @param content 指导内容
|
|
* @param content 指导内容
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public DoctorGuidanceTemp add(String doctor, String content) {
|
|
|
|
|
|
public DoctorGuidanceTemp add(String doctor, String content,String modelName,String imagesUrl) {
|
|
DoctorGuidanceTemp guidanceTemp = new DoctorGuidanceTemp();
|
|
DoctorGuidanceTemp guidanceTemp = new DoctorGuidanceTemp();
|
|
|
|
|
|
guidanceTemp.setCode(getCode());
|
|
guidanceTemp.setCode(getCode());
|
|
@ -38,6 +52,9 @@ public class DoctorGuidanceTempService extends BaseService {
|
|
guidanceTemp.setSendTimes(0);
|
|
guidanceTemp.setSendTimes(0);
|
|
guidanceTemp.setCreateTime(new Date());
|
|
guidanceTemp.setCreateTime(new Date());
|
|
|
|
|
|
|
|
guidanceTemp.setModelName(modelName);
|
|
|
|
guidanceTemp.setImagesUrl(imagesUrl);
|
|
|
|
|
|
return guidanceTempDao.save(guidanceTemp);
|
|
return guidanceTempDao.save(guidanceTemp);
|
|
}
|
|
}
|
|
|
|
|