|
@@ -6,6 +6,7 @@ import cn.hnthyy.thmz.entity.MzException;
|
|
|
import cn.hnthyy.thmz.entity.his.YzActOrder;
|
|
|
import cn.hnthyy.thmz.entity.his.mz.Employee;
|
|
|
import cn.hnthyy.thmz.entity.his.yp.YpBaseYf;
|
|
|
+import cn.hnthyy.thmz.entity.his.yp.YpSummaryPrint;
|
|
|
import cn.hnthyy.thmz.entity.his.yp.YpYzSendRecord;
|
|
|
import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
|
|
|
import cn.hnthyy.thmz.entity.his.yz.*;
|
|
@@ -27,9 +28,11 @@ import cn.hnthyy.thmz.mapper.his.zy.*;
|
|
|
import cn.hnthyy.thmz.service.his.yf.YfWardPrescriptionService;
|
|
|
import cn.hnthyy.thmz.service.his.yz.YzSequenceService;
|
|
|
import cn.hnthyy.thmz.vo.YfWardVo;
|
|
|
+import cn.hnthyy.thmz.vo.YpSummaryVo;
|
|
|
import cn.hnthyy.thmz.vo.YzActOrderCyDetailVo;
|
|
|
import cn.hnthyy.thmz.vo.YzActOrderCyVo;
|
|
|
import cn.hnthyy.thmz.vo.YzYpPageNoVo;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONObject;
|
|
@@ -1101,4 +1104,64 @@ public class YfWardPrescriptionServiceImpl implements YfWardPrescriptionService
|
|
|
String hisId = String.valueOf(pageNo);
|
|
|
return prescriptionMapper.selectByjByPageNo(hisId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> checkYpSummaryDataByPageNo(YpSummaryVo vo) {
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ List<YpSummaryPrint> summaryData = vo.getSummaryData();
|
|
|
+ if(null == summaryData || summaryData.isEmpty()){
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ List<YfWardVo> yfWardVos;
|
|
|
+ if ("A".equals(vo.getPageClass())) {//医技科室领药
|
|
|
+ yfWardVos = queryZyDrug(vo.getPageNo(), vo.getSubmitFlag());
|
|
|
+ } else {
|
|
|
+ yfWardVos = queryYzYpOrder(vo.getPageNo(), vo.getPageClass(), vo.getSubmitFlag());
|
|
|
+ }
|
|
|
+ String msg = "";
|
|
|
+ boolean flag = false;
|
|
|
+ int pid = 1;
|
|
|
+ for(YpSummaryPrint ypPrint : summaryData){
|
|
|
+ String chargeCode = ypPrint.getChargeCode();
|
|
|
+ String serial = ypPrint.getSerial();
|
|
|
+ BigDecimal amount = ypPrint.getAmount();
|
|
|
+ for (YfWardVo yf : yfWardVos){
|
|
|
+ if(chargeCode.equals(yf.getChargeCode()) && serial.equals(yf.getSerial())){
|
|
|
+ if(amount.doubleValue() == yf.getAmount()){
|
|
|
+ ypPrint.setResult("正常");
|
|
|
+ } else {
|
|
|
+ if(StringUtils.isBlank(msg)){
|
|
|
+ msg += "有误差,实际发药数量: " + yf.getAmount() + ", 打印数量: " + amount + " 。。。";
|
|
|
+ }
|
|
|
+ ypPrint.setResult("有误差,实际发药数量: " + yf.getAmount() + ", 打印数量: " + amount);
|
|
|
+ if(!flag){
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ypPrint.setId(String.valueOf(System.currentTimeMillis()));
|
|
|
+ ypPrint.setSort(pid);
|
|
|
+ ypPrint.setPageNo(vo.getPageNo());
|
|
|
+ ypPrint.setPageClass(vo.getPageClass());
|
|
|
+ ypPrint.setSubmitFlag(String.valueOf(vo.getSubmitFlag()));
|
|
|
+ ypPrint.setPrintFlag(vo.getPrintFlag());
|
|
|
+ // 医嘱实际发药量
|
|
|
+ ypPrint.setRealAmount(BigDecimal.valueOf(yf.getAmount()));
|
|
|
+ ypPrint.setCreateDate(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ pid ++;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(msg)) {
|
|
|
+ vo.setMessage(msg);
|
|
|
+ }
|
|
|
+ if(flag){
|
|
|
+ List<List<YpSummaryPrint>> result = ListSizeControlUtil.splitList(summaryData, 70);
|
|
|
+ for (List<YpSummaryPrint> record: result) {
|
|
|
+ ypZyPatientMapper.insertSummaryData(record);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultMap.put("msg", msg);
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
}
|