From 7d9a0c24149281cbe766f4135272cbaf619061fe Mon Sep 17 00:00:00 2001 From: jeesun Date: Sun, 12 May 2019 01:46:13 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=83=E5=B0=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E9=A1=B5=E9=9D=A2table=E7=BB=84=E4=BB=B6max-?= =?UTF-8?q?height=EF=BC=8C=E8=A7=A3=E5=86=B3=E7=AB=96=E5=90=91=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1=E4=B8=8D=E5=87=BA=E7=8E=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/vue/dictType/list.html | 2 +- .../simon/controller/QuartzJobController.java | 123 ------------------ 2 files changed, 1 insertion(+), 124 deletions(-) delete mode 100644 web/src/test/java/com/simon/controller/QuartzJobController.java diff --git a/web/src/main/resources/templates/vue/dictType/list.html b/web/src/main/resources/templates/vue/dictType/list.html index 9e485dd..8d8f7c5 100644 --- a/web/src/main/resources/templates/vue/dictType/list.html +++ b/web/src/main/resources/templates/vue/dictType/list.html @@ -21,7 +21,7 @@ - diff --git a/web/src/test/java/com/simon/controller/QuartzJobController.java b/web/src/test/java/com/simon/controller/QuartzJobController.java deleted file mode 100644 index a6a939a..0000000 --- a/web/src/test/java/com/simon/controller/QuartzJobController.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.simon.controller; - -import com.simon.common.controller.BaseController; -import com.simon.model.QuartzJob; -import com.simon.service.DictTypeService; -import com.simon.service.QuartzJobService; -import com.simon.repository.QuartzJobRepository; - -import com.simon.common.domain.ResultMsg; -import com.simon.common.domain.UserEntity; -import com.simon.common.domain.EasyUIDataGridResult; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.MessageSource; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.core.Authentication; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; - -import org.springframework.data.domain.Page; -import org.springframework.data.domain.Pageable; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; - -import javax.annotation.security.RolesAllowed; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.security.Principal; -import java.util.Locale; -import java.util.Date; -import java.util.Map; -import java.util.HashMap; -import java.util.LinkedHashMap; - -import java.sql.Time; - -/** -* quartz任务 -* -* @author SimonSun -* @date 2019-05-04 -**/ -@Slf4j -@Api(description = "quartz任务") -@Controller -@RequestMapping("/api/quartzJobs") -public class QuartzJobController extends BaseController{ - - @Autowired - private QuartzJobService quartzJobService; - - @Autowired - private DictTypeService dictTypeService; - - @ApiIgnore - @ApiOperation(value = "列表页面") - @GetMapping("list") - public String list(Model model){ - return "vue/quartzJob/list"; - } - - @ApiIgnore - @ApiOperation(value = "新增页面") - @GetMapping("add") - public String add(){ - return "vue/quartzJob/add"; - } - - @ApiIgnore - @ApiOperation(value = "编辑页面") - @GetMapping("edit") - public String edit(@RequestParam Long id, Model model){ - model.addAttribute("entity", quartzJobService.findById(id)); - return "vue/quartzJob/edit"; - } - - @ApiIgnore - @ApiOperation(value = "列表数据") - @GetMapping("data") - @ResponseBody - public EasyUIDataGridResult data( - @ApiParam(value = "页码", defaultValue = "1", required = true) @RequestParam Integer pageNo, - @ApiParam(value = "每页条数", defaultValue = "10", required = true)@RequestParam Integer pageSize, - @ApiParam(value = "排序")@RequestParam(required = false, defaultValue = "") String orderBy){ - Map params = new LinkedHashMap<>(); - return new EasyUIDataGridResult<>(quartzJobService.getList(params, pageNo, pageSize, orderBy)); - } - - @ApiOperation(value = "新增") - @PostMapping("add") - @ResponseBody - public ResultMsg add(@RequestBody QuartzJob body, Authentication authentication){ - UserEntity userEntity = getCurrentUser(authentication); - body.setCreateDate(new Date()); - body.setCreateBy(userEntity.getId()); - quartzJobService.insertSelective(body); - return ResultMsg.success(); - } - - @ApiOperation(value = "修改") - @PatchMapping("edit") - @ResponseBody - public ResultMsg update(@RequestBody QuartzJob body, Authentication authentication){ - UserEntity userEntity = getCurrentUser(authentication); - body.setUpdateDate(new Date()); - body.setUpdateBy(userEntity.getId()); - quartzJobService.updateByPrimaryKeySelective(body); - return ResultMsg.success(); - } - - @ApiOperation(value = "删除") - @DeleteMapping("/ids/{ids}") - @ResponseBody - public ResultMsg delete(@PathVariable String ids){ - quartzJobService.deleteByIds(ids); - return ResultMsg.success(); - } -} \ No newline at end of file -- Gitee From c1c1cd4bd25ecc06daf6c24471f47ebf8011be92 Mon Sep 17 00:00:00 2001 From: jeesun Date: Sun, 12 May 2019 15:32:47 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E7=9C=81=E5=B8=82=E5=8C=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=B7=BB=E5=8A=A0=E7=BC=93=E5=AD=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-common.yml | 2 +- .../com/simon/common/config/WebMvcConfig.java | 1 - .../simon/service/impl/CityServiceImpl.java | 2 + .../service/impl/CountryServiceImpl.java | 2 + .../service/impl/ProvinceServiceImpl.java | 2 + web/src/main/resources/ehcache.xml | 8 + .../resources/templates/vue/demo-backup.html | 153 ------------------ .../main/resources/templates/vue/demo.html | 138 ---------------- 8 files changed, 15 insertions(+), 293 deletions(-) delete mode 100644 web/src/main/resources/templates/vue/demo-backup.html delete mode 100644 web/src/main/resources/templates/vue/demo.html diff --git a/common/src/main/resources/application-common.yml b/common/src/main/resources/application-common.yml index e0bdaf4..2ee311f 100644 --- a/common/src/main/resources/application-common.yml +++ b/common/src/main/resources/application-common.yml @@ -59,7 +59,7 @@ spring: type: ehcache #redis, ehcache。默认是Ehcache缓存。 ehcache: config: ehcache.xml - cache-names: oauthUserCache,listOptionCache,smsCache + cache-names: DictionaryCache,smsCache,oauthUserCache,listOptionCache,chinaRegionCache jpa: hibernate: naming: diff --git a/web/src/main/java/com/simon/common/config/WebMvcConfig.java b/web/src/main/java/com/simon/common/config/WebMvcConfig.java index 5027096..b87cba3 100644 --- a/web/src/main/java/com/simon/common/config/WebMvcConfig.java +++ b/web/src/main/java/com/simon/common/config/WebMvcConfig.java @@ -119,7 +119,6 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter { //app用户隐私协议 registry.addViewController("/protocol.html").setViewName("protocol"); - registry.addViewController("/vue/demo").setViewName("vue/demo"); registry.addViewController("/vue/home").setViewName("vue/home"); } diff --git a/web/src/main/java/com/simon/service/impl/CityServiceImpl.java b/web/src/main/java/com/simon/service/impl/CityServiceImpl.java index 505c1e6..96a7b94 100644 --- a/web/src/main/java/com/simon/service/impl/CityServiceImpl.java +++ b/web/src/main/java/com/simon/service/impl/CityServiceImpl.java @@ -12,6 +12,7 @@ import com.simon.service.CityService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; @@ -134,6 +135,7 @@ public class CityServiceImpl implements CityService { return cityMapper.findByProvinceId(provinceId); } + @Cacheable(value = "chinaRegionCache", key = "'provinceId' + #provinceId") @Override public List getCascaderOptionDtos(String provinceId) { return cityMapper.getCascaderOptionDtos(provinceId); diff --git a/web/src/main/java/com/simon/service/impl/CountryServiceImpl.java b/web/src/main/java/com/simon/service/impl/CountryServiceImpl.java index a49f361..598f843 100644 --- a/web/src/main/java/com/simon/service/impl/CountryServiceImpl.java +++ b/web/src/main/java/com/simon/service/impl/CountryServiceImpl.java @@ -12,6 +12,7 @@ import com.simon.service.CountryService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; @@ -134,6 +135,7 @@ public class CountryServiceImpl implements CountryService { return countryMapper.findByCityId(cityId); } + @Cacheable(value = "chinaRegionCache", key = "'cityId' + #cityId") @Override public List getCascaderOptionDtos(String cityId) { return countryMapper.getCascaderOptionDtos(cityId); diff --git a/web/src/main/java/com/simon/service/impl/ProvinceServiceImpl.java b/web/src/main/java/com/simon/service/impl/ProvinceServiceImpl.java index c55ff30..a7a95aa 100644 --- a/web/src/main/java/com/simon/service/impl/ProvinceServiceImpl.java +++ b/web/src/main/java/com/simon/service/impl/ProvinceServiceImpl.java @@ -12,6 +12,7 @@ import com.simon.service.ProvinceService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cache.annotation.Cacheable; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; @@ -129,6 +130,7 @@ public class ProvinceServiceImpl implements ProvinceService { return new PageInfo<>(list); } + @Cacheable(value = "chinaRegionCache", key = "'provinces'") @Override public List getCascaderOptionDtos() { return provinceMapper.getCascaderOptionDtos(); diff --git a/web/src/main/resources/ehcache.xml b/web/src/main/resources/ehcache.xml index 7b97cd4..0030a39 100644 --- a/web/src/main/resources/ehcache.xml +++ b/web/src/main/resources/ehcache.xml @@ -67,4 +67,12 @@ diskPersistent="true" memoryStoreEvictionPolicy="LRU"> + + + \ No newline at end of file diff --git a/web/src/main/resources/templates/vue/demo-backup.html b/web/src/main/resources/templates/vue/demo-backup.html deleted file mode 100644 index b381153..0000000 --- a/web/src/main/resources/templates/vue/demo-backup.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - 登录 - - - - - - - - - - - -
- - - - - - - - - - -
- - - \ No newline at end of file diff --git a/web/src/main/resources/templates/vue/demo.html b/web/src/main/resources/templates/vue/demo.html deleted file mode 100644 index 351542d..0000000 --- a/web/src/main/resources/templates/vue/demo.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - 登录 - - - - - - - - - - - - -
- - -
- - - \ No newline at end of file -- Gitee From dc36a015883478e5a912c39cdb90de7378193ed4 Mon Sep 17 00:00:00 2001 From: jeesun Date: Mon, 13 May 2019 00:24:01 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=AE=A1=E7=AE=97iframe?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main/resources/templates/vue/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/main/resources/templates/vue/index.html b/web/src/main/resources/templates/vue/index.html index 0490cf3..8db347c 100644 --- a/web/src/main/resources/templates/vue/index.html +++ b/web/src/main/resources/templates/vue/index.html @@ -204,6 +204,7 @@ var container = new Vue({ el: '#container', data: { + iframeHeight: 0, tableData: [], isCollapse: false, inOrOut: { @@ -240,6 +241,7 @@ }, mounted: function () { this.loadMenuData(); + this.iframeHeight = document.body.clientHeight - 120; }, methods: { handleCommand(command) { @@ -313,7 +315,7 @@ this.editableTabs.push({ title: title, name: targetName, - content: '
', + content: '
', closable: closable }); } -- Gitee From 5b9aab03ad6f2218abd57fc2fd3107c2fb4d3810 Mon Sep 17 00:00:00 2001 From: jeesun Date: Mon, 13 May 2019 16:08:42 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9mysql=E7=9A=84t=5Freset?= =?UTF-8?q?=5Fpwd=5Finfo=E7=9A=84expires=5Fin=E5=AD=97=E6=AE=B5=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=B8=BAdatetime=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/src/main/java/com/simon/model/ResetPwdInfo.java | 1 + schema-mysql.sql | 2 +- web/src/main/java/com/simon/model/ResetPwdInfo.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/com/simon/model/ResetPwdInfo.java b/api/src/main/java/com/simon/model/ResetPwdInfo.java index 48d3748..46344a0 100644 --- a/api/src/main/java/com/simon/model/ResetPwdInfo.java +++ b/api/src/main/java/com/simon/model/ResetPwdInfo.java @@ -50,6 +50,7 @@ public class ResetPwdInfo implements Serializable{ @Column(name = "update_date") private Date updateDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = AppConfig.DATE_PATTERN_DATETIME, timezone = AppConfig.DATE_TIMEZONE) @ApiModelProperty(value = "expires_in") @Column(name = "expires_in") private Date expiresIn; diff --git a/schema-mysql.sql b/schema-mysql.sql index c3e8592..03f4e72 100644 --- a/schema-mysql.sql +++ b/schema-mysql.sql @@ -510,7 +510,7 @@ CREATE TABLE `t_reset_pwd_info` ( `create_date` datetime DEFAULT NULL COMMENT '创建时间', `update_by` bigint(20) DEFAULT NULL COMMENT '更新人id', `update_date` datetime DEFAULT NULL COMMENT '更新时间', - `expires_in` timestamp(6) NULL DEFAULT NULL, + `expires_in` datetime DEFAULT NULL, `secret_key` varchar(255) DEFAULT NULL, `user_id` bigint(20) DEFAULT NULL, `valid` tinyint(1) NOT NULL, diff --git a/web/src/main/java/com/simon/model/ResetPwdInfo.java b/web/src/main/java/com/simon/model/ResetPwdInfo.java index 0e127f3..195d92e 100644 --- a/web/src/main/java/com/simon/model/ResetPwdInfo.java +++ b/web/src/main/java/com/simon/model/ResetPwdInfo.java @@ -55,6 +55,7 @@ public class ResetPwdInfo implements Serializable{ @Column(name = "update_date") private Date updateDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = AppConfig.DATE_PATTERN_DATETIME, timezone = AppConfig.DATE_TIMEZONE) @ApiModelProperty(value = "expires_in") @Column(name = "expires_in") private Date expiresIn; -- Gitee From dd306e255ee8293e798a704678535927297802fa Mon Sep 17 00:00:00 2001 From: jeesun Date: Mon, 13 May 2019 16:10:54 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E9=87=8D=E5=86=99home=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/pom.xml | 6 + .../com/simon/mapper/FontAwesomeMapper.java | 5 - .../resources/mapping/AuthorityMapper.xml | 2 +- .../resources/mapping/FontAwesomeMapper.xml | 36 ++ .../main/resources/mapping/SideMenuMapper.xml | 2 +- .../main/resources/static/css/vue/home.css | 8 + .../main/resources/static/css/vue/list.css | 4 + .../templates/components/vue/vue-list.html | 3 + .../templates/vue/authority/list.html | 2 +- .../resources/templates/vue/bill/list.html | 2 +- .../templates/vue/fontAwesome/list.html | 2 +- .../main/resources/templates/vue/home.html | 345 ++++++++++++++++-- .../main/resources/templates/vue/index.html | 14 - .../templates/vue/loggingEvent/list.html | 2 +- .../templates/vue/newsInfo/list.html | 2 +- .../templates/vue/quartzJob/list.html | 2 +- .../templates/vue/roleAuthority/list.html | 2 +- .../templates/vue/sideMenu/list.html | 2 +- .../resources/templates/vue/table/list.html | 2 +- 19 files changed, 387 insertions(+), 56 deletions(-) create mode 100644 web/src/main/resources/static/css/vue/home.css diff --git a/web/pom.xml b/web/pom.xml index e8cc0d6..e96906f 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -335,6 +335,12 @@ 2.7.2 + + org.webjars.bower + echarts + 4.2.1 + + org.webjars.bower jquery-validation diff --git a/web/src/main/java/com/simon/mapper/FontAwesomeMapper.java b/web/src/main/java/com/simon/mapper/FontAwesomeMapper.java index 2af015f..16edfef 100644 --- a/web/src/main/java/com/simon/mapper/FontAwesomeMapper.java +++ b/web/src/main/java/com/simon/mapper/FontAwesomeMapper.java @@ -3,10 +3,7 @@ package com.simon.mapper; import com.simon.common.mapper.MyMapper; import com.simon.dto.FontAwesomeDto; import com.simon.model.FontAwesome; -import com.simon.provider.FontAwesomeProvider; import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.ResultMap; -import org.apache.ibatis.annotations.SelectProvider; import java.util.List; import java.util.Map; @@ -21,8 +18,6 @@ public interface FontAwesomeMapper extends MyMapper { * @param map 查询条件 * @return 结果列表 */ - @ResultMap("BaseResultMap") - @SelectProvider(type = FontAwesomeProvider.class, method = "getList") List getList(Map map); List getDtos(); diff --git a/web/src/main/resources/mapping/AuthorityMapper.xml b/web/src/main/resources/mapping/AuthorityMapper.xml index ab5ee62..dca5a43 100644 --- a/web/src/main/resources/mapping/AuthorityMapper.xml +++ b/web/src/main/resources/mapping/AuthorityMapper.xml @@ -96,7 +96,7 @@ GROUP BY ta.user_id,tu.username,tu.phone - HAVING WM_CONCAT(to_char(ta.authority)) LIKE CONCAT('%', #{map.authority}, '%') + HAVING WM_CONCAT(to_char(ta.authority)) LIKE CONCAT(CONCAT('%', #{map.authority}), '%') diff --git a/web/src/main/resources/mapping/FontAwesomeMapper.xml b/web/src/main/resources/mapping/FontAwesomeMapper.xml index 1bee13b..495a682 100644 --- a/web/src/main/resources/mapping/FontAwesomeMapper.xml +++ b/web/src/main/resources/mapping/FontAwesomeMapper.xml @@ -27,6 +27,42 @@ icon_class, label, tags + + + + + + diff --git a/web/src/main/resources/mapping/SideMenuMapper.xml b/web/src/main/resources/mapping/SideMenuMapper.xml index ff52709..106c586 100644 --- a/web/src/main/resources/mapping/SideMenuMapper.xml +++ b/web/src/main/resources/mapping/SideMenuMapper.xml @@ -244,7 +244,7 @@ AND authority=#{map.authority} - AND name LIKE CONCAT('%', #{map.name}, '%') + AND name LIKE CONCAT(CONCAT('%', #{map.name}), '%') GROUP BY diff --git a/web/src/main/resources/static/css/vue/home.css b/web/src/main/resources/static/css/vue/home.css new file mode 100644 index 0000000..3a23961 --- /dev/null +++ b/web/src/main/resources/static/css/vue/home.css @@ -0,0 +1,8 @@ +body{ + padding: 0 10px 20px 10px; + background-color: #f0f2f5; +} + +.el-tabs__header { + margin: 0; +} \ No newline at end of file diff --git a/web/src/main/resources/static/css/vue/list.css b/web/src/main/resources/static/css/vue/list.css index 5b28591..9b351e1 100644 --- a/web/src/main/resources/static/css/vue/list.css +++ b/web/src/main/resources/static/css/vue/list.css @@ -33,4 +33,8 @@ body { } .el-form-item{ margin-bottom: 6px; +} + +.el-cascader{ + width: 222px; } \ No newline at end of file diff --git a/web/src/main/resources/templates/components/vue/vue-list.html b/web/src/main/resources/templates/components/vue/vue-list.html index 059d88a..6412dce 100644 --- a/web/src/main/resources/templates/components/vue/vue-list.html +++ b/web/src/main/resources/templates/components/vue/vue-list.html @@ -33,6 +33,9 @@ + + + diff --git a/web/src/main/resources/templates/vue/authority/list.html b/web/src/main/resources/templates/vue/authority/list.html index 9a5e64a..778d0ca 100644 --- a/web/src/main/resources/templates/vue/authority/list.html +++ b/web/src/main/resources/templates/vue/authority/list.html @@ -21,7 +21,7 @@ - diff --git a/web/src/main/resources/templates/vue/bill/list.html b/web/src/main/resources/templates/vue/bill/list.html index 7954df6..67d5aaa 100644 --- a/web/src/main/resources/templates/vue/bill/list.html +++ b/web/src/main/resources/templates/vue/bill/list.html @@ -38,7 +38,7 @@ 导入 导出 - diff --git a/web/src/main/resources/templates/vue/fontAwesome/list.html b/web/src/main/resources/templates/vue/fontAwesome/list.html index 83bcd0b..94e3ceb 100644 --- a/web/src/main/resources/templates/vue/fontAwesome/list.html +++ b/web/src/main/resources/templates/vue/fontAwesome/list.html @@ -21,7 +21,7 @@ 导入 导出 - diff --git a/web/src/main/resources/templates/vue/home.html b/web/src/main/resources/templates/vue/home.html index 0906a36..da24316 100644 --- a/web/src/main/resources/templates/vue/home.html +++ b/web/src/main/resources/templates/vue/home.html @@ -1,32 +1,60 @@ - +
-