Ver Fonte

评价器功能开发

hurugang há 5 anos atrás
pai
commit
71d23e2638

+ 1 - 0
src/main/java/cn/hnthyy/thmz/controller/LoginController.java

@@ -101,6 +101,7 @@ public class LoginController {
         String token =TokenUtil.createJWT(JsonUtil.object2Json(user),deadTime);
         resultMap.put("code", 0);
         resultMap.put("token", token);
+        resultMap.put("userID", userParam.getUserCode());
         resultMap.put("message", "恭喜您,登录成功!");
         return resultMap;
     }

+ 44 - 0
src/main/resources/static/js/common/pad-util.js

@@ -0,0 +1,44 @@
+function encodeUnicode(str) {
+    var res = [];
+    for (var i = 0; i < str.length; i++) {
+        res[i] = ("00" + str.charCodeAt(i).toString(16)).slice(-4);
+    }
+    return  "\\u" + res.join("\\u");
+}
+
+
+function sendData(d) {
+    console.log(d);
+    $.ajax({
+        type:"get",
+        crossDomain:true,
+        url:"http://localhost:8320/api",
+        data: "data=" + d,
+        success:function (ret) {
+            console.log(ret);
+        },
+        error:function(){
+            console.error("get error");
+        }
+    });
+}
+
+
+function postCMD(cmd,UserID,UserPsw,ItemName,Coast,Pay,Change,GuestName,Msg,Self,free,PatNo) {
+    var d = {}; // new object();
+    d.CMD = cmd;
+    d.UserID = UserID;
+    d.UserPsw = UserPsw;
+    d.ItemName = encodeUnicode(ItemName);
+    d.Coast = Coast;
+    d.Pay = Pay;
+    d.Change = Change;
+    d.GuestName=encodeUnicode(GuestName);
+    d.Msg = encodeUnicode(Msg);
+    d.Self = Self;
+    d.free = free;
+    d.PatNo = PatNo;
+    sendData(JSON.stringify(d));
+    //console.log(d);
+    //console.log(JSON.stringify(d));
+}

+ 4 - 0
src/main/resources/static/js/common/string-util.js

@@ -68,3 +68,7 @@ function isChinese(val) {
 }
 
 
+
+
+
+

+ 1 - 0
src/main/resources/static/js/login.js

@@ -49,6 +49,7 @@ function login() {
                 $('.alert-success').removeClass('hide').addClass('in');
                 $("#successMessage").text(result.message);
                 localStorage.setItem("token",result.token);
+                localStorage.setItem("userID",result.userID);
                 window.location.href='/thmz/menu/view'
             } else {
                 if($("#errorMessage").length==0){

+ 2 - 1
src/main/resources/static/js/menu.js

@@ -72,7 +72,7 @@ $(function () {
         }
 
     });
-
+    postCMD("connect",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
 });
 
 
@@ -130,6 +130,7 @@ function loginOut() {
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
         success: function (result) {
             if (result == '401' || result == 401 || result.code == 0) {
+                postCMD("logout",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
                 window.location.href = '/thmz/login/view'
                 return;
             }

+ 35 - 0
src/main/resources/static/js/registration.js

@@ -342,6 +342,12 @@ $(function () {
         queryUserInfoByName();
     });
 
+    // postCMD("connect",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
+    // setTimeout(function () {
+    //     postCMD("login",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
+    // }, 600);
+    postCMD("login",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
+
 });
 
 
@@ -742,6 +748,7 @@ function confirmFeeModal() {
     $("#cash").val($("#amountMoneyConfirm").text());
     //$("#cash").val(null);
     $("#confirmFeeModal").modal();
+    sendPeiceMessage($("#amountMoneyConfirm").text());
 }
 
 /**
@@ -1480,6 +1487,7 @@ function saveMzyReqrec() {
                 // loadTableCount();
                 // loadRegistrationList(true);
                 clearRegistration();
+                postCMD("appraise",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
             } else {
                 new PNotify({
                     title: '错误提示',
@@ -1813,4 +1821,31 @@ function queryUserInfoByName() {
         });
     }
 
+}
+
+
+
+
+/**
+ * 推送价格信息
+ */
+function sendPeiceMessage(data) {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getByPatientId?patientId=' + $("#patientId").val(),
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                if (res.data != null) {
+                    postCMD("price",localStorage.getItem("userID"),'000000','收费项目',parseFloat(data).toFixed(2),parseFloat(0).toFixed(2),parseFloat(0).toFixed(2), $("#userNameReadOnly").val(),'祝您早日康复',parseFloat(data).toFixed(2),parseFloat(0).toFixed(2),res.data.phoneNo);
+                }
+            }
+        }
+    });
 }

+ 32 - 1
src/main/resources/static/js/toll_administration.js

@@ -94,6 +94,10 @@ $(function () {
 //         });
 //         $("#editWindowsModal").modal();
 //     });
+    postCMD("login",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
+    // setTimeout(function () {
+    //     postCMD("login",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
+    // }, 3000);
 });
 
 /**
@@ -809,8 +813,32 @@ function confirmFeeModal(times, totalCharge, receiptNo) {
     $("#payType").selectpicker('refresh');
     $("#changeAmount").val(0.0);
     $("#surplusAmount").val(0.0);
+    sendPeiceMessage(data);
 }
 
+/**
+ * 推送价格信息
+ */
+function sendPeiceMessage(data) {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getByPatientId?patientId=' + $("#patientIdHaveTally").val(),
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                if (res.data != null) {
+                    postCMD("price",localStorage.getItem("userID"),'000000','收费项目',data.toFixed(2),parseFloat(0).toFixed(2),parseFloat(0).toFixed(2), $("#nameHaveTally").val(),'祝您早日康复',data.toFixed(2),parseFloat(0).toFixed(2),res.data.phoneNo);
+                }
+            }
+        }
+    });
+}
 
 /**
  * 打开收费明细窗口
@@ -825,6 +853,7 @@ function chargeDetailModal(patientId, times, receiptNo) {
 }
 
 
+
 /**
  * 病人当前就诊次数的诊断查询
  * @param data
@@ -1234,6 +1263,7 @@ function saveConfirmFee() {
                 initFeeTable();
                 //默认光标在卡号输入框
                 $("#cardNo").focus();
+                postCMD("appraise",localStorage.getItem("userID"),'000000','收费项目',0,0,0, '','祝您早日康复',0,0,0);
             } else {
                 new PNotify({
                     title: '错误提示',
@@ -2142,4 +2172,5 @@ function cleanParams() {
     $("#cardNo").focus();
     $("#serialNo").val(null);
     $("#ownData").removeAttr("checked");
-}
+}
+

+ 1 - 0
src/main/resources/templates/menu.html

@@ -288,6 +288,7 @@
 <script src="/thmz/js/bootstrap-datetimepicker.zh-CN.js"></script>
 <script src="/thmz/js/common/date-util.js"></script>
 <script src="/thmz/js/common/string-util.js"></script>
+<script src="/thmz/js/common/pad-util.js"></script>
 <!-- Custom Theme Scripts -->
 <script src="/thmz/js/custom-from-min.js"></script>
 <script src="/thmz/js/menu.js"></script>