|
@@ -7,7 +7,9 @@ import com.jpsoft.bus.modules.common.dto.MessageResult;
|
|
import com.jpsoft.bus.modules.common.dto.Sort;
|
|
import com.jpsoft.bus.modules.common.dto.Sort;
|
|
import com.jpsoft.bus.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.bus.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.bus.modules.merchant.entity.AccountInfo;
|
|
import com.jpsoft.bus.modules.merchant.entity.AccountInfo;
|
|
|
|
+import com.jpsoft.bus.modules.merchant.entity.CapitalInfo;
|
|
import com.jpsoft.bus.modules.merchant.service.AccountInfoService;
|
|
import com.jpsoft.bus.modules.merchant.service.AccountInfoService;
|
|
|
|
+import com.jpsoft.bus.modules.merchant.service.CapitalInfoService;
|
|
import com.jpsoft.bus.modules.sys.entity.User;
|
|
import com.jpsoft.bus.modules.sys.entity.User;
|
|
import com.jpsoft.bus.modules.sys.service.UserService;
|
|
import com.jpsoft.bus.modules.sys.service.UserService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -19,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -34,6 +37,8 @@ public class AccountInfoController {
|
|
private CompanyInfoService companyInfoService;
|
|
private CompanyInfoService companyInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private UserService userService;
|
|
private UserService userService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CapitalInfoService capitalInfoService;
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
@GetMapping("create")
|
|
@GetMapping("create")
|
|
@@ -62,6 +67,21 @@ public class AccountInfoController {
|
|
int affectCount = accountInfoService.insert(accountInfo);
|
|
int affectCount = accountInfoService.insert(accountInfo);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
if (affectCount > 0) {
|
|
|
|
+ CapitalInfo ci = capitalInfoService.findByMerchantId(accountInfo.getId());
|
|
|
|
+ if(ci == null) {
|
|
|
|
+ ci = new CapitalInfo();
|
|
|
|
+ ci.setId(UUID.randomUUID().toString());
|
|
|
|
+ ci.setMerchantId(accountInfo.getId());
|
|
|
|
+ ci.setAlreadyWithdrawalAmount(new BigDecimal(0));
|
|
|
|
+ ci.setOnlineTotalRevenue(new BigDecimal(0));
|
|
|
|
+ ci.setTotalRevenue(new BigDecimal(0));
|
|
|
|
+ ci.setWithdrawalAmount(new BigDecimal(0));
|
|
|
|
+
|
|
|
|
+ ci.setDelFlag(false);
|
|
|
|
+ ci.setCreateBy(subject);
|
|
|
|
+ ci.setCreateTime(new Date());
|
|
|
|
+ capitalInfoService.insert(ci);
|
|
|
|
+ }
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
msgResult.setData(accountInfo);
|
|
msgResult.setData(accountInfo);
|
|
} else {
|
|
} else {
|
|
@@ -117,6 +137,21 @@ public class AccountInfoController {
|
|
int affectCount = accountInfoService.update(accountInfo);
|
|
int affectCount = accountInfoService.update(accountInfo);
|
|
|
|
|
|
if (affectCount > 0) {
|
|
if (affectCount > 0) {
|
|
|
|
+ CapitalInfo ci = capitalInfoService.findByMerchantId(accountInfo.getId());
|
|
|
|
+ if(ci == null) {
|
|
|
|
+ ci = new CapitalInfo();
|
|
|
|
+ ci.setId(UUID.randomUUID().toString());
|
|
|
|
+ ci.setMerchantId(accountInfo.getId());
|
|
|
|
+ ci.setAlreadyWithdrawalAmount(new BigDecimal(0));
|
|
|
|
+ ci.setOnlineTotalRevenue(new BigDecimal(0));
|
|
|
|
+ ci.setTotalRevenue(new BigDecimal(0));
|
|
|
|
+ ci.setWithdrawalAmount(new BigDecimal(0));
|
|
|
|
+
|
|
|
|
+ ci.setDelFlag(false);
|
|
|
|
+ ci.setCreateBy(subject);
|
|
|
|
+ ci.setCreateTime(new Date());
|
|
|
|
+ capitalInfoService.insert(ci);
|
|
|
|
+ }
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
msgResult.setData(accountInfo);
|
|
msgResult.setData(accountInfo);
|
|
} else {
|
|
} else {
|