|
|
@ -29,8 +29,7 @@ public class progressTask { |
|
|
|
public void progress() throws ParseException { |
|
|
|
|
|
|
|
LocalDate date = LocalDate.now(); |
|
|
|
int dayOfYear = date.getYear(); |
|
|
|
int monthValue = date.getMonthValue(); |
|
|
|
|
|
|
|
int dayOfMonth = date.getDayOfMonth(); |
|
|
|
|
|
|
|
if (dayOfMonth == 1) { |
|
|
@ -45,15 +44,13 @@ public class progressTask { |
|
|
|
String proCode = bsSgcjsjdBuiProInfo.getProCode(); |
|
|
|
|
|
|
|
BsSgcJsjdBuiProgress bsSgcJsjdBuiProgress = new BsSgcJsjdBuiProgress(); |
|
|
|
BaseEntityUtils.preInsert(bsSgcJsjdBuiProgress); |
|
|
|
bsSgcJsjdBuiProgress.setProNo(proNo); |
|
|
|
bsSgcJsjdBuiProgress.setProCode(proCode); |
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); |
|
|
|
Date date1 = new Date(); |
|
|
|
String formatted = format.format(date1); |
|
|
|
Date parse = format.parse(formatted); |
|
|
|
int year = parse.getYear(); |
|
|
|
int month = parse.getMonth(); |
|
|
|
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance(); |
|
|
|
cal.add(Calendar.MONTH, -1); |
|
|
@ -91,11 +88,6 @@ public class progressTask { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bsSgcJsjdBuiProgress.setCreateTime(new Date()); |
|
|
|
|
|
|
|
bsSgcJsjdBuiProgress.setMonthly(parse); |
|
|
@ -108,6 +100,74 @@ public class progressTask { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
QueryWrapper<BsSgcjsjdBuiProInfo> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("project_status", "0"); |
|
|
|
|
|
|
|
List<BsSgcjsjdBuiProInfo> bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(queryWrapper); |
|
|
|
|
|
|
|
if (!bsSgcjsjdBuiProInfos.isEmpty()) { |
|
|
|
for (BsSgcjsjdBuiProInfo bsSgcjsjdBuiProInfo : bsSgcjsjdBuiProInfos) { |
|
|
|
String proNo = bsSgcjsjdBuiProInfo.getProNo(); |
|
|
|
String proCode = bsSgcjsjdBuiProInfo.getProCode(); |
|
|
|
|
|
|
|
BsSgcJsjdBuiProgress bsSgcJsjdBuiProgress = new BsSgcJsjdBuiProgress(); |
|
|
|
bsSgcJsjdBuiProgress.setProNo(proNo); |
|
|
|
bsSgcJsjdBuiProgress.setProCode(proCode); |
|
|
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); |
|
|
|
Date date1 = new Date(); |
|
|
|
String formatted = format.format(date1); |
|
|
|
Date parse = format.parse(formatted); |
|
|
|
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance(); |
|
|
|
cal.add(Calendar.MONTH, -1); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); |
|
|
|
String string = sdf.format(cal.getTime()); |
|
|
|
|
|
|
|
Date lastMonth = format.parse(string); |
|
|
|
if (lastMonth.getMonth() == 12) { |
|
|
|
QueryWrapper<BsSgcJsjdBuiProgress> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq("pro_no", proNo); |
|
|
|
wrapper.eq("pro_code", proCode); |
|
|
|
wrapper.eq("monthly", lastMonth); |
|
|
|
BsSgcJsjdBuiProgress buiProgress = bsSgcJsjdBuiProgressMapper.selectOne(wrapper); |
|
|
|
if (buiProgress != null) { |
|
|
|
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload((double) 0); |
|
|
|
bsSgcJsjdBuiProgress.setProjectOverallWorkload(buiProgress.getProjectOverallWorkload()); |
|
|
|
|
|
|
|
}else { |
|
|
|
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload((double) 0); |
|
|
|
bsSgcJsjdBuiProgress.setProjectOverallWorkload((double) 0); |
|
|
|
} |
|
|
|
}else { |
|
|
|
QueryWrapper<BsSgcJsjdBuiProgress> wrapper = new QueryWrapper<>(); |
|
|
|
wrapper.eq("pro_no", proNo); |
|
|
|
wrapper.eq("pro_code", proCode); |
|
|
|
wrapper.eq("monthly", lastMonth); |
|
|
|
BsSgcJsjdBuiProgress buiProgress = bsSgcJsjdBuiProgressMapper.selectOne(wrapper); |
|
|
|
if (buiProgress != null) { |
|
|
|
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload(buiProgress.getYearlyCumulativeWorkload()); |
|
|
|
bsSgcJsjdBuiProgress.setProjectOverallWorkload(buiProgress.getProjectOverallWorkload()); |
|
|
|
|
|
|
|
}else { |
|
|
|
bsSgcJsjdBuiProgress.setYearlyCumulativeWorkload((double) 0); |
|
|
|
bsSgcJsjdBuiProgress.setProjectOverallWorkload((double) 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
bsSgcJsjdBuiProgress.setCreateTime(new Date()); |
|
|
|
|
|
|
|
bsSgcJsjdBuiProgress.setMonthly(parse); |
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); |
|
|
|
|
|
|
|
bsSgcJsjdBuiProgress.setEndingTime(calendar.getTime()); |
|
|
|
bsSgcJsjdBuiProgress.setFillingStatus("0"); |
|
|
|
bsSgcJsjdBuiProgressMapper.insert(bsSgcJsjdBuiProgress); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|