| @@ -186,7 +186,8 @@ public class WxMerchantController extends BaseController { | |||
| @SystemControllerLog(description = "商户-更新") | |||
| public ResultData updateMerchant(@RequestBody WxMerchant wxMerchant) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchant"); | |||
| wxMerchant.updateTenantInfo(getTenantInfo()); | |||
| //wxMerchant.updateTenantInfo(getTenantInfo()); | |||
| wxMerchant.setTenantId("789"); | |||
| return wxMerchantService.updateMerchant(wxMerchant); | |||
| } | |||
| @@ -1,5 +1,7 @@ | |||
| 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; | |||
| @@ -9,9 +11,12 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| 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.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||
| import com.iformall.enums.EnumContractOperationType; | |||
| import com.iformall.enums.EnumContractType; | |||
| @@ -25,10 +30,16 @@ import com.iformall.enums.EnumRentStartType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import com.iformall.service.WxMallBuildingService; | |||
| import com.iformall.service.WxMallFloorService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import com.iformall.service.WxShopService; | |||
| 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; | |||
| @@ -37,6 +48,7 @@ import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| @@ -58,6 +70,12 @@ public class WxPropertyContractController extends WxContractBaseController { | |||
| private WxPropertyContractMapper wxPropertyContractMapper; | |||
| @Autowired | |||
| private WxRentPropertyContractService wxRentPropertyContractService; | |||
| @Autowired | |||
| WxMallBuildingService buildingService; | |||
| @Autowired | |||
| WxMallFloorService floorService; | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @UserDataRuleAnnotation("property_contract_list") | |||
| @GetMapping("/list") | |||
| @@ -84,6 +102,57 @@ public class WxPropertyContractController extends WxContractBaseController { | |||
| } | |||
| } | |||
| 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); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -1,5 +1,7 @@ | |||
| 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.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| @@ -74,6 +76,10 @@ public class WxRentContractController extends WxContractBaseController { | |||
| private WxShopService wxShopService; | |||
| @Autowired | |||
| WxPropertyContractService wxPropertyContractService; | |||
| @Autowired | |||
| WxMallBuildingService buildingService; | |||
| @Autowired | |||
| WxMallFloorService floorService; | |||
| @UserDataRuleAnnotation("rent_contract_list") | |||
| @GetMapping("/list") | |||
| @@ -100,6 +106,55 @@ public class WxRentContractController extends WxContractBaseController { | |||
| } | |||
| } | |||
| 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); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -156,6 +156,10 @@ public class WxPropertyContract extends TenantEntity { | |||
| @TableField(exist = false) | |||
| 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") | |||
| private Integer priceUnit; | |||
| @@ -43,6 +43,10 @@ public class WxRentContract extends TenantEntity { | |||
| @TableField(exist = false) | |||
| private String floor; | |||
| @TableField(exist = false) | |||
| private String floorName; | |||
| @TableField(exist = false) | |||
| private String buildingName; | |||
| @TableField(exist = false) | |||
| private String brandName; | |||
| @@ -462,7 +462,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| wxMerchantMapper.updateById(wxMerchant); | |||
| //如果原来店铺在商户里面有有效的合同,则不能操作 | |||
| List<Long> oldShopIds = wxMerchantShopMapper.findShopIds(wxMerchant.getId()); | |||
| if (null != oldShopIds) { | |||
| if (null != oldShopIds && oldShopIds.size() > 0) { | |||
| for (Long osid : oldShopIds) { | |||
| WxRentContract wrc = new WxRentContract(); | |||
| 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); | |||
| wxMerchantShopMapper.realDelByMerchantId(wxMerchant.getId()); | |||
| } | |||