Переглянути джерело

核心业务 列表

tags/24080901
PoffyZhang 1 рік тому
джерело
коміт
495da9b2c7
7 змінених файлів з 70 додано та 4 видалено
  1. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java
  2. +25
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectApply.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApplyVO.java
  5. +9
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java
  6. +4
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCoreBizTask.java
  7. +28
    -0
      pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java

+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/constant/BizConst.java Переглянути файл

@@ -92,6 +92,8 @@ public interface BizConst {
String RESPONSE_KEY_MATTER_NAME = "matterName";
String RESPONSE_KEY_ORG_NAME = "orgName";
String RESPONSE_KEY_USER_STATE = "userState";

String RESPONSE_KEY_AREA_NAME = "areaName";
String ORG_NAME = "organizationName";
String ORG_CODE = "organizationCode";



+ 25
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java Переглянути файл

@@ -50,7 +50,11 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Field;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.Temporal;
import java.util.*;
import java.util.stream.Collectors;

@@ -440,6 +444,11 @@ public class GovProjectCollectionManage {
}else{
saveApply.setTongTime(LocalDateTime.now());
}
if(Objects.nonNull(saveApply.getBaseProjStartTime()) &&
Objects.nonNull(saveApply.getBaseProjEndTime())){
saveApply.setBaseProjDuration(convertMonth(saveApply.getBaseProjStartTime(),
saveApply.getBaseProjEndTime()));
}
saveApply.setAreaCode(RegionConst.RC_LS);
saveApply.setBizTime(LocalDateTime.now());
saveApply.setUpdateBy(user.getUsername());
@@ -577,6 +586,22 @@ public class GovProjectCollectionManage {
}

/**
* 计算2个时间的月份
* @param baseProjStartTime
* @param baseProjEndTime
* @return
*/
public static String convertMonth(LocalDateTime baseProjStartTime, LocalDateTime baseProjEndTime) {
String start = baseProjStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String end = baseProjEndTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Temporal temporal1 = LocalDate.parse(start);
Temporal temporal2 = LocalDate.parse(end);
// 方法返回为相差月份
Long ll = ChronoUnit.MONTHS.between(temporal1, temporal2);
return ll.toString();
}

/**
* 暂存草稿箱
* @param saveDTO
* @param user


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectApply.java Переглянути файл

@@ -76,7 +76,7 @@ public class GovBizProjectApply implements Serializable {
private LocalDateTime baseProjEndTime;

@ApiModelProperty("项目期限")
private LocalDateTime baseProjDuration;
private String baseProjDuration;

@ApiModelProperty("项目年度")
private String baseProjSetYear;


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApplyVO.java Переглянути файл

@@ -71,7 +71,7 @@ public class GovBizProjectApplyVO implements Serializable {
private LocalDateTime baseProjEndTime;

@ApiModelProperty("项目期限")
private LocalDateTime baseProjDuration;
private String baseProjDuration;

@ApiModelProperty("项目年度")
private String baseProjSetYear;


+ 9
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java Переглянути файл

@@ -22,6 +22,8 @@ import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.ExcelExportStyle;
import com.ningdatech.pmapi.irs.manage.ProjectIrsManage;
import com.ningdatech.pmapi.irs.model.entity.ProjectCoreBiz;
import com.ningdatech.pmapi.irs.service.IProjectCoreBizService;
import com.ningdatech.pmapi.projectdeclared.contants.DeclaredProjectContant;
import com.ningdatech.pmapi.projectdeclared.model.dto.*;
import com.ningdatech.pmapi.projectdeclared.model.entity.ProjectDraft;
@@ -96,6 +98,8 @@ public class DeclaredProjectManage {

private final ProjectIrsManage projectIrsManage;

private final IProjectCoreBizService coreBizService;

@Value("${spring.profiles.active}")
private String active;

@@ -459,7 +463,11 @@ public class DeclaredProjectManage {
}
}else if(BizConst.PRE.equals(active) ||
BizConst.PROD.equals(active)){
jsonObject = projectIrsManage.searchCoreBiz(businessName,user.getEmpPosUnitCode(),limit,page);
// jsonObject = projectIrsManage.searchCoreBiz(businessName,user.getEmpPosUnitCode(),limit,page);
List<ProjectCoreBiz> list = coreBizService.list(Wrappers.lambdaQuery(ProjectCoreBiz.class)
.eq(ProjectCoreBiz::getOrgCode, user.getEmpPosUnitCode())
.like(StringUtils.isNotBlank(businessName), ProjectCoreBiz::getMatterName, businessName));
jsonObject.put("data",list);
}
return jsonObject;
}


+ 4
- 1
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/SynProjectCoreBizTask.java Переглянути файл

@@ -104,7 +104,7 @@ public class SynProjectCoreBizTask {
String matterName = jsonData.getString(BizConst.RESPONSE_KEY_MATTER_NAME);
String orgName = jsonData.getString(BizConst.RESPONSE_KEY_ORG_NAME);
String userState = jsonData.getString(BizConst.RESPONSE_KEY_USER_STATE);
String areaName = jsonData.getString(BizConst.RESPONSE_KEY_AREA_NAME);
ProjectCoreBiz old = projectCoreBizService.getOne(Wrappers.lambdaQuery(ProjectCoreBiz.class)
.eq(ProjectCoreBiz::getIrsId, irsId)
.last(BizConst.LIMIT_1));
@@ -114,11 +114,14 @@ public class SynProjectCoreBizTask {
}else{
coreBiz.setCreateOn(LocalDateTime.now());
}
coreBiz.setUpdateOn(LocalDateTime.now());
coreBiz.setIrsId(irsId);
coreBiz.setMatterName(matterName);
coreBiz.setOrgCode(dingCode);
coreBiz.setOrgName(orgName);
coreBiz.setUserState(userState);
coreBiz.setAreaName(areaName);
coreBiz.setMatterCode(irsId.toString());
projectCoreBizService.saveOrUpdate(coreBiz);
coreBiz.setMatterCode(genirate(unifiedSocialCreditCode,coreBiz.getId()));
projectCoreBizService.updateById(coreBiz);


+ 28
- 0
pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java Переглянути файл

@@ -23,6 +23,11 @@ import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.net.UnknownHostException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.time.temporal.Temporal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -158,4 +163,27 @@ public class ProjectCollectionTest extends AppTests {
}
}
}

@Test
public void test5(){
List<GovBizProjectApply> list = applyService.list(Wrappers.lambdaQuery(GovBizProjectApply.class)
.isNotNull(GovBizProjectApply::getBaseProjStartTime)
.isNotNull(GovBizProjectApply::getBaseProjEndTime)
.isNull(GovBizProjectApply::getBaseProjDuration));

for(GovBizProjectApply apply : list){
apply.setBaseProjDuration(convertMonth(apply.getBaseProjStartTime(),apply.getBaseProjEndTime()));
applyService.updateById(apply);
}
}

public static String convertMonth(LocalDateTime baseProjStartTime, LocalDateTime baseProjEndTime) {
String start = baseProjStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
String end = baseProjEndTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
Temporal temporal1 = LocalDate.parse(start);
Temporal temporal2 = LocalDate.parse(end);
// 方法返回为相差月份
Long ll = ChronoUnit.MONTHS.between(temporal1, temporal2);
return ll.toString();
}
}

Завантаження…
Відмінити
Зберегти