linfutong пре 3 година
родитељ
комит
e371be502e

+ 1 - 3
zd-modules/zd-algorithm/pom.xml

@@ -37,7 +37,6 @@
             <artifactId>mysql-connector-java</artifactId>
         </dependency>
 
-
         <!--mqtt客户端链接服务-->
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -70,7 +69,7 @@
             <artifactId>arcsoft-sdk-face</artifactId>
             <version>3.0.0.0</version>
             <scope>system</scope>
-            <systemPath>${pom.basedir}/src/main/resources/libs/arcsoft-sdk-face-3.0.0.0.jar</systemPath>
+            <systemPath>${project.basedir}/src/main/resources/libs/arcsoft-sdk-face-3.0.0.0.jar</systemPath>
         </dependency>
 
         <!-- https://mvnrepository.com/artifact/org.bytedeco/ffmpeg-platform -->
@@ -204,7 +203,6 @@
                 <artifactId>spring-boot-maven-plugin</artifactId>
                 <configuration>
                     <includeSystemScope>true</includeSystemScope>
-                    <fork>true</fork>
                 </configuration>
                 <executions>
                     <execution>

+ 0 - 1
zd-modules/zd-base/pom.xml

@@ -132,7 +132,6 @@
                 <artifactId>spring-boot-maven-plugin</artifactId>
                 <configuration>
                     <includeSystemScope>true</includeSystemScope>
-                    <fork>true</fork>
                 </configuration>
                 <executions>
                     <execution>

+ 3 - 4
zd-modules/zd-chemical/pom.xml

@@ -115,7 +115,7 @@
             <artifactId>stax2-api</artifactId>
             <version>3.1.4</version>
             <scope>system</scope>
-            <systemPath>${pom.basedir}/src/main/resources/libs/sms-syd/stax2-api-3.1.4.jar</systemPath>
+            <systemPath>${project.basedir}/src/main/resources/libs/sms-syd/stax2-api-3.1.4.jar</systemPath>
         </dependency>
 
         <dependency>
@@ -123,7 +123,7 @@
             <artifactId>xpp3_min</artifactId>
             <version>1.1.4c</version>
             <scope>system</scope>
-            <systemPath>${pom.basedir}/src/main/resources/libs/sms-syd/xpp3_min-1.1.4c.jar</systemPath>
+            <systemPath>${project.basedir}/src/main/resources/libs/sms-syd/xpp3_min-1.1.4c.jar</systemPath>
         </dependency>
 
         <dependency>
@@ -134,7 +134,7 @@
 
             <version>1.3.1</version>
             <scope>system</scope>
-            <systemPath>${pom.basedir}/src/main/resources/libs/sms-syd/xstream-1.3.1.jar</systemPath>
+            <systemPath>${project.basedir}/src/main/resources/libs/sms-syd/xstream-1.3.1.jar</systemPath>
         </dependency>
         <!-- 四医大短信依赖包 -->
 
@@ -148,7 +148,6 @@
                 <artifactId>spring-boot-maven-plugin</artifactId>
                 <configuration>
                     <includeSystemScope>true</includeSystemScope>
-                    <fork>true</fork>
                 </configuration>
                 <executions>
                     <execution>

+ 74 - 0
zd-modules/zd-chemical/src/main/java/com/zd/chemical/util/ChemicalUtils.java

@@ -0,0 +1,74 @@
+package com.zd.chemical.util;
+
+import com.zd.common.core.utils.StringUtils;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * <p>化学品模块工具类</p>
+ *
+ * @author linft
+ * @version 1.0
+ * @date 11/28/2022
+ */
+public class ChemicalUtils {
+
+    /**
+     * 去除小数点后多余的0
+     *
+     * @param unit
+     * @return
+     */
+    public static String removeZeroForAfterPoint(String unit) {
+        if (StringUtils.isNotEmpty(unit)) {
+            List<String> list = new ArrayList<>();
+            String regex = "\\d+\\.+\\d+";
+            Pattern pattern = Pattern.compile(regex);
+            Matcher matcher = pattern.matcher(unit);
+            while (matcher.find()) {
+                String group = matcher.group();
+                list.add(group);
+            }
+            //取0处理
+            if (list.size() > 0) {
+                for (String str:list) {
+                    String newStr = noZeros(str);
+                    unit = unit.replace(str, newStr);
+                }
+            }
+        }
+        return unit;
+    }
+
+    /**
+     * 去除小数点后多余的0
+     * @param unit
+     * @return
+     */
+    public static BigDecimal removeZeroForAfterPoint(BigDecimal unit) {
+        String str = unit.stripTrailingZeros().toPlainString();
+        return new BigDecimal(str);
+    }
+
+    /**
+     * 小数点后去0处理
+     * 如:1.0100,执行后为:1.01
+     * @param unit
+     * @return
+     */
+    private static String noZeros(String unit) {
+        BigDecimal value = new BigDecimal(unit);
+        BigDecimal noZeros = value.stripTrailingZeros();
+        return noZeros.toPlainString();
+    }
+    public static void main(String[] args) {
+        //String str = "武汉0.133300g;北京10.25001g, 是1.0000个,这个2";
+        //String str = "dasddsa11.10000";
+        String str = "J00036-申购:1.00000oz";
+        System.out.println("str = "+removeZeroForAfterPoint(str));
+    }
+}

+ 0 - 2
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysMenuMapper.xml

@@ -215,7 +215,6 @@
                              from sys_permit_menu
                              where permit_id = (select id from sys_permit where type = 1 limit 1)) pm
         on m.menu_id = pm.menu_id
-
         where m.status = '0'
     </select>
     <select id="selectNewMenuTreeByStudent" resultType="com.zd.system.domain.SysMenu">
@@ -266,7 +265,6 @@
                              from sys_permit_menu
                              where permit_id = (select id from sys_permit where type = 2 limit 1)) pm
         on m.menu_id = pm.menu_id
-
         where m.status = '0'
     </select>
 

+ 0 - 1
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -98,5 +98,4 @@
     <update id="cleanOperLog">
         truncate table sys_oper_log
     </update>
-
 </mapper>

+ 0 - 2
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysPermitMapper.xml

@@ -12,7 +12,6 @@
         <result property="updateTime" column="update_time"/>
         <result property="remark" column="remark"/>
         <result property="name" column="name"/>
-
         <result property="type" column="type"/>
     </resultMap>
 
@@ -53,7 +52,6 @@
             <if test="name != null">name,</if>
 
             <if test="type != null">type,</if>
-
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="createBy != null">#{createBy},</if>

+ 0 - 1
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysPermitMenuMapper.xml

@@ -59,7 +59,6 @@
         from
             sys_permit_menu pm inner join sys_menu m on pm.menu_id = m.menu_id
         where pm.user_id = #{userId} and m.status = 0 and m.menu_type = 'C'
-
     </select>
 
     <select id="selectIdByRelation" resultType="java.lang.Long">

+ 0 - 1
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysPostMapper.xml

@@ -113,7 +113,6 @@
         <if test="status != null and status != ''">status,</if>
         <if test="remark != null and remark != ''">remark,</if>
         <if test="createBy != null and createBy != ''">create_by,</if>
-
         <if test="userId != null">user_id,</if>
         <if test="deptId != null">dept_id,</if>
         create_time

+ 0 - 1
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml

@@ -30,5 +30,4 @@
             (#{item.roleId},#{item.deptId})
         </foreach>
     </insert>
-
 </mapper>

+ 0 - 1
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml

@@ -30,5 +30,4 @@
             (#{item.roleId},#{item.menuId})
         </foreach>
     </insert>
-
 </mapper>

+ 1 - 22
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -3,7 +3,6 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zd.system.mapper.SysUserMapper">
-
     <resultMap type="com.zd.model.entity.SysUser" id="SysUserResult">
         <id property="userId" column="user_id"/>
         <result property="deptId" column="dept_id"/>
@@ -48,8 +47,6 @@
         <result property="faceImg" column="face_img"/>
         <result property="className" column="class_name"/>
         <result property="createTimeStr" column="createTimeStr"/>
-
-
         <association property="dept" column="dept_id" javaType="com.zd.model.entity.SysDept"
                      resultMap="deptResult"/>
         <!--<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>-->
@@ -229,8 +226,6 @@
             </foreach>
     </select>
 
-
-
     <select id="selectAllocatedList" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
         select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.email, u.phonenumber, u.status, u.create_time, d.`dept_name`,
         u.card_num,u.wechat_id,u.education,u.nationality,u.addr,u.work_status,u.date_birth
@@ -363,7 +358,6 @@
         </where>
     </select>
 
-
     <select id="noJoinPositionByList" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
         select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
         u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
@@ -436,7 +430,6 @@
         ${params.dataScope}
     </select>
 
-
     <insert id="insertUser" parameterType="com.zd.model.entity.SysUser" useGeneratedKeys="true"
             keyProperty="userId">
         insert into sys_user(
@@ -457,9 +450,7 @@
         <if test="grade != null and grade != ''">grade,</if>
         <if test="category != null and category != ''">category,</if>
         <if test="tutorUserId != null and tutorUserId != '' ">tutor_user_id,</if>
-
         <if test="majorId != null and majorId != ''">major_id,</if>
-
         <if test="position != null and position != ''">position,</if>
         <if test="department != null and department != ''">department,</if>
         <if test="nature != null and nature != ''">nature,</if>
@@ -489,9 +480,7 @@
         <if test="grade != null and grade != ''">#{grade},</if>
         <if test="category != null and category != ''">#{category},</if>
         <if test="tutorUserId != null and tutorUserId != ''">#{tutorUserId},</if>
-
         <if test="majorId != null and majorId != ''">#{majorId},</if>
-
         <if test="position != null and position != '' ">#{position},</if>
         <if test="department != null and department != ''">#{department},</if>
         <if test="nature != null and nature != ''">#{nature},</if>
@@ -522,7 +511,6 @@
             <if test="loginDate != null">login_date = #{loginDate},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null and remark != ''">remark = #{remark},</if>
-
             <if test="userType != null ">user_type = #{userType},</if>
             <if test="major != null and major != ''">major = #{major},</if>
             <if test="majorId != null">major_id = #{majorId},</if>
@@ -562,7 +550,6 @@
             <if test="loginDate != null">login_date = #{loginDate},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null and remark != ''">remark = #{remark},</if>
-
             <if test="userType != null ">user_type = #{userType},</if>
             <if test="major != null and major != ''">major = #{major},</if>
             <if test="majorId != null">major_id = #{majorId},</if>
@@ -601,7 +588,6 @@
             <if test="loginDate != null">login_date = #{loginDate},</if>
             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
             <if test="remark != null and remark != ''">remark = #{remark},</if>
-
             <if test="userType != null ">user_type = #{userType},</if>
             <if test="major != null and major != ''">major = #{major},</if>
             <if test="majorId != null">major_id = #{majorId},</if>
@@ -624,15 +610,11 @@
         where user_id = #{userId}
     </update>
 
-
     <update id="relieveUserByPosition" parameterType="com.zd.model.entity.SysUser">
         update sys_user
         set position = '未定'
         where user_id = #{userId}
     </update>
-<!--    <update id="updateUserStatus" parameterType="com.zd.model.domain.SysUser">-->
-<!-- 		update sys_user set status = #{status} where user_id = #{userId}-->
-<!--	</update>-->
 
     <update id="updateUserAvatar" parameterType="com.zd.model.entity.SysUser">
  		update sys_user set avatar = #{avatar} where user_name = #{userName}
@@ -735,8 +717,6 @@
 
     </select>
 
-
-
     <select id="selectUserListByNotWhite" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
         select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex,
         u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
@@ -805,11 +785,11 @@
         </if>
 
     </select>
+
     <select id="selectUserInfoByCardNum" resultType="com.zd.model.entity.SysUser">
         SELECT user_id,nick_name,card_num FROM sys_user u WHERE u.card_num = #{cardNum}
     </select>
 
-
     <select id="getSafeUserList" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
         select u.user_id, u.nick_name
         from
@@ -819,5 +799,4 @@
             AND FIND_IN_SET(u.user_id, #{safeUserId})
         </if>
     </select>
-
 </mapper>

+ 3 - 13
zd-modules/zd-modules-system/src/main/resources/mapper/system/SysUserRoleMapper.xml

@@ -32,31 +32,21 @@
                 ifnull((select data_sort from sys_dept where data_sort is not null and dept_id in (SELECT dept_id FROM sys_dept WHERE find_in_set((select dept_id from sys_user where user_id = #{userId}), ancestors)) order by data_sort desc limit 1), 0)
             else 0 end
         from (select role_id, data_scope from sys_role where role_id = (select role_id from sys_user_role where user_id = #{userId} limit 1) ) t
-
     </select>
 
     <select id="selectLevelByUserId" resultType="java.lang.Integer">
         select
-
-            case when
-                     '1' = t.data_scope then 1
-                 when
-                     '2' = t.data_scope then
+            case when '1' = t.data_scope then 1
+                 when '2' = t.data_scope then
                      (
-
                          select
                              case when a.count > 0
                                       then 1 else 2 end
-
                          from (select count(1) count from sys_role_dept where role_id = (select ur.role_id from sys_user_role ur left join sys_role r on ur.role_id = r.role_id where ur.user_id = #{userId} order by r.data_scope limit 1) and dept_id in (select dept_id from sys_dept where parent_id = 0)) a
-
                      )
-
-
                  else 2 end
-
         from
-            (select role_id, data_scope from sys_role where role_id = (select ur.role_id from sys_user_role ur left join sys_role r on ur.role_id = r.role_id where ur.user_id = #{userId} order by r.data_scope limit 1)) t
+        (select role_id, data_scope from sys_role where role_id = (select ur.role_id from sys_user_role ur left join sys_role r on ur.role_id = r.role_id where ur.user_id = #{userId} order by r.data_scope limit 1)) t
     </select>
 
     <delete id="deleteUserRole" >