Browse Source

Merge branch 'dev_v3.2.1' into dev_v3.2.2
merge

wangliang 2 years ago
parent
commit
c64a6af2a5

+ 2 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFFlowJoinService.java

@@ -46,4 +46,6 @@ public interface TFFlowJoinService extends IService<TFFlowJoin> {
      * @return
      */
     public List<TFFlowJoin> findByFlowEntityId(Long flowEntityId);
+
+    void deleteByObjectIdAndFlowId(Long objectId, Long flowId);
 }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamCardServiceImpl.java

@@ -531,7 +531,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
             throw ExceptionResultEnum.ERROR.exception("通用规则未设置");
         }
 
-        if (StringUtils.isBlank(examCardParams.getMakeMethod().name())) {
+        if (Objects.nonNull(examCardParams.getMakeMethod()) && StringUtils.isBlank(examCardParams.getMakeMethod().name())) {
             throw ExceptionResultEnum.ERROR.exception("题卡制作方式不能为空");
         }
         if (examCardParams.getStatus() == null) {

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -291,6 +291,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         return this.baseMapper.listUser(schoolId, SystemConstant.translateSpecificSign(param), orgIds);
     }
 
+    @Transactional
     @Override
     public Boolean assignUser(ExamTask examTask) {
         if (examTask.getId() == null) {
@@ -340,6 +341,8 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     map = activitiService.customFlowStart(map);
                     flowId = SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID));
                     map.computeIfAbsent(SystemConstant.FLOW_JOIN_TYPE, v -> FlowJoinTypeEnum.NEW);
+
+                    tfFlowJoinService.deleteByObjectIdAndFlowId(examTask.getId(), null);
                     tfFlowJoinService.saveOrUpdate(map);
                 } else {
                     flowId = task.getFlowId();

+ 11 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowJoinServiceImpl.java

@@ -1,6 +1,7 @@
 package com.qmth.distributed.print.business.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.entity.TFFlowJoin;
@@ -118,4 +119,14 @@ public class TFFlowJoinServiceImpl extends ServiceImpl<TFFlowJoinMapper, TFFlowJ
     public List<TFFlowJoin> findByFlowEntityId(Long flowEntityId) {
         return this.list(new QueryWrapper<TFFlowJoin>().lambda().eq(TFFlowJoin::getFlowEntityId, flowEntityId));
     }
+
+    @Override
+    public void deleteByObjectIdAndFlowId(Long objectId, Long flowId) {
+        UpdateWrapper<TFFlowJoin> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().eq(TFFlowJoin::getObjectId, objectId);
+        if (flowId != null) {
+            updateWrapper.lambda().eq(TFFlowJoin::getFlowId, flowId);
+        }
+        this.remove(updateWrapper);
+    }
 }

+ 1 - 1
distributed-print-business/src/main/resources/mapper/BasicCardRuleMapper.xml

@@ -37,7 +37,7 @@
             <if test="schoolId != null and schoolId != ''">
                 and school_id = #{schoolId}
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and enable = #{enable}
             </if>
             <if test="name != null and name != ''">

+ 1 - 1
distributed-print-business/src/main/resources/mapper/BasicExamMapper.xml

@@ -40,7 +40,7 @@
             <if test="semesterId != null and semesterId != ''">
                 and a.semester_id = #{semesterId}
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and a.enable = #{enable}
             </if>
         </where>

+ 1 - 1
distributed-print-business/src/main/resources/mapper/BasicPrintConfigMapper.xml

@@ -36,7 +36,7 @@
             <if test="examId != null and examId != ''">
                 and exam_id = #{examId}
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and enable = #{enable}
             </if>
             <if test="createStartTime != null and createStartTime != ''">

+ 1 - 1
distributed-print-business/src/main/resources/mapper/BasicTemplateMapper.xml

@@ -45,7 +45,7 @@
             <if test="name != null and name != ''">
                 and name like concat('%',#{name}, '%')
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and enable = #{enable}
             </if>
             <if test="startTime != null and startTime != ''">

+ 1 - 1
distributed-print-business/src/main/resources/mapper/ExamCardMapper.xml

@@ -197,7 +197,7 @@
             <if test="createMethod != null and createMethod != ''">
                 and create_method = #{createMethod}
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and enable = #{enable}
             </if>
             <if test="createStartTime != null and createStartTime != ''">

+ 7 - 1
teachcloud-common/src/main/resources/mapper/SysRoleMapper.xml

@@ -44,13 +44,19 @@
             <if test="name != null and name != ''">
                 and name like concat('%', #{name}, '%')
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and enable = #{enable}
             </if>
         </where>
         union
         select id, school_id, name, enable, type, create_id, create_time, update_id, update_time, default_role, interpret from sys_role
         where default_role = 1 and type <![CDATA[ <> ]]> 'ADMIN'
+            <if test="name != null and name != ''">
+                and name like concat('%', #{name}, '%')
+            </if>
+            <if test="enable != null and enable != '' or enable == 0">
+                and enable = #{enable}
+            </if>
             ) t
         ORDER BY t.create_time
     </select>

+ 4 - 4
teachcloud-common/src/main/resources/mapper/SysUserMapper.xml

@@ -60,7 +60,7 @@
                 and a.school_id = #{schoolId}
             </if>
             <if test="userInfo != null and userInfo != ''">
-                and a.login_name like concat('%', #{userInfo} , '%') or a.real_name like concat('%', #{userInfo} , '%') or a.mobile_number like concat('%', #{userInfo} , '%')
+                and (a.login_name like concat('%', #{userInfo} , '%') or a.real_name like concat('%', #{userInfo} , '%') or a.mobile_number like concat('%', #{userInfo} , '%'))
             </if>
             <if test="orgId != null and orgId != ''">
                 and a.org_id = #{orgId}
@@ -68,7 +68,7 @@
             <if test="roleId != null and roleId != ''">
                 and a.id in (select user_id from sys_user_role b where b.role_id = #{roleId})
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and a.enable = #{enable}
             </if>
         </where>
@@ -98,7 +98,7 @@
             <if test="roleId != null and roleId != ''">
                 and a.id in (select user_id from sys_user_role b where b.role_id = #{roleId})
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and a.enable = #{enable}
             </if>
             <if test="loginName != null and loginName != ''">
@@ -164,7 +164,7 @@
             <if test="realName != null and realName != ''">
                 and a.real_name like concat('%', #{realName} , '%')
             </if>
-            <if test="enable != null">
+            <if test="enable != null and enable != '' or enable == 0">
                 and a.enable = #{enable}
             </if>
         </where>