Jelajahi Sumber

fix: 修复Path参数Swagger注解

huangzqa 4 tahun lalu
induk
melakukan
986469e2bd
16 mengubah file dengan 314 tambahan dan 232 penghapusan
  1. 9 4
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/AppController.java
  2. 5 2
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ManufacturerInfoController.java
  3. 16 16
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/approval/ApprovalController.java
  4. 2 1
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/audit/MgeAuditRptController.java
  5. 53 51
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/audit/UserAuditRptController.java
  6. 15 11
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/AppFunInfoController.java
  7. 44 35
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/RoleInfoController.java
  8. 51 43
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/org/GovernmentInfoController.java
  9. 40 20
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/org/OrgInfoController.java
  10. 8 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/DataSourceController.java
  11. 4 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/DuceapUploadController.java
  12. 5 2
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/MdDynCodeDicController.java
  13. 6 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/MdDynCodeDicSonController.java
  14. 5 2
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/statisics/ManageStatisicsController.java
  15. 4 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/statisics/UserStatisicsController.java
  16. 47 45
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/user/PoliceManagementController.java

+ 9 - 4
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/AppController.java

@@ -34,6 +34,7 @@ import com.dragonsoft.duceap.core.search.Searchable;
 import com.dragonsoft.duceap.core.search.enums.SearchOperator;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -126,7 +127,8 @@ public class AppController {
     }
 
     @ApiOperation(value = "删除应用")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "应用ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @DeleteMapping(value = "/app/{id}")
     public Result<Object> del(@PathVariable("id") String id) {
         try {
@@ -149,7 +151,8 @@ public class AppController {
      * @return
      */
     @ApiOperation(value = "查询应用")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "应用ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "/app/{id}")
     public Result<AppVo> toDetail(@PathVariable("id") String id) {
         //查询应用信息
@@ -163,7 +166,8 @@ public class AppController {
     }
 
     @ApiOperation(value = "开启停止应用")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "应用ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @PutMapping(value = "/app/status/{id}")
     public Result<Object> startOrStop(@PathVariable String id) {
         String message = "";
@@ -178,7 +182,8 @@ public class AppController {
 
 
     @ApiOperation(value = "根据厂商ID,获取厂商所有的应用")
-    @ApiImplicitParam(value = "mfrId", name = "厂商Id", required = true)
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "厂商ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "app/manufacturer/{mfrId}")
     public Result<List<Map<String, String>>> getAppByMfr(@PathVariable String mfrId) {
         if (StrUtil.isBlank(mfrId)) {

+ 5 - 2
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ManufacturerInfoController.java

@@ -24,6 +24,7 @@ import com.dragonsoft.duceap.core.search.Searchable;
 import com.dragonsoft.duceap.web.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -62,7 +63,8 @@ public class ManufacturerInfoController extends BaseController<ManufacturerInfo,
     }
 
     @ApiOperation(value = "获取厂商")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "厂商ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "manufacturer/{id}")
     public Result<ManufacturerVo> detail(@PathVariable("id") String id) {
         ManufacturerVo manufacturerVo = new ManufacturerVo();
@@ -129,7 +131,8 @@ public class ManufacturerInfoController extends BaseController<ManufacturerInfo,
     }
 
     @ApiOperation(value = "删除厂商")
-    @ApiImplicitParam(name = "id", value = "id", required = true)
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "厂商ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @DeleteMapping(value = "manufacturer/{id}")
     public Result<Object> del(@PathVariable("id") String id) {
         List<ApplyInfo> appList = applyInfoFacade.getAppListByManufacturerId(id);

+ 16 - 16
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/approval/ApprovalController.java

@@ -23,7 +23,7 @@ import java.text.SimpleDateFormat;
 import java.util.List;
 
 @Api(tags = {"动态授权管理接口"})
-@Permission(value="power_config")
+@Permission(value = "power_config")
 @RestController
 @RequestMapping(value = "approsvr/v2/approval/")
 public class ApprovalController {
@@ -35,17 +35,17 @@ public class ApprovalController {
     private IUserInfoFacade iUserInfoFacade;
 
     @ApiOperation(value = "获取动态授权信息列表")
-    @ApiImplicitParam(name = "searchDTO" , value = "查询条件",paramType = "body",
+    @ApiImplicitParam(name = "searchDTO", value = "查询条件", paramType = "body",
             examples = @Example({
-            @ExampleProperty(value = "{'appName_like':'应用名称','roleName_like':'角色名称','proposerName_like':'申请人'," +
-                    "'proposerOrg_eq':'id申请机构id','approvalStatus_eq':'申请状态'}",
-                    mediaType = "application/json")
-    }))
+                    @ExampleProperty(value = "{'appName_like':'应用名称','roleName_like':'角色名称','proposerName_like':'申请人'," +
+                            "'proposerOrg_eq':'id申请机构id','approvalStatus_eq':'申请状态'}",
+                            mediaType = "application/json")
+            }))
     @PostMapping(value = "_search")
     public Result<List<FuncApproval>> approvalPage(SearchDTO searchDTO) {
         Page<FuncApproval> page = iApprovalFacade.approvalPage(searchDTO);
         page.getContent().stream().forEach(this::setValues);
-        return Result.success(page.getTotalElements(),page.getContent());
+        return Result.success(page.getTotalElements(), page.getContent());
     }
 
 
@@ -53,12 +53,12 @@ public class ApprovalController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "id", value = "id"),
             @ApiImplicitParam(name = "hasTime", value = "hasTime,0:不存在时间限制 1:存在时间限制。"),
-            @ApiImplicitParam(name = "validTime", value = "授权截止时间 格式:yyyyMMddHHmmss",paramType = "string")
+            @ApiImplicitParam(name = "validTime", value = "授权截止时间 格式:yyyyMMddHHmmss", paramType = "string")
     })
     @PutMapping(value = "agree")
     public Result agree(@RequestBody FuncApprovalVo funcApprovalVo) {
-        ApprovalDto approvalDto=new ApprovalDto();
-        BeanUtils.copyProperties(funcApprovalVo,approvalDto);
+        ApprovalDto approvalDto = new ApprovalDto();
+        BeanUtils.copyProperties(funcApprovalVo, approvalDto);
         ResponseStatus responseStatus = iApprovalFacade.agree(approvalDto);
         Result result = dealResponseStatus(responseStatus);
         return result;
@@ -71,8 +71,8 @@ public class ApprovalController {
     })
     @PutMapping(value = "disagree")
     public Result disagree(@RequestBody FuncApprovalVo funcApprovalVo) {
-        ApprovalDto approvalDto=new ApprovalDto();
-        BeanUtils.copyProperties(funcApprovalVo,approvalDto);
+        ApprovalDto approvalDto = new ApprovalDto();
+        BeanUtils.copyProperties(funcApprovalVo, approvalDto);
         ResponseStatus responseStatus = iApprovalFacade.disagree(approvalDto);
         Result result = dealResponseStatus(responseStatus);
         return result;
@@ -80,14 +80,15 @@ public class ApprovalController {
     }
 
     @ApiOperation(value = "获取详情")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "授权ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "detail/{id}")
     public Result<FuncApprovalVo> toDetail(@PathVariable("id") String id) {
         FuncApproval approval = iApprovalFacade.detail(id);
         setValues(approval);
         FuncApprovalVo vo = new FuncApprovalVo();
-        BeanUtils.copyProperties(approval,vo);
-        if (approval.getValidTime()!=null){
+        BeanUtils.copyProperties(approval, vo);
+        if (approval.getValidTime() != null) {
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             vo.setValidTime(format.format(approval.getValidTime()));
         }
@@ -108,7 +109,6 @@ public class ApprovalController {
     }
 
 
-
     private Result dealResponseStatus(ResponseStatus responseStatus) {
         if (ResponseStatus.SUCCESS_CODE.equals(responseStatus.getStatusCode())) {
             return Result.success(responseStatus.getMessage());

+ 2 - 1
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/audit/MgeAuditRptController.java

@@ -56,7 +56,8 @@ public class MgeAuditRptController {
     }
 
     @ApiOperation(value = "查询管理员审计详情")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "审计详情ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "/detail/{id}")
     public Result<MgeLogVo> orgAuditDetail(@PathVariable("id") String id) {
         MgeLog mgeLog = iMgeLogFacade.getMgeLog(id);

+ 53 - 51
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/audit/UserAuditRptController.java

@@ -22,6 +22,7 @@ import com.dragonsoft.duceap.commons.util.ObjectUtils;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -57,36 +58,37 @@ public class UserAuditRptController {
     private ICodeListResourceFacade codeListResourceFacade;
 
 
-    private Map<String,String> codeMap = new HashMap<String, String>(){{
-        put("UserType","DM_USER_TYPE");             //人员类型
-        put("Area","DM_AREA_CODE");                 //地区
-        put("UserStatus","DM_USER_STATUS");         //人员状态
-        put("AuxiliaryType","DM_AUXILIARY_TYPE");   //辅警类型
-        put("PoliceCategory","T_MD_POLICE_TYPE");   //警钟
-        put("Sex","DM_SEX");                        //性别
-        put("Nation","DM_NATION_CODE");             //民族
-        put("Title","DM_CERT_DUTY_LEVEL");          //职级
-        put("Rank","DM_POLICE_RANK");               //警衔
+    private Map<String, String> codeMap = new HashMap<String, String>() {{
+        put("UserType", "DM_USER_TYPE");             //人员类型
+        put("Area", "DM_AREA_CODE");                 //地区
+        put("UserStatus", "DM_USER_STATUS");         //人员状态
+        put("AuxiliaryType", "DM_AUXILIARY_TYPE");   //辅警类型
+        put("PoliceCategory", "T_MD_POLICE_TYPE");   //警钟
+        put("Sex", "DM_SEX");                        //性别
+        put("Nation", "DM_NATION_CODE");             //民族
+        put("Title", "DM_CERT_DUTY_LEVEL");          //职级
+        put("Rank", "DM_POLICE_RANK");               //警衔
     }};
 
     @ApiOperation(value = "查询用户审计报表")
     @ApiImplicitParam(name = "SearchDTO", value = "查询条件,默认带一个IDCARD")
     @PostMapping(value = "users")
-    public Result getUserAuditRpt(SearchDTO searchDTO){
+    public Result getUserAuditRpt(SearchDTO searchDTO) {
         searchDTO.setSort("");
         Page<UserLogVo> page = iUserLogFacade.findUserLogRpt(searchDTO);
-        for(UserLogVo vo:page.getContent()) {
+        for (UserLogVo vo : page.getContent()) {
             List<CompareVo> dftMap = getCompareVos(vo);
             vo.setDftList(dftMap);
             continue;
         }
-        return Result.success(page.getTotalElements(),page.getContent());
+        return Result.success(page.getTotalElements(), page.getContent());
     }
 
     @ApiOperation(value = "查询用户审计详情")
-    @ApiImplicitParam(name = "id", value = "主键ID")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "主键ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "user/{id}")
-    public Result<UserLogVo> userAuditDetail(@PathVariable("id") String id){
+    public Result<UserLogVo> userAuditDetail(@PathVariable("id") String id) {
         UserLogVo userLogVo = iUserLogFacade.userLogVoDetail(id);
         List<CompareVo> dftMap = getCompareVos(userLogVo);
         userLogVo.setDftList(dftMap);
@@ -98,23 +100,24 @@ public class UserAuditRptController {
     @PostMapping(value = "/audit/users")
     public Result getUserWithDeleted(SearchDTO searchDTO) {
         Page<UserInfo> page = iUserInfoFacade.userList(searchDTO);
-        Map<String,String> auxiliaryTypeList =getCodes("DM_AUXILIARY_TYPE");
-        Map<String,String> policeUserTypeList = getCodes( "DM_MAN_TYPE");
-        page.forEach(item->{
-            if (UserTypeEnum.POLICE.getValue().equals(item.getUserType())){
+        Map<String, String> auxiliaryTypeList = getCodes("DM_AUXILIARY_TYPE");
+        Map<String, String> policeUserTypeList = getCodes("DM_MAN_TYPE");
+        page.forEach(item -> {
+            if (UserTypeEnum.POLICE.getValue().equals(item.getUserType())) {
                 item.setManType(policeUserTypeList.get(item.getManType()));
             }
-            if (UserTypeEnum.HELPER.getValue().equals(item.getUserType())){
+            if (UserTypeEnum.HELPER.getValue().equals(item.getUserType())) {
                 item.setManType(auxiliaryTypeList.get(item.getAuxiliaryType()));
             }
         });
-        return  Result.success(page.getTotalElements(),page.getContent());
+        return Result.success(page.getTotalElements(), page.getContent());
     }
-    private Map<String,String> getCodes(String codeName){
+
+    private Map<String, String> getCodes(String codeName) {
         List<CodeRecord> codeRecordList = codeListResourceFacade.listCode("code", codeName);
-        Map<String,String> map=new HashMap<>();
-        codeRecordList.forEach(item->{
-            map.put(item.getValue(),item.getLabel());
+        Map<String, String> map = new HashMap<>();
+        codeRecordList.forEach(item -> {
+            map.put(item.getValue(), item.getLabel());
         });
         return map;
     }
@@ -123,7 +126,7 @@ public class UserAuditRptController {
         List<CompareVo> dftMap = new ArrayList<CompareVo>();
         if (ObjectTypeEnum.USER.getValue().equals(vo.getObjectType())) {
             //用户信息
-            try{
+            try {
                 UserInfo oldUser = JSON.parseObject(vo.getPreviousData(), UserInfo.class);
                 UserInfo newUser = JSON.parseObject(vo.getJsonData(), UserInfo.class);
                 if (vo.getOperateType().equals(OperateTypeEnum.UPDATE.getValue())) {
@@ -135,12 +138,12 @@ public class UserAuditRptController {
                     }
                     vo.setDftList(dftMap);
                 }
-            }catch (Exception e){
-                logger.error("userInfo-getUserAuditRpt:id:"+vo.getId());
-                logger.error("",e);
+            } catch (Exception e) {
+                logger.error("userInfo-getUserAuditRpt:id:" + vo.getId());
+                logger.error("", e);
             }
-        }else if(ObjectTypeEnum.POSTINFO.getValue().equals(vo.getObjectType())){
-            try{
+        } else if (ObjectTypeEnum.POSTINFO.getValue().equals(vo.getObjectType())) {
+            try {
                 //职位信息
                 PostInfo newPost = JSON.parseObject(vo.getCurrentData(), PostInfo.class);
                 PostInfo oldPost = new PostInfo();
@@ -152,18 +155,18 @@ public class UserAuditRptController {
                     //放入对应枚举值
                     setEunm(compareVo);
                 }
-            }catch (Exception e){
-                logger.error("postInfo-getUserAuditRpt:id:"+vo.getId());
-                logger.error("",e);
+            } catch (Exception e) {
+                logger.error("postInfo-getUserAuditRpt:id:" + vo.getId());
+                logger.error("", e);
             }
-        }else if(ObjectTypeEnum.ACCOUNT.getValue().equals(vo.getObjectType())){
+        } else if (ObjectTypeEnum.ACCOUNT.getValue().equals(vo.getObjectType())) {
             //账号信息
-            try{
+            try {
                 AccountInfo newAccount = JSON.parseObject(vo.getCurrentData(), AccountInfo.class);
                 if (vo.getOperateType().equals(OperateTypeEnum.UPDATE.getValue())) {
                     if (StringUtils.isNotEmpty(vo.getPreviousData())) {
                         AccountInfo oldAccount = JSON.parseObject(vo.getPreviousData(), AccountInfo.class);
-                        dftMap = CompareUtils.compareVos(oldAccount, newAccount,"endDate","ipAddress","isAtive","password");
+                        dftMap = CompareUtils.compareVos(oldAccount, newAccount, "endDate", "ipAddress", "isAtive", "password");
                         for (CompareVo compareVo : dftMap) {
                             //放入对应枚举值
                             setEunm(compareVo);
@@ -171,10 +174,10 @@ public class UserAuditRptController {
                     }
                 }
 
-            }catch (Exception e){
-                logger.error("accountInfo-getUserAuditRpt:id:"+vo.getId());
-                logger.error("getUserAuditRpt:json:"+vo.toString());
-                logger.error("",e);
+            } catch (Exception e) {
+                logger.error("accountInfo-getUserAuditRpt:id:" + vo.getId());
+                logger.error("getUserAuditRpt:json:" + vo.toString());
+                logger.error("", e);
             }
         }
         return dftMap;
@@ -217,7 +220,7 @@ public class UserAuditRptController {
             beVal = "1".equals(beVal) ? "启用" : "停用";
             compareVo.setAfterVal(afterVal);
             compareVo.setBeforeVal(beVal);
-        } else if(name.equals("Password")){
+        } else if (name.equals("Password")) {
             afterVal = "******";
             beVal = "******";
             compareVo.setAfterVal(afterVal);
@@ -233,7 +236,7 @@ public class UserAuditRptController {
             }
             compareVo.setAfterVal(afterVal);
             compareVo.setBeforeVal(beVal);
-        }  else if (name.equals("PoliceBusiness")) {
+        } else if (name.equals("PoliceBusiness")) {
             String[] business = (StringUtils.isEmpty(compareVo.getAfterVal()) ? "" : compareVo.getAfterVal()).split(",");
             HashMap<String, String> map = getCodeVLMap(name);
             for (String b : business) {
@@ -262,7 +265,7 @@ public class UserAuditRptController {
             }
             compareVo.setAfterVal(afterVal.length() > 0 ? afterVal.substring(0, afterVal.length() - 1) : "");
             compareVo.setBeforeVal(beVal.length() > 0 ? beVal.substring(0, beVal.length() - 1) : "");
-        }  else if ("Company".equals(name)) {
+        } else if ("Company".equals(name)) {
             if (StringUtils.isNotBlank(compareVo.getAfterVal())) {
                 afterVal = iManufacturerInfoFacade.manufacturerInfoDetail(compareVo.getAfterVal()).getManufacturerName();
                 compareVo.setAfterVal(afterVal);
@@ -271,7 +274,7 @@ public class UserAuditRptController {
                 beVal = iManufacturerInfoFacade.manufacturerInfoDetail(compareVo.getBeforeVal()).getManufacturerName();
                 compareVo.setBeforeVal(beVal);
             }
-        }else if(codeMap.containsKey(name)){
+        } else if (codeMap.containsKey(name)) {
             HashMap<String, String> map = getCodeVLMap(name);
             compareVo.setAfterVal(map.get(compareVo.getAfterVal()));
             compareVo.setBeforeVal(map.get(compareVo.getBeforeVal()));
@@ -283,16 +286,16 @@ public class UserAuditRptController {
         HashMap<String, String> map = new HashMap<String, String>();
         String codeId = codeMap.get(name);
         List<Map<String, Object>> codeResource = iDuceapCodeFacade.getCodeResource(codeId);
-        codeResource.forEach(item->{
+        codeResource.forEach(item -> {
             String lable = item.get("NAME").toString();
             String value = item.get("CODE").toString();
-            map.put(value,lable);
+            map.put(value, lable);
         });
         return map;
     }
 
     public String getDate(String time) {
-        if(time.length() == 8) {
+        if (time.length() == 8) {
             SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", Locale.US);
             Date d = null;
             try {
@@ -303,10 +306,9 @@ public class UserAuditRptController {
                 e.printStackTrace();
             }
         }
-        if(time.length() == 10){
+        if (time.length() == 10) {
             return time;
-        }
-        else{
+        } else {
             SimpleDateFormat sdf = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy", Locale.US);
             Date d;
             String date = "";

+ 15 - 11
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/AppFunInfoController.java

@@ -14,6 +14,7 @@ import com.dragonsoft.duceap.commons.util.tree.TreeNodeUtils;
 import com.dragonsoft.duceap.web.annotation.Permission;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -32,10 +33,10 @@ import java.util.Map;
  * @author Administrator
  */
 @Api(tags = {"授权模块-菜单管理接口"})
-@Permission(value="power_config")
+@Permission(value = "power_config")
 @RestController
 @RequestMapping(value = "authsvr/v2/appfuninfo")
-public class AppFunInfoController  {
+public class AppFunInfoController {
 
     public static Logger logger = LoggerFactory.getLogger(AppFunInfoController.class);
 
@@ -47,32 +48,34 @@ public class AppFunInfoController  {
 
     /**
      * 获取所有菜单信息列表
+     *
      * @return
      */
     @ApiOperation(value = "获取所有菜单信息列表")
     @ApiImplicitParam(name = "appId", value = "应用id")
     @GetMapping(value = "/menuTreeList")
     public Result<List<Map<String, Object>>> getMenuTreeList(@RequestParam(value = "appId") String appId) {
-        List<TreeInfoVO>  funList = iAppFunInfoFacade.getAllTreeList(appId);
+        List<TreeInfoVO> funList = iAppFunInfoFacade.getAllTreeList(appId);
         List<Map<String, Object>> maps = TreeNodeUtils.generateTree(funList, new SimpleTreeNodeItemResolver("code", "pid"));
         for (Map<String, Object> map : maps) {
             List children = (List) map.get("children");
-            if(CollectionUtils.isNotEmpty(children)){
-                map.put("isParent",true);
+            if (CollectionUtils.isNotEmpty(children)) {
+                map.put("isParent", true);
             }
         }
         return Result.success(maps);
     }
 
     @ApiOperation(value = "根据id获取应用的菜单")
-    @ApiImplicitParam(name = "id", value = "菜单id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "菜单ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "/menuCode/{id}")
-    public Result<List<AppFunInfoVo>> getMenuCode(@PathVariable("id") String codeId){
-        List<AppFunInfo> resultList=iAppFunInfoFacade.getCode(codeId);
+    public Result<List<AppFunInfoVo>> getMenuCode(@PathVariable("id") String codeId) {
+        List<AppFunInfo> resultList = iAppFunInfoFacade.getCode(codeId);
         List<AppFunInfoVo> vos = new ArrayList<>();
         for (AppFunInfo source : resultList) {
             AppFunInfoVo vo = new AppFunInfoVo();
-            BeanUtils.copyProperties(source,vo);
+            BeanUtils.copyProperties(source, vo);
             vos.add(vo);
         }
         return Result.success(vos);
@@ -80,6 +83,7 @@ public class AppFunInfoController  {
 
     /**
      * 获取菜单、功能初始化
+     *
      * @param
      * @return
      */
@@ -95,8 +99,8 @@ public class AppFunInfoController  {
         List<Map<String, Object>> maps = TreeNodeUtils.generateTree(appAllTreeList, new SimpleTreeNodeItemResolver("code", "pid"));
         for (Map<String, Object> map : maps) {
             List children = (List) map.get("children");
-            if(CollectionUtils.isNotEmpty(children)){
-                   map.put("isParent",true);
+            if (CollectionUtils.isNotEmpty(children)) {
+                map.put("isParent", true);
             }
         }
         return Result.success(maps);

+ 44 - 35
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/auth/RoleInfoController.java

@@ -24,6 +24,7 @@ import com.dragonsoft.duceap.core.search.filter.Condition;
 import com.dragonsoft.duceap.web.annotation.Permission;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,6 +54,7 @@ public class RoleInfoController {
 
     /**
      * 角色列表
+     *
      * @param searchDTO
      * @return
      */
@@ -71,7 +73,7 @@ public class RoleInfoController {
      */
     @ApiOperation(value = "保存菜单")
     @Permission(value = "power_config")
-    @PostMapping(value = "/rsGrid",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PostMapping(value = "/rsGrid", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Result saveRsGrid(@RequestBody RoleFunRsRlVo roleFunRsRlVo) {
         Result result;
         try {
@@ -82,7 +84,7 @@ public class RoleInfoController {
             iRoleInfoFacade.saveRsGrid(rsGridList, roleId);
             result = Result.success("保存成功");
         } catch (Exception e) {
-            logger.error("saveRsGrid error:{}",e);
+            logger.error("saveRsGrid error:{}", e);
             result = Result.fail("保存异常");
 
         }
@@ -96,23 +98,25 @@ public class RoleInfoController {
      * @return
      */
     @ApiOperation(value = "查看角色信息")
-    @ApiImplicitParam(name = "id", value = "角色id")
-    @GetMapping(value = "/role/{id}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "角色ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
+    @GetMapping(value = "/role/{id}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Result<RoleInfoVo> roleInfo(@PathVariable("id") String id) {
         RoleInfo roleInfo = iRoleInfoFacade.get(id);
         RoleInfoVo vo = new RoleInfoVo();
-        BeanUtils.copyProperties(roleInfo,vo);
+        BeanUtils.copyProperties(roleInfo, vo);
         return Result.success(vo);
     }
 
     /**
      * 保存角色
+     *
      * @param roleInfoVo
      * @return
      */
     @ApiOperation(value = "保存角色信息")
     @Permission(value = "power_config")
-    @PostMapping(value = "/role",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PostMapping(value = "/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Result saveRole(@RequestBody RoleInfoVo roleInfoVo) {
 
         Result result;
@@ -122,9 +126,9 @@ public class RoleInfoController {
                 return result;
             }
             Searchable searchable = Searchable.newSearchable();
-            searchable.addSearchFilter("code", SearchOperator.eq,roleInfoVo.getCode());
+            searchable.addSearchFilter("code", SearchOperator.eq, roleInfoVo.getCode());
             if (StringUtils.isNotEmpty(roleInfoVo.getId()))
-                searchable.addSearchFilter("id",SearchOperator.ne,roleInfoVo.getId());
+                searchable.addSearchFilter("id", SearchOperator.ne, roleInfoVo.getId());
             List<RoleInfo> list = iRoleInfoFacade.roleList(searchable.toSearchDTO());
             if (list != null && list.size() > 0)
                 return Result.fail("角色代码已被使用");
@@ -132,17 +136,17 @@ public class RoleInfoController {
             roleInfoVo.setInitNumber(0);
             roleInfoVo.setCreator(user.getId());
             roleInfoVo.setIsActive(YesNotEnum.YES.getValue());
-            roleInfoVo.setPoliceCategory(StringUtils.isEmpty(roleInfoVo.getPoliceCategory())?null:roleInfoVo.getPoliceCategory());
+            roleInfoVo.setPoliceCategory(StringUtils.isEmpty(roleInfoVo.getPoliceCategory()) ? null : roleInfoVo.getPoliceCategory());
             roleInfoVo.setCreateTime(new Date());
             //TODO
             //DTO暂未设计,沿用原来的接口参数,后期修改
             RoleInfo roleInfo = new RoleInfo();
-            BeanUtils.copyProperties(roleInfoVo,roleInfo);
+            BeanUtils.copyProperties(roleInfoVo, roleInfo);
             iRoleInfoFacade.save(roleInfo);
             result = Result.success("保存成功");
 
         } catch (Exception e) {
-            logger.error("",e);
+            logger.error("", e);
             result = Result.fail("保存失败");
 
         }
@@ -158,7 +162,7 @@ public class RoleInfoController {
      */
     @ApiOperation(value = "修改角色信息")
     @Permission(value = "power_config")
-    @PutMapping(value = "/role",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PutMapping(value = "/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Result updateRole(@RequestBody RoleInfoVo roleInfoVo) {
         Result result;
         try {
@@ -167,9 +171,9 @@ public class RoleInfoController {
                 return result;
             }
             Searchable searchable = Searchable.newSearchable();
-            searchable.addSearchFilter("code", SearchOperator.eq,roleInfoVo.getCode());
+            searchable.addSearchFilter("code", SearchOperator.eq, roleInfoVo.getCode());
             if (StringUtils.isNotEmpty(roleInfoVo.getId()))
-                searchable.addSearchFilter("id",SearchOperator.ne,roleInfoVo.getId());
+                searchable.addSearchFilter("id", SearchOperator.ne, roleInfoVo.getId());
             List<RoleInfo> list = iRoleInfoFacade.roleList(searchable.toSearchDTO());
             if (list != null && list.size() > 0)
                 return Result.fail("角色代码已被使用");
@@ -180,14 +184,14 @@ public class RoleInfoController {
             role_info.setDetail(roleInfoVo.getDetail());
             role_info.setModifier(ContextUtils.getUserInfo().getName());
             role_info.setModifiedTime(new Date());
-            role_info.setPoliceCategory(StringUtils.isEmpty(roleInfoVo.getPoliceCategory())?null:roleInfoVo.getPoliceCategory());
+            role_info.setPoliceCategory(StringUtils.isEmpty(roleInfoVo.getPoliceCategory()) ? null : roleInfoVo.getPoliceCategory());
             role_info.setRoleBusiness(roleInfoVo.getRoleBusiness());
             role_info.setIsNotLimitCount(roleInfoVo.getIsNotLimitCount());
             iRoleInfoFacade.update(role_info);
             result = Result.success("保存成功");
 
         } catch (Exception e) {
-            logger.error("",e);
+            logger.error("", e);
             result = Result.fail("保存失败");
 
         }
@@ -202,9 +206,10 @@ public class RoleInfoController {
      * @return
      */
     @ApiOperation(value = "删除角色信息")
-    @ApiImplicitParam(name = "id", value = "角色id",required = true)
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "角色ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @Permission(value = "power_config")
-    @DeleteMapping(value = "/role/{id}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @DeleteMapping(value = "/role/{id}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Result deleteRole(@PathVariable("id") String id) {
         Result result;
         try {
@@ -214,7 +219,7 @@ public class RoleInfoController {
             iRoleInfoFacade.delAllRolesInfo(id);
             result = Result.success("删除成功");
         } catch (Exception e) {
-            logger.error("delete role error:{}",e);
+            logger.error("delete role error:{}", e);
             result = Result.fail("删除异常");
 
         }
@@ -224,11 +229,12 @@ public class RoleInfoController {
 
     /**
      * 根据角色获取选中菜单、功能
+     *
      * @param roleId 角色id
      * @return
      */
     @ApiOperation(value = "根据角色获取选中菜单、功能")
-    @ApiImplicitParam(name = "roleId", value = "角色id",required = true)
+    @ApiImplicitParam(name = "roleId", value = "角色id", required = true)
     @GetMapping(value = "/checked/{roleId}")
     public Result<List<RsGridCheckedVO>> checked(@PathVariable("roleId") String roleId) {
         List<RsGridCheckedVO> rsGridCheckedVOList = iRoleInfoFacade.getRsGridChecked(roleId);
@@ -238,44 +244,46 @@ public class RoleInfoController {
 
     /**
      * 获取角色配额授权情况列表
+     *
      * @param searchDTO
      * @return
      */
     @ApiOperation(value = "获取角色配额授权情况列表")
-    @ApiImplicitParam(name = "searchDTO", value = "查询条件,applicationId不能为空",required = true)
+    @ApiImplicitParam(name = "searchDTO", value = "查询条件,applicationId不能为空", required = true)
     @PostMapping(value = "/roleQuotaList/_search")
     public Result<List<RoleInfoVO>> getRoleQuotaList(SearchDTO searchDTO) {
         Searchable searchable = Searchable.toSearchable(searchDTO);
         Condition condition = searchable.getSearchFilterByKey("applicationId_eq");
-        if(null == condition) return Result.fail("400","applicationId 不能为空");
+        if (null == condition) return Result.fail("400", "applicationId 不能为空");
         String applicationId = (String) condition.getValue();
-        if(StringUtils.isBlank(applicationId)) return Result.fail("400","applicationId 不能为空");
+        if (StringUtils.isBlank(applicationId)) return Result.fail("400", "applicationId 不能为空");
         Page<RoleInfoVO> page = iRoleInfoFacade.getRoleQuotaList(searchDTO);
         return Result.success(page.getTotalElements(), page.getContent());
     }
 
     /**
      * 获取应用有限配额的角色列表
+     *
      * @param searchDTO
      * @return
      */
     @ApiOperation(value = "获取应用有限配额的角色列表")
-    @ApiImplicitParam(name = "searchDTO", value = "查询条件,applicationId不能为空",required = true)
+    @ApiImplicitParam(name = "searchDTO", value = "查询条件,applicationId不能为空", required = true)
     @PostMapping(value = "/orgQuotoAuthInfo/_search")
     public Result<List<RoleInfoVO>> getOrgQuotoAuthInfo(SearchDTO searchDTO) {
         Searchable searchable = Searchable.toSearchable(searchDTO);
         Condition condition = searchable.getSearchFilterByKey("applicationId_eq");
-        if(null == condition){
-            return Result.fail("400","applicationId 不能为空");
+        if (null == condition) {
+            return Result.fail("400", "applicationId 不能为空");
         }
         String applicationId = (String) condition.getValue();
-        if(StringUtils.isBlank(applicationId)){
-            return Result.fail("400","applicationId 不能为空");
+        if (StringUtils.isBlank(applicationId)) {
+            return Result.fail("400", "applicationId 不能为空");
         }
         Condition roleLevel_eq = searchable.getSearchFilterByKey("roleLevel_eq");
-        if (roleLevel_eq!=null){
+        if (roleLevel_eq != null) {
             searchable.removeSearchFilter("roleLevel_eq");
-            searchable.addSearchFilter("role_level",SearchOperator.eq,roleLevel_eq.getValue());
+            searchable.addSearchFilter("role_level", SearchOperator.eq, roleLevel_eq.getValue());
         }
         Page<RoleInfoVO> page = iRoleInfoFacade.getQuotoRoles(searchable.toSearchDTO());
         return Result.success(page.getTotalElements(), page.getContent());
@@ -289,7 +297,7 @@ public class RoleInfoController {
      */
     @ApiOperation(value = "角色初始配额信息保存")
     @Permission(value = "quota_init")
-    @PostMapping(value = "/roleQuota",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+    @PostMapping(value = "/roleQuota", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
     public Result roleQuotaSave(@RequestBody List<RoleQuotaVo> roleQuotaList) {
         Result result;
         try {
@@ -297,7 +305,7 @@ public class RoleInfoController {
             iRoleInfoFacade.roleQuotaSave(listStr);
             result = Result.success("保存成功");
         } catch (Exception e) {
-            logger.error("role quota save error:{}",e);
+            logger.error("role quota save error:{}", e);
             result = Result.fail(e.getMessage());
         }
         return result;
@@ -305,21 +313,22 @@ public class RoleInfoController {
 
     /**
      * 用户角色列表
+     *
      * @param searchDTO
      * @return
      */
     @ApiOperation(value = "用户角色列表")
-    @ApiImplicitParam(name = "searchDTO", value = "查询条件,staffId不能为空 ",required = true)
+    @ApiImplicitParam(name = "searchDTO", value = "查询条件,staffId不能为空 ", required = true)
     @PostMapping(value = "/userRole/_search")
     public Result<List<StaffAssignAuthInfoVo>> userRole(SearchDTO searchDTO) {
         Searchable searchable = Searchable.toSearchable(searchDTO);
         String staffId = (String) searchable.getSearchFilterByKey("staffId_eq").getValue();
-        if(StringUtils.isBlank(staffId)) return Result.fail("300","staffId 不能为空");
+        if (StringUtils.isBlank(staffId)) return Result.fail("300", "staffId 不能为空");
         Page<StaffAssignAuthInfo> page = iStaffAssignAuthInfoFacade.findForPage(searchable.toSearchDTO());
         List<StaffAssignAuthInfoVo> vos = new ArrayList<>();
         for (StaffAssignAuthInfo source : page.getContent()) {
             StaffAssignAuthInfoVo vo = new StaffAssignAuthInfoVo();
-            BeanUtils.copyProperties(source,vo);
+            BeanUtils.copyProperties(source, vo);
         }
         return Result.success(page.getTotalElements(), vos);
     }

+ 51 - 43
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/org/GovernmentInfoController.java

@@ -50,90 +50,98 @@ public class GovernmentInfoController {
     @Autowired
     private IGovUserInfoFacade iGovUserInfoFacade;
 
-    @ApiOperation(value="政务机构新增")
+    @ApiOperation(value = "政务机构新增")
     @PostMapping("govOrg")
-    public Result save(@RequestBody GovOrgVo vo){
-        try{
+    public Result save(@RequestBody GovOrgVo vo) {
+        try {
             GovInfo government = new GovInfo();
-            BeanUtils.copyProperties(government,vo);
-            if(StringUtils.isBlank(government.getUpGovId())){
+            BeanUtils.copyProperties(government, vo);
+            if (StringUtils.isBlank(government.getUpGovId())) {
                 government.setIsRoot("0");
-            }else{
+            } else {
                 government.setIsRoot("1");
             }
             SecurityUser user = (SecurityUser) ContextUtils.getUserInfo();
-            if (iGovInfoFacade.checkCode("", government.getCode()))
+            if (iGovInfoFacade.checkCode("", government.getCode())) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "政务机构代码已存在");
-            if (iGovInfoFacade.checkName("", government.getFullName(), ""))
+            }
+            if (iGovInfoFacade.checkName("", government.getFullName(), "")) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "政务机构名称已存在");
-            if (!iUserInfoFacade.getRootUser().equals(user.getUserName()) && StringUtils.isEmpty(government.getUpGovId()))
+            }
+            if (!iUserInfoFacade.getRootUser().equals(user.getUserName()) && StringUtils.isEmpty(government.getUpGovId())) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "请选择机构后再新增!");
+            }
             iGovInfoFacade.addGov(government);
-        }catch (Exception e){
+        } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"新增异常");
+            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "新增异常");
         }
         return Result.success();
     }
 
-    @ApiOperation(value="政务机构修改")
+    @ApiOperation(value = "政务机构修改")
     @PutMapping("govOrg/{id}")
-    public Result update(@RequestBody GovOrgVo vo){
-        try{
+    public Result update(@RequestBody GovOrgVo vo) {
+        try {
             GovInfo government = new GovInfo();
-            BeanUtils.copyProperties(government,vo);
+            BeanUtils.copyProperties(government, vo);
             government = setUpdateProperties(government);
             iGovInfoFacade.updateGov(government);
-        }catch(Exception e){
+        } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"修改异常");
+            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "修改异常");
         }
         return Result.success();
     }
 
     @ApiOperation(value = "删除政务机构")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "机构ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @DeleteMapping("govOrg/{id}")
-    public Result delete(@PathVariable("id") String id){
+    public Result delete(@PathVariable("id") String id) {
         Searchable searchable = Searchable.newSearchable();
-        searchable.addSearchFilter("gov_id", SearchOperator.eq,id);
-        searchable.addSearchFilter("deleted",SearchOperator.eq, YesNotEnum.NO.getValue());
+        searchable.addSearchFilter("gov_id", SearchOperator.eq, id);
+        searchable.addSearchFilter("deleted", SearchOperator.eq, YesNotEnum.NO.getValue());
         SearchDTO searchDTO = searchable.toSearchDTO();
         Page<GovUserInfo> page = iGovUserInfoFacade.govUserInfoPage(searchDTO);
-        if (page.getContent().size() > 0)
+        if (page.getContent().size() > 0) {
             return Result.fail("该机构有人员存在,不可删除");
+        }
         iGovInfoFacade.deleteOrg(id);
         return Result.success();
     }
 
-    @ApiOperation(value="获取政务机构")
+    @ApiOperation(value = "获取政务机构")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "机构ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "govOrg/{id}")
-    public Result get(@PathVariable("id") String id){
+    public Result get(@PathVariable("id") String id) {
         GovInfo government = new GovInfo();
         government = iGovInfoFacade.getGovInfoById(id);
         GovOrgVo vo = new GovOrgVo();
         try {
-            BeanUtils.copyProperties(vo,government);
+            BeanUtils.copyProperties(vo, government);
         } catch (Exception e) {
-            logger.error(e.getMessage(),e);
+            logger.error(e.getMessage(), e);
             return Result.fail("属性复制异常");
         }
         return Result.success(vo);
     }
 
 
-    @ApiOperation(value="政务机构树")
-    @ApiImplicitParam(name = "id",value = "id")
+    @ApiOperation(value = "政务机构树")
+    @ApiImplicitParam(name = "id", value = "id")
     @PostMapping(value = "govOrg/tree/full")
     public Result fullGovTree(@RequestBody Map params) {
         String id = (String) params.get("id");
-        if (StringUtils.isEmpty(id)){
+        if (StringUtils.isEmpty(id)) {
             //根节点
             GovInfo root = iGovInfoFacade.getRootGov();
             List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
-            resultList.add(treeMapFilter(root,null,""));
+            resultList.add(treeMapFilter(root, null, ""));
             return Result.success(resultList);
         }
-        return  Result.success(getChildTreeNode(id, YesNotEnum.NO.getValue()));
+        return Result.success(getChildTreeNode(id, YesNotEnum.NO.getValue()));
     }
 
     @ApiOperation(value = "政务机构拖动排序")
@@ -143,12 +151,12 @@ public class GovernmentInfoController {
             @ApiImplicitParam(name = "moveType", value = "prev:目标机构前,next: 目标机构后", required = true)
     })
     @PostMapping(value = "govOrg/sort")
-    public Result reSort(@RequestBody SortVo sortVo){
-        try{
+    public Result reSort(@RequestBody SortVo sortVo) {
+        try {
             iGovInfoFacade.reSort(sortVo.getStartId(), sortVo.getEndId(), sortVo.getMoveType());
-        }catch (Exception e){
+        } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"排序异常");
+            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "排序异常");
         }
 
         return Result.success();
@@ -160,16 +168,16 @@ public class GovernmentInfoController {
             @ApiImplicitParam(name = "pageSize", value = "页数", required = true)
     })
     @PostMapping(value = "govOrg/tree/match")
-    public Result govMatch( @RequestBody Map map){
-        String name =map.get("name").toString();
-        Integer pageNum =Integer.valueOf(map.get("pageNum").toString());
-        Integer pageSize =Integer.valueOf(map.get("pageSize").toString());
-        return Result.success(iGovInfoFacade.govMatch(name,pageNum,pageSize).getResult());
+    public Result govMatch(@RequestBody Map map) {
+        String name = map.get("name").toString();
+        Integer pageNum = Integer.valueOf(map.get("pageNum").toString());
+        Integer pageSize = Integer.valueOf(map.get("pageSize").toString());
+        return Result.success(iGovInfoFacade.govMatch(name, pageNum, pageSize).getResult());
     }
 
-    private GovInfo setUpdateProperties(GovInfo government){
+    private GovInfo setUpdateProperties(GovInfo government) {
         GovInfo oldGov = new GovInfo();
-        if(StringUtils.isNotBlank(government.getId())){
+        if (StringUtils.isNotBlank(government.getId())) {
             oldGov = iGovInfoFacade.getGovInfoById(government.getId());
         }
         oldGov.setId(government.getId());
@@ -186,7 +194,7 @@ public class GovernmentInfoController {
      *
      * @param government
      * @param orgNums
-     * @param state   节点勾选状态
+     * @param state      节点勾选状态
      * @return
      */
     private Map<String, Object> treeMapFilter(GovInfo government, Map<String, Long> orgNums, String state) {
@@ -196,7 +204,7 @@ public class GovernmentInfoController {
         map.put("name", StringEscapeUtils.unescapeHtml4(government.getFullName()));
         map.put("pid", government.getUpGovId());
         map.put("isParent", true);
-        if (null == orgNums){
+        if (null == orgNums) {
             map.put("isParent", true);
             return map;
         }

+ 40 - 20
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/org/OrgInfoController.java

@@ -9,12 +9,10 @@ import com.dragoninfo.dcuc.authweb.restcontroller.org.vo.OrgRangeVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.org.vo.OrgVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.org.vo.SortVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.statisics.vo.OrgTreeNodeVo;
-
 import com.dragoninfo.dcuc.authweb.util.UserUtils;
 import com.dragoninfo.dcuc.authweb.util.VersionUtils;
 import com.dragoninfo.dcuc.org.entity.OrgInfo;
 import com.dragoninfo.dcuc.org.facade.IOrgInfoFacade;
-
 import com.dragoninfo.dcuc.org.vo.OrgTreeNode;
 import com.dragoninfo.dcuc.user.admin.entity.OrgMtAuth;
 import com.dragoninfo.dcuc.user.admin.facade.*;
@@ -57,7 +55,7 @@ import java.util.*;
 
 @Api(tags = {"机构管理接口"})
 @RestController
-@RequestMapping(value = "/orgsvr/"+ VersionUtils.VERSION_UID+"/")
+@RequestMapping(value = "/orgsvr/" + VersionUtils.VERSION_UID + "/")
 public class OrgInfoController {
     @Autowired
     private IOrgInfoFacade iOrgInfoFacade;
@@ -82,6 +80,7 @@ public class OrgInfoController {
 
     /**
      * 当前用户的管理范围机构树
+     *
      * @param params type:机构树类型 (ORG:机构管理范围 USER:用户管理范围 APP:权限管理范围 MGE:管理员管理范围 ), id:异步加载的树节点
      * @return
      */
@@ -110,12 +109,13 @@ public class OrgInfoController {
      * 获取单个树节点机构信息
      */
     @ApiOperation(value = "单个树节点信息")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "机构ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "org/tree/node/{id}")
-    public Result<OrgTreeNodeVo> orgTreeNode(@PathVariable("id")String id) {
+    public Result<OrgTreeNodeVo> orgTreeNode(@PathVariable("id") String id) {
         OrgTreeNode orgTreeNode = iOrgInfoFacade.getOrgTreeNode(id);
         OrgTreeNodeVo vo = new OrgTreeNodeVo();
-        BeanUtils.copyProperties(orgTreeNode,vo);
+        BeanUtils.copyProperties(orgTreeNode, vo);
         vo.setName(orgTreeNode.getLabel());
         return Result.success(vo);
     }
@@ -123,6 +123,7 @@ public class OrgInfoController {
 
     /**
      * 管理员管理—管理范围—分配树
+     *
      * @return
      */
     @ApiOperation(value = "管理员管理—管理范围—分配树")
@@ -138,10 +139,10 @@ public class OrgInfoController {
         String userId = orgRangeVo.getUserId();
         //获取管理范围ids
         SecurityUser curUser = (SecurityUser) ContextUtils.getUserInfo();
-        String mtAuthIds = mtAuthService.getMtAuth(curUser.getId(),mtType);
+        String mtAuthIds = mtAuthService.getMtAuth(curUser.getId(), mtType);
         //当临时表没有数据时候,获取登录人的权限范围
-        if (StringUtils.isEmpty(mtAuthIds)&&SysConstants.MT_TEMP.equals(orgRangeVo.getMtType())){
-            mtAuthIds=iAppMtAuthFacade.mgeAppRightRangeStr(ContextUtils.getUserInfo().getId());
+        if (StringUtils.isEmpty(mtAuthIds) && SysConstants.MT_TEMP.equals(orgRangeVo.getMtType())) {
+            mtAuthIds = iAppMtAuthFacade.mgeAppRightRangeStr(ContextUtils.getUserInfo().getId());
         }
         if (StringUtils.isEmpty(id)) {
             //获取机构树根节点列表
@@ -155,6 +156,7 @@ public class OrgInfoController {
 
     /**
      * 、机构新增
+     *
      * @return
      */
     @ApiOperation(value = "机构新增")
@@ -165,13 +167,16 @@ public class OrgInfoController {
             UserUtils.copyObject(orgInfo, vo);
             SecurityUser user = (SecurityUser) ContextUtils.getUserInfo();
             orgInfo = this.upSetOrg(orgInfo);
-            if (iOrgInfoFacade.checkCode("", orgInfo.getCode()) != null)
+            if (iOrgInfoFacade.checkCode("", orgInfo.getCode()) != null) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "机构代码已存在");
-            if (iOrgInfoFacade.checkName("", orgInfo.getFullName(), "") != null)
+            }
+            if (iOrgInfoFacade.checkName("", orgInfo.getFullName(), "") != null) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "机构名称已存在");
+            }
 
-            if (!iUserInfoFacade.getRootUser().equals(user.getUserName()) && StringUtils.isEmpty(orgInfo.getUpGovId()))
+            if (!iUserInfoFacade.getRootUser().equals(user.getUserName()) && StringUtils.isEmpty(orgInfo.getUpGovId())) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "请选择机构后再新增!");
+            }
             //保存机构在这
             orgInfo = iOrgInfoFacade.addOrg(orgInfo);
             // TODO: 2019/1/30
@@ -203,10 +208,12 @@ public class OrgInfoController {
     @PutMapping(value = "org/{id}")
     public Result update(@RequestBody OrgVo vo) {
         try {
-            if (iOrgInfoFacade.checkCode(vo.getId(), vo.getCode()) != null)
+            if (iOrgInfoFacade.checkCode(vo.getId(), vo.getCode()) != null) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "机构代码已存在");
-            if (iOrgInfoFacade.checkName(vo.getId(), vo.getFullName(), "") != null)
+            }
+            if (iOrgInfoFacade.checkName(vo.getId(), vo.getFullName(), "") != null) {
                 return Result.fail(ResultEnum.FAIL.getKey(), "机构名称已存在");
+            }
             OrgInfo orgInfo = iOrgInfoFacade.detail(vo.getId());
             Date date = orgInfo.getOrgEndDate();
             UserUtils.copyObject(orgInfo, vo);
@@ -221,6 +228,7 @@ public class OrgInfoController {
 
     /**
      * 设置org更新值
+     *
      * @param orgInfo
      */
 
@@ -250,10 +258,12 @@ public class OrgInfoController {
 
     /**
      * 机构删除
+     *
      * @return
      */
     @ApiOperation(value = "机构删除")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "机构ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @DeleteMapping(value = "org/{id}")
     public Result deleteOrg(@PathVariable("id") String id) {
         logger.info(id);
@@ -262,11 +272,13 @@ public class OrgInfoController {
         searchable.addSearchFilter("deleted", SearchOperator.eq, YesNotEnum.NO.getValue());
         SearchDTO searchDTO = searchable.toSearchDTO();
         Page<UserInfo> page = iUserInfoFacade.userList(searchDTO);
-        if (page.getContent().size() > 0)
+        if (page.getContent().size() > 0) {
             return Result.fail(ResultEnum.FAIL.getKey(), "该机构有人员存在,不可删除");
+        }
         Page<ApplyInfo> appPage = applyInfoFacade.applyInfoPage(searchDTO);
-        if (appPage.getContent().size() > 0)
+        if (appPage.getContent().size() > 0) {
             return Result.fail(ResultEnum.FAIL.getKey(), "该机构有应用存在,不可删除");
+        }
 //        searchable = Searchable.newSearchable();
 //        searchable.addSearchFilter("orgId", SearchOperator.eq, id);
 //        searchDTO = searchable.toSearchDTO();
@@ -308,6 +320,7 @@ public class OrgInfoController {
 
     /**
      * 机构合并
+     *
      * @param mergersVo
      * @return
      */
@@ -330,7 +343,7 @@ public class OrgInfoController {
                     iAppMtAuthFacade.save("", note.getUserId());
                     iUserMtAuthFacade.save("", note.getUserId());
                     iOrgMtAuthFacade.save("", note.getUserId());
-                    iManageInfoFacade.deleteAdmin(note.getUserId(),"");
+                    iManageInfoFacade.deleteAdmin(note.getUserId(), "");
                 }
             }
         }
@@ -355,12 +368,14 @@ public class OrgInfoController {
 
     /**
      * 机构详情
+     *
      * @param orgId
      * @return
      */
     @GetMapping(value = "org/{id}")
     @ApiOperation(value = "获取单个机构")
-    @ApiImplicitParam(name = "id", value = "id", required = true)
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "机构ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     public Result<OrgVo> orgInfoDetail(@PathVariable(value = "id") String orgId) {
         OrgInfo detail = iOrgInfoFacade.detail(orgId);
         OrgVo org = new OrgVo();
@@ -372,6 +387,7 @@ public class OrgInfoController {
 
     /**
      * orginfo转map
+     *
      * @param orgInfosList
      * @param orgNums
      * @return
@@ -577,6 +593,7 @@ public class OrgInfoController {
 
     /**
      * 根据ids获取初始树根节点
+     *
      * @param mtAuthIds:管理范围ids
      * @return
      */
@@ -601,6 +618,7 @@ public class OrgInfoController {
 
     /**
      * 异步获取子节点
+     *
      * @param parentId  父节点id
      * @param state     机构状态:0:未删除,1:已删除,null:全部
      * @param mtAuthIds 管理范围,为""或null时不过滤
@@ -625,6 +643,7 @@ public class OrgInfoController {
 
     /**
      * 管理员管理-管理范围-节点状态勾选
+     *
      * @param treeNodes
      * @param type         机构树类型
      * @param targetUserId
@@ -706,6 +725,7 @@ public class OrgInfoController {
 
     /**
      * 审计管理—机构树
+     *
      * @param type 机构树类型 ORG:机构管理范围 USER:用户管理范围 APP:权限管理范围 MGE:管理员管理范围
      * @param id   异步加载的树节点
      * @return
@@ -758,7 +778,7 @@ public class OrgInfoController {
             return Result.success();
         }
         ResponseDTO responseDTO = iOrgInfoFacade.orgMatch(name, mts, pageNum, pageSize);
-        return Result.success(StringUtils.getLong(responseDTO.getMessage()),responseDTO.getResult());
+        return Result.success(StringUtils.getLong(responseDTO.getMessage()), responseDTO.getResult());
     }
 
     @ApiOperation(value = "获取过滤后的父节点")

+ 8 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/DataSourceController.java

@@ -11,6 +11,8 @@ import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import com.dragonsoft.duceap.core.entity.response.ResponseResult;
 import com.dragonsoft.duceap.core.search.Searchable;
 import com.dragonsoft.duceap.web.controller.BaseController;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -54,6 +56,8 @@ public class DataSourceController extends BaseController {
         return ResponseResult.newInstance(ResponseResult.toConvert(objects, searchable));
     }
 
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "表码ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @RequestMapping(value = "editRow/{id}")
     public String editRow(@PathVariable("id") String id, Model model) {
         MdDatasourceDTO mdDataSource = iDuceapMdDataSourceFacade.get(id);
@@ -61,6 +65,8 @@ public class DataSourceController extends BaseController {
         return "resourceManagement/datasource/dataSourceEdit";
     }
 
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "表码ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @RequestMapping(value = "viewRow/{id}")
     public String viewRow(@PathVariable("id") String id, Model model) {
         MdDatasourceDTO mdDataSource = iDuceapMdDataSourceFacade.get(id);
@@ -73,6 +79,8 @@ public class DataSourceController extends BaseController {
         return "resourceManagement/datasource/dataSourceView";
     }
 
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "表码ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @RequestMapping(value = "delete/{id}")
     @ResponseBody
     public ResponseStatus delete(@PathVariable("id") String id) {

+ 4 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/DuceapUploadController.java

@@ -3,6 +3,8 @@ package com.dragoninfo.dcuc.authweb.restcontroller.resource;
 import com.dragoninfo.dcuc.duceap.facade.IFileUploadFacade;
 import com.dragonsoft.duceap.base.entity.uploader.FileHolder;
 import feign.Response;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -31,6 +33,8 @@ public class DuceapUploadController {
         return upload;
     }
 
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "/view/{id}")
     public void view(@PathVariable("id") String id, HttpServletResponse response) {
         Response view = iFileUploadFacade.view(id);

+ 5 - 2
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/MdDynCodeDicController.java

@@ -11,6 +11,7 @@ import com.dragonsoft.duceap.base.entity.search.SearchDTO;
 import com.dragonsoft.duceap.web.controller.BaseController;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
@@ -57,7 +58,8 @@ public class MdDynCodeDicController extends BaseController {
     }
 
     @ApiOperation(value = "修改表码")
-    @ApiImplicitParam(name = "codeDicVo", value = "表码vo")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "表码ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @PutMapping(value = "/code/{id}")
     public Result update(CodeDicVo codeDicVo) {
         try {
@@ -119,7 +121,8 @@ public class MdDynCodeDicController extends BaseController {
      * @return
      */
     @ApiOperation(value = "查询表码")
-    @ApiImplicitParam(name = "id", value = "id")
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "表码ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @GetMapping(value = "/code/{id}")
     public Result<CodeDicVo> getModel(@PathVariable("id") String id) {
         CodeDicDTO codeDic = iDuceapCodeFacade.get(id);

+ 6 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/resource/MdDynCodeDicSonController.java

@@ -12,6 +12,8 @@ import com.dragonsoft.duceap.core.entity.response.ResponseResult;
 import com.dragonsoft.duceap.core.search.Searchable;
 import com.dragonsoft.duceap.core.search.enums.SearchOperator;
 import com.dragonsoft.duceap.web.controller.BaseController;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -62,6 +64,8 @@ public class MdDynCodeDicSonController extends BaseController {
         return codeList;
     }
 
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "表码ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @RequestMapping(value = "previewData/{id}")
     public String previewData(@PathVariable("id") String id, Model model) {
         try {
@@ -91,6 +95,8 @@ public class MdDynCodeDicSonController extends BaseController {
 
     }
 
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "表码ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @RequestMapping(value = "data/{id}")
     @ResponseBody
     public List<Map<String, Object>> Data(@PathVariable("id") String id, String code, String name) {

+ 5 - 2
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/statisics/ManageStatisicsController.java

@@ -4,6 +4,8 @@ import com.dragoninfo.dcuc.org.facade.IOrgInfoFacade;
 import com.dragoninfo.dcuc.user.admin.facade.IManageInfoFacade;
 import com.dragonsoft.duceap.web.controller.BaseController;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -33,11 +35,12 @@ public class ManageStatisicsController extends BaseController {
      * @return
      */
 
-
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @ApiOperation(value = "获取警员管理员统计列表")
     @GetMapping(value = "statisics/{id}")
     public List<Map<String, String>> getMgeSpreadDtlList(@PathVariable String id) {
-        if(id.equals("null")){
+        if (id.equals("null")) {
             id = "";
         }
         List<Map<String, String>> list = iManageInfoFacade.mgeSpreadDtlListForGD(id);

+ 4 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/statisics/UserStatisicsController.java

@@ -9,6 +9,8 @@ import com.dragoninfo.dcuc.user.user.facade.IUserInfoFacade;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import com.dragonsoft.duceap.web.controller.BaseController;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -66,6 +68,8 @@ public class UserStatisicsController extends BaseController {
      * @param id 节点机构id
      * @return
      */
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "机构ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @ApiOperation(value = "获取完整树下各用户数量")
     @GetMapping(value = "statisics/{id}")
     public List<OrgTreeNodeVo> treeGrid(@PathVariable String id) {

+ 47 - 45
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/user/PoliceManagementController.java

@@ -109,22 +109,22 @@ public class PoliceManagementController {
 
     @ApiOperation(value = "获取警员")
     @GetMapping(value = "/police/{id}")
-    @ApiImplicitParam(name = "id", value = "id", required = true)
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "用户ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     public Result<PoliceInVo> get(@PathVariable("id") String id) {
         UserInfo userInfo = new UserInfo();
         userInfo = userInfoFacade.userDetail(id);
         List<PostInfo> postInfos = postInfoFacade.getPostInfos(id);
-        PoliceInVo policeInVo=new PoliceInVo();
-        UserUtils.copyObject( policeInVo,userInfo);
-        List<PostInfoVo> list=UserUtils.copyObjectByVo(postInfos);
+        PoliceInVo policeInVo = new PoliceInVo();
+        UserUtils.copyObject(policeInVo, userInfo);
+        List<PostInfoVo> list = UserUtils.copyObjectByVo(postInfos);
         policeInVo.setPostInfos(list);
-        policeInVo.setFile( uploadhandler.queryByBusiId(id,""));
-        List<FileHolder> fileHolders = uploadhandler.queryByBusiId(id,"");
+        policeInVo.setFile(uploadhandler.queryByBusiId(id, ""));
+        List<FileHolder> fileHolders = uploadhandler.queryByBusiId(id, "");
         return Result.success(policeInVo);
     }
 
 
-
     @ApiOperation(value = "修改警员")
     @PutMapping(value = "/police/{id}")
     public Result update(@RequestBody PoliceInVo userVo) {
@@ -132,26 +132,26 @@ public class PoliceManagementController {
             UserInfo info = new UserInfo();
             //用户PoliceInVo copy到UserInfo
             setUser(userVo, info);
-            if (UserUtils.verificaName(info)){
-                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"姓名不能为ADMIN");
+            if (UserUtils.verificaName(info)) {
+                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "姓名不能为ADMIN");
             }
-            if (UserUtils.verificaIdcard(info,userInfoFacade)){
-                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"身份证重复!");
+            if (UserUtils.verificaIdcard(info, userInfoFacade)) {
+                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "身份证重复!");
             }
             if (CollectionUtils.isEmpty(info.getPostInfos())) {
-                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"职务信息不能为空!");
+                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "职务信息不能为空!");
             }
             //设置用户部门
             UserUtils.setUserOrg(orgInfoFacade, info.getPostInfos(), info);
             ResponseStatus responseStatus = userInfoFacade.savePolice(info);
-            if(!responseStatus.getStatusCode().equals("200")){
-                return  Result.fail(responseStatus.getStatusCode(),responseStatus.getMessage());
-            }else {
+            if (!responseStatus.getStatusCode().equals("200")) {
+                return Result.fail(responseStatus.getStatusCode(), responseStatus.getMessage());
+            } else {
                 return Result.success();
             }
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"保存异常");
+            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "保存异常");
         }
     }
 
@@ -162,31 +162,32 @@ public class PoliceManagementController {
             UserInfo info = new UserInfo();
             setUser(userVo, info);
             //姓名不能为ADMIN
-            if (UserUtils.verificaIdcard(info,userInfoFacade)){
-                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"身份证重复!");
+            if (UserUtils.verificaIdcard(info, userInfoFacade)) {
+                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "身份证重复!");
             }
-            if (UserUtils.verificaName(info)){
-                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"姓名不能为ADMIN");
+            if (UserUtils.verificaName(info)) {
+                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "姓名不能为ADMIN");
             }
             if (CollectionUtils.isEmpty(info.getPostInfos())) {
-                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"职务信息不能为空!");
+                return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "职务信息不能为空!");
             }
             //设置用户部门
             UserUtils.setUserOrg(orgInfoFacade, info.getPostInfos(), info);
             ResponseStatus responseStatus = userInfoFacade.savePolice(info);
-            if(!responseStatus.getStatusCode().equals("200")){
-                return  Result.fail(responseStatus.getStatusCode(),responseStatus.getMessage());
-            }else {
+            if (!responseStatus.getStatusCode().equals("200")) {
+                return Result.fail(responseStatus.getStatusCode(), responseStatus.getMessage());
+            } else {
                 return Result.success();
             }
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"保存异常");
+            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "保存异常");
         }
     }
 
     @ApiOperation(value = "删除警员")
-    @ApiImplicitParam(name = "id", value = "id", required = true)
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "path", name = "id", value = "用户ID", required = true
+            , example = "40288a8b699fc2500169a33b20540000")})
     @DeleteMapping(value = "/police/{id}")
     public Result del(@PathVariable("id") String id) {
         try {
@@ -197,7 +198,7 @@ public class PoliceManagementController {
             return Result.success("删除成功");
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(),"删除失败");
+            return Result.fail(ResultEnum.SERVICE_FAIL.getValue(), "删除失败");
         }
     }
 
@@ -210,8 +211,8 @@ public class PoliceManagementController {
         BigDecimal num = new BigDecimal(1);
         BigDecimal sort = userInfoFacade.sortNew(UserTypeEnum.POLICE.getValue()).add(num);
         HashMap<String, String> map = new HashMap<>();
-        map.put("policeNumber",pn+"");
-        map.put("pSortNo",sort+"");
+        map.put("policeNumber", pn + "");
+        map.put("pSortNo", sort + "");
         return Result.success(map);
     }
 
@@ -227,14 +228,14 @@ public class PoliceManagementController {
             @ApiImplicitParam(name = "id", value = "postId 职务ID", required = true),
             @ApiImplicitParam(name = "sort", value = "排序 10:上升,20:下降", required = true)
     })
-    public Result jySortPo(@RequestBody Map<String,String> map) {
+    public Result jySortPo(@RequestBody Map<String, String> map) {
         String id = map.get("id");
-        String sortType =  map.get("sort");
+        String sortType = map.get("sort");
         try {
             userInfoFacade.jySortPo(id, sortType);
             return Result.success();
         } catch (Exception e) {
-            logger.error("排序失败",e);
+            logger.error("排序失败", e);
             return Result.fail(ResultEnum.FAIL.getValue());
         }
     }
@@ -274,11 +275,11 @@ public class PoliceManagementController {
     public void batchExport(HttpServletRequest request, HttpServletResponse response) {
         String orgIds = request.getParameter("orgIds");
         try {
-            SearchDTO searchDTO=new SearchDTO();
+            SearchDTO searchDTO = new SearchDTO();
             //TODO 导出无数据
             List<UserInfoView> userInfoViews = userInfoFacade.batchExportPolice(orgIds);
             searchDTO.setMetadata(template());
-            ExportExcelUtils.exportPoliceExcel("警员信息", userInfoViews,Searchable.toSearchable(searchDTO).getMetaData(), request, response);
+            ExportExcelUtils.exportPoliceExcel("警员信息", userInfoViews, Searchable.toSearchable(searchDTO).getMetaData(), request, response);
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
             throw new ApplicationException(300, "导出失败", e);
@@ -302,25 +303,26 @@ public class PoliceManagementController {
             List<UserInfo> list = ImpExcelUtils.loadScoreInfo(inputStream, UserTypeEnum.POLICE.getValue());
             String message = this.impPolice(list);
             if (message != null) {
-                if(message.startsWith("身份证或警号重复,未保存人员")){
+                if (message.startsWith("身份证或警号重复,未保存人员")) {
                     throw new NumberFormatException(message);
                 }
             }
             return Result.success("导入成功");
         } catch (IOException e) {
             logger.error(e.getMessage(), e);
-            return Result.fail("300","导入文件类型错误");
+            return Result.fail("300", "导入文件类型错误");
         } catch (NumberFormatException e) {
 
-            return Result.fail("300",e.getMessage());
+            return Result.fail("300", e.getMessage());
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
-            return Result.fail("300","导入失败");
+            return Result.fail("300", "导入失败");
         }
     }
 
     /**
      * 根据业务域获取警种,通过机构id和警种获取用户
+     *
      * @return
      */
     @PostMapping(value = "police/businessUser")
@@ -335,7 +337,7 @@ public class PoliceManagementController {
         String business = businessVo.getBusiness();
         SecurityUser securityUser = (SecurityUser) ContextUtils.getUserInfo();
         UserInfo user = userInfoFacade.userDetail(securityUser.getId());
-        if (StringUtils.isEmpty(orgId) || StringUtils.isEmpty(business)){
+        if (StringUtils.isEmpty(orgId) || StringUtils.isEmpty(business)) {
             return Result.success(list);
         }
         Searchable searchable = new SearchRequest();
@@ -412,7 +414,7 @@ public class PoliceManagementController {
             @ApiImplicitParam(name = "availableId", value = "未选警员id,用逗号隔开")
     })
     @ApiOperation(value = "业务域保存配置")
-    public Result saveBusiness(@RequestBody BusinessVo businessVo ) {
+    public Result saveBusiness(@RequestBody BusinessVo businessVo) {
         try {
             String orgId = businessVo.getOrgId();
             String business = businessVo.getBusiness();
@@ -425,11 +427,13 @@ public class PoliceManagementController {
         }
         return Result.success("保存成功");
     }
+
     /**
      * 模板
+     *
      * @return
      */
-    private String template(){
+    private String template() {
         return "[{\"name\":\"name\",\"displyName\":\"姓名\"},{\"name\":\"policeNumber\",\"displyName\":\"警号\"}," +
                 "{\"name\":\"idcard\",\"displyName\":\"身份证\"}," +
                 "{\"name\":\"orgCode\",\"displyName\":\"单位机构代码\"}," +
@@ -455,6 +459,7 @@ public class PoliceManagementController {
 
     /**
      * copy UserInfo
+     *
      * @param userVo
      * @param info
      * @throws IllegalAccessException
@@ -532,7 +537,7 @@ public class PoliceManagementController {
             if (orgInfo == null) {
                 throw new NumberFormatException("身份证" + info.getIdcard() + "用户的单位机构代码不存在!");
             }
-            if (!AuthUtils.isHaveAuth(orgMgeMt, orgInfo)&&!userInfoFacade.isRootUser(ContextUtils.getUserInfo().getId())) {
+            if (!AuthUtils.isHaveAuth(orgMgeMt, orgInfo) && !userInfoFacade.isRootUser(ContextUtils.getUserInfo().getId())) {
                 throw new NumberFormatException("没有身份证" + info.getIdcard() + "用户所填写单位机构代码的管理权限!");
             }
             info.setSortNo(sort);
@@ -547,7 +552,4 @@ public class PoliceManagementController {
     }
 
 
-
-
-
 }