|
@@ -2,8 +2,6 @@ package com.chuanghai.smartschool.tuitionpayment.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.anno.AdminLoginCheck;
|
|
import com.chuanghai.smartschool.tuitionpayment.anno.AdminLoginCheck;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.common.exception.BizCodeEnume;
|
|
import com.chuanghai.smartschool.tuitionpayment.common.exception.BizCodeEnume;
|
|
@@ -25,15 +23,8 @@ import com.chuanghai.smartschool.tuitionpayment.vo.*;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.http.HttpEntity;
|
|
|
|
|
-import org.springframework.http.HttpHeaders;
|
|
|
|
|
-import org.springframework.http.MediaType;
|
|
|
|
|
-import org.springframework.http.ResponseEntity;
|
|
|
|
|
-import org.springframework.util.LinkedMultiValueMap;
|
|
|
|
|
-import org.springframework.util.MultiValueMap;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.client.RestTemplate;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -278,7 +269,7 @@ public class PayableInfoController {
|
|
|
* 更新缴费订单的时间参数
|
|
* 更新缴费订单的时间参数
|
|
|
*/
|
|
*/
|
|
|
@PutMapping("updatePayInfo")
|
|
@PutMapping("updatePayInfo")
|
|
|
- public CommonResult<T> updatePayInfo(String itemName) {
|
|
|
|
|
|
|
+ public CommonResult<T> updatePayInfo(@RequestHeader("card_number") String cardNumber, String itemName) {
|
|
|
QueryWrapper<PayableInfoEntity> wrapper = new QueryWrapper<>();
|
|
QueryWrapper<PayableInfoEntity> wrapper = new QueryWrapper<>();
|
|
|
wrapper.eq("payMent_item", itemName);
|
|
wrapper.eq("payMent_item", itemName);
|
|
|
//更新时间等参数
|
|
//更新时间等参数
|
|
@@ -286,7 +277,6 @@ public class PayableInfoController {
|
|
|
|
|
|
|
|
List<PayableInfoEntity> objectList = new ArrayList<>();
|
|
List<PayableInfoEntity> objectList = new ArrayList<>();
|
|
|
infoEntityList.forEach(payableInfoEntity -> {
|
|
infoEntityList.forEach(payableInfoEntity -> {
|
|
|
- String cardNumber = getCardNumberByIdCard(payableInfoEntity.getStudentNo(), null, null, null);
|
|
|
|
|
payableInfoEntity.setCardNumber(cardNumber);
|
|
payableInfoEntity.setCardNumber(cardNumber);
|
|
|
payableInfoEntity.setPayCreateTime(LocalDateTime.now());
|
|
payableInfoEntity.setPayCreateTime(LocalDateTime.now());
|
|
|
payableInfoEntity.setPayItemType("1");
|
|
payableInfoEntity.setPayItemType("1");
|
|
@@ -307,42 +297,42 @@ public class PayableInfoController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 通过身份证调用活动管理平台数据库换取 微笑的cardNumber信息
|
|
|
|
|
- *
|
|
|
|
|
- * @param idCard
|
|
|
|
|
- * @return
|
|
|
|
|
- */
|
|
|
|
|
- public String getCardNumberByIdCard(String idCard, String inputType, String inputStr, String outPutType) {
|
|
|
|
|
- //表示输入的参数为身份证
|
|
|
|
|
- inputType = inputType == null ? "1" : inputType;
|
|
|
|
|
- //输入的参数
|
|
|
|
|
- inputStr = idCard;
|
|
|
|
|
- // 返回微校的cardNumber
|
|
|
|
|
- outPutType = outPutType == null ? "2" : outPutType;
|
|
|
|
|
-
|
|
|
|
|
- String url = "https://chtech.ncjti.edu.cn/lamp/recordApi/consume/getUserInfo";
|
|
|
|
|
- MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
|
|
|
|
|
- map.add("inputType", inputType);
|
|
|
|
|
- map.add("inputStr", inputStr);
|
|
|
|
|
- map.add("outPutType", outPutType);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
- HttpHeaders headers = new HttpHeaders();
|
|
|
|
|
- headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
|
|
|
-
|
|
|
|
|
- HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(map, headers);
|
|
|
|
|
- ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, request, String.class);
|
|
|
|
|
- JSONObject jsonObj = JSON.parseObject(responseEntity.getBody());
|
|
|
|
|
- String cardNumber = "";
|
|
|
|
|
- try {
|
|
|
|
|
- cardNumber = jsonObj.get("result").toString();
|
|
|
|
|
- } catch (NullPointerException e) {
|
|
|
|
|
- throw new NullPointerException("未匹配到该用户!");
|
|
|
|
|
- }
|
|
|
|
|
- return cardNumber == null ? idCard : cardNumber;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 通过身份证调用活动管理平台数据库换取 微笑的cardNumber信息
|
|
|
|
|
+// *
|
|
|
|
|
+// * @param idCard
|
|
|
|
|
+// * @return
|
|
|
|
|
+// */
|
|
|
|
|
+// public String getCardNumberByIdCard(String idCard, String inputType, String inputStr, String outPutType) {
|
|
|
|
|
+// //表示输入的参数为身份证
|
|
|
|
|
+// inputType = inputType == null ? "1" : inputType;
|
|
|
|
|
+// //输入的参数
|
|
|
|
|
+// inputStr = idCard;
|
|
|
|
|
+// // 返回微校的cardNumber
|
|
|
|
|
+// outPutType = outPutType == null ? "2" : outPutType;
|
|
|
|
|
+//
|
|
|
|
|
+// String url = "https://chtech.ncjti.edu.cn/lamp/recordApi/consume/getUserInfo";
|
|
|
|
|
+// MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
|
|
|
|
|
+// map.add("inputType", inputType);
|
|
|
|
|
+// map.add("inputStr", inputStr);
|
|
|
|
|
+// map.add("outPutType", outPutType);
|
|
|
|
|
+//
|
|
|
|
|
+//
|
|
|
|
|
+// RestTemplate restTemplate = new RestTemplate();
|
|
|
|
|
+// HttpHeaders headers = new HttpHeaders();
|
|
|
|
|
+// headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
|
|
|
+//
|
|
|
|
|
+// HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(map, headers);
|
|
|
|
|
+// ResponseEntity<String> responseEntity = restTemplate.postForEntity(url, request, String.class);
|
|
|
|
|
+// JSONObject jsonObj = JSON.parseObject(responseEntity.getBody());
|
|
|
|
|
+// String cardNumber = "";
|
|
|
|
|
+// try {
|
|
|
|
|
+// cardNumber = jsonObj.get("result").toString();
|
|
|
|
|
+// } catch (NullPointerException e) {
|
|
|
|
|
+// throw new NullPointerException("未匹配到该用户!");
|
|
|
|
|
+// }
|
|
|
|
|
+// return cardNumber == null ? idCard : cardNumber;
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|