|
|
|
@ -539,19 +539,20 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
int istatus = 0; |
|
|
|
if (sdjson.getInteger("status") == 1 || sdjson.getInteger("status") == 4 || |
|
|
|
sdjson.getInteger("status") == 5) { |
|
|
|
istatus = 1; |
|
|
|
istatus = 1;//上架
|
|
|
|
} else if (sdjson.getInteger("status") == 2) { |
|
|
|
istatus = 2; |
|
|
|
istatus = 2; //下架
|
|
|
|
} else { |
|
|
|
istatus = 4; |
|
|
|
istatus = 4;//失效
|
|
|
|
} |
|
|
|
// 取今年的年份数字
|
|
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
|
int iyear = calendar.get(Calendar.YEAR); |
|
|
|
// 组装到goods对象
|
|
|
|
Goods goods = new Goods(); |
|
|
|
//提取和处理,委托周期
|
|
|
|
String contractualPeriod = nsdjson.getString("contractualPeriod"); |
|
|
|
int iperiod = 0; |
|
|
|
int iperiod = ApiGoodsUtils.convertProid(contractualPeriod); |
|
|
|
//商品起止时间
|
|
|
|
String cstart = nsdjson.getString("contractualPeriodStart"); |
|
|
|
String curTime = new SimpleDateFormat("HH:mm:ss").format(new Date()); |
|
|
|
@ -575,7 +576,21 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
Date fwtEnd= DateUtils.daysAgoOrAfter(wtEnd,fdays); |
|
|
|
cend = fwtEnd.toString(); |
|
|
|
} catch (Exception ex) { |
|
|
|
ex.printStackTrace(); |
|
|
|
log.error("一次性委托日期转码出错:"+ex.getStackTrace()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 周期委托
|
|
|
|
if(iperiod==3){ |
|
|
|
//当前时间
|
|
|
|
SimpleDateFormat nowDateSdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String nowStr = nowDateSdf.format(new Date()); |
|
|
|
// 判断是否为当前时间 上架状态
|
|
|
|
if(nowStr.equals(cstart)){ |
|
|
|
istatus=1; |
|
|
|
} |
|
|
|
// 到期自动下架
|
|
|
|
if(nowStr.equals(cend)){ |
|
|
|
istatus=2; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|