| @@ -33,7 +33,7 @@ public class WxRentContractDepositTypeController extends WxContractBaseControlle | |||
| dt.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| dt.setBillType(EnumBillAllType.RENT_DEPOSIT.getCode()); | |||
| dt.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(dt, 1, 100); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(dt, 1, 100,false); | |||
| if (null == page) { | |||
| return new ResultData(); | |||
| } | |||
| @@ -179,7 +179,7 @@ public class WxEnergyController extends BaseController { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| record.setBillType(EnumBillAllType.DAILY.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -51,7 +51,7 @@ public class WxFeesStandardsController extends BaseController { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setBillType(EnumBillAllType.PROPERTY.getCode()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -63,7 +63,7 @@ public class WxFeesStandardsController extends BaseController { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setBillType(EnumBillAllType.PROPERTY.getCode()); | |||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, 1, 100); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, 1, 100,false); | |||
| if (null != page) { | |||
| return new ResultData(page.getList()); | |||
| } | |||
| @@ -1,5 +1,6 @@ | |||
| package com.iformall.controller.market; | |||
| import com.aliyun.openservices.shade.com.alibaba.fastjson.JSON; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| @@ -7,8 +8,6 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.dto.FinanceSetOffDTO; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceAdvance; | |||
| import com.iformall.domain.po.WxFinanceAdvanceType; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.base.BaseEntity; | |||
| import com.iformall.domain.po.base.WxBillBaseEntity; | |||
| @@ -27,6 +26,8 @@ import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -54,11 +55,11 @@ public class WxFinanceController extends BaseController { | |||
| */ | |||
| @GetMapping("billTypes") | |||
| public ResultData billTypes() { | |||
| Map<Integer,EnumBillAllType> tmap = new HashMap<Integer,EnumBillAllType>(); | |||
| for (EnumBillAllType t : EnumBillAllType.getOperateNotEnergyTypes()) { | |||
| tmap.put(t.getCode(), t); | |||
| List<EnumBillAllType> list = new ArrayList<EnumBillAllType>(); | |||
| for (EnumBillAllType t : EnumBillAllType.getCommonOperateTypes()) { | |||
| list.add(t); | |||
| } | |||
| return new ResultData(tmap); | |||
| return new ResultData(list); | |||
| } | |||
| @ApiOperation("费用科目列表") | |||
| @@ -71,8 +72,8 @@ public class WxFinanceController extends BaseController { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| //查询非能源费用科目 | |||
| record.setNotEnergy(EnumYesOrNo.YES.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize); | |||
| record.setCommonOperate(EnumYesOrNo.YES.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,false); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -129,81 +130,67 @@ public class WxFinanceController extends BaseController { | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData advanceTypeList(@ModelAttribute WxFinanceAdvanceType record, Integer pageNum, Integer pageSize) { | |||
| public ResultData advanceTypeList(@ModelAttribute WxEnergyFees record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxFinanceAdvanceType> page = wxFinanceService.advanceTypeListAsPage(record, pageNum, pageSize); | |||
| record.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| PageInfo<WxEnergyFees> page = wxEnergyService.feesListAsPage(record, pageNum, pageSize,true); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("能源表新增修改") | |||
| @PostMapping("saveAdvanceType") | |||
| public ResultData saveAdvanceType(@RequestBody WxFinanceAdvanceType record) { | |||
| @ApiOperation("预收科目新增修改") | |||
| @PostMapping("saveAdvanceFees") | |||
| public ResultData saveAdvanceType(@RequestBody WxEnergyFees record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if (StringUtils.isBlank(record.getRate())) { | |||
| return new ResultData(Result.ERROR,"请填写抵扣比例"); | |||
| } | |||
| if (new BigDecimal(record.getRate()).compareTo(new BigDecimal(100)) > 0 ) { | |||
| return new ResultData(Result.ERROR,"冲抵比例不能超过100"); | |||
| } | |||
| wxFinanceService.saveOrUpdateAdvanceType(record); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("advanceTypeUpdateIsDel") | |||
| public ResultData advanceTypeUpdateIsDel(@RequestBody WxFinanceAdvanceType record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxFinanceService.updateAdvanceTypeIsDel(record); | |||
| record.setBillType(EnumBillAllType.ADVANCE.getCode()); | |||
| record.setFixedPrice(EnumYesOrNo.YES.getCode()); | |||
| wxEnergyService.saveOrUpdateFees(record); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("预收记录列表") | |||
| @GetMapping("advanceList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| }) | |||
| public ResultData advanceList(@ModelAttribute WxFinanceAdvance record, Integer pageNum, Integer pageSize) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| record.setSortColumns(BaseEntity.SortField.CreateTime_DESC); | |||
| PageInfo<WxFinanceAdvance> page = wxFinanceService.advanceListAsPage(record, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("预收记录新增修改") | |||
| @ApiOperation("预收") | |||
| @PostMapping("saveAdvance") | |||
| public ResultData saveAdvance(@RequestBody WxFinanceAdvance record) { | |||
| public ResultData saveAdvance(@RequestBody WxFinanceReceive record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxFinanceService.saveOrUpdateAdvance(record,this.getUser()); | |||
| return new ResultData(); | |||
| } | |||
| @PostMapping("advanceUpdateIsDel") | |||
| public ResultData advanceUpdateIsDel(@RequestBody WxFinanceAdvance record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| wxFinanceService.updateAdvanceIsDel(record); | |||
| if (StringUtils.isBlank(record.getTotalMoney())) { | |||
| return new ResultData(Result.ERROR,"请填写金额"); | |||
| } | |||
| if (null == record.getFeesId()) { | |||
| return new ResultData(Result.ERROR,"请选择科目"); | |||
| } | |||
| record.setType(EnumFinanceReceiveType.ADVANCE.getCode()); | |||
| wxFinanceService.saveOrUpdateReceive(record,this.getUser()); | |||
| return new ResultData(); | |||
| } | |||
| //查询商户预收总计 | |||
| @GetMapping("getMerchantAdvance") | |||
| public ResultData getMerchantAdvance(@ModelAttribute WxFinanceAdvance record) { | |||
| public ResultData getMerchantAdvance(@ModelAttribute WxFinanceReceive record) { | |||
| record.updateTenantInfo(getTenantInfo()); | |||
| if (null == record.getMerchantId()) { | |||
| return new ResultData(Result.ERROR,"请选择商户"); | |||
| } | |||
| record.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| List<WxFinanceAdvance> advanceList = wxFinanceService.getMerchantAdvanceGroupSumList(record); | |||
| List<WxFinanceReceive> advanceList = wxFinanceService.getMerchantAdvanceGroupSumList(record); | |||
| BigDecimal total = new BigDecimal(0); | |||
| Map retMap = new HashMap(); | |||
| if (null != advanceList && advanceList.size() > 0 ) { | |||
| WxFinanceAdvanceType fat = new WxFinanceAdvanceType(); | |||
| WxEnergyFees fat = new WxEnergyFees(); | |||
| fat.updateTenantInfo(record); | |||
| Map<Long, WxFinanceAdvanceType> advanceTypMap = wxFinanceService.getAdvanceTypeMap(fat); | |||
| Map<Long, WxEnergyFees> advanceTypMap = wxEnergyService.getFeesMap(fat); | |||
| for (int i = 0 ; i < advanceList.size() ; i++) { | |||
| WxFinanceAdvance at = advanceList.get(i); | |||
| if (null != advanceTypMap) { | |||
| WxFinanceAdvanceType wfat = advanceTypMap.get(at.getAdvanceTypeId()); | |||
| WxFinanceReceive at = advanceList.get(i); | |||
| if (null != at.getFeesId() && null != advanceTypMap) { | |||
| WxEnergyFees wfat = advanceTypMap.get(at.getFeesId()); | |||
| if (null != wfat) { | |||
| at.setAdvanceTypeName(wfat.getName()); | |||
| at.setFeesName(wfat.getName()); | |||
| } | |||
| total.add(new BigDecimal(at.getRemainMoney())); | |||
| total.add(new BigDecimal(at.getTotalMoney())); | |||
| } | |||
| } | |||
| } | |||
| @@ -1422,49 +1422,49 @@ create table wx_bill_pay_way_99 like wx_bill_pay_way; | |||
| drop table wx_bill_pay_way; | |||
| INSERT INTO wx_bill_pay_way_3 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1003',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1003',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1003',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1003',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1003',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_8 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1008','1028',NOW(),NOW(),0,'商户小程序',1), (2,'1008','1028',NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1008','1028',NOW(),NOW(),0,'商户小程序',1), (2,'1008','1028',NOW(),NOW(),0,'系统自动结清',1),(3,'1008','1028',NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_9 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1009',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1009',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1009',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1009',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1009',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_10 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1010',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1010',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1010',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1010',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1010',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_12 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1012',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1012',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1012',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1012',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1012',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_13 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1013',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1013',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1013',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1013',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1013',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_19 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1019',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1019',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1019',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1019',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1019',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_20 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1020','1028',NOW(),NOW(),0,'商户小程序',1), (2,'1020','1028',NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1020','1028',NOW(),NOW(),0,'商户小程序',1), (2,'1020','1028',NOW(),NOW(),0,'系统自动结清',1),(3,'1020','1028',NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_22 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1022',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1022',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1022',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1022',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1022',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_24 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1024',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1024',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1024',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1024',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1024',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_42 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1042',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1042',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1042',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1042',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1042',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_63 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1063',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1063',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1063',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1063',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1063',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_95 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1095',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1095',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1095',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1095',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1095',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_96 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'1096',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1096',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'1096',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'1096',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'1096',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| INSERT INTO wx_bill_pay_way_89 (id,tenant_id,parent_tenant_id,create_time,update_time,is_del,NAME,is_system) | |||
| VALUES (1,'789',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'789',NULL,NOW(),NOW(),0,'系统自动结清',1); | |||
| VALUES (1,'789',NULL,NOW(),NOW(),0,'商户小程序',1), (2,'789',NULL,NOW(),NOW(),0,'系统自动结清',1),(3,'789',NULL,NOW(),NOW(),0,'预充抵扣',1); | |||
| CREATE TABLE `wx_energy_fees` ( | |||
| @@ -1487,6 +1487,20 @@ CREATE TABLE `wx_energy_fees` ( | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表'; | |||
| CREATE TABLE `wx_energy_fees_setoff` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| `tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID', | |||
| `parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID', | |||
| `create_time` timestamp NULL DEFAULT NULL, | |||
| `update_time` timestamp NULL DEFAULT NULL, | |||
| `advance_fees_id` bigint(20) NOT NULL COMMENT '预充科目编码', | |||
| `fees_id` bigint(20) NOT NULL COMMENT '抵扣科目编码', | |||
| PRIMARY KEY (`id`), | |||
| UNIQUE KEY `id_UNIQUE` (`id`), | |||
| KEY `T_A_F` (`tenant_id`,`advance_fees_id`,`fees_id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表'; | |||
| create table wx_energy_fees_0 like wx_energy_fees; | |||
| create table wx_energy_fees_1 like wx_energy_fees; | |||
| create table wx_energy_fees_2 like wx_energy_fees; | |||
| @@ -1590,6 +1604,109 @@ create table wx_energy_fees_99 like wx_energy_fees; | |||
| drop table wx_energy_fees; | |||
| create table wx_energy_fees_setoff_0 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_1 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_2 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_3 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_4 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_5 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_6 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_7 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_8 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_9 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_10 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_11 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_12 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_13 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_14 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_15 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_16 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_17 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_18 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_19 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_20 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_21 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_22 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_23 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_24 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_25 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_26 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_27 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_28 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_29 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_30 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_31 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_32 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_33 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_34 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_35 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_36 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_37 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_38 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_39 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_40 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_41 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_42 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_43 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_44 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_45 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_46 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_47 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_48 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_49 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_50 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_51 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_52 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_53 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_54 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_55 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_56 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_57 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_58 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_59 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_60 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_61 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_62 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_63 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_64 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_65 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_66 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_67 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_68 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_69 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_70 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_71 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_72 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_73 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_74 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_75 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_76 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_77 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_78 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_79 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_80 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_81 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_82 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_83 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_84 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_85 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_86 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_87 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_88 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_89 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_90 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_91 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_92 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_93 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_94 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_95 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_96 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_97 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_98 like wx_energy_fees_setoff; | |||
| create table wx_energy_fees_setoff_99 like wx_energy_fees_setoff; | |||
| drop table wx_energy_fees_setoff; | |||
| alter table wx_bill_rent_0 add column energy_fees_id bigint(20) NOT NULL COMMENT '科目编号';; | |||
| alter table wx_bill_rent_1 add column energy_fees_id bigint(20) NOT NULL COMMENT '科目编号';; | |||
| alter table wx_bill_rent_2 add column energy_fees_id bigint(20) NOT NULL COMMENT '科目编号';; | |||
| @@ -2616,7 +2733,108 @@ CREATE TABLE `wx_bill_advance` ( | |||
| UNIQUE KEY `id_UNIQUE` (`id`) | |||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='能耗表'; | |||
| create table wx_bill_advance_0 like wx_bill_advance; | |||
| create table wx_bill_advance_1 like wx_bill_advance; | |||
| create table wx_bill_advance_2 like wx_bill_advance; | |||
| create table wx_bill_advance_3 like wx_bill_advance; | |||
| create table wx_bill_advance_4 like wx_bill_advance; | |||
| create table wx_bill_advance_5 like wx_bill_advance; | |||
| create table wx_bill_advance_6 like wx_bill_advance; | |||
| create table wx_bill_advance_7 like wx_bill_advance; | |||
| create table wx_bill_advance_8 like wx_bill_advance; | |||
| create table wx_bill_advance_9 like wx_bill_advance; | |||
| create table wx_bill_advance_10 like wx_bill_advance; | |||
| create table wx_bill_advance_11 like wx_bill_advance; | |||
| create table wx_bill_advance_12 like wx_bill_advance; | |||
| create table wx_bill_advance_13 like wx_bill_advance; | |||
| create table wx_bill_advance_14 like wx_bill_advance; | |||
| create table wx_bill_advance_15 like wx_bill_advance; | |||
| create table wx_bill_advance_16 like wx_bill_advance; | |||
| create table wx_bill_advance_17 like wx_bill_advance; | |||
| create table wx_bill_advance_18 like wx_bill_advance; | |||
| create table wx_bill_advance_19 like wx_bill_advance; | |||
| create table wx_bill_advance_20 like wx_bill_advance; | |||
| create table wx_bill_advance_21 like wx_bill_advance; | |||
| create table wx_bill_advance_22 like wx_bill_advance; | |||
| create table wx_bill_advance_23 like wx_bill_advance; | |||
| create table wx_bill_advance_24 like wx_bill_advance; | |||
| create table wx_bill_advance_25 like wx_bill_advance; | |||
| create table wx_bill_advance_26 like wx_bill_advance; | |||
| create table wx_bill_advance_27 like wx_bill_advance; | |||
| create table wx_bill_advance_28 like wx_bill_advance; | |||
| create table wx_bill_advance_29 like wx_bill_advance; | |||
| create table wx_bill_advance_30 like wx_bill_advance; | |||
| create table wx_bill_advance_31 like wx_bill_advance; | |||
| create table wx_bill_advance_32 like wx_bill_advance; | |||
| create table wx_bill_advance_33 like wx_bill_advance; | |||
| create table wx_bill_advance_34 like wx_bill_advance; | |||
| create table wx_bill_advance_35 like wx_bill_advance; | |||
| create table wx_bill_advance_36 like wx_bill_advance; | |||
| create table wx_bill_advance_37 like wx_bill_advance; | |||
| create table wx_bill_advance_38 like wx_bill_advance; | |||
| create table wx_bill_advance_39 like wx_bill_advance; | |||
| create table wx_bill_advance_40 like wx_bill_advance; | |||
| create table wx_bill_advance_41 like wx_bill_advance; | |||
| create table wx_bill_advance_42 like wx_bill_advance; | |||
| create table wx_bill_advance_43 like wx_bill_advance; | |||
| create table wx_bill_advance_44 like wx_bill_advance; | |||
| create table wx_bill_advance_45 like wx_bill_advance; | |||
| create table wx_bill_advance_46 like wx_bill_advance; | |||
| create table wx_bill_advance_47 like wx_bill_advance; | |||
| create table wx_bill_advance_48 like wx_bill_advance; | |||
| create table wx_bill_advance_49 like wx_bill_advance; | |||
| create table wx_bill_advance_50 like wx_bill_advance; | |||
| create table wx_bill_advance_51 like wx_bill_advance; | |||
| create table wx_bill_advance_52 like wx_bill_advance; | |||
| create table wx_bill_advance_53 like wx_bill_advance; | |||
| create table wx_bill_advance_54 like wx_bill_advance; | |||
| create table wx_bill_advance_55 like wx_bill_advance; | |||
| create table wx_bill_advance_56 like wx_bill_advance; | |||
| create table wx_bill_advance_57 like wx_bill_advance; | |||
| create table wx_bill_advance_58 like wx_bill_advance; | |||
| create table wx_bill_advance_59 like wx_bill_advance; | |||
| create table wx_bill_advance_60 like wx_bill_advance; | |||
| create table wx_bill_advance_61 like wx_bill_advance; | |||
| create table wx_bill_advance_62 like wx_bill_advance; | |||
| create table wx_bill_advance_63 like wx_bill_advance; | |||
| create table wx_bill_advance_64 like wx_bill_advance; | |||
| create table wx_bill_advance_65 like wx_bill_advance; | |||
| create table wx_bill_advance_66 like wx_bill_advance; | |||
| create table wx_bill_advance_67 like wx_bill_advance; | |||
| create table wx_bill_advance_68 like wx_bill_advance; | |||
| create table wx_bill_advance_69 like wx_bill_advance; | |||
| create table wx_bill_advance_70 like wx_bill_advance; | |||
| create table wx_bill_advance_71 like wx_bill_advance; | |||
| create table wx_bill_advance_72 like wx_bill_advance; | |||
| create table wx_bill_advance_73 like wx_bill_advance; | |||
| create table wx_bill_advance_74 like wx_bill_advance; | |||
| create table wx_bill_advance_75 like wx_bill_advance; | |||
| create table wx_bill_advance_76 like wx_bill_advance; | |||
| create table wx_bill_advance_77 like wx_bill_advance; | |||
| create table wx_bill_advance_78 like wx_bill_advance; | |||
| create table wx_bill_advance_79 like wx_bill_advance; | |||
| create table wx_bill_advance_80 like wx_bill_advance; | |||
| create table wx_bill_advance_81 like wx_bill_advance; | |||
| create table wx_bill_advance_82 like wx_bill_advance; | |||
| create table wx_bill_advance_83 like wx_bill_advance; | |||
| create table wx_bill_advance_84 like wx_bill_advance; | |||
| create table wx_bill_advance_85 like wx_bill_advance; | |||
| create table wx_bill_advance_86 like wx_bill_advance; | |||
| create table wx_bill_advance_87 like wx_bill_advance; | |||
| create table wx_bill_advance_88 like wx_bill_advance; | |||
| create table wx_bill_advance_89 like wx_bill_advance; | |||
| create table wx_bill_advance_90 like wx_bill_advance; | |||
| create table wx_bill_advance_91 like wx_bill_advance; | |||
| create table wx_bill_advance_92 like wx_bill_advance; | |||
| create table wx_bill_advance_93 like wx_bill_advance; | |||
| create table wx_bill_advance_94 like wx_bill_advance; | |||
| create table wx_bill_advance_95 like wx_bill_advance; | |||
| create table wx_bill_advance_96 like wx_bill_advance; | |||
| create table wx_bill_advance_97 like wx_bill_advance; | |||
| create table wx_bill_advance_98 like wx_bill_advance; | |||
| create table wx_bill_advance_99 like wx_bill_advance; | |||
| drop table wx_bill_advance; | |||
| CREATE TABLE `wx_finance_receive` ( | |||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | |||
| @@ -2625,6 +2843,7 @@ CREATE TABLE `wx_finance_receive` ( | |||
| `create_time` timestamp NULL DEFAULT NULL, | |||
| `update_time` timestamp NULL DEFAULT NULL, | |||
| `total_money` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '总支付金额', | |||
| `remain_money` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '剩余金额', | |||
| `status` int(3) NOT NULL COMMENT '状态', | |||
| `create_by` bigint(20) DEFAULT NULL COMMENT '创建人', | |||
| `create_by_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '创建人名称', | |||
| @@ -806,6 +806,108 @@ alter table wx_bill_other_deposit_97 add column set_off varchar(30) COMMENT | |||
| alter table wx_bill_other_deposit_98 add column set_off varchar(30) COMMENT '抵扣金额'; | |||
| alter table wx_bill_other_deposit_99 add column set_off varchar(30) COMMENT '抵扣金额'; | |||
| alter table wx_energy_fees_0 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_1 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_2 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_3 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_4 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_5 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_6 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_7 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_8 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_9 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_10 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_11 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_12 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_13 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_14 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_15 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_16 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_17 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_18 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_19 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_20 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_21 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_22 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_23 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_24 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_25 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_26 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_27 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_28 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_29 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_30 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_31 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_32 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_33 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_34 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_35 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_36 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_37 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_38 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_39 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_40 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_41 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_42 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_43 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_44 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_45 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_46 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_47 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_48 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_49 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_50 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_51 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_52 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_53 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_54 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_55 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_56 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_57 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_58 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_59 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_60 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_61 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_62 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_63 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_64 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_65 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_66 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_67 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_68 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_69 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_70 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_71 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_72 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_73 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_74 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_75 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_76 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_77 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_78 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_79 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_80 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_81 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_82 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_83 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_84 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_85 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_86 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_87 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_88 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_89 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_90 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_91 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_92 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_93 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_94 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_95 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_96 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_97 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_98 add column rate varchar(30) comment '抵扣比例';; | |||
| alter table wx_energy_fees_99 add column rate varchar(30) comment '抵扣比例';; | |||
| @@ -449,6 +449,20 @@ public class BaseMyBatisConfiguration { | |||
| wxEnergyFeesSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxEnergyFeesSharding); | |||
| ShardingSphere wxBillAdvanceSharding = new ShardingSphere(); | |||
| wxBillAdvanceSharding.setColumn("tenant_id"); | |||
| wxBillAdvanceSharding.setTableName("wx_bill_advance"); | |||
| wxBillAdvanceSharding.setCount(100); | |||
| wxBillAdvanceSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxBillAdvanceSharding); | |||
| ShardingSphere wxEnergyFeesSetoffSharding = new ShardingSphere(); | |||
| wxEnergyFeesSetoffSharding.setColumn("tenant_id"); | |||
| wxEnergyFeesSetoffSharding.setTableName("wx_energy_fees_setoff"); | |||
| wxEnergyFeesSetoffSharding.setCount(100); | |||
| wxEnergyFeesSetoffSharding.setRule(EnumShardingRule.HASH.getCode()); | |||
| shardingList.add(wxEnergyFeesSetoffSharding); | |||
| //初始化 | |||
| shardingSpherePlugin.setShardingSpheres(shardingList); | |||
| Properties properties = new Properties(); | |||
| @@ -179,8 +179,8 @@ public class WxEnergyFees extends TenantEntity { | |||
| } | |||
| } | |||
| @TableField(exist = false) | |||
| private Integer notEnergy; | |||
| @io.swagger.annotations.ApiModelProperty(value="冲抵比例",name="rate") | |||
| private String rate; | |||
| @TableField(exist = false) | |||
| private List<Long> feesIds;//冲抵科目 | |||
| @@ -201,5 +201,10 @@ public class WxEnergyFees extends TenantEntity { | |||
| return null; | |||
| } | |||
| @TableField(exist = false) | |||
| private Integer commonOperate;//通用可配置类型 | |||
| @TableField(exist = false) | |||
| private Integer notSetOff; | |||
| } | |||
| @@ -9,11 +9,11 @@ import java.util.Date; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_finance_advance_type_fees") | |||
| @TableName(value = "wx_energy_fees_setoff") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxFinanceAdvanceTypeFees extends TenantEntity { | |||
| public class WxEnergyFeesSetoff extends TenantEntity { | |||
| private static final long serialVersionUID = 7009117540201976664L; | |||
| @@ -26,10 +26,10 @@ public class WxFinanceAdvanceTypeFees extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "advanceType编码", name = "advanceTypeId") | |||
| private Long advanceTypeId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "预充科目编码", name = "advanceFeesId") | |||
| private Long advanceFeesId; | |||
| @io.swagger.annotations.ApiModelProperty(value="科目编码",name="feesId") | |||
| @io.swagger.annotations.ApiModelProperty(value="抵扣科目编码",name="feesId") | |||
| private Long feesId; | |||
| @@ -1,61 +0,0 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| */ | |||
| @TableName(value = "wx_finance_advance_type") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxFinanceAdvanceType extends TenantEntity { | |||
| private static final long serialVersionUID = 7009117540201976664L; | |||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="name",name="name") | |||
| private String name; | |||
| @io.swagger.annotations.ApiModelProperty(value="createTime",name="createTime") | |||
| private Date createTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "isDel", name = "isDel") | |||
| private Integer isDel; | |||
| @io.swagger.annotations.ApiModelProperty(value="冲抵比例",name="rate") | |||
| private String rate; | |||
| @TableField(exist = false) | |||
| private List<Long> feesIds; | |||
| @TableField(exist = false) | |||
| private String feesName; | |||
| public String getFeesIdsName(Map<Long, WxEnergyFees> feesMap) { | |||
| if (null != feesIds) { | |||
| StringBuffer sb= new StringBuffer(); | |||
| for (int i = 0 ; i < feesIds.size(); i++) { | |||
| Long feid = feesIds.get(i); | |||
| WxEnergyFees f = feesMap.get(feid); | |||
| if (null != f) { | |||
| sb.append(f.getName()).append(","); | |||
| } | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -35,6 +35,13 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="updateTime",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="科目ID,预收的时候有",name="feesId") | |||
| private Long feesId; | |||
| @TableField(exist = false) | |||
| private List<Long> feesIdList; | |||
| @TableField(exist = false) | |||
| private String feesName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "收款总金额", name = "totalMoney") | |||
| private String totalMoney; | |||
| @@ -75,9 +82,6 @@ public class WxFinanceReceive extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value = "remark", name = "remark") | |||
| private String remark; | |||
| @io.swagger.annotations.ApiModelProperty(value = "预收款类型,", name = "advanceTypeId") | |||
| private Long advanceTypeId; | |||
| @TableField(exist = false) | |||
| private List<WxBillBaseEntity> bills; | |||
| @TableField(exist = false) | |||
| @@ -76,7 +76,7 @@ public class WxBillBaseEntity extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="到账日期",name="payDate") | |||
| public Date payDate; | |||
| @Excel(name = "实收账款(元)", width = 20, orderNum = "10") | |||
| @Excel(name = "冲抵金额(元)", width = 20, orderNum = "10") | |||
| @io.swagger.annotations.ApiModelProperty(value="冲抵金额",name="setOff") | |||
| public String setOff; | |||
| @@ -60,8 +60,8 @@ public enum EnumBillAllType { | |||
| return ret; | |||
| } | |||
| //财务可以自定义的除了能源和冲抵的科目 | |||
| public static EnumBillAllType[] getOperateNotEnergyTypes() { | |||
| //财务可以通用自定义的 | |||
| public static EnumBillAllType[] getCommonOperateTypes() { | |||
| EnumBillAllType[] ret = new EnumBillAllType[] {RENT_DEPOSIT,PROPERTY,OTHER,OTHER_DEPOSIT}; | |||
| return ret; | |||
| } | |||
| @@ -6,8 +6,8 @@ package com.iformall.enums; | |||
| public enum EnumFinanceReceiveType { | |||
| RECEIVE(1,"收单"), | |||
| SETOFF(2,"冲抵") | |||
| RECEIVE(1,"缴费"), | |||
| ADVANCE(2,"预充") | |||
| ; | |||
| public static EnumFinanceReceiveType getEnum(Integer code) { | |||
| @@ -0,0 +1,23 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxEnergyFeesSetoff; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxEnergyFeesSetoffMapper extends CommonMapper<WxEnergyFeesSetoff, Long> { | |||
| List<WxEnergyFeesSetoff> findList(WxEnergyFeesSetoff wxBillRent); | |||
| List<Long> findFeesIdList(WxEnergyFeesSetoff wxBillRent); | |||
| List<Long> findadvanceFeesIdList(WxEnergyFeesSetoff wxBillRent); | |||
| WxEnergyFeesSetoff selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void deleteByAdvanceId(WxEnergyFeesSetoff wxBillRent); | |||
| } | |||
| @@ -1,23 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxFinanceAdvanceTypeFees; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxFinanceAdvanceTypeFeesMapper extends CommonMapper<WxFinanceAdvanceTypeFees, Long> { | |||
| List<WxFinanceAdvanceTypeFees> findList(WxFinanceAdvanceTypeFees wxBillRent); | |||
| List<Long> findFeesIdList(WxFinanceAdvanceTypeFees wxBillRent); | |||
| List<Long> findadvanceTypeIdList(WxFinanceAdvanceTypeFees wxBillRent); | |||
| WxFinanceAdvanceTypeFees selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void deleteByAdvanceId(WxFinanceAdvanceTypeFees wxBillRent); | |||
| } | |||
| @@ -1,20 +0,0 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxEnergyMeter; | |||
| import com.iformall.domain.po.WxFinanceAdvanceType; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| /** | |||
| */ | |||
| public interface WxFinanceAdvanceTypeMapper extends CommonMapper<WxFinanceAdvanceType, Long> { | |||
| List<WxFinanceAdvanceType> findList(WxFinanceAdvanceType wxBillRent); | |||
| WxFinanceAdvanceType selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void setIsDel(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isDel")Integer isDel); | |||
| } | |||
| @@ -14,5 +14,7 @@ public interface WxFinanceReceiveMapper extends CommonMapper<WxFinanceReceive, L | |||
| WxFinanceReceive selectById(@Param("id")Long id,@Param("tenantId")String tenantId); | |||
| void setIsDel(@Param("id")Long id,@Param("tenantId")String tenantId,@Param("isDel")Integer isDel); | |||
| List<WxFinanceReceive> getMerchantAdvanceGroupSumList(WxFinanceReceive record); | |||
| } | |||
| @@ -38,7 +38,7 @@ public interface WxEnergyService { | |||
| void setTimeIsDel(WxEnergyFeesTime record); | |||
| //费用科目 | |||
| PageInfo<WxEnergyFees> feesListAsPage(WxEnergyFees record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxEnergyFees> feesListAsPage(WxEnergyFees record, Integer pageIndex, Integer pageSize,boolean isSetOff); | |||
| void saveOrUpdateFees(WxEnergyFees record); | |||
| WxEnergyFees getFeesById(WxEnergyFees record); | |||
| void setFeesIsDel(WxEnergyFees record); | |||
| @@ -6,7 +6,6 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.dto.FinanceSetOffDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxFinanceAdvanceType; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| @@ -23,17 +22,8 @@ public interface WxFinanceService { | |||
| Map<Long,WxBillPayWay> getPayWayMap(WxBillPayWay record); | |||
| void payWayInit(TenantEntity tenantInfo); | |||
| //预收款类型 | |||
| PageInfo<WxFinanceAdvanceType> advanceTypeListAsPage(WxFinanceAdvanceType record, Integer pageIndex, Integer pageSize); | |||
| WxFinanceAdvanceType getAdvanceTypeById(TenantEntity tenantEntity,Long id); | |||
| void saveOrUpdateAdvanceType(WxFinanceAdvanceType record); | |||
| void updateAdvanceTypeIsDel(WxFinanceAdvanceType record); | |||
| Map<Long,WxFinanceAdvanceType> getAdvanceTypeMap(WxFinanceAdvanceType record); | |||
| //预收款 | |||
| List<Map> getSetOffList(FinanceSetOffDTO dto); | |||
| WxBillBaseEntity setOff(FinanceSetOffDTO dto,MallUserInfo user); | |||
| List<WxBillBaseEntity> getBills(TenantEntity tenantEntity,List<WxBillBaseEntity> bills); | |||
| //收款 | |||
| PageInfo<WxFinanceReceive> receiveListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | |||
| @@ -42,4 +32,9 @@ public interface WxFinanceService { | |||
| void saveOrUpdateReceiveBill(WxFinanceReceiveBill record); | |||
| WxFinanceReceive getReceiveById(TenantEntity tenantEntity,Long id); | |||
| void invalidReceive(WxFinanceReceive record,MallUserInfo user); | |||
| List<WxBillBaseEntity> getBills(TenantEntity tenantEntity,List<WxBillBaseEntity> bills); | |||
| List<WxFinanceReceive> getMerchantAdvanceGroupSumList(WxFinanceReceive record); | |||
| //冲抵 | |||
| WxBillBaseEntity setOff(FinanceSetOffDTO dto,MallUserInfo user); | |||
| } | |||
| @@ -187,7 +187,7 @@ public class WxBillAdvanceServiceImpl extends WxBillBaseService implements WxBil | |||
| String receivepay = StringUtils.isBlank(record.getReceivePay()) ? "0" : record.getReceivePay(); | |||
| String pay = StringUtils.isBlank(record.getPay()) ? "0" : record.getPay(); | |||
| if(new BigDecimal(pay).compareTo(new BigDecimal(receivepay)) > 0 ){ | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "实收金额不能大于实际应收总金额"); | |||
| return new ResultData(ErrorCode.BILL_PAY_ERROR.getCode(), "抵扣金额不能大于实际预收总金额"); | |||
| } | |||
| Date date = new Date(); | |||
| if (record.getId() == null) { | |||
| @@ -51,6 +51,8 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| @Autowired | |||
| WxEnergyFeesMapper wxEnergyFeesMapper; | |||
| @Autowired | |||
| WxEnergyFeesSetoffMapper wxEnergyFeesSetoffMapper; | |||
| @Autowired | |||
| WxEnergyReadingCalcuteMapper wxEnergyReadingCalcuteMapper; | |||
| @Lazy | |||
| @@ -244,15 +246,33 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| @Override | |||
| public PageInfo<WxEnergyFees> feesListAsPage(WxEnergyFees record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyFeesMapper.findList(record)); | |||
| public PageInfo<WxEnergyFees> feesListAsPage(WxEnergyFees record, Integer pageIndex, Integer pageSize,boolean isSetOff) { | |||
| PageInfo<WxEnergyFees> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxEnergyFeesMapper.findList(record)); | |||
| //如果是预充费用,还需要查询可冲抵科目 | |||
| if (isSetOff) { | |||
| if (null != page && null != page.getList()) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> feesMap = this.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxEnergyFees at = page.getList().get(i); | |||
| WxEnergyFeesSetoff tf = new WxEnergyFeesSetoff(); | |||
| tf.updateTenantInfo(at); | |||
| tf.setAdvanceFeesId(at.getId()); | |||
| at.setFeesIds(wxEnergyFeesSetoffMapper.findFeesIdList(tf)); | |||
| at.setFeesName(at.getFeesIdsName(feesMap)); | |||
| } | |||
| } | |||
| } | |||
| return page; | |||
| } | |||
| @Override | |||
| public void saveOrUpdateFees(WxEnergyFees record) { | |||
| Date date = new Date(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateTime(date); | |||
| record.setUpdateTime(date); | |||
| @@ -273,6 +293,28 @@ public class WxEnergyServiceImpl implements WxEnergyService { | |||
| } | |||
| record.setUpdateTime(date); | |||
| wxEnergyFeesMapper.updateById(record); | |||
| //如果是预充的,则需处理管理科目 | |||
| if (fees.getBillType().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | |||
| //先删掉之前的关联 | |||
| WxEnergyFeesSetoff fd = new WxEnergyFeesSetoff(); | |||
| fd.updateTenantInfo(record); | |||
| fd.setAdvanceFeesId(record.getId()); | |||
| wxEnergyFeesSetoffMapper.deleteByAdvanceId(fd); | |||
| if (null != record.getFeesIds()) { | |||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||
| Long feeid = record.getFeesIds().get(i); | |||
| WxEnergyFeesSetoff tf = new WxEnergyFeesSetoff(); | |||
| tf.setId(idWorker.nextId()); | |||
| tf.setAdvanceFeesId(record.getId()); | |||
| tf.setFeesId(feeid); | |||
| tf.setCreateTime(new Date()); | |||
| tf.setUpdateTime(new Date()); | |||
| wxEnergyFeesSetoffMapper.insert(tf); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -8,22 +8,28 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.dto.FinanceSetOffDTO; | |||
| import com.iformall.domain.dto.WxBillPayDTO; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillAdvance; | |||
| import com.iformall.domain.po.WxBillPayWay; | |||
| import com.iformall.domain.po.WxEnergyFees; | |||
| import com.iformall.domain.po.WxFinanceAdvanceType; | |||
| import com.iformall.domain.po.WxFinanceAdvanceTypeFees; | |||
| import com.iformall.domain.po.WxEnergyFeesSetoff; | |||
| import com.iformall.domain.po.WxFinanceReceive; | |||
| import com.iformall.domain.po.WxFinanceReceiveBill; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.WxBillBaseEntity; | |||
| import com.iformall.enums.EnumBillAllType; | |||
| import com.iformall.enums.EnumBillStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveStatus; | |||
| import com.iformall.enums.EnumFinanceReceiveType; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxBillPayWayMapper; | |||
| import com.iformall.mapper.WxFinanceAdvanceTypeFeesMapper; | |||
| import com.iformall.mapper.WxFinanceAdvanceTypeMapper; | |||
| import com.iformall.mapper.WxEnergyFeesSetoffMapper; | |||
| import com.iformall.mapper.WxFinanceReceiveBillMapper; | |||
| import com.iformall.mapper.WxFinanceReceiveMapper; | |||
| import com.iformall.service.WxBillAdvanceService; | |||
| import com.iformall.service.WxEnergyService; | |||
| import com.iformall.service.WxFinanceService; | |||
| import com.iformall.service.WxMerchantService; | |||
| @@ -39,6 +45,9 @@ import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.math.BigDecimal; | |||
| import java.util.ArrayList; | |||
| import java.util.Collections; | |||
| import java.util.Comparator; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| @@ -53,9 +62,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| @Autowired | |||
| WxBillPayWayMapper wxBillPayWayMapper; | |||
| @Autowired | |||
| WxFinanceAdvanceTypeMapper wxFinanceAdvanceTypeMapper; | |||
| @Autowired | |||
| WxFinanceAdvanceTypeFeesMapper wxFinanceAdvanceTypeFeesMapper; | |||
| WxEnergyFeesSetoffMapper wxEnergyFeesSetoffMapper; | |||
| @Autowired | |||
| WxFinanceReceiveMapper wxFinanceReceiveMapper; | |||
| @Autowired | |||
| @@ -74,6 +81,9 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| @Lazy | |||
| @Autowired | |||
| WxBillAllHelper wxBillAllHelper; | |||
| @Lazy | |||
| @Autowired | |||
| WxBillAdvanceService wxBillAdvanceService; | |||
| @@ -149,103 +159,33 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| payway2.setCreateTime(new Date()); | |||
| payway2.setUpdateTime(new Date()); | |||
| wxBillPayWayMapper.insert(payway2); | |||
| WxBillPayWay payway3 = new WxBillPayWay(); | |||
| payway3.updateTenantInfo(tenantInfo); | |||
| payway3.setId(Constant.bill_pay_way_setoff); | |||
| payway3.setName("预充抵扣"); | |||
| payway3.setIsDel(EnumYesOrNo.NO.getCode()); | |||
| payway3.setIsSystem(EnumYesOrNo.YES.getCode()); | |||
| payway3.setCreateTime(new Date()); | |||
| payway3.setUpdateTime(new Date()); | |||
| wxBillPayWayMapper.insert(payway3); | |||
| } | |||
| @Override | |||
| public PageInfo<WxFinanceAdvanceType> advanceTypeListAsPage(WxFinanceAdvanceType record, Integer pageIndex, | |||
| Integer pageSize) { | |||
| PageInfo<WxFinanceAdvanceType> page = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxFinanceAdvanceTypeMapper.findList(record)); | |||
| if (null != page && null != page.getList()) { | |||
| WxEnergyFees fq = new WxEnergyFees(); | |||
| fq.updateTenantInfo(record); | |||
| Map<Long, WxEnergyFees> feesMap = wxEnergyService.getFeesMap(fq); | |||
| for (int i = 0 ; i < page.getList().size() ; i++) { | |||
| WxFinanceAdvanceType at = page.getList().get(i); | |||
| WxFinanceAdvanceTypeFees tf = new WxFinanceAdvanceTypeFees(); | |||
| tf.updateTenantInfo(at); | |||
| tf.setAdvanceTypeId(at.getId()); | |||
| at.setFeesIds(wxFinanceAdvanceTypeFeesMapper.findFeesIdList(tf)); | |||
| at.setFeesName(at.getFeesIdsName(feesMap)); | |||
| } | |||
| } | |||
| return page; | |||
| } | |||
| @Override | |||
| public WxFinanceAdvanceType getAdvanceTypeById(TenantEntity tenantEntity, Long id) { | |||
| return wxFinanceAdvanceTypeMapper.selectById(id, tenantEntity.getTenantId()); | |||
| } | |||
| @Override | |||
| public void saveOrUpdateAdvanceType(WxFinanceAdvanceType record) { | |||
| Date date = new Date(); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| if (record.getId() == null) { | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateTime(date); | |||
| record.setUpdateTime(date); | |||
| try { | |||
| wxFinanceAdvanceTypeMapper.insert(record); | |||
| } catch (Exception e) { | |||
| logger.error("保存失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| } else { | |||
| //先删掉之前的关联 | |||
| WxFinanceAdvanceTypeFees fd = new WxFinanceAdvanceTypeFees(); | |||
| fd.updateTenantInfo(record); | |||
| fd.setAdvanceTypeId(record.getId()); | |||
| wxFinanceAdvanceTypeFeesMapper.deleteByAdvanceId(fd); | |||
| record.setUpdateTime(date); | |||
| wxFinanceAdvanceTypeMapper.updateById(record); | |||
| } | |||
| if (null != record.getFeesIds()) { | |||
| for (int i = 0 ; i < record.getFeesIds().size(); i++) { | |||
| Long feeid = record.getFeesIds().get(i); | |||
| WxFinanceAdvanceTypeFees tf = new WxFinanceAdvanceTypeFees(); | |||
| tf.setId(idWorker.nextId()); | |||
| tf.setAdvanceTypeId(record.getId()); | |||
| tf.setFeesId(feeid); | |||
| tf.setCreateTime(new Date()); | |||
| tf.setUpdateTime(new Date()); | |||
| wxFinanceAdvanceTypeFeesMapper.insert(tf); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void updateAdvanceTypeIsDel(WxFinanceAdvanceType record) { | |||
| wxFinanceAdvanceTypeMapper.setIsDel(record.getId(), record.getTenantId(), record.getIsDel()); | |||
| public List<WxFinanceReceive> getMerchantAdvanceGroupSumList(WxFinanceReceive record){ | |||
| return wxFinanceReceiveMapper.getMerchantAdvanceGroupSumList(record); | |||
| } | |||
| @Override | |||
| public Map<Long, WxFinanceAdvanceType> getAdvanceTypeMap(WxFinanceAdvanceType record) { | |||
| List<WxFinanceAdvanceType> list = wxFinanceAdvanceTypeMapper.findList(record); | |||
| if (null != list && list.size() > 0 ) { | |||
| Map<Long,WxFinanceAdvanceType> retMap = new HashMap<Long,WxFinanceAdvanceType>(); | |||
| for (int i = 0 ; i<list.size() ; i ++) { | |||
| WxFinanceAdvanceType m = list.get(i); | |||
| retMap.put(m.getId(), m); | |||
| } | |||
| return retMap; | |||
| } | |||
| return null; | |||
| } | |||
| private List<WxFinanceAdvance> getAdvanceListByFeesId(TenantEntity tenantEntity,Long feesId) { | |||
| WxFinanceAdvanceTypeFees tf = new WxFinanceAdvanceTypeFees(); | |||
| private List<WxFinanceReceive> getAdvanceListByFeesId(TenantEntity tenantEntity,Long feesId) { | |||
| WxEnergyFeesSetoff tf = new WxEnergyFeesSetoff(); | |||
| tf.updateTenantInfo(tenantEntity); | |||
| tf.setFeesId(feesId); | |||
| List<Long> advanceTypeIdList = wxFinanceAdvanceTypeFeesMapper.findadvanceTypeIdList(tf); | |||
| if (null != advanceTypeIdList && advanceTypeIdList.size() > 0 ) { | |||
| WxFinanceAdvance faq = new WxFinanceAdvance(); | |||
| List<Long> feesIdList = wxEnergyFeesSetoffMapper.findadvanceFeesIdList(tf); | |||
| if (null != feesIdList && feesIdList.size() > 0 ) { | |||
| WxFinanceReceive faq = new WxFinanceReceive(); | |||
| faq.updateTenantInfo(tenantEntity); | |||
| faq.setAdvanceTypeIdList(advanceTypeIdList); | |||
| return wxFinanceAdvanceMapper.findList(faq); | |||
| faq.setFeesIdList(feesIdList); | |||
| return wxFinanceReceiveMapper.findList(faq); | |||
| }else { | |||
| return null; | |||
| } | |||
| @@ -261,19 +201,19 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| return null; | |||
| } | |||
| //通过科目去查询可以抵扣的预充费用 | |||
| List<WxFinanceAdvance> advanceList = getAdvanceListByFeesId(dto, be.getEnergyFeesId()); | |||
| List<WxFinanceReceive> advanceList = getAdvanceListByFeesId(dto, be.getEnergyFeesId()); | |||
| if (null != advanceList && advanceList.size() > 0 ) { | |||
| WxFinanceAdvanceType atq = new WxFinanceAdvanceType(); | |||
| WxEnergyFees atq = new WxEnergyFees(); | |||
| atq.updateTenantInfo(dto); | |||
| Map<Long, WxFinanceAdvanceType> typeMap = this.getAdvanceTypeMap(atq); | |||
| Map<Long, WxEnergyFees> typeMap = wxEnergyService.getFeesMap(atq); | |||
| List retList = new ArrayList(); | |||
| for (int i = 0 ; i < advanceList.size() ; i ++) { | |||
| WxFinanceAdvance a = advanceList.get(i); | |||
| WxFinanceReceive a = advanceList.get(i); | |||
| Map m = new HashMap(); | |||
| m.put("id", a.getId()); | |||
| if (null != typeMap) { | |||
| WxFinanceAdvanceType fat = typeMap.get(a.getAdvanceTypeId()); | |||
| if (null != typeMap && null != a.getFeesId()) { | |||
| WxEnergyFees fat = typeMap.get(a.getFeesId()); | |||
| if (null != fat) { | |||
| m.put("name", fat.getName()); | |||
| m.put("rate", fat.getRate()); | |||
| @@ -303,18 +243,26 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| if (new BigDecimal(bill.getOwe()).compareTo(new BigDecimal(0)) <= 0) { | |||
| return null; | |||
| } | |||
| WxFinanceAdvance advance = this.getAdvanceById(dto, dto.getFinanceAdvanceId()); | |||
| WxFinanceAdvanceType advanceType= getAdvanceTypeById(dto,advance.getAdvanceTypeId()); | |||
| WxFinanceReceive advance = this.getReceiveById(dto, dto.getFinanceAdvanceId()); | |||
| WxEnergyFees ef = new WxEnergyFees(); | |||
| ef.updateTenantInfo(dto); | |||
| ef.setId(advance.getFeesId()); | |||
| WxEnergyFees advanceFees= wxEnergyService.getFeesById(ef); | |||
| //设置账单冲抵金额 | |||
| String money = calcuteSetOffMoney(advanceFees.getRate(),bill.getOwe()); | |||
| //应该是不创建收款记录。因为一个收款记录会包括收款和冲抵的账单详情 | |||
| //新增收款记录,冲抵,关联冲抵账单 | |||
| WxFinanceReceive addreceive = new WxFinanceReceive(); | |||
| String money = calcuteSetOffMoney(advanceType.getRate(),bill.getOwe()); | |||
| addreceive.updateTenantInfo(dto); | |||
| addreceive.setTotalMoney(money); | |||
| addreceive.setMoneyDetail(JSON.toJSONString(advance)); | |||
| addreceive.setMerchantId(bill.getMerchantId()); | |||
| addreceive.setRemark(advanceType.getName()+"冲抵"); | |||
| addreceive.setType(EnumFinanceReceiveType.SETOFF.getCode()); | |||
| // addreceive.setRemark(advanceType.getName()+"冲抵"); | |||
| // addreceive.setType(EnumFinanceReceiveType.SETOFF.getCode()); | |||
| this.saveOrUpdateReceive(addreceive,user); | |||
| //更新账单 | |||
| WxBillPayDTO payDto = new WxBillPayDTO(); | |||
| @@ -408,14 +356,14 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| fr.setMerchantName(merchant.getName()); | |||
| } | |||
| } | |||
| //查询关联的账单记录 | |||
| WxFinanceReceiveBill rb = new WxFinanceReceiveBill(); | |||
| rb.updateTenantInfo(record); | |||
| rb.setReceiveId(fr.getId()); | |||
| List<WxFinanceReceiveBill> bills = wxFinanceReceiveBillMapper.findList(rb); | |||
| if (null != bills && bills.size() > 0 ) { | |||
| } | |||
| // //查询关联的账单记录 | |||
| // WxFinanceReceiveBill rb = new WxFinanceReceiveBill(); | |||
| // rb.updateTenantInfo(record); | |||
| // rb.setReceiveId(fr.getId()); | |||
| // List<WxFinanceReceiveBill> bills = wxFinanceReceiveBillMapper.findList(rb); | |||
| // if (null != bills && bills.size() > 0 ) { | |||
| // | |||
| // } | |||
| } | |||
| } | |||
| @@ -442,6 +390,19 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||
| logger.error("保存失败,e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| //增加预收账单 | |||
| WxBillAdvance billAdvance = new WxBillAdvance(); | |||
| billAdvance.updateTenantInfo(user); | |||
| billAdvance.setMerchantId(record.getMerchantId()); | |||
| WxMerchant merchant = wxMerchantService.selectById(record.getMerchantId()); | |||
| billAdvance.setRentShopType(merchant.getRentShopType()); | |||
| billAdvance.setReceivePay(record.getTotalMoney()); | |||
| billAdvance.setPay("0"); | |||
| billAdvance.setStarttime(new Date()); | |||
| billAdvance.setEndtime(new Date()); | |||
| billAdvance.setStatus(EnumBillStatus.SET_OFF.getCode()); | |||
| billAdvance.setEnergyFeesId(record.getFeesId()); | |||
| wxBillAdvanceService.saveOrUpdate(billAdvance, user); | |||
| } else { | |||
| record.setUpdateBy(user.getId()); | |||
| record.setUpdateByName(user.getName()); | |||
| @@ -145,6 +145,7 @@ public class Constant { | |||
| public static final Long bill_pay_way_minigrame = 1L; | |||
| public static final Long bill_pay_way_system = 2L; | |||
| public static final Long bill_pay_way_setoff = 3L; | |||
| } | |||
| @@ -17,10 +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="rate" jdbcType="VARCHAR" property="rate"/> | |||
| </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` | |||
| `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`,`rate` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -36,12 +38,14 @@ | |||
| <if test=" null != publicCalcute ">and `public_calcute` = #{publicCalcute}</if> | |||
| <if test=" null != type ">and `type` = #{type}</if> | |||
| <if test=" null != billType ">and `bill_type` = #{billType}</if> | |||
| <if test=" null != notEnergy ">and `bill_type` != 3</if> | |||
| <if test=" null != commonOperate ">and `bill_type` != 3 and `bill_type` != 6</if> | |||
| <if test=" null != notSetOff ">and `bill_type` != 6</if> | |||
| <if test=" null != isSystem ">and `is_system` = #{isSystem}</if> | |||
| <if test=" null != fixedPrice ">and `fixed_price` = #{fixedPrice}</if> | |||
| <if test=" null != calcuteUnit ">and `calcute_unit` = #{calcuteUnit}</if> | |||
| <if test=" null != timeUnit ">and `time_unit` = #{timeUnit}</if> | |||
| <if test=" null != name and '' != name ">and name like concat('%', #{name},'%')</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -1,18 +1,18 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxFinanceAdvanceTypeFeesMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFinanceAdvanceTypeFees"> | |||
| <mapper namespace="com.iformall.mapper.WxEnergyFeesSetoffMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxEnergyFeesSetoff"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="advance_type_id" jdbcType="BIGINT" property="advanceTypeId"/> | |||
| <result column="advance_fees_id" jdbcType="BIGINT" property="advanceFeesId"/> | |||
| <result column="fees_id" jdbcType="BIGINT" property="feesId"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`advance_type_id`,`fees_id` | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`advance_fees_id`,`fees_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -24,7 +24,7 @@ | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != advanceTypeId ">and `advance_type_id` = #{advanceTypeId}</if> | |||
| <if test=" null != advanceFeesId ">and `advance_fees_id` = #{advanceFeesId}</if> | |||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -35,33 +35,33 @@ | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxFinanceAdvanceTypeFees" resultMap="BaseResultMap"> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_finance_advance_type_fees | |||
| from wx_energy_fees_setoff | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxFinanceAdvanceTypeFees" resultType="Long"> | |||
| <select id="findFeesIdList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultType="Long"> | |||
| select distinct fees_id | |||
| from wx_finance_advance_type_fees | |||
| from wx_energy_fees_setoff | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findadvanceTypeIdList" parameterType="com.iformall.domain.po.WxFinanceAdvanceTypeFees" resultType="Long"> | |||
| select distinct advance_type_id | |||
| from wx_finance_advance_type_fees | |||
| <select id="findadvanceFeesIdList" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" resultType="Long"> | |||
| select distinct advance_fees_id | |||
| from wx_energy_fees_setoff | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_finance_advance_type_fees where id = #{id} and `tenant_id` = #{tenantId} | |||
| from wx_energy_fees_setoff where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| <delete id="deleteByAdvanceId" parameterType="com.iformall.domain.po.WxFinanceAdvanceTypeFees" > | |||
| delete from wx_finance_advance_type_fees where `tenant_id` = #{tenantId} and advance_type_id = #{advanceTypeId} | |||
| <delete id="deleteByAdvanceId" parameterType="com.iformall.domain.po.WxEnergyFeesSetoff" > | |||
| delete from wx_energy_fees_setoff where `tenant_id` = #{tenantId} and advance_fees_id = #{advanceFeesId} | |||
| </delete> | |||
| </mapper> | |||
| @@ -1,57 +0,0 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxFinanceAdvanceTypeMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxFinanceAdvanceType"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="is_del" jdbcType="INTEGER" property="isDel"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="rate" jdbcType="VARCHAR" property="rate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`is_del`,`name`,`rate` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1=1 | |||
| <if test=" null != id ">and `id` = #{id}</if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != isDel ">and `is_del` = #{isDel}</if> | |||
| <if test=" null != name and '' != name ">and name like concat('%', #{name},'%')</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxFinanceAdvanceType" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_finance_advance_type | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectById" parameterType="HashMap" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_finance_advance_type where id = #{id} and `tenant_id` = #{tenantId} | |||
| </select> | |||
| <update id = "setIsDel" parameterType="HashMap"> | |||
| update wx_finance_advance_type set is_del = #{isDel} where id = #{id} and `tenant_id` = #{tenantId} | |||
| </update> | |||
| </mapper> | |||
| @@ -17,11 +17,12 @@ | |||
| <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/> | |||
| <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> | |||
| <result column="remark" jdbcType="VARCHAR" property="remark"/> | |||
| <result column="fees_id" jdbcType="BIGINT" property="feesId"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`total_money`,`status`,`type`,`money_detail`, | |||
| `create_by`,`create_by_name`,`update_by`,`update_by_name`,`merchant_id`,`remark` | |||
| `create_by`,`create_by_name`,`update_by`,`update_by_name`,`merchant_id`,`remark`,`feesId` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -38,12 +39,19 @@ | |||
| <if test=" null != merchantId ">and `merchantId` = #{merchant_id}</if> | |||
| <if test=" null != createTimeBegin ">and `create_time` >= #{createTimeBegin}</if> | |||
| <if test=" null != createTimeEnd ">and `create_time` <= #{createTimeEnd}</if> | |||
| <if test=" null != feesId ">and `fees_id` = #{feesId}</if> | |||
| <if test=" null != merchantIdList "> | |||
| and merchantId in | |||
| <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")"> | |||
| #{midItem} | |||
| </foreach> | |||
| </if> | |||
| </if> | |||
| <if test=" null != feesIdList "> | |||
| and fees_id in | |||
| <foreach collection="feesIdList" index="index" item="fidItem" open="(" separator="," close=")"> | |||
| #{fidItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -69,6 +77,11 @@ | |||
| <update id = "setIsDel" parameterType="HashMap"> | |||
| update wx_finance_receive set is_del = #{isDel} where id = #{id} and `tenant_id` = #{tenantId} | |||
| </update> | |||
| <select id="getMerchantAdvanceGroupSumList" parameterType="com.iformall.domain.po.WxFinanceReceive" resultMap="BaseResultMap"> | |||
| select fees_id,sum(CAST(money AS DECIMAL(20,4))) as total_money | |||
| from wx_finance_receive where type = 2 and status group by fees_id | |||
| </select> | |||
| </mapper> | |||