From 58ed54164f69d9115a633f7df2d5ae30a5c18164 Mon Sep 17 00:00:00 2001 From: wangjiadong <1654135867@qq.com> Date: Thu, 29 Dec 2022 14:43:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E8=A1=8C=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/zybank/admin/ZybankList.vue | 177 ++++++++++++++++++ .../views/zybank/admin/modules/ZybankForm.vue | 109 +++++++++++ .../zybank/admin/modules/ZybankModal.vue | 60 ++++++ .../modules/ZybankModal__Style#Drawer.vue | 84 +++++++++ .../zybank/controller/ZybankController.java | 172 +++++++++++++++++ .../modules/demo/zybank/entity/Zybank.java | 67 +++++++ .../demo/zybank/mapper/ZybankMapper.java | 19 ++ .../demo/zybank/mapper/xml/ZybankMapper.xml | 5 + .../demo/zybank/service/IZybankService.java | 16 ++ .../service/impl/ZybankServiceImpl.java | 21 +++ 10 files changed, 730 insertions(+) create mode 100644 ant-design-vue-jeecg/src/views/zybank/admin/ZybankList.vue create mode 100644 ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankForm.vue create mode 100644 ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal.vue create mode 100644 ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal__Style#Drawer.vue create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/controller/ZybankController.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/entity/Zybank.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/ZybankMapper.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/xml/ZybankMapper.xml create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/IZybankService.java create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/impl/ZybankServiceImpl.java diff --git a/ant-design-vue-jeecg/src/views/zybank/admin/ZybankList.vue b/ant-design-vue-jeecg/src/views/zybank/admin/ZybankList.vue new file mode 100644 index 00000000..eda41d32 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zybank/admin/ZybankList.vue @@ -0,0 +1,177 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankForm.vue b/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankForm.vue new file mode 100644 index 00000000..96987043 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankForm.vue @@ -0,0 +1,109 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal.vue b/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal.vue new file mode 100644 index 00000000..25494e80 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal__Style#Drawer.vue b/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal__Style#Drawer.vue new file mode 100644 index 00000000..40cb6f56 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/zybank/admin/modules/ZybankModal__Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/controller/ZybankController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/controller/ZybankController.java new file mode 100644 index 00000000..099498b7 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/controller/ZybankController.java @@ -0,0 +1,172 @@ +package org.jeecg.modules.demo.zybank.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.demo.zybank.entity.Zybank; +import org.jeecg.modules.demo.zybank.service.IZybankService; + +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: 2022-12-29 + * @Version: V1.0 + */ +@Api(tags="银行信息表") +@RestController +@RequestMapping("/zybank/zybank") +@Slf4j +public class ZybankController extends JeecgController { + @Autowired + private IZybankService zybankService; + + /** + * 分页列表查询 + * + * @param zybank + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "银行信息表-分页列表查询") + @ApiOperation(value="银行信息表-分页列表查询", notes="银行信息表-分页列表查询") + @GetMapping(value = "/list") + public Result queryPageList(Zybank zybank, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zybank, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zybankService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param zybank + * @return + */ + @AutoLog(value = "银行信息表-添加") + @ApiOperation(value="银行信息表-添加", notes="银行信息表-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody Zybank zybank) { + zybankService.save(zybank); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param zybank + * @return + */ + @AutoLog(value = "银行信息表-编辑") + @ApiOperation(value="银行信息表-编辑", notes="银行信息表-编辑") + @PutMapping(value = "/edit") + public Result edit(@RequestBody Zybank zybank) { + zybankService.updateById(zybank); + 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) { + zybankService.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.zybankService.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) { + Zybank zybank = zybankService.getById(id); + if(zybank==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(zybank); + } + + /** + * 导出excel + * + * @param request + * @param zybank + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, Zybank zybank) { + return super.exportXls(request, zybank, Zybank.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, Zybank.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/entity/Zybank.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/entity/Zybank.java new file mode 100644 index 00000000..f10b31a3 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/entity/Zybank.java @@ -0,0 +1,67 @@ +package org.jeecg.modules.demo.zybank.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: 2022-12-29 + * @Version: V1.0 + */ +@Data +@TableName("zybank") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="zybank对象", description="银行信息表") +public class Zybank implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private String sysOrgCode; + /**银行名称*/ + @Excel(name = "银行名称", width = 15) + @ApiModelProperty(value = "银行名称") + private String bankname; + /**开户行*/ + @Excel(name = "开户行", width = 15) + @ApiModelProperty(value = "开户行") + private String bankkh; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/ZybankMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/ZybankMapper.java new file mode 100644 index 00000000..2094fdb6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/ZybankMapper.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.zybank.mapper; + + + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.zybank.entity.Zybank; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 银行信息表 + * @Author: jeecg-boot + * @Date: 2022-12-29 + * @Version: V1.0 + */ +public interface ZybankMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/xml/ZybankMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/xml/ZybankMapper.xml new file mode 100644 index 00000000..b7e76ea6 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/mapper/xml/ZybankMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/IZybankService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/IZybankService.java new file mode 100644 index 00000000..743e7b54 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/IZybankService.java @@ -0,0 +1,16 @@ +package org.jeecg.modules.demo.zybank.service; + + + +import org.jeecg.modules.demo.zybank.entity.Zybank; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 银行信息表 + * @Author: jeecg-boot + * @Date: 2022-12-29 + * @Version: V1.0 + */ +public interface IZybankService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/impl/ZybankServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/impl/ZybankServiceImpl.java new file mode 100644 index 00000000..5054591c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zybank/service/impl/ZybankServiceImpl.java @@ -0,0 +1,21 @@ +package org.jeecg.modules.demo.zybank.service.impl; + + + +import org.jeecg.modules.demo.zybank.entity.Zybank; +import org.jeecg.modules.demo.zybank.mapper.ZybankMapper; +import org.jeecg.modules.demo.zybank.service.IZybankService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 银行信息表 + * @Author: jeecg-boot + * @Date: 2022-12-29 + * @Version: V1.0 + */ +@Service +public class ZybankServiceImpl extends ServiceImpl implements IZybankService { + +}