Procházet zdrojové kódy

fix

release_toaliyun_real
winter před 1 rokem
rodič
revize
71dd8c2b66
53 změnil soubory, kde provedl 1709 přidání a 1384 odebrání
  1. +0
    -36
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMapController.java
  2. +19
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java
  3. +48
    -200
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  4. +33
    -33
      mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java
  5. +270
    -0
      mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql
  6. +10
    -0
      mallinkBApi/src/main/java/com/iformall/controller/BaseController.java
  7. +64
    -43
      mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java
  8. +23
    -13
      mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java
  9. +3
    -3
      mallinkBApi/src/main/java/com/iformall/controller/WxMallAdminController.java
  10. +24
    -1
      mallinkBApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java
  11. +16
    -0
      mallinkService/src/main/java/com/iformall/domain/dto/WxRentLoginUserDTO.java
  12. +5
    -17
      mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java
  13. +90
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxContractCustomers.java
  14. +46
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxContractShop.java
  15. +1
    -2
      mallinkService/src/main/java/com/iformall/domain/po/WxEnergyReadingCalcuteResult.java
  16. +1
    -29
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java
  17. +46
    -134
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  18. +0
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContractAgileDeposit.java
  19. +0
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContractAgileUnDeposit.java
  20. +30
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
  21. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java
  22. +4
    -4
      mallinkService/src/main/java/com/iformall/domain/vo/WxBillNotify.java
  23. +0
    -9
      mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java
  24. +2
    -5
      mallinkService/src/main/java/com/iformall/domain/vo/WxShopBillVo.java
  25. +35
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumContractCustomersStatus.java
  26. +2
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java
  27. +16
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxContractCustomersMapper.java
  28. +18
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxContractShopMapper.java
  29. +0
    -23
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  30. +1
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java
  31. +0
    -10
      mallinkService/src/main/java/com/iformall/print/data/impl/PrintBillDataHandler.java
  32. +2
    -2
      mallinkService/src/main/java/com/iformall/print/data/impl/PrintMerchantSettleDataHandler.java
  33. +8
    -0
      mallinkService/src/main/java/com/iformall/service/WxAgileContractService.java
  34. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxAllBillService.java
  35. +0
    -14
      mallinkService/src/main/java/com/iformall/service/WxRentContractService.java
  36. +6
    -2
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  37. +76
    -55
      mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java
  38. +113
    -52
      mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java
  39. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java
  40. +2
    -12
      mallinkService/src/main/java/com/iformall/service/impl/WxEnergyServiceImpl.java
  41. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java
  42. +5
    -5
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  43. +449
    -369
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  44. +33
    -37
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  45. +2
    -0
      mallinkService/src/main/java/com/iformall/utils/Constant.java
  46. +12
    -24
      mallinkService/src/main/resources/mapper/WxAllBillMapper.xml
  47. +84
    -0
      mallinkService/src/main/resources/mapper/WxContractCustomersMapper.xml
  48. +73
    -0
      mallinkService/src/main/resources/mapper/WxContractShopMapper.xml
  49. +1
    -3
      mallinkService/src/main/resources/mapper/WxRentContractAgileDepositMapper.xml
  50. +1
    -3
      mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositItemMapper.xml
  51. +1
    -3
      mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositMapper.xml
  52. +14
    -226
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
  53. +12
    -0
      mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml

+ 0
- 36
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMapController.java Zobrazit soubor

@@ -55,33 +55,6 @@ public class WxMapController extends BaseController {
@Autowired
private WxCreditHistoryService wxCreditHistoryService;

@ApiOperation("根据id查询接口")
@GetMapping("/findShopBySid")
@ApiImplicitParam(name = "sid", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "店铺管理-id查询")
public ResultData findShopBySid(String sid) {
logger.debug("[" + getIpAddr() + "] WxMapController::findShopBySid");
Map<String, Object> resultObject = new HashMap<>();
Map<String, Object> wxShopObject = wxShopService.detailBySid(getTenantInfo(), sid);
Map<String, Object> wxMerchantObject = new HashMap<>();
Map<String, Object> wxRentContractObject = new HashMap<>();
if(wxShopObject != null && !wxShopObject.isEmpty()
&& EnumShopStatus.RENT.getCode().toString().equals(wxShopObject.get("status").toString())){
//已出租
long shopId = Long.parseLong(wxShopObject.get("id").toString());
String shopNumber = wxShopObject.get("shopNumber").toString();
wxMerchantObject = wxMerchantService.detailByShopId(getTenantInfo(), shopId);
if(wxMerchantObject != null && !wxMerchantObject.isEmpty()){
long merchantId = Long.parseLong(wxMerchantObject.get("id").toString());
wxRentContractObject = wxRentContractService.currentValidByMerchantId(getTenantInfo(),merchantId,shopNumber);
}
}
resultObject.put("wxShop",wxShopObject);
resultObject.put("wxMerchant",wxMerchantObject);
resultObject.put("wxRentContract",wxRentContractObject);
return new ResultData(Result.SUCCESS, "查询成功", resultObject);
}

@ApiOperation("根据id查询接口")
@GetMapping("/findStatisticsBySid")
@ApiImplicitParam(name = "sid", value = "sid", dataType = "Long", paramType = "query", required = true)
@@ -151,15 +124,6 @@ public class WxMapController extends BaseController {
return new ResultData(Result.SUCCESS, "查询成功", wxMerchantService.findMerchantByShop(shopId));
}

@ApiOperation("根据id查询接口")
@GetMapping("/findRentByShop")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
@SystemControllerLog(description = "店铺管理-id查询")
public ResultData findRentByShop(Long shopId) {
logger.debug("[" + getIpAddr() + "] WxMapController::findRentByShop");
return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.findRentByShop(shopId));
}

@ApiOperation("根据id查询接口")
@GetMapping("/findStatisticsByShop")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)


+ 19
- 2
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxContractBaseController.java Zobrazit soubor

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

import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxContractCustomers;
import com.iformall.domain.po.WxFlowModel;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPropertyContract;
@@ -11,6 +12,7 @@ import com.iformall.enums.EnumFlowContractType;
import com.iformall.enums.EnumFlowKey;
import com.iformall.enums.EnumRentAgileType;
import com.iformall.enums.EnumRentShopType;
import com.iformall.service.WxAgileContractService;
import com.iformall.service.WxFlowService;
import com.iformall.service.WxShopService;

@@ -18,7 +20,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -31,8 +36,11 @@ public class WxContractBaseController extends BaseController{
@Autowired
private WxShopService wxShopService;
@Autowired
private WxAgileContractService wxAgileContractService;
protected Map<String,Object> generateFlowParams(WxMerchant merchant,EnumFlowKey flowType,EnumFlowContractType contractType,EnumRentAgileType agileType,String remark,Long contractId,Long wholeProperyId) {
protected Map<String,Object> generateFlowParams(WxContractCustomers contractCustomers,EnumFlowKey flowType,EnumFlowContractType contractType,EnumRentAgileType agileType,String remark,Long contractId,Long wholeProperyId) {
Map<String,Object> map = new HashMap<String,Object>();
map.put("businessType", flowType.getCode());
map.put("remark", remark);
@@ -68,7 +76,7 @@ public class WxContractBaseController extends BaseController{
Map rentNameMap = new HashMap<String,Object>();
rentNameMap.put("key","rentName");
rentNameMap.put("value",wxShopService.getRentName(merchant));
rentNameMap.put("value",contractCustomers.getName());
variablesList.add(rentNameMap);
map.put("variables", variablesList);
@@ -119,4 +127,13 @@ public class WxContractBaseController extends BaseController{
return false;
}
public static boolean dateHasIntersection(Date startDate1, Date endDate1, Date startDate2, Date endDate2) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (startDate1.compareTo(endDate2) <= 0 && startDate2.compareTo(endDate1) <= 0) {
return true;
} else {
return false;
}
}
}

+ 48
- 200
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Zobrazit soubor

@@ -50,6 +50,8 @@ public class WxRentContractController extends WxContractBaseController {
@Autowired
private WxRentContractMapper wxRentContractMapper;
@Autowired
private WxAgileContractService wxAgileContractService;
@Autowired
private WxRentPropertyContractService wxRentPropertyContractService;
@Autowired
private WxShopService wxShopService;
@@ -78,20 +80,6 @@ public class WxRentContractController extends WxContractBaseController {
wxRentContract.setBusinessForRule(dataRule.getBussinessIds());
wxRentContract.setShopTypeForRule(dataRule.getShopTypes());
}
if (null == wxRentContract.getIsPrivateMerchant()) {
wxRentContract.setIsPrivateMerchant(EnumYesOrNo.NO.getCode());
}
//如果是已售,则查询虚拟商户,并且店铺类型是商业的
if (wxRentContract.getIsPrivateMerchant()==2) {
wxRentContract.setIsPrivateMerchant(EnumYesOrNo.YES.getCode());
List<Integer> rentShopTypeList = new ArrayList<Integer>();
rentShopTypeList.add(EnumRentShopType.SHOP.getCode());
rentShopTypeList.add(EnumRentShopType.POINT.getCode());
wxRentContract.setPrivateRentShopTypeList(rentShopTypeList);
}else if (wxRentContract.getIsPrivateMerchant()==1) {
wxRentContract.setIsPrivateMerchant(EnumYesOrNo.YES.getCode());
wxRentContract.setPrivateRentShopType(EnumRentShopType.XIZILOU.getCode());
}
wxRentContract.setAgileType(EnumRentAgileType.STANDARDS_YEAR.getCode());
PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, pageNum, pageSize);
Integer hasFlow = null;
@@ -132,6 +120,11 @@ public class WxRentContractController extends WxContractBaseController {
if(wxRentContract.getRentStartType()!=null &&wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
wxRentContract.setRentalStartDate(wxRentContract.getStartDate());
}
try {
validShop(wxRentContract);
} catch (Exception e) {
return new ResultData(Result.ERROR,e.getMessage());
}
return wxRentContractService.save(wxRentContract, user,user.getName(),oldDate);
}

@@ -259,6 +252,13 @@ public class WxRentContractController extends WxContractBaseController {
if(rentContract.getRentStartType()!=null && rentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
rentContract.setRentalStartDate(rentContract.getStartDate());
}
try {
validShop(rentContract);
} catch (Exception e) {
return new ResultData(Result.ERROR,e.getMessage());
}
ResultData update = null;
try {
update = wxRentContractService.updateOneStep(rentContract, user, user.getName(), EnumFromType.OTHER.getCode(), oldDate,false);
@@ -271,142 +271,6 @@ public class WxRentContractController extends WxContractBaseController {
}
}
/**
* 查询商户可用商铺
* @param merchantId
* @param contractId
* @return
*/
@GetMapping("/merchantShops")
@ApiImplicitParams({
@ApiImplicitParam(name = "merchantId", value = "merchantId", dataType = "Long", paramType = "query", required = true),
@ApiImplicitParam(name = "contractId", value = "contractId", dataType = "Long", paramType = "query", required = true)})
public ResultData merchantShops(Long merchantId,Long contractId) {
//如果商户是虚拟商户,则直接返回绑定的铺位
List<Long> shopList = null;
WxMerchant merchant = wxMerchantService.selectById(merchantId);
if (merchant.getIsPrivate() == EnumYesOrNo.YES.getCode() && merchant.getCreateFrom() == EnumMerchantCreateFrom.SYS_SHOP_CREATE.getCode()) {
shopList = new ArrayList<Long>();
//不从这取,因为这是存的第一次创建时店铺的编号,这个店铺有可能被删除重新创建
//shopList.add(Long.parseLong(merchant.getCreateFromId()));
String shopNumber = merchant.getCreateShopNumber();
WxShop shop = wxShopService.getShopByShopNumber(merchant, shopNumber);
if (null != shop) {
shopList.add(shop.getId());
}
}else {
shopList = wxMerchantService.getMerchantShopIds(merchantId);
}
if (null == shopList || shopList.size() <= 0 ) {
return new ResultData(Result.ERROR,"商户未绑定店铺!");
}
WxRentContract rentq = new WxRentContract();
rentq.setStatuss(EnumRentContractStatus.getValidStatus());
rentq.setMerchantId(merchantId);
rentq.updateTenantInfo(getUser());
List<WxRentContract> rentContractList = wxRentContractService.findList(rentq);
List<Long> rentValidShopIdList = new ArrayList<Long>();
if (null != rentContractList) {
for (WxRentContract rent : rentContractList) {
List<Long> shopidlist = rent.shopIdsByRentInfo();
if (null != shopidlist) {
for (Long sid: shopidlist) {
if (!rentValidShopIdList.contains(sid)) {
rentValidShopIdList.add(sid);
}
}
}
}
}
//如果是新建,或者修改,此时能查询出来未在有效合同里面的店铺
//如果是续签,则还能查询出来合同本身的店铺
List<Long> currentContractShopIds = null;
if (null != contractId) {
WxRentContract rentContract = wxRentContractService.getSimpleDeatil(contractId);
if (null == rentContract) {
return new ResultData(Result.ERROR,"租金合同不存在!");
}
if (rentContract.getStatus().intValue() != EnumRentContractStatus.PAING.getCode()
&& rentContract.getStatus().intValue() != EnumRentContractStatus.OUT_DATE.getCode()) {
return new ResultData(Result.ERROR,"租金合同状态为计租中或者正常到期才能续签。");
}
List<Long> _currentContractShopIds = rentContract.shopIdsByRentInfo();
if (null != _currentContractShopIds) {
currentContractShopIds = new ArrayList<Long>();
for (int i = 0 ; i < _currentContractShopIds.size() ; i ++) {
Long cs = _currentContractShopIds.get(i);
if (shopList.contains(cs)) {
currentContractShopIds.add(cs);
}
}
}
}
//去掉正常状态的合同里的店铺
shopList.stream().filter(s -> !rentValidShopIdList.contains(s));
if ( null != currentContractShopIds) {
//去重
shopList.removeAll(currentContractShopIds);
}
List<WxShop> shops = wxShopService.getByIds(rentq,shopList);
//再加上合同里面店铺
if(null != currentContractShopIds && currentContractShopIds.size() > 0 ) {
List<WxShop> contractShops = wxShopService.getByIds(rentq,currentContractShopIds);
if (null != contractShops) {
for (int i = 0 ; i < contractShops.size() ; i ++) {
WxShop s = contractShops.get(i);
if (!shopList.contains(s.getId())) {
shops.add(s);
}
}
}
}
return new ResultData(shops);
}
/**
* 查询商户计租中或者正常到期的合同
* @param wxRentContract
* @return
*/
@GetMapping("getXuQianRentContract")
@ApiImplicitParams({})
public ResultData getXuQianRentContract(@ModelAttribute WxRentContract wxRentContract) {
wxRentContract.updateTenantInfo(getTenantInfo());
List<Integer> statss = new ArrayList<Integer>();
statss.add(EnumRentContractStatus.PAING.getCode());
statss.add(EnumRentContractStatus.OUT_DATE.getCode());
wxRentContract.setStatuss(statss);
wxRentContract.setSortColumn(BaseEntity.SortField.Createtime_DESC.getValue());
if (null == wxRentContract.getIsPrivateMerchant()) {
wxRentContract.setIsPrivateMerchant(EnumYesOrNo.NO.getCode());
}
PageInfo<WxRentContract> page = wxRentContractService.getRentContractList(wxRentContract, 1, 100000);
if (null != page && null != page.getList()) {
List<Map<String, Object>> retList = new ArrayList<Map<String, Object>>();
for (WxRentContract wr:page.getList()) {
retList.add(wxRentContractService.getById(wr.getId()));
}
return new ResultData(retList);
// List<WxRentContract> painglist = new ArrayList<WxRentContract>();
// painglist.addAll(page.getList());
// painglist.stream().filter( p -> p.getStatus().intValue()==EnumRentContractStatus.PAING.getCode().intValue());
// if (painglist.size()>0) {
// return new ResultData(wxRentContractService.getById(painglist.get(0).getId()));
// }else {
// List<WxRentContract> outdatelist = new ArrayList<WxRentContract>();
// outdatelist.addAll(page.getList());
// outdatelist.stream().filter( p -> p.getStatus().intValue()==EnumRentContractStatus.OUT_DATE.getCode().intValue());
// if (outdatelist.size() > 0 ) {
// return new ResultData(wxRentContractService.getById(outdatelist.get(0).getId()));
// }
// }
}
return new ResultData();
}
/**
* 作废
* @param wxRentContract
@@ -593,28 +457,37 @@ public class WxRentContractController extends WxContractBaseController {
}
private void validShop(WxRentContract rentContract) throws Exception {
//判断该合同的店铺是不是在商户的店铺的绑定关系里面
List<Long> shopIds = null;
WxMerchant merchant = wxMerchantService.selectById(rentContract.getMerchantId());
if (merchant.getIsPrivate() == EnumYesOrNo.YES.getCode()) {
WxShop shq = new WxShop();
shq.updateTenantInfo(merchant);
shq.setQueryShopNumber(merchant.getCreateShopNumber());
shq.setIsDel(EnumYesOrNo.NO.getCode());
shopIds = wxShopService.getShopIds(shq);
}else {
shopIds = wxMerchantService.getMerchantShopIds(rentContract.getMerchantId());
}
if (null == shopIds) {
throw new MallinkException(Result.ERROR, "该商户未绑定任何商铺。");
}
List<Long> cids = rentContract.shopIdsByRentInfo();
if (null == cids) {
throw new MallinkException(Result.ERROR, "该合同未绑定任何商铺。");
}
if (!shopIds.containsAll(cids)) {
throw new MallinkException(Result.ERROR, "该合同绑定的部分商铺未在商户绑定的店铺范围内。");
//TODO 判断该合同的店铺是不是存在有效的合同,或者审批中的合同,要判断时间区间是否有重复
List<Long> shopIdList = rentContract.shopIdsByRentInfo();
List<Long> contractIds = wxAgileContractService.findShopContractIds(rentContract, shopIdList);
//查询是否有跟当前合同时间有冲突的合同
if (null != contractIds) {
if (null != rentContract.getId()) {
contractIds.remove(rentContract.getId());
}
if (contractIds.size() > 0) {
WxRentContract rc = new WxRentContract();
rc.updateTenantInfo(rentContract);
rc.setIds(contractIds);
List<Integer> statusList = new ArrayList<Integer>();
statusList.add(EnumRentContractStatus.DRAFT.getCode());
statusList.add(EnumRentContractStatus.PAING.getCode());
statusList.add(EnumRentContractStatus.READY_FOR_PAING.getCode());
statusList.add(EnumRentContractStatus.PERFORMANCE.getCode());
statusList.add(EnumRentContractStatus.UNWRITE.getCode());
rc.setStatuss(statusList);
List<WxRentContract> contractList = wxRentContractService.findList(rc);
if (null != contractList && contractList.size() > 0 ) {
for (int i = 0 ; i < contractList.size(); i ++ ) {
WxRentContract wrc = contractList.get(i);
if (dateHasIntersection(rentContract.getRentalStartDate(),rentContract.getRentalEndDate(),
wrc.getRentalStartDate(),wrc.getRentalEndDate())) {
throw new MallinkException(Result.ERROR, "房间资源存在时间冲突的合同。");
}
}
}
}
}
}
@@ -658,13 +531,13 @@ public class WxRentContractController extends WxContractBaseController {
}
}
WxMerchant merchant = wxMerchantService.selectById(rentContract.getMerchantId());
WxContractCustomers customers = wxAgileContractService.findCustomers(rentContract, rentContract.getId());
if(rentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue() ||
rentContract.getOperationType().intValue() == EnumContractOperationType.JINMAO.getCode().intValue()) {
rentContract.setFlowParams(generateFlowParams(merchant,EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT,EnumRentAgileType.getEnum(rentContract.getAgileType()), wxRentContract.getRemark(), wxRentContract.getId(),null));
rentContract.setFlowParams(generateFlowParams(customers,EnumFlowKey.NEW_RENT_CONTRACT, EnumFlowContractType.RENT,EnumRentAgileType.getEnum(rentContract.getAgileType()), wxRentContract.getRemark(), wxRentContract.getId(),null));
}else if(rentContract.getOperationType().intValue() == EnumContractOperationType.WHOLE.getCode().intValue()){
rentContract.setFlowParams(generateFlowParams(merchant,EnumFlowKey.NNEW_RENT_CONTRACT, EnumFlowContractType.WHOLE_SHOP, EnumRentAgileType.getEnum(rentContract.getAgileType()),wxRentContract.getRemark(), wxRentContract.getId(),wxRentContract.getPropertyId()));
rentContract.setFlowParams(generateFlowParams(customers,EnumFlowKey.NNEW_RENT_CONTRACT, EnumFlowContractType.WHOLE_SHOP, EnumRentAgileType.getEnum(rentContract.getAgileType()),wxRentContract.getRemark(), wxRentContract.getId(),wxRentContract.getPropertyId()));
}else {
return new ResultData(Result.ERROR,"合同操作类型非法。");
}
@@ -699,22 +572,6 @@ public class WxRentContractController extends WxContractBaseController {
statuss.add(EnumRentContractStatus.OUT_DATE.getCode());
wxRentContract.setStatuss(statuss);
}
if (null == wxRentContract.getIsPrivateMerchant()) {
wxRentContract.setIsPrivateMerchant(EnumYesOrNo.NO.getCode());
}
//如果是已售,则查询虚拟商户,并且店铺类型是商业的
if (wxRentContract.getIsPrivateMerchant()==2) {
wxRentContract.setIsPrivateMerchant(EnumYesOrNo.YES.getCode());
List<Integer> rentShopTypeList = new ArrayList<Integer>();
rentShopTypeList.add(EnumRentShopType.SHOP.getCode());
rentShopTypeList.add(EnumRentShopType.POINT.getCode());
wxRentContract.setPrivateRentShopTypeList(rentShopTypeList);
}else if (wxRentContract.getIsPrivateMerchant()==1) {
wxRentContract.setIsPrivateMerchant(EnumYesOrNo.YES.getCode());
wxRentContract.setPrivateRentShopType(EnumRentShopType.XIZILOU.getCode());
}
}
wxRentContract.setSortColumns(SortField.Createtime_DESC);
@@ -824,14 +681,6 @@ public class WxRentContractController extends WxContractBaseController {
return new ResultData();
}

@GetMapping("/getMerchants")
public ResultData getMerchants(@ModelAttribute WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::getMerchants");
wxRentContract.updateTenantInfo(getTenantInfo());
return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.getMerchants(wxRentContract));
}


@GetMapping("/getContractByContractNumber")
public ResultData getContractByContractNumber(@ModelAttribute WxRentContract wxRentContract) {
logger.debug("[" + getIpAddr() + "] WxRentContractController::getContractByContractNumber");
@@ -944,7 +793,6 @@ public class WxRentContractController extends WxContractBaseController {
}
WxPropertyContract bq = new WxPropertyContract();
bq.updateTenantInfo(rentContract);
bq.setMerchantId(contract.getMerchantId());
bq.setRentContractId(rentContract.getId());
bq.setOperationType(EnumContractOperationType.WHOLE.getCode());
//包括提前终止的,租金+物业合同是一对一的


+ 33
- 33
mallinkAdmin/src/main/java/com/iformall/controller/rent/WxAllBillController.java Zobrazit soubor

@@ -28,7 +28,7 @@ import com.iformall.domain.vo.WxBillExcelTemplate;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillJianMian;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.domain.vo.WxMerchantBillVo;
import com.iformall.domain.vo.WxShopBillVo;
import com.iformall.enums.EnumBillAllType;
import com.iformall.enums.EnumBillOweOrNearType;
import com.iformall.enums.EnumBillStatus;
@@ -109,7 +109,7 @@ public class WxAllBillController extends BillBaseController {
private WxFinancePrintService wxFinancePrintService;
/**
* 商户账单汇总计费列表
* 铺位账单汇总计费列表
* @param wxMerchant
* @param pageNum
* @param pageSize
@@ -119,40 +119,40 @@ public class WxAllBillController extends BillBaseController {
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData merchantBillList(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) {
wxMerchant.updateTenantInfo(getTenantInfo());
public ResultData merchantBillList(@ModelAttribute WxShop wxShop, Integer pageNum, Integer pageSize) {
wxShop.updateTenantInfo(getTenantInfo());
WxUserDataRule dataRule = this.getCurrentDataFloors();
if (null != dataRule) {
wxMerchant.setFloorForRule(dataRule.getFloorIds());
wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
wxMerchant.setShopTypeForRule(dataRule.getShopTypes());
wxShop.setFloorForRule(dataRule.getFloorIds());
wxShop.setBusinessForRule(dataRule.getBussinessIds());
wxShop.setShopTypeForRule(dataRule.getShopTypes());
}
return new ResultData(getVoPage(wxMerchant, pageNum, pageSize));
}
private PageInfo<WxMerchantBillVo> getVoPage(WxMerchant wxMerchant,Integer pageNum, Integer pageSize) {
Date starttime = wxMerchant.getStarttime();
Date enttime = wxMerchant.getEndtime();
wxMerchant.setStarttime(null);
wxMerchant.setEndtime(null);
if (null != wxMerchant.getOnlyOwe() && EnumYesOrNo.YES.getCode().intValue() == wxMerchant.getOnlyOwe().intValue()) {
wxMerchant.setOweBillBeforeDays(getOweBillBeforeDays());
List<Long> mids = billAllHelper.getOwdMerchantIds(wxMerchant, starttime, enttime);
if (null != mids && mids.size() > 0 ) {
wxMerchant.setIds(mids);;
return new ResultData(getVoPage(wxShop, pageNum, pageSize));
}
private PageInfo<WxShopBillVo> getVoPage(WxShop wxShop,Integer pageNum, Integer pageSize) {
Date starttime = wxShop.getStarttime();
Date enttime = wxShop.getEndtime();
wxShop.setStarttime(null);
wxShop.setEndtime(null);
if (null != wxShop.getOnlyOwe() && EnumYesOrNo.YES.getCode().intValue() == wxShop.getOnlyOwe().intValue()) {
wxShop.setOweBillBeforeDays(getOweBillBeforeDays());
List<Long> sids = billAllHelper.getOwdShopIds(wxShop, starttime, enttime);
if (null != sids && sids.size() > 0 ) {
wxShop.setIds(sids);;
}else {
wxMerchant.setId(-1L);
wxShop.setId(-1L);
}
}
wxMerchant.setIsPreview(EnumYesOrNo.NO.getCode());
PageInfo<WxMerchant> merchantPage = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize);
PageInfo<WxMerchantBillVo> page = new PageInfo<WxMerchantBillVo>();
wxShop.setIsPreview(EnumYesOrNo.NO.getCode());
PageInfo<WxShop> shopPage = wxShopSerivce.listAsPage(wxShop, pageNum, pageSize);
PageInfo<WxShopBillVo> page = new PageInfo<WxShopBillVo>();
page.setPageNum(pageNum);
page.setPageSize(pageSize);
if (null != merchantPage && null != merchantPage.getList() && merchantPage.getList().size() > 0 ) {
List<WxMerchantBillVo> retList = new ArrayList<WxMerchantBillVo>();
if (null != shopPage && null != shopPage.getList() && shopPage.getList().size() > 0 ) {
List<WxShopBillVo> retList = new ArrayList<WxShopBillVo>();
for (int i = 0 ; i < merchantPage.getList().size(); i ++) {
WxMerchantBillVo vo = new WxMerchantBillVo();
WxShopBillVo vo = new WxShopBillVo();
WxMerchant m = merchantPage.getList().get(i);
vo.setMerchantId(m.getId());
vo.setMerchantName(m.getName());
@@ -195,8 +195,8 @@ public class WxAllBillController extends BillBaseController {
wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
wxMerchant.setShopTypeForRule(dataRule.getShopTypes());
}
PageInfo<WxMerchantBillVo> page = getVoPage(wxMerchant, 1, 10000);
excelService.exportExcel(page.getList(), null, "商户账单总览数据", WxMerchantBillVo.class, "商户账单总览数据.xlsx", response, false);
PageInfo<WxShopBillVo> page = getVoPage(wxMerchant, 1, 10000);
excelService.exportExcel(page.getList(), null, "商户账单总览数据", WxShopBillVo.class, "商户账单总览数据.xlsx", response, false);
}
/**
@@ -209,7 +209,7 @@ public class WxAllBillController extends BillBaseController {
if (null == wxMerchant.getId()) {
return new ResultData(Result.ERROR,"请选择商户");
}
WxMerchantBillVo vo = getMerchantBillVo(wxMerchant);
WxShopBillVo vo = getMerchantBillVo(wxMerchant);
if (null == vo) {
return new ResultData();
}
@@ -217,7 +217,7 @@ public class WxAllBillController extends BillBaseController {
return new ResultData(vo);
}
private WxMerchantBillVo getMerchantBillVo( WxMerchant wxMerchant) {
private WxShopBillVo getMerchantBillVo( WxMerchant wxMerchant) {
wxMerchant.updateTenantInfo(getTenantInfo());
Date starttime = wxMerchant.getStarttime();
Date enttime = wxMerchant.getEndtime();
@@ -227,7 +227,7 @@ public class WxAllBillController extends BillBaseController {
if (null == m) {
return null;
}
WxMerchantBillVo vo = new WxMerchantBillVo();
WxShopBillVo vo = new WxShopBillVo();
vo.setMerchantId(m.getId());
vo.setMerchantName(m.getName());
vo.setShopNumber(billAllHelper.getMerchantShopNumber(m));
@@ -279,7 +279,7 @@ public class WxAllBillController extends BillBaseController {
}
merchant.updateTenantInfo(getTenantInfo());
WxPayAccountBill ab = wxPayAccountBillService.getByTenantInfo(merchant);
WxMerchantBillVo vo = getMerchantBillVo(merchant);
WxShopBillVo vo = getMerchantBillVo(merchant);
if (null != ab) {
vo.setMallBankAccount(ab.getBankCardId());
vo.setMallBankAccountName(ab.getBankName());


+ 270
- 0
mallinkAdmin/src/main/resources/db/migration/V202411000000001.sql Zobrazit soubor

@@ -0,0 +1,270 @@
alter table wx_rent_contract drop column merchant_id;
alter table wx_rent_contract drop column merchant_name;
alter table wx_rent_contract drop column brand;
alter table wx_rent_contract drop column business_id;
alter table wx_rent_contract drop column shop_type;
alter table wx_rent_contract drop column shop_type_str;
alter table wx_rent_contract drop column property_name;
alter table wx_rent_contract drop column property_fee;
alter table wx_rent_contract drop column fee_cycle;
alter table wx_rent_contract drop column water_fee;
alter table wx_rent_contract drop column electricity_fees;
alter table wx_rent_contract drop column first_party_bank_info;
alter table wx_rent_contract drop column second_party_bank_info;
alter table wx_rent_contract drop column second_party_tax_info;
alter table wx_rent_contract drop column shop_type_sub;
alter table wx_rent_contract drop column lease_purpose;
alter table wx_rent_contract drop column contractual_rules;
alter table wx_rent_contract drop column delivery_date;
alter table wx_rent_contract drop column delivery_grace_period;
alter table wx_rent_contract drop column opening_date;
alter table wx_rent_contract drop column business_hours;
alter table wx_rent_contract drop column scope_metre;
alter table wx_rent_contract drop column pay_date;

alter table wx_rent_contract_agile_deposit drop column merchant_id;
alter table wx_rent_contract_agile_un_deposit drop column merchant_id;
alter table wx_rent_contract_agile_un_deposit_item drop column merchant_id;

#此处要把万星的虚拟商户给删掉 soho的
alter table wx_rent_contract drop column is_private_merchant;
alter table wx_rent_contract drop column private_rent_shop_type;

#此处要把万星的合同,根据商户的刷成customers_id (商业和soho的)
alter table wx_rent_contract add column customers_id bigint(20) not null comment '客户ID';


CREATE TABLE `wx_contract_customers` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID',
`parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID',
`principal_type` int(20) NOT NULL COMMENT '主体类型',
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称',
`phone` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '电话',
`legal_person` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '法人',
`id_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '身份证号',
`sex` int(1) DEFAULT NULL COMMENT '性别',
`link_person` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`update_date` datetime NOT NULL COMMENT '更新时间',
`status` int(1) NOT NULL DEFAULT '0' COMMENT '状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='合同意向客户';

CREATE TABLE `wx_contract_shop` (
`id` bigint(20) NOT NULL COMMENT '主键ID',
`tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID',
`parent_tenant_id` varchar(5) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID',
`contract_id` bigint(20) NOT NULL COMMENT '合同编号',
`shop_id` bigint(20) NOT NULL COMMENT '店铺编号',
`create_date` datetime NOT NULL COMMENT '创建时间',
`update_date` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQUE_R_S` (`tenant_id`,`contract_id`,`shop_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='合同铺位关联';



alter table wx_all_bill_0 drop column merchant_id;
alter table wx_all_bill_1 drop column merchant_id;
alter table wx_all_bill_2 drop column merchant_id;
alter table wx_all_bill_3 drop column merchant_id;
alter table wx_all_bill_4 drop column merchant_id;
alter table wx_all_bill_5 drop column merchant_id;
alter table wx_all_bill_6 drop column merchant_id;
alter table wx_all_bill_7 drop column merchant_id;
alter table wx_all_bill_8 drop column merchant_id;
alter table wx_all_bill_9 drop column merchant_id;
alter table wx_all_bill_10 drop column merchant_id;
alter table wx_all_bill_11 drop column merchant_id;
alter table wx_all_bill_12 drop column merchant_id;
alter table wx_all_bill_13 drop column merchant_id;
alter table wx_all_bill_14 drop column merchant_id;
alter table wx_all_bill_15 drop column merchant_id;
alter table wx_all_bill_16 drop column merchant_id;
alter table wx_all_bill_17 drop column merchant_id;
alter table wx_all_bill_18 drop column merchant_id;
alter table wx_all_bill_19 drop column merchant_id;
alter table wx_all_bill_20 drop column merchant_id;
alter table wx_all_bill_21 drop column merchant_id;
alter table wx_all_bill_22 drop column merchant_id;
alter table wx_all_bill_23 drop column merchant_id;
alter table wx_all_bill_24 drop column merchant_id;
alter table wx_all_bill_25 drop column merchant_id;
alter table wx_all_bill_26 drop column merchant_id;
alter table wx_all_bill_27 drop column merchant_id;
alter table wx_all_bill_28 drop column merchant_id;
alter table wx_all_bill_29 drop column merchant_id;
alter table wx_all_bill_30 drop column merchant_id;
alter table wx_all_bill_31 drop column merchant_id;
alter table wx_all_bill_32 drop column merchant_id;
alter table wx_all_bill_33 drop column merchant_id;
alter table wx_all_bill_34 drop column merchant_id;
alter table wx_all_bill_35 drop column merchant_id;
alter table wx_all_bill_36 drop column merchant_id;
alter table wx_all_bill_37 drop column merchant_id;
alter table wx_all_bill_38 drop column merchant_id;
alter table wx_all_bill_39 drop column merchant_id;
alter table wx_all_bill_40 drop column merchant_id;
alter table wx_all_bill_41 drop column merchant_id;
alter table wx_all_bill_42 drop column merchant_id;
alter table wx_all_bill_43 drop column merchant_id;
alter table wx_all_bill_44 drop column merchant_id;
alter table wx_all_bill_45 drop column merchant_id;
alter table wx_all_bill_46 drop column merchant_id;
alter table wx_all_bill_47 drop column merchant_id;
alter table wx_all_bill_48 drop column merchant_id;
alter table wx_all_bill_49 drop column merchant_id;
alter table wx_all_bill_50 drop column merchant_id;
alter table wx_all_bill_51 drop column merchant_id;
alter table wx_all_bill_52 drop column merchant_id;
alter table wx_all_bill_53 drop column merchant_id;
alter table wx_all_bill_54 drop column merchant_id;
alter table wx_all_bill_55 drop column merchant_id;
alter table wx_all_bill_56 drop column merchant_id;
alter table wx_all_bill_57 drop column merchant_id;
alter table wx_all_bill_58 drop column merchant_id;
alter table wx_all_bill_59 drop column merchant_id;
alter table wx_all_bill_60 drop column merchant_id;
alter table wx_all_bill_61 drop column merchant_id;
alter table wx_all_bill_62 drop column merchant_id;
alter table wx_all_bill_63 drop column merchant_id;
alter table wx_all_bill_64 drop column merchant_id;
alter table wx_all_bill_65 drop column merchant_id;
alter table wx_all_bill_66 drop column merchant_id;
alter table wx_all_bill_67 drop column merchant_id;
alter table wx_all_bill_68 drop column merchant_id;
alter table wx_all_bill_69 drop column merchant_id;
alter table wx_all_bill_70 drop column merchant_id;
alter table wx_all_bill_71 drop column merchant_id;
alter table wx_all_bill_72 drop column merchant_id;
alter table wx_all_bill_73 drop column merchant_id;
alter table wx_all_bill_74 drop column merchant_id;
alter table wx_all_bill_75 drop column merchant_id;
alter table wx_all_bill_76 drop column merchant_id;
alter table wx_all_bill_77 drop column merchant_id;
alter table wx_all_bill_78 drop column merchant_id;
alter table wx_all_bill_79 drop column merchant_id;
alter table wx_all_bill_80 drop column merchant_id;
alter table wx_all_bill_81 drop column merchant_id;
alter table wx_all_bill_82 drop column merchant_id;
alter table wx_all_bill_83 drop column merchant_id;
alter table wx_all_bill_84 drop column merchant_id;
alter table wx_all_bill_85 drop column merchant_id;
alter table wx_all_bill_86 drop column merchant_id;
alter table wx_all_bill_87 drop column merchant_id;
alter table wx_all_bill_88 drop column merchant_id;
alter table wx_all_bill_89 drop column merchant_id;
alter table wx_all_bill_90 drop column merchant_id;
alter table wx_all_bill_91 drop column merchant_id;
alter table wx_all_bill_92 drop column merchant_id;
alter table wx_all_bill_93 drop column merchant_id;
alter table wx_all_bill_94 drop column merchant_id;
alter table wx_all_bill_95 drop column merchant_id;
alter table wx_all_bill_96 drop column merchant_id;
alter table wx_all_bill_97 drop column merchant_id;
alter table wx_all_bill_98 drop column merchant_id;
alter table wx_all_bill_99 drop column merchant_id;

alter table wx_all_bill_0 modify column shop_id bigint(20) not null;
alter table wx_all_bill_1 modify column shop_id bigint(20) not null;
alter table wx_all_bill_2 modify column shop_id bigint(20) not null;
alter table wx_all_bill_3 modify column shop_id bigint(20) not null;
alter table wx_all_bill_4 modify column shop_id bigint(20) not null;
alter table wx_all_bill_5 modify column shop_id bigint(20) not null;
alter table wx_all_bill_6 modify column shop_id bigint(20) not null;
alter table wx_all_bill_7 modify column shop_id bigint(20) not null;
alter table wx_all_bill_8 modify column shop_id bigint(20) not null;
alter table wx_all_bill_9 modify column shop_id bigint(20) not null;
alter table wx_all_bill_10 modify column shop_id bigint(20) not null;
alter table wx_all_bill_11 modify column shop_id bigint(20) not null;
alter table wx_all_bill_12 modify column shop_id bigint(20) not null;
alter table wx_all_bill_13 modify column shop_id bigint(20) not null;
alter table wx_all_bill_14 modify column shop_id bigint(20) not null;
alter table wx_all_bill_15 modify column shop_id bigint(20) not null;
alter table wx_all_bill_16 modify column shop_id bigint(20) not null;
alter table wx_all_bill_17 modify column shop_id bigint(20) not null;
alter table wx_all_bill_18 modify column shop_id bigint(20) not null;
alter table wx_all_bill_19 modify column shop_id bigint(20) not null;
alter table wx_all_bill_20 modify column shop_id bigint(20) not null;
alter table wx_all_bill_21 modify column shop_id bigint(20) not null;
alter table wx_all_bill_22 modify column shop_id bigint(20) not null;
alter table wx_all_bill_23 modify column shop_id bigint(20) not null;
alter table wx_all_bill_24 modify column shop_id bigint(20) not null;
alter table wx_all_bill_25 modify column shop_id bigint(20) not null;
alter table wx_all_bill_26 modify column shop_id bigint(20) not null;
alter table wx_all_bill_27 modify column shop_id bigint(20) not null;
alter table wx_all_bill_28 modify column shop_id bigint(20) not null;
alter table wx_all_bill_29 modify column shop_id bigint(20) not null;
alter table wx_all_bill_30 modify column shop_id bigint(20) not null;
alter table wx_all_bill_31 modify column shop_id bigint(20) not null;
alter table wx_all_bill_32 modify column shop_id bigint(20) not null;
alter table wx_all_bill_33 modify column shop_id bigint(20) not null;
alter table wx_all_bill_34 modify column shop_id bigint(20) not null;
alter table wx_all_bill_35 modify column shop_id bigint(20) not null;
alter table wx_all_bill_36 modify column shop_id bigint(20) not null;
alter table wx_all_bill_37 modify column shop_id bigint(20) not null;
alter table wx_all_bill_38 modify column shop_id bigint(20) not null;
alter table wx_all_bill_39 modify column shop_id bigint(20) not null;
alter table wx_all_bill_40 modify column shop_id bigint(20) not null;
alter table wx_all_bill_41 modify column shop_id bigint(20) not null;
alter table wx_all_bill_42 modify column shop_id bigint(20) not null;
alter table wx_all_bill_43 modify column shop_id bigint(20) not null;
alter table wx_all_bill_44 modify column shop_id bigint(20) not null;
alter table wx_all_bill_45 modify column shop_id bigint(20) not null;
alter table wx_all_bill_46 modify column shop_id bigint(20) not null;
alter table wx_all_bill_47 modify column shop_id bigint(20) not null;
alter table wx_all_bill_48 modify column shop_id bigint(20) not null;
alter table wx_all_bill_49 modify column shop_id bigint(20) not null;
alter table wx_all_bill_50 modify column shop_id bigint(20) not null;
alter table wx_all_bill_51 modify column shop_id bigint(20) not null;
alter table wx_all_bill_52 modify column shop_id bigint(20) not null;
alter table wx_all_bill_53 modify column shop_id bigint(20) not null;
alter table wx_all_bill_54 modify column shop_id bigint(20) not null;
alter table wx_all_bill_55 modify column shop_id bigint(20) not null;
alter table wx_all_bill_56 modify column shop_id bigint(20) not null;
alter table wx_all_bill_57 modify column shop_id bigint(20) not null;
alter table wx_all_bill_58 modify column shop_id bigint(20) not null;
alter table wx_all_bill_59 modify column shop_id bigint(20) not null;
alter table wx_all_bill_60 modify column shop_id bigint(20) not null;
alter table wx_all_bill_61 modify column shop_id bigint(20) not null;
alter table wx_all_bill_62 modify column shop_id bigint(20) not null;
alter table wx_all_bill_63 modify column shop_id bigint(20) not null;
alter table wx_all_bill_64 modify column shop_id bigint(20) not null;
alter table wx_all_bill_65 modify column shop_id bigint(20) not null;
alter table wx_all_bill_66 modify column shop_id bigint(20) not null;
alter table wx_all_bill_67 modify column shop_id bigint(20) not null;
alter table wx_all_bill_68 modify column shop_id bigint(20) not null;
alter table wx_all_bill_69 modify column shop_id bigint(20) not null;
alter table wx_all_bill_70 modify column shop_id bigint(20) not null;
alter table wx_all_bill_71 modify column shop_id bigint(20) not null;
alter table wx_all_bill_72 modify column shop_id bigint(20) not null;
alter table wx_all_bill_73 modify column shop_id bigint(20) not null;
alter table wx_all_bill_74 modify column shop_id bigint(20) not null;
alter table wx_all_bill_75 modify column shop_id bigint(20) not null;
alter table wx_all_bill_76 modify column shop_id bigint(20) not null;
alter table wx_all_bill_77 modify column shop_id bigint(20) not null;
alter table wx_all_bill_78 modify column shop_id bigint(20) not null;
alter table wx_all_bill_79 modify column shop_id bigint(20) not null;
alter table wx_all_bill_80 modify column shop_id bigint(20) not null;
alter table wx_all_bill_81 modify column shop_id bigint(20) not null;
alter table wx_all_bill_82 modify column shop_id bigint(20) not null;
alter table wx_all_bill_83 modify column shop_id bigint(20) not null;
alter table wx_all_bill_84 modify column shop_id bigint(20) not null;
alter table wx_all_bill_85 modify column shop_id bigint(20) not null;
alter table wx_all_bill_86 modify column shop_id bigint(20) not null;
alter table wx_all_bill_87 modify column shop_id bigint(20) not null;
alter table wx_all_bill_88 modify column shop_id bigint(20) not null;
alter table wx_all_bill_89 modify column shop_id bigint(20) not null;
alter table wx_all_bill_90 modify column shop_id bigint(20) not null;
alter table wx_all_bill_91 modify column shop_id bigint(20) not null;
alter table wx_all_bill_92 modify column shop_id bigint(20) not null;
alter table wx_all_bill_93 modify column shop_id bigint(20) not null;
alter table wx_all_bill_94 modify column shop_id bigint(20) not null;
alter table wx_all_bill_95 modify column shop_id bigint(20) not null;
alter table wx_all_bill_96 modify column shop_id bigint(20) not null;
alter table wx_all_bill_97 modify column shop_id bigint(20) not null;
alter table wx_all_bill_98 modify column shop_id bigint(20) not null;
alter table wx_all_bill_99 modify column shop_id bigint(20) not null;



+ 10
- 0
mallinkBApi/src/main/java/com/iformall/controller/BaseController.java Zobrazit soubor

@@ -3,6 +3,7 @@ package com.iformall.controller;

import com.iformall.common.ErrorCode;
import com.iformall.common.SysConfigConstant;
import com.iformall.domain.dto.WxRentLoginUserDTO;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.BaseCUserEntity;
import com.iformall.domain.po.base.TenantEntity;
@@ -230,4 +231,13 @@ public class BaseController {
// user.setIsAdmin(1);
// return user;
}
public WxRentLoginUserDTO getRentLoginUser() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
WxRentLoginUserDTO dto = (WxRentLoginUserDTO)request.getAttribute(Constant.REQUEST_SHOP_USER_KEY);
if (null == dto) {
throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"业主/租户登录用户不存在");
}
return dto;
}
}

+ 64
- 43
mallinkBApi/src/main/java/com/iformall/controller/WxBillController.java Zobrazit soubor

@@ -7,6 +7,7 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.common.SysConfigConstant;
import com.iformall.domain.dto.WxBillPayDTO;
import com.iformall.domain.dto.WxRentLoginUserDTO;
import com.iformall.domain.po.SysConfig;
import com.iformall.domain.po.WxBillAction;
import com.iformall.domain.po.WxAllBill;
@@ -14,7 +15,10 @@ import com.iformall.domain.po.WxFlowModel;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxMerchantBUser;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.po.WxShopUsers;
import com.iformall.domain.po.WxUserDataRule;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.enums.EnumBillAllType;
import com.iformall.enums.EnumBillOweOrNearType;
@@ -23,6 +27,7 @@ import com.iformall.enums.EnumBillUpdateType;
import com.iformall.enums.EnumFilterSettle;
import com.iformall.enums.EnumFlowKey;
import com.iformall.enums.EnumMerchantStatus;
import com.iformall.enums.EnumShopUsersStatus;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.service.SysConfigService;
import com.iformall.service.WxAllBillService;
@@ -31,6 +36,7 @@ import com.iformall.service.WxBillSettleService;
import com.iformall.service.WxFlowService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.WxShopService;
import com.iformall.service.helper.WxBillAllHelper;
import com.iformall.service.payBill.PayBillServiceFactory;
import com.iformall.utils.Constant;
@@ -60,12 +66,8 @@ public class WxBillController extends BaseController {

private final Logger logger = LoggerFactory.getLogger(this.getClass());

//@Autowired
//WxBillAllService wxBillAllService;
@Autowired
WxMerchantService wxMerchantService;
//@Autowired
//WxBillSettleService wxBillSettleService;
WxShopService wxShopService;
@Autowired
private WxFlowService wxFlowService;
@Autowired
@@ -111,6 +113,22 @@ public class WxBillController extends BaseController {
return new ResultData(tmap);
}
private WxShop getCurrentShopList() {
WxRentLoginUserDTO user = this.getRentLoginUser();
WxShopUsers su = new WxShopUsers();
su.updateTenantInfo(user);
su.setPhone(user.getPhone());
su.setStatus(EnumShopUsersStatus.LIVE.getCode());
List<Long> shopIds = wxShopService.getUserShopIds(su);
if (null == shopIds || shopIds.size() <= 0 ) {
return null;
}else {
WxShop shop = new WxShop();
shop.updateTenantInfo(user);
shop.setIds(shopIds);
return shop;
}
}
/**
* 商户催缴账单列表
@@ -120,11 +138,12 @@ public class WxBillController extends BaseController {
* @return
*/
@GetMapping("notifyList")
public ResultData notifyList(@ModelAttribute WxMerchant wxMerchant) {
WxMerchantBUser buser = this.getLoginBUser();
wxMerchant.setId(buser.getMerchantId());
wxMerchant.updateTenantInfo(buser);
return new ResultData(billAllHelper.getBillNotifyList(wxMerchant,EnumYesOrNo.YES.getCode()));
public ResultData notifyList() {
WxShop shop = getCurrentShopList();
if (null == shop) {
return new ResultData();
}
return new ResultData(billAllHelper.getBillNotifyList(shop,EnumYesOrNo.YES.getCode()));
}
/**
@@ -135,12 +154,13 @@ public class WxBillController extends BaseController {
* @return
*/
@GetMapping("oweBillList")
public ResultData oweBillList(@ModelAttribute WxMerchant wxMerchant) {
WxMerchantBUser buser = this.getLoginBUser();
wxMerchant.setId(buser.getMerchantId());
wxMerchant.setOweBillBeforeDays(getOweBillBeforeDays());
wxMerchant.updateTenantInfo(buser);
return new ResultData(billAllHelper.getBillNotifyList(wxMerchant,null));
public ResultData oweBillList() {
WxShop shop = getCurrentShopList();
if (null == shop) {
return new ResultData();
}
shop.setOweBillBeforeDays(getOweBillBeforeDays());
return new ResultData(billAllHelper.getBillNotifyList(shop,null));
}
private Integer getOweBillBeforeDays() {
@@ -160,13 +180,14 @@ public class WxBillController extends BaseController {
* @return
*/
@GetMapping("nearBillList")
public ResultData nearBillList(@ModelAttribute WxMerchant wxMerchant) {
WxMerchantBUser buser = this.getLoginBUser();
wxMerchant.updateTenantInfo(buser);
wxMerchant.setId(buser.getMerchantId());
wxMerchant.setOweBillBeforeDays(getOweBillBeforeDays());
wxMerchant.setNearBillBeforeDays(getNearBillBeforeDays());
return new ResultData(billAllHelper.getBillNotifyList(wxMerchant,null));
public ResultData nearBillList() {
WxShop shop = getCurrentShopList();
if (null == shop) {
return new ResultData();
}
shop.setOweBillBeforeDays(getOweBillBeforeDays());
shop.setNearBillBeforeDays(getNearBillBeforeDays());
return new ResultData(billAllHelper.getBillNotifyList(shop,null));
}
private Integer getNearBillBeforeDays() {
@@ -180,28 +201,30 @@ public class WxBillController extends BaseController {

@ApiOperation("查询账单")
@RequestMapping("list")
public ResultData listBill(@ModelAttribute WxMerchant wxMerchant,Integer pageNum, Integer pageSize) {
if (null != wxMerchant.getOnlyOweOrNear()) {
if (EnumBillOweOrNearType.OWE.getCode().intValue() == wxMerchant.getOnlyOweOrNear().intValue()) {
wxMerchant.setOweBillBeforeDays(getOweBillBeforeDays());
}else if (EnumBillOweOrNearType.NEAR.getCode().intValue() == wxMerchant.getOnlyOweOrNear().intValue()) {
wxMerchant.setOweBillBeforeDays(getOweBillBeforeDays());
wxMerchant.setNearBillBeforeDays(getNearBillBeforeDays());
public ResultData listBill(@ModelAttribute WxShop wxShop,Integer pageNum, Integer pageSize) {
WxShop shop0 = getCurrentShopList();
if (null == shop0) {
return new ResultData();
}
if (null != wxShop.getOnlyOweOrNear()) {
if (EnumBillOweOrNearType.OWE.getCode().intValue() == wxShop.getOnlyOweOrNear().intValue()) {
shop0.setOweBillBeforeDays(getOweBillBeforeDays());
}else if (EnumBillOweOrNearType.NEAR.getCode().intValue() == wxShop.getOnlyOweOrNear().intValue()) {
shop0.setOweBillBeforeDays(getOweBillBeforeDays());
shop0.setNearBillBeforeDays(getNearBillBeforeDays());
}
}
wxMerchant.setId(this.getLoginBUser().getMerchantId());
wxMerchant.updateTenantInfo(getTenantInfo());
return new ResultData(billAllHelper.getBillList(wxMerchant,pageNum,pageSize));
return new ResultData(billAllHelper.getBillList(shop0,pageNum,pageSize));
}
@ApiOperation("账单详情")
@GetMapping("detail")
public ResultData detail(@ModelAttribute WxMerchant wxMerchant,Integer billTypeValue,Long billId) {
if (null == wxMerchant) {
wxMerchant = new WxMerchant();
public ResultData detail(Integer billTypeValue,Long billId) {
WxShop shop = getCurrentShopList();
if (null == shop) {
return new ResultData();
}
wxMerchant.updateTenantInfo(getTenantInfo());
return new ResultData(wxAllBillService.getById(wxMerchant,billId));
return new ResultData(wxAllBillService.getById(shop,billId));
}
@ApiOperation("账单操作记录列表")
@@ -254,10 +277,8 @@ public class WxBillController extends BaseController {
return new ResultData(Result.ERROR,"分类非法");
}
}
WxMerchant wxMerchant = new WxMerchant();
wxMerchant.setId(this.getLoginBUser().getMerchantId());
wxMerchant.updateTenantInfo(getTenantInfo());
WxAllBill billdetail = billAllHelper.getBillDetail(btype, wxMerchant,billId);
TenantEntity tenantEntity = getTenantInfo();
WxAllBill billdetail = billAllHelper.getBillDetail(tenantEntity,billId);
if (null == billdetail) {
return new ResultData(Result.ERROR,"账单支付未查询到");
}
@@ -265,7 +286,7 @@ public class WxBillController extends BaseController {
// if (owe.compareTo(new BigDecimal(payMoney)) < 0) {
// return new ResultData(Result.ERROR,"支付金额大于欠费金额,请刷新账单后再支付");
// }
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(wxMerchant);
WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(tenantEntity);
if (null == wxPayAccountBill || null == wxPayAccountBill.getPayChannel()) {
return new ResultData(Result.ERROR,"账单支付配置错误,请联系管理员");
}


+ 23
- 13
mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java Zobrazit soubor

@@ -51,6 +51,9 @@ public class WxInfoController extends BaseController {

@Autowired
MallUserInfoService mallUserInfoService;
@Autowired
WxShopService wxShopService;

@Autowired
MallUserRoleService mallUserRoleService;
@@ -249,6 +252,7 @@ public class WxInfoController extends BaseController {
String iv = map.get("iv");
String openId = map.get("openId");
String session_key = map.get("session_key");
String shopUser = map.get("shopUser");

//登录凭证不能为空
if (StringUtils.isBlank(encryptedData)) {
@@ -284,21 +288,27 @@ public class WxInfoController extends BaseController {
if (null != phone) {
resultMap.put("phone", phone);

MallUserInfo user = mallUserInfoService.getByPhone(phone, tenantEntity);
if(user == null) {
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),"手机号["+phone+"]非绑定后台管理员账号", resultMap);
}
if (mallUserRoleService.checkIsMobileAdmin(user)) {
resultMap.put("phone", user.getPhone());
resultMap.put("admin", "1");

user.setBopenId(buser.getOpenId());
mallUserInfoService.saveOrUpdate(user);
resultMap.put("token", user.getId().toString()+Constant.TOKEN_ADMIN_END);
if (StringUtils.isBlank(shopUser) || (!"1".equals(shopUser))) {
MallUserInfo user = mallUserInfoService.getByPhone(phone, tenantEntity);
if(user == null) {
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),"手机号["+phone+"]非绑定后台管理员账号", resultMap);
}
if (mallUserRoleService.checkIsMobileAdmin(user)) {
resultMap.put("phone", user.getPhone());
resultMap.put("admin", "1");

user.setBopenId(buser.getOpenId());
mallUserInfoService.saveOrUpdate(user);
resultMap.put("token", user.getId().toString()+Constant.TOKEN_ADMIN_END);
return new ResultData(resultMap);
} else {
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),user.getName()+"不是超管或者没有"+EnumMenuType.MOBILE_ADMIN.getMessage()+"的权限", resultMap);
}
}else {
resultMap.put("token", phone+"_"+buser.getTenantId()+"_"+StringUtils.trimToEmpty(buser.getParentTenantId())+Constant.TOKEN_SHOP_USER_END);
return new ResultData(resultMap);
} else {
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),user.getName()+"不是超管或者没有"+EnumMenuType.MOBILE_ADMIN.getMessage()+"的权限", resultMap);
}
} else {
return new ResultData(ErrorCode.PHONE_DECODE_ERR, resultMap);
}


+ 3
- 3
mallinkBApi/src/main/java/com/iformall/controller/WxMallAdminController.java Zobrazit soubor

@@ -176,9 +176,9 @@ public class WxMallAdminController extends BaseController {
* @return
*/
@GetMapping("notifyList")
public ResultData notifyList(@ModelAttribute WxMerchant wxMerchant) {
setQueryDataRule(wxMerchant);
return new ResultData(billAllHelper.getBillNotifyList(wxMerchant,EnumYesOrNo.YES.getCode()));
public ResultData notifyList(@ModelAttribute WxShop wxShop) {
setQueryDataRule(wxShop);
return new ResultData(billAllHelper.getBillNotifyList(wxShop,EnumYesOrNo.YES.getCode()));
}
private Integer getOweBillBeforeDays() {


+ 24
- 1
mallinkBApi/src/main/java/com/iformall/interceptor/AuthorizationInterceptor.java Zobrazit soubor

@@ -6,6 +6,7 @@ import com.iformall.annotation.AuthIgnore;
import com.iformall.annotation.TenantIgnore;
import com.iformall.common.ErrorCode;
import com.iformall.common.TenantThreadLocal;
import com.iformall.domain.dto.WxRentLoginUserDTO;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxMall;
import com.iformall.domain.po.WxMerchantBUser;
@@ -93,6 +94,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
String tenantId = null;
String parenTenantId = null;
MallUserInfo adminUser = null;
WxRentLoginUserDTO rentLoginUser = null;
if (StringUtils.isNotBlank(token)) {
//商管操作台
if(token.endsWith(Constant.TOKEN_ADMIN_END)){
@@ -102,6 +104,15 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " adminUserId失效,请重新登录");
}
request.setAttribute(Constant.REQUEST_MALL_USER_KEY, adminUser);
//租赁缴费
}else if (token.endsWith(Constant.TOKEN_SHOP_USER_END)) {
String[] tokens = token.split(":");
String[] contents = tokens[0].split("_");
rentLoginUser = new WxRentLoginUserDTO();
rentLoginUser.setPhone(contents[0]);
rentLoginUser.setTenantId(contents[1]);
rentLoginUser.setParentTenantId(StringUtils.trimToNull(contents[2]));
request.setAttribute(Constant.REQUEST_SHOP_USER_KEY, rentLoginUser);
}else {
BaseCUserEntity user = cUserTokenService.getBByToken(token);
if (user == null || user.getExpireTime().getTime() < System.currentTimeMillis()) {
@@ -117,7 +128,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
buser = wxMerchantBUserService.getById(Long.parseLong(bid));
}

if (buser == null && adminUser == null) {
if (buser == null && adminUser == null && null == rentLoginUser) {
throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " 登录失效,请重新登录");
}

@@ -138,6 +149,11 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
if (StringUtils.isNotBlank(adminUser.getParentTenantId())) {
parenTenantId = adminUser.getParentTenantId();
}
}else if (null != rentLoginUser) {
tenantId = rentLoginUser.getTenantId();
if (StringUtils.isNotBlank(rentLoginUser.getParentTenantId())) {
parenTenantId = rentLoginUser.getParentTenantId();
}
}
}

@@ -153,11 +169,18 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
&& !tenantId.equals(adminUser.getParentTenantId())){
throw new MallinkException(ErrorCode.SYS_AUTH_ERROR);
}
}else if (null != rentLoginUser) {
if(!tenantId.equals(rentLoginUser.getTenantId())
&& !rentLoginUser.getTenantId().equals(parenTenantId)
&& !tenantId.equals(rentLoginUser.getParentTenantId())){
throw new MallinkException(ErrorCode.SYS_AUTH_ERROR);
}
}

if (null != buser) {
request.setAttribute(Constant.LOGIN_B_USER_KEY, buser.getId());
}
request.setAttribute(Constant.TENANT_ID, tenantId);
request.setAttribute(Constant.PARENT_TENANT_ID, parenTenantId);


+ 16
- 0
mallinkService/src/main/java/com/iformall/domain/dto/WxRentLoginUserDTO.java Zobrazit soubor

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

import com.iformall.domain.po.base.TenantEntity;

import lombok.Data;

/**
* 获取积分DTO
*
* @author xmzhao71
* @date 2023-08-31
*/
@Data
public class WxRentLoginUserDTO extends TenantEntity{
private String phone;
}

+ 5
- 17
mallinkService/src/main/java/com/iformall/domain/po/WxAllBill.java Zobrazit soubor

@@ -35,13 +35,12 @@ public class WxAllBill extends TenantEntity {

protected Long id;

@io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId")
public Long merchantId;
@io.swagger.annotations.ApiModelProperty(value="归属商铺ID",name="shopId")
public Long shopId;
@Excel(name = "商铺号", width = 20, orderNum = "1")
public String shopNumber;
@Excel(name = "商户名称", width = 20, orderNum = "2")
@TableField(exist = false)
public String merchantName;
@Excel(name = "制单时间", format = "yyyy-MM-dd HH:mm:ss", width = 20, orderNum = "13")
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime")
public Date createtime;
@@ -263,12 +262,6 @@ public class WxAllBill extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="租金里面的营业管理费",name="operatingManageFeeNeedPay")
public String operatingManageFeeNeedPay;
@io.swagger.annotations.ApiModelProperty(value="归属商铺ID,非必须",name="shopId")
public Long shopId;
@Excel(name = "商铺号", width = 20, orderNum = "1")
public String shopNumber;
@io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "shopInfo")
public String shopInfo;
@@ -346,9 +339,6 @@ public class WxAllBill extends TenantEntity {
.setScale(decimalSize, RoundingMode.HALF_UP).toPlainString();
}
@TableField(exist = false)
public List<Long> merchantIdList;
@TableField(exist = false)
public String month;
@@ -392,8 +382,6 @@ public class WxAllBill extends TenantEntity {
@TableField(exist = false)
List<WxBillFeesStandardsListVo> unFixedbillFeesStandardsList;
@TableField(exist = false)
private Integer hasMerchant;
@TableField(exist = false)
private Integer hasParentBillId;
@TableField(exist = false)


+ 90
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxContractCustomers.java Zobrazit soubor

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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.common.SortColumn;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumCUserBaseInfoSex;
import com.iformall.enums.EnumContractCustomersStatus;
import com.iformall.enums.EnumRentShopType;
import com.iformall.enums.EnumShopUsersPrincipalType;
import com.iformall.enums.EnumShopUsersStatus;
import com.iformall.enums.EnumShopUsersType;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@TableName(value = "wx_contract_customers")
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxContractCustomers extends TenantEntity {

private Long id;
@io.swagger.annotations.ApiModelProperty(value = "主体类型EnumShopUsersPrincipalType", name = "type")
private Integer principalType;
@TableField(exist = false)
private String principalTypeName;
public String getPrincipalTypeName() {
if (null != principalType) {
return EnumShopUsersPrincipalType.getEnum(principalType).getMessage();
}
return null;
}
@io.swagger.annotations.ApiModelProperty(value="名称",name="name")
private String name;
@io.swagger.annotations.ApiModelProperty(value="手机号",name="phone")
private String phone;
@io.swagger.annotations.ApiModelProperty(value="法人",name="legalPerson")
private String legalPerson;
@io.swagger.annotations.ApiModelProperty(value="身份证号码",name="idNumber")
private String idNumber;
@io.swagger.annotations.ApiModelProperty(value="性别EnumCUserBaseInfoSex",name="sex")
private Integer sex;
@TableField(exist = false)
private String sexName;
public String getSexName() {
if (null != sex) {
return EnumCUserBaseInfoSex.getEnum(sex).getMessage();
}
return null;
}
@io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson")
private String linkPerson;

@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;

@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate;
@Excel(name="状态",width = 20,orderNum = "7",replace = {"意向客户_0","正式客户_1"})
@io.swagger.annotations.ApiModelProperty(value="状态EnumContractCustomersStatus",name="status")
private Integer status;
@TableField(exist = false)
private String statusName;
public String getStatusName() {
if (null != status) {
return EnumContractCustomersStatus.getEnum(status).getMessage();
}
return null;
}
@TableField(exist = false)
private String nameEqal;
@TableField(exist = false)
private String phoneEqal;
}

+ 46
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxContractShop.java Zobrazit soubor

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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.common.SortColumn;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumCUserBaseInfoSex;
import com.iformall.enums.EnumContractCustomersStatus;
import com.iformall.enums.EnumRentShopType;
import com.iformall.enums.EnumShopUsersPrincipalType;
import com.iformall.enums.EnumShopUsersStatus;
import com.iformall.enums.EnumShopUsersType;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@TableName(value = "wx_contract_shop")
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class WxContractShop extends TenantEntity {

private Long id;
@io.swagger.annotations.ApiModelProperty(value="合体编号",name="contractId")
private Long contractId;
@io.swagger.annotations.ApiModelProperty(value="店铺编号",name="shopId")
private Long shopId;
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;

@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate;
@TableField(exist = false)
private List<Long> shopIds;
}

+ 1
- 2
mallinkService/src/main/java/com/iformall/domain/po/WxEnergyReadingCalcuteResult.java Zobrazit soubor

@@ -93,12 +93,11 @@ public class WxEnergyReadingCalcuteResult extends TenantEntity {
@TableField(exist = false)
private String feesIdsStr;
public WxAllBill generateBill(WxEnergyReadingCalcute calcute,WxMerchant merchant,WxShop shop,MallUserInfo user,Date starttime,Date endtime,String needPay,String detail,String remark) {
public WxAllBill generateBill(WxEnergyReadingCalcute calcute,WxShop shop,MallUserInfo user,Date starttime,Date endtime,String needPay,String detail,String remark) {
WxAllBill daily = new WxAllBill();
final IdWorker idWorker = IdWorker.get();
daily.setId(idWorker.nextId());
daily.updateTenantInfo(this);
daily.setMerchantId(merchant.getId());
daily.setCreatetime(new Date());
daily.setCreateBy(user.getId());
daily.setCreateByName(user.getName());


+ 1
- 29
mallinkService/src/main/java/com/iformall/domain/po/WxMerchant.java Zobrazit soubor

@@ -449,17 +449,6 @@ public class WxMerchant extends TenantEntity {
private String initLog;

@TableField(exist = false)
private Integer onlyOwe;
//账单逾期计算提前天数
@TableField(exist = false)
private Integer oweBillBeforeDays;
//临期计算提前天数
@TableField(exist = false)
private Integer nearBillBeforeDays;
//账单完结备注
@TableField(exist = false)
private String billCompleteRemark;
@@ -469,25 +458,12 @@ public class WxMerchant extends TenantEntity {
@TableField(exist = false)
private Long shopId;
@TableField(exist = false)
private Integer needPayPreDays;
@TableField(exist = false)
private Integer needPayNoDays;
@TableField(exist = false)
public Integer onlyOweOrNear;
@TableField(exist = false)
public Integer billType;
@TableField(exist = false)
public Long energyFeesId;
@TableField(exist = false)
public List<Long> energyFeesIdList;

@TableField(exist = false)
public Integer toPayMerchant;
@TableField(exist = false)
public Integer isPreview;
@TableField(exist = false)
public List<Long> feesIdList;
@TableField(exist = false)
@@ -497,10 +473,6 @@ public class WxMerchant extends TenantEntity {
@TableField(exist = false)
public String feesIdListStr;
@TableField(exist = false)
public Integer advanceHasMoney;
@TableField(exist = false)
public Date receiveDate;
@TableField(exist = false)
public Integer isAll;
@TableField(exist = false)
private List<Integer> privateRentShopTypeList;


+ 46
- 134
mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java Zobrazit soubor

@@ -25,6 +25,7 @@ import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

@@ -39,6 +40,18 @@ public class WxRentContract extends TenantEntity {

protected Long id;

private Long customersId;
@TableField(exist = false)
private Integer customerType;
@TableField(exist = false)
private String customerName;
@TableField(exist = false)
private String customerLinkPerson;
@TableField(exist = false)
private String customerPhone;
@TableField(exist = false)
private String customerLegalPerson;
@io.swagger.annotations.ApiModelProperty(value = "来源ID,针对续签,从哪个合同续签", name = "fromId")
private Long fromId;
@@ -62,26 +75,6 @@ public class WxRentContract extends TenantEntity {
@TableField(exist = false)
private String buildArea;

// @TableField(exist = false)
// private String priceStr;

// public String getPriceStr() {
// if(price!=null) {
// priceStr = new BigDecimal(price).divide(new BigDecimal(100)).toString();
// }
// return priceStr;
// }

// @TableField(exist = false)
// private String depositStr;
//
// public String getDepositStr() {
// if(deposit!=null) {
// depositStr = new BigDecimal(deposit).divide(new BigDecimal(100)).toString();
// }
// return depositStr;
// }

@TableField(exist = false)
@SortColumn(column = "allPeriod")
private Integer allPeriod;
@@ -114,85 +107,11 @@ public class WxRentContract extends TenantEntity {
private Integer endProperty;


// 商品类别
private String shopTypeSub;
// 租赁用途
private String leasePurpose;

// 联系地址
// 本合同正本一式 份,甲方执 份,乙方执 份
//{total:,partyA:,partyB:}
private String contractualRules;
// 商铺交付日期
private Date deliveryDate;
// 交付宽限期(天)
private Integer deliveryGracePeriod;
// 开业日期
private Date openingDate;
// 营业时间 每日 点至 点
//{start:,end:}
private String businessHours;
// 合同期内 米不得新设相同品牌之分店或加盟店
private Integer scopeMetre;

// 物业公司名称 请输入物业公司名称
// 物业费金额 请输入金额
// 物业费支付周期
//
// 水费 元/吨
//
// 电费 元/度



// 甲方开户银行
// 甲方开户名称
// 甲方银行账号
//
// 乙方开户银行
// 乙方开户名称
// 乙方银行账号
//
// 乙方纳税人识别号
// 乙方税务登记地址
// 乙方开户银行
// 乙方开户名称
// 乙方银行账号
// 乙方联系电话




@io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "contractNumber")
private String contractNumber;


//甲方信息(公司,地址,电话取wx_mall)
// 甲方统一社会信用代码
// private String socialCreditCodeA;
// // 甲方开户银行
// private String bankNameA;
// // 甲方开户名称
// private String accountNameA;
// // 甲方银行账号
// private String accountNumA;

private String firstPartyBankInfo;

//物业信息
//物业公司名称
private String propertyName;
//物业费金额(分/月)
private String propertyFee;
//物业费支付周期(月/季/年)
private Integer feeCycle;
//水费(分/吨)
private String waterFee;
//电费(分/度)
private String electricityFees;

//乙方信息
//联系方式
//地址
private String linkAddress;

@@ -208,31 +127,8 @@ public class WxRentContract extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "开户行", name = "bankName")
private String bankName;

// 乙方统一社会信用代码
// private String socialCreditCode;
// // 乙方开户银行
// // 乙方开户名称
// private String accountName;
// 乙方银行账号

private String secondPartyBankInfo;

private String secondPartyTaxInfo;


// 乙方纳税人识别号
// private String taxpayerNumber;
// // 乙方税务登记地址
// private String taxpayerAdress;

@io.swagger.annotations.ApiModelProperty(value = "金额小数点位数", name = "decimalSize")
private Integer decimalSize = Constant.default_short_decimal_size ;
@io.swagger.annotations.ApiModelProperty(value = "商户", name = "merchantId")
private Long merchantId;
@io.swagger.annotations.ApiModelProperty(value = "是不是私密商户(虚拟)", name = "isPrivateMerchant")
private Integer isPrivateMerchant;
@io.swagger.annotations.ApiModelProperty(value = "虚拟商户店铺类型EnumRentShopType", name = "privateRentShopType")
private Integer privateRentShopType;
@io.swagger.annotations.ApiModelProperty(value = "月租金/分成(元)", name = "price")
private String price;
@TableField(exist = false)
@@ -272,20 +168,8 @@ public class WxRentContract extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "押金详细", name = "cashtypeLsit")
private String cashtypeLsit;

@io.swagger.annotations.ApiModelProperty(value = "交租日 计租开始时间减去交租日的天数为基数 提前多少日交租", name = "payDate")
@SortColumn(column = "payDate")
private Integer payDate;
@io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel")
private Integer isDel;
@io.swagger.annotations.ApiModelProperty(value = "商户名称", name = "merchantName")
private String merchantName;
@io.swagger.annotations.ApiModelProperty(value = "经营品牌", name = "brand")
private Long brand;
@io.swagger.annotations.ApiModelProperty(value = "经常业态ID", name = "businessId")
private Integer businessId;
@io.swagger.annotations.ApiModelProperty(value = "店铺类型", name = "shopType")
private Integer shopType;
private String shopTypeStr;
@io.swagger.annotations.ApiModelProperty(value = "店铺名称", name = "shopName")
private String shopName;
@io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updatetime")
@@ -599,6 +483,39 @@ public class WxRentContract extends TenantEntity {
return sb.toString();
}
public Map<Long,BigDecimal> getRentShopAreaRate() {
String rentInfo = this.getRentInfo();
if (!StringUtils.isBlank(rentInfo)) {
Map<Long,BigDecimal> shopAreaMap = new HashMap<Long,BigDecimal>();
JSONArray rentInfoArray = JSONArray.parseArray(rentInfo);
int size = rentInfoArray.size();
BigDecimal total = new BigDecimal(0);
for (int i = 0; i < size; i++) {
JSONObject rentInfoObject = rentInfoArray.getJSONObject(i);
Long shopId = rentInfoObject.getLong("id");
String rentArea = rentInfoObject.getString("rentArea");
if (StringUtils.isBlank(rentArea)) {
shopAreaMap.put(shopId, new BigDecimal("0"));
}else {
shopAreaMap.put(shopId, new BigDecimal("rentArea"));
total = total.add(new BigDecimal("rentArea"));
}
}
if (total.compareTo(new BigDecimal(0)) <= 0 ) {
total = new BigDecimal(1);
}
Map<Long,BigDecimal> shopAreaRateMap = new HashMap<Long,BigDecimal>();
for (Iterator<Long> it = shopAreaMap.keySet().iterator();it.hasNext();) {
Long sid = it.next();
BigDecimal sa = shopAreaMap.get(sid);
shopAreaRateMap.put(sid, sa.divide(total,Constant.default_long_decimal_size,BigDecimal.ROUND_HALF_UP));
}
return shopAreaRateMap;
}
return null;
}
public Map<Long,WxEnergyFees> getDepositEnergyFees(Map<Long,WxEnergyFees> feesMap) {
String dsdstr = this.getCashtypeContentLsit();
if (!StringUtils.isBlank(dsdstr)) {
@@ -623,9 +540,6 @@ public class WxRentContract extends TenantEntity {
return null;
}
@TableField(exist = false)
private List<Long> merchantIds;
@TableField(exist = false)
private String onlyPropertyContractId;
@@ -667,8 +581,6 @@ public class WxRentContract extends TenantEntity {
@TableField(exist = false)
private String queryShopNumber;
@TableField(exist = false)
private List<Integer> privateRentShopTypeList;
@TableField(exist = false)
List<WxRentContractAgileDeposit> contractDepositList;
}


+ 0
- 3
mallinkService/src/main/java/com/iformall/domain/po/WxRentContractAgileDeposit.java Zobrazit soubor

@@ -25,9 +25,6 @@ public class WxRentContractAgileDeposit extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="合同编号",name="rentContractId")
private Long rentContractId;
@io.swagger.annotations.ApiModelProperty(value="商户编号",name="merchantId")
private Long merchantId;
@io.swagger.annotations.ApiModelProperty(value="科目编号",name="feesId")
private Long feesId;


+ 0
- 3
mallinkService/src/main/java/com/iformall/domain/po/WxRentContractAgileUnDeposit.java Zobrazit soubor

@@ -30,9 +30,6 @@ public class WxRentContractAgileUnDeposit extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="合同编号",name="rentContractId")
private Long rentContractId;
@io.swagger.annotations.ApiModelProperty(value="商户编号",name="merchantId")
private Long merchantId;
@io.swagger.annotations.ApiModelProperty(value="费用设置方式EnumRentContractAgilSettingMethod",name="settingMethod")
private Integer settingMethod;
@TableField(exist = false)


+ 30
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxShop.java Zobrazit soubor

@@ -197,4 +197,34 @@ public class WxShop extends TenantEntity {
private List<Integer> typeList;
@TableField(exist = false)
private String queryShopNumber;
@TableField(exist = false)
private Date starttime;
@TableField(exist = false)
private Date endtime;
//账单逾期计算提前天数
@TableField(exist = false)
private Integer oweBillBeforeDays;
//临期计算提前天数
@TableField(exist = false)
private Integer nearBillBeforeDays;
@TableField(exist = false)
private Integer needPayPreDays;
@TableField(exist = false)
public Integer toPayMerchant;
@TableField(exist = false)
public Integer isPreview;
@TableField(exist = false)
private Integer needPayNoDays;
@TableField(exist = false)
public List<Long> energyFeesIdList;
@TableField(exist = false)
public Integer advanceHasMoney;
@TableField(exist = false)
public Date receiveDate;
@TableField(exist = false)
public Integer onlyOweOrNear;
@TableField(exist = false)
private Integer onlyOwe;
}

+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxShopUsers.java Zobrazit soubor

@@ -101,4 +101,7 @@ public class WxShopUsers extends TenantEntity {
}
return null;
}
@TableField(exist = false)
private List<Long> shopIds;
}

+ 4
- 4
mallinkService/src/main/java/com/iformall/domain/vo/WxBillNotify.java Zobrazit soubor

@@ -23,10 +23,10 @@ public class WxBillNotify implements Serializable {
private String receivePay;
private String pay;
private String owe;
private Long merchantId;
private String merchantName;
private String merchantPhone;
private String merchantLinkPerson;
private Long shopId;
private String shopUserName;
private String shopUserPerson;
private String shopUserPhone;
public String getOwe() {
return new BigDecimal(receivePay).subtract(new BigDecimal(pay)).toPlainString();


+ 0
- 9
mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java Zobrazit soubor

@@ -34,9 +34,6 @@ public class WxRentPropertyContractVo extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "商铺信息", name = "rentInfo")
private String rentInfo;

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

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

@@ -64,9 +61,6 @@ public class WxRentPropertyContractVo extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型1店铺2多经点位", name = "rentShopType")
private Integer rentShopType;

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

@io.swagger.annotations.ApiModelProperty(value = "物业合同状态", name = "propertyStatus")
private Integer propertyStatus;

@@ -108,10 +102,7 @@ public class WxRentPropertyContractVo extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "首期账单结束时间", name = "firstBillDateEnd")
private Date firstBillDateEnd;
private List<Long> merchantIds;
private String queryShopNumber;
private Integer isPrivateMerchant;
}


mallinkService/src/main/java/com/iformall/domain/vo/WxMerchantBillVo.java → mallinkService/src/main/java/com/iformall/domain/vo/WxShopBillVo.java Zobrazit soubor

@@ -15,14 +15,11 @@ import java.util.Date;
import java.util.List;

@Data
public class WxMerchantBillVo implements Serializable {
public class WxShopBillVo implements Serializable {

private static final long serialVersionUID = 1L;

private Long merchantId;
@Excel(name = "商户名称", width = 20, orderNum = "2")
@TableField(exist = false)
private String merchantName;//商户名称
private Long shopId;
@Excel(name = "商铺号", width = 20, orderNum = "3")
@TableField(exist = false)
private String shopNumber;

+ 35
- 0
mallinkService/src/main/java/com/iformall/enums/EnumContractCustomersStatus.java Zobrazit soubor

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

/**
*/
public enum EnumContractCustomersStatus {

TEMP(0, "意向客户"),
FORMUL(1, "正式客户"),
;

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

private Integer code;
private String message;

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

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 2
- 2
mallinkService/src/main/java/com/iformall/mapper/WxAllBillMapper.java Zobrazit soubor

@@ -17,6 +17,8 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> {
List<WxAllBill> findList(WxAllBill wxBillRent);
List<Long> queryBillRentContractIdList(WxAllBill record);
List<Long> getShopIdList(WxAllBill record);
List<WxAllBill> getMerchantAdvanceGroupSumList(WxAllBill wxBillRent);
List<WxBillNotify> getBillNotifyList(WxAllBill record);
@@ -37,8 +39,6 @@ public interface WxAllBillMapper extends CommonMapper<WxAllBill, Long> {
List<WxBillSum> getFeesBillSum(WxAllBill wxBillRent);
List<Long> getMerchantIdList(WxAllBill wxBillRent);
List<WxBillHotNotify> getBillHotNotify(WxAllBill wxBillRent);
WxAllBill selectById(@Param("id")Long id,@Param("tenantId")String tenantId);


+ 16
- 0
mallinkService/src/main/java/com/iformall/mapper/WxContractCustomersMapper.java Zobrazit soubor

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

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxContractCustomers;
import java.util.List;

import org.apache.ibatis.annotations.Param;

/**
*/
public interface WxContractCustomersMapper extends CommonMapper<WxContractCustomers, String> {

List<WxContractCustomers> findList(WxContractCustomers wxShop);
WxContractCustomers selectById(@Param("id")Long id,@Param("tenantId")String tenantId);
}

+ 18
- 0
mallinkService/src/main/java/com/iformall/mapper/WxContractShopMapper.java Zobrazit soubor

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

import com.iformall.common.CommonMapper;
import com.iformall.domain.po.WxContractCustomers;
import com.iformall.domain.po.WxContractShop;

import java.util.List;

/**
*/
public interface WxContractShopMapper extends CommonMapper<WxContractShop, String> {

List<WxContractShop> findList(WxContractShop wxShop);
List<Long> findContractIdList(WxContractShop wxShop);
void deleteByCondition(WxContractShop wxShop);
}

+ 0
- 23
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java Zobrazit soubor

@@ -17,22 +17,14 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>

List<WxRentContract> findList(WxRentContract wxRentContract);

void updateStatusForUnsign(WxRentContract wxRentContract);

void updateApplyStatus(WxRentContract wxRentContract);

void updateStatus(WxRentContract wxRentContract);

long queryOweCount(WxRentContract wxRentContract);

List<WxRentContract> getMerchants(WxRentContract wxRentContract);

int selectRentContractCountByShopId(@Param("tenantId") String tenantId,@Param("parentTenantId") String parentTenantId,@Param("shopId") Long shopId,@Param("id") Long id);

List<WxRentContract> selectRentContractByMerchantId(WxRentContract wxRentContract);

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

int hasContractNumber(WxRentContract wxRentContract);

List<WxRentPropertyContractVo> listContractVo(WxRentPropertyContractVo record);
@@ -41,23 +33,8 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>

int getShopCountMax();

List<Map<String,Object>> queryContractByBus(WxBusiness wxBusiness);

WxRentContract getByMerchantId(WxRentContract wxRentContract);

List<WxRentContract> getAllContractBymerchantId(WxRentContract wxRentContract);

//List<WxRentContract> getContractByMerchant(WxRentContract wxRentContract);
Integer getCanApplyCount(@Param("id") Long id);
List<Long> getMerchantIdsByStatuss(WxRentContract wxRentContract);

@Deprecated
List<Map<String, Object>> findRentByShop(@Param("shopId")Long shopId);

List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract);
List<Long> getUsedRentShopIds(WxRentContract wxRentContract);

long findCount(WxRentContract wxRentContract);


+ 1
- 0
mallinkService/src/main/java/com/iformall/mapper/WxShopUsersMapper.java Zobrazit soubor

@@ -9,4 +9,5 @@ import java.util.List;
public interface WxShopUsersMapper extends CommonMapper<WxShopUsers, String> {

List<WxShopUsers> findList(WxShopUsers wxShop);
List<Long> findShopIdList(WxShopUsers wxShop);
}

+ 0
- 10
mallinkService/src/main/java/com/iformall/print/data/impl/PrintBillDataHandler.java Zobrazit soubor

@@ -51,12 +51,6 @@ public class PrintBillDataHandler implements PrintDataParser{
}else if (name.equals("owe")) {
return receive.getOwe();
}else if (name.equals("merchantName")) {
if (null != merchantMap && null != receive.getMerchantId()) {
WxMerchant m = merchantMap.get(receive.getMerchantId());
if (null != m) {
return m.getName();
}
}
return "";
}else if (name.equals("feesName")) {
if (StringUtils.isNotBlank(receive.getEnergyFeesName())) {
@@ -75,10 +69,6 @@ public class PrintBillDataHandler implements PrintDataParser{
if (StringUtils.isNotBlank(receive.getShopNumber())) {
return receive.getShopNumber();
}
if (null != shopNumber && null != receive.getMerchantId()) {
String m = shopNumber.get(receive.getMerchantId());
return m;
}
return "";
}
return null;


+ 2
- 2
mallinkService/src/main/java/com/iformall/print/data/impl/PrintMerchantSettleDataHandler.java Zobrazit soubor

@@ -9,7 +9,7 @@ import com.iformall.domain.po.WxAllBill;
import com.iformall.domain.po.WxEnergyFees;
import com.iformall.domain.po.WxFinanceReceive;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.vo.WxMerchantBillVo;
import com.iformall.domain.vo.WxShopBillVo;
import com.iformall.print.data.PrintDataParser;
import com.iformall.utils.DateUtils;

@@ -21,7 +21,7 @@ public class PrintMerchantSettleDataHandler implements PrintDataParser{
Map<Long, WxMerchant> merchantMap = (Map<Long, WxMerchant>) params[0];
Map<Long, WxEnergyFees> feesMap = (Map<Long, WxEnergyFees>) params[1];
Map<Long,String> shopNumber = (Map<Long, String>) params[2];
WxMerchantBillVo receive = (WxMerchantBillVo) o;
WxShopBillVo receive = (WxShopBillVo) o;
//根据科目来查询对应的信息
if (name.equals("maxDate")) {
return DateUtils.date2String(receive.getMaxDate(),DateUtils.DATE_PATTERN);


+ 8
- 0
mallinkService/src/main/java/com/iformall/service/WxAgileContractService.java Zobrazit soubor

@@ -3,9 +3,11 @@ package com.iformall.service;
import com.github.pagehelper.PageInfo;
import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxContractCustomers;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.WxRentContractAgileDeposit;
import com.iformall.domain.po.WxRentContractAgileUnDeposit;
import com.iformall.domain.po.base.TenantEntity;

import java.util.List;

@@ -32,4 +34,10 @@ public interface WxAgileContractService {
List<WxRentContractAgileUnDeposit> findUnDepositList(WxRentContractAgileUnDeposit unDeposit);
void createUnDepositBill(WxRentContractAgileUnDeposit unDeposit,MallUserInfo user);
List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,List<Long> shopIds,Integer shopDel);
List<Long> findShopContractIds(TenantEntity tenantEntity,List<Long> shopIds);
WxContractCustomers findCustomers(TenantEntity tenantEntity,Long customerId);
}

+ 1
- 1
mallinkService/src/main/java/com/iformall/service/WxAllBillService.java Zobrazit soubor

@@ -33,7 +33,7 @@ public interface WxAllBillService {
PageInfo<WxAllBill> listAsPage(WxAllBill record, Integer pageIndex, Integer pageSize);
List<Long> getMerchantIds(WxAllBill wxBillRent);
List<Long> getShopIds(WxAllBill wxBillRent);
List<WxBillHotNotify> getBillHotNotify(WxAllBill wxBillRent);


+ 0
- 14
mallinkService/src/main/java/com/iformall/service/WxRentContractService.java Zobrazit soubor

@@ -91,8 +91,6 @@ public interface WxRentContractService {

void buildDeposit( TenantEntity tenantEntity,MallUserInfo user,Long rentContractId);

Object getMerchants(WxRentContract wxRentContract);

//void updateInvalidContract(Long rentContractId);

ResultData hasRentStatus(WxRentContract wxRentContract);
@@ -134,18 +132,6 @@ public interface WxRentContractService {
WxRentContract getSimpleDeatil(Long id);
/**
* 查询合同的店铺是否已经在其他有效合同里面了
* @param wxRentContract
* @return
*/
boolean hasOtherValidContractShop(WxRentContract wxRentContract);

@Deprecated
Map<String, Object> findRentByShop(Long shopId);

Map<String, Object> currentValidByMerchantId(TenantEntity tenantInfo, Long merchantId,String shopNumber);

long findCount(WxRentContract wxRentContract);
void setEndContractTime(WxRentContract wxRentContract);


+ 6
- 2
mallinkService/src/main/java/com/iformall/service/WxShopService.java Zobrazit soubor

@@ -15,6 +15,7 @@ import javax.servlet.http.HttpServletResponse;

import java.io.File;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -141,6 +142,9 @@ public interface WxShopService {
void deleteShopUsersPerson(WxShopUsersPerson wxShopUsers);
String getRentName(WxMerchant merchant);

List<Long> getUserShopIds(WxShopUsers wxShopUsers);
Map<Long,WxShopUsers> getShopUserMap(WxShopUsers wxShopUsers);
WxShopUsers getCurrentShopUser(TenantEntity tenantEntity,Long shopId);
}

+ 76
- 55
mallinkService/src/main/java/com/iformall/service/helper/WxBillAllHelper.java Zobrazit soubor

@@ -30,6 +30,8 @@ import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxMerchantBUser;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.po.WxShopUsers;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillNotify;
@@ -42,6 +44,7 @@ import com.iformall.enums.EnumBillOweOrNearType;
import com.iformall.enums.EnumBillStatus;
import com.iformall.enums.EnumBillType;
import com.iformall.enums.EnumRentContractManageFeeType;
import com.iformall.enums.EnumShopUsersStatus;
import com.iformall.enums.EnumSystemUserType;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.service.WxAllBillService;
@@ -78,38 +81,36 @@ public class WxBillAllHelper {
return DateUtils.getSecondsTimeAfter(afterDays*3600*24, nowBegin);
}
private void updateQueryParm(WxMerchant wxMerchant,WxAllBill bill,Date starttime,Date enttime) {
bill.updateTenantInfo(wxMerchant);
bill.setFloorForRule(wxMerchant.getFloorForRule());
bill.setBusinessForRule(wxMerchant.getBusinessForRule());
bill.setShopTypeForRule(wxMerchant.getShopTypeForRule());
bill.setBuilding(wxMerchant.getBuilding());
bill.setFloor(wxMerchant.getFloor());
bill.setMerchantName(wxMerchant.getName());
bill.setMerchantId(wxMerchant.getId());
private void updateQueryParm(WxShop wxShop,WxAllBill bill,Date starttime,Date enttime) {
bill.updateTenantInfo(wxShop);
bill.setFloorForRule(wxShop.getFloorForRule());
bill.setBusinessForRule(wxShop.getBusinessForRule());
bill.setShopTypeForRule(wxShop.getShopTypeForRule());
bill.setBuilding(wxShop.getBuilding());
bill.setFloor(wxShop.getFloor());
bill.setStarttime(starttime);
bill.setEndtime(enttime);
//bill.setRentShopType(wxMerchant.getType());
if (null != wxMerchant.getOweBillBeforeDays()) {
bill.setOweBillLastTime(getDateBefore(wxMerchant.getOweBillBeforeDays()));
if (null != wxShop.getOweBillBeforeDays()) {
bill.setOweBillLastTime(getDateBefore(wxShop.getOweBillBeforeDays()));
}
if (null != wxMerchant.getNearBillBeforeDays()) {
bill.setNearBillLastTime(getDateBefore(wxMerchant.getNearBillBeforeDays()));
if (null != wxShop.getNearBillBeforeDays()) {
bill.setNearBillLastTime(getDateBefore(wxShop.getNearBillBeforeDays()));
}
if (null != wxMerchant.getNeedPayPreDays()) {
bill.setNeedPayStartDay(getDateBefore(wxMerchant.getNeedPayPreDays()));
if (null != wxShop.getNeedPayPreDays()) {
bill.setNeedPayStartDay(getDateBefore(wxShop.getNeedPayPreDays()));
}
bill.setToPayMerchant(wxMerchant.getToPayMerchant());
bill.setIsPreview(wxMerchant.getIsPreview());
bill.setNeedPayNoDays(wxMerchant.getNeedPayNoDays());
bill.setEnergyFeesIds(wxMerchant.getEnergyFeesIdList());
bill.setAdvanceHasMoney(wxMerchant.getAdvanceHasMoney());
bill.setReceiveDate(wxMerchant.getReceiveDate());
bill.setToPayMerchant(wxShop.getToPayMerchant());
bill.setIsPreview(wxShop.getIsPreview());
bill.setNeedPayNoDays(wxShop.getNeedPayNoDays());
bill.setEnergyFeesIds(wxShop.getEnergyFeesIdList());
bill.setAdvanceHasMoney(wxShop.getAdvanceHasMoney());
bill.setReceiveDate(wxShop.getReceiveDate());
}
public WxBillSum getBillSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
public WxBillSum getBillSum(WxShop wxShop,Date starttime, Date enttime) {
WxAllBill br = new WxAllBill();
updateQueryParm(wxMerchant, br,starttime,enttime);
updateQueryParm(wxShop, br,starttime,enttime);
WxBillSum rentSum = wxAllBillService.getBillMonthSum(br);
if (null == rentSum) {
rentSum = new WxBillSum();
@@ -117,15 +118,15 @@ public class WxBillAllHelper {
return rentSum;
}
public List<WxBillSum> getFeesBillSum(WxMerchant wxMerchant,Date starttime, Date enttime) {
public List<WxBillSum> getFeesBillSum(WxShop wxShop,Date starttime, Date enttime) {
WxAllBill br = new WxAllBill();
updateQueryParm(wxMerchant, br,starttime,enttime);
updateQueryParm(wxShop, br,starttime,enttime);
return wxAllBillService.getFeesBillSum(br);
}
public List<WxBillHotNotify> getBillHotNotify(WxMerchant wxMerchant,Date starttime, Date enttime) {
public List<WxBillHotNotify> getBillHotNotify(WxShop wxShop,Date starttime, Date enttime) {
WxAllBill br = new WxAllBill();
updateQueryParm(wxMerchant, br,starttime,enttime);
updateQueryParm(wxShop, br,starttime,enttime);
return wxAllBillService.getBillHotNotify(br);
}
@@ -213,10 +214,10 @@ public class WxBillAllHelper {
return "0";
}
public List<Long> getOwdMerchantIds(WxMerchant wxMerchant,Date starttime, Date enttime) {
public List<Long> getOwdShopIds(WxShop wxShop,Date starttime, Date enttime) {
WxAllBill br = new WxAllBill();
updateQueryParm(wxMerchant, br,starttime,enttime);
return wxAllBillService.getMerchantIds(br);
updateQueryParm(wxShop, br,starttime,enttime);
return wxAllBillService.getShopIds(br);
}
private List<Long> getUnionIds(List<Long>...lists ) {
@@ -234,9 +235,9 @@ public class WxBillAllHelper {
return null;
}
public PageInfo<WxAllBill> getBillList(WxMerchant wxMerchant,Integer pageNum, Integer pageSize) {
public PageInfo<WxAllBill> getBillList(WxShop wxShop,Integer pageNum, Integer pageSize) {
WxAllBill wxAllBill = new WxAllBill();
updateQueryParm(wxMerchant, wxAllBill,wxMerchant.getStarttime(),wxMerchant.getEndtime());
updateQueryParm(wxShop, wxAllBill,wxShop.getStarttime(),wxShop.getEndtime());
wxAllBill.setIsPreview(EnumYesOrNo.NO.getCode());
wxAllBill.setSortColumns("starttime asc");
return wxAllBillService.listAsPage(wxAllBill, pageNum, pageSize);
@@ -253,27 +254,42 @@ public class WxBillAllHelper {
return wxAllBillService.getById(tenantEntity, id);
}
public List<WxBillNotify> getBillNotifyList(WxMerchant wxMerchant,Integer notifyed) {
public List<WxBillNotify> getBillNotifyList(WxShop wxShop,Integer notifyed) {
WxAllBill wxBillRent = new WxAllBill();
updateQueryParm(wxMerchant, wxBillRent,wxMerchant.getStarttime(),wxMerchant.getEndtime());
updateQueryParm(wxShop, wxBillRent,wxShop.getStarttime(),wxShop.getEndtime());
wxBillRent.setNotifyed(notifyed);
wxBillRent.setSortColumns("starttime asc");
List<WxBillNotify> retList = wxAllBillService.notifyList(wxBillRent);
if (null != retList && retList.size() > 0 ) {
//单个商户的就不查了
if (null == wxMerchant.getId()) {
Map<Long, WxMerchant> merchantMap = wxMerchantService.findMerchantMap(wxMerchant);
for (int i = 0 ; i < retList.size() ; i++) {
WxBillNotify bn = retList.get(i);
if (null != bn.getMerchantId() && null != merchantMap) {
WxMerchant m = merchantMap.get(bn.getMerchantId());
if (null != m) {
bn.setMerchantName(m.getName());
bn.setMerchantPhone(m.getLinkPhone());
bn.setMerchantLinkPerson(m.getLinkPerson());
}
List<Long> shopIdList = new ArrayList<Long>();
for (int i = 0 ; i < retList.size(); i ++) {
WxBillNotify wbn = retList.get(i);
if (null != wbn.getShopId()) {
if (!shopIdList.contains(wbn.getShopId())) {
shopIdList.add(wbn.getShopId());
}
}
}
if (shopIdList.size() > 0) {
WxShopUsers suq = new WxShopUsers();
suq.updateTenantInfo(wxShop);
suq.setStatus(EnumShopUsersStatus.LIVE.getCode());
suq.setShopIds(shopIdList);
Map<Long, WxShopUsers> shopUserMap = wxShopService.getShopUserMap(suq);
if (null != shopUserMap) {
for (int i = 0 ; i < retList.size() ; i++) {
WxBillNotify bn = retList.get(i);
if (null != bn.getShopId()) {
WxShopUsers s = shopUserMap.get(bn.getShopId());
if (null != s) {
bn.setShopUserName(s.getName());
bn.setShopUserPerson(s.getLinkPerson());
bn.setShopUserPhone(s.getPhone());
}
}
}
}
}
}
@@ -292,13 +308,18 @@ public class WxBillAllHelper {
Map<String, Object> result = new HashMap<>();
result.put("starttime", DateUtils.date2String(bill.getStarttime(),DateUtils.DATE_PATTERN));
result.put("endtime", DateUtils.date2String(bill.getEndtime(),DateUtils.DATE_PATTERN));
WxMerchant m = wxMerchantService.selectById(bill.getMerchantId());
if (null != m) {
result.put("shopNumber", getMerchantShopNumber(m));
result.put("merchantName", m.getName());
result.put("linkPerson", m.getLinkPerson());
result.put("linkPhone", m.getLinkPhone());
exportFileName = exportFileName+"_"+m.getName();
if (null != bill.getShopId()) {
WxShop shop = wxShopService.getById(bill.getShopId());
if (null != shop) {
result.put("shopNumber", shop.getShopNumber());
}
WxShopUsers su = wxShopService.getCurrentShopUser(bill, bill.getShopId());
if (null != su) {
result.put("merchantName", su.getName());
result.put("linkPerson", su.getLinkPerson());
result.put("linkPhone", su.getPhone());
exportFileName = exportFileName+"_"+su.getName();
}
}
result.put("billTypeName", bill.getBillTypeName());
exportFileName = exportFileName +"_"+ bill.getBillTypeName();
@@ -355,8 +376,8 @@ public class WxBillAllHelper {
wxAllBillService.updatePayByMerchant(dto, user,isOnline);
}
public WxAllBill getBillDetail(EnumBillAllType billType,WxMerchant wxMerchant,Long billId) {
return wxAllBillService.getById(wxMerchant,billId);
public WxAllBill getBillDetail(TenantEntity tenantEntity,Long billId) {
return wxAllBillService.getById(tenantEntity,billId);
}
public void updatePayToMerchant(WxBillPayDTO dto,MallUserInfo user) {


+ 113
- 52
mallinkService/src/main/java/com/iformall/service/impl/WxAgileContractServiceImpl.java Zobrazit soubor

@@ -10,6 +10,8 @@ import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxAllBill;
import com.iformall.domain.po.WxContractCustomers;
import com.iformall.domain.po.WxContractShop;
import com.iformall.domain.po.WxEnergyFees;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxRentContract;
@@ -18,6 +20,7 @@ import com.iformall.domain.po.WxRentContractAgileDepositShop;
import com.iformall.domain.po.WxRentContractAgileUnDeposit;
import com.iformall.domain.po.WxRentContractAgileUnDepositItem;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.BillTimeVo;
import com.iformall.enums.EnumBillAllType;
import com.iformall.enums.EnumBillExtraCreateFrom;
@@ -34,6 +37,8 @@ import com.iformall.enums.EnumYesOrNo;
import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxAllBillMapper;
import com.iformall.mapper.WxBusinessMapper;
import com.iformall.mapper.WxContractCustomersMapper;
import com.iformall.mapper.WxContractShopMapper;
import com.iformall.mapper.WxMerchantMapper;
import com.iformall.mapper.WxRentContractAgileDepositMapper;
import com.iformall.mapper.WxRentContractAgileDepositShopMapper;
@@ -60,6 +65,8 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@@ -92,6 +99,15 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
@Autowired
WxRentContractFreePeriodMapper wxRentContractFreePeriodMapper;
@Autowired
WxContractShopMapper wxContractShopMapper;
@Autowired
WxContractCustomersMapper wxContractCustomersMapper;
@Autowired
WxShopMapper wxShopMapper;
@Lazy
@Autowired
WxMerchantService wxMerchantService;
@@ -106,11 +122,12 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
@Override
public PageInfo<WxRentContract> getRentContractList(WxRentContract rentContract, Integer pageIndex, Integer pageSize) {
if (StringUtils.isNoneBlank(rentContract.getFloorForRule())) {
List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(rentContract, rentContract.getFloorForRule() , null, null,rentContract.getShopTypeForRule(), 0, 0,null);
if (null == mids || mids.size() <= 0 ) {
List<Long> contractIds = this.findBuildingFloorContractIds(rentContract, rentContract.getFloorForRule(), null, null, null, 0);
//List<Long> mids = wxMerchantService.getFloorBuildMerchantIds(rentContract, rentContract.getFloorForRule() , null, null,rentContract.getShopTypeForRule(), 0, 0,null);
if (null == contractIds || contractIds.size() <= 0 ) {
rentContract.setId(-1L);
} else {
rentContract.setMerchantIds(mids);
rentContract.setIds(contractIds);
}
}
PageInfo<WxRentContract> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxRentContractMapper.findList(rentContract));
@@ -135,10 +152,6 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
record.setCreateBy(user.getId());
record.setCreateByName(user.getName());
}
WxMerchant merchant = wxMerchantService.selectById(record.getMerchantId());
record.setIsPrivateMerchant(merchant.getIsPrivate());
record.setPrivateRentShopType(merchant.getCreateShopType());
record.setMerchantName(merchant.getName());
record.setUpdatetime(new Date());
record.setUpdateBy(user.getId());
record.setUpdateByName(user.getName());
@@ -183,7 +196,6 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
if (null != deposit.getShopList() && deposit.getShopList().size() > 0 ) {
WxRentContractAgileDeposit rca = new WxRentContractAgileDeposit();
rca.setRentContractId(wxRentContract.getId());
rca.setMerchantId(contract.getMerchantId());
rca.updateTenantInfo(wxRentContract);
rca.setId(idWorker.nextId());
rca.setFeesId(deposit.getFeesId());
@@ -253,7 +265,6 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
unDeposit.setCreatetime(new Date());
}
unDeposit.setUpdatetime(new Date());
unDeposit.setMerchantId(contract.getMerchantId());
if (isCreate) {
wxRentContractAgileUnDepositMapper.insert(unDeposit);
}else {
@@ -289,7 +300,6 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
WxRentContractAgileUnDepositItem item = unDeposit.getItems().get(i);
item.setRentContractId(unDeposit.getRentContractId());
item.setUnDepositId(unDeposit.getId());
item.setMerchantId(unDeposit.getMerchantId());
item.setFeesId(unDeposit.getFeesId());
item.setId(idWorker.nextId());
item.updateTenantInfo(contract);
@@ -380,51 +390,50 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
fq.updateTenantInfo(wxRentContract);
Map<Long,WxEnergyFees> typeMap = wxEnergyService.getFeesMap(fq);
//根据关联的店铺面积来分金额
Map<Long, BigDecimal> shopAreaRateMap = wxRentContract.getRentShopAreaRate();
if (null == shopAreaRateMap) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"无店铺信息");
}
List<Long> shopIdList = wxRentContract.shopIdsByRentInfo();
List<WxAllBill> insertList = new ArrayList<WxAllBill>();
final IdWorker idWorker = IdWorker.get();
for (int i = 0 ; i < depositList.size(); i++) {
WxRentContractAgileDeposit deposit = depositList.get(i);
WxRentContractAgileDeposit deposit = depositList.get(i);
WxEnergyFees fees = typeMap.get(deposit.getFeesId());
WxAllBill wxBillDeposit = new WxAllBill();
wxBillDeposit.setId(idWorker.nextId());
wxBillDeposit.updateTenantInfo(wxRentContract);
wxBillDeposit.setRentContractId(wxRentContract.getId());
wxBillDeposit.setBillType(fees.getBillType());
wxBillDeposit.setIsPreview(EnumYesOrNo.YES.getCode());
wxBillDeposit.setCanEdit(EnumYesOrNo.NO.getCode());
wxBillDeposit.setPriceDetail(fees.getName());
wxBillDeposit.setPay("0");
wxBillDeposit.setReceivePay(deposit.getPrice());
wxBillDeposit.setNeedPay(deposit.getPrice());
wxBillDeposit.setStarttime(wxRentContract.getRentalStartDate());
wxBillDeposit.setEndtime(wxRentContract.getRentalEndDate());
wxBillDeposit.setReceiveDate(wxRentContract.getRentalStartDate());
wxBillDeposit.setPeriod(WxRentContractHelper.getPeriod(wxRentContract.getRentalStartDate()));
wxBillDeposit.updateTenantInfo(wxRentContract);
wxBillDeposit.setMerchantId(wxRentContract.getMerchantId());
WxRentContractAgileDepositShop shopq = new WxRentContractAgileDepositShop();
shopq.updateTenantInfo(wxRentContract);
shopq.setRentContractId(wxRentContract.getId());
List<WxShop> shopList = deposit.getShopList();
StringBuffer snstr = new StringBuffer();
for (int j = 0 ; j < shopList.size() ; j ++) {
WxShop ds = shopList.get(j);
snstr.append(ds.getShopNumber()).append(",");
}
wxBillDeposit.setShopNumber(snstr.toString());
//wxBillDeposit.setShopId();
wxBillDeposit.setRentArea(wxRentContract.getRentArea());
wxBillDeposit.setCreatetime(new Date());
wxBillDeposit.setCreateBy(user.getId());
wxBillDeposit.setCreateByName(user.getName());
wxBillDeposit.setUpdatetime(new Date());
wxBillDeposit.setUpdateBy(user.getId());
wxBillDeposit.setUpdateByName(user.getName());
wxBillDeposit.setEnergyFeesId(deposit.getFeesId());
wxBillDeposit.setRentContractAgileFeesType(EnumRentContractAgileFeesType.DEPOSIT.getCode());
insertList.add(wxBillDeposit);
for (int j = 0 ; j < shopIdList.size(); j++ ) {
Long sid = shopIdList.get(j);
BigDecimal shoprate = shopAreaRateMap.get(sid);
WxAllBill wxBillDeposit = new WxAllBill();
wxBillDeposit.setId(idWorker.nextId());
wxBillDeposit.updateTenantInfo(wxRentContract);
wxBillDeposit.setRentContractId(wxRentContract.getId());
wxBillDeposit.setBillType(fees.getBillType());
wxBillDeposit.setIsPreview(EnumYesOrNo.YES.getCode());
wxBillDeposit.setCanEdit(EnumYesOrNo.NO.getCode());
wxBillDeposit.setPriceDetail(fees.getName());
wxBillDeposit.setPay("0");
wxBillDeposit.setReceivePay(new BigDecimal(deposit.getPrice()).multiply(shoprate).toPlainString());
wxBillDeposit.setNeedPay(wxBillDeposit.getReceivePay());
wxBillDeposit.setStarttime(wxRentContract.getRentalStartDate());
wxBillDeposit.setEndtime(wxRentContract.getRentalEndDate());
wxBillDeposit.setReceiveDate(wxRentContract.getRentalStartDate());
wxBillDeposit.setPeriod(WxRentContractHelper.getPeriod(wxRentContract.getRentalStartDate()));
wxBillDeposit.updateTenantInfo(wxRentContract);
wxBillDeposit.setShopId(sid);
wxBillDeposit.setRentArea(wxRentContract.getRentArea());
wxBillDeposit.setCreatetime(new Date());
wxBillDeposit.setCreateBy(user.getId());
wxBillDeposit.setCreateByName(user.getName());
wxBillDeposit.setUpdatetime(new Date());
wxBillDeposit.setUpdateBy(user.getId());
wxBillDeposit.setUpdateByName(user.getName());
wxBillDeposit.setEnergyFeesId(deposit.getFeesId());
wxBillDeposit.setRentContractAgileFeesType(EnumRentContractAgileFeesType.DEPOSIT.getCode());
insertList.add(wxBillDeposit);
}
}
try {
if (insertList.size() > 0 ) {
@@ -520,7 +529,10 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
//截止收租日在当前时间之前
Date date = new Date();
wxBillRent.updateTenantInfo(unDeposit);
wxBillRent.setMerchantId(unDeposit.getMerchantId());
//wxBillRent.setMerchantId(unDeposit.getMerchantId());
wxBillRent.setShopId(item.getShopId());
wxBillRent.setShopNumber(shopNumber);
wxBillRent.setRentArea(item.getRentArea());
@@ -532,5 +544,54 @@ public class WxAgileContractServiceImpl implements WxAgileContractService {
wxBillRent.setUpdateByName(user.getName());
return wxBillRent;
}


@Override
public List<Long> findBuildingFloorContractIds(TenantEntity tenantEntity, String floorRule, Long building,
Long floor,List<Long> shopIds,Integer shopDel) {
WxShop shopQ = new WxShop();
if (null != shopDel) {
shopQ.setIsDel(shopDel);
}
shopQ.updateTenantInfo(tenantEntity);
if (null != floorRule) {
shopQ.setFloorForRule(floorRule);
}
if (null != building) {
shopQ.setBuilding(building);
}
if (null != floor) {
shopQ.setFloor(floor);
}
shopQ.setIds(shopIds);;
List<Long> sIds = wxShopMapper.findIdList(shopQ);
if (null == sIds || sIds.size() <= 0 ) {
return null;
}
WxContractShop cs = new WxContractShop();
cs.updateTenantInfo(tenantEntity);
cs.setShopIds(sIds);
return wxContractShopMapper.findContractIdList(cs);
}


@Override
public List<Long> findShopContractIds(TenantEntity tenantEntity, List<Long> shopIds) {
WxContractShop cs = new WxContractShop();
cs.updateTenantInfo(tenantEntity);
cs.setShopIds(shopIds);
return wxContractShopMapper.findContractIdList(cs);
}


@Override
public WxContractCustomers findCustomers(TenantEntity tenantEntity, Long customerId) {
return wxContractCustomersMapper.selectById(customerId, tenantEntity.getTenantId());
}


}

+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxAllBillServiceImpl.java Zobrazit soubor

@@ -213,9 +213,9 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill
}
@Override
public List<Long> getMerchantIds(WxAllBill wxBillRent) {
public List<Long> getShopIds(WxAllBill wxBillRent) {
updateQueryParam(wxBillRent);
return wxAllBillMapper.getMerchantIdList(wxBillRent);
return wxAllBillMapper.getShopIdList(wxBillRent);
}
@Override


+ 2
- 12
mallinkService/src/main/java/com/iformall/service/impl/WxEnergyServiceImpl.java Zobrazit soubor

@@ -13,7 +13,7 @@ import com.iformall.common.ResultData;
import com.iformall.domain.dto.FloorBuildingIdDTO;
import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxMerchantBillVo;
import com.iformall.domain.vo.WxShopBillVo;
import com.iformall.enums.EnumBillAllType;
import com.iformall.enums.EnumEnergyMeterPhysicsType;
import com.iformall.enums.EnumEnergyMeterShopFloorType;
@@ -1570,13 +1570,11 @@ public class WxEnergyServiceImpl implements WxEnergyService {
crq.setCalcuteId(calcute.getId());
List<Long> shopIdList = wxEnergyReadingCalcuteResultMapper.findShopIdList(crq);
Map<Long, WxShop> shopMap = null;
Map<Long, WxMerchant> merchantMap = null;
if (shopIdList.size() > 0 ) {
WxShop sq = new WxShop();
sq.updateTenantInfo(record);
sq.setIds(shopIdList);
shopMap = wxShopService.findShopMap(sq);
merchantMap = wxMerchantService.getShopMerchantMap(sq);
}
WxEnergyFees fees = this.getFeesById(calcute.getFeesId(), record.getTenantId());
@@ -1594,14 +1592,6 @@ public class WxEnergyServiceImpl implements WxEnergyService {
if (null == shop) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺ID["+result.getShopId()+"]未查询到店铺");
}
WxMerchant merchant = null;
if (null != merchantMap) {
merchant = merchantMap.get(result.getShopId());
}
if (null == merchant) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"未绑定商户,请先绑定商户");
}
WxEnergyFeesShop feesShop = wxEnergyFeesShopMapper.selectById(result.getFeesShopId(), result.getTenantId());
if (null == feesShop) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"店铺"+shop.getShopNumber()+"该科目费用标准未查询到");
@@ -1614,7 +1604,7 @@ public class WxEnergyServiceImpl implements WxEnergyService {
feesShopList.add(feesShop);
}
WxAllBill bill = result.generateBill(calcute, merchant, shop, user,result.getBeginTime(),result.getEndTime(), result.getMoney(), result.getMoneyDeail(), "能源计算自动生成");
WxAllBill bill = result.generateBill(calcute, shop, user,result.getBeginTime(),result.getEndTime(), result.getMoney(), result.getMoneyDeail(), "能源计算自动生成");
billList.add(bill);
}


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxFinancePrintServiceImpl.java Zobrazit soubor

@@ -22,7 +22,7 @@ import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.vo.PrintVo;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.domain.vo.WxMerchantBillVo;
import com.iformall.domain.vo.WxShopBillVo;
import com.iformall.enums.EnumFinancePrintDataType;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.exception.MallinkException;
@@ -313,7 +313,7 @@ public class WxFinancePrintServiceImpl implements WxFinancePrintService {
}
return voList;
}else if (printDatatype.getCode().intValue() == EnumFinancePrintDataType.RENT_OWE.getCode()) {
WxMerchantBillVo bq = (WxMerchantBillVo) entity;
WxShopBillVo bq = (WxShopBillVo) entity;
if (null != shopNumber && null != bq.getMerchantId()) {
bq.setShopNumber(shopNumber.get(bq.getMerchantId()));
}else {


+ 5
- 5
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Zobrazit soubor

@@ -375,11 +375,11 @@ public class WxMerchantServiceImpl implements WxMerchantService {

WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setMerchantId(wxMerchant.getId());
List<WxRentContract> lrc = wxRentContractMapper.selectRentContractByMerchantId(wxRentContract);
if (!lrc.isEmpty()) {
wxMerchant.setRentalStartDate(lrc.get(0).getRentalStartDate());
wxMerchant.setRentalEndDate(lrc.get(0).getRentalEndDate());
}
//List<WxRentContract> lrc = wxRentContractMapper.selectRentContractByMerchantId(wxRentContract);
//if (!lrc.isEmpty()) {
// wxMerchant.setRentalStartDate(lrc.get(0).getRentalStartDate());
// wxMerchant.setRentalEndDate(lrc.get(0).getRentalEndDate());
//}
List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop);
for (WxMerchantShop merchantShop : wxMerchantShopList) {


+ 449
- 369
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 33
- 37
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Zobrazit soubor

@@ -50,6 +50,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -629,21 +630,6 @@ public class WxShopServiceImpl implements WxShopService {
map.put("merchantName", merchant.getName());
map.put("linkPerson", merchant.getLinkPerson());
map.put("linkPhone", merchant.getLinkPhone());
WxRentContract rentContractQ = new WxRentContract();
rentContractQ.updateTenantInfo(tenantEntity);
rentContractQ.setMerchantId(merchant.getId());
List<WxRentContract> rentList = wxRentContractMapper.findList(rentContractQ);
if (null != rentList && rentList.size() > 0 ) {
WxRentContract rc = rentList.get(0);
map.put("price", rc.getPrice());
map.put("receivePeriod", rc.getReceivePeriod());
EnumContractReceivePeriodUnit pu = EnumContractReceivePeriodUnit.getEnum(rc.getReceivePeriodUnit());
if (null != pu) {
map.put("receivePeriodUnit", pu.getMessage());
}
}
}
}
}
@@ -1126,30 +1112,40 @@ public class WxShopServiceImpl implements WxShopService {
}

@Override
public String getRentName(WxMerchant merchant) {
if (merchant.getIsPrivate() == EnumYesOrNo.NO.getCode()) {
return merchant.getName();
}else {
if (StringUtils.isBlank(merchant.getCreateShopNumber())) {
return merchant.getName();
}
WxShop shop = this.getShopByShopNumber(merchant, merchant.getCreateShopNumber()) ;
if (null != shop ) {
//查询租户和业主
WxShopUsers suq = new WxShopUsers();
suq.updateTenantInfo(merchant);
suq.setShopId(shop.getId());
suq.setStatus(EnumShopUsersStatus.LIVE.getCode());
suq.setSortColumns("type desc");
WxShopUsers wsu = this.getOneShopUsers(suq);
if (null != wsu) {
return wsu.getName();
}else {
return merchant.getName();
public List<Long> getUserShopIds(WxShopUsers wxShopUsers) {
return wxShopUsersMapper.findShopIdList(wxShopUsers);
}

@Override
public Map<Long, WxShopUsers> getShopUserMap(WxShopUsers wxShopUsers) {
wxShopUsers.setSortColumn(" status asc, type desc");
List<WxShopUsers> list = wxShopUsersMapper.findList(wxShopUsers);
if (null == list || list.size() <= 0 ) {
return null;
}
Map<Long,WxShopUsers> retMap = new HashMap<Long,WxShopUsers>();
for (int i = 0 ; i < list.size(); i++) {
WxShopUsers su = list.get(i);
if (null != su.getShopId()) {
if (!retMap.containsKey(su.getShopId())) {
retMap.put(su.getShopId(), su);
}
}else {
return merchant.getName();
}
}
return retMap;
}

@Override
public WxShopUsers getCurrentShopUser(TenantEntity tenantEntity, Long shopId) {
WxShopUsers suq = new WxShopUsers();
suq.updateTenantInfo(tenantEntity);
suq.setShopId(shopId);
suq.setStatus(EnumShopUsersStatus.LIVE.getCode());
suq.setSortColumn("type desc");
List<WxShopUsers> list = wxShopUsersMapper.findList(suq);
if (null == list || list.size() <= 0 ) {
return null;
};
return list.get(0);
}
}

+ 2
- 0
mallinkService/src/main/java/com/iformall/utils/Constant.java Zobrazit soubor

@@ -49,6 +49,7 @@ public class Constant {
public static final String TOKEN_WXC_END = ":wx-cuser";
public static final String TOKEN_TTC_END = ":tt-cuser";
public static final String TOKEN_ADMIN_END = ":admin-user";
public static final String TOKEN_SHOP_USER_END = ":shop-user";

public static final String cuserQr = "weapp:cuser-qr:";

@@ -63,6 +64,7 @@ public class Constant {
public static final String PARENT_TENANT_ID = "PARENT_TENANT_ID";
public static final String REQUEST_C_USER_KEY = "REQUEST_C_USER";
public static final String REQUEST_MALL_USER_KEY = "REQUEST_MALL_USER";
public static final String REQUEST_SHOP_USER_KEY = "REQUEST_SHOP_USER";

public static final String APP_Id = "APP_Id";
public static final String APP_NAME = "APP_NAME";


+ 12
- 24
mallinkService/src/main/resources/mapper/WxAllBillMapper.xml Zobrazit soubor

@@ -5,7 +5,8 @@
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="create_by" jdbcType="BIGINT" property="createBy"/>
<result column="create_by_name" jdbcType="VARCHAR" property="createByName"/>
@@ -34,8 +35,6 @@
<result column="bussiness_manage_fee_need_pay" jdbcType="VARCHAR" property="bussinessManageFeeNeedPay"/>
<result column="operating_manage_fee_need_pay" jdbcType="VARCHAR" property="operatingManageFeeNeedPay"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
<result column="is_preview" jdbcType="INTEGER" property="isPreview"/>
<result column="shop_info" jdbcType="VARCHAR" property="shopInfo"/>
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/>
@@ -51,7 +50,7 @@
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`createtime`,`create_by`,`create_by_name`,`updatetime`,`update_by`,`update_by_name`,
`id`,`tenant_id`,`parent_tenant_id`,`createtime`,`create_by`,`create_by_name`,`updatetime`,`update_by`,`update_by_name`,
`price_detail`,`need_pay`,`receive_pay`,`pay`,`bill_type`,`pay_way`,`pay_date`,`set_off`,`use_money`,`starttime`,`endtime`,`status`,`energy_fees_id`,`return_pay`,
`bill_remark`,`last_owe_call_time`,`last_owe_call_user`,`bussiness_manage_fee_need_pay`,`operating_manage_fee_need_pay`,`shop_id`,`shop_number`,`receive_date`,`period`,
`is_preview`,`shop_info`,`rent_contract_id`,`rent_contract_agile_fees_type`,`property_contract_id`,`parent_bill_id`,`energy_reading_calcuteId`,`energy_reading_id`,`extra_create_from`,`rent_area`,
@@ -62,7 +61,6 @@
where `tenant_id` = #{tenantId}
<if test=" null != id ">and `id` = #{id}</if>
<if test=" null != parentTenantId and '' != parentTenantId"> and `parent_tenant_id` = #{parentTenantId}</if>
<if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
<if test=" null != createBy ">and `create_by` = #{createBy}</if>
<if test=" null != createByName and '' != createByName"> and `create_by_name` like concat('%',#{createByName},'%')</if>
<if test=" null != billType ">and `bill_type` = #{billType}</if>
@@ -130,7 +128,6 @@
(`last_owe_call_time` is not null and `receive_pay` - `pay`- IFNULL(`set_off`,'0') &gt; 0 and bill_type in (13,21,5,7))
)
</if>
<if test=" null != hasMerchant ">and `merchant_id` is not null</if>
<if test=" 1 == hasParentBillId ">and `parent_bill_id` is not null</if>
<if test=" 0 == hasParentBillId ">and `parent_bill_id` is null</if>
<if test=" null != energyReadingCalcuteId ">and `energy_reading_calcuteId` = #{energyReadingCalcuteId}</if>
@@ -153,12 +150,6 @@
#{pidItem}
</foreach>
</if>
<if test=" null != merchantIdList ">
and `merchant_id` in
<foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")">
#{midItem}
</foreach>
</if>
<if test=" null != statusList ">
and `status` in
<foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")">
@@ -190,6 +181,12 @@
<include refid="dynamicWhereConditions"/>
</select>
<select id="getShopIdList" parameterType="com.iformall.domain.po.WxAllBill" resultType="Long">
select distinct shop_id
from wx_all_bill
<include refid="dynamicWhereConditions"/>
</select>
<select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
@@ -245,11 +242,6 @@
group by energy_fees_id
</select>
<select id="getMerchantIdList" parameterType="com.iformall.domain.po.WxAllBill" resultType="Long">
select distinct merchant_id from wx_all_bill
<include refid="dynamicWhereConditions"/>
</select>
<resultMap id="HotNotifyBaseResultMap" type="com.iformall.domain.vo.WxBillHotNotify">
<result column="total_count" jdbcType="INTEGER" property="totalCount"/>
<result column="total_money" jdbcType="VARCHAR" property="totalMoney" />
@@ -275,10 +267,10 @@
<result column="endtime" jdbcType="TIMESTAMP" property="endtime"/>
<result column="receive_pay" jdbcType="VARCHAR" property="receivePay"/>
<result column="pay" jdbcType="VARCHAR" property="pay"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
</resultMap>
<select id="getBillNotifyList" parameterType="com.iformall.domain.po.WxAllBill" resultMap="NotifyResultMap">
select bill_type,br.id as bill_id, br.starttime,br.endtime,br.receive_pay,br.pay,br.merchant_id from wx_all_bill br
select bill_type,br.id as bill_id, br.starttime,br.endtime,br.receive_pay,br.pay,br.shop_id from wx_all_bill br
<include refid="dynamicWhereConditions"/>
</select>
@@ -315,10 +307,6 @@
<if test=" null != propertyContractId">
and property_contract_id = #{propertyContractId}
</if>
<if test=" null != merchantId">
and merchant_id = #{merchantId}
</if>
</delete>
<delete id="deleteByRentHuiSuan" parameterType="com.iformall.domain.po.WxAllBill">
@@ -362,7 +350,7 @@
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},#{item.tenantId},#{item.parentTenantId},#{item.merchantId},#{item.createtime},
#{item.id},#{item.tenantId},#{item.parentTenantId},#{item.createtime},
#{item.createBy},#{item.createByName},#{item.updatetime},#{item.updateBy},#{item.updateByName},#{item.priceDetail},
#{item.needPay},#{item.receivePay},#{item.pay},#{item.billType},#{item.payWay},#{item.payDate},#{item.setOff},#{item.useMoney},
#{item.starttime},#{item.endtime},#{item.status},#{item.energyFeesId},#{item.returnPay},#{item.billRemark},


+ 84
- 0
mallinkService/src/main/resources/mapper/WxContractCustomersMapper.xml Zobrazit soubor

@@ -0,0 +1,84 @@
<?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.WxContractCustomersMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxContractCustomers">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="principal_type" jdbcType="INTEGER" property="principalType"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="legal_person" jdbcType="VARCHAR" property="legalPerson"/>
<result column="id_number" jdbcType="VARCHAR" property="idNumber"/>
<result column="sex" jdbcType="INTEGER" property="sex"/>
<result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="status" jdbcType="INTEGER" property="status"/>
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`principal_type`,`name`,`phone`,`legal_person`,`id_number`,`sex`,
`link_person`,`create_date`,`update_date`,`status`
</sql>

<sql id="dynamicWhereConditions">
where 1=1

<if test=" null != id ">
and `id` = #{id}
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != principalType">
and `principal_type` = #{principalType}
</if>
<if test=" null != name and name != '' ">
and `name` like concat('%', #{name},'%')
</if>
<if test=" null != nameEqal and nameEqal != '' ">
and `name` = #{nameEqal}
</if>
<if test=" null != phone and phone != '' ">
and `phone` like concat('%', #{phone},'%')
</if>
<if test=" null != phoneEqal and phoneEqal != '' ">
and `phone` = #{phoneEqal}
</if>
<if test=" null != status">
and `status` = #{status}
</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>

<select id="findList" parameterType="com.iformall.domain.po.WxContractCustomers" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_contract_customers
<include refid="dynamicWhereConditions"/>
</select>
<select id="selectById" parameterType="HashMap" resultMap="BaseResultMap">
select
<include refid="allColumns"/>
from wx_contract_customers where id = #{id} and `tenant_id` = #{tenantId}
</select>
</mapper>

+ 73
- 0
mallinkService/src/main/resources/mapper/WxContractShopMapper.xml Zobrazit soubor

@@ -0,0 +1,73 @@
<?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.WxContractShopMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxContractShop">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="contract_id" jdbcType="BIGINT" property="contractId"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`contract_id`,`shop_id`,`create_date`,`update_date`
</sql>

<sql id="dynamicWhereConditions">
where 1=1

<if test=" null != id ">
and `id` = #{id}
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>

<if test=" null != contractId">
and `contract_id` = #{contractId}
</if>
<if test=" null != shopId">
and `shop_id` = #{shopId}
</if>
<if test=" null != shopIds ">
and shop_id in
<foreach collection="shopIds" index="index" item="sidItem" open="(" separator="," close=")">
#{sidItem}
</foreach>
</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>

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

<select id="findContractIdList" parameterType="com.iformall.domain.po.WxContractShop" resultType="Long">
select distinct contract_id
from wx_contract_shop
<include refid="dynamicWhereConditions"/>
</select>
<delete id="deleteByCondition" parameterType="com.iformall.domain.po.WxContractShop">
delete from wx_contract_shop
<include refid="dynamicWhereConditions"/>
</delete>
</mapper>

+ 1
- 3
mallinkService/src/main/resources/mapper/WxRentContractAgileDepositMapper.xml Zobrazit soubor

@@ -8,13 +8,12 @@
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="fees_id" jdbcType="BIGINT" property="feesId"/>
<result column="price" jdbcType="VARCHAR" property="price"/>
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`createtime`,`updatetime`,`rent_contract_id`,`merchant_id`,`fees_id`,`price`
`id`,`tenant_id`,`parent_tenant_id`,`createtime`,`updatetime`,`rent_contract_id`,`fees_id`,`price`
</sql>

<sql id="dynamicWhereConditions">
@@ -27,7 +26,6 @@
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if>
<if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
<if test=" null != feesId ">and `fees_id` = #{feesId}</if>
<if test=" null != ids ">
and id in


+ 1
- 3
mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositItemMapper.xml Zobrazit soubor

@@ -7,7 +7,6 @@
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/>
<result column="un_deposit_id" jdbcType="BIGINT" property="unDepositId"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/>
<result column="fees_id" jdbcType="BIGINT" property="feesId"/>
@@ -23,7 +22,7 @@
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`un_deposit_id`,`merchant_id`,`shop_id`,`shop_number`,
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`un_deposit_id`,`shop_id`,`shop_number`,
`fees_id`,`begin_time`,`end_time`,`price`,`price_unit`,`createtime`,`updatetime`,`is_free`,`rent_area`,`is_father`
</sql>

@@ -37,7 +36,6 @@
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if>
<if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
<if test=" null != feesId ">and `fees_id` = #{feesId}</if>
<if test=" null != unDepositId ">and `un_deposit_id` = #{unDepositId}</if>
<if test=" null != isFather ">and `is_father` = #{isFather}</if>


+ 1
- 3
mallinkService/src/main/resources/mapper/WxRentContractAgileUnDepositMapper.xml Zobrazit soubor

@@ -6,7 +6,6 @@
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="setting_method" jdbcType="INTEGER" property="settingMethod"/>
<result column="fees_id" jdbcType="BIGINT" property="feesId"/>
<result column="time_period" jdbcType="INTEGER" property="timePeriod"/>
@@ -18,7 +17,7 @@
</resultMap>

<sql id="allColumns">
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`merchant_id`,`setting_method`,`fees_id`,`price`,`price_unit`,
`id`,`tenant_id`,`parent_tenant_id`,`rent_contract_id`,`setting_method`,`fees_id`,`price`,`price_unit`,
`time_period`,`time_unit`,`calcute_time`,`fees_create_rule`,`createtime`,`updatetime`
</sql>

@@ -32,7 +31,6 @@
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if>
<if test=" null != merchantId ">and `merchant_id` = #{merchantId}</if>
<if test=" null != feesId ">and `fees_id` = #{feesId}</if>
<if test=" null != ids ">
and id in


+ 14
- 226
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml Zobrazit soubor

@@ -3,17 +3,10 @@
<mapper namespace="com.iformall.mapper.WxRentContractMapper">
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxRentContract">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="merchant_id" jdbcType="BIGINT" property="merchantId"/>
<result column="is_private_merchant" jdbcType="INTEGER" property="isPrivateMerchant"/>
<result column="private_rent_shop_type" jdbcType="INTEGER" property="privateRentShopType"/>
<result column="shop_type_sub" jdbcType="VARCHAR" property="shopTypeSub"/>
<result column="lease_purpose" jdbcType="VARCHAR" property="leasePurpose"/>
<result column="contractual_rules" jdbcType="VARCHAR" property="contractualRules"/>
<result column="delivery_date" jdbcType="TIMESTAMP" property="deliveryDate"/>
<result column="delivery_grace_period" jdbcType="INTEGER" property="deliveryGracePeriod"/>
<result column="opening_date" jdbcType="TIMESTAMP" property="openingDate"/>
<result column="business_hours" jdbcType="VARCHAR" property="businessHours"/>
<result column="scope_metre" jdbcType="INTEGER" property="scopeMetre"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="agile_type" jdbcType="INTEGER" property="agileType"/>
<result column="customers_id" jdbcType="BIGINT" property="customersId"/>
<result column="decimal_size" jdbcType="INTEGER" property="decimalSize"/>
<result column="price" jdbcType="VARCHAR" property="price"/>
<result column="rental_start_date" jdbcType="TIMESTAMP" property="rentalStartDate"/>
@@ -22,47 +15,23 @@
<result column="receive_period" jdbcType="INTEGER" property="receivePeriod"/>
<result column="receive_period_unit" jdbcType="INTEGER" property="receivePeriodUnit"/>
<result column="pay_period_rate" jdbcType="INTEGER" property="payPeriodRate"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
<result column="filepath" jdbcType="VARCHAR" property="filepath"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="contract_number" jdbcType="VARCHAR" property="contractNumber"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="create_by" jdbcType="BIGINT" property="createBy"/>
<result column="create_by_name" jdbcType="VARCHAR" property="createByName"/>
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
<result column="update_by" jdbcType="BIGINT" property="updateBy"/>
<result column="update_by_name" jdbcType="VARCHAR" property="updateByName"/>
<result column="first_party_bank_info" jdbcType="VARCHAR" property="firstPartyBankInfo"/>
<result column="second_party_bank_info" jdbcType="VARCHAR" property="secondPartyBankInfo"/>
<result column="second_party_tax_info" jdbcType="VARCHAR" property="secondPartyTaxInfo"/>

<result column="property_name" jdbcType="VARCHAR" property="propertyName"/>
<result column="property_fee" jdbcType="VARCHAR" property="propertyFee"/>
<result column="fee_cycle" jdbcType="INTEGER" property="feeCycle"/>
<result column="water_fee" jdbcType="VARCHAR" property="waterFee"/>
<result column="electricity_fees" jdbcType="VARCHAR" property="electricityFees"/>

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

<!--<result column="deposit_info" jdbcType="VARCHAR" property="depositInfo"/>-->
<result column="cashtype_content_lsit" jdbcType="VARCHAR" property="cashtypeContentLsit"/>
<result column="cashtype_lsit" jdbcType="VARCHAR" property="cashtypeLsit"/>

<result column="pay_date" jdbcType="INTEGER" property="payDate"/>
<result column="is_del" jdbcType="INTEGER" property="isDel"/>
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName"/>
<result column="brand" jdbcType="VARCHAR" property="brand"/>
<result column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="shop_type" jdbcType="INTEGER" property="shopType"/>
<result column="shop_type_str" jdbcType="VARCHAR" property="shopTypeStr"/>
<result column="updatetime" jdbcType="TIMESTAMP" property="updatetime"/>
<result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
<result column="link_person" jdbcType="VARCHAR" property="linkPerson"/>
<result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/>
<result column="pay_account" jdbcType="VARCHAR" property="payAccount"/>

<result column="link_address" jdbcType="VARCHAR" property="linkAddress"/>

<result column="filename" jdbcType="VARCHAR" property="filename"/>
<result column="lease" jdbcType="INTEGER" property="lease"/>
<result column="type" jdbcType="INTEGER" property="type"/>
@@ -84,40 +53,23 @@
<result column="file_names" jdbcType="VARCHAR" property="fileNames"/>
<result column="price_unit" property="priceUnit"/>
<result column="rent_price" property="rentPrice"/>

<result column="other_rent_price_info" jdbcType="VARCHAR" property="otherRentPriceInfo"/>

<result column="subject_name" property="subjectName"/>
<result column="rent_start_type" property="rentStartType"/>
<result column="type" jdbcType="INTEGER" property="type"/>
<result column="revenue" jdbcType="INTEGER" property="revenue"/>
<result column="adjust_ratio" jdbcType="VARCHAR" property="adjustRatio"/>
<result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/>
<result column="pay_ratio" jdbcType="INTEGER" property="payRatio"/>
<result column="start_date" jdbcType="TIMESTAMP" property="startDate"/>
<result column="end_date" jdbcType="TIMESTAMP" property="endDate"/>
<result column="apply_status" jdbcType="INTEGER" property="applyStatus"/>
<result column="bank_name" jdbcType="VARCHAR" property="bankName"/>
<result column="subject_name" property="subjectName"/>
<result column="rent_start_type" property="rentStartType"/>
<result column="shop_name" property="shopName"/>
<result column="from_id" property="fromId"/>

<result column="rent_input_way" property="rentInputWay"/>
<result column="adjust_ratio_way" property="adjustRatioWay"/>
<result column="operation_type" property="operationType"/>
<result column="late_pay_ratio" property="latePayRatio"/>
<result column="late_pay_day" property="latePayDay"/>

<result column="end_contract_time" jdbcType="TIMESTAMP" property="endContractTime"/>
<result column="bussiness_management_fee" jdbcType="VARCHAR" property="bussinessManagementFee"/>
<result column="bussiness_management_fee_ratio_way" jdbcType="INTEGER" property="bussinessManagementFeeRatioWay"/>
<result column="bussiness_management_fee_ratio" jdbcType="VARCHAR" property="bussinessManagementFeeRatio"/>
<result column="operating_management_fee" jdbcType="VARCHAR" property="operatingManagementFee"/>
<result column="operating_management_fee_ratio_way" jdbcType="INTEGER" property="operatingManagementFeeRatioWay"/>
<result column="operating_management_fee_ratio" jdbcType="VARCHAR" property="operatingManagementFeeRatio"/>
<result column="out_date_notify_days" jdbcType="INTEGER" property="outDateNotifyDays"/>
<result column="out_date_notify_phone" jdbcType="VARCHAR" property="outDateNotifyPhone"/>
<result column="design_file" jdbcType="VARCHAR" property="designFile"/>
@@ -128,23 +80,18 @@
<result column="revenue_rent_price" jdbcType="VARCHAR" property="revenueRentPrice"/>
<result column="revenue_jumps_remark" jdbcType="VARCHAR" property="revenueJumpsRemark"/>
<result column="free_period_remark" jdbcType="VARCHAR" property="freePeriodRemark"/>
<result column="first_bill_date_start" jdbcType="TIMESTAMP" property="firstBillDateStart"/>
<result column="first_bill_date_end" jdbcType="TIMESTAMP" property="firstBillDateEnd"/>
<result column="first_bill_receive_date" jdbcType="TIMESTAMP" property="firstBillReceiveDate"/>
<result column="agile_type" jdbcType="INTEGER" property="agileType"/>
</resultMap>

<sql id="allColumns">
`id`,`merchant_id`,`is_private_merchant`,`private_rent_shop_type`,`agile_type`,
`shop_type_sub`,`lease_purpose`,`contractual_rules`,`delivery_date`,`delivery_grace_period`,`opening_date`,`business_hours`,`scope_metre`,
`id`,`agile_type`,`customers_id`,`tenant_id`,`parent_tenant_id`,
`decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`receive_period_unit`,
`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,`price_detail`,`create_by`,`update_by`,
`first_party_bank_info`,`second_party_bank_info`,`second_party_tax_info`,`day_price_calcute`,`first_bill_date_start`,`first_bill_date_end`,
`property_name`,`property_fee`,`fee_cycle`,`water_fee`,`electricity_fees`,`month_average_days`,`free_period_remark`,
`deposit`,cashtype_content_lsit,cashtype_lsit,`pay_date`,`is_del`,`merchant_name`,`revenue_jumps_remark`,
`brand`,`business_id`,`shop_type`,`shop_type_str`,`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`,
`filepath`,`status`,`contract_number`,`price_detail`,`create_by`,`update_by`,
`day_price_calcute`,`first_bill_date_start`,`first_bill_date_end`,`month_average_days`,`free_period_remark`,
`deposit`,cashtype_content_lsit,cashtype_lsit,`is_del`,`revenue_jumps_remark`,
`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`,
`pay_account`,`filename`,`lease`,`type`,`revenue`,`revenue_ratio`,`revenue_ratio_way`,`revenue_ratio_set`,`adjust_ratio`,`adjust_period`,`pay_ratio`,
`start_date`,`end_date`,`shop_name`,`from_id`,`end_contract_time`,`revenue_fixed_rent_price`,`revenue_rent_price`,
`apply_status`,`bank_name`,`fix_start_date`,`fix_end_date`,`pay_period_rate`,`create_by_name`,`update_by_name`,
@@ -159,10 +106,8 @@
where 1 = 1
<if test=" null != id ">and `id` = #{id}</if>
<if test=" null != fromId ">and `from_id` = #{fromId}</if>
<if test=" null != merchantId and '' != merchantId">and `merchant_id` = #{merchantId}</if>
<if test=" null != isPrivateMerchant">and `is_private_merchant` = #{isPrivateMerchant}</if>
<if test=" null != privateRentShopType">and `private_rent_shop_type` = #{privateRentShopType}</if>
<if test=" null != agileType">and `agile_type` = #{agileType}</if>
<if test=" null != customersId ">and `customers_id` = #{customersId}</if>
<if test=" null != price and '' != price">and `price` = #{price}</if>
<if test=" null != rentalStartDate and '' != rentalStartDate">and `rental_start_date` = #{rentalStartDate}</if>
<if test=" null != rentalEndDate and '' != rentalEndDate">and `rental_end_date` = #{rentalEndDate}</if>
@@ -182,12 +127,7 @@
<if test=" null != applyStatus ">and `apply_status` = #{applyStatus}</if>
<if test=" null != contractNumber and '' != contractNumber">and `contract_number` = #{contractNumber}</if>
<if test=" null != deposit and '' != deposit">and `deposit` = #{deposit}</if>
<if test=" null != payDate and '' != payDate">and `pay_date` = #{payDate}</if>
<if test=" null != isDel and '' != isDel">and `is_del` = #{isDel}</if>
<if test=" null != merchantName and '' != merchantName">and `merchant_name` like concat('%', #{merchantName},'%') </if>
<if test=" null != brand and '' != brand">and `brand` = #{brand}</if>
<if test=" null != businessId and '' != businessId">and `business_id` = #{businessId}</if>
<if test=" null != shopType and '' != shopType">and `shop_type` = #{shopType}</if>
<if test=" null != updatetime and '' != updatetime">and `updatetime` = #{updatetime}</if>
<if test=" null != createtime and '' != createtime">and `createtime` = #{createtime}</if>
<if test=" null != linkPerson and '' != linkPerson">and `link_person` = #{linkPerson}</if>
@@ -210,24 +150,6 @@
and concat(',',shop_name,',') like concat('%,',#{queryShopNumber},',%')
</if>

<if test=" null != businessForRule and '' != businessForRule ">
and business_id in (${businessForRule})
</if>
<if test=" null != privateRentShopTypeList ">
and private_rent_shop_type in
<foreach collection="privateRentShopTypeList" index="index" item="pmItem" open="(" separator="," close=")">
#{pmItem}
</foreach>
</if>
<if test=" null != merchantIds ">
and merchant_id in
<foreach collection="merchantIds" index="index" item="mItem" open="(" separator="," close=")">
#{mItem}
</foreach>
</if>

<if test=" null != statuss ">
and status in
<foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")">
@@ -280,27 +202,11 @@
update wx_rent_contract set status=#{status} where id=#{id}
</update>

<select id="updateStatusForUnsign" parameterType="com.iformall.domain.po.WxRentContract">
update wx_rent_contract set status=1 where status=2 and merchant_id is null
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
</select>

<select id="queryOweCount" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long">
select count(1) from wx_rent_contract r,wx_all_bill b
where b.rent_contract_id = r.id and b.status = 1 and r.id = #{id}
</select>

<select id="getMerchants" parameterType="com.iformall.domain.po.WxRentContract"
resultType="com.iformall.domain.po.WxRentContract">
select <include refid="allColumns"/> from wx_rent_contract where status in(2,3,4)
and merchant_id not in(select merchant_id from wx_property_contract where status in(2,3,4))
</select>

<select id="selectRentContractCountByShopId" parameterType="java.util.Map" resultType="int">
select count(1) from wx_rent_contract where 1=1
<if test=" null != tenantId and '' != tenantId">
@@ -315,26 +221,6 @@
</if>
</select>

<!--<select id="selectRentContractByShopId" parameterType="com.iformall.domain.po.WxRentContract" resultType="com.iformall.domain.po.WxRentContract">
select <include refid="allColumns"/> from wx_rent_contract
where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
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>
</select> -->

<select id="selectRentContractByMerchantId" parameterType="com.iformall.domain.po.WxRentContract"
resultType="com.iformall.domain.po.WxRentContract">
select <include refid="allColumns"/> from wx_rent_contract
where status in(2,3,4)
and merchant_id = #{merchantId}
</select>

<select id="hasContractNumber" parameterType="com.iformall.domain.po.WxRentContract"
resultType="int">
select count(1) from (
@@ -370,7 +256,6 @@
<result column="rent_id" property="rentId"/>
<result column="property_id" property="propertyId"/>
<result column="shop_name" property="shopName"/>
<result column="merchant_name" property="merchantName"/>
<result column="rent_info" property="rentInfo"/>
<result column="rental_start_date" property="rentalStartDate"/>
<result column="rental_end_date" property="rentalEndDate"/>
@@ -381,7 +266,6 @@
<result column="status" property="status"/>
<result column="apply_status" property="applyStatus"/>
<result column="operation_type" property="operationType"/>
<result column="merchant_id" property="merchantId"/>
<result column="property_status" property="propertyStatus"/>
<result column="rent_price_unit" property="rentPriceUnit"/>
<result column="property_price_unit" property="propertyPriceUnit"/>
@@ -397,9 +281,9 @@

<select id="listContractVo" parameterType="com.iformall.domain.vo.WxRentPropertyContractVo" resultMap="contractMap">
select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.id as rent_id, pc.id as property_id, rc.merchant_name,rc.rental_start_date,rc.rental_end_date,rc.`status`,
select rc.id,rc.tenant_id,rc.parent_tenant_id,rc.id as rent_id, pc.id as property_id, rc.rental_start_date,rc.rental_end_date,rc.`status`,
rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status,rc.price_detail,rc.revenue_fixed_rent_price,rc.revenue_rent_price,
rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status,
rc.rent_info,pc.price as property_price,pc.`status` as property_status,
rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute,rc.free_period_remark,
rc.business_type businessType,rc.month_average_days,rc.revenue_jumps_remark,rc.first_bill_date_start,rc.first_bill_date_end
from wx_rent_contract rc left join wx_property_contract pc on rc.id=pc.rent_contract_id
@@ -413,20 +297,15 @@
<if test=" null != contractNumber and '' != contractNumber">
and rc.`contract_number` = #{contractNumber}
</if>
<if test=" null != isPrivateMerchant">and rc.`is_private_merchant` = #{isPrivateMerchant}</if>
<if test=" null != rentId and '' != rentId">
and rc.`id` = #{rentId}
</if>
<if test=" null != propertyId and '' != propertyId">
and pc.`id` = #{propertyId}
</if>
<if test=" null != merchantName and merchantName!=''">and rc.`merchant_name` like
concat('%',#{merchantName},'%')
</if>
<if test=" null != shopNumber and shopNumber!=''">
and (json_extract(rc.rent_info,'$[*].shopNumber') like concat('%',#{shopNumber},'%') or rc.shop_name like concat('%',#{shopNumber},'%') )
</if>
<if test=" null != merchantId and '' != merchantId">and rc.`merchant_id` = #{merchantId}</if>
<if test=" null != queryShopNumber and queryShopNumber!=''">
and concat(',',rc.shop_name,',') like concat('%,',#{queryShopNumber},',%')
</if>
@@ -445,12 +324,6 @@
<if test=" null != businessForRule and '' != businessForRule ">
and rc.business_id in (${businessForRule})
</if>
<if test=" null != merchantIds ">
and rc.merchant_id in
<foreach collection="merchantIds" index="index" item="mItem" open="(" separator="," close=")">
#{mItem}
</foreach>
</if>
</where>
<if test=" null != sortColumns">order by ${sortColumns}</if>
<if test=" null == sortColumns">order by rc.createtime desc,rc.id desc</if>
@@ -467,95 +340,10 @@
select max(json_length(rent_info)) from wx_rent_contract
</select>

<select id="queryContractByBus" resultType="hashmap" parameterType="com.iformall.domain.po.WxBusiness">
select 1 type,c.`rental_start_date`,c.`rental_end_date`,c.id id from wx_merchant m left join wx_rent_contract c on(m.id = c.merchant_id)
where m.business_id = #{id} and c.price is not null and c.`rental_start_date` is not null and c.`rental_end_date` is not null
union all
select 2 type,c.`rental_start_date`,c.`rental_end_date`,c.id id from wx_merchant m left join wx_property_contract c on(m.id = c.merchant_id)
where m.business_id = #{id} and c.price is not null and c.`rental_start_date` is not null and c.`rental_end_date` is not null
</select>
<select id="getCanApplyCount" resultType="Integer" parameterType="Long">
select count(1) from wx_rent_contract where id != #{id} and (status=1 or (status=10 and apply_status=3) )
</select>

<select id="getMerchantIdsByStatuss" resultType="Long" parameterType="com.iformall.domain.po.WxRentContract">
select distinct merchant_id from wx_rent_contract where `tenant_id` = #{tenantId} and merchant_id is not null
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and status in
<foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")">
#{statusItem}
</foreach>
</select>


<select id="findRentByShop" parameterType="Long" resultType="hashmap">
select
rc.`id`,rc.`merchant_id`,
rc.`shop_type_sub`,rc.`lease_purpose`,rc.`contractual_rules`,rc.`delivery_date`,rc.`delivery_grace_period`,rc.`opening_date`,rc.`business_hours`,rc.`scope_metre`,
rc.`price`,rc.rent_area,rc.`rental_start_date`,rc.`rental_end_date`,rc.`sign_date`,rc.`receive_period`, rc.`receive_period_unit`,
rc.`tenant_id`,rc.`parent_tenant_id`,rc.`filepath`,rc.`status`,rc.`contract_number`,rc.`price_detail`,rc.`create_by`,rc.`update_by`,
rc.`first_party_bank_info`,rc.`second_party_bank_info`,rc.`second_party_tax_info`,rc.`free_period_remark`,
rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`,
rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`,
rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`,
rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`revenue_ratio`,rc.`revenue_ratio_way`,rc.`revenue_ratio_set`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`,
rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`,`rc.end_contract_time`,rc.`revenue_jumps_remark`,
rc.`apply_status`,rc.`bank_name`,rc.`fix_start_date`,rc.`fix_end_date`,
rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type,
rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,
rc.bussiness_management_fee,rc.bussiness_management_fee_ratio_way,rc.bussiness_management_fee_ratio,
rc.operating_management_fee,rc.operating_management_fee_ratio_way,rc.operating_management_fee_ratio,rc.out_date_notify_days,rc.out_date_notify_phone
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_rent_contract rc on rc.merchant_id = m.id and rc.is_del=0
where s.`id` = #{shopId}
and rc.`status` in (2,3)
and rc.`rental_start_date` &lt;= now() and rc.rental_end_date >= now()
order by rc.`updatetime` desc;
</select>

<select id="currentValidByMerchantId" parameterType="com.iformall.domain.po.WxRentContract" resultType="hashmap">
select
rc.`id`,rc.`merchant_id`,
rc.`shop_type_sub`,rc.`lease_purpose`,rc.`contractual_rules`,rc.`delivery_date`,rc.`delivery_grace_period`,rc.`opening_date`,rc.`business_hours`,rc.`scope_metre`,
rc.`price`,rc.rent_area,rc.`rental_start_date`,rc.`rental_end_date`,rc.`sign_date`,rc.`receive_period`, rc.`receive_period_unit`,
rc.`tenant_id`,rc.`parent_tenant_id`,rc.`filepath`,rc.`status`,rc.`contract_number`,rc.`price_detail`,rc.`create_by`,rc.`update_by`,
rc.`first_party_bank_info`,rc.`second_party_bank_info`,rc.`second_party_tax_info`,rc.`revenue_jumps_remark`,
rc.`property_name`,rc.`property_fee`,rc.`fee_cycle`,rc.`water_fee`,rc.`electricity_fees`,rc.`free_period_remark`,
rc.`deposit`,rc.cashtype_content_lsit,rc.cashtype_lsit,rc.`pay_date`,rc.`is_del`,rc.`merchant_name`,
rc.`brand`,rc.`business_id`,rc.`shop_type`,rc.`shop_type_str`,rc.`updatetime`,rc.`createtime`,rc.`link_person`,rc.`link_phone`,rc.`link_address`,
rc.`pay_account`,rc.`filename`,rc.`lease`,rc.`type`,rc.`revenue`,rc.`revenue_ratio`,rc.`revenue_ratio_way`,rc.`revenue_ratio_set`,rc.`adjust_ratio`,rc.`adjust_period`,rc.`pay_ratio`,
rc.`start_date`,rc.`end_date`,rc.`shop_name`,rc.`from_id`,rc.`end_contract_time`,
rc.`apply_status`,rc.`bank_name`,rc.`fix_start_date`,rc.`fix_end_date`,
rc.`business_type`,rc.`rent_info`, rc.`file_names`,rc.price_unit,rent_price,rc.other_rent_price_info,rc.`subject_name`,rc.rent_start_type,
rc.`rent_input_way`,rc.`adjust_ratio_way`,rc.`operation_type`,rc.late_pay_ratio,rc.late_pay_day,
rc.bussiness_management_fee,rc.bussiness_management_fee_ratio_way,rc.bussiness_management_fee_ratio,
rc.operating_management_fee,rc.operating_management_fee_ratio_way,rc.operating_management_fee_ratio,rc.out_date_notify_days,rc.out_date_notify_phone
from wx_rent_contract rc
where rc.is_del = 0
<if test=" null != tenantId and '' != tenantId">
and rc.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and rc.`parent_tenant_id` = #{parentTenantId}
</if>
and rc.`merchant_id` = #{merchantId}
<if test=" null != shopNumber and shopNumber!=''">
and rc.shop_name like concat('%',#{shopNumber},'%')
</if>
and rc.`rental_start_date` &lt;= now() and rc.rental_end_date >= now()
<if test=" null != statuss ">
and rc.`status` in
<foreach collection="statuss" index="index" item="statusItem" open="(" separator="," close=")">
#{statusItem}
</foreach>
</if>
</select>
<select id="getUsedRentShopIds" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long">
SELECT distinct shop_id FROM wx_rent_contract WHERE status in(1,2,3,4,8)
<if test=" null != tenantId and '' != tenantId">


+ 12
- 0
mallinkService/src/main/resources/mapper/WxShopUsersMapper.xml Zobrazit soubor

@@ -63,6 +63,13 @@
<if test=" null != status">
and `status` = #{status}
</if>
<if test=" null != shopIds ">
and shop_id in
<foreach collection="shopIds" index="index" item="sidItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>

<if test=" null != ids ">
and id in
@@ -79,4 +86,9 @@
from wx_shop_users
<include refid="dynamicWhereConditions"/>
</select>
<select id="findShopIdList" parameterType="com.iformall.domain.po.WxShopUsers" resultType="Long">
select distinct shop_id
from wx_shop_users
<include refid="dynamicWhereConditions"/>
</select>
</mapper>

Načítá se…
Zrušit
Uložit