diff --git a/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql b/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql index aeca024a2..939582ad6 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202102260001__wx_rent_contract.sql @@ -51,6 +51,108 @@ update wx_rent_contract set ) where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 3 and rent_input_way = 1 and cashtype_lsit is null; +--4 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') , + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[2].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[2].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[2].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[3].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[3].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[3].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 4 and rent_input_way = 1 and cashtype_lsit is null; + +--5 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') , + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[2].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[2].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[2].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[3].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[3].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[3].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[4].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[4].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[4].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 5 and rent_input_way = 1 and cashtype_lsit is null; + +--6 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') , + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[2].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[2].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[2].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[3].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[3].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[3].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[4].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[4].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[4].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[5].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[5].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[5].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 6 and rent_input_way = 1 and cashtype_lsit is null; + +--7 +update wx_rent_contract set + cashtype_lsit = '[{"label": "一般押金", "value": "0", "disabled": true}, {"label": "合同保证金", "value": "1", "disabled": false}, {"label": "质量保证金", "value": "2", "disabled": false}]', + cashtype_content_lsit = concat('[{"value": "',ROUND(deposit/100,2),'", "deposit": "1"}]') , + other_rent_price_info = '{"siteMoney": "", "facilityMoney": "", "administratorMoney": ""}', + rent_info = json_set(rent_info, + "$[0].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[0].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[0].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[1].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[1].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[1].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[2].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[2].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[2].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[3].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[3].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[3].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[4].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[4].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[4].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[5].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[5].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[5].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", ""), + "$[6].cashtypeLsit",JSON_ARRAY(JSON_OBJECT("label", "一般押金", "value", "0", "disabled", false),JSON_OBJECT("label", "合同保证金", "value", "1", "disabled", false),JSON_OBJECT("label", "质量保证金", "value", "2", "disabled", false)), + "$[6].cashtypeContentLsit",JSON_ARRAY(JSON_OBJECT("value", "", "deposit", "")), + "$[6].otherRentPriceInfo",JSON_OBJECT("siteMoney", "", "facilityMoney", "", "administratorMoney", "") + ) +where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 7 and rent_input_way = 1 and cashtype_lsit is null; + --多店铺分铺 --2 @@ -103,6 +205,8 @@ where (LENGTH(shop_name) - LENGTH( REPLACE (shop_name, ',',''))) = 3 and rent_in + + --10 diff --git a/mallinkAdmin/src/main/resources/db/migration/V202103190001__wx_bill_rent.sql b/mallinkAdmin/src/main/resources/db/migration/V202103190001__wx_bill_rent.sql index 92d6c03b4..78c1e5329 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202103190001__wx_bill_rent.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202103190001__wx_bill_rent.sql @@ -7,7 +7,7 @@ ADD COLUMN `rent_price_info` json COMMENT '合同应收明细' AFTER `contract_n update wx_bill_rent set contract_need_pay = need_pay, - rent_price_info = concat('{"rentPrice": "',need_pay,'", "siteMoney": "0", "facilityMoney": "0", "administratorMoney": "0"}'), + rent_price_info = concat('{"rentPrice": "',ROUND(need_pay/100,2),'", "siteMoney": "0", "facilityMoney": "0", "administratorMoney": "0"}') where contract_need_pay is null; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java index 94108b1da..60ffc75aa 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java @@ -101,44 +101,21 @@ public class WxBillRent extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "合同应收明细", name = "rentPriceInfo") private String rentPriceInfo; - @Excel(name = "原合同应收金额明细", width = 20, height = 30, orderNum = "7") + @Excel(name = "原合同应收金额明细(元)", width = 20, height = 30, orderNum = "7") @TableField(exist = false) private String rentPriceInfoStr; public String getRentPriceInfoStr() { String infoStr = ""; if(StringUtils.isNotBlank(this.getRentPriceInfo())){ JSONObject jsonObject = JSONObject.parseObject(this.getRentPriceInfo()); - infoStr += "租金:"; String rentPrice1 = jsonObject.getString("rentPrice"); - if(StringUtils.isNotBlank(rentPrice1)){ - infoStr += new BigDecimal(rentPrice1).divide(new BigDecimal(100)).toPlainString(); - }else{ - infoStr += 0; - } - infoStr += "\n"; + infoStr += "租金:" + (StringUtils.isBlank(rentPrice1) ? "0":rentPrice1) + "\n"; String siteMoney1 = jsonObject.getString("siteMoney"); - infoStr += "场地费:"; - if(StringUtils.isNotBlank(siteMoney1)){ - infoStr += new BigDecimal(siteMoney1).divide(new BigDecimal(100)).toPlainString(); - }else{ - infoStr += 0; - } - infoStr += "\n"; + infoStr += "场地费:" + (StringUtils.isBlank(siteMoney1) ? "0":siteMoney1) + "\n"; String facilityMoney1 = jsonObject.getString("facilityMoney"); - infoStr += "设备费:"; - if(StringUtils.isNotBlank(facilityMoney1)){ - infoStr += new BigDecimal(facilityMoney1).divide(new BigDecimal(100)).toPlainString(); - }else{ - infoStr += 0; - } - infoStr += "\n"; + infoStr += "设备费:" + (StringUtils.isBlank(facilityMoney1) ? "0":facilityMoney1) + "\n"; String administratorMoney1 = jsonObject.getString("administratorMoney"); - infoStr += "商业管理费:"; - if(StringUtils.isNotBlank(administratorMoney1)){ - infoStr += new BigDecimal(administratorMoney1).divide(new BigDecimal(100)).toPlainString(); - }else{ - infoStr += 0; - } + infoStr += "商业管理费:" + (StringUtils.isBlank(administratorMoney1) ? "0":administratorMoney1); } return infoStr;