微调
This commit is contained in:
		
							parent
							
								
									d914843e67
								
							
						
					
					
						commit
						3df9ab3e88
					
				|  | @ -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))); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|  | @ -520,7 +520,7 @@ public class ServiceConstants { | ||||||
|      */ |      */ | ||||||
|     public static final String DIVIDEND_STATUS_SETTLED = "1"; |     public static final String DIVIDEND_STATUS_SETTLED = "1"; | ||||||
| 
 | 
 | ||||||
| /**----------------------------分账状态end----------------------------*/ |     /**----------------------------分账状态end----------------------------*/ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     /**----------------------------退款类型start----------------------------*/ |     /**----------------------------退款类型start----------------------------*/ | ||||||
|  |  | ||||||
|  | @ -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(); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
|  | @ -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> |  | ||||||
| { |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
|  | @ -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); |  | ||||||
| } |  | ||||||
|  | @ -82,15 +82,15 @@ public class RlUserServiceImpl implements IRlUserService{ | ||||||
|     @Autowired |     @Autowired | ||||||
|     private RlChannelWithdrawService etChannelWithdrawService; |     private RlChannelWithdrawService etChannelWithdrawService; | ||||||
| 
 | 
 | ||||||
|  |     @Autowired | ||||||
|  |     private IRlUserWithdrawService userWithdrawService; | ||||||
|  | 
 | ||||||
|     @Autowired |     @Autowired | ||||||
|     private TransactionTemplate transactionTemplate; |     private TransactionTemplate transactionTemplate; | ||||||
| 
 | 
 | ||||||
|     @Autowired |     @Autowired | ||||||
|     private IRlChangeBalanceService changeBalanceService; |     private IRlChangeBalanceService changeBalanceService; | ||||||
| 
 | 
 | ||||||
|     @Autowired |  | ||||||
|     private IRlUserWithdrawService userWithdrawService; |  | ||||||
| 
 |  | ||||||
|     @Value("${aliyun.accessKeyId}") |     @Value("${aliyun.accessKeyId}") | ||||||
|     private String accessKeyId; |     private String accessKeyId; | ||||||
| 
 | 
 | ||||||
|  | @ -802,7 +802,7 @@ public class RlUserServiceImpl implements IRlUserService{ | ||||||
|             asynchronousMsg(user.getUserName()); |             asynchronousMsg(user.getUserName()); | ||||||
|             return Boolean.TRUE; |             return Boolean.TRUE; | ||||||
|         }); |         }); | ||||||
|         if(!execute)throw new ServiceException("【提现】失败"); |         if(Boolean.FALSE.equals(execute))throw new ServiceException("【提现】失败"); | ||||||
|         return 1; |         return 1; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -832,15 +832,15 @@ public class RlUserServiceImpl implements IRlUserService{ | ||||||
|         rlWithdraw.setOwnerId(user.getUserId()); |         rlWithdraw.setOwnerId(user.getUserId()); | ||||||
|         rlWithdraw.setOwnerName(user.getUserName()); |         rlWithdraw.setOwnerName(user.getUserName()); | ||||||
|         rlWithdraw.setOwnerPhone(user.getPhonenumber()); |         rlWithdraw.setOwnerPhone(user.getPhonenumber()); | ||||||
|         ChannelWithdrawVO channelWithdrawVO = etChannelWithdrawService.selectChannelWithdrawByChannelId(withdraw.getUserWithdrawChannelId()); |         RlUserWithdraw userWithdraw =  userWithdrawService.selectRlUserWithdrawByUserChannelId(withdraw.getUserWithdrawChannelId()); | ||||||
|         if(ObjectUtil.isNull(channelWithdrawVO)){ |         ServiceUtil.assertion(ObjectUtil.isNull(userWithdraw), "用户提现渠道不存在"); | ||||||
|             throw new ServiceException("提现渠道不存在"); |         ChannelWithdrawVO channelWithdrawVO = etChannelWithdrawService.selectChannelWithdrawByChannelId(userWithdraw.getChannelId()); | ||||||
|         } |         ServiceUtil.assertion(ObjectUtil.isNull(channelWithdrawVO), "全局提现渠道不存在"); | ||||||
|         BigDecimal cost; |         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); |             cost = channelWithdrawVO.getCostRate().divide(new BigDecimal(100)).multiply(withdraw.getAmount()).setScale(2, RoundingMode.HALF_UP); | ||||||
|         }else{ |         }else{ | ||||||
|             cost = channelWithdrawVO.getWithdrawHandlingCharge(); |             cost = userWithdraw.getWithdrawHandlingCharge(); | ||||||
|         } |         } | ||||||
|         rlWithdraw.setCost(cost); |         rlWithdraw.setCost(cost); | ||||||
|         rlWithdraw.setWithdrawChannelId(withdraw.getWithdrawChannelId()); |         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(); |         BigDecimal lat2 = storeVo.getLat(); | ||||||
|         if (lng2 != null && lat2 != null) { |         if (lng2 != null && lat2 != null) { | ||||||
|             double[] point1 = {lng2.doubleValue(), lat2.doubleValue()}; |             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); |             double distance = GeoUtils.haversineDistance(point1, point2); | ||||||
|             BigDecimal distanceFormatted = new BigDecimal(distance).setScale(1, RoundingMode.HALF_UP); |             return new BigDecimal(distance).setScale(1, RoundingMode.HALF_UP); | ||||||
|             return distanceFormatted; |  | ||||||
|         } |         } | ||||||
|         return null; |         return null; | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user