| @@ -89,6 +89,11 @@ public class WxBillRent implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /*欠缴**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="欠缴",name="owe") | |||||
| private BigDecimal owe; | |||||
| public Integer getShopId() { | public Integer getShopId() { | ||||
| return shopId; | return shopId; | ||||
| } | } | ||||
| @@ -184,6 +189,14 @@ public class WxBillRent implements Serializable { | |||||
| this.wxMerchant = wxMerchant; | this.wxMerchant = wxMerchant; | ||||
| } | } | ||||
| public BigDecimal getOwe() { | |||||
| return owe; | |||||
| } | |||||
| public void setOwe(BigDecimal owe) { | |||||
| this.owe = owe; | |||||
| } | |||||
| public WxShop getWxShop() { | public WxShop getWxShop() { | ||||
| return wxShop; | return wxShop; | ||||
| } | } | ||||
| @@ -12,4 +12,6 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, String> { | |||||
| List<Map<String,Object>> findListMap(WxBillRent record); | List<Map<String,Object>> findListMap(WxBillRent record); | ||||
| Map<String,Object> queryPayInfo(Map<String,Object> params); | |||||
| } | } | ||||
| @@ -13,6 +13,7 @@ import com.simple.utils.DateUtils; | |||||
| import com.simple.utils.HashUtil; | import com.simple.utils.HashUtil; | ||||
| import com.simple.utils.HttpUtil; | import com.simple.utils.HttpUtil; | ||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.apache.poi.ss.usermodel.DateUtil; | |||||
| import org.apache.shiro.codec.Base64; | import org.apache.shiro.codec.Base64; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -46,6 +47,9 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| @Autowired | @Autowired | ||||
| WxMallMapper wxMallMapper; | WxMallMapper wxMallMapper; | ||||
| @Autowired | |||||
| WxBillRentMapper wxBillRentMapper; | |||||
| @Override | @Override | ||||
| @@ -78,6 +82,28 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| datamap.put("wczl", wczl+"%"); | datamap.put("wczl", wczl+"%"); | ||||
| } | } | ||||
| //租金 | |||||
| Map<String,Object> params=new HashMap<>(); | |||||
| params.put("tenantId",tenantId); | |||||
| Calendar calendar = Calendar.getInstance();//日历对象 | |||||
| calendar.setTime(new Date());//设置当前日期 | |||||
| calendar.add(Calendar.MONTH, -1);//月份减一 | |||||
| params.put("receiveDate", DateUtils.date2String(calendar.getTime(),"yyyy-MM")); | |||||
| Map<String,Object> payinfo=wxBillRentMapper.queryPayInfo(params); | |||||
| if(payinfo!=null){ | |||||
| BigDecimal receivepay = (BigDecimal) payinfo.get("receivepay"); | |||||
| BigDecimal pay = (BigDecimal) payinfo.get("pay"); | |||||
| BigDecimal divide = receivepay.divide(pay); | |||||
| double zjcjl = divide.doubleValue()*100; | |||||
| datamap.put("ysje",receivepay); | |||||
| datamap.put("ssje",pay); | |||||
| datamap.put("zjsjl",zjcjl+"%"); | |||||
| }else{ | |||||
| datamap.put("ysje",0); | |||||
| datamap.put("ssje",0); | |||||
| datamap.put("zjsjl",0); | |||||
| } | |||||
| //上报 | //上报 | ||||
| WxMerchant wxMerchant = new WxMerchant(); | WxMerchant wxMerchant = new WxMerchant(); | ||||
| wxMerchant.setTenantId(tenantId); | wxMerchant.setTenantId(tenantId); | ||||
| @@ -17,11 +17,13 @@ | |||||
| <result column="pay_way" jdbcType="INTEGER" property="payWay" /> | <result column="pay_way" jdbcType="INTEGER" property="payWay" /> | ||||
| <result column="receipt_num" jdbcType="VARCHAR" property="receiptNum" /> | <result column="receipt_num" jdbcType="VARCHAR" property="receiptNum" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | ||||
| <result column="owe" jdbcType="DECIMAL" property="owe" /> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`shop_id`,`user_area`,`price`,`need_pay`,`receive_pay`,`pay`,`receive_period`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`pay_way`,`receipt_num`,`tenant_id` | |||||
| `id`,`shop_id`,`user_area`,`price`,`need_pay`,`receive_pay`,`pay`,`receive_period`,`receive_date`,`pay_date`,`createtime`,`expired_day`,`pay_way`,`receipt_num`,`tenant_id`,`owe` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| @@ -59,7 +61,7 @@ | |||||
| select br.id,br.shop_id shopId,br.user_area userArea,br.price,br.need_pay needPay,br.receive_pay receivePay, | select br.id,br.shop_id shopId,br.user_area userArea,br.price,br.need_pay needPay,br.receive_pay receivePay, | ||||
| br.pay,br.receive_period receivePeriod,br.receive_date receiveDate,br.pay_date payDate,br.createtime, | br.pay,br.receive_period receivePeriod,br.receive_date receiveDate,br.pay_date payDate,br.createtime, | ||||
| br.expired_day expiredDay,br.pay_way payWay,br.receipt_num receiptNum,m.`name` merchantName, | br.expired_day expiredDay,br.pay_way payWay,br.receipt_num receiptNum,m.`name` merchantName, | ||||
| s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber | |||||
| s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber,br.owe | |||||
| from wx_bill_rent br left join wx_merchant_shop ms on br.shop_id=ms.shop_id and ms.is_del=0 | from wx_bill_rent br left join wx_merchant_shop ms on br.shop_id=ms.shop_id and ms.is_del=0 | ||||
| inner join wx_merchant m on ms.merchant_id=m.id | inner join wx_merchant m on ms.merchant_id=m.id | ||||
| inner join wx_shop s on ms.shop_id=s.id | inner join wx_shop s on ms.shop_id=s.id | ||||
| @@ -89,6 +91,11 @@ | |||||
| </select> | </select> | ||||
| <select id="queryPayInfo" resultType="hashmap" parameterType="hashmap"> | |||||
| select sum(receive_pay) receivepay,sum(pay) pay,tenant_id from wx_bill_rent | |||||
| where tenant_id=#{tenantId} and date_format(receive_date,'%Y-%m')=#{receiveDate} | |||||
| group by tenant_id | |||||
| </select> | |||||
| </mapper> | </mapper> | ||||