|
@@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.*;
|
|
|
+
|
|
|
@Slf4j
|
|
|
@Service
|
|
|
public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
@@ -123,7 +124,7 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
mzPharmacyMapper.updateFytjConfirmFlag(mzRefundMedicineVo);
|
|
|
}
|
|
|
mzPharmacyMapper.updateChargeDetailConfirmFlag(mzRefundMedicineVo);
|
|
|
- if(mzPharmacyMapper.updateBaseYf(mzRefundMedicineVo) > 0){
|
|
|
+ if (mzPharmacyMapper.updateBaseYf(mzRefundMedicineVo) > 0) {
|
|
|
log.info("更新药房库存数据成功{}", JSONObject.valueToString(mzRefundMedicineVo));
|
|
|
}
|
|
|
}
|
|
@@ -200,10 +201,10 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
ypMzFytj.setInputTime(date);
|
|
|
ypMzFytj.setConfirmId(user.getUserIdCode());
|
|
|
ypMzFytj.setConfirmName(user.getUserName());
|
|
|
- if(mzPharmacyMapper.insertFyclFytj(ypMzFytj) < 1){
|
|
|
+ if (mzPharmacyMapper.insertFyclFytj(ypMzFytj) < 1) {
|
|
|
throw new MzException("保存发药统计数据为空,发药处理失败");
|
|
|
}
|
|
|
- if(mzPharmacyMapper.updateFyclChargeDetailConfirmFlag(ypMzFytj) < 1){
|
|
|
+ if (mzPharmacyMapper.updateFyclChargeDetailConfirmFlag(ypMzFytj) < 1) {
|
|
|
throw new MzException("修改发药状态数据为空,发药处理失败");
|
|
|
}
|
|
|
MzRefundMedicineVo mzRefundMedicineVo = new MzRefundMedicineVo();
|
|
@@ -215,10 +216,10 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
mzRefundMedicineVo.setPatientId(ypMzFytj.getPatientId());
|
|
|
mzRefundMedicineVo.setTimes(ypMzFytj.getTimes());
|
|
|
mzRefundMedicineVo.setOrderNo(ypMzFytj.getOrderNo());
|
|
|
- if(mzPharmacyMapper.updateBaseYf(mzRefundMedicineVo) < 1){
|
|
|
+ if (mzPharmacyMapper.updateBaseYf(mzRefundMedicineVo) < 1) {
|
|
|
throw new MzException("更新药房库存数据为空,发药处理失败");
|
|
|
- }else{
|
|
|
- log.info("更新药房库存数据成功[{}]",JSONObject.valueToString(mzRefundMedicineVo));
|
|
|
+ } else {
|
|
|
+ log.info("更新药房库存数据成功[{}]", JSONObject.valueToString(mzRefundMedicineVo));
|
|
|
}
|
|
|
}
|
|
|
resultMap.put("code", 0);
|
|
@@ -259,9 +260,9 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
}
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Map map = list.get(i);
|
|
|
- String manuName = ypZdManufactoryMapper.selectYpZdManufactoryByCode((String)map.get("manu_code"));
|
|
|
+ String manuName = ypZdManufactoryMapper.selectYpZdManufactoryByCode((String) map.get("manu_code"));
|
|
|
map.put("manuName", manuName);
|
|
|
- YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf((String) map.get("code"), (String) map.get("serial"), "71",null);
|
|
|
+ YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf((String) map.get("code"), (String) map.get("serial"), "71", null);
|
|
|
map.put("location", ypBaseYf.getLocation());
|
|
|
map.put("stockAmount", ypBaseYf.getStockAmount());
|
|
|
}
|
|
@@ -270,7 +271,7 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
|
|
|
- public int sendMedicineProcessingRad(User user) {
|
|
|
+ public int sendMedicineProcessingRad(User user) throws MzException {
|
|
|
Date date = mzPharmacyMapper.selectLastRadSendDate(DateUtil.pase(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
String startDateStr = DateUtil.fomart(date, "yyyy-MM-dd");
|
|
|
String endDateStr = DateUtil.fomart(DateUtil.getPrevDayLastSecond(new Date()), "yyyy-MM-dd HH:mm:ss");
|
|
@@ -281,8 +282,31 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
mzChargeDetail.setConfirmFlag(1);
|
|
|
mzChargeDetail.setConfirmId(user.getUserIdCode());
|
|
|
mzChargeDetail.setConfirmTime(newDate);
|
|
|
+ YpMzFytj ypMzFytj = new YpMzFytj();
|
|
|
+ ypMzFytj.setPatientId(mzChargeDetail.getPatientId());
|
|
|
+ ypMzFytj.setTimes(mzChargeDetail.getTimes());
|
|
|
+ ypMzFytj.setReceiptNo(mzChargeDetail.getReceiptNo());
|
|
|
+ ypMzFytj.setOrderNo(mzChargeDetail.getOrderNo());
|
|
|
+ ypMzFytj.setQuantity(mzChargeDetail.getQuantity());
|
|
|
+ ypMzFytj.setUnitPrice(mzChargeDetail.getUnitPrice());
|
|
|
+ ypMzFytj.setChargeItemCode(mzChargeDetail.getChargeItemCode());
|
|
|
+ ypMzFytj.setSerial(mzChargeDetail.getSerial());
|
|
|
+ ypMzFytj.setGroupNo(mzChargeDetail.getGroupNo());
|
|
|
+ ypMzFytj.setItemNo(mzChargeDetail.getItemNo());
|
|
|
+ ypMzFytj.setSerialNo(mzChargeDetail.getSerialNo());
|
|
|
+ ypMzFytj.setDoctorId(mzChargeDetail.getDoctorCode());
|
|
|
+ ypMzFytj.setWinNo(mzChargeDetail.getWindowsNoYf());
|
|
|
+ Employee employee = employeeMapper.selectByUserCode(mzChargeDetail.getDoctorCode());
|
|
|
+ ypMzFytj.setDoctorName(employee.getEmployeeName());
|
|
|
+ ypMzFytj.setConfirmTime(date);
|
|
|
+ ypMzFytj.setInputTime(date);
|
|
|
+ ypMzFytj.setConfirmId(user.getUserIdCode());
|
|
|
+ ypMzFytj.setConfirmName(user.getUserName());
|
|
|
+ if (mzPharmacyMapper.insertFyclFytj(ypMzFytj) < 1) {
|
|
|
+ log.error("保存发药统计数据为空,发药处理失败");
|
|
|
+ throw new MzException("保存发药统计数据为空,发药处理失败");
|
|
|
+ }
|
|
|
number += mzPharmacyMapper.updateMzChargeDetailDispensing(mzChargeDetail);
|
|
|
- //更新药房库存
|
|
|
MzRefundMedicineVo mzRefundMedicineVo = new MzRefundMedicineVo();
|
|
|
mzRefundMedicineVo.setChargeCode(mzChargeDetail.getChargeItemCode());
|
|
|
mzRefundMedicineVo.setSerial(mzChargeDetail.getSerial());
|
|
@@ -292,8 +316,11 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
mzRefundMedicineVo.setPatientId(mzChargeDetail.getPatientId());
|
|
|
mzRefundMedicineVo.setTimes(mzChargeDetail.getTimes());
|
|
|
mzRefundMedicineVo.setOrderNo(mzChargeDetail.getOrderNo());
|
|
|
- if(mzPharmacyMapper.updateBaseYf(mzRefundMedicineVo) > 0){
|
|
|
+ if (mzPharmacyMapper.updateBaseYf(mzRefundMedicineVo) > 0) {
|
|
|
log.info("更新药房库存数据成功{}", JSONObject.valueToString(mzRefundMedicineVo));
|
|
|
+ } else {
|
|
|
+ log.error("更新药房库存数据失败{}", JSONObject.valueToString(mzRefundMedicineVo));
|
|
|
+ throw new MzException("更新药房库存数据异常,放射科发药失败");
|
|
|
}
|
|
|
}
|
|
|
return number;
|
|
@@ -301,10 +328,10 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
|
|
|
@Override
|
|
|
public String callNumberAudio(String text) {
|
|
|
- String res="";
|
|
|
+ String res = "";
|
|
|
try {
|
|
|
String encode = URLEncoder.encode(text, "UTF-8");
|
|
|
- res = HttpUtil.sendHttpGet(audioServiceUrl+"?text="+encode, "utf-8");
|
|
|
+ res = HttpUtil.sendHttpGet(audioServiceUrl + "?text=" + encode, "utf-8");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
log.info("语音生成失败,内容:{}", text);
|