Просмотр исходного кода

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

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
f9637f4a1a
11 измененных файлов: 53 добавлений и 35 удалений
  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 Просмотреть файл

@@ -49,5 +49,13 @@ public class WxBillAllController extends BaseController
wxBillAllService.exportBill(request,response,wxBillAll); 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 Просмотреть файл

@@ -35,7 +35,7 @@ public class WxBillPropertyController extends BaseController {
wxBillProperty = new WxBillProperty(); wxBillProperty = new WxBillProperty();
} }
wxBillProperty.setTenantId(getTenantId()); 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); PageInfo<Map<String, Object>> result = wxBillPropertyService.listAsPage(wxBillProperty, pageNum, pageSize);
return new ResultData(result); return new ResultData(result);
} }
@@ -84,4 +84,14 @@ public class WxBillPropertyController extends BaseController {
return new ResultData(Result.SUCCESS, "查询成功", wxBillPropertyService.detail(id)); 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 Просмотреть файл

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


@GetMapping("/findByMerchantId") @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"); 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") @GetMapping("/updatePaid")


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/WxBillAllService.java Просмотреть файл

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


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


Object getBillInfo(WxBillAll wxBillAll);
} }

+ 1
- 2
mallinkService/src/main/java/com/iformall/service/WxBillPropertyService.java Просмотреть файл

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


import java.util.Map; import java.util.Map;


@@ -48,7 +47,7 @@ public interface WxBillPropertyService {
void deleteById(Long id); 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); ResultData updatePaid(Long id);




+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxBillRentService.java Просмотреть файл

@@ -45,7 +45,7 @@ public interface WxBillRentService {
void deleteById(Long id); 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); ResultData updatePaid(Long id);




+ 4
- 15
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Просмотреть файл

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


+ 9
- 6
mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java Просмотреть файл

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


@Override @Override
public Object findByMerchantId(Long id) {
public PageInfo<Map<String, Object>> findByMerchantId(Long id, String tenantId, Integer pageIndex, Integer pageSize) {
WxBillProperty record = new WxBillProperty(); WxBillProperty record = new WxBillProperty();
record.setMerchantId(id); record.setMerchantId(id);
record.setTenantId(tenantId);
record.setSortColumns(WxBillProperty.Field.Id_ASC); 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}) @Transactional(rollbackFor = {Exception.class})
@Override @Override
public ResultData updatePaid(Long id) { public ResultData updatePaid(Long id) {
@@ -181,12 +187,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
WxBillPropertyDeposit depositParam = new WxBillPropertyDeposit(); WxBillPropertyDeposit depositParam = new WxBillPropertyDeposit();
depositParam.setPropertyContractId((Long) property.get("propertyContractId")); depositParam.setPropertyContractId((Long) property.get("propertyContractId"));
Map<String, Object> deposit = wxBillPropertyDepositMapper.queryBillDepositList(depositParam).get(0); 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("property", property);
result.put("deposit", deposit); result.put("deposit", deposit);
result.put("weekly", weekly);
return result; return result;
} }




+ 9
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java Просмотреть файл

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


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


@Override @Override
public Object findByMerchantId(Long id) {
public PageInfo<Map<String, Object>> findByMerchantId(Long id, String tenantId, Integer pageIndex, Integer pageSize) {
WxBillRent record = new WxBillRent(); WxBillRent record = new WxBillRent();
record.setMerchantId(id); record.setMerchantId(id);
record.setTenantId(tenantId);
record.setSortColumns(WxBillRent.Field.Id_ASC); 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}) @Transactional(rollbackFor = {Exception.class})
@@ -184,11 +188,11 @@ public class WxBillRentServiceImpl implements WxBillRentService {
depositParam.setRentContractId((Long) rent.get("rentContractId")); depositParam.setRentContractId((Long) rent.get("rentContractId"));
Map<String, Object> deposit = wxBillDepositMapper.queryBillDepositList(depositParam).get(0); 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); Map<String, Object> result = new HashMap<>(3);
result.put("rent", rent); result.put("rent", rent);
result.put("deposit", deposit); result.put("deposit", deposit);
result.put("weekly", weekly);
//result.put("weekly", weekly);
return result; return result;
} }




+ 1
- 1
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml Просмотреть файл

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


+ 1
- 1
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml Просмотреть файл

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


Загрузка…
Отмена
Сохранить