| @@ -7,7 +7,7 @@ update mall_sale_type set menus = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 50, 101, | |||
| --加金茂合同菜单 | |||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (307, '金茂合同', 299, 'Y', NULL, 1, NULL, NULL, 'jmrentlist', 'icon-zhangdan', 0, 307); | |||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (308, '租金合同', 300, 'Y', NULL, 1, NULL, NULL, 'jmpointrentlist', 'icon-wuyehetong', 0, 308); | |||
| INSERT INTO `mall_permission`(`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`) VALUES (308, '金茂合同', 300, 'Y', NULL, 1, NULL, NULL, 'jmpointrentlist', 'icon-wuyehetong', 0, 308); | |||
| @@ -1,8 +1,6 @@ | |||
| ALTER TABLE `mallink`.`wx_mall` | |||
| ADD COLUMN `social_credit_code` varchar(255) COMMENT '甲方统一社会信用代码' AFTER `longitude`, | |||
| ADD COLUMN `bank_name` varchar(255) COMMENT '甲方开户银行' AFTER `social_credit_code`, | |||
| ADD COLUMN `account_name` varchar(255) COMMENT '甲方开户名称' AFTER `bank_name`, | |||
| ADD COLUMN `account_num` varchar(255) COMMENT '甲方银行账号' AFTER `account_name`; | |||
| ALTER TABLE `mallink`.`wx_pay_account_bill` | |||
| ADD COLUMN `social_credit_code` varchar(255) COMMENT '甲方统一社会信用代码' AFTER `bank_card_id`, | |||
| ADD COLUMN `bank_name` varchar(255) COMMENT '甲方开户行' AFTER `social_credit_code`; | |||
| @@ -20,10 +18,11 @@ ADD COLUMN `scope_metre` int(11) COMMENT '合同期内?米不得新设相同品 | |||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||
| ADD COLUMN `social_credit_code_a` varchar(255) COMMENT '甲方统一社会信用代码' AFTER `contract_number`, | |||
| ADD COLUMN `bank_name_a` varchar(255) COMMENT '甲方开户银行' AFTER `social_credit_code_a`, | |||
| ADD COLUMN `account_name_a` varchar(255) COMMENT '甲方开户名称' AFTER `bank_name_a`, | |||
| ADD COLUMN `account_num_a` varchar(255) COMMENT '甲方银行账号' AFTER `account_name_a`; | |||
| ADD COLUMN `first_party_bank_info` json COMMENT '甲方银行帐号信息' AFTER `contract_number`; | |||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||
| ADD COLUMN `second_party_bank_info` json COMMENT '乙方银行帐号信息' AFTER `first_party_bank_info`, | |||
| ADD COLUMN `second_party_tax_info` json COMMENT '乙方税务信息' AFTER `second_party_bank_info`; | |||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||
| ADD COLUMN `property_name` varchar(255) COMMENT '物业公司名称' AFTER `account_num_a`, | |||
| @@ -36,8 +35,3 @@ ALTER TABLE `mallink`.`wx_rent_contract` | |||
| ADD COLUMN `link_address` varchar(255) COMMENT '联系地址' AFTER `link_phone`, | |||
| MODIFY COLUMN `bank_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '开户行名称' AFTER `pay_account`; | |||
| ALTER TABLE `mallink`.`wx_rent_contract` | |||
| ADD COLUMN `social_credit_code` varchar(255) COMMENT '乙方统一社会信用代码' AFTER `bank_name`, | |||
| ADD COLUMN `account_name` varchar(255) COMMENT '乙方开户名称' AFTER `social_credit_code`, | |||
| ADD COLUMN `taxpayer_number` varchar(255) COMMENT '乙方纳税人识别号' AFTER `account_name`, | |||
| ADD COLUMN `taxpayer_adress` varchar(255) COMMENT '乙方税务登记地址' AFTER `taxpayer_number`; | |||
| @@ -95,16 +95,6 @@ public class WxMall extends TenantEntity { | |||
| @io.swagger.annotations.ApiModelProperty(value="支付宝app authToken,永久有效",name="alipayAppAuthToken") | |||
| private String alipayMemberTemplateId; | |||
| // 甲方统一社会信用代码 | |||
| private String socialCreditCode; | |||
| // 甲方开户银行 | |||
| private String bankName; | |||
| // 甲方开户名称 | |||
| private String accountName; | |||
| // 甲方银行账号 | |||
| private String accountNum; | |||
| @TableField(exist = false) | |||
| protected List<WxMallBuilding> buildings; | |||
| @@ -39,6 +39,10 @@ public class WxPayAccountBill extends TenantEntity { | |||
| private String bankAccountName; | |||
| @io.swagger.annotations.ApiModelProperty(value="接收银行卡号",name="bankCardId") | |||
| private String bankCardId; | |||
| // 甲方统一社会信用代码 | |||
| private String socialCreditCode; | |||
| // 甲方开户银行 | |||
| private String bankName; | |||
| public String getPayNotifyUrl() { | |||
| return notifyUrl + "/pay"; | |||
| @@ -161,18 +161,20 @@ public class WxRentContract extends TenantEntity { | |||
| //甲方信息(公司,地址,电话取wx_mall) | |||
| // 甲方统一社会信用代码 | |||
| private String socialCreditCodeA; | |||
| // 甲方开户银行 | |||
| private String bankNameA; | |||
| // 甲方开户名称 | |||
| private String accountNameA; | |||
| // 甲方银行账号 | |||
| private String accountNumA; | |||
| // private String socialCreditCodeA; | |||
| // // 甲方开户银行 | |||
| // private String bankNameA; | |||
| // // 甲方开户名称 | |||
| // private String accountNameA; | |||
| // // 甲方银行账号 | |||
| // private String accountNumA; | |||
| private String firstPartyBankInfo; | |||
| //物业信息 | |||
| //物业公司名称 | |||
| private String propertyName; | |||
| //物业费金额(元/月) | |||
| //物业费金额(分/月) | |||
| private Integer propertyFee; | |||
| //物业费支付周期(月/季/年) | |||
| private Integer feeCycle; | |||
| @@ -199,17 +201,21 @@ public class WxRentContract extends TenantEntity { | |||
| private String bankName; | |||
| // 乙方统一社会信用代码 | |||
| private String socialCreditCode; | |||
| // 乙方开户银行 | |||
| // 乙方开户名称 | |||
| private String accountName; | |||
| // private String socialCreditCode; | |||
| // // 乙方开户银行 | |||
| // // 乙方开户名称 | |||
| // private String accountName; | |||
| // 乙方银行账号 | |||
| private String secondPartyBankInfo; | |||
| private String secondPartyTaxInfo; | |||
| // 乙方纳税人识别号 | |||
| private String taxpayerNumber; | |||
| // 乙方税务登记地址 | |||
| private String taxpayerAdress; | |||
| // private String taxpayerNumber; | |||
| // // 乙方税务登记地址 | |||
| // private String taxpayerAdress; | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户", name = "merchantId") | |||
| @@ -968,6 +968,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| Integer lease = wxRentContract.getLease(); | |||
| Date rentalStartDate = wxRentContract.getRentalStartDate(); | |||
| Long price = wxRentContract.getPrice(); | |||
| if(EnumContractOperationType.JINMAO.getCode().equals(wxRentContract.getOperationType())){ | |||
| rentList = buildRentJinmao(userId, wxRentContract, receivePeriod, lease, rentalStartDate, price, isPreview,saveDb); | |||
| }else{ | |||
| //按月计租 | |||
| // if (wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_MONTH.getCode()) | |||
| @@ -980,6 +983,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| // Map<String, Object> resultMap = buildRent(receivePeriod, new long[]{price}, yearList, Calendar.DAY_OF_MONTH, wxRentContract, userId, 0, isPreview,null,saveDb); | |||
| // rentList = ( List<WxBillRent>)resultMap.get("billList"); | |||
| // } | |||
| } | |||
| } | |||
| for (int i = 0; i < rentList.size(); i++) { | |||
| rentList.get(i).setPeriod(i+1); | |||
| @@ -1161,6 +1165,116 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| return resultList; | |||
| } | |||
| public List<WxBillRent> buildRentJinmao(Long userId, WxRentContract wxRentContract, int receivePeriod, Integer lease, Date rentalStartDate, Long price, Integer isPreview, boolean saveDb) { | |||
| int size = 0; | |||
| long[] priceArrs = null; | |||
| List<Map<String, Object>> shopInfos = new ArrayList<>(); | |||
| if (//wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode()) && | |||
| wxRentContract.getRentInputWay().equals(EnumRentContractRentInputWay.PART.getCode()) && | |||
| !wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode()) && | |||
| !wxRentContract.getType().equals(EnumRentContractType.RENT_BY_COUNT.getCode())) { | |||
| String rentInfo = wxRentContract.getRentInfo(); | |||
| JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); | |||
| List<long[]> priceList = computePrice(rentInfo, wxRentContract); | |||
| size = priceList.size(); | |||
| priceArrs = new long[size]; | |||
| for (int i = 0; i < size; i++) { | |||
| long[] priceInt = priceList.get(i); | |||
| long sum = 0; | |||
| for (long p : priceInt) { | |||
| sum += p; | |||
| } | |||
| priceArrs[i] = sum; | |||
| } | |||
| for (int i = 0; i < size; i++) { | |||
| Map<String, Object> shopInfo = new HashMap<>(); | |||
| long[] ints = priceList.get(i); | |||
| for (int j = 0; j < ints.length; j++) { | |||
| JSONObject rentInfoObject = rentInfoArray.getJSONObject(j); | |||
| String s = new BigDecimal(ints[j]).divide(new BigDecimal(100)).toPlainString(); | |||
| shopInfo.put(rentInfoObject.getString("shopNumber"), s); | |||
| } | |||
| shopInfos.add(shopInfo); | |||
| } | |||
| } else { | |||
| String adjustRatio = wxRentContract.getAdjustRatio(); | |||
| List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class); | |||
| integers.add(0, 0); | |||
| size = integers.size(); | |||
| priceArrs = new long[size]; | |||
| priceArrs[0] = price; | |||
| BigDecimal priceD = new BigDecimal(price); | |||
| if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.RATIO.getCode())) { | |||
| for (int i = 1; i < size; i++) { | |||
| BigDecimal divide = priceD.multiply(new BigDecimal(integers.get(i))).divide(new BigDecimal(10000)); | |||
| priceD = priceD.add(divide); | |||
| priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| } | |||
| } else if (wxRentContract.getAdjustRatioWay().equals(EnumRentContractAdjustRatioWay.MONEY.getCode())) { | |||
| for (int i = 1; i < size; i++) { | |||
| priceD = priceD.add(new BigDecimal(integers.get(i))); | |||
| priceArrs[i] = priceD.setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| } | |||
| } else { | |||
| for (int i = 1; i < size; i++) { | |||
| if (wxRentContract.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| if (EnumMissTimeType.YEAR.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||
| priceArrs[i] = new BigDecimal(integers.get(i)).multiply(new BigDecimal(12)).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| continue; | |||
| } | |||
| if (EnumMissTimeType.PERIOD.getCode().equals(wxRentContract.getBusDiscountTime())) { | |||
| priceArrs[i] = new BigDecimal(integers.get(i)).multiply(new BigDecimal(wxRentContract.getReceivePeriod())).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| continue; | |||
| } | |||
| } | |||
| priceArrs[i] = new BigDecimal(integers.get(i)).setScale(0, RoundingMode.HALF_EVEN).longValue(); | |||
| } | |||
| } | |||
| } | |||
| int month = 12; | |||
| // int divide = lease / month; | |||
| // int mod = lease % month; | |||
| // int[] leaseArr = new int[size]; | |||
| // for (int i = 0; i < divide; i++) { | |||
| // leaseArr[i] = month; | |||
| // } | |||
| // if (mod > 0) { | |||
| // leaseArr[divide] = mod; | |||
| // } | |||
| int billcount = 0; | |||
| List<WxBillRent> resultList = new ArrayList<>(); | |||
| List<Date> yearList = new ArrayList<>(); | |||
| for (int i = 0; i < size; i++) { | |||
| Calendar instance = Calendar.getInstance(); | |||
| Date startDate; | |||
| //自然月 | |||
| if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ | |||
| if(i == 0){ //第一期 | |||
| startDate = rentalStartDate; | |||
| }else{ | |||
| instance.setTime(rentalStartDate); | |||
| instance.add(Calendar.MONTH, month * i); | |||
| startDate = DateUtils.getFirstDayForCurrMonth(instance.getTime()); | |||
| } | |||
| }else{ | |||
| instance.setTime(rentalStartDate); | |||
| instance.add(Calendar.MONTH, month * i); | |||
| startDate = instance.getTime(); | |||
| } | |||
| yearList.add(startDate); | |||
| } | |||
| String shopInfoStr = getShopInfoStr(wxRentContract); | |||
| Map<String, Object> resultMap = buildRent(receivePeriod, priceArrs, yearList, Calendar.MONTH, wxRentContract, userId, billcount, isPreview, shopInfoStr,saveDb); | |||
| List<WxBillRent> billRentList = (List<WxBillRent>)resultMap.get("billList"); | |||
| resultList.addAll(billRentList); | |||
| return resultList; | |||
| } | |||
| public String getShopInfoStr(WxRentContract wxRentContract){ | |||
| String shopInfoStr = null; | |||
| // if (wxRentContract.getRentShopType().equals(EnumRentShopType.SHOP.getCode())) { | |||
| @@ -1697,11 +1811,16 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| logger.info("获取租赁及物业合同数据"); | |||
| result = getRentAndPropertyInfo(rentId,propertyId); | |||
| result.put("contractType", EnumContractType.ALL.getMessage()); | |||
| if (EnumRentContractType.RENT_BY_AREA.getCode().equals(result.get("type"))) { | |||
| templatePath = "contract-word-template/contract_rent_property.docx"; | |||
| } else { | |||
| templatePath = "contract-word-template/contract_rent_property_by_ratio.docx"; | |||
| if(EnumContractOperationType.JINMAO.getCode().equals(result.get("operationType"))){ | |||
| templatePath = "contract-word-template/jinmao_contract_rent_property.docx"; | |||
| }else{ | |||
| if (EnumRentContractType.RENT_BY_AREA.getCode().equals(result.get("type"))) { | |||
| templatePath = "contract-word-template/contract_rent_property.docx"; | |||
| } else { | |||
| templatePath = "contract-word-template/contract_rent_property_by_ratio.docx"; | |||
| } | |||
| } | |||
| logger.info("租赁及物业合同数据结果:" + result); | |||
| } | |||
| @@ -1851,7 +1970,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| //MALL信息 | |||
| WxMall wxMall = new WxMall(); | |||
| wxMall.setTenantInfo(wxRentContract); | |||
| result.put("mallList",wxMallMapper.findList(new WxMall())); | |||
| wxMall = wxMallMapper.findList(wxMall).get(0); | |||
| result.put("mallName", wxMall.getName()); | |||
| result.put("province", wxMall.getProvince()); | |||
| @@ -41,11 +41,6 @@ | |||
| <result column="alipay_app_auth_token" jdbcType="VARCHAR" property="alipayAppAuthToken"/> | |||
| <result column="alipay_member_template_id" jdbcType="VARCHAR" property="alipayMemberTemplateId"/> | |||
| <result column="social_credit_code" jdbcType="VARCHAR" property="socialCreditCode"/> | |||
| <result column="bank_name" jdbcType="VARCHAR" property="bankName"/> | |||
| <result column="account_name" jdbcType="VARCHAR" property="accountName"/> | |||
| <result column="account_num" jdbcType="VARCHAR" property="accountNum"/> | |||
| <result column="admin_id" jdbcType="BIGINT" property="adminId"/> | |||
| <result column="admin_name" jdbcType="VARCHAR" property="adminName"/> | |||
| @@ -61,8 +56,7 @@ | |||
| `img_url`,`img_url_h`, `weap_note`, `img_qrcode_weapp`, `img_qrcode_wemp`, | |||
| `weapp_share_title`,`weapp_share_cover_img`, `pos_qrcode_rule`, | |||
| `sale_type`, `valid_start`, `valid_end`,`business_hours`,`introduction`,`img`, | |||
| `group_support`,`latitude`,`longitude`,`live_support`,`cash_out_support`,`cash_out_limit`,`alipay_app_auth_token`,`alipay_member_template_id`, | |||
| `social_credit_code`,`bank_name`,`account_name`,`account_num` | |||
| `group_support`,`latitude`,`longitude`,`live_support`,`cash_out_support`,`cash_out_limit`,`alipay_app_auth_token`,`alipay_member_template_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -16,6 +16,8 @@ | |||
| <result column="real_rate" jdbcType="INTEGER" property="realRate"/> | |||
| <result column="bank_account_name" jdbcType="VARCHAR" property="bankAccountName"/> | |||
| <result column="bank_card_id" jdbcType="VARCHAR" property="bankCardId"/> | |||
| <result column="social_credit_code" jdbcType="VARCHAR" property="socialCreditCode"/> | |||
| <result column="bank_name" jdbcType="VARCHAR" property="bankName"/> | |||
| <result column="service_charge_rate" property="serviceChargeRate"/> | |||
| </resultMap> | |||
| @@ -25,10 +25,10 @@ | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="contract_number" jdbcType="VARCHAR" property="contractNumber"/> | |||
| <result column="social_credit_code_a" jdbcType="VARCHAR" property="socialCreditCodeA"/> | |||
| <result column="bank_name_a" jdbcType="VARCHAR" property="bankNameA"/> | |||
| <result column="account_name_a" jdbcType="VARCHAR" property="accountNameA"/> | |||
| <result column="account_num_a" jdbcType="VARCHAR" property="accountNumA"/> | |||
| <result column="first_party_bank_info" jdbcType="VARCHAR" property="firstPartyBankInfo"/> | |||
| <result column="second_party_bank_info" jdbcType="VARCHAR" property="secondPartyBankInfo"/> | |||
| <result column="second_party_tax_info" jdbcType="VARCHAR" property="secondPartyTaxInfo"/> | |||
| <result column="property_name" jdbcType="VARCHAR" property="propertyName"/> | |||
| <result column="property_fee" jdbcType="INTEGER" property="propertyFee"/> | |||
| <result column="fee_cycle" jdbcType="INTEGER" property="feeCycle"/> | |||
| @@ -54,10 +54,6 @@ | |||
| <result column="pay_account" jdbcType="VARCHAR" property="payAccount"/> | |||
| <result column="link_address" jdbcType="VARCHAR" property="linkAddress"/> | |||
| <result column="social_credit_code" jdbcType="VARCHAR" property="socialCreditCode"/> | |||
| <result column="account_name" jdbcType="VARCHAR" property="accountName"/> | |||
| <result column="taxpayer_number" jdbcType="VARCHAR" property="taxpayerNumber"/> | |||
| <result column="taxpayer_adress" jdbcType="VARCHAR" property="taxpayerAdress"/> | |||
| <result column="filename" jdbcType="VARCHAR" property="filename"/> | |||
| <result column="lease" jdbcType="INTEGER" property="lease"/> | |||
| @@ -122,11 +118,10 @@ | |||
| `shop_type_sub`,`lease_purpose`,`contractual_rules`,`delivery_date`,`delivery_grace_period`,`opening_date`,`business_hours`,`scope_metre`, | |||
| `price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`, | |||
| `tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`, | |||
| `social_credit_code_a`,`bank_name_a`,`account_name_a`,`account_num_a`, | |||
| `first_party_bank_info`,`second_party_bank_info`,`second_party_tax_info`, | |||
| `property_name`,`property_fee`,`fee_cycle`,`water_fee`,`electricity_fees`, | |||
| `deposit`,cashtype_content_lsit,cashtype_lsit,`pay_date`,`is_del`,`merchant_name`, | |||
| `brand`,`business_id`,`shop_type`,`updatetime`,`createtime`,`link_person`,`link_phone`, | |||
| `link_address`,`social_credit_code`,`account_name`,`taxpayer_number`,`taxpayer_adress`, | |||
| `brand`,`business_id`,`shop_type`,`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, | |||
| `pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio`, | |||
| `start_date`,`end_date`,`shop_name`,`from_id`, | |||
| `apply_status`,`bank_name`,`rent_shop_type`,`fix_start_date`,`fix_end_date`, | |||