From 2c19b1c16d392905e33e995e7c13faa598d5a867 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Thu, 05 Aug 2021 14:20:02 +0800
Subject: [PATCH] 巡逻任务问题修复

---
 src/main/java/org/springblade/modules/zc/controller/ZcController.java |   30 ++++++++++++++-
 Dockerfile                                                            |    2 
 src/main/java/org/springblade/modules/zc/vo/ZcVO.java                 |    2 
 src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml          |   18 ++++++++-
 src/main/resources/application-dev.yml                                |    9 +++-
 src/main/resources/application.yml                                    |   12 +++---
 6 files changed, 59 insertions(+), 14 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 0e8a75b..fdf06ee 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@
 
 EXPOSE 8800
 
-ADD ./target/blade-jfpts.jar ./app.jar
+ADD ./target/qfqk.jar ./app.jar
 
 ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "app.jar"]
 
diff --git a/src/main/java/org/springblade/modules/zc/controller/ZcController.java b/src/main/java/org/springblade/modules/zc/controller/ZcController.java
index f6b4315..969465c 100644
--- a/src/main/java/org/springblade/modules/zc/controller/ZcController.java
+++ b/src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -22,12 +22,14 @@
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.common.vo.DeptVo;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.DigestUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.service.IDeptService;
 import org.springblade.modules.system.service.IUserService;
 import org.springblade.modules.zc.entity.Zc;
 import org.springblade.modules.zc.service.IZcService;
@@ -37,7 +39,9 @@
 
 import javax.validation.Valid;
 import java.text.SimpleDateFormat;
+import java.util.Arrays;
 import java.util.Date;
+import java.util.List;
 
 /**
  *  控制器
@@ -54,6 +58,8 @@
 	private final IZcService zcService;
 
 	private IUserService iUserService;
+
+	private final IDeptService deptFeignApi;
 
 	/**
 	 * 详情
@@ -84,8 +90,28 @@
 	@ApiOperationSupport(order = 3)
 	@ApiOperation(value = "分页", notes = "传入zc")
 	public R<IPage<ZcVO>> page(ZcVO zc, Query query) {
-		IPage<ZcVO> pages = zcService.selectZcPage(Condition.getPage(query), zc);
-		return R.data(pages);
+		//获取部门数据
+		List<DeptVo> deptVos = deptFeignApi.selDeptList();
+		IPage<ZcVO> page = zcService.selectZcPage(Condition.getPage(query), zc);
+		for (int j = 0; j < page.getRecords().size(); j++) {
+			if (page.getRecords().get(j).getDeptid() != null && !page.getRecords().get(j).getDeptid().equals("")){
+				String[] split = page.getRecords().get(j).getDeptid().split(",");
+				List<String> list = Arrays.asList(split);
+				StringBuffer deptNameBuiffer = new StringBuffer();
+				//数据匹配封装
+				for (String deptId:list) {
+					for (DeptVo deptVo:deptVos) {
+						if (deptId.equals(deptVo.getId().toString())){
+							deptNameBuiffer.append(deptVo.getDeptName()).append(",");
+						}
+					}
+				}
+				//封装部门名称数据
+				page.getRecords().get(j).setDeptName(deptNameBuiffer.substring(0,deptNameBuiffer.length()-1));
+			}
+		}
+
+		return R.data(page);
 	}
 
 	/**
diff --git a/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml b/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
index ee58312..b53a4b7 100644
--- a/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
+++ b/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
@@ -3,7 +3,7 @@
 <mapper namespace="org.springblade.modules.zc.mapper.ZcMapper">
 
     <!-- 通用查询映射结果 -->
-    <resultMap id="zcResultMap" type="org.springblade.modules.zc.entity.Zc">
+    <resultMap id="zcResultMap" type="org.springblade.modules.zc.vo.ZcVO">
         <id column="id" property="id"/>
         <result column="username" property="username"/>
         <result column="password" property="password"/>
@@ -18,7 +18,21 @@
 
 
     <select id="selectZcPage" resultMap="zcResultMap">
-        select * from act_zc where is_deleted = 0
+        select * from act_zc where
+        1 = 1
+        <if test="zc.username != null and zc.username != '' ">
+            and username like CONCAT('%',#{zc.username},'%')
+        </if>
+        <if test="zc.sname != null and zc.sname != '' ">
+            and sname like CONCAT('%',#{zc.sname},'%')
+        </if>
+        <if test="zc.sex != null and zc.sex != '' ">
+            and sex like CONCAT('%',#{zc.sex},'%')
+        </if>
+        <if test="zc.type != null and zc.type != '' ">
+            and type like CONCAT('%',#{zc.type},'%')
+        </if>
+        and type != 1
     </select>
 
 
diff --git a/src/main/java/org/springblade/modules/zc/vo/ZcVO.java b/src/main/java/org/springblade/modules/zc/vo/ZcVO.java
index 38d8924..cf17f0b 100644
--- a/src/main/java/org/springblade/modules/zc/vo/ZcVO.java
+++ b/src/main/java/org/springblade/modules/zc/vo/ZcVO.java
@@ -32,5 +32,5 @@
 @ApiModel(value = "ZcVO对象", description = "ZcVO对象")
 public class ZcVO extends Zc {
 	private static final long serialVersionUID = 1L;
-
+	private String deptName;
 }
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 5ada00a..01bbe18 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -13,9 +13,14 @@
     #  commandTimeout: 5000
   datasource:
     # MySql
-    url: jdbc:mysql://36.134.81.48:3306/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+#    url: jdbc:mysql://36.134.81.48:3306/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+#    username: root
+#    password: jfpt123
+
+    url: jdbc:mysql://223.82.109.183:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
     username: root
-    password: jfpt123
+    password: zhba0728
+
     # PostgreSQL
     #url: jdbc:postgresql://127.0.0.1:5432/bladex_boot
     #username: postgres
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 37c8909..6a86f5d 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,6 +1,6 @@
 #服务器配置
 server:
-  port: 82
+  port: 83
   undertow:
     # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
     io-threads: 16
@@ -124,12 +124,12 @@
 #oss默认配置
 oss:
   enabled: true
-  name: qiniu
+  name: minio
   tenant-mode: true
-  endpoint: http://prt1thnw3.bkt.clouddn.com
-  access-key: N_Loh1ngBqcJovwiAJqR91Ifj2vgOWHOf8AwBA_h
-  secret-key: AuzuA1KHAbkIndCU0dB3Zfii2O3crHNODDmpxHRS
-  bucket-name: bladex
+  endpoint: http://web.byisf.com:9000
+  access-key: adminminio
+  secret-key: adminminio
+  bucket-name: jfpt
 
 #第三方登陆配置
 social:

--
Gitblit v1.9.3