qxp192083 5 年 前
コミット
ccbda1eee1

+ 18 - 0
dgtly-admin/src/main/java/com/dgtly/web/controller/people/EntryPassController.java

@@ -1,6 +1,10 @@
 package com.dgtly.web.controller.people;
 
 import java.util.List;
+import java.util.Map;
+
+import com.dgtly.framework.util.ShiroUtils;
+import com.dgtly.system.domain.SysUser;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -78,5 +82,19 @@ public class EntryPassController extends BaseController
         return toAjax(entryPassService.updateEntryPass(entryPass));
     }
 
+    /**
+     * 获取出入证待审批列表
+     * @return
+     */
+    @PostMapping("/checkPass")
+    @ResponseBody
+    public AjaxResult checkPass(EntryPass entryPass){
+
+        int i  = entryPassService.updateEntryPass(entryPass);
+        if(i>0){
+            return success();
+        }
+        return error();
+    }
 
 }

+ 2 - 3
dgtly-admin/src/main/java/com/dgtly/web/core/config/SwaggerConfig.java

@@ -2,7 +2,6 @@ package com.dgtly.web.core.config;
 
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import com.dgtly.common.config.Global;
 import io.swagger.annotations.ApiOperation;
 import springfox.documentation.builders.ApiInfoBuilder;
 import springfox.documentation.builders.PathSelectors;
@@ -54,9 +53,9 @@ public class SwaggerConfig
                 // 描述
                 .description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
                 // 作者信息
-                .contact(new Contact(Global.getName(), null, null))
+                .contact(new Contact("神州通誉", null, null))
                 // 版本
-                .version("版本号:" + Global.getVersion())
+                .version("版本号:1.0")
                 .build();
     }
 }

+ 1 - 1
dgtly-admin/src/main/resources/application-dev.yml

@@ -7,7 +7,7 @@ ruoyi:
   # 版权年份
   copyrightYear: 2019
   # 实例演示开关
-  demoEnabled: false
+  demoEnabled: true
   # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
   profile: D:/testfile/dgtly/uploadPath
   # 获取ip地址开关

+ 38 - 7
dgtly-admin/src/main/resources/templates/system/people/pass/pass.html

@@ -40,11 +40,16 @@
                     visible: false
                 },
                 {
-                    field : 'isWuhan', 
-                    title : '是否有武汉旅居史',
-                    formatter: function(value, row, index) {
-                       return $.table.selectDictLabel(isWuhanDatas, value);
-                    }
+                    field : 'username',
+                    title : '姓名'
+                },
+                {
+                    field : 'phonenumber',
+                    title : '电话'
+                },
+                {
+                    field : 'idCard',
+                    title : '身份证'
                 },
                 {
                     field : 'address', 
@@ -66,13 +71,29 @@
                     field : 'ownership', 
                     title : '房产证或租房合同'
                 },
+                {
+                    field : 'isWuhan',
+                    title : '是否有武汉旅居史',
+                    formatter: function(value, row, index) {
+                        return value="1"?"是":"否";
+                    }
+                },
                 {
                     field : 'auditOpinion', 
                     title : '审核意见'
                 },
                 {
                     field : 'status', 
-                    title : '状态0未审核  1 通过审核  -1未通过审核'
+                    title : '状态',
+                    formatter: function(value, row, index) {
+                        if(value=="0"){
+                            return "未审核"
+                        }else if(value=="1"){
+                            return "已通过"
+                        }else if(value=="2"){
+                            return "已拒绝"
+                        }
+                    }
                 },
                 {
                     title: '操作',
@@ -80,7 +101,8 @@
                     formatter: function(value, row, index) {
                         var actions = [];
                         if(row.status=="0"){
-                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>审核</a> ');
+                            actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="check(\'' + row.userId + '\',\'1'+'\')"><i class="fa fa-check"></i>通过</a> ');
+                            actions.push('<a class="btn btn-danger btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="check(\'' + row.userId + '\',\'2'+'\')"><i class="fa fa-ban"></i>拒绝</a> ');
                         }
                         return actions.join('');
                     }
@@ -88,6 +110,15 @@
             };
             $.table.init(options);
         });
+        function check(userId,status){
+            var json = {
+                "userId":userId,
+                "status":status
+            }
+            $.operate.post("people/pass/checkPass",json,function(res){
+                console.log(res)
+            })
+        }
     </script>
 </body>
 </html>

+ 6 - 15
dgtly-admin/src/main/resources/templates/system/people/people.html

@@ -42,15 +42,6 @@
                 <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="people:people:add">
                     <i class="fa fa-plus"></i> 添加
                 </a>
-                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="people:people:edit">
-                    <i class="fa fa-edit"></i> 修改
-                </a>
-                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="people:people:remove">
-                    <i class="fa fa-remove"></i> 删除
-                </a>
-                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="people:people:export">
-                    <i class="fa fa-download"></i> 导出
-                 </a>
             </div>
             <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
@@ -105,13 +96,13 @@
                     }
                 },
                 {
-                    field : 'idWuhan',
+                    field : 'isWuhan',
                     title : '是否有武汉旅居史',
                     formatter: function (value, row, index) {
                         if(value==0){
-                            return "没有"
+                            return ""
                         }else if(value==1){
-                            return ""
+                            return ""
                         }
 
                     }
@@ -131,8 +122,8 @@
                     formatter: function(value, row, index) {
                         var actions = [];
                         actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="openTemperature(\'' + row.userId + '\')"><i class="fa fa-edit"></i>体温</a> ');
-                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a>');
+                        //actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.userId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                        //actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.userId + '\')"><i class="fa fa-remove"></i>删除</a>');
                         return actions.join('');
                     }
                 }]
@@ -141,7 +132,7 @@
         });
 
         function openTemperature(userId){
-            $.modal.open("修改头像", "temperature/"+userId);
+            $.modal.open("温度列表", "temperature/"+userId);
         }
     </script>
 </body>

+ 4 - 1
dgtly-api/src/main/java/com/dgtly/api/controller/CommonController.java

@@ -6,6 +6,8 @@ import com.dgtly.common.config.Global;
 import com.dgtly.common.config.ServerConfig;
 import com.dgtly.common.core.domain.AjaxResult;
 import com.dgtly.common.utils.file.FileUploadUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -15,7 +17,7 @@ import org.springframework.web.multipart.MultipartFile;
 @Controller
 public class CommonController {
 
-
+    private static final Logger log = LoggerFactory.getLogger(CommonController.class);
     @Autowired
     private ServerConfig serverConfig;
     /**
@@ -40,6 +42,7 @@ public class CommonController {
         }
         catch (Exception e)
         {
+            log.error("上传图片错误",e);
             return AjaxResult.error(e.getMessage());
         }
     }

+ 1 - 1
dgtly-api/src/main/resources/application.yml

@@ -1,4 +1,4 @@
 spring:
   profiles:
-    active: test
+    active: dev
 #开发环境dev 测试环境test 正式环境prod  启动时可以设置参数Java -jar xxxxxx.jar spring.profiles.actiove=prod

+ 4 - 2
dgtly-apiframework/src/main/java/com/dgtly/apiframework/config/ApiResourcesConfig.java

@@ -2,10 +2,10 @@ package com.dgtly.apiframework.config;
 
 import com.dgtly.apiframework.interceptor.AuthenticationInterceptor;
 import com.dgtly.apiframework.interceptor.VerifyInterceptor;
-import com.dgtly.common.config.Global;
 import com.dgtly.common.constant.Constants;
 import com.dgtly.apiframework.interceptor.ApiRepeatSubmitInterceptor;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
@@ -23,6 +23,8 @@ public class ApiResourcesConfig implements WebMvcConfigurer
     @Autowired
     private ApiRepeatSubmitInterceptor apiRepeatSubmitInterceptor;
 
+    @Value("${ruoyi.profile}")
+    private String profile;
     /**
      * token验证
      */
@@ -41,7 +43,7 @@ public class ApiResourcesConfig implements WebMvcConfigurer
     public void addResourceHandlers(ResourceHandlerRegistry registry)
     {
         /** 本地文件上传路径 */
-        registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + Global.getProfile() + "/");
+        registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + profile + "/");
 
         /** swagger配置 */
         registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");

+ 1 - 1
dgtly-apiframework/src/main/java/com/dgtly/apiframework/config/SwaggerConfig.java

@@ -77,7 +77,7 @@ public class SwaggerConfig
                 //.contact(new Contact(Global.getName(), null, null))
                 .contact(new Contact("接口文档", null, null))
                 // 版本
-                .version("版本号:" + Global.getVersion())
+                .version("版本号:1.0")
                 .build();
     }
 }

+ 0 - 1
dgtly-common/pom.xml

@@ -8,7 +8,6 @@
         <version>4.0.0</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
-	
     <artifactId>dgtly-common</artifactId>
 	
 	<description>

+ 13 - 16
dgtly-common/src/main/java/com/dgtly/common/config/Global.java

@@ -7,18 +7,28 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import com.dgtly.common.utils.StringUtils;
 import com.dgtly.common.utils.YamlUtil;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.stereotype.Component;
 
 /**
  * 全局配置类
  * 
  * @author ruoyi
  */
+@Component
 public class Global
 {
     private static final Logger log = LoggerFactory.getLogger(Global.class);
 
-    private static String DEFULT_NAME = "application.yml";
 
+    private static String active ;
+
+
+    @Value("${spring.profiles.active}")
+    public void setActive(String active) {
+        Global.active = active;
+    }
     /**
      * 当前对象实例
      */
@@ -56,7 +66,7 @@ public class Global
             Map<?, ?> yamlMap = null;
             try
             {
-                yamlMap = YamlUtil.loadYaml(getConfigeFileName());
+                yamlMap = YamlUtil.loadYaml("application-"+active+".yml");
                 value = String.valueOf(YamlUtil.getProperty(yamlMap, key));
                 map.put(key, value != null ? value : StringUtils.EMPTY);
             }
@@ -140,18 +150,5 @@ public class Global
         return getProfile() + "/upload";
     }
 
-    public static String getConfigeFileName(){
-        String value="";
-        Map<?, ?> yamlMap = null;
-        try
-        {
-            yamlMap = YamlUtil.loadYaml(DEFULT_NAME);
-            value = String.valueOf(YamlUtil.getProperty(yamlMap, "spring.profiles.active"));
-        }
-        catch (FileNotFoundException e)
-        {
-            log.error("获取全局配置异常 ");
-        }
-        return "application-"+value+".yml";
-    }
+
 }

+ 1 - 0
dgtly-common/src/main/java/com/dgtly/common/utils/file/FileUploadUtils.java

@@ -36,6 +36,7 @@ public class FileUploadUtils
     /**
      * 默认上传的地址
      */
+
     private static String defaultBaseDir = Global.getProfile();
 
     private static int counter = 0;

+ 4 - 1
dgtly-framework/src/main/java/com/dgtly/framework/config/ResourcesConfig.java

@@ -25,6 +25,9 @@ public class ResourcesConfig implements WebMvcConfigurer
     @Value("${shiro.user.indexUrl}")
     private String indexUrl;
 
+    @Value("${ruoyi.profile}")
+    private String profile;
+
     @Autowired
     private RepeatSubmitInterceptor repeatSubmitInterceptor;
 
@@ -41,7 +44,7 @@ public class ResourcesConfig implements WebMvcConfigurer
     public void addResourceHandlers(ResourceHandlerRegistry registry)
     {
         /** 本地文件上传路径 */
-        registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + Global.getProfile() + "/");
+        registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + profile + "/");
 
         /** swagger配置 */
         registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");

+ 2 - 1
dgtly-system/src/main/resources/mapper/system/EntryPassMapper.xml

@@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="householdRelation"    column="household_relation"    />
         <result property="ownership"    column="ownership"    />
         <result property="auditOpinion"    column="audit_opinion"    />
-        <result property="user_name"    column="username"    />
+        <result property="username"    column="user_name"    />
         <result property="phonenumber"    column="phonenumber"    />
         <result property="isWuhan"    column="is_wuhan"    />
         <result property="sex"    column="sex"    />
@@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="status != null  and status != ''"> and ep.status = #{status}</if>
             <if test="chargeCommunityId != null  and chargeCommunityId != ''"> and u.charge_community_id = #{chargeCommunityId}</if>
         </where>
+        order by ep.status
     </select>
     
     <select id="selectEntryPassByUserId" parameterType="Long" resultMap="EntryPassResult">