|
|
@@ -25,6 +25,7 @@ import org.springframework.transaction.annotation.Isolation;
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.*;
|
|
|
|
|
|
@@ -133,6 +134,26 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
|
|
|
+ public int cancelRefundMedicineProcessing(Integer realNo, String groupNo, Integer orderNo) throws MzException {
|
|
|
+ List<YpMzFytj> ypMzFytjs = mzPharmacyMapper.selectRefundDrug(realNo, groupNo, orderNo);
|
|
|
+ if (ypMzFytjs.size() > 0) {
|
|
|
+ for (int i = 0; i < ypMzFytjs.size(); i++) {
|
|
|
+ YpMzFytj ypMzFytj = ypMzFytjs.get(i);
|
|
|
+ int j = ypBaseYfMapper.updateStockAmount(ypMzFytj.getChargeItemCode(), ypMzFytj.getSerial(), groupNo, ypMzFytj.getQuantity(),
|
|
|
+ BigDecimal.valueOf(ypMzFytj.getQuantity()).multiply(ypMzFytj.getUnitPrice()));
|
|
|
+ if (j != 1) {
|
|
|
+ log.error("撤销退药失败,退回库存异常,错误信息{}", ypMzFytj.getChargeItemCode()+","+ypMzFytj.getSerial()+","+groupNo);
|
|
|
+ throw new MzException("退回库存异常");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw new MzException("未查询到已退药记录");
|
|
|
+ }
|
|
|
+ return mzPharmacyMapper.updateReFytjConfirmFlag(2, realNo, groupNo, orderNo);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<ChargeDetailInfoVo> getFyclWfyPrescriptionPage(ChargeFeeParamsVo chargeFeeParamsVo) {
|
|
|
return mzPharmacyMapper.selectFyclWfyPrescriptionPage(chargeFeeParamsVo);
|
|
|
@@ -172,9 +193,9 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
|
|
|
public Map<String, Object> sendMedicineProcessing(MzChargeDetail mzChargeDetail, User user) throws MzException {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
- int i = mzPharmacyMapper.selectConfirmFlagByRealNo(mzChargeDetail.getRealNo(),mzChargeDetail.getGroupNo(),mzChargeDetail.getOrderNo());
|
|
|
- if(i != 0){
|
|
|
- throw new MzException("发药失败,流水号"+mzChargeDetail.getRealNo()+"处方非待发药状态(已发药、退药或已退费)");
|
|
|
+ int i = mzPharmacyMapper.selectConfirmFlagByRealNo(mzChargeDetail.getRealNo(), mzChargeDetail.getGroupNo(), mzChargeDetail.getOrderNo());
|
|
|
+ if (i != 0) {
|
|
|
+ throw new MzException("发药失败,流水号" + mzChargeDetail.getRealNo() + "处方非待发药状态(已发药、退药或已退费)");
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
List<MzSendMedicineVo> cfxxList = mzPharmacyMapper.selectFyclPrescriptionDetail(mzChargeDetail);
|
|
|
@@ -337,7 +358,7 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
String res = "";
|
|
|
try {
|
|
|
String encode = URLEncoder.encode(text, "UTF-8");
|
|
|
- res = HttpUtil.sendHttpGet(audioServiceUrl + "?text=" + encode, "utf-8",3000);
|
|
|
+ res = HttpUtil.sendHttpGet(audioServiceUrl + "?text=" + encode, "utf-8", 3000);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
log.info("语音生成失败,内容:{}", text);
|
|
|
@@ -351,8 +372,8 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int queryConfirmFlagByRealNo(Integer realNo, String groupNo, Integer orderNo) {
|
|
|
- return mzPharmacyMapper.selectConfirmFlagByRealNo(realNo, groupNo, orderNo);
|
|
|
+ public int queryRefundMoneyCount(Integer realNo, Integer receiptNo, String groupNo, Integer orderNo) {
|
|
|
+ return mzPharmacyMapper.selectRefundMoneyCount(realNo, receiptNo, groupNo, orderNo);
|
|
|
}
|
|
|
|
|
|
@Override
|