From 9ce4d64e9309912374d443c1cc32c51a83c0937c Mon Sep 17 00:00:00 2001 From: xyiege Date: Wed, 20 Jul 2022 10:39:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=8A=B6=E6=80=81=E5=8F=98?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/AdminAccountCloseController.java | 35 +++++++++++++------ .../mapper/AccountRatioSettingMapper.java | 7 ++++ .../szwh/service/AccountCloseService.java | 8 +++++ .../service/impl/AccountCloseServiceImpl.java | 11 ++++++ .../mapper/szwh/AccountRatioSettingMapper.xml | 7 ++++ 5 files changed, 58 insertions(+), 10 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 a0f3679..b1314ea 100644 --- a/src/main/java/cn/chjyj/szwh/controller/admin/AdminAccountCloseController.java +++ b/src/main/java/cn/chjyj/szwh/controller/admin/AdminAccountCloseController.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.crypto.spec.IvParameterSpec; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.List; @@ -25,46 +26,45 @@ public class AdminAccountCloseController extends BaseController { /** * 资金结算对账账单列表 - * @param rejson post 发来的json + * @param request * @return */ @RequestMapping("/closeList") - public JSONObject closeList(@RequestBody String rejson){ - JSONObject request = JSONObject.parseObject(rejson); + public JSONObject closeList(HttpServletRequest request){ Map qmap =new HashMap(); // 结算人 - String userName=request.getString("user_name"); + String userName=request.getParameter("user_name"); if(StringUtils.isNotBlank(userName)){ qmap.put("user_name",userName); } //结算账户 - String closeAccount=request.getString("close_account"); + String closeAccount=request.getParameter("close_account"); if(StringUtils.isNotBlank(closeAccount)){ qmap.put("close_account",closeAccount); } //银行卡号 - String bankAccount= request.getString("bank_account"); + String bankAccount= request.getParameter("bank_account"); if(StringUtils.isNotBlank(bankAccount)){ qmap.put("bank_account",bankAccount); } //状态 - String status =request.getString("status"); + String status =request.getParameter("status"); if(StringUtils.isNotBlank(status)){ qmap.put("status",status); } // 类型 - String type = request.getString("type"); + String type = request.getParameter("type"); if(StringUtils.isNotBlank(type)){ qmap.put("type",type); } //每页大小 - String limit = request.getString("limit"); + String limit = request.getParameter("limit"); int ilimit = StringUtils.isNotBlank(limit)?20:Integer.valueOf(limit); // 当前页码 - String page = request.getString("page"); + String page = request.getParameter("page"); int ipage = StringUtils.isNotBlank(page)?1:Integer.valueOf(page); //执行搜索查询 @@ -159,4 +159,19 @@ public class AdminAccountCloseController extends BaseController { jsonObject.put("msg","成功"); return jsonObject; } + + /** + * 开启或关闭设置 + * @return + */ + @PostMapping("/ratioStatus") + public JSONObject ratioStatus(@RequestBody String rjson){ + JSONObject request = JSONObject.parseObject(rjson); + String sid = request.getString("id"); + Integer id =Integer.valueOf(sid); + accountCloseService.ratioStatus(id); + 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 853593a..3bdb678 100644 --- a/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java +++ b/src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java @@ -35,4 +35,11 @@ public interface AccountRatioSettingMapper { * @return */ int countAcRs(); + + /** + * 变更状态 + * @param id + * @return + */ + int ratioStatus(@Param("status") Integer status,@Param("id") Integer id); } diff --git a/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java b/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java index 4c85ce3..2cf1718 100644 --- a/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java +++ b/src/main/java/cn/chjyj/szwh/service/AccountCloseService.java @@ -2,6 +2,7 @@ package cn.chjyj.szwh.service; import cn.chjyj.szwh.bean.AccountRatioDetail; import cn.chjyj.szwh.bean.PaySetting; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -50,4 +51,11 @@ public interface AccountCloseService { * @return */ List ratioDetail(int settingId); + + /** + * 变更状态 + * @param id + * @return + */ + int ratioStatus(Integer id); } 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 36743e9..4e89650 100644 --- a/src/main/java/cn/chjyj/szwh/service/impl/AccountCloseServiceImpl.java +++ b/src/main/java/cn/chjyj/szwh/service/impl/AccountCloseServiceImpl.java @@ -152,4 +152,15 @@ public class AccountCloseServiceImpl implements AccountCloseService { public List ratioDetail(int settingId) { return accountRatioDetailMapper.getAccRatioDetailBySettingId(settingId); } + + @Override + public int ratioStatus(Integer id) { + AccountRatioSetting accountRatioSetting = accountRatioSettingMapper.getAccRatioSettingById(id); + Integer status=Integer.valueOf(accountRatioSetting.getStatus()); + int nstatus=1; + if(status==1){ + nstatus=0; + } + return accountRatioSettingMapper.ratioStatus(nstatus,id); + } } diff --git a/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml b/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml index 8148763..0fecc5f 100644 --- a/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml +++ b/src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml @@ -60,6 +60,13 @@ ) + + + update + set status=#{status} + where id=#{id}; + + update