|
@@ -7,19 +7,24 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.ruoyi.common.annotation.DataScope;
|
|
import com.ruoyi.common.annotation.DataScope;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.web.work.api.util.AppUtil;
|
|
import com.ruoyi.web.work.api.util.AppUtil;
|
|
import com.ruoyi.web.work.domain.FollowRecord;
|
|
import com.ruoyi.web.work.domain.FollowRecord;
|
|
|
|
+import com.ruoyi.web.work.domain.User;
|
|
import com.ruoyi.web.work.domain.dto.FollowRecordDto;
|
|
import com.ruoyi.web.work.domain.dto.FollowRecordDto;
|
|
import com.ruoyi.web.work.domain.dto.VisitDto;
|
|
import com.ruoyi.web.work.domain.dto.VisitDto;
|
|
import com.ruoyi.web.work.domain.vo.FollowRecordVoList;
|
|
import com.ruoyi.web.work.domain.vo.FollowRecordVoList;
|
|
import com.ruoyi.web.work.domain.vo.VisitVoList;
|
|
import com.ruoyi.web.work.domain.vo.VisitVoList;
|
|
import com.ruoyi.web.work.mapper.FollowRecordMapper;
|
|
import com.ruoyi.web.work.mapper.FollowRecordMapper;
|
|
|
|
+import com.ruoyi.web.work.mapper.UserMapper;
|
|
import com.ruoyi.web.work.service.IFollowRecordService;
|
|
import com.ruoyi.web.work.service.IFollowRecordService;
|
|
import com.ruoyi.web.work.service.IUserService;
|
|
import com.ruoyi.web.work.service.IUserService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.core.env.Environment;
|
|
import org.springframework.core.env.Environment;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.text.ParseException;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -39,7 +44,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
|
|
@Autowired
|
|
@Autowired
|
|
private Environment env;
|
|
private Environment env;
|
|
|
|
|
|
- @DataScope(deptAlias = "k",userAlias = "k")
|
|
|
|
|
|
+ @DataScope(deptAlias = "k", userAlias = "k")
|
|
@Override
|
|
@Override
|
|
public List<FollowRecord> selectList(FollowRecord followRecord) {
|
|
public List<FollowRecord> selectList(FollowRecord followRecord) {
|
|
return followRecordMapper.selectList(followRecord);
|
|
return followRecordMapper.selectList(followRecord);
|
|
@@ -97,6 +102,9 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
|
|
if (!saveBatch(followRecordList)) {
|
|
if (!saveBatch(followRecordList)) {
|
|
throw new ServiceException("新增回访记录失败");
|
|
throw new ServiceException("新增回访记录失败");
|
|
}
|
|
}
|
|
|
|
+ followRecordList.forEach(e -> {
|
|
|
|
+ sendMessage(e);
|
|
|
|
+ });
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -107,6 +115,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
|
|
return AjaxResult.error("复诊提醒不存在或非法操作");
|
|
return AjaxResult.error("复诊提醒不存在或非法操作");
|
|
}
|
|
}
|
|
followRecord.setState(1);
|
|
followRecord.setState(1);
|
|
|
|
+ followRecord.setReturnTime(new Date());
|
|
updateById(followRecord);
|
|
updateById(followRecord);
|
|
return AjaxResult.success();
|
|
return AjaxResult.success();
|
|
}
|
|
}
|
|
@@ -117,26 +126,25 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
|
|
JSONObject body = new JSONObject();
|
|
JSONObject body = new JSONObject();
|
|
body.set("appid", env.getProperty("wx.appid"));
|
|
body.set("appid", env.getProperty("wx.appid"));
|
|
JSONObject content = new JSONObject();
|
|
JSONObject content = new JSONObject();
|
|
- //复诊提醒
|
|
|
|
|
|
+ User user = userService.selectUserByPatientId(record.getPatientId());
|
|
|
|
+ if (user == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ body.set("touser", user.getOpenId());
|
|
|
|
+ body.set("page", "pages/user/index?patientId="+record.getPatientId());
|
|
|
|
+ //复查提醒
|
|
if (record.getType() == 0) {
|
|
if (record.getType() == 0) {
|
|
- /* User user = userService.getById(record.getPatientId);
|
|
|
|
- body.set("touser", user.getOpenId());
|
|
|
|
- body.set("template_id", "PtdKbqfzmpvGsJPx_YekDX4-cljbhOXcvoUB3XJaVLg");
|
|
|
|
- body.set("page", "pages/user/money/index");
|
|
|
|
- content.set("amount3", new JSONObject().set("value", pay.getMoney() + "元"));//提现金额
|
|
|
|
- content.set("character_string4", new JSONObject().set("value", pay.getNums()));//交易单号
|
|
|
|
- content.set("time2", new JSONObject().set("value", DateUtils.getTime())); //提现时间*/
|
|
|
|
|
|
+ body.set("template_id", "S6JARkInVBjID8QMpgZdSHNyxeMDZQq7lur8YrNK0oY");
|
|
|
|
+ content.set("thing1", new JSONObject().set("value", record.getTemplateName()));//复查提醒名称
|
|
|
|
+ content.set("thing3", new JSONObject().set("value", "岑溪人民医院"));//复查机构
|
|
|
|
+ content.set("thing6", new JSONObject().set("value", StringUtils.truncateTo12Chars(record.getOp())));//备注
|
|
}
|
|
}
|
|
//随访提醒
|
|
//随访提醒
|
|
if (record.getType() == 1) {
|
|
if (record.getType() == 1) {
|
|
- /* User user = userService.getById(pay.getUserId());
|
|
|
|
- body.set("touser", user.getOpenId());
|
|
|
|
- body.set("template_id", "NIqSQq0j765o9Iz9gMiSelnuxMgPIPeCnk3lvEnWJlo");
|
|
|
|
- body.set("page", "pages/user/money/index");
|
|
|
|
- content.set("amount3", new JSONObject().set("value", pay.getMoney() + "元"));//提现金额
|
|
|
|
- content.set("character_string4", new JSONObject().set("value", pay.getNums()));//交易单号
|
|
|
|
- content.set("thing5", new JSONObject().set("value", pay.getMsg())); //失败原因
|
|
|
|
- content.set("time2", new JSONObject().set("value", DateUtils.getTime())); //提现时间*/
|
|
|
|
|
|
+ body.set("template_id", "1Jvx8F22na-tG2Q6HFX_3vRtbiv7zZko6NwX8ICIFXc");
|
|
|
|
+ content.set("thing11", new JSONObject().set("value", record.getTemplateName()));//随访名称
|
|
|
|
+ content.set("thing2", new JSONObject().set("value", "岑溪人民医院"));//随访机构
|
|
|
|
+ content.set("phrase3", new JSONObject().set("value", record.getPatientName()));//就诊人
|
|
}
|
|
}
|
|
body.set("data", content);
|
|
body.set("data", content);
|
|
String result = HttpUtil.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + jsonObject.getStr("access_token"), body.toString());
|
|
String result = HttpUtil.post("https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=" + jsonObject.getStr("access_token"), body.toString());
|