| @@ -6,6 +6,7 @@ import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFeesStandardsCalcuteUnit; | |||
| import com.iformall.enums.EnumFeesStandardsTimeUnit; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.*; | |||
| @@ -62,6 +63,21 @@ public class WxRentContractDepositTypeController extends WxContractBaseControlle | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询物业合同时间单位列表") | |||
| @GetMapping("typeTimeUnitList") | |||
| public ResultData typeTimeUnitList() { | |||
| List<EnumFeesStandardsTimeUnit> enumList = EnumBillAllType.getTimeUnites(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| if (null != enumList) { | |||
| Map<Integer,String> retMap = new HashMap<Integer,String>(); | |||
| for (int i = 0 ; i < enumList.size(); i++) { | |||
| EnumFeesStandardsTimeUnit cu = enumList.get(i); | |||
| retMap.put(cu.getCode(), cu.getMessage()); | |||
| } | |||
| return new ResultData(retMap); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -5,8 +5,10 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.common.SysConfigConstant; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.FinanceSetOffDTO; | |||
| import com.iformall.domain.po.SysConfig; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| @@ -17,12 +19,15 @@ import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceiveSetoff; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | |||
| import com.iformall.domain.vo.WxFinanceReceiveSumVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumFinanceCashierType; | |||
| import com.iformall.enums.EnumFinanceFinishStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.service.SysConfigService; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -56,6 +61,8 @@ public class WxFinanceController extends BaseController { | |||
| private WxFinanceService wxFinanceService; | |||
| @Autowired | |||
| WxEnergyService wxEnergyService; | |||
| @Autowired | |||
| private SysConfigService sysConfigService; | |||
| /** | |||
| * 账单类型(非能源) | |||
| @@ -258,6 +265,18 @@ public class WxFinanceController extends BaseController { | |||
| return new ResultData(list); | |||
| } | |||
| @GetMapping("cashierTypes") | |||
| public ResultData cashierTypes() { | |||
| List<Map> list = new ArrayList<Map>(); | |||
| for (EnumFinanceCashierType t : EnumFinanceCashierType.values()) { | |||
| Map m = new HashMap(); | |||
| m.put("id", t.getCode()); | |||
| m.put("name", t.getMessage()); | |||
| list.add(m); | |||
| } | |||
| return new ResultData(list); | |||
| } | |||
| @ApiOperation("收款记录列表") | |||
| @GetMapping("receiveList") | |||
| @ApiImplicitParams({ | |||
| @@ -289,7 +308,7 @@ public class WxFinanceController extends BaseController { | |||
| @PostMapping("receiveRedSet") | |||
| public ResultData receiveRedSet(@RequestBody WxFinanceReceive record) { | |||
| WxFinanceReceive receive = wxFinanceService.getReceiveById(this.getTenantInfo(), record.getId()); | |||
| if (receive.getStatus().intValue() != EnumFinanceReceiveStatus.FINISH.getCode().intValue()) { | |||
| if (receive.getIsFinish().intValue() == EnumYesOrNo.NO.getCode().intValue()) { | |||
| return new ResultData(Result.ERROR,"该状态不允许操作"); | |||
| } | |||
| if (StringUtils.isNotBlank(record.getRemark())) { | |||
| @@ -312,14 +331,6 @@ public class WxFinanceController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("过账") | |||
| @PostMapping("receiveFinish") | |||
| public ResultData receiveFinish(@RequestBody WxFinanceReceive record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxFinanceService.finishReceive(record, getUser()); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("打印项项目需要获取的租户号") | |||
| @GetMapping("templateCurrentTenant") | |||
| @TenantIgnore | |||
| @@ -328,7 +339,7 @@ public class WxFinanceController extends BaseController { | |||
| } | |||
| @GetMapping("finishStatus") | |||
| public ResultData receiveSetoffStatus() { | |||
| public ResultData finishStatus() { | |||
| List<Map> list = new ArrayList<Map>(); | |||
| for (EnumFinanceFinishStatus t : EnumFinanceFinishStatus.values()) { | |||
| Map m = new HashMap(); | |||
| @@ -339,7 +350,19 @@ public class WxFinanceController extends BaseController { | |||
| return new ResultData(list); | |||
| } | |||
| @ApiOperation("过账列表") | |||
| @GetMapping("finishReceiveStatus") | |||
| public ResultData finishReceiveStatus() { | |||
| List<Map> list = new ArrayList<Map>(); | |||
| for (EnumFinanceReceiveStatus t : EnumFinanceReceiveStatus.getFinishStatus()) { | |||
| Map m = new HashMap(); | |||
| m.put("id", t.getCode()); | |||
| m.put("name", t.getMessage()); | |||
| list.add(m); | |||
| } | |||
| return new ResultData(list); | |||
| } | |||
| @ApiOperation("结账列表") | |||
| @GetMapping("finishList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @@ -352,4 +375,89 @@ public class WxFinanceController extends BaseController { | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("结账") | |||
| @PostMapping("saveFinish") | |||
| public ResultData saveFinish(@RequestBody WxFinanceFinish record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxFinanceService.saveOrUpdateFinish(record, getUser()); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("结账列表") | |||
| @GetMapping("finishReceiveList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData finishList(@ModelAttribute WxFinanceReceive record, Integer pageNum, Integer pageSize) { | |||
| if (null == record.getFinishId()) { | |||
| return new ResultData(Result.ERROR,"finishId参数不能为空"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| WxFinanceFinish finish = wxFinanceService.getFinishById(record, record.getFinishId()); | |||
| record.setCreateTimeBegin(finish.getStartDate()); | |||
| record.setCreateTimeEnd(finish.getEndDate()); | |||
| record.setFinishStatus(EnumYesOrNo.YES.getCode()); | |||
| record.setSortColumns("status asc,create_time asc"); | |||
| PageInfo<WxFinanceReceiveVo> page = wxFinanceService.receiveVoListAsPage(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("结账列表") | |||
| @GetMapping("finishReceiveSum") | |||
| public ResultData finishReceiveSum(@ModelAttribute WxFinanceReceive record, Integer pageNum, Integer pageSize) { | |||
| if (null == record.getFinishId()) { | |||
| return new ResultData(Result.ERROR,"finishId参数不能为空"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| WxFinanceFinish finish = wxFinanceService.getFinishById(record, record.getFinishId()); | |||
| record.setCreateTimeBegin(finish.getStartDate()); | |||
| record.setCreateTimeEnd(finish.getEndDate()); | |||
| record.setFinishStatus(EnumYesOrNo.YES.getCode()); | |||
| WxFinanceReceiveSumVo page = wxFinanceService.getReceiveSum(record); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("结账") | |||
| @PostMapping("receiveFinish") | |||
| public ResultData receiveFinish(@RequestBody WxFinanceFinish record) { | |||
| if (null == record.getId()) { | |||
| return new ResultData(Result.ERROR,"finishId参数不能为空"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxFinanceService.finishReceive(record, getUser()); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("批次结账") | |||
| @PostMapping("batchReceiveFinish") | |||
| public ResultData batchReceiveFinish(@RequestBody WxFinanceFinish record) { | |||
| if (null == record.getId() || null == record.getReceiveIds() || record.getReceiveIds().size() <= 0 ) { | |||
| return new ResultData(Result.ERROR,"请选择"); | |||
| } | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| WxFinanceFinish finish = wxFinanceService.getFinishById(record, record.getId()); | |||
| WxFinanceReceive rq = new WxFinanceReceive(); | |||
| rq.setCreateTimeBegin(finish.getStartDate()); | |||
| rq.setCreateTimeEnd(finish.getEndDate()); | |||
| rq.setFinishStatus(EnumYesOrNo.YES.getCode()); | |||
| rq.setIsFinish(EnumYesOrNo.NO.getCode()); | |||
| rq.updateTenantInfo(record); | |||
| Integer count = wxFinanceService.getReceiveUnFinisedCount(rq); | |||
| boolean isAll = false; | |||
| if (null != count && count > record.getReceiveIds().size()) { | |||
| }else { | |||
| isAll = true; | |||
| } | |||
| wxFinanceService.batchFinishReceive(record, getUser(),isAll); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("截止时间") | |||
| @GetMapping("getReceiveEndTime") | |||
| public ResultData getReceiveEndTime() { | |||
| SysConfig config = sysConfigService.getByKey(SysConfigConstant.finance_receive_end_date, getTenantInfo()); | |||
| return new ResultData(config); | |||
| } | |||
| } | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.controller.market; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| @@ -31,6 +32,9 @@ import org.springframework.web.bind.annotation.RestController; | |||
| /** | |||
| * https://www.lodop.net/index.html | |||
| https://github.com/myliuxia/kr-print-designer?tab=readme-ov-file | |||
| 打印项目是独立部署,无法跟后台集成登录。 | |||
| * @author Administrator | |||
| */ | |||
| @RestController | |||
| @@ -79,7 +83,29 @@ public class WxFinancePrintController extends BaseController { | |||
| if (null == record.getTenantId()) { | |||
| return new ResultData(Result.ERROR,"参数不对"); | |||
| } | |||
| wxFinancePrintService.saveOrUpdate(record); | |||
| wxFinancePrintService.save(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("费用区间列表") | |||
| @PostMapping("updateTemplates") | |||
| @TenantIgnore | |||
| public ResultData updateTemplates(@RequestBody WxFinancePrintTemplate record) { | |||
| if (null == record.getTenantId()) { | |||
| return new ResultData(Result.ERROR,"参数不对"); | |||
| } | |||
| wxFinancePrintService.update(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("费用区间列表") | |||
| @PostMapping("copyTemplates") | |||
| @TenantIgnore | |||
| public ResultData copyTemplates(@RequestBody WxFinancePrintTemplate record) { | |||
| if (null == record.getId()) { | |||
| return new ResultData(Result.ERROR,"参数不对"); | |||
| } | |||
| wxFinancePrintService.copy(record); | |||
| return new ResultData(); | |||
| } | |||
| @@ -90,8 +116,37 @@ public class WxFinancePrintController extends BaseController { | |||
| if (null == record.getTenantId()) { | |||
| return new ResultData(Result.ERROR,"参数不对"); | |||
| } | |||
| wxFinancePrintService.saveOrUpdate(record); | |||
| wxFinancePrintService.setTemplatesDel(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("查询模板") | |||
| @GetMapping("getTemplate") | |||
| @TenantIgnore | |||
| public ResultData getTemplate(@ModelAttribute String tenantId,Long templateId) { | |||
| if (null == templateId) { | |||
| return new ResultData(Result.ERROR,"参数不对"); | |||
| } | |||
| return new ResultData(wxFinancePrintService.getTemplateById(templateId)); | |||
| } | |||
| @ApiOperation("预览") | |||
| @PostMapping("viewTemplate") | |||
| @TenantIgnore | |||
| public ResultData viewTemplate(@RequestBody String tenantId,Long templateId,List<Long> dataIds) { | |||
| if (StringUtils.isBlank(tenantId)||null == dataIds || dataIds.size() <= 0 || null == templateId) { | |||
| return new ResultData(Result.ERROR,"参数不对"); | |||
| } | |||
| return new ResultData(wxFinancePrintService.parseTemplateData(tenantId,templateId,dataIds,null)); | |||
| } | |||
| @ApiOperation("") | |||
| @GetMapping("needUpdate") | |||
| @TenantIgnore | |||
| public ResultData version() { | |||
| Map retMap = new HashMap(); | |||
| retMap.put("isUpdate", "0"); | |||
| return new ResultData(retMap); | |||
| } | |||
| } | |||
| @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.TenantIgnore; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| @@ -36,12 +37,14 @@ import com.iformall.service.SysConfigService; | |||
| import com.iformall.service.WxAllBillService; | |||
| import com.iformall.service.WxBillActionService; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFinancePrintService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxPayAccountBillService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.service.helper.WxBillAllHelper; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| @@ -98,6 +101,9 @@ public class WxAllBillController extends BillBaseController { | |||
| @Autowired | |||
| WxAllBillService wxAllBillService; | |||
| @Autowired | |||
| private WxFinancePrintService wxFinancePrintService; | |||
| /** | |||
| * 商户账单汇总计费列表 | |||
| * @param wxMerchant | |||
| @@ -133,6 +139,7 @@ public class WxAllBillController extends BillBaseController { | |||
| wxMerchant.setId(-1L); | |||
| } | |||
| } | |||
| wxMerchant.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| PageInfo<WxMerchant> merchantPage = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | |||
| PageInfo<WxMerchantBillVo> page = new PageInfo<WxMerchantBillVo>(); | |||
| page.setPageNum(pageNum); | |||
| @@ -210,10 +217,39 @@ public class WxAllBillController extends BillBaseController { | |||
| vo.setMerchantId(m.getId()); | |||
| vo.setMerchantName(m.getName()); | |||
| vo.setShopNumber(billAllHelper.getMerchantShopNumber(m)); | |||
| wxMerchant.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| if (null != wxMerchant.getOnlyOwe() && EnumYesOrNo.YES.getCode().intValue() == wxMerchant.getOnlyOwe().intValue()) { | |||
| wxMerchant.setOweBillBeforeDays(getOweBillBeforeDays()); | |||
| } | |||
| //根据科目来 | |||
| List<WxBillSum> sumList = billAllHelper.getFeesBillSum(wxMerchant,starttime, enttime); | |||
| if (null == sumList ) { | |||
| return new ResultData(); | |||
| } | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| fq.updateTenantInfo(wxMerchant); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| BigDecimal needpay = new BigDecimal(0); | |||
| BigDecimal paid = new BigDecimal(0); | |||
| BigDecimal owe = new BigDecimal(0); | |||
| for (int i = 0 ; i < sumList.size() ; i ++) { | |||
| WxBillSum s = sumList.get(i); | |||
| if (null != s.getEnergyFeesId() && null != feesMap) { | |||
| WxEnergyFees fees = feesMap.get(s.getEnergyFeesId()); | |||
| if (null != fees) { | |||
| s.setBillName(fees.getName()); | |||
| } | |||
| needpay = needpay.add(s.getNeedPayNumber()); | |||
| paid = paid.add(s.getPaidNumber()); | |||
| owe = owe.add(s.getOweNumber()); | |||
| } | |||
| } | |||
| vo.setNeedPay(needpay.toPlainString()); | |||
| vo.setPaid(paid.toPlainString()); | |||
| vo.setOwe(owe.toPlainString()); | |||
| vo.setBillSumList(sumList); | |||
| return new ResultData(vo); | |||
| } | |||
| @@ -670,6 +706,7 @@ public class WxAllBillController extends BillBaseController { | |||
| } | |||
| } | |||
| record.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| record.setSortColumns("status asc, starttime asc , merchant_id desc"); | |||
| return new ResultData(wxAllBillService.listAsPage(record, pageNum, pageSize)); | |||
| } | |||
| @@ -711,9 +748,20 @@ public class WxAllBillController extends BillBaseController { | |||
| record.setOweBillLastTime(billAllHelper.getDateBefore(getOweBillBeforeDays())); | |||
| record.setNearBillLastTime(billAllHelper.getDateBefore(getNearBillBeforeDays())); | |||
| } | |||
| } | |||
| record.setIsPreview(EnumYesOrNo.NO.getCode()); | |||
| return new ResultData(wxAllBillService.getBillMonthSum(record)); | |||
| } | |||
| @ApiOperation("预览结算单") | |||
| @PostMapping("viewSettleTemplate") | |||
| @TenantIgnore | |||
| public ResultData viewSettleTemplate(@RequestBody WxMerchant merchant,Long templateId) { | |||
| if (null == merchant.getId()) { | |||
| return new ResultData(Result.ERROR,"清选择商户"); | |||
| } | |||
| merchant.updateTenantInfo(getTenantInfo()); | |||
| return new ResultData(wxFinancePrintService.parseTemplateData(merchant.getTenantId(),templateId,null,merchant)); | |||
| } | |||
| } | |||
| @@ -779,7 +779,7 @@ CREATE TABLE `wx_finance_print_data` ( | |||
| `type` int(1) NOT NULL COMMENT '类型', | |||
| `sort` int(1) NOT NULL DEFAULT '0' COMMENT '排序', | |||
| `print_data_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '打印的字段类型', | |||
| `print_data_json` json DEFAULT NULL COMMENT '配置项', | |||
| `print_data_json` text COLLATE utf8mb4_unicode_ci COMMENT '配置项', | |||
| `is_edit` int(1) NOT NULL DEFAULT '0' COMMENT '是否可编辑', | |||
| PRIMARY KEY (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='租赁合同'; | |||
| @@ -791,10 +791,112 @@ CREATE TABLE `wx_finance_print_template` ( | |||
| `update_time` datetime DEFAULT NULL COMMENT '更新时间', | |||
| `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |||
| `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '模板名称', | |||
| `is_del` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL, | |||
| `is_del` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0', | |||
| `content` text COLLATE utf8mb4_unicode_ci COMMENT '内容', | |||
| `type` int(1) NOT NULL COMMENT '类型', | |||
| PRIMARY KEY (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='租赁合同'; | |||
| alter table wx_finance_receive_0 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_1 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_2 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_3 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_4 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_5 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_6 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_7 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_8 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_9 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_10 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_11 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_12 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_13 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_14 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_15 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_16 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_17 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_18 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_19 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_20 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_21 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_22 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_23 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_24 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_25 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_26 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_27 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_28 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_29 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_30 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_31 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_32 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_33 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_34 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_35 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_36 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_37 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_38 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_39 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_40 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_41 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_42 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_43 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_44 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_45 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_46 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_47 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_48 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_49 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_50 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_51 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_52 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_53 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_54 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_55 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_56 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_57 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_58 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_59 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_60 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_61 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_62 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_63 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_64 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_65 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_66 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_67 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_68 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_69 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_70 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_71 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_72 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_73 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_74 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_75 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_76 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_77 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_78 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_79 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_80 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_81 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_82 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_83 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_84 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_85 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_86 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_87 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_88 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_89 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_90 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_91 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_92 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_93 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_94 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_95 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_96 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_97 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_98 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| alter table wx_finance_receive_99 add column is_finish int(1) not null default 0 comment '是否已经结账完成'; | |||
| @@ -0,0 +1,107 @@ | |||
| ALTER TABLE wx_rent_contract ADD COLUMN first_bill_date_start timestamp COMMENT '首期账单开始时间'; | |||
| ALTER TABLE wx_rent_contract ADD COLUMN first_bill_date_end timestamp COMMENT '首期账单结束时间'; | |||
| ALTER TABLE wx_property_contract ADD COLUMN first_bill_date_start timestamp COMMENT '首期账单开始时间'; | |||
| ALTER TABLE wx_property_contract ADD COLUMN first_bill_date_end timestamp COMMENT '首期账单结束时间'; | |||
| alter table wx_energy_fees_0 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_1 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_2 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_3 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_4 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_5 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_6 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_7 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_8 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_9 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_10 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_11 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_12 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_13 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_14 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_15 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_16 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_17 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_18 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_19 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_20 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_21 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_22 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_23 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_24 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_25 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_26 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_27 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_28 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_29 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_30 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_31 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_32 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_33 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_34 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_35 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_36 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_37 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_38 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_39 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_40 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_41 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_42 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_43 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_44 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_45 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_46 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_47 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_48 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_49 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_50 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_51 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_52 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_53 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_54 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_55 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_56 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_57 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_58 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_59 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_60 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_61 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_62 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_63 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_64 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_65 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_66 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_67 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_68 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_69 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_70 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_71 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_72 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_73 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_74 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_75 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_76 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_77 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_78 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_79 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_80 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_81 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_82 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_83 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_84 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_85 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_86 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_87 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_88 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_89 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_90 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_91 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_92 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_93 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_94 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_95 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_96 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_97 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_98 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| alter table wx_energy_fees_99 ADD COLUMN tax_rate VARCHAR(30) COMMENT '税率'; | |||
| @@ -12,4 +12,5 @@ public class SysConfigConstant { | |||
| public static final String merchant_Login_CheckPhone = "merchantLoginCheckPhone"; | |||
| public static final String bill_before_days = "billBeforeDays"; | |||
| public static final String bill_near_days = "billNearDays"; | |||
| public static final String finance_receive_end_date = "financeReceiveEndDate"; | |||
| } | |||
| @@ -10,6 +10,8 @@ import com.iformall.domain.vo.FinanceSetOffDetailVo; | |||
| import com.iformall.domain.vo.WxBillFeesStandardsListVo; | |||
| import com.iformall.enums.EnumBillAction; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.utils.DateUtils; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -104,6 +106,14 @@ public class WxAllBill extends TenantEntity { | |||
| @Excel(name = "周期开始时间", format = "yyyy-MM-dd", width = 20, orderNum = "4") | |||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime") | |||
| public Date starttime; | |||
| @TableField(exist = false) | |||
| private String starttimeStr; | |||
| public String getStarttimeStr() { | |||
| if (null != starttime) { | |||
| starttimeStr = DateUtils.date2String(starttime); | |||
| } | |||
| return starttimeStr; | |||
| } | |||
| @Excel(name = "周期结束时间", format = "yyyy-MM-dd", width = 20, orderNum = "5") | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| @@ -112,6 +122,14 @@ public class WxAllBill extends TenantEntity { | |||
| public Date endtimeBegin; | |||
| @TableField(exist = false) | |||
| public Date endtimeEnd; | |||
| @TableField(exist = false) | |||
| private String endtimeStr; | |||
| public String getEndtimeStr() { | |||
| if (null != endtime) { | |||
| endtimeStr = DateUtils.date2String(endtime); | |||
| } | |||
| return endtimeStr; | |||
| } | |||
| @Excel(name = "欠缴金额(元)", width = 20, orderNum = "11") | |||
| @TableField(exist = false) | |||
| @@ -135,6 +153,14 @@ public class WxAllBill extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | |||
| public Integer status; | |||
| @TableField(exist = false) | |||
| private String statusName; | |||
| public String getStatusName() { | |||
| if (null != status) { | |||
| return EnumBillStatus.getEnum(status).getMessage(); | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| public List<Integer> statusList; | |||
| @io.swagger.annotations.ApiModelProperty(value = "费用科目", name = "energyFeesId") | |||
| @@ -289,8 +315,6 @@ public class WxAllBill extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private Integer hasParentBillId; | |||
| @TableField(exist = false) | |||
| private Integer hasFeesStardarsId; | |||
| @TableField(exist = false) | |||
| private List<Long> propertyContractIds; | |||
| @TableField(exist = false) | |||
| private List<Long> notInIds; | |||
| @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumContractReceivePeriodUnit; | |||
| import com.iformall.enums.EnumEnergyPublicCalcuteRule; | |||
| import com.iformall.enums.EnumFeesStandardsCalcuteUnit; | |||
| import com.iformall.enums.EnumFeesStandardsTimeUnit; | |||
| @@ -19,6 +20,7 @@ import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.math.BigDecimal; | |||
| import java.math.RoundingMode; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Calendar; | |||
| import java.util.Date; | |||
| @@ -53,6 +55,9 @@ public class WxEnergyFees extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "单价", name = "price") | |||
| private String price; | |||
| @io.swagger.annotations.ApiModelProperty(value = "税率", name = "taxRate") | |||
| private String taxRate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "公摊计算规则EnumEnergyPublicCalcuteRule", name = "publicCalcute") | |||
| private Integer publicCalcute; | |||
| @TableField(exist = false) | |||
| @@ -118,7 +123,8 @@ public class WxEnergyFees extends TenantEntity { | |||
| return ""; | |||
| } | |||
| public String calcuteTotalMoney(Integer decimalSize,Date start,Date end,String count,boolean isFixed,EnumRentDayPriceCalcute priceCalcute,Integer monthDays ) { | |||
| public String calcuteTotalMoney(Integer decimalSize,Date start,Date end,String count,boolean isFixed,EnumRentDayPriceCalcute priceCalcute,Integer monthDays, | |||
| EnumContractReceivePeriodUnit dayType,Integer receivePeriod ) { | |||
| if (StringUtils.isBlank(count)) { | |||
| count = "1"; | |||
| } | |||
| @@ -129,7 +135,7 @@ public class WxEnergyFees extends TenantEntity { | |||
| priceD = priceD.multiply(new BigDecimal(count)); | |||
| return priceD.toPlainString(); | |||
| } | |||
| //按天计算 | |||
| if (this.timeUnit.intValue() == EnumFeesStandardsTimeUnit.DAY.getCode().intValue()) { | |||
| BigDecimal priceD = new BigDecimal(this.price); | |||
| priceD = priceD.multiply(new BigDecimal(count)); | |||
| @@ -141,47 +147,7 @@ public class WxEnergyFees extends TenantEntity { | |||
| priceMonth = new BigDecimal(price).divide(new BigDecimal(12),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP); | |||
| } | |||
| priceMonth = priceMonth.multiply(new BigDecimal(count)); | |||
| //如果开始时间是1号,结束时间是当月最后一天,则是整月,*月数。 | |||
| //如果不是整月,跨月了的,则计算: 开始时间到当月底+ 中间整月 + 结束时间月1号到结束时间 | |||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||
| Date startMonthFirstDay = DateUtils.getFirstDayForCurrMonth(start); | |||
| Date endMonthLastDay = DateUtils.getLastDayForMonth(end); | |||
| if(sd.format(start).equals(sd.format(startMonthFirstDay)) && sd.format(end).equals(sd.format(endMonthLastDay)) ){ | |||
| int months = WxRentContractHelper.getMonths(sd.format(start),sd.format(end)); | |||
| months++; | |||
| if (months > 0 ) { | |||
| return priceMonth.multiply(new BigDecimal(months)).toPlainString(); | |||
| }else { | |||
| return priceMonth.toPlainString(); | |||
| } | |||
| }else { | |||
| Date startMonthEndDay = DateUtils.getLastDayForMonth(start); | |||
| int startDays = DateUtils.daysBetween(start, startMonthEndDay); | |||
| int startMonthDays = DateUtils.daysBetween(startMonthFirstDay, startMonthEndDay); | |||
| Date endMontFirstDay = DateUtils.getFirstDayForCurrMonth(end); | |||
| int endDays = DateUtils.daysBetween(endMontFirstDay, end); | |||
| int endMonthDays = DateUtils.daysBetween(endMontFirstDay, endMonthLastDay); | |||
| int months = WxRentContractHelper.getMonths(sd.format(DateUtils.getDaySet(startMonthEndDay, Calendar.DATE, 1)),sd.format(DateUtils.getDaySet(endMontFirstDay, Calendar.DATE, -1))); | |||
| months++; | |||
| if (startDays > 0 ) { | |||
| priceMonth = priceMonth.multiply(new BigDecimal(startDays)).divide(new BigDecimal(startMonthDays),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP); | |||
| } | |||
| if (endDays > 0 ) { | |||
| priceMonth = priceMonth.multiply(new BigDecimal(endDays)).divide(new BigDecimal(endMonthDays),Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP); | |||
| } | |||
| if (months > 0 ) { | |||
| priceMonth = priceMonth.multiply(new BigDecimal(months)); | |||
| } | |||
| return priceMonth.toPlainString(); | |||
| } | |||
| return WxRentContractHelper.getMonthNeedPay(null,decimalSize,priceMonth, start, end,dayType.getCode(),receivePeriod,priceCalcute.getCode(),monthDays); | |||
| } | |||
| } | |||
| @@ -72,4 +72,10 @@ public class WxFinanceFinish extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "name", name = "name") | |||
| private String name; | |||
| @TableField(exist = false) | |||
| private List<Long> receiveIds; | |||
| @TableField(exist = false) | |||
| private Date receiveEndTime; | |||
| } | |||
| @@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableId; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.print.PrintDataHandler; | |||
| import com.iformall.print.PrintComponentHandler; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @@ -42,7 +42,7 @@ public class WxFinancePrintData extends BaseEntity { | |||
| @TableField(exist = false) | |||
| private Object printComponents; | |||
| public Object getPrintComponents() { | |||
| printComponents = PrintDataHandler.parseComponent(this); | |||
| printComponents = PrintComponentHandler.parseComponent(this); | |||
| return printComponents; | |||
| } | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.domain.po; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| @@ -27,6 +28,8 @@ public class WxFinancePrintTemplate extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="name",name="name") | |||
| private String name; | |||
| @TableField(exist = false) | |||
| private String title; | |||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||
| private Date createTime; | |||
| @@ -50,5 +53,9 @@ public class WxFinancePrintTemplate extends TenantEntity { | |||
| } | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| private JSONObject contentJsonUpdate; | |||
| @TableField(exist = false) | |||
| private List tempItems; | |||
| } | |||
| @@ -69,18 +69,6 @@ public class WxFinanceReceive extends TenantEntity { | |||
| return new BigDecimal(receiveMoney).subtract(new BigDecimal(useMoney)).toPlainString(); | |||
| } | |||
| @TableField(exist = false) | |||
| private String totalMoney; | |||
| public String getTotalMoney() { | |||
| if (StringUtils.isBlank(setOffMoney)) { | |||
| setOffMoney = "0"; | |||
| } | |||
| if (StringUtils.isBlank(receiveMoney)) { | |||
| receiveMoney = "0"; | |||
| } | |||
| return new BigDecimal(receiveMoney).add(new BigDecimal(setOffMoney)).toPlainString(); | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "状态EnumFinanceReceiveStatus", name = "status") | |||
| private Integer status; | |||
| @TableField(exist = false) | |||
| @@ -92,6 +80,9 @@ public class WxFinanceReceive extends TenantEntity { | |||
| return null; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否已结账完成", name = "isFinish") | |||
| private Integer isFinish; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumFinanceCashierType", name = "type") | |||
| private Integer type; | |||
| @TableField(exist = false) | |||
| @@ -106,7 +97,7 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumFinanceReceiveType", name = "type") | |||
| private Integer receiveType; | |||
| @TableField(exist = false) | |||
| private String receivetypeName; | |||
| private String receiveTypeName; | |||
| public String getReceiveTypeName() { | |||
| if (null != receiveType) { | |||
| return EnumFinanceReceiveType.getEnum(receiveType).getMessage(); | |||
| @@ -158,5 +149,7 @@ public class WxFinanceReceive extends TenantEntity { | |||
| private String shopIds; | |||
| @TableField(exist = false) | |||
| private Integer finishStatus; | |||
| @TableField(exist = false) | |||
| private Long finishId; | |||
| } | |||
| @@ -33,6 +33,8 @@ public class WxFinanceReceivePayway extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="支付方式",name="payWay") | |||
| private Long payWay; | |||
| @TableField(exist = false) | |||
| private String payWayName; | |||
| @io.swagger.annotations.ApiModelProperty(value="实收金额",name="receive") | |||
| private String receive; | |||
| @@ -482,5 +482,7 @@ public class WxMerchant extends TenantEntity { | |||
| @TableField(exist = false) | |||
| public Integer toPayMerchant; | |||
| @TableField(exist = false) | |||
| public Integer isPreview; | |||
| } | |||
| @@ -205,7 +205,7 @@ public class WxPropertyContract extends TenantEntity { | |||
| private String subjectName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "1按租赁日生产2按计租日生成账单", name = "rentStartType") | |||
| @io.swagger.annotations.ApiModelProperty(value = "1按租赁日生产2按计租日生成账单EnumRentStartType", name = "rentStartType") | |||
| private Integer rentStartType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作类型1区分租赁物业2合并租赁物业", name = "operationType") | |||
| @@ -242,6 +242,12 @@ public class WxPropertyContract extends TenantEntity { | |||
| private String shopNumbers; | |||
| @TableField(exist = false) | |||
| private List<Long> shopIdsQuery; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单开始时间", name = "firstBillDateStart") | |||
| private Date firstBillDateStart; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单结束时间", name = "firstBillDateEnd") | |||
| private Date firstBillDateEnd; | |||
| //查询过期提醒 | |||
| @TableField(exist = false) | |||
| @@ -251,9 +251,7 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "押金", name = "deposit") | |||
| private String deposit; | |||
| //// @io.swagger.annotations.ApiModelProperty(value = "押金详细", name = "depositInfo") | |||
| //// private String depositInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value = "押金详细EnumRentContractDepositType", name = "cashtypeContentLsit") | |||
| @io.swagger.annotations.ApiModelProperty(value = "押金详细", name = "cashtypeContentLsit") | |||
| private String cashtypeContentLsit; | |||
| @io.swagger.annotations.ApiModelProperty(value = "押金详细", name = "cashtypeLsit") | |||
| private String cashtypeLsit; | |||
| @@ -303,6 +301,11 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点调整比率", name = "revenueRatioSet") | |||
| private String revenueRatioSet; | |||
| @TableField(exist = false) | |||
| private String revenueYear; | |||
| public String getRevenueYear() { | |||
| return revenueRatioSet; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "计租周期 1日2月3自然月EnumRentContractAdjustPeriod", name = "adjustPeriod") | |||
| private Integer adjustPeriod; | |||
| @@ -310,9 +313,6 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营扣点比率", name = "payRatio") | |||
| private String payRatio; | |||
| // @io.swagger.annotations.ApiModelProperty(value = "联营扣点跳点设置", name = "busDiscountRatio") | |||
| // private String busDiscountRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "保底营业额", name = "revenue") | |||
| private String revenue; | |||
| @@ -450,6 +450,12 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "设计文件", name = "outDateNotifyPhone") | |||
| private String designFile; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单开始时间", name = "firstBillDateStart") | |||
| private Date firstBillDateStart; | |||
| @io.swagger.annotations.ApiModelProperty(value = "首期账单结束时间", name = "firstBillDateEnd") | |||
| private Date firstBillDateEnd; | |||
| //查询过期提醒 | |||
| @TableField(exist = false) | |||
| @@ -469,7 +475,7 @@ public class WxRentContract extends TenantEntity { | |||
| public void calcutePrice() { | |||
| //如果是按铺位数算,price不用计算,是填写的值 | |||
| if (!this.type.equals(EnumRentContractType.RENT_BY_COUNT.getCode())) { | |||
| if (this.type.equals(EnumRentContractType.RENT_BY_AREA.getCode()) || this.type.equals(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode())) { | |||
| if (StringUtils.isNotBlank(this.rentArea) && StringUtils.isNotBlank(this.rentPrice)) { | |||
| this.price = new BigDecimal(this.rentArea).multiply(new BigDecimal(this.rentPrice)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| @@ -492,6 +498,7 @@ public class WxRentContract extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "合同类型", name = "contractType") | |||
| private Integer contractType; | |||
| //联营扣点跳点设置 | |||
| @TableField(exist = false) | |||
| private List<WxRentContractRevenueJump> revenueJumps; | |||
| @io.swagger.annotations.ApiModelProperty(value = "联营跳点设置说明", name = "revenueJumpsRemark") | |||
| @@ -0,0 +1,18 @@ | |||
| package com.iformall.domain.vo; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| @Data | |||
| public class PrintMerchantSettleVo implements Serializable{ | |||
| private static final long serialVersionUID = 1L; | |||
| private Date startDate; | |||
| private Date endDate; | |||
| private Date ReceiveDate; | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.domain.vo; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| @Data | |||
| public class PrintVo implements Serializable{ | |||
| private static final long serialVersionUID = 1L; | |||
| private Long dataId; | |||
| private JSONObject template; | |||
| } | |||
| @@ -13,7 +13,11 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||
| public class WxBillSum implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| private Long energyFeesId; | |||
| @TableField(exist = false) | |||
| private String energyFeesName; | |||
| //应收总金额 | |||
| private String needPay = "0"; | |||
| @TableField(exist = false) | |||
| @@ -0,0 +1,18 @@ | |||
| package com.iformall.domain.vo; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| import java.util.List; | |||
| import com.iformall.domain.po.WxFinanceReceivePayway; | |||
| @Data | |||
| public class WxFinanceReceiveSumVo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| String totalReceive; | |||
| String totalSetoff; | |||
| String totalPay; | |||
| List<WxFinanceReceivePayway> payWays; | |||
| } | |||
| @@ -63,6 +63,7 @@ public enum EnumContractReceivePeriodUnit { | |||
| instance.add(Calendar.MONTH, period); | |||
| //instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| instance.add(Calendar.SECOND, -1); | |||
| return instance.getTime(); | |||
| } | |||
| //几个季度之后 | |||
| }else if (unit == QUARTER.getCode().intValue()) { | |||
| @@ -2,8 +2,9 @@ package com.iformall.enums; | |||
| public enum EnumFinancePrintDataType { | |||
| FINANCE_BILL(1,"财务账单"), | |||
| FINANCE_RECEIVE(2,"财务收款单") | |||
| FINANCE_RECEIVE(1,"财务收付款单"), | |||
| BILL(2,"账单"), | |||
| RENT_OWE(3,"结算单") | |||
| ; | |||
| public static EnumFinancePrintDataType getEnum(Integer code) { | |||
| @@ -10,8 +10,7 @@ public enum EnumFinanceReceiveStatus { | |||
| NORMAL(1,"正常"), | |||
| INVALID(2,"作废"), | |||
| RED_SETOFF(3, "红冲"), | |||
| FINISH(4,"已审核过账") | |||
| RED_SETOFF(3, "红冲") | |||
| ; | |||
| public static EnumFinanceReceiveStatus getEnum(Integer code) { | |||
| @@ -39,10 +38,10 @@ public enum EnumFinanceReceiveStatus { | |||
| return message; | |||
| } | |||
| public static List<EnumFinanceReceiveStatus> getSetoff() { | |||
| public static List<EnumFinanceReceiveStatus> getFinishStatus() { | |||
| List<EnumFinanceReceiveStatus> list = new ArrayList<EnumFinanceReceiveStatus>(); | |||
| list.add(NORMAL); | |||
| list.add(FINISH); | |||
| list.add(RED_SETOFF); | |||
| return list; | |||
| } | |||
| } | |||
| @@ -30,6 +30,8 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> { | |||
| WxBillSum getBillMonthSum(WxAllBill wxBillRent); | |||
| List<WxBillSum> getFeesBillSum(WxAllBill wxBillRent); | |||
| List<Long> getMerchantIdList(WxAllBill wxBillRent); | |||
| List<WxBillHotNotify> getBillHotNotify(WxAllBill wxBillRent); | |||
| @@ -2,6 +2,9 @@ package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceivePayway; | |||
| import com.iformall.domain.vo.WxFinanceReceiveSumVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| @@ -18,5 +21,9 @@ public interface WxFinanceReceiveMapper extends CommonMapper<WxFinanceReceive, L | |||
| List<WxFinanceReceive> getMerchantAdvanceGroupSumList(WxFinanceReceive record); | |||
| void finish(WxFinanceReceive wxBillRent); | |||
| WxFinanceReceiveSumVo getReceiveSum(WxFinanceReceive record); | |||
| List<WxFinanceReceivePayway> getReceivePayWaySum(WxFinanceReceive record); | |||
| } | |||
| @@ -13,13 +13,14 @@ import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.print.entity.PrintComponent; | |||
| import com.iformall.print.entity.component.html.PrintHtml; | |||
| import com.iformall.print.entity.component.table.PrintBraidTable; | |||
| import com.iformall.print.entity.component.table.PrintBraidTableColumns; | |||
| import com.iformall.print.entity.component.table.PrintBraidTableColumnsTrSet; | |||
| import com.iformall.print.entity.component.txt.PrintBraidTxt; | |||
| @Data | |||
| public class PrintDataHandler implements Serializable { | |||
| public class PrintComponentHandler implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @@ -39,6 +40,7 @@ public class PrintDataHandler implements Serializable { | |||
| table.setIsEdit(data.getIsEdit()); | |||
| table.setName(dataJson.getString("fieldName")); | |||
| table.setValue("{"+data.getName()+"}"); | |||
| table.setTabelHtml(dataJson.getString("tableHtml")); | |||
| List<PrintBraidTableColumns> columnsAttr = new ArrayList<PrintBraidTableColumns>(); | |||
| JSONArray columns = dataJson.getJSONArray("columns"); | |||
| if (null != columns) { | |||
| @@ -66,6 +68,13 @@ public class PrintDataHandler implements Serializable { | |||
| } | |||
| table.setColumnsAttr(columnsAttr); | |||
| return table; | |||
| }else if ("braid-html".equals(data.getPrintDataType())) { | |||
| PrintHtml html = new PrintHtml(); | |||
| html.setTitle(data.getName()); | |||
| html.setIsEdit(data.getIsEdit()); | |||
| html.setName("html"); | |||
| html.setValue(dataJson.getString("html")); | |||
| return html; | |||
| } | |||
| return null; | |||
| } | |||
| @@ -1,33 +0,0 @@ | |||
| package com.iformall.print; | |||
| import lombok.Data; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.enums.EnumFinancePrintDataType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.print.entity.PrintComponent; | |||
| import com.iformall.print.entity.component.table.PrintBraidTable; | |||
| import com.iformall.print.entity.component.table.PrintBraidTableColumns; | |||
| import com.iformall.print.entity.component.table.PrintBraidTableColumnsTrSet; | |||
| @Data | |||
| public class PrintDataParseHandler implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| //根据类型来解析传进来的对象 | |||
| private Map<String,Object> getComponentValuesMap(EnumFinancePrintDataType type,Object object) { | |||
| return null; | |||
| } | |||
| public static JSONObject parseData(EnumFinancePrintDataType type,WxFinancePrintData data,Map<String,Object> valueMap) { | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,31 @@ | |||
| package com.iformall.print.data; | |||
| import java.util.Map; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| public abstract class AbstractPrintDataParser { | |||
| public JSONObject parse(String templateContent,Object re,Map<Long,WxMerchant> merchantMap,Map<Long,WxEnergyFees> feesMap) { | |||
| //把所有可能的组件里面需要的内容都解析出来 | |||
| if (StringUtils.isBlank(templateContent)) { | |||
| return null; | |||
| } | |||
| JSONObject o = JSON.parseObject(templateContent); | |||
| JSONArray items = o.getJSONArray("tempItems"); | |||
| if (null != items) { | |||
| for (int i = 0 ; i < items.size() ; i ++) { | |||
| JSONObject ov = items.getJSONObject(i); | |||
| ov.put("value", getObjectValue(ov.getString("name"),re,merchantMap,feesMap)); | |||
| } | |||
| } | |||
| return o; | |||
| } | |||
| public abstract Object getObjectValue(String name, Object o,Map<Long,WxMerchant> merchantMap,Map<Long,WxEnergyFees> feesMap); | |||
| } | |||
| @@ -0,0 +1,62 @@ | |||
| package com.iformall.print.data; | |||
| import java.util.Map; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.utils.DateUtils; | |||
| @Service | |||
| public class PrintBillDataHandler extends AbstractPrintDataParser { | |||
| @Override | |||
| public Object getObjectValue(String name, Object o,Map<Long,WxMerchant> merchantMap,Map<Long,WxEnergyFees> feesMap) { | |||
| WxAllBill receive = (WxAllBill) o; | |||
| if (name.equals("id")) { | |||
| return receive.getId(); | |||
| }else if (name.equals("createtime")) { | |||
| return DateUtils.date2String(receive.getCreatetime()); | |||
| }else if (name.equals("receivePay")) { | |||
| return receive.getReceivePay(); | |||
| }else if (name.equals("pay")) { | |||
| return receive.getPay(); | |||
| }else if (name.equals("setOff")) { | |||
| return receive.getSetOff(); | |||
| }else if (name.equals("starttime")) { | |||
| return DateUtils.date2String(receive.getStarttime()); | |||
| }else if (name.equals("endtime")) { | |||
| return DateUtils.date2String(receive.getEndtime()); | |||
| }else if (name.equals("owe")) { | |||
| return receive.getOwe(); | |||
| }else if (name.equals("statusName")) { | |||
| return receive.getStatusName(); | |||
| }else if (name.equals("merchantName")) { | |||
| if (null != merchantMap) { | |||
| WxMerchant m = merchantMap.get(receive.getMerchantId()); | |||
| if (null != m) { | |||
| return m.getName(); | |||
| } | |||
| } | |||
| return ""; | |||
| }else if (name.equals("energyFeesName")) { | |||
| if (null != feesMap) { | |||
| WxEnergyFees f = feesMap.get(receive.getEnergyFeesId()); | |||
| if (null != f) { | |||
| return f.getName(); | |||
| } | |||
| } | |||
| return ""; | |||
| }else if (name.equals("returnPay")) { | |||
| return receive.getReturnPay(); | |||
| }else if (name.equals("billRemark")) { | |||
| return receive.getBillRemark(); | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,57 @@ | |||
| package com.iformall.print.data; | |||
| import java.util.Map; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.utils.DateUtils; | |||
| /** | |||
| * 财务数据解析 | |||
| * 跟 WxFinancePrintData 里面的字段对应 | |||
| * | |||
| * @author Administrator | |||
| * | |||
| */ | |||
| @Service | |||
| public class PrintFinanceReceiveDataHandler extends AbstractPrintDataParser { | |||
| @Override | |||
| public Object getObjectValue(String name, Object o,Map<Long,WxMerchant> merchantMap,Map<Long,WxEnergyFees> feesMap) { | |||
| WxFinanceReceive receive = (WxFinanceReceive) o; | |||
| if (name.equals("id")) { | |||
| return receive.getId(); | |||
| }else if (name.equals("createTime")) { | |||
| return DateUtils.date2String(receive.getCreateTime()); | |||
| }else if (name.equals("receiveMoney")) { | |||
| return receive.getReceiveMoney(); | |||
| }else if (name.equals("payMoney")) { | |||
| return receive.getPayMoney(); | |||
| }else if (name.equals("setOffMoney")) { | |||
| return receive.getSetOffMoney(); | |||
| }else if (name.equals("useMoney")) { | |||
| return receive.getUseMoney(); | |||
| }else if (name.equals("receiveTypeName")) { | |||
| return receive.getReceiveTypeName(); | |||
| }else if (name.equals("createByName")) { | |||
| return receive.getCreateByName(); | |||
| }else if (name.equals("moneyDetail")) { | |||
| return receive.getMoneyDetail(); | |||
| }else if (name.equals("remark")) { | |||
| return receive.getRemark(); | |||
| }else if (name.equals("merchantName")) { | |||
| if (null != merchantMap) { | |||
| WxMerchant m = merchantMap.get(receive.getMerchantId()); | |||
| if (null != m) { | |||
| return receive.getRemark(); | |||
| } | |||
| } | |||
| return ""; | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,64 @@ | |||
| package com.iformall.print.data; | |||
| import java.util.Map; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.vo.PrintMerchantSettleVo; | |||
| import com.iformall.utils.DateUtils; | |||
| @Service | |||
| public class PrintMerchantSettleDataHandler extends AbstractPrintDataParser { | |||
| @Override | |||
| public Object getObjectValue(String name, Object o,Map<Long,WxMerchant> merchantMap,Map<Long,WxEnergyFees> feesMap) { | |||
| PrintMerchantSettleVo receive = (PrintMerchantSettleVo) o; | |||
| //根据科目来查询对应的信息 | |||
| // if (name.equals("id")) { | |||
| // return receive.getId(); | |||
| // }else if (name.equals("createtime")) { | |||
| // return DateUtils.date2String(receive.getCreatetime()); | |||
| // }else if (name.equals("receivePay")) { | |||
| // return receive.getReceivePay(); | |||
| // }else if (name.equals("pay")) { | |||
| // return receive.getPay(); | |||
| // }else if (name.equals("setOff")) { | |||
| // return receive.getSetOff(); | |||
| // }else if (name.equals("starttime")) { | |||
| // return DateUtils.date2String(receive.getStarttime()); | |||
| // }else if (name.equals("endtime")) { | |||
| // return DateUtils.date2String(receive.getEndtime()); | |||
| // }else if (name.equals("owe")) { | |||
| // return receive.getOwe(); | |||
| // }else if (name.equals("statusName")) { | |||
| // return receive.getStatusName(); | |||
| // }else if (name.equals("merchantName")) { | |||
| // if (null != merchantMap) { | |||
| // WxMerchant m = merchantMap.get(receive.getMerchantId()); | |||
| // if (null != m) { | |||
| // return m.getName(); | |||
| // } | |||
| // } | |||
| // return ""; | |||
| // }else if (name.equals("energyFeesName")) { | |||
| // if (null != feesMap) { | |||
| // WxEnergyFees f = feesMap.get(receive.getEnergyFeesId()); | |||
| // if (null != f) { | |||
| // return f.getName(); | |||
| // } | |||
| // } | |||
| // return ""; | |||
| // }else if (name.equals("returnPay")) { | |||
| // return receive.getReturnPay(); | |||
| // }else if (name.equals("billRemark")) { | |||
| // return receive.getBillRemark(); | |||
| // } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,13 @@ | |||
| package com.iformall.print.entity.component.html; | |||
| import lombok.Data; | |||
| import com.iformall.print.entity.PrintComponent; | |||
| @Data | |||
| public class PrintHtml extends PrintComponent { | |||
| private static final long serialVersionUID = 1L; | |||
| private String type="braid-html"; | |||
| //打印项默认内容 | |||
| private String defaultValue; | |||
| } | |||
| @@ -29,6 +29,8 @@ public interface WxAllBillService { | |||
| WxBillSum getBillMonthSum(WxAllBill wxBillRent); | |||
| List<WxBillSum> getFeesBillSum(WxAllBill wxBillRent); | |||
| PageInfo<WxAllBill> listAsPage(WxAllBill record, Integer pageIndex, Integer pageSize); | |||
| List<Long> getMerchantIds(WxAllBill wxBillRent); | |||
| @@ -73,19 +75,4 @@ public interface WxAllBillService { | |||
| void deleteEnergyReadingBills(WxAllBill wxBillDaily); | |||
| } | |||
| @@ -3,6 +3,8 @@ package com.iformall.service; | |||
| import java.util.List; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.domain.po.WxFinancePrintTemplate; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.vo.PrintVo; | |||
| /** | |||
| */ | |||
| public interface WxFinancePrintService { | |||
| @@ -10,6 +12,9 @@ public interface WxFinancePrintService { | |||
| List<WxFinancePrintData> printDataList(WxFinancePrintData record); | |||
| List<WxFinancePrintTemplate> printTemplateList(WxFinancePrintTemplate record); | |||
| WxFinancePrintTemplate getTemplateById(Long id); | |||
| void saveOrUpdate(WxFinancePrintTemplate record); | |||
| void save(WxFinancePrintTemplate record); | |||
| void update(WxFinancePrintTemplate record); | |||
| void copy(WxFinancePrintTemplate record); | |||
| void setTemplatesDel(WxFinancePrintTemplate record); | |||
| List<PrintVo> parseTemplateData(String tenantId,Long templateId,List<Long> dataIds,BaseEntity entity); | |||
| } | |||
| @@ -12,6 +12,7 @@ import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceiveSetoff; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | |||
| import com.iformall.domain.vo.WxFinanceReceiveSumVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||
| /** | |||
| */ | |||
| @@ -27,12 +28,12 @@ public interface WxFinanceService { | |||
| //收付款 | |||
| PageInfo<WxFinanceReceiveVo> receiveVoListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | |||
| List<WxFinanceReceive> findReceiveList(WxFinanceReceive record); | |||
| List<WxAllBill> createReceive(WxFinanceReceive record,MallUserInfo user); | |||
| List<WxAllBill> createPay(WxFinanceReceive record,MallUserInfo user); | |||
| WxFinanceReceive getReceiveById(TenantEntity tenantEntity,Long id); | |||
| void invalidReceive(WxFinanceReceive record,MallUserInfo user,String remark); | |||
| void redSetoffReceive(WxFinanceReceive record,MallUserInfo user); | |||
| void finishReceive(WxFinanceReceive record,MallUserInfo user); | |||
| //预收款 | |||
| List<WxAllBill> calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); | |||
| FinanceBillSetoffSum getBillSetoffSum(WxFinanceReceive record); | |||
| @@ -42,4 +43,10 @@ public interface WxFinanceService { | |||
| //结账 | |||
| PageInfo<WxFinanceFinish> finishListAsPage(WxFinanceFinish record, Integer pageIndex, Integer pageSize); | |||
| WxFinanceFinish getFinishById(TenantEntity tenantEntity,Long id); | |||
| void saveOrUpdateFinish(WxFinanceFinish record,MallUserInfo user); | |||
| WxFinanceReceiveSumVo getReceiveSum(WxFinanceReceive record); | |||
| void finishReceive(WxFinanceFinish record,MallUserInfo user); | |||
| Integer getReceiveUnFinisedCount(WxFinanceReceive record); | |||
| void batchFinishReceive(WxFinanceFinish record,MallUserInfo user,boolean isAll); | |||
| } | |||
| @@ -100,6 +100,7 @@ public class WxBillAllHelper { | |||
| bill.setNeedPayStartDay(getDateBefore(wxMerchant.getNeedPayPreDays())); | |||
| } | |||
| bill.setToPayMerchant(wxMerchant.getToPayMerchant()); | |||
| bill.setIsPreview(wxMerchant.getIsPreview()); | |||
| } | |||
| public WxBillSum getBillSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||
| @@ -112,13 +113,19 @@ public class WxBillAllHelper { | |||
| return rentSum; | |||
| } | |||
| public List<WxBillSum> getFeesBillSum(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||
| WxAllBill br = new WxAllBill(); | |||
| updateQueryParm(wxMerchant, br,starttime,enttime); | |||
| return wxAllBillService.getFeesBillSum(br); | |||
| } | |||
| public List<WxBillHotNotify> getBillHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) { | |||
| WxAllBill br = new WxAllBill(); | |||
| updateQueryParm(wxMerchant, br,starttime,enttime); | |||
| return wxAllBillService.getBillHotNotify(br); | |||
| } | |||
| private String calcuteSum(String... money) { | |||
| public String calcuteSum(String... money) { | |||
| if (null != money) { | |||
| BigDecimal total = new BigDecimal(0); | |||
| for (int i = 0 ; i < money.length ; i++) { | |||
| @@ -8,6 +8,7 @@ import java.util.Calendar; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import org.apache.commons.collections4.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.joda.time.DateTime; | |||
| import org.joda.time.Months; | |||
| @@ -133,24 +134,16 @@ public class WxRentContractHelper { | |||
| //计算每年租金基数值(合铺录入),具体计算在合同创建时,会根据合同的PriceUnit来根据此基数来计算 | |||
| private static String[] calcuteRentPriceByJoin(WxRentContract wxRentContract) { | |||
| //租金的年调整 | |||
| String adjustRatio = wxRentContract.getAdjustRatio(); | |||
| List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class); | |||
| integers.add(0, 0); | |||
| int size = integers.size(); | |||
| String[] priceArrs = new String[size]; | |||
| //如果是联营扣点租金取高,是固定租金 | |||
| BigDecimal priceD = null; | |||
| if (null != wxRentContract.getRevenueFixedRentPrice() && | |||
| wxRentContract.getRevenueFixedRentPrice().intValue() == EnumYesOrNo.YES.getCode()) { | |||
| priceArrs[0] = wxRentContract.getRevenueRentPrice(); | |||
| priceD = new BigDecimal(wxRentContract.getRevenueRentPrice()); | |||
| }else { | |||
| priceArrs[0] = wxRentContract.getPrice(); | |||
| priceD = new BigDecimal(wxRentContract.getPrice()); | |||
| } | |||
| //BigDecimal priceD = new BigDecimal(wxRentContract.getPrice()); | |||
| priceArrs[0] = wxRentContract.getPrice(); | |||
| BigDecimal priceD = new BigDecimal(wxRentContract.getPrice()); | |||
| //联营扣点年调整。 | |||
| String revenueYear = wxRentContract.getRevenueRatioSet(); | |||
| List<Long> revenueYears = null; | |||
| @@ -161,47 +154,78 @@ public class WxRentContractHelper { | |||
| } | |||
| revenueYears.add(0,0L); | |||
| //联营扣点取高单独计算联营扣点调整。 | |||
| //联营扣点取高单据计算联营扣点方式的,再跟租金的对比取高 | |||
| String[] revenuePriceArrs = calcuteRevenuePriceByRentAreaJoint(wxRentContract,revenueYears,size); | |||
| if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { | |||
| //租金的年调整,联营扣点没有年租金调整,取revenueRatioWay | |||
| Integer adjustRatioWay = wxRentContract.getAdjustRatioWay(); | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| adjustRatioWay = wxRentContract.getRevenueRatioWay(); | |||
| } | |||
| //计算所有租金的 | |||
| if (adjustRatioWay.equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { | |||
| for (int i = 1; i < size; i++) { | |||
| BigDecimal divide = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | |||
| //如果纯联营扣点,没有租金的年增长,用联营扣点的年增长;联营扣点取高时priceD已是最高值 | |||
| String _update = ""; | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| _update = String.valueOf(revenueYears.get(i)); | |||
| }else { | |||
| _update = String.valueOf(integers.get(i)); | |||
| } | |||
| BigDecimal divide = priceD.multiply(new BigDecimal(_update)).divide(new BigDecimal(100)); | |||
| priceD = priceD.add(divide); | |||
| priceArrs[i] = priceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| } else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) { | |||
| } else if (adjustRatioWay.equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) { | |||
| for (int i = 1; i < size; i++) { | |||
| priceD = priceD.add(new BigDecimal(integers.get(i))); | |||
| String _update = ""; | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| _update = String.valueOf(revenueYears.get(i)); | |||
| }else { | |||
| _update = String.valueOf(integers.get(i)); | |||
| } | |||
| priceD = priceD.add(new BigDecimal(_update)); | |||
| priceArrs[i] = priceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| } else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | |||
| } else if (adjustRatioWay.equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | |||
| for (int i = 1; i < size; i++) { | |||
| priceArrs[i] = new BigDecimal(integers.get(i)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| String _update = ""; | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| _update = String.valueOf(revenueYears.get(i)); | |||
| }else { | |||
| _update = String.valueOf(integers.get(i)); | |||
| } | |||
| priceArrs[i] = new BigDecimal(_update).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| }else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ | |||
| }else if (adjustRatioWay.equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ | |||
| String renenue = wxRentContract.getRevenue();//联营保底营业额 | |||
| if (StringUtils.isBlank(renenue)) { | |||
| renenue = "0"; | |||
| } | |||
| for (int i = 1; i < size; i++) { | |||
| BigDecimal _p = null; | |||
| //联营扣点才乘保底营业额 | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode()) && revenueYears.size() == size) { | |||
| _p = new BigDecimal(revenueYears.get(i)).multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | |||
| //如果是联营扣点,用保底营业额*比例 | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| priceArrs[i] = new BigDecimal(renenue).multiply(new BigDecimal(revenueYears.get(i))).divide(new BigDecimal(100)).toPlainString(); | |||
| }else { | |||
| _p = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | |||
| priceArrs[i] = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(100)).toPlainString(); | |||
| } | |||
| priceArrs[i] = _p.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| } | |||
| //租金和联营取高 | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode())) { | |||
| for (int i = 0 ; i < priceArrs.length; i ++) { | |||
| if (new BigDecimal(priceArrs[i]).compareTo(new BigDecimal(revenuePriceArrs[i])) < 0) { | |||
| priceArrs[i] = revenuePriceArrs[i]; | |||
| } | |||
| } | |||
| if (null != revenuePriceArrs) { | |||
| for (int i = 0 ; i < priceArrs.length; i ++) { | |||
| if (new BigDecimal(priceArrs[i]).compareTo(new BigDecimal(revenuePriceArrs[i])) < 0) { | |||
| priceArrs[i] = revenuePriceArrs[i]; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return priceArrs; | |||
| return priceArrs; | |||
| } | |||
| //联营面积取高计算联营扣点调整。 | |||
| @@ -209,60 +233,48 @@ public class WxRentContractHelper { | |||
| //联营面积取高时,联营扣点调整比率设置 | |||
| String[] revenuePriceArrs = new String[size]; | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode())) { | |||
| String _revenuePriceD = null; | |||
| if (null != wxRentContract.getRevenueFixedRentPrice() && wxRentContract.getRevenueFixedRentPrice().intValue() == EnumYesOrNo.YES.getCode().intValue()) { | |||
| _revenuePriceD = wxRentContract.getRevenueRentPrice(); | |||
| }else { | |||
| _revenuePriceD = new BigDecimal(wxRentContract.getRevenue()).multiply(new BigDecimal(wxRentContract.getPayRatio())) | |||
| .divide(new BigDecimal(10000)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| if (StringUtils.isBlank(wxRentContract.getRevenue())) { | |||
| return null; | |||
| } | |||
| String _revenuePriceD = new BigDecimal(wxRentContract.getRevenue()).multiply(new BigDecimal(wxRentContract.getPayRatio())) | |||
| .divide(new BigDecimal(100)).toPlainString(); | |||
| revenuePriceArrs[0] = _revenuePriceD; | |||
| BigDecimal revenuePriceD = new BigDecimal(_revenuePriceD); | |||
| //联营扣点调整比率 | |||
| String revenueRationSet = wxRentContract.getRevenueRatioSet(); | |||
| List<Long> revenueRationSets = null; | |||
| if (!StringUtils.isBlank(revenueRationSet)) { | |||
| revenueRationSets = JSONArray.parseArray(revenueRationSet, Long.class); | |||
| }else { | |||
| revenueRationSets = new ArrayList<Long>(); | |||
| } | |||
| revenueRationSets.add(0,0L); | |||
| if (wxRentContract.getRevenueRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { | |||
| for (int i = 1; i < size; i++) { | |||
| //联营扣点算法 | |||
| if (revenueYears.size() == size && revenueRationSets.size() == size) { | |||
| BigDecimal _p = new BigDecimal(revenueYears.get(i)).multiply(new BigDecimal(revenueRationSets.get(i))).divide(new BigDecimal(10000)); | |||
| if (revenueYears.size() == size) { | |||
| BigDecimal _p = new BigDecimal(revenueYears.get(i)).multiply(revenuePriceD).divide(new BigDecimal(100)); | |||
| revenuePriceD = revenuePriceD.add(_p); | |||
| } | |||
| revenuePriceArrs[i] = revenuePriceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| revenuePriceArrs[i] = revenuePriceD.toPlainString(); | |||
| } | |||
| } else if (wxRentContract.getRevenueRatioWay().equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) { | |||
| for (int i = 1; i < size; i++) { | |||
| if (revenueYears.size() == size && revenueRationSets.size() == size) { | |||
| revenuePriceD = revenuePriceD.add(new BigDecimal(revenueRationSets.get(i))); | |||
| if (revenueYears.size() == size) { | |||
| revenuePriceD = revenuePriceD.add(new BigDecimal(revenueYears.get(i))); | |||
| } | |||
| revenuePriceArrs[i] = revenuePriceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| revenuePriceArrs[i] = revenuePriceD.toPlainString(); | |||
| } | |||
| } else if (wxRentContract.getRevenueRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | |||
| for (int i = 1; i < size; i++) { | |||
| revenuePriceArrs[i] = new BigDecimal(revenueRationSets.get(i)) | |||
| .setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| revenuePriceArrs[i] = new BigDecimal(revenueYears.get(i)).toPlainString(); | |||
| } | |||
| }else if (wxRentContract.getRevenueRatioWay().equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ | |||
| //比例方式直接用保底营业额*比例 | |||
| for (int i = 1; i < size; i++) { | |||
| BigDecimal _p = new BigDecimal(0) ; | |||
| if (revenueYears.size() == size && revenueRationSets.size() == size) { | |||
| _p = new BigDecimal(revenueRationSets.get(i)).multiply(new BigDecimal(revenueYears.get(i))).divide(new BigDecimal(10000)); | |||
| if (revenueYears.size() == size) { | |||
| _p = new BigDecimal(revenueYears.get(i)).multiply(new BigDecimal(wxRentContract.getRevenue())).divide(new BigDecimal(100)); | |||
| } | |||
| revenuePriceArrs[i] = _p.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| revenuePriceArrs[i] = _p.toPlainString(); | |||
| } | |||
| } | |||
| } | |||
| return revenuePriceArrs; | |||
| } | |||
| //合铺计算某项计费 | |||
| private static String[] calcuteRatioByJoin(Integer decimalSize,Integer ratioWay,String ratio,String ratioFirstYearPrice) { | |||
| List<Integer> integers = JSONArray.parseArray(ratio, Integer.class); | |||
| @@ -411,7 +423,7 @@ public class WxRentContractHelper { | |||
| if (null != fees.getCalcuteUnit() && fees.getCalcuteUnit().intValue() == EnumFeesStandardsCalcuteUnit.MM.getCode().intValue()) { | |||
| count = rentArea; | |||
| } | |||
| vo.setTotal(fees.calcuteTotalMoney(decimalSize, billStartDate, billEndDate, count,true,null,null)); | |||
| vo.setTotal(fees.calcuteTotalMoney(decimalSize, billStartDate, billEndDate, count,true,null,null,null,null)); | |||
| vo.setReceiveDate(DateUtils.getDaySet(billStartDate,Calendar.DATE,-1)); | |||
| vo.setFeeStandards(fees); | |||
| retList.add(vo); | |||
| @@ -468,88 +480,163 @@ public class WxRentContractHelper { | |||
| if (null == validDays || validDays.size() <= 0 ) { | |||
| return "0"; | |||
| } | |||
| NeedPayDTO np = getMonthPay(start, end, price, decimalSize, validDays, dayPriceCalcute, monthAvageDays); | |||
| NeedPayDTO np = getCurrentMonthPay(start, end, price, decimalSize, validDays, dayPriceCalcute, monthAvageDays); | |||
| return np.getMoney().toPlainString(); | |||
| } | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(start); | |||
| instance = EnumContractReceivePeriodUnit.getAfterCalendarDay(instance, receivePeriod, dayType); | |||
| if(sd.format(instance.getTime()).equals(sd.format(end))){ | |||
| List<Date> validDays = getValidDays(start,end,freeDays); | |||
| if (null == validDays || validDays.size() <= 0 ) { | |||
| return "0"; | |||
| } | |||
| //不是一个月的。但是按整月算的 | |||
| int months = getMonths(sdM.format(start)+"-01",sdM.format(DateUtils.getDaySet(end,Calendar.DATE,1))+"-01"); | |||
| for (int i = 0 ; i < months; i++) { | |||
| Date currentMonthEnd = DateUtils.getLastDayForMonth(start); | |||
| NeedPayDTO np = getMonthPay(start, currentMonthEnd, price, decimalSize, validDays, dayPriceCalcute, monthAvageDays); | |||
| start = DateUtils.getDaySet(currentMonthEnd,Calendar.DATE,1); | |||
| total = total.add(np.getMoney()); | |||
| //正好是一个周期开始 | |||
| boolean isPeriodStart = false; | |||
| //如果是按自然季度,如果start不是1号,则也不是一个周期 | |||
| if (EnumContractReceivePeriodUnit.QUARTER.getCode().intValue() == dayType) { | |||
| String startday = sdD.format(start); | |||
| if ("1".equals(startday)) { | |||
| isPeriodStart = true; | |||
| } | |||
| return total.toPlainString(); | |||
| }else { | |||
| isPeriodStart = true; | |||
| } | |||
| if (isPeriodStart) { | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(start); | |||
| instance = EnumContractReceivePeriodUnit.getAfterCalendarDay(instance, receivePeriod, dayType); | |||
| if(sd.format(instance.getTime()).equals(sd.format(end))){ | |||
| List<Date> validDays = getValidDays(start,end,freeDays); | |||
| if (null == validDays || validDays.size() <= 0 ) { | |||
| return "0"; | |||
| } | |||
| //如果该周期内是全部有效的,则用月份*金额 | |||
| int allDays = DateUtils.daysBetween(start,end)+1; | |||
| boolean isFull = false; | |||
| if (allDays == validDays.size()) { | |||
| isFull = true; | |||
| } | |||
| //不是一个月的。但是按整月算的 | |||
| int months = getMonths(sdM.format(start)+"-01",sdM.format(DateUtils.getDaySet(end,Calendar.DATE,1))+"-01"); | |||
| if (isFull) { | |||
| return price.multiply(new BigDecimal(months)).toPlainString(); | |||
| } | |||
| //计费每个周期开始时间 | |||
| Calendar periodStart = Calendar.getInstance(); | |||
| periodStart.setTime(start); | |||
| for (int i = 0 ; i < months; i++) { | |||
| //每个计费1个月结束时间,可能是跨月的 | |||
| Date periodEnd = EnumContractReceivePeriodUnit.getAfterCalendarDay(periodStart, i+1, EnumContractReceivePeriodUnit.MONTH.getCode()).getTime(); | |||
| //当前开始时间到当前月底 | |||
| Date currentMonthEnd = DateUtils.getLastDayForMonth(start); | |||
| NeedPayDTO np = getCurrentMonthPay(start, currentMonthEnd, price, decimalSize, validDays, dayPriceCalcute, monthAvageDays); | |||
| total = total.add(np.getMoney()); | |||
| if(periodEnd.after(currentMonthEnd)) { | |||
| start = DateUtils.getDaySet(currentMonthEnd,Calendar.DATE,1); | |||
| NeedPayDTO lnp = getCurrentMonthPay(start, periodEnd, price, decimalSize, validDays, dayPriceCalcute, monthAvageDays); | |||
| total = total.add(lnp.getMoney()); | |||
| }else { | |||
| start = DateUtils.getDaySet(currentMonthEnd,Calendar.DATE,1); | |||
| periodStart.setTime(start); | |||
| } | |||
| } | |||
| return total.toPlainString(); | |||
| } | |||
| } | |||
| //开始到这个月底 | |||
| Date lastMonthDay = DateUtils.getLastDayForMonth(start); | |||
| List<Date> currValidDays = getValidDays(start,lastMonthDay,freeDays); | |||
| if (null == currValidDays || currValidDays.size() <= 0 ) { | |||
| return "0"; | |||
| }else { | |||
| NeedPayDTO np = getCurrentMonthPay(start, lastMonthDay, price, decimalSize, currValidDays, dayPriceCalcute, monthAvageDays); | |||
| total = total.add(np.getMoney()); | |||
| System.out.println("首1月>>>>"+DateUtils.date2String(start)+">>>"+DateUtils.date2String(lastMonthDay)+">>>>"+total.toPlainString()); | |||
| } | |||
| NeedPayDTO np = getMonthPay(start, lastMonthDay, price, decimalSize, currValidDays, dayPriceCalcute, monthAvageDays); | |||
| total = total.add(np.getMoney()); | |||
| System.out.println("首1月>>>>"+DateUtils.date2String(start)+">>>"+DateUtils.date2String(lastMonthDay)+">>>>"+total.toPlainString()); | |||
| //中间月份 | |||
| Date newStartDate = DateUtils.getDaySet(lastMonthDay,Calendar.DATE,1); | |||
| Date newStartDate = DateUtils.getDaySet(lastMonthDay,Calendar.SECOND,1); | |||
| int months = getMonths(sdM.format(newStartDate)+"-01",sdM.format(end)+"-01"); | |||
| for (int i = 0 ; i < months; i++) { | |||
| Date currentMonthEnd = DateUtils.getLastDayForMonth(newStartDate); | |||
| List<Date> _validDays = getValidDays(newStartDate,currentMonthEnd,freeDays); | |||
| if (null == _validDays ||_validDays.size() <= 0 ) { | |||
| }else { | |||
| NeedPayDTO _np = getMonthPay(newStartDate, currentMonthEnd, price, decimalSize, _validDays, dayPriceCalcute, monthAvageDays); | |||
| NeedPayDTO _np = getCurrentMonthPay(newStartDate, currentMonthEnd, price, decimalSize, _validDays, dayPriceCalcute, monthAvageDays); | |||
| System.out.println(i+2+"月>>>>"+DateUtils.date2String(newStartDate)+">>>>"+DateUtils.date2String(currentMonthEnd)+">>>>"+_np.getMoney().toPlainString()); | |||
| newStartDate = DateUtils.getDaySet(currentMonthEnd,Calendar.DATE,1); | |||
| newStartDate = DateUtils.getDaySet(currentMonthEnd,Calendar.SECOND,1); | |||
| total = total.add(_np.getMoney()); | |||
| } | |||
| } | |||
| //最后一个月 | |||
| if (newStartDate.before(end)) { | |||
| Date last = DateUtils.getFirstDayForCurrMonth(end); | |||
| List<Date> lastValidDays = getValidDays(last,end,freeDays); | |||
| List<Date> lastValidDays = getValidDays(newStartDate,end,freeDays); | |||
| if (null == lastValidDays || lastValidDays.size() <= 0 ) { | |||
| return "0"; | |||
| }else { | |||
| NeedPayDTO enp = getCurrentMonthPay(newStartDate, end, price, decimalSize, lastValidDays, dayPriceCalcute, monthAvageDays); | |||
| total = total.add(enp.getMoney()); | |||
| System.out.println("末月>>>>"+DateUtils.date2String(newStartDate)+">>>"+DateUtils.date2String(end)+">>>>"+enp.getMoney().toPlainString()); | |||
| } | |||
| NeedPayDTO enp = getMonthPay(last, end, price, decimalSize, lastValidDays, dayPriceCalcute, monthAvageDays); | |||
| total = total.add(enp.getMoney()); | |||
| System.out.println("末月>>>>"+DateUtils.date2String(last)+">>>"+DateUtils.date2String(end)+">>>>"+enp.getMoney().toPlainString()); | |||
| } | |||
| return total.toPlainString(); | |||
| } | |||
| private static List<Date> getValidDays(Date start,Date end,List<Date> freeDays) { | |||
| List<Date> allDaysFrees = DateUtils.getAllDays(start, end); | |||
| if (null == allDaysFrees) { | |||
| List<Date> allDays = DateUtils.getAllDays(start, end); | |||
| if (null == allDays) { | |||
| return null; | |||
| } | |||
| List<Date> validDays = new ArrayList<Date>(); | |||
| validDays.addAll(allDaysFrees); | |||
| if (null != freeDays && freeDays.size() > 0 ) { | |||
| allDaysFrees.retainAll(freeDays); | |||
| } | |||
| if (null != freeDays && freeDays.size() > 0 && null != allDaysFrees && allDaysFrees.size() > 0 ) { | |||
| validDays.removeAll(allDaysFrees); | |||
| } | |||
| if (validDays.size() <= 0 ) { | |||
| return null; | |||
| validDays.addAll(allDays); | |||
| if (null != freeDays) { | |||
| List<Date> currfreeDays = (List<Date>) CollectionUtils.intersection(allDays, freeDays); | |||
| if (null != currfreeDays) { | |||
| validDays.removeAll(currfreeDays); | |||
| } | |||
| } | |||
| return validDays; | |||
| } | |||
| private static NeedPayDTO getMonthPay(Date start,Date end, BigDecimal priceMonth,Integer decimalSize,List<Date> validDays,Integer dayPriceCalcute,Integer monthAvageDays) { | |||
| public static void main(String[] args) { | |||
| Date start = DateUtils.str2Date("2026-08-10 00:00:00").getTime(); | |||
| Date end = DateUtils.str2Date("2026-09-30 23:59:59").getTime(); | |||
| Date d1 = DateUtils.str2Date("2026-08-09 00:00:00").getTime(); | |||
| Date d2 = DateUtils.str2Date("2026-09-08 00:00:00").getTime(); | |||
| List<Date> f1 = DateUtils.getAllDays(d1, d2); | |||
| // Date d3 = DateUtils.str2Date("2024-09-01 00:00:00").getTime(); | |||
| // Date d4 = DateUtils.str2Date("2024-09-30 00:00:00").getTime(); | |||
| // f1.addAll(DateUtils.getAllDays(d3, d4)); | |||
| System.out.println(getValidDays(start,end,f1)); | |||
| // Date start = DateUtils.str2Date("2024-08-05 00:00:00").getTime(); | |||
| // Date end = DateUtils.str2Date("2025-11-04 23:59:59").getTime(); | |||
| // | |||
| // Date d1 = DateUtils.str2Date("2024-07-31 00:00:00").getTime(); | |||
| // Date d2 = DateUtils.str2Date("2024-08-03 00:00:00").getTime(); | |||
| // Date d3 = DateUtils.str2Date("2024-08-06 00:00:00").getTime(); | |||
| // Date d4 = DateUtils.str2Date("2024-08-31 00:00:00").getTime(); | |||
| // Date d5 = DateUtils.str2Date("2024-09-01 00:00:00").getTime(); | |||
| // Date d6 = DateUtils.str2Date("2024-09-11 00:00:00").getTime(); | |||
| // Date d7 = DateUtils.str2Date("2024-09-30 00:00:00").getTime(); | |||
| // | |||
| // List<Date> freeDays = new ArrayList<Date>(); | |||
| // freeDays.add(d1); | |||
| // freeDays.add(d2); | |||
| // freeDays.add(d3); | |||
| // freeDays.add(d4); | |||
| // freeDays.add(d5); | |||
| // freeDays.add(d6); | |||
| // freeDays.add(d7); | |||
| // System.out.println(DateUtils.getDaySet(d1, Calendar.DATE, -1)); | |||
| //String dayMoney = getNeedPay(freeDays, 2, new BigDecimal(10), start, end, EnumRentDayPriceCalcute.AVERAGE_DAYS, 30); | |||
| //System.out.println(dayMoney); | |||
| //String monthMoney = getMonthNeedPay(freeDays, 2, new BigDecimal(2000), start, end, EnumContractReceivePeriodUnit.QUARTER.getCode(), 1, EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode(), 30); | |||
| //System.out.println(monthMoney); | |||
| } | |||
| //查询当前月内的金额 | |||
| private static NeedPayDTO getCurrentMonthPay(Date start,Date end, BigDecimal priceMonth,Integer decimalSize,List<Date> validDays,Integer dayPriceCalcute,Integer monthAvageDays) { | |||
| NeedPayDTO np = new NeedPayDTO(); | |||
| //当月实际天数 | |||
| int md = DateUtils.getMonthDayCount(start);; | |||
| @@ -703,7 +790,7 @@ public class WxRentContractHelper { | |||
| return 0; | |||
| } | |||
| //如果可用区间的最大闭start小 | |||
| //如果可用区间的最大比start小 | |||
| if (start.after(allDays.get(allDays.size()-1))) { | |||
| return 0; | |||
| } | |||
| @@ -713,7 +800,8 @@ public class WxRentContractHelper { | |||
| Date _end = DateUtils.getDayBegin(end); | |||
| //如果可用区间的最大闭end小,相当于这一期是尾 | |||
| if (end.after(allDays.get(allDays.size()-1))) { | |||
| Date allDayEnd = DateUtils.getDayBegin(allDays.get(allDays.size()-1)); | |||
| if (end.after(allDayEnd)) { | |||
| int ret = allDays.size(); | |||
| allDays.clear(); | |||
| return ret; | |||
| @@ -733,34 +821,5 @@ public class WxRentContractHelper { | |||
| } | |||
| return 0; | |||
| } | |||
| public static void main(String[] args) { | |||
| Date start = DateUtils.str2Date("2024-08-05 00:00:00").getTime(); | |||
| Date end = DateUtils.str2Date("2025-11-04 23:59:59").getTime(); | |||
| Date d1 = DateUtils.str2Date("2024-07-31 00:00:00").getTime(); | |||
| Date d2 = DateUtils.str2Date("2024-08-03 00:00:00").getTime(); | |||
| Date d3 = DateUtils.str2Date("2024-08-06 00:00:00").getTime(); | |||
| Date d4 = DateUtils.str2Date("2024-08-31 00:00:00").getTime(); | |||
| Date d5 = DateUtils.str2Date("2024-09-01 00:00:00").getTime(); | |||
| Date d6 = DateUtils.str2Date("2024-09-11 00:00:00").getTime(); | |||
| Date d7 = DateUtils.str2Date("2024-09-30 00:00:00").getTime(); | |||
| List<Date> freeDays = new ArrayList<Date>(); | |||
| freeDays.add(d1); | |||
| freeDays.add(d2); | |||
| freeDays.add(d3); | |||
| freeDays.add(d4); | |||
| freeDays.add(d5); | |||
| freeDays.add(d6); | |||
| freeDays.add(d7); | |||
| //String dayMoney = getNeedPay(freeDays, 2, new BigDecimal(10), start, end, EnumRentDayPriceCalcute.AVERAGE_DAYS, 30); | |||
| //System.out.println(dayMoney); | |||
| //String monthMoney = getMonthNeedPay(freeDays, 2, new BigDecimal(2000), start, end, EnumContractReceivePeriodUnit.QUARTER.getCode(), 1, EnumRentDayPriceCalcute.AVERAGE_DAYS.getCode(), 30); | |||
| //System.out.println(monthMoney); | |||
| } | |||
| } | |||
| @@ -13,6 +13,7 @@ import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxBillAction; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantBUser; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| @@ -32,10 +33,12 @@ import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxAllBillService; | |||
| import com.iformall.service.WxBillActionService; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxMerchantTradeDailyService; | |||
| import com.iformall.service.WxPayAccountBillService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.service.helper.WxBillAllHelper; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.DateUtils; | |||
| @@ -93,6 +96,9 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| @Lazy | |||
| @Autowired | |||
| WxMerchantService wxMerchantService; | |||
| @Lazy | |||
| @Autowired | |||
| WxShopService wxShopService; | |||
| @Lazy | |||
| @Autowired | |||
| @@ -102,6 +108,10 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| @Autowired | |||
| WxFinanceService wxFinanceService; | |||
| @Lazy | |||
| @Autowired | |||
| WxEnergyService wxEnergyService; | |||
| @Autowired | |||
| WxRentContractMapper wxRentContractMapper; | |||
| @@ -142,11 +152,57 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||
| updateQueryParam(wxBillRent); | |||
| return wxAllBillMapper.getBillMonthSum(wxBillRent); | |||
| } | |||
| @Override | |||
| public List<WxBillSum> getFeesBillSum(WxAllBill wxBillRent) { | |||
| updateQueryParam(wxBillRent); | |||
| return wxAllBillMapper.getFeesBillSum(wxBillRent); | |||
| } | |||
| @Override | |||
| public PageInfo<WxAllBill> listAsPage(WxAllBill record, Integer pageIndex, Integer pageSize) { | |||
| updateQueryParam(record); | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxAllBillMapper.findList(record)); | |||
| PageInfo<WxAllBill> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxAllBillMapper.findList(record)); | |||
| if (null == page) { | |||
| return null; | |||
| } | |||
| if (null != page.getList() && page.getList().size() > 0 ) { | |||
| List<Long> merchantIds = new ArrayList<Long>(); | |||
| for (int i = 0 ; i < page.getList().size() ; i ++) { | |||
| WxAllBill ab = page.getList().get(i); | |||
| merchantIds.add(ab.getMerchantId()); | |||
| } | |||
| Map<Long, String> shopNumberMap = wxShopService.getMerchantShopNumberMap(record, merchantIds, null); | |||
| WxMerchant mq = new WxMerchant(); | |||
| mq.updateTenantInfo(record); | |||
| mq.setIds(merchantIds); | |||
| Map<Long, WxMerchant> merchantMap = wxMerchantService.findMerchantMap(mq); | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size() ; i ++) { | |||
| WxAllBill e = page.getList().get(i); | |||
| if (null != shopNumberMap) { | |||
| e.setShopNumber(shopNumberMap.get(e.getMerchantId())); | |||
| } | |||
| if (null != merchantMap) { | |||
| WxMerchant m = merchantMap.get(e.getMerchantId()); | |||
| if (null != m) { | |||
| e.setMerchantName(m.getName()); | |||
| } | |||
| } | |||
| if (null != feesMap) { | |||
| WxEnergyFees f = feesMap.get(e.getEnergyFeesId()); | |||
| if (null != f) { | |||
| e.setEnergyFeesName(f.getName()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return page; | |||
| } | |||
| @Override | |||
| @@ -4,22 +4,42 @@ package com.iformall.service.impl; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxAllBill; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinancePrintData; | |||
| import com.iformall.domain.po.WxFinancePrintTemplate; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.PrintMerchantSettleVo; | |||
| import com.iformall.domain.vo.PrintVo; | |||
| import com.iformall.enums.EnumFinancePrintDataType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxFinancePrintDataMapper; | |||
| import com.iformall.mapper.WxFinancePrintTemplateMapper; | |||
| import com.iformall.print.data.PrintBillDataHandler; | |||
| import com.iformall.print.data.PrintFinanceReceiveDataHandler; | |||
| import com.iformall.print.data.PrintMerchantSettleDataHandler; | |||
| import com.iformall.service.WxAllBillService; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFinancePrintService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import com.iformall.service.WxMerchantService; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| */ | |||
| @@ -32,6 +52,31 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||
| @Autowired | |||
| WxFinancePrintTemplateMapper wxFinancePrintTemplateMapper; | |||
| @Lazy | |||
| @Autowired | |||
| WxFinanceService wxFinanceService; | |||
| @Lazy | |||
| @Autowired | |||
| WxEnergyService wxEnergyService; | |||
| @Lazy | |||
| @Autowired | |||
| WxAllBillService wxAllBillService; | |||
| @Autowired | |||
| PrintFinanceReceiveDataHandler printFinanceReceiveDataHandler; | |||
| @Autowired | |||
| PrintBillDataHandler printBillDataHandler; | |||
| @Autowired | |||
| PrintMerchantSettleDataHandler printMerchantSettleDataHandler; | |||
| @Lazy | |||
| @Autowired | |||
| WxMerchantService wxMerchantService; | |||
| @Override | |||
| public List<WxFinancePrintData> printDataList(WxFinancePrintData record) { | |||
| return wxFinancePrintDataMapper.findList(record); | |||
| @@ -48,37 +93,67 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxFinancePrintTemplate record) { | |||
| public void save(WxFinancePrintTemplate record) { | |||
| Date date = new Date(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateTime(date); | |||
| record.setUpdateTime(date); | |||
| record.setName(record.getTitle()); | |||
| Map map = new HashMap(); | |||
| map.put("width", 770); | |||
| map.put("height", 500); | |||
| map.put("pageWidth", 215); | |||
| map.put("pageHeight", 140); | |||
| map.put("tempItems", record.getTempItems()); | |||
| map.put("id", String.valueOf(record.getId())); | |||
| map.put("title", record.getName()); | |||
| map.put("type", record.getType()); | |||
| record.setContent(JSON.toJSONString(map)); | |||
| try { | |||
| wxFinancePrintTemplateMapper.insert(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存模板失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public void update(WxFinancePrintTemplate record) { | |||
| WxFinancePrintTemplate t = getTemplateById(record.getId()); | |||
| Map map = new HashMap(); | |||
| if (null == record.getContentJsonUpdate()) { | |||
| map.put("width", 770); | |||
| map.put("height", 500); | |||
| map.put("pageWidth", 215); | |||
| map.put("pageHeight", 140); | |||
| map.put("id", String.valueOf(t.getId())); | |||
| map.put("title", record.getTitle()); | |||
| map.put("type", t.getType()); | |||
| record.setContent(JSON.toJSONString(map)); | |||
| } | |||
| Date date = new Date(); | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateTime(date); | |||
| record.setUpdateTime(date); | |||
| if (null != record.getContentJson()) { | |||
| JSONObject o = record.getContentJson(); | |||
| o.put("type", record.getType()); | |||
| o.put("id", String.valueOf(record.getId())); | |||
| o.put("defaultValue", 0); | |||
| record.setContent(JSON.toJSONString(o)); | |||
| } | |||
| try { | |||
| wxFinancePrintTemplateMapper.insert(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存模板失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } else { | |||
| if (null != record.getContentJson()) { | |||
| JSONObject o = record.getContentJson(); | |||
| o.put("type", record.getType()); | |||
| o.put("id", String.valueOf(record.getId())); | |||
| o.put("defaultValue", 0); | |||
| record.setContent(JSON.toJSONString(o)); | |||
| } | |||
| record.setUpdateTime(date); | |||
| wxFinancePrintTemplateMapper.updateById(record); | |||
| JSONObject o = record.getContentJsonUpdate(); | |||
| o.put("title", record.getTitle()); | |||
| record.setContent(JSON.toJSONString(o)); | |||
| record.setName(record.getTitle()); | |||
| record.setUpdateTime(date); | |||
| wxFinancePrintTemplateMapper.updateById(record); | |||
| } | |||
| @Override | |||
| public void copy(WxFinancePrintTemplate record) { | |||
| WxFinancePrintTemplate t = getTemplateById(record.getId()); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| t.setId(idWorker.nextId()); | |||
| t.setCreateTime(new Date()); | |||
| t.setUpdateTime(new Date()); | |||
| t.setName(t.getName()+"复制"); | |||
| t.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| if (StringUtils.isNotBlank(t.getContent())) { | |||
| t.setContent(t.getContent().replaceAll("uuid", "olduuid")); | |||
| } | |||
| wxFinancePrintTemplateMapper.insert(t); | |||
| } | |||
| @Override | |||
| @@ -87,5 +162,73 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService { | |||
| wxFinancePrintTemplateMapper.updateById(record); | |||
| } | |||
| @Override | |||
| public List<PrintVo> parseTemplateData(String tenantId, Long templateId, List<Long> dataIds,BaseEntity entity) { | |||
| WxFinancePrintTemplate template = this.getTemplateById(templateId); | |||
| if (null == template) { | |||
| return null; | |||
| } | |||
| EnumFinancePrintDataType printDatatype = EnumFinancePrintDataType.getEnum(template.getType()); | |||
| WxMerchant mq = new WxMerchant(); | |||
| mq.setTenantId(tenantId); | |||
| Map<Long,WxMerchant> merchantMap = wxMerchantService.findMerchantMap(mq); | |||
| WxEnergyFees feq = new WxEnergyFees(); | |||
| feq.setTenantId(tenantId); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(feq); | |||
| //付款单 | |||
| if (printDatatype.getCode().intValue() == EnumFinancePrintDataType.FINANCE_RECEIVE.getCode()) { | |||
| WxFinanceReceive receiveq = new WxFinanceReceive(); | |||
| receiveq.setTenantId(tenantId); | |||
| receiveq.setIds(dataIds); | |||
| List<WxFinanceReceive> receiveList = wxFinanceService.findReceiveList(receiveq); | |||
| if (null == receiveList || receiveList.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| List<PrintVo> voList = new ArrayList<PrintVo>(); | |||
| for (int i = 0 ; i < receiveList.size(); i ++) { | |||
| WxFinanceReceive re = receiveList.get(i); | |||
| PrintVo vo = new PrintVo(); | |||
| vo.setDataId(templateId); | |||
| vo.setTemplate(printFinanceReceiveDataHandler.parse(template.getContent(), re,merchantMap,feesMap)); | |||
| voList.add(vo); | |||
| } | |||
| return voList; | |||
| }else if (printDatatype.getCode().intValue() == EnumFinancePrintDataType.BILL.getCode()) { | |||
| WxAllBill bq = new WxAllBill(); | |||
| bq.setTenantId(tenantId); | |||
| bq.setIds(dataIds); | |||
| List<WxAllBill> billAllList = wxAllBillService.list(bq); | |||
| if (null == billAllList || billAllList.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| List<PrintVo> voList = new ArrayList<PrintVo>(); | |||
| for (int i = 0 ; i < billAllList.size(); i ++) { | |||
| WxAllBill re = billAllList.get(i); | |||
| PrintVo vo = new PrintVo(); | |||
| vo.setDataId(templateId); | |||
| vo.setTemplate(printBillDataHandler.parse(template.getContent(), re,merchantMap,feesMap)); | |||
| voList.add(vo); | |||
| } | |||
| return voList; | |||
| }else if (printDatatype.getCode().intValue() == EnumFinancePrintDataType.RENT_OWE.getCode()) { | |||
| WxMerchant bq = (WxMerchant) entity; | |||
| List<WxMerchant> merchantList = wxMerchantService.findList(bq); | |||
| if (null == merchantList || merchantList.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| WxMerchant m = merchantList.get(0); | |||
| List<PrintVo> voList = new ArrayList<PrintVo>(); | |||
| //TODO 获取结算单信息 | |||
| PrintMerchantSettleVo sv = null; | |||
| PrintVo vo = new PrintVo(); | |||
| vo.setDataId(templateId); | |||
| vo.setTemplate(printMerchantSettleDataHandler.parse(template.getContent(), sv,merchantMap,feesMap)); | |||
| voList.add(vo); | |||
| return voList; | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -28,10 +28,12 @@ import com.iformall.domain.po.base.BaseEntity.SortField; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | |||
| import com.iformall.domain.vo.FinanceSetOffDetailVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveSumVo; | |||
| import com.iformall.domain.vo.WxFinanceReceiveVo; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.enums.EnumFinanceCashierType; | |||
| import com.iformall.enums.EnumFinanceFinishStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| @@ -488,6 +490,12 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| return pageVo; | |||
| } | |||
| @Override | |||
| public List<WxFinanceReceive> findReceiveList(WxFinanceReceive record) { | |||
| initQueryParam(record); | |||
| return wxFinanceReceiveMapper.findList(record); | |||
| } | |||
| private void sortBills(List<WxAllBill> billList) { | |||
| Collections.sort(billList, new Comparator<WxAllBill>() { | |||
| @Override | |||
| @@ -521,6 +529,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long receiveId = idWorker.nextId(); | |||
| List<WxFinanceReceivePayway> receivePayWayList = new ArrayList<WxFinanceReceivePayway>(); | |||
| StringBuffer moneyDetail = new StringBuffer(); | |||
| if (null != record.getPayWays()) { | |||
| for (int i = 0 ; i < record.getPayWays().size() ; i ++) { | |||
| WxBillPayWay payWay = record.getPayWays().get(i); | |||
| @@ -541,6 +550,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| rpw.setUpdateTime(new Date()); | |||
| rpw.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| receivePayWayList.add(rpw); | |||
| moneyDetail.append(payWay.getName()).append(":").append(payWay.getMoney()).append("元"); | |||
| } | |||
| } | |||
| } | |||
| @@ -552,7 +562,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| //创建主收款单 | |||
| WxFinanceReceive addreceive = generateReceive(receiveId,user, EnumFinanceCashierType.RECEIVE,EnumFinanceReceiveType.RECEIVE, receiveTotal.toPlainString(),null, record.getMerchantId(), null, record.getRemark()); | |||
| if (receiveTotal.compareTo(new BigDecimal(0)) > 0) { | |||
| addreceive.setMoneyDetail(JSON.toJSONString(record.getPayWays())); | |||
| addreceive.setMoneyDetail(moneyDetail.toString()); | |||
| wxFinanceReceivePaywayMapper.insertPayWays(record.getTenantId(),receivePayWayList); | |||
| } | |||
| WxMerchant merchant = new WxMerchant(); | |||
| @@ -725,6 +735,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| Long receiveId = idWorker.nextId(); | |||
| List<WxFinanceReceivePayway> receivePayWayList = new ArrayList<WxFinanceReceivePayway>(); | |||
| StringBuffer moneyDetail = new StringBuffer(); | |||
| if (null != record.getPayWays()) { | |||
| for (int i = 0 ; i < record.getPayWays().size() ; i ++) { | |||
| WxBillPayWay payWay = record.getPayWays().get(i); | |||
| @@ -744,6 +755,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| rpw.setUpdateTime(new Date()); | |||
| rpw.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| receivePayWayList.add(rpw); | |||
| moneyDetail.append(payWay.getName()).append(":").append(payWay.getMoney()).append("元"); | |||
| } | |||
| } | |||
| List<WxAllBill> bills = record.getBills(); | |||
| @@ -969,11 +981,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| wxFinanceReceiveMapper.insert(record); | |||
| } | |||
| @Override | |||
| public void finishReceive(WxFinanceReceive record, MallUserInfo user) { | |||
| wxFinanceReceiveMapper.finish(record); | |||
| } | |||
| @Override | |||
| public PageInfo<WxFinanceReceiveSetoff> receiveSetoffListAsPage(WxFinanceReceive record, Integer pageIndex, | |||
| Integer pageSize) { | |||
| @@ -1004,5 +1011,110 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| return page; | |||
| } | |||
| @Override | |||
| public WxFinanceFinish getFinishById(TenantEntity tenantEntity, Long id) { | |||
| return wxFinanceFinishMapper.selectById(id, tenantEntity.getTenantId()); | |||
| } | |||
| @Override | |||
| public void saveOrUpdateFinish(WxFinanceFinish record,MallUserInfo user) { | |||
| Date date = new Date(); | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateTime(date); | |||
| record.setCreateBy(user.getId()); | |||
| record.setCreateByName(user.getName()); | |||
| record.setUpdateTime(date); | |||
| record.setUpdateBy(user.getId()); | |||
| record.setUpdateByName(user.getName()); | |||
| record.setStatus(EnumFinanceFinishStatus.READY.getCode()); | |||
| try { | |||
| wxFinanceFinishMapper.insert(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } else { | |||
| record.setUpdateTime(date); | |||
| record.setUpdateBy(user.getId()); | |||
| record.setUpdateByName(user.getName()); | |||
| wxFinanceFinishMapper.updateById(record); | |||
| } | |||
| } | |||
| @Override | |||
| public WxFinanceReceiveSumVo getReceiveSum(WxFinanceReceive record) { | |||
| initQueryParam(record); | |||
| WxFinanceReceiveSumVo vo = wxFinanceReceiveMapper.getReceiveSum(record); | |||
| if (null != vo ) { | |||
| List<WxFinanceReceivePayway> pays = wxFinanceReceiveMapper.getReceivePayWaySum(record); | |||
| if (null != pays) { | |||
| WxBillPayWay pq = new WxBillPayWay(); | |||
| pq.updateTenantInfo(record); | |||
| Map<Long,WxBillPayWay> paywayMap = this.getPayWayMap(pq); | |||
| for (int i = 0 ; i < pays.size() ; i ++) { | |||
| WxFinanceReceivePayway rpw = pays.get(i); | |||
| if (null != paywayMap && null != rpw.getPayWay()) { | |||
| WxBillPayWay pw = paywayMap.get(rpw.getPayWay()); | |||
| if (null != pw) { | |||
| rpw.setPayWayName(pw.getName()); | |||
| } | |||
| } | |||
| } | |||
| vo.setPayWays(pays); | |||
| } | |||
| } | |||
| return vo; | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| @Override | |||
| public void finishReceive(WxFinanceFinish record, MallUserInfo user) { | |||
| WxFinanceFinish finish = this.getFinishById(record, record.getId()); | |||
| //更新批次, | |||
| WxFinanceFinish ff = new WxFinanceFinish(); | |||
| ff.updateTenantInfo(record); | |||
| ff.setId(finish.getId()); | |||
| ff.setStatus(EnumFinanceFinishStatus.COMPLETE.getCode()); | |||
| ff.setUpdateTime(new Date()); | |||
| ff.setUpdateBy(user.getId()); | |||
| ff.setUpdateByName(user.getName()); | |||
| wxFinanceFinishMapper.updateById(ff); | |||
| //更新收付款记录 | |||
| WxFinanceReceive fr = new WxFinanceReceive(); | |||
| fr.updateTenantInfo(record); | |||
| fr.setCreateTimeBegin(finish.getStartDate()); | |||
| fr.setCreateTimeEnd(finish.getEndDate()); | |||
| fr.setFinishStatus(EnumYesOrNo.YES.getCode()); | |||
| fr.setIsFinish(EnumYesOrNo.NO.getCode()); | |||
| wxFinanceReceiveMapper.finish(fr); | |||
| } | |||
| @Override | |||
| public Integer getReceiveUnFinisedCount(WxFinanceReceive record) { | |||
| return null; | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| @Override | |||
| public void batchFinishReceive(WxFinanceFinish record, MallUserInfo user,boolean isAll) { | |||
| //更新收付款记录 | |||
| WxFinanceReceive fr = new WxFinanceReceive(); | |||
| fr.updateTenantInfo(record); | |||
| fr.setIds(record.getReceiveIds()); | |||
| wxFinanceReceiveMapper.finish(fr); | |||
| //如果主 | |||
| if (isAll) { | |||
| WxFinanceFinish ff = new WxFinanceFinish(); | |||
| ff.updateTenantInfo(record); | |||
| ff.setId(record.getId()); | |||
| ff.setStatus(EnumFinanceFinishStatus.COMPLETE.getCode()); | |||
| ff.setUpdateTime(new Date()); | |||
| ff.setUpdateBy(user.getId()); | |||
| ff.setUpdateByName(user.getName()); | |||
| wxFinanceFinishMapper.updateById(ff); | |||
| } | |||
| } | |||
| } | |||
| @@ -257,11 +257,13 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| wxBillRent.setPropertyContractId(id); | |||
| wxBillRent.setSortColumns("starttime asc"); | |||
| wxBillRent.updateTenantInfo(tenantEntity); | |||
| //一次性的和非一次性的都有这个属性,过滤掉,就是物业主账单 | |||
| wxBillRent.setHasFeesStardarsId(EnumYesOrNo.NO.getCode()); | |||
| //物业主账单 | |||
| wxBillRent.setEnergyFeesId(EnumBillAllType.PROPERTY.getEnergyFeesId()); | |||
| List<WxAllBill> retList = wxAllBillMapper.findList(wxBillRent); | |||
| //非一次性的有这个属性 | |||
| wxBillRent.setHasFeesStardarsId(EnumYesOrNo.YES.getCode()); | |||
| //获取非一次性的, | |||
| wxBillRent.setEnergyFeesId(null); | |||
| wxBillRent.setBillType(EnumBillAllType.PROPERTY.getCode()); | |||
| wxBillRent.setHasParentBillId(EnumYesOrNo.YES.getCode()); | |||
| List<WxAllBill> unFixedList = wxAllBillMapper.findList(wxBillRent); | |||
| Map<Long,List<WxAllBill>> childMap = null; | |||
| @@ -275,6 +277,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| childList = new ArrayList<WxAllBill>(); | |||
| childMap.put(ub.getParentBillId(), childList); | |||
| } | |||
| ub.setFeesStandarsId(ub.getEnergyFeesId()); | |||
| childList.add(ub); | |||
| } | |||
| } | |||
| @@ -425,7 +428,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| //重新生成 | |||
| record.setRentalStartDate(wxPropertyContract.getRentalStartDate()); | |||
| record.setRentalEndDate(wxPropertyContract.getRentalEndDate()); | |||
| record.setRentStartType(wxPropertyContract.getRentStartType()); | |||
| //切换的时候需要用传过来的类型 | |||
| if (null == record.getRentStartType()) { | |||
| record.setRentStartType(wxPropertyContract.getRentStartType()); | |||
| } | |||
| record.setStartDate(wxPropertyContract.getStartDate()); | |||
| record.setEndDate(wxPropertyContract.getEndDate()); | |||
| record.setAdjustPeriod(wxPropertyContract.getAdjustPeriod()); | |||
| @@ -622,20 +628,32 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { | |||
| BigDecimal priceD = new BigDecimal(price); | |||
| for (int i = 1; i < size; i++) { | |||
| priceD = priceD.add(priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(100))); | |||
| priceArr[i] = priceD.setScale(wxPropertyContract.getDecimalSize(), RoundingMode.HALF_EVEN).toPlainString(); | |||
| priceD = priceD.add(priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000))); | |||
| priceArr[i] = priceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_EVEN).toPlainString(); | |||
| } | |||
| } else if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) { | |||
| BigDecimal priceD = new BigDecimal(price); | |||
| for (int i = 1; i < size; i++) { | |||
| priceD = priceD.add(new BigDecimal(integers.get(i))); | |||
| priceArr[i] = priceD.setScale(wxPropertyContract.getDecimalSize(), RoundingMode.HALF_EVEN).toPlainString(); | |||
| priceD = priceD.add(new BigDecimal(integers.get(i)).divide(new BigDecimal(100))); | |||
| priceArr[i] = priceD.setScale(Constant.default_long_decimal_size, RoundingMode.HALF_EVEN).toPlainString(); | |||
| } | |||
| } else { | |||
| for (int i = 1; i < size; i++) { | |||
| priceArr[i] = new BigDecimal(integers.get(i)).setScale(wxPropertyContract.getDecimalSize(), RoundingMode.HALF_EVEN).toPlainString(); | |||
| }else if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.CUSTOM.getCode())){ | |||
| for (int i = 1; i < size; i++) { | |||
| priceArr[i] = new BigDecimal(integers.get(i)).divide(new BigDecimal(100)).setScale(Constant.default_long_decimal_size, RoundingMode.HALF_UP).toPlainString(); | |||
| } | |||
| }else { | |||
| for (int i = 1; i < size; i++) { | |||
| priceArr[i] = price; | |||
| } | |||
| } | |||
| //物业没有4 | |||
| // }else if (wxPropertyContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.FIX_RATIO.getCode())){ | |||
| // BigDecimal priceD = new BigDecimal(price); | |||
| // for (int i = 1; i < size; i++) { | |||
| // priceArr[i] = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(100)).toPlainString(); | |||
| // } | |||
| // } | |||
| int month = 12; | |||
| int divide = lease / month; | |||
| @@ -655,20 +673,20 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| for (int i = 0; i < size; i++) { | |||
| Calendar instance = Calendar.getInstance(); | |||
| Date startDate; | |||
| //自然月 | |||
| if(wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| if(i == 0){ //第一期 | |||
| startDate = rentalStartDate; | |||
| }else{ | |||
| instance.setTime(rentalStartDate); | |||
| instance.add(Calendar.MONTH, month * i); | |||
| startDate = DateUtils.getFirstDayForCurrMonth(instance.getTime()); | |||
| } | |||
| }else{ | |||
| // //自然月 | |||
| // if(wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| // if(i == 0){ //第一期 | |||
| // startDate = rentalStartDate; | |||
| // }else{ | |||
| // instance.setTime(rentalStartDate); | |||
| // instance.add(Calendar.MONTH, month * i); | |||
| // startDate = DateUtils.getFirstDayForCurrMonth(instance.getTime()); | |||
| // } | |||
| // }else{ | |||
| instance.setTime(rentalStartDate); | |||
| instance.add(Calendar.MONTH, month * i); | |||
| startDate = instance.getTime(); | |||
| } | |||
| // } | |||
| yearList.add(startDate); | |||
| } | |||
| Map<String, Object> resultMap = buildRent(receivePeriod, priceArr, yearList, wxPropertyContract.getReceivePeriodUnit(), wxPropertyContract, user, wxMerchant, billcount, isPreview, shopInfo,saveDb); | |||
| @@ -691,7 +709,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| List<BillTimeVo> billTimeVoList = new ArrayList<>(); | |||
| if(saveDb){ | |||
| billTimeVoList = WxRentContractServiceImpl.initBillTimeList(wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate(),wxPropertyContract.getAdjustPeriod(),dayType,receivePeriod); | |||
| billTimeVoList = WxRentContractServiceImpl.initBillTimeList(yearList,wxPropertyContract.getRentalStartDate(),wxPropertyContract.getRentalEndDate(),wxPropertyContract.getAdjustPeriod(),dayType,receivePeriod); | |||
| }else{ | |||
| //预账单编辑账期,生成金额 | |||
| for (WxAllBill rent:wxPropertyContract.getPreviewBillRentList()) { | |||
| @@ -703,15 +721,24 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| } | |||
| } | |||
| //结算其他金额 | |||
| Date billStartDate = null; | |||
| Date billEndDate = null; | |||
| if (billTimeVoList.size() > 0 ) { | |||
| billStartDate = billTimeVoList.get(0).getStartDate(); | |||
| billEndDate = billTimeVoList.get(billTimeVoList.size()-1).getEndDate(); | |||
| Date firstBillStartDate = null; | |||
| Date firstBillEndDate = null; | |||
| if (null != billTimeVoList && billTimeVoList.size() > 0 ) { | |||
| BillTimeVo firstBillTime = billTimeVoList.get(0); | |||
| WxPropertyContract cupdate = new WxPropertyContract(); | |||
| cupdate.updateTenantInfo(wxPropertyContract); | |||
| cupdate.setId(wxPropertyContract.getId()); | |||
| cupdate.setFirstBillDateStart(firstBillTime.getStartDate()); | |||
| cupdate.setFirstBillDateEnd(firstBillTime.getEndDate()); | |||
| cupdate.setDecimalSize(null);//去掉默认的,避免更新 | |||
| wxPropertyContractMapper.updateById(cupdate); | |||
| firstBillStartDate = firstBillTime.getStartDate(); | |||
| firstBillEndDate = firstBillTime.getEndDate(); | |||
| } | |||
| //结算其他金额 | |||
| //一次性费用的,只有一个账单。 | |||
| List<WxBillFeesStandardsListVo> fixedList = WxRentContractHelper.getStandardsBillList(wxPropertyContract.getDecimalSize(),wxPropertyContract.getFeesStardarsList(),billStartDate,billEndDate,true,wxPropertyContract.getRentArea()); | |||
| List<WxBillFeesStandardsListVo> fixedList = WxRentContractHelper.getStandardsBillList(wxPropertyContract.getDecimalSize(),wxPropertyContract.getFeesStardarsList(),firstBillStartDate,firstBillEndDate,true,wxPropertyContract.getRentArea()); | |||
| int index = 0; | |||
| @@ -744,7 +771,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| standarsTotal = calcuteStandardsFee(unFixedList, billTimeVo.getStartDate(), endDate, wxPropertyContract); | |||
| }else{ | |||
| if(billTimeVo.getStartDate().before(endDate)){ | |||
| needpayFront = getNeedPayMoney(wxPropertyContract, priceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate,Calendar.DATE,-1), i, billTimeVoList.size(), saveDb,dayType,receivePeriod); | |||
| needpayFront = getNeedPayMoney(wxPropertyContract, priceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate,Calendar.SECOND,-1), i, billTimeVoList.size(), saveDb,dayType,receivePeriod); | |||
| needpayAfter = getNeedPayMoney(wxPropertyContract, priceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb,dayType,receivePeriod); | |||
| }else{ | |||
| needpayFront = getNeedPayMoney(wxPropertyContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb,dayType,receivePeriod); | |||
| @@ -826,6 +853,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| private WxAllBill generateBillProperty(WxPayAccountBill wxPayAccountBill,WxPropertyContract wxPropertyContract,Integer isPreview,Date start,Date end,Date receiveDate,String needpay, | |||
| MallUserInfo user,Integer billcount,Map<String, Object> shopInfo,String standarsTotal,String remark,Long parentBillId,Long feesStandardsId) { | |||
| if (StringUtils.isBlank(needpay)) { | |||
| needpay = "0"; | |||
| }else { | |||
| needpay = new BigDecimal(needpay).setScale(wxPropertyContract.getDecimalSize(),BigDecimal.ROUND_HALF_UP).toPlainString(); | |||
| } | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| WxAllBill wxBillProperty = new WxAllBill(); | |||
| wxBillProperty.setIsPreview(isPreview); | |||
| @@ -884,11 +916,14 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| WxBillFeesStandardsListVo bfsvo = unFixedList.get(j); | |||
| WxEnergyFees feeStandars = bfsvo.getFeeStandards(); | |||
| if(EnumFeesStandardsCalcuteUnit.MM.getCode().intValue() == feeStandars.getCalcuteUnit().intValue()) { | |||
| bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,wxPropertyContract.getRentArea(),false,dayPrice,wxPropertyContract.getMonthAverageDays())); | |||
| bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,wxPropertyContract.getRentArea(),false,dayPrice, | |||
| wxPropertyContract.getMonthAverageDays(),EnumContractReceivePeriodUnit.getEnum(wxPropertyContract.getReceivePeriodUnit()),wxPropertyContract.getReceivePeriod())); | |||
| }else if (EnumFeesStandardsCalcuteUnit.HU.getCode().intValue() == feeStandars.getCalcuteUnit().intValue()) { | |||
| bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1",false,dayPrice,wxPropertyContract.getMonthAverageDays())); | |||
| bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1",false,dayPrice,wxPropertyContract.getMonthAverageDays(), | |||
| EnumContractReceivePeriodUnit.getEnum(wxPropertyContract.getReceivePeriodUnit()),wxPropertyContract.getReceivePeriod())); | |||
| }else { | |||
| bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1",false,dayPrice,wxPropertyContract.getMonthAverageDays())); | |||
| bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1",false,dayPrice,wxPropertyContract.getMonthAverageDays(), | |||
| EnumContractReceivePeriodUnit.getEnum(wxPropertyContract.getReceivePeriodUnit()),wxPropertyContract.getReceivePeriod())); | |||
| } | |||
| bfsvo.setStart(start); | |||
| bfsvo.setEnd(end); | |||
| @@ -921,47 +956,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); | |||
| return needpay; | |||
| } | |||
| SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | |||
| SimpleDateFormat sdD = new SimpleDateFormat("d"); | |||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||
| SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); | |||
| if(i == billTimeVoListSize - 1){//最后 | |||
| if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getEndDate())) ){ | |||
| int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | |||
| months++; | |||
| needpay = new BigDecimal(months).multiply(priceD).toPlainString(); | |||
| }else { | |||
| needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); | |||
| } | |||
| }else if(i == 0){//第一期 | |||
| if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| if(isFirstDay(startDate)){ | |||
| int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | |||
| months++; | |||
| needpay = new BigDecimal(months).multiply(priceD).toPlainString(); | |||
| }else{ | |||
| needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); | |||
| } | |||
| }else{ | |||
| if(isFirstDay(startDate)){ | |||
| int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | |||
| if(isFirstDay(startDate)){ | |||
| months++; | |||
| } | |||
| needpay = new BigDecimal(months).multiply(priceD).toPlainString(); | |||
| }else{ | |||
| needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); | |||
| } | |||
| } | |||
| }else{//中间 | |||
| int months = WxRentContractHelper.getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | |||
| if(isFirstDay(startDate)){ | |||
| months++; | |||
| } | |||
| needpay = new BigDecimal(months).multiply(priceD).toPlainString(); | |||
| } | |||
| needpay = WxRentContractHelper.getMonthNeedPay(null,wxRentContract.getDecimalSize(),priceD, startDate, endDate,dayType,receivePeriod,wxRentContract.getDayPriceCalcute(),wxRentContract.getMonthAverageDays()); | |||
| } | |||
| return needpay; | |||
| } | |||
| @@ -677,13 +677,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| if (StringUtils.isBlank(revenue)) { | |||
| revenue = "0"; | |||
| } | |||
| record.setPrice(new BigDecimal(record.getPayRatio()).multiply(new BigDecimal(revenue)).setScale(Constant.default_long_decimal_size,RoundingMode.HALF_UP).toPlainString()); | |||
| record.setPrice(new BigDecimal(record.getPayRatio()).multiply(new BigDecimal(revenue)).divide(new BigDecimal(100),Constant.default_long_decimal_size,RoundingMode.HALF_UP).toPlainString()); | |||
| }else if (record.getType().equals(EnumRentContractType.RENT_BY_AREA_AND_JOINT.getCode())) { | |||
| String revenue = record.getRevenue(); | |||
| if (StringUtils.isBlank(revenue)) { | |||
| revenue = "0"; | |||
| } | |||
| BigDecimal renevuePrice = new BigDecimal(record.getPayRatio()).multiply(new BigDecimal(revenue)); | |||
| BigDecimal rentPrice = null; | |||
| //联营取高,如果是固定金额的话,取固定金额. 不固定的金额,会传price. | |||
| if (null != record.getRevenueFixedRentPrice() && record.getRevenueFixedRentPrice().intValue() == EnumYesOrNo.YES.getCode()){ | |||
| @@ -691,11 +686,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| }else { | |||
| rentPrice = new BigDecimal(record.getPrice()); | |||
| } | |||
| if (renevuePrice.compareTo(rentPrice) > 0 ) { | |||
| record.setPrice(renevuePrice.toPlainString()); | |||
| }else { | |||
| record.setPrice(rentPrice.toPlainString()); | |||
| } | |||
| record.setPrice(rentPrice.toPlainString()); | |||
| } | |||
| } | |||
| } | |||
| @@ -763,12 +754,14 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| List<WxRentContractRevenueJump> jlist = new ArrayList<WxRentContractRevenueJump>(); | |||
| for (int i = 0 ; i < record.getRevenueJumps().size(); i++) { | |||
| WxRentContractRevenueJump jp = record.getRevenueJumps().get(i); | |||
| jp.updateTenantInfo(record); | |||
| jp.setId(idWorker.nextId()); | |||
| jp.setRentContractId(record.getId()); | |||
| jp.setCreateTime(new Date()); | |||
| jp.setUpdateTime(new Date()); | |||
| jlist.add(jp); | |||
| if (StringUtils.isNotBlank(jp.getMinMoney())) { | |||
| jp.updateTenantInfo(record); | |||
| jp.setId(idWorker.nextId()); | |||
| jp.setRentContractId(record.getId()); | |||
| jp.setCreateTime(new Date()); | |||
| jp.setUpdateTime(new Date()); | |||
| jlist.add(jp); | |||
| } | |||
| } | |||
| if (jlist.size() > 0 ) { | |||
| wxRentContractRevenueJumpMapper.inertJumps(record.getTenantId(), jlist); | |||
| @@ -819,12 +812,13 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxBillDeposit.setPriceDetail("合同押金项["+fees.getName()+"]"+depositFee.getPrice()+"元"+"/"+fees.getCalcuteUnitName()); | |||
| } | |||
| wxBillDeposit.setPay("0"); | |||
| //String needpay = wxRentContract.getDeposit(); | |||
| String count = "1"; | |||
| if (null != depositFee.getCalcuteUnit() && depositFee.getCalcuteUnit().intValue() == EnumFeesStandardsCalcuteUnit.MM.getCode().intValue()) { | |||
| count = wxRentContract.getRentArea(); | |||
| } | |||
| String needpay = depositFee.calcuteTotalMoney(wxRentContract.getDecimalSize(), null, null, count, true, null, null); | |||
| String needpay = depositFee.getPrice(); | |||
| // String count = "1"; | |||
| // if (null != depositFee.getCalcuteUnit() && depositFee.getCalcuteUnit().intValue() == EnumFeesStandardsCalcuteUnit.MM.getCode().intValue()) { | |||
| // count = wxRentContract.getRentArea(); | |||
| // } | |||
| // String needpay = depositFee.calcuteTotalMoney(wxRentContract.getDecimalSize(), null, null, count, true, null, null); | |||
| wxBillDeposit.setReceivePay(needpay); | |||
| wxBillDeposit.setNeedPay(needpay); | |||
| //wxBillDeposit.setOwe(needpay); | |||
| @@ -832,22 +826,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; | |||
| Date date = new Date(); | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(wxRentContract.getRentalStartDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| //wxBillDeposit.setReceiveDate(time); | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(time); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillDeposit.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(time); | |||
| instance.add(dayType, wxRentContract.getLease()); | |||
| wxBillDeposit.setEndtime(instance.getTime()); | |||
| wxBillDeposit.setStarttime(wxRentContract.getFirstBillDateStart()); | |||
| wxBillDeposit.setEndtime(wxRentContract.getFirstBillDateEnd()); | |||
| wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode()); | |||
| //wxBillDeposit.setExpiredDay(0L); | |||
| //wxBillDeposit.setReceiveDate(time); | |||
| @@ -1049,20 +1030,20 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| for (int i = 0; i < years; i++) { | |||
| Calendar instance = Calendar.getInstance(); | |||
| Date startDate; | |||
| //自然月 | |||
| if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| if(i == 0){ //第一期 | |||
| startDate = rentalStartDate; | |||
| }else{ | |||
| instance.setTime(rentalStartDate); | |||
| instance.add(Calendar.MONTH, month * i); | |||
| startDate = DateUtils.getFirstDayForCurrMonth(instance.getTime()); | |||
| } | |||
| }else{ | |||
| // //自然月 | |||
| // if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| // if(i == 0){ //第一期 | |||
| // startDate = rentalStartDate; | |||
| // }else{ | |||
| // instance.setTime(rentalStartDate); | |||
| // instance.add(Calendar.MONTH, month * i); | |||
| // startDate = DateUtils.getFirstDayForCurrMonth(instance.getTime()); | |||
| // } | |||
| // }else{ | |||
| instance.setTime(rentalStartDate); | |||
| instance.add(Calendar.MONTH, month * i); | |||
| startDate = instance.getTime(); | |||
| } | |||
| // } | |||
| yearList.add(startDate); | |||
| } | |||
| @@ -1216,7 +1197,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| WxRentContractFreePeriod fp = freePeriods.get(i); | |||
| List<Date> dates = DateUtils.getAllDays(fp.getStartDate(), fp.getEndDate()); | |||
| if (null != dates && dates.size() > 0 ) { | |||
| allDate.retainAll(dates); | |||
| allDate.removeAll(dates); | |||
| allDate.addAll(dates); | |||
| } | |||
| } | |||
| @@ -1241,7 +1222,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| List<BillTimeVo> billTimeVoList = new ArrayList<>(); | |||
| if(saveDb){ | |||
| billTimeVoList = initBillTimeList(wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate(),wxRentContract.getAdjustPeriod(),dayType,receivePeriod); | |||
| billTimeVoList = initBillTimeList(yearList,wxRentContract.getRentalStartDate(),wxRentContract.getRentalEndDate(),wxRentContract.getAdjustPeriod(),dayType,receivePeriod); | |||
| }else{ | |||
| //预账单编辑账期,生成金额 | |||
| for (WxAllBill rent:wxRentContract.getPreviewBillRentList()) { | |||
| @@ -1252,6 +1233,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| billTimeVoList.add(billTimeVo); | |||
| } | |||
| } | |||
| if (null != billTimeVoList && billTimeVoList.size() > 0 ) { | |||
| BillTimeVo firstBillTime = billTimeVoList.get(0); | |||
| WxRentContract cupdate = new WxRentContract(); | |||
| cupdate.updateTenantInfo(wxRentContract); | |||
| cupdate.setId(wxRentContract.getId()); | |||
| cupdate.setFirstBillDateStart(firstBillTime.getStartDate()); | |||
| cupdate.setFirstBillDateEnd(firstBillTime.getEndDate()); | |||
| cupdate.setDecimalSize(null);//去掉默认的,避免更新 | |||
| wxRentContractMapper.updateById(cupdate); | |||
| } | |||
| //免租期 | |||
| List<Date> freePeriods = getFreeDays(wxRentContract); | |||
| @@ -1298,6 +1290,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| operatingManageFeeNeedpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract,operationManagerPriceArrs[index-1],billTimeVo.getStartDate(),endDate,i,billTimeVoList.size(),saveDb,dayType,receivePeriod); | |||
| } | |||
| }else{ | |||
| //这一年到期和下一年开始的期间,从这一年到期时间分开来进行计算。因为涉及到年租金调整等 TODO 如何把这两块单独生成账单 | |||
| if(billTimeVo.getStartDate().before(endDate)){ | |||
| if (EnumRentContractType.RENT_BY_JOINT.getCode().equals(wxRentContract.getType()) && EnumMissTimeType.PERIOD.getCode().equals(0)) { | |||
| //设置跳点率为年周期 price不变 | |||
| @@ -1309,17 +1302,26 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| operatingManageFeeNeedpayFront = operationManagerPriceArrs[index - 1]; | |||
| } | |||
| }else { | |||
| needpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, priceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.DATE, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| needpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, priceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.SECOND, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| needpayAfter = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, priceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| if (null != bussinessManagerPriceArrs && bussinessManagerPriceArrs.length > 0) { | |||
| bussinessManageFeeNeedpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, bussinessManagerPriceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.DATE, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| bussinessManageFeeNeedpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, bussinessManagerPriceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.SECOND, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| bussinessManageFeeNeedpayAfter = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, bussinessManagerPriceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| } | |||
| if (null != operationManagerPriceArrs && operationManagerPriceArrs.length > 0) { | |||
| operatingManageFeeNeedpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, operationManagerPriceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.DATE, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| operatingManageFeeNeedpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, operationManagerPriceArrs[index - 1], billTimeVo.getStartDate(), DateUtils.getDaySet(endDate, Calendar.SECOND, -1), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| operatingManageFeeNeedpayAfter = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, operationManagerPriceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb, dayType, receivePeriod); | |||
| } | |||
| } | |||
| //下一年的第一天 | |||
| }else if (billTimeVo.getStartDate().equals(endDate)) { | |||
| needpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb,dayType,receivePeriod); | |||
| if (null != bussinessManagerPriceArrs && bussinessManagerPriceArrs.length > 0) { | |||
| bussinessManageFeeNeedpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, bussinessManagerPriceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb,dayType,receivePeriod); | |||
| } | |||
| if (null != operationManagerPriceArrs && operationManagerPriceArrs.length > 0) { | |||
| operatingManageFeeNeedpayFront = WxRentContractHelper.getNeedPayMoney(freePeriods,wxRentContract, operationManagerPriceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb,dayType,receivePeriod); | |||
| } | |||
| }else{ | |||
| //如果是按自然月,则这一年和下一年交叉部分需要重新计算 | |||
| if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())) { | |||
| @@ -1390,6 +1392,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| wxBillRent.setNeedPay(needpay); | |||
| //wxBillRent.setOwe(needpay); | |||
| wxBillRent.setReceivePay(needpay); | |||
| logger.debug(">>>>"+DateUtils.date2String(billTimeVo.getStartDate())+">>>>"+DateUtils.date2String(billTimeVo.getEndDate())+">>>>"+needpay); | |||
| //商业管理费 | |||
| wxBillRent.setBussinessManageFeeNeedPay(bussinessManageFeeNeedpay); | |||
| //运营管理费 | |||
| @@ -1871,11 +1874,16 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| // return wxRentContractMapper.getShopType(wxRentContract); | |||
| // } | |||
| public static List<BillTimeVo> initBillTimeList(Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){ | |||
| //yearList,每年的合同截止日期,到这个截止日之前之后,需要拆开时间 | |||
| public static List<BillTimeVo> initBillTimeList(List<Date> yearList,Date start,Date end,Integer adjustPeriod,Integer dayType,int receivePeriod){ | |||
| List<BillTimeVo> list = new ArrayList<>(); | |||
| int count = 0; | |||
| while (true){ | |||
| List<Date> yearsEndList = new ArrayList<Date>(); | |||
| yearsEndList.addAll(yearList); | |||
| if (yearsEndList.size() > 0) { | |||
| yearsEndList.remove(0); | |||
| } | |||
| while (true) { | |||
| BillTimeVo timeVo = new BillTimeVo(); | |||
| //开始时间 | |||
| @@ -1897,25 +1905,35 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //instance.add(Calendar.DATE, -1); | |||
| timeVo.setEndDate(instance.getTime()); | |||
| //自然月 | |||
| //自然月,应该是从本月开始到本月结束 | |||
| if(adjustPeriod.equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| if(count == 0){ | |||
| timeVo.setEndDate(EnumContractReceivePeriodUnit.getAfterCalendarNarDay(timeVo.getStartDate(), receivePeriod, dayType)); | |||
| /** | |||
| if(receivePeriod == 1) { //周期1个月 头一个月到当月底 头一个月或者头一个季度 | |||
| timeVo.setEndDate(DateUtils.getLastDayForMonth(timeVo.getStartDate())); | |||
| }else{ | |||
| Date firstDay = DateUtils.getFirstDayForCurrMonth(start); | |||
| instance.clear(); | |||
| instance.setTime(firstDay); | |||
| //最后一个期有余,加上残月,不整除时,最后一个月有余,否则为0 | |||
| instance.add(dayType, receivePeriod); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| timeVo.setEndDate(instance.getTime()); | |||
| }*/ | |||
| } | |||
| timeVo.setEndDate(EnumContractReceivePeriodUnit.getAfterCalendarNarDay(timeVo.getStartDate(), receivePeriod, dayType)); | |||
| } | |||
| if (count >= 12) { | |||
| String a = ""; | |||
| } | |||
| //如果是到了每年的截止时间,第一年忽略(是开始时间) | |||
| boolean isYearCut = false;//是不是有截断 | |||
| if (null != yearsEndList && yearsEndList.size() > 0 ) { | |||
| Date yearEndDateStart = yearsEndList.get(0); | |||
| //如果开始时间到了年的截止 | |||
| if (timeVo.getStartDate().equals(yearEndDateStart)) { | |||
| yearsEndList.remove(yearEndDateStart); | |||
| }else if (timeVo.getStartDate().after(yearEndDateStart)) { | |||
| //do nothing | |||
| }else if (timeVo.getStartDate().before(yearEndDateStart)) { | |||
| Date yearEndDateEnd = DateUtils.getDayEnd(yearEndDateStart); | |||
| if (timeVo.getEndDate().after(yearEndDateEnd)) { | |||
| timeVo.setEndDate(DateUtils.getDaySet(yearEndDateEnd,Calendar.DATE,-1)); | |||
| yearsEndList.remove(yearEndDateStart); | |||
| isYearCut = true; | |||
| }else if(timeVo.getEndDate().equals(yearEndDateEnd)) { | |||
| yearsEndList.remove(yearEndDateStart); | |||
| } | |||
| } | |||
| } | |||
| if(timeVo.getEndDate().after(end)){ | |||
| timeVo.setEndDate(end); | |||
| } | |||
| @@ -1923,7 +1941,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| list.add(timeVo); | |||
| //next | |||
| //start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.DATE,1); | |||
| start = DateUtils.getDaySet(timeVo.getEndDate(),Calendar.SECOND,1); | |||
| if(start.after(end)) { | |||
| @@ -1937,7 +1954,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| logger.error("initBillTimeList() warnCount max error !!!"); | |||
| break; | |||
| } | |||
| } | |||
| } | |||
| return list; | |||
| } | |||
| @@ -1646,6 +1646,7 @@ public class DateUtils { | |||
| cal.set(Calendar.HOUR_OF_DAY, 0); | |||
| cal.set(Calendar.MINUTE, 0); | |||
| cal.set(Calendar.SECOND, 0); | |||
| cal.set(Calendar.MILLISECOND, 0); | |||
| List<Date> allDays = new ArrayList<Date>(); | |||
| while (cal.getTime().before(end) || cal.getTime().equals(end)) { | |||
| allDays.add(cal.getTime()); | |||
| @@ -67,8 +67,8 @@ | |||
| <if test=" null != propertyContractId ">and `property_contract_id` = #{propertyContractId}</if> | |||
| <if test=" null != parentBillId ">and `parent_bill_id` = #{parentBillId}</if> | |||
| <if test=" null != isPreview ">and `is_preview` = #{isPreview}</if> | |||
| <if test=" null != starttime">and `starttime` <= #{starttime}</if> | |||
| <if test=" null != endtime">and `endtime` >= #{endtime}</if> | |||
| <if test=" null != starttime">and `starttime` >= #{starttime}</if> | |||
| <if test=" null != endtime">and `endtime` <= #{endtime}</if> | |||
| <if test=" null != month and '' != month"> | |||
| and date_format(starttime,'%Y-%m') <= #{month} and date_format(endtime,'%Y-%m') >= #{month} | |||
| </if> | |||
| @@ -88,8 +88,6 @@ | |||
| <if test=" null != hasMerchant ">and `merchant_id` is not null</if> | |||
| <if test=" 1 == hasParentBillId ">and `parent_bill_id` is not null</if> | |||
| <if test=" 0 == hasParentBillId ">and `parent_bill_id` is null</if> | |||
| <if test=" 1 == hasFeesStardarsId ">and `energy_fees_id` is not null</if> | |||
| <if test=" 0 == hasFeesStardarsId ">and `energy_fees_id` is null</if> | |||
| <if test=" null != energyReadingCalcuteId ">and `energy_reading_calcuteId` = #{energyReadingCalcuteId}</if> | |||
| <if test=" null != energyReadingId ">and `energy_reading_id` = #{energyReadingId}</if> | |||
| <if test=" null != rentContractIdList "> | |||
| @@ -153,6 +151,7 @@ | |||
| <result column="max_date" jdbcType="TIMESTAMP" property="maxDate" /> | |||
| <result column="return_pay" jdbcType="VARCHAR" property="returnPay"/> | |||
| <result column="set_off" jdbcType="VARCHAR" property="setOff"/> | |||
| <result column="energy_fees_id" jdbcType="BIGINT" property="energyFeesId"/> | |||
| </resultMap> | |||
| <select id="getBillMonthSum" parameterType="com.iformall.domain.po.WxAllBill" resultMap="SumBaseResultMap"> | |||
| select | |||
| @@ -165,6 +164,19 @@ | |||
| from wx_all_bill | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="getFeesBillSum" parameterType="com.iformall.domain.po.WxAllBill" resultMap="SumBaseResultMap"> | |||
| select | |||
| energy_fees_id, | |||
| sum(CAST(receive_pay AS DECIMAL(20,2))) receive_pay , | |||
| sum(CAST(pay AS DECIMAL(20,2))) paid, | |||
| min(starttime) min_date, | |||
| max(endtime) max_date, | |||
| sum(CAST(set_off AS DECIMAL(20,2))) set_off , | |||
| sum(CAST(return_pay AS DECIMAL(20,2))) return_pay | |||
| from wx_all_bill | |||
| <include refid="dynamicWhereConditions"/> | |||
| group by energy_fees_id | |||
| </select> | |||
| <select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxAllBill" resultType="Long"> | |||
| select distinct merchant_id from wx_all_bill | |||
| @@ -182,7 +194,7 @@ | |||
| bill_type, | |||
| count(1) total_count , | |||
| sum(CAST(`receive_pay` AS DECIMAL(20,2)) - CAST(`pay` AS DECIMAL(20,2)) - CAST(IFNULL(`set_off`,'0') AS DECIMAL(20,2)) + CAST(IFNULL(`return_pay`,'0') AS DECIMAL(20,2))) total_money, | |||
| MIN(br.starttime) min_begin_time from wx_all_bill | |||
| MIN(starttime) min_begin_time from wx_all_bill | |||
| <include refid="dynamicWhereConditions"/> | |||
| group by bill_type | |||
| </select> | |||
| @@ -17,11 +17,12 @@ | |||
| <result column="fixed_price" jdbcType="INTEGER" property="fixedPrice"/> | |||
| <result column="calcute_unit" jdbcType="INTEGER" property="calcuteUnit"/> | |||
| <result column="time_unit" jdbcType="INTEGER" property="timeUnit"/> | |||
| <result column="tax_rate" jdbcType="VARCHAR" property="taxRate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`is_del`,`name`,`price`,`public_calcute`,`type`,`bill_type`,`is_system`, | |||
| `fixed_price`,`calcute_unit`,`time_unit` | |||
| `fixed_price`,`calcute_unit`,`time_unit`,`tax_rate` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -58,5 +58,6 @@ | |||
| <include refid="allColumns"/> | |||
| from wx_finance_finish where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| </mapper> | |||
| @@ -24,12 +24,13 @@ | |||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||
| <result column="fees_id" jdbcType="BIGINT" property="feesId"/> | |||
| <result column="is_print" jdbcType="INTEGER" property="isPrint"/> | |||
| <result column="is_finish" jdbcType="INTEGER" property="isFinish"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`receive_money`,`pay_money`,`set_off_money`,`use_money`,`status`,`type`, | |||
| `receive_type`,`money_detail`,`create_by`,`create_by_name`,`update_by`,`update_by_name`,`merchant_id`,`rent_shop_type`,`remark`, | |||
| `fees_id`,`is_print` | |||
| `fees_id`,`is_print`,`is_finish` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -51,7 +52,8 @@ | |||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | |||
| <if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if> | |||
| <if test=" null != isPrint ">and `is_print` = #{isPrint}</if> | |||
| <if test=" null != finishStatus ">and `status` in (1,4)</if> | |||
| <if test=" null != isFinish ">and `is_finish` = #{isFinish}</if> | |||
| <if test=" null != finishStatus ">and `status` in (1,3)</if> | |||
| <if test=" null != merchantIdList "> | |||
| and merchant_id in | |||
| <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")"> | |||
| @@ -98,12 +100,36 @@ | |||
| group by fees_id | |||
| </select> | |||
| <update id="finish"> | |||
| update wx_finance_receive set status = 4 where status = 1 | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| <resultMap id="SumResultMap" type="com.iformall.domain.vo.WxFinanceReceiveSumVo"> | |||
| <result column="total_receive" jdbcType="VARCHAR" property="totalReceive"/> | |||
| <result column="total_setoff" jdbcType="VARCHAR" property="totalSetoff" /> | |||
| <result column="total_pay" jdbcType="VARCHAR" property="totalPay"/> | |||
| </resultMap> | |||
| <select id="getReceiveSum" parameterType="com.iformall.domain.po.WxFinanceReceive" resultMap="SumResultMap"> | |||
| select | |||
| sum(CAST(ifnull(receive_money,'0') AS DECIMAL(20,2))) total_receive , | |||
| sum(CAST(ifnull(set_off_money,'0') AS DECIMAL(20,2))) total_setoff, | |||
| sum(CAST(ifnull(pay_money,'0') AS DECIMAL(20,2))) total_pay | |||
| from wx_finance_receive | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <resultMap id="PayWaySumResultMap" type="com.iformall.domain.po.WxFinanceReceivePayway"> | |||
| <result column="pay_way" jdbcType="BIGINT" property="payWay"/> | |||
| <result column="receive" jdbcType="VARCHAR" property="receive"/> | |||
| </resultMap> | |||
| <select id="getReceivePayWaySum" parameterType="com.iformall.domain.po.WxFinanceReceive" resultMap="PayWaySumResultMap"> | |||
| select pay_way, sum(CAST(ifnull(receive,'0') AS DECIMAL(20,2))) receive | |||
| from wx_finance_receive_payway where is_del = 0 and receive_id in ( | |||
| select id from wx_finance_receive | |||
| <include refid="dynamicWhereConditions"/> | |||
| ) | |||
| group by pay_way | |||
| </select> | |||
| <update id="finish" parameterType="com.iformall.domain.po.WxFinanceReceive"> | |||
| update wx_finance_receive set is_finish = 1 | |||
| <include refid="dynamicWhereConditions"/> | |||
| </update> | |||
| </mapper> | |||
| @@ -64,13 +64,16 @@ | |||
| <result column="fees_standards_info" jdbcType="VARCHAR" property="feesStandardsInfo"/> | |||
| <result column="day_price_calcute" jdbcType="INTEGER" property="dayPriceCalcute"/> | |||
| <result column="month_average_days" jdbcType="INTEGER" property="monthAverageDays"/> | |||
| <result column="first_bill_date_start" jdbcType="TIMESTAMP" property="firstBillDateStart"/> | |||
| <result column="first_bill_date_end" jdbcType="TIMESTAMP" property="firstBillDateEnd"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`merchant_id`,`decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`create_type`,`shop_ids`,`shop_numbers`, | |||
| `sign_date`,`receive_period`,`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,`price_detail`, | |||
| `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`receive_period_unit`,`create_by`,`update_by`, | |||
| `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`,`fees_standards_info`, | |||
| `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`,`fees_standards_info`,`first_bill_date_start`,`first_bill_date_end`, | |||
| `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`,`day_price_calcute`,`month_average_days`, | |||
| `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price, | |||
| `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time,out_date_notify_days,out_date_notify_phone | |||
| @@ -131,6 +131,9 @@ | |||
| <result column="revenue_rent_price" jdbcType="VARCHAR" property="revenueRentPrice"/> | |||
| <result column="revenue_jumps_remark" jdbcType="VARCHAR" property="revenueJumpsRemark"/> | |||
| <result column="free_period_remark" jdbcType="VARCHAR" property="freePeriodRemark"/> | |||
| <result column="first_bill_date_start" jdbcType="TIMESTAMP" property="firstBillDateStart"/> | |||
| <result column="first_bill_date_end" jdbcType="TIMESTAMP" property="firstBillDateEnd"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| @@ -138,7 +141,7 @@ | |||
| `shop_type_sub`,`lease_purpose`,`contractual_rules`,`delivery_date`,`delivery_grace_period`,`opening_date`,`business_hours`,`scope_metre`, | |||
| `decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`receive_period_unit`, | |||
| `tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,`price_detail`,`create_by`,`update_by`, | |||
| `first_party_bank_info`,`second_party_bank_info`,`second_party_tax_info`,`day_price_calcute`, | |||
| `first_party_bank_info`,`second_party_bank_info`,`second_party_tax_info`,`day_price_calcute`,`first_bill_date_start`,`first_bill_date_end`, | |||
| `property_name`,`property_fee`,`fee_cycle`,`water_fee`,`electricity_fees`,`month_average_days`,`free_period_remark`, | |||
| `deposit`,cashtype_content_lsit,cashtype_lsit,`pay_date`,`is_del`,`merchant_name`,`revenue_jumps_remark`, | |||
| `brand`,`business_id`,`shop_type`,`shop_type_str`,`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, | |||
| @@ -382,6 +385,8 @@ | |||
| <result column="revenue_rent_price" jdbcType="VARCHAR" property="revenueRentPrice"/> | |||
| <result column="revenue_jumps_remark" jdbcType="VARCHAR" property="revenueJumpsRemark"/> | |||
| <result column="free_period_remark" jdbcType="VARCHAR" property="freePeriodRemark"/> | |||
| <result column="first_bill_date_start" jdbcType="TIMESTAMP" property="firstBillDateStart"/> | |||
| <result column="first_bill_date_end" jdbcType="TIMESTAMP" property="firstBillDateEnd"/> | |||
| </resultMap> | |||
| @@ -390,7 +395,7 @@ | |||
| rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status,rc.price_detail,rc.revenue_fixed_rent_price,rc.revenue_rent_price, | |||
| rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status, | |||
| rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute,rc.free_period_remark, | |||
| rc.business_type businessType,rc.month_average_days,rc.revenue_jumps_remark | |||
| rc.business_type businessType,rc.month_average_days,rc.revenue_jumps_remark,rc.first_bill_date_start,rc.first_bill_date_end | |||
| from wx_rent_contract rc left join wx_property_contract pc on rc.id=pc.rent_contract_id | |||
| <where> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||