From 96712cfb23b9daf7bc71d9752d49c197dce86b1f Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Thu, 20 May 2021 17:52:59 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StaffGradeController.java | 11 ++++++++- .../liuwanr/mapper/StaffGradeMapper.java | 12 +++++++++- .../liuwanr/service/StaffGradeService.java | 24 ++++++++++++++++--- .../liuwanr/service/StaffGradServiceTest.java | 18 +++++++------- 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/controller/StaffGradeController.java b/src/main/java/com/yipin/liuwanr/controller/StaffGradeController.java index 0e170fd..744ac20 100644 --- a/src/main/java/com/yipin/liuwanr/controller/StaffGradeController.java +++ b/src/main/java/com/yipin/liuwanr/controller/StaffGradeController.java @@ -1,6 +1,7 @@ package com.yipin.liuwanr.controller; import java.util.HashMap; +import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; @@ -103,11 +104,19 @@ public class StaffGradeController { Response deleteStaffGrade(@RequestBody StaffGrade staffGrade) { Response resp = new Response(); Integer staffGradeId = staffGrade.getStaffGradeId(); + HashMap ret = new HashMap<>(); if (staffGradeId==null) { resp.setStatus(300); resp.setErrmessage("Parameter Invalid"); } else { - HashMap ret = staffGradeService.deleteStaffGrade(staffGradeId); + List userIds = staffGradeService.queryUserIdsByGradeId(staffGradeId); + if(userIds.size()>0){ + ret = staffGradeService.deleteStaffGrade(userIds); + ret = staffGradeService.deleteStaffGradePs(staffGradeId); + }else{//如果组织架构下面没有员工,则只删除组织架构 + ret = staffGradeService.deleteStaffGradePs(staffGradeId); + } + int status = (int) ret.get("retcode"); if (200 == status) { resp.setStatus(status); diff --git a/src/main/java/com/yipin/liuwanr/mapper/StaffGradeMapper.java b/src/main/java/com/yipin/liuwanr/mapper/StaffGradeMapper.java index aaeef71..df85618 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/StaffGradeMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/StaffGradeMapper.java @@ -21,8 +21,15 @@ public interface StaffGradeMapper { " "}) List queryStaffGrade(Integer staffProfessionalArchitectureId); +// @Update("UPDATE staff_grade SET isdel = 1 where staffGradeId = #{staffGradeId}") + @Update("UPDATE staff s,hr_user_info u SET s.isdel = 1,u.isdel = 1 WHERE s.userId = u.userId AND s.userId IN" + + "(" + + "#{userId}" + + ")") + void deleteStaffGrade(List userIds); + @Update("UPDATE staff_grade SET isdel = 1 where staffGradeId = #{staffGradeId}") - void deleteStaffGrade(Integer staffGradeId); + void deleteStaffGradePs(Integer staffGradeId); @Select({" "}) List queryStaffGrade(Integer staffProfessionalArchitectureId); - -// @Update("UPDATE staff_grade SET isdel = 1 where staffGradeId = #{staffGradeId}") - @Update("UPDATE staff s,hr_user_info u SET s.isdel = 1,u.isdel = 1 WHERE s.userId = u.userId AND s.userId IN" + - "(" + - "#{userId}" + - ")") - void deleteStaffGrade(List userIds); + + @Update({""}) + void deleteStaffGrade(@Param("userIds") List userIds); + @Update("UPDATE staff_grade SET isdel = 1 where staffGradeId = #{staffGradeId}") void deleteStaffGradePs(Integer staffGradeId); @@ -41,4 +41,10 @@ public interface StaffGradeMapper { @Select("select userId from staff where staffGradeId =#{staffGradeId} and isdel = 0") List queryUserIdsByGradeId(Integer staffGradeId); + + @Update("UPDATE staff_grade SET isdel = 1 where staffProfessionalArchitectureId = #{staffProfessionalArchitectureId}") + void delStaffGradeByArchId(Integer staffProfessionalArchitectureId); + + @Update("UPDATE staff_grade SET isdel = 1 where staffProfessionalArchitectureId = #{staffProfessionalArchitectureId}") + void deleteStaffArch(Integer staffProfessionalArchitectureId); } \ No newline at end of file diff --git a/src/main/java/com/yipin/liuwanr/mapper/StaffMapper.java b/src/main/java/com/yipin/liuwanr/mapper/StaffMapper.java index c282345..dc58cb2 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/StaffMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/StaffMapper.java @@ -123,4 +123,7 @@ public interface StaffMapper { @Select("select schoolId,staffId FROM staff WHERE userId = #{userId} AND isdel = 0 GROUP BY schoolId ORDER BY staffId limit 1") Integer querySchoolId(Integer userId); + @Select("select userId from staff where staffProfessionalArchitectureId =#{staffProfessionalArchitectureId} and isdel = 0") + List queryUserIdsByArchId(Integer staffProfessionalArchitectureId); + } \ No newline at end of file diff --git a/src/main/java/com/yipin/liuwanr/service/StaffProfessionalArchitectureService.java b/src/main/java/com/yipin/liuwanr/service/StaffProfessionalArchitectureService.java index 03a3914..893954a 100644 --- a/src/main/java/com/yipin/liuwanr/service/StaffProfessionalArchitectureService.java +++ b/src/main/java/com/yipin/liuwanr/service/StaffProfessionalArchitectureService.java @@ -1,7 +1,10 @@ package com.yipin.liuwanr.service; import java.util.HashMap; +import java.util.List; +import com.yipin.liuwanr.mapper.StaffGradeMapper; +import com.yipin.liuwanr.mapper.StaffMapper; import org.jboss.logging.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -17,6 +20,11 @@ public class StaffProfessionalArchitectureService { @Autowired private StaffProfessionalArchitectureMapper staffProfessionalArchitectureMapper; + @Autowired + private StaffGradeMapper staffGradeMapper; + @Autowired + private StaffMapper staffMapper; + public HashMap addStaffProfessionalArchitecture(StaffProfessionalArchitecture staffProfessionalArchitecture){ HashMap resp = new HashMap(); try { @@ -78,7 +86,19 @@ public class StaffProfessionalArchitectureService { public HashMap deleteStaffProfessionalArchitecture(Integer staffProfessionalArchitectureId){ HashMap resp = new HashMap(); try { + //删除员工专业一级组织架构 staffProfessionalArchitectureMapper.deleteStaffProfessionalArchitecture(staffProfessionalArchitectureId); + //根据一级架构id删除staff_grade表中二级组织架构(假删) + staffGradeMapper.delStaffGradeByArchId(staffProfessionalArchitectureId); + //根据staffProfessionalArchitectureId查询staff表中的userId,然后调用批量删除员工信息接口 + List userIds =staffMapper.queryUserIdsByArchId(staffProfessionalArchitectureId); + if(userIds.size()>0){//说明年级架构下面存在用户 + staffGradeMapper.deleteStaffGrade(userIds); + staffGradeMapper.deleteStaffArch(staffProfessionalArchitectureId); + }else{//如果组织架构下面没有员工,则只删除组织架构 + staffGradeMapper.deleteStaffArch(staffProfessionalArchitectureId); + } + resp.put("retcode", 200); } catch (RuntimeException e) { logger.error(e.getMessage()); From 6f5a7d21059486adac8ccde67ff181754f81e907 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Wed, 26 May 2021 14:32:13 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BB=A5=E5=8F=8A=E8=AE=A2=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java | 2 +- src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java b/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java index 994d92c..cac1643 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/CourseMapper.java @@ -94,7 +94,7 @@ public interface CourseMapper { //删除课程 @Update({" "}) diff --git a/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java b/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java index 6df3a52..b71ef3a 100644 --- a/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java +++ b/src/main/java/com/yipin/liuwanr/mapper/OrderMapper.java @@ -54,7 +54,7 @@ public interface OrderMapper { " and o.cityId = #{cityId} ", " and o.orderType = #{orderType} ", " and o.orderStatus = #{orderStatus} ", - " and o.orderNumber like CONCAT('%',#{searchContent},'%') or c.customerName like CONCAT('%',#{searchContent},'%')", + " and (o.orderNumber like CONCAT('%',#{searchContent},'%') or c.customerName like CONCAT('%',#{searchContent},'%'))", "order by o.orderDate desc", " "}) List queryOrder(Order order); From bf7ce4dd0b0bf6643db8c4e5b45a116dd9dbd389 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Fri, 28 May 2021 15:10:39 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=A7=91=E5=A4=A7=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/application-keda.properties | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/main/resources/application-keda.properties diff --git a/src/main/resources/application-keda.properties b/src/main/resources/application-keda.properties new file mode 100644 index 0000000..441c064 --- /dev/null +++ b/src/main/resources/application-keda.properties @@ -0,0 +1,49 @@ +server.port=8090 +server.servlet.context-path=/liuwanr + +#\u79D1\u5927\u6B63\u5F0F\u6570\u636E\u5E93\u8FDE\u63A5 +spring.datasource.url=jdbc:mysql://192.168.0.99:3306/keda?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai +spring.datasource.username=root +spring.datasource.password=mssdk@028 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + +#redis\u914D\u7F6E +spring.redis.database=0 +spring.redis.host=127.0.0.1 +spring.redis.password= +spring.redis.port=6379 +spring.redis.timeout=3000 +spring.redis.jedis.pool.max-idle=500 +spring.redis.jedis.pool.min-idle=50 +spring.redis.jedis.pool.max-active=2000 +spring.redis.jedis.pool.max-wait=1000 + +#redis-cluster +redis.cluster.maxTotal=200 +redis.cluster.maxIdle=8 +redis.cluster.minIdle=3 +redis.cluster.nodes=192.168.136.191:8000,192.168.136.191:8001,192.168.136.191:8002 + +spring.mina.port=9123 +spring.mina.buffersize=2048 +spring.mina.idletime=15 +spring.main.show-banner=false + +#\u65E5\u5FD7\u7EA7\u522B +logging.level.jdbc=OFF +logging.level.jdbc.sqltiming=DEBUG +logging.level.jdbc.resultsettable=DEBUG +logging.level.com.yipin.liuwar.mapper=DEBUG +logging.level.com.yipin.liuwanr.mapper=DEBUG + +spring.elasticsearch.rest.uris=http://es-cn-v641e944a0006xtwy.elasticsearch.aliyuncs.com:9200 +spring.elasticsearch.rest.username=elastic +spring.elasticsearch.rest.password=1qaz@WSX + +# maxFileSize \u5355\u4E2A\u6570\u636E\u5927\u5C0F +spring.servlet.multipart.maxFileSize = 1024MB +# maxRequestSize \u662F\u603B\u6570\u636E\u5927\u5C0F +spring.servlet.multipart.maxRequestSize=10240MB + +pagehelper.reasonable=false + From b3cba9f9c7d5b141c0b96f2f988e38934de00f59 Mon Sep 17 00:00:00 2001 From: chen <1251790704@qq.com> Date: Fri, 28 May 2021 15:35:26 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E7=A7=91=E5=A4=A7redis=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-keda.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-keda.properties b/src/main/resources/application-keda.properties index 441c064..fa02aba 100644 --- a/src/main/resources/application-keda.properties +++ b/src/main/resources/application-keda.properties @@ -10,7 +10,7 @@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver #redis\u914D\u7F6E spring.redis.database=0 spring.redis.host=127.0.0.1 -spring.redis.password= +spring.redis.password=msdw@2021 spring.redis.port=6379 spring.redis.timeout=3000 spring.redis.jedis.pool.max-idle=500 From a86beca6e2cb8179feffab8e9669c6fbd6890294 Mon Sep 17 00:00:00 2001 From: shijie <648688341@qq.com> Date: Fri, 28 May 2021 17:14:23 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=B8=AD=E5=8F=B0=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yipin/liuwanr/service/UserInfoService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java index fa1c87f..3a6c9c9 100644 --- a/src/main/java/com/yipin/liuwanr/service/UserInfoService.java +++ b/src/main/java/com/yipin/liuwanr/service/UserInfoService.java @@ -127,13 +127,13 @@ public class UserInfoService { userInfoMapper.userAddStudent(student); } int size = userProfilesList.size(); - if (size<=0){ +// if (size<=0){ for (int i = 0;i