Explorar el Código

一级市场订单转售修改

linbl hace 1 año
padre
commit
1d2ee4060f

+ 3 - 2
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersApiController.java

@@ -105,8 +105,9 @@ public class TbOrdersApiController {
 
 	/** 增 一级市场已完成订单进行转售时,新增二级市场订单 */
 	@RequestMapping("addOrderByResale")
-	public AjaxJson  addOrderByResale(TbOrdersDto ordersDto) {
-		return AjaxJson.toAjax(tbOrdersService.addOrderByResale(ordersDto));
+	public AjaxJson  addOrderByResale() {
+		SoMap so = SoMap.getRequestSoMap();
+		return AjaxJson.toAjax(tbOrdersService.addOrderByResale(so));
 	}
 
 	/** 查 根据订单Id查订单详情 */

+ 13 - 7
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersService.java

@@ -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;