|
|
|
@ -13,6 +13,7 @@ import jakarta.servlet.http.HttpServletRequest; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
@ -39,9 +40,13 @@ public class CashCollectionController { |
|
|
|
|
|
|
|
//根据精网号获取姓名和地区 |
|
|
|
@PostMapping("/getNameAndMarket") |
|
|
|
public User getNameAndMarket(@RequestBody Integer jwcode) { |
|
|
|
return cashCollectionService.getNameAndMarket(jwcode); |
|
|
|
public Result getNameAndMarket(@RequestBody Integer jwcode) { |
|
|
|
try { |
|
|
|
|
|
|
|
return Result.success(cashCollectionService.getNameAndMarket(jwcode)); |
|
|
|
} catch (Exception e) { |
|
|
|
return Result.error(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
//获取收款活动列表 |
|
|
|
@PostMapping("/getActivityList") |
|
|
|
@ -81,22 +86,30 @@ public class CashCollectionController { |
|
|
|
} |
|
|
|
//多条件查询收款订单列表 |
|
|
|
@PostMapping("/selectCollection") |
|
|
|
public PageInfo<CashCollection> selectCollection( |
|
|
|
@RequestBody Page page) throws Exception{ |
|
|
|
Integer pageNum = page.getPageNum(); |
|
|
|
Integer pageSize = page.getPageSize(); |
|
|
|
CashCollection cashCollection = page.getCashCollection(); |
|
|
|
//解token权限 |
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String token = request.getHeader("token"); |
|
|
|
Admin admin = (Admin) JWTUtil.getUserDetailsList(String.valueOf(token), Admin.class); |
|
|
|
if (admin != null) { |
|
|
|
public Result selcetAll(@RequestBody Page page){ |
|
|
|
try { |
|
|
|
if (ObjectUtils.isEmpty(page.getPageNum())) { |
|
|
|
return Result.error("页码数为空!"); |
|
|
|
} |
|
|
|
if (ObjectUtils.isEmpty(page.getPageSize())) { |
|
|
|
return Result.error("页大小为空!"); |
|
|
|
} else { |
|
|
|
//解token权限 |
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String token = request.getHeader("token"); |
|
|
|
Admin admin = (Admin) JWTUtil.getUserDetailsList(String.valueOf(token), Admin.class); |
|
|
|
if (admin != null) { |
|
|
|
List<String> list = Arrays.asList(admin.getMarkets().split(",")); |
|
|
|
cashCollection.setMarkets(list); |
|
|
|
page.getCashCollection().setMarkets(list);} |
|
|
|
else{ |
|
|
|
return Result.error("角色为空"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
return cashCollectionService.selectCollection(pageNum, pageSize, cashCollection); |
|
|
|
} |
|
|
|
return Result.success(cashCollectionService.selectCollection(page.getPageNum(), page.getPageSize(),page.getCashCollection())); |
|
|
|
}} catch (Exception e) { |
|
|
|
return Result.error(e.getMessage()); |
|
|
|
|
|
|
|
}} |
|
|
|
//补全手续费等 |
|
|
|
@PostMapping("/complete") |
|
|
|
public Result complete(@RequestBody CashRecord cashRecord) { |
|
|
|
|