Compare commits
	
		
			3 Commits
		
	
	
		
			1210a63f15
			...
			3df9ab3e88
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3df9ab3e88 | |||
| d914843e67 | |||
| dc40089668 | 
| 
						 | 
				
			
			@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.RlUser;
 | 
			
		|||
import com.ruoyi.common.core.domain.model.LoginUser;
 | 
			
		||||
import com.ruoyi.common.enums.BusinessType;
 | 
			
		||||
import com.ruoyi.common.exception.ServiceException;
 | 
			
		||||
import com.ruoyi.common.utils.DateUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
import com.ruoyi.common.utils.StringUtils;
 | 
			
		||||
import com.ruoyi.common.utils.verify.vo.IDResponse;
 | 
			
		||||
| 
						 | 
				
			
			@ -610,4 +611,39 @@ public class AppVerifyController extends BaseController
 | 
			
		|||
        return success(order);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * sn和mac号绑定
 | 
			
		||||
     */
 | 
			
		||||
    @Log(title = "设备绑定", businessType = BusinessType.BAND)
 | 
			
		||||
    @PostMapping("/band")
 | 
			
		||||
    public AjaxResult bandSn(String sn,String mac,Long hardwareVersionId)
 | 
			
		||||
    {
 | 
			
		||||
        logger.info("sn和mac号绑定:【sn="+sn+"】,【mac="+mac+"】,【hardwareVersionId="+hardwareVersionId+"】");
 | 
			
		||||
        RlDevice asDevice = new RlDevice();
 | 
			
		||||
        asDevice.setSn(sn);
 | 
			
		||||
        asDevice.setMac(mac);
 | 
			
		||||
        asDevice.setHardwareVersionId(hardwareVersionId);
 | 
			
		||||
        asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NOT_BAND);
 | 
			
		||||
        asDevice.setCreateTime(DateUtils.getNowDate());
 | 
			
		||||
        return toAjax(deviceService.bandSn(asDevice));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据mac修改sn
 | 
			
		||||
     */
 | 
			
		||||
    @Log(title = "根据mac修改sn", businessType = BusinessType.UPDATESN)
 | 
			
		||||
    @PostMapping("/updateSn")
 | 
			
		||||
    public AjaxResult updateSn(String sn,String mac,Long hardwareVersionId)
 | 
			
		||||
    {
 | 
			
		||||
        logger.info("根据mac修改sn:【sn="+sn+"】,【mac="+mac+"】,【hardwareVersionId="+hardwareVersionId+"】");
 | 
			
		||||
        RlDevice asDevice = new RlDevice();
 | 
			
		||||
        asDevice.setSn(sn);
 | 
			
		||||
        asDevice.setMac(mac);
 | 
			
		||||
        asDevice.setHardwareVersionId(hardwareVersionId);
 | 
			
		||||
        asDevice.setStatus(ServiceConstants.VEHICLE_STATUS_NOT_BAND);
 | 
			
		||||
        asDevice.setCreateTime(DateUtils.getNowDate());
 | 
			
		||||
        return toAjax(deviceService.updateSn(asDevice));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,97 +0,0 @@
 | 
			
		|||
package com.ruoyi.web.controller.system;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.annotation.Log;
 | 
			
		||||
import com.ruoyi.common.core.controller.BaseController;
 | 
			
		||||
import com.ruoyi.common.core.domain.AjaxResult;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.common.enums.BusinessType;
 | 
			
		||||
import com.ruoyi.common.utils.poi.ExcelUtil;
 | 
			
		||||
import com.ruoyi.system.domain.SysStudent;
 | 
			
		||||
import com.ruoyi.system.service.ISysStudentService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.security.access.prepost.PreAuthorize;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.Arrays;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 学生信息Controller
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/system/student")
 | 
			
		||||
public class SysStudentController extends BaseController
 | 
			
		||||
{
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private ISysStudentService sysStudentService;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询学生信息列表
 | 
			
		||||
     */
 | 
			
		||||
    @PreAuthorize("@ss.hasPermi('system:student:list')")
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    public TableDataInfo list(SysStudent sysStudent)
 | 
			
		||||
    {
 | 
			
		||||
        startPage();
 | 
			
		||||
        List<SysStudent> list = sysStudentService.queryList(sysStudent);
 | 
			
		||||
        return getDataTable(list);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 导出学生信息列表
 | 
			
		||||
     */
 | 
			
		||||
    @PreAuthorize("@ss.hasPermi('system:student:export')")
 | 
			
		||||
    @Log(title = "学生信息", businessType = BusinessType.EXPORT)
 | 
			
		||||
    @GetMapping("/export")
 | 
			
		||||
    public AjaxResult export(SysStudent sysStudent)
 | 
			
		||||
    {
 | 
			
		||||
        List<SysStudent> list = sysStudentService.queryList(sysStudent);
 | 
			
		||||
        ExcelUtil<SysStudent> util = new ExcelUtil<SysStudent>(SysStudent.class);
 | 
			
		||||
        return util.exportExcel(list, "student");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取学生信息详细信息
 | 
			
		||||
     */
 | 
			
		||||
    @PreAuthorize("@ss.hasPermi('system:student:query')")
 | 
			
		||||
    @GetMapping(value = "/{studentId}")
 | 
			
		||||
    public AjaxResult getInfo(@PathVariable("studentId") Long studentId)
 | 
			
		||||
    {
 | 
			
		||||
        return AjaxResult.success(sysStudentService.getById(studentId));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 新增学生信息
 | 
			
		||||
     */
 | 
			
		||||
    @PreAuthorize("@ss.hasPermi('system:student:add')")
 | 
			
		||||
    @Log(title = "学生信息", businessType = BusinessType.INSERT)
 | 
			
		||||
    @PostMapping
 | 
			
		||||
    public AjaxResult add(@RequestBody SysStudent sysStudent)
 | 
			
		||||
    {
 | 
			
		||||
        return toAjax(sysStudentService.save(sysStudent));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 修改学生信息
 | 
			
		||||
     */
 | 
			
		||||
    @PreAuthorize("@ss.hasPermi('system:student:edit')")
 | 
			
		||||
    @Log(title = "学生信息", businessType = BusinessType.UPDATE)
 | 
			
		||||
    @PutMapping
 | 
			
		||||
    public AjaxResult edit(@RequestBody SysStudent sysStudent)
 | 
			
		||||
    {
 | 
			
		||||
        return toAjax(sysStudentService.updateById(sysStudent));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除学生信息
 | 
			
		||||
     */
 | 
			
		||||
    @PreAuthorize("@ss.hasPermi('system:student:remove')")
 | 
			
		||||
    @Log(title = "学生信息", businessType = BusinessType.DELETE)
 | 
			
		||||
    @DeleteMapping("/{studentIds}")
 | 
			
		||||
    public AjaxResult remove(@PathVariable Long[] studentIds)
 | 
			
		||||
    {
 | 
			
		||||
        return toAjax(sysStudentService.removeByIds(Arrays.asList(studentIds)));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -153,4 +153,12 @@ public enum BusinessType
 | 
			
		|||
     * 更新设备
 | 
			
		||||
     */
 | 
			
		||||
    REFRESH,
 | 
			
		||||
    /**
 | 
			
		||||
     * 绑定
 | 
			
		||||
     */
 | 
			
		||||
    BAND,
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据mac修改sn
 | 
			
		||||
     */
 | 
			
		||||
    UPDATESN
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,131 +0,0 @@
 | 
			
		|||
package com.ruoyi.system.domain;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.IdType;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableField;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableName;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import com.ruoyi.common.annotation.Excel;
 | 
			
		||||
import org.apache.commons.lang3.builder.ToStringBuilder;
 | 
			
		||||
import org.apache.commons.lang3.builder.ToStringStyle;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 学生信息对象 sys_student
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
@TableName(value = "sys_student")
 | 
			
		||||
public class SysStudent implements Serializable
 | 
			
		||||
{
 | 
			
		||||
    @TableField(exist = false)
 | 
			
		||||
    private static final long serialVersionUID = 1L;
 | 
			
		||||
 | 
			
		||||
    /** 编号 */
 | 
			
		||||
    @TableId(type = IdType.AUTO)
 | 
			
		||||
    private Long studentId;
 | 
			
		||||
 | 
			
		||||
    /** 学生名称 */
 | 
			
		||||
    @Excel(name = "学生名称")
 | 
			
		||||
    private String studentName;
 | 
			
		||||
 | 
			
		||||
    /** 年龄 */
 | 
			
		||||
    @Excel(name = "年龄")
 | 
			
		||||
    private Integer studentAge;
 | 
			
		||||
 | 
			
		||||
    /** 爱好(0代码 1音乐 2电影) */
 | 
			
		||||
    @Excel(name = "爱好", readConverterExp = "0=代码,1=音乐,2=电影")
 | 
			
		||||
    private String studentHobby;
 | 
			
		||||
 | 
			
		||||
    /** 性别(0男 1女 2未知) */
 | 
			
		||||
    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
 | 
			
		||||
    private String studentSex;
 | 
			
		||||
 | 
			
		||||
    /** 状态(0正常 1停用) */
 | 
			
		||||
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
 | 
			
		||||
    private String studentStatus;
 | 
			
		||||
 | 
			
		||||
    /** 生日 */
 | 
			
		||||
    @JsonFormat(pattern = "yyyy-MM-dd")
 | 
			
		||||
    @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
 | 
			
		||||
    private Date studentBirthday;
 | 
			
		||||
 | 
			
		||||
    public void setStudentId(Long studentId)
 | 
			
		||||
    {
 | 
			
		||||
        this.studentId = studentId;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getStudentId()
 | 
			
		||||
    {
 | 
			
		||||
        return studentId;
 | 
			
		||||
    }
 | 
			
		||||
    public void setStudentName(String studentName)
 | 
			
		||||
    {
 | 
			
		||||
        this.studentName = studentName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getStudentName()
 | 
			
		||||
    {
 | 
			
		||||
        return studentName;
 | 
			
		||||
    }
 | 
			
		||||
    public void setStudentAge(Integer studentAge)
 | 
			
		||||
    {
 | 
			
		||||
        this.studentAge = studentAge;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Integer getStudentAge()
 | 
			
		||||
    {
 | 
			
		||||
        return studentAge;
 | 
			
		||||
    }
 | 
			
		||||
    public void setStudentHobby(String studentHobby)
 | 
			
		||||
    {
 | 
			
		||||
        this.studentHobby = studentHobby;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getStudentHobby()
 | 
			
		||||
    {
 | 
			
		||||
        return studentHobby;
 | 
			
		||||
    }
 | 
			
		||||
    public void setStudentSex(String studentSex)
 | 
			
		||||
    {
 | 
			
		||||
        this.studentSex = studentSex;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getStudentSex()
 | 
			
		||||
    {
 | 
			
		||||
        return studentSex;
 | 
			
		||||
    }
 | 
			
		||||
    public void setStudentStatus(String studentStatus)
 | 
			
		||||
    {
 | 
			
		||||
        this.studentStatus = studentStatus;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getStudentStatus()
 | 
			
		||||
    {
 | 
			
		||||
        return studentStatus;
 | 
			
		||||
    }
 | 
			
		||||
    public void setStudentBirthday(Date studentBirthday)
 | 
			
		||||
    {
 | 
			
		||||
        this.studentBirthday = studentBirthday;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Date getStudentBirthday()
 | 
			
		||||
    {
 | 
			
		||||
        return studentBirthday;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
 | 
			
		||||
                .append("studentId", getStudentId())
 | 
			
		||||
                .append("studentName", getStudentName())
 | 
			
		||||
                .append("studentAge", getStudentAge())
 | 
			
		||||
                .append("studentHobby", getStudentHobby())
 | 
			
		||||
                .append("studentSex", getStudentSex())
 | 
			
		||||
                .append("studentStatus", getStudentStatus())
 | 
			
		||||
                .append("studentBirthday", getStudentBirthday())
 | 
			
		||||
                .toString();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -89,6 +89,14 @@ public interface RlDeviceMapper extends BaseMapper<RlDevice>
 | 
			
		|||
     */
 | 
			
		||||
    public int updateDeviceBySn(RlDevice RlDevice);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据MAC修改设备
 | 
			
		||||
     *
 | 
			
		||||
     * @param rlDevice 设备
 | 
			
		||||
     * @return 结果
 | 
			
		||||
     */
 | 
			
		||||
    public int updateAsDeviceByMac(RlDevice rlDevice);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除设备
 | 
			
		||||
     *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,14 +0,0 @@
 | 
			
		|||
package com.ruoyi.system.mapper;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
			
		||||
import com.ruoyi.system.domain.SysStudent;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 学生信息Mapper接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
public interface SysStudentMapper extends BaseMapper<SysStudent>
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -361,6 +361,11 @@ public interface IRlDeviceService extends IService<RlDevice>
 | 
			
		|||
     */
 | 
			
		||||
    int bandSn(RlDevice device);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据mac修改sn
 | 
			
		||||
     */
 | 
			
		||||
    int updateSn(RlDevice device);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据mac号判断是否有绑定过
 | 
			
		||||
     */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,22 +0,0 @@
 | 
			
		|||
package com.ruoyi.system.service;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
			
		||||
import com.ruoyi.system.domain.SysStudent;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 学生信息Service接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
public interface ISysStudentService extends IService<SysStudent>
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询学生信息列表
 | 
			
		||||
     *
 | 
			
		||||
     * @param sysStudent 学生信息
 | 
			
		||||
     * @return 学生信息集合
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysStudent> queryList(SysStudent sysStudent);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2096,6 +2096,23 @@ public class RlDeviceServiceImpl extends ServiceImpl<RlDeviceMapper, RlDevice> i
 | 
			
		|||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据mac修改sn
 | 
			
		||||
     */
 | 
			
		||||
    @SneakyThrows
 | 
			
		||||
    @Override
 | 
			
		||||
    public int updateSn(RlDevice device) {
 | 
			
		||||
        RlDevice updateDevice = new RlDevice();
 | 
			
		||||
        updateDevice.setSn(device.getSn());
 | 
			
		||||
        updateDevice.setHardwareVersionId(device.getHardwareVersionId());
 | 
			
		||||
        updateDevice.setMac(device.getMac());
 | 
			
		||||
        int i = deviceMapper.updateAsDeviceByMac(updateDevice);
 | 
			
		||||
        if(i>0){
 | 
			
		||||
            log.info("【sn和mac号绑定】===>mac【{}】已经绑定过:更新sn【{}】成功",device.getMac(),device.getSn());
 | 
			
		||||
        }
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 判断是否靠近边界
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -692,8 +692,8 @@ public class RlOrderServiceImpl implements IRlOrderService
 | 
			
		|||
            }
 | 
			
		||||
            return Boolean.TRUE;
 | 
			
		||||
        });
 | 
			
		||||
        if(!execute)throw new ServiceException("订单取消失败");
 | 
			
		||||
        return false;
 | 
			
		||||
        if(Boolean.FALSE.equals(execute))throw new ServiceException("订单取消失败");
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			@ -707,9 +707,9 @@ public class RlOrderServiceImpl implements IRlOrderService
 | 
			
		|||
        int i = orderMapper.updateRlOrderByOrderNo(rlOrder);
 | 
			
		||||
        /** 记录订单履历 */
 | 
			
		||||
        RlOrderVO order = orderMapper.selectRlOrderByOrderNo(orderNo);
 | 
			
		||||
        if(orderOperService.recordOrderHistory(orderNo,ServiceConstants.ORDER_OPERATION_DEDUCTION,
 | 
			
		||||
        if(!orderOperService.recordOrderHistory(orderNo,ServiceConstants.ORDER_OPERATION_DEDUCTION,
 | 
			
		||||
                order.getStatus(),order.getStatus(),order.getPayFee(),order.getPayFee(),order.getUserId(),order.getPhone(),"车损扣款:扣款金额:"+money+",实际押金退款:"+order.getDeposit()+"-"+money)){
 | 
			
		||||
            throw new ServiceException("【改价】更新订单信息失败");
 | 
			
		||||
            throw new ServiceException("【车损扣款】更新订单信息失败");
 | 
			
		||||
        }
 | 
			
		||||
        return i>0;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -82,15 +82,15 @@ public class RlUserServiceImpl implements IRlUserService{
 | 
			
		|||
    @Autowired
 | 
			
		||||
    private RlChannelWithdrawService etChannelWithdrawService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IRlUserWithdrawService userWithdrawService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private TransactionTemplate transactionTemplate;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IRlChangeBalanceService changeBalanceService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private IRlUserWithdrawService userWithdrawService;
 | 
			
		||||
 | 
			
		||||
    @Value("${aliyun.accessKeyId}")
 | 
			
		||||
    private String accessKeyId;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -802,7 +802,7 @@ public class RlUserServiceImpl implements IRlUserService{
 | 
			
		|||
            asynchronousMsg(user.getUserName());
 | 
			
		||||
            return Boolean.TRUE;
 | 
			
		||||
        });
 | 
			
		||||
        if(!execute)throw new ServiceException("【提现】失败");
 | 
			
		||||
        if(Boolean.FALSE.equals(execute))throw new ServiceException("【提现】失败");
 | 
			
		||||
        return 1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -832,15 +832,15 @@ public class RlUserServiceImpl implements IRlUserService{
 | 
			
		|||
        rlWithdraw.setOwnerId(user.getUserId());
 | 
			
		||||
        rlWithdraw.setOwnerName(user.getUserName());
 | 
			
		||||
        rlWithdraw.setOwnerPhone(user.getPhonenumber());
 | 
			
		||||
        ChannelWithdrawVO channelWithdrawVO = etChannelWithdrawService.selectChannelWithdrawByChannelId(withdraw.getUserWithdrawChannelId());
 | 
			
		||||
        if(ObjectUtil.isNull(channelWithdrawVO)){
 | 
			
		||||
            throw new ServiceException("提现渠道不存在");
 | 
			
		||||
        }
 | 
			
		||||
        RlUserWithdraw userWithdraw =  userWithdrawService.selectRlUserWithdrawByUserChannelId(withdraw.getUserWithdrawChannelId());
 | 
			
		||||
        ServiceUtil.assertion(ObjectUtil.isNull(userWithdraw), "用户提现渠道不存在");
 | 
			
		||||
        ChannelWithdrawVO channelWithdrawVO = etChannelWithdrawService.selectChannelWithdrawByChannelId(userWithdraw.getChannelId());
 | 
			
		||||
        ServiceUtil.assertion(ObjectUtil.isNull(channelWithdrawVO), "全局提现渠道不存在");
 | 
			
		||||
        BigDecimal cost;
 | 
			
		||||
        if(channelWithdrawVO.getHandlingChargeType().equals(ServiceConstants.HANDLING_CHARGE_TYPE_PERCENT)){
 | 
			
		||||
        if(userWithdraw.getHandlingChargeType().equals(ServiceConstants.HANDLING_CHARGE_TYPE_PERCENT)){
 | 
			
		||||
            cost = channelWithdrawVO.getCostRate().divide(new BigDecimal(100)).multiply(withdraw.getAmount()).setScale(2, RoundingMode.HALF_UP);
 | 
			
		||||
        }else{
 | 
			
		||||
            cost = channelWithdrawVO.getWithdrawHandlingCharge();
 | 
			
		||||
            cost = userWithdraw.getWithdrawHandlingCharge();
 | 
			
		||||
        }
 | 
			
		||||
        rlWithdraw.setCost(cost);
 | 
			
		||||
        rlWithdraw.setWithdrawChannelId(withdraw.getWithdrawChannelId());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,43 +0,0 @@
 | 
			
		|||
package com.ruoyi.system.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import com.ruoyi.common.utils.StringUtils;
 | 
			
		||||
import com.ruoyi.system.domain.SysStudent;
 | 
			
		||||
import com.ruoyi.system.mapper.SysStudentMapper;
 | 
			
		||||
import com.ruoyi.system.service.ISysStudentService;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 学生信息Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
 * @author ruoyi
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
public class SysStudentServiceImpl extends ServiceImpl<SysStudentMapper, SysStudent> implements ISysStudentService
 | 
			
		||||
{
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<SysStudent> queryList(SysStudent sysStudent)
 | 
			
		||||
    {
 | 
			
		||||
        // 注意:mybatis-plus lambda 模式不支持 eclipse 的编译器
 | 
			
		||||
        // LambdaQueryWrapper<SysStudent> queryWrapper = Wrappers.lambdaQuery();
 | 
			
		||||
        // queryWrapper.eq(SysStudent::getStudentName, sysStudent.getStudentName());
 | 
			
		||||
        QueryWrapper<SysStudent> queryWrapper = Wrappers.query();
 | 
			
		||||
        if (StringUtils.isNotEmpty(sysStudent.getStudentName()))
 | 
			
		||||
        {
 | 
			
		||||
            queryWrapper.eq("student_name", sysStudent.getStudentName());
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotNull(sysStudent.getStudentAge()))
 | 
			
		||||
        {
 | 
			
		||||
            queryWrapper.eq("student_age", sysStudent.getStudentAge());
 | 
			
		||||
        }
 | 
			
		||||
        if (StringUtils.isNotEmpty(sysStudent.getStudentHobby()))
 | 
			
		||||
        {
 | 
			
		||||
            queryWrapper.eq("student_hobby", sysStudent.getStudentHobby());
 | 
			
		||||
        }
 | 
			
		||||
        return this.list(queryWrapper);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -593,10 +593,9 @@ public class StoreServiceImpl implements RlStoreService
 | 
			
		|||
        BigDecimal lat2 = storeVo.getLat();
 | 
			
		||||
        if (lng2 != null && lat2 != null) {
 | 
			
		||||
            double[] point1 = {lng2.doubleValue(), lat2.doubleValue()};
 | 
			
		||||
            double[] point2 = {Double.valueOf(lon1), Double.valueOf(lat1)};
 | 
			
		||||
            double[] point2 = {Double.parseDouble(lon1), Double.parseDouble(lat1)};
 | 
			
		||||
            double distance = GeoUtils.haversineDistance(point1, point2);
 | 
			
		||||
            BigDecimal distanceFormatted = new BigDecimal(distance).setScale(1, RoundingMode.HALF_UP);
 | 
			
		||||
            return distanceFormatted;
 | 
			
		||||
            return new BigDecimal(distance).setScale(1, RoundingMode.HALF_UP);
 | 
			
		||||
        }
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -304,9 +304,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		|||
        </trim>
 | 
			
		||||
        where sn = #{sn}
 | 
			
		||||
    </update>
 | 
			
		||||
    <update id="batchDisable">
 | 
			
		||||
        update
 | 
			
		||||
 | 
			
		||||
    <update id="updateAsDeviceByMac">
 | 
			
		||||
        update rl_device
 | 
			
		||||
        <trim prefix="SET" suffixOverrides=",">
 | 
			
		||||
            <if test="sn != null">sn = #{sn},</if>
 | 
			
		||||
            <if test="hardwareVersionId != null">hardware_version_id = #{hardwareVersionId},</if>
 | 
			
		||||
            <if test="onlineStatus != null">online_status = #{onlineStatus},</if>
 | 
			
		||||
        </trim>
 | 
			
		||||
        where mac = #{mac}
 | 
			
		||||
    </update>
 | 
			
		||||
 | 
			
		||||
    <delete id="deleteDeviceByDeviceId" parameterType="Long">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user