1. 车型关联收费方式
This commit is contained in:
parent
13ea20b61a
commit
8bc7c4c95d
|
@ -251,7 +251,7 @@ public class AppController extends BaseController
|
||||||
@GetMapping("/fee/list")
|
@GetMapping("/fee/list")
|
||||||
public AjaxResult feeList(EtFeeRule etFeeRule)
|
public AjaxResult feeList(EtFeeRule etFeeRule)
|
||||||
{
|
{
|
||||||
List<EtFeeRule> list = etFeeRuleService.selectEtFeeRuleListByAreaId(etFeeRule.getAreaId());
|
List<EtFeeRule> list = etFeeRuleService.selectRuleInfoListByModelId(etFeeRule.getModelId());
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.ruoyi.system.service.IAsDeviceService;
|
import com.ruoyi.system.service.IAsDeviceService;
|
||||||
|
import com.ruoyi.system.service.IEtFeeRuleService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -39,6 +40,9 @@ public class EtModelController extends BaseController
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAsDeviceService asDeviceService;
|
private IAsDeviceService asDeviceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IEtFeeRuleService etFeeRuleService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询车辆型号列表
|
* 查询车辆型号列表
|
||||||
|
@ -72,7 +76,11 @@ public class EtModelController extends BaseController
|
||||||
@GetMapping(value = "/{modelId}")
|
@GetMapping(value = "/{modelId}")
|
||||||
public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
|
public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
|
||||||
{
|
{
|
||||||
return success(etModelService.selectEtModelByModelId(modelId));
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
EtModel model = etModelService.selectEtModelByModelId(modelId);
|
||||||
|
ajax.put(AjaxResult.DATA_TAG, model);
|
||||||
|
ajax.put("ruleIds", etFeeRuleService.selectRuleListByModelId(modelId));
|
||||||
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.enums.BusinessType;
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.system.domain.EtFeeRule;
|
||||||
import com.ruoyi.system.domain.EtModel;
|
import com.ruoyi.system.domain.EtModel;
|
||||||
import com.ruoyi.system.domain.EtOperatingArea;
|
import com.ruoyi.system.domain.EtOperatingArea;
|
||||||
import com.ruoyi.system.mapper.EtModelMapper;
|
import com.ruoyi.system.mapper.EtModelMapper;
|
||||||
|
@ -172,6 +173,9 @@ public class EtOperatingAreaController extends BaseController
|
||||||
EtModel model = new EtModel();
|
EtModel model = new EtModel();
|
||||||
model.setOperator(deptId);
|
model.setOperator(deptId);
|
||||||
ajax.put("modelList", etModelMapper.selectEtModelList(model));
|
ajax.put("modelList", etModelMapper.selectEtModelList(model));
|
||||||
|
EtFeeRule rule = new EtFeeRule();
|
||||||
|
rule.setDeptId(deptId);
|
||||||
|
ajax.put("ruleList", etFeeRuleService.selectEtFeeRuleList(rule));
|
||||||
return success(ajax);
|
return success(ajax);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,10 @@ public class EtFeeRule extends BaseEntity
|
||||||
@Excel(name = "运营商id")
|
@Excel(name = "运营商id")
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
@Excel(name = "车型id")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Long modelId;
|
||||||
|
|
||||||
/** 说明 */
|
/** 说明 */
|
||||||
@Excel(name = "说明")
|
@Excel(name = "说明")
|
||||||
private String explain;
|
private String explain;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -32,6 +33,14 @@ public class EtModel extends BaseEntity
|
||||||
@Excel(name = "运营商id")
|
@Excel(name = "运营商id")
|
||||||
private Long operator;
|
private Long operator;
|
||||||
|
|
||||||
|
/** 运营区id */
|
||||||
|
@Excel(name = "运营区id")
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
|
/** 运营区名称 */
|
||||||
|
@Excel(name = "运营区名称")
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
/** 运营商 */
|
/** 运营商 */
|
||||||
@Excel(name = "运营商")
|
@Excel(name = "运营商")
|
||||||
private String operatorName;
|
private String operatorName;
|
||||||
|
@ -58,4 +67,8 @@ public class EtModel extends BaseEntity
|
||||||
@Excel(name = "运营区列表")
|
@Excel(name = "运营区列表")
|
||||||
private List<EtOperatingArea> areaList;
|
private List<EtOperatingArea> areaList;
|
||||||
|
|
||||||
|
/** 收费方式 */
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Long[] ruleIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车型与收费方式关联对象 et_model_rule
|
||||||
|
*
|
||||||
|
* @author 邱贞招
|
||||||
|
* @date 2024-05-19
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "et_model_rule")
|
||||||
|
public class EtModelRule implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 区域id */
|
||||||
|
private Long modelId;
|
||||||
|
|
||||||
|
/** 收费规则id */
|
||||||
|
private Long ruleId;
|
||||||
|
|
||||||
|
}
|
|
@ -329,5 +329,23 @@ public class EtOrder extends BaseEntity
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private BigDecimal cost;
|
private BigDecimal cost;
|
||||||
|
|
||||||
|
/** 可退预约费 */
|
||||||
|
@Excel(name = "可退预约费")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal refundableAppointmentFee;
|
||||||
|
|
||||||
|
/** 可退运营区外调度费退款 */
|
||||||
|
@Excel(name = "可退运营区外调度费退款")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal refundableRideFee;
|
||||||
|
|
||||||
|
/** 可退预约费 */
|
||||||
|
@Excel(name = "可退预约费")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal refundableDispatchFee;
|
||||||
|
|
||||||
|
/** 可退停车点外调度费退款 */
|
||||||
|
@Excel(name = "可退停车点外调度费退款")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal refundableManageFee;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,14 @@ public interface EtFeeRuleMapper
|
||||||
*/
|
*/
|
||||||
public List<Long> selectRuleListByAreaId(Long areaId);
|
public List<Long> selectRuleListByAreaId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据modelId获取收费方式选择框列表
|
||||||
|
*
|
||||||
|
* @param modelId 车型id
|
||||||
|
* @return 选中收费方式ID列表
|
||||||
|
*/
|
||||||
|
public List<Long> selectRuleListByModelId(Long modelId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据区域ID获取收费方式列表
|
* 根据区域ID获取收费方式列表
|
||||||
*
|
*
|
||||||
|
@ -84,6 +92,14 @@ public interface EtFeeRuleMapper
|
||||||
*/
|
*/
|
||||||
public List<EtFeeRule> selectRuleInfoListByAreaId(Long areaId);
|
public List<EtFeeRule> selectRuleInfoListByAreaId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据区域ID获取收费方式列表
|
||||||
|
*
|
||||||
|
* @param modelId 车型id
|
||||||
|
* @return 选中收费方式ID列表
|
||||||
|
*/
|
||||||
|
public List<EtFeeRule> selectRuleInfoListByModelId(Long modelId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据区域ID获取收费方式名称选择框列表
|
* 根据区域ID获取收费方式名称选择框列表
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.ruoyi.system.domain.EtModelRule;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域与收费方式关联 数据层
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public interface EtModelRuleMapper extends BaseMapper<EtModelRule>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 通过用运营区ID删除区域与收费方式关联
|
||||||
|
*
|
||||||
|
* @param areaId 运营区id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteModelRuleByModelId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过用ruleId删除区域与收费方式关联
|
||||||
|
*
|
||||||
|
* @param ruleId 运营区id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteModelRuleByRuleId(Long ruleId);
|
||||||
|
|
||||||
|
}
|
|
@ -44,6 +44,14 @@ public interface IEtFeeRuleService
|
||||||
*/
|
*/
|
||||||
public List<EtFeeRule> selectEtFeeRuleListByAreaId(Long areaId);
|
public List<EtFeeRule> selectEtFeeRuleListByAreaId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据运营区获取收费方式列表
|
||||||
|
*
|
||||||
|
* @param modelId 车型id
|
||||||
|
* @return 收费方式集合
|
||||||
|
*/
|
||||||
|
public List<EtFeeRule> selectRuleInfoListByModelId(Long modelId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增收费方式
|
* 新增收费方式
|
||||||
|
@ -93,4 +101,12 @@ public interface IEtFeeRuleService
|
||||||
* @return 选中收费方式名称列表
|
* @return 选中收费方式名称列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectRuleNameListByAreaId(Long areaId);
|
public List<String> selectRuleNameListByAreaId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据modelId获取收费方式选择框列表
|
||||||
|
*
|
||||||
|
* @param modelId 车型id
|
||||||
|
* @return 选中收费方式ID列表
|
||||||
|
*/
|
||||||
|
public List<Long> selectRuleListByModelId(Long modelId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.ruoyi.system.service.impl;
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.ruoyi.common.annotation.DataScope;
|
import com.ruoyi.common.annotation.DataScope;
|
||||||
|
@ -10,20 +8,20 @@ import com.ruoyi.common.core.domain.entity.SysDept;
|
||||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.system.domain.EtAreaRule;
|
import com.ruoyi.system.domain.EtFeeRule;
|
||||||
|
import com.ruoyi.system.domain.EtModelRule;
|
||||||
import com.ruoyi.system.domain.EtOperatingArea;
|
import com.ruoyi.system.domain.EtOperatingArea;
|
||||||
import com.ruoyi.system.domain.vo.IntervalRuleVo;
|
|
||||||
import com.ruoyi.system.domain.vo.StartingRuleVo;
|
import com.ruoyi.system.domain.vo.StartingRuleVo;
|
||||||
import com.ruoyi.system.mapper.EtAreaRuleMapper;
|
import com.ruoyi.system.mapper.EtFeeRuleMapper;
|
||||||
|
import com.ruoyi.system.mapper.EtModelRuleMapper;
|
||||||
|
import com.ruoyi.system.service.IEtFeeRuleService;
|
||||||
import com.ruoyi.system.service.IEtOperatingAreaService;
|
import com.ruoyi.system.service.IEtOperatingAreaService;
|
||||||
import com.ruoyi.system.service.IWxPayService;
|
import com.ruoyi.system.service.IWxPayService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.system.mapper.EtFeeRuleMapper;
|
|
||||||
import com.ruoyi.system.domain.EtFeeRule;
|
|
||||||
import com.ruoyi.system.service.IEtFeeRuleService;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收费方式Service业务层处理
|
* 收费方式Service业务层处理
|
||||||
|
@ -43,8 +41,11 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
||||||
@Autowired
|
@Autowired
|
||||||
private IWxPayService wxPayService;
|
private IWxPayService wxPayService;
|
||||||
|
|
||||||
|
// @Resource
|
||||||
|
// private EtAreaRuleMapper etAreaRuleMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private EtAreaRuleMapper etAreaRuleMapper;
|
private EtModelRuleMapper etModelRuleMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询收费方式
|
* 查询收费方式
|
||||||
|
@ -122,6 +123,17 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
||||||
return etFeeRuleMapper.selectRuleInfoListByAreaId(areaId);
|
return etFeeRuleMapper.selectRuleInfoListByAreaId(areaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据运营区获取收费方式列表
|
||||||
|
*
|
||||||
|
* @param modelId 车型id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<EtFeeRule> selectRuleInfoListByModelId(Long modelId) {
|
||||||
|
return etFeeRuleMapper.selectRuleInfoListByModelId(modelId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增收费方式
|
* 新增收费方式
|
||||||
*
|
*
|
||||||
|
@ -141,7 +153,7 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
||||||
etFeeRule.setStatus("0");
|
etFeeRule.setStatus("0");
|
||||||
int i = etFeeRuleMapper.insertEtFeeRule(etFeeRule);
|
int i = etFeeRuleMapper.insertEtFeeRule(etFeeRule);
|
||||||
if(ObjectUtil.isNotNull(etFeeRule.getAreaId())){
|
if(ObjectUtil.isNotNull(etFeeRule.getAreaId())){
|
||||||
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etFeeRule.getAreaId()).ruleId(etFeeRule.getRuleId()).build());
|
etModelRuleMapper.insert(EtModelRule.builder().modelId(etFeeRule.getModelId()).ruleId(etFeeRule.getRuleId()).build());
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -155,9 +167,9 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
||||||
@Override
|
@Override
|
||||||
public int updateEtFeeRule(EtFeeRule etFeeRule)
|
public int updateEtFeeRule(EtFeeRule etFeeRule)
|
||||||
{
|
{
|
||||||
int i = etAreaRuleMapper.deleteAreaRuleByRuleId(etFeeRule.getRuleId());
|
int i = etModelRuleMapper.deleteModelRuleByModelId(etFeeRule.getRuleId());
|
||||||
if(ObjectUtil.isNotNull(etFeeRule.getAreaId())){
|
if(ObjectUtil.isNotNull(etFeeRule.getAreaId())){
|
||||||
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etFeeRule.getAreaId()).ruleId(etFeeRule.getRuleId()).build());
|
etModelRuleMapper.insert(EtModelRule.builder().modelId(etFeeRule.getModelId()).ruleId(etFeeRule.getRuleId()).build());
|
||||||
}
|
}
|
||||||
return etFeeRuleMapper.updateEtFeeRule(etFeeRule);
|
return etFeeRuleMapper.updateEtFeeRule(etFeeRule);
|
||||||
}
|
}
|
||||||
|
@ -197,6 +209,17 @@ public class EtFeeRuleServiceImpl implements IEtFeeRuleService
|
||||||
return etFeeRuleMapper.selectRuleListByAreaId(areaId);
|
return etFeeRuleMapper.selectRuleListByAreaId(areaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据modelId获取收费方式选择框列表
|
||||||
|
*
|
||||||
|
* @param modelId 车型id
|
||||||
|
* @return 选中收费方式ID列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Long> selectRuleListByModelId(Long modelId) {
|
||||||
|
return etFeeRuleMapper.selectRuleListByModelId(modelId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据区域ID获取收费方式名称选择框列表
|
* 根据区域ID获取收费方式名称选择框列表
|
||||||
*
|
*
|
||||||
|
|
|
@ -12,9 +12,11 @@ import com.ruoyi.common.utils.onenet.ResponseVo;
|
||||||
import com.ruoyi.common.utils.onenet.Token;
|
import com.ruoyi.common.utils.onenet.Token;
|
||||||
import com.ruoyi.system.domain.AsDevice;
|
import com.ruoyi.system.domain.AsDevice;
|
||||||
import com.ruoyi.system.domain.EtModel;
|
import com.ruoyi.system.domain.EtModel;
|
||||||
|
import com.ruoyi.system.domain.EtModelRule;
|
||||||
import com.ruoyi.system.domain.EtOperatingArea;
|
import com.ruoyi.system.domain.EtOperatingArea;
|
||||||
import com.ruoyi.system.mapper.AsDeviceMapper;
|
import com.ruoyi.system.mapper.AsDeviceMapper;
|
||||||
import com.ruoyi.system.mapper.EtModelMapper;
|
import com.ruoyi.system.mapper.EtModelMapper;
|
||||||
|
import com.ruoyi.system.mapper.EtModelRuleMapper;
|
||||||
import com.ruoyi.system.mapper.SysDeptMapper;
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
||||||
import com.ruoyi.system.service.IAsDeviceService;
|
import com.ruoyi.system.service.IAsDeviceService;
|
||||||
import com.ruoyi.system.service.IEtModelService;
|
import com.ruoyi.system.service.IEtModelService;
|
||||||
|
@ -44,15 +46,15 @@ public class EtModelServiceImpl implements IEtModelService
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAsDeviceService asDeviceService;
|
private IAsDeviceService asDeviceService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private AsDeviceMapper asDeviceMapper;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IEtOperatingAreaService etOperatingAreaService;
|
private IEtOperatingAreaService etOperatingAreaService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SysDeptMapper deptMapper;
|
private SysDeptMapper deptMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EtModelRuleMapper etModelRuleMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询车辆型号
|
* 查询车辆型号
|
||||||
|
@ -120,6 +122,13 @@ public class EtModelServiceImpl implements IEtModelService
|
||||||
}
|
}
|
||||||
etModel.setCreateTime(DateUtils.getNowDate());
|
etModel.setCreateTime(DateUtils.getNowDate());
|
||||||
int i = etModelMapper.insertEtModel(etModel);
|
int i = etModelMapper.insertEtModel(etModel);
|
||||||
|
Long[] ruleIds = etModel.getRuleIds();
|
||||||
|
if(ObjectUtil.isNotNull(ruleIds) && ruleIds.length > 0){
|
||||||
|
for (Long ruleId:ruleIds){
|
||||||
|
etModelRuleMapper.insert(EtModelRule.builder().modelId(etModel.getModelId()).ruleId(ruleId).build());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// // 发送设置低电压命令
|
// // 发送设置低电压命令
|
||||||
// Integer lowBatteryReminder = etModel.getLowBatteryReminder();
|
// Integer lowBatteryReminder = etModel.getLowBatteryReminder();
|
||||||
// if(ObjectUtil.isNotNull(lowBatteryReminder) && lowBatteryReminder > 0){
|
// if(ObjectUtil.isNotNull(lowBatteryReminder) && lowBatteryReminder > 0){
|
||||||
|
@ -156,6 +165,15 @@ public class EtModelServiceImpl implements IEtModelService
|
||||||
}
|
}
|
||||||
etModel.setUpdateTime(DateUtils.getNowDate());
|
etModel.setUpdateTime(DateUtils.getNowDate());
|
||||||
int i = etModelMapper.updateEtModel(etModel);
|
int i = etModelMapper.updateEtModel(etModel);
|
||||||
|
Long[] ruleIds = etModel.getRuleIds();
|
||||||
|
if(ObjectUtil.isNotNull(ruleIds)){
|
||||||
|
etModelRuleMapper.deleteModelRuleByModelId(etModel.getModelId());
|
||||||
|
if(ObjectUtil.isNotNull(ruleIds)){
|
||||||
|
for (Long ruleId:ruleIds){
|
||||||
|
etModelRuleMapper.insert(EtModelRule.builder().modelId(etModel.getModelId()).ruleId(ruleId).build());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// 发送设置低电压命令
|
// 发送设置低电压命令
|
||||||
// Integer lowBatteryReminder = etModel.getLowBatteryReminder();
|
// Integer lowBatteryReminder = etModel.getLowBatteryReminder();
|
||||||
// if(ObjectUtil.isNotNull(lowBatteryReminder) && lowBatteryReminder > 0){
|
// if(ObjectUtil.isNotNull(lowBatteryReminder) && lowBatteryReminder > 0){
|
||||||
|
|
|
@ -56,8 +56,8 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl<EtOperatingAreaMappe
|
||||||
@Autowired
|
@Autowired
|
||||||
private IEtFeeRuleService etFeeRuleService;
|
private IEtFeeRuleService etFeeRuleService;
|
||||||
|
|
||||||
@Resource
|
// @Resource
|
||||||
private EtAreaRuleMapper etAreaRuleMapper;
|
// private EtAreaRuleMapper etAreaRuleMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IEtOperatingAreaService etOperatingAreaService;
|
private IEtOperatingAreaService etOperatingAreaService;
|
||||||
|
@ -157,12 +157,12 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl<EtOperatingAreaMappe
|
||||||
String wkt = GeoUtils.wkt(geometry);
|
String wkt = GeoUtils.wkt(geometry);
|
||||||
etOperatingArea.setBoundary(wkt);
|
etOperatingArea.setBoundary(wkt);
|
||||||
int insert = dao.insert(etOperatingArea);
|
int insert = dao.insert(etOperatingArea);
|
||||||
Long[] ruleIds = etOperatingArea.getRuleIds();
|
// Long[] ruleIds = etOperatingArea.getRuleIds();
|
||||||
if(ObjectUtil.isNotNull(ruleIds) && ruleIds.length > 0){
|
// if(ObjectUtil.isNotNull(ruleIds) && ruleIds.length > 0){
|
||||||
for (Long ruleId:ruleIds){
|
// for (Long ruleId:ruleIds){
|
||||||
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etOperatingArea.getAreaId()).ruleId(ruleId).build());
|
// etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etOperatingArea.getAreaId()).ruleId(ruleId).build());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
Long deptId = SecurityUtils.getDeptId();
|
Long deptId = SecurityUtils.getDeptId();
|
||||||
if(deptId == 100){
|
if(deptId == 100){
|
||||||
deptId = etOperatingArea.getDeptId();
|
deptId = etOperatingArea.getDeptId();
|
||||||
|
@ -193,15 +193,15 @@ public class EtOperatingAreaServiceImpl extends ServiceImpl<EtOperatingAreaMappe
|
||||||
String wkt = GeoUtils.wkt(geometry);
|
String wkt = GeoUtils.wkt(geometry);
|
||||||
etOperatingArea.setBoundary(wkt);
|
etOperatingArea.setBoundary(wkt);
|
||||||
int i = dao.updateById(etOperatingArea);
|
int i = dao.updateById(etOperatingArea);
|
||||||
Long[] ruleIds = etOperatingArea.getRuleIds();
|
// Long[] ruleIds = etOperatingArea.getRuleIds();
|
||||||
if(ObjectUtil.isNotNull(ruleIds)){
|
// if(ObjectUtil.isNotNull(ruleIds)){
|
||||||
etAreaRuleMapper.deleteAreaRuleByAreaId(etOperatingArea.getAreaId());
|
// etAreaRuleMapper.deleteAreaRuleByAreaId(etOperatingArea.getAreaId());
|
||||||
if(ObjectUtil.isNotNull(ruleIds)){
|
// if(ObjectUtil.isNotNull(ruleIds)){
|
||||||
for (Long ruleId:ruleIds){
|
// for (Long ruleId:ruleIds){
|
||||||
etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etOperatingArea.getAreaId()).ruleId(ruleId).build());
|
// etAreaRuleMapper.insert(EtAreaRule.builder().areaId(etOperatingArea.getAreaId()).ruleId(ruleId).build());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
Long deptId = SecurityUtils.getDeptId();
|
Long deptId = SecurityUtils.getDeptId();
|
||||||
if(deptId == 100){
|
if(deptId == 100){
|
||||||
deptId = etOperatingArea.getDeptId();
|
deptId = etOperatingArea.getDeptId();
|
||||||
|
|
|
@ -224,16 +224,35 @@ public class EtOrderServiceImpl implements IEtOrderService
|
||||||
order.setRule(etFeeRule);
|
order.setRule(etFeeRule);
|
||||||
}
|
}
|
||||||
//退款记录
|
//退款记录
|
||||||
EtRefund etRefund = new EtRefund();
|
// 初始化可退金额为订单的原始费用
|
||||||
etRefund.setOrderNo(order.getOrderNo());
|
BigDecimal remainingDispatchFee = order.getDispatchFee();
|
||||||
List<EtRefund> refundList = etRefundService.selectEtRefundList(etRefund);
|
BigDecimal remainingManageFee = order.getManageFee();
|
||||||
|
BigDecimal remainingRidingFee = order.getRidingFee();
|
||||||
|
BigDecimal remainingAppointmentFee = order.getAppointmentFee();
|
||||||
|
BigDecimal totalRefundedAmount = BigDecimal.ZERO; // 总退款金额
|
||||||
|
|
||||||
|
List<EtRefund> refundList = etRefundService.selectEtRefundByOrderNo(order.getOrderNo());
|
||||||
|
if(ObjectUtils.isNotEmpty(refundList) && refundList.size() > 0){
|
||||||
|
order.setEtRefunds(refundList);
|
||||||
|
}
|
||||||
if(ObjectUtils.isNotEmpty(refundList)){
|
if(ObjectUtils.isNotEmpty(refundList)){
|
||||||
EtRefund etRefund1 = refundList.get(0);
|
for (EtRefund refund : refundList) {
|
||||||
order.setEtRefund(etRefund1);
|
totalRefundedAmount = totalRefundedAmount.add(refund.getAmount() != null ? refund.getAmount() : BigDecimal.ZERO);
|
||||||
order.setSettlementFee(order.getTotalFee().subtract(etRefund1.getAmount()));
|
// 减去已退款的金额
|
||||||
|
remainingDispatchFee = remainingDispatchFee.subtract(refund.getDispatchFee() != null ? refund.getDispatchFee() : BigDecimal.ZERO);
|
||||||
|
remainingManageFee = remainingManageFee.subtract(refund.getManageFee() != null ? refund.getManageFee() : BigDecimal.ZERO);
|
||||||
|
remainingRidingFee = remainingRidingFee.subtract(refund.getRidingFee() != null ? refund.getRidingFee() : BigDecimal.ZERO);
|
||||||
|
remainingAppointmentFee = remainingAppointmentFee.subtract(refund.getAppointmentFee() != null ? refund.getAppointmentFee() : BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
order.setSettlementFee(order.getTotalFee().subtract(totalRefundedAmount));
|
||||||
}else{
|
}else{
|
||||||
order.setSettlementFee(order.getTotalFee());
|
order.setSettlementFee(order.getTotalFee());
|
||||||
}
|
}
|
||||||
|
order.setRefundableDispatchFee(remainingDispatchFee.max(BigDecimal.ZERO));
|
||||||
|
order.setRefundableManageFee(remainingManageFee.max(BigDecimal.ZERO));
|
||||||
|
order.setRefundableRideFee(remainingRidingFee.max(BigDecimal.ZERO));
|
||||||
|
order.setRefundableAppointmentFee(remainingAppointmentFee.max(BigDecimal.ZERO));
|
||||||
|
|
||||||
//行程记录
|
//行程记录
|
||||||
EtTripLog tripLog = new EtTripLog();
|
EtTripLog tripLog = new EtTripLog();
|
||||||
tripLog.setOrderNo(order.getOrderNo());
|
tripLog.setOrderNo(order.getOrderNo());
|
||||||
|
|
|
@ -74,6 +74,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where r.is_deleted = 0 and a.area_id = #{areaId}
|
where r.is_deleted = 0 and a.area_id = #{areaId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRuleListByModelId" parameterType="Long" resultType="Long">
|
||||||
|
select r.rule_id
|
||||||
|
from et_fee_rule r
|
||||||
|
left join et_model_rule mr on mr.rule_id = r.rule_id
|
||||||
|
left join et_model m on m.model_id = mr.model_id
|
||||||
|
where r.is_deleted = 0 and m.model_id = #{modelId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectRuleInfoListByAreaId" parameterType="Long" resultMap="EtFeeRuleResult">
|
<select id="selectRuleInfoListByAreaId" parameterType="Long" resultMap="EtFeeRuleResult">
|
||||||
select r.rule_id, r.`dept_id`, r.`name`, r.`explain`,
|
select r.rule_id, r.`dept_id`, r.`name`, r.`explain`,
|
||||||
r.status, r.auto_refund_deposit, r.order_exceed_minutes, r.order_exceed_warn,
|
r.status, r.auto_refund_deposit, r.order_exceed_minutes, r.order_exceed_warn,
|
||||||
|
@ -93,6 +101,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where r.is_deleted = 0 and a.area_id = #{areaId}
|
where r.is_deleted = 0 and a.area_id = #{areaId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRuleInfoListByModelId" resultType="com.ruoyi.system.domain.EtFeeRule">
|
||||||
|
select r.rule_id, r.`dept_id`, r.`name`, r.`explain`,
|
||||||
|
r.status, r.auto_refund_deposit, r.order_exceed_minutes, r.order_exceed_warn,
|
||||||
|
r.free_ride_time, r.rental_unit, r.riding_rule, r.riding_rule_json, r.charging_cycle, r.charging_cycle_value,
|
||||||
|
r.capped_amount, r.instructions, r.create_by, r.create_time
|
||||||
|
from et_fee_rule r
|
||||||
|
left join et_model_rule mr on mr.rule_id = r.rule_id
|
||||||
|
left join et_model m on m.model_id = mr.model_id
|
||||||
|
where r.is_deleted = 0 and m.model_id = #{modelId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertEtFeeRule" parameterType="EtFeeRule" useGeneratedKeys="true" keyProperty="ruleId">
|
<insert id="insertEtFeeRule" parameterType="EtFeeRule" useGeneratedKeys="true" keyProperty="ruleId">
|
||||||
insert into et_fee_rule
|
insert into et_fee_rule
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="model" column="model" />
|
<result property="model" column="model" />
|
||||||
<result property="brand" column="brand" />
|
<result property="brand" column="brand" />
|
||||||
<result property="operator" column="operator" />
|
<result property="operator" column="operator" />
|
||||||
|
<result property="areaId" column="area_id" />
|
||||||
<result property="fullVoltage" column="full_voltage" />
|
<result property="fullVoltage" column="full_voltage" />
|
||||||
<result property="lowVoltage" column="low_voltage" />
|
<result property="lowVoltage" column="low_voltage" />
|
||||||
<result property="fullEndurance" column="full_endurance" />
|
<result property="fullEndurance" column="full_endurance" />
|
||||||
|
@ -21,24 +22,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEtModelVo">
|
<sql id="selectEtModelVo">
|
||||||
select model_id, model, brand, operator, full_voltage, low_voltage, full_endurance, low_battery_reminder, create_by, create_time, update_by, update_time, remark from et_model
|
select model_id, model, brand, operator, area_id, full_voltage, low_voltage, full_endurance, low_battery_reminder, create_by, create_time, update_by, update_time, remark from et_model
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEtModelList" parameterType="EtModel" resultMap="EtModelResult">
|
<select id="selectEtModelList" parameterType="EtModel" resultMap="EtModelResult">
|
||||||
select m.model_id, m.model, m.brand, m.operator, m.full_voltage, m.low_voltage,
|
select m.model_id, m.model, m.brand, m.operator, m.full_voltage, m.low_voltage,m.area_id,a.area_name areaName,
|
||||||
m.full_endurance, m.low_battery_reminder, m.create_by, m.create_time,
|
m.full_endurance, m.low_battery_reminder, m.create_by, m.create_time,
|
||||||
m.update_by, m.update_time, m.remark from et_model m
|
m.update_by, m.update_time, m.remark from et_model m
|
||||||
left join sys_dept d on d.dept_id = m.operator
|
left join sys_dept d on d.dept_id = m.operator
|
||||||
|
left join et_operating_area a on a.area_id = m.area_id
|
||||||
where m.del_flag != 2
|
where m.del_flag != 2
|
||||||
<if test="model != null and model != ''"> and m.model = #{model}</if>
|
<if test="model != null and model != ''"> and m.model = #{model}</if>
|
||||||
<if test="brand != null and brand != ''"> and m.brand = #{brand}</if>
|
<if test="brand != null and brand != ''"> and m.brand = #{brand}</if>
|
||||||
<if test="operator != null and operator != ''"> and m.operator = #{operator}</if>
|
<if test="operator != null and operator != ''"> and m.operator = #{operator}</if>
|
||||||
|
<if test="areaId != null and areaId != ''"> and m.area_id = #{areaId}</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectEtModelByModelId" parameterType="Long" resultMap="EtModelResult">
|
<select id="selectEtModelByModelId" parameterType="Long" resultMap="EtModelResult">
|
||||||
select m.model_id, m.model, m.brand, m.operator, d.dept_name, m.full_voltage, m.low_voltage,
|
select m.model_id, m.model, m.brand, m.operator, d.dept_name, m.full_voltage, m.low_voltage,m.area_id,
|
||||||
m.full_endurance, m.low_battery_reminder, m.create_by, m.create_time,
|
m.full_endurance, m.low_battery_reminder, m.create_by, m.create_time,
|
||||||
m.update_by, m.update_time, m.remark from et_model m
|
m.update_by, m.update_time, m.remark from et_model m
|
||||||
left join sys_dept d on d.dept_id = m.operator
|
left join sys_dept d on d.dept_id = m.operator
|
||||||
|
@ -56,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="model != null">model,</if>
|
<if test="model != null">model,</if>
|
||||||
<if test="brand != null">brand,</if>
|
<if test="brand != null">brand,</if>
|
||||||
<if test="operator != null">operator,</if>
|
<if test="operator != null">operator,</if>
|
||||||
|
<if test="areaId != null">area_id,</if>
|
||||||
<if test="fullVoltage != null">full_voltage,</if>
|
<if test="fullVoltage != null">full_voltage,</if>
|
||||||
<if test="lowVoltage != null">low_voltage,</if>
|
<if test="lowVoltage != null">low_voltage,</if>
|
||||||
<if test="fullEndurance != null">full_endurance,</if>
|
<if test="fullEndurance != null">full_endurance,</if>
|
||||||
|
@ -71,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="model != null">#{model},</if>
|
<if test="model != null">#{model},</if>
|
||||||
<if test="brand != null">#{brand},</if>
|
<if test="brand != null">#{brand},</if>
|
||||||
<if test="operator != null">#{operator},</if>
|
<if test="operator != null">#{operator},</if>
|
||||||
|
<if test="areaId != null">#{areaId},</if>
|
||||||
<if test="fullVoltage != null">#{fullVoltage},</if>
|
<if test="fullVoltage != null">#{fullVoltage},</if>
|
||||||
<if test="lowVoltage != null">#{lowVoltage},</if>
|
<if test="lowVoltage != null">#{lowVoltage},</if>
|
||||||
<if test="fullEndurance != null">#{fullEndurance},</if>
|
<if test="fullEndurance != null">#{fullEndurance},</if>
|
||||||
|
@ -89,6 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="model != null">model = #{model},</if>
|
<if test="model != null">model = #{model},</if>
|
||||||
<if test="brand != null">brand = #{brand},</if>
|
<if test="brand != null">brand = #{brand},</if>
|
||||||
<if test="operator != null">operator = #{operator},</if>
|
<if test="operator != null">operator = #{operator},</if>
|
||||||
|
<if test="areaId != null">area_id = #{areaId},</if>
|
||||||
<if test="fullVoltage != null">full_voltage = #{fullVoltage},</if>
|
<if test="fullVoltage != null">full_voltage = #{fullVoltage},</if>
|
||||||
<if test="lowVoltage != null">low_voltage = #{lowVoltage},</if>
|
<if test="lowVoltage != null">low_voltage = #{lowVoltage},</if>
|
||||||
<if test="fullEndurance != null">full_endurance = #{fullEndurance},</if>
|
<if test="fullEndurance != null">full_endurance = #{fullEndurance},</if>
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.system.mapper.EtModelRuleMapper">
|
||||||
|
|
||||||
|
<delete id="deleteModelRuleByModelId">
|
||||||
|
delete from et_model_rule where model_id=#{modelId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteModelRuleByRuleId">
|
||||||
|
delete from et_model_rule where rule_id=#{ruleId}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user