|
|
@@ -2,6 +2,7 @@ package com.ytpm.middle.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
|
|
@@ -13,6 +14,9 @@ import com.ytpm.handle.CustomerException;
|
|
|
import com.ytpm.middle.dao.AgentMapper;
|
|
|
import com.ytpm.middle.dao.AppMapper;
|
|
|
import com.ytpm.middle.dao.EnterpriseMapper;
|
|
|
+import com.ytpm.middle.dao.FinanceMapper;
|
|
|
+import com.ytpm.middle.model.YtFinancePayment;
|
|
|
+import com.ytpm.middle.model.YtFinancePaymentRecord;
|
|
|
import com.ytpm.middle.model.YtMiddleEnterprise;
|
|
|
import com.ytpm.middle.param.AgentBaseInfoParam;
|
|
|
import com.ytpm.middle.param.AgentForm;
|
|
|
@@ -31,6 +35,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -52,6 +57,8 @@ public class AgentServiceImpl implements AgentService {
|
|
|
private RedisUtil redisUtil;
|
|
|
@Resource
|
|
|
private AppMapper appMapper;
|
|
|
+ @Resource
|
|
|
+ private FinanceMapper financeMapper;
|
|
|
|
|
|
@Value("${tencent.sms.registryTemplateId}")
|
|
|
private String registryTemplateId;
|
|
|
@@ -93,10 +100,56 @@ public class AgentServiceImpl implements AgentService {
|
|
|
generateLoginAccount(form,accountId);
|
|
|
addEnterprise(form,accountId);
|
|
|
//根据企业类型创建缴费单
|
|
|
-
|
|
|
+ generatePayment(form,accountId);
|
|
|
return Result.resultOk(RepMessage.ADD_SUCCESS);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成企业缴费单信息
|
|
|
+ * 1、默认生成流量费 1200
|
|
|
+ * 2、默认生成软著费用 400
|
|
|
+ */
|
|
|
+ private void generatePayment(AgentForm form, String accountId) {
|
|
|
+ String paymentId = IDUtil.generateFlowID("bill_");
|
|
|
+ BigDecimal totalAmount = BigDecimal.ZERO;
|
|
|
+ //缴费单生产未缴费记录
|
|
|
+ YtFinancePaymentRecord record = new YtFinancePaymentRecord();
|
|
|
+ //加急或普通软著费
|
|
|
+ record.setPaymentId(paymentId);
|
|
|
+ record.setUserId(accountId);
|
|
|
+ record.setItemId(form.getHasFast()==1?"7c9607f7727911f0b74d525400b5f38e":"6d4c2561727911f0b74d525400b5f38e");
|
|
|
+ record.setShouldAmount(new BigDecimal(form.getHasFast()==1?1000:400));
|
|
|
+ record.setRecordId(IdUtil.fastSimpleUUID());
|
|
|
+ financeMapper.addPaymentRecord(record);
|
|
|
+ totalAmount = totalAmount.add(record.getShouldAmount());
|
|
|
+ //1200流量费
|
|
|
+ record = new YtFinancePaymentRecord();
|
|
|
+ record.setPaymentId(paymentId);
|
|
|
+ record.setUserId(accountId);
|
|
|
+ record.setItemId("34b6eb3f727911f0b74d525400b5f38e");
|
|
|
+ record.setShouldAmount(new BigDecimal(1200));
|
|
|
+ record.setRecordId(IdUtil.fastSimpleUUID());
|
|
|
+ financeMapper.addPaymentRecord(record);
|
|
|
+ totalAmount = totalAmount.add(record.getShouldAmount());
|
|
|
+ //一万定金
|
|
|
+ record = new YtFinancePaymentRecord();
|
|
|
+ record.setPaymentId(paymentId);
|
|
|
+ record.setUserId(accountId);
|
|
|
+ record.setItemId("26bc4fa9727911f0b74d525400b5f38e");
|
|
|
+ record.setShouldAmount(new BigDecimal(10000));
|
|
|
+ record.setRecordId(IdUtil.fastSimpleUUID());
|
|
|
+ financeMapper.addPaymentRecord(record);
|
|
|
+ totalAmount = totalAmount.add(record.getShouldAmount());
|
|
|
+ //生成缴费单
|
|
|
+ YtFinancePayment payment = new YtFinancePayment();
|
|
|
+ payment.setPaymentId(paymentId);
|
|
|
+ payment.setPaymentNo(redisUtil.generateOrderNo("payment_"));
|
|
|
+ payment.setTotalAmount(totalAmount);
|
|
|
+ payment.setUserId(accountId);
|
|
|
+ payment.setDefaultParam(form.getCreateUserId());
|
|
|
+ financeMapper.addPayment(payment);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 修改代理商
|
|
|
*/
|