| | |
| | | * @Date 2020-06-09 09:30:59 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tPubWithdrawal") |
| | | @RequestMapping("") |
| | | public class TPubWithdrawalController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tPubWithdrawal/"; |
| | |
| | | /** |
| | | * 跳转到提现列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | @RequestMapping("/tPubWithdrawal") |
| | | public String index() { |
| | | return PREFIX + "tPubWithdrawal.html"; |
| | | } |
| | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | @RequestMapping("/tPubWithdrawal/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TPubWithdrawal tPubWithdrawal = tPubWithdrawalService.selectById(id); |
| | | String str = ""; |
| | |
| | | * 跳转到立即处理页面 |
| | | * ----------改为批量 |
| | | */ |
| | | @RequestMapping("/tPubWithdrawal_immediately/{tPubWithdrawalIds}") |
| | | @RequestMapping("/tPubWithdrawal/tPubWithdrawal_immediately/{tPubWithdrawalIds}") |
| | | public String tPubWithdrawalUpdate(@PathVariable String tPubWithdrawalIds, Model model) { |
| | | model.addAttribute("tPubWithdrawalIds",tPubWithdrawalIds); |
| | | return PREFIX + "tPubWithdrawal_immediately.html"; |
| | |
| | | /** |
| | | * 获取提现列表列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @RequestMapping(value = "/tPubWithdrawal/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String name, |
| | |
| | | /** |
| | | * 新增提现列表 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @RequestMapping(value = "/tPubWithdrawal/add") |
| | | @ResponseBody |
| | | public Object add(TPubWithdrawal tPubWithdrawal) { |
| | | tPubWithdrawalService.insert(tPubWithdrawal); |
| | |
| | | /** |
| | | * 立即处理操作 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @RequestMapping(value = "/tPubWithdrawal/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam Integer state,@RequestParam String remark) { |
| | | TPubWithdrawal tPubWithdrawal = tPubWithdrawalService.selectById(id); |
| | | if (SinataUtil.isNotEmpty(tPubWithdrawal)){ |
| | | tPubWithdrawal.setRemark(remark); |
| | | |
| | | String serviceCode = ""; |
| | | String phone = ""; |
| | | String narration = ""; |
| | | Integer language = null; |
| | | if(tPubWithdrawal.getUserType() == 1){ |
| | | TUser tUser = userService.selectById(tPubWithdrawal.getUserId()); |
| | | language = tUser.getLanguage(); |
| | | serviceCode = tUser.getPhoneOperator(); |
| | | phone = tUser.getPhone(); |
| | | narration = "用户提现"; |
| | | }else{ |
| | | TDriver tDriver = driverService.selectById(tPubWithdrawal.getUserId()); |
| | | language = tDriver.getLanguage(); |
| | | serviceCode = tDriver.getPhoneOperator(); |
| | | phone = tDriver.getPhone(); |
| | | narration = "司机提现"; |
| | | } |
| | | if(2 == state){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String payerTransactionID = sdf.format(new Date()) + tPubWithdrawal.getId(); |
| | | PayoutResponse payoutResponse = tinggPayoutUtil.sendPayout(serviceCode, "+" + phone, payerTransactionID, tPubWithdrawal.getMoney().doubleValue(), callbackPath + "/tPubWithdrawal/base/withdrawalCallback", narration); |
| | | PayoutResponse payoutResponse = tinggPayoutUtil.sendPayout(serviceCode, phone, payerTransactionID, tPubWithdrawal.getMoney().doubleValue(), callbackPath + "/base/withdrawalCallback", remark); |
| | | AuthStatus authStatus = payoutResponse.getAuthStatus(); |
| | | Results results = payoutResponse.getResults().get(0); |
| | | String statusCode = results.getStatusCode(); |
| | |
| | | return ResultUtil.error(results.getStatusDescription()); |
| | | } |
| | | tPubWithdrawal.setSerialNo(results.getBeepTransactionID()); |
| | | tPubWithdrawal.setState(4); |
| | | }else{//回退金额 |
| | | tPubWithdrawal.setHandleTime(new Date()); |
| | | tPubWithdrawal.setState(state); |
| | |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(2); |
| | | notice.setUserType(tPubWithdrawal.getUserType()); |
| | | notice.setContent("提现处理结果:【"+remark+"】。"); |
| | | notice.setContent((language == 1 ? "提现申请反馈" : language == 2 ? "Feedback on withdrawal requests" : "Réponse à la demande de retrait") + ":【" +remark +"】。"); |
| | | notice.setUserId(tPubWithdrawal.getUserId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | |
| | | /** |
| | | * 修改提现列表 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @RequestMapping(value = "/tPubWithdrawal/update") |
| | | @ResponseBody |
| | | public Object update(TPubWithdrawal tPubWithdrawal) { |
| | | tPubWithdrawalService.updateById(tPubWithdrawal); |
| | |
| | | /** |
| | | * 提现列表详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tPubWithdrawalId}") |
| | | @RequestMapping(value = "/tPubWithdrawal/detail/{tPubWithdrawalId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tPubWithdrawalId") Integer tPubWithdrawalId) { |
| | | return tPubWithdrawalService.selectById(tPubWithdrawalId); |
| | |
| | | * @param type |
| | | * @param state |
| | | */ |
| | | @RequestMapping(value = "/downloadList",method = RequestMethod.GET) |
| | | @RequestMapping(value = "/tPubWithdrawal/downloadList",method = RequestMethod.GET) |
| | | public void downloadList(String insertTime, String name, Integer withdrawalType, Integer userType, Integer type, Integer state, |
| | | HttpServletRequest request, HttpServletResponse response){ |
| | | String start = null; |