| @@ -89,6 +89,13 @@ public class WxBillAllController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| ExcelService excelService; | ExcelService excelService; | ||||
| /** | |||||
| * 商户账单汇总计费列表 | |||||
| * @param wxMerchant | |||||
| * @param pageNum | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("merchantBillList") | @GetMapping("merchantBillList") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | ||||
| @@ -153,7 +160,12 @@ public class WxBillAllController extends BaseController { | |||||
| return new PageInfo<WxMerchantBillVo>(new ArrayList<WxMerchantBillVo>()); | return new PageInfo<WxMerchantBillVo>(new ArrayList<WxMerchantBillVo>()); | ||||
| } | } | ||||
| /** | |||||
| * 导出商户账单汇总计费 | |||||
| * @param wxMerchant | |||||
| * @param request | |||||
| * @param response | |||||
| */ | |||||
| @GetMapping("exportMerchantBillList") | @GetMapping("exportMerchantBillList") | ||||
| public void exportBill(@ModelAttribute WxMerchant wxMerchant, HttpServletRequest request, HttpServletResponse response) { | public void exportBill(@ModelAttribute WxMerchant wxMerchant, HttpServletRequest request, HttpServletResponse response) { | ||||
| wxMerchant.updateTenantInfo(getTenantInfo()); | wxMerchant.updateTenantInfo(getTenantInfo()); | ||||
| @@ -167,7 +179,7 @@ public class WxBillAllController extends BaseController { | |||||
| } | } | ||||
| /** | /** | ||||
| * 商户计费详情 | |||||
| * 商户汇总计费详情 | |||||
| * @param wxMerchant | * @param wxMerchant | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| @@ -222,6 +234,10 @@ public class WxBillAllController extends BaseController { | |||||
| return new ResultData(vo); | return new ResultData(vo); | ||||
| } | } | ||||
| /** | |||||
| * 账单类型 | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("billTypes") | @GetMapping("billTypes") | ||||
| public ResultData billTypes() { | public ResultData billTypes() { | ||||
| Map<Integer,String> tmap = new HashMap<Integer,String>(); | Map<Integer,String> tmap = new HashMap<Integer,String>(); | ||||
| @@ -231,6 +247,30 @@ public class WxBillAllController extends BaseController { | |||||
| return new ResultData(tmap); | return new ResultData(tmap); | ||||
| } | } | ||||
| /** | |||||
| * 欠缴账单统计-红灯区 | |||||
| * @param wxBillAll | |||||
| * @param pageNum | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| // @GetMapping("oweBillHot") | |||||
| // public ResultData oweBillHot() { | |||||
| // wxMerchant.updateTenantInfo(getTenantInfo()); | |||||
| // WxUserDataRule dataRule = this.getCurrentDataFloors(); | |||||
| // if (null != dataRule) { | |||||
| // wxMerchant.setFloorForRule(dataRule.getFloorIds()); | |||||
| // wxMerchant.setBusinessForRule(dataRule.getBussinessIds()); | |||||
| // } | |||||
| // wxMerchant.setOnlyOwe(EnumYesOrNo.YES.getCode()); | |||||
| // EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| // if (null == btype) { | |||||
| // return new ResultData(Result.ERROR,"分类非法"); | |||||
| // } | |||||
| // Date starttime = wxMerchant.getStarttime(); | |||||
| // Date enttime = wxMerchant.getEndtime(); | |||||
| // return new ResultData(billAllHelper.getBillSum(btype, wxMerchant,starttime,enttime)); | |||||
| // } | |||||
| /** | /** | ||||
| * 欠缴账单统计 | * 欠缴账单统计 | ||||
| @@ -316,6 +356,46 @@ public class WxBillAllController extends BaseController { | |||||
| excelService.exportExcel(page.getList(), null, "商户账单总览数据", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false); | excelService.exportExcel(page.getList(), null, "商户账单总览数据", WxBillBaseEntity.class, "商户欠缴账单_"+btype.getMessage()+".xlsx", response, false); | ||||
| } | } | ||||
| /** | |||||
| * 生成单账单催缴 | |||||
| * @param wxBillAll | |||||
| * @param pageNum | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| @GetMapping("exportOneOweBill") | |||||
| public void exportOneOweBill(Long id,Integer billType, HttpServletRequest request, HttpServletResponse response) { | |||||
| if (null == billType) { | |||||
| return ; | |||||
| } | |||||
| EnumBillAllType btype = EnumBillAllType.getEnum(billType); | |||||
| if (null == btype) { | |||||
| return ; | |||||
| } | |||||
| WxBillBaseEntity bill = billAllHelper.getOneBill(getTenantInfo(), btype, id); | |||||
| if (null == bill) { | |||||
| return; | |||||
| } | |||||
| billAllHelper.exportOneBillOweWord(bill, request, response); | |||||
| } | |||||
| //###################################### 老代码 ###################################### | |||||
| @GetMapping("exportOweBill") | |||||
| @SystemControllerLog(description = "费用收缴数据-生成催缴单") | |||||
| public void exportOweBill(@ModelAttribute WxBillAll wxBillAll, HttpServletRequest request, HttpServletResponse response) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::exportOweBill"); | |||||
| if (null == wxBillAll) { | |||||
| wxBillAll = new WxBillAll(); | |||||
| } | |||||
| //默认查当月第一天到今天 | |||||
| if (StringUtils.isNotBlank(wxBillAll.getEndtime())) { | |||||
| wxBillAll.setEndtime(wxBillAll.getEndtime() + " 23:59:59"); | |||||
| } | |||||
| wxBillAll.updateTenantInfo(getTenantInfo()); | |||||
| wxBillAllService.exportOweBill(wxBillAll, request, response); | |||||
| } | |||||
| /** | /** | ||||
| * 欠缴商户列表 | * 欠缴商户列表 | ||||
| @@ -498,21 +578,6 @@ public class WxBillAllController extends BaseController { | |||||
| } | } | ||||
| @GetMapping("exportOweBill") | |||||
| @SystemControllerLog(description = "费用收缴数据-生成催缴单") | |||||
| public void exportOweBill(@ModelAttribute WxBillAll wxBillAll, HttpServletRequest request, HttpServletResponse response) { | |||||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::exportOweBill"); | |||||
| if (null == wxBillAll) { | |||||
| wxBillAll = new WxBillAll(); | |||||
| } | |||||
| //默认查当月第一天到今天 | |||||
| if (StringUtils.isNotBlank(wxBillAll.getEndtime())) { | |||||
| wxBillAll.setEndtime(wxBillAll.getEndtime() + " 23:59:59"); | |||||
| } | |||||
| wxBillAll.updateTenantInfo(getTenantInfo()); | |||||
| wxBillAllService.exportOweBill(wxBillAll, request, response); | |||||
| } | |||||
| @PostMapping("updateReceivePay") | @PostMapping("updateReceivePay") | ||||
| @SystemControllerLog(description = "账单-更新") | @SystemControllerLog(description = "账单-更新") | ||||
| @@ -447,4 +447,5 @@ public class WxMerchant extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer onlyOwe; | private Integer onlyOwe; | ||||
| } | } | ||||
| @@ -36,6 +36,7 @@ public class WxBillBaseEntity extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | ||||
| protected Integer rentShopType; | protected Integer rentShopType; | ||||
| @Excel(name = "实际应收总金额(元)", width = 20, orderNum = "8") | |||||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额(做了减免之后和need可能不一样)",name="receivePay") | @io.swagger.annotations.ApiModelProperty(value="实际应收金额(做了减免之后和need可能不一样)",name="receivePay") | ||||
| protected String receivePay; | protected String receivePay; | ||||
| @@ -59,16 +60,16 @@ public class WxBillBaseEntity extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe") | @io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe") | ||||
| protected String owe; | protected String owe; | ||||
| @Excel(name = "实际应收总金额(元)(包括滞纳金服务费等)", width = 20, orderNum = "8") | |||||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") | |||||
| //@Excel(name = "实际应收总金额(元)", width = 20, orderNum = "8") | |||||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额(加上了滞纳金服务费等费用)",name="realReceivePay") | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| protected String realReceivePay; | protected String realReceivePay; | ||||
| @Excel(name = "实际应收总金额(元)(包括滞纳金服务费等)", width = 20, orderNum = "8") | |||||
| @Excel(name = "账单类型名称", width = 20, orderNum = "8") | |||||
| @io.swagger.annotations.ApiModelProperty(value="账单类型名称",name="billTypeName") | @io.swagger.annotations.ApiModelProperty(value="账单类型名称",name="billTypeName") | ||||
| protected String billTypeName; | protected String billTypeName; | ||||
| @Excel(name = "实际应收总金额(元)(包括滞纳金服务费等)", width = 20, orderNum = "9") | |||||
| @Excel(name = "备注", width = 20, orderNum = "9") | |||||
| @io.swagger.annotations.ApiModelProperty(value="备注",name="billRemark") | @io.swagger.annotations.ApiModelProperty(value="备注",name="billRemark") | ||||
| protected String billRemark; | protected String billRemark; | ||||
| @@ -0,0 +1,34 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import lombok.Data; | |||||
| import java.io.Serializable; | |||||
| import java.math.BigDecimal; | |||||
| import java.math.RoundingMode; | |||||
| import java.util.Date; | |||||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||||
| @Data | |||||
| public class WxBillHotNotify implements Serializable { | |||||
| private static final long serialVersionUID = 1L; | |||||
| //EnumBillAllType; | |||||
| private Integer billType; | |||||
| private String billTypeName; | |||||
| private Integer totalCount = 0; | |||||
| private String totalMoney = "0"; | |||||
| private BigDecimal totalMoneyNumber; | |||||
| private Date minBeginTime; | |||||
| public BigDecimal getTotalMoneyNumber() { | |||||
| if (StringUtils.isNotBlank(totalMoney)) { | |||||
| this.totalMoneyNumber = new BigDecimal(totalMoney).setScale(2, RoundingMode.HALF_UP); | |||||
| }else { | |||||
| this.totalMoneyNumber = new BigDecimal(0); | |||||
| } | |||||
| return totalMoneyNumber; | |||||
| } | |||||
| } | |||||
| @@ -5,7 +5,13 @@ import java.math.RoundingMode; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Collection; | import java.util.Collection; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| import java.util.UUID; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| import org.apache.commons.collections.CollectionUtils; | import org.apache.commons.collections.CollectionUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -24,6 +30,7 @@ import com.iformall.domain.po.WxBillRentManage; | |||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.base.WxBillBaseEntity; | import com.iformall.domain.po.base.WxBillBaseEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | |||||
| import com.iformall.domain.vo.WxBillSum; | import com.iformall.domain.vo.WxBillSum; | ||||
| import com.iformall.domain.vo.WxShopVo; | import com.iformall.domain.vo.WxShopVo; | ||||
| import com.iformall.enums.EnumBillAllType; | import com.iformall.enums.EnumBillAllType; | ||||
| @@ -39,10 +46,18 @@ import com.iformall.service.WxBillPropertyDepositService; | |||||
| import com.iformall.service.WxBillPropertyService; | import com.iformall.service.WxBillPropertyService; | ||||
| import com.iformall.service.WxBillRentManageService; | import com.iformall.service.WxBillRentManageService; | ||||
| import com.iformall.service.WxBillRentService; | import com.iformall.service.WxBillRentService; | ||||
| import com.iformall.service.WxMallService; | |||||
| import com.iformall.service.WxMerchantService; | |||||
| import com.iformall.service.WxShopService; | import com.iformall.service.WxShopService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import com.iformall.utils.PriceUtil; | |||||
| import com.iformall.utils.WordUtil; | |||||
| @Service | @Service | ||||
| public class WxBillAllHelper { | public class WxBillAllHelper { | ||||
| @Autowired | |||||
| private String fmUploadDir; | |||||
| @Autowired | @Autowired | ||||
| private WxBillRentService wxBillRentService; | private WxBillRentService wxBillRentService; | ||||
| @@ -71,6 +86,12 @@ public class WxBillAllHelper { | |||||
| @Autowired | @Autowired | ||||
| private WxShopService wxShopService; | private WxShopService wxShopService; | ||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| private WxMallService wxMallService; | |||||
| private void updateQueryParm(WxMerchant wxMerchant,WxBillBaseEntity bill,Date starttime,Date enttime) { | private void updateQueryParm(WxMerchant wxMerchant,WxBillBaseEntity bill,Date starttime,Date enttime) { | ||||
| bill.updateTenantInfo(wxMerchant); | bill.updateTenantInfo(wxMerchant); | ||||
| @@ -103,6 +124,11 @@ public class WxBillAllHelper { | |||||
| return wxBillRentService.getMerchantIds(br); | return wxBillRentService.getMerchantIds(br); | ||||
| } | } | ||||
| // public WxBillHotNotify getBillRentHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||||
| // WxBillRent br = new WxBillRent(); | |||||
| // updateQueryParm(wxMerchant, br,starttime,enttime); | |||||
| // } | |||||
| public WxBillSum getBillRentManageSum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumRentContractManageFeeType manageFeeType) { | public WxBillSum getBillRentManageSum(WxMerchant wxMerchant,Date starttime, Date enttime,EnumRentContractManageFeeType manageFeeType) { | ||||
| WxBillRentManage brm = new WxBillRentManage(); | WxBillRentManage brm = new WxBillRentManage(); | ||||
| if (null != manageFeeType) { | if (null != manageFeeType) { | ||||
| @@ -362,4 +388,61 @@ public class WxBillAllHelper { | |||||
| } | } | ||||
| return null; | return null; | ||||
| } | } | ||||
| public WxBillBaseEntity getOneBill(TenantEntity tenantEntity,EnumBillAllType billType,Long id) { | |||||
| if (billType == EnumBillAllType.RENT) { | |||||
| return wxBillRentService.getById(tenantEntity, id); | |||||
| }else if (billType == EnumBillAllType.RENT_BUSSINESS_MANAGE) { | |||||
| return wxBillRentManageService.getById(tenantEntity, id); | |||||
| }else if (billType == EnumBillAllType.RENT_OPERATION_MANAGE) { | |||||
| return wxBillRentManageService.getById(tenantEntity, id); | |||||
| }else if (billType == EnumBillAllType.RENT_DEPOSIT) { | |||||
| return wxBillRentDepositService.getById(id); | |||||
| }else if (billType == EnumBillAllType.PROPERTY) { | |||||
| return wxBillPropertyService.getById(tenantEntity, id); | |||||
| }else if (billType == EnumBillAllType.PROPERTY_DEPOSIT) { | |||||
| return wxBillPropertyDepositService.getById(id); | |||||
| }else if (billType == EnumBillAllType.DAILY) { | |||||
| return wxBillDailyService.getById(tenantEntity, id); | |||||
| }else if (billType == EnumBillAllType.OTHER) { | |||||
| return wxBillOtherService.getById(tenantEntity, id); | |||||
| }else if (billType == EnumBillAllType.OTHER_DEPOSIT) { | |||||
| return wxBillOtherDepositService.getById(tenantEntity, id); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| public void exportOneBillOweWord(WxBillBaseEntity bill,HttpServletRequest request, HttpServletResponse response) { | |||||
| String templatePath = "contract-word-template/bill_owe_one.docx"; | |||||
| String filepath = fmUploadDir; | |||||
| String filename = UUID.randomUUID() + ".docx"; | |||||
| String exportFileName = "催缴单"; | |||||
| Map<String, Object> result = new HashMap<>(); | |||||
| result.put("starttime", DateUtils.date2String(bill.getStarttime(),DateUtils.DATE_PATTERN)); | |||||
| result.put("endtime", DateUtils.date2String(bill.getEndtime(),DateUtils.DATE_PATTERN)); | |||||
| WxMerchant m = wxMerchantService.selectById(bill.getMerchantId()); | |||||
| if (null != m) { | |||||
| result.put("shopNumber", getMerchantShopNumber(m)); | |||||
| result.put("merchantName", m.getName()); | |||||
| result.put("linkPerson", m.getLinkPerson()); | |||||
| result.put("linkPhone", m.getLinkPhone()); | |||||
| exportFileName = exportFileName+"_"+m.getName(); | |||||
| } | |||||
| result.put("billTypeName", bill.getBillTypeName()); | |||||
| exportFileName = exportFileName +"_"+ bill.getBillTypeName(); | |||||
| result.put("billRemark", bill.getBillRemark()); | |||||
| result.put("receivePay", bill.getReceivePay()); | |||||
| result.put("pay", bill.getPay()); | |||||
| result.put("owe", bill.getOwe()); | |||||
| result.put("number", "JF" + DateUtils.getSystemTime("yyyyMMddHHmmss")); | |||||
| result.put("summaryUpper", PriceUtil.number2CNMontrayUnit(new BigDecimal(bill.getOwe()).setScale(2,RoundingMode.HALF_UP))); | |||||
| result.put("mall", wxMallService.getByTenantInfo(bill).getName()); | |||||
| result.put("createtime", DateUtils.date2String(new Date())); | |||||
| exportFileName = exportFileName +".docx"; | |||||
| WordUtil.exportWord(templatePath, filepath, filename, exportFileName, result, request, response, null); | |||||
| } | |||||
| // public WxBillHotNotify getHotNotify() { | |||||
| // | |||||
| // } | |||||
| } | } | ||||