| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.ExcelUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; |
| | | import com.stylefeng.guns.modular.huifu.biz.FenZhangUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.Base64Util; |
| | | import com.stylefeng.guns.modular.system.dao.LineShiftDriverMapper; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 快车改派管理控制器 |
| | |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tReassignId,@RequestParam Integer optType) { |
| | | public Object opt(@RequestParam Integer tReassignId,@RequestParam Integer optType) throws Exception { |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | TReassign tReassign = tReassignService.selectById(tReassignId); |
| | | if (1 == optType){ |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | |
| | | |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |
| | |
| | | |
| | | |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |
| | |
| | | TReassign tReassign = tReassignService.selectById(tReassignId); |
| | | if (1 == optType){ |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |
| | |
| | | */ |
| | | @RequestMapping(value = "/optTaxi") |
| | | @ResponseBody |
| | | public Object optTaxi(@RequestParam Integer tReassignId,@RequestParam Integer optType) { |
| | | public Object optTaxi(@RequestParam Integer tReassignId,@RequestParam Integer optType) throws Exception { |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | TReassign tReassign = tReassignService.selectById(tReassignId); |
| | | if (1 == optType){ |
| | | |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |