|
@@ -8,11 +8,14 @@ import cn.hnthyy.thmz.entity.his.mz.CriticalMessage;
|
|
|
import cn.hnthyy.thmz.entity.thmz.CriticalValue;
|
|
|
import cn.hnthyy.thmz.entity.thmz.User;
|
|
|
import cn.hnthyy.thmz.service.his.mz.CriticalMessageService;
|
|
|
+import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
|
|
|
import cn.hnthyy.thmz.service.thmz.CriticalValueService;
|
|
|
-import cn.hnthyy.thmz.service.thmz.UserRoleRelationService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.HaiCiAdapterService;
|
|
|
+import cn.hnthyy.thmz.service.thmz.UserDeptRelationService;
|
|
|
import cn.hnthyy.thmz.service.thmz.UserService;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.convert.Convert;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -30,6 +33,7 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
@@ -41,6 +45,13 @@ public class CriticalValueController {
|
|
|
private CriticalMessageService service;
|
|
|
@Resource
|
|
|
private UserService userService;
|
|
|
+ @Resource
|
|
|
+ private HaiCiAdapterService haiCiAdapterService;
|
|
|
+ @Resource
|
|
|
+ private UserDeptRelationService userDeptRelationService;
|
|
|
+ @Resource
|
|
|
+ private ZdUnitCodeService zdUnitCodeService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取危急值列表
|
|
@@ -110,12 +121,31 @@ public class CriticalValueController {
|
|
|
public R dealCriticalMessage(@RequestBody Map<String,Object> param) {
|
|
|
Integer id = Convert.toInt(param.get("id"));
|
|
|
AssertUtil.isNotBlank(id,"id 不能为空");
|
|
|
+ Date now = new Date();
|
|
|
CriticalMessage criticalMessage = CriticalMessage.builder()
|
|
|
.id(id)
|
|
|
.handleStaff(TokenUtil.getUser().getUserIdCode())
|
|
|
- .handleTime(new Date())
|
|
|
+ .handleTime(now)
|
|
|
.build();
|
|
|
service.updateById(criticalMessage);
|
|
|
+ Map<String, Object> receiptParam = new HashMap<>();
|
|
|
+ User user = userService.queryUserByUserIdCode(TokenUtil.getUser().getUserIdCode());
|
|
|
+ String deptCode = "";
|
|
|
+ String deptName = "";
|
|
|
+ List<String> depts = userDeptRelationService.queryAllByUserIdCode(TokenUtil.getUser().getUserIdCode());
|
|
|
+ if(CollUtil.isNotEmpty(depts)){
|
|
|
+ deptCode = depts.get(0);
|
|
|
+ deptName = zdUnitCodeService.queryDeptNameByIdInCache(deptCode);
|
|
|
+ }
|
|
|
+ CriticalMessage temp = service.getById(id);
|
|
|
+ receiptParam.put("msgId", temp.getMsgId());
|
|
|
+ receiptParam.put("departKey", deptCode);
|
|
|
+ receiptParam.put("departName", deptName);
|
|
|
+ receiptParam.put("doctorKey", user == null ? "": user.getUserCode());
|
|
|
+ receiptParam.put("doctorName",user == null ? "": user.getUserName());
|
|
|
+ receiptParam.put("receiptTime", DateUtil.formatDateTime(now));
|
|
|
+ receiptParam.put("content", "已处理");
|
|
|
+ haiCiAdapterService.criticalMessageReceipt(receiptParam);
|
|
|
return R.ok();
|
|
|
}
|
|
|
|