Просмотр исходного кода

Merge remote-tracking branch 'origin/develop' into develop

release_toaliyun_real
luozukai 7 лет назад
Родитель
Сommit
f5551377a0
30 измененных файлов: 1048 добавлений и 76 удалений
  1. +78
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/WxCreditHistoryController.java
  2. +0
    -4
      mallinkAdmin/src/main/resources/db/migration/V20190401210901__ADD_RENT_FILES.sql
  3. +11
    -0
      mallinkAdmin/src/main/resources/db/migration/V201904012109__ADD_RENT_FILES.sql
  4. +17
    -0
      mallinkAdmin/src/main/resources/db/migration/V201904021540__ADD_RENT_BILL.sql
  5. +18
    -0
      mallinkAdmin/src/main/resources/db/migration/V201904021550__ADD_WX_CREDIT_HISTORY.sql
  6. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/WxCreditHistoryDto.java
  7. +1
    -8
      mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java
  8. +12
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java
  9. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java
  10. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java
  11. +150
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCreditHistory.java
  12. +11
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java
  13. +12
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
  14. +55
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxCreditHistoryVo.java
  15. +111
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxShopVo.java
  16. +35
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumUserType.java
  17. +15
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java
  18. +2
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java
  19. +1
    -1
      mallinkService/src/main/java/com/iformall/service/ExcelService.java
  20. +60
    -0
      mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java
  21. +34
    -5
      mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java
  22. +139
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java
  23. +63
    -40
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  24. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  25. +13
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  26. +4
    -2
      mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml
  27. +3
    -2
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  28. +122
    -0
      mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml
  29. +4
    -2
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml
  30. +50
    -7
      mallinkService/src/main/resources/mapper/WxShopMapper.xml

+ 78
- 0
mallinkAdmin/src/main/java/com/iformall/controller/WxCreditHistoryController.java Просмотреть файл

@@ -0,0 +1,78 @@
package com.iformall.controller;

import com.iformall.domain.dto.WxCreditHistoryDto;
import com.iformall.domain.vo.WxCreditHistoryVo;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.iformall.common.Result;
import com.iformall.common.ResultData;

import org.slf4j.Logger;
import com.iformall.domain.po.WxCreditHistory;
import com.iformall.service.WxCreditHistoryService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@RestController
@RequestMapping("wxCreditHistory")
public class WxCreditHistoryController extends BaseController
{
@Autowired
private WxCreditHistoryService wxCreditHistoryService;

private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCreditHistory wxCreditHistory, Integer pageNum, Integer pageSize) {
if (null == wxCreditHistory) wxCreditHistory = new WxCreditHistory();
final PageInfo<WxCreditHistoryVo> page = wxCreditHistoryService.listAsPageMore(wxCreditHistory, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCreditHistory wxCreditHistory) {
//Assert.notNull(wxCreditHistory.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCreditHistoryService.saveOrUpdate(wxCreditHistory);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCreditHistory wxCreditHistory) {
wxCreditHistoryService.saveOrUpdate(wxCreditHistory);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCreditHistoryService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCreditHistoryService.getById(id));
}
}

+ 0
- 4
mallinkAdmin/src/main/resources/db/migration/V20190401210901__ADD_RENT_FILES.sql Просмотреть файл

@@ -1,4 +0,0 @@
ALTER TABLE `wx_rent_contract`
ADD COLUMN `file_names` JSON NULL COMMENT '合同支持多文件' AFTER `fix_end_date`;

update `wx_rent_contract` set `file_names` = CONCAT('[{\"filename\":\"',`filename`,'\",\"filepath\":\"',`filepath`,'\"}]');

+ 11
- 0
mallinkAdmin/src/main/resources/db/migration/V201904012109__ADD_RENT_FILES.sql Просмотреть файл

@@ -0,0 +1,11 @@
ALTER TABLE `wx_rent_contract`
ADD COLUMN `file_names` JSON NULL COMMENT '合同支持多文件' AFTER `fix_end_date`;

update `wx_rent_contract`
set `file_names` =
CASE
WHEN `filename` is not null and LENGTH(`filename`) > 0 THEN
CONCAT('[{\"filename\":\"',`filename`,'\",\"filepath\":\"',`filepath`,'\"}]')
ELSE
CONCAT('[]')
END;

+ 17
- 0
mallinkAdmin/src/main/resources/db/migration/V201904021540__ADD_RENT_BILL.sql Просмотреть файл

@@ -0,0 +1,17 @@
ALTER TABLE `wx_rent_contract`
ADD COLUMN `rent_info` JSON NULL COMMENT '商铺信息';

ALTER TABLE `wx_property_contract`
ADD COLUMN `rent_info` JSON NULL COMMENT '商铺信息';

ALTER TABLE `wx_bill_rent`
ADD COLUMN `shop_info` JSON NULL COMMENT '商铺信息';

ALTER TABLE `wx_bill_rent_deposit`
ADD COLUMN `shop_info` JSON NULL COMMENT '商铺信息';

ALTER TABLE `wx_bill_property`
ADD COLUMN `shop_info` JSON NULL COMMENT '商铺信息';

ALTER TABLE `wx_bill_property_deposit`
ADD COLUMN `shop_info` JSON NULL COMMENT '商铺信息';

+ 18
- 0
mallinkAdmin/src/main/resources/db/migration/V201904021550__ADD_WX_CREDIT_HISTORY.sql Просмотреть файл

@@ -0,0 +1,18 @@
DROP TABLE IF EXISTS `wx_credit_history`;
CREATE TABLE `wx_credit_history` (
`id` bigint(64) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(50) NOT NULL COMMENT '租户ID',
`c_user_id` bigint(64) NOT NULL COMMENT '用户ID',
`credit_amount` int(11) NOT NULL COMMENT '总积分',
`credit_num` int(11) NOT NULL COMMENT '每笔积分明细',
`credit_type` tinyint(2) NOT NULL COMMENT '积分类型(操作说明)',
`create_date` datetime(0) NOT NULL COMMENT '创建日期',
`receipt_url` varchar(256) NULL DEFAULT NULL COMMENT '小票URL',
`operator_type` tinyint(2) NOT NULL COMMENT '操作人类型',
`operator_id` bigint(64) NOT NULL COMMENT '操作人ID',
`merchant_id` bigint(11) NULL DEFAULT NULL COMMENT '商户ID',
`coupon_id` bigint(64) NULL DEFAULT NULL COMMENT '券ID(积分兑换券时生成)',
`business_id` bigint(64) NULL DEFAULT NULL COMMENT '业态ID(计算新增积分时使用)',
`spend` int(11) NULL DEFAULT NULL COMMENT '花费',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB ROW_FORMAT = Dynamic COMMENT='积分记录';

+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/dto/WxCreditHistoryDto.java Просмотреть файл

@@ -0,0 +1,4 @@
package com.iformall.domain.dto;

public class WxCreditHistoryDto {
}

+ 1
- 8
mallinkService/src/main/java/com/iformall/domain/po/MallUserInfo.java Просмотреть файл

@@ -21,7 +21,7 @@ public class MallUserInfo implements Serializable {
protected Long id;
@Transient
protected List<String> ids;
protected List<Long> ids;
@Transient
protected String sortColumns;
@@ -37,13 +37,6 @@ public class MallUserInfo implements Serializable {
return sortColumns;
}
public List<String> getIds() {
return ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}


/**租户ID**/


+ 12
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java Просмотреть файл

@@ -104,6 +104,18 @@ public class WxBillDeposit implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "退还金额", name = "returnPrice")
private Integer returnPrice;

@io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "shopInfo")
private String shopInfo;

public String getShopInfo() {
return shopInfo;
}

public void setShopInfo(String shopInfo) {
this.shopInfo = shopInfo;
}


public Date getStarttime() {
return starttime;
}


+ 11
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java Просмотреть файл

@@ -119,6 +119,17 @@ public class WxBillProperty implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "预览账单0否1是", name = "isPreview")
private Integer isPreview;

@io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "shopInfo")
private String shopInfo;

public String getShopInfo() {
return shopInfo;
}

public void setShopInfo(String shopInfo) {
this.shopInfo = shopInfo;
}

public Integer getIsPreview() {
return isPreview;
}


+ 11
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java Просмотреть файл

@@ -104,6 +104,17 @@ public class WxBillPropertyDeposit implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "退还金额", name = "returnPrice")
private Integer returnPrice;

@io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "shopInfo")
private String shopInfo;

public String getShopInfo() {
return shopInfo;
}

public void setShopInfo(String shopInfo) {
this.shopInfo = shopInfo;
}

public Date getStarttime() {
return starttime;
}


+ 150
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCreditHistory.java Просмотреть файл

@@ -0,0 +1,150 @@
package com.iformall.domain.po;

import lombok.Data;
import javax.persistence.*;
import java.util.*;
import java.math.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import java.io.Serializable;

@Table(name = "wx_credit_history")
@Data
public class WxCreditHistory implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@Transient
protected List<Long> ids;
@Transient
protected String sortColumns;

@Transient
@io.swagger.annotations.ApiModelProperty(value="开始时间",name="startTime")
private Date startTime;

@Transient
@io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime")
private Date endTime;

@Transient
@io.swagger.annotations.ApiModelProperty(value="手机号",name="phone")
private String phone;

@Transient
@io.swagger.annotations.ApiModelProperty(value="姓名",name="name")
private String name;

/**租户ID*/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
/**用户ID*/
@io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId")
private Long cUserId;
/**总积分*/
@io.swagger.annotations.ApiModelProperty(value="总积分",name="creditAmount")
private Integer creditAmount;
/**每笔积分明细*/
@io.swagger.annotations.ApiModelProperty(value="每笔积分明细",name="creditNum")
private Integer creditNum;
/**积分类型*/
@io.swagger.annotations.ApiModelProperty(value="积分类型",name="creditType")
private Integer creditType;
/**创建日期*/
@io.swagger.annotations.ApiModelProperty(value="创建日期",name="createDate")
private Date createDate;
/**小票URL*/
@io.swagger.annotations.ApiModelProperty(value="小票URL",name="receiptUrl")
private String receiptUrl;
/**操作人类型*/
@io.swagger.annotations.ApiModelProperty(value="操作人类型",name="operatorType")
private Integer operatorType;
/**操作人ID*/
@io.swagger.annotations.ApiModelProperty(value="操作人ID",name="operatorId")
private Long operatorId;
/**商户ID*/
@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
private Long merchantId;
/**券ID(积分兑换券时生成)*/
@io.swagger.annotations.ApiModelProperty(value="券ID(积分兑换券时生成)",name="couponId")
private Long couponId;
/**业态ID(计算新增积分时使用)*/
@io.swagger.annotations.ApiModelProperty(value="业态ID(计算新增积分时使用)",name="businessId")
private Long businessId;
/**花费*/
@io.swagger.annotations.ApiModelProperty(value="花费",name="spend")
private Integer spend;



public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC")
,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC")
,CreditAmount_ASC("`credit_amount` ASC"),CreditAmount_DESC("`credit_amount` DESC")
,CreditNum_ASC("`credit_num` ASC"),CreditNum_DESC("`credit_num` DESC")
,CreditType_ASC("`credit_type` ASC"),CreditType_DESC("`credit_type` DESC")
,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC")
,ReceiptUrl_ASC("`receipt_url` ASC"),ReceiptUrl_DESC("`receipt_url` DESC")
,OperatorType_ASC("`operator_type` ASC"),OperatorType_DESC("`operator_type` DESC")
,OperatorId_ASC("`operator_id` ASC"),OperatorId_DESC("`operator_id` DESC")
,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC")
,CouponId_ASC("`coupon_id` ASC"),CouponId_DESC("`coupon_id` DESC")
,BusinessId_ASC("`business_id` ASC"),BusinessId_DESC("`business_id` DESC")
,Spend_ASC("`spend` ASC"),Spend_DESC("`spend` DESC")
;
private String value;
Field(String value){
this.value = value;
}
public String getValue() {
return value;
}
public void setCol(String value) {
this.value = value;
}
@Override
public String toString() {
return this.getValue();
}
}
public void setSortColumns(Field... fields)
{
if (fields == null || fields.length == 0) {
return;
}
for (int k = 0; k < fields.length; k++) {
if (fields[k] == null) {
return;
}
}
StringBuilder sb = new StringBuilder(fields[0].toString());
for (int k = 1; k < fields.length; k++) {
sb.append(",");
sb.append(fields[k].toString());
}
this.sortColumns = sb.toString();
}
public void setSortColumns(String sortColumns)
{
if (sortColumns == null || "".equals(sortColumns.trim())) {
return;
}
if (sortColumns.contains(",")) {
String[] cols = sortColumns.split(",");
List<Field> fList = new ArrayList();
for (int k = 0; k < cols.length; k++) {
fList.add(Field.valueOf(cols[k]));
}
this.setSortColumns(fList.toArray(new Field[fList.size()]));
} else {
this.setSortColumns(Field.valueOf(sortColumns));
}
}
}

+ 11
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java Просмотреть файл

@@ -175,6 +175,17 @@ public class WxPropertyContract implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "物业预账单列表", name = "previewBillRentList")
private List<WxBillProperty> previewBillRentList;

@io.swagger.annotations.ApiModelProperty(value = "租金信息", name = "rentInfo")
private String rentInfo;

public String getRentInfo() {
return rentInfo;
}

public void setRentInfo(String rentInfo) {
this.rentInfo = rentInfo;
}


public String getAdjustRatio() {
return adjustRatio;


+ 12
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxShop.java Просмотреть файл

@@ -1,5 +1,7 @@
package com.iformall.domain.po;

import cn.afterturn.easypoi.excel.annotation.Excel;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
@@ -52,14 +54,22 @@ public class WxShop implements Serializable {
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;

@io.swagger.annotations.ApiModelProperty(value = "点位类型", name = "pointType")
@Excel(name="类型",width = 20,orderNum = "1",
replace = {"商铺_null", "固定点位_1", "临时促销点位_2", "宣传点位_3","ATM点位_4","仓库点位_5","其他点位_6"})
private Integer pointType;
/*商铺编号**/
@io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber")
@Excel(name="商铺号/多径点位号",width = 20,orderNum = "2")
private String shopNumber;
/*建筑面积**/
@io.swagger.annotations.ApiModelProperty(value="建筑面积",name="buildArea")
@Excel(name="建筑面积(㎡)",width = 20,orderNum = "5")
private String buildArea;
/*经营面积**/
@io.swagger.annotations.ApiModelProperty(value="经营面积",name="operationArea")
@Excel(name="计租面积(㎡)",width = 20,orderNum = "6")
private String operationArea;
/*楼座号**/
@io.swagger.annotations.ApiModelProperty(value="楼座号",name="building")
@@ -69,6 +79,7 @@ public class WxShop implements Serializable {
private Long floor;
/*状态(0:未出租, 1:已出租)**/
@io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)",name="status")
@Excel(name="租赁状态",width = 20,orderNum = "7",replace = {"未出租_0","已出租_1"})
private Integer status;
/*店铺相对位置x**/
@io.swagger.annotations.ApiModelProperty(value="店铺相对位置x",name="x")
@@ -107,8 +118,7 @@ public class WxShop implements Serializable {
@io.swagger.annotations.ApiModelProperty(value = "类型", name = "type")
private Integer type;

@io.swagger.annotations.ApiModelProperty(value = "点位类型", name = "pointType")
private Integer pointType;


@io.swagger.annotations.ApiModelProperty(value = "备注", name = "comments")
private String comments;


+ 55
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxCreditHistoryVo.java Просмотреть файл

@@ -0,0 +1,55 @@
package com.iformall.domain.vo;

import lombok.Data;

import java.util.Date;

@Data
public class WxCreditHistoryVo {

@io.swagger.annotations.ApiModelProperty(value="手机号",name="phone")
private String phone;

@io.swagger.annotations.ApiModelProperty(value="姓名",name="name")
private String name;

@io.swagger.annotations.ApiModelProperty(value="性别",name="sex")
private String sex;

@io.swagger.annotations.ApiModelProperty(value="积分ID",name="creditId")
private String creditId;

@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;

@io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId")
private Long cUserId;
/**总积分*/
@io.swagger.annotations.ApiModelProperty(value="总积分",name="creditAmount")
private Integer creditAmount;
/**每笔积分明细*/
@io.swagger.annotations.ApiModelProperty(value="每笔积分明细",name="creditNum")
private Integer creditNum;
/**积分类型*/
@io.swagger.annotations.ApiModelProperty(value="积分类型",name="creditType")
private Integer creditType;
/**创建日期*/
@io.swagger.annotations.ApiModelProperty(value="创建日期",name="createDate")
private Date createDate;
/**小票URL*/
@io.swagger.annotations.ApiModelProperty(value="小票URL",name="receiptUrl")
private String receiptUrl;

@io.swagger.annotations.ApiModelProperty(value="商户",name="merchantName")
private String merchantName;

@io.swagger.annotations.ApiModelProperty(value="操作人类型",name="operator")
private String operatorType;

@io.swagger.annotations.ApiModelProperty(value="操作人ID",name="operatorId")
private Long operatorId;

@io.swagger.annotations.ApiModelProperty(value="操作人",name="operator")
private String operator;

}

+ 111
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxShopVo.java Просмотреть файл

@@ -0,0 +1,111 @@
package com.iformall.domain.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.iformall.domain.po.WxShop;


public class WxShopVo extends WxShop {
private static final long serialVersionUID = 6687964942922444531L;


@io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName")
@Excel(name="楼座",width = 20,orderNum = "3")
private String buildingName;
/**楼层号**/
@io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName")
@Excel(name="楼层",width = 20,orderNum = "4")
private String floorName;


@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
private Long merchantId;

@Excel(name="租赁商户",width = 20,orderNum = "8")
@io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName")
private String merchantName;

/*联系方式**/
@io.swagger.annotations.ApiModelProperty(value="联系方式",name="linkPhone")
@Excel(name="负责人电话",width = 20,orderNum = "12")
private String linkPhone;

@io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson")
@Excel(name="负责人",width = 20,orderNum = "11")
private String linkPerson;

@io.swagger.annotations.ApiModelProperty(value="品牌",name="brandName")
@Excel(name="品牌",width = 20,orderNum = "10")
private String brandName;

@io.swagger.annotations.ApiModelProperty(value="经营业态",name="business")
@Excel(name="经营业态",width = 20,orderNum = "9")
private String business;

public String getBuildingName() {
return buildingName;
}

public void setBuildingName(String buildingName) {
this.buildingName = buildingName;
}

public String getFloorName() {
return floorName;
}

public void setFloorName(String floorName) {
this.floorName = floorName;
}

public Long getMerchantId() {
return merchantId;
}

public void setMerchantId(Long merchantId) {
this.merchantId = merchantId;
}

public String getMerchantName() {
return merchantName;
}

public void setMerchantName(String merchantName) {
this.merchantName = merchantName;
}

@Override
public String getLinkPhone() {
return linkPhone;
}

@Override
public void setLinkPhone(String linkPhone) {
this.linkPhone = linkPhone;
}

@Override
public String getLinkPerson() {
return linkPerson;
}

@Override
public void setLinkPerson(String linkPerson) {
this.linkPerson = linkPerson;
}

public String getBrandName() {
return brandName;
}

public void setBrandName(String brandName) {
this.brandName = brandName;
}

public String getBusiness() {
return business;
}

public void setBusiness(String business) {
this.business = business;
}
}

+ 35
- 0
mallinkService/src/main/java/com/iformall/enums/EnumUserType.java Просмотреть файл

@@ -0,0 +1,35 @@
package com.iformall.enums;

public enum EnumUserType {

CUSER(1, "C端用户"),
CUSERBASIC(2, "C端用户(偏向A端)"),
BUSER(3, "B端用户"),
MALLUSER(4, "A端用户")
;

public static EnumUserType getEnum(Integer code) {
for (EnumUserType value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumUserType(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 15
- 0
mallinkService/src/main/java/com/iformall/mapper/WxCreditHistoryMapper.java Просмотреть файл

@@ -0,0 +1,15 @@
package com.iformall.mapper;

import java.util.*;
import com.iformall.common.CommonMapper;
import com.iformall.domain.vo.WxCreditHistoryVo;
import com.iformall.domain.po.WxCreditHistory;

public interface WxCreditHistoryMapper extends CommonMapper<WxCreditHistory, Long> {

List<WxCreditHistory> findList(WxCreditHistory wxCreditHistory);

List<WxCreditHistoryVo> findListMore(WxCreditHistory wxCreditHistory);

}

+ 2
- 1
mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java Просмотреть файл

@@ -2,6 +2,7 @@ package com.iformall.mapper;

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.vo.WxShopVo;

import java.util.List;
import java.util.Map;
@@ -26,5 +27,5 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> {

int hasShopNumber(WxShop wxShop);

List<Map<String,Object>> findListWithMerchantMap(WxShop record);
List<WxShopVo> findListWithMerchantMap(WxShop record);
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/ExcelService.java Просмотреть файл

@@ -58,7 +58,7 @@ public class ExcelService {
{
Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
if (workbook != null);
downLoadExcel(fileName, response, workbook);
downLoadExcel(fileName, response, workbook);
}

private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook)


+ 60
- 0
mallinkService/src/main/java/com/iformall/service/WxCreditHistoryService.java Просмотреть файл

@@ -0,0 +1,60 @@
package com.iformall.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.iformall.domain.dto.WxCreditHistoryDto;
import com.iformall.domain.po.WxCreditHistory;
import com.iformall.domain.vo.WxCreditHistoryVo;

public interface WxCreditHistoryService {

/**
* 根据实体查询分页列表
*
* @param record
* @param pageIndex
* @param pageSize
* @return
*/
PageInfo<WxCreditHistory> listAsPage(WxCreditHistory record, Integer pageIndex, Integer pageSize);

/**
* 根据实体查询分页列表更多
*
* @param record
* @param pageIndex
* @param pageSize
* @return
*/
PageInfo<WxCreditHistoryVo> listAsPageMore(WxCreditHistory record, Integer pageIndex, Integer pageSize);

/**
* 根据Id获得实体
*
* @param id
* @return
*/
WxCreditHistory getById(Long id);
/**
* 保存或更新实体
*
* @param record
*/
void saveOrUpdate(WxCreditHistory record);

/**
* 根据Id删除实体
*
* @param id
*/
void deleteById(Long id);

}

+ 34
- 5
mallinkService/src/main/java/com/iformall/service/impl/DataTowerServiceImpl.java Просмотреть файл

@@ -477,6 +477,7 @@ public class DataTowerServiceImpl implements DataTowerService {

@Override
public Map<String, Object> queryCar(String tenantId) {
logger.info("停车-月统计-开始");
HashMap<String, Object> params = new HashMap<>();
params.put("tenantId", tenantId);
params.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
@@ -507,8 +508,10 @@ public class DataTowerServiceImpl implements DataTowerService {
}
Map<String, Object> datamap = new HashMap<>();
datamap.put("history", historymap);
logger.info("停车-月统计-结束");

// 查询近一周的缴费车辆----start------
logger.info("停车-查询近一周的缴费车辆-开始");
HashMap<String, Object> weekParams = new HashMap<>();
weekParams.put("tenantId", tenantId);
String oneWeekStartdate = DateUtils.getTimeBefore(7, new Date());
@@ -518,8 +521,10 @@ public class DataTowerServiceImpl implements DataTowerService {
weekParams.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode());

datamap.put("oneWeekCarPayCount",wxCarCmdLogMapper.queryWeekCarPayCount(weekParams));
logger.info("停车-查询近一周的缴费车辆-结束");

// 近一周缴费金额
logger.info("停车-查询近一周的缴费金额-开始");
weekParams.put("cmdType", EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode());
List<Map<String, Object>> weekCarPayHistoryList = wxCarCmdLogMapper.queryWeekCarPay(weekParams);
Map<String, Object> weekCollect = weekCarPayHistoryList.stream().collect(Collectors.toMap(m -> {
@@ -537,8 +542,10 @@ public class DataTowerServiceImpl implements DataTowerService {
weekMap.put(key,weekCollect.get(key));
}
datamap.put("oneWeekCarPayFeeCount",weekMap);
logger.info("停车-查询近一周的缴费金额-结束");

// 近一周新增会员历史
logger.info("停车-近一周新增会员历史-开始");
List<Map<String, Object>> carCountHistory = wxCUserCarMapper.queryCarCountHistory(weekParams);
Map<String, Object> weekCarCollect = carCountHistory.stream().collect(Collectors.toMap(m -> {
return (String)m.get("create_time");
@@ -553,8 +560,10 @@ public class DataTowerServiceImpl implements DataTowerService {
weekCarMap.put(key,weekCarCollect.get(key));
}
datamap.put("oneWeekNewCarUserHistory",weekCarMap);
logger.info("停车-近一周新增会员历史-结束");

//近一周新增停车会员数
logger.info("停车-近一周新增停车会员数-开始");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto();
wxCUserBasicInfoDto.setTenantId(tenantId);
@@ -565,14 +574,18 @@ public class DataTowerServiceImpl implements DataTowerService {
e.printStackTrace();
}
datamap.put("oneWeekNewCarUserCount",wxCUserCarMapper.countUser(wxCUserBasicInfoDto));
logger.info("停车-近一周新增停车会员数-结束");
//停车会员总数
logger.info("停车-停车会员总数-开始");
wxCUserBasicInfoDto = new WxCUserBasicInfoDto();
wxCUserBasicInfoDto.setTenantId(tenantId);
datamap.put("newCarUserSumCount",wxCUserCarMapper.countUser(wxCUserBasicInfoDto));
logger.info("停车-停车会员总数-结束");

// 查询近一周的缴费车辆----end------

//今日车流量
logger.info("停车-今日车流量-开始");
long todaycar = (long) historymap.get(DateUtils.getSystemTime("MM/dd"));
datamap.put("todaycar", todaycar);
//环比
@@ -585,8 +598,10 @@ public class DataTowerServiceImpl implements DataTowerService {
} else {
datamap.put("hb", "--");
}
logger.info("停车-今日车流量-结束");

//上周同期
logger.info("停车-上周同期-开始");
String lastweek = DateUtils.getTimeBefore(7, new Date());
long last = (long) historymap.get(lastweek.substring(5).replace("-", "/"));
if (last > 0) {
@@ -596,7 +611,10 @@ public class DataTowerServiceImpl implements DataTowerService {
} else {
datamap.put("lasthb", "--");
}
logger.info("停车-上周同期-结束");

// 今日
logger.info("停车-今日停车数据-开始");
params.put("startdate", systemTime + " 05:00:00");
params.put("enddate", DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss"));

@@ -623,7 +641,10 @@ public class DataTowerServiceImpl implements DataTowerService {
hourMap.putAll(todaycollect);

datamap.put("todaycardata", hourMap);
logger.info("停车-今日停车数据-结束");

// 昨日
logger.info("停车-昨日停车数据-开始");
params.put("startdate", yesterday + " 05:00:00");
params.put("enddate", yesterday + " 22:59:59");
List<Map<String, Object>> yesterdayCarlist = wxCarCmdLogMapper.queryTodayCar(params);
@@ -636,20 +657,25 @@ public class DataTowerServiceImpl implements DataTowerService {
yesterdaytreemap.putAll(yesterdaycollect);

datamap.put("yesterdaycardata", yesterdaytreemap);
logger.info("停车-昨日停车数据-结束");

// 上周同期
logger.info("停车-上周同期停车数据-开始");
params.put("startdate", lastweek + " 05:00:00");
params.put("enddate", lastweek + " 22:59:59");
List<Map<String, Object>> lastdayCarlist = wxCarCmdLogMapper.queryTodayCar(params);
Map<Object, Object> lastdaycollect = lastdayCarlist.stream().collect(Collectors.toMap(m -> {
List<Map<String, Object>> lastweekCarlist = wxCarCmdLogMapper.queryTodayCar(params);
Map<Object, Object> lastweekcollect = lastweekCarlist.stream().collect(Collectors.toMap(m -> {
return m.get("create_time");
}, m -> {
return m.get("carcount");
}));
TreeMap lastdaytreemap = getTimeTreeMap();
lastdaytreemap.putAll(lastdaycollect);
datamap.put("lastdaycardata", lastdaytreemap);
TreeMap lastweektreemap = getTimeTreeMap();
lastweektreemap.putAll(lastweekcollect);
datamap.put("lastdaycardata", lastweektreemap);
logger.info("停车-上周同期停车数据-结束");

//绑定车牌
logger.info("停车-绑定车牌-开始");
Map<String,Object> carParams=new HashMap<>();
carParams.put("tenantId",tenantId);
carParams.put("startdate",DateUtils.getSystemTime("yyyy-MM-dd 00:00:00"));
@@ -678,6 +704,7 @@ public class DataTowerServiceImpl implements DataTowerService {
} else {
datamap.put("lastweekbindhb", "--");
}
logger.info("停车-绑定车牌-结束");

return datamap;

@@ -752,7 +779,9 @@ public class DataTowerServiceImpl implements DataTowerService {
if (cap == null || !cap.stream().anyMatch(c->c.equals(dataType))) {
return new ResultData(ErrorCode.WIWIDE_INFO_NOT_FOUND);
}
logger.info("迈外迪访问接口参数:" + params);
String res = WiwideUtil.queryData(wiWideInfo, getWiwideToken(wiWideInfo), params);
logger.info("迈外迪访问接口结果:" + res);
JSONObject result = JSONObject.parseObject(res);
if (result == null)
return new ResultData(ErrorCode.WIWIDE_INFO_NOT_READY);


+ 139
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxCreditHistoryServiceImpl.java Просмотреть файл

@@ -0,0 +1,139 @@
package com.iformall.service.impl;

import java.util.*;
import java.util.stream.Collectors;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.iformall.domain.dto.WxCreditHistoryDto;
import com.iformall.domain.po.*;
import com.iformall.domain.vo.WxCreditHistoryVo;
import com.iformall.enums.EnumUserType;
import com.iformall.mapper.*;
import com.iformall.service.WxCreditHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iformall.common.IdWorker;

@Service
public class WxCreditHistoryServiceImpl implements WxCreditHistoryService {
@Autowired
WxCreditHistoryMapper wxCreditHistoryMapper;

@Autowired
WxCUserMapper wxCUserMapper;

@Autowired
WxCUserBasicInfoMapper wxCUserBasicInfoMapper;

@Autowired
WxMerchantBUserMapper wxMerchantBUserMapper;

@Autowired
MallUserInfoMapper mallUserInfoMapper;

@Override
public PageInfo<WxCreditHistory> listAsPage(WxCreditHistory record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCreditHistoryMapper.findList(record));
}

@Override
public PageInfo<WxCreditHistoryVo> listAsPageMore(WxCreditHistory record, Integer pageIndex, Integer pageSize) {
PageHelper.startPage(pageIndex, pageSize);
List<WxCreditHistoryVo> wxCreditHistoryVoList = wxCreditHistoryMapper.findListMore(record);
if (wxCreditHistoryVoList == null || wxCreditHistoryVoList.size() == 0) {
return new PageInfo<>(wxCreditHistoryVoList);
}
List<Long> cUserIds = wxCreditHistoryVoList.stream().filter(a -> a.getOperatorType().equals(EnumUserType.CUSER.getCode())).map(WxCreditHistoryVo::getOperatorId).collect(Collectors.toList());
List<Long> cUserBasicIds = wxCreditHistoryVoList.stream().filter(a -> a.getOperatorType().equals(EnumUserType.CUSERBASIC.getCode())).map(WxCreditHistoryVo::getOperatorId).collect(Collectors.toList());
List<Long> bUserIds = wxCreditHistoryVoList.stream().filter(a -> a.getOperatorType().equals(EnumUserType.BUSER.getCode())).map(WxCreditHistoryVo::getOperatorId).collect(Collectors.toList());
List<Long> mallUserIds = wxCreditHistoryVoList.stream().filter(a -> a.getOperatorType().equals(EnumUserType.MALLUSER.getCode())).map(WxCreditHistoryVo::getOperatorId).collect(Collectors.toList());
List<WxCUser> wxCUserList = Lists.newArrayList();
List<WxCUserBasicInfo> wxCUserBasicInfoList = Lists.newArrayList();
List<WxMerchantBUser> wxMerchantBUserList = Lists.newArrayList();
List<MallUserInfo> mallUserInfoList = Lists.newArrayList();
if (cUserIds != null && cUserIds.size() > 0) {
WxCUser wxUser = new WxCUser();
wxUser.setIds(cUserIds);
wxCUserList = wxCUserMapper.findList(wxUser);
}
if (cUserBasicIds != null && cUserBasicIds.size() > 0) {
WxCUserBasicInfo wxCUserBasicInfo = new WxCUserBasicInfo();
wxCUserBasicInfo.setIds(cUserBasicIds);
wxCUserBasicInfoList = wxCUserBasicInfoMapper.findList(wxCUserBasicInfo);
}
if (bUserIds != null && bUserIds.size() > 0) {
WxMerchantBUser wxMerchantBUser = new WxMerchantBUser();
wxMerchantBUser.setIds(bUserIds);
wxMerchantBUserList = wxMerchantBUserMapper.findList(wxMerchantBUser);
}
if (mallUserIds != null && mallUserIds.size() > 0) {
MallUserInfo mallUserInfo = new MallUserInfo();
mallUserInfo.setIds(mallUserIds);
mallUserInfoList = mallUserInfoMapper.findList(mallUserInfo);
}
for (WxCreditHistoryVo credit : wxCreditHistoryVoList) {
if (wxCUserList != null && wxCUserList.size() > 0) {
wxCUserList.stream().forEach(cUser->{
if (cUser.getId().longValue() == credit.getOperatorId().longValue()) {
credit.setOperator(cUser.getNickName());
}
});
}
if (wxCUserBasicInfoList != null && wxCUserBasicInfoList.size() > 0) {
wxCUserBasicInfoList.stream().forEach(cUserBasicInfo->{
if (cUserBasicInfo.getId().longValue() == credit.getOperatorId().longValue()) {
credit.setOperator(cUserBasicInfo.getNickName());
}
});
}
if (wxMerchantBUserList != null && wxMerchantBUserList.size() > 0) {
wxMerchantBUserList.stream().forEach(bUser->{
if (bUser.getId().longValue() == credit.getOperatorId().longValue()) {
credit.setOperator(bUser.getName());
}
});
}
if (mallUserInfoList != null && mallUserInfoList.size() > 0) {
mallUserInfoList.stream().forEach(mallUser->{
if (mallUser.getId().longValue() == credit.getOperatorId().longValue()) {
credit.setOperator(mallUser.getName());
}
});
}
}
return new PageInfo<>(wxCreditHistoryVoList);
}

@Override
public WxCreditHistory getById(Long id) {
return wxCreditHistoryMapper.selectByPrimaryKey(id);
}

@Override
public void saveOrUpdate(WxCreditHistory record) {
if (record.getId() == null) {
//record.setId(UUID.randomUUID().toString().replaceAll("-", ""));
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
wxCreditHistoryMapper.insertSelective(record);
} else {
wxCreditHistoryMapper.updateByPrimaryKeySelective(record);
}
}

@Override
public void deleteById(Long id) {
wxCreditHistoryMapper.deleteByPrimaryKey(id);
}
}

+ 63
- 40
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java Просмотреть файл

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

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode;
@@ -390,6 +391,16 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
wxBillDeposit.setUpdatetime(date);
wxBillDeposit.setIsDel(EnumDelStatus.NOT_DEL.getCode());
wxBillDeposit.setRentShopType(wxPropertyContract.getRentShopType());
String rentInfo = wxPropertyContract.getRentInfo();
Map<String, Object> shopInfo = new HashMap<>();
if (rentInfo != null) {
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo);
for (int i = 0, size = rentInfoArray.size(); i < size; i++) {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
shopInfo.put(rentInfoObject.getString("shopNumber"), rentInfoObject.get("buildArea"));
}
}
wxBillDeposit.setShopInfo(JSONObject.toJSONString(shopInfo));
try {
wxBillPropertyDepositMapper.insertSelective(wxBillDeposit);
} catch (Exception e) {
@@ -401,6 +412,15 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService

public List<WxBillProperty> buildRentMonth(WxMerchant wxMerchant, Long userId, WxPropertyContract wxPropertyContract, int receivePeriod, Integer lease, Date rentalStartDate, Integer price,Integer isPreview) {
String adjustRatio = wxPropertyContract.getAdjustRatio();
String rentInfo = wxPropertyContract.getRentInfo();
Map<String, Object> shopInfo = new HashMap<>();
if (rentInfo != null) {
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo);
for (int i = 0, size = rentInfoArray.size(); i < size; i++) {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
shopInfo.put(rentInfoObject.getString("shopNumber"), rentInfoObject.get("buildArea"));
}
}
List<Integer> integers = JSONArray.parseArray(adjustRatio, Integer.class);
integers.add(0, 0);
int size = integers.size();
@@ -429,7 +449,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
instance.setTime(rentalStartDate);
//开始时间
instance.add(Calendar.MONTH, month * i);
Map<String,Object> resultMap = buildRent(leaseArr[i], receivePeriod, priceArr[i], instance.getTime(), Calendar.MONTH, wxPropertyContract, userId, wxMerchant, billcount,isPreview);
Map<String, Object> resultMap = buildRent(leaseArr[i], receivePeriod, priceArr[i], instance.getTime(), Calendar.MONTH, wxPropertyContract, userId, wxMerchant, billcount, isPreview, shopInfo);
List<WxBillProperty> billRentList = (List<WxBillProperty>)resultMap.get("billList");
billcount = (Integer)resultMap.get("billcount");
resultList.addAll(billRentList);
@@ -437,7 +457,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
return resultList;
}

public Map<String,Object> buildRent(int lease, int receivePeriod, int price, Date startdate, int dayType, WxPropertyContract wxPropertyContract, Long userId, WxMerchant wxMerchant, int billcount,Integer isPreview) {
public Map<String, Object> buildRent(int lease, int receivePeriod, int price, Date startdate, int dayType, WxPropertyContract wxPropertyContract, Long userId, WxMerchant wxMerchant, int billcount, Integer isPreview, Map<String, Object> shopInfo) {
Map<String,Object> resultMap = new HashedMap();
List<WxBillProperty> resultList = new ArrayList<>();
int extralease = lease % receivePeriod;
@@ -446,12 +466,12 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
int index = paycount - 1;
final IdWorker idWorker = IdWorker.get();
for (int i = 0; i < paycount; i++) {
WxBillProperty wxBillRent = new WxBillProperty();
wxBillRent.setIsPreview(isPreview);
WxBillProperty wxBillProperty = new WxBillProperty();
wxBillProperty.setIsPreview(isPreview);

wxBillRent.setId(idWorker.nextId());
wxBillRent.setPropertyContractId(wxPropertyContract.getId());
wxBillRent.setPay(0);
wxBillProperty.setId(idWorker.nextId());
wxBillProperty.setPropertyContractId(wxPropertyContract.getId());
wxBillProperty.setPay(0);
int needpay = price * receivePeriod;

Date date = new Date();
@@ -460,70 +480,73 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
instance.add(dayType, receivePeriod * i);
instance.add(Calendar.DAY_OF_MONTH, -1);
Date time = instance.getTime();
wxBillRent.setReceiveDate(time);
wxBillProperty.setReceiveDate(time);

//账单开始时间
instance.clear();
instance.setTime(wxBillRent.getReceiveDate());
instance.setTime(wxBillProperty.getReceiveDate());
instance.add(Calendar.DAY_OF_MONTH, 1);
wxBillRent.setStarttime(instance.getTime());
wxBillProperty.setStarttime(instance.getTime());
//账单结束时间
instance.clear();
instance.setTime(wxBillRent.getStarttime());
instance.setTime(wxBillProperty.getStarttime());
instance.add(dayType, receivePeriod);
instance.add(Calendar.DAY_OF_MONTH, -1);
wxBillRent.setEndtime(instance.getTime());
wxBillProperty.setEndtime(instance.getTime());

if (extracount > 0 && i == index) {
//账单开始时间
instance.clear();
instance.setTime(wxBillRent.getReceiveDate());
instance.setTime(wxBillProperty.getReceiveDate());
instance.add(Calendar.DAY_OF_MONTH, 1);
wxBillRent.setStarttime(instance.getTime());
wxBillProperty.setStarttime(instance.getTime());
//账单结束时间
instance.clear();
instance.setTime(wxBillRent.getStarttime());
instance.setTime(wxBillProperty.getStarttime());
instance.add(dayType, extralease);
instance.add(Calendar.DAY_OF_MONTH, -1);
wxBillRent.setEndtime(instance.getTime());
wxBillProperty.setEndtime(instance.getTime());
needpay = price * extralease;
}
wxBillRent.setNeedPay(needpay);
wxBillRent.setOwe(needpay);
wxBillRent.setReceivePay(needpay);
wxBillProperty.setNeedPay(needpay);
wxBillProperty.setOwe(needpay);
wxBillProperty.setReceivePay(needpay);

//截止收租日在当前时间之前
if (wxBillRent.getReceiveDate().before(date)) {
if (wxBillProperty.getReceiveDate().before(date)) {
long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000);
wxBillRent.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillRent.setExpiredDay(day);
wxBillProperty.setStatus(EnumBillRentStatus.NOT_PAID.getCode());
wxBillProperty.setExpiredDay(day);
} else {//截止收租日在当前时间之后
Calendar now = Calendar.getInstance();
now.add(dayType, receivePeriod);
Date currenttime = now.getTime();
//当前日期加上周期后小于截止收租日就是没有到期,否则当前待缴
if (currenttime.before(wxBillRent.getReceiveDate())) {
wxBillRent.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode());
wxBillRent.setExpiredDay(0L);
if (currenttime.before(wxBillProperty.getReceiveDate())) {
wxBillProperty.setStatus(EnumBillRentStatus.NOT_EXPIRED.getCode());
wxBillProperty.setExpiredDay(0L);
} else {
wxBillRent.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillRent.setExpiredDay(0L);
wxBillProperty.setStatus(EnumBillRentStatus.WAIT_PAY.getCode());
wxBillProperty.setExpiredDay(0L);
}
}

wxBillRent.setTenantId(wxMerchant.getTenantId());
wxBillRent.setIsDel(0);
wxBillRent.setMerchantId(wxMerchant.getId());
wxBillRent.setUserId(userId);
wxBillRent.setShopId(wxPropertyContract.getShopId());
wxBillRent.setCreatetime(date);
wxBillRent.setUpdatetime(date);
wxBillRent.setIsDel(EnumDelStatus.NOT_DEL.getCode());
wxBillRent.setRentShopType(wxPropertyContract.getRentShopType());
wxBillRent.setPeriod(++billcount);
wxBillProperty.setTenantId(wxMerchant.getTenantId());
wxBillProperty.setIsDel(0);
wxBillProperty.setMerchantId(wxMerchant.getId());
wxBillProperty.setUserId(userId);
wxBillProperty.setShopId(wxPropertyContract.getShopId());
wxBillProperty.setCreatetime(date);
wxBillProperty.setUpdatetime(date);
wxBillProperty.setIsDel(EnumDelStatus.NOT_DEL.getCode());
wxBillProperty.setRentShopType(wxPropertyContract.getRentShopType());
wxBillProperty.setPeriod(++billcount);
if (shopInfo != null) {
wxBillProperty.setShopInfo(JSONObject.toJSONString(shopInfo));
}
try {
wxBillPropertyMapper.insertSelective(wxBillRent);
resultList.add(wxBillRent);
wxBillPropertyMapper.insertSelective(wxBillProperty);
resultList.add(wxBillProperty);
} catch (Exception e) {
logger.error("添加租赁账单失败,e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
@@ -568,7 +591,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
result = buildRentMonth(wxMerchant, userId, propertyContract, receivePeriod, lease, rentalStartDate, price,isPreview);
} else {
//按日计租
Map<String,Object> resultMap = buildRent(lease, receivePeriod, price, rentalStartDate, Calendar.DAY_OF_MONTH, propertyContract, userId, wxMerchant, 0,isPreview);
Map<String, Object> resultMap = buildRent(lease, receivePeriod, price, rentalStartDate, Calendar.DAY_OF_MONTH, propertyContract, userId, wxMerchant, 0, isPreview, null);
result = (List<WxBillProperty>)resultMap.get("billList");
}
}


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Просмотреть файл

@@ -450,7 +450,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
shopInfo.put(rentInfoObject.getString("shopNumber"), rentInfoObject.get("deposit"));
}
wxBillDeposit.setShopInfo(JSONObject.toJSONString(shopInfo));
}
try {
wxBillDepositMapper.insertSelective(wxBillDeposit);


+ 13
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Просмотреть файл

@@ -8,10 +8,12 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchantShop;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.vo.WxShopVo;
import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxMerchantShopMapper;
import com.iformall.mapper.WxShopMapper;
import com.iformall.service.ExcelService;
import com.iformall.service.WxShopService;
import com.iformall.utils.Constant;
import com.iformall.utils.DownFileUtil;
@@ -41,6 +43,9 @@ public class WxShopServiceImpl implements WxShopService {
@Autowired
WxMerchantShopMapper wxMerchantShopMapper;

@Autowired
ExcelService excelService;

@Override
public PageInfo<WxShop> listAsPage(WxShop record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopMapper.findList(record));
@@ -132,6 +137,13 @@ public class WxShopServiceImpl implements WxShopService {
return pageInfo;
}

public void exportShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response) {
List<WxShopVo> list = wxShopMapper.findListWithMerchantMap(wxShop);
String name = EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"店铺列表":"多经点位列表";
excelService.exportExcel(list,null, name, WxShopVo.class,name+".xls",response);
}

/*
@Override
public void exportShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response) {
List<Map<String,Object>> shopList = wxShopMapper.findListWithMerchantMap(wxShop);
@@ -258,6 +270,6 @@ public class WxShopServiceImpl implements WxShopService {
e.printStackTrace();
}
}
*/

}

+ 4
- 2
mallinkService/src/main/resources/mapper/WxBillPropertyDepositMapper.xml Просмотреть файл

@@ -21,13 +21,14 @@
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
<result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/>
<result column="return_price" jdbcType="INTEGER" property="returnPrice"/>
<result column="shop_info" jdbcType="VARCHAR" property="shopInfo"/>
</resultMap>
<sql id="allColumns">
`id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,
`pay_date`,`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,
`merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`return_price`
`merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,`return_price`,`shop_info`
</sql>

<sql id="dynamicWhereConditions">
@@ -69,7 +70,8 @@
select br.`id`,br.`receive_pay` receivePay,br.`pay`,br.`receive_date` receiveDate,
br.`pay_date` payDate,br.`createtime`,br.`expired_day` expiredDay,br.`owe`,br.`status`,
br.`need_pay` needPay,m.`name` merchantName,s.shop_number shopNumber,br.`updatetime`,
br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType,br.`return_price` returnPrice
br.`merchant_id` merchantId,br.`rent_shop_type` rentShopType,br.`return_price` returnPrice,br.`shop_info`
shopInfo
from wx_bill_property_deposit br left join wx_merchant m on br.merchant_id=m.id
left join wx_shop s on br.shop_id=s.id
<where>


+ 3
- 2
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml Просмотреть файл

@@ -26,6 +26,7 @@
<result column="late_pay_price" jdbcType="INTEGER" property="latePayPrice"/>
<result column="period" jdbcType="INTEGER" property="period"/>
<result column="is_preview" property="isPreview"/>
<result column="shop_info" jdbcType="VARCHAR" property="shopInfo"/>
</resultMap>
@@ -33,7 +34,7 @@
`id`,`property_contract_id`,`receive_pay`,`pay`,`receive_date`,`pay_date`,
`createtime`,`expired_day`,`tenant_id`,`owe`,`status`,`is_del`,`need_pay`,
`merchant_id`,`user_id`,`shop_id`,`updatetime`,`rent_shop_type`,
`revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`
`revenue`,`late_pay_ratio`,`late_pay_time`,`late_pay_price`,`period`,`is_preview`,`shop_info`

</sql>

@@ -84,7 +85,7 @@
else
FLOOR(DATEDIFF(now(),br.late_pay_time)*br.late_pay_ratio/10000*br.owe) end latePayPrice,
(select max(period) from wx_bill_property where property_contract_id=br.property_contract_id)
allPeriod,d.`status` depositStatus
allPeriod,d.`status` depositStatus,br.`shop_info` shopInfo
from wx_bill_property br left join wx_merchant m on br.merchant_id=m.id
left join wx_shop s on br.shop_id=s.id
left join wx_bill_property_deposit d on br.property_contract_id=d.property_contract_id


+ 122
- 0
mallinkService/src/main/resources/mapper/WxCreditHistoryMapper.xml Просмотреть файл

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.iformall.mapper.WxCreditHistoryMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCreditHistory">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
<result column="credit_amount" jdbcType="INTEGER" property="creditAmount" />
<result column="credit_num" jdbcType="INTEGER" property="creditNum" />
<result column="credit_type" jdbcType="INTEGER" property="creditType" />
<result column="create_date" jdbcType="TIMESTAMP" property="credateDate" />
<result column="receipt_url" jdbcType="VARCHAR" property="receiptUrl" />
<result column="operator_type" jdbcType="INTEGER" property="operatorType" />
<result column="operator_id" jdbcType="BIGINT" property="operatorId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="spend" jdbcType="INTEGER" property="spend" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`c_user_id`,`credit_amount`,`credit_num`,`credit_type`,`credate_date`,`receipt_url`,`operator_type`,`operator_id`,`merchant_id`,`coupon_id`,`business_id`,`spend`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
</if>
<if test=" null != creditAmount ">
and `credit_amount` = #{creditAmount}
</if>
<if test=" null != creditNum ">
and `credit_num` = #{creditNum}
</if>
<if test=" null != creditType ">
and `credit_type` = #{creditType}
</if>
<if test=" null != receiptUrl ">
and `receipt_url` like concat('%', #{receiptUrl},'%')
</if>
<if test=" null != operatorType ">
and `operator_type` = #{operatorType}
</if>
<if test=" null != operatorId ">
and `operator_id` = #{operatorId}
</if>
<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}
</if>
<if test=" null != couponId ">
and `coupon_id` = #{couponId}
</if>
<if test=" null != businessId ">
and `business_id` = #{businessId}
</if>
<if test=" null != spend ">
and `spend` = #{spend}
</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>

<sql id="customWhereConditions">
where 1 = 1
<if test=" null != name ">
and basic.name like concat('%', #{name},'%')
</if>
<if test=" null != phone ">
and basic.phone like concat('%', #{phone},'%')
</if>
<if test=" null != startTime ">
and credit.create_date &gt;= #{startTime}
</if>
<if test=" null != endTime">
and credit.create_date &lt; #{endTime}
</if>
<if test=" null != tenantId ">
and credit.tenant_id = #{tenantId}
</if>
</sql>

<select id="findList" parameterType="com.iformall.domain.po.WxCreditHistory" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_credit_history
<include refid="dynamicWhereConditions" />
</select>

<select id="findListMore" parameterType="com.iformall.domain.po.WxCreditHistory" resultType="com.iformall.domain.vo.WxCreditHistoryVo">
SELECT
credit.id creditId,
basic.NAME name,
basic.phone phone,
basic.sex sex,
credit.tenant_id tenantId,
credit.c_user_id cUserId,
credit.credit_amount creditAmount,
credit.credit_num creditNum,
credit.create_date createDate,
credit.credit_type creditType,
credit.receipt_url receiptUrl,
credit.operator_type operatorType,
credit.operator_id operatorId,
merchant.NAME merchantName
FROM
wx_c_user_basic_info basic
INNER JOIN wx_credit_history credit ON basic.id = credit.c_user_id
LEFT JOIN wx_merchant merchant ON credit.merchant_id = merchant.id
<include refid="customWhereConditions"/>
ORDER BY
credit.id DESC
</select>


</mapper>

+ 4
- 2
mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml Просмотреть файл

@@ -36,6 +36,7 @@
<result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/>
<result column="business_type" property="businessType"/>
<result column="adjust_ratio" property="adjustRatio"/>
<result column="rent_info" jdbcType="VARCHAR" property="rentInfo"/>

</resultMap>
@@ -45,7 +46,7 @@
`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,
`shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`,
`link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`,
`start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio
`start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`
</sql>
<sql id="dynamicWhereConditions">
@@ -104,7 +105,8 @@
f.floor_name floorName,b.building_name buildingName,receive_period receivePeriod,
rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,
start_date startDate,end_date endDate,rc.rent_contract_id rentContractId,br.`name` brandName,
s.addr,rc.apply_status applyStatus,rc.adjust_period adjustPeriod,rc.business_type businessType,rc.adjust_ratio adjustRatio
s.addr,rc.apply_status applyStatus,rc.adjust_period adjustPeriod,rc.business_type businessType,
rc.adjust_ratio adjustRatio,rc.rent_info rentInfo
from wx_property_contract rc
left join wx_shop s on rc.shop_id=s.id
left join wx_mall_floor f on s.floor=f.id


+ 50
- 7
mallinkService/src/main/resources/mapper/WxShopMapper.xml Просмотреть файл

@@ -148,6 +148,7 @@
<include refid="dynamicWhereConditions"/>
</select>


<select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">

select s.id,s.shop_number shopNumber,s.build_area buildArea,
@@ -266,13 +267,55 @@
</select>


<select id="findListWithMerchantMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap">
select s.id,s.shop_number shopNumber,s.build_area buildArea,
s.img_url imgUrl,s.operation_area operationArea,
s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId,
m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone,
s.type,s.point_type pointType,s.addr,s.email,
brand.name brand,m.link_person,m.link_phone,bus.title

<resultMap id="VoResultMap" type="com.iformall.domain.vo.WxShopVo">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
<result column="build_area" jdbcType="VARCHAR" property="buildArea"/>
<result column="operation_area" jdbcType="VARCHAR" property="operationArea"/>
<result column="building" jdbcType="BIGINT" property="building"/>
<result column="floor" jdbcType="BIGINT" property="floor"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="x" jdbcType="DECIMAL" property="x"/>
<result column="y" jdbcType="DECIMAL" property="y"/>
<result column="addr" jdbcType="VARCHAR" property="addr"/>
<result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/>
<result column="longitude" jdbcType="DECIMAL" property="longitude"/>
<result column="latitude" jdbcType="DECIMAL" property="latitude"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="img_url" jdbcType="VARCHAR" property="imgUrl"/>
<result column="manager" jdbcType="VARCHAR" property="manager"/>
<result column="manager_phone" jdbcType="VARCHAR" property="managerPhone"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<result column="point_type" jdbcType="INTEGER" property="pointType"/>
<result column="comments" jdbcType="VARCHAR" property="comments"/>
<result column="email" property="email"/>

<result column="building_name" jdbcType="VARCHAR" property="buildingName"/>
<result column="floor_name" jdbcType="VARCHAR" property="floorName"/>


<result column="merchantId" jdbcType="VARCHAR" property="merchantId"/>
<result column="merchantName" jdbcType="VARCHAR" property="merchantName"/>
<result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/>
<result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>

<result column="business" jdbcType="VARCHAR" property="business"/>

<result column="brandName" jdbcType="VARCHAR" property="brandName"/>

</resultMap>


<select id="findListWithMerchantMap" parameterType="com.iformall.domain.vo.WxShopVo" resultMap="VoResultMap">
select
s.id,s.shop_number,s.build_area,s.img_url,s.operation_area,s.status,s.manager,s.manager_phone,s.addr,s.email,s.type,s.point_type,
b.building_name,f.floor_name,
m.id merchantId,m.name merchantName,m.link_person,m.link_phone,
brand.name brandName,
bus.title business
from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0
left join wx_merchant m on ms.merchant_id=m.id
left join wx_mall_building b on s.building=b.id


Загрузка…
Отмена
Сохранить