|
@@ -1,11 +1,19 @@
|
|
package com.jpsoft.bus.modules.merchant.controller;
|
|
package com.jpsoft.bus.modules.merchant.controller;
|
|
|
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
|
+import com.jpsoft.bus.modules.bus.entity.CompanyInfo;
|
|
|
|
+import com.jpsoft.bus.modules.bus.service.CompanyInfoService;
|
|
import com.jpsoft.bus.modules.common.dto.MessageResult;
|
|
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.CapitalInfo;
|
|
import com.jpsoft.bus.modules.merchant.entity.WithdrawalRecord;
|
|
import com.jpsoft.bus.modules.merchant.entity.WithdrawalRecord;
|
|
|
|
+import com.jpsoft.bus.modules.merchant.service.AccountInfoService;
|
|
|
|
+import com.jpsoft.bus.modules.merchant.service.CapitalInfoService;
|
|
import com.jpsoft.bus.modules.merchant.service.WithdrawalRecordService;
|
|
import com.jpsoft.bus.modules.merchant.service.WithdrawalRecordService;
|
|
|
|
+import com.jpsoft.bus.modules.sys.entity.User;
|
|
|
|
+import com.jpsoft.bus.modules.sys.service.UserService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -26,6 +34,14 @@ public class WithdrawalRecordController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private WithdrawalRecordService withdrawalRecordService;
|
|
private WithdrawalRecordService withdrawalRecordService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private AccountInfoService accountInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CapitalInfoService capitalInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private CompanyInfoService companyInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserService userService;
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
@GetMapping("create")
|
|
@GetMapping("create")
|
|
@@ -197,6 +213,11 @@ public class WithdrawalRecordController {
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
public MessageResult<Map> pageList(
|
|
public MessageResult<Map> pageList(
|
|
String id,
|
|
String id,
|
|
|
|
+ @RequestParam(value="name",defaultValue="") String name,
|
|
|
|
+ @RequestParam(value="companyId",defaultValue="") String companyId,
|
|
|
|
+ @RequestParam(value="phone",defaultValue="") String phone,
|
|
|
|
+ @RequestParam(value="status",defaultValue="") String status,
|
|
|
|
+ @RequestParam(value="withdrawalNo",defaultValue="") String withdrawalNo,
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestAttribute String subject){
|
|
@RequestAttribute String subject){
|
|
@@ -215,7 +236,37 @@ public class WithdrawalRecordController {
|
|
searchParams.put("id","%" + id + "%");
|
|
searchParams.put("id","%" + id + "%");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(name)) {
|
|
|
|
+ searchParams.put("name","%" + name + "%");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(phone)) {
|
|
|
|
+ searchParams.put("phone","%" + phone + "%");
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(status)) {
|
|
|
|
+ searchParams.put("status",status);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotEmpty(withdrawalNo)) {
|
|
|
|
+ searchParams.put("withdrawalNo","%" + withdrawalNo + "%");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotEmpty(companyId)) {
|
|
|
|
+ CompanyInfo companyInfo = companyInfoService.get(companyId);
|
|
|
|
+ searchParams.put("companyCode",companyInfo.getCode() + "%");
|
|
|
|
+ }else{
|
|
|
|
+ if (!userService.hasRole(subject, "SYSADMIN")) {
|
|
|
|
+ User user = userService.get(subject);
|
|
|
|
+ CompanyInfo companyInfo = companyInfoService.get(user.getCompanyId());
|
|
|
|
+ searchParams.put("companyCode", companyInfo.getCode() + "%");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
Page<WithdrawalRecord> page = withdrawalRecordService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
Page<WithdrawalRecord> page = withdrawalRecordService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
+ for(WithdrawalRecord wr : page.getResult()){
|
|
|
|
+ AccountInfo ac = accountInfoService.get(wr.getMerchantId());
|
|
|
|
+ wr.setAccountInfo(ac);
|
|
|
|
+ CapitalInfo ci = capitalInfoService.findByMerchantId(wr.getMerchantId());
|
|
|
|
+ wr.setCapitalInfo(ci);
|
|
|
|
+ }
|
|
|
|
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|