|
|
|
@ -6,10 +6,7 @@ import cn.chjyj.szwh.bean.GoodsSource; |
|
|
|
import cn.chjyj.szwh.bean.OperationLog; |
|
|
|
import cn.chjyj.szwh.constant.ChConstant; |
|
|
|
import cn.chjyj.szwh.exception.ChException; |
|
|
|
import cn.chjyj.szwh.mapper.GoodsDetailMapper; |
|
|
|
import cn.chjyj.szwh.mapper.GoodsMapper; |
|
|
|
import cn.chjyj.szwh.mapper.GoodsSourceMapper; |
|
|
|
import cn.chjyj.szwh.mapper.OperationLogMapper; |
|
|
|
import cn.chjyj.szwh.mapper.*; |
|
|
|
import cn.chjyj.szwh.service.GoodsService; |
|
|
|
import cn.chjyj.szwh.utils.*; |
|
|
|
import cn.chjyj.szwh.vo.GoodsDetailVo; |
|
|
|
@ -46,8 +43,11 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
// 操作日志
|
|
|
|
@Autowired |
|
|
|
private OperationLogMapper operationLogMapper; |
|
|
|
// 节假日mapper
|
|
|
|
@Autowired |
|
|
|
private FestivalsMapper festivalsMapper; |
|
|
|
/** |
|
|
|
* springboot 自带事物 |
|
|
|
* springboot 自带事务 |
|
|
|
*/ |
|
|
|
@Autowired |
|
|
|
private PlatformTransactionManager platformTransactionManager; |
|
|
|
@ -531,7 +531,7 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
// insertGoodsDetail
|
|
|
|
GoodsDetail goodsDetail = ApiGoodsUtils.jsonToGoodsDetail(nsdjson, sdjson); |
|
|
|
// 返回商品详情
|
|
|
|
int gdid = goodsDetailMapper.addGoodsDetail(goodsDetail); |
|
|
|
goodsDetailMapper.addGoodsDetail(goodsDetail); |
|
|
|
|
|
|
|
//抽取target 字段中的json,转为jsonobject
|
|
|
|
JSONObject targetJson = sdjson.getJSONObject("targetData"); |
|
|
|
@ -545,6 +545,10 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
} else { |
|
|
|
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; |
|
|
|
@ -558,7 +562,6 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
String cend = nsdjson.getString("contractualPeriodEnd"); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(cend) && day!=null) { |
|
|
|
|
|
|
|
//如果是一次性授权或单次授权,存在托管结束时间
|
|
|
|
if (iperiod == 2) { |
|
|
|
try { |
|
|
|
@ -566,7 +569,11 @@ public class GoodsServiceImpl implements GoodsService { |
|
|
|
Date wtStart = sdf.parse(cstart); |
|
|
|
// 委托终止时间
|
|
|
|
Date wtEnd = DateUtils.daysAgoOrAfter(wtStart, day); |
|
|
|
cend = wtEnd.toString(); |
|
|
|
// 统计该时间段内的节假日
|
|
|
|
int fdays = festivalsMapper.countDayBetweenDays(wtStart,wtEnd,iyear); |
|
|
|
// 节假日顺眼后的日期
|
|
|
|
Date fwtEnd= DateUtils.daysAgoOrAfter(wtEnd,fdays); |
|
|
|
cend = fwtEnd.toString(); |
|
|
|
} catch (Exception ex) { |
|
|
|
ex.printStackTrace(); |
|
|
|
} |
|
|
|
|