| @@ -6,7 +6,6 @@ import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxBusiness; | import com.iformall.domain.po.WxBusiness; | ||||
| import com.iformall.domain.po.WxSubBusiness; | import com.iformall.domain.po.WxSubBusiness; | ||||
| import com.iformall.domain.vo.WxBusinessDataVo; | import com.iformall.domain.vo.WxBusinessDataVo; | ||||
| import com.iformall.domain.vo.WxMerchantSubsidyVo; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBusinessService; | import com.iformall.service.WxBusinessService; | ||||
| import com.iformall.service.WxSubBusinessService; | import com.iformall.service.WxSubBusinessService; | ||||
| @@ -15,12 +14,10 @@ import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.http.HttpResponse; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.text.SimpleDateFormat; | import java.text.SimpleDateFormat; | ||||
| @@ -95,7 +95,7 @@ public class ActivitySchedule { | |||||
| public void activityExipred() { | public void activityExipred() { | ||||
| logger.info("活动报名结束任务"); | logger.info("活动报名结束任务"); | ||||
| WxActivity activity = new WxActivity(); | WxActivity activity = new WxActivity(); | ||||
| activity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); | |||||
| activity.setStatus(EnumActivityStatus.INJECT_CAMPAIGN.getCode()); | |||||
| activity.setIsExpired(EnumActivityExpired.YES.getCode()); | activity.setIsExpired(EnumActivityExpired.YES.getCode()); | ||||
| activity.setUpdateTime(new Date()); | activity.setUpdateTime(new Date()); | ||||
| wxActivityMapper.activityExipred(activity); | wxActivityMapper.activityExipred(activity); | ||||
| @@ -566,12 +566,12 @@ | |||||
| select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' | ||||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | bill_type,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_rent where is_preview = 0 and tenant_id = #{tenantId} | |||||
| endtime,rent_shop_type from wx_bill_rent where tenant_id = #{tenantId} and is_preview = 0 | |||||
| <include refid="getOweBillAsPageConditions"/> | <include refid="getOweBillAsPageConditions"/> | ||||
| union all | union all | ||||
| select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' | ||||
| bill_type,need_pay,receive_pay,pay,owe,DATE_FORMAT(receive_date,'%Y-%m-%d') receive_date,pay_date,expired_day,status,'' starttime,'' | bill_type,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_property where is_preview = 0 and tenant_id = #{tenantId} | |||||
| endtime,rent_shop_type from wx_bill_property where tenant_id = #{tenantId} and is_preview = 0 | |||||
| <include refid="getOweBillAsPageConditions"/> | <include refid="getOweBillAsPageConditions"/> | ||||
| union all | union all | ||||
| select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, | select res.id,res.merchant_id,res.shop_id,res.tenant_id,res.name,res.bill_type_value,res.bill_type,res.need_pay, | ||||
| @@ -596,7 +596,7 @@ | |||||
| res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( | res.receive_pay,res.pay,res.owe owe,res.receive_date,res.pay_date,res.expired_day,res.status,res.starttime,res.endtime,res.rent_shop_type from( | ||||
| select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 bill_type_value,'其他费用' bill_type,0 as | select id,merchant_id,shop_id,tenant_id,'其他费用' name,5 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 | 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 in(1,2,3) and tenant_id = #{tenantId} | |||||
| from wx_bill_daily where tenant_id = #{tenantId} and type in(1,2,3) | |||||
| <include refid="getOweBillAsPageConditions"/> | <include refid="getOweBillAsPageConditions"/> | ||||
| union all | union all | ||||
| select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as | select id,merchant_id,shop_id,tenant_id,'其他费用' name,7 bill_type_value,'其他费用' bill_type,0 as | ||||
| @@ -86,62 +86,62 @@ | |||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | (select sum(mtd.trade_amt) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) | |||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| /100,2) volume, | /100,2) volume, | ||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | (select sum(mtd.trade_amt) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) | |||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| / | / | ||||
| (select sum(ws.operation_area) | (select sum(ws.operation_area) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| where m.business_id = b.id and m.tenant_id=#{tenantId}) | |||||
| where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1) | |||||
| /100,2) sale, | /100,2) sale, | ||||
| round( | round( | ||||
| (select | (select | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | (select sum(br.receive_pay) receive_pay from wx_merchant m | ||||
| left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate}) | |||||
| left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| + | + | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | (select sum(br.receive_pay) receive_pay from wx_merchant m | ||||
| left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate}) | |||||
| left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| from dual) / | from dual) / | ||||
| (select sum(ws.operation_area) | (select sum(ws.operation_area) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| where m.business_id = b.id and m.tenant_id=#{tenantId} ) | |||||
| where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1) | |||||
| /100,2) rent, | /100,2) rent, | ||||
| round( | round( | ||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | (select sum(mtd.trade_amt) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) | |||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| / | / | ||||
| (select sum(ws.operation_area) | (select sum(ws.operation_area) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| where m.business_id = b.id and m.tenant_id=#{tenantId}) | |||||
| where m.business_id = b.id and m.tenant_id=#{tenantId} and m.status = 1) | |||||
| /100,2) | /100,2) | ||||
| / | / | ||||
| round( | round( | ||||
| (select | (select | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | (select sum(br.receive_pay) receive_pay from wx_merchant m | ||||
| left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate}) | |||||
| left join wx_bill_rent br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| + | + | ||||
| (select sum(br.receive_pay) receive_pay from wx_merchant m | (select sum(br.receive_pay) receive_pay from wx_merchant m | ||||
| left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate}) | |||||
| left join wx_bill_property br on(br.merchant_id=m.id) where m.business_id = b.id and m.tenant_id=#{tenantId} and br.receive_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| from dual) / | from dual) / | ||||
| (select sum(ws.operation_area) | (select sum(ws.operation_area) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_shop mtd on mtd.merchant_id = m.id | left join wx_merchant_shop mtd on mtd.merchant_id = m.id | ||||
| left join wx_shop ws on(mtd.shop_id = ws.id) | left join wx_shop ws on(mtd.shop_id = ws.id) | ||||
| where m.business_id = b.id) | |||||
| where m.business_id = b.id and m.status = 1) | |||||
| /100,2) | /100,2) | ||||
| ,4) | ,4) | ||||
| rentSaleRate, | rentSaleRate, | ||||
| @@ -149,10 +149,10 @@ | |||||
| round( | round( | ||||
| (select sum(mtd.trade_amt) | (select sum(mtd.trade_amt) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) / | |||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) / | |||||
| (select count(mtd.id) | (select count(mtd.id) | ||||
| from wx_merchant m | from wx_merchant m | ||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate}) | |||||
| left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id where m.business_id = b.id and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate} and m.status = 1) | |||||
| /100,2) comPrice | /100,2) comPrice | ||||
| from wx_business b | from wx_business b | ||||
| @@ -253,6 +253,7 @@ | |||||
| and m.tenant_id = #{tenantId} | and m.tenant_id = #{tenantId} | ||||
| and s.is_del = 0 | and s.is_del = 0 | ||||
| and ms.is_del = 0 | and ms.is_del = 0 | ||||
| and m.status = 1 | |||||
| group by m.business_id | group by m.business_id | ||||
| </select> | </select> | ||||