|
|
@@ -3,6 +3,7 @@ package com.fs.his.service.impl;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
@@ -23,6 +24,8 @@ import com.fs.his.service.IFsStoreOrderService;
|
|
|
import com.fs.his.utils.ConfigUtil;
|
|
|
import com.fs.his.utils.qrcode.QRCodeUtils;
|
|
|
import com.fs.his.vo.*;
|
|
|
+import com.fs.hospital580.entity.Hospital580PrescriptionScrmEntity;
|
|
|
+import com.fs.hospital580.service.Hospital580PrescriptionScrmService;
|
|
|
import com.fs.im.dto.MsgCustomDTO;
|
|
|
import com.fs.im.dto.MsgDTO;
|
|
|
import com.fs.im.dto.MsgDataDTO;
|
|
|
@@ -45,6 +48,7 @@ import java.lang.reflect.Field;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.net.URL;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -80,6 +84,10 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
ConfigUtil configUtil;
|
|
|
@Autowired
|
|
|
FsExportTaskMapper fsExportTaskMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private Hospital580PrescriptionScrmService orderScrmService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询处方
|
|
|
*
|
|
|
@@ -778,6 +786,58 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void auditPrescribe580() {
|
|
|
+ List<Hospital580PrescriptionScrmEntity> prescriptionScrmEntities = orderScrmService.list(new LambdaQueryWrapper<Hospital580PrescriptionScrmEntity>()
|
|
|
+ .eq(Hospital580PrescriptionScrmEntity::getPrescriptionStatus, 1)
|
|
|
+ .eq(Hospital580PrescriptionScrmEntity::getAuditStatus, 1));
|
|
|
+ for (Hospital580PrescriptionScrmEntity fsPrescribe : prescriptionScrmEntities) {
|
|
|
+ // 西药
|
|
|
+ Long id = doctorMapper.selectFsDoctorType2Ids(1);
|
|
|
+ FsPrescribeAuditParam param=new FsPrescribeAuditParam();
|
|
|
+ param.setDoctorId(id);
|
|
|
+ param.setPrescribeId(fsPrescribe.getPreId());
|
|
|
+ audit580(param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public R audit580(FsPrescribeAuditParam param){
|
|
|
+ Hospital580PrescriptionScrmEntity prescribe=orderScrmService.getById(param.getPrescribeId());
|
|
|
+ prescribe.setAuditStatus(param.getStatus().equals(1)?2:3);
|
|
|
+ prescribe.setAuditTime(LocalDateTime.now());
|
|
|
+ FsDoctor doctor=doctorService.selectFsDoctorByDoctorId(param.getDoctorId());
|
|
|
+ prescribe.setAuditApothecaryName(doctor.getDoctorName());
|
|
|
+ prescribe.setReason(param.getAuditReason());
|
|
|
+ prescribe.updateById();
|
|
|
+ if(param.getStatus().equals(1)){
|
|
|
+ //发送信息
|
|
|
+ String orderId= String.valueOf(prescribe.getStoreOrderId());
|
|
|
+ MsgDTO msgDTO=new MsgDTO();
|
|
|
+ MsgCustomDTO customDTO=new MsgCustomDTO();
|
|
|
+ customDTO.setType("inquiry");
|
|
|
+ customDTO.setOrderId(orderId);
|
|
|
+ customDTO.setImType(1);
|
|
|
+ customDTO.setOrderType(prescribe.getServiceType().equals(0)?1:2);
|
|
|
+ msgDTO.setCloudCustomData(JSONUtil.toJsonStr(customDTO));
|
|
|
+ msgDTO.setFrom_Account("D-"+prescribe.getDoctorId());
|
|
|
+ msgDTO.setTo_Account("U-"+prescribe.getUserId());
|
|
|
+ List<MsgDataDTO> msgs=new ArrayList<>();
|
|
|
+ MsgDataDTO msg=new MsgDataDTO();
|
|
|
+ String ext= JSONUtil.toJsonStr(prescribe);
|
|
|
+
|
|
|
+ msg.setMsgContent(new MsgDataFormatDTO("prescribe",ext,orderId));
|
|
|
+ msg.setMsgType("TIMCustomElem");//TIMCustomElem
|
|
|
+ msgs.add(msg);
|
|
|
+ msgDTO.setMsgBody(msgs);
|
|
|
+ imService.sendMsg(msgDTO);
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ return R.ok("操作成功");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
private String getFsPrescribeStoreZyImg(PrescribeZyImgParam o) {
|
|
|
File mb = new File("C:\\fs\\zycf.jpg");
|
|
|
if (!mb.exists()) {
|