|
@@ -40,15 +40,17 @@ public class U9InfoTask {
|
|
|
private final ChuanyunCompanyDao chuanyunCompanyDao;
|
|
|
private final ChuanyunClientDao chuanyunClientDao;
|
|
|
private final ChuanyunUserDao chuanyunUserDao;
|
|
|
+ private final ChuanyunOutDepartmentDao chuanyunOutDepartmentDao;
|
|
|
|
|
|
|
|
|
- public U9InfoTask(ChuanYunManager chuanYunManager, ClawFeign clawFeign, ChuanyunBudgetStatisticsDao chuanyunBudgetStatisticsDao, ChuanyunCompanyDao chuanyunCompanyDao, ChuanyunClientDao chuanyunClientDao, ChuanyunUserDao chuanyunUserDao) {
|
|
|
+ public U9InfoTask(ChuanYunManager chuanYunManager, ClawFeign clawFeign, ChuanyunBudgetStatisticsDao chuanyunBudgetStatisticsDao, ChuanyunCompanyDao chuanyunCompanyDao, ChuanyunClientDao chuanyunClientDao, ChuanyunUserDao chuanyunUserDao, ChuanyunOutDepartmentDao chuanyunOutDepartmentDao) {
|
|
|
this.chuanYunManager = chuanYunManager;
|
|
|
this.clawFeign = clawFeign;
|
|
|
this.chuanyunBudgetStatisticsDao = chuanyunBudgetStatisticsDao;
|
|
|
this.chuanyunCompanyDao = chuanyunCompanyDao;
|
|
|
this.chuanyunClientDao = chuanyunClientDao;
|
|
|
this.chuanyunUserDao = chuanyunUserDao;
|
|
|
+ this.chuanyunOutDepartmentDao = chuanyunOutDepartmentDao;
|
|
|
}
|
|
|
|
|
|
@Scheduled(fixedDelay = 3600000L)
|
|
@@ -419,6 +421,10 @@ public class U9InfoTask {
|
|
|
String newDate = dateTimeFormatter.format(chuanyunLaborCostDTO.getChuanyunLaborCostPrimaryKey().getPeriod());
|
|
|
LocalDateTime dt = LocalDateTime.parse(newDate,dateTimeFormatter);
|
|
|
chuanyunLaborCostDTO.getChuanyunLaborCostPrimaryKey().setPeriod(dt);
|
|
|
+ ChuanyunOutDepartmentDO chuanyunOutDepartmentDO = chuanyunOutDepartmentDao.findByDepartment(chuanyunLaborCostDTO.getChuanyunLaborCostPrimaryKey().getDepartment());
|
|
|
+ if (chuanyunOutDepartmentDO!=null){
|
|
|
+ chuanyunLaborCostDTO.getChuanyunLaborCostPrimaryKey().setDepartment(chuanyunOutDepartmentDO.getDepartmentId());
|
|
|
+ }
|
|
|
LaborCostDTO laborCostDTO = new LaborCostDTO(chuanyunLaborCostDTO);
|
|
|
laborCostDTO.setDataType("U9");
|
|
|
var purcostString=objectMapper.writeValueAsString(laborCostDTO);
|
|
@@ -427,6 +433,7 @@ public class U9InfoTask {
|
|
|
List<String> matchers = new ArrayList<>();
|
|
|
matchers.add("F0000005_2,"+chuanyunLaborCostDTO.getChuanyunLaborCostPrimaryKey().getProjectcode());
|
|
|
matchers.add("F0000002_2,"+chuanyunLaborCostDTO.getChuanyunLaborCostPrimaryKey().getPeriod());
|
|
|
+ matchers.add("F0000015_2,"+chuanyunLaborCostDTO.getChuanyunLaborCostPrimaryKey().getDepartment());
|
|
|
var filter= Filter.instance(0,1,true,"And",matchers);
|
|
|
var chuanyunFindAllResponse=chuanYunManager.findAll(ChuanyunMonthLaborCostDO.SCHEMA_CODE,filter);
|
|
|
if (chuanyunFindAllResponse.getReturnData() == null) {
|
|
@@ -439,7 +446,7 @@ public class U9InfoTask {
|
|
|
chuanyunSaveDTO = chuanYunManager.update(ChuanyunMonthLaborCostDO.SCHEMA_CODE,result.get(0).getObjectId(),purcostString);
|
|
|
}
|
|
|
if(chuanyunSaveDTO.getSuccessful()){
|
|
|
-// log.info("新增项目人力成本成功");
|
|
|
+ log.info("新增项目人力成本成功");
|
|
|
}else{
|
|
|
log.warn("新增项目人力成本失败");
|
|
|
}
|
|
@@ -570,6 +577,9 @@ public class U9InfoTask {
|
|
|
@JsonDeserialize(using = ChuanyunLocalDateTimeDeserializer.class)
|
|
|
private LocalDateTime logDate;
|
|
|
|
|
|
+ @JsonProperty("F0000015")
|
|
|
+ private String departmentCode;
|
|
|
+
|
|
|
@JsonProperty("F0000004")
|
|
|
private String dataType;
|
|
|
|
|
@@ -584,6 +594,9 @@ public class U9InfoTask {
|
|
|
if (null!=chuanyunMonthLaborCostDTO.getChuanyunLaborCostPrimaryKey().getPeriod()){
|
|
|
this.logDate=chuanyunMonthLaborCostDTO.getChuanyunLaborCostPrimaryKey().getPeriod();
|
|
|
}
|
|
|
+ if (null!=chuanyunMonthLaborCostDTO.getChuanyunLaborCostPrimaryKey().getDepartment()){
|
|
|
+ this.departmentCode=chuanyunMonthLaborCostDTO.getChuanyunLaborCostPrimaryKey().getDepartment();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|