bzd_wsp hai 4 meses
pai
achega
8df0841c60

+ 1 - 1
health-admin/src/main/java/com/bzd/web/controller/dtp/PharmaceuticalServiceController.java

@@ -100,7 +100,7 @@ public class PharmaceuticalServiceController extends BaseController {
     public AjaxResult slectPatientByNameOrPhoneOrIdCard() throws Exception {
         PageData pd = this.getPageData();
         startPage();
-        PageData pageData = (PageData) pharmaceuticalService.slectPatientByNameOrPhoneOrIdCard(pd);
+        List<PageData>  pageData = pharmaceuticalService.slectPatientByNameOrPhoneOrIdCard(pd);
 
         return AjaxResult.success(pageData);
     }

+ 9 - 8
health-admin/src/main/resources/templates/dtp/recipe/recipe.html

@@ -76,19 +76,20 @@
 				</div>
 
 		        <div class="btn-group-sm" id="toolbar" role="group">
-		        	<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="dtp:recipe:add">
-		                <i class="fa fa-plus"></i> 处方登记APP
-		            </a>
+<!--		        	<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="dtp:recipe:add">-->
+<!--		                <i class="fa fa-plus"></i> 处方登记APP-->
+<!--		            </a>-->
 					<a class="btn btn-success" onclick="$.operate.addTab2()" shiro:hasPermission="dtp:recipe:add">
 						<i class="fa fa-plus"></i> 新建登记
 					</a>
-		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sdtp:recipe:remove">
-		                <i class="fa fa-remove"></i> 删除
-		            </a>
+<!--		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sdtp:recipe:remove">-->
+<!--		                <i class="fa fa-remove"></i> 删除-->
+<!--		            </a>-->
 <!--					<a class="btn btn-success" onclick="budan()">-->
 <!--						<i class="fa btn-primary"></i> 补单-->
-<!--					</a>-->
-						<button type="button"  onclick="budan()" class="btn-primary">补单</button>
+<!--					</a>
+<button type="button"  onclick="budan()" class="btn-primary">补单</button>-->
+
 		        </div>
 
 				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: hidden;">

+ 13 - 18
health-system/src/main/java/com/bzd/system/service/DTPService.java

@@ -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;
+        }
     }
 
     /**

+ 3 - 8
health-system/src/main/java/com/bzd/system/service/PharmaceuticalService.java

@@ -48,14 +48,9 @@ public class PharmaceuticalService {
        }
 
     }
-    public PageData slectPatientByNameOrPhoneOrIdCard(PageData pd) throws Exception{
-        String query= (String) pd.get("query");
-        if(StringUtil.isNotEmpty(query)){
-            Object PageData;
-            return (com.bzd.common.config.dao.PageData) (PageData= daoSupport.findForObject("PharmaceuticalServiceMapper.slectPatientByNameOrPhoneOrIdCard", pd));
-        }else {
-            return null;
-        }
+    public List<PageData> slectPatientByNameOrPhoneOrIdCard(PageData pd) throws Exception{
+        return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.slectPatientByNameOrPhoneOrIdCard", pd);
+
     }
 
     public List<PageData> findBasicInfomation(PageData pd) throws Exception{

+ 1 - 1
health-system/src/main/resources/mapper/pmServiceMapper/PharmaceuticalServiceMapper.xml

@@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 
 	<select id="slectPatientByNameOrPhoneOrIdCard" parameterType="pd" resultType="pd">
-		select * from s_dtp_ysfw_archive_management where  1=1  AND  name =#{query} or phoneNumber=#{query} or documentNumber=#{query}
+		select * from s_dtp_ysfw_archive_management where  1=1  AND name LIKE CONCAT('%', #{query}, '%') or phoneNumber=#{query} or documentNumber=#{query}
 	</select>
 
 	<select id="selectPatientById" parameterType="pd" resultType="pd">