winter 1 год назад
Родитель
Сommit
9c6e942db6
24 измененных файлов: 128 добавлений и 68 удалений
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  2. +5
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  3. +3
    -0
      mallinkAdmin/src/main/resources/db/migration/V202409000000001.sql
  4. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java
  5. +1
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxEnergyReadingCalcuteResult.java
  6. +2
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxFinanceReceive.java
  7. +4
    -4
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  8. +2
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java
  9. +2
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  10. +1
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
  11. +2
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumMerchantCreateFrom.java
  12. +2
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumRentShopType.java
  13. +1
    -1
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  14. +1
    -1
      mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java
  15. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxFinanceServiceImpl.java
  16. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantPowerBillConfigServiceImpl.java
  17. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  18. +80
    -30
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  19. +2
    -0
      mallinkService/src/main/resources/mapper/WxAllBillMapper.xml
  20. +1
    -3
      mallinkService/src/main/resources/mapper/WxFinanceReceiveMapper.xml
  21. +3
    -10
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml
  22. +3
    -0
      mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml
  23. +5
    -3
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
  24. +1
    -1
      mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java Просмотреть файл

@@ -255,7 +255,7 @@ public class WxMerchantController extends BaseController {
wxMerchant.updateTenantInfo(getTenantInfo()); wxMerchant.updateTenantInfo(getTenantInfo());
wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC);
wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode());
wxMerchant.setType(type);
//wxMerchant.setType(type);
wxMerchant.setCarVendorType(0); wxMerchant.setCarVendorType(0);
wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes()); wxMerchant.setAdminTypes(EnumMerchantAdmin.getOrdinaryTypes());
WxUserDataRule dataRule = this.getCurrentDataFloors(); WxUserDataRule dataRule = this.getCurrentDataFloors();


+ 5
- 1
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java Просмотреть файл

@@ -150,6 +150,9 @@ public class WxPropertyContractController extends WxContractBaseController {
if (null == wxPropertyContract.getOperationType()) { if (null == wxPropertyContract.getOperationType()) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "operationType不能为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "operationType不能为空");
} }
if (null == wxPropertyContract.getRentShopType()) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "rentShopType不能为空");
}
if (null == wxPropertyContract.getAdjustPeriod()) { if (null == wxPropertyContract.getAdjustPeriod()) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "adjustPeriod不能为空"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "adjustPeriod不能为空");
} }
@@ -197,6 +200,7 @@ public class WxPropertyContractController extends WxContractBaseController {
wxPropertyContract.setSignDate(rentContract.getSignDate()); wxPropertyContract.setSignDate(rentContract.getSignDate());
wxPropertyContract.setRentInfo(rentContract.getRentInfo()); wxPropertyContract.setRentInfo(rentContract.getRentInfo());
wxPropertyContract.setShopNumbers(rentContract.getRentInfoShopNumber()); wxPropertyContract.setShopNumbers(rentContract.getRentInfoShopNumber());
wxPropertyContract.setRentShopType(rentContract.getRentShopType());
} }
WxMerchant merchant = wxMerchantService.selectById(wxPropertyContract.getMerchantId()); WxMerchant merchant = wxMerchantService.selectById(wxPropertyContract.getMerchantId());
@@ -209,7 +213,7 @@ public class WxPropertyContractController extends WxContractBaseController {
wxPropertyContract.setShopType(merchant.getShopType()); wxPropertyContract.setShopType(merchant.getShopType());
wxPropertyContract.setLinkPerson(merchant.getLinkPerson()); wxPropertyContract.setLinkPerson(merchant.getLinkPerson());
wxPropertyContract.setLinkPhone(merchant.getLinkPhone()); wxPropertyContract.setLinkPhone(merchant.getLinkPhone());
wxPropertyContract.setRentShopType(merchant.getType());
//wxPropertyContract.setRentShopType(merchant.getType());
Integer contractType = wxRentPropertyContractService.getContractType(wxPropertyContract.getRentShopType(), wxPropertyContract.getOperationType(), EnumContractType.PROPERTY.getCode()); Integer contractType = wxRentPropertyContractService.getContractType(wxPropertyContract.getRentShopType(), wxPropertyContract.getOperationType(), EnumContractType.PROPERTY.getCode());
wxPropertyContract.setContractType(contractType); wxPropertyContract.setContractType(contractType);


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

@@ -0,0 +1,3 @@
INSERT INTO `mallink`.`mall_permission` (`id`, `name`, `parent_id`, `available`, `permission`, `resource_type`, `module_color`, `module_color_num`, `url`, `icon`, `version_type`, `sort`)
VALUES (213, '写字楼住宅', 201, 'Y', NULL, 1, NULL, NULL, 'xzlzzlist', NULL, 0, 213);


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

@@ -409,4 +409,6 @@ public class WxAllBill extends TenantEntity {
private String merchantLinkPerson; private String merchantLinkPerson;
@TableField(exist = false) @TableField(exist = false)
private String merchantPhone; private String merchantPhone;
@TableField(exist = false)
private String queryShopNumber;
} }

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

@@ -91,7 +91,7 @@ public class WxEnergyReadingCalcuteResult extends TenantEntity {
daily.setId(idWorker.nextId()); daily.setId(idWorker.nextId());
daily.updateTenantInfo(this); daily.updateTenantInfo(this);
daily.setMerchantId(merchant.getId()); daily.setMerchantId(merchant.getId());
daily.setRentShopType(merchant.getType());
daily.setRentShopType(shop.getType());
daily.setCreatetime(new Date()); daily.setCreatetime(new Date());
daily.setCreateBy(user.getId()); daily.setCreateBy(user.getId());
daily.setCreateByName(user.getName()); daily.setCreateByName(user.getName());


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

@@ -161,8 +161,8 @@ public class WxFinanceReceive extends TenantEntity {
@TableField(exist = false) @TableField(exist = false)
private List<Long> merchantIdList; private List<Long> merchantIdList;
@io.swagger.annotations.ApiModelProperty(value = "店铺/多径EnumRentShopType", name = "rentShopType")
private Integer rentShopType;
// @io.swagger.annotations.ApiModelProperty(value = "店铺/多径EnumRentShopType", name = "rentShopType")
// private Integer rentShopType;
@io.swagger.annotations.ApiModelProperty(value = "remark", name = "remark") @io.swagger.annotations.ApiModelProperty(value = "remark", name = "remark")
private String remark; private String remark;


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

@@ -85,7 +85,7 @@ public class WxMerchant extends TenantEntity {
private Date rentalEndDate; private Date rentalEndDate;


@Excel(name="商户状态",width = 20,orderNum = "7",replace = {"停用_0","正常_1"}) @Excel(name="商户状态",width = 20,orderNum = "7",replace = {"停用_0","正常_1"})
@io.swagger.annotations.ApiModelProperty(value="状态1可用0停用",name="status")
@io.swagger.annotations.ApiModelProperty(value="状态1可用0停用EnumMerchantStatus",name="status")
private Integer status; private Integer status;


public boolean checkStatus() { public boolean checkStatus() {
@@ -112,7 +112,7 @@ public class WxMerchant extends TenantEntity {
private Date createDate; private Date createDate;


@Excel(name="是否展示",width = 20,orderNum = "9",replace = {"否_0","是_1"}) @Excel(name="是否展示",width = 20,orderNum = "9",replace = {"否_0","是_1"})
@io.swagger.annotations.ApiModelProperty(value = "是否显示在C端", name = "isPublic")
@io.swagger.annotations.ApiModelProperty(value = "是否显示在C端EnumMerchantPublic", name = "isPublic")
private Integer isPublic; private Integer isPublic;


@io.swagger.annotations.ApiModelProperty(value = "是否保密", name = "isPrivate") @io.swagger.annotations.ApiModelProperty(value = "是否保密", name = "isPrivate")
@@ -282,8 +282,8 @@ public class WxMerchant extends TenantEntity {
private Integer shopType; private Integer shopType;
@io.swagger.annotations.ApiModelProperty(value="品牌",name="brand") @io.swagger.annotations.ApiModelProperty(value="品牌",name="brand")
private Long brand; private Long brand;
@io.swagger.annotations.ApiModelProperty(value = "类型EnumRentShopType", name = "type")
private Integer type;
// @io.swagger.annotations.ApiModelProperty(value = "类型EnumRentShopType", name = "type")
// private Integer type;
@io.swagger.annotations.ApiModelProperty(value = "邮件", name = "email") @io.swagger.annotations.ApiModelProperty(value = "邮件", name = "email")
private String email; private String email;
@io.swagger.annotations.ApiModelProperty(value = "副标题", name = "title") @io.swagger.annotations.ApiModelProperty(value = "副标题", name = "title")


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

@@ -376,6 +376,7 @@ public class WxPropertyContract extends TenantEntity {
@TableField(exist = false) @TableField(exist = false)
List<WxEnergyFees> feeStandards; List<WxEnergyFees> feeStandards;

@TableField(exist = false)
private String queryShopNumber;


} }

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

@@ -627,5 +627,7 @@ public class WxRentContract extends TenantEntity {
private Date yearsBegin; private Date yearsBegin;
@TableField(exist = false) @TableField(exist = false)
private Date yearsEnd; private Date yearsEnd;
@TableField(exist = false)
private String queryShopNumber;
} }



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

@@ -77,7 +77,7 @@ public class WxShop extends TenantEntity {
private String floorName; private String floorName;


@Excel(name="租赁状态",width = 20,orderNum = "7",replace = {"未出租_0","已出租_1"}) @Excel(name="租赁状态",width = 20,orderNum = "7",replace = {"未出租_0","已出租_1"})
@io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)",name="status")
@io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)EnumShopStatus",name="status")
private Integer status; private Integer status;


@io.swagger.annotations.ApiModelProperty(value="店铺相对位置x",name="x") @io.swagger.annotations.ApiModelProperty(value="店铺相对位置x",name="x")
@@ -119,8 +119,6 @@ public class WxShop extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "类型EnumRentShopType", name = "type") @io.swagger.annotations.ApiModelProperty(value = "类型EnumRentShopType", name = "type")
private Integer type; private Integer type;




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




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

@@ -7,7 +7,8 @@ package com.iformall.enums;
public enum EnumMerchantCreateFrom { public enum EnumMerchantCreateFrom {


CREATE(1, "手动创建"), CREATE(1, "手动创建"),
DOUYIN_LAIKE(2, "抖音来客");
DOUYIN_LAIKE(2, "抖音来客"),
SYS_SHOP_CREATE(3, "系统根据店铺自动创建");


public static EnumMerchantCreateFrom getEnum(Integer code) { public static EnumMerchantCreateFrom getEnum(Integer code) {
for (EnumMerchantCreateFrom value : values()) { for (EnumMerchantCreateFrom value : values()) {


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

@@ -8,7 +8,8 @@ package com.iformall.enums;
public enum EnumRentShopType { public enum EnumRentShopType {


SHOP(1, "店铺"), SHOP(1, "店铺"),
POINT(2, "多经点位");
POINT(2, "多经点位"),
XIZILOU(3, "写字楼住宅");


public static EnumRentShopType getEnum(Integer code) { public static EnumRentShopType getEnum(Integer code) {
for (EnumRentShopType value : values()) { for (EnumRentShopType value : values()) {


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

@@ -31,7 +31,7 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>


List<WxRentContract> selectRentContractByMerchantId(WxRentContract wxRentContract); List<WxRentContract> selectRentContractByMerchantId(WxRentContract wxRentContract);


List<WxRentContract> selectRentContractByShopId(@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId,@Param("shopId") Long shopId,@Param("status") Integer status);
//List<WxRentContract> selectRentContractByShopId(@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId,@Param("shopId") Long shopId,@Param("status") Integer status);


int hasContractNumber(WxRentContract wxRentContract); int hasContractNumber(WxRentContract wxRentContract);




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

@@ -89,7 +89,7 @@ public class WxBillAllHelper {
bill.setMerchantId(wxMerchant.getId()); bill.setMerchantId(wxMerchant.getId());
bill.setStarttime(starttime); bill.setStarttime(starttime);
bill.setEndtime(enttime); bill.setEndtime(enttime);
bill.setRentShopType(wxMerchant.getType());
//bill.setRentShopType(wxMerchant.getType());
if (null != wxMerchant.getOweBillBeforeDays()) { if (null != wxMerchant.getOweBillBeforeDays()) {
bill.setOweBillLastTime(getDateBefore(wxMerchant.getOweBillBeforeDays())); bill.setOweBillLastTime(getDateBefore(wxMerchant.getOweBillBeforeDays()));
} }


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

@@ -914,8 +914,8 @@ public class WxFinanceServiceImpl implements WxFinanceService {
addreceive.setReceiveMoney(receiveMoney); addreceive.setReceiveMoney(receiveMoney);
addreceive.setPayMoney(payMoney); addreceive.setPayMoney(payMoney);
addreceive.setMerchantId(merchantId); addreceive.setMerchantId(merchantId);
WxMerchant merchant = wxMerchantService.getById(merchantId);
addreceive.setRentShopType(merchant.getType());
//WxMerchant merchant = wxMerchantService.getById(merchantId);
//addreceive.setRentShopType(merchant.getType());
addreceive.setCreateTime(new Date()); addreceive.setCreateTime(new Date());
addreceive.setCreateBy(user.getId()); addreceive.setCreateBy(user.getId());
addreceive.setCreateByName(user.getName()); addreceive.setCreateByName(user.getName());


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

@@ -74,7 +74,7 @@ public class WxMerchantPowerBillConfigServiceImpl implements WxMerchantPowerBill
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);
} }
config.setMerchantName(wxMerchant.getName()); config.setMerchantName(wxMerchant.getName());
config.setMerchantType(wxMerchant.getType());
//config.setMerchantType(wxMerchant.getType());
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
config.setId(idWorker.nextId()); config.setId(idWorker.nextId());
config.setCreateDate(date); config.setCreateDate(date);


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

@@ -2271,7 +2271,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
shopIds.add(shop.getId()); shopIds.add(shop.getId());
merchant.setShopids(shopIds); merchant.setShopids(shopIds);
merchant.setBusinessId(shop.getBusinessId()); merchant.setBusinessId(shop.getBusinessId());
merchant.setType(1);
//merchant.setType(1);
merchant.setCreateFrom(EnumMerchantCreateFrom.DOUYIN_LAIKE.getCode()); merchant.setCreateFrom(EnumMerchantCreateFrom.DOUYIN_LAIKE.getCode());
merchant.setCreateFromId(poiId); merchant.setCreateFromId(poiId);
Result result = this.addMerchant(merchant, user.getId()); Result result = this.addMerchant(merchant, user.getId());


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

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


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.Constant;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.ErrorCode; import com.iformall.common.ErrorCode;
@@ -15,8 +16,10 @@ import com.iformall.domain.vo.WxNotRentShopVo;
import com.iformall.domain.vo.WxShopVo; import com.iformall.domain.vo.WxShopVo;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxAllBillMapper;
import com.iformall.mapper.WxMerchantMapper; import com.iformall.mapper.WxMerchantMapper;
import com.iformall.mapper.WxMerchantShopMapper; import com.iformall.mapper.WxMerchantShopMapper;
import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.mapper.WxRentContractMapper; import com.iformall.mapper.WxRentContractMapper;
import com.iformall.mapper.WxShopMapper; import com.iformall.mapper.WxShopMapper;
import com.iformall.service.*; import com.iformall.service.*;
@@ -36,6 +39,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -66,6 +71,12 @@ public class WxShopServiceImpl implements WxShopService {
@Autowired @Autowired
WxRentContractMapper wxRentContractMapper; WxRentContractMapper wxRentContractMapper;
@Autowired
WxPropertyContractMapper wxPropertyContractMapper;
@Autowired
WxAllBillMapper wxAllBillMapper;
@Lazy @Lazy
@Autowired @Autowired
WxMallFloorService wxMallFloorService; WxMallFloorService wxMallFloorService;
@@ -332,6 +343,7 @@ public class WxShopServiceImpl implements WxShopService {
return volist; return volist;
} }


@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
@Override @Override
public ResultData saveOrUpdate(WxShop record) { public ResultData saveOrUpdate(WxShop record) {
if (record.getId() == null) { if (record.getId() == null) {
@@ -345,6 +357,44 @@ public class WxShopServiceImpl implements WxShopService {
if (StringUtils.isBlank(record.getOperationArea()) || "0".equals(record.getOperationArea())) { if (StringUtils.isBlank(record.getOperationArea()) || "0".equals(record.getOperationArea())) {
record.setOperationArea(record.getBuildArea()); record.setOperationArea(record.getBuildArea());
} }
//如果是写字楼住宅,则自动新增虚拟商户
if (record.getType() == EnumRentShopType.XIZILOU.getCode()) {
WxMerchant merchant = new WxMerchant();
merchant.updateTenantInfo(record);
merchant.setName("[系统]"+record.getShopNumber());
merchant.setId(idWorker.nextId());
merchant.setLinkPerson("虚拟");
merchant.setLinkPhone("11111111111");
merchant.setStatus(EnumMerchantStatus.VALID.getCode());
merchant.setCreateDate(new Date());
merchant.setUpdateDate(new Date());
merchant.setIsPublic(EnumMerchantPublic.PRIVATE.getCode());
merchant.setIsPrivate(EnumYesOrNo.YES.getCode());
merchant.setBillSetting(3);
merchant.setCreateFrom(EnumMerchantCreateFrom.SYS_SHOP_CREATE.getCode());
merchant.setCreateFromId(String.valueOf(record.getId()));
merchant.setCarVendorType(0);
merchant.setBusinessId(com.iformall.utils.Constant.default_business);
//merchant.setType();
merchant.setIsAdmin(EnumYesOrNo.NO.getCode());
merchant.setIsDel(EnumYesOrNo.NO.getCode());
merchant.setSearchCardByPhone(EnumYesOrNo.NO.getCode());
merchant.setCreditLocked(EnumYesOrNo.NO.getCode());
wxMerchantMapper.insert(merchant);
WxMerchantShop ms = new WxMerchantShop();
ms.updateTenantInfo(record);
ms.setMerchantId(merchant.getId());
ms.setShopId(record.getId());
ms.setIsDel(EnumYesOrNo.NO.getCode());
ms.setCreateDate(new Date());
ms.setUpdateDate(new Date());
wxMerchantShopMapper.insert(ms);
record.setStatus(EnumShopStatus.RENT.getCode());
}
wxShopMapper.insert(record); wxShopMapper.insert(record);
return new ResultData(Result.SUCCESS,"添加成功"); return new ResultData(Result.SUCCESS,"添加成功");
} else { } else {
@@ -367,40 +417,40 @@ public class WxShopServiceImpl implements WxShopService {
//2、是否关联过商户 //2、是否关联过商户
WxMerchantShop wxMerchantShop = new WxMerchantShop(); WxMerchantShop wxMerchantShop = new WxMerchantShop();
wxMerchantShop.setShopId(wxShop.getId()); wxMerchantShop.setShopId(wxShop.getId());
List<WxMerchantShop> wxMerchantShops = wxMerchantShopMapper.selectList(new QueryWrapper(wxMerchantShop));

if (isAdmin.equals(EnumUserAdmin.ADMIN.getCode())) {
//3、合同 两种 都要查一下 存在时不能删除
WxRentContract wxRentContract = new WxRentContract();
//wxRentContract.setShopId(wxShop.getId());
wxRentContract.updateTenantInfo(wxShop);
long count = 0;
if (wxShop.getType().equals(EnumRentShopType.SHOP.getCode())) {
count = wxRentContractMapper.selectRentContractByShopId(wxRentContract.getTenantId(),wxRentContract.getParentTenantId(),wxShop.getId(),null).parallelStream()
// .filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
.filter(r -> !EnumRentContractStatus.getValidStatus().contains(r.getStatus())).count();
} else {
wxRentContract.setShopNumber(wxShop.getShopNumber());
List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract);
// count = list.stream().filter(r -> !r.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.RENT_PAID.getCode()) &&
// !r.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
count = list.stream().filter(r -> EnumRentContractStatus.getValidStatus().contains(r.getStatus())).count();
}
if (count > 0) {
return new ResultData(ErrorCode.SHOP_CONTRACT_HAS_CONNECT);
}
wxMerchantShop.updateTenantInfo(wxShop);
List<WxMerchantShop> wxMerchantShops = wxMerchantShopMapper.findList(wxMerchantShop);

//如果存在有效的合同,则不允许删除
WxRentContract rcq = new WxRentContract();
rcq.updateTenantInfo(wxShop);
rcq.setQueryShopNumber(wxShop.getShopNumber());
List<Integer> status = EnumRentContractStatus.getValidStatus();
status.add(EnumRentContractStatus.PERFORMANCE.getCode());
rcq.setStatuss(status);
List<WxRentContract> list = wxRentContractMapper.findList(rcq);
if (null != list && list.size() > 0 ) {
return new ResultData(Result.ERROR, "店铺存在有效或者审批中的租金合同,不能删除");
}
WxPropertyContract pcq = new WxPropertyContract();
pcq.updateTenantInfo(wxShop);
pcq.setQueryShopNumber(wxShop.getShopNumber());
pcq.setStatuss(status);
List<WxPropertyContract> plist = wxPropertyContractMapper.findList(pcq);
if (null != plist && plist.size() > 0 ) {
return new ResultData(Result.ERROR, "店铺存在有效或者审批中的物业合同,不能删除");
}
WxAllBill abq = new WxAllBill();
abq.updateTenantInfo(wxShop);
abq.setQueryShopNumber(wxShop.getShopNumber());
abq.setIsPreview(EnumYesOrNo.NO.getCode());
List<WxAllBill> billlist = wxAllBillMapper.findList(abq);
if (null != billlist && plist.size() > 0 ) {
return new ResultData(Result.ERROR, "店铺已存在有效的账单,不能删除");
} }
//有关联过商户必须是管理员才能删除 //有关联过商户必须是管理员才能删除
int count = wxMerchantShops.size(); int count = wxMerchantShops.size();
if (count > 0) { if (count > 0) {
if (!isAdmin.equals(EnumUserAdmin.ADMIN.getCode())) {
return new ResultData(ErrorCode.SHOP_DELETED_BY_ADMIN);
}
//更新标记 //更新标记
wxShop.setIsDel(EnumDelStatus.DEL.getCode()); wxShop.setIsDel(EnumDelStatus.DEL.getCode());
wxShopMapper.updateById(wxShop); wxShopMapper.updateById(wxShop);


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

@@ -81,6 +81,8 @@
<if test=" null != noExtraCreateFrom">and `extra_create_from` is null</if> <if test=" null != noExtraCreateFrom">and `extra_create_from` is null</if>
<if test=" null != advanceHasMoney">and bill_type = 6 and IFNULL(`pay`,'0') - IFNULL(`use_money`,'0') &gt; 0</if> <if test=" null != advanceHasMoney">and bill_type = 6 and IFNULL(`pay`,'0') - IFNULL(`use_money`,'0') &gt; 0</if>
<if test=" null != canEdit">and `can_edit` = #{canEdit}</if> <if test=" null != canEdit">and `can_edit` = #{canEdit}</if>
<if test=" null != shopNumber and '' != shopNumber"> and shop_number like concat('%',#{shopNumber},'%')</if>
<if test=" null != queryShopNumber and '' != queryShopNumber"> and shop_number like concat('%,',#{shopNumber},',%')</if>
<if test=" null != month and '' != month"> <if test=" null != month and '' != month">
and date_format(starttime,'%Y-%m') &lt;= #{month} and date_format(endtime,'%Y-%m') &gt;= #{month} and date_format(starttime,'%Y-%m') &lt;= #{month} and date_format(endtime,'%Y-%m') &gt;= #{month}
</if> </if>


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

@@ -20,7 +20,6 @@
<result column="update_by" jdbcType="BIGINT" property="updateBy"/> <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
<result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/> <result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/> <result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="rent_shop_type" jdbcType="INTEGER" property="rentShopType"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/> <result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="fees_id" jdbcType="BIGINT" property="feesId"/> <result column="fees_id" jdbcType="BIGINT" property="feesId"/>
<result column="is_print" jdbcType="INTEGER" property="isPrint"/> <result column="is_print" jdbcType="INTEGER" property="isPrint"/>
@@ -30,7 +29,7 @@


<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`receive_date`,`receive_money`,`pay_money`,`set_off_money`,`cut_money`,`status`,`type`, `id`,`tenant_id`,`parent_tenant_id`,`create_time`,`update_time`,`receive_date`,`receive_money`,`pay_money`,`set_off_money`,`cut_money`,`status`,`type`,
`money_detail`,`create_by`,`create_by_name`,`update_by`,`update_by_name`,`merchant_id`,`rent_shop_type`,`remark`,`fees_id`,`is_print`,`is_finish`,`parent_id`
`money_detail`,`create_by`,`create_by_name`,`update_by`,`update_by_name`,`merchant_id`,`remark`,`fees_id`,`is_print`,`is_finish`,`parent_id`
</sql> </sql>


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">
@@ -45,7 +44,6 @@
<if test=" null != status ">and `status` = #{status}</if> <if test=" null != status ">and `status` = #{status}</if>
<if test=" null != type ">and `type` = #{type}</if> <if test=" null != type ">and `type` = #{type}</if>
<if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if> <if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
<if test=" null != rentShopType ">and `rent_shop_type` = #{rentShopType}</if>
<if test=" null != createTimeBegin ">and `create_time` &gt;= #{createTimeBegin}</if> <if test=" null != createTimeBegin ">and `create_time` &gt;= #{createTimeBegin}</if>
<if test=" null != createTimeEnd ">and `create_time` &lt;= #{createTimeEnd}</if> <if test=" null != createTimeEnd ">and `create_time` &lt;= #{createTimeEnd}</if>
<if test=" null != receiveDateBegin ">and `receive_date` &gt;= #{receiveDateBegin}</if> <if test=" null != receiveDateBegin ">and `receive_date` &gt;= #{receiveDateBegin}</if>


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

@@ -21,7 +21,6 @@
<result column="sub_business_id" jdbcType="INTEGER" property="subBusinessId"/> <result column="sub_business_id" jdbcType="INTEGER" property="subBusinessId"/>
<result column="shop_type" jdbcType="INTEGER" property="shopType"/> <result column="shop_type" jdbcType="INTEGER" property="shopType"/>
<result column="brand" jdbcType="VARCHAR" property="brand"/> <result column="brand" jdbcType="VARCHAR" property="brand"/>
<result column="type" jdbcType="SMALLINT" property="type"/>
<result column="is_public" jdbcType="SMALLINT" property="isPublic"/> <result column="is_public" jdbcType="SMALLINT" property="isPublic"/>
<result column="is_private" jdbcType="SMALLINT" property="isPrivate"/> <result column="is_private" jdbcType="SMALLINT" property="isPrivate"/>
<result column="email" jdbcType="VARCHAR" property="email"/> <result column="email" jdbcType="VARCHAR" property="email"/>
@@ -55,7 +54,7 @@
<sql id="allColumns"> <sql id="allColumns">
m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`, m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.`is_private`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`is_public`,m.`is_private`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.search_card_by_phone,m.credit_locked,m.credit_locked,m.entry_amount,m.cash_out_count, m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.search_card_by_phone,m.credit_locked,m.credit_locked,m.entry_amount,m.cash_out_count,
m.cash_out_last_time,m.create_from,m.create_from_id m.cash_out_last_time,m.create_from,m.create_from_id
</sql> </sql>
@@ -124,9 +123,6 @@
<if test=" null != businessForRule and '' != businessForRule "> <if test=" null != businessForRule and '' != businessForRule ">
and m.business_id in (${businessForRule}) and m.is_del=0 and m.business_id in (${businessForRule}) and m.is_del=0
</if> </if>
<if test=" null != shopTypeForRule and '' != shopTypeForRule ">
and m.type in (${shopTypeForRule})
</if>


<if test=" null != businessTypes "> <if test=" null != businessTypes ">
and JSON_CONTAINS(m.business_types,JSON_OBJECT('id', #{businessTypes})) and JSON_CONTAINS(m.business_types,JSON_OBJECT('id', #{businessTypes}))
@@ -143,9 +139,6 @@
and m.`status` = #{status} and m.`status` = #{status}
</if> </if>


<if test=" null != type ">
and m.`type` = #{type}
</if>
<if test=" null != isPublic "> <if test=" null != isPublic ">
and m.`is_public` = #{isPublic} and m.`is_public` = #{isPublic}
</if> </if>
@@ -467,7 +460,7 @@
<select id="findShopMerchant" parameterType="Long" resultType="hashmap"> <select id="findShopMerchant" parameterType="Long" resultType="hashmap">
select select
m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`, m.`id`,m.`tenant_id`,m.`parent_tenant_id`,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.`is_private`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`is_public`,m.`is_private`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked
from wx_merchant m where m.id = #{id} from wx_merchant m where m.id = #{id}
</select> </select>
@@ -476,7 +469,7 @@
select select
m.`id`,m.`tenant_id` tenantId,m.`parent_tenant_id` parentTenantId,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`, m.`id`,m.`tenant_id` tenantId,m.`parent_tenant_id` parentTenantId,m.`img_url`,m.`name`,m.`encode`,m.`link_phone`,m.`create_date`,m.`update_date`,
m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`, m.`car_vendor_type`,m.`car_params`,m.`status`,m.`link_person`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`type`,m.`is_public`,m.`is_private`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`business_id`,m.`business_types`,m.`sub_business_id`,m.`shop_type`,m.`brand`,m.`is_public`,m.`is_private`,m.email,m.`title`,m.`cover_picture`,m.`is_admin`,m.`bill_setting`,m.`qr_code`,m.`tt_qr_code`,
m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked m.`introduction`,m.`action_desc`,m.`mark`,m.mark_time,m.`is_del`,m.`talk_user_main`,m.`talk_user_aux`,m.link_line_phone,m.credit_locked,m.credit_locked
from wx_merchant m where m.id = #{id} and m.is_del = 0 from wx_merchant m where m.id = #{id} and m.is_del = 0
<if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId"> <if test=" null != tenantInfo.tenantId and '' != tenantInfo.tenantId">


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

@@ -132,6 +132,9 @@
<if test=" null != shopTypeForRule and '' != shopTypeForRule "> <if test=" null != shopTypeForRule and '' != shopTypeForRule ">
and rent_shop_type in (${shopTypeForRule}) and rent_shop_type in (${shopTypeForRule})
</if> </if>
<if test=" null != queryShopNumber and queryShopNumber!=''">
and concat(',',shop_numbers,',') like concat('%,',#{queryShopNumber},',%')
</if>
<if test=" null != merchantIds "> <if test=" null != merchantIds ">
and merchant_id in and merchant_id in
<foreach collection="merchantIds" index="index" item="mItem" open="(" separator="," close=")"> <foreach collection="merchantIds" index="index" item="mItem" open="(" separator="," close=")">


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

@@ -206,6 +206,9 @@
<if test=" null != shopNumber and shopNumber!=''"> <if test=" null != shopNumber and shopNumber!=''">
and shop_name like concat('%',#{shopNumber},'%') and shop_name like concat('%',#{shopNumber},'%')
</if> </if>
<if test=" null != queryShopNumber and queryShopNumber!=''">
and concat(',',shop_name,',') like concat('%,',#{queryShopNumber},',%')
</if>


<if test=" null != businessForRule and '' != businessForRule "> <if test=" null != businessForRule and '' != businessForRule ">
and business_id in (${businessForRule}) and business_id in (${businessForRule})
@@ -314,8 +317,7 @@
</if> </if>
</select> </select>


<select id="selectRentContractByShopId" parameterType="com.iformall.domain.po.WxRentContract"
resultType="com.iformall.domain.po.WxRentContract">
<!--<select id="selectRentContractByShopId" parameterType="com.iformall.domain.po.WxRentContract" resultType="com.iformall.domain.po.WxRentContract">
select <include refid="allColumns"/> from wx_rent_contract select <include refid="allColumns"/> from wx_rent_contract
where 1=1 where 1=1
<if test=" null != tenantId and '' != tenantId"> <if test=" null != tenantId and '' != tenantId">
@@ -326,7 +328,7 @@
</if> </if>
and json_contains(json_extract(rent_info,'$[*].id'),concat('"',${shopId},'"')) and rent_shop_type =1 and json_contains(json_extract(rent_info,'$[*].id'),concat('"',${shopId},'"')) and rent_shop_type =1
<if test=" null != status ">and status=#{status} and status!=7</if> <if test=" null != status ">and status=#{status} and status!=7</if>
</select>
</select> -->


<select id="selectRentContractByMerchantId" parameterType="com.iformall.domain.po.WxRentContract" <select id="selectRentContractByMerchantId" parameterType="com.iformall.domain.po.WxRentContract"
resultType="com.iformall.domain.po.WxRentContract"> resultType="com.iformall.domain.po.WxRentContract">


+ 1
- 1
mallinkTTAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java Просмотреть файл

@@ -110,7 +110,7 @@ public class WxMerchantController extends BaseController {
wxMerchant.updateTenantInfo(getTenantInfo()); wxMerchant.updateTenantInfo(getTenantInfo());
wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC); wxMerchant.setSortColumns(BaseEntity.SortField.TopTime_DESC);
wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode()); wxMerchant.setStatus(EnumMerchantStatus.VALID.getCode());
wxMerchant.setType(type);
//wxMerchant.setType(type);
wxMerchant.setCarVendorType(0); wxMerchant.setCarVendorType(0);
return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant)); return new ResultData(wxMerchantService.queryIdAndNames(wxMerchant));
} }


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