Procházet zdrojové kódy

fix

release_toaliyun_real
winter před 1 rokem
rodič
revize
80525e4fb9
9 změnil soubory, kde provedl 188 přidání a 55 odebrání
  1. +15
    -0
      mallinkBApi/src/main/java/com/iformall/controller/BaseController.java
  2. +2
    -0
      mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java
  3. +110
    -26
      mallinkBApi/src/main/java/com/iformall/controller/WxMallAdminController.java
  4. +6
    -0
      mallinkService/src/main/java/com/iformall/service/WxChartDataService.java
  5. +2
    -0
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  6. +23
    -29
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  7. +23
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  8. +1
    -0
      mallinkService/src/main/java/com/iformall/utils/Constant.java
  9. +6
    -0
      mallinkService/src/main/resources/mapper/WxShopMapper.xml

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

@@ -9,6 +9,7 @@ import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumAppPlat;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.exception.MallinkException;
import com.iformall.service.MallUserInfoService;
import com.iformall.service.SysConfigService;
import com.iformall.service.WxAppinfoService;
import com.iformall.service.WxMerchantBUserService;
@@ -212,4 +213,18 @@ public class BaseController {
}
}
}
public void setLoginMallUserInfo(MallUserInfo user) {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
request.setAttribute(Constant.REQUEST_MALL_USER_KEY, user);
}
public MallUserInfo getLoginMallUserInfo() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
MallUserInfo user = (MallUserInfo) request.getAttribute(Constant.REQUEST_MALL_USER_KEY);
if (null == user) {
throw new MallinkException(ErrorCode.USER_IS_EMPTY.getCode(),"商管登录用户不存在");
}
return user;
}
}

+ 2
- 0
mallinkBApi/src/main/java/com/iformall/controller/WxInfoController.java Zobrazit soubor

@@ -290,6 +290,8 @@ public class WxInfoController extends BaseController {

user.setBopenId(buser.getOpenId());
mallUserInfoService.saveOrUpdate(user);
setLoginMallUserInfo(user);
return new ResultData(resultMap);
} else {
return new ResultData(ErrorCode.USER_NO_PERMISSION.getCode(),user.getName()+"不是超管或者没有"+EnumMenuType.MOBILE_ADMIN.getMessage()+"的权限", resultMap);


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

@@ -14,10 +14,12 @@ import com.iformall.domain.po.WxBillAction;
import com.iformall.domain.po.WxFlowModel;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxMerchantBUser;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.po.WxUserDataRule;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxBillAll;
import com.iformall.domain.vo.WxBillHotNotify;
import com.iformall.domain.vo.WxBillSum;
import com.iformall.enums.EnumBillAllType;
import com.iformall.enums.EnumBillOweOrNearType;
import com.iformall.enums.EnumBillUpdateType;
@@ -35,6 +37,7 @@ import com.iformall.service.SysConfigService;
import com.iformall.service.WxBillActionService;
import com.iformall.service.WxBillAllService;
import com.iformall.service.WxBillSettleService;
import com.iformall.service.WxChartDataService;
import com.iformall.service.WxFlowService;
import com.iformall.service.WxMerchantService;
import com.iformall.service.WxUserDataRuleService;
@@ -51,7 +54,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -82,13 +87,10 @@ public class WxMallAdminController extends BaseController {
private MallPermissionService mallPermissionService;
@Autowired
WxUserDataRuleService wxUserDataRuleService;
@Autowired
private WxChartDataService wxChartDataService;
private MallUserInfo getMallUserByPhone(String phone,TenantEntity tenantEntity) {
MallUserInfo user = mallUserInfoService.getByPhone(phone, tenantEntity);
return user;
}
private WxUserDataRule getCurrentDataFloors(MallUserInfo user) {
if (null != user.getIsAdmin() && user.getIsAdmin().intValue() == EnumYesOrNo.YES.getCode().intValue()) {
return null;
@@ -100,6 +102,16 @@ public class WxMallAdminController extends BaseController {
}
return byUserId;
}
private void setQueryDataRule(TenantEntity tenantEntity) {
MallUserInfo userInfo = this.getLoginMallUserInfo();
tenantEntity.updateTenantInfo(userInfo);
WxUserDataRule dataRule = this.getCurrentDataFloors(userInfo);
if (null != dataRule) {
tenantEntity.setFloorForRule(dataRule.getFloorIds());
tenantEntity.setBusinessForRule(dataRule.getBussinessIds());
}
}
/**
* 获取权限
@@ -107,16 +119,8 @@ public class WxMallAdminController extends BaseController {
*/
@GetMapping("menus")
public ResultData menus(String phone) {
if (StringUtils.isBlank(phone) || "undefined".equals(phone)) {
return new ResultData(Result.ERROR,"参数非法");
}
MallUserInfo userInfo = getMallUserByPhone(phone,this.getTenantInfo());
if (null == userInfo) {
return new ResultData(Result.ERROR,"手机号["+phone+"]非绑定后台管理员账号");
}
MallUserInfo userInfo = this.getLoginMallUserInfo();
List<Long> bpermissions = mallPermissionService.getIdsByParentId(EnumMenuType.MOBILE_ADMIN.getCode().longValue());
MallUserRole ur = new MallUserRole();
ur.setUid(userInfo.getId());
List<MallUserRole> userRoles = mallUserRoleService.getList(ur);
@@ -142,21 +146,101 @@ public class WxMallAdminController extends BaseController {
*/
@GetMapping("notifyList")
public ResultData notifyList(@ModelAttribute WxMerchant wxMerchant) {
if (StringUtils.isBlank(wxMerchant.getPhone()) || "undefined".equals(wxMerchant.getPhone())) {
return new ResultData(Result.ERROR,"参数非法");
setQueryDataRule(wxMerchant);
return new ResultData(billAllHelper.getBillNotifyList(wxMerchant,EnumYesOrNo.YES.getCode()));
}
private Integer getOweBillBeforeDays() {
SysConfig config = sysConfigService.getByKey(SysConfigConstant.bill_before_days, getTenantInfo());
Integer oweBillBeforeDays = 0 ;
if (null != config && null != config.getConfigItemValue()) {
oweBillBeforeDays = Integer.parseInt(config.getConfigItemValue());
}
return oweBillBeforeDays;
}
private Integer getNearBillBeforeDays() {
SysConfig lqconfig = sysConfigService.getByKey(SysConfigConstant.bill_near_days, getTenantInfo());
Integer nearBillBeforeDays = Constant.bill_near_default_days ;
if (null != lqconfig && null != lqconfig.getConfigItemValue()) {
nearBillBeforeDays = Integer.parseInt(lqconfig.getConfigItemValue());
}
return nearBillBeforeDays;
}
private List<WxBillHotNotify> getHots(Integer nearBillBeforeDays) {
WxMerchant wxMerchant = new WxMerchant();
setQueryDataRule(wxMerchant);
wxMerchant.setOweBillBeforeDays(getOweBillBeforeDays());
wxMerchant.setNearBillBeforeDays(nearBillBeforeDays);
return billAllHelper.getHotNotify(wxMerchant);
}
//逾期账单
@GetMapping("oweBillHot")
public ResultData oweBillHot() {
return new ResultData(getHots(null));
}
//临期账单
@GetMapping("nearBillHot")
public ResultData nearBillHot() {
return new ResultData(getHots(getNearBillBeforeDays()));
}
@ApiOperation("分类查询账单")
@GetMapping("listBill")
public ResultData listBill(@ModelAttribute WxMerchant wxMerchant,Integer billTypeValue, Integer pageNum, Integer pageSize) {
setQueryDataRule(wxMerchant);
if (null == billTypeValue) {
return new ResultData(Result.ERROR,"请选择分类");
}
MallUserInfo userInfo = getMallUserByPhone(wxMerchant.getPhone(),this.getTenantInfo());
if (null == userInfo) {
return new ResultData(Result.ERROR,"手机号["+wxMerchant.getPhone()+"]非绑定后台管理员账号");
EnumBillAllType btype;
if (billTypeValue.intValue() == Constant.bill_all_type_manage_fee) {
btype = EnumBillAllType.RENT_BUSSINESS_MANAGE;
}else {
btype = EnumBillAllType.getEnum(billTypeValue);
if (null == btype) {
return new ResultData(Result.ERROR,"分类非法");
}
}
WxUserDataRule dataRule = this.getCurrentDataFloors(userInfo);
if (null != dataRule) {
wxMerchant.setFloorForRule(dataRule.getFloorIds());
wxMerchant.setBusinessForRule(dataRule.getBussinessIds());
}
return new ResultData(billAllHelper.getBillNotifyList(wxMerchant,EnumYesOrNo.YES.getCode()));
return new ResultData(billAllHelper.getBillList(btype, wxMerchant,pageNum,pageSize));
}
//账单汇总
@GetMapping("billSum")
public ResultData billSum(@ModelAttribute WxMerchant wxMerchant) {
setQueryDataRule(wxMerchant);
Date starttime = wxMerchant.getStarttime();
Date enttime = wxMerchant.getEndtime();
WxBillSum rentSum = billAllHelper.getBillRentSum(wxMerchant,starttime, enttime);
WxBillSum rentManageSum = billAllHelper.getBillRentManageSum(wxMerchant, starttime, enttime,null);
WxBillSum rentDepositSum = billAllHelper.getBillDepositSum(wxMerchant, starttime, enttime);
WxBillSum propertySum = billAllHelper.getBillPropertySum(wxMerchant, starttime, enttime);
WxBillSum propertyDepositSum = billAllHelper.getBillPropertyDepositSum(wxMerchant, starttime, enttime);
WxBillSum dailySum = billAllHelper.getBillDailySum(wxMerchant, starttime, enttime,null);
WxBillSum otherSum = billAllHelper.getBillOtherSum(wxMerchant, starttime, enttime);
WxBillSum otherDepositSum = billAllHelper.getBillOtherDepositSum(wxMerchant, starttime, enttime);
String needpay = billAllHelper.calcuteSum(rentSum.getNeedPay(),rentManageSum.getNeedPay(),rentDepositSum.getNeedPay(),propertySum.getNeedPay(),
propertyDepositSum.getNeedPay(),dailySum.getNeedPay(),otherSum.getNeedPay(),otherDepositSum.getNeedPay());
String paid = billAllHelper.calcuteSum(rentSum.getPaid(),rentManageSum.getPaid(),rentDepositSum.getPaid(),propertySum.getPaid(),
propertyDepositSum.getPaid(),dailySum.getPaid(),otherSum.getPaid(),otherDepositSum.getPaid());
String owe = billAllHelper.calcuteSum(rentSum.getOwe(),rentManageSum.getOwe(),rentDepositSum.getOwe(),propertySum.getOwe(),
propertyDepositSum.getOwe(),dailySum.getOwe(),otherSum.getOwe(),otherDepositSum.getOwe());
Map retMap = new HashMap();
retMap.put("needPay", needpay);
retMap.put("paid", paid);
retMap.put("owe", owe);
return new ResultData(retMap);
}
//租赁情况汇总
@GetMapping("rent")
public ResultData rent(@ModelAttribute WxShop wxMerchant) {
WxShop wxShop = new WxShop();
setQueryDataRule(wxShop);
return wxChartDataService.getIndexShopRentData(wxShop);
}
}

+ 6
- 0
mallinkService/src/main/java/com/iformall/service/WxChartDataService.java Zobrazit soubor

@@ -1,6 +1,8 @@
package com.iformall.service;

import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.WxShop;
import com.iformall.domain.po.base.TenantEntity;
import com.iformall.enums.EnumChartType;

@@ -25,5 +27,9 @@ public interface WxChartDataService {
ResultData queryMonthVos(EnumChartType chartType, TenantEntity tenantEntity);

ResultData queryData(Map<String, String> params);
ResultData getRentRate(WxShop wxShop);
ResultData getIndexShopRentData(WxShop wxShop);

}

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

@@ -112,5 +112,7 @@ public interface WxShopService {
Map<Long,WxShop> findShopMap(WxShop wxShop);
Map<Long,String> getMerchantShopNumberMap(TenantEntity tenantEntity,List<Long> merchantIds);
List<Long> getFloorBuildShopIds(TenantEntity tenantEntity,String floorRule,Long building,Long floor,Integer shopDel) ;

}

+ 23
- 29
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java Zobrazit soubor

@@ -265,7 +265,9 @@ public class WxChartServiceImpl implements WxChartDataService {
//String bussinessRule = paramsMap.get("bussinessRule");
//出租率
if (chart.equals(EnumChart.CZL.getCode())) {
return getRentRate(tenantEntity);
WxShop wxShop = new WxShop();
wxShop.updateTenantInfo(tenantEntity);
return getRentRate(wxShop);
}
//租金收缴率
if (chart.equals(EnumChart.ZJSJL.getCode())) {
@@ -461,7 +463,21 @@ public class WxChartServiceImpl implements WxChartDataService {

//首页商铺出租数据
if (chart.equals(EnumChart.INDEX_SHOP_RENT.getCode())) {
return getIndexShopRentData(paramsMap);
WxShop wxShop = new WxShop();
wxShop.updateTenantInfo(tenantEntity);
String building = paramsMap.get("building");
String floor = paramsMap.get("floor");
String business = paramsMap.get("businessId");
if (StringUtils.isNotEmpty(building)) {
wxShop.setBuilding(Long.valueOf(building));
}
if (StringUtils.isNotEmpty(floor)) {
wxShop.setFloor(Long.valueOf(floor));
}
if (StringUtils.isNotEmpty(business)) {
wxShop.setBusinessId(Integer.valueOf(business));
}
return getIndexShopRentData(wxShop);
}

//首页商铺出租数据
@@ -2743,13 +2759,12 @@ public class WxChartServiceImpl implements WxChartDataService {
* 出租率
* @param tenantEntity
*/
private ResultData getRentRate(TenantEntity tenantEntity) {
@Override
public ResultData getRentRate(WxShop wxShop) {
HashMap<String, Object> datamap = new HashMap<>();
//出租与未出租
int yczsize = 0;
int wczsize = 0;
WxShop wxShop = new WxShop();
wxShop.updateTenantInfo(tenantEntity);
wxShop.setStatus(EnumShopStatus.RENT.getCode());
List<WxShop> yczlist = wxShopMapper.findList(wxShop);
wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());
@@ -2774,7 +2789,7 @@ public class WxChartServiceImpl implements WxChartDataService {
}
return new ResultData(datamap);
}
/**
* 租金收缴率
* @param tenantEntity
@@ -2870,30 +2885,9 @@ public class WxChartServiceImpl implements WxChartDataService {
* @param paramMap
* @return
*/
private ResultData getIndexShopRentData(Map<String, String> paramMap) {
@Override
public ResultData getIndexShopRentData(WxShop query) {
HashMap<String, Object> datamap = new HashMap<>();
WxShop query = new WxShop();
String tenantId = paramMap.get("tenantId");
String parentTenantId = paramMap.get("parentTenantId");
String building = paramMap.get("building");
String floor = paramMap.get("floor");
String business = paramMap.get("businessId");

if (StringUtils.isNotEmpty(tenantId)) {
query.setTenantId(tenantId);
}
if (StringUtils.isNotEmpty(parentTenantId)) {
query.setParentTenantId(parentTenantId);
}
if (StringUtils.isNotEmpty(building)) {
query.setBuilding(Long.valueOf(building));
}
if (StringUtils.isNotEmpty(floor)) {
query.setFloor(Long.valueOf(floor));
}
if (StringUtils.isNotEmpty(business)) {
query.setBusinessId(Integer.valueOf(business));
}
query.setType(null);
Long total = wxShopMapper.getCountByWxShop(query);
query.setType(EnumRentShopType.SHOP.getCode());


+ 23
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Zobrazit soubor

@@ -756,4 +756,27 @@ public class WxShopServiceImpl implements WxShopService {
}
return null;
}

@Override
public List<Long> getFloorBuildShopIds(TenantEntity tenantEntity, String floorRule, Long building, Long floor,Integer shopDel) {
if (null != floorRule || null != building || null != floor) {
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);
}
List<Long> shopIds = wxShopMapper.findIdList(shopQ);
return shopIds;
}
return null;
}
}

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

@@ -60,6 +60,7 @@ public class Constant {
public static final String TENANT_ID = "TENANT_ID";
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 APP_Id = "APP_Id";
public static final String APP_NAME = "APP_NAME";


+ 6
- 0
mallinkService/src/main/resources/mapper/WxShopMapper.xml Zobrazit soubor

@@ -593,6 +593,12 @@
<if test="null != businessId and businessId!=0">
and business_id = #{businessId}
</if>
<if test=" null != floorForRule and '' != floorForRule ">
and `floor` in (${floorForRule})
</if>
<if test=" null != businessForRule and '' != businessForRule ">
and `business_id` in (${businessForRule})
</if>
</select>

<update id="updateUnRentByIds" parameterType="Long">


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