傅行帆 6 년 전
부모
커밋
0f01adad3e

+ 44
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/HkController.java 파일 보기

@@ -0,0 +1,44 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.HkResponseBean;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
7
+import com.community.huiju.model.HkVisitorBill;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiImplicitParam;
10
+import io.swagger.annotations.ApiImplicitParams;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.cloud.context.config.annotation.RefreshScope;
13
+import org.springframework.web.bind.annotation.PathVariable;
14
+import org.springframework.web.bind.annotation.RequestBody;
15
+import org.springframework.web.bind.annotation.RequestMapping;
16
+import org.springframework.web.bind.annotation.RequestMethod;
17
+import org.springframework.web.bind.annotation.RestController;
18
+
19
+import javax.servlet.http.HttpSession;
20
+
21
+/**
22
+ * @author FXF
23
+ * @date 2019-01-23
24
+ */
25
+@RestController
26
+@RefreshScope
27
+@RequestMapping("/")
28
+@Api(value = "海康相关的API",description = "海康相关的API")
29
+public class HkController {
30
+	
31
+	@ApiOperation(value = "发送访客账单", notes = "发送访客账单")
32
+	@ApiImplicitParams({ @ApiImplicitParam(paramType = "body", name = "hkVisitorBill", dataType = "String",value = "billNum: 账单号,reservationNum:预约单号,plateNum:出场车牌号,leaveTime:出场时间,billFee:账单金额")})
33
+	@RequestMapping(value = "/sendVisitorBill",method = RequestMethod.POST)
34
+	public HkResponseBean allMessageRead(@RequestBody HkVisitorBill hkVisitorBill){
35
+		HkResponseBean hkResponseBean = new HkResponseBean();
36
+		System.out.println("测试:"+hkVisitorBill.getBillFee());
37
+		System.out.println("测试:"+hkVisitorBill.getBillNum());
38
+		System.out.println("测试:"+hkVisitorBill.getPlateNum());
39
+		System.out.println("测试:"+hkVisitorBill.getReservationNum());
40
+		System.out.println("测试:"+hkVisitorBill.getLeaveTime());
41
+		hkResponseBean.addSuccess("账单发送成功","");
42
+		return hkResponseBean;
43
+	}
44
+}

+ 72
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/HkVisitorBill.java 파일 보기

@@ -0,0 +1,72 @@
1
+package com.community.huiju.model;
2
+
3
+/**
4
+ * @author FXF
5
+ * @date 2019-01-23
6
+ */
7
+public class HkVisitorBill {
8
+	/**
9
+	 * 账单号
10
+	 */
11
+	private String billNum;
12
+	
13
+	/**
14
+	 * 预约单号
15
+	 */
16
+	private String reservationNum;
17
+	
18
+	/**
19
+	 * 出场车牌号
20
+	 */
21
+	private String plateNum;
22
+	
23
+	/**
24
+	 * 出场时间
25
+	 */
26
+	private Long leaveTime;
27
+	
28
+	/**
29
+	 * 账单金额
30
+	 */
31
+	private Integer billFee;
32
+	
33
+	public String getBillNum() {
34
+		return billNum;
35
+	}
36
+	
37
+	public void setBillNum(String billNum) {
38
+		this.billNum = billNum;
39
+	}
40
+	
41
+	public String getReservationNum() {
42
+		return reservationNum;
43
+	}
44
+	
45
+	public void setReservationNum(String reservationNum) {
46
+		this.reservationNum = reservationNum;
47
+	}
48
+	
49
+	public String getPlateNum() {
50
+		return plateNum;
51
+	}
52
+	
53
+	public void setPlateNum(String plateNum) {
54
+		this.plateNum = plateNum;
55
+	}
56
+	
57
+	public Long getLeaveTime() {
58
+		return leaveTime;
59
+	}
60
+	
61
+	public void setLeaveTime(Long leaveTime) {
62
+		this.leaveTime = leaveTime;
63
+	}
64
+	
65
+	public Integer getBillFee() {
66
+		return billFee;
67
+	}
68
+	
69
+	public void setBillFee(Integer billFee) {
70
+		this.billFee = billFee;
71
+	}
72
+}

+ 53
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/mode/HkResponseBean.java 파일 보기

@@ -0,0 +1,53 @@
1
+package com.community.commom.mode;
2
+
3
+import java.io.Serializable;
4
+
5
+/**
6
+ * 接口统一状态返回BEAN.
7
+ */
8
+public class HkResponseBean<T> implements Serializable {
9
+
10
+    private static final long serialVersionUID = 3593827217136880822L;
11
+
12
+    public static final String CODE_SUCCESS =  "0";
13
+    public static final String CODE_FAIL =  "1";
14
+
15
+    private String errorCode = "0";
16
+
17
+    private String errorMessage = "成功";
18
+
19
+    private T data;
20
+
21
+    public HkResponseBean() {
22
+    }
23
+ 
24
+    public void addSuccess(String errorMessage,T data) {
25
+        this.errorCode = "0";
26
+        this.errorMessage = errorMessage;
27
+        this.data = data;
28
+    }
29
+    
30
+    public String getErrorCode() {
31
+        return errorCode;
32
+    }
33
+    
34
+    public void setErrorCode(String errorCode) {
35
+        this.errorCode = errorCode;
36
+    }
37
+    
38
+    public String getErrorMessage() {
39
+        return errorMessage;
40
+    }
41
+    
42
+    public void setErrorMessage(String errorMessage) {
43
+        this.errorMessage = errorMessage;
44
+    }
45
+    
46
+    public T getData() {
47
+        return data;
48
+    }
49
+    
50
+    public void setData(T data) {
51
+        this.data = data;
52
+    }
53
+}