Browse Source

分账详情

master
xyiege 4 years ago
parent
commit
7a4d72bfe4
  1. 26
      src/main/java/cn/chjyj/szwh/controller/admin/AdminAccountCloseController.java
  2. 6
      src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java
  3. 8
      src/main/java/cn/chjyj/szwh/service/AccountCloseService.java
  4. 16
      src/main/java/cn/chjyj/szwh/service/impl/AccountCloseServiceImpl.java
  5. 5
      src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml

26
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<AccountRatioDetail> acdeList=accountCloseService.ratioDetail(id);
jsonObject.put("data",acdeList);
jsonObject.put("code",200);
jsonObject.put("msg","成功");
return jsonObject;
}
/**

6
src/main/java/cn/chjyj/szwh/mapper/AccountRatioSettingMapper.java

@ -29,4 +29,10 @@ public interface AccountRatioSettingMapper {
List<AccountRatioSetting> getRatioSettingList(@Param("map") Map imap,
@Param("startrs") Integer statrs,
@Param("limit") Integer limit);
/**
* 统计总数
* @return
*/
int countAcRs();
}

8
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<String,Object> ratioList(String ruleName,String userId,String status,
String createtime,Integer ipage,Integer ilimit);
/**
* 设置详情
* @param settingId
* @return
*/
List<AccountRatioDetail> ratioDetail(int settingId);
}

16
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<AccountRatioSetting> 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<AccountRatioDetail> ratioDetail(int settingId) {
return accountRatioDetailMapper.getAccRatioDetailBySettingId(settingId);
}
}

5
src/main/resources/mapper/szwh/AccountRatioSettingMapper.xml

@ -44,6 +44,11 @@
limit #{limit}
</select>
<!-- 统计数量 -->
<select id="countAcRs" resultType="java.lang.Integer">
select count(*) from <include refid="tbName"/>
</select>
<!--新增用户 id 自增加-->
<insert id="addAdmin" parameterType="cn.chjyj.szwh.bean.AccountRatioSetting" useGeneratedKeys="true" keyColumn="id">
insert into

Loading…
Cancel
Save