wangliang 4 tahun lalu
induk
melakukan
3040dcef4e

+ 1 - 1
themis-backend/src/main/java/com/qmth/themis/backend/api/TEExamController.java

@@ -208,7 +208,7 @@ public class TEExamController {
     @ApiOperation(value = "考试批次查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考试批次信息", response = TEExam.class)})
-    public Result query(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "考试批次编码", required = false) @RequestParam(required = false) String code, @ApiParam(value = "考试批次名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "考试批次模式", required = false) @RequestParam(required = false) Integer mode, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
+    public Result query(@ApiParam(value = "考试批次id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "考试批次编码", required = false) @RequestParam(required = false) String code, @ApiParam(value = "考试批次名称", required = false) @RequestParam(required = false) String name, @ApiParam(value = "考试批次模式", required = false) @RequestParam(required = false) String mode, @ApiParam(value = "是否启用", required = false) @RequestParam(required = false) Integer enable, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
         IPage<TEExamQueryDto> teExamQueryDtoIPage = teExamService.examQuery(new Page<>(pageNumber, pageSize), id, code, name, mode, enable);
         BasePage basePage = new BasePage(teExamQueryDtoIPage.getRecords(), teExamQueryDtoIPage.getCurrent(), teExamQueryDtoIPage.getSize(), teExamQueryDtoIPage.getTotal());
         return ResultUtil.ok(basePage);

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/dao/TEExamMapper.java

@@ -32,7 +32,7 @@ public interface TEExamMapper extends BaseMapper<TEExam> {
      * @param enable
      * @return
      */
-    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, @Param("id") Long id, @Param("code") String code, @Param("name") String name, @Param("mode") Integer mode, @Param("enable") Integer enable);
+    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, @Param("id") Long id, @Param("code") String code, @Param("name") String name, @Param("mode") String mode, @Param("enable") Integer enable);
 
     /**
      * 获取考试待考列表

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/TEExamService.java

@@ -34,7 +34,7 @@ public interface TEExamService extends IService<TEExam> {
      * @param enable
      * @return
      */
-    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long id, String code, String name, Integer mode, Integer enable);
+    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long id, String code, String name, String mode, Integer enable);
 
     /**
      * 获取考试待考列表

+ 6 - 2
themis-business/src/main/java/com/qmth/themis/business/service/impl/TBAttachmentServiceImpl.java

@@ -99,7 +99,11 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
 
             boolean oss = (boolean) map.get(SystemConstant.OSS);
             LocalDateTime nowTime = LocalDateTime.now();
-            StringJoiner stringJoiner = new StringJoiner("").add(SystemConstant.FILES_DIR).add(File.separator);
+            StringJoiner stringJoiner = new StringJoiner("");
+            if (!oss) {
+                stringJoiner.add(SystemConstant.FILES_DIR).add(File.separator);
+            }
+
             String uploadType = String.valueOf(map.get(SystemConstant.UPLOAD_TYPE));
             if (Objects.isNull(uploadType)) {
                 throw new BusinessException(ExceptionResultEnum.ATTACHMENT_TYPE_IS_NULL);
@@ -115,7 +119,7 @@ public class TBAttachmentServiceImpl extends ServiceImpl<TBAttachmentMapper, TBA
             if (oss) {//上传至oss
                 stringJoiner.add(File.separator).add(String.valueOf(UUID.randomUUID()).replaceAll("-", ""))
                         .add(tbAttachment.getType());
-                ossUtil.ossUpload(map, stringJoiner.toString().replaceAll(SystemConstant.FILES_DIR + File.separator, ""), file.getInputStream());
+                ossUtil.ossUpload(map, stringJoiner.toString(), file.getInputStream());
             } else {//上传至服务器
                 File finalFile = new File(stringJoiner.add(File.separator).add(String.valueOf(UUID.randomUUID()).replaceAll("-", ""))
                         .add(tbAttachment.getType()).toString());

+ 1 - 1
themis-business/src/main/java/com/qmth/themis/business/service/impl/TEExamServiceImpl.java

@@ -93,7 +93,7 @@ public class TEExamServiceImpl extends ServiceImpl<TEExamMapper, TEExam> impleme
      * @return
      */
     @Override
-    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long id, String code, String name, Integer mode, Integer enable) {
+    public IPage<TEExamQueryDto> examQuery(IPage<Map> iPage, Long id, String code, String name, String mode, Integer enable) {
         return teExamMapper.examQuery(iPage, id, code, name, mode, enable);
     }
 

+ 9 - 9
themis-business/src/main/java/com/qmth/themis/business/templete/TaskImportCommon.java

@@ -128,15 +128,15 @@ public class TaskImportCommon {
                 this.ossUtil.ossUpload(this.ossEnv, file.getPath(), txtStr);
                 file.delete();
             }
-            //临时加的代码 我不知道该怎么写
-            if(this.exception) {
-            	this.tbTaskHistory.setSummary("处理出错");
-            }else {
-            	this.tbTaskHistory.setProgress(100.0);
-            	if(StringUtils.isBlank(this.tbTaskHistory.getSummary())) {
-            		this.tbTaskHistory.setSummary("处理成功");
-            	}
-            }
+//            //临时加的代码 我不知道该怎么写
+//            if(this.exception) {
+//            	this.tbTaskHistory.setSummary("处理出错");
+//            }else {
+//            	this.tbTaskHistory.setProgress(100.0);
+//            	if(StringUtils.isBlank(this.tbTaskHistory.getSummary())) {
+//            		this.tbTaskHistory.setSummary("处理成功");
+//            	}
+//            }
             tbTaskHistoryService.updateById(this.tbTaskHistory);
         } catch (IOException e) {
             e.printStackTrace();

+ 16 - 2
themis-business/src/main/resources/mapper/TBOrgMapper.xml

@@ -42,10 +42,24 @@
                 t_b_org tbo
             <where>
                 <if test="code != null and code != ''">
-                    and tbo.code = #{code}
+                    <choose>
+                        <when test="name != null and name != ''">
+                            (tbo.code like concat(#{code}, '%')
+                        </when>
+                        <otherwise>
+                            and tbo.code like concat(#{code}, '%')
+                        </otherwise>
+                    </choose>
                 </if>
                 <if test="name != null and name != ''">
-                    and tbo.login_name like concat(#{name}, '%')
+                    <choose>
+                        <when test="code != null and code != ''">
+                            or tbo.name like concat(#{name}, '%'))
+                        </when>
+                        <otherwise>
+                            and tbo.name like concat(#{name}, '%')
+                        </otherwise>
+                    </choose>
                 </if>
                 <if test="enable != null and enable != '' or enable == 0">
                     and tbo.enable = #{enable}

+ 17 - 2
themis-business/src/main/resources/mapper/TBUserMapper.xml

@@ -48,16 +48,31 @@
                     and tbu.id = #{id}
                 </if>
                 <if test="loginName != null and loginName != ''">
-                    and tbu.login_name like concat(#{loginName}, '%')
+                    <choose>
+                        <when test="name != null and name != ''">
+                            (tbu.login_name like concat(#{loginName}, '%')
+                        </when>
+                        <otherwise>
+                            and tbu.login_name like concat(#{loginName}, '%')
+                        </otherwise>
+                    </choose>
                 </if>
                 <if test="name != null and name != ''">
-                    and tbu.name like concat(#{name}, '%')
+                    <choose>
+                        <when test="loginName != null and loginName != ''">
+                            or tbu.name like concat(#{name}, '%'))
+                        </when>
+                        <otherwise>
+                            and tbu.name like concat(#{name}, '%')
+                        </otherwise>
+                    </choose>
                 </if>
                 <if test="enable != null and enable != '' or enable == 0">
                     and tbu.enable = #{enable}
                 </if>
             </where> group by tbu.org_id,tbu.id,tbu.mobile_number,tbu.login_name,tbu.name,tbu.enable) t
             <where>
+                t.roleCodeStr <![CDATA[ <> ]]> 'SUPER_ADMIN'
                 <if test="role != null and role != ''">
                     and t.roleCodeStr like concat(#{role}, '%')
                 </if>