diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/AdapayMemberController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/AdapayMemberController.java index 837793ca7..4ead8d820 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/AdapayMemberController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/AdapayMemberController.java @@ -2,17 +2,16 @@ package com.jsowell.web.controller.pile; import com.alibaba.fastjson2.JSON; import com.huifu.adapay.core.exception.BaseAdaPayException; -import com.jsowell.adapay.dto.AdapayMemberInfoDTO; -import com.jsowell.adapay.dto.SettleAccountDTO; -import com.jsowell.adapay.dto.UpdateAccountConfigDTO; -import com.jsowell.adapay.dto.WithdrawDTO; +import com.jsowell.adapay.dto.*; import com.jsowell.adapay.service.AdapayService; import com.jsowell.adapay.vo.AdapayAccountBalanceVO; import com.jsowell.common.core.controller.BaseController; import com.jsowell.common.core.domain.AjaxResult; +import com.jsowell.common.core.page.PageResponse; import com.jsowell.common.enums.ykc.ReturnCodeEnum; import com.jsowell.common.exception.BusinessException; import com.jsowell.common.util.StringUtils; +import com.jsowell.pile.service.ClearingWithdrawInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -28,6 +27,9 @@ public class AdapayMemberController extends BaseController { @Autowired private AdapayService adapayService; + @Autowired + private ClearingWithdrawInfoService clearingWithdrawInfoService; + /** * 创建结算账户 * http://localhost:8080/adapay/member/createSettleAccount @@ -54,6 +56,7 @@ public class AdapayMemberController extends BaseController { logger.info("创建结算账户接口 result:{}", JSON.toJSONString(result)); return result; } + /** * 查询汇付会员接口 * http://localhost:8080/adapay/member/selectAdapayMember @@ -120,6 +123,26 @@ public class AdapayMemberController extends BaseController { return result; } + /** + * 查询提现记录 分页 + * http://localhost:8080/adapay/member/queryWithdrawList + */ + @PostMapping("/queryWithdrawList") + public AjaxResult queryWithdrawList(@RequestBody QueryWithdrawListDTO dto) { + AjaxResult result; + try { + PageResponse map = clearingWithdrawInfoService.queryWithdrawList(dto); + result = AjaxResult.success(map); + } catch (BusinessException e) { + logger.error("查询提现记录error", e); + result = AjaxResult.error(e.getMessage()); + } catch (Exception e) { + logger.error("查询提现记录error", e); + result = AjaxResult.error(); + } + return result; + } + /** * 修改结算 * http://localhost:8080/adapay/member/updateSettleAccountConfig diff --git a/jsowell-admin/src/test/java/SpringBootTestController.java b/jsowell-admin/src/test/java/SpringBootTestController.java index 96a9009e9..35e6b6af4 100644 --- a/jsowell-admin/src/test/java/SpringBootTestController.java +++ b/jsowell-admin/src/test/java/SpringBootTestController.java @@ -484,9 +484,9 @@ public class SpringBootTestController { System.out.println("每笔单需要退还的金额: " + refunds); } -/** - * 测试多笔支付情况,解冻部分金额 - */ + /** + * 测试多笔支付情况,解冻部分金额 + */ @Test public void calculateUnfreezeAmountTest() { BigDecimal orderAmount = new BigDecimal("0.06"); @@ -547,14 +547,14 @@ public class SpringBootTestController { @Test public void createSettleAccountRequestTest() throws BaseAdaPayException { SettleAccountDTO dto = new SettleAccountDTO(); - dto.setCardId("31050180460000002469"); - dto.setCardName("上海擎昆物业管理有限公司"); - dto.setTelNo("18021373333"); - dto.setBankCode("01050000"); + dto.setCardId("398899991013000296800"); + dto.setCardName("瑞桩(宿迁)新能源科技有限公司"); + dto.setTelNo("16652725453"); + dto.setBankCode("03010000"); dto.setBankAcctType("1"); - dto.setProvCode("0031"); - dto.setAreaCode("3100"); - String adapayMemberId = "ACM80899105"; + dto.setProvCode("0032"); + dto.setAreaCode("3207"); + String adapayMemberId = "ACM84693947"; adapayService.createSettleAccountRequest(dto, adapayMemberId, wechatAppId1); } @@ -881,101 +881,263 @@ public class SpringBootTestController { public List getPaymentIdList() { List list = Lists.newArrayList(); - list.add("002212024010101075410587580878168895488"); - list.add("002212024010102523610587607229613518848"); - list.add("002212024010105571210587653684106059776"); - list.add("002212024010108061010587686138729041920"); - list.add("002212024010108094310587687032976687104"); - list.add("002212024010109235610587705709803712512"); - list.add("002212024010109411710587710078440730624"); - list.add("002212024010110093210587717185796173824"); - list.add("002212024010110114810587717755373236224"); - list.add("002212024010110430310587725622161223680"); - list.add("002212024010110442210587725952496656384"); - list.add("002212024010111041310587730948674940928"); - list.add("002212024010111061610587731463304601600"); - list.add("002212024010111090910587732188870881280"); - list.add("002212024010111124010587733075944652800"); - list.add("002212024010112083110587747130628071424"); - list.add("002212024010113044210587761268845203456"); - list.add("002212024010117035410587821466505822208"); - list.add("002212024010118021810587836160999813120"); - list.add("002212024010121114110587883820366671872"); - list.add("002212024010121172810587885277725347840"); - list.add("002212024010121360910587889977852805120"); - list.add("002212024010121403710587891103411613696"); - list.add("002212024010121463210587892592913821696"); - list.add("002212024010121521210587894017458290688"); - list.add("002212024010122074910587897947023601664"); - list.add("002212024010200230110587931973321207808"); - list.add("002212024010202092710587958756136411136"); - list.add("002212024010202372110587965779008131072"); - list.add("002212024010206225610588022547623931904"); - list.add("002212024010208084010588049157132750848"); - list.add("002212024010208105410588049720929546240"); - list.add("002212024010208414310588057474119176192"); - list.add("002212024010208420910588057583474987008"); - list.add("002212024010208423910588057710375165952"); - list.add("002212024010209530510588075436586000384"); - list.add("002212024010209584510588076860822663168"); - list.add("002212024010209591210588076973560410112"); - list.add("002212024010210034310588078109612511232"); - list.add("002212024010210415310588087714478313472"); - list.add("002212024010211234310588098244052742144"); - list.add("002212024010211284710588099519227203584"); - list.add("002212024010211290010588099570871668736"); - list.add("002212024010212151710588111221625434112"); - list.add("002212024010212494010588119872168116224"); - list.add("002212024010213345310588131253226409984"); - list.add("002212024010213434710588133490166534144"); - list.add("002212024010214565810588151910782144512"); - list.add("002212024010215393310588162624955854848"); - list.add("002212024010216321410588175885140078592"); - list.add("002212024010217025510588183605473587200"); - list.add("002212024010218092510588200339110998016"); - list.add("002212024010218384410588207720573153280"); - list.add("002212024010218552910588211935283392512"); - list.add("002212024010218582310588212663065886720"); - list.add("002212024010221252910588249683337523200"); - list.add("002212024010221355710588252317973581824"); - list.add("002212024010221422210588253932824178688"); - list.add("002212024010221475110588255312943796224"); - list.add("002212024010222000210588258377594286080"); - list.add("002212024010222130610588261665215287296"); - list.add("002212024010222250110588264663147048960"); - list.add("002212024010301210910588308989585768448"); - list.add("002212024010302261710588325382111916032"); - list.add("002212024010307312410588402167369936896"); - list.add("002212024010308475210588421411857518592"); - list.add("002212024010309004510588424651157757952"); - list.add("002212024010309335510588432999090466816"); - list.add("002212024010309393410588434420238102528"); - list.add("002212024010310245610588445838966501376"); - list.add("002212024010310400910588449668134703104"); - list.add("002212024010310591910588454488895754240"); - list.add("002212024010311020010588455166592036864"); - list.add("002212024010311065510588456402759675904"); - list.add("002212024010311075310588456648135630848"); - list.add("002212024010311275010588461667046240256"); - list.add("002212024010311281610588461774182510592"); - list.add("002212024010311470510588466510222454784"); - list.add("002212024010312142910588473406713212928"); - list.add("002212024010312381410588479383941296128"); - list.add("002212024010313571710588499279179898880"); - list.add("002212024010314513810588512955768811520"); - list.add("002212024010315275810588522098386841600"); - list.add("002212024010316200410588535208883630080"); - list.add("002212024010316285010588537416669925376"); - list.add("002212024010317090010588547523266760704"); - list.add("002212024010320573210588605035650072576"); - list.add("002212024010321125910588608925487640576"); - list.add("002212024010321554510588619687768641536"); - list.add("002212024010321560510588619769521926144"); - list.add("002212024010321585710588620493146312704"); - list.add("002212024010322100510588623294530711552"); - list.add("002212024010322201910588625870417518592"); - list.add("002212024010322230310588626557293146112"); - list.add("002212024010322495110588633301220700160"); + list.add("002212023083122144710543325992302137344"); + list.add("002212023083122184310543326985915338752"); + list.add("002212023090112434810543544691319656448"); + list.add("002212023090119514510543652385933602816"); + list.add("002212023090121124510543672771933622272"); + list.add("002212023090121302510543677218274512896"); + list.add("002212023090123232810543705665991143424"); + list.add("002212023090123355710543708808341741568"); + list.add("002212023090208394810543845673047273472"); + list.add("002212023090213342710543919822878302208"); + list.add("002212023090214333210543934693708627968"); + list.add("002212023090214394610543936260781764608"); + list.add("002212023090218405110543996930723139584"); + list.add("002212023090219270410544008564594167808"); + list.add("002212023090220295010544024358464737280"); + list.add("002212023090223300210544069706587594752"); + list.add("002212023090300355410544086282983026688"); + list.add("002212023090301020510544092871901474816"); + list.add("002212023090306565410544182164883103744"); + list.add("002212023090313262810544280200422481920"); + list.add("002212023090313531110544286925746663424"); + list.add("002212023090315162910544307889622843392"); + list.add("002212023090318081010544351094558584832"); + list.add("002212023090321170210544398623752015872"); + list.add("002212023090321251810544400704541392896"); + list.add("002212023090322410810544419790387834880"); + list.add("002212023090410302810544598299004755968"); + list.add("002212023090419105310544729264036499456"); + list.add("002212023090419283210544733708827889664"); + list.add("002212023090421010310544756988227379200"); + list.add("002212023090422322710544779992993230848"); + list.add("002212023090500314110544809998093770752"); + list.add("002212023090509562610544952122147966976"); + list.add("002212023090518210410545079118518349824"); + list.add("002212023090518255210545080324992032768"); + list.add("002212023090519173010545093320424927232"); + list.add("002212023090520263510545110703815909376"); + list.add("002212023090521354610545128113298894848"); + list.add("002212023090601062510545181125809139712"); + list.add("002212023090619342310545459956702466048"); + list.add("002212023090623322310545519849739636736"); + list.add("002212023090708331910545655982339489792"); + list.add("002212023090715360310545762366528544768"); + list.add("002212023090719411510545824070909317120"); + list.add("002212023090719574610545828226453831680"); + list.add("002212023090722442310545870156928339968"); + list.add("002212023090811334810546063786779631616"); + list.add("002212023090813584110546100247382880256"); + list.add("002212023090816465710546142595950948352"); + list.add("002212023090818042210546162076081303552"); + list.add("002212023090818060810546162521008877568"); + list.add("002212023090819051510546177398738505728"); + list.add("002212023090821415310546216817356042240"); + list.add("002212023090822103010546224020578234368"); + list.add("002212023090823592110546251410211364864"); + list.add("002212023090914060010546464477812981760"); + list.add("002212023090914350910546471815530369024"); + list.add("002212023090919182210546543087612719104"); + list.add("002212023090920035110546554532997750784"); + list.add("002212023090920430610546564411142406144"); + list.add("002212023090921593810546583674089222144"); + list.add("002212023091000173510546618390597496832"); + list.add("002212023091000292410546621361481158656"); + list.add("002212023091008252610546741160548888576"); + list.add("002212023091011435710546791119940734976"); + list.add("002212023091013224810546815994008285184"); + list.add("002212023091018053010546887138713763840"); + list.add("002212023091018512110546898678474715136"); + list.add("002212023091019081410546902924227534848"); + list.add("002212023091020553210546929927187132416"); + list.add("002212023091023052110546962599850438656"); + list.add("002212023091100040710546977388099932160"); + list.add(""); + list.add("002212023091111520010547155530152923136"); + list.add("002212023091113132710547176028927815680"); + list.add("002212023091120512110547291265674534912"); + list.add("002212023091122321210547316644195885056"); + list.add("002212023091209261510547481241595011072"); + list.add("002212023091213520210547548126692794368"); + list.add("002212023091217492910547607884790108160"); + list.add("002212023091217565710547609763706630144"); + list.add("002212023091218202810547615682417152000"); + list.add("002212023091218311610547618396642848768"); + list.add("002212023091222073010547672817516367872"); + list.add("002212023091317254910547964315248054272"); + list.add("002212023091317512410547970755183476736"); + list.add(""); + list.add(""); + list.add("002212023091319310610547995842010251264"); + list.add("002212023091322085210548035549470253056"); + list.add("002212023091322203510548038496812347393"); + list.add("002212023091322582110548047999484809216"); + list.add("002212023091408342910548192987720835072"); + list.add("002212023091410084110548216695450054656"); + list.add(""); + list.add("002212023091412392610548254634511298560"); + list.add("002212023091418014210548335733482033152"); + list.add("002212023091419272310548357297851514880"); + list.add("002212023091419311910548358288533114880"); + list.add("002212023091421540310548394206287802368"); + list.add("002212023091500321810548434033424281600"); + list.add("002212023091503431310548482076360822784"); + list.add(""); + list.add("002212023091515212410548657781333807104"); + list.add("002212023091519464510548724558899834880"); + list.add("002212023091520282610548735050025897984"); + list.add("002212023091522021010548758637003177984"); + list.add("002212023091523101610548775776024129536"); + list.add("002212023091523383010548782881905602560"); + list.add("002212023091523414910548783713843433472"); + list.add("002212023091612052410548970842227191808"); + list.add("002212023091615530210549028129170698240"); + list.add("002212023091616003610549030034239524864"); + list.add("002212023091617571010549059369594810368"); + list.add("002212023091619544510549088958869385216"); + list.add("002212023091621065110549107103101169664"); + list.add("002212023091622363110549129668955975680"); + list.add("002212023091700214110549156135467347968"); + list.add("002212023091701013710549166184109256704"); + list.add("002212023091710431710549312567500058624"); + list.add("002212023091711541410549330423276974080"); + list.add("002212023091716444610549403536746483712"); + list.add("002212023091719131610549440909122236416"); + list.add("002212023091719272310549444458482675712"); + list.add("002212023091801554910549542211845230592"); + list.add("002212023091808253010549640280669601792"); + list.add("002212023091808551810549647779947745280"); + list.add("002212023091812232010549700132812128256"); + list.add("002212023091817363410549778960795688960"); + list.add("002212023091818553110549798827605569536"); + list.add("002212023091819224810549805693209010176"); + list.add("002212023091819513110549812922134376448"); + list.add("002212023091819573910549814463578578944"); + list.add("002212023091820551010549828938590310400"); + list.add("002212023091821422110549840813230338048"); + list.add("002212023091900154510549879418637012992"); + list.add("002212023091901521310549903694903627776"); + list.add("002212023091916535410550130611411464192"); + list.add("002212023091917451610550143535847485440"); + list.add("002212023091919224310550168060550025216"); + list.add("002212023091920524610550190721550114816"); + list.add(""); + list.add("002212023091921214010550197994735742976"); + list.add(""); + list.add("002212023092004521510550311390219849728"); + list.add("002212023092008282710550365799283191808"); + list.add("002212023092014042810550450359211683840"); + list.add("002212023092014461910550460891247591424"); + list.add("002212023092018031910550510468632752128"); + list.add(""); + list.add("002212023092019143710550528409372635136"); + list.add("002212023092019261610550531342513283072"); + list.add("002212023092021275410550561952458964992"); + list.add("002212023092100430310550611064920715264"); + list.add("002212023092108545510550734844807106560"); + list.add("002212023092118141710550875617280229376"); + list.add("002212023092118463810550883758572118016"); + list.add("002212023092119254310550893594188697600"); + list.add("002212023092120053110550903606648369152"); + list.add("002212023092120272910550909136260218880"); + list.add("002212023092122074110550934351173419008"); + list.add("002212023092122404610550942678009352192"); + list.add("002212023092123320010550955571402366976"); + list.add("002212023092123352710550956439504105472"); + list.add("002212023092200121010550965680069484544"); + list.add("002212023092208283210551090593928413184"); + list.add("002212023092215003210551189246374301696"); + list.add("002212023092219350610551258340256505856"); + list.add("002212023092222365010551304075132514304"); + list.add("002212023092222382010551304452976537600"); + list.add("002212023092305383710551410221313445888"); + list.add("002212023092309262210551467536752754688"); + list.add("002212023092309490010551473233143517184"); + list.add("002212023092313455910551532872081289216"); + list.add("002212023092313491010551533674076696576"); + list.add("002212023092314175810551540921847279616"); + list.add("002212023092314202310551541528242192384"); + list.add("002212023092317371210551591057743069184"); + list.add("002212023092319233910551617847520952320"); + list.add("002212023092319342810551620569230077952"); + list.add("002212023092320033210551627885622669312"); + list.add("002212023092320462610551638680597008384"); + list.add("002212023092323585310551687111517847552"); + list.add("002212023092409251710551829652152020992"); + list.add("002212023092417150610551947886492483584"); + list.add("002212023092419565910551988624923430912"); + list.add("002212023092420505010552002177378910208"); + list.add("002212023092421095710552006986343673856"); + list.add("002212023092421244510552010712205565952"); + list.add("002212023092421425110552015266918203392"); + list.add("002212023092421470410552016328282583040"); + list.add("002212023092422434510552030591926239232"); + list.add("002212023092422583210552034312383963136"); + list.add("002212023092423275610552041712312041472"); + list.add("002212023092515243510552282462336561152"); + list.add("002212023092515313110552284207140483072"); + list.add("002212023092518270910552328403712724992"); + list.add("002212023092519161910552340776229408768"); + list.add("002212023092519265610552343450557644800"); + list.add("002212023092520095510552354266103967744"); + list.add("002212023092520205910552357049986134016"); + list.add("002212023092521001110552366915611181056"); + list.add("002212023092523283710552404271420321792"); + list.add("002212023092600303810552419878409940992"); + list.add("002212023092614321310552631671040634880"); + list.add("002212023092617540110552682452564910080"); + list.add("002212023092619190610552703867824816128"); + list.add("002212023092619201310552704147078492160"); + list.add("002212023092619363810552708280581914624"); + list.add("002212023092619581110552713702302842880"); + list.add("002212023092622502910552757063885815808"); + list.add("002212023092623025510552760191074775040"); + list.add("002212023092708254310552901825309736960"); + list.add("002212023092713384110552980586671669248"); + list.add("002212023092717205610553036517898690560"); + list.add("002212023092718125510553049600159035392"); + list.add("002212023092718244310553052568742707200"); + list.add("002212023092719291810553068823284289536"); + list.add("002212023092719303710553069153142956032"); + list.add("002212023092719333210553069885942620160"); + list.add("002212023092719453110553072903865192448"); + list.add("002212023092720180110553081079443673088"); + list.add("002212023092720565310553090862134845440"); + list.add("002212023092721572410553106093716258816"); + list.add("002212023092722550310553120600563302400"); + list.add("002212023092723143810553125527868100608"); + list.add("002212023092723261310553128443406364672"); + list.add("002212023092801144810553155769987203072"); + list.add("002212023092809151210553276665498382336"); + list.add("002212023092811473310553315007963312128"); + list.add("002212023092812262410553324784890396672"); + list.add("002212023092812553010553332104573460480"); + list.add("002212023092814054010553349765376729088"); + list.add("002212023092814140010553351862544715776"); + list.add("002212023092817494610553406161413464064"); + list.add("002212023092818443810553419969748275200"); + list.add("002212023092819411910553434231255552000"); + list.add("002212023092820200210553443975454216192"); + list.add("002212023092820243510553445121187360768"); + list.add("002212023092821460610553465635214155776"); + list.add("002212023092822275410553476153733259264"); + list.add("002212023092910122510553653453927698432"); + list.add("002212023092912075610553682521843007488"); + list.add("002212023092912511410553693421067923456"); + list.add("002212023092918473110553783080155590656"); + list.add("002212023092920373010553810760989401088"); + list.add("002212023092920461810553812974036840448"); + list.add("002212023092921240210553822471448420352"); + list.add("002212023092921350710553825260224098304"); + list.add("002212023092922191210553836353901129728"); + list.add("002212023093010003610554012866985242624"); + list.add("002212023093011285610554035094668435456"); + list.add("002212023093012180410554047461959884800"); + list.add("002212023093014083710554075281010716672"); + list.add("002212023093014273310554080045376417792"); + list.add("002212023093017564610554132698471018496"); + list.add("002212023093020184410554168424765763584"); return list; } diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/dto/QueryWithdrawListDTO.java b/jsowell-pile/src/main/java/com/jsowell/adapay/dto/QueryWithdrawListDTO.java new file mode 100644 index 000000000..d4aabb537 --- /dev/null +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/dto/QueryWithdrawListDTO.java @@ -0,0 +1,16 @@ +package com.jsowell.adapay.dto; + +import lombok.*; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@Builder +public class QueryWithdrawListDTO { + private String merchantId; + + private Integer pageNum; + + private Integer pageSize; +} diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java index c0204c55b..54f85544d 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java @@ -39,7 +39,6 @@ import com.jsowell.pile.domain.ClearingWithdrawInfo; import com.jsowell.pile.domain.MemberBasicInfo; import com.jsowell.pile.dto.PayOrderDTO; import com.jsowell.pile.service.*; -import com.jsowell.pile.vo.web.WithdrawInfoVO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -551,11 +550,12 @@ public class AdapayService { vo.setYesterdayRevenue(yesterdayRevenue); // 累计提现金额 - BigDecimal totalWithdraw = BigDecimal.ZERO; - List withdrawInfoVOS = clearingWithdrawInfoService.selectByMerchantId(merchantId); - if (CollectionUtils.isNotEmpty(withdrawInfoVOS)) { - totalWithdraw = withdrawInfoVOS.stream().map(WithdrawInfoVO::getCashAmt).reduce(BigDecimal.ZERO, BigDecimal::add); - } + // BigDecimal totalWithdraw = BigDecimal.ZERO; + // List withdrawInfoVOS = clearingWithdrawInfoService.selectByMerchantId(merchantId); + // if (CollectionUtils.isNotEmpty(withdrawInfoVOS)) { + // totalWithdraw = withdrawInfoVOS.stream().map(WithdrawInfoVO::getCashAmt).reduce(BigDecimal.ZERO, BigDecimal::add); + // } + BigDecimal totalWithdraw = clearingWithdrawInfoService.queryTotalWithdraw(merchantId); vo.setTotalWithdraw(totalWithdraw); return vo; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ClearingWithdrawInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ClearingWithdrawInfoMapper.java index c033d868b..23682fc9a 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ClearingWithdrawInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ClearingWithdrawInfoMapper.java @@ -4,6 +4,7 @@ import com.jsowell.pile.domain.ClearingWithdrawInfo; import com.jsowell.pile.vo.web.ClearingBillVO; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; public interface ClearingWithdrawInfoMapper { @@ -70,4 +71,6 @@ public interface ClearingWithdrawInfoMapper { List selectWithdrawInfoByOrderCodeList(@Param("orderCodeList") List orderCodeList); List selectByMerchantId(@Param("merchantId") String merchantId); + + BigDecimal queryTotalWithdraw(String merchantId); } \ No newline at end of file diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ClearingWithdrawInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ClearingWithdrawInfoService.java index 86bb7d4ec..aaf5c8d1c 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/ClearingWithdrawInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ClearingWithdrawInfoService.java @@ -1,11 +1,15 @@ package com.jsowell.pile.service; import com.huifu.adapay.core.exception.BaseAdaPayException; +import com.jsowell.adapay.dto.QueryWithdrawListDTO; +import com.jsowell.common.core.page.PageResponse; import com.jsowell.pile.domain.ClearingWithdrawInfo; import com.jsowell.pile.vo.web.ClearingBillVO; import com.jsowell.pile.vo.web.WithdrawInfoVO; +import java.math.BigDecimal; import java.util.List; + public interface ClearingWithdrawInfoService{ int deleteByPrimaryKey(Integer id); @@ -35,4 +39,8 @@ public interface ClearingWithdrawInfoService{ List selectWithdrawInfoByOrderCodeList(List orderCodeList); List selectByMerchantId(String merchantId) throws BaseAdaPayException; + + PageResponse queryWithdrawList(QueryWithdrawListDTO dto) throws BaseAdaPayException; + + BigDecimal queryTotalWithdraw(String merchantId); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ClearingWithdrawInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ClearingWithdrawInfoServiceImpl.java index 15743cecd..60e91a8cd 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ClearingWithdrawInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ClearingWithdrawInfoServiceImpl.java @@ -1,10 +1,13 @@ package com.jsowell.pile.service.impl; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; import com.huifu.adapay.core.exception.BaseAdaPayException; +import com.jsowell.adapay.dto.QueryWithdrawListDTO; import com.jsowell.adapay.service.AdapayService; +import com.jsowell.common.core.page.PageResponse; import com.jsowell.common.util.DateUtils; -import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.ClearingWithdrawInfo; import com.jsowell.pile.mapper.ClearingWithdrawInfoMapper; import com.jsowell.pile.service.ClearingWithdrawInfoService; @@ -16,7 +19,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.List; + @Service public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoService{ @@ -107,10 +112,10 @@ public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoServ if (CollectionUtils.isEmpty(infoList)) { return resultList; } - String wechatAppId = pileMerchantInfoService.queryAppIdByMerchantId(merchantId); - if (StringUtils.isBlank(wechatAppId)) { - return resultList; - } + // String wechatAppId = pileMerchantInfoService.queryAppIdByMerchantId(merchantId); + // if (StringUtils.isBlank(wechatAppId)) { + // return resultList; + // } for (ClearingWithdrawInfo clearingWithdrawInfo : infoList) { String withdrawCode = clearingWithdrawInfo.getWithdrawCode(); WithdrawInfoVO vo = new WithdrawInfoVO(); @@ -124,4 +129,35 @@ public class ClearingWithdrawInfoServiceImpl implements ClearingWithdrawInfoServ return resultList; } + @Override + public PageResponse queryWithdrawList(QueryWithdrawListDTO dto) throws BaseAdaPayException { + PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); + List infoList = clearingWithdrawInfoMapper.selectByMerchantId(dto.getMerchantId()); + PageInfo pageInfo = new PageInfo<>(infoList); + + List resultList = Lists.newArrayList(); + for (ClearingWithdrawInfo clearingWithdrawInfo : pageInfo.getList()) { + WithdrawInfoVO vo = new WithdrawInfoVO(); + vo.setMerchantId(clearingWithdrawInfo.getMerchantId()); + vo.setWithdrawCode(clearingWithdrawInfo.getWithdrawCode()); + vo.setApplicationTime(DateUtils.formatDateTime(clearingWithdrawInfo.getApplicationTime())); + vo.setStatusDesc(clearingWithdrawInfo.getWithdrawStatus()); + vo.setCashAmt(clearingWithdrawInfo.getCreditedAmt()); + resultList.add(vo); + } + PageResponse pageResponse = PageResponse.builder() + .pageSize(pageInfo.getPageSize()) + .pageNum(pageInfo.getPageNum()) + .list(resultList) + .pages(pageInfo.getPages()) + .total(pageInfo.getTotal()) + .build(); + return pageResponse; + } + + @Override + public BigDecimal queryTotalWithdraw(String merchantId) { + return clearingWithdrawInfoMapper.queryTotalWithdraw(merchantId); + } + } diff --git a/jsowell-pile/src/main/resources/mapper/pile/ClearingWithdrawInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ClearingWithdrawInfoMapper.xml index 7d5344190..46b02eaa2 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ClearingWithdrawInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ClearingWithdrawInfoMapper.xml @@ -565,4 +565,12 @@ where del_flag = '0' and merchant_id = #{merchantId,jdbcType=VARCHAR} + + \ No newline at end of file