Bläddra i källkod

rebuild: something

shc 9 månader sedan
förälder
incheckning
054c693c5e

+ 2 - 27
hnqz-visual/hnqz-report-biz/src/main/java/com/qunzhixinxi/hnqz/report/mq/ExcelReportExportNbReceiver.java

@@ -4,9 +4,7 @@ import cn.hutool.json.JSONUtil;
 import com.qunzhixinxi.hnqz.admin.api.constant.CacheConstants;
 import com.qunzhixinxi.hnqz.admin.api.constant.MqConstants;
 import com.qunzhixinxi.hnqz.admin.api.entity.WmReport;
-import com.qunzhixinxi.hnqz.admin.api.constant.enums.ReportTypeEnum;
-import com.qunzhixinxi.hnqz.report.service.ExcelReportExportService;
-import com.qunzhixinxi.hnqz.report.service.ReportHandlerDeptRelationService;
+import com.qunzhixinxi.hnqz.report.service.ReportExportService;
 import com.qunzhixinxi.hnqz.common.core.constant.CommonConstants;
 import com.qunzhixinxi.hnqz.common.core.entity.BaseMap;
 import com.qunzhixinxi.hnqz.common.core.util.R;
@@ -33,10 +31,7 @@ import java.util.Map;
 @RabbitMqComponent(value = "excelNbReportExportReceiver")
 public class ExcelReportExportNbReceiver extends BaseRabbiMqHandler<BaseMap> {
 
-//    private final ReportExportService reportExportService;
-//    private final WmReportExportRecordService wmReportExportRecordService;
-
-    private final ReportHandlerDeptRelationService reportHandlerDeptRelationService;
+    private final ReportExportService reportExportService;
 
     @RabbitHandler
     public void onMessage(BaseMap baseMap, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag) {
@@ -46,19 +41,11 @@ public class ExcelReportExportNbReceiver extends BaseRabbiMqHandler<BaseMap> {
             String requestBody = map.get("requestBody").toString();
             String username = map.get("username").toString();
             Integer deptId = Integer.valueOf(map.get("deptId").toString());
-//            Integer exportRecordId = Integer.valueOf(map.get("recordId").toString());
             WmReport wmReport = JSONUtil.toBean(requestBody, WmReport.class);
             String key = String.format(CacheConstants.EXCEL_EXPORT_NB_REPORT_CACHE, wmReport.getId());
             String resStr = "ERROR_未知错误,请联系管理员";
 
-//            int exportStatus = WmReportOpt.WmReportOptStatus.GENERATED.ordinal();
-//            String name = "无";
-//            String title = "无";
-
             try {
-                // 根据企业获取对应报告处理类
-                ExcelReportExportService reportExportService =
-                        reportHandlerDeptRelationService.getExcelHandlerClass(ReportTypeEnum.EXCEL_NB.getType(), deptId);
 
                 R r = reportExportService.newExportNb(wmReport, deptId, username);
                 if (r.getCode() == CommonConstants.SUCCESS){
@@ -66,12 +53,9 @@ public class ExcelReportExportNbReceiver extends BaseRabbiMqHandler<BaseMap> {
                     Map<String,String> data = (Map<String, String>) r.getData();
                     log.info("result-map:{}",data);
                     resStr = data.get("url") ;
-//                    name = data.get("fileName");
-//                    title = data.get("orgFileNmae");
                 } else {
                     // error msg
                     resStr = r.getMsg();
-//                    exportStatus = WmReportOpt.WmReportOptStatus.ERROR.ordinal();
                 }
             } catch (Exception e) {
                 log.error("excel_nb报告导出异常", e);
@@ -79,15 +63,6 @@ public class ExcelReportExportNbReceiver extends BaseRabbiMqHandler<BaseMap> {
                 Map<String,String> res = new HashMap<>(2);
                 res.put("key",key);
                 res.put("res",resStr);
-
-
-//                WmReportExportRecord byId = wmReportExportRecordService.getById(exportRecordId);
-//                byId.setExportStatus(exportStatus);
-//                byId.setUrl(resStr);
-//                byId.setTitle(title);
-//                byId.setReportNum(name);
-//                byId.setFinishTime(LocalDateTime.now());
-//                wmReportExportRecordService.updateById(byId);
                 return res;
             }
         });

+ 1 - 1
hnqz-visual/hnqz-report-biz/src/main/java/com/qunzhixinxi/hnqz/report/service/ReportExportService.java

@@ -61,7 +61,7 @@ public interface ReportExportService {
      * @return
      * @throws IOException
      */
-    R newExportNb(WmReport wmReport, Integer deptId, String username) throws IOException;
+    R<?> newExportNb(WmReport wmReport, Integer deptId, String username) throws IOException;
 
     List<Map<String, Object>> exportZbInfo(WmTask wmTask) throws IOException;
 

+ 4 - 4
hnqz-visual/hnqz-report-biz/src/main/java/com/qunzhixinxi/hnqz/report/service/impl/ReportExportServiceImpl.java

@@ -106,7 +106,7 @@ public class ReportExportServiceImpl implements ReportExportService {
      * @throws IOException
      */
     @Override
-    public R newExportNb(WmReport wmReport, Integer deptId, String username) throws IOException {
+    public R<?> newExportNb(WmReport wmReport, Integer deptId, String username) throws IOException {
 
 
         wmReport = wmReportService.getById(wmReport.getId());
@@ -114,9 +114,9 @@ public class ReportExportServiceImpl implements ReportExportService {
         // 更新任务表审批意见
         WmScorePackage scorePackage = wmScorePackageService.getById(wmReport.getScoreId());
         WmTask wmTask = new WmTask();
-        wmTask.setDelFlag("0");
-        wmTask.setEnableFlag("0");
-        wmTask.setRealFlag("0");
+        wmTask.setDelFlag(CommonConstants.STATUS_NORMAL);
+        wmTask.setEnableFlag(CommonConstants.STATUS_NORMAL);
+        wmTask.setRealFlag(CommonConstants.STATUS_NORMAL);
 
         SysDept sysDept = sysDeptService.getById(scorePackage.getSendPackageDeptId());