| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.Income; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.TransactionDetails; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.qiniuyun.QNYAuth; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | |
| | | @Autowired |
| | | private IDriverOnlineService driverOnlineService; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | |
| | | /** |
| | |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(map.get("amount")))); |
| | | baseWarpper.setName(String.valueOf(map.get("name"))); |
| | | baseWarpper.setDay(String.valueOf(map.get("day"))); |
| | | baseWarpper.setRemark(String.valueOf(map.get("remark"))); |
| | | data.add(baseWarpper); |
| | | } |
| | | return ResultUtil.success(data); |
| | |
| | | case 5: |
| | | baseWarpper.setName("跨城小件物流"); |
| | | break; |
| | | case 6: |
| | | baseWarpper.setName("平台充值"); |
| | | break; |
| | | } |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | switch (Integer.valueOf(map.get("orderType").toString())){ |
| | |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes4.size() > 0 ? incomes4.get(0).getMoney() : 0);//抽成 |
| | | break; |
| | | case 6: |
| | | List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>() |
| | | .eq("type", 1) |
| | | .eq("userId", uid) |
| | | .eq("state", 1) |
| | | .eq("userType", 2) |
| | | .eq("orderType", 6)); |
| | | if(!CollectionUtils.isEmpty(transactionDetails)){ |
| | | baseWarpper.setAmount(transactionDetails.get(0).getMoney()); |
| | | baseWarpper.setRemark(transactionDetails.get(0).getRemark()); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | baseWarpper.setData(map1); |
| | | data.add(baseWarpper); |
| | | } |
| | | List<TransactionDetails> transactionDetails = transactionDetailsService.selectList(new EntityWrapper<TransactionDetails>() |
| | | .eq("type", 1) |
| | | .eq("userId", uid) |
| | | .eq("state", 1) |
| | | .eq("userType", 2) |
| | | .eq("orderType", 6)); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| | | for (TransactionDetails transactionDetail : transactionDetails) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setDay(format.format(transactionDetail.getInsertTime())); |
| | | baseWarpper.setAmount(transactionDetail.getMoney()); |
| | | baseWarpper.setRemark(transactionDetail.getRemark()); |
| | | baseWarpper.setName("平台充值"); |
| | | baseWarpper.setData(new HashMap<>()); |
| | | data.add(baseWarpper); |
| | | } |
| | | return ResultUtil.success(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |