|
|
@@ -15,11 +15,9 @@ import com.fs.company.domain.Company;
|
|
|
import com.fs.company.domain.CompanyDeduct;
|
|
|
import com.fs.company.domain.CompanyRecharge;
|
|
|
import com.fs.company.param.CompanyDeductParam;
|
|
|
+import com.fs.company.param.CompanyDivConfigUpdateParam;
|
|
|
import com.fs.company.param.CompanyRechargeParam;
|
|
|
-import com.fs.company.service.ICompanyDeductService;
|
|
|
-import com.fs.company.service.ICompanyRechargeService;
|
|
|
-import com.fs.company.service.ICompanyService;
|
|
|
-import com.fs.company.service.ICompanyUserService;
|
|
|
+import com.fs.company.service.*;
|
|
|
import com.fs.company.vo.CompanyVO;
|
|
|
import com.fs.core.utils.OrderCodeUtils;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
@@ -70,6 +68,8 @@ public class FsCompanyController extends BaseController
|
|
|
private ICompanyDeductService deductService;
|
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
|
+ @Autowired
|
|
|
+ private ICompanyDivConfigService companyDivConfigService;
|
|
|
/**
|
|
|
* 查询诊所管理列表
|
|
|
*/
|
|
|
@@ -217,6 +217,65 @@ public class FsCompanyController extends BaseController
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description: 红包充值功能 因公司余额的变动关联的地方太多,现在把充值红包的金额单独提出来 不合计到公司余额中
|
|
|
+ * @Param:
|
|
|
+ * @Return:
|
|
|
+ * @Author xgb
|
|
|
+ * @Date 2025/11/3 11:08
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('his:company:redRecharge')")
|
|
|
+ @Log(title = "红包充值", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping(value = "/redRecharge")
|
|
|
+ @Transactional
|
|
|
+ @RepeatSubmit
|
|
|
+ public R redRecharge(@RequestBody CompanyRechargeParam param)
|
|
|
+ {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ CompanyRecharge redRecharge=new CompanyRecharge();
|
|
|
+ String orderSn = OrderCodeUtils.getOrderSn();
|
|
|
+ if(StringUtils.isEmpty(orderSn)){
|
|
|
+ return R.error("订单生成失败,请重试");
|
|
|
+ }
|
|
|
+ redRecharge.setRechargeNo(orderSn);
|
|
|
+ redRecharge.setCompanyId(param.getCompanyId());
|
|
|
+ redRecharge.setMoney(param.getMoney());
|
|
|
+ redRecharge.setCreateUserId(loginUser.getUser().getUserId());
|
|
|
+ redRecharge.setIsAudit(0);
|
|
|
+ redRecharge.setStatus(0);
|
|
|
+ redRecharge.setRemark(param.getRemark());
|
|
|
+ redRecharge.setPayType(3);
|
|
|
+ redRecharge.setBusinessType(1);// 红包充值
|
|
|
+ rechargeService.insertCompanyRecharge(redRecharge);
|
|
|
+ return R.ok("提交成功,等待审核");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @PreAuthorize("@ss.hasPermi('his:company:redDeduct')")
|
|
|
+ @Log(title = "企业扣款", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping(value = "/redDeduct")
|
|
|
+ @Transactional
|
|
|
+ @RepeatSubmit
|
|
|
+ public R redDeduct(@RequestBody CompanyDeductParam param)
|
|
|
+ {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ CompanyDeduct deduct=new CompanyDeduct();
|
|
|
+ String orderSn = OrderCodeUtils.getOrderSn();
|
|
|
+ if(StringUtils.isEmpty(orderSn)){
|
|
|
+ return R.error("订单生成失败,请重试");
|
|
|
+ }
|
|
|
+ deduct.setDeductNo(orderSn);
|
|
|
+ deduct.setCompanyId(param.getCompanyId());
|
|
|
+ deduct.setMoney(param.getMoney());
|
|
|
+ deduct.setCreateUserId(loginUser.getUser().getUserId());
|
|
|
+ deduct.setIsAudit(0);
|
|
|
+ deduct.setRemark(param.getRemark());
|
|
|
+ deduct.setBusinessType(1); // 红包扣款
|
|
|
+ deductService.insertCompanyDeduct(deduct);
|
|
|
+ return R.ok("提交成功,等待审核");
|
|
|
+ }
|
|
|
+
|
|
|
@PreAuthorize("@ss.hasPermi('his:company:deduct')")
|
|
|
@Log(title = "企业扣款", businessType = BusinessType.INSERT)
|
|
|
@PostMapping(value = "/deduct")
|
|
|
@@ -241,4 +300,25 @@ public class FsCompanyController extends BaseController
|
|
|
deductService.insertCompanyDeduct(deduct);
|
|
|
return R.ok("提交成功,等待审核");
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取公司分账配置详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('his:companyDivConfig:query')")
|
|
|
+ @GetMapping(value = "/getDivConfig/{companyId}")
|
|
|
+ public AjaxResult getDivConfig(@PathVariable("companyId") Long companyId)
|
|
|
+ {
|
|
|
+ return AjaxResult.success(companyDivConfigService.selectCompanyDivConfigByCompanyId(companyId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 公司分账配置
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('his:companyDivConfig:set')")
|
|
|
+ @Log(title = "公司分账配置", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/setDiv")
|
|
|
+ public R setDiv(@RequestBody CompanyDivConfigUpdateParam param)
|
|
|
+ {
|
|
|
+ return companyDivConfigService.setDiv(param);
|
|
|
+ }
|
|
|
}
|