From 7a4d72bfe42e088f29b314f3c2cf53d182b4c953 Mon Sep 17 00:00:00 2001 From: xyiege Date: Wed, 20 Jul 2022 10:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E8=B4=A6=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/AdminAccountCloseController.java | 26 ++++++++++++++++++- .../mapper/AccountRatioSettingMapper.java | 6 +++++ .../szwh/service/AccountCloseService.java | 8 ++++++ .../service/impl/AccountCloseServiceImpl.java | 16 +++++++++++- .../mapper/szwh/AccountRatioSettingMapper.xml | 5 ++++ 5 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/chjyj/szwh/controller/admin/AdminAccountCloseController.java b/src/main/java/cn/chjyj/szwh/controller/admin/AdminAccountCloseController.java index b7e3676..f440c69 100644 --- a/src/main/java/cn/chjyj/szwh/controller/admin/AdminAccountCloseController.java +++ b/src/main/java/cn/chjyj/szwh/controller/admin/AdminAccountCloseController.java @@ -1,5 +1,6 @@ package cn.chjyj.szwh.controller.admin; +import cn.chjyj.szwh.bean.AccountRatioDetail; import cn.chjyj.szwh.controller.BaseController; import cn.chjyj.szwh.service.AccountCloseService; import com.alibaba.fastjson.JSONObject; @@ -9,6 +10,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -20,6 +22,7 @@ public class AdminAccountCloseController extends BaseController { @Autowired private AccountCloseService accountCloseService; + /** * 资金结算对账账单列表 * @param rejson post 发来的json @@ -87,6 +90,7 @@ public class AdminAccountCloseController extends BaseController { /** * 结算表 + * 注意:也会从url中传递参数!! * @param rejson * @return */ @@ -103,7 +107,27 @@ public class AdminAccountCloseController extends BaseController { String limit = request.getString("limit"); int ilimit =StringUtils.isNotBlank(limit)?Integer.valueOf(limit):10; // - accountCloseService.ratioList(ruleName,userId,status,createtime,ipage,ilimit); + Map retmap = accountCloseService.ratioList(ruleName,userId,status,createtime,ipage,ilimit); + jsonObject.put("code",200); + jsonObject.put("msg","成功"); + jsonObject.put("data",retmap); + return jsonObject; + } + + /** + * 设置详情 + * @param rjson + * @return + */ + @PostMapping("/ratioDetail") + public JSONObject ratioDetail(@RequestBody String rjson){ + JSONObject request = JSONObject.parseObject(rjson); + String sid = request.getString("id"); + Integer id =Integer.valueOf(sid); + List acdeList=accountCloseService.ratioDetail(id); + jsonObject.put("data",acdeList); + jsonObject.put("code",200); + jsonObject.put("msg","成功"); return jsonObject; } /** diff --git a/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java b/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java index 7e6fa88..853593a 100644 --- a/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java +++ b/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java @@ -29,4 +29,10 @@ public interface AccountRatioSettingMapper { List getRatioSettingList(@Param("map") Map imap, @Param("startrs") Integer statrs, @Param("limit") Integer limit); + + /** + * 统计总数 + * @return + */ + int countAcRs(); } diff --git a/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java b/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java index 8872c14..4c85ce3 100644 --- a/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java +++ b/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java @@ -1,5 +1,6 @@ package cn.chjyj.szwh.service; +import cn.chjyj.szwh.bean.AccountRatioDetail; import cn.chjyj.szwh.bean.PaySetting; import java.util.List; @@ -42,4 +43,11 @@ public interface AccountCloseService { */ Map ratioList(String ruleName,String userId,String status, String createtime,Integer ipage,Integer ilimit); + + /** + * 设置详情 + * @param settingId + * @return + */ + List ratioDetail(int settingId); } diff --git a/src/main/java/cn/chjyj/szwh/service/impl/AccountCloseServiceImpl.java b/src/main/java/cn/chjyj/szwh/service/impl/AccountCloseServiceImpl.java index 3d80681..edfdf45 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/AccountCloseServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/AccountCloseServiceImpl.java @@ -1,8 +1,10 @@ package cn.chjyj.szwh.service.impl; +import cn.chjyj.szwh.bean.AccountRatioDetail; import cn.chjyj.szwh.bean.AccountRatioSetting; import cn.chjyj.szwh.bean.PaySetting; +import cn.chjyj.szwh.mapper.AccountRatioDetailMapper; import cn.chjyj.szwh.mapper.AccountRatioSettingMapper; import cn.chjyj.szwh.mapper.OrderUserMapper; import cn.chjyj.szwh.mapper.PaySettingMapper; @@ -25,6 +27,8 @@ public class AccountCloseServiceImpl implements AccountCloseService { private OrderUserMapper orderUserMapper; @Autowired private AccountRatioSettingMapper accountRatioSettingMapper; + @Autowired + private AccountRatioDetailMapper accountRatioDetailMapper; @Override public Map getPaySetting() { @@ -108,16 +112,19 @@ public class AccountCloseServiceImpl implements AccountCloseService { if(StringUtils.isNotBlank(status)){ query.put("status",status); } - if(StringUtils.isNotBlank(createtime)){ + if(StringUtils.isNotBlank(createtime) && !"[]".equals(createtime)){ query.put("createtime",createtime); } + int total = accountRatioSettingMapper.countAcRs(); Map retmap=new HashMap(); int startrs=ipage>1?(ipage-1)*ilimit:0; retmap.put("start",startrs+1); retmap.put("cur_page",ipage); retmap.put("limit",ilimit); retmap.put("end",ipage*ilimit); + retmap.put("per_page",ilimit); + retmap.put("total",total); List acrlist = accountRatioSettingMapper.getRatioSettingList(query,startrs,ilimit); List retlist = new ArrayList(); @@ -127,9 +134,16 @@ public class AccountCloseServiceImpl implements AccountCloseService { amap.put("id",acs.getId()); amap.put("user_id",acs.getUserId()); amap.put("createtime",acs.getCreatetime()); + amap.put("is_deleted",acs.getIsDeleted()); + amap.put("status",acs.getStatus()); retlist.add(amap); } retmap.put("data",retlist); return retmap; } + + @Override + public List ratioDetail(int settingId) { + return accountRatioDetailMapper.getAccRatioDetailBySettingId(settingId); + } } diff --git a/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml b/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml index 23a75e8..8148763 100644 --- a/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml +++ b/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml @@ -44,6 +44,11 @@ limit #{limit} + + + insert into