diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxFinanceController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxFinanceController.java index 691933346..b142b4f50 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxFinanceController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxFinanceController.java @@ -19,6 +19,7 @@ import com.iformall.domain.po.WxFinanceReceiveBill; import com.iformall.domain.po.WxFinanceReceivePayway; import com.iformall.domain.po.WxFinanceReceiveSetoff; 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.TenantEntity; import com.iformall.domain.vo.FinanceBillSetoffSum; @@ -270,8 +271,8 @@ public class WxFinanceController extends BaseController { if (null == record.getEnergyFeesId()) { 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())) { // return new ResultData(Result.ERROR,"支付时间请在结账截止时间之后"); @@ -280,12 +281,12 @@ public class WxFinanceController extends BaseController { return new ResultData(); } - //查询商户预收总计 + //查询铺位预收总计 @GetMapping("getMerchantAdvance") - public ResultData getMerchantAdvance(@ModelAttribute WxFinanceReceive record) { + public ResultData getMerchantAdvance(@ModelAttribute WxShop record) { 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); return new ResultData(sum); diff --git a/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql b/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql index c9fc94264..912659ed9 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql @@ -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_name; alter table wx_rent_contract drop column brand; @@ -45,6 +47,27 @@ alter table wx_property_contract drop column pay_date; #此处要把万星的合同,根据商户的刷成customers_id (商业和soho的) 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` ( `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_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 '店铺编号' ; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java b/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java index a47101b5e..f3cc89df5 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java @@ -296,7 +296,7 @@ public class WxAllBill extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "是否可以编辑", name = "canEdit") private Integer canEdit; - @io.swagger.annotations.ApiModelProperty(value = "客户名称(临时费用添加时设置)", name = "cusName") + @io.swagger.annotations.ApiModelProperty(value = "客户名称", name = "cusName") private String cusName; @io.swagger.annotations.ApiModelProperty(value="楼座号",name="building") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java b/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java index baca5d37d..727d9149a 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java @@ -167,6 +167,12 @@ public class WxFinanceReceive extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "父编号,红冲单据", name = "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) private List bills; @TableField(exist = false) @@ -177,7 +183,7 @@ public class WxFinanceReceive extends TenantEntity { @TableField(exist = false) private Long floor; @TableField(exist = false) - private String shopIds; + private String queryShopNumber; @TableField(exist = false) private Long finishId; @TableField(exist = false) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java index 99cace2f6..ff03670c7 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java @@ -27,8 +27,8 @@ public class WxShopUsers extends TenantEntity { 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") private Integer type; @@ -78,30 +78,9 @@ public class WxShopUsers extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="联系人",name="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") 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 shopIds; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersShop.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersShop.java new file mode 100644 index 000000000..5fda4f870 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShopUsersShop.java @@ -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 shopIds; +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java index 0c663a027..b6f466b1b 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java @@ -9,5 +9,4 @@ import java.util.List; public interface WxShopUsersMapper extends CommonMapper { List findList(WxShopUsers wxShop); - List findShopIdList(WxShopUsers wxShop); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersShopMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersShopMapper.java new file mode 100644 index 000000000..f40905fd7 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopUsersShopMapper.java @@ -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 { + + List findList(WxShopUsersShop wxShop); + List findShopIdList(WxShopUsersShop wxShop); +} diff --git a/mallinkService/src/main/java/com/iformall/service/WxFinanceService.java b/mallinkService/src/main/java/com/iformall/service/WxFinanceService.java index f3265b56c..35ff8d5d5 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxFinanceService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxFinanceService.java @@ -23,6 +23,7 @@ import com.iformall.domain.po.WxFinanceReceive; import com.iformall.domain.po.WxFinanceReceiveBill; import com.iformall.domain.po.WxFinanceReceivePayway; import com.iformall.domain.po.WxFinanceReceiveSetoff; +import com.iformall.domain.po.WxShop; import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.vo.FinanceBillSetoffSum; import com.iformall.domain.vo.WxFinanceReceiveBillSum; @@ -61,7 +62,7 @@ public interface WxFinanceService { void updateReceiveStatus(WxFinanceReceive record); //预收款 List calcuetSetOff(FinanceSetOffDTO dto,MallUserInfo user); - FinanceBillSetoffSum getBillSetoffSum(WxFinanceReceive record); + FinanceBillSetoffSum getBillSetoffSum(WxShop wxShop); //List getSetOffList(FinanceSetOffDTO dto,boolean isMerge); PageInfo receiveSetoffListAsPage(WxFinanceReceive record, Integer pageIndex, Integer pageSize); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java index 4bb57a1bf..ee76094ac 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java @@ -30,6 +30,7 @@ import com.iformall.domain.po.WxFinanceReceiveSetoff; import com.iformall.domain.po.WxMallFloor; import com.iformall.domain.po.WxMerchant; 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.TenantEntity; import com.iformall.domain.vo.FinanceAdvanceBillVo; @@ -44,6 +45,7 @@ import com.iformall.enums.EnumBillStatus; import com.iformall.enums.EnumFinanceCashierType; import com.iformall.enums.EnumFinanceFinishStatus; import com.iformall.enums.EnumFinanceReceiveStatus; +import com.iformall.enums.EnumShopUsersStatus; import com.iformall.enums.EnumYesOrNo; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillPayWayMapper; @@ -240,13 +242,13 @@ public class WxFinanceServiceImpl implements WxFinanceService { } @Override - public FinanceBillSetoffSum getBillSetoffSum(WxFinanceReceive record) { + public FinanceBillSetoffSum getBillSetoffSum(WxShop record) { //取账单里面的 //查询预存账单 WxAllBill abq = new WxAllBill(); abq.updateTenantInfo(record); abq.setBillType(EnumBillAllType.ADVANCE.getCode()); - abq.setMerchantId(record.getMerchantId()); + abq.setShopId(record.getId()); abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); List advanceList = wxBillAllHelper.getMerchantAdvanceGroupSumList(abq); 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(); abq.updateTenantInfo(dto); abq.setFeesStandarsId(dto.getFeesId()); abq.setBillType(EnumBillAllType.ADVANCE.getCode()); abq.setAdvanceHasMoney(EnumYesOrNo.YES.getCode()); abq.setSortColumns(SortField.Createtime_ASC); - abq.setMerchantId(dto.getBills().get(0).getMerchantId());; + //如果是多个店铺的则不能冲抵 + abq.setShopId(shopId);; List advanceList = wxAllBillService.list(abq); if (null == advanceList || advanceList.size() <= 0 ) { return null; @@ -368,8 +381,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { List bills = dto.getBills(); sortBills(bills); //每个账单去计算抵扣 - WxMerchant merchant = new WxMerchant(); - merchant.updateTenantInfo(dto); FinanceSetOffCalcuteDTO calcuteDto = new FinanceSetOffCalcuteDTO(); calcuteDto.setCurrentIndex(0); calcuteDto.setAdvanceList(advanceList); @@ -379,7 +390,7 @@ public class WxFinanceServiceImpl implements WxFinanceService { be.setSetOffDetailList(null); be.setCurrentReceive(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())) { be.setReceivePay(bill.getReceivePay()); @@ -398,59 +409,6 @@ public class WxFinanceServiceImpl implements WxFinanceService { } private void initQueryParam(WxFinanceReceive record) { - List queryMerchantIds = new ArrayList(); - 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 shopIdList = new ArrayList(); - 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 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 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()) { WxFinanceFinish finish = wxFinanceFinishMapper.selectById(record.getFinishId(), record.getTenantId()); record.setReceiveDateBegin(finish.getStartDate()); @@ -1259,13 +1217,13 @@ public class WxFinanceServiceImpl implements WxFinanceService { public void createTempFees(WxAllBill record,MallUserInfo user) { WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; record.setBillType(fees.getBillType()); - WxMerchant merchant = wxMerchantService.selectById(record.getMerchantId()); + WxShop shop = wxShopService.getById(record.getShopId()); 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()) { - 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()) { - 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) { WxEnergyFees fees = wxEnergyService.getFeesById(record.getEnergyFeesId(),record.getTenantId()) ; 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 == starttime) { Date cur = new Date(); @@ -1293,15 +1251,19 @@ public class WxFinanceServiceImpl implements WxFinanceService { } WxAllBill advanceBill = new WxAllBill(); 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.setReceivePay(receivePay); advanceBill.setPay(pay); diff --git a/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml b/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml index 3b48958e0..09b14c6b2 100644 --- a/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml @@ -24,11 +24,13 @@ + + `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` @@ -50,7 +52,12 @@ and `is_print` = #{isPrint} and `is_finish` = #{isFinish} and `parent_id` = #{parentId} - + + and `bill_cus_name` like concat('%',#{billCusName},'%') + + + and `bill_shop_number` like concat('%',#{billShopNumber},'%') + and status in diff --git a/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml b/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml index 654282e9f..ef512d288 100644 --- a/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml @@ -5,7 +5,7 @@ - + @@ -14,16 +14,13 @@ - - - - `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` @@ -40,8 +37,8 @@ and `parent_tenant_id` = #{parentTenantId} - - and `shop_id` = #{shopId} + + and `create_shop_id` = #{createShopId} @@ -60,17 +57,6 @@ and `phone` like concat('%', #{phone},'%') - - and `status` = #{status} - - - - and shop_id in - - #{idItem} - - - and id in @@ -86,9 +72,4 @@ from wx_shop_users - diff --git a/mallinkService/src/main/resources/mapper/WxShopUsersShopMapper.xml b/mallinkService/src/main/resources/mapper/WxShopUsersShopMapper.xml new file mode 100644 index 000000000..20914082c --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxShopUsersShopMapper.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + `id`,`tenant_id`,`parent_tenant_id`,`shop_id`,`shop_user_id`,`begin_date`,`end_date`,`create_date`,`update_date`,`status` + + + + where 1=1 + + + and `id` = #{id} + + + + and `tenant_id` = #{tenantId} + + + and `parent_tenant_id` = #{parentTenantId} + + + + and `shop_id` = #{shopId} + + + + and `status` = #{status} + + + + and shop_id in + + #{idItem} + + + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + +