|
@@ -20,6 +20,7 @@ import com.ruoyi.zdsz.service.IZEngineeringInfoService;
|
|
|
import com.ruoyi.zdsz.service.IZEngineeringNodeService;
|
|
|
import com.ruoyi.zdsz.service.IZEngineeringReviewService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -31,6 +32,7 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
import static cn.hutool.core.date.DateUtil.format;
|
|
|
+import static com.ruoyi.common.core.mapper.BaseMapperPlus.log;
|
|
|
|
|
|
/**
|
|
|
* 工程节点Service业务层处理
|
|
@@ -40,7 +42,7 @@ import static cn.hutool.core.date.DateUtil.format;
|
|
|
*/
|
|
|
@RequiredArgsConstructor
|
|
|
@Service
|
|
|
-
|
|
|
+@Slf4j
|
|
|
public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
|
|
|
|
|
|
private final ZEngineeringNodeMapper baseMapper;
|
|
@@ -123,19 +125,19 @@ public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
|
|
|
return lqw;
|
|
|
}
|
|
|
@Override
|
|
|
- @Async
|
|
|
+
|
|
|
public String ZEngineeringReview(ZEngineeringNodeBo bo) {
|
|
|
- String userId=LoginHelper.getLoginUser().getUserId().toString();
|
|
|
+ String userId=LoginHelper.getLoginUser().getUsername().toString();
|
|
|
SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
|
|
|
Date date = new Date(System.currentTimeMillis());
|
|
|
- formatter.format(date);
|
|
|
- List<String>dateList= getMonthBetweenDates("2023-12","2024-01");
|
|
|
+
|
|
|
+ List<String>dateList= getMonthBetweenDates("2023-09",formatter.format(date));
|
|
|
dateList.stream().forEach(item->{
|
|
|
Runnable runnable=new Runnable() {
|
|
|
@Override
|
|
|
public void run( ) {
|
|
|
try {
|
|
|
- getZEngineeringNodeList(item,userId);
|
|
|
+ getZEngineeringNodeList(item,userId,bo);
|
|
|
Thread.sleep(30000);
|
|
|
} catch (InterruptedException e) {
|
|
|
throw new RuntimeException(e);
|
|
@@ -147,7 +149,7 @@ public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
|
|
|
});
|
|
|
return null;
|
|
|
}
|
|
|
- public List getZEngineeringNodeList(String date,String UserId)
|
|
|
+ public List getZEngineeringNodeList(String date,String UserId,ZEngineeringNodeBo bo)
|
|
|
{
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
|
|
|
List<ZEngineeringNodeVo> list= new ArrayList<>();
|
|
@@ -155,9 +157,17 @@ public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
|
|
|
Date startdate = format.parse(date);
|
|
|
ZEngineeringNodeBo zEngineeringNodeBo=new ZEngineeringNodeBo();
|
|
|
zEngineeringNodeBo.setCreateTime(startdate);
|
|
|
+ zEngineeringNodeBo.setType(bo.getType());
|
|
|
SimpleDateFormat format2 = new SimpleDateFormat("yyyy_MM");
|
|
|
MonthTableNameHandler.setData(format2.format(startdate));
|
|
|
- list =queryList(zEngineeringNodeBo);
|
|
|
+ try {
|
|
|
+ list =queryList(zEngineeringNodeBo);
|
|
|
+ }catch (Exception e)
|
|
|
+ {
|
|
|
+ log.info("没有{}该表",format2);
|
|
|
+
|
|
|
+ return null ;
|
|
|
+ }
|
|
|
List zEngineeringReviewList=new ArrayList<>();
|
|
|
list.stream().forEach(item->{
|
|
|
ZEngineeringReviewBo zEngineeringReview =new ZEngineeringReviewBo();
|
|
@@ -231,6 +241,7 @@ public class ZEngineeringNodeServiceImpl implements IZEngineeringNodeService {
|
|
|
public Boolean update(ZEngineeringNodeBo bo) {
|
|
|
ZEngineeringNode update = BeanUtil.toBean(bo, ZEngineeringNode.class);
|
|
|
validEntityBeforeSave(update);
|
|
|
+ bo.getzEngineeringInfoBo().setCreateTime(bo.getCreateTime());
|
|
|
izEngineeringInfoService.update(bo.getzEngineeringInfoBo());
|
|
|
return baseMapper.updateById(update) > 0;
|
|
|
}
|