diff --git a/src/main/java/com/tenlion/twoduty/controller/api/departmentbase/DepartmentBaseController.java b/src/main/java/com/tenlion/twoduty/controller/api/departmentbase/DepartmentBaseController.java index 3aca1c1..37024a3 100644 --- a/src/main/java/com/tenlion/twoduty/controller/api/departmentbase/DepartmentBaseController.java +++ b/src/main/java/com/tenlion/twoduty/controller/api/departmentbase/DepartmentBaseController.java @@ -1,7 +1,9 @@ package com.tenlion.twoduty.controller.api.departmentbase; +import com.tenlion.twoduty.pojo.dtos.departmentsynopsis.DepartmentSynopsisDTO; import com.tenlion.twoduty.pojo.dtos.userexpand.UserExpandDTO; +import com.tenlion.twoduty.service.departmentsynopsis.IDepartmentSynopsisService; import com.tenlion.twoduty.service.userexpand.IUserExpandService; import ink.wgink.common.base.DefaultBaseController; import ink.wgink.common.component.SecurityComponent; @@ -32,6 +34,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -60,9 +63,10 @@ public class DepartmentBaseController extends DefaultBaseController { private IUserService userService; @Autowired private IPositionUserService positionUserService; - @Autowired private IUserExpandService userExpandService; + @Autowired + private IDepartmentSynopsisService departmentSynopsisService; /** @@ -90,36 +94,47 @@ public class DepartmentBaseController extends DefaultBaseController { @ApiOperation(value = "组织机构列表", notes = "组织机构列表接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @GetMapping("list-jur") - public List listJur(){ + public List> listJur(){ List list = new ArrayList<>(); + List> resultList = new ArrayList<>(); List roles = securityComponent.getCurrentUser().getRoles(); if("admin".equals(securityComponent.getCurrentUser().getUserUsername())){ list = departmentBaseService.listByParentId(GENGID); - return list; - } - - for (RolePO role : roles) { - //市局角色 - if(ROLE_1_CODE.equals(role.getRoleCode())){ - list = departmentBaseService.listByParentId(GENGID); - break; - } - //旗县区角色 - if(ROLE_2_CODE.equals(role.getRoleCode())){ - for (DepartmentPO department : securityComponent.getCurrentUser().getDepartments()) { - DepartmentPO po = departmentBaseService.getPO(department.getDepartmentId()); - if(po != null){ - list.add(po); - } + }else{ + for (RolePO role : roles) { + //市局角色 + if(ROLE_1_CODE.equals(role.getRoleCode())){ + list = departmentBaseService.listByParentId(GENGID); + break; + } + //旗县区角色 + if(ROLE_2_CODE.equals(role.getRoleCode())){ + for (DepartmentPO department : securityComponent.getCurrentUser().getDepartments()) { + DepartmentPO po = departmentBaseService.getPO(department.getDepartmentId()); + if(po != null){ + list.add(po); + } + } + break; } - break; } } + for (DepartmentPO departmentPO : list) { + DepartmentSynopsisDTO byDepartmentId = departmentSynopsisService.getByDepartmentId(departmentPO.getDepartmentId()); + Map map = new HashMap<>(); + map.put("departmentId",departmentPO.getDepartmentId()); + map.put("departmentName",departmentPO.getDepartmentName()); + if(byDepartmentId != null){ + map.put("departmentPhoto",byDepartmentId.getDepartmentSynopsisPhoto()); + }else{ + map.put("departmentPhoto",""); + } + resultList.add(map); + } - - return list; + return resultList; } diff --git a/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java b/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java index 3b21307..046b05e 100644 --- a/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java +++ b/src/main/java/com/tenlion/twoduty/controller/route/indexWebController.java @@ -90,10 +90,6 @@ public class indexWebController extends DefaultBaseController { return params; } - - - - public String initDepartmentId(UserInfoBO currentUser){ List departments = currentUser.getDepartments(); if(departments.size() == 0){ diff --git a/src/main/resources/mybatis/mapper/articlecontent/article-content-mapper.xml b/src/main/resources/mybatis/mapper/articlecontent/article-content-mapper.xml index bfde4f0..686c64a 100644 --- a/src/main/resources/mybatis/mapper/articlecontent/article-content-mapper.xml +++ b/src/main/resources/mybatis/mapper/articlecontent/article-content-mapper.xml @@ -319,7 +319,7 @@ AND t1.article_classify_id = #{articleClassifyId} - + AND t1.article_content_is_publish = #{articleContentIsPublish} diff --git a/src/main/resources/static/assets/web/css/index.css b/src/main/resources/static/assets/web/css/index.css index b0b01d9..4c565e7 100644 --- a/src/main/resources/static/assets/web/css/index.css +++ b/src/main/resources/static/assets/web/css/index.css @@ -1,4 +1,4 @@ -.header{width:100%;height:550px;min-width:1200px;position:relative;background:url(../images/header-bg.png) no-repeat center;background-size:100% 100%} +.header{width:100%;height:550px;min-width:1200px;position:relative;background:url(../images/header-bg-2.png) no-repeat center;background-size:100% 100%} .date{overflow:hidden;width:1200px;margin:0 auto;height:40px;line-height:40px;font-size:12px;color:#333} .date span{color:#b09158} .day{float:left;} diff --git a/src/main/resources/static/assets/web/images/header-bg-2.png b/src/main/resources/static/assets/web/images/header-bg-2.png new file mode 100644 index 0000000..d4dd560 Binary files /dev/null and b/src/main/resources/static/assets/web/images/header-bg-2.png differ diff --git a/src/main/resources/templates/articlecontent/type/save-type.html b/src/main/resources/templates/articlecontent/type/save-type.html index 0752821..34fe782 100644 --- a/src/main/resources/templates/articlecontent/type/save-type.html +++ b/src/main/resources/templates/articlecontent/type/save-type.html @@ -378,8 +378,13 @@ } }, photos:function (value,item) { - if(value == ''){ - return '请上传封面图片'; + if("ed2fae3a-c89d-4a2d-9c4c-defc250f1436" == articleTypeId || + "ccb93228-d911-4384-ad7d-26fda5182105" == articleTypeId + ) + { + if(value == ''){ + return '请上传封面图片'; + } } } diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 08ba26c..a21ff7d 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -111,7 +111,7 @@
- +
四个清单 @@ -164,7 +164,8 @@ 0{{idx+1}}/ @@ -213,7 +214,7 @@