Browse Source

[账单][修改][查询等]

release_toaliyun_real
gongbiao 7 years ago
parent
commit
f9637f4a1a
11 changed files with 53 additions and 35 deletions
  1. +8
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/WxBillAllController.java
  2. +11
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/WxBillPropertyController.java
  3. +7
    -3
      mallinkAdmin/src/main/java/com/iformall/controller/WxBillRentController.java
  4. +1
    -0
      mallinkService/src/main/java/com/iformall/service/WxBillAllService.java
  5. +1
    -2
      mallinkService/src/main/java/com/iformall/service/WxBillPropertyService.java
  6. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxBillRentService.java
  7. +4
    -15
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  8. +9
    -6
      mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java
  9. +9
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java
  10. +1
    -1
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  11. +1
    -1
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml

+ 8
- 0
mallinkAdmin/src/main/java/com/iformall/controller/WxBillAllController.java View File

@@ -49,5 +49,13 @@ public class WxBillAllController extends BaseController
wxBillAllService.exportBill(request,response,wxBillAll);
}

@GetMapping("getBillInfo")
public ResultData getBillInfo(@ModelAttribute WxBillAll wxBillAll) {
wxBillAll.setTenantId(getTenantId());
Object billInfo = wxBillAllService.getBillInfo(wxBillAll);
return new ResultData(billInfo);
}



}

+ 11
- 1
mallinkAdmin/src/main/java/com/iformall/controller/WxBillPropertyController.java View File

@@ -35,7 +35,7 @@ public class WxBillPropertyController extends BaseController {
wxBillProperty = new WxBillProperty();
}
wxBillProperty.setTenantId(getTenantId());
wxBillProperty.setSortColumns(WxBillProperty.Field.Id_ASC);
wxBillProperty.setSortColumns(WxBillProperty.Field.Id_DESC);
PageInfo<Map<String, Object>> result = wxBillPropertyService.listAsPage(wxBillProperty, pageNum, pageSize);
return new ResultData(result);
}
@@ -84,4 +84,14 @@ public class WxBillPropertyController extends BaseController {
return new ResultData(Result.SUCCESS, "查询成功", wxBillPropertyService.detail(id));
}

@GetMapping("/findByMerchantId")
@ApiImplicitParams({
@ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true),
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData findByMerchantId(Long merchantId, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxBillRentController::findByMerchantId");
final PageInfo<Map<String, Object>> page = wxBillPropertyService.findByMerchantId(merchantId, getTenantId(), pageNum, pageSize);
return new ResultData(page);
}
}

+ 7
- 3
mallinkAdmin/src/main/java/com/iformall/controller/WxBillRentController.java View File

@@ -69,10 +69,14 @@ public class WxBillRentController extends BaseController {
}

@GetMapping("/findByMerchantId")
@ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true)
public ResultData findByMerchantId(Long merchantId) {
@ApiImplicitParams({
@ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true),
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData findByMerchantId(Long merchantId, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxBillRentController::findByMerchantId");
return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.findByMerchantId(merchantId));
final PageInfo<Map<String, Object>> page = wxBillRentService.findByMerchantId(merchantId, getTenantId(), pageNum, pageSize);
return new ResultData(page);
}

@GetMapping("/updatePaid")


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxBillAllService.java View File

@@ -23,4 +23,5 @@ public interface WxBillAllService {

void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillAll wxBillAll);

Object getBillInfo(WxBillAll wxBillAll);
}

+ 1
- 2
mallinkService/src/main/java/com/iformall/service/WxBillPropertyService.java View File

@@ -3,7 +3,6 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxBillRent;

import java.util.Map;

@@ -48,7 +47,7 @@ public interface WxBillPropertyService {
void deleteById(Long id);


Object findByMerchantId(Long id);
PageInfo<Map<String, Object>> findByMerchantId(Long id, String tenantId, Integer pageIndex, Integer pageSize);

ResultData updatePaid(Long id);



+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxBillRentService.java View File

@@ -45,7 +45,7 @@ public interface WxBillRentService {
void deleteById(Long id);


Object findByMerchantId(Long id);
PageInfo<Map<String, Object>> findByMerchantId(Long id, String tenantId, Integer pageIndex, Integer pageSize);

ResultData updatePaid(Long id);



+ 4
- 15
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java View File

@@ -85,20 +85,10 @@ public class WxBillAllServiceImpl implements WxBillAllService {
public Map<String, Object> listAsPage(WxBillAll record, Integer pageIndex, Integer pageSize) {
//更新各账单状态
updateBillStatus(record);
//得到当前月
String month = DateUtils.getSystemTime("yyyy-MM");
//获取账单信息-欠缴笔数、欠缴金额、结清笔数、结清金额
Object billInfo = getBillInfo(record.getTenantId(), month);
//设置查询参数-当前月
record.setMonth(month);
//分页-页数、条数
PageHelper.startPage(pageIndex, pageSize);
//查询
List<Map<String, Object>> billList = wxBillAllMapper.list(record);
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billList);
//返回值
Map<String, Object> result = new HashMap<>();
result.put("billInfo", billInfo);
result.put("pageInfo", pageInfo);
return result;
}
@@ -498,10 +488,9 @@ public class WxBillAllServiceImpl implements WxBillAllService {
logger.info("更新各账单状态结束");
}

private Object getBillInfo(String tenantId, String month) {
WxBillAll record = new WxBillAll();
record.setTenantId(tenantId);
record.setMonth(month);
@Override
public Object getBillInfo(WxBillAll record) {

record.setRentShopType(EnumRentShopType.SHOP.getCode());
record.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
Map<String, Object> oweInfoForShop = wxBillAllMapper.queryOweInfo(record);
@@ -514,7 +503,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
record.setStatus(EnumBillRentStatus.PAID.getCode());
Map<String, Object> paidInfoForPoint = wxBillAllMapper.queryPaidInfo(record);

Map<String, Object> result = new HashMap<>(5);
Map<String, Object> result = new HashMap<>(4);
result.put("oweInfoForShop", oweInfoForShop);
result.put("paidInfoForShop", paidInfoForShop);
result.put("oweInfoForPoint", oweInfoForPoint);


+ 9
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java View File

@@ -146,13 +146,19 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
}

@Override
public Object findByMerchantId(Long id) {
public PageInfo<Map<String, Object>> findByMerchantId(Long id, String tenantId, Integer pageIndex, Integer pageSize) {
WxBillProperty record = new WxBillProperty();
record.setMerchantId(id);
record.setTenantId(tenantId);
record.setSortColumns(WxBillProperty.Field.Id_ASC);
return wxBillPropertyMapper.queryBillPropertyList(record);
updateBillStatus(record);
PageHelper.startPage(pageIndex, pageSize);
List<Map<String, Object>> billRentList = wxBillPropertyMapper.queryBillPropertyList(record);
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billRentList);
return pageInfo;
}


@Transactional(rollbackFor = {Exception.class})
@Override
public ResultData updatePaid(Long id) {
@@ -181,12 +187,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
WxBillPropertyDeposit depositParam = new WxBillPropertyDeposit();
depositParam.setPropertyContractId((Long) property.get("propertyContractId"));
Map<String, Object> deposit = wxBillPropertyDepositMapper.queryBillDepositList(depositParam).get(0);
//周期
Object weekly = findByMerchantId((Long) property.get("merchantId"));
Map<String, Object> result = new HashMap<>(3);
Map<String, Object> result = new HashMap<>(2);
result.put("property", property);
result.put("deposit", deposit);
result.put("weekly", weekly);
return result;
}



+ 9
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java View File

@@ -92,7 +92,6 @@ public class WxBillRentServiceImpl implements WxBillRentService {
public Map<String, Object> getById(Long id) {
WxBillRent record = new WxBillRent();
record.setId(id);
record.setSortColumns(WxBillRent.Field.Id_ASC);
return wxBillRentMapper.queryBillRentList(record).get(0);
}

@@ -148,11 +147,16 @@ public class WxBillRentServiceImpl implements WxBillRentService {
}

@Override
public Object findByMerchantId(Long id) {
public PageInfo<Map<String, Object>> findByMerchantId(Long id, String tenantId, Integer pageIndex, Integer pageSize) {
WxBillRent record = new WxBillRent();
record.setMerchantId(id);
record.setTenantId(tenantId);
record.setSortColumns(WxBillRent.Field.Id_ASC);
return wxBillRentMapper.queryBillRentList(record);
updateBillStatus(record);
PageHelper.startPage(pageIndex, pageSize);
List<Map<String, Object>> billRentList = wxBillRentMapper.queryBillRentList(record);
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billRentList);
return pageInfo;
}

@Transactional(rollbackFor = {Exception.class})
@@ -184,11 +188,11 @@ public class WxBillRentServiceImpl implements WxBillRentService {
depositParam.setRentContractId((Long) rent.get("rentContractId"));
Map<String, Object> deposit = wxBillDepositMapper.queryBillDepositList(depositParam).get(0);
//周期
Object weekly = findByMerchantId((Long) rent.get("merchantId"));
//Object weekly = findByMerchantId((Long) rent.get("merchantId"));
Map<String, Object> result = new HashMap<>(3);
result.put("rent", rent);
result.put("deposit", deposit);
result.put("weekly", weekly);
//result.put("weekly", weekly);
return result;
}



+ 1
- 1
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml View File

@@ -100,7 +100,7 @@
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
</where>
order by br.${sortColumns}
<if test=" null != sortColumns">order by br.${sortColumns}</if>
</select>
<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">


+ 1
- 1
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml View File

@@ -101,7 +101,7 @@
<if test=" null != starttime and null!=endtime ">and br.`receive_date` between #{starttime} and #{endtime}</if>
<if test=" null != rentShopType ">and br.`rent_shop_type` = #{rentShopType}</if>
</where>
order by br.${sortColumns}
<if test=" null != sortColumns">order by br.${sortColumns}</if>
</select>
<select id="queryPayInfo" resultType="hashmap" parameterType="hashmap">


Loading…
Cancel
Save