diff --git a/mallinkAdmin/src/main/resources/db/migration/V201904191340__UPDATE_BILL_DAILY.sql b/mallinkAdmin/src/main/resources/db/migration/V201904191340__UPDATE_BILL_DAILY.sql
new file mode 100644
index 000000000..cf62ea2bf
--- /dev/null
+++ b/mallinkAdmin/src/main/resources/db/migration/V201904191340__UPDATE_BILL_DAILY.sql
@@ -0,0 +1,2 @@
+alter table wx_bill_daily
+add column `price_detail` json default null COMMENT '费用明细';
diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java
index 489cef538..a29898c5f 100644
--- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java
+++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java
@@ -111,6 +111,17 @@ public class WxBillDaily implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "支付方式:见枚举EnumBillPayWay", name = "payWay")
private Integer payWay;
+ @io.swagger.annotations.ApiModelProperty(value = "费用明细", name = "priceDetail")
+ private String priceDetail;
+
+ public String getPriceDetail() {
+ return priceDetail;
+ }
+
+ public void setPriceDetail(String priceDetail) {
+ this.priceDetail = priceDetail;
+ }
+
public Integer getPayWay() {
return payWay;
}
diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumBillDailyType.java b/mallinkService/src/main/java/com/iformall/enums/EnumBillDailyType.java
index c6bf1b61d..1b0760915 100644
--- a/mallinkService/src/main/java/com/iformall/enums/EnumBillDailyType.java
+++ b/mallinkService/src/main/java/com/iformall/enums/EnumBillDailyType.java
@@ -9,6 +9,7 @@ public enum EnumBillDailyType {
WATER(1,"水费"),
POWER(2,"电费"),
+ AIR_CONDITIONING(3, "空调费"),
;
public static EnumBillDailyType getEnum(Integer code) {
diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumBillType.java b/mallinkService/src/main/java/com/iformall/enums/EnumBillType.java
index c9906c785..9cb32c36c 100644
--- a/mallinkService/src/main/java/com/iformall/enums/EnumBillType.java
+++ b/mallinkService/src/main/java/com/iformall/enums/EnumBillType.java
@@ -12,7 +12,8 @@ public enum EnumBillType {
PROPERTY(3,"物业"),
WATER(4, "水费"),
POWER(5, "电费"),
- ROUTINE(6,"其他")
+ ROUTINE(6, "其他"),
+ AIR_CONDITIONING(7, "空调费"),
;
public static EnumBillType getEnum(Integer code) {
diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumBillTypeParam.java b/mallinkService/src/main/java/com/iformall/enums/EnumBillTypeParam.java
index 1cd2df063..fcf76a503 100644
--- a/mallinkService/src/main/java/com/iformall/enums/EnumBillTypeParam.java
+++ b/mallinkService/src/main/java/com/iformall/enums/EnumBillTypeParam.java
@@ -14,7 +14,8 @@ public enum EnumBillTypeParam {
WATER(5, "水费"),
POWER(6, "电费"),
ROUTINE(7, "其他费用"),
- ATHER_DEPOSIT(8, "其他押金")
+ ATHER_DEPOSIT(8, "其他押金"),
+ AIR_CONDITIONING(9, "空调费")
;
public static EnumBillTypeParam getEnum(Integer code) {
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
index e9d983479..e308e52e9 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
@@ -140,6 +140,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillAll.setBillTypeValue(EnumBillTypeParam.POWER.getCode());
} else if (wxBillAll.getBillTypeValue().equals(EnumBillType.ROUTINE.getCode())) {
wxBillAll.setBillTypeValue(EnumBillTypeParam.ROUTINE.getCode());
+ } else if (wxBillAll.getBillTypeValue().equals(EnumBillType.AIR_CONDITIONING.getCode())) {
+ wxBillAll.setBillTypeValue(EnumBillTypeParam.AIR_CONDITIONING.getCode());
} else {
logger.info("账单不存在");
return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND);
@@ -195,14 +197,20 @@ public class WxBillAllServiceImpl implements WxBillAllService {
if(wxBillDaily!=null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())){
updateBillDaily(bill);
}
+ } else if (billTypeValue == EnumBillTypeParam.AIR_CONDITIONING.getCode().intValue()) {
+ //更新空调费账单
+ WxBillDaily wxBillDaily = wxBillDailyMapper.selectByPrimaryKey(bill.get("id"));
+ if (wxBillDaily != null && !wxBillDaily.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
+ updateBillDaily(bill);
+ }
} else if (billTypeValue==EnumBillTypeParam.ROUTINE.getCode().intValue()) {
//更新其他账单
WxBillOther wxBillOther = wxBillOtherMapper.selectByPrimaryKey(bill.get("id"));
if(wxBillOther!=null && !wxBillOther.getStatus().equals(EnumBillRentStatus.PAID.getCode())){
updateBillOther(bill);
}
- } else if (billTypeValue == EnumBillTypeParam.ROUTINE.getCode().intValue()) {
- //更新其他账单
+ } else if (billTypeValue == EnumBillTypeParam.ATHER_DEPOSIT.getCode().intValue()) {
+ //更新其他押金账单
WxBillOtherDeposit wxBillOtherDeposit = wxBillOtherDepositMapper.selectByPrimaryKey(bill.get("id"));
if (wxBillOtherDeposit != null && !wxBillOtherDeposit.getStatus().equals(EnumBillRentStatus.PAID.getCode())) {
updateBillOtherDeposit(bill);
diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
index b647997df..3103566e6 100644
--- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
@@ -72,6 +72,11 @@
rent_shop_type,'[]' shop_info
from wx_bill_daily where type=2
union
+ select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,
+ rent_shop_type,'[]' shop_info
+ from wx_bill_daily where type=3
+ union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,
rent_shop_type,'[]' shop_info
@@ -128,6 +133,10 @@
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2
union
+ select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
+ type=3
+ union
select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union
@@ -172,6 +181,10 @@
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2
union
+ select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
+ type=3
+ union
select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union
@@ -224,6 +237,10 @@
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union
+ select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
+ from wx_bill_daily where type=3
+ union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_vaue,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
@@ -301,6 +318,10 @@
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
+ union
+ select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
+ from wx_bill_daily where type=3
union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
@@ -345,6 +366,10 @@
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union
+ select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
+ from wx_bill_daily where type=3
+ union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
@@ -388,6 +413,10 @@
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union
+ select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
+ from wx_bill_daily where type=3
+ union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
@@ -434,6 +463,10 @@
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_daily where type=2
union
+ select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as
+ need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
+ from wx_bill_daily where type=3
+ union
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,'其他' bill_type,0 as
need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
diff --git a/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
index bdb26c312..0c1dfbcd9 100644
--- a/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxBillDailyMapper.xml
@@ -20,13 +20,14 @@
+
`id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,`createtime`,`expired_day`,
`tenant_id`,`owe`,`status`,`is_del`,`merchant_id`,`user_id`,`shop_id`,`updatetime`,`type`,
- `rent_shop_type`,`pay_way`
+ `rent_shop_type`,`pay_way`,`price_detail`
@@ -67,7 +68,7 @@
select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate,
br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`,
m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`,br.`merchant_id` merchantId,
- br.shop_id shopId,br.type,br.`rent_shop_type` rentShopType,br.pay_way payWay
+ br.shop_id shopId,br.type,br.`rent_shop_type` rentShopType,br.pay_way payWay,br.price_detail priceDetail
from wx_bill_daily br left join wx_merchant m on br.merchant_id=m.id
left join wx_shop s on br.shop_id=s.id