|
|
@@ -509,6 +509,43 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * @desc : 功能包保存
|
|
|
+ * @author : 姜永辉
|
|
|
+ * @date : 2024-05-17 13:55
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public ResponseResultVO saveFunc(CompanyVO companyVO) {
|
|
|
+ // 转实体
|
|
|
+ Company company = companyConvert.convertToPo(companyVO);
|
|
|
+ // 生成临时license授权
|
|
|
+ Map<String, Object> licenseMap = new HashMap<>();
|
|
|
+ licenseMap.put("grade_code", company.getGradeCode());
|
|
|
+ licenseMap.put("end_date", company.getEndDate());
|
|
|
+ licenseMap.put("user_end_date", companyVO.getUserEndDate());
|
|
|
+ licenseMap.put("web_max_num", companyVO.getWebMaxNum());
|
|
|
+ licenseMap.put("wx_max_num", companyVO.getWxMaxNum());
|
|
|
+ licenseMap.put("vip", companyVO.getVip());
|
|
|
+ licenseMap.put("fun_package", companyVO.getFunPackage());
|
|
|
+ company.setLicenseSocial(AESUtil.aesEncrypt(JSON.toJSONString(licenseMap)));
|
|
|
+ companyMapper.updateById(company);
|
|
|
+ // 生成交易记录
|
|
|
+ Trade trade = new Trade();
|
|
|
+ trade.setTradeNo(companyVO.getTradeNo());
|
|
|
+ trade.setCpId(companyVO.getCpId());
|
|
|
+ trade.setWxUserId(companyVO.getWxUserId());
|
|
|
+ trade.setTradeAmount(companyVO.getTradeAmount());
|
|
|
+ trade.setTradeType(Constant.TradeType.FUNTION.getName());
|
|
|
+ trade.setBuyLong(companyVO.getBuyLong());
|
|
|
+ trade.setBuyBeginDate(companyVO.getBuyBeginDate());
|
|
|
+ trade.setBuyEndDate(companyVO.getBuyEndDate());
|
|
|
+ trade.setExtendDays(companyVO.getExtendDays());
|
|
|
+ trade.setBuyGradeCode(companyVO.getGradeCode());
|
|
|
+ trade.setTradeStatus(Constant.TradeStatus.INEFFECTIVE.getName());
|
|
|
+ tradeMapper.insert(trade);
|
|
|
+ return ResponseResultUtil.success(trade);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* @desc : 保存用户功能频率表
|
|
|
* @author : 周兴
|
|
|
* @date : 2024/3/28 9:39
|