|
@@ -180,12 +180,15 @@ public class DTPService {
|
|
|
Object drugList = pd.get("drugData");//获取药品信息列表
|
|
|
String Id = IdUtils.fastSimpleUUID();//生成处方单号
|
|
|
List<PageData> addList = new ArrayList<>();
|
|
|
+ int resultDrug=0;
|
|
|
+ int drugQuantity=0;
|
|
|
|
|
|
if (StringUtils.isNotNull(drugList)) {
|
|
|
try {
|
|
|
// 将 JSON 字符串转换为 List<Map<String, Object>>
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
List<Map<String, Object>> rowsdrugList = objectMapper.readValue(drugList.toString(), List.class);
|
|
|
+ drugQuantity=rowsdrugList.size();//处方取药数量
|
|
|
// 遍历列表并调用插入数据接口
|
|
|
if (rowsdrugList.size() > 0) {
|
|
|
for (Map<String, Object> lxr : rowsdrugList) {
|
|
@@ -211,13 +214,9 @@ public class DTPService {
|
|
|
pageData.put("dvalueDays", 1);
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
// 添加其他可能需要的字段(如果有的话)
|
|
|
pageData.put("medicationRoute", lxr.get("medicationRoute"));
|
|
|
-// pageData.put("sales", lxr.get("sales"));
|
|
|
+ //pageData.put("sales", lxr.get("sales"));
|
|
|
pageData.put("prescriptionNumber", Id);
|
|
|
pageData.put("prescriptionDate", DateUtils.getTime());
|
|
|
pageData.put("hospital", lxr.get("hospital"));
|
|
@@ -236,7 +235,7 @@ public class DTPService {
|
|
|
}
|
|
|
final HashMap<String, Object> addMap = new HashMap<String, Object>();
|
|
|
addMap.put("dataList", addList);
|
|
|
- int resultDrug= dao.executeBatch("DTPCFDJMapper.batchAddDrugPurchaseRecord", addMap);
|
|
|
+ resultDrug= dao.executeBatch("DTPCFDJMapper.batchAddDrugPurchaseRecord", addMap);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
@@ -264,27 +263,23 @@ public class DTPService {
|
|
|
pd.put("prescriptionIssueDate", pd.get("prescriptionIssueDate"));
|
|
|
pd.put("invoiceImageUrl", pd.get("invoiceImageUrl"));
|
|
|
pd.put("invoiceCode", pd.get("invoiceCode"));
|
|
|
- pd.put("saleDate", pd.get("saleDate"));
|
|
|
- pd.put("registrationDate", pd.get("registrationDate"));
|
|
|
+ pd.put("registrationDate", DateUtils.getTime());
|
|
|
pd.put("registerPharmacistName", pd.get("registerPharmacistName"));
|
|
|
pd.put("registrant", pd.get("registrant"));
|
|
|
pd.put("reviewingName", pd.get("reviewingName"));
|
|
|
+ pd.put("drugQuantity", drugQuantity);
|
|
|
|
|
|
// 患者信息
|
|
|
pd.put("patientId", pd.get("patientId"));
|
|
|
pd.put("patientName", pd.get("patientName"));
|
|
|
- String sex= (String) pd.get("gender");
|
|
|
-
|
|
|
- if(sex.equals("男")){
|
|
|
- pd.put("gender", 1);
|
|
|
- }
|
|
|
- if(sex.equals("女")){
|
|
|
- pd.put("gender", 0);
|
|
|
- }
|
|
|
+ pd.put("gender", pd.get("gender"));
|
|
|
pd.put("age", pd.get("age"));
|
|
|
-
|
|
|
int result = daoSupport.save("DTPCFDJMapper.insertPrescriptionRegistration", pd);
|
|
|
- return result;
|
|
|
+ if(resultDrug>0 && result>0){
|
|
|
+ return 1;
|
|
|
+ }else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|