Browse Source

fix contract

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
b755cc8c10
7 changed files with 250 additions and 113 deletions
  1. +1
    -2
      mallinkAdmin/src/main/java/com/iformall/controller/basic/WxMerchantController.java
  2. +50
    -35
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  3. +91
    -57
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java
  4. +82
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentPropertyContractController.java
  5. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/vo/WxRentPropertyContractVo.java
  6. +17
    -15
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  7. +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);
}



+ 50
- 35
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);


+ 91
- 57
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);


+ 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);
}
}
}
}


+ 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;



+ 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) {


+ 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