|
@@ -10,6 +10,7 @@ import com.pj.api.client.async_server.AsyncServerInterface;
|
|
|
import com.pj.api.client.level_one_server.LevelOneServerInterface;
|
|
|
import com.pj.api.dto.GoodsDto;
|
|
|
import com.pj.api.dto.MessageDto;
|
|
|
+import com.pj.api.dto.OrderDto;
|
|
|
import com.pj.api.dto.OrdersDto;
|
|
|
import com.pj.common.core.text.Convert;
|
|
|
import com.pj.common.core.utils.StringUtils;
|
|
@@ -284,16 +285,21 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
|
|
|
/**
|
|
|
* 增 一级市场已完成订单进行转售时,新增二级市场订单
|
|
|
*/
|
|
|
- boolean addOrderByResale(TbOrdersDto ordersDto) {
|
|
|
+ boolean addOrderByResale(SoMap so) {
|
|
|
+ OrderDto orderDto = levelOneServerInterface.getOrderDtoById(so.getLong("id"));
|
|
|
+ if (null == orderDto) throw new RuntimeException("当前一级市场订单为空,请联系管理员!");
|
|
|
+
|
|
|
//获取app登录用户
|
|
|
APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
- if (appLoginInfo == null || appLoginInfo.getLoginId() == null)
|
|
|
- throw new RuntimeException("当前登陆用户信息已失效!");
|
|
|
-
|
|
|
- if (null == ordersDto.getLevelOneOrderId()) throw new RuntimeException("当前一级市场订单号为空,请联系管理员!");
|
|
|
|
|
|
TbOrders orders = new TbOrders();
|
|
|
- BeanUtils.copyProperties(ordersDto, orders);
|
|
|
+ orders.setResalePrice(so.getDouble("resalePrice"));
|
|
|
+ orders.setLevelOneOrderId(so.getLong("id"));
|
|
|
+ orders.setGoodsId(orderDto.getGoodsId());
|
|
|
+ orders.setGoodsName(orderDto.getGoodsNames());
|
|
|
+ orders.setTradeAreaName(orderDto.getTradeAreaName());
|
|
|
+ orders.setTradeAreaId(orderDto.getTradeAreaId());
|
|
|
+ orders.setVeNo(orderDto.getVeNo());
|
|
|
//订单编号:EJSCDD=二级市场订单
|
|
|
orders.setOrderNo(SystemObject.getREFcode("EJSCDD", new Date()));
|
|
|
//订单完成状态 (0=未完成,1=已完成)
|
|
@@ -311,7 +317,7 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
|
|
|
this.add(orders);
|
|
|
|
|
|
//修改一级市场边民订单转售状态为已转售
|
|
|
- boolean b = levelOneServerInterface.updateResaleStatus(ordersDto.getLevelOneOrderId());
|
|
|
+ boolean b = levelOneServerInterface.updateResaleStatus(so.getLong("id"));
|
|
|
if (!b) throw new RuntimeException("修改一级市场边民订单转售状态为已转售失败!");
|
|
|
|
|
|
return true;
|