| | |
| | | package com.kidgrow.oprationcenter.controller; |
| | | |
| | | import com.kidgrow.common.annotation.LoginUser; |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.model.ProductOrder; |
| | | import com.kidgrow.oprationcenter.service.IBusinessRecordsService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderService; |
| | |
| | | productOrder.setCreateUserOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | } |
| | | //默认添加的合同视为无效合同,在充值完成后,会将对应合同启用 |
| | | productOrder.setIsDel(true); |
| | | // productOrder.setIsDel(true); |
| | | boolean v = productOrderService.saveOrUpdate(productOrder); |
| | | if (v) { |
| | | return ResultBody.ok().data(productOrder).msg("保存成功"); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 冲试用套餐 用于注册医生自动充值 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "套餐充值") |
| | | @PostMapping("/saveTemp") |
| | | public ResultBody saveProductDetail(@RequestBody Map<String,Object> params,@LoginUser SysUser sysUser) |
| | | { |
| | | if (StringUtils.isNotBlank(params.get("hospitalId").toString()) && |
| | | StringUtils.isNotBlank(params.get("departmentId").toString())&& |
| | | StringUtils.isNotBlank(params.get("hospitalName").toString())&& |
| | | StringUtils.isNotBlank(params.get("departmentName").toString())) { |
| | | params.put("proId", CommonConstant.REG_USER_PRODUCT_ID); |
| | | boolean isResult= productOrderService.saveProductDetail(params,sysUser); |
| | | if (isResult) { |
| | | return ResultBody.ok().data(isResult).msg("试用套餐充值成功"); |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed().data(isResult).msg("试用套餐充值失败"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed().data(false).msg("充值参数有误"); |
| | | } |
| | | } |
| | | /** |
| | | * 删除 |
| | | */ |
| | |
| | | } |
| | | return resultBody; |
| | | } |
| | | @ApiOperation(value = "获取用户套餐的使用状态") |
| | | @PostMapping("/getStatus") |
| | | public ResultBody getStatus(@RequestBody ProductOrder productOrder) { |
| | | return productOrderService.getStatus(productOrder); |
| | | } |
| | | |
| | | } |