|
|
|
@ -15,6 +15,7 @@ import org.springframework.test.annotation.Rollback; |
|
|
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.sql.Timestamp; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Date; |
|
|
|
@ -134,28 +135,31 @@ public class GoodsServiceImplTest { |
|
|
|
// 取今年的年份数字
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
int iyear = calendar.get(Calendar.YEAR); |
|
|
|
|
|
|
|
//委托开始时间
|
|
|
|
Timestamp ncst=new Timestamp(0l); |
|
|
|
//委托结束时间
|
|
|
|
Timestamp ncet=new Timestamp(0l); |
|
|
|
if (StringUtils.isBlank(cend) && iday != null) { |
|
|
|
//如果是一次性授权或单次授权,存在托管结束时间
|
|
|
|
if (iperiod == 2) { |
|
|
|
try { |
|
|
|
// 委托开始时间
|
|
|
|
// 委托开始时间 匹配时间格式,防止转码出错
|
|
|
|
Date wtStart = sdf.parse(ncstart); |
|
|
|
// 注入当日时间,判断周几
|
|
|
|
ncst = new Timestamp(wtStart.getTime()); |
|
|
|
// 判断周几
|
|
|
|
calendar.setTime(wtStart); |
|
|
|
// 得到处理后的时间
|
|
|
|
int wkday = calendar.get(Calendar.DAY_OF_WEEK); |
|
|
|
//周末顺延
|
|
|
|
// notice:在节假日调休时候,会有变动
|
|
|
|
iday += wkday > 5 ? (wkday - 5 + 1) : 0; |
|
|
|
//iday = iday+ixday;
|
|
|
|
// 委托终止时间
|
|
|
|
Date wtEnd = DateUtils.daysAgoOrAfter(wtStart, iday); |
|
|
|
// 统计该时间段内的节假日
|
|
|
|
int fdays = festivalsMapper.countDayBetweenDays(wtStart, wtEnd, iyear); |
|
|
|
// 节假日顺眼后的日期
|
|
|
|
// 节假日顺延后的日期
|
|
|
|
Date fwtEnd = DateUtils.daysAgoOrAfter(wtEnd, fdays); |
|
|
|
cend = fwtEnd.toString(); |
|
|
|
String tmpcend = sdf.format(fwtEnd); |
|
|
|
ncet=new Timestamp(sdf.parse(tmpcend).getTime()); |
|
|
|
} catch (Exception ex) { |
|
|
|
ex.printStackTrace(); |
|
|
|
} |
|
|
|
@ -175,7 +179,6 @@ public class GoodsServiceImplTest { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String ncend = cend + "23:59:59"; |
|
|
|
} |
|
|
|
// int icount = goodsService.manuImportGoods(jsonObject);
|
|
|
|
|
|
|
|
|