| | |
| | | import com.agentdriving.driver.modular.system.model.DriverBank; |
| | | import com.agentdriving.driver.modular.system.service.IDriverBankService; |
| | | import com.agentdriving.driver.modular.system.service.IDriverService; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.BindAccount; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.InterfaceResponse; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.model.UnbindAccount; |
| | | import com.agentdriving.driver.modular.system.util.MallBook.util.TrhRequest; |
| | | import com.agentdriving.driver.modular.system.util.ResultUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | |
| | | driverBank.setName(name); |
| | | driverBank.setPhone(phone); |
| | | |
| | | BindAccount bindAccount = new BindAccount(); |
| | | bindAccount.setUserId(driver.getMerchantNumber()); |
| | | bindAccount.setCertId(IDCode); |
| | | bindAccount.setCardName(name); |
| | | bindAccount.setCardNo(bankNumber); |
| | | bindAccount.setBankAcctType("2"); |
| | | bindAccount.setPhone(phone); |
| | | TrhRequest<BindAccount> request = new TrhRequest(); |
| | | InterfaceResponse execute = request.execute(bindAccount, BindAccount.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | this.insert(driverBank); |
| | | // BindAccount bindAccount = new BindAccount(); |
| | | // bindAccount.setUserId(driver.getMerchantNumber()); |
| | | // bindAccount.setCertId(IDCode); |
| | | // bindAccount.setCardName(name); |
| | | // bindAccount.setCardNo(bankNumber); |
| | | // bindAccount.setBankAcctType("2"); |
| | | // bindAccount.setPhone(phone); |
| | | // TrhRequest<BindAccount> request = new TrhRequest(); |
| | | // InterfaceResponse execute = request.execute(bindAccount, BindAccount.SERVICE_CODE); |
| | | // if(!"0000".equals(execute.getResult())){ |
| | | // return ResultUtil.error(execute.getMsg()); |
| | | // } |
| | | // JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | // String status = jsonObject.getString("status"); |
| | | // if("2".equals(status)){ |
| | | // return ResultUtil.error("失败"); |
| | | // } |
| | | // if("0".equals(status)){ |
| | | // return ResultUtil.error("处理中"); |
| | | // } |
| | | // this.insert(driverBank); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | if(ToolUtil.isEmpty(driver.getMerchantNumber())){ |
| | | return ResultUtil.error("请先注册商户"); |
| | | } |
| | | UnbindAccount unbindAccount = new UnbindAccount(); |
| | | unbindAccount.setUserId(driver.getMerchantNumber()); |
| | | |
| | | TrhRequest<UnbindAccount> request = new TrhRequest<>(); |
| | | InterfaceResponse execute = request.execute(unbindAccount, UnbindAccount.SERVICE_CODE); |
| | | if(!"0000".equals(execute.getResult())){ |
| | | return ResultUtil.error(execute.getMsg()); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | String status = jsonObject.getString("status"); |
| | | if("2".equals(status)){ |
| | | return ResultUtil.error("失败"); |
| | | } |
| | | if("0".equals(status)){ |
| | | return ResultUtil.error("处理中"); |
| | | } |
| | | this.deleteById(id); |
| | | // UnbindAccount unbindAccount = new UnbindAccount(); |
| | | // unbindAccount.setUserId(driver.getMerchantNumber()); |
| | | // |
| | | // TrhRequest<UnbindAccount> request = new TrhRequest<>(); |
| | | // InterfaceResponse execute = request.execute(unbindAccount, UnbindAccount.SERVICE_CODE); |
| | | // if(!"0000".equals(execute.getResult())){ |
| | | // return ResultUtil.error(execute.getMsg()); |
| | | // } |
| | | // JSONObject jsonObject = JSON.parseObject(execute.getResult()); |
| | | // String status = jsonObject.getString("status"); |
| | | // if("2".equals(status)){ |
| | | // return ResultUtil.error("失败"); |
| | | // } |
| | | // if("0".equals(status)){ |
| | | // return ResultUtil.error("处理中"); |
| | | // } |
| | | // this.deleteById(id); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |