Commit 11749eead9b9af19429862a22cbac9ee39d973be
1 parent
52440ccacc
Exists in
master
and in
6 other branches
德州妇幼打印
Showing 3 changed files with 74 additions and 8 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CouponPrintController.java
View file @
11749ee
1 | +package com.lyms.platform.operate.web.controller; | |
2 | + | |
3 | +import java.util.Date; | |
4 | + | |
5 | +import javax.servlet.http.HttpServletRequest; | |
6 | + | |
7 | +import org.springframework.beans.factory.annotation.Autowired; | |
8 | +import org.springframework.stereotype.Controller; | |
9 | +import org.springframework.web.bind.annotation.RequestMapping; | |
10 | +import org.springframework.web.bind.annotation.RequestMethod; | |
11 | +import org.springframework.web.bind.annotation.ResponseBody; | |
12 | + | |
13 | +import com.lyms.platform.biz.service.PatientsService; | |
14 | +import com.lyms.platform.common.annotation.TokenRequired; | |
15 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
16 | +import com.lyms.platform.common.result.RespBuilder; | |
17 | +import com.lyms.platform.common.result.ResponseCode; | |
18 | +import com.lyms.platform.common.utils.DateUtil; | |
19 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
20 | +import com.lyms.platform.operate.web.utils.HospitalCouponPrintUtils; | |
21 | +import com.lyms.platform.pojo.Patients; | |
22 | + | |
23 | +@Controller | |
24 | +@RequestMapping("/couponPrint") | |
25 | +public class CouponPrintController { | |
26 | + | |
27 | + | |
28 | + @Autowired | |
29 | + private PatientsService patientsService; | |
30 | + | |
31 | + private static final String shanDong_DeZhou_fuYou_hopitalId = "1000000114"; | |
32 | + | |
33 | + public static final String shanDong_Dezhou_youHuiQuan_money_Number = PropertiesUtils.getPropertyValue("shanDong_Dezhou_youHuiQuan_money_Number"); | |
34 | + | |
35 | + | |
36 | + /** | |
37 | + * 产检券打印触发后台操作 | |
38 | + * @param userId | |
39 | + * @param hospitalId | |
40 | + * @return | |
41 | + */ | |
42 | + @RequestMapping(method = RequestMethod.POST,value = "/printTrigger") | |
43 | + @ResponseBody | |
44 | + @TokenRequired | |
45 | + public BaseObjectResponse printTrigger(HttpServletRequest request) { | |
46 | + if(shanDong_DeZhou_fuYou_hopitalId.equals(request.getParameter("hospitalId"))){//山东德州妇幼 | |
47 | + Patients patient = patientsService.findOnePatientById(request.getParameter("patientUserId")); | |
48 | + String cardType = request.getParameter("cardType"); | |
49 | + String sendPersonName = request.getParameter("sendPersonName"); | |
50 | + String patientUserName = patient.getUsername();//领卡人 | |
51 | + String cardNum = patient.getVcCardNo();//就诊卡号 | |
52 | + String sendReason = "孕产婴软件:"+patientUserName+", 孕检代金券";//发卡原因 | |
53 | + String remark = cardType + "代金券,产检代金券禁止其他使用";//备注 | |
54 | + String JSFS = "孕检代金券";//结算方式 | |
55 | + Integer KMJE = Integer.parseInt(shanDong_Dezhou_youHuiQuan_money_Number);//卡面金额 | |
56 | + Integer XSJE =0;// 销售金额 | |
57 | + Integer CZZKL =100;//充值折扣率 | |
58 | + Integer YE = KMJE;//余额 | |
59 | + String result = HospitalCouponPrintUtils.getDZdjq(cardType, cardNum, sendReason, sendPersonName, patientUserName, DateUtil.getyyyy_MM_dd(new Date()),remark, JSFS, KMJE, XSJE, CZZKL, YE); | |
60 | + if("调用程序出错".equals(result)){ | |
61 | + return RespBuilder.buildErro(ResponseCode.ERROR); | |
62 | + }else{ | |
63 | + return RespBuilder.buildErro(ResponseCode.SUCCESS); | |
64 | + } | |
65 | + }else{ | |
66 | + return RespBuilder.buildErro(ResponseCode.SUCCESS); | |
67 | + } | |
68 | + } | |
69 | + | |
70 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HospitalCouponPrintUtils.java
View file @
11749ee
1 | 1 | package com.lyms.platform.operate.web.utils; |
2 | 2 | |
3 | -import com.lyms.platform.common.utils.PropertiesUtils; | |
4 | 3 | import org.apache.http.HttpEntity; |
5 | -import org.apache.http.NameValuePair; | |
6 | -import org.apache.http.client.HttpClient; | |
7 | -import org.apache.http.client.entity.UrlEncodedFormEntity; | |
8 | 4 | import org.apache.http.client.methods.CloseableHttpResponse; |
9 | 5 | import org.apache.http.client.methods.HttpPost; |
10 | 6 | import org.apache.http.entity.StringEntity; |
11 | 7 | import org.apache.http.impl.client.DefaultHttpClient; |
12 | 8 | import org.apache.http.impl.conn.PoolingClientConnectionManager; |
13 | -import org.apache.http.message.BasicNameValuePair; | |
14 | 9 | import org.apache.http.util.EntityUtils; |
15 | 10 | |
16 | -import java.util.ArrayList; | |
17 | -import java.util.Date; | |
18 | -import java.util.List; | |
11 | +import com.lyms.platform.common.utils.PropertiesUtils; | |
19 | 12 | |
20 | 13 | /** |
21 | 14 | * Created by Administrator on 2017/5/16. |
platform-operate-api/src/main/resources/config.properties
View file @
11749ee
... | ... | @@ -8,6 +8,9 @@ |
8 | 8 | #区域平台访问短信中心的token |
9 | 9 | center_token=e0c56363-00d6-42ee-bbe0-23c553583062 |
10 | 10 | |
11 | +#\u5C71\u4E1C\u5FB7\u5DDE\u4F18\u60E0\u5238\u91D1\u989D_shanDong dezhou youHuiQuan jinE | |
12 | +shanDong_Dezhou_youHuiQuan_money_Number=500 | |
13 | + | |
11 | 14 | |
12 | 15 | |
13 | 16 | #His系统版本 0:未使用,1:桓台,2:新乐,3:青龙县医院,4:秦皇岛妇幼,5:抚宁妇幼, 6: 德州妇幼 |