From a43d27a5c8f5650642d63efe3d4bcd6d7eee8dc0 Mon Sep 17 00:00:00 2001 From: lzx_win <2602107437@qq.com> Date: Fri, 26 Sep 2025 18:26:53 +0800 Subject: [PATCH] 1 --- admin-hanhai-vue/.env.development | 2 +- .../controller/EmployWithdrawalController.java | 171 +++++++++++++++++ .../employWithdrawal/entity/EmployWithdrawal.java | 78 ++++++++ .../mapper/EmployWithdrawalMapper.java | 17 ++ .../mapper/xml/EmployWithdrawalMapper.xml | 5 + .../service/IEmployWithdrawalService.java | 14 ++ .../service/impl/EmployWithdrawalServiceImpl.java | 19 ++ .../employWithdrawal/vue/EmployWithdrawalList.vue | 209 +++++++++++++++++++++ .../vue/modules/EmployWithdrawalForm.vue | 129 +++++++++++++ .../modules/EmployWithdrawalModal.Style#Drawer.vue | 84 +++++++++ .../vue/modules/EmployWithdrawalModal.vue | 60 ++++++ .../employWithdrawal/vue3/EmployWithdrawal.api.ts | 61 ++++++ .../employWithdrawal/vue3/EmployWithdrawal.data.ts | 84 +++++++++ .../employWithdrawal/vue3/EmployWithdrawalList.vue | 162 ++++++++++++++++ .../vue3/components/EmployWithdrawalModal.vue | 58 ++++++ .../api/employController/AmountController.java | 10 +- .../jeecg/modules/apiService/AmountService.java | 3 +- .../modules/apiService/impl/AmountServiceImpl.java | 52 ++++- .../modules/apiService/impl/SeekServiceImpl.java | 1 + 19 files changed, 1213 insertions(+), 6 deletions(-) create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/controller/EmployWithdrawalController.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/entity/EmployWithdrawal.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/EmployWithdrawalMapper.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/xml/EmployWithdrawalMapper.xml create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/IEmployWithdrawalService.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/impl/EmployWithdrawalServiceImpl.java create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/EmployWithdrawalList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalForm.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.Style#Drawer.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.api.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.data.ts create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawalList.vue create mode 100644 jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/components/EmployWithdrawalModal.vue diff --git a/admin-hanhai-vue/.env.development b/admin-hanhai-vue/.env.development index 7456dcc..ce445d0 100644 --- a/admin-hanhai-vue/.env.development +++ b/admin-hanhai-vue/.env.development @@ -1,5 +1,5 @@ NODE_ENV=development -VUE_APP_API_BASE_URL=http://localhost:8003/employ-api/ +VUE_APP_API_BASE_URL=http://localhost:8002/employ-api/ //VUE_APP_API_BASE_URL=http://localhost:8000/employ-api/ VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/controller/EmployWithdrawalController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/controller/EmployWithdrawalController.java new file mode 100644 index 0000000..14d17b2 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/controller/EmployWithdrawalController.java @@ -0,0 +1,171 @@ +package org.jeecg.modules.employWithdrawal.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.employWithdrawal.entity.EmployWithdrawal; +import org.jeecg.modules.employWithdrawal.service.IEmployWithdrawalService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 提现 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +@Api(tags="提现") +@RestController +@RequestMapping("/employWithdrawal/employWithdrawal") +@Slf4j +public class EmployWithdrawalController extends JeecgController { + @Autowired + private IEmployWithdrawalService employWithdrawalService; + + /** + * 分页列表查询 + * + * @param employWithdrawal + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "提现-分页列表查询") + @ApiOperation(value="提现-分页列表查询", notes="提现-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(EmployWithdrawal employWithdrawal, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(employWithdrawal, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = employWithdrawalService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param employWithdrawal + * @return + */ + @AutoLog(value = "提现-添加") + @ApiOperation(value="提现-添加", notes="提现-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody EmployWithdrawal employWithdrawal) { + employWithdrawalService.save(employWithdrawal); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param employWithdrawal + * @return + */ + @AutoLog(value = "提现-编辑") + @ApiOperation(value="提现-编辑", notes="提现-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody EmployWithdrawal employWithdrawal) { + employWithdrawalService.updateById(employWithdrawal); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "提现-通过id删除") + @ApiOperation(value="提现-通过id删除", notes="提现-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + employWithdrawalService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "提现-批量删除") + @ApiOperation(value="提现-批量删除", notes="提现-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.employWithdrawalService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "提现-通过id查询") + @ApiOperation(value="提现-通过id查询", notes="提现-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + EmployWithdrawal employWithdrawal = employWithdrawalService.getById(id); + if(employWithdrawal==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(employWithdrawal); + } + + /** + * 导出excel + * + * @param request + * @param employWithdrawal + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, EmployWithdrawal employWithdrawal) { + return super.exportXls(request, employWithdrawal, EmployWithdrawal.class, "提现"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, EmployWithdrawal.class); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/entity/EmployWithdrawal.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/entity/EmployWithdrawal.java new file mode 100644 index 0000000..0c6b707 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/entity/EmployWithdrawal.java @@ -0,0 +1,78 @@ +package org.jeecg.modules.employWithdrawal.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 提现 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +@Data +@TableName("employ_withdrawal") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="employ_withdrawal对象", description="提现") +public class EmployWithdrawal implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**用户*/ + @Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") + @ApiModelProperty(value = "用户") + private java.lang.String userId; + /**真实姓名*/ + @Excel(name = "真实姓名", width = 15) + @ApiModelProperty(value = "真实姓名") + private java.lang.String realName; + /**银行卡号*/ + @Excel(name = "银行卡号", width = 15) + @ApiModelProperty(value = "银行卡号") + private java.lang.String bankCard; + /**开户行*/ + @Excel(name = "开户行", width = 15) + @ApiModelProperty(value = "开户行") + private java.lang.String bankName; + /**金额*/ + @Excel(name = "金额", width = 15) + @ApiModelProperty(value = "金额") + private java.math.BigDecimal money; + /**打款凭证*/ + @Excel(name = "打款凭证", width = 15) + @ApiModelProperty(value = "打款凭证") + private java.lang.String voucher; +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/EmployWithdrawalMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/EmployWithdrawalMapper.java new file mode 100644 index 0000000..f53f28f --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/EmployWithdrawalMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.employWithdrawal.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.employWithdrawal.entity.EmployWithdrawal; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 提现 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +public interface EmployWithdrawalMapper extends BaseMapper { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/xml/EmployWithdrawalMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/xml/EmployWithdrawalMapper.xml new file mode 100644 index 0000000..a87e18c --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/mapper/xml/EmployWithdrawalMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/IEmployWithdrawalService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/IEmployWithdrawalService.java new file mode 100644 index 0000000..ca2efd4 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/IEmployWithdrawalService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.employWithdrawal.service; + +import org.jeecg.modules.employWithdrawal.entity.EmployWithdrawal; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 提现 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +public interface IEmployWithdrawalService extends IService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/impl/EmployWithdrawalServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/impl/EmployWithdrawalServiceImpl.java new file mode 100644 index 0000000..ee0556b --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/service/impl/EmployWithdrawalServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.employWithdrawal.service.impl; + +import org.jeecg.modules.employWithdrawal.entity.EmployWithdrawal; +import org.jeecg.modules.employWithdrawal.mapper.EmployWithdrawalMapper; +import org.jeecg.modules.employWithdrawal.service.IEmployWithdrawalService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 提现 + * @Author: jeecg-boot + * @Date: 2025-09-26 + * @Version: V1.0 + */ +@Service +public class EmployWithdrawalServiceImpl extends ServiceImpl implements IEmployWithdrawalService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/EmployWithdrawalList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/EmployWithdrawalList.vue new file mode 100644 index 0000000..5a357f0 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/EmployWithdrawalList.vue @@ -0,0 +1,209 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalForm.vue new file mode 100644 index 0000000..7f54ed0 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalForm.vue @@ -0,0 +1,129 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.Style#Drawer.vue new file mode 100644 index 0000000..851ebde --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.vue new file mode 100644 index 0000000..d40ef23 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue/modules/EmployWithdrawalModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.api.ts new file mode 100644 index 0000000..b4b895d --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/employWithdrawal/employWithdrawal/list', + save='/employWithdrawal/employWithdrawal/add', + edit='/employWithdrawal/employWithdrawal/edit', + deleteOne = '/employWithdrawal/employWithdrawal/delete', + deleteBatch = '/employWithdrawal/employWithdrawal/deleteBatch', + importExcel = '/employWithdrawal/employWithdrawal/importExcel', + exportXls = '/employWithdrawal/employWithdrawal/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.data.ts new file mode 100644 index 0000000..00b82d7 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawal.data.ts @@ -0,0 +1,84 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '创建日期', + align:"center", + dataIndex: 'createTime' + }, + { + title: '用户', + align:"center", + dataIndex: 'userId_dictText' + }, + { + title: '真实姓名', + align:"center", + dataIndex: 'realName' + }, + { + title: '银行卡号', + align:"center", + dataIndex: 'bankCard' + }, + { + title: '开户行', + align:"center", + dataIndex: 'bankName' + }, + { + title: '金额', + align:"center", + dataIndex: 'money' + }, + { + title: '打款凭证', + align:"center", + dataIndex: 'voucher', + customRender:render.renderAvatar, + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '用户', + field: 'userId', + component: 'JSearchSelect', + componentProps:{ + dict:"han_hai_member,nick_name,id" + }, + }, + { + label: '真实姓名', + field: 'realName', + component: 'Input', + }, + { + label: '银行卡号', + field: 'bankCard', + component: 'Input', + }, + { + label: '开户行', + field: 'bankName', + component: 'Input', + }, + { + label: '金额', + field: 'money', + component: 'InputNumber', + }, + { + label: '打款凭证', + field: 'voucher', + component: 'JImageUpload', + componentProps:{ + }, + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawalList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawalList.vue new file mode 100644 index 0000000..bcce0c1 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/EmployWithdrawalList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/components/EmployWithdrawalModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/components/EmployWithdrawalModal.vue new file mode 100644 index 0000000..7c05a9a --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employWithdrawal/vue3/components/EmployWithdrawalModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/AmountController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/AmountController.java index 628c2ce..8bb8d73 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/AmountController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/AmountController.java @@ -7,6 +7,7 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.modules.apiBean.PageBean; import org.jeecg.modules.apiService.AmountService; import org.jeecg.modules.apiService.AuthenticationService; +import org.jeecg.modules.employWithdrawal.entity.EmployWithdrawal; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -37,8 +38,13 @@ public class AmountController { @ApiOperation(value="我的钱包-提现", notes="我的钱包-提现") @RequestMapping(value = "/CashOut", method = {RequestMethod.GET}) - public Result CashOut(@RequestHeader("X-Access-Token") String token, BigDecimal price){ - return amountService.CashOut(token); + public Result CashOut(@RequestHeader("X-Access-Token") String token, BigDecimal money, String realName, String bankCard, String bankName){ + EmployWithdrawal withdrawal = new EmployWithdrawal(); + withdrawal.setMoney(money); + withdrawal.setRealName(realName); + withdrawal.setBankCard(bankCard); + withdrawal.setBankName(bankName); + return amountService.CashOut(token, withdrawal); } @ApiOperation(value="我的钱包-充值", notes="我的钱包-充值") diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/AmountService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/AmountService.java index 240a813..2a78bc8 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/AmountService.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/AmountService.java @@ -2,6 +2,7 @@ package org.jeecg.modules.apiService; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.apiBean.PageBean; +import org.jeecg.modules.employWithdrawal.entity.EmployWithdrawal; import org.springframework.web.bind.annotation.RequestHeader; import java.math.BigDecimal; @@ -15,7 +16,7 @@ public interface AmountService { public Result CountCashOut(@RequestHeader("X-Access-Token") String token); //我的钱包-提现 - public Result CashOut(@RequestHeader("X-Access-Token") String token); + public Result CashOut(@RequestHeader("X-Access-Token") String token, EmployWithdrawal withdrawal); //我的钱包-充值 public Result recharge(@RequestHeader("X-Access-Token") String token, BigDecimal price); diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java index 266785b..9ebc343 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java @@ -13,6 +13,8 @@ import org.jeecg.modules.employAmountLog.entity.EmployAmountLog; import org.jeecg.modules.employAmountLog.service.IEmployAmountLogService; import org.jeecg.modules.employTrade.entity.EmployTrade; import org.jeecg.modules.employTrade.service.IEmployTradeService; +import org.jeecg.modules.employWithdrawal.entity.EmployWithdrawal; +import org.jeecg.modules.employWithdrawal.service.IEmployWithdrawalService; import org.jeecg.modules.hanHaiMember.entity.HanHaiMember; import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService; import org.jeecg.modules.pay.MpWxPayService; @@ -44,6 +46,10 @@ public class AmountServiceImpl implements AmountService { @Resource private IEmployAmountLogService employAmountLogService; + //金额明细 + @Resource + private IEmployWithdrawalService employWithdrawalService; + @Resource private IHanHaiMemberService hanHaiMemberService; /******************************************************************************************************************/ @@ -87,8 +93,50 @@ public class AmountServiceImpl implements AmountService { //我的钱包-提现 @Override - public Result CashOut(String token) { - return Result.OK("接口内容暂未完成"); + public Result CashOut(String token, EmployWithdrawal withdrawal) { + //权限验证 + HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + + try { + // 1. 判断用户金额是否足够 + BigDecimal userBalance = hanHaiMember.getPrice() == null ? BigDecimal.ZERO : hanHaiMember.getPrice(); // 用户当前余额 + BigDecimal withdrawalAmount = withdrawal.getMoney(); // 提现金额 + + if (withdrawalAmount == null) { + return Result.error("请填写金额"); + } + + if (withdrawalAmount.compareTo(BigDecimal.ZERO) <= 0) { + return Result.error("提现金额必须大于0"); + } + + if (userBalance.compareTo(withdrawalAmount) < 0) { + return Result.error("余额不足,当前余额:" + userBalance + "元"); + } + + // 2. 减去提现的金额 + BigDecimal newBalance = userBalance.subtract(withdrawalAmount); + hanHaiMember.setPrice(newBalance); + hanHaiMemberService.updateById(hanHaiMember); + + // 3. 添加流水记录(EmployAmountLog) + EmployAmountLog amountLog = new EmployAmountLog(); + amountLog.setTitle("提现"); + amountLog.setAmount(withdrawalAmount); + amountLog.setType("1"); // 支出 + amountLog.setUserId(hanHaiMember.getId()); + employAmountLogService.save(amountLog); + + // 4. 添加提现记录(EmployWithdrawal) + withdrawal.setUserId(hanHaiMember.getId()); + employWithdrawalService.save(withdrawal); + + return Result.OK("提现申请成功,提现金额:" + withdrawalAmount + "元,剩余余额:" + newBalance + "元"); + + } catch (Exception e) { + e.printStackTrace(); + return Result.error("提现申请失败:" + e.getMessage()); + } } //我的钱包-充值 diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/SeekServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/SeekServiceImpl.java index 267042c..302890e 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/SeekServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/SeekServiceImpl.java @@ -58,6 +58,7 @@ public class SeekServiceImpl implements SeekService { .like(employSeek.getAddress() != null, EmploySeek::getAddress, employSeek.getAddress()) .orderByDesc(EmploySeek::getCreateTime) .notIn(EmploySeek::getSeekStatus, 1, 2) + .eq(StringUtils.isNotEmpty(employSeek.getCategoryOne()), EmploySeek::getCategoryOne, employSeek.getCategoryOne()) .page(page); //创建一个新的集合 for (EmploySeek seek : pageList.getRecords()) {