瀏覽代碼

修改定时任务-关于报表日志统计

2507040827 8 小時之前
父節點
當前提交
31128a04bf

+ 1 - 34
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/controller/AitagTagLogController.java

@@ -5,6 +5,7 @@ import cn.com.yusys.yusp.commons.module.adapter.web.rest.ResultDto;
 import cn.com.yusys.yusp.domain.entity.AitagTagLogEntity;
 import cn.com.yusys.yusp.domain.vo.*;
 import cn.com.yusys.yusp.service.AitagTagLogService;
+import cn.com.yusys.yusp.service.DistributedScheduledTask;
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -110,39 +111,6 @@ public class AitagTagLogController {
         return ResultDto.success(taggingDetailsResDTO);
     }
 
-//    /**
-//     * 导出数据
-//     *
-//     * @param transactionReqVo
-//     * @return ResultDto
-//     */
-//    @ApiOperation("导出数据")
-//    @PostMapping("/exportData")
-//    public void exportData(@RequestBody TaggingTransactionReqVo transactionReqVo,HttpServletResponse response) throws IOException {
-//        List<AitagTagLogEntity> aitagTagLogEntities = aitagTagLogService.queryList(transactionReqVo);
-//        List<ExportDataVo> exportDataVos = new ArrayList<>();
-//        for (AitagTagLogEntity aitagTagLog:aitagTagLogEntities) {
-//            ExportDataVo exportDataVo = JSONObject.parseObject(JSONObject.toJSONString(aitagTagLog), ExportDataVo.class);
-//            if(FEEDBACK_RESULT_REJECT.equals(aitagTagLog.getFeedback())){
-//                String feedbackResult = aitagTagLog.getFeedbackResult();
-//                exportDataVo.setResult(getTags(feedbackResult));
-//            }else{
-//                String result = aitagTagLog.getResult();
-//                exportDataVo.setResult(getTags(result));
-//            }
-//            exportDataVos.add(exportDataVo);
-//        }
-//        // 2. 设置响应头(防止中文乱码)
-//        response.reset();
-//        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-//        response.setCharacterEncoding("utf-8");
-//        String fileName = URLEncoder.encode("导出标签", "UTF-8").replaceAll("\\+", "%20");
-//        response.setHeader("Content-Disposition", "attachment; filename*=utf-8''" + fileName + ".xlsx");
-//        EasyExcel.write(response.getOutputStream(), ExportDataVo.class)
-//                .sheet("标签数据")
-//                .doWrite(exportDataVos);
-//    }
-
 
     /**
      * 导出数据
@@ -195,5 +163,4 @@ public class AitagTagLogController {
         return stringBuilder.toString();
     }
 
-
 }

+ 0 - 2
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/DistributedScheduledTask.java

@@ -29,8 +29,6 @@ import static cn.com.yusys.yusp.config.DataDictionary.FEEDBACK_RESULT_AGREE;
 public class DistributedScheduledTask {
 
 
-    private static final String TASK_LOCK_KEY = "scheduled_task:sync_data";
-
 
     @Autowired
     private StringRedisTemplate redisTemplate;

+ 0 - 1
server/yusp-tagging-core/src/main/java/cn/com/yusys/yusp/service/TagImportListener.java

@@ -28,7 +28,6 @@ public class TagImportListener extends AnalysisEventListener<TagImportDto> {
         if (!StringUtils.isBlank(data.getParentName())) {
             data.setParentName(data.getParentName().trim());
         }
-
         // 生成临时 ID
         data.setId(UUID.randomUUID().toString().replace("-", ""));
         dataList.add(data);

+ 4 - 4
server/yusp-tagging-core/src/main/resources/mapper/AitagTagDailyAggMapper.xml

@@ -4,7 +4,7 @@
     <resultMap id="aitagTagDailyAgg" type="cn.com.yusys.yusp.domain.entity.AitagTagDailyAggEntity">
         <id column="id" jdbcType="VARCHAR" property="id"/>
         <result column="agg_date" jdbcType="VARCHAR" property="aggDate"/>
-        <result column="category_nm" jdbcType="VARCHAR" property="categoryNm"/>
+        <result column="category_code" jdbcType="VARCHAR" property="categoryCode"/>
         <result column="tag_nm" jdbcType="VARCHAR" property="tagNm"/>
         <result column="tag_count" jdbcType="INTEGER" property="tagCount"/>
     </resultMap>
@@ -16,13 +16,13 @@
         tag_count AS val
         FROM aitag_tag_daily_agg
         <where>
-            <if test="startTaggingTime != null">
+            <if test="startTaggingTime != null and startTaggingTime != ''">
                 AND agg_date >= #{startTaggingTime}
             </if>
-            <if test="endTaggingTime != null">
+            <if test="endTaggingTime != null and endTaggingTime != ''">
                 AND #{endTaggingTime} >= agg_date
             </if>
-            <if test="categoryCode != null">
+            <if test="categoryCode != null and categoryCode != '' ">
                 AND #{categoryCode} = category_code
             </if>
             <if test="sort == 'ase'">

+ 1 - 2
server/yusp-tagging-core/src/main/resources/mapper/AitagTagLogMapper.xml

@@ -104,11 +104,10 @@
     <select id="selectByInsertTime" resultType="cn.com.yusys.yusp.domain.entity.AitagTagLogEntity">
         SELECT id, app_id, insert_time, business_attr, phrase, attachment, attachment_url, `result`, feedback_user_id, feedback_user_nm, feedback_time, feedback, feedback_result, state, consuming_time, category_code
         FROM aitag_tag_log
-            where
         WHERE
             tag_scope = 0
         AND DATE(insert_time) = #{insertTime}
-        AND state in ("2","3")
+        AND state in ('2','3')
     </select>
 
 </mapper>