Przeglądaj źródła

fix contract

release_toaliyun_real
xiaohanzi 5 lat temu
rodzic
commit
25e04c774d
6 zmienionych plików z 136 dodań i 3 usunięć
  1. +2
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  2. +69
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  3. +55
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  4. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java
  5. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java
  6. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java

+ 2
- 1
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java Wyświetl plik

@@ -186,7 +186,8 @@ public class WxMerchantController extends BaseController {
@SystemControllerLog(description = "商户-更新") @SystemControllerLog(description = "商户-更新")
public ResultData updateMerchant(@RequestBody WxMerchant wxMerchant) { public ResultData updateMerchant(@RequestBody WxMerchant wxMerchant) {
logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchant"); logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchant");
wxMerchant.updateTenantInfo(getTenantInfo());
//wxMerchant.updateTenantInfo(getTenantInfo());
wxMerchant.setTenantId("789");
return wxMerchantService.updateMerchant(wxMerchant); return wxMerchantService.updateMerchant(wxMerchant);
} }




+ 69
- 0
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java Wyświetl plik

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


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog; import com.iformall.annotation.SystemControllerLog;
import com.iformall.annotation.UserDataRuleAnnotation; import com.iformall.annotation.UserDataRuleAnnotation;
@@ -9,9 +11,12 @@ import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController; import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillProperty; import com.iformall.domain.po.WxBillProperty;
import com.iformall.domain.po.WxMallBuilding;
import com.iformall.domain.po.WxMallFloor;
import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPropertyContract; import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract; import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.po.base.BaseEntity.SortField; import com.iformall.domain.po.base.BaseEntity.SortField;
import com.iformall.enums.EnumContractOperationType; import com.iformall.enums.EnumContractOperationType;
import com.iformall.enums.EnumContractType; import com.iformall.enums.EnumContractType;
@@ -25,10 +30,16 @@ import com.iformall.enums.EnumRentStartType;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxPropertyContractMapper; import com.iformall.mapper.WxPropertyContractMapper;
import com.iformall.service.WxBillPropertyService; import com.iformall.service.WxBillPropertyService;
import com.iformall.service.WxMallBuildingService;
import com.iformall.service.WxMallFloorService;
import com.iformall.service.WxPropertyContractService; import com.iformall.service.WxPropertyContractService;
import com.iformall.service.WxRentPropertyContractService; import com.iformall.service.WxRentPropertyContractService;
import com.iformall.service.WxShopService;

import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -37,6 +48,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;


import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@@ -58,6 +70,12 @@ public class WxPropertyContractController extends WxContractBaseController {
private WxPropertyContractMapper wxPropertyContractMapper; private WxPropertyContractMapper wxPropertyContractMapper;
@Autowired @Autowired
private WxRentPropertyContractService wxRentPropertyContractService; private WxRentPropertyContractService wxRentPropertyContractService;
@Autowired
WxMallBuildingService buildingService;
@Autowired
WxMallFloorService floorService;
@Autowired
private WxShopService wxShopService;


@UserDataRuleAnnotation("property_contract_list") @UserDataRuleAnnotation("property_contract_list")
@GetMapping("/list") @GetMapping("/list")
@@ -84,6 +102,57 @@ public class WxPropertyContractController extends WxContractBaseController {
} }
} }
wpc.setFlowHas(hasFlow); wpc.setFlowHas(hasFlow);
String renInfo = wpc.getRentInfo();
if (!StringUtils.isBlank(renInfo)) {
JSONArray arrays = JSONArray.parseArray(renInfo);
if ( null != arrays) {
List<Long> floorIds = new ArrayList<Long>();
List<Long> buildIds = new ArrayList<Long>();
List<Long> shopIds = new ArrayList<Long>();
for (int i = 0 ; i < arrays.size(); i ++) {
JSONObject o = arrays.getJSONObject(i);
floorIds.add(Long.parseLong(o.getString("floor")));
buildIds.add(Long.parseLong(o.getString("building")));
shopIds.add(Long.parseLong(o.getString("id")));
}
String floorName = "";
String buildingName = "";
String shopNumber = "";
WxMallBuilding bq = new WxMallBuilding();
bq.setIds(buildIds);
PageInfo<WxMallBuilding> bpage = buildingService.listAsPage(bq, 1, 1000);
if (null != bpage && null != bpage.getList()) {
for (WxMallBuilding wmb : bpage.getList()) {
buildingName = buildingName +"," + wmb.getBuildingName();
}
}
WxMallFloor fq = new WxMallFloor();
fq.setIds(floorIds);
PageInfo<WxMallFloor> fpage = floorService.listAsPage(fq, 1, 1000);
if (null != fpage && null != fpage.getList()) {
for (WxMallFloor wmf : fpage.getList()) {
floorName = floorName +"," + wmf.getFloorName();
}
}
WxShop ws = new WxShop();
ws.setIds(shopIds);
PageInfo<WxShop> spage = wxShopService.listAsPage(ws, 1, 1000);
if (null != spage && null != spage.getList()) {
for (WxShop shop : spage.getList()) {
shopNumber = shopNumber+","+shop.getShopNumber();
}
}
wpc.setFloorName(floorName);
wpc.setBuildingName(buildingName);
wpc.setShopNumber(shopNumber);
}
}
} }
} }


+ 55
- 0
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java Wyświetl plik

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


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog; import com.iformall.annotation.SystemControllerLog;
@@ -74,6 +76,10 @@ public class WxRentContractController extends WxContractBaseController {
private WxShopService wxShopService; private WxShopService wxShopService;
@Autowired @Autowired
WxPropertyContractService wxPropertyContractService; WxPropertyContractService wxPropertyContractService;
@Autowired
WxMallBuildingService buildingService;
@Autowired
WxMallFloorService floorService;
@UserDataRuleAnnotation("rent_contract_list") @UserDataRuleAnnotation("rent_contract_list")
@GetMapping("/list") @GetMapping("/list")
@@ -100,6 +106,55 @@ public class WxRentContractController extends WxContractBaseController {
} }
} }
wrc.setFlowHas(hasFlow); wrc.setFlowHas(hasFlow);
String renInfo = wrc.getRentInfo();
if (!StringUtils.isBlank(renInfo)) {
JSONArray arrays = JSONArray.parseArray(renInfo);
if ( null != arrays) {
List<Long> floorIds = new ArrayList<Long>();
List<Long> buildIds = new ArrayList<Long>();
List<Long> shopIds = new ArrayList<Long>();
for (int i = 0 ; i < arrays.size(); i ++) {
JSONObject o = arrays.getJSONObject(i);
floorIds.add(Long.parseLong(o.getString("floor")));
buildIds.add(Long.parseLong(o.getString("building")));
shopIds.add(Long.parseLong(o.getString("id")));
}
String floorName = "";
String buildingName = "";
String shopNumber = "";
WxMallBuilding bq = new WxMallBuilding();
bq.setIds(buildIds);
PageInfo<WxMallBuilding> bpage = buildingService.listAsPage(bq, 1, 1000);
if (null != bpage && null != bpage.getList()) {
for (WxMallBuilding wmb : bpage.getList()) {
buildingName = buildingName +"," + wmb.getBuildingName();
}
}
WxMallFloor fq = new WxMallFloor();
fq.setIds(floorIds);
PageInfo<WxMallFloor> fpage = floorService.listAsPage(fq, 1, 1000);
if (null != fpage && null != fpage.getList()) {
for (WxMallFloor wmf : fpage.getList()) {
floorName = floorName +"," + wmf.getFloorName();
}
}
WxShop ws = new WxShop();
ws.setIds(shopIds);
PageInfo<WxShop> spage = wxShopService.listAsPage(ws, 1, 1000);
if (null != spage && null != spage.getList()) {
for (WxShop shop : spage.getList()) {
shopNumber = shopNumber+","+shop.getShopNumber();
}
}
wrc.setFloorName(floorName);
wrc.setBuildingName(buildingName);
wrc.setShopNumber(shopNumber);
}
}
} }
} }


+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java Wyświetl plik

@@ -156,6 +156,10 @@ public class WxPropertyContract extends TenantEntity {


@TableField(exist = false) @TableField(exist = false)
private String floor; private String floor;
@TableField(exist = false)
private String floorName;
@TableField(exist = false)
private String buildingName;


@io.swagger.annotations.ApiModelProperty(value = "租金单位1日2月3年", name = "priceUnit") @io.swagger.annotations.ApiModelProperty(value = "租金单位1日2月3年", name = "priceUnit")
private Integer priceUnit; private Integer priceUnit;


+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java Wyświetl plik

@@ -43,6 +43,10 @@ public class WxRentContract extends TenantEntity {


@TableField(exist = false) @TableField(exist = false)
private String floor; private String floor;
@TableField(exist = false)
private String floorName;
@TableField(exist = false)
private String buildingName;


@TableField(exist = false) @TableField(exist = false)
private String brandName; private String brandName;


+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Wyświetl plik

@@ -462,7 +462,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
wxMerchantMapper.updateById(wxMerchant); wxMerchantMapper.updateById(wxMerchant);
//如果原来店铺在商户里面有有效的合同,则不能操作 //如果原来店铺在商户里面有有效的合同,则不能操作
List<Long> oldShopIds = wxMerchantShopMapper.findShopIds(wxMerchant.getId()); List<Long> oldShopIds = wxMerchantShopMapper.findShopIds(wxMerchant.getId());
if (null != oldShopIds) {
if (null != oldShopIds && oldShopIds.size() > 0) {
for (Long osid : oldShopIds) { for (Long osid : oldShopIds) {
WxRentContract wrc = new WxRentContract(); WxRentContract wrc = new WxRentContract();
wrc.setMerchantId(wxMerchant.getId()); wrc.setMerchantId(wxMerchant.getId());
@@ -477,7 +477,7 @@ public class WxMerchantServiceImpl implements WxMerchantService {
} }
//都验证过了之后,先把之前的商铺释放,删除关系 //都验证过了之后,先把之前的商铺释放,删除关系
if (null != oldShopIds) {
if (null != oldShopIds && oldShopIds.size() > 0 ) {
wxShopMapper.updateUnRentByIds(oldShopIds); wxShopMapper.updateUnRentByIds(oldShopIds);
wxMerchantShopMapper.realDelByMerchantId(wxMerchant.getId()); wxMerchantShopMapper.realDelByMerchantId(wxMerchant.getId());
} }


Ładowanie…
Anuluj
Zapisz