From 3ddba90fc26caef76bd01c22f5c2328ab8e524da Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Sat, 13 Jul 2024 14:12:47 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/app/AppController.java | 18 +- .../controller/app/AppVerifyController.java | 115 +++++++- .../controller/system/EtOrderController.java | 19 ++ .../system/EtParkingAreaController.java | 2 +- .../controller/system/SysUserController.java | 3 + .../common/constant/ServiceConstants.java | 39 +++ .../common/core/domain/entity/SysDept.java | 11 + .../common/core/domain/entity/SysUser.java | 13 + .../com/ruoyi/common/enums/BusinessType.java | 24 ++ .../com/ruoyi/common/utils/onenet/Data.java | 9 + .../common/utils/onenet/DataPointRes.java | 13 + .../ruoyi/common/utils/onenet/Datapoint.java | 13 + .../common/utils/onenet/DatapointValue.java | 66 +++++ .../ruoyi/common/utils/onenet/Datastream.java | 15 ++ .../ruoyi/system/domain/EtCapitalFlow.java | 17 +- .../com/ruoyi/system/domain/EtFeeRule.java | 6 + .../ruoyi/system/domain/EtOperatingArea.java | 3 + .../java/com/ruoyi/system/domain/EtOrder.java | 11 + .../ruoyi/system/domain/vo/DeviceNumVo.java | 6 + .../ruoyi/system/mapper/SysUserMapper.java | 10 +- .../ruoyi/system/service/CallbackService.java | 5 +- .../system/service/IAsDeviceService.java | 11 + .../ruoyi/system/service/IEtOrderService.java | 10 + .../service/impl/AsDeviceServiceImpl.java | 114 +++++++- .../service/impl/CallbackServiceImpl.java | 250 ++++++++++++------ .../service/impl/EtFeeRuleServiceImpl.java | 9 +- .../service/impl/EtOrderServiceImpl.java | 89 ++++++- .../service/impl/EtWithdrawServiceImpl.java | 2 +- .../service/impl/SysUserServiceImpl.java | 2 - .../mapper/system/AsDeviceMapper.xml | 1 + .../mapper/system/EtCapitalFlowMapper.xml | 15 ++ .../mapper/system/EtFeeRuleMapper.xml | 8 +- .../mapper/system/EtOperatingAreaMapper.xml | 5 +- .../resources/mapper/system/EtOrderMapper.xml | 21 +- .../resources/mapper/system/SysDeptMapper.xml | 8 +- .../resources/mapper/system/SysUserMapper.xml | 4 + 36 files changed, 850 insertions(+), 117 deletions(-) create mode 100644 electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Data.java create mode 100644 electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DataPointRes.java create mode 100644 electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datapoint.java create mode 100644 electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DatapointValue.java create mode 100644 electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datastream.java diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java index ac23d79..38c06e2 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppController.java @@ -131,7 +131,7 @@ public class AppController extends BaseController public TableDataInfo list(EtParkingArea etParkingArea) { etParkingArea.setStatus("0"); - startPage(); +// startPage(); List list = etParkingAreaService.selectEtParkingAreaList(etParkingArea); return getDataTable(list); } @@ -383,4 +383,20 @@ public class AppController extends BaseController return AjaxResult.success(); } + /** + * 查询版本并更新 + */ + @GetMapping("/queryVersion") + public AjaxResult queryVersion(String sn) + { + if(StrUtil.isNotBlank(sn)){ + return AjaxResult.success(asDeviceService.updateVersion(sn)); + } + List asDevices = asDeviceService.selectAsDeviceList(new AsDevice()); + for (AsDevice asDevice:asDevices) { + asDeviceService.updateVersion(asDevice.getSn()); + } + return AjaxResult.success(); + } + } diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java index 8bcec7a..b28e33f 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/app/AppVerifyController.java @@ -8,6 +8,7 @@ import com.ruoyi.common.constant.ServiceConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.AsUser; +import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginUser; @@ -91,9 +92,12 @@ public class AppVerifyController extends BaseController @Resource private EtOrderMapper etOrderMapper; - @Autowired + @Resource private ISysUserService userService; + @Autowired + private ISysDeptService deptService; + /** * 故障上报 @@ -858,6 +862,40 @@ public class AppVerifyController extends BaseController return success(longs); } + /** + * 根据token获取运营商信息 + */ + @GetMapping("/getDept") + public AjaxResult getDept() + { + AsUser asUser = getLoginUser().getAsUser(); + logger.info("获取到当前app登录用户:【{}】", JSON.toJSON(asUser)); + if(ObjectUtil.isNull(asUser.getSysUserId())){ + throw new RuntimeException("用户【"+asUser.getUserName()+"】未绑定系统用户"); + } + SysUser sysUser = userService.selectUserById(asUser.getSysUserId()); + Long deptId; + SysDept sysDept = null; + if(!sysUser.isAdmin()){ + deptId = sysUser.getDeptId(); + sysDept = deptService.selectDeptById(deptId); + logger.info("根据token获取运营商信息:【{}】", JSON.toJSON(sysDept)); + } + return success(sysDept); + } + + /** + * 绑定APP用户 + */ + @Log(title = "绑定APP用户", businessType = BusinessType.UPDATE) + @PutMapping("/bandAppUser") + public AjaxResult bandAppUser(@RequestBody SysUser user) + { + LoginUser loginUser = SecurityUtils.getLoginUser(); + user.setUserId(loginUser.getAsUser().getSysUserId()); + return toAjax(userService.bandAppUser(user)); + } + /** * 重启设备 */ @@ -871,4 +909,79 @@ public class AppVerifyController extends BaseController Boolean i =asDeviceService.reboot(sn); return success(i); } + + /** + * 保存视频地址 + */ + @Log(title = "保存视频", businessType = BusinessType.VIDEO) + @PutMapping("/order/saveVideoUrl") + public AjaxResult saveVideoUrl(@RequestBody EtOrder etOrder) + { + logger.info("【订单保存视频请求参数】:{}", JSON.toJSON(etOrder)); + //根据订单号查询订单信息 + EtOrder etOrder1 = etOrderService.selectEtOrderByOrderNo(etOrder.getOrderNo()); + if(ObjectUtil.isNull(etOrder1)){ + throw new ServiceException("订单不存在"); + } + if(!ServiceConstants.ORDER_TYPE_RIDING.equals(etOrder1.getType())){ + throw new ServiceException("保存视频失败,类型必须是骑行订单"); + } + return toAjax(etOrderService.updateEtOrderByOrderNo(etOrder)); + } + + /** + * 还车审核通过 + * 改状态,退押金 + */ + @Transactional + @Log(title = "还车审核通过", businessType = BusinessType.PASSAUDIT) + @PostMapping("/passAudit/{orderNo}") + public AjaxResult passAudit(@PathVariable("orderNo") String orderNo) + { + logger.info("还车审核通过请求:【{}】", orderNo); + EtOrder order = etOrderService.selectEtOrderByOrderNo(orderNo); + if(ObjectUtil.isNotNull(order)){ + order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + return toAjax(etOrderService.passAudit(order)); + }else{ + throw new ServiceException("订单不存在"); + } + } + + /** + * 车辆有损坏 + */ + @Log(title = "车辆有损坏", businessType = BusinessType.DAMAGED) + @PutMapping("/order/damaged") + public AjaxResult edit(@RequestBody EtOrder etOrder) + { + return toAjax(etOrderService.updateEtOrderByOrderNo(etOrder)); + } + + /** + * 官方审核通过 + */ + @Log(title = "官方审核通过", businessType = BusinessType.AUTHORITYPASS) + @PutMapping("/authoritypass/{orderNo}") + public AjaxResult authoritypass(@PathVariable("orderNo") String orderNo) + { + logger.info("官方审核通过请求:【{}】", orderNo); + EtOrder order = etOrderService.selectEtOrderByOrderNo(orderNo); + if(ObjectUtil.isNotNull(order)){ + order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + return toAjax(etOrderService.authoritypass(order)); + }else{ + throw new ServiceException("订单不存在"); + } + } + + /** + * 提交审核 + */ + @Log(title = "提交审核", businessType = BusinessType.SUBMITAUDIT) + @PutMapping("/order/submitAudit") + public AjaxResult edit2(@RequestBody EtOrder etOrder) + { + return toAjax(etOrderService.updateEtOrderByOrderNo(etOrder)); + } } diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java index 1945378..79fa16c 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtOrderController.java @@ -123,6 +123,25 @@ public class EtOrderController extends BaseController } } + /** + * 还车审核通过 + * 改状态,退押金 + */ + @Transactional + @Log(title = "还车审核通过", businessType = BusinessType.PASSAUDIT) + @PostMapping("/passAudit/{orderNo}") + public AjaxResult passAudit(@PathVariable("orderNo") String orderNo) + { + logger.info("还车审核通过请求:【{}】", orderNo); + EtOrder order = etOrderService.selectEtOrderByOrderNo(orderNo); + if(ObjectUtil.isNotNull(order)){ + order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + return toAjax(etOrderService.passAudit(order)); + }else{ + throw new ServiceException("订单不存在"); + } + } + /** * 获取订单详细信息 */ diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java index 3d80bb1..e539284 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/EtParkingAreaController.java @@ -43,7 +43,7 @@ public class EtParkingAreaController extends BaseController @GetMapping("/list") public TableDataInfo list(EtParkingArea etParkingArea) { - startPage(); +// startPage(); List list = etParkingAreaService.selectEtParkingAreaList(etParkingArea); return getDataTable(list); } diff --git a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 0f82b73..8a8c818 100644 --- a/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/electripper-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; import cn.hutool.core.util.ObjectUtil; import com.ruoyi.common.core.domain.entity.AsUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.system.domain.EtOperatingArea; import com.ruoyi.system.service.*; import org.apache.commons.lang3.ArrayUtils; @@ -76,6 +77,8 @@ public class SysUserController extends BaseController @PutMapping("/bandAppUser") public AjaxResult bandAppUser(@RequestBody SysUser user) { + LoginUser loginUser = SecurityUtils.getLoginUser(); + user.setUserId(loginUser.getUserId()); return toAjax(userService.bandAppUser(user)); } diff --git a/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java b/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java index 79ee632..5cc99d0 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java +++ b/electripper-common/src/main/java/com/ruoyi/common/constant/ServiceConstants.java @@ -86,6 +86,16 @@ public class ServiceConstants { */ public static final String ORDER_STATUS_ORDER_END = "4"; + /** + * 订单状态:5-待审核 + */ + public static final String ORDER_STATUS_TO_BE_AUDIT = "5"; + + /** + * 订单状态:6-车辆有损坏 + */ + public static final String ORDER_STATUS_DAMAGED = "6"; + /**----------------------------订单状态end----------------------------*/ /**----------------------------支付状态start----------------------------*/ @@ -158,6 +168,11 @@ public class ServiceConstants { */ public static final String VEHICLE_STATUS_TEMPORARILY_LOCK = "4"; + /** + * 车辆状态: 6-调度中 + */ + public static final String VEHICLE_STATUS_SCHEDULING = "6"; + /** * 车辆状态: 8-下线 禁用 */ @@ -549,4 +564,28 @@ public class ServiceConstants { public static final String IS_DEPOSIT_DEDUCTION = "1"; /**----------------------------是否押金抵扣end----------------------------*/ + /**----------------------------所属人类型start----------------------------*/ + /** 所属人类型:1-运营商;2-合伙人 */ + /** + * 所属人类型:1-运营商 + */ + public static final String OWNER_TYPE_OPERATOR = "1"; + /** + * 所属人类型:2-合伙人 + */ + public static final String OWNER_TYPE_PARTNER = "2"; + /**----------------------------所属人类型end----------------------------*/ + + /**----------------------------还车是否拍照审核start----------------------------*/ + /** 还车是否拍照审核:0-否;1-是 */ + /** + * 还车是否拍照审核:否 + */ + public static final String RETURN_VERIFY_NO = "0"; + /** + * 还车是否拍照审核:是 + */ + public static final String RETURN_VERIFY_YES = "1"; + /**----------------------------还车是否拍照审核end----------------------------*/ + } diff --git a/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index 5e35a7c..4b972af 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -67,6 +67,9 @@ public class SysDept extends BaseEntity /** 是否开启分账 */ private String isProfitSharing; + /** 是否有独立支付账户 */ + private String separateAccount; + /** 是否使用创享电动车小程序 */ private String isUsePlatformApp; @@ -103,6 +106,14 @@ public class SysDept extends BaseEntity /** 退款回调地址 */ private String refundNotifyUrl; + public String getSeparateAccount() { + return separateAccount; + } + + public void setSeparateAccount(String separateAccount) { + this.separateAccount = separateAccount; + } + public String getHandlingCharge() { return handlingCharge; } diff --git a/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 0970fbe..34516b0 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/electripper-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -12,6 +12,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; import javax.validation.constraints.Email; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Size; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -58,6 +59,10 @@ public class SysUser extends BaseEntity /** 密码 */ private String password; + /** 余额 */ + @Excel(name = "余额") + private BigDecimal balance; + /** 帐号状态(0正常 1停用) */ @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用") private String status; @@ -124,6 +129,14 @@ public class SysUser extends BaseEntity /** app用户id,用于分账或提现 */ private Long appUserId; + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + public Long getAppUserId() { return appUserId; } diff --git a/electripper-common/src/main/java/com/ruoyi/common/enums/BusinessType.java b/electripper-common/src/main/java/com/ruoyi/common/enums/BusinessType.java index f989c51..af805fa 100644 --- a/electripper-common/src/main/java/com/ruoyi/common/enums/BusinessType.java +++ b/electripper-common/src/main/java/com/ruoyi/common/enums/BusinessType.java @@ -77,6 +77,25 @@ public enum BusinessType */ DEDUCTION, + /** + * 还车审核通过 + */ + PASSAUDIT, + + /** + * 车辆有损坏 + */ + DAMAGED, + + /** + * 提交审核 + */ + SUBMITAUDIT, + + /** + * 还车审核通过 + */ + AUTHORITYPASS, /** * 提现 */ @@ -127,4 +146,9 @@ public enum BusinessType * 出仓 */ STASH, + /** + * 保存视频 + */ + VIDEO, + } diff --git a/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Data.java b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Data.java new file mode 100644 index 0000000..d758506 --- /dev/null +++ b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Data.java @@ -0,0 +1,9 @@ +package com.ruoyi.common.utils.onenet; + +import java.util.List; + +@lombok.Data +public class Data { + private int count; + private List devices; +} diff --git a/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DataPointRes.java b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DataPointRes.java new file mode 100644 index 0000000..39d7dbd --- /dev/null +++ b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DataPointRes.java @@ -0,0 +1,13 @@ +package com.ruoyi.common.utils.onenet; + +import com.alibaba.fastjson2.annotation.JSONField; +import lombok.Data; + +@Data +public class DataPointRes { + private int code; + private com.ruoyi.common.utils.onenet.Data data; + private String msg; + @JSONField(name = "request_id") + private String requestId; +} diff --git a/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datapoint.java b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datapoint.java new file mode 100644 index 0000000..ecafce4 --- /dev/null +++ b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datapoint.java @@ -0,0 +1,13 @@ +package com.ruoyi.common.utils.onenet; + +import lombok.Data; + +@Data +public class Datapoint { + + private String at; + + private String id; + + private Object value; +} diff --git a/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DatapointValue.java b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DatapointValue.java new file mode 100644 index 0000000..7493ba9 --- /dev/null +++ b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/DatapointValue.java @@ -0,0 +1,66 @@ +package com.ruoyi.common.utils.onenet; + +import lombok.Data; + +import java.util.List; + +@Data +public class DatapointValue { + + private List dsArray; + private int jiaoshui_qiangdu; + private nextDs next_ds; + private Mc mc; + private Set set; + private Tr tr; + private int turan_show; + + + // 定时器列表 Ds + @Data + public static class Ds { + private int hour;//时 + private int min;//分 + private Boolean once; //是否单次,false为循环浇水,true为单次 + private int sec;//浇水时长(单位秒) + private Boolean sw;// 开关 + private int week;//周转成二进制 bit0位开始为周一 0110 (week&1<<0) 1<<1 1<<2 00000110 + private int id; + } + + // 内部类 Mc 脉冲 + @Data + public static class Mc { + private int jg_sec;//间隔时间 + private int js_sec;//启动时间 + private Boolean kaiguan; //开关 普通模式情况下获取的是ds.js_sec的时间 + + } + + // 内部类 Set 设置 + @Data + public static class Set { + private Boolean kaiguan; + private int xp_min; + } + + // 内部类 Tr 土壤 + @Data + public static class Tr { + private int end_sd; + private Boolean kaiguan; + private int start_sd; + + } + + //下次浇水时间 + @Data + public static class nextDs { + private int hour; + private int min; + private int sec; + private Boolean sw;//定时总开关,先根据总开关判断定时功能是否关闭,如果打开,再判断定时数组中有没有有效的定时器 + private int week;//周转成二进制 bit0位开始为周一 0110 (week&1<<0) 1<<1 1<<2 00000110 + private String date;//日期 + } +} diff --git a/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datastream.java b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datastream.java new file mode 100644 index 0000000..e9c3760 --- /dev/null +++ b/electripper-common/src/main/java/com/ruoyi/common/utils/onenet/Datastream.java @@ -0,0 +1,15 @@ +package com.ruoyi.common.utils.onenet; + +import lombok.Data; + +import java.util.List; + +@Data +public class Datastream { + + private List datastreams; + + private String id; + + private String title; +} diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtCapitalFlow.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtCapitalFlow.java index 12fe7c9..abb0213 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtCapitalFlow.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtCapitalFlow.java @@ -1,12 +1,10 @@ package com.ruoyi.system.domain; -import java.math.BigDecimal; - -import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import lombok.Data; + +import java.math.BigDecimal; /** * 资金流水对象 et_capital_flow @@ -29,6 +27,15 @@ public class EtCapitalFlow extends BaseEntity @Excel(name = "区域名称") private String areaName; + @Excel(name = "所属人id") + private String owner; + + @Excel(name = "所属人") + private Long ownerId; + + @Excel(name = "所属人类型") + private String ownerType; + /** 关联订单号 */ @Excel(name = "关联订单号") private String orderNo; diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtFeeRule.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtFeeRule.java index 1172865..a4ad237 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtFeeRule.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtFeeRule.java @@ -1,5 +1,6 @@ package com.ruoyi.system.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import lombok.Data; @@ -28,6 +29,11 @@ public class EtFeeRule extends BaseEntity @Excel(name = "运营区id") private Long areaId; + /** 运营区 */ + @Excel(name = "运营区") + @TableField(exist = false) + private EtOperatingArea area; + /** 运营商 */ @Excel(name = "运营商") private String deptName; diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOperatingArea.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOperatingArea.java index 2409847..b4719ad 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOperatingArea.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOperatingArea.java @@ -207,4 +207,7 @@ public class EtOperatingArea extends BaseEntityPlus implements Serializable /** 是否开启押金抵扣:0-否;1-是 */ private String isDepositDeduction; + + /** 还车是否拍照审核:0-否;1-是 */ + private String returnVerify; } diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java index c552380..18645ed 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/EtOrder.java @@ -235,4 +235,15 @@ public class EtOrder extends BaseEntity @TableField(exist = false) private String isDepositDeduction; + /** 还车视频 */ + @Excel(name = "还车视频") + private String videoUrl; + + /** 扣除金额 */ + @Excel(name = "扣除金额") + private String deductionAmount; + + /** 音频文件 */ + @Excel(name = "音频文件") + private String audioFiles; } diff --git a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/DeviceNumVo.java b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/DeviceNumVo.java index de321a1..767aee1 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/domain/vo/DeviceNumVo.java +++ b/electripper-system/src/main/java/com/ruoyi/system/domain/vo/DeviceNumVo.java @@ -36,4 +36,10 @@ public class DeviceNumVo { /** 调度设备 */ private Integer dispatchNum; + /** 仓库设备 */ + private Integer inStashNum; + + /** 运营中 */ + private Integer inOperation; + } diff --git a/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index a41c5cf..9c3ee8c 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/electripper-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -1,8 +1,8 @@ package com.ruoyi.system.mapper; +import java.math.BigDecimal; import java.util.List; -import com.ruoyi.common.core.domain.entity.AsUser; import org.apache.ibatis.annotations.Param; import com.ruoyi.common.core.domain.entity.SysUser; @@ -134,4 +134,12 @@ public interface SysUserMapper * @return */ void bandAppUser(@Param("appUserId") Long appUserId, @Param("userId") Long userId); + + /** + * 更改余额 + * + * @return 结果 + */ + void changeUserBalance(@Param("amount")BigDecimal amount, @Param("userId")Long userId); + } diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/CallbackService.java b/electripper-system/src/main/java/com/ruoyi/system/service/CallbackService.java index e31f2e1..95ee5ec 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/CallbackService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/CallbackService.java @@ -1,5 +1,6 @@ package com.ruoyi.system.service; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.system.domain.EtOperatingArea; import com.ruoyi.system.domain.EtOrder; @@ -29,9 +30,11 @@ public interface CallbackService { * @param order 订单 * @param type 类型 * @param busType 业务类型 + * @param ownerType 所属人类型 + * @param user 合伙人对象 * @return void */ - public void capitalFlowRecords(EtOrder order, String type, String busType); + public void capitalFlowRecords(EtOrder order, String type, String busType, String ownerType, SysUser user); /** * 分红处理 diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java index 5ec4826..f1f9b8e 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IAsDeviceService.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.common.utils.onenet.DataPointRes; import com.ruoyi.common.utils.onenet.ResponseVo; import com.ruoyi.system.domain.AsDevice; import com.ruoyi.system.domain.EtOperatingArea; @@ -157,6 +158,11 @@ public interface IAsDeviceService extends IService */ public ResponseVo sendCommandWithResp(String mac, String token, String command, String type); + /** + * 查询数据点 + */ + public DataPointRes historyDatapoints(String mac, String token); + /** * 响铃寻车 */ @@ -327,6 +333,11 @@ public interface IAsDeviceService extends IService */ IsInParkingAreaVo isInParkingArea(String longitude, String latitude,String areaId,String sn); + /** + * 查询版本并更新 + */ + boolean updateVersion(String sn); + // /** // * 是否靠近运营区边界 // */ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java b/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java index dbfb0b4..92c798d 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/IEtOrderService.java @@ -191,4 +191,14 @@ public interface IEtOrderService * 押金抵扣 */ int deduction(EtOrder etOrder); + + /** + * 还车审核通过 + */ + boolean passAudit(EtOrder etOrder); + + /** + * 官方审核通过 + */ + boolean authoritypass(EtOrder etOrder); } diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java index e1a1eb9..569d58d 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/AsDeviceServiceImpl.java @@ -12,20 +12,14 @@ import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.IotConstants; import com.ruoyi.common.constant.ServiceConstants; import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.entity.AsUser; import com.ruoyi.common.core.domain.entity.SysDept; -import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.CommonUtil; import com.ruoyi.common.utils.DateUtils; -import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.http.HttpUtils; import com.ruoyi.common.utils.map.GeoUtils; -import com.ruoyi.common.utils.onenet.CreateDeviceVo; -import com.ruoyi.common.utils.onenet.IotUtil; -import com.ruoyi.common.utils.onenet.ResponseVo; -import com.ruoyi.common.utils.onenet.Token; +import com.ruoyi.common.utils.onenet.*; import com.ruoyi.common.utils.uuid.IdUtils; import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.response.OrderResponse; @@ -103,7 +97,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i @Resource private EtOrderMapper etOrderMapper; - @Autowired + @Resource private EtCommandLogMapper etCommandLogMapper; @Value(value = "${iot.iotUrl}") @@ -127,7 +121,30 @@ public class AsDeviceServiceImpl extends ServiceImpl i @Override public AsDevice selectAsDeviceByDeviceId(Long deviceId) { - return asDeviceMapper.selectAsDeviceByDeviceId(deviceId); + AsDevice device = asDeviceMapper.selectAsDeviceByDeviceId(deviceId); + String status = device.getStatus(); + if(ObjectUtil.isNotNull(status)){ + String typeName = sysDictDataService.selectDictLabel("as_device_status", status); + device.setStatusStr(typeName); + if(status.equals(ServiceConstants.VEHICLE_STATUS_NOT_BAND) && ObjectUtil.isNotNull(device.getAreaId())){ + device.setStatus(ServiceConstants.VEHICLE_STATUS_NOT_LISTING); + int i = asDeviceMapper.updateAsDevice(device); + } + } + Long areaId = device.getAreaId(); + if (ObjectUtil.isNotNull(areaId) && areaId!=0){ + EtOperatingArea etOperatingArea = etOperatingAreaService.selectEtOperatingAreaByAreaId(areaId); + device.setAreaName(etOperatingArea.getAreaName()); + } + if(ObjectUtil.isNotNull(areaId) && areaId!=0){ + SysDept sysDept = wxPayService.getDeptObjByAreaId(areaId); + //https://dianche.chuantewulian.cn?sn=https://dche.ccttiot.com?sn=3000900 + device.setQrText(sysDept.getDomain()+"?sn="+device.getSn()); + device.setDeptName(sysDept.getDeptName()); + }else{ + device.setQrText(""); + } + return device; } /** @@ -455,7 +472,11 @@ public class AsDeviceServiceImpl extends ServiceImpl i wrapper.between("remaining_power", Integer.parseInt(powerStart), Integer.parseInt(powerEnd)); } if(StrUtil.isNotBlank(status)){ - wrapper.in("status",status); + if(StrUtil.equals(status,"-0")){ + wrapper.ne("status","0"); + }else{ + wrapper.in("status",status); + } } if(StrUtil.isNotBlank(onlineStatus)){ wrapper.in("online_status",onlineStatus); @@ -495,6 +516,9 @@ public class AsDeviceServiceImpl extends ServiceImpl i Integer ridingNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_IN_USING,areaId); deviceNumVo.setRidingNum(ridingNum);//骑行中 + Integer inOperation = setInOperationNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_NOT_LISTING,areaId); + deviceNumVo.setInOperation(inOperation);//投放中 + Integer temporarilyLockNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_TEMPORARILY_LOCK,areaId); deviceNumVo.setTemporarilyLockNum(temporarilyLockNum);//临时锁车 @@ -504,8 +528,12 @@ public class AsDeviceServiceImpl extends ServiceImpl i Integer normalNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_NORMAL,areaId); deviceNumVo.setNormalNum(normalNum);//正常待租 + Integer inStashNum = setNum(powerStart, powerEnd,ServiceConstants.VEHICLE_STATUS_NOT_LISTING,areaId); + deviceNumVo.setInStashNum(inStashNum); + QueryWrapper wrapperForOffline = new QueryWrapper<>(); wrapperForOffline.eq("online_status","0");//在线状态:0-不在线;1-在线 + wrapperForOffline.ne("status","0");// if(StrUtil.isNotBlank(powerStart) && StrUtil.isNotBlank(powerEnd)){ wrapperForOffline.between("remaining_power",Integer.parseInt(powerStart),Integer.parseInt(powerEnd)); } @@ -541,7 +569,18 @@ public class AsDeviceServiceImpl extends ServiceImpl i wrapper.eq("area_id",areaId); } return asDeviceMapper.selectCount(wrapper); + } + private Integer setInOperationNum(String powerStart, String powerEnd,String status,String areaId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.ne("status",status); + if(StrUtil.isNotBlank(powerStart) && StrUtil.isNotBlank(powerEnd)){ + wrapper.between("remaining_power", Integer.parseInt(powerStart),Integer.parseInt(powerEnd)); + } + if(StrUtil.isNotBlank(areaId)){ + wrapper.eq("area_id",areaId); + } + return asDeviceMapper.selectCount(wrapper); } @@ -644,6 +683,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i /** 2.发送命令*/ sendCommand(asDevice.getMac(), token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_20,"管理员开锁"); asDevice.setIsAdminUnlocking("1"); + asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_SCHEDULING); asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN); int i = asDeviceMapper.updateAsDevice(asDevice); if(i>0){ @@ -668,6 +708,7 @@ public class AsDeviceServiceImpl extends ServiceImpl i /** 2.发送命令*/ sendCommand(mac, token,IotConstants.COMMAND_OPEN+IotConstants.COMMAND_FREQUENCY_20,"管理员开锁"); asDevice.setIsAdminUnlocking("1"); + asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_SCHEDULING); asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_OPEN); int i = asDeviceMapper.updateAsDevice(asDevice); if(i>0){ @@ -872,6 +913,16 @@ public class AsDeviceServiceImpl extends ServiceImpl i return JSON.parseObject(result,ResponseVo.class); } + /** 查询数据点*/ + @Override + public DataPointRes historyDatapoints(String mac, String token) { + String param = "device_name=" + mac + "&product_id=" + productId +"&timeout=" + timeout; + String sendUrl = iotUrl+ IotConstants.ADDS_CURRENT_DATAPOINTS + "?"+param; + String result = HttpUtils.sendGetWithToken(sendUrl, null, token); + log.info("【查询数据点】===>IOT请求调用结果:【{}】",result); + return JSON.parseObject(result,DataPointRes.class); + } + /** * 响铃寻车 * @param sn @@ -1900,6 +1951,49 @@ public class AsDeviceServiceImpl extends ServiceImpl i return isInParkingAreaVo; } + /** + * 查询版本并更新 + */ + @Override + @SneakyThrows + public boolean updateVersion(String sn) { + AsDevice device = asDeviceMapper.selectAsDeviceBySn(sn); + if(device!=null){ + String version = device.getVersion(); + if(StrUtil.isBlank(version)){ + String token = Token.getToken(); + DataPointRes datapoints = historyDatapoints(asDeviceMapper.selectAsDeviceBySn(sn).getMac(), token); + if(datapoints.getCode() == 0){ + Data data = datapoints.getData(); + List datastreams = data.getDevices(); + for (Datastream datastream: datastreams) { + List datapointList = datastream.getDatastreams(); + if(ObjectUtil.isNotNull(datapointList)){ + for (Datapoint datapoint:datapointList) { + if(datapoint.getId().equals(IotConstants.ONENET_VER)){ + Integer value = (Integer)datapoint.getValue(); + log.info("【查询数据点】===>获取到版本值:【{}】", value); + if(value != null){ + AsDevice device1 = new AsDevice(); + device1.setVersion(value.toString()); + device1.setSn(sn); + if(asDeviceMapper.updateAsDeviceBySn(device1) > 0){ + log.info("【查询数据点】===>更新版本成功"); + return true; + }else{ + log.info("【查询数据点】===>更新版本失败"); + } + } + } + } + } + } + } + } + } + return false; + } + /** * sn和mac号绑定 diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java index 724cb77..1324300 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/CallbackServiceImpl.java @@ -115,6 +115,9 @@ public class CallbackServiceImpl implements CallbackService { @Resource private EtCallbackLogMapper callbackLogMapper; + @Autowired + private CallbackService callbackService; + // @Value("${et.handlingCharge}") // private String handlingCharge; @@ -169,20 +172,25 @@ public class CallbackServiceImpl implements CallbackService { if(attachVo.getType().equals(ServiceConstants.BUSINESS_TYPE_RIDING)){ logger.info("【微信支付回调】骑行支付"); // 1-骑行支付 关锁 - order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + EtOperatingArea area = etOperatingAreaService.selectEtOperatingAreaByAreaId(order.getAreaId()); order.setMark("骑行支付"); + logger.info("=================【微信支付回调】11111111=================="); + if(ServiceConstants.RETURN_VERIFY_YES.equals(area.getReturnVerify())){ + logger.info("【微信支付回调】还车-----需要-----拍照审核"); + order.setStatus(ServiceConstants.ORDER_STATUS_TO_BE_AUDIT);//如果还车需要拍照审核,状态为待审核 + }else{ + logger.info("【微信支付回调】还车-----不需要-----拍照审核"); + order.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + // 还车结算___小时后自动退押金---创建一个定时器TimerTask,计算出退还时间后,执行退款操作 + logger.info("=================【微信支付回调】22222222=================="); + // 退还押金处理 + refundDeposit(area.getDeposit(), order, asUser); + logger.info("=================【微信支付回调】33333333=================="); + } asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NORMAL);//还车后车辆正常运营 asDevice.setLockStatus(ServiceConstants.LOCK_STATUS_CLOSE); - // 新增资金流水记录 - capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING); - logger.info("=================【微信支付回调】11111111=================="); - // 还车结算___小时后自动退押金---创建一个定时器TimerTask,计算出退还时间后,执行退款操作 - EtOperatingArea area = etOperatingAreaService.selectEtOperatingAreaByAreaId(order.getAreaId()); - logger.info("=================【微信支付回调】22222222=================="); - // 退还押金处理 - refundDeposit(area.getDeposit(), order, asUser); - logger.info("=================【微信支付回调】33333333=================="); + capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING,ServiceConstants.OWNER_TYPE_OPERATOR,null); // 24小时后发起分账 scheduledExecutorService.schedule(() -> { // 请求分账处理 @@ -323,6 +331,7 @@ public class CallbackServiceImpl implements CallbackService { if(i==0){ throw new ServiceException("保存分账明细失败"); } +// callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_INCOME,ServiceConstants.ORDER_TYPE_RIDING,ServiceConstants.OWNER_TYPE_PARTNER,sysUser1); } }else{ logger.info("=================【微信支付回调】合伙人【{}】已禁用或已过期合作期==================",sysUser1.getUserName()); @@ -458,81 +467,158 @@ public class CallbackServiceImpl implements CallbackService { * 资金流水记录 * */ @Override - public void capitalFlowRecords(EtOrder order,String type,String busType) { -// if(ObjectUtil.isNotNull(etCapitalFlowService.selectEtCapitalFlowByOutTradeNo(order.getOutTradeNo()))){ -// return; -// } - SysDept sysDept = wxPayService.getDeptObjByAreaId(order.getAreaId()); + public void capitalFlowRecords(EtOrder order,String type,String busType,String ownerType,SysUser user) { EtCapitalFlow capitalFlow = new EtCapitalFlow(); - capitalFlow.setAreaId(order.getAreaId()); - capitalFlow.setOrderNo(order.getOrderNo()); - capitalFlow.setOutTradeNo(order.getOutTradeNo()); - capitalFlow.setType(type); - capitalFlow.setBusType(busType); - capitalFlow.setAmount(order.getPayFee()); - String handlingCharge1 = sysDept.getHandlingCharge(); - logger.info("【微信支付回调--保存资金流水记录】 获取到配置手续费==============handlingCharge=====================:"+handlingCharge1); - BigDecimal bigDecimal = new BigDecimal(handlingCharge1).divide(new BigDecimal(1000), 6, BigDecimal.ROUND_HALF_UP); - logger.info("【微信支付回调--保存资金流水记录】 转换后手续费==============bigDecimal=====================:"+bigDecimal); - BigDecimal handlingCharge = bigDecimal.multiply(order.getPayFee()).setScale(2, BigDecimal.ROUND_HALF_UP); - logger.info("【微信支付回调--保存资金流水记录】 计算出的手续费==============handlingCharge=====================:"+handlingCharge); - BigDecimal serviceFeeScale = new BigDecimal(sysDept.getPlatformServiceFee()).divide(new BigDecimal(100), 6, BigDecimal.ROUND_HALF_UP); - BigDecimal platformServiceFee = serviceFeeScale.multiply(order.getPayFee()); - logger.info("【微信支付回调--保存资金流水记录】 计算出的平台服务费==============platformServiceFee=====================:"+platformServiceFee); - capitalFlow.setPlatformServiceFee(platformServiceFee); - capitalFlow.setHandlingCharge(handlingCharge);//手续费 - if(busType.equals(ServiceConstants.ORDER_TYPE_WITHDRAW)){//提现,需要手续费,不需要平台服务费 - BigDecimal separateAccountFee = order.getPayFee(); - capitalFlow.setPartnerDividend(BigDecimal.ZERO); - capitalFlow.setPlatformServiceFee(BigDecimal.ZERO); - capitalFlow.setOperatorDividend(separateAccountFee.negate()); - capitalFlow.setOperatorBalance(sysDept.getBalance().subtract(separateAccountFee)); - deptService.changeDeptBalance(separateAccountFee.negate(),sysDept.getDeptId()); - logger.info("【微信支付回调--保存资金流水记录】 ==============支出=====================:"); - }else{ - logger.info("【微信支付回调--保存资金流水记录】 ==============业务类型=====================:"+busType); - BigDecimal partnerDividend = BigDecimal.ZERO; - BigDecimal separateAccountFee = order.getPayFee().subtract(handlingCharge).subtract(platformServiceFee); - logger.info("【微信支付回调--保存资金流水记录】 ==============扣掉手续费和服务费之后的金额,这个金额拿来分账=====================:"+separateAccountFee); - BigDecimal operatorDividend = separateAccountFee; - if(sysDept.getIsProfitSharing().equals("true")){//需要分账 - logger.info("【微信支付回调--保存资金流水记录】 ==============需要分账====================="+sysDept.getIsProfitSharing()); - //获取所有合伙人列表 - SysUser sysUser = new SysUser(); - sysUser.setUserType("03"); - sysUser.setAreaId(order.getAreaId()); - List sysUsers = userMapper.selectUserList(sysUser); - double totalDividendProportion = sysUsers.stream() - .mapToDouble(SysUser::getDividendProportion) - .sum();//算出总的分成比例 - BigDecimal decimal = new BigDecimal(totalDividendProportion).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); - partnerDividend = operatorDividend.multiply(decimal); - operatorDividend = operatorDividend.subtract(partnerDividend); - } - logger.info("【微信支付回调--保存资金流水记录】 ==============partnerDividend=====================:"+partnerDividend); - logger.info("【微信支付回调--保存资金流水记录】 ==============operatorDividend=====================:"+operatorDividend); - if(type.equals(ServiceConstants.FLOW_TYPE_INCOME)){ - capitalFlow.setPartnerDividend(partnerDividend); - capitalFlow.setOperatorDividend(operatorDividend); - capitalFlow.setOperatorBalance(sysDept.getBalance().add(operatorDividend)); - deptService.changeDeptBalance(operatorDividend,sysDept.getDeptId()); - logger.info("【微信支付回调--保存资金流水记录】 ==============收入=====================:"); - }else{ - capitalFlow.setPartnerDividend(partnerDividend.negate()); - capitalFlow.setOperatorDividend(operatorDividend.negate()); - capitalFlow.setOperatorBalance(sysDept.getBalance().subtract(operatorDividend)); - deptService.changeDeptBalance(operatorDividend.negate(),sysDept.getDeptId()); + if(ownerType.equals(ServiceConstants.OWNER_TYPE_OPERATOR)){//运营商 + SysDept sysDept = wxPayService.getDeptObjByAreaId(order.getAreaId()); + capitalFlow.setAreaId(order.getAreaId()); + capitalFlow.setOrderNo(order.getOrderNo()); + capitalFlow.setOutTradeNo(order.getOutTradeNo()); + capitalFlow.setType(type); + capitalFlow.setBusType(busType); + capitalFlow.setOwnerType(ownerType); + capitalFlow.setOwnerId(sysDept.getDeptId()); + capitalFlow.setOwner(sysDept.getDeptName()); + capitalFlow.setAmount(order.getPayFee()); + String handlingCharge1 = sysDept.getHandlingCharge(); + logger.info("【微信支付回调--保存资金流水记录】 获取到配置手续费==============handlingCharge=====================:"+handlingCharge1); + BigDecimal bigDecimal = new BigDecimal(handlingCharge1).divide(new BigDecimal(1000), 6, BigDecimal.ROUND_HALF_UP); + logger.info("【微信支付回调--保存资金流水记录】 转换后手续费==============bigDecimal=====================:"+bigDecimal); + BigDecimal handlingCharge = bigDecimal.multiply(order.getPayFee()).setScale(2, BigDecimal.ROUND_HALF_UP); + logger.info("【微信支付回调--保存资金流水记录】 计算出的手续费==============handlingCharge=====================:"+handlingCharge); + BigDecimal serviceFeeScale = new BigDecimal(sysDept.getPlatformServiceFee()).divide(new BigDecimal(100), 6, BigDecimal.ROUND_HALF_UP); + BigDecimal platformServiceFee = serviceFeeScale.multiply(order.getPayFee()); + logger.info("【微信支付回调--保存资金流水记录】 计算出的平台服务费==============platformServiceFee=====================:"+platformServiceFee); + capitalFlow.setPlatformServiceFee(platformServiceFee); + capitalFlow.setHandlingCharge(handlingCharge);//手续费 + if(busType.equals(ServiceConstants.ORDER_TYPE_WITHDRAW)){//提现,需要手续费,不需要平台服务费 + BigDecimal separateAccountFee = order.getPayFee(); + capitalFlow.setPartnerDividend(BigDecimal.ZERO); + capitalFlow.setPlatformServiceFee(BigDecimal.ZERO); + capitalFlow.setOperatorDividend(separateAccountFee.negate()); + capitalFlow.setOperatorBalance(sysDept.getBalance().subtract(separateAccountFee)); + deptService.changeDeptBalance(separateAccountFee.negate(),sysDept.getDeptId()); logger.info("【微信支付回调--保存资金流水记录】 ==============支出=====================:"); + }else{ + logger.info("【微信支付回调--保存资金流水记录】 ==============业务类型=====================:"+busType); + BigDecimal partnerDividend = BigDecimal.ZERO; + BigDecimal separateAccountFee = order.getPayFee().subtract(handlingCharge).subtract(platformServiceFee); + logger.info("【微信支付回调--保存资金流水记录】 ==============扣掉手续费和服务费之后的金额,这个金额拿来分账=====================:"+separateAccountFee); + BigDecimal operatorDividend = separateAccountFee; + if(sysDept.getIsProfitSharing().equals("true")){//需要分账 + logger.info("【微信支付回调--保存资金流水记录】 ==============需要分账====================="+sysDept.getIsProfitSharing()); + //获取所有合伙人列表 + SysUser sysUser = new SysUser(); + sysUser.setUserType("03"); + sysUser.setAreaId(order.getAreaId()); + List sysUsers = userMapper.selectUserList(sysUser); + double totalDividendProportion = sysUsers.stream() + .mapToDouble(SysUser::getDividendProportion) + .sum();//算出总的分成比例 + BigDecimal decimal = new BigDecimal(totalDividendProportion).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); + partnerDividend = operatorDividend.multiply(decimal); + operatorDividend = operatorDividend.subtract(partnerDividend); + } + logger.info("【微信支付回调--保存资金流水记录】 ==============partnerDividend=====================:"+partnerDividend); + logger.info("【微信支付回调--保存资金流水记录】 ==============operatorDividend=====================:"+operatorDividend); + if(type.equals(ServiceConstants.FLOW_TYPE_INCOME)){ + capitalFlow.setPartnerDividend(partnerDividend); + capitalFlow.setOperatorDividend(operatorDividend); + capitalFlow.setOperatorBalance(sysDept.getBalance().add(operatorDividend)); + deptService.changeDeptBalance(operatorDividend,sysDept.getDeptId()); + logger.info("【微信支付回调--保存资金流水记录】 ==============收入=====================:"); + }else{ + capitalFlow.setPartnerDividend(partnerDividend.negate()); + capitalFlow.setOperatorDividend(operatorDividend.negate()); + capitalFlow.setOperatorBalance(sysDept.getBalance().subtract(operatorDividend)); + deptService.changeDeptBalance(operatorDividend.negate(),sysDept.getDeptId()); + logger.info("【微信支付回调--保存资金流水记录】 ==============支出=====================:"); + } + } + capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX); + capitalFlow.setCreateTime(DateUtils.getNowDate()); + logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); + int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); + if(i==0){ + throw new ServiceException("保存资金流水记录失败"); + }else { + logger.info("【微信支付回调】保存资金流水记录成功"); + } + }else{ + capitalFlow.setAreaId(order.getAreaId()); + capitalFlow.setOrderNo(order.getOrderNo()); + capitalFlow.setOutTradeNo(order.getOutTradeNo()); + capitalFlow.setType(type); + capitalFlow.setBusType(busType); + capitalFlow.setOwnerType(ownerType); + capitalFlow.setOwnerId(user.getUserId()); + capitalFlow.setOwner(user.getUserName()); + capitalFlow.setAmount(order.getPayFee()); +// String handlingCharge1 = sysDept.getHandlingCharge(); +// logger.info("【微信支付回调--保存资金流水记录】 获取到配置手续费==============handlingCharge=====================:"+handlingCharge1); +// BigDecimal bigDecimal = new BigDecimal(handlingCharge1).divide(new BigDecimal(1000), 6, BigDecimal.ROUND_HALF_UP); +// logger.info("【微信支付回调--保存资金流水记录】 转换后手续费==============bigDecimal=====================:"+bigDecimal); +// BigDecimal handlingCharge = bigDecimal.multiply(order.getPayFee()).setScale(2, BigDecimal.ROUND_HALF_UP); +// logger.info("【微信支付回调--保存资金流水记录】 计算出的手续费==============handlingCharge=====================:"+handlingCharge); +// BigDecimal serviceFeeScale = new BigDecimal(sysDept.getPlatformServiceFee()).divide(new BigDecimal(100), 6, BigDecimal.ROUND_HALF_UP); +// BigDecimal platformServiceFee = serviceFeeScale.multiply(order.getPayFee()); +// logger.info("【微信支付回调--保存资金流水记录】 计算出的平台服务费==============platformServiceFee=====================:"+platformServiceFee); +// capitalFlow.setPlatformServiceFee(platformServiceFee); +// capitalFlow.setHandlingCharge(handlingCharge);//手续费 + if(busType.equals(ServiceConstants.ORDER_TYPE_WITHDRAW)){//提现,需要手续费,不需要平台服务费 + BigDecimal separateAccountFee = order.getPayFee(); + capitalFlow.setPartnerDividend(BigDecimal.ZERO); + capitalFlow.setPlatformServiceFee(BigDecimal.ZERO); + capitalFlow.setOperatorDividend(separateAccountFee.negate()); + capitalFlow.setOperatorBalance(user.getBalance().subtract(separateAccountFee)); + userMapper.changeUserBalance(separateAccountFee.negate(),user.getUserId()); + logger.info("【保存资金流水记录】 ==============支出=====================:"); + }else{ + logger.info("【微信支付回调--保存资金流水记录】 ==============业务类型=====================:"+busType); +// BigDecimal partnerDividend = BigDecimal.ZERO; +// BigDecimal separateAccountFee = order.getPayFee().subtract(handlingCharge).subtract(platformServiceFee); +// logger.info("【微信支付回调--保存资金流水记录】 ==============扣掉手续费和服务费之后的金额,这个金额拿来分账=====================:"+separateAccountFee); +// BigDecimal operatorDividend = separateAccountFee; +// if(sysDept.getIsProfitSharing().equals("true")){//需要分账 +// logger.info("【微信支付回调--保存资金流水记录】 ==============需要分账====================="+sysDept.getIsProfitSharing()); +// //获取所有合伙人列表 +// SysUser sysUser = new SysUser(); +// sysUser.setUserType("03"); +// sysUser.setAreaId(order.getAreaId()); +// List sysUsers = userMapper.selectUserList(sysUser); +// double totalDividendProportion = sysUsers.stream() +// .mapToDouble(SysUser::getDividendProportion) +// .sum();//算出总的分成比例 +// BigDecimal decimal = new BigDecimal(totalDividendProportion).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP); +// partnerDividend = operatorDividend.multiply(decimal); +// operatorDividend = operatorDividend.subtract(partnerDividend); +// } +// logger.info("【微信支付回调--保存资金流水记录】 ==============partnerDividend=====================:"+partnerDividend); +// logger.info("【微信支付回调--保存资金流水记录】 ==============operatorDividend=====================:"+operatorDividend); + BigDecimal operatorDividend = order.getPayFee(); + if(type.equals(ServiceConstants.FLOW_TYPE_INCOME)){ + capitalFlow.setPartnerDividend(BigDecimal.ZERO); + capitalFlow.setOperatorDividend(BigDecimal.ZERO); + capitalFlow.setOperatorBalance(user.getBalance().add(operatorDividend)); + userMapper.changeUserBalance(operatorDividend,user.getUserId()); + logger.info("【微信支付回调--保存资金流水记录】 ==============收入=====================:"); + }else{ + capitalFlow.setPartnerDividend(BigDecimal.ZERO); + capitalFlow.setOperatorDividend(BigDecimal.ZERO); + capitalFlow.setOperatorBalance(user.getBalance().subtract(order.getPayFee())); + userMapper.changeUserBalance(operatorDividend.negate(),user.getUserId()); + logger.info("【微信支付回调--保存资金流水记录】 ==============支出=====================:"); + } + } + capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX); + capitalFlow.setCreateTime(DateUtils.getNowDate()); + logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); + int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); + if(i==0){ + throw new ServiceException("保存资金流水记录失败"); + }else { + logger.info("【微信支付回调】保存资金流水记录成功"); } - } - capitalFlow.setPayType(ServiceConstants.PAY_TYPE_WX); - capitalFlow.setCreateTime(DateUtils.getNowDate()); - logger.info("【微信支付回调】保存资金流水记录对象 : " + JSON.toJSONString(capitalFlow)); - int i = etCapitalFlowService.insertEtCapitalFlow(capitalFlow); - if(i==0){ - throw new ServiceException("保存资金流水记录失败"); - }else { - logger.info("【微信支付回调】保存资金流水记录成功"); } } diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtFeeRuleServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtFeeRuleServiceImpl.java index 6e00559..a041f56 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtFeeRuleServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtFeeRuleServiceImpl.java @@ -6,7 +6,7 @@ import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.system.service.IAsUserService; +import com.ruoyi.system.service.IEtOperatingAreaService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.EtFeeRuleMapper; @@ -25,6 +25,9 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService @Autowired private EtFeeRuleMapper etFeeRuleMapper; + @Autowired + private IEtOperatingAreaService etOperatingAreaService; + /** * 查询收费方式 * @@ -34,7 +37,9 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService @Override public EtFeeRule selectEtFeeRuleByRuleId(Long ruleId) { - return etFeeRuleMapper.selectEtFeeRuleByRuleId(ruleId); + EtFeeRule etFeeRule = etFeeRuleMapper.selectEtFeeRuleByRuleId(ruleId); + etFeeRule.setArea(etOperatingAreaService.selectEtOperatingAreaByAreaId(etFeeRule.getAreaId())); + return etFeeRule; } /** diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java index 7d3d298..de88630 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtOrderServiceImpl.java @@ -404,7 +404,7 @@ public class EtOrderServiceImpl implements IEtOrderService /** 退款剩余押金*/ Refund refund = wxPayService.refund(depositOrder, "押金抵扣退款",afterDeductionFee,IdUtils.getOrderNo("ref")); /** 2.记录退款表 创建退款对象*/ - depositOrder.setReason("押金提现"); + depositOrder.setReason("押金抵扣退款"); EtRefund refund1= createRefund(depositOrder, afterDeductionFee, null, null, null, null, refund.getOutRefundNo(),ServiceConstants.REFUND_TYPE_DEPOSIT); int i = etRefundService.insertEtRefund(refund1); if(i == 0){ @@ -426,6 +426,91 @@ public class EtOrderServiceImpl implements IEtOrderService return 1; } + /** + * 还车审核通过 + * 1.更新订单状态为订单结束 + * 2.退押金 + * 3.创建退款记录 + * 4.更新用户余额 + */ + @Override + public boolean passAudit(EtOrder etOrder) { + /** 1.更新订单状态为订单结束*/ + etOrder.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + int updateEtOrder = etOrderMapper.updateEtOrder(etOrder); + if(updateEtOrder == 0){ + throw new ServiceException("还车审核失败,更新订单失败"); + } + /** 2.退押金*/ + EtOrder depositOrder = getDepositOrder(etOrder.getUserId()); + BigDecimal deposit = depositOrder.getTotalFee(); +// Refund refund = wxPayService.refund(depositOrder, "还车审核通过后退押金",deposit,IdUtils.getOrderNo("ref")); + /** 3.记录退款表 创建退款对象*/ +// depositOrder.setReason("还车审核通过后退押金"); +// EtRefund refund1= createRefund(depositOrder, deposit, null, null, null, null, refund.getOutRefundNo(),ServiceConstants.REFUND_TYPE_DEPOSIT); +// int i = etRefundService.insertEtRefund(refund1); +// if(i == 0){ +// log.info("【还车审核通过】保存退款对象失败"); +// throw new ServiceException("【还车审核通过】,保存退款对象失败"); +// } + /** 4.更新用户余额*/ + AsUser asUser = asUserService.selectUserById(depositOrder.getUserId()); + if(asUser!=null){ + // 更新用户并更新缓存 + asUser.setBalance(BigDecimal.ZERO); + if (asUserService.updateUserProfile(asUser) > 0) + { + log.info("【还车审核通过】更新用户信息成功:"+ JSON.toJSON(asUser)); + }else{ + throw new ServiceException("【还车审核通过】,更新用户信息失败"); + } + } + return true; + } + + /** + * 官方审核通过 + * 1.更新订单状态为订单结束 + * 2.退押金 + * 3.创建退款记录 + * 4.更新用户余额 + */ + @Override + public boolean authoritypass(EtOrder etOrder) { + /** 1.更新订单状态为订单结束*/ + etOrder.setStatus(ServiceConstants.ORDER_STATUS_ORDER_END); + int updateEtOrder = etOrderMapper.updateEtOrder(etOrder); + if(updateEtOrder == 0){ + throw new ServiceException("还车审核失败,更新订单失败"); + } + /** 2.退剩余押金 = 押金 - 扣除金额*/ + EtOrder depositOrder = getDepositOrder(etOrder.getUserId()); + BigDecimal residualDeposit = depositOrder.getTotalFee().subtract(new BigDecimal(etOrder.getDeductionAmount())); + Refund refund = wxPayService.refund(depositOrder, "还车审核通过后退押金",residualDeposit,IdUtils.getOrderNo("ref")); + /** 3.记录退款表 创建退款对象*/ + depositOrder.setReason("还车审核通过后退押金"); + EtRefund refund1= createRefund(depositOrder, residualDeposit, null, null, null, null, refund.getOutRefundNo(),ServiceConstants.REFUND_TYPE_DEPOSIT); + int i = etRefundService.insertEtRefund(refund1); + if(i == 0){ + log.info("【还车审核通过】保存退款对象失败"); + throw new ServiceException("【还车审核通过】,保存退款对象失败"); + } + /** 4.更新用户余额*/ + AsUser asUser = asUserService.selectUserById(depositOrder.getUserId()); + if(asUser!=null){ + // 更新用户并更新缓存 + asUser.setBalance(BigDecimal.ZERO); + if (asUserService.updateUserProfile(asUser) > 0) + { + log.info("【还车审核通过】更新用户信息成功:"+ JSON.toJSON(asUser)); + }else{ + throw new ServiceException("【还车审核通过】,更新用户信息失败"); + } + } + return false; + } + + private EtOrder getDepositOrder(Long userId) { EtOrder depositOrder = new EtOrder(); depositOrder.setUserId(userId); @@ -1060,7 +1145,7 @@ public class EtOrderServiceImpl implements IEtOrderService } // 新增资金流水记录 etOrder1.setPayFee(refundAmount); - callbackService.capitalFlowRecords(etOrder1,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants. ORDER_TYPE_RIDING_REFUND); + callbackService.capitalFlowRecords(etOrder1,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants.ORDER_TYPE_RIDING_REFUND,ServiceConstants.OWNER_TYPE_OPERATOR,null); //todo 更新订单的payFee = totalFee - refundAmount String outRefundNo = IdUtils.getOrderNo("ref"); /** 2.记录退款表 创建退款对象*/ diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtWithdrawServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtWithdrawServiceImpl.java index 698c147..ce5e897 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtWithdrawServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/EtWithdrawServiceImpl.java @@ -150,7 +150,7 @@ public class EtWithdrawServiceImpl implements IEtWithdrawService } order.setAreaId(longs.get(0)); //记录资金流水 - callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants.ORDER_TYPE_WITHDRAW); + callbackService.capitalFlowRecords(order,ServiceConstants.FLOW_TYPE_DISBURSE,ServiceConstants.ORDER_TYPE_WITHDRAW,ServiceConstants.OWNER_TYPE_OPERATOR,null); } } return etWithdrawMapper.updateEtWithdraw(etWithdraw); diff --git a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 5c30dde..61d524b 100644 --- a/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/electripper-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -699,8 +699,6 @@ public class SysUserServiceImpl implements ISysUserService */ @Override public int bandAppUser(SysUser user) { - LoginUser loginUser = SecurityUtils.getLoginUser(); - user.setUserId(loginUser.getUserId()); return userMapper.updateUser(user); } } diff --git a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml index 37271a8..f4c4867 100644 --- a/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/AsDeviceMapper.xml @@ -285,6 +285,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mac = #{mac}, model_id = #{modelId}, vehicle_num = #{vehicleNum}, + version = #{version}, area_id = #{areaId}, activation_time = #{activationTime}, online_status = #{onlineStatus}, diff --git a/electripper-system/src/main/resources/mapper/system/EtCapitalFlowMapper.xml b/electripper-system/src/main/resources/mapper/system/EtCapitalFlowMapper.xml index 78d0818..8c8baa5 100644 --- a/electripper-system/src/main/resources/mapper/system/EtCapitalFlowMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtCapitalFlowMapper.xml @@ -7,6 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -30,6 +33,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT cf.flow_id, cf.area_id, + cf.owner, + cf.owner_id, + cf.owner_type, cf.order_no, cf.out_trade_no, cf.type, @@ -86,6 +92,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" flow_id, area_id, + owner, + owner_id, + owner_type, order_no, out_trade_no, type, @@ -102,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{flowId}, #{areaId}, + #{owner}, + #{ownerId}, + #{ownerType}, #{orderNo}, #{outTradeNo}, #{type}, @@ -121,6 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update et_capital_flow area_id = #{areaId}, + owner = #{owner}, + owner_id = #{ownerId}, + owner_type = #{ownerType}, order_no = #{orderNo}, out_trade_no = #{outTradeNo}, type = #{type}, diff --git a/electripper-system/src/main/resources/mapper/system/EtFeeRuleMapper.xml b/electripper-system/src/main/resources/mapper/system/EtFeeRuleMapper.xml index 84cfb99..ca7748e 100644 --- a/electripper-system/src/main/resources/mapper/system/EtFeeRuleMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtFeeRuleMapper.xml @@ -50,8 +50,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -72,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" a.no_riding_outage, a.authentication, a.msg_switch, a.undercharge, a.error, a.agreement, a.deposit, a.outage, a.appointment_service_fee, a.dispatch_fee, a.vehicle_management_fee, a.timeout_minutes, a.auto_replacement_order, a.area_time_start, a.area_time_end, a.area_out_return, a.parking_return, - a.service_name1, a.service_name2, a.service_name3, a.service_phone1, a.service_phone2, a.service_phone3, a.custom_service, a.is_deposit_deduction from et_operating_area a + a.service_name1, a.service_name2, a.service_name3, a.service_phone1, a.service_phone2, a.service_phone3, a.custom_service, a.is_deposit_deduction,a.return_verify from et_operating_area a left join et_area_dept ad on ad.area_id = a.area_id left join sys_dept d on d.dept_id = ad.dept_id where 1 = 1 diff --git a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml index c873128..bbe2d50 100644 --- a/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml +++ b/electripper-system/src/main/resources/mapper/system/EtOrderMapper.xml @@ -40,13 +40,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + select order_id, area_id, order_no, out_trade_no, user_id, rule_id, device_mac, sn, pay_time, paid, pay_type, type, total_fee, pay_fee, dispatch_fee, manage_fee, riding_fee, appointment_fee, mark, duration, distance, status, - create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time, rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str,cycle,deposit_deduction from et_order + create_time, appointment_start_time, appointment_end_time,appointment_timeout, unlock_time,return_time, + rule_end_time, return_type, AsText(trip_route) trip_route,trip_route_str,cycle,deposit_deduction,video_url,deduction_amount,audio_files from et_order