Browse Source

Merge branch 'develop' of https://git.youlane.cn/server/formallProject into develop

release_toaliyun_real
hupeng 7 years ago
parent
commit
3c64db1538
25 changed files with 310 additions and 160 deletions
  1. +8
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  2. +13
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java
  3. +8
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  4. +1
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java
  5. +4
    -0
      mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java
  6. +90
    -0
      mallinkAdmin/src/main/resources/db/migration/V201907051056__L_ADD_FLOW_DATA.sql
  7. +1
    -0
      mallinkAdmin/src/main/resources/db/migration/V201907051354__L_ADD_FLOW_DATA.sql
  8. +1
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java
  9. +14
    -8
      mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java
  10. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java
  11. +2
    -1
      mallinkService/src/main/java/com/iformall/pay/WxPayment.java
  12. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java
  13. +10
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  14. +27
    -22
      mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java
  15. +1
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java
  16. +3
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  17. +7
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java
  18. +4
    -1
      mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml
  19. +84
    -94
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml
  20. +2
    -1
      mallinkService/src/main/resources/mapper/WxBusinessMapper.xml
  21. +1
    -1
      mallinkService/src/main/resources/mapper/WxCouponCarMapper.xml
  22. +4
    -5
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml
  23. +21
    -11
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml
  24. +1
    -1
      mallinkService/src/main/resources/mapper/WxOrderMapper.xml
  25. +1
    -1
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml

+ 8
- 2
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java View File

@@ -8,6 +8,7 @@ import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillProperty; import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxPropertyContract;
import com.iformall.enums.EnumRentStartType; import com.iformall.enums.EnumRentStartType;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.service.WxBillPropertyService; import com.iformall.service.WxBillPropertyService;
import com.iformall.service.WxPropertyContractService; import com.iformall.service.WxPropertyContractService;
@@ -107,8 +108,13 @@ public class WxPropertyContractController extends BaseController {
WxBillProperty wxBillProperty = new WxBillProperty(); WxBillProperty wxBillProperty = new WxBillProperty();
wxBillProperty.setTenantId(super.getTenantId()); wxBillProperty.setTenantId(super.getTenantId());
wxBillPropertyService.updateBillStatus(wxBillProperty); wxBillPropertyService.updateBillStatus(wxBillProperty);
Map<String, Object> data = wxPropertyContractService.getById(id);
return new ResultData(data);
try {
Map<String, Object> data = wxPropertyContractService.getById(id);
return new ResultData(data);
} catch (MallinkException e) {
logger.error(e.getMessage());
return new ResultData(e.getErrorCode(), e.getMessage());
}
} }


@RequestMapping("/download") @RequestMapping("/download")


+ 13
- 2
mallinkAdmin/src/main/java/com/iformall/controller/market/WxActivityController.java View File

@@ -7,6 +7,7 @@ import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController; import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxActivity; import com.iformall.domain.po.WxActivity;
import com.iformall.enums.EnumActivityStatus; import com.iformall.enums.EnumActivityStatus;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxActivityService; import com.iformall.service.WxActivityService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@@ -54,7 +55,12 @@ public class WxActivityController extends BaseController {
logger.debug("[" + getIpAddr() + "] WxActivityController::add"); logger.debug("[" + getIpAddr() + "] WxActivityController::add");
wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode()); wxActivity.setStatus(EnumActivityStatus.STATUS_THROW_IN.getCode());
wxActivity.setTenantId(getTenantId()); wxActivity.setTenantId(getTenantId());
wxActivityService.saveOrUpdate(wxActivity);
try {
wxActivityService.saveOrUpdate(wxActivity);
} catch (MallinkException e) {
logger.error(e.getMessage());
return new ResultData(e.getErrorCode(), e.getMessage());
}
return new ResultData(); return new ResultData();
} }


@@ -63,7 +69,12 @@ public class WxActivityController extends BaseController {
@SystemControllerLog(description = "活动-id更新") @SystemControllerLog(description = "活动-id更新")
public ResultData update(@RequestBody WxActivity wxActivity) { public ResultData update(@RequestBody WxActivity wxActivity) {
logger.debug("[" + getIpAddr() + "] WxActivityController::update"); logger.debug("[" + getIpAddr() + "] WxActivityController::update");
return wxActivityService.saveOrUpdate(wxActivity);
try {
return wxActivityService.saveOrUpdate(wxActivity);
} catch (MallinkException e) {
logger.error(e.getMessage());
return new ResultData(e.getErrorCode(), e.getMessage());
}
} }


@ApiOperation("根据id更新接口") @ApiOperation("根据id更新接口")


+ 8
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java View File

@@ -179,6 +179,14 @@ public class WxCouponController extends BaseController {
if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){ if(wxCoupon.getValidEndDate()!=null && wxCoupon.getValidEndDate().before(coupon.getValidEndDate())){
return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR); return new ResultData(ErrorCode.COUPON_STOCK_ENDTIME_ERR);
} }
if((wxCoupon.getValidEndDate()!=null&&coupon.getValidEndDate()!=null && DateUtils.format(wxCoupon.getValidEndDate()).equals(DateUtils.format(coupon.getValidEndDate()))
&& wxCoupon.getInventory().equals(coupon.getInventory()))
||
(wxCoupon.getValidDays()!=null && coupon.getValidDays()!=null && wxCoupon.getInventory().equals(coupon.getInventory()) &&
wxCoupon.getValidDays().equals(coupon.getValidDays()))
){
return new ResultData(ErrorCode.COUPON_STOCK_VALID_DATE_SETTING_ERR);
}
} }


//启动审批流 //启动审批流


+ 1
- 2
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxBillPropertyController.java View File

@@ -57,8 +57,7 @@ public class WxBillPropertyController extends BaseController {
@SystemControllerLog(description = "物业账单-更新") @SystemControllerLog(description = "物业账单-更新")
public ResultData update(@RequestBody WxBillProperty wxBillProperty) { public ResultData update(@RequestBody WxBillProperty wxBillProperty) {
logger.debug("[" + getIpAddr() + "] WxBillPropertyController::update"); logger.debug("[" + getIpAddr() + "] WxBillPropertyController::update");
wxBillPropertyService.saveOrUpdate(wxBillProperty, getUser());
return new ResultData();
return wxBillPropertyService.saveOrUpdate(wxBillProperty, getUser());
} }


@GetMapping("/del") @GetMapping("/del")


+ 4
- 0
mallinkAdmin/src/main/java/com/iformall/tenant/TenantInfoImpl.java View File

@@ -100,6 +100,10 @@ public class TenantInfoImpl implements TenantInfo {
return true; return true;
if ("com.iformall.mapper.WxActivityJoinMapper.updateStatus".equals(ms.getId())) if ("com.iformall.mapper.WxActivityJoinMapper.updateStatus".equals(ms.getId()))
return true; return true;
if ("com.iformall.mapper.WxCouponMapper.findCouponList".equals(ms.getId()))
return true;
if ("com.iformall.mapper.WxCouponMapper.findCouponListCount".equals(ms.getId()))
return true;
return false; return false;
} }
} }

+ 90
- 0
mallinkAdmin/src/main/resources/db/migration/V201907051056__L_ADD_FLOW_DATA.sql View File

@@ -0,0 +1,90 @@
delete from wx_flow_config where name in('营销审批','拼团审批','有价卷审批','卡审批','砍价审批');

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560252222, 0, '789', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560252222, '789', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560253333, 0, '790', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560253333, '790', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560254444, 0, '1001', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560254444, '1001', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560255555, 0, '1002', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255555, '1002', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560255556, 0, '1003', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560255556, '1003', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560256666, 0, '1004', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560256666, '1004', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560257777, 0, '1005', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560257777, '1005', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560258888, 0, '1006', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560258888, '1006', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560259999, 0, '1007', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560259999, '1007', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560260000, 0, '1008', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260000, '1008', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);

INSERT INTO `wx_flow_config` (`id`, `parent_id`, `tenant_id`, `name`, `type`, `model_id`, `create_date`, `update_date`, `sort`)
VALUES
(1560260001, 0, '1009', '营销审批', 0, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '有价卷审批', 9, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 1),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '卡审批', 10, 0, '2019-06-11 13:42:18', '2019-06-11 13:42:18', 2),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '拼团审批', 11, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 3),
((select unix_timestamp(now()) + CEILING(RAND()*90000+10000)), 1560260001, '1009', '砍价审批', 12, 0, '2019-06-11 14:02:42', '2019-06-21 10:34:16', 4);


+ 1
- 0
mallinkAdmin/src/main/resources/db/migration/V201907051354__L_ADD_FLOW_DATA.sql View File

@@ -0,0 +1 @@
update wx_flow_config set name = '有价券审批' where name ='有价卷审批';

+ 1
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/ActivitySchedule.java View File

@@ -99,6 +99,7 @@ public class ActivitySchedule {
activity.setIsExpired(EnumActivityExpired.YES.getCode()); activity.setIsExpired(EnumActivityExpired.YES.getCode());
activity.setUpdateTime(new Date()); activity.setUpdateTime(new Date());
wxActivityMapper.activityExipred(activity); wxActivityMapper.activityExipred(activity);
wxActivityJoinMapper.activityExpired();
} }


/** /**


+ 14
- 8
mallinkService/src/main/java/com/iformall/domain/vo/WxCouponOrderBVo.java View File

@@ -57,23 +57,23 @@ public class WxCouponOrderBVo extends WxCouponOrder{
@io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone") @io.swagger.annotations.ApiModelProperty(value="c用户绑定的手机号",name="cUserPhone")
private String cUserPhone; private String cUserPhone;


@Excel(name = "交易时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "8")
@Excel(name = "交易时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9")
@io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate") @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createDate")
private Date createDate; private Date createDate;


@Transient @Transient
@Excel(name = "面额(元)", width = 20, orderNum = "6")
@Excel(name = "面额(元)", width = 20, orderNum = "7")
private String priceStr; private String priceStr;


@Transient @Transient
@Excel(name = "交易价格(元)", width = 20, orderNum = "5")
@Excel(name = "交易价格(元)", width = 20, orderNum = "6")
private String salePriceStr; private String salePriceStr;


@Excel(name = "状态", width = 20, replace = {"可以退款_0", "已经使用_1", "已经过期_2", "已经退款_3"}, orderNum = "14")
@Excel(name = "状态", width = 20, replace = {"待使用_0", "已核销_1", "已过期_2", "已退款_3"}, orderNum = "14")
@io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus")
private Integer couponOrderStatus; private Integer couponOrderStatus;


@Excel(name = "核销/过期/退款时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "9")
@Excel(name = "核销/过期/退款时间", width = 20, exportFormat = "yyyy-MM-dd HH:mm:ss", orderNum = "10")
@io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate")
private Date updateDate; private Date updateDate;


@@ -101,7 +101,7 @@ public class WxCouponOrderBVo extends WxCouponOrder{
return new BigDecimal(subsidyNum == null ? 0 : subsidyNum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString(); return new BigDecimal(subsidyNum == null ? 0 : subsidyNum).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString();
} }


@Excel(name = "补贴额(元)", width = 50, orderNum = "7")
@Excel(name = "补贴额(元)", width = 50, orderNum = "8")
@io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidyNumStr") @io.swagger.annotations.ApiModelProperty(value = "补贴额", name = "subsidyNumStr")
private String subsidyNumStr; private String subsidyNumStr;


@@ -112,11 +112,11 @@ public class WxCouponOrderBVo extends WxCouponOrder{
private String bUserName; private String bUserName;
@io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone") @io.swagger.annotations.ApiModelProperty(value="b端用户手机号",name="bUserPhone")
private String bUserPhone; private String bUserPhone;
@Excel(name = "商户", width = 50, orderNum = "3")
@Excel(name = "发券商户", width = 50, orderNum = "3")
@io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName") @io.swagger.annotations.ApiModelProperty(value="使用券商户名",name="merchantName")
private String merchantName; private String merchantName;


@Excel(name = "商铺号", width = 50, orderNum = "4")
@Excel(name = "商铺号", width = 50, orderNum = "5")
@Transient @Transient
private String shopNumber; private String shopNumber;


@@ -141,9 +141,15 @@ public class WxCouponOrderBVo extends WxCouponOrder{


@Transient @Transient
private Long couponId; private Long couponId;

@Excel(name = "券类型", width = 50, orderNum = "15", replace = {"满减券_1", "代金券_2", "团购券_3", "礼品券_4", "停车券_5", "通用券_6", "砍价券_8", "团购券_9", "积分券_50", "家积分停车券_51", "消费卡_100"})
@Transient @Transient
private Integer couponType; private Integer couponType;


@Excel(name = "核销商户", width = 50, orderNum = "4")
@Transient
private String verifyMerchantName;

@Transient @Transient
private Integer floor; private Integer floor;
@Transient @Transient


+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxActivityJoinMapper.java View File

@@ -20,4 +20,5 @@ public interface WxActivityJoinMapper extends CommonMapper<WxActivityJoin, Long>


void updateStatus(List<WxActivity> wxActivity); void updateStatus(List<WxActivity> wxActivity);


void activityExpired();
} }

+ 2
- 1
mallinkService/src/main/java/com/iformall/pay/WxPayment.java View File

@@ -1,6 +1,7 @@
package com.iformall.pay; package com.iformall.pay;


import com.iformall.utils.*; import com.iformall.utils.*;
import org.apache.commons.codec.digest.HmacAlgorithms;
import org.apache.commons.codec.digest.HmacUtils; import org.apache.commons.codec.digest.HmacUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;


@@ -416,7 +417,7 @@ public class WxPayment {
params.remove("sign"); params.remove("sign");
String stringA = packageSign(params, false); String stringA = packageSign(params, false);
String stringSignTemp = stringA + "&key=" + partnerKey; String stringSignTemp = stringA + "&key=" + partnerKey;
return HmacUtils.hmacSha256Hex(partnerKey, stringSignTemp).toUpperCase();
return new HmacUtils(HmacAlgorithms.HMAC_SHA_256, partnerKey).hmacHex(stringSignTemp).toUpperCase();
} }


/** /**


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java View File

@@ -172,7 +172,7 @@ public class WxBillRentServiceImpl implements WxBillRentService {
logger.error("添加租赁账单行为日志,e:" + e.getMessage()); logger.error("添加租赁账单行为日志,e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
} }
return new ResultData(Result.SUCCESS, "更新租赁账单成功");
return new ResultData(Result.SUCCESS, "更新租赁账单成功", wxBillRent);
} }
} }




+ 10
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java View File

@@ -84,14 +84,22 @@ public class WxChartServiceImpl implements WxChartDataService {
public ResultData queryData(Map<String, String> paramsMap) { public ResultData queryData(Map<String, String> paramsMap) {
String tenantId = paramsMap.get("tenantId"); String tenantId = paramsMap.get("tenantId");
Integer chart = Integer.valueOf(paramsMap.get("chart")); Integer chart = Integer.valueOf(paramsMap.get("chart"));
String startdate = paramsMap.get("startdate") + " 00:00:00";
String enddate = paramsMap.get("enddate") + " 23:59:59";
String startdate = paramsMap.get("startdate");
String enddate = paramsMap.get("enddate");

if(chart == null){
return new ResultData(ErrorCode.REPORT_TYPE_UNKNOWN);
}


if (StringUtils.isEmpty(startdate)) { if (StringUtils.isEmpty(startdate)) {
startdate = DateUtils.getSystemTime("yyyy-MM-dd") + " 00:00:00" ; startdate = DateUtils.getSystemTime("yyyy-MM-dd") + " 00:00:00" ;
} else {
startdate = startdate + " 00:00:00";
} }
if (StringUtils.isEmpty(enddate)) { if (StringUtils.isEmpty(enddate)) {
enddate = DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"; enddate = DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59";
} else {
enddate = enddate + " 23:59:59";
} }


//出租率 //出租率


+ 27
- 22
mallinkService/src/main/java/com/iformall/service/impl/WxCouponOrderServiceImpl.java View File

@@ -279,6 +279,9 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
String filename = "券订单"; String filename = "券订单";
List<WxCouponOrderBVo> list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder); List<WxCouponOrderBVo> list = wxCouponOrderMapper.findListOfAdmin(wxCouponOrder);
list.parallelStream().forEach(c -> { list.parallelStream().forEach(c -> {
if (c.getCouponOrderStatus().equals(EnumCouponOrderStatus.COUPON_ORDER_USE_WAIT.getCode())) {
c.setUpdateDate(null);
}
if (!c.getMerchantId().equals(0L)) { if (!c.getMerchantId().equals(0L)) {
List<WxMerchantVo> merchantVoList = c.getMerchantVoList(); List<WxMerchantVo> merchantVoList = c.getMerchantVoList();
if (!merchantVoList.isEmpty()) { if (!merchantVoList.isEmpty()) {
@@ -635,28 +638,30 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService {
// 6. get payOrder info // 6. get payOrder info
int formType = EnumMsgLimitType.WEAPP_FORMID.getCode(); int formType = EnumMsgLimitType.WEAPP_FORMID.getCode();
if(StringUtils.isBlank(order.getFormId()) || order.getFormId().equalsIgnoreCase("undefined")) { if(StringUtils.isBlank(order.getFormId()) || order.getFormId().equalsIgnoreCase("undefined")) {
// formId为空,获取prepayId
WxPayOrder payOrder = null;
WxPayOrder payOrderQ = new WxPayOrder();
payOrderQ.setTenantId(couponOrder.getTenantId());
payOrderQ.setOrderId(order.getId());
payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode());
List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ);
if (payList.size() > 0) {
payOrder = payList.get(0);
}
if (payOrder == null) {
logger.error("找不到payOrder信息");
throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND);
}
if (payOrder.getPrepayId() == null) {
logger.error("payOrder信息中,prepay_id为空");
throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY);
}
dateAfter7Day = DateUtils.getHourTimeAfter(7, payOrder.getCreateTime());
if(curDate.before(dateAfter7Day)) {
formId = payOrder.getPrepayId();
formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode();
if(order.getPayment() > 0) {
// formId为空,获取prepayId
WxPayOrder payOrder = null;
WxPayOrder payOrderQ = new WxPayOrder();
payOrderQ.setTenantId(couponOrder.getTenantId());
payOrderQ.setOrderId(order.getId());
payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_STATUS_SUCCESS.getCode());
List<WxPayOrder> payList = wxPayOrderMapper.select(payOrderQ);
if (payList.size() > 0) {
payOrder = payList.get(0);
}
if (payOrder == null) {
logger.error("找不到payOrder信息");
throw new MallinkException(ErrorCode.PAY_ORDER_NOT_FOUND);
}
if (payOrder.getPrepayId() == null) {
logger.error("payOrder信息中,prepay_id为空");
throw new MallinkException(ErrorCode.PREPAY_ID_IS_EMPTY);
}
dateAfter7Day = DateUtils.getHourTimeAfter(7, payOrder.getCreateTime());
if (curDate.before(dateAfter7Day)) {
formId = payOrder.getPrepayId();
formType = EnumMsgLimitType.WEAPP_PREPAYID.getCode();
}
} }
} }




+ 1
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxFlowServiceImpl.java View File

@@ -204,8 +204,7 @@ public class WxFlowServiceImpl implements WxFlowService {
wxCoupon.setPutApplyStatus(applyStatus); wxCoupon.setPutApplyStatus(applyStatus);
}else if(EnumCouponAppType.STOCK.getCode().equals(operateType)){ }else if(EnumCouponAppType.STOCK.getCode().equals(operateType)){
wxCoupon.setStockApplyStatus(applyStatus); wxCoupon.setStockApplyStatus(applyStatus);
if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()
||EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) {
if(EnumRentContractAppStatus.FINISH.getCode().intValue() == applyStatus.intValue()) {
//减库存 //减库存
if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) { if(EnumFlowKey.NEW_COUPON_UPLINE.getCode().equals(flowType) || EnumFlowKey.NEW_CARD_UPLINE.getCode().equals(flowType)) {
Integer inventory = (Integer) getVariableByKey(variables, "inventory"); Integer inventory = (Integer) getVariableByKey(variables, "inventory");


+ 3
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -262,6 +262,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) { wxRentContract.getStatus().equals(EnumRentContractStatus.INVALID.getCode())) {
return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED); return new ResultData(ErrorCode.RENT_CONTRACT_IS_TERMINATED);
} }
} else {
return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND);
} }
if (null == record.getMerchantId() && record.getOperationType().equals(EnumContractOperationType.PART.getCode())) { if (null == record.getMerchantId() && record.getOperationType().equals(EnumContractOperationType.PART.getCode())) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId不能为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId不能为空");
@@ -365,7 +367,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND);
} }


record.setRentalStartDate(wxPropertyContract.getRentalStartDate());
record.setRentalStartDate(wxRentContract.getRentalStartDate());
record.setRentalEndDate(wxRentContract.getRentalEndDate()); record.setRentalEndDate(wxRentContract.getRentalEndDate());
record.setStartDate(wxRentContract.getStartDate()); record.setStartDate(wxRentContract.getStartDate());
record.setEndDate(wxRentContract.getEndDate()); record.setEndDate(wxRentContract.getEndDate());


+ 7
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxRentPropertyContractServiceImpl.java View File

@@ -7,6 +7,7 @@ import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract; import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.vo.WxRentPropertyContractVo; import com.iformall.domain.vo.WxRentPropertyContractVo;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.mapper.WxRentContractMapper; import com.iformall.mapper.WxRentContractMapper;
import com.iformall.service.WxPropertyContractService; import com.iformall.service.WxPropertyContractService;
@@ -71,8 +72,12 @@ public class WxRentPropertyContractServiceImpl implements WxRentPropertyContract
wxPropertyContractQuery.setRentContractId(id); wxPropertyContractQuery.setRentContractId(id);
WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(wxPropertyContractQuery); WxPropertyContract propertyContract = wxPropertyContractMapper.selectOne(wxPropertyContractQuery);
if (propertyContract != null) { if (propertyContract != null) {
Map<String, Object> property = wxPropertyContractService.getById(propertyContract.getId());
data.put("property", property);
try {
Map<String, Object> property = wxPropertyContractService.getById(propertyContract.getId());
data.put("property", property);
} catch (MallinkException e) {
logger.error(e.getMessage());
}
} }
return new ResultData(data); return new ResultData(data);
} }


+ 4
- 1
mallinkService/src/main/resources/mapper/WxActivityJoinMapper.xml View File

@@ -104,6 +104,9 @@
#{activity.id} #{activity.id}
</foreach> </foreach>
</update> </update>

<update id="activityExpired">
update wx_activity_join set `status`=2 where `status`!=2 and activity_id in(select id from wx_activity where is_expired=1)
</update>


</mapper> </mapper>

+ 84
- 94
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml View File

@@ -53,45 +53,37 @@
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,receive_date,pay_date,expired_day,status,'' starttime,'' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments
from wx_bill_rent where is_preview = 0
union
from wx_bill_rent where tenant_id=#{tenantId} and is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,shop_info,NULL comments from wx_bill_rent_deposit
union
endtime,rent_shop_type,shop_info,NULL comments from wx_bill_rent_deposit where tenant_id=#{tenantId}
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,receive_date,pay_date,expired_day,status,'' starttime,'' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments
from wx_bill_property where is_preview = 0
union
from wx_bill_property where tenant_id=#{tenantId} and is_preview = 0
union all
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,''
endtime,rent_shop_type,shop_info,NULL comments from wx_bill_property_deposit
union
select id,merchant_id,shop_id,tenant_id,'水费' name,5 bill_type_value,'水费' bill_type,0 as
endtime,rent_shop_type,shop_info,NULL comments from wx_bill_property_deposit where tenant_id=#{tenantId}
union all
select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name,
case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value,
case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,
rent_shop_type,'[]' shop_info,NULL comments rent_shop_type,'[]' shop_info,NULL comments
from wx_bill_daily where type=1
union
select id,merchant_id,shop_id,tenant_id,'电费' name,6 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,NULL comments
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,NULL comments
from wx_bill_daily where type=3
union
from wx_bill_daily where tenant_id=#{tenantId}
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
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,
rent_shop_type,'[]' shop_info,comments rent_shop_type,'[]' shop_info,comments
from wx_bill_other
union
from wx_bill_other where tenant_id=#{tenantId}
union all
select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as
need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime, need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,
rent_shop_type,'[]' shop_info,comments rent_shop_type,'[]' shop_info,comments
from wx_bill_other_deposit
from wx_bill_other_deposit where tenant_id=#{tenantId}
) bill ) bill
left join wx_merchant m on bill.merchant_id=m.id left join wx_merchant m on bill.merchant_id=m.id
left join wx_shop s on bill.shop_id=s.id left join wx_shop s on bill.shop_id=s.id
@@ -130,34 +122,34 @@
select count(bill.id) owncount,IFNULL(sum(bill.owe),0) owe from ( select count(bill.id) owncount,IFNULL(sum(bill.owe),0) owe from (
select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金' select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0 bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_rent_deposit wx_bill_rent_deposit
union
union all
select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费' select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property where is_preview = 0 wx_bill_property where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property_deposit wx_bill_property_deposit
union
union all
select id,merchant_id,shop_id,tenant_id,5 bill_type_value,'水费' bill_type,0 as select id,merchant_id,shop_id,tenant_id,5 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=1 type=1
union
union all
select id,merchant_id,shop_id,tenant_id,6 bill_type_value,'电费' bill_type,0 as select id,merchant_id,shop_id,tenant_id,6 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2 type=2
union
union all
select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=3 type=3
union
union all
select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union
union all
select id,merchant_id,shop_id,tenant_id,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,8 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_deposit need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit
) bill ) bill
@@ -185,34 +177,34 @@
select count(bill.id) paycount,IFNULL(sum(bill.pay),0) pay from ( select count(bill.id) paycount,IFNULL(sum(bill.pay),0) pay from (
select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金' select id,merchant_id,shop_id,tenant_id,1 bill_type_value,'租金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0 bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_rent where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_rent_deposit wx_bill_rent_deposit
union
union all
select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费' select id,merchant_id,shop_id,tenant_id,3 bill_type_value,'物业费'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property where is_preview = 0 wx_bill_property where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from
wx_bill_property_deposit wx_bill_property_deposit
union
union all
select id,merchant_id,shop_id,tenant_id,5 bill_type_value,'水费' bill_type,0 as select id,merchant_id,shop_id,tenant_id,5 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=1 type=1
union
union all
select id,merchant_id,shop_id,tenant_id,6 bill_type_value,'电费' bill_type,0 as select id,merchant_id,shop_id,tenant_id,6 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=2 type=2
union
union all
select id,merchant_id,shop_id,tenant_id,9 bill_type_value,'空调费' bill_type,0 as 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_daily where
type=3 type=3
union
union all
select id,merchant_id,shop_id,tenant_id,7 bill_type_value,'其他' bill_type,0 as 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other
union
union all
select id,merchant_id,shop_id,tenant_id,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,8 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_deposit need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,rent_shop_type from wx_bill_other_deposit
) bill ) bill
@@ -237,42 +229,40 @@
rentShopType from ( rentShopType from (
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,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
from wx_bill_rent where is_preview = 0 and rent_contract_id in (select id from wx_rent_contract where status in
from wx_bill_rent where is_preview = 0 and tenant_id=#{tenantId}and rent_contract_id in (select id from
wx_rent_contract where status in
(2,3,4)) (2,3,4))
union
union all
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
from wx_bill_rent_deposit where rent_contract_id in (select id from wx_rent_contract where status in (2,3,4))
union
from wx_bill_rent_deposit where tenant_id=#{tenantId} and rent_contract_id in (select id from wx_rent_contract
where status in (2,3,4))
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,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
from wx_bill_property where is_preview = 0 and property_contract_id in (select id from wx_property_contract
from wx_bill_property where is_preview = 0 and tenant_id=#{tenantId} and property_contract_id in (select id from
wx_property_contract
where status in(2,3,4)) where status in(2,3,4))
union
union all
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime,rent_shop_type
from wx_bill_property_deposit where property_contract_id in (select id from wx_property_contract where status in
from wx_bill_property_deposit where tenant_id=#{tenantId} and property_contract_id in (select id from
wx_property_contract where status in
(2,3,4)) (2,3,4))
union
select id,merchant_id,shop_id,tenant_id,'水费' name,5 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=1
union
select id,merchant_id,shop_id,tenant_id,'电费' name,6 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=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
union all
select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name,
case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value,
case when type=1 then '水费' when type=2 then '电费' else '空调费' end 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 tenant_id=#{tenantId}
union all
select id,merchant_id,shop_id,tenant_id,name,7 bill_type_vaue,'其他' bill_type,0 as 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other
union
from wx_bill_other where tenant_id=#{tenantId}
union all
select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,comments as name,8 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 need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,'' starttime,'' endtime,rent_shop_type
from wx_bill_other_deposit
from wx_bill_other_deposit where tenant_id=#{tenantId}
) bill ) bill
left join wx_merchant m on bill.merchant_id=m.id left join wx_merchant m on bill.merchant_id=m.id
left join wx_shop s on bill.shop_id=s.id left join wx_shop s on bill.shop_id=s.id
@@ -323,35 +313,35 @@
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 endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 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_deposit endtime,rent_shop_type from wx_bill_rent_deposit
union
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 endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 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_deposit endtime,rent_shop_type from wx_bill_property_deposit
union
union all
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=1 from wx_bill_daily where type=1
union
union all
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as 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 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 from wx_bill_daily where type=2
union
union all
select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as 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 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 from wx_bill_daily where type=3
union
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
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_other from wx_bill_other
union
union all
select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,name,8 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_other_deposit from wx_bill_other_deposit
@@ -370,35 +360,35 @@
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 endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 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_deposit endtime,rent_shop_type from wx_bill_rent_deposit
union
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 endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 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_deposit endtime,rent_shop_type from wx_bill_property_deposit
union
union all
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=1 from wx_bill_daily where type=1
union
union all
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as 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 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 from wx_bill_daily where type=2
union
union all
select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as 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 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 from wx_bill_daily where type=3
union
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
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_other from wx_bill_other
union
union all
select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,name,8 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_other_deposit from wx_bill_other_deposit
@@ -417,11 +407,11 @@
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 endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 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_deposit endtime,rent_shop_type from wx_bill_rent_deposit
union
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 endtime,rent_shop_type from wx_bill_property where is_preview = 0
@@ -429,23 +419,23 @@
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 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_deposit endtime,rent_shop_type from wx_bill_property_deposit
union
union all
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=1 from wx_bill_daily where type=1
union
union all
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as 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 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 from wx_bill_daily where type=2
union
union all
select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as 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 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 from wx_bill_daily where type=3
union
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
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_other from wx_bill_other
union
union all
select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,name,8 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_other_deposit from wx_bill_other_deposit
@@ -468,35 +458,35 @@
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 endtime,rent_shop_type from wx_bill_rent where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 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_deposit endtime,rent_shop_type from wx_bill_rent_deposit
union
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 endtime,rent_shop_type from wx_bill_property where is_preview = 0
union
union all
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 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_deposit endtime,rent_shop_type from wx_bill_property_deposit
union
union all
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=1 from wx_bill_daily where type=1
union
union all
select id,merchant_id,shop_id,tenant_id,'电费' name,6 bill_type_value,'电费' bill_type,0 as 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 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 from wx_bill_daily where type=2
union
union all
select id,merchant_id,shop_id,tenant_id,'空调费' name,9 bill_type_value,'空调费' bill_type,0 as 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 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 from wx_bill_daily where type=3
union
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
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_other from wx_bill_other
union
union all
select id,merchant_id,shop_id,tenant_id,name,8 bill_type_value,'其他押金' bill_type,0 as select id,merchant_id,shop_id,tenant_id,name,8 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_other_deposit from wx_bill_other_deposit


+ 2
- 1
mallinkService/src/main/resources/mapper/WxBusinessMapper.xml View File

@@ -168,7 +168,7 @@
left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id left join wx_merchant_trade_daily mtd on mtd.merchant_id = m.id
left join wx_merchant_shop wmt on wmt.merchant_id = m.id left join wx_merchant_shop wmt on wmt.merchant_id = m.id
left join wx_shop ws on(wmt.shop_id = ws.id) left join wx_shop ws on(wmt.shop_id = ws.id)
where m.business_id=#{id} and m.tenant_id=#{tenantId})
where m.business_id=#{id} and m.tenant_id=#{tenantId} and mtd.create_date between #{startdate} and #{enddate})
,2) devoteRate ,2) devoteRate


from wx_merchant m from wx_merchant m
@@ -176,6 +176,7 @@
left join wx_merchant_shop wmt on wmt.merchant_id = m.id left join wx_merchant_shop wmt on wmt.merchant_id = m.id
left join wx_shop ws on(wmt.shop_id = ws.id) left join wx_shop ws on(wmt.shop_id = ws.id)
where m.business_id=#{id} and m.tenant_id=#{tenantId} where m.business_id=#{id} and m.tenant_id=#{tenantId}
and mtd.create_date between #{startdate} and #{enddate}
group by m.id group by m.id
order by devoteRate desc order by devoteRate desc
</select> </select>


+ 1
- 1
mallinkService/src/main/resources/mapper/WxCouponCarMapper.xml View File

@@ -127,7 +127,7 @@


<sql id="CouponCarColumns"> <sql id="CouponCarColumns">
c.id,c.tenant_id,c.type,c.cover_img,c.cover_picture,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, c.id,c.tenant_id,c.type,c.cover_img,c.cover_picture,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business,
car.vendor_type, car.vendor_params,c.credit_price
car.vendor_type, car.vendor_params,c.credit_price, c.`auto_refund`
</sql> </sql>
<select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap"> <select id="findVoDetail" parameterType="java.lang.Long" resultMap="CouponCarMap">
select <include refid="CouponCarColumns" /> select <include refid="CouponCarColumns" />


+ 4
- 5
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -410,17 +410,16 @@
<!--如果配置了审批模板,需要过滤投放审批状态--> <!--如果配置了审批模板,需要过滤投放审批状态-->
<if test="0 != filterCanPut or null ==filterCanPut "> <if test="0 != filterCanPut or null ==filterCanPut ">
<if test=" null != pressModelId and 0l != pressModelId"> <if test=" null != pressModelId and 0l != pressModelId">
and if(type=8,put_apply_status =2,1=1)
and if(type=8,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}) ,1=1)
</if> </if>
<if test=" null != groupModelId and 0l != groupModelId"> <if test=" null != groupModelId and 0l != groupModelId">
and if(type=9,put_apply_status =2,1=1)
and if(type=9,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}),1=1)
</if> </if>
<if test=" null != cardModelId and 0l != cardModelId"> <if test=" null != cardModelId and 0l != cardModelId">
and if(type=100,put_apply_status =2,1=1)
and if(type=100,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}),1=1)
</if> </if>
<if test=" null != couponModelId and 0l != couponModelId"> <if test=" null != couponModelId and 0l != couponModelId">

and if(type !=8 and type !=9 and type!=100,put_apply_status =2,1=1)
and if(type !=8 and type !=9 and type!=100,put_apply_status =2 or c.id in(select coupon_id from wx_coupon_channel where status=0 and tenant_id=#{tenantId}),1=1)
</if> </if>
</if> </if>




+ 21
- 11
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml View File

@@ -378,6 +378,8 @@
<result column="phone" jdbcType="VARCHAR" property="cUserPhone" /> <result column="phone" jdbcType="VARCHAR" property="cUserPhone" />
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> <result column="merchant_name" jdbcType="VARCHAR" property="merchantName" />
<result column="verify_merchant_name" jdbcType="VARCHAR" property="verifyMerchantName"/>
<collection column="{productId=coupon_id}" property="merchantVoList" <collection column="{productId=coupon_id}" property="merchantVoList"
ofType="com.iformall.domain.vo.WxMerchantVo" ofType="com.iformall.domain.vo.WxMerchantVo"
javaType="java.util.List" javaType="java.util.List"
@@ -393,7 +395,7 @@
where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name, where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name,
(case when com.mc = 1 then (select m.id from wx_merchant m, (case when com.mc = 1 then (select m.id from wx_merchant m,
wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id = co.coupon_id wx_coupon_merchant cm where m.id = cm.merchant_id and cm.product_id = co.coupon_id
and cm.status = 0) else 0 end) as merchant_id,(select phone from wx_c_user where id=co.c_user_id) phone
and cm.status = 0) else 0 end) as merchant_id,cu.phone,bu.verify_merchant_name
</sql> </sql>


<sql id="allAdminCouponOrderDetailColumns"> <sql id="allAdminCouponOrderDetailColumns">
@@ -407,14 +409,19 @@
<select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap">
select <include refid="allAdminCouponOrderListColumns" /> select <include refid="allAdminCouponOrderListColumns" />
from from
wx_coupon_order co,
wx_coupon c,
(select tco.id as tcoid,
(select count(*) from wx_coupon_merchant tcm
where tcm.product_id = tco.coupon_id
and tcm.status = 0) as mc
from wx_coupon_order tco) com
where com.tcoid = co.id
wx_coupon_order co inner join wx_coupon c on c.id = co.coupon_id
inner join (select tco.id as tcoid,
(select count(*) from wx_coupon_merchant tcm
where tcm.product_id = tco.coupon_id
and tcm.status = 0) as mc
from wx_coupon_order tco) com on com.tcoid = co.id
inner join wx_c_user cu on cu.id=co.c_user_id
left join (
select bu.id as bu_id,m.name as verify_merchant_name
from wx_merchant_b_user bu inner join wx_merchant m on bu.merchant_id=m.id
where bu.tenant_id = #{tenantId}
) bu on bu.bu_id = co.b_user_id
where 1=1
<choose> <choose>
<when test=" null != couponType"> <when test=" null != couponType">
and co.coupon_type = #{couponType} and co.coupon_type = #{couponType}
@@ -423,7 +430,6 @@
and co.coupon_type &lt; 100 and co.coupon_type &lt; 100
</otherwise> </otherwise>
</choose> </choose>
and c.id = co.coupon_id
<if test=" null != tenantId "> <if test=" null != tenantId ">
and co.tenant_id = #{tenantId} and co.tenant_id = #{tenantId}
</if> </if>
@@ -468,6 +474,10 @@
<if test=" null != business "> <if test=" null != business ">
and c.business = #{business} and c.business = #{business}
</if> </if>
<if test=" null != verifyMerchantName ''!= verifyMerchantName ">
and bu.verify_merchant_name = #{verifyMerchantName}
</if>
<if test="null!=building"> <if test="null!=building">
and co.coupon_id in( and co.coupon_id in(
select cm.product_id from wx_merchant_shop ms left join wx_merchant m on ms.merchant_id=m.id select cm.product_id from wx_merchant_shop ms left join wx_merchant m on ms.merchant_id=m.id
@@ -483,7 +493,7 @@
) )
</if> </if>
<if test=" null != sortColumns"> order by ${sortColumns} </if> <if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns"> order by id desc </if>
<if test=" null == sortColumns">order by co.create_date desc,co.id desc</if>
</select> </select>




+ 1
- 1
mallinkService/src/main/resources/mapper/WxOrderMapper.xml View File

@@ -566,7 +566,7 @@
</where> </where>


<if test=" null != sortColumns"> order by ${sortColumns} </if> <if test=" null != sortColumns"> order by ${sortColumns} </if>
<if test=" null == sortColumns">order by o.id desc</if>
<if test=" null == sortColumns">order by o.create_date desc, o.id desc</if>


</select> </select>


+ 1
- 1
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml View File

@@ -348,7 +348,7 @@
<if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if> <if test=" null != operationType ">and rc.`operation_type` = #{operationType}</if>
</where> </where>
<if test=" null != sortColumns">order by ${sortColumns}</if> <if test=" null != sortColumns">order by ${sortColumns}</if>
<if test=" null == sortColumns">order by rc.id desc</if>
<if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if>
</select> </select>






Loading…
Cancel
Save