|
@@ -177,7 +177,7 @@ public class ChuanyunProjectScheduledTask {
|
|
|
/**
|
|
|
* 项目核算登记
|
|
|
*/
|
|
|
- @Scheduled(fixedDelay = 3600000L)
|
|
|
+// @Scheduled(fixedDelay = 3600000L)
|
|
|
private void saveAdjustAccount() {
|
|
|
var objectMapper=new ObjectMapper();
|
|
|
var flag = true;
|
|
@@ -334,13 +334,20 @@ public class ChuanyunProjectScheduledTask {
|
|
|
//每人每天工时
|
|
|
ChuanyunWorkHourDO chuanyunWorkHourDO = chuanyunWorkHourDao.getDayWorkHour(chuanyunUserCompanyDO.getUserId(),self.getDayLogDate());
|
|
|
//工时标准化
|
|
|
- if (chuanyunWorkHourDO.getHoursWorked().intValue()<8) {
|
|
|
- chuanyunSelfWorkHourDO.setStandardWorkHour(self.getHoursWorked());
|
|
|
- }else {
|
|
|
- BigDecimal personDays = (self.getHoursWorked().divide(chuanyunWorkHourDO.getHoursWorked(), 2, BigDecimal.ROUND_HALF_UP)).multiply(standard);
|
|
|
- chuanyunSelfWorkHourDO.setStandardWorkHour(personDays);
|
|
|
- }
|
|
|
- chuanyunSelfWorkHourDao.save(chuanyunSelfWorkHourDO);
|
|
|
+ if (chuanyunWorkHourDO != null) {
|
|
|
+ if (chuanyunWorkHourDO.getHoursWorked().intValue()<8) {
|
|
|
+ chuanyunSelfWorkHourDO.setStandardWorkHour(self.getHoursWorked());
|
|
|
+ }else {
|
|
|
+ BigDecimal personDays = (self.getHoursWorked().divide(chuanyunWorkHourDO.getHoursWorked(), 2, BigDecimal.ROUND_HALF_UP)).multiply(standard);
|
|
|
+ chuanyunSelfWorkHourDO.setStandardWorkHour(personDays);
|
|
|
+ }
|
|
|
+ ChuanyunSelfWorkHourDO chuanyunSelfWorkHourDO1 = chuanyunSelfWorkHourDao.findByUserIdAndAndProjectIdAndAndDayLogDate(chuanyunUserCompanyDO.getUserId(),self.getProjectId(),self.getDayLogDate());
|
|
|
+ if (chuanyunSelfWorkHourDO1!=null) {
|
|
|
+ chuanyunSelfWorkHourDao.delete(chuanyunSelfWorkHourDO1);
|
|
|
+ }
|
|
|
+ chuanyunSelfWorkHourDao.save(chuanyunSelfWorkHourDO);
|
|
|
+ log.info("工时标准化新增成功");
|
|
|
+ }
|
|
|
});
|
|
|
});
|
|
|
}
|