winter 2 лет назад
Родитель
Сommit
b0890e72d8
7 измененных файлов: 68 добавлений и 77 удалений
  1. +10
    -4
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxSettleMerchantController.java
  2. +7
    -8
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java
  3. +2
    -6
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillRentController.java
  4. +2
    -2
      mallinkService/src/main/java/com/iformall/service/WxBillPropertyService.java
  5. +3
    -2
      mallinkService/src/main/java/com/iformall/service/WxBillRentService.java
  6. +38
    -51
      mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java
  7. +6
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java

+ 10
- 4
mallinkAdmin/src/main/java/com/iformall/controller/market/WxSettleMerchantController.java Просмотреть файл

@@ -14,6 +14,7 @@ import com.iformall.enums.EnumRentContractStatus;
import com.iformall.enums.EnumYesOrNo; import com.iformall.enums.EnumYesOrNo;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBillPropertyMapper; import com.iformall.mapper.WxBillPropertyMapper;
import com.iformall.service.WxBillPropertyService;
import com.iformall.service.WxBillRentService; import com.iformall.service.WxBillRentService;
import com.iformall.service.WxPropertyContractService; import com.iformall.service.WxPropertyContractService;
import com.iformall.service.WxRentContractService; import com.iformall.service.WxRentContractService;
@@ -35,6 +36,7 @@ import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;


@RestController @RestController
@@ -53,6 +55,10 @@ public class WxSettleMerchantController extends BaseController {
WxPropertyContractService wxPropertyContractService; WxPropertyContractService wxPropertyContractService;
@Autowired @Autowired
WxBillPropertyMapper wxBillPropertyMapper; WxBillPropertyMapper wxBillPropertyMapper;
@Lazy
@Autowired
WxBillPropertyService wxBillPropertyService;


@ApiOperation("分页列表接口") @ApiOperation("分页列表接口")
@GetMapping("list") @GetMapping("list")
@@ -205,13 +211,13 @@ public class WxSettleMerchantController extends BaseController {
br.setStarttime(wxSettleMerchant.getBeginTime()); br.setStarttime(wxSettleMerchant.getBeginTime());
br.setEndtime(wxSettleMerchant.getEndTime()); br.setEndtime(wxSettleMerchant.getEndTime());
List<WxBillProperty> blist = wxBillPropertyMapper.queryBillPropertyList(br);
if (null == blist || blist.size() <= 0 ) {
PageInfo<WxBillProperty> blist = wxBillPropertyService.listAsPage(br,1, 10000);
if (null == blist || null == blist.getList() || blist.getList().size() <= 0 ) {
return new ResultData(Result.ERROR,"物业合同无对应账单"); return new ResultData(Result.ERROR,"物业合同无对应账单");
} }
Long all = 0L; Long all = 0L;
for (int i = 0 ; i < blist.size() ; i ++) {
WxBillProperty r = blist.get(i);
for (int i = 0 ; i < blist.getList().size() ; i ++) {
WxBillProperty r = blist.getList().get(i);
Long _np = 0L; Long _np = 0L;
if (null != r.getNeedPay()) { if (null != r.getNeedPay()) {
_np = r.getNeedPay(); _np = r.getNeedPay();


+ 7
- 8
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java Просмотреть файл

@@ -87,10 +87,8 @@ public class WxBillPropertyController extends BaseController {


@GetMapping("/findById") @GetMapping("/findById")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "物业账单-查询")
public ResultData findById(Long id) { public ResultData findById(Long id) {
logger.debug("[" + getIpAddr() + "] WxBillPropertyController::findById");
return new ResultData(Result.SUCCESS, "查询成功", wxBillPropertyService.getById(id));
return new ResultData(Result.SUCCESS, "查询成功", wxBillPropertyService.getById(this.getTenantInfo(),id));
} }


@GetMapping("/updatePaid") @GetMapping("/updatePaid")
@@ -103,10 +101,8 @@ public class WxBillPropertyController extends BaseController {


@GetMapping("/detail") @GetMapping("/detail")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "物业账单-详情")
public ResultData detail(Long id) { public ResultData detail(Long id) {
logger.debug("[" + getIpAddr() + "] WxBillPropertyController::detail");
return new ResultData(Result.SUCCESS, "查询成功", wxBillPropertyService.detail(id));
return new ResultData(Result.SUCCESS, "查询成功", wxBillPropertyService.detail(this.getTenantInfo(),id));
} }


@GetMapping("/findByPropertyContractId") @GetMapping("/findByPropertyContractId")
@@ -114,7 +110,6 @@ public class WxBillPropertyController extends BaseController {
@ApiImplicitParam(name = "propertyContractId", value = "merchantId", dataType = "Long", paramType = "query", required = true), @ApiImplicitParam(name = "propertyContractId", value = "merchantId", dataType = "Long", paramType = "query", required = true),
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
@SystemControllerLog(description = "物业账单-根据商户获取")
public ResultData findByPropertyContractId(Long propertyContractId, Integer pageNum, Integer pageSize) { public ResultData findByPropertyContractId(Long propertyContractId, Integer pageNum, Integer pageSize) {
logger.debug("[" + getIpAddr() + "] WxBillPropertyController::findByPropertyContractId"); logger.debug("[" + getIpAddr() + "] WxBillPropertyController::findByPropertyContractId");
final PageInfo<WxBillProperty> page = wxBillPropertyService.findByPropertyContractId(propertyContractId, getTenantInfo(), pageNum, pageSize); final PageInfo<WxBillProperty> page = wxBillPropertyService.findByPropertyContractId(propertyContractId, getTenantInfo(), pageNum, pageSize);
@@ -125,7 +120,6 @@ public class WxBillPropertyController extends BaseController {
@PostMapping("updateLatePayStatus") @PostMapping("updateLatePayStatus")
@SystemControllerLog(description = "物业账单-滞纳金结单") @SystemControllerLog(description = "物业账单-滞纳金结单")
public ResultData updateLatePayStatus(@RequestBody WxBillProperty wxBillProperty) { public ResultData updateLatePayStatus(@RequestBody WxBillProperty wxBillProperty) {
logger.debug("[" + getIpAddr() + "] WxBillPropertyController::updateLatePayStatus");
return wxBillPropertyService.updateLatePayStatus(wxBillProperty); return wxBillPropertyService.updateLatePayStatus(wxBillProperty);
} }


@@ -133,6 +127,11 @@ public class WxBillPropertyController extends BaseController {
@SystemControllerLog(description = "物业账单-导出") @SystemControllerLog(description = "物业账单-导出")
public void exportBill(@ModelAttribute WxBillProperty wxBillProperty, HttpServletRequest request, HttpServletResponse response) { public void exportBill(@ModelAttribute WxBillProperty wxBillProperty, HttpServletRequest request, HttpServletResponse response) {
wxBillProperty.updateTenantInfo(getTenantInfo()); wxBillProperty.updateTenantInfo(getTenantInfo());
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxBillProperty.setFloorForRule(dataRule.getFloorForRule());
wxBillProperty.setBusinessForRule(dataRule.getBusinessForRule());
}
wxBillPropertyService.exportBill(request, response, wxBillProperty); wxBillPropertyService.exportBill(request, response, wxBillProperty);
} }
} }

+ 2
- 6
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillRentController.java Просмотреть файл

@@ -86,10 +86,8 @@ public class WxBillRentController extends BaseController {


@GetMapping("/findById") @GetMapping("/findById")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "租赁押金账单-id查找")
public ResultData findById(Long id) { public ResultData findById(Long id) {
logger.debug("[" + getIpAddr() + "] WxBillRentController::findById");
return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.getById(id));
return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.getById(this.getTenantInfo(),id));
} }


@GetMapping("/findByRentContractId") @GetMapping("/findByRentContractId")
@@ -117,10 +115,8 @@ public class WxBillRentController extends BaseController {


@GetMapping("/detail") @GetMapping("/detail")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "租赁押金账单-详情")
public ResultData detail(Long id) { public ResultData detail(Long id) {
logger.debug("[" + getIpAddr() + "] WxBillRentController::detail");
return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.detail(id));
return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.detail(this.getTenantInfo(),id));
} }


@PostMapping("updateRevenue") @PostMapping("updateRevenue")


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

@@ -33,7 +33,7 @@ public interface WxBillPropertyService {
* @param id * @param id
* @return * @return
*/ */
WxBillProperty getById(Long id);
WxBillProperty getById(TenantEntity tenantEntity,Long id);


/** /**
* 保存或更新实体 * 保存或更新实体
@@ -63,7 +63,7 @@ public interface WxBillPropertyService {


ResultData updatePaid(Long id); ResultData updatePaid(Long id);


Object detail(Long id);
Object detail(TenantEntity tenantEntity,Long id);


ResultData updateLatePayStatus(WxBillProperty wxBillProperty); ResultData updateLatePayStatus(WxBillProperty wxBillProperty);




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

@@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillRent; import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.base.TenantEntity;


import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -30,7 +31,7 @@ public interface WxBillRentService {
* @param id * @param id
* @return * @return
*/ */
WxBillRent getById(Long id);
WxBillRent getById(TenantEntity tenantEntity,Long id);
/** /**
* 保存或更新实体 * 保存或更新实体
@@ -60,7 +61,7 @@ public interface WxBillRentService {


ResultData updatePaid(Long id); ResultData updatePaid(Long id);


Object detail(Long id);
Object detail(TenantEntity tenantEntity,Long id);


ResultData updateRevenue(WxBillRent wxBillRent, MallUserInfo user); ResultData updateRevenue(WxBillRent wxBillRent, MallUserInfo user);




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

@@ -76,14 +76,7 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
@Override @Override
public PageInfo<WxBillProperty> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) { public PageInfo<WxBillProperty> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record); WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record);
PageHelper.startPage(pageIndex, pageSize);
List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record);
billRentList.stream().forEach(e -> {
computeTotalMoney(wxPayAccountBill, e);

});
PageInfo<WxBillProperty> pageInfo = new PageInfo<>(billRentList);
return pageInfo;
return getBillPropertyList(pageIndex, pageSize, wxPayAccountBill, record);
} }
private PageInfo<WxBillProperty> getBillPropertyList(Integer pageIndex, Integer pageSize,WxPayAccountBill wxPayAccountBill,WxBillProperty record) { private PageInfo<WxBillProperty> getBillPropertyList(Integer pageIndex, Integer pageSize,WxPayAccountBill wxPayAccountBill,WxBillProperty record) {
@@ -273,13 +266,15 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
} }


@Override @Override
public WxBillProperty getById(Long id) {
public WxBillProperty getById(TenantEntity tenantEntity,Long id) {
//手续费 = 合同应收+手续费+滞纳金
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(tenantEntity);
WxBillProperty record = new WxBillProperty(); WxBillProperty record = new WxBillProperty();
record.setId(id); record.setId(id);
record.updateTenantInfo(tenantEntity);
getBillPropertyList(1, 10000, wxPayAccountBill, record);
WxBillProperty property = wxBillPropertyMapper.queryBillPropertyList(record).get(0); WxBillProperty property = wxBillPropertyMapper.queryBillPropertyList(record).get(0);
//手续费 = 合同应收+手续费+滞纳金
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(property);
computeTotalMoney(wxPayAccountBill, property);
property.setOwe(property.getRealReceivePay() - property.getPay()); property.setOwe(property.getRealReceivePay() - property.getPay());
return property; return property;
} }
@@ -394,14 +389,8 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
record.setSortColumns(BaseEntity.SortField.Id_ASC); record.setSortColumns(BaseEntity.SortField.Id_ASC);
updateBillStatus(record); updateBillStatus(record);
PageHelper.startPage(pageIndex, pageSize); PageHelper.startPage(pageIndex, pageSize);
List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record);
billRentList.stream().forEach(e -> {
//手续费 = 合同应收+手续费+滞纳金
computeTotalMoney(wxPayAccountBill, e);
});

PageInfo<WxBillProperty> pageInfo = new PageInfo<>(billRentList);
return pageInfo;
PageInfo<WxBillProperty> billRentList = getBillPropertyList(1, 10000, wxPayAccountBill, record);
return billRentList;
} }




@@ -426,9 +415,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
} }


@Override @Override
public Object detail(Long id) {
public Object detail(TenantEntity tenantEntity,Long id) {
//物业 //物业
WxBillProperty property = getById(id);
WxBillProperty property = getById(tenantEntity,id);
//押金 //押金
WxBillPropertyDeposit depositParam = new WxBillPropertyDeposit(); WxBillPropertyDeposit depositParam = new WxBillPropertyDeposit();
depositParam.setPropertyContractId(property.getPropertyContractId()); depositParam.setPropertyContractId(property.getPropertyContractId());
@@ -464,36 +453,34 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService {
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillProperty); WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxBillProperty);
String billName = wxBillProperty.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) ? "商铺物业账单" : "多经点位物业账单"; String billName = wxBillProperty.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) ? "商铺物业账单" : "多经点位物业账单";


List<WxBillProperty> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty);
billPropertyList.stream().forEach(e -> {
//手续费 = 合同应收+手续费+滞纳金
computeTotalMoney(wxPayAccountBill, e);
});
Map<Long, List<WxBillProperty>> collect = billPropertyList.parallelStream()
.collect(Collectors.groupingBy(WxBillProperty::getMerchantId));
Set<Map.Entry<Long, List<WxBillProperty>>> entries = collect.entrySet();
PageInfo<WxBillProperty> billPropertyList = getBillPropertyList(1, 10000, wxPayAccountBill, wxBillProperty);
List<WxBillProperty> datalist = new ArrayList<>(); List<WxBillProperty> datalist = new ArrayList<>();
for (Map.Entry<Long, List<WxBillProperty>> entry : entries) {
List<WxBillProperty> list = entry.getValue();
for (WxBillProperty property : list) {
if (property.getDepositStatus() == null) {
property.setDepositStatus(0);
}
String shopNumber = property.getShopNumber();
if (StringUtils.isEmpty(shopNumber)) {
String shopInfo = property.getShopInfo();
if (StringUtils.isNotEmpty(shopInfo) && !shopInfo.equals("[]")) {
JSONObject jsonObject = JSONObject.parseObject(shopInfo);
StringBuffer sb = new StringBuffer();
Set<Map.Entry<String, Object>> sets = jsonObject.entrySet();
sets.forEach(x -> sb.append(x.getKey()).append(","));
if(StringUtils.isNotBlank(sb)){
property.setShopNumber(sb.deleteCharAt(sb.length() - 1).toString());
}
}
}
datalist.add(property);
}
if (null != billPropertyList && null != billPropertyList.getList()) {
Map<Long, List<WxBillProperty>> collect = billPropertyList.getList().parallelStream()
.collect(Collectors.groupingBy(WxBillProperty::getMerchantId));
Set<Map.Entry<Long, List<WxBillProperty>>> entries = collect.entrySet();
for (Map.Entry<Long, List<WxBillProperty>> entry : entries) {
List<WxBillProperty> list = entry.getValue();
for (WxBillProperty property : list) {
if (property.getDepositStatus() == null) {
property.setDepositStatus(0);
}
String shopNumber = property.getShopNumber();
if (StringUtils.isEmpty(shopNumber)) {
String shopInfo = property.getShopInfo();
if (StringUtils.isNotEmpty(shopInfo) && !shopInfo.equals("[]")) {
JSONObject jsonObject = JSONObject.parseObject(shopInfo);
StringBuffer sb = new StringBuffer();
Set<Map.Entry<String, Object>> sets = jsonObject.entrySet();
sets.forEach(x -> sb.append(x.getKey()).append(","));
if(StringUtils.isNotBlank(sb)){
property.setShopNumber(sb.deleteCharAt(sb.length() - 1).toString());
}
}
}
datalist.add(property);
}
}
} }
excelService.exportExcel(datalist, null, billName, WxBillProperty.class, billName + ".xlsx", response, false); excelService.exportExcel(datalist, null, billName, WxBillProperty.class, billName + ".xlsx", response, false);
} }


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

@@ -8,6 +8,7 @@ import com.iformall.common.IdWorker;
import com.iformall.common.Result; import com.iformall.common.Result;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.*; import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.RatioVo; import com.iformall.domain.vo.RatioVo;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
@@ -135,10 +136,11 @@ public class WxBillRentServiceImpl implements WxBillRentService {
} }


@Override @Override
public WxBillRent getById(Long id) {
public WxBillRent getById(TenantEntity tenantEntity,Long id) {
WxBillRent record = new WxBillRent(); WxBillRent record = new WxBillRent();
record.setId(id); record.setId(id);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(record);
record.updateTenantInfo(tenantEntity);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(tenantEntity);
PageInfo<WxBillRent> rp = getBillRentPropertyList(1,1,record,wxPayAccountBill); PageInfo<WxBillRent> rp = getBillRentPropertyList(1,1,record,wxPayAccountBill);
WxBillRent rent = rp.getList().get(0); WxBillRent rent = rp.getList().get(0);
//手续费 = 合同应收+手续费+滞纳金 //手续费 = 合同应收+手续费+滞纳金
@@ -273,9 +275,9 @@ public class WxBillRentServiceImpl implements WxBillRentService {
} }


@Override @Override
public Object detail(Long id) {
public Object detail(TenantEntity tenantEntity,Long id) {
//租赁 //租赁
WxBillRent rent = getById(id);
WxBillRent rent = getById(tenantEntity,id);
//合同 //合同
WxRentContract wxRentContract = wxRentContractMapper.selectById(rent.getRentContractId()); WxRentContract wxRentContract = wxRentContractMapper.selectById(rent.getRentContractId());
//押金 //押金


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