Commit 9bc5bebf authored by hubaoshan's avatar hubaoshan

改 task id

parent 0e4d13a7
...@@ -2,40 +2,32 @@ package org.rcisoft.bus.jnsp7xtmdqsj.controller; ...@@ -2,40 +2,32 @@ package org.rcisoft.bus.jnsp7xtmdqsj.controller;
/*固定导入*/ /*固定导入*/
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjPageHandleDto; import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjPageHandleDto;
import org.rcisoft.bus.jnsp7xtmdqsj.entity.Jnsp7xtmDqsj;
import org.rcisoft.bus.jnsp7xtmdqsj.service.Jnsp7xtmDqsjService;
import org.rcisoft.bus.taskinfo.entity.TaskInfo; import org.rcisoft.bus.taskinfo.entity.TaskInfo;
import org.rcisoft.core.anno.CyEncryptSm4Anno; import org.rcisoft.core.anno.CyEncryptSm4Anno;
import org.rcisoft.core.anno.CyOpeLogAnno; import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum; import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.util.CyEpExcelUtil; import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyResultGenUtil;
import org.rcisoft.util.ExportToExcelUtil; import org.rcisoft.util.ExportToExcelUtil;
import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyResultGenUtil;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.exception.CyServiceException;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import org.rcisoft.bus.jnsp7xtmdqsj.entity.Jnsp7xtmDqsj;
import org.rcisoft.bus.jnsp7xtmdqsj.service.Jnsp7xtmDqsjService;
import org.springframework.web.multipart.MultipartFile;
import java.util.List; import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/** /**
* Created by cy on 2024年5月14日 上午10:20:48. * Created by cy on 2024年5月14日 上午10:20:48.
...@@ -162,7 +154,7 @@ public class Jnsp7xtmDqsjController extends CyPaginationController<Jnsp7xtmDqsj> ...@@ -162,7 +154,7 @@ public class Jnsp7xtmDqsjController extends CyPaginationController<Jnsp7xtmDqsj>
//service1 //service1
TaskInfo taskInfo = jnsp7xtmDqsjServiceImpl.addTaskInfo(); TaskInfo taskInfo = jnsp7xtmDqsjServiceImpl.addTaskInfo();
//service2 //service2
jnsp7xtmDqsjServiceImpl.monthlyTablePull(taskInfo.getTackId()); jnsp7xtmDqsjServiceImpl.monthlyTablePull(taskInfo.getTaskId());
return CyResultGenUtil.builder(new CyPersistModel(1), return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS, CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR, CyMessCons.MESSAGE_ALERT_ERROR,
......
...@@ -6,43 +6,29 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; ...@@ -6,43 +6,29 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.base.Stopwatch; import com.google.common.base.Stopwatch;
import com.mongodb.client.model.Collation; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.SqlSession;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.tools.ant.taskdefs.Sleep;
import org.rcisoft.bus.jnsp7xtm.dto.Jnsp7xtmDto;
import org.rcisoft.bus.jnsp7xtm.dto.Jnsp7xtmOptionDto; import org.rcisoft.bus.jnsp7xtm.dto.Jnsp7xtmOptionDto;
import org.rcisoft.bus.jnsp7xtm.entity.Jnsp7xtm;
import org.rcisoft.bus.jnsp7xtm.enums.ColTransitionEnum;
import org.rcisoft.bus.jnsp7xtm.enums.Jnsp7xtmDqsjType;
import org.rcisoft.bus.jnsp7xtm.vo.Jnsp7xtmVo; import org.rcisoft.bus.jnsp7xtm.vo.Jnsp7xtmVo;
import org.rcisoft.bus.jnsp7xtmdqsj.dao.Jnsp7xtmDqsjRepository;
import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjExportTemplateDto; import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjExportTemplateDto;
import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjImportDto; import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjImportDto;
import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjPageHandleDto; import org.rcisoft.bus.jnsp7xtmdqsj.dto.Jnsp7xtmDqsjPageHandleDto;
import org.rcisoft.bus.jnsp7xtmdqsj.entity.Jnsp7xtmDqsj;
import org.rcisoft.bus.jnsp7xtmdqsj.service.Jnsp7xtmDqsjService;
import org.rcisoft.bus.taskinfo.dao.TaskInfoRepository; import org.rcisoft.bus.taskinfo.dao.TaskInfoRepository;
import org.rcisoft.bus.taskinfo.entity.TaskInfo; import org.rcisoft.bus.taskinfo.entity.TaskInfo;
import org.rcisoft.core.exception.CyServiceException; import org.rcisoft.core.exception.CyServiceException;
import org.rcisoft.core.model.CyPageInfo;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyIdGenUtil; import org.rcisoft.core.util.CyIdGenUtil;
import org.rcisoft.core.util.CyUserUtil; import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.core.aop.CyPageUtilAsp;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.rcisoft.bus.jnsp7xtmdqsj.dao.Jnsp7xtmDqsjRepository;
import org.rcisoft.bus.jnsp7xtmdqsj.entity.Jnsp7xtmDqsj;
import org.rcisoft.bus.jnsp7xtmdqsj.service.Jnsp7xtmDqsjService;
import org.rcisoft.core.service.CyBaseService;
import org.rcisoft.enums.CyImportErrCodeEnum; import org.rcisoft.enums.CyImportErrCodeEnum;
import org.rcisoft.util.ExcelExportStatisticStyler;
import org.rcisoft.util.ExportToExcelUtil; import org.rcisoft.util.ExportToExcelUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -51,25 +37,21 @@ import org.springframework.stereotype.Service; ...@@ -51,25 +37,21 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation; import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.rcisoft.core.model.CyPageInfo; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.*; import java.util.ArrayList;
import java.util.concurrent.CompletableFuture; import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
/** /**
* Created by cy on 2024年5月14日 上午10:20:48. * Created by cy on 2024年5月14日 上午10:20:48.
...@@ -241,7 +223,7 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository, ...@@ -241,7 +223,7 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository,
} }
// Thread.sleep(5000); // Thread.sleep(5000);
LambdaUpdateWrapper<TaskInfo> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TaskInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TaskInfo::getTackId,taskId).set(TaskInfo::getStatus,"1"); updateWrapper.eq(TaskInfo::getTaskId,taskId).set(TaskInfo::getStatus,"1");
taskInfoRepository.update(null,updateWrapper); taskInfoRepository.update(null,updateWrapper);
log.info("数据同步需要多少秒" + stopwatch.elapsed().getSeconds()); log.info("数据同步需要多少秒" + stopwatch.elapsed().getSeconds());
} catch (Exception e) { } catch (Exception e) {
...@@ -289,7 +271,7 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository, ...@@ -289,7 +271,7 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository,
if (topFourButtonLock.tryLock(1000, TimeUnit.MILLISECONDS)) { if (topFourButtonLock.tryLock(1000, TimeUnit.MILLISECONDS)) {
try { try {
taskInfo.setStatus("0"); taskInfo.setStatus("0");
taskInfo.setTackId(CyIdGenUtil.uuid()); taskInfo.setTaskId(CyIdGenUtil.uuid());
taskInfo.setFlag("1"); taskInfo.setFlag("1");
taskInfoRepository.insert(taskInfo); taskInfoRepository.insert(taskInfo);
return taskInfo; return taskInfo;
......
package org.rcisoft.bus.taskinfo.entity; package org.rcisoft.bus.taskinfo.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import org.rcisoft.core.entity.CyIdEntity;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.rcisoft.core.entity.CyIdIncreEntity; import org.rcisoft.core.entity.CyIdIncreEntity;
/** /**
...@@ -28,7 +20,7 @@ public class TaskInfo extends CyIdIncreEntity<TaskInfo> { ...@@ -28,7 +20,7 @@ public class TaskInfo extends CyIdIncreEntity<TaskInfo> {
* @default * @default
*/ */
@Excel(name = "??id", orderNum = "0", width = 20) @Excel(name = "??id", orderNum = "0", width = 20)
private String tackId; private String taskId;
/** /**
* @desc ?? 0:??? 1:??? * @desc ?? 0:??? 1:???
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/> <result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="DATE" property="updateDate"/> <result column="update_date" jdbcType="DATE" property="updateDate"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/> <result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="tack_id" jdbcType="VARCHAR" property="tackId"/> <result column="task_id" jdbcType="VARCHAR" property="taskId"/>
<result column="status" jdbcType="VARCHAR" property="status"/> <result column="status" jdbcType="VARCHAR" property="status"/>
<result column="type" jdbcType="VARCHAR" property="type"/> <result column="type" jdbcType="VARCHAR" property="type"/>
<result column="type" jdbcType="VARCHAR" property="type"/> <result column="type" jdbcType="VARCHAR" property="type"/>
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<if test="entity.flag !=null and entity.flag != '' "> <if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag} and flag = #{entity.flag}
</if> </if>
<if test="entity.tackId !=null and entity.tackId != '' "> <if test="entity.taskId !=null and entity.taskId != '' ">
and tack_id = #{entity.tackId} and task_id = #{entity.taskId}
</if> </if>
<if test="entity.status !=null and entity.status != '' "> <if test="entity.status !=null and entity.status != '' ">
and status like concat('%',#{entity.status},'%') and status like concat('%',#{entity.status},'%')
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
<if test="entity.flag !=null and entity.flag != '' "> <if test="entity.flag !=null and entity.flag != '' ">
and flag = #{entity.flag} and flag = #{entity.flag}
</if> </if>
<if test="entity.tackId !=null and entity.tackId != '' "> <if test="entity.taskId !=null and entity.taskId != '' ">
and tack_id like concat('%',#{entity.tackId},'%') and task_id like concat('%',#{entity.taskId},'%')
</if> </if>
<if test="entity.status !=null and entity.status != '' "> <if test="entity.status !=null and entity.status != '' ">
and status like concat('%',#{entity.status},'%') and status like concat('%',#{entity.status},'%')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment