From 30f391c07c584cd65243532beba7e2b1f6b5455b Mon Sep 17 00:00:00 2001 From: Enzo Date: Mon, 1 Apr 2019 11:04:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=92=8C=E5=A2=9E=E5=8A=A0=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 437 +++++++++--------- ruoyi-admin/src/main/java/com/Hello.java | 11 + .../main/java/com/ruoyi/RuoYiApplication.java | 13 +- .../web/controller/store/VGoodController.java | 127 +++++ .../controller/store/VGoodItemController.java | 127 +++++ .../controller/store/VStoreController.java | 127 +++++ .../src/main/resources/application-druid.yml | 2 +- .../src/main/resources/application.yml | 14 +- .../resources/templates/store/vGood/add.html | 107 +++++ .../resources/templates/store/vGood/edit.html | 109 +++++ .../templates/store/vGood/vGood.html | 207 +++++++++ .../templates/store/vGoodItem/add.html | 59 +++ .../templates/store/vGoodItem/edit.html | 61 +++ .../templates/store/vGoodItem/vGoodItem.html | 126 +++++ .../templates/store/vQrcode/add.html | 59 +++ .../templates/store/vQrcode/edit.html | 61 +++ .../templates/store/vQrcode/vQrcode.html | 126 +++++ .../resources/templates/store/vStore/add.html | 91 ++++ .../templates/store/vStore/edit.html | 93 ++++ .../templates/store/vStore/vStore.html | 179 +++++++ .../resources/templates/system/user/user.html | 5 + ruoyi-common/pom.xml | 11 + .../ruoyi/common/core/domain/BaseEntity.java | 8 + .../ruoyi/common/core/page/ExampleUtils.java | 40 ++ .../com/ruoyi/common/core/text/Convert.java | 14 + .../com/ruoyi/common/utils/AddressUtils.java | 43 +- .../java/com/ruoyi/common/utils/IpUtils.java | 98 ++-- .../generator/controller/GenController.java | 20 +- .../ruoyi/generator/domain/ColumnInfo.java | 22 + .../com/ruoyi/generator/domain/TableInfo.java | 4 + .../src/main/resources/generator.yml | 4 +- .../resources/mapper/generator/GenMapper.xml | 4 +- .../src/main/resources/vm/html/edit.html.vm | 11 +- .../src/main/resources/vm/html/list.html.vm | 6 +- .../src/main/resources/vm/java/Mapper.java.vm | 22 +- .../main/resources/vm/java/Service.java.vm | 18 +- .../resources/vm/java/ServiceImpl.java.vm | 60 ++- .../src/main/resources/vm/java/domain.java.vm | 37 +- ruoyi-system/pom.xml | 4 +- .../com/ruoyi/store/domain/VGoodItem.java | 55 +++ .../java/com/ruoyi/store/domain/VStore.java | 75 +++ .../ruoyi/store/mapper/VGoodItemMapper.java | 66 +++ .../com/ruoyi/store/mapper/VStoreMapper.java | 66 +++ .../store/service/IVGoodItemService.java | 60 +++ .../ruoyi/store/service/IVStoreService.java | 60 +++ .../service/impl/VGoodItemServiceImpl.java | 110 +++++ .../store/service/impl/VStoreServiceImpl.java | 115 +++++ .../java/com/ruoyi/system/domain/SysDept.java | 2 + .../com/ruoyi/system/domain/SysDictType.java | 1 + .../ruoyi/system/mapper/SysConfigMapper.java | 1 + 50 files changed, 2796 insertions(+), 382 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/Hello.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodItemController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VStoreController.java create mode 100644 ruoyi-admin/src/main/resources/templates/store/vGood/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vGood/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vGood/vGood.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vGoodItem/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vGoodItem/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vGoodItem/vGoodItem.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vQrcode/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vQrcode/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vQrcode/vQrcode.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vStore/add.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vStore/edit.html create mode 100644 ruoyi-admin/src/main/resources/templates/store/vStore/vStore.html create mode 100644 ruoyi-common/src/main/java/com/ruoyi/common/core/page/ExampleUtils.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/domain/VGoodItem.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/domain/VStore.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/mapper/VGoodItemMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/mapper/VStoreMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/service/IVGoodItemService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/service/IVStoreService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VGoodItemServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VStoreServiceImpl.java diff --git a/pom.xml b/pom.xml index ab9ba7d48..05215d5c6 100644 --- a/pom.xml +++ b/pom.xml @@ -2,42 +2,44 @@ - 4.0.0 - + 4.0.0 + com.ruoyi ruoyi 3.2 ruoyi - http://www.ruoyi.vip + http://www.ruoyi.vip 若依管理系统 - + - 3.2 - UTF-8 - UTF-8 - 1.8 - 1.4.0 - 2.0.0 - 1.3.2 - 1.1.13 - 1.19 - 2.3.2 - 2.7.0 - 1.2.5 - 3.9.1 - 2.5 - 1.3.3 - 1.9.3 - 1.11.3 - 3.17 - 1.7 - - - + 3.2 + UTF-8 + UTF-8 + 1.8 + 1.4.0 + 2.0.0 + 1.3.2 + 1.1.13 + 1.19 + 2.1.5 + 2.3.2 + 2.7.0 + 1.2.5 + 3.9.1 + 2.5 + 1.3.3 + 1.9.3 + 1.11.3 + 3.17 + 1.7 + 1.16.22 + + + - + org.springframework.boot @@ -46,182 +48,195 @@ pom import - + - - com.alibaba - druid-spring-boot-starter - ${druid.version} - - - - - com.github.penggle - kaptcha - ${kaptcha.version} - - - - - org.apache.shiro - shiro-core - ${shiro.version} - - - - - org.apache.shiro - shiro-spring - ${shiro.version} - - - - - org.apache.shiro - shiro-ehcache - ${shiro.version} - - - - - com.github.theborakompanioni - thymeleaf-extras-shiro - ${thymeleaf.extras.shiro.version} - - - - - eu.bitwalker - UserAgentUtils - ${bitwalker.version} - - - - - com.github.pagehelper - pagehelper-spring-boot-starter - ${pagehelper.boot.version} - - - - - com.github.oshi - oshi-core - ${oshi.version} - - - - - io.springfox - springfox-swagger2 - ${swagger.version} - - - - - io.springfox - springfox-swagger-ui - ${swagger.version} - - + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + + com.github.penggle + kaptcha + ${kaptcha.version} + + + + + org.apache.shiro + shiro-core + ${shiro.version} + + + + + org.apache.shiro + shiro-spring + ${shiro.version} + + + + + org.apache.shiro + shiro-ehcache + ${shiro.version} + + + + + com.github.theborakompanioni + thymeleaf-extras-shiro + ${thymeleaf.extras.shiro.version} + + + + + eu.bitwalker + UserAgentUtils + ${bitwalker.version} + + + + tk.mybatis + mapper-spring-boot-starter + ${mapper.version} + + + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.boot.version} + + + + + com.github.oshi + oshi-core + ${oshi.version} + + + + + io.springfox + springfox-swagger2 + ${swagger.version} + + + + + io.springfox + springfox-swagger-ui + ${swagger.version} + + - - commons-io - commons-io - ${commons.io.version} - - - - - commons-fileupload - commons-fileupload - ${commons.fileupload.version} - - - - - commons-beanutils - commons-beanutils - ${commons.beanutils.version} - - - - - org.jsoup - jsoup - ${jsoup.version} - - - - - org.apache.poi - poi-ooxml - ${poi.version} - - - - - org.apache.velocity - velocity - ${velocity.version} - - + + commons-io + commons-io + ${commons.io.version} + + + + + commons-fileupload + commons-fileupload + ${commons.fileupload.version} + + + + + commons-beanutils + commons-beanutils + ${commons.beanutils.version} + + + + + org.jsoup + jsoup + ${jsoup.version} + + + + + org.apache.poi + poi-ooxml + ${poi.version} + + + + + org.apache.velocity + velocity + ${velocity.version} + + - - com.ruoyi - ruoyi-quartz - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-generator - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-framework - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-system - ${ruoyi.version} - - - - - com.ruoyi - ruoyi-common - ${ruoyi.version} - - + + com.ruoyi + ruoyi-quartz + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-generator + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-framework + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-system + ${ruoyi.version} + + + + + com.ruoyi + ruoyi-common + ${ruoyi.version} + + + + org.projectlombok + lombok + provided + ${lombok.version} + + + - ruoyi-admin - ruoyi-framework - ruoyi-system - ruoyi-quartz - ruoyi-generator + ruoyi-admin + ruoyi-framework + ruoyi-system + ruoyi-quartz + ruoyi-generator ruoyi-common pom - + - - + - + org.apache.maven.plugins @@ -235,29 +250,29 @@ - - - public - aliyun nexus - http://maven.aliyun.com/nexus/content/groups/public/ - - true - - - + + + public + aliyun nexus + http://maven.aliyun.com/nexus/content/groups/public/ + + true + + + - - - public - aliyun nexus - http://maven.aliyun.com/nexus/content/groups/public/ - - true - - - false - - - + + + public + aliyun nexus + http://maven.aliyun.com/nexus/content/groups/public/ + + true + + + false + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/Hello.java b/ruoyi-admin/src/main/java/com/Hello.java new file mode 100644 index 000000000..8ee4f6d61 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/Hello.java @@ -0,0 +1,11 @@ +package com; + +/** + * @Author: Enzo + * @Date: 2019/3/27 11:23 + */ +public class Hello { + public static void main(String[] args) { + System.out.println(System.getProperty("user.timezone")); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index f72741ce0..754abad2d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -1,9 +1,9 @@ package com.ruoyi; -import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import tk.mybatis.spring.annotation.MapperScan; /** * 启动程序 @@ -18,15 +18,6 @@ public class RuoYiApplication { // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); - System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); + } } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodController.java new file mode 100644 index 000000000..26f078b4d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodController.java @@ -0,0 +1,127 @@ +package com.ruoyi.web.controller.store; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.store.domain.VGood; +import com.ruoyi.store.service.IVGoodService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; + +/** + * 商品管理 信息操作处理 + * + * @author Enzo + * @date 2019-03-25 + */ +@Controller +@RequestMapping("/store/vGood") +public class VGoodController extends BaseController +{ + private String prefix = "store/vGood"; + + @Autowired + private IVGoodService vGoodService; + + @RequiresPermissions("store:vGood:view") + @GetMapping() + public String vGood() + { + return prefix + "/vGood"; + } + + /** + * 查询商品管理列表 + */ + @RequiresPermissions("store:vGood:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(VGood vGood) + { + startPage(); + List list = vGoodService.selectVGoodList(vGood); + return getDataTable(list); + } + + + /** + * 导出商品管理列表 + */ + @RequiresPermissions("store:vGood:export") + @PostMapping("/export") + @ResponseBody + public AjaxResult export(VGood vGood) + { + List list = vGoodService.selectVGoodList(vGood); + ExcelUtil util = new ExcelUtil(VGood.class); + return util.exportExcel(list, "vGood"); + } + + /** + * 新增商品管理 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存商品管理 + */ + @RequiresPermissions("store:vGood:add") + @Log(title = "商品管理", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(VGood vGood) + { + return toAjax(vGoodService.insertVGood(vGood)); + } + + /** + * 修改商品管理 + */ + @GetMapping("/edit/{goodId}") + public String edit(@PathVariable("goodId") Long goodId, ModelMap mmap) + { + VGood vGood = vGoodService.selectVGoodById(goodId); + mmap.put("vGood", vGood); + return prefix + "/edit"; + } + + /** + * 修改保存商品管理 + */ + @RequiresPermissions("store:vGood:edit") + @Log(title = "商品管理", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(VGood vGood) + { + return toAjax(vGoodService.updateVGood(vGood)); + } + + /** + * 删除商品管理 + */ + @RequiresPermissions("store:vGood:remove") + @Log(title = "商品管理", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(vGoodService.deleteVGoodByIds(ids)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodItemController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodItemController.java new file mode 100644 index 000000000..3c103c9ca --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VGoodItemController.java @@ -0,0 +1,127 @@ +package com.ruoyi.web.controller.store; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.store.domain.VGoodItem; +import com.ruoyi.store.service.IVGoodItemService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; + +/** + * 商品分类 信息操作处理 + * + * @author Enzo + * @date 2019-03-25 + */ +@Controller +@RequestMapping("/store/vGoodItem") +public class VGoodItemController extends BaseController +{ + private String prefix = "store/vGoodItem"; + + @Autowired + private IVGoodItemService vGoodItemService; + + @RequiresPermissions("store:vGoodItem:view") + @GetMapping() + public String vGoodItem() + { + return prefix + "/vGoodItem"; + } + + /** + * 查询商品分类列表 + */ + @RequiresPermissions("store:vGoodItem:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(VGoodItem vGoodItem) + { + startPage(); + List list = vGoodItemService.selectVGoodItemList(vGoodItem); + return getDataTable(list); + } + + + /** + * 导出商品分类列表 + */ + @RequiresPermissions("store:vGoodItem:export") + @PostMapping("/export") + @ResponseBody + public AjaxResult export(VGoodItem vGoodItem) + { + List list = vGoodItemService.selectVGoodItemList(vGoodItem); + ExcelUtil util = new ExcelUtil(VGoodItem.class); + return util.exportExcel(list, "vGoodItem"); + } + + /** + * 新增商品分类 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存商品分类 + */ + @RequiresPermissions("store:vGoodItem:add") + @Log(title = "商品分类", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(VGoodItem vGoodItem) + { + return toAjax(vGoodItemService.insertVGoodItem(vGoodItem)); + } + + /** + * 修改商品分类 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + VGoodItem vGoodItem = vGoodItemService.selectVGoodItemById(id); + mmap.put("vGoodItem", vGoodItem); + return prefix + "/edit"; + } + + /** + * 修改保存商品分类 + */ + @RequiresPermissions("store:vGoodItem:edit") + @Log(title = "商品分类", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(VGoodItem vGoodItem) + { + return toAjax(vGoodItemService.updateVGoodItem(vGoodItem)); + } + + /** + * 删除商品分类 + */ + @RequiresPermissions("store:vGoodItem:remove") + @Log(title = "商品分类", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(vGoodItemService.deleteVGoodItemByIds(ids)); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VStoreController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VStoreController.java new file mode 100644 index 000000000..b75c4008d --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/store/VStoreController.java @@ -0,0 +1,127 @@ +package com.ruoyi.web.controller.store; + +import java.util.List; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.store.domain.VStore; +import com.ruoyi.store.service.IVStoreService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; + +/** + * 门店管理 信息操作处理 + * + * @author Enzo + * @date 2019-03-25 + */ +@Controller +@RequestMapping("/store/vStore") +public class VStoreController extends BaseController +{ + private String prefix = "store/vStore"; + + @Autowired + private IVStoreService vStoreService; + + @RequiresPermissions("store:vStore:view") + @GetMapping() + public String vStore() + { + return prefix + "/vStore"; + } + + /** + * 查询门店管理列表 + */ + @RequiresPermissions("store:vStore:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(VStore vStore) + { + startPage(); + List list = vStoreService.selectVStoreList(vStore); + return getDataTable(list); + } + + + /** + * 导出门店管理列表 + */ + @RequiresPermissions("store:vStore:export") + @PostMapping("/export") + @ResponseBody + public AjaxResult export(VStore vStore) + { + List list = vStoreService.selectVStoreList(vStore); + ExcelUtil util = new ExcelUtil(VStore.class); + return util.exportExcel(list, "vStore"); + } + + /** + * 新增门店管理 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存门店管理 + */ + @RequiresPermissions("store:vStore:add") + @Log(title = "门店管理", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(VStore vStore) + { + return toAjax(vStoreService.insertVStore(vStore)); + } + + /** + * 修改门店管理 + */ + @GetMapping("/edit/{storeId}") + public String edit(@PathVariable("storeId") Long storeId, ModelMap mmap) + { + VStore vStore = vStoreService.selectVStoreById(storeId); + mmap.put("vStore", vStore); + return prefix + "/edit"; + } + + /** + * 修改保存门店管理 + */ + @RequiresPermissions("store:vStore:edit") + @Log(title = "门店管理", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(VStore vStore) + { + return toAjax(vStoreService.updateVStore(vStore)); + } + + /** + * 删除门店管理 + */ + @RequiresPermissions("store:vStore:remove") + @Log(title = "门店管理", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(vStoreService.deleteVStoreByIds(ids)); + } + +} diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 18c0b11cc..0b5d7c54d 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -8,7 +8,7 @@ spring: master: url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: password + password: PAYcsroot@0402 # 从库数据源 slave: # 从数据源开关/默认关闭 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index c75c11666..9b5e664f6 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -14,10 +14,10 @@ ruoyi: # 开发环境配置 server: # 服务端口 - port: 80 + port: 8081 servlet: # 项目contextPath - context-path: / + context-path: /ry tomcat: # tomcat的URI编码 uri-encoding: UTF-8 @@ -47,6 +47,7 @@ spring: encoding: utf-8 # 禁用缓存 cache: false + check-template-location: true # 资源信息 messages: # 国际化资源文件路径 @@ -93,7 +94,7 @@ shiro: # 首页地址 indexUrl: /index # 验证码开关 - captchaEnabled: true + captchaEnabled: false # 验证码类型 math 数组计算 char 字符 captchaType: math cookie: @@ -121,3 +122,10 @@ xss: excludes: /system/notice/* # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* + + # 通用mapper 配置 +mapper: + mappers: + - tk.mybatis.mapper.common.Mapper + not-empty: true + diff --git a/ruoyi-admin/src/main/resources/templates/store/vGood/add.html b/ruoyi-admin/src/main/resources/templates/store/vGood/add.html new file mode 100644 index 000000000..7393a82f3 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vGood/add.html @@ -0,0 +1,107 @@ + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vGood/edit.html b/ruoyi-admin/src/main/resources/templates/store/vGood/edit.html new file mode 100644 index 000000000..6e65c7483 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vGood/edit.html @@ -0,0 +1,109 @@ + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vGood/vGood.html b/ruoyi-admin/src/main/resources/templates/store/vGood/vGood.html new file mode 100644 index 000000000..dd3698579 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vGood/vGood.html @@ -0,0 +1,207 @@ + + + + + + +
+
+
+
+
+
    +
  • + 商品名称: +
  • + +
  • + 商品价格: +
  • + +
  • + 单位: +
  • + +
  • + 商品图片: +
  • + +
  • + 状态: +
  • +
  • + 商品简介: +
  • + +
  • + + + - + +
  • +
  • + 分类ID: +
  • + +
  • + 门店ID: +
  • + +
  • + 删除状态: +
  • +
  • + 详细描述: +
  • + +
  • + 推荐: +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/store/vGoodItem/add.html b/ruoyi-admin/src/main/resources/templates/store/vGoodItem/add.html new file mode 100644 index 000000000..801ded238 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vGoodItem/add.html @@ -0,0 +1,59 @@ + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vGoodItem/edit.html b/ruoyi-admin/src/main/resources/templates/store/vGoodItem/edit.html new file mode 100644 index 000000000..d78aec3dd --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vGoodItem/edit.html @@ -0,0 +1,61 @@ + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vGoodItem/vGoodItem.html b/ruoyi-admin/src/main/resources/templates/store/vGoodItem/vGoodItem.html new file mode 100644 index 000000000..5e9b500c6 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vGoodItem/vGoodItem.html @@ -0,0 +1,126 @@ + + + + + + +
+
+
+
+
+
    +
  • + 类别名称: +
  • + +
  • + 分类描述: +
  • + +
  • + + + - + +
  • +
  • + 门店ID: +
  • + +
  • + 排序: +
  • + +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/store/vQrcode/add.html b/ruoyi-admin/src/main/resources/templates/store/vQrcode/add.html new file mode 100644 index 000000000..9bc1b19c2 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vQrcode/add.html @@ -0,0 +1,59 @@ + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vQrcode/edit.html b/ruoyi-admin/src/main/resources/templates/store/vQrcode/edit.html new file mode 100644 index 000000000..8b4c71e13 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vQrcode/edit.html @@ -0,0 +1,61 @@ + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vQrcode/vQrcode.html b/ruoyi-admin/src/main/resources/templates/store/vQrcode/vQrcode.html new file mode 100644 index 000000000..be864cc77 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vQrcode/vQrcode.html @@ -0,0 +1,126 @@ + + + + + + +
+
+
+
+
+
    +
  • + 门店ID: +
  • + +
  • + 编码: +
  • + +
  • + 二维码地址: +
  • + +
  • + 二维码名称: +
  • + +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/store/vStore/add.html b/ruoyi-admin/src/main/resources/templates/store/vStore/add.html new file mode 100644 index 000000000..1c125ac78 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vStore/add.html @@ -0,0 +1,91 @@ + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vStore/edit.html b/ruoyi-admin/src/main/resources/templates/store/vStore/edit.html new file mode 100644 index 000000000..e12aaf151 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vStore/edit.html @@ -0,0 +1,93 @@ + + + + + +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ + + diff --git a/ruoyi-admin/src/main/resources/templates/store/vStore/vStore.html b/ruoyi-admin/src/main/resources/templates/store/vStore/vStore.html new file mode 100644 index 000000000..5d32be2fa --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/store/vStore/vStore.html @@ -0,0 +1,179 @@ + + + + + + +
+
+
+
+
+
    +
  • + 门店编号: +
  • + +
  • + 门店名称: +
  • + +
  • + 门店联系人: +
  • + +
  • + 门店 联系电话: +
  • + +
  • + 注册的邮箱: +
  • + +
  • + 门店LOGO: +
  • + +
  • + 门店地址: +
  • + +
  • + 门店状态: +
  • +
  • + + + - + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/user/user.html b/ruoyi-admin/src/main/resources/templates/system/user/user.html index 74e88d7e8..72d7831f0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/user.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/user.html @@ -135,10 +135,15 @@ field: 'userName', title: '用户名称' }, + { field: 'dept.deptName', title: '部门' }, + { + field: '性别', + title: '用户名称' + }, { field: 'email', title: '邮箱', diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 05136e964..61ae681d4 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -88,6 +88,17 @@ javax.servlet javax.servlet-api + + + tk.mybatis + mapper-spring-boot-starter + + + + org.projectlombok + lombok + compile + diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index 0fc68beb5..4dde01ad7 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -6,6 +6,8 @@ import java.util.HashMap; import java.util.Map; import com.fasterxml.jackson.annotation.JsonFormat; +import javax.persistence.Transient; + /** * Entity基类 * @@ -16,23 +18,29 @@ public class BaseEntity implements Serializable private static final long serialVersionUID = 1L; /** 搜索值 */ + @Transient private String searchValue; /** 创建者 */ + @Transient private String createBy; /** 创建时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Transient private Date createTime; /** 更新者 */ + @Transient private String updateBy; /** 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Transient private Date updateTime; /** 备注 */ + @Transient private String remark; /** 请求参数 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/ExampleUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/ExampleUtils.java new file mode 100644 index 000000000..5c108ccd1 --- /dev/null +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/ExampleUtils.java @@ -0,0 +1,40 @@ +package com.ruoyi.common.core.page; + +import org.apache.commons.lang3.StringUtils; +import tk.mybatis.mapper.entity.Example; + +import java.util.List; + +/** + * @Author: Enzo + * @Date: 2019/3/25 14:48 + */ +public class ExampleUtils { + + public static void andEqualTo(Example.Criteria criteria, String filed, Object value) { + if (null != value && StringUtils.isNotBlank(value.toString())) { + criteria.andEqualTo(filed, value); + } + } + + public static void andBetweenDateToDate(Example.Criteria criteria, String filed, Object fromDate, Object endDate) { + if (null != fromDate && StringUtils.isNotBlank(fromDate.toString()) + && null != endDate && StringUtils.isNotBlank(endDate.toString())) { + + fromDate = fromDate.toString().contains(":") ? fromDate : fromDate + " 00:00:00"; + endDate = endDate.toString().contains(":") ? endDate : endDate + " 23:59:59"; + + criteria.andBetween(filed, fromDate, endDate); + } + } + + public static void inField(Example.Criteria criteria, String filed, List values) { + criteria.andIn(filed, values); + } + + public static void andLikeTo(Example.Criteria criteria, String field, String value) { + if (null != value && StringUtils.isNotBlank(value.toString())) { + criteria.andLike(field, String.format("%%%s%%", value)); + } + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java index 9dd076d04..604045b3d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java @@ -5,6 +5,8 @@ import java.math.BigInteger; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.text.NumberFormat; +import java.util.Arrays; +import java.util.List; import java.util.Set; import com.ruoyi.common.utils.StringUtils; @@ -366,6 +368,18 @@ public class Convert return toStrArray(",", str); } + + /** + * 转换为String数组
+ * + * @param str 被转换的值 + * @return 结果 + */ + public static List toList(String str) + { + return Arrays.asList(toStrArray(",", str)); + } + /** * 转换为String数组
* diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/AddressUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/AddressUtils.java index 437137dea..d44d42356 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/AddressUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/AddressUtils.java @@ -9,43 +9,42 @@ import com.ruoyi.common.utils.http.HttpUtils; /** * 获取地址类 - * + * * @author ruoyi */ -public class AddressUtils -{ +public class AddressUtils { private static final Logger log = LoggerFactory.getLogger(AddressUtils.class); - public static final String IP_URL = "http://ip.taobao.com/service/getIpInfo.php"; + public static final String IP_URL = "https://api.map.baidu.com/location/ip"; + public static final String ak = "hNGEz4KKVtRLkM1zrUKDjGRv"; - public static String getRealAddressByIP(String ip) - { + public static String getRealAddressByIP(String ip) { String address = "XX XX"; // 内网不查询 - if (IpUtils.internalIp(ip)) - { + if (IpUtils.internalIp(ip)) { return "内网IP"; } - if (Global.isAddressEnabled()) - { - String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip); - if (StringUtils.isEmpty(rspStr)) - { + if (Global.isAddressEnabled()) { + + if (ip.contains("," )) { + ip = ip.split("," )[0]; + } + String rspStr = HttpUtils.sendPost(IP_URL, "ip=" + ip + "&ak=" + ak); + if (StringUtils.isEmpty(rspStr)) { log.error("获取地理位置异常 {}", ip); return address; } JSONObject obj; - try - { + try { obj = JSON.unmarshal(rspStr, JSONObject.class); - JSONObject data = obj.getObj("data"); - String region = data.getStr("region"); - String city = data.getStr("city"); - address = region + " " + city; - } - catch (Exception e) - { + log.info("地址位置接口返回信息:{}", rspStr); +// JSONObject data = obj.getObj("data"); + address = obj.getStr("address" ); +// String region = data.getStr("region"); +// String city = data.getStr("city"); +// address = region + " " + city; + } catch (Exception e) { log.error("获取地理位置异常 {}", ip); } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/IpUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/IpUtils.java index b9cfa028f..bfe0d8674 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/IpUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/IpUtils.java @@ -6,51 +6,41 @@ import javax.servlet.http.HttpServletRequest; /** * 获取IP方法 - * + * * @author ruoyi */ -public class IpUtils -{ - public static String getIpAddr(HttpServletRequest request) - { - if (request == null) - { +public class IpUtils { + public static String getIpAddr(HttpServletRequest request) { + if (request == null) { return "unknown"; } - String ip = request.getHeader("x-forwarded-for"); - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("Proxy-Client-IP"); + String ip = request.getHeader("x-forwarded-for" ); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP" ); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("X-Forwarded-For"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("X-Forwarded-For" ); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("WL-Proxy-Client-IP"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP" ); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { - ip = request.getHeader("X-Real-IP"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("X-Real-IP" ); } - if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) - { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; } - public static boolean internalIp(String ip) - { + public static boolean internalIp(String ip) { byte[] addr = textToNumericFormatV4(ip); return internalIp(addr) || "127.0.0.1".equals(ip); } - private static boolean internalIp(byte[] addr) - { + private static boolean internalIp(byte[] addr) { final byte b0 = addr[0]; final byte b1 = addr[1]; // 10.x.x.x/8 @@ -62,18 +52,15 @@ public class IpUtils // 192.168.x.x/16 final byte SECTION_5 = (byte) 0xC0; final byte SECTION_6 = (byte) 0xA8; - switch (b0) - { + switch (b0) { case SECTION_1: return true; case SECTION_2: - if (b1 >= SECTION_3 && b1 <= SECTION_4) - { + if (b1 >= SECTION_3 && b1 <= SECTION_4) { return true; } case SECTION_5: - switch (b1) - { + switch (b1) { case SECTION_6: return true; } @@ -84,25 +71,24 @@ public class IpUtils /** * 将IPv4地址转换成字节 - * + * * @param text IPv4地址 * @return byte 字节 */ - public static byte[] textToNumericFormatV4(String text) - { - if (text.length() == 0) - { + public static byte[] textToNumericFormatV4(String text) { + if (text.length() == 0) { return null; } + if (text.contains("," )) { + text = text.split("," )[0]; + } byte[] bytes = new byte[4]; String[] elements = text.split("\\.", -1); - try - { + try { long l; int i; - switch (elements.length) - { + switch (elements.length) { case 1: l = Long.parseLong(elements[0]); if ((l < 0L) || (l > 4294967295L)) @@ -125,8 +111,7 @@ public class IpUtils bytes[3] = (byte) (int) (l & 0xFF); break; case 3: - for (i = 0; i < 2; ++i) - { + for (i = 0; i < 2; ++i) { l = Integer.parseInt(elements[i]); if ((l < 0L) || (l > 255L)) return null; @@ -139,8 +124,7 @@ public class IpUtils bytes[3] = (byte) (int) (l & 0xFF); break; case 4: - for (i = 0; i < 4; ++i) - { + for (i = 0; i < 4; ++i) { l = Integer.parseInt(elements[i]); if ((l < 0L) || (l > 255L)) return null; @@ -150,34 +134,24 @@ public class IpUtils default: return null; } - } - catch (NumberFormatException e) - { + } catch (NumberFormatException e) { return null; } return bytes; } - public static String getHostIp() - { - try - { + public static String getHostIp() { + try { return InetAddress.getLocalHost().getHostAddress(); - } - catch (UnknownHostException e) - { + } catch (UnknownHostException e) { } return "127.0.0.1"; } - public static String getHostName() - { - try - { + public static String getHostName() { + try { return InetAddress.getLocalHost().getHostName(); - } - catch (UnknownHostException e) - { + } catch (UnknownHostException e) { } return "未知"; } diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java index b288a6ada..3388c84d3 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java @@ -3,6 +3,7 @@ package com.ruoyi.generator.controller; import java.io.IOException; import java.util.List; import javax.servlet.http.HttpServletResponse; + import org.apache.commons.io.IOUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; @@ -22,13 +23,12 @@ import com.ruoyi.generator.service.IGenService; /** * 代码生成 操作处理 - * + * * @author ruoyi */ @Controller @RequestMapping("/tool/gen") -public class GenController extends BaseController -{ +public class GenController extends BaseController { private String prefix = "tool/gen"; @Autowired @@ -36,16 +36,14 @@ public class GenController extends BaseController @RequiresPermissions("tool:gen:view") @GetMapping() - public String gen() - { + public String gen() { return prefix + "/gen"; } @RequiresPermissions("tool:gen:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(TableInfo tableInfo) - { + public TableDataInfo list(TableInfo tableInfo) { startPage(); List list = genService.selectTableList(tableInfo); return getDataTable(list); @@ -57,11 +55,10 @@ public class GenController extends BaseController @RequiresPermissions("tool:gen:code") @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/genCode/{tableName}") - public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException - { + public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { byte[] data = genService.generatorCode(tableName); response.reset(); - response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\""); + response.setHeader("Content-Disposition", "attachment; filename=\"" + tableName + ".zip\""); response.addHeader("Content-Length", "" + data.length); response.setContentType("application/octet-stream; charset=UTF-8"); @@ -75,8 +72,7 @@ public class GenController extends BaseController @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/batchGenCode") @ResponseBody - public void batchGenCode(HttpServletResponse response, String tables) throws IOException - { + public void batchGenCode(HttpServletResponse response, String tables) throws IOException { String[] tableNames = Convert.toStrArray(tables); byte[] data = genService.generatorCode(tableNames); response.reset(); diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/ColumnInfo.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/ColumnInfo.java index c4032a535..0c4632bfb 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/ColumnInfo.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/ColumnInfo.java @@ -34,6 +34,11 @@ public class ColumnInfo /** 执行计划(包含了与索引相关的一些细节信息) */ private String extra; + /** 当PRI值时为这个字段为主键 */ + private String columnKey; + + private boolean iskey; + public String getColumnName() { return columnName; @@ -122,4 +127,21 @@ public class ColumnInfo { this.configInfo = configInfo; } + + public String getColumnKey() { + return columnKey; + } + + public void setColumnKey(String columnKey) { + this.columnKey = columnKey; + } + + public boolean isIskey() { + if("PRI".equals(this.getColumnKey())){ + return true; + }else{ + return false; + } + + } } diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/TableInfo.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/TableInfo.java index d6219249f..9ec13fa0b 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/TableInfo.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/TableInfo.java @@ -31,6 +31,8 @@ public class TableInfo extends BaseEntity /** 类名(第一个字母小写) */ private String classname; + + public String getTableName() { return tableName; @@ -100,4 +102,6 @@ public class TableInfo extends BaseEntity { this.primaryKey = primaryKey; } + + } diff --git a/ruoyi-generator/src/main/resources/generator.yml b/ruoyi-generator/src/main/resources/generator.yml index 9e76f23f4..b90834d40 100644 --- a/ruoyi-generator/src/main/resources/generator.yml +++ b/ruoyi-generator/src/main/resources/generator.yml @@ -2,9 +2,9 @@ # 代码生成 gen: # 作者 - author: ruoyi + author: Enzo # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool - packageName: com.ruoyi.system + packageName: com.ruoyi.store # 自动去除表前缀,默认是true autoRemovePre: true # 表前缀(类名不会包含表前缀) diff --git a/ruoyi-generator/src/main/resources/mapper/generator/GenMapper.xml b/ruoyi-generator/src/main/resources/mapper/generator/GenMapper.xml index 45bf4bd8a..15c119288 100644 --- a/ruoyi-generator/src/main/resources/mapper/generator/GenMapper.xml +++ b/ruoyi-generator/src/main/resources/mapper/generator/GenMapper.xml @@ -9,12 +9,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -45,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/ruoyi-generator/src/main/resources/vm/html/edit.html.vm b/ruoyi-generator/src/main/resources/vm/html/edit.html.vm index be5976aa5..92a2ded97 100644 --- a/ruoyi-generator/src/main/resources/vm/html/edit.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/edit.html.vm @@ -5,14 +5,21 @@
- + #foreach($column in $columns) +#if($column.iskey) + +#end #if($column.columnName != $primaryKey.columnName) #if(!${column.configInfo})
- +#if(${column.attrType} == "Date") + +#else + +#end
#else diff --git a/ruoyi-generator/src/main/resources/vm/html/list.html.vm b/ruoyi-generator/src/main/resources/vm/html/list.html.vm index b339642b6..3f2b52fe5 100644 --- a/ruoyi-generator/src/main/resources/vm/html/list.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/list.html.vm @@ -72,7 +72,7 @@ var prefix = ctx + "${moduleName}/${classname}"; #foreach($column in $columns) #if(${column.configInfo} && ${column.configInfo.type} == 'dict') - var datas = [[${@dict.getType('${column.configInfo.value}')}]]; + var ${column.attrname}_datas = [[${@dict.getType('${column.configInfo.value}')}]]; #end #end @@ -89,7 +89,7 @@ checkbox: true }, #foreach($column in $columns) -#if($column.columnName == $primaryKey.columnName) +#if($column.iskey) { field : '${column.attrname}', title : '${column.columnComment}', @@ -102,7 +102,7 @@ title : '${column.columnComment}', sortable: true, formatter: function(value, row, index) { - return $.table.selectDictLabel(datas, value); + return $.table.selectDictLabel(${column.attrname}_datas, value); } }, #else diff --git a/ruoyi-generator/src/main/resources/vm/java/Mapper.java.vm b/ruoyi-generator/src/main/resources/vm/java/Mapper.java.vm index 076e413de..ce6234012 100644 --- a/ruoyi-generator/src/main/resources/vm/java/Mapper.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/Mapper.java.vm @@ -1,7 +1,10 @@ package ${package}.mapper; import ${package}.domain.${className}; -import java.util.List; +import java.util.List; + +import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; /** * ${tableComment} 数据层 @@ -9,15 +12,16 @@ import java.util.List; * @author ${author} * @date ${datetime} */ -public interface ${className}Mapper +@Repository +public interface ${className}Mapper extends Mapper<${className}> { /** * 查询${tableComment}信息 * - * @param ${primaryKey.attrname} ${tableComment}ID + * @param ${primaryKey.attrname} ${tableComment} * @return ${tableComment}信息 */ - public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); + ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); /** * 查询${tableComment}列表 @@ -25,7 +29,7 @@ public interface ${className}Mapper * @param ${classname} ${tableComment}信息 * @return ${tableComment}集合 */ - public List<${className}> select${className}List(${className} ${classname}); + List<${className}> select${className}List(${className} ${classname}); /** * 新增${tableComment} @@ -33,7 +37,7 @@ public interface ${className}Mapper * @param ${classname} ${tableComment}信息 * @return 结果 */ - public int insert${className}(${className} ${classname}); + int insert${className}(${className} ${classname}); /** * 修改${tableComment} @@ -41,7 +45,7 @@ public interface ${className}Mapper * @param ${classname} ${tableComment}信息 * @return 结果 */ - public int update${className}(${className} ${classname}); + int update${className}(${className} ${classname}); /** * 删除${tableComment} @@ -49,7 +53,7 @@ public interface ${className}Mapper * @param ${primaryKey.attrname} ${tableComment}ID * @return 结果 */ - public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); + int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); /** * 批量删除${tableComment} @@ -57,6 +61,6 @@ public interface ${className}Mapper * @param ${primaryKey.attrname}s 需要删除的数据ID * @return 结果 */ - public int delete${className}ByIds(String[] ${primaryKey.attrname}s); + int delete${className}ByIds(String[] ${primaryKey.attrname}s); } \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/vm/java/Service.java.vm b/ruoyi-generator/src/main/resources/vm/java/Service.java.vm index 7276e6b90..72e2560d8 100644 --- a/ruoyi-generator/src/main/resources/vm/java/Service.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/Service.java.vm @@ -17,7 +17,7 @@ public interface I${className}Service * @param ${primaryKey.attrname} ${tableComment}ID * @return ${tableComment}信息 */ - public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); + ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); /** * 查询${tableComment}列表 @@ -25,7 +25,7 @@ public interface I${className}Service * @param ${classname} ${tableComment}信息 * @return ${tableComment}集合 */ - public List<${className}> select${className}List(${className} ${classname}); + List<${className}> select${className}List(${className} ${classname}); /** * 新增${tableComment} @@ -33,7 +33,7 @@ public interface I${className}Service * @param ${classname} ${tableComment}信息 * @return 结果 */ - public int insert${className}(${className} ${classname}); + int insert${className}(${className} ${classname}); /** * 修改${tableComment} @@ -41,7 +41,7 @@ public interface I${className}Service * @param ${classname} ${tableComment}信息 * @return 结果 */ - public int update${className}(${className} ${classname}); + int update${className}(${className} ${classname}); /** * 删除${tableComment}信息 @@ -49,6 +49,12 @@ public interface I${className}Service * @param ids 需要删除的数据ID * @return 结果 */ - public int delete${className}ByIds(String ids); - + int delete${className}ByIds(String ids); + + + /** + * 删除${tableComment} 单条信息 + * @return + */ + int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname}); } diff --git a/ruoyi-generator/src/main/resources/vm/java/ServiceImpl.java.vm b/ruoyi-generator/src/main/resources/vm/java/ServiceImpl.java.vm index c0df374b1..af4e6fd3b 100644 --- a/ruoyi-generator/src/main/resources/vm/java/ServiceImpl.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/ServiceImpl.java.vm @@ -1,83 +1,111 @@ package ${package}.service.impl; import java.util.List; + +import com.ruoyi.common.core.page.ExampleUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import ${package}.mapper.${className}Mapper; import ${package}.domain.${className}; import ${package}.service.I${className}Service; import com.ruoyi.common.core.text.Convert; +import tk.mybatis.mapper.entity.Example; /** * ${tableComment} 服务层实现 - * + * * @author ${author} * @date ${datetime} */ @Service -public class ${className}ServiceImpl implements I${className}Service +public class ${className}ServiceImpl implements I${className}Service { @Autowired private ${className}Mapper ${classname}Mapper; /** * 查询${tableComment}信息 - * + * * @param ${primaryKey.attrname} ${tableComment}ID * @return ${tableComment}信息 */ @Override public ${className} select${className}ById(${primaryKey.attrType} ${primaryKey.attrname}) { - return ${classname}Mapper.select${className}ById(${primaryKey.attrname}); + return ${classname}Mapper.selectByPrimaryKey(${primaryKey.attrname}); } - + /** * 查询${tableComment}列表 - * + * * @param ${classname} ${tableComment}信息 * @return ${tableComment}集合 */ @Override public List<${className}> select${className}List(${className} ${classname}) { - return ${classname}Mapper.select${className}List(${classname}); + Example example = new Example(${className}.class); + Example.Criteria criteria = example.createCriteria(); + +#foreach ($column in $columns) +#if(${column.attrType} != "Date") + ExampleUtils.andEqualTo(criteria, "${column.attrname}", ${classname}.get${column.attrName}()); +#elseif(${column.attrType} == "Date") + ExampleUtils.andBetweenDateToDate(criteria, "${column.attrname}", ${classname}.getParams().get("begin${column.attrName}"),${classname}.getParams().get("end${column.attrName}")); +#end +#end + + return ${classname}Mapper.selectByExample(example); } - + /** * 新增${tableComment} - * + * * @param ${classname} ${tableComment}信息 * @return 结果 */ @Override public int insert${className}(${className} ${classname}) { - return ${classname}Mapper.insert${className}(${classname}); + return ${classname}Mapper.insertSelective(${classname}); } - + /** * 修改${tableComment} - * + * * @param ${classname} ${tableComment}信息 * @return 结果 */ @Override public int update${className}(${className} ${classname}) { - return ${classname}Mapper.update${className}(${classname}); + return ${classname}Mapper.updateByPrimaryKeySelective(${classname}); } /** * 删除${tableComment}对象 - * + * * @param ids 需要删除的数据ID * @return 结果 */ @Override public int delete${className}ByIds(String ids) { - return ${classname}Mapper.delete${className}ByIds(Convert.toStrArray(ids)); + Example example = new Example(${className}.class); + Example.Criteria criteria = example.createCriteria(); + criteria.andIn("${primaryKey.attrname}",Convert.toList(ids)); + return ${classname}Mapper.deleteByExample(example); } - + + + /** + * 删除${tableComment} 单条信息 + * @param ${primaryKey.attrname} 删除的主键ID + * @return + */ + @Override + public int delete${className}ById(${primaryKey.attrType} ${primaryKey.attrname}){ + return ${classname}Mapper.deleteByPrimaryKey(${primaryKey.attrname}); + } + } diff --git a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm index 7184ab5a2..c45e27a4c 100644 --- a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -1,8 +1,13 @@ package ${package}.domain; +import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.domain.BaseEntity; +import lombok.EqualsAndHashCode; + +import javax.persistence.Column; +import javax.persistence.Id; +import javax.persistence.Table; + #foreach ($column in $columns) #if($column.attrType == 'Date') import java.util.Date; @@ -16,32 +21,24 @@ import java.util.Date; * @author ${author} * @date ${datetime} */ +@EqualsAndHashCode(callSuper = true) +@Data +@Table(name = "${tableName}") public class ${className} extends BaseEntity { private static final long serialVersionUID = 1L; #foreach ($column in $columns) - /** $column.columnComment */ + + /**字段描述 $column.columnComment */ +#if($column.iskey) + @Id +#end + @Column(name = "$column.columnName") private $column.attrType $column.attrname; #end -#foreach ($column in $columns) - public void set${column.attrName}($column.attrType $column.attrname) - { - this.$column.attrname = $column.attrname; - } - public $column.attrType get${column.attrName}() - { - return $column.attrname; - } -#end - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) -#foreach ($column in $columns) - .append("${column.attrname}", get${column.attrName}()) -#end - .toString(); - } + } diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index c886bd260..4b1bc4415 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -28,7 +28,9 @@ com.ruoyi ruoyi-common - + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/domain/VGoodItem.java b/ruoyi-system/src/main/java/com/ruoyi/store/domain/VGoodItem.java new file mode 100644 index 000000000..966a19301 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/domain/VGoodItem.java @@ -0,0 +1,55 @@ +package com.ruoyi.store.domain; +import lombok.Data; + +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.EqualsAndHashCode; + +import javax.persistence.Column; +import javax.persistence.Id; +import javax.persistence.Table; + +import java.util.Date; + +/** + * 商品分类表 v_good_item + * + * @author Enzo + * @date 2019-03-25 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Table(name = "v_good_item") +public class VGoodItem extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /**字段描述 主键ID */ + @Id + @Column(name = "id") + private Long id; + + /**字段描述 类别名称 */ + @Column(name = "item_name") + private String itemName; + + /**字段描述 分类描述 */ + @Column(name = "item_desc") + private String itemDesc; + + /**字段描述 创建时间 */ + @Column(name = "ctime") + private Date ctime; + + /**字段描述 门店ID */ + @Column(name = "m_storeid") + private Long mStoreid; + + /**字段描述 排序 */ + @Column(name = "sore") + private Integer sore; + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/domain/VStore.java b/ruoyi-system/src/main/java/com/ruoyi/store/domain/VStore.java new file mode 100644 index 000000000..c170f4d9f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/domain/VStore.java @@ -0,0 +1,75 @@ +package com.ruoyi.store.domain; +import lombok.Data; + +import com.ruoyi.common.core.domain.BaseEntity; +import lombok.EqualsAndHashCode; + +import javax.persistence.Column; +import javax.persistence.Id; +import javax.persistence.Table; + +import java.util.Date; + +/** + * 门店管理表 v_store + * + * @author Enzo + * @date 2019-03-25 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@Table(name = "v_store") +public class VStore extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + + /**字段描述 ID */ + @Id + @Column(name = "store_id") + private Long storeId; + + /**字段描述 门店编号 */ + @Column(name = "store_code") + private String storeCode; + + /**字段描述 门店名称 */ + @Column(name = "store_name") + private String storeName; + + /**字段描述 门店联系人 */ + @Column(name = "store_people") + private String storePeople; + + /**字段描述 门店 联系电话 */ + @Column(name = "store_tel") + private String storeTel; + + /**字段描述 注册的邮箱 */ + @Column(name = "store_email") + private String storeEmail; + + /**字段描述 门店LOGO */ + @Column(name = "store_logo") + private String storeLogo; + + /**字段描述 门店地址 */ + @Column(name = "store_address") + private String storeAddress; + + /**字段描述 门店状态 */ + @Column(name = "store_status") + private Integer storeStatus; + + /**字段描述 创建时间 */ + @Column(name = "ctime") + private Date ctime; + + /**字段描述 门店到期时间 */ + @Column(name = "stime") + private Date stime; + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/mapper/VGoodItemMapper.java b/ruoyi-system/src/main/java/com/ruoyi/store/mapper/VGoodItemMapper.java new file mode 100644 index 000000000..440f764ed --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/mapper/VGoodItemMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.store.mapper; + +import com.ruoyi.store.domain.VGoodItem; +import java.util.List; + +import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; + +/** + * 商品分类 数据层 + * + * @author Enzo + * @date 2019-03-25 + */ +@Repository +public interface VGoodItemMapper extends Mapper +{ + /** + * 查询商品分类信息 + * + * @param id 商品分类 + * @return 商品分类信息 + */ + VGoodItem selectVGoodItemById(Long id); + + /** + * 查询商品分类列表 + * + * @param vGoodItem 商品分类信息 + * @return 商品分类集合 + */ + List selectVGoodItemList(VGoodItem vGoodItem); + + /** + * 新增商品分类 + * + * @param vGoodItem 商品分类信息 + * @return 结果 + */ + int insertVGoodItem(VGoodItem vGoodItem); + + /** + * 修改商品分类 + * + * @param vGoodItem 商品分类信息 + * @return 结果 + */ + int updateVGoodItem(VGoodItem vGoodItem); + + /** + * 删除商品分类 + * + * @param id 商品分类ID + * @return 结果 + */ + int deleteVGoodItemById(Long id); + + /** + * 批量删除商品分类 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteVGoodItemByIds(String[] ids); + +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/mapper/VStoreMapper.java b/ruoyi-system/src/main/java/com/ruoyi/store/mapper/VStoreMapper.java new file mode 100644 index 000000000..871fc57ef --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/mapper/VStoreMapper.java @@ -0,0 +1,66 @@ +package com.ruoyi.store.mapper; + +import com.ruoyi.store.domain.VStore; +import java.util.List; + +import org.springframework.stereotype.Repository; +import tk.mybatis.mapper.common.Mapper; + +/** + * 门店管理 数据层 + * + * @author Enzo + * @date 2019-03-25 + */ +@Repository +public interface VStoreMapper extends Mapper +{ + /** + * 查询门店管理信息 + * + * @param storeId 门店管理 + * @return 门店管理信息 + */ + VStore selectVStoreById(Long storeId); + + /** + * 查询门店管理列表 + * + * @param vStore 门店管理信息 + * @return 门店管理集合 + */ + List selectVStoreList(VStore vStore); + + /** + * 新增门店管理 + * + * @param vStore 门店管理信息 + * @return 结果 + */ + int insertVStore(VStore vStore); + + /** + * 修改门店管理 + * + * @param vStore 门店管理信息 + * @return 结果 + */ + int updateVStore(VStore vStore); + + /** + * 删除门店管理 + * + * @param storeId 门店管理ID + * @return 结果 + */ + int deleteVStoreById(Long storeId); + + /** + * 批量删除门店管理 + * + * @param storeIds 需要删除的数据ID + * @return 结果 + */ + int deleteVStoreByIds(String[] storeIds); + +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/service/IVGoodItemService.java b/ruoyi-system/src/main/java/com/ruoyi/store/service/IVGoodItemService.java new file mode 100644 index 000000000..17fbf226f --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/service/IVGoodItemService.java @@ -0,0 +1,60 @@ +package com.ruoyi.store.service; + +import com.ruoyi.store.domain.VGoodItem; +import java.util.List; + +/** + * 商品分类 服务层 + * + * @author Enzo + * @date 2019-03-25 + */ +public interface IVGoodItemService +{ + /** + * 查询商品分类信息 + * + * @param id 商品分类ID + * @return 商品分类信息 + */ + VGoodItem selectVGoodItemById(Long id); + + /** + * 查询商品分类列表 + * + * @param vGoodItem 商品分类信息 + * @return 商品分类集合 + */ + List selectVGoodItemList(VGoodItem vGoodItem); + + /** + * 新增商品分类 + * + * @param vGoodItem 商品分类信息 + * @return 结果 + */ + int insertVGoodItem(VGoodItem vGoodItem); + + /** + * 修改商品分类 + * + * @param vGoodItem 商品分类信息 + * @return 结果 + */ + int updateVGoodItem(VGoodItem vGoodItem); + + /** + * 删除商品分类信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteVGoodItemByIds(String ids); + + + /** + * 删除商品分类 单条信息 + * @return + */ + int deleteVGoodItemById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/service/IVStoreService.java b/ruoyi-system/src/main/java/com/ruoyi/store/service/IVStoreService.java new file mode 100644 index 000000000..878daa8f1 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/service/IVStoreService.java @@ -0,0 +1,60 @@ +package com.ruoyi.store.service; + +import com.ruoyi.store.domain.VStore; +import java.util.List; + +/** + * 门店管理 服务层 + * + * @author Enzo + * @date 2019-03-25 + */ +public interface IVStoreService +{ + /** + * 查询门店管理信息 + * + * @param storeId 门店管理ID + * @return 门店管理信息 + */ + VStore selectVStoreById(Long storeId); + + /** + * 查询门店管理列表 + * + * @param vStore 门店管理信息 + * @return 门店管理集合 + */ + List selectVStoreList(VStore vStore); + + /** + * 新增门店管理 + * + * @param vStore 门店管理信息 + * @return 结果 + */ + int insertVStore(VStore vStore); + + /** + * 修改门店管理 + * + * @param vStore 门店管理信息 + * @return 结果 + */ + int updateVStore(VStore vStore); + + /** + * 删除门店管理信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + int deleteVStoreByIds(String ids); + + + /** + * 删除门店管理 单条信息 + * @return + */ + int deleteVStoreById(Long storeId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VGoodItemServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VGoodItemServiceImpl.java new file mode 100644 index 000000000..a512ea663 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VGoodItemServiceImpl.java @@ -0,0 +1,110 @@ +package com.ruoyi.store.service.impl; + +import java.util.List; + +import com.ruoyi.common.core.page.ExampleUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.store.mapper.VGoodItemMapper; +import com.ruoyi.store.domain.VGoodItem; +import com.ruoyi.store.service.IVGoodItemService; +import com.ruoyi.common.core.text.Convert; +import tk.mybatis.mapper.entity.Example; + +/** + * 商品分类 服务层实现 + * + * @author Enzo + * @date 2019-03-25 + */ +@Service +public class VGoodItemServiceImpl implements IVGoodItemService +{ + @Autowired + private VGoodItemMapper vGoodItemMapper; + + /** + * 查询商品分类信息 + * + * @param id 商品分类ID + * @return 商品分类信息 + */ + @Override + public VGoodItem selectVGoodItemById(Long id) + { + return vGoodItemMapper.selectByPrimaryKey(id); + } + + /** + * 查询商品分类列表 + * + * @param vGoodItem 商品分类信息 + * @return 商品分类集合 + */ + @Override + public List selectVGoodItemList(VGoodItem vGoodItem) + { + Example example = new Example(VGoodItem.class); + Example.Criteria criteria = example.createCriteria(); + + ExampleUtils.andEqualTo(criteria, "id", vGoodItem.getId()); + ExampleUtils.andEqualTo(criteria, "itemName", vGoodItem.getItemName()); + ExampleUtils.andEqualTo(criteria, "itemDesc", vGoodItem.getItemDesc()); + ExampleUtils.andBetweenDateToDate(criteria, "ctime", vGoodItem.getParams().get("beginCtime"),vGoodItem.getParams().get("endCtime")); + ExampleUtils.andEqualTo(criteria, "mStoreid", vGoodItem.getMStoreid()); + ExampleUtils.andEqualTo(criteria, "sore", vGoodItem.getSore()); + + return vGoodItemMapper.selectByExample(example); + } + + /** + * 新增商品分类 + * + * @param vGoodItem 商品分类信息 + * @return 结果 + */ + @Override + public int insertVGoodItem(VGoodItem vGoodItem) + { + return vGoodItemMapper.insertSelective(vGoodItem); + } + + /** + * 修改商品分类 + * + * @param vGoodItem 商品分类信息 + * @return 结果 + */ + @Override + public int updateVGoodItem(VGoodItem vGoodItem) + { + return vGoodItemMapper.updateByPrimaryKeySelective(vGoodItem); + } + + /** + * 删除商品分类对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteVGoodItemByIds(String ids) + { + Example example = new Example(VGoodItem.class); + Example.Criteria criteria = example.createCriteria(); + criteria.andIn("id",Convert.toList(ids)); + return vGoodItemMapper.deleteByExample(example); + } + + + /** + * 删除商品分类 单条信息 + * @param id 删除的主键ID + * @return + */ + @Override + public int deleteVGoodItemById(Long id){ + return vGoodItemMapper.deleteByPrimaryKey(id); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VStoreServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VStoreServiceImpl.java new file mode 100644 index 000000000..681d8f371 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/store/service/impl/VStoreServiceImpl.java @@ -0,0 +1,115 @@ +package com.ruoyi.store.service.impl; + +import java.util.List; + +import com.ruoyi.common.core.page.ExampleUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.store.mapper.VStoreMapper; +import com.ruoyi.store.domain.VStore; +import com.ruoyi.store.service.IVStoreService; +import com.ruoyi.common.core.text.Convert; +import tk.mybatis.mapper.entity.Example; + +/** + * 门店管理 服务层实现 + * + * @author Enzo + * @date 2019-03-25 + */ +@Service +public class VStoreServiceImpl implements IVStoreService +{ + @Autowired + private VStoreMapper vStoreMapper; + + /** + * 查询门店管理信息 + * + * @param storeId 门店管理ID + * @return 门店管理信息 + */ + @Override + public VStore selectVStoreById(Long storeId) + { + return vStoreMapper.selectByPrimaryKey(storeId); + } + + /** + * 查询门店管理列表 + * + * @param vStore 门店管理信息 + * @return 门店管理集合 + */ + @Override + public List selectVStoreList(VStore vStore) + { + Example example = new Example(VStore.class); + Example.Criteria criteria = example.createCriteria(); + + ExampleUtils.andEqualTo(criteria, "storeId", vStore.getStoreId()); + ExampleUtils.andEqualTo(criteria, "storeCode", vStore.getStoreCode()); + ExampleUtils.andEqualTo(criteria, "storeName", vStore.getStoreName()); + ExampleUtils.andEqualTo(criteria, "storePeople", vStore.getStorePeople()); + ExampleUtils.andEqualTo(criteria, "storeTel", vStore.getStoreTel()); + ExampleUtils.andEqualTo(criteria, "storeEmail", vStore.getStoreEmail()); + ExampleUtils.andEqualTo(criteria, "storeLogo", vStore.getStoreLogo()); + ExampleUtils.andEqualTo(criteria, "storeAddress", vStore.getStoreAddress()); + ExampleUtils.andEqualTo(criteria, "storeStatus", vStore.getStoreStatus()); + ExampleUtils.andBetweenDateToDate(criteria, "ctime", vStore.getParams().get("beginCtime"),vStore.getParams().get("endCtime")); + ExampleUtils.andBetweenDateToDate(criteria, "stime", vStore.getParams().get("beginStime"),vStore.getParams().get("endStime")); + + return vStoreMapper.selectByExample(example); + } + + /** + * 新增门店管理 + * + * @param vStore 门店管理信息 + * @return 结果 + */ + @Override + public int insertVStore(VStore vStore) + { + return vStoreMapper.insertSelective(vStore); + } + + /** + * 修改门店管理 + * + * @param vStore 门店管理信息 + * @return 结果 + */ + @Override + public int updateVStore(VStore vStore) + { + return vStoreMapper.updateByPrimaryKeySelective(vStore); + } + + /** + * 删除门店管理对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteVStoreByIds(String ids) + { + Example example = new Example(VStore.class); + Example.Criteria criteria = example.createCriteria(); + criteria.andIn("storeId",Convert.toList(ids)); + return vStoreMapper.deleteByExample(example); + } + + + /** + * 删除门店管理 单条信息 + * @param storeId 删除的主键ID + * @return + */ + @Override + public int deleteVStoreById(Long storeId){ + return vStoreMapper.deleteByPrimaryKey(storeId); + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDept.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDept.java index 69ee792eb..2366d91a7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDept.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDept.java @@ -1,5 +1,6 @@ package com.ruoyi.system.domain; + import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.core.domain.BaseEntity; @@ -9,6 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity; * * @author ruoyi */ + public class SysDept extends BaseEntity { private static final long serialVersionUID = 1L; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDictType.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDictType.java index 223269f26..1d44d7fe9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDictType.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysDictType.java @@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity; * * @author ruoyi */ + public class SysDictType extends BaseEntity { private static final long serialVersionUID = 1L; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java index 9bc8482cc..eb9f205bc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.SysConfig; + /** * 参数配置 数据层 *