|
@@ -1,12 +1,14 @@
|
|
package com.pj.ht_trade_settlement;
|
|
package com.pj.ht_trade_settlement;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import cn.hutool.core.util.RandomUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.log.StaticLog;
|
|
import cn.hutool.log.StaticLog;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.IService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.pj.api.dto.*;
|
|
import com.pj.api.dto.*;
|
|
|
|
+import com.pj.common.core.utils.DateUtils;
|
|
import com.pj.current.config.SystemObject;
|
|
import com.pj.current.config.SystemObject;
|
|
import com.pj.enummj.*;
|
|
import com.pj.enummj.*;
|
|
import com.pj.tb_goods.TbGoods;
|
|
import com.pj.tb_goods.TbGoods;
|
|
@@ -143,14 +145,18 @@ public class HtTradeSettlementService extends ServiceImpl<HtTradeSettlementMappe
|
|
Date applyTime = new Date(Long.parseLong(tradeSettlementDto.getDeclTime()));
|
|
Date applyTime = new Date(Long.parseLong(tradeSettlementDto.getDeclTime()));
|
|
htTradeSettlement.setDeclTime(DateUtil.format(applyTime, "yyyy-MM-dd HH:mm:ss")).setFinishStatus(0);
|
|
htTradeSettlement.setDeclTime(DateUtil.format(applyTime, "yyyy-MM-dd HH:mm:ss")).setFinishStatus(0);
|
|
BigDecimal totalPrice = BigDecimal.ZERO;
|
|
BigDecimal totalPrice = BigDecimal.ZERO;
|
|
|
|
+ Date now = new Date();
|
|
|
|
+ String dateStr = DateUtils.parseDateToStr("yyMMddHHmm", now);
|
|
for (BordersListDto item : bordersListDtoList) {//开始创建边民订单
|
|
for (BordersListDto item : bordersListDtoList) {//开始创建边民订单
|
|
totalPrice = totalPrice.add(BigDecimal.valueOf(item.getBuyAmount()));
|
|
totalPrice = totalPrice.add(BigDecimal.valueOf(item.getBuyAmount()));
|
|
TbOrder tbOrder = new TbOrder();
|
|
TbOrder tbOrder = new TbOrder();
|
|
//航通字段
|
|
//航通字段
|
|
BeanUtils.copyProperties(item, tbOrder);
|
|
BeanUtils.copyProperties(item, tbOrder);
|
|
|
|
+ String tradeNo = "YJSCDD".concat(dateStr)
|
|
|
|
+ .concat(RandomUtil.randomNumbers(5) + "0");
|
|
tbOrder.setSaleMainId(htTradeSettlement.getId());
|
|
tbOrder.setSaleMainId(htTradeSettlement.getId());
|
|
- tbOrder.setCreateTime(new Date()).setPreNo(item.getPreNo())
|
|
|
|
- .setTradeNo(SystemObject.getREFcode("YJSCDD", new Date()))
|
|
|
|
|
|
+ tbOrder.setCreateTime(now).setPreNo(item.getPreNo())
|
|
|
|
+ .setTradeNo(tradeNo)
|
|
.setTradeAreaId(tbTradeArea.getId()).setTradeAreaName(tbTradeArea.getName());
|
|
.setTradeAreaId(tbTradeArea.getId()).setTradeAreaName(tbTradeArea.getName());
|
|
tbOrder.setTotalWeight(item.getGrossWt()).setTotalPrice(item.getBuyAmount());
|
|
tbOrder.setTotalWeight(item.getGrossWt()).setTotalPrice(item.getBuyAmount());
|
|
|
|
|