wenhongquan 1 жил өмнө
parent
commit
5784f9514a

+ 36 - 36
ruoyi-admin/pom.xml

@@ -92,43 +92,43 @@
                     <warName>${project.artifactId}</warName>
                 </configuration>   
            </plugin>
-            <plugin>
-                <groupId>com.google.cloud.tools</groupId>
-                <artifactId>jib-maven-plugin</artifactId>
-                <version>1.7.0</version>
-                <configuration>
-                    <!--from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字-->
-                    <from>
-                        <image>williamyeh/java8</image>
-                    </from>
-                    <to>
-                        <!--镜像名称和tag,使用了mvn内置变量${project.version},表示当前工程的version-->
-                        <image>docker.xt.wenhq.top:8083/docker_r/nnbp:${project.version}</image>
-                        <auth>
-                            <username>admin</username>
-                            <password>xtwenhongquan</password>
-                        </auth>
-                    </to>
-                    <!--容器相关的属性-->
-                    <container>
-                        <useCurrentTimestamp>true</useCurrentTimestamp>
-                        <jvmFlags>
-                            <jvmFlag>-Dfile.encoding=UTF-8</jvmFlag>
-                            <jvmFlag>-Dsun.jnu.encoding=UTF-8</jvmFlag>
-                        </jvmFlags>
-                    </container>
-                    <allowInsecureRegistries>true</allowInsecureRegistries>
+<!--            <plugin>-->
+<!--                <groupId>com.google.cloud.tools</groupId>-->
+<!--                <artifactId>jib-maven-plugin</artifactId>-->
+<!--                <version>1.7.0</version>-->
+<!--                <configuration>-->
+<!--                    &lt;!&ndash;from节点用来设置镜像的基础镜像,相当于Docerkfile中的FROM关键字&ndash;&gt;-->
+<!--                    <from>-->
+<!--                        <image>williamyeh/java8</image>-->
+<!--                    </from>-->
+<!--                    <to>-->
+<!--                        &lt;!&ndash;镜像名称和tag,使用了mvn内置变量${project.version},表示当前工程的version&ndash;&gt;-->
+<!--                        <image>docker.xt.wenhq.top:8083/docker_r/nnbp:${project.version}</image>-->
+<!--                        <auth>-->
+<!--                            <username>admin</username>-->
+<!--                            <password>xtwenhongquan</password>-->
+<!--                        </auth>-->
+<!--                    </to>-->
+<!--                    &lt;!&ndash;容器相关的属性&ndash;&gt;-->
+<!--                    <container>-->
+<!--                        <useCurrentTimestamp>true</useCurrentTimestamp>-->
+<!--                        <jvmFlags>-->
+<!--                            <jvmFlag>-Dfile.encoding=UTF-8</jvmFlag>-->
+<!--                            <jvmFlag>-Dsun.jnu.encoding=UTF-8</jvmFlag>-->
+<!--                        </jvmFlags>-->
+<!--                    </container>-->
+<!--                    <allowInsecureRegistries>true</allowInsecureRegistries>-->
 
-                </configuration>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>build</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
+<!--                </configuration>-->
+<!--                <executions>-->
+<!--                    <execution>-->
+<!--                        <phase>package</phase>-->
+<!--                        <goals>-->
+<!--                            <goal>build</goal>-->
+<!--                        </goals>-->
+<!--                    </execution>-->
+<!--                </executions>-->
+<!--            </plugin>-->
         </plugins>
         <finalName>${project.artifactId}</finalName>
     </build>

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java

@@ -1,6 +1,7 @@
 package com.ruoyi;
 
 import com.dtflys.forest.springboot.annotation.ForestScan;
+import com.ruoyi.common.utils.SecurityUtils;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@@ -16,6 +17,8 @@ public class RuoYiApplication
 {
     public static void main(String[] args)
     {
+
+//        String a = SecurityUtils.encryptPassword("qq308805712@qq.com");
         // System.setProperty("spring.devtools.restart.enabled", "false");
         SpringApplication.run(RuoYiApplication.class, args);
         System.out.println("(♥◠‿◠)ノ゙  服务启动成功   ლ(´ڡ`ლ)゙  \n" +

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.system;
 
 import java.util.List;
 import java.util.Set;
+
+import com.ruoyi.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.constant.Constants;
@@ -26,6 +28,9 @@ public class SysLoginController
     private SysLoginService loginService;
 
     @Autowired
+    private ISysUserService userService;
+
+    @Autowired
     private ISysMenuService menuService;
 
     @Autowired
@@ -41,6 +46,14 @@ public class SysLoginController
     public AjaxResult login(@RequestBody LoginBody loginBody)
     {
         AjaxResult ajax = AjaxResult.success();
+        if(loginBody.getUsername().length()==11){
+            SysUser user = new SysUser();
+            user.setPhonenumber(loginBody.getUsername());
+            List<SysUser> userList = userService.selectUserList(user);
+            if(userList.size()>0){
+                loginBody.setUsername(userList.get(0).getUserName());
+            }
+        }
         // 生成令牌
         String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
                 loginBody.getUuid());

+ 95 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TblTaskController.java

@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 工单任务Controller
@@ -133,6 +134,34 @@ public class TblTaskController extends BaseController
             areamap.put(d.getDictValue(),d.getDictLabel());
         }
 
+        sysDictData = new SysDictData();
+        sysDictData.setDictType("zctype");
+        list1 = sysDictDataService.selectDictDataList(sysDictData);
+        List<String> zctypemap = new ArrayList<>();
+        zctypemap = list1.stream().map(i->i.getDictLabel()).collect(Collectors.toList());
+
+
+        sysDictData = new SysDictData();
+        sysDictData.setDictType("zccz");
+        list1 = sysDictDataService.selectDictDataList(sysDictData);
+        List<String> zcczmap = new ArrayList<>();
+        zcczmap = list1.stream().map(i->i.getDictLabel()).collect(Collectors.toList());
+
+        sysDictData = new SysDictData();
+        sysDictData.setDictType("zcdw");
+        list1 = sysDictDataService.selectDictDataList(sysDictData);
+        List<String> zcdwmap = new ArrayList<>();
+        zcdwmap = list1.stream().map(i->i.getDictLabel()).collect(Collectors.toList());
+
+
+        sysDictData = new SysDictData();
+        sysDictData.setDictType("zcgg");
+        list1 = sysDictDataService.selectDictDataList(sysDictData);
+
+        List<String> zcggmap = new ArrayList<>();
+        zcggmap = list1.stream().map(i->i.getDictLabel()).collect(Collectors.toList());
+
+
         List<SysUser> users = userService.selectUserList(new SysUser());
         Map<Long,SysUser> usermap = new HashMap<>();
         for (SysUser d:users
@@ -230,6 +259,14 @@ public class TblTaskController extends BaseController
                 "                        ).hcdes }";
         Object hcdes = JSUtils.runjs(runjs);
 
+        Collection cz = new ArrayList<>();
+        try{
+            runjs= commjs+ "return (( eval(JSON.toJSONString(JSON.parse(taskinfo.tblTaskLogList.filter(function(ii){return ii.taskStatus === 3 })[0].logDes).zcdata)))) }" ;
+            cz =  JSON.parseObject(JSON.toJSONString(JSUtils.runjs(runjs)),Map.class).values();
+        }catch (Exception e){}
+
+
+
         Map<String,Object> rw = new HashMap<>();
         rw.put("fzr",fzr);
         rw.put("zyrs",zyrs);
@@ -240,10 +277,58 @@ public class TblTaskController extends BaseController
         rw.put("gzl",gzl);
         rw.put("cl1",cl1);
         rw.put("cl2",cl2);
+        {
+            List<Object> c = JSONArray.parseArray(JSON.toJSONString(cl1),Object.class);
+            List<Object> c1 = JSONArray.parseArray(JSON.toJSONString(cl2),Object.class);
+            List<List<Object>> c2 = new ArrayList<>();
+            for(int i=0;i<c.size();i++){
+                List<Object> p = new ArrayList<>();
+                p.add(c.get(i));p.add(c1.size()>i?c1.get(i):new Object());
+                c2.add(p);
+            }
+            rw.put("cl3",c2);
+        }
+
         rw.put("hc1",hc1);
         rw.put("hc2",hc2);
         rw.put("hc3",hc3);
+        {
+            List<Object> h1 = JSONArray.parseArray(JSON.toJSONString(hc1),Object.class);
+            List<Object> h2 = JSONArray.parseArray(JSON.toJSONString(hc2),Object.class);
+            List<Object> h3 = JSONArray.parseArray(JSON.toJSONString(hc3),Object.class);
+            List<List<Object>> c2 = new ArrayList<>();
+            for(int i=0;i<h1.size();i++){
+                List<Object> p = new ArrayList<>();
+                p.add(h1.get(i));p.add(h2.size()>i?h2.get(i):new Object());;p.add(h3.size()>i?h3.get(i):new Object());
+                c2.add(p);
+            }
+            rw.put("hc",c2);
+        }
         rw.put("hc4",hc4);
+        rw.put("cz1",cz);
+        try{
+            List<Map> h1 = JSONArray.parseArray(JSON.toJSONString(cz),Map.class);
+            List<Map<String,Object>> pp = new ArrayList<>();
+            int c1 = zctypemap.size(),c2=zcczmap.size(),c3=zcdwmap.size(),c4=zcggmap.size()%3==0?zcggmap.size()/3:((zcggmap.size()/3)+1);
+            for (int i=0;i< Math.max(Math.max(c1, c2), Math.max(c3, c4));i++){
+                Map<String,Object> p=new HashMap<>();
+
+                p.put("type",getdui(h1,i>=zctypemap.size()?"":zctypemap.get(i),"type","",true));
+                p.put("cz",getdui(h1,i>=zcczmap.size()?"":zcczmap.get(i),"cz","",true));
+                p.put("dw",getdui(h1,i>=zcdwmap.size()?"":zcdwmap.get(i),"dw","",true));
+
+                List<String> ccc = new ArrayList<>();
+                ccc.add(getdui(h1,zcggmap.size()<=i*3?"":(zcggmap.get(i*3)),"gg","num",false));
+                ccc.add(getdui(h1,zcggmap.size()<=i*3+1?"":(zcggmap.get(i*3+1)),"gg","num",false));
+                ccc.add(getdui(h1,zcggmap.size()<=i*3+2?"":(zcggmap.get(i*3+2)),"gg","num",false));
+                p.put("gg",i>zcggmap.size()/3?"":ccc);
+                pp.add(p);
+            }
+            rw.put("cz1",pp);
+        }catch (Exception e){}
+
+
+
 
         rw.put("hcsj",hcsj);
         rw.put("hcdes",hcdes);
@@ -264,6 +349,16 @@ public class TblTaskController extends BaseController
 //        util.exportExcel(response, list, "工单任务数据");
     }
 
+    private  String getdui(List<Map> h1,String c,String key,String k1,boolean tt){
+       if(tt) {
+           return (h1.stream().filter(ppc -> c.equals(ppc.get(key).toString())).count() > 0 ? '✔' : c.equals("") ? "" : '□') + c;
+       }else{
+           int cp =  h1.stream().filter(ppc -> c.equals(ppc.get(key).toString())).mapToInt(i-> Integer.parseInt(i.get(k1).toString())).sum();
+           return (h1.stream().filter(ppc -> c.equals(ppc.get(key).toString())).count() > 0 ? '✔' : c.equals("") ? "" : '□') + c + "( "+ cp +" )";
+       }
+
+    }
+
 
     /**
      * 导出工单任务列表

BIN
ruoyi-admin/src/main/resources/fk.xlsx


+ 3 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java

@@ -202,8 +202,10 @@ public class BaseController
         String path = "./" + fileName + ".xlsx";
 //        String tpath = "/Users/wenhongquan/gitdata/nnbp/ruoyi-admin/src/main/resources/"+excelTemplateName+".xlsx";
 //        File filex = new File(tpath);
-        //this.getClass().getResourceAsStream("/" + excelTemplateName + ".xlsx")
+
 //        InputStream is =  new FileInputStream(filex)
+//        InputStream is =  this.getClass().getResourceAsStream("/" + excelTemplateName + ".xlsx")
+        ;
         try (InputStream is =  this.getClass().getResourceAsStream("/" + excelTemplateName + ".xlsx") ) {
             try (OutputStream os = new FileOutputStream(path)) {
                 Context context = new Context();