|
@@ -1,5 +1,6 @@
|
|
package org.jeecg.modules.system.app.controller;
|
|
package org.jeecg.modules.system.app.controller;
|
|
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -44,6 +45,7 @@ import org.springframework.http.HttpHeaders;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
@@ -60,113 +62,114 @@ import java.util.stream.Collectors;
|
|
/**
|
|
/**
|
|
* @Description: 订单表
|
|
* @Description: 订单表
|
|
* @Author: jeecg-boot
|
|
* @Author: jeecg-boot
|
|
- * @Date: 2025-07-03
|
|
|
|
|
|
+ * @Date: 2025-07-03
|
|
* @Version: V1.0
|
|
* @Version: V1.0
|
|
*/
|
|
*/
|
|
-@Tag(name="订单表")
|
|
|
|
|
|
+@Tag(name = "订单表")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/app/appOrder")
|
|
@RequestMapping("/app/appOrder")
|
|
@Slf4j
|
|
@Slf4j
|
|
public class AppOrderController extends JeecgController<AppOrder, IAppOrderService> {
|
|
public class AppOrderController extends JeecgController<AppOrder, IAppOrderService> {
|
|
- @Autowired
|
|
|
|
- private IAppOrderService appOrderService;
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IAppOrderService appOrderService;
|
|
@Autowired
|
|
@Autowired
|
|
private WeChatProfitSharingService weChatProfitSharingService;
|
|
private WeChatProfitSharingService weChatProfitSharingService;
|
|
@Autowired
|
|
@Autowired
|
|
private IOrderService orderService;
|
|
private IOrderService orderService;
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 分页列表查询
|
|
|
|
- *
|
|
|
|
- * @param appOrder
|
|
|
|
- * @param pageNo
|
|
|
|
- * @param pageSize
|
|
|
|
- * @param req
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- //@AutoLog(value = "订单表-分页列表查询")
|
|
|
|
- @Operation(summary="订单表-分页列表查询")
|
|
|
|
- @GetMapping(value = "/list")
|
|
|
|
- public Result<IPage<AppOrder>> queryPageList(AppOrder appOrder,
|
|
|
|
- @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
- @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
- HttpServletRequest req) {
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 分页列表查询
|
|
|
|
+ *
|
|
|
|
+ * @param appOrder
|
|
|
|
+ * @param pageNo
|
|
|
|
+ * @param pageSize
|
|
|
|
+ * @param req
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ //@AutoLog(value = "订单表-分页列表查询")
|
|
|
|
+ @Operation(summary = "订单表-分页列表查询")
|
|
|
|
+ @GetMapping(value = "/list")
|
|
|
|
+ public Result<IPage<AppOrder>> queryPageList(AppOrder appOrder,
|
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
+ HttpServletRequest req) {
|
|
|
|
|
|
|
|
|
|
QueryWrapper<AppOrder> queryWrapper = QueryGenerator.initQueryWrapper(appOrder, req.getParameterMap());
|
|
QueryWrapper<AppOrder> queryWrapper = QueryGenerator.initQueryWrapper(appOrder, req.getParameterMap());
|
|
- Page<AppOrder> page = new Page<AppOrder>(pageNo, pageSize);
|
|
|
|
- IPage<AppOrder> pageList = appOrderService.page(page, queryWrapper);
|
|
|
|
- return Result.OK(pageList);
|
|
|
|
- }
|
|
|
|
|
|
+ Page<AppOrder> page = new Page<AppOrder>(pageNo, pageSize);
|
|
|
|
+ IPage<AppOrder> pageList = appOrderService.page(page, queryWrapper);
|
|
|
|
+ return Result.OK(pageList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 订单分页
|
|
|
|
+ *
|
|
|
|
+ * @param appOrderPageForm
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Operation(summary = "订单-分页列表查询")
|
|
|
|
+ @PostMapping(value = "/queryPage")
|
|
|
|
+ public Result<Page<OrderPageVO>> queryPage(@RequestBody AppOrderPageForm appOrderPageForm) {
|
|
|
|
+ return Result.OK(appOrderService.queryPage(appOrderPageForm));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询详情
|
|
|
|
+ *
|
|
|
|
+ * @param orderId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Operation(summary = "订单-查询详情")
|
|
|
|
+ @GetMapping(value = "/queryInfoById/{orderId}")
|
|
|
|
+ public Result<AppOrderInfoVO> queryInfoById(@PathVariable(name = "orderId") String orderId) {
|
|
|
|
+ return Result.OK(appOrderService.queryInfoById(orderId));
|
|
|
|
+ }
|
|
|
|
|
|
- /**
|
|
|
|
- * 订单分页
|
|
|
|
- * @param appOrderPageForm
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @Operation(summary="订单-分页列表查询")
|
|
|
|
- @PostMapping(value = "/queryPage")
|
|
|
|
- public Result<Page<OrderPageVO>> queryPage(@RequestBody AppOrderPageForm appOrderPageForm) {
|
|
|
|
- return Result.OK(appOrderService.queryPage(appOrderPageForm));
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 添加
|
|
|
|
+ *
|
|
|
|
+ * @param appOrder
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @AutoLog(value = "订单表-添加")
|
|
|
|
+ @Operation(summary = "订单表-添加")
|
|
|
|
+ @RequiresPermissions("org.jeecg.modules.app:nm_order:add")
|
|
|
|
+ @PostMapping(value = "/add")
|
|
|
|
+ public Result<String> add(@RequestBody AppOrder appOrder) {
|
|
|
|
+ appOrderService.save(appOrder);
|
|
|
|
|
|
- /**
|
|
|
|
- * 查询详情
|
|
|
|
- *
|
|
|
|
- * @param orderId
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @Operation(summary = "订单-查询详情")
|
|
|
|
- @GetMapping(value = "/queryInfoById/{orderId}")
|
|
|
|
- public Result<AppOrderInfoVO> queryInfoById(@PathVariable(name = "orderId") String orderId) {
|
|
|
|
- return Result.OK(appOrderService.queryInfoById(orderId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 添加
|
|
|
|
- *
|
|
|
|
- * @param appOrder
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @AutoLog(value = "订单表-添加")
|
|
|
|
- @Operation(summary="订单表-添加")
|
|
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_order:add")
|
|
|
|
- @PostMapping(value = "/add")
|
|
|
|
- public Result<String> add(@RequestBody AppOrder appOrder) {
|
|
|
|
- appOrderService.save(appOrder);
|
|
|
|
|
|
+ return Result.OK("添加成功!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 编辑
|
|
|
|
+ *
|
|
|
|
+ * @param appOrder
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @AutoLog(value = "订单表-编辑")
|
|
|
|
+ @Operation(summary = "订单表-编辑")
|
|
|
|
+ @RequiresPermissions("org.jeecg.modules.app:nm_order:edit")
|
|
|
|
+ @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
|
|
|
|
+ public Result<String> edit(@RequestBody AppOrder appOrder) {
|
|
|
|
+ appOrderService.updateById(appOrder);
|
|
|
|
+ return Result.OK("编辑成功!");
|
|
|
|
+ }
|
|
|
|
|
|
- return Result.OK("添加成功!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 编辑
|
|
|
|
- *
|
|
|
|
- * @param appOrder
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @AutoLog(value = "订单表-编辑")
|
|
|
|
- @Operation(summary="订单表-编辑")
|
|
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_order:edit")
|
|
|
|
- @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
- public Result<String> edit(@RequestBody AppOrder appOrder) {
|
|
|
|
- appOrderService.updateById(appOrder);
|
|
|
|
- return Result.OK("编辑成功!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 通过id删除
|
|
|
|
- *
|
|
|
|
- * @param id
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @AutoLog(value = "订单表-通过id删除")
|
|
|
|
- @Operation(summary="订单表-通过id删除")
|
|
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_order:delete")
|
|
|
|
- @DeleteMapping(value = "/delete")
|
|
|
|
- public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
- appOrderService.removeById(id);
|
|
|
|
- return Result.OK("删除成功!");
|
|
|
|
- }
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 通过id删除
|
|
|
|
+ *
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @AutoLog(value = "订单表-通过id删除")
|
|
|
|
+ @Operation(summary = "订单表-通过id删除")
|
|
|
|
+ @RequiresPermissions("org.jeecg.modules.app:nm_order:delete")
|
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
|
+ public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
+ appOrderService.removeById(id);
|
|
|
|
+ return Result.OK("删除成功!");
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 分账
|
|
* 分账
|
|
@@ -198,45 +201,45 @@ public class AppOrderController extends JeecgController<AppOrder, IAppOrderServi
|
|
JSONObject jsonObject = weChatProfitSharingService.getProfitSharingResult(orderCode);
|
|
JSONObject jsonObject = weChatProfitSharingService.getProfitSharingResult(orderCode);
|
|
return Result.OK(jsonObject);
|
|
return Result.OK(jsonObject);
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 批量删除
|
|
|
|
- *
|
|
|
|
- * @param ids
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @AutoLog(value = "订单表-批量删除")
|
|
|
|
- @Operation(summary="订单表-批量删除")
|
|
|
|
- @RequiresPermissions("org.jeecg.modules.app:nm_order:deleteBatch")
|
|
|
|
- @DeleteMapping(value = "/deleteBatch")
|
|
|
|
- public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
|
- this.appOrderService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
|
- return Result.OK("批量删除成功!");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 通过id查询
|
|
|
|
- *
|
|
|
|
- * @param id
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- //@AutoLog(value = "订单表-通过id查询")
|
|
|
|
- @Operation(summary="订单表-通过id查询")
|
|
|
|
- @GetMapping(value = "/queryById")
|
|
|
|
- public Result<AppOrder> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
|
- AppOrder appOrder = appOrderService.getById(id);
|
|
|
|
- if(appOrder==null) {
|
|
|
|
- return Result.error("未找到对应数据");
|
|
|
|
- }
|
|
|
|
- return Result.OK(appOrder);
|
|
|
|
- }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 导出excel
|
|
|
|
- *
|
|
|
|
- * @param request
|
|
|
|
- * @param appOrder
|
|
|
|
- */
|
|
|
|
|
|
+ * 批量删除
|
|
|
|
+ *
|
|
|
|
+ * @param ids
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @AutoLog(value = "订单表-批量删除")
|
|
|
|
+ @Operation(summary = "订单表-批量删除")
|
|
|
|
+ @RequiresPermissions("org.jeecg.modules.app:nm_order:deleteBatch")
|
|
|
|
+ @DeleteMapping(value = "/deleteBatch")
|
|
|
|
+ public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
|
+ this.appOrderService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
|
+ return Result.OK("批量删除成功!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 通过id查询
|
|
|
|
+ *
|
|
|
|
+ * @param id
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ //@AutoLog(value = "订单表-通过id查询")
|
|
|
|
+ @Operation(summary = "订单表-通过id查询")
|
|
|
|
+ @GetMapping(value = "/queryById")
|
|
|
|
+ public Result<AppOrder> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
+ AppOrder appOrder = appOrderService.getById(id);
|
|
|
|
+ if (appOrder == null) {
|
|
|
|
+ return Result.error("未找到对应数据");
|
|
|
|
+ }
|
|
|
|
+ return Result.OK(appOrder);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 导出excel
|
|
|
|
+ *
|
|
|
|
+ * @param request
|
|
|
|
+ * @param appOrder
|
|
|
|
+ */
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_order:exportXls")
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_order:exportXls")
|
|
@RequestMapping(value = "/exportXls")
|
|
@RequestMapping(value = "/exportXls")
|
|
public ModelAndView exportXls(HttpServletRequest request, AppOrder appOrder) {
|
|
public ModelAndView exportXls(HttpServletRequest request, AppOrder appOrder) {
|
|
@@ -244,12 +247,12 @@ public class AppOrderController extends JeecgController<AppOrder, IAppOrderServi
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 通过excel导入数据
|
|
|
|
- *
|
|
|
|
- * @param request
|
|
|
|
- * @param response
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
|
|
+ * 通过excel导入数据
|
|
|
|
+ *
|
|
|
|
+ * @param request
|
|
|
|
+ * @param response
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_order:importExcel")
|
|
@RequiresPermissions("org.jeecg.modules.app:nm_order:importExcel")
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
|
@@ -264,9 +267,9 @@ public class AppOrderController extends JeecgController<AppOrder, IAppOrderServi
|
|
* @date 2025/9/17
|
|
* @date 2025/9/17
|
|
* return {@link }
|
|
* return {@link }
|
|
**/
|
|
**/
|
|
- @Operation(summary="赛事条件导出-查询赛事")
|
|
|
|
|
|
+ @Operation(summary = "赛事条件导出-查询赛事")
|
|
@GetMapping(value = "/exportConditionByName")
|
|
@GetMapping(value = "/exportConditionByName")
|
|
- public Result<List<ExportConditionVO>> exportConditionByName(@RequestParam(value = "name", required = false) String name){
|
|
|
|
|
|
+ public Result<List<ExportConditionVO>> exportConditionByName(@RequestParam(value = "name", required = false) String name) {
|
|
return Result.OK(appOrderService.exportConditionByName(name));
|
|
return Result.OK(appOrderService.exportConditionByName(name));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -277,10 +280,10 @@ public class AppOrderController extends JeecgController<AppOrder, IAppOrderServi
|
|
* @date 2025/9/17
|
|
* @date 2025/9/17
|
|
* return {@link }
|
|
* return {@link }
|
|
**/
|
|
**/
|
|
- @Operation(summary="赛事条件导出-查询项目")
|
|
|
|
|
|
+ @Operation(summary = "赛事条件导出-查询项目")
|
|
@GetMapping(value = "/exportConditionByProjectName")
|
|
@GetMapping(value = "/exportConditionByProjectName")
|
|
- public Result<List<ExportConditionVO>> exportConditionByProjectName(@RequestParam(value = "projectName", required = false)String projectName,
|
|
|
|
- @RequestParam(value = "gameId", required = false)String gameId){
|
|
|
|
|
|
+ public Result<List<ExportConditionVO>> exportConditionByProjectName(@RequestParam(value = "projectName", required = false) String projectName,
|
|
|
|
+ @RequestParam(value = "gameId", required = false) String gameId) {
|
|
return Result.OK(appOrderService.exportConditionByProjectName(projectName, gameId));
|
|
return Result.OK(appOrderService.exportConditionByProjectName(projectName, gameId));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -291,7 +294,7 @@ public class AppOrderController extends JeecgController<AppOrder, IAppOrderServi
|
|
* @date 2025/9/17
|
|
* @date 2025/9/17
|
|
* return {@link }
|
|
* return {@link }
|
|
**/
|
|
**/
|
|
- @Operation(summary="赛事条件导出")
|
|
|
|
|
|
+ @Operation(summary = "赛事条件导出")
|
|
@PostMapping(value = "/exportCondition")
|
|
@PostMapping(value = "/exportCondition")
|
|
public ResponseEntity<byte[]> exportCondition(@RequestBody ExportConditionDTO exportConditionDTO) throws IOException {
|
|
public ResponseEntity<byte[]> exportCondition(@RequestBody ExportConditionDTO exportConditionDTO) throws IOException {
|
|
try {
|
|
try {
|
|
@@ -309,12 +312,12 @@ public class AppOrderController extends JeecgController<AppOrder, IAppOrderServi
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Operation(summary="退款管理-分页列表查询")
|
|
|
|
|
|
+ @Operation(summary = "退款管理-分页列表查询")
|
|
@PostMapping(value = "/refundOrderPageList")
|
|
@PostMapping(value = "/refundOrderPageList")
|
|
public Result<IPage<RefundOrderPageVO>> refundOrderPageList(@RequestBody RefundOrderPageForm refundOrderPageForm) {
|
|
public Result<IPage<RefundOrderPageVO>> refundOrderPageList(@RequestBody RefundOrderPageForm refundOrderPageForm) {
|
|
- LoginUser user = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
|
|
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
String orgCode = user.getOrgCode();
|
|
String orgCode = user.getOrgCode();
|
|
- if (!ObjectUtil.equals("A01",orgCode)){
|
|
|
|
|
|
+ if (!ObjectUtil.equals("A01", orgCode)) {
|
|
refundOrderPageForm.setOrderCode(orgCode);
|
|
refundOrderPageForm.setOrderCode(orgCode);
|
|
}
|
|
}
|
|
IPage<RefundOrderPageVO> page = appOrderService.refundOrderPageList(refundOrderPageForm);
|
|
IPage<RefundOrderPageVO> page = appOrderService.refundOrderPageList(refundOrderPageForm);
|
|
@@ -327,47 +330,12 @@ public class AppOrderController extends JeecgController<AppOrder, IAppOrderServi
|
|
private IInsurePriceService insurePriceService;
|
|
private IInsurePriceService insurePriceService;
|
|
@Resource
|
|
@Resource
|
|
private ISysUserService sysUserService;
|
|
private ISysUserService sysUserService;
|
|
|
|
+
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
@Operation(summary = "订单管理-订单改价")
|
|
@Operation(summary = "订单管理-订单改价")
|
|
@PostMapping(value = "/priceChange")
|
|
@PostMapping(value = "/priceChange")
|
|
public Result<UserPayForm> priceChange(@RequestBody PriceChangeForm priceChangeForm) {
|
|
public Result<UserPayForm> priceChange(@RequestBody PriceChangeForm priceChangeForm) {
|
|
|
|
|
|
- AppOrder appOrder = orderService.getById(priceChangeForm.getOrderId());
|
|
|
|
- if (ObjectUtil.isEmpty(appOrder)) {
|
|
|
|
- throw new JeecgBootException("订单不存在!");
|
|
|
|
- }
|
|
|
|
- String userId = appOrder.getUserId();
|
|
|
|
- SysUser sysUser = sysUserService.getById(userId);
|
|
|
|
- //根据订单构建改价后的订单信息(总金额 = 子订单金额 + 保险)
|
|
|
|
- CreateOrderForm createOrderForm = new CreateOrderForm();
|
|
|
|
- createOrderForm.setType(appOrder.getType());
|
|
|
|
- createOrderForm.setOrderType(appOrder.getOrderType());
|
|
|
|
- createOrderForm.setOrFreeOrder(appOrder.getOrderOrFree());
|
|
|
|
- createOrderForm.setAmount(appOrder.getAmount());
|
|
|
|
- createOrderForm.setFamilyIds(appOrder.getFamilyIds());
|
|
|
|
- createOrderForm.setGameCertificationForm(appOrder.getGameCertification());
|
|
|
|
- //构建商品IDs
|
|
|
|
- List<PriceChangeForm.OrderItemForm> orderItemList = priceChangeForm.getOrderItemList();
|
|
|
|
- String productIds = orderItemList.stream().map(PriceChangeForm.OrderItemForm::getProductId)
|
|
|
|
- .collect(Collectors.joining(","));
|
|
|
|
- createOrderForm.setProductIds(productIds);
|
|
|
|
- //构建保险表单
|
|
|
|
- List<InsureOrderInfo> insureOrderInfoList = insureOrderInfoService.list(Wrappers.<InsureOrderInfo>lambdaQuery().eq(InsureOrderInfo::getOrderId,
|
|
|
|
- appOrder.getId()));
|
|
|
|
-
|
|
|
|
- String familyMembersIds = insureOrderInfoList.stream().map(InsureOrderInfo::getFamilyMembersId).collect(Collectors.joining(","));
|
|
|
|
-
|
|
|
|
- InsurePrice insurePrice = insurePriceService.getOne(Wrappers.lambdaQuery(InsurePrice.class).eq(InsurePrice::getInsureId,
|
|
|
|
- insureOrderInfoList.get(0).getInsureId()).last("limit 1"));
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- InsureOrderInfoForm insureOrderInfoForm = new InsureOrderInfoForm();
|
|
|
|
- insureOrderInfoForm.setInsureId(insureOrderInfoList.get(0).getInsureId());
|
|
|
|
- insureOrderInfoForm.setAssertStartTime(insureOrderInfoList.get(0).getAssertStartTime());
|
|
|
|
- insureOrderInfoForm.setAssertEndTime(insureOrderInfoList.get(0).getAssertEndTime());
|
|
|
|
- insureOrderInfoForm.setInsurePriceId(insurePrice.getId());
|
|
|
|
- insureOrderInfoForm.setFamilyMembersIds(familyMembersIds);
|
|
|
|
-
|
|
|
|
- createOrderForm.setInsureOrderInfoForm(insureOrderInfoForm);
|
|
|
|
- return Result.OK(orderService.orderChangePrice(sysUser,priceChangeForm));
|
|
|
|
|
|
+ return Result.OK(orderService.orderChangePrice(priceChangeForm));
|
|
}
|
|
}
|
|
}
|
|
}
|