Browse Source

Merge branch 'release_toaliyun_real' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real

release_toaliyun_real
xhxu 5 years ago
parent
commit
da00ff63a3
10 changed files with 277 additions and 131 deletions
  1. +1
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  2. +55
    -39
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  3. +95
    -59
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  4. +82
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java
  5. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql
  6. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java
  7. +1
    -1
      mallinkService/src/main/java/com/iformall/service/WxPropertyContractService.java
  8. +17
    -15
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  9. +15
    -11
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java
  10. +6
    -4
      mallinkService/src/main/resources/mapper/WxMallBuildingMapper.xml

+ 1
- 2
mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java View File

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



+ 55
- 39
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java View File

@@ -107,44 +107,59 @@ public class WxPropertyContractController extends WxContractBaseController {
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();
}
}
// 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);
// try {
// floorIds.add(Long.parseLong(o.getString("floor")));
// }catch(Exception e) {
// floorName = floorName +","+o.getString("floor");
// }
// try {
// buildIds.add(Long.parseLong(o.getString("building")));
// }catch(Exception e) {
// buildingName = buildingName + ","+ o.getString("building");
// }
// try {
// shopIds.add(Long.parseLong(o.getString("id")));
// }catch(Exception e) {
// shopNumber = shopNumber +","+o.getString("id");
// }
//
//
// }
//
// 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);
@@ -172,7 +187,7 @@ public class WxPropertyContractController extends WxContractBaseController {
if(wxPropertyContract.getRentStartType()!=null && wxPropertyContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){
wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate());
}
return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName());
return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName(),false);
}

@PostMapping("updateRentStartTime")
@@ -184,7 +199,7 @@ public class WxPropertyContractController extends WxContractBaseController {
propertyContract.updateTenantInfo(user);
propertyContract.setAdjustPeriodHandle();
propertyContract.setRentStartType(wxPropertyContract.getRentStartType());
return wxPropertyContractService.saveOrUpdate(propertyContract, user.getId(), user.getName());
return wxPropertyContractService.saveOrUpdate(propertyContract, user.getId(), user.getName(),false);
}

@PostMapping("update")
@@ -195,7 +210,7 @@ public class WxPropertyContractController extends WxContractBaseController {
wxPropertyContract.updateTenantInfo(user);
wxPropertyContract.setAdjustPeriodHandle();
//第三步提交 SWITCH
return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName());
return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName(),true);

}
@@ -228,7 +243,8 @@ public class WxPropertyContractController extends WxContractBaseController {
if (null == contract) {
return new ResultData(Result.ERROR, "合同不存在.");
}
if (contract.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() ||
if (contract.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue() ||
contract.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() ||
(contract.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue()
&& (contract.getApplyStatus().intValue() == EnumRentContractAppStatus.REJECT.getCode().intValue() ||
contract.getApplyStatus().intValue() == EnumRentContractAppStatus.SETBACK.getCode().intValue()))) {


+ 95
- 59
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java View File

@@ -1,8 +1,28 @@
package com.iformall.controller.contract;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog;
import com.iformall.annotation.TenantIgnore;
@@ -10,8 +30,15 @@ import com.iformall.annotation.UserDataRuleAnnotation;
import com.iformall.common.ErrorCode;
import com.iformall.common.Result;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.*;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxBillRent;
import com.iformall.domain.po.WxMallBuilding;
import com.iformall.domain.po.WxMallFloor;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxPayAccountBill;
import com.iformall.domain.po.WxPropertyContract;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.po.base.BaseEntity.SortField;
import com.iformall.enums.EnumContractOperationType;
@@ -28,25 +55,19 @@ import com.iformall.exception.MallinkException;
import com.iformall.mapper.WxBillPropertyMapper;
import com.iformall.mapper.WxBillRentMapper;
import com.iformall.mapper.WxRentContractMapper;
import com.iformall.service.*;
import com.iformall.service.WxBillRentService;
import com.iformall.service.WxMallBuildingService;
import com.iformall.service.WxMallFloorService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxPayAccountBillService;
import com.iformall.service.WxPropertyContractService;
import com.iformall.service.WxRentContractService;
import com.iformall.service.WxRentPropertyContractService;
import com.iformall.service.WxShopService;
import com.iformall.utils.DateUtils;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author gongbiao
@@ -108,46 +129,59 @@ public class WxRentContractController extends WxContractBaseController {
wrc.setFlowHas(hasFlow);
String renInfo = wrc.getRentInfo();
if (!StringUtils.isBlank(renInfo)) {
String floorName = "";
String buildingName = "";
String shopNumber = "";
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();
}
}
// 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);
// try {
// floorIds.add(Long.parseLong(o.getString("floor")));
// }catch(Exception e) {
// floorName = floorName +","+o.getString("floor");
// }
// try {
// buildIds.add(Long.parseLong(o.getString("building")));
// }catch(Exception e) {
// buildingName = buildingName + ","+ o.getString("building");
// }
// try {
// shopIds.add(Long.parseLong(o.getString("id")));
// }catch(Exception e) {
// shopNumber = shopNumber +","+o.getString("id");
// }
// }
//
// 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);
@@ -266,7 +300,8 @@ public class WxRentContractController extends WxContractBaseController {
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),"租赁合同未查询到");
}
if (cure.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() ||
if (cure.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()||
cure.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() ||
(cure.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue()
&& (cure.getApplyStatus().intValue()== EnumRentContractAppStatus.REJECT.getCode().intValue() ||
cure.getApplyStatus().intValue()== EnumRentContractAppStatus.SETBACK.getCode().intValue()))) {
@@ -411,7 +446,8 @@ public class WxRentContractController extends WxContractBaseController {
if (null == contract) {
return new ResultData(Result.ERROR, "合同不存在.");
}
if (contract.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() ||
if (contract.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue() ||
contract.getStatus().intValue() == EnumRentContractStatus.DRAFT.getCode().intValue() ||
(contract.getStatus().intValue() == EnumRentContractStatus.PERFORMANCE.getCode().intValue()
&& (contract.getApplyStatus().intValue() == EnumRentContractAppStatus.REJECT.getCode().intValue() ||
contract.getApplyStatus().intValue() == EnumRentContractAppStatus.SETBACK.getCode().intValue()))) {


+ 82
- 0
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java View File

@@ -1,17 +1,31 @@
package com.iformall.controller.contract;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.iformall.annotation.SystemControllerLog;
import com.iformall.annotation.UserDataRuleAnnotation;
import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.MallUserInfo;
import com.iformall.domain.po.WxMallBuilding;
import com.iformall.domain.po.WxMallFloor;
import com.iformall.domain.po.WxRentContract;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.vo.WxRentPropertyContractVo;
import com.iformall.service.WxMallBuildingService;
import com.iformall.service.WxMallFloorService;
import com.iformall.service.WxRentPropertyContractService;
import com.iformall.service.WxShopService;

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

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +41,12 @@ public class WxRentPropertyContractController extends WxContractBaseController {

@Autowired
private WxRentPropertyContractService wxRentPropertyContractService;
@Autowired
WxMallBuildingService buildingService;
@Autowired
WxMallFloorService floorService;
@Autowired
private WxShopService wxShopService;

@UserDataRuleAnnotation("rent_property_contract_list")
@GetMapping("/list")
@@ -51,6 +71,68 @@ public class WxRentPropertyContractController extends WxContractBaseController {
}
}
wrc.setFlowHas(hasFlow);
String renInfo = wrc.getRentInfo();
if (!StringUtils.isBlank(renInfo)) {
String floorName = "";
String buildingName = "";
String shopNumber = "";
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);
// try {
// floorIds.add(Long.parseLong(o.getString("floor")));
// }catch(Exception e) {
// floorName = floorName +","+o.getString("floor");
// }
// try {
// buildIds.add(Long.parseLong(o.getString("building")));
// }catch(Exception e) {
// buildingName = buildingName + ","+ o.getString("building");
// }
// try {
// shopIds.add(Long.parseLong(o.getString("id")));
// }catch(Exception e) {
// shopNumber = shopNumber +","+o.getString("id");
// }
// }
//
// 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);
}
}
}
}


+ 2
- 0
mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql View File

@@ -61,8 +61,10 @@ WHERE wrc.rent_info IS NULL AND wrc.shop_id IS NOT NULL ;

//删除店铺不存在的垃圾数据 (先查询!!!!)
DELETE FROM wx_rent_contract WHERE shop_id IS NOT NULL AND shop_id NOT IN (SELECT id FROM wx_shop);
DELETE FROM wx_property_contract WHERE shop_id IS NOT NULL AND shop_id NOT IN (SELECT id FROM wx_shop);
//删除商户不存在得垃圾数据(先查询!!!!)
delete from wx_rent_contract where merchant_id IS NOT NULL AND merchant_id not in ( select id from wx_merchant );
delete from wx_property_contract where merchant_id IS NOT NULL AND merchant_id not in ( select id from wx_merchant );

//删除租金合同不在的物业合同
delete from wx_property_contract where rent_contract_id is not null and rent_contract_id not in (


+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java View File

@@ -21,6 +21,9 @@ public class WxRentPropertyContractVo extends TenantEntity {
private Long rentId;
private Long propertyId;
private String floorName;
private String buildingName;
@io.swagger.annotations.ApiModelProperty(value = "合同编号", name = "contractNumber")
private String contractNumber;



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

@@ -48,7 +48,7 @@ public interface WxPropertyContractService {
* @param userName
* @return
*/
ResultData saveOrUpdate(WxPropertyContract record, Long userId, String userName);
ResultData saveOrUpdate(WxPropertyContract record, Long userId, String userName,boolean writeComplate);

/**
* 根据Id删除实体


+ 17
- 15
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java View File

@@ -482,21 +482,23 @@ public class WxMerchantServiceImpl implements WxMerchantService {
wxMerchantShopMapper.realDelByMerchantId(wxMerchant.getId());
}
List<Long> shopIds = wxMerchant.getShopids();
for (Long sid: shopIds) {
WxMerchantShop mcs = new WxMerchantShop();
mcs.setMerchantId(wxMerchant.getId());
mcs.setShopId(sid);
mcs.setIsDel(EnumDelStatus.NOT_DEL.getCode());
mcs.setId(idWorker.nextId());
mcs.updateTenantInfo(wxMerchant);
Date shopdate = new Date();
mcs.setUpdateDate(shopdate);
mcs.setCreateDate(shopdate);
wxMerchantShopMapper.insert(mcs);
//更新商铺状态
WxShop sh = wxShopMapper.selectById(sid);
sh.setStatus(EnumShopStatus.RENT.getCode());
wxShopMapper.updateById(sh);
if (null != shopIds) {
for (Long sid: shopIds) {
WxMerchantShop mcs = new WxMerchantShop();
mcs.setMerchantId(wxMerchant.getId());
mcs.setShopId(sid);
mcs.setIsDel(EnumDelStatus.NOT_DEL.getCode());
mcs.setId(idWorker.nextId());
mcs.updateTenantInfo(wxMerchant);
Date shopdate = new Date();
mcs.setUpdateDate(shopdate);
mcs.setCreateDate(shopdate);
wxMerchantShopMapper.insert(mcs);
//更新商铺状态
WxShop sh = wxShopMapper.selectById(sid);
sh.setStatus(EnumShopStatus.RENT.getCode());
wxShopMapper.updateById(sh);
}
}
return new ResultData(Result.SUCCESS, "商户更新成功");
} catch (Exception e) {


+ 15
- 11
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -265,7 +265,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService

@Override
@Transactional(rollbackFor = {Exception.class})
public ResultData saveOrUpdate(WxPropertyContract record, Long userId, String userName) {
public ResultData saveOrUpdate(WxPropertyContract record, Long userId, String userName,boolean writeComplate) {
// 保存调整金额(预账单调整)
boolean haspreview = false;
if(!CollectionUtils.isEmpty(record.getPreviewBillRentList())){
@@ -328,14 +328,14 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
String message;
boolean hasFlow = true;
if (record.getId() == null) {
if (record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())) {
WxPropertyContract propertyContractQuery = new WxPropertyContract();
propertyContractQuery.setRentContractId(record.getRentContractId());
int propertyContractCount = wxPropertyContractMapper.selectCount(new QueryWrapper(propertyContractQuery));
if (propertyContractCount > 0) {
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"租金合同编号["+record.getRentContractId()+"]存在关联的物业合同");
}
}
// if (record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())) {
// WxPropertyContract propertyContractQuery = new WxPropertyContract();
// propertyContractQuery.setRentContractId(record.getRentContractId());
// int propertyContractCount = wxPropertyContractMapper.selectCount(new QueryWrapper(propertyContractQuery));
// if (propertyContractCount > 0) {
// throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"租金合同编号["+record.getRentContractId()+"]存在关联的物业合同");
// }
// }
hasFlow = false;
final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId());
@@ -352,7 +352,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
// } else {
// record.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode());
// }
record.setStatus(EnumRentContractStatus.DRAFT.getCode());
record.setStatus(EnumRentContractStatus.UNWRITE.getCode());
record.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode());
try {
wxPropertyContractMapper.insert(record);
@@ -402,7 +402,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService
record.setUpdatetime(new Date());

//如果是合并合同 物业合同的状态为 意向
record.setStatus(EnumRentContractStatus.DRAFT.getCode());
if (writeComplate) {
record.setStatus(EnumRentContractStatus.DRAFT.getCode());
}else {
record.setStatus(wxPropertyContract.getStatus());
}
// if (record.getOperationType().equals(EnumContractOperationType.WHOLE.getCode())) {
// record.setStatus(EnumRentContractStatus.INTENTION.getCode());
// }


+ 6
- 4
mallinkService/src/main/resources/mapper/WxMallBuildingMapper.xml View File

@@ -55,13 +55,15 @@
<if test=" null != updateDate ">
and `update_date` = #{updateDate}
</if>
</if>
<if test=" null != ids ">
and id in
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
#{idItem}
</foreach>
</if>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>


Loading…
Cancel
Save