| @@ -19,6 +19,7 @@ import com.iformall.domain.po.WxFinanceReceiveBill; | |||||
| import com.iformall.domain.po.WxFinanceReceivePayway; | import com.iformall.domain.po.WxFinanceReceivePayway; | ||||
| import com.iformall.domain.po.WxFinanceReceiveSetoff; | import com.iformall.domain.po.WxFinanceReceiveSetoff; | ||||
| import com.iformall.domain.po.WxFlowModel; | import com.iformall.domain.po.WxFlowModel; | ||||
| import com.iformall.domain.po.WxShop; | |||||
| import com.iformall.domain.po.base.BaseEntity; | import com.iformall.domain.po.base.BaseEntity; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | import com.iformall.domain.vo.FinanceBillSetoffSum; | ||||
| @@ -270,8 +271,8 @@ public class WxFinanceController extends BaseController { | |||||
| if (null == record.getEnergyFeesId()) { | if (null == record.getEnergyFeesId()) { | ||||
| return new ResultData(Result.ERROR,"请选择科目"); | return new ResultData(Result.ERROR,"请选择科目"); | ||||
| } | } | ||||
| if (null == record.getMerchantId()) { | |||||
| return new ResultData(Result.ERROR,"请选择商户"); | |||||
| if (null == record.getShopId()) { | |||||
| return new ResultData(Result.ERROR,"请选择房源"); | |||||
| } | } | ||||
| // if (!this.isValidPayTime(record.getReceiveDate())) { | // if (!this.isValidPayTime(record.getReceiveDate())) { | ||||
| // return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | // return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); | ||||
| @@ -280,12 +281,12 @@ public class WxFinanceController extends BaseController { | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| //查询商户预收总计 | |||||
| //查询铺位预收总计 | |||||
| @GetMapping("getMerchantAdvance") | @GetMapping("getMerchantAdvance") | ||||
| public ResultData getMerchantAdvance(@ModelAttribute WxFinanceReceive record) { | |||||
| public ResultData getMerchantAdvance(@ModelAttribute WxShop record) { | |||||
| record.updateTenantInfo(getTenantInfo()); | record.updateTenantInfo(getTenantInfo()); | ||||
| if (null == record.getMerchantId()) { | |||||
| return new ResultData(Result.ERROR,"请选择商户"); | |||||
| if (null == record.getId()) { | |||||
| return new ResultData(Result.ERROR,"请选择房源"); | |||||
| } | } | ||||
| FinanceBillSetoffSum sum = wxFinanceService.getBillSetoffSum(record); | FinanceBillSetoffSum sum = wxFinanceService.getBillSetoffSum(record); | ||||
| return new ResultData(sum); | return new ResultData(sum); | ||||
| @@ -1,3 +1,5 @@ | |||||
| ##备份 ########## wx_rent_contract,wx_property_contract,wx_shop_users | |||||
| alter table wx_rent_contract drop column merchant_id; | alter table wx_rent_contract drop column merchant_id; | ||||
| alter table wx_rent_contract drop column merchant_name; | alter table wx_rent_contract drop column merchant_name; | ||||
| alter table wx_rent_contract drop column brand; | alter table wx_rent_contract drop column brand; | ||||
| @@ -45,6 +47,27 @@ alter table wx_property_contract drop column pay_date; | |||||
| #此处要把万星的合同,根据商户的刷成customers_id (商业和soho的) | #此处要把万星的合同,根据商户的刷成customers_id (商业和soho的) | ||||
| alter table wx_rent_contract add column customers_id bigint(20) not null comment '客户ID'; | alter table wx_rent_contract add column customers_id bigint(20) not null comment '客户ID'; | ||||
| alter table wx_shop_users change shop_id create_shop_id bigint(20) not null; | |||||
| alter table wx_shop_users drop column status; | |||||
| alter table wx_shop_users drop column begin_date; | |||||
| alter table wx_shop_users drop column end_date; | |||||
| CREATE TABLE `wx_shop_users_shop` ( | |||||
| `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', | |||||
| `shop_id` bigint(20) NOT NULL COMMENT '店铺编号', | |||||
| `begin_date` datetime DEFAULT NULL COMMENT '入住日期', | |||||
| `end_date` datetime DEFAULT NULL COMMENT '离开日期', | |||||
| `create_date` datetime NOT NULL COMMENT '创建时间', | |||||
| `update_date` datetime NOT NULL COMMENT '更新时间', | |||||
| `status` int(1) NOT NULL DEFAULT '0' COMMENT '状态', | |||||
| `shop_user_id` bigint(20) NOT NULL, | |||||
| PRIMARY KEY (`id`), | |||||
| UNIQUE KEY `id_UNIQUE` (`id`), | |||||
| UNIQUE KEY `UNIQUE_S_U` (`tenant_id`,`shop_id`,`shop_user_id`) | |||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商铺'; | |||||
| CREATE TABLE `wx_contract_customers` ( | CREATE TABLE `wx_contract_customers` ( | ||||
| `id` bigint(20) NOT NULL COMMENT '主键ID', | `id` bigint(20) NOT NULL COMMENT '主键ID', | ||||
| @@ -685,5 +708,205 @@ alter table wx_finance_receive_bill_98 add column shop_id bigint(20) not nu | |||||
| alter table wx_finance_receive_bill_99 add column shop_id bigint(20) not null ; | alter table wx_finance_receive_bill_99 add column shop_id bigint(20) not null ; | ||||
| alter table wx_finance_receive_0 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_1 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_2 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_3 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_4 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_5 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_6 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_7 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_8 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_9 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_10 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_11 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_12 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_13 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_14 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_15 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_16 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_17 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_18 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_19 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_20 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_21 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_22 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_23 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_24 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_25 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_26 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_27 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_28 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_29 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_30 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_31 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_32 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_33 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_34 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_35 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_36 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_37 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_38 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_39 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_40 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_41 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_42 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_43 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_44 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_45 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_46 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_47 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_48 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_49 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_50 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_51 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_52 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_53 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_54 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_55 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_56 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_57 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_58 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_59 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_60 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_61 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_62 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_63 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_64 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_65 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_66 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_67 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_68 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_69 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_70 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_71 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_72 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_73 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_74 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_75 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_76 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_77 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_78 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_79 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_80 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_81 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_82 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_83 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_84 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_85 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_86 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_87 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_88 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_89 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_90 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_91 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_92 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_93 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_94 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_95 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_96 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_97 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_98 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_99 add column bill_cus_name varchar(300) comment '客户名称' ; | |||||
| alter table wx_finance_receive_0 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_1 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_2 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_3 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_4 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_5 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_6 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_7 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_8 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_9 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_10 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_11 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_12 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_13 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_14 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_15 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_16 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_17 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_18 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_19 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_20 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_21 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_22 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_23 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_24 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_25 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_26 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_27 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_28 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_29 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_30 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_31 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_32 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_33 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_34 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_35 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_36 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_37 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_38 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_39 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_40 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_41 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_42 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_43 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_44 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_45 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_46 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_47 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_48 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_49 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_50 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_51 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_52 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_53 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_54 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_55 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_56 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_57 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_58 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_59 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_60 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_61 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_62 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_63 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_64 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_65 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_66 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_67 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_68 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_69 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_70 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_71 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_72 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_73 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_74 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_75 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_76 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_77 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_78 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_79 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_80 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_81 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_82 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_83 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_84 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_85 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_86 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_87 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_88 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_89 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_90 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_91 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_92 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_93 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_94 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_95 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_96 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_97 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_98 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| alter table wx_finance_receive_99 add column bill_shop_number varchar(300) comment '店铺编号' ; | |||||
| @@ -296,7 +296,7 @@ public class WxAllBill extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "是否可以编辑", name = "canEdit") | @io.swagger.annotations.ApiModelProperty(value = "是否可以编辑", name = "canEdit") | ||||
| private Integer canEdit; | private Integer canEdit; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "客户名称(临时费用添加时设置)", name = "cusName") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "客户名称", name = "cusName") | |||||
| private String cusName; | private String cusName; | ||||
| @io.swagger.annotations.ApiModelProperty(value="楼座号",name="building") | @io.swagger.annotations.ApiModelProperty(value="楼座号",name="building") | ||||
| @@ -167,6 +167,12 @@ public class WxFinanceReceive extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "父编号,红冲单据", name = "parentId") | @io.swagger.annotations.ApiModelProperty(value = "父编号,红冲单据", name = "parentId") | ||||
| private Long parentId; | private Long parentId; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "客户名称(多个逗号分隔)", name = "billCusName") | |||||
| private String billCusName; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "铺位号(多个逗号分隔,便于查询)", name = "billCusName") | |||||
| private String billShopNumber; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<WxAllBill> bills; | private List<WxAllBill> bills; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -177,7 +183,7 @@ public class WxFinanceReceive extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long floor; | private Long floor; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String shopIds; | |||||
| private String queryShopNumber; | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long finishId; | private Long finishId; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -27,8 +27,8 @@ public class WxShopUsers extends TenantEntity { | |||||
| private Long id; | private Long id; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "店铺编号", name = "shopId") | |||||
| private Long shopId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "创建的店铺编号", name = "createShopId") | |||||
| private Long createShopId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "类型EnumShopUsersType", name = "type") | @io.swagger.annotations.ApiModelProperty(value = "类型EnumShopUsersType", name = "type") | ||||
| private Integer type; | private Integer type; | ||||
| @@ -78,30 +78,9 @@ public class WxShopUsers extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") | @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") | ||||
| private String linkPerson; | private String linkPerson; | ||||
| @io.swagger.annotations.ApiModelProperty(value="入住日期",name="beginDate") | |||||
| private Date beginDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="离开日期",name="endDate") | |||||
| private Date endDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
| private Date updateDate; | private Date updateDate; | ||||
| @Excel(name="状态",width = 20,orderNum = "7",replace = {"当前_0","往任_1"}) | |||||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:当前, 1:往任)EnumShopUsersStatus",name="status") | |||||
| private Integer status; | |||||
| @TableField(exist = false) | |||||
| private String statusName; | |||||
| public String getStatusName() { | |||||
| if (null != status) { | |||||
| return EnumShopUsersStatus.getEnum(status).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @TableField(exist = false) | |||||
| private List<Long> shopIds; | |||||
| } | } | ||||
| @@ -0,0 +1,62 @@ | |||||
| package com.iformall.domain.po; | |||||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.common.SortColumn; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.enums.EnumCUserBaseInfoSex; | |||||
| import com.iformall.enums.EnumRentShopType; | |||||
| import com.iformall.enums.EnumShopUsersPrincipalType; | |||||
| import com.iformall.enums.EnumShopUsersStatus; | |||||
| import com.iformall.enums.EnumShopUsersType; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.math.BigDecimal; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @TableName(value = "wx_shop_users") | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxShopUsersShop extends TenantEntity { | |||||
| private Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "店铺编号", name = "shopId") | |||||
| private Long shopId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "人员编号", name = "shopUserId") | |||||
| private Long shopUserId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="入住日期",name="beginDate") | |||||
| private Date beginDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="离开日期",name="endDate") | |||||
| private Date endDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| @Excel(name="状态",width = 20,orderNum = "7",replace = {"当前_0","往任_1"}) | |||||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:当前, 1:往任)EnumShopUsersStatus",name="status") | |||||
| private Integer status; | |||||
| @TableField(exist = false) | |||||
| private String statusName; | |||||
| public String getStatusName() { | |||||
| if (null != status) { | |||||
| return EnumShopUsersStatus.getEnum(status).getMessage(); | |||||
| } | |||||
| return null; | |||||
| } | |||||
| @TableField(exist = false) | |||||
| private List<Long> shopIds; | |||||
| } | |||||
| @@ -9,5 +9,4 @@ import java.util.List; | |||||
| public interface WxShopUsersMapper extends CommonMapper<WxShopUsers, String> { | public interface WxShopUsersMapper extends CommonMapper<WxShopUsers, String> { | ||||
| List<WxShopUsers> findList(WxShopUsers wxShop); | List<WxShopUsers> findList(WxShopUsers wxShop); | ||||
| List<Long> findShopIdList(WxShopUsers wxShop); | |||||
| } | } | ||||
| @@ -0,0 +1,14 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxShopUsersShop; | |||||
| import java.util.List; | |||||
| /** | |||||
| */ | |||||
| public interface WxShopUsersShopMapper extends CommonMapper<WxShopUsersShop, String> { | |||||
| List<WxShopUsersShop> findList(WxShopUsersShop wxShop); | |||||
| List<Long> findShopIdList(WxShopUsersShop wxShop); | |||||
| } | |||||
| @@ -23,6 +23,7 @@ import com.iformall.domain.po.WxFinanceReceive; | |||||
| import com.iformall.domain.po.WxFinanceReceiveBill; | import com.iformall.domain.po.WxFinanceReceiveBill; | ||||
| import com.iformall.domain.po.WxFinanceReceivePayway; | import com.iformall.domain.po.WxFinanceReceivePayway; | ||||
| import com.iformall.domain.po.WxFinanceReceiveSetoff; | import com.iformall.domain.po.WxFinanceReceiveSetoff; | ||||
| import com.iformall.domain.po.WxShop; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.FinanceBillSetoffSum; | import com.iformall.domain.vo.FinanceBillSetoffSum; | ||||
| import com.iformall.domain.vo.WxFinanceReceiveBillSum; | import com.iformall.domain.vo.WxFinanceReceiveBillSum; | ||||
| @@ -61,7 +62,7 @@ public interface WxFinanceService { | |||||
| void updateReceiveStatus(WxFinanceReceive record); | void updateReceiveStatus(WxFinanceReceive record); | ||||
| //预收款 | //预收款 | ||||
| List<WxAllBill> calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); | List<WxAllBill> calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); | ||||
| FinanceBillSetoffSum getBillSetoffSum(WxFinanceReceive record); | |||||
| FinanceBillSetoffSum getBillSetoffSum(WxShop wxShop); | |||||
| //List<WxFinanceReceive> getSetOffList(FinanceSetOffDTO dto,boolean isMerge); | //List<WxFinanceReceive> getSetOffList(FinanceSetOffDTO dto,boolean isMerge); | ||||
| PageInfo<WxFinanceReceiveSetoff> receiveSetoffListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | PageInfo<WxFinanceReceiveSetoff> receiveSetoffListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); | ||||
| @@ -30,6 +30,7 @@ import com.iformall.domain.po.WxFinanceReceiveSetoff; | |||||
| import com.iformall.domain.po.WxMallFloor; | import com.iformall.domain.po.WxMallFloor; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxShop; | import com.iformall.domain.po.WxShop; | ||||
| import com.iformall.domain.po.WxShopUsers; | |||||
| import com.iformall.domain.po.base.BaseEntity.SortField; | import com.iformall.domain.po.base.BaseEntity.SortField; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.FinanceAdvanceBillVo; | import com.iformall.domain.vo.FinanceAdvanceBillVo; | ||||
| @@ -44,6 +45,7 @@ import com.iformall.enums.EnumBillStatus; | |||||
| import com.iformall.enums.EnumFinanceCashierType; | import com.iformall.enums.EnumFinanceCashierType; | ||||
| import com.iformall.enums.EnumFinanceFinishStatus; | import com.iformall.enums.EnumFinanceFinishStatus; | ||||
| import com.iformall.enums.EnumFinanceReceiveStatus; | import com.iformall.enums.EnumFinanceReceiveStatus; | ||||
| import com.iformall.enums.EnumShopUsersStatus; | |||||
| import com.iformall.enums.EnumYesOrNo; | import com.iformall.enums.EnumYesOrNo; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillPayWayMapper; | import com.iformall.mapper.WxBillPayWayMapper; | ||||
| @@ -240,13 +242,13 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public FinanceBillSetoffSum getBillSetoffSum(WxFinanceReceive record) { | |||||
| public FinanceBillSetoffSum getBillSetoffSum(WxShop record) { | |||||
| //取账单里面的 | //取账单里面的 | ||||
| //查询预存账单 | //查询预存账单 | ||||
| WxAllBill abq = new WxAllBill(); | WxAllBill abq = new WxAllBill(); | ||||
| abq.updateTenantInfo(record); | abq.updateTenantInfo(record); | ||||
| abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | ||||
| abq.setMerchantId(record.getMerchantId()); | |||||
| abq.setShopId(record.getId()); | |||||
| abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | ||||
| List<WxAllBill> advanceList = wxBillAllHelper.getMerchantAdvanceGroupSumList(abq); | List<WxAllBill> advanceList = wxBillAllHelper.getMerchantAdvanceGroupSumList(abq); | ||||
| BigDecimal total = new BigDecimal(0); | BigDecimal total = new BigDecimal(0); | ||||
| @@ -353,13 +355,24 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| } | } | ||||
| //查询出账单可以抵扣的科目预收项 | //查询出账单可以抵扣的科目预收项 | ||||
| Long shopId = null; | |||||
| for (int i = 0 ; i < dto.getBills().size() ; i ++) { | |||||
| WxAllBill be = dto.getBills().get(i); | |||||
| if (null == shopId) { | |||||
| shopId = be.getShopId(); | |||||
| } | |||||
| if (shopId != be.getShopId()) { | |||||
| throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"多个房源合并收款不能冲抵"); | |||||
| } | |||||
| } | |||||
| WxAllBill abq = new WxAllBill(); | WxAllBill abq = new WxAllBill(); | ||||
| abq.updateTenantInfo(dto); | abq.updateTenantInfo(dto); | ||||
| abq.setFeesStandarsId(dto.getFeesId()); | abq.setFeesStandarsId(dto.getFeesId()); | ||||
| abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | abq.setBillType(EnumBillAllType.ADVANCE.getCode()); | ||||
| abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); | ||||
| abq.setSortColumns(SortField.Createtime_ASC); | abq.setSortColumns(SortField.Createtime_ASC); | ||||
| abq.setMerchantId(dto.getBills().get(0).getMerchantId());; | |||||
| //如果是多个店铺的则不能冲抵 | |||||
| abq.setShopId(shopId);; | |||||
| List<WxAllBill> advanceList = wxAllBillService.list(abq); | List<WxAllBill> advanceList = wxAllBillService.list(abq); | ||||
| if (null == advanceList || advanceList.size() <= 0 ) { | if (null == advanceList || advanceList.size() <= 0 ) { | ||||
| return null; | return null; | ||||
| @@ -368,8 +381,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| List<WxAllBill> bills = dto.getBills(); | List<WxAllBill> bills = dto.getBills(); | ||||
| sortBills(bills); | sortBills(bills); | ||||
| //每个账单去计算抵扣 | //每个账单去计算抵扣 | ||||
| WxMerchant merchant = new WxMerchant(); | |||||
| merchant.updateTenantInfo(dto); | |||||
| FinanceSetOffCalcuteDTO calcuteDto = new FinanceSetOffCalcuteDTO(); | FinanceSetOffCalcuteDTO calcuteDto = new FinanceSetOffCalcuteDTO(); | ||||
| calcuteDto.setCurrentIndex(0); | calcuteDto.setCurrentIndex(0); | ||||
| calcuteDto.setAdvanceList(advanceList); | calcuteDto.setAdvanceList(advanceList); | ||||
| @@ -379,7 +390,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| be.setSetOffDetailList(null); | be.setSetOffDetailList(null); | ||||
| be.setCurrentReceive(null); | be.setCurrentReceive(null); | ||||
| be.setCurrentSetOff(null); | be.setCurrentSetOff(null); | ||||
| WxAllBill bill = wxBillAllHelper.getBillDetail(EnumBillAllType.getEnum(be.getBillType()), merchant, be.getId()); | |||||
| WxAllBill bill = wxBillAllHelper.getBillDetail(dto, be.getId()); | |||||
| //如果账单的科目不在冲抵的范围内,则不冲抵 | //如果账单的科目不在冲抵的范围内,则不冲抵 | ||||
| if (setOffFeesIds.contains(bill.getEnergyFeesId())) { | if (setOffFeesIds.contains(bill.getEnergyFeesId())) { | ||||
| be.setReceivePay(bill.getReceivePay()); | be.setReceivePay(bill.getReceivePay()); | ||||
| @@ -398,59 +409,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| } | } | ||||
| private void initQueryParam(WxFinanceReceive record) { | private void initQueryParam(WxFinanceReceive record) { | ||||
| List<Long> queryMerchantIds = new ArrayList<Long>(); | |||||
| if (StringUtils.isNotBlank(record.getShopNumber()) || StringUtils.isNotBlank(record.getShopIds()) | |||||
| || null != record.getBuilding() || null != record.getFloor()) { | |||||
| //根据店铺去找到商户 | |||||
| WxShop sq = new WxShop(); | |||||
| sq.updateTenantInfo(record); | |||||
| sq.setShopNumber(record.getShopNumber()); | |||||
| if (StringUtils.isNotBlank(record.getShopIds())) { | |||||
| String[] sids = record.getShopIds().split(","); | |||||
| if (null != sids) { | |||||
| List<Long> shopIdList = new ArrayList<Long>(); | |||||
| for (int i = 0 ; i < sids.length; i++) { | |||||
| String s = sids[i]; | |||||
| if (StringUtils.isNotBlank(s)) { | |||||
| shopIdList.add(Long.parseLong(s)); | |||||
| } | |||||
| } | |||||
| if (shopIdList.size() > 0 ) { | |||||
| sq.setIds(shopIdList); | |||||
| }else { | |||||
| sq.setId(-1L); | |||||
| } | |||||
| } | |||||
| } | |||||
| sq.setBuilding(record.getBuilding()); | |||||
| sq.setFloor(record.getFloor()); | |||||
| List<Long> merchantIds = wxShopService.getMerchantIds(sq); | |||||
| if (null == merchantIds || merchantIds.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| queryMerchantIds.addAll(merchantIds); | |||||
| } | |||||
| } | |||||
| if (StringUtils.isNotBlank(record.getMerchantName())) { | |||||
| WxMerchant mq = new WxMerchant(); | |||||
| mq.updateTenantInfo(record); | |||||
| mq.setName(record.getMerchantName()); | |||||
| List<Long> mids = wxMerchantService.findIdList(mq); | |||||
| if (null == mids || mids.size() <= 0 ) { | |||||
| record.setId(-1L); | |||||
| }else { | |||||
| if (queryMerchantIds.size() > 0 ) { | |||||
| queryMerchantIds.retainAll(mids); | |||||
| }else { | |||||
| queryMerchantIds.addAll(mids); | |||||
| } | |||||
| } | |||||
| } | |||||
| if (queryMerchantIds.size() > 0 ) { | |||||
| record.setMerchantIdList(queryMerchantIds); | |||||
| } | |||||
| if (null != record.getFinishId()) { | if (null != record.getFinishId()) { | ||||
| WxFinanceFinish finish = wxFinanceFinishMapper.selectById(record.getFinishId(), record.getTenantId()); | WxFinanceFinish finish = wxFinanceFinishMapper.selectById(record.getFinishId(), record.getTenantId()); | ||||
| record.setReceiveDateBegin(finish.getStartDate()); | record.setReceiveDateBegin(finish.getStartDate()); | ||||
| @@ -1259,13 +1217,13 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| public void createTempFees(WxAllBill record,MallUserInfo user) { | public void createTempFees(WxAllBill record,MallUserInfo user) { | ||||
| WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | ||||
| record.setBillType(fees.getBillType()); | record.setBillType(fees.getBillType()); | ||||
| WxMerchant merchant = wxMerchantService.selectById(record.getMerchantId()); | |||||
| WxShop shop = wxShopService.getById(record.getShopId()); | |||||
| if (fees.getBillType().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | if (fees.getBillType().intValue() == EnumBillAllType.ADVANCE.getCode().intValue()) { | ||||
| generateTempBill(record, merchant, user,EnumBillAllType.ADVANCE,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||||
| generateTempBill(record, shop, user,EnumBillAllType.ADVANCE,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||||
| }else if (fees.getBillType().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | }else if (fees.getBillType().intValue() == EnumBillAllType.OTHER_DEPOSIT.getCode().intValue()) { | ||||
| generateTempBill(record, merchant, user,EnumBillAllType.OTHER_DEPOSIT,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||||
| generateTempBill(record, shop, user,EnumBillAllType.OTHER_DEPOSIT,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||||
| }else if (fees.getBillType().intValue() == EnumBillAllType.OTHER.getCode().intValue()) { | }else if (fees.getBillType().intValue() == EnumBillAllType.OTHER.getCode().intValue()) { | ||||
| generateTempBill(record, merchant, user,EnumBillAllType.OTHER,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||||
| generateTempBill(record, shop, user,EnumBillAllType.OTHER,record.getReceivePay(),"0",record.getStarttime(),record.getEndtime()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1273,11 +1231,11 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| public void createTempToPay(WxAllBill record,MallUserInfo user) { | public void createTempToPay(WxAllBill record,MallUserInfo user) { | ||||
| WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; | ||||
| record.setBillType(fees.getBillType()); | record.setBillType(fees.getBillType()); | ||||
| WxMerchant merchant = wxMerchantService.selectById(record.getMerchantId()); | |||||
| generateTempBill(record, merchant, user,EnumBillAllType.TEMP_TO_PAYMERCHANT,"0",record.getReceivePay(),record.getStarttime(),record.getEndtime()); | |||||
| WxShop shop = wxShopService.getById(record.getShopId()); | |||||
| generateTempBill(record, shop, user,EnumBillAllType.TEMP_TO_PAYMERCHANT,"0",record.getReceivePay(),record.getStarttime(),record.getEndtime()); | |||||
| } | } | ||||
| public void generateTempBill(WxAllBill record,WxMerchant merchant,MallUserInfo user, EnumBillAllType billType,String receivePay,String pay,Date starttime,Date endtime) { | |||||
| public void generateTempBill(WxAllBill record,WxShop wxShop,MallUserInfo user, EnumBillAllType billType,String receivePay,String pay,Date starttime,Date endtime) { | |||||
| if (null == endtime) { | if (null == endtime) { | ||||
| if (null == starttime) { | if (null == starttime) { | ||||
| Date cur = new Date(); | Date cur = new Date(); | ||||
| @@ -1293,15 +1251,19 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| } | } | ||||
| WxAllBill advanceBill = new WxAllBill(); | WxAllBill advanceBill = new WxAllBill(); | ||||
| advanceBill.updateTenantInfo(record); | advanceBill.updateTenantInfo(record); | ||||
| advanceBill.setMerchantId(merchant.getId()); | |||||
| if (null != record.getShopId()) { | |||||
| WxShop shop = wxShopService.getById(record.getShopId()); | |||||
| if (null != shop) { | |||||
| advanceBill.setShopNumber(shop.getShopNumber()); | |||||
| advanceBill.setShopId(shop.getId()); | |||||
| advanceBill.setShopId(wxShop.getId()); | |||||
| if (StringUtils.isBlank(record.getCusName())) { | |||||
| WxShopUsers su = new WxShopUsers(); | |||||
| su.updateTenantInfo(record); | |||||
| su.setShopId(wxShop.getId()); | |||||
| su.setStatus(EnumShopUsersStatus.LIVE.getCode()); | |||||
| WxShopUsers wsu = wxShopService.getOneShopUsers(su); | |||||
| if (null != wsu) { | |||||
| advanceBill.setCusName(wsu.getName()); | |||||
| } | } | ||||
| }else { | |||||
| advanceBill.setCusName(record.getCusName()); | |||||
| } | } | ||||
| advanceBill.setCusName(record.getCusName()); | |||||
| advanceBill.setNeedPay(record.getReceivePay()); | advanceBill.setNeedPay(record.getReceivePay()); | ||||
| advanceBill.setReceivePay(receivePay); | advanceBill.setReceivePay(receivePay); | ||||
| advanceBill.setPay(pay); | advanceBill.setPay(pay); | ||||
| @@ -24,11 +24,13 @@ | |||||
| <result column="is_print" jdbcType="INTEGER" property="isPrint"/> | <result column="is_print" jdbcType="INTEGER" property="isPrint"/> | ||||
| <result column="is_finish" jdbcType="INTEGER" property="isFinish"/> | <result column="is_finish" jdbcType="INTEGER" property="isFinish"/> | ||||
| <result column="parent_id" jdbcType="BIGINT" property="parentId"/> | <result column="parent_id" jdbcType="BIGINT" property="parentId"/> | ||||
| <result column="bill_cus_name" jdbcType="VARCHAR" property="billCusName"/> | |||||
| <result column="bill_shop_number" jdbcType="VARCHAR" property="billShopNumber"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`receive_date`,`receive_money`,`pay_money`,`set_off_money`,`cut_money`,`status`,`type`, | `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`receive_date`,`receive_money`,`pay_money`,`set_off_money`,`cut_money`,`status`,`type`, | ||||
| `money_detail`,`create_by`,`create_by_name`,`update_by`,`update_by_name`,`remark`,`fees_id`,`is_print`,`is_finish`,`parent_id` | |||||
| `money_detail`,`create_by`,`create_by_name`,`update_by`,`update_by_name`,`remark`,`fees_id`,`is_print`,`is_finish`,`parent_id`,`bill_cus_name`,`bill_shop_number` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -50,7 +52,12 @@ | |||||
| <if test=" null != isPrint ">and `is_print` = #{isPrint}</if> | <if test=" null != isPrint ">and `is_print` = #{isPrint}</if> | ||||
| <if test=" null != isFinish ">and `is_finish` = #{isFinish}</if> | <if test=" null != isFinish ">and `is_finish` = #{isFinish}</if> | ||||
| <if test=" null != parentId ">and `parent_id` = #{parentId}</if> | <if test=" null != parentId ">and `parent_id` = #{parentId}</if> | ||||
| <if test=" null != billCusName and '' != billCusName"> | |||||
| and `bill_cus_name` like concat('%',#{billCusName},'%') | |||||
| </if> | |||||
| <if test=" null != billShopNumber and '' != billShopNumber"> | |||||
| and `bill_shop_number` like concat('%',#{billShopNumber},'%') | |||||
| </if> | |||||
| <if test=" null != statusList "> | <if test=" null != statusList "> | ||||
| and status in | and status in | ||||
| <foreach collection="statusList" index="index" item="sItem" open="(" separator="," close=")"> | <foreach collection="statusList" index="index" item="sItem" open="(" separator="," close=")"> | ||||
| @@ -5,7 +5,7 @@ | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | <id column="id" jdbcType="BIGINT" property="id"/> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | ||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | ||||
| <result column="shop_id" jdbcType="BIGINT" property="shopId"/> | |||||
| <result column="create_shop_id" jdbcType="BIGINT" property="createShopId"/> | |||||
| <result column="type" jdbcType="INTEGER" property="type"/> | <result column="type" jdbcType="INTEGER" property="type"/> | ||||
| <result column="principal_type" jdbcType="INTEGER" property="principalType"/> | <result column="principal_type" jdbcType="INTEGER" property="principalType"/> | ||||
| <result column="name" jdbcType="VARCHAR" property="name"/> | <result column="name" jdbcType="VARCHAR" property="name"/> | ||||
| @@ -14,16 +14,13 @@ | |||||
| <result column="id_number" jdbcType="VARCHAR" property="idNumber"/> | <result column="id_number" jdbcType="VARCHAR" property="idNumber"/> | ||||
| <result column="sex" jdbcType="INTEGER" property="sex"/> | <result column="sex" jdbcType="INTEGER" property="sex"/> | ||||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/> | <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/> | ||||
| <result column="begin_date" jdbcType="TIMESTAMP" property="beginDate"/> | |||||
| <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | ||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | ||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`type`,`principal_type`,`name`,`phone`,`legal_person`,`id_number`,`sex`, | |||||
| `link_person`,`begin_date`,`end_date`,`create_date`,`update_date`,`status` | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`create_shop_id`,`type`,`principal_type`,`name`,`phone`,`legal_person`,`id_number`,`sex`, | |||||
| `link_person`,`create_date`,`update_date` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -40,8 +37,8 @@ | |||||
| and `parent_tenant_id` = #{parentTenantId} | and `parent_tenant_id` = #{parentTenantId} | ||||
| </if> | </if> | ||||
| <if test=" null != shopId"> | |||||
| and `shop_id` = #{shopId} | |||||
| <if test=" null != createShopId"> | |||||
| and `create_shop_id` = #{createShopId} | |||||
| </if> | </if> | ||||
| <if test=" null != type"> | <if test=" null != type"> | ||||
| @@ -60,17 +57,6 @@ | |||||
| and `phone` like concat('%', #{phone},'%') | and `phone` like concat('%', #{phone},'%') | ||||
| </if> | </if> | ||||
| <if test=" null != status"> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != shopIds "> | |||||
| and shop_id in | |||||
| <foreach collection="shopIds" index="index" item="sidItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -86,9 +72,4 @@ | |||||
| from wx_shop_users | from wx_shop_users | ||||
| <include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
| </select> | </select> | ||||
| <select id="findShopIdList" parameterType="com.iformall.domain.po.WxShopUsers" resultType="Long"> | |||||
| select distinct shop_id | |||||
| from wx_shop_users | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||
| @@ -0,0 +1,70 @@ | |||||
| <?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.WxShopUsersShopMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxShopUsersShop"> | |||||
| <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="shop_id" jdbcType="BIGINT" property="shopId"/> | |||||
| <result column="shop_user_id" jdbcType="BIGINT" property="shopUserId"/> | |||||
| <result column="begin_date" jdbcType="TIMESTAMP" property="beginDate"/> | |||||
| <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> | |||||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`shop_user_id`,`begin_date`,`end_date`,`create_date`,`update_date`,`status` | |||||
| </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 != shopId"> | |||||
| and `shop_id` = #{shopId} | |||||
| </if> | |||||
| <if test=" null != status"> | |||||
| and `status` = #{status} | |||||
| </if> | |||||
| <if test=" null != shopIds "> | |||||
| and shop_id in | |||||
| <foreach collection="shopIds" index="index" item="sidItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </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.WxShopUsersShop" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_shop_users_shop | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="findShopIdList" parameterType="com.iformall.domain.po.WxShopUsersShop" resultType="Long"> | |||||
| select distinct shop_id | |||||
| from wx_shop_users_shop | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| </mapper> | |||||