diff --git a/mallinkAdmin/src/main/java/com/iformall/config/ShiroConfig.java b/mallinkAdmin/src/main/java/com/iformall/config/ShiroConfig.java index 665b9c906..b031c8ce9 100644 --- a/mallinkAdmin/src/main/java/com/iformall/config/ShiroConfig.java +++ b/mallinkAdmin/src/main/java/com/iformall/config/ShiroConfig.java @@ -162,7 +162,7 @@ public class ShiroConfig { filterChainDefinitionMap.put("/logout", "authc"); filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); - filterChainDefinitionMap.put("/**", "anon"); +// filterChainDefinitionMap.put("/**", "anon"); shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java b/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java index 247597318..fa0b4e34a 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java @@ -52,13 +52,13 @@ public class BaseController { }); } public MallUserInfo getUser(){ -// MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); - MallUserInfo user = new MallUserInfo(); - user.setId(321127266275430400L); - user.setName("alitest"); - user.setTenantId("789"); - user.setParentTenantId(null); - user.setIsAdmin(1); + MallUserInfo user = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); +// MallUserInfo user = new MallUserInfo(); +// user.setId(321127266275430400L); +// user.setName("alitest"); +// user.setTenantId("789"); +// user.setParentTenantId(null); +// user.setIsAdmin(1); return user; } @@ -80,10 +80,10 @@ public class BaseController { */ public TenantEntity getTenantInfo(){ Session session = SecurityUtils.getSubject().getSession(); -// String tenantId = (String)session.getAttribute(UserSession.tenantId); -// String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId); - String tenantId = "789"; - String parentTenantId = null; + String tenantId = (String)session.getAttribute(UserSession.tenantId); + String parentTenantId = (String)session.getAttribute(UserSession.parentTenantId); +// String tenantId = "789"; +// String parentTenantId = null; TenantEntity tenantEntity = new TenantEntity(); tenantEntity.setTenantId(tenantId); tenantEntity.setParentTenantId(parentTenantId); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java index 138ea289e..1433197d7 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java @@ -247,7 +247,6 @@ public class WxPropertyContractController extends WxContractBaseController { if (null == wxPropertyContract.getId()) { return new ResultData(Result.ERROR,"id不能为空"); } - MallUserInfo user = getUser(); wxPropertyContract.updateTenantInfo(user); wxPropertyContract.setAdjustPeriodHandle(); diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxFeesStandards.java b/mallinkService/src/main/java/com/iformall/domain/po/WxFeesStandards.java index 72e0c4ce6..cee685dbe 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxFeesStandards.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxFeesStandards.java @@ -94,7 +94,10 @@ public class WxFeesStandards extends TenantEntity { return ""; } - public String calcuteTotalMoney(Integer decimalSize,Date start,Date end,String count) { + public String calcuteTotalMoney(Integer decimalSize,Date start,Date end,String count,boolean isFixed) { + if (isFixed) { + return this.price; + } if (StringUtils.isBlank(count)) { count = "1"; } diff --git a/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java b/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java index 058d9fddc..2bb2d7807 100644 --- a/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java +++ b/mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java @@ -491,7 +491,7 @@ public class WxRentContractHelper { if (fees.getFixedPrice().intValue() == EnumYesOrNo.YES.getCode().intValue() && null != billStartDate && null != billEndDate) { vo.setStart(billStartDate); vo.setEnd(billEndDate); - vo.setTotal(fees.calcuteTotalMoney(decimalSize, billStartDate, billEndDate, "1")); + vo.setTotal(fees.calcuteTotalMoney(decimalSize, billStartDate, billEndDate, "1",true)); vo.setReceiveDate(DateUtils.getDaySet(billStartDate,Calendar.DATE,-1)); vo.setFeeStandards(fees); retList.add(vo); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 633575957..fb4e27478 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -393,6 +393,18 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService //删除预账单,重新生成 wxBillPropertyMapper.deleteBillByContract(record); //重新生成 + WxPropertyContract propertyContract = wxPropertyContractMapper.selectById(wxPropertyContract.getId()); + if (null == propertyContract) { + return new ResultData(Result.ERROR,"id无效"); + } + record.setRentalStartDate(propertyContract.getRentalStartDate()); + record.setRentalEndDate(propertyContract.getRentalEndDate()); + record.setRentStartType(propertyContract.getRentStartType()); + record.setStartDate(propertyContract.getStartDate()); + record.setAdjustPeriod(propertyContract.getAdjustPeriod()); + record.setCreateType(propertyContract.getCreateType()); + record.setShopIds(propertyContract.getShopIds()); + record.setFeeStandards(propertyContract.getFeesStardarsList()); List billList = buildProperty(new WxMerchant(),userId,record,EnumIsPreview.YES.getCode(),true); record.setPreviewBillRentList(billList); } @@ -540,15 +552,30 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService return JSONObject.toJSONString(shopInfo); } - public List buildRentMonth(WxMerchant wxMerchant, Long userId, WxPropertyContract wxPropertyContract, int receivePeriod, Integer lease, Date rentalStartDate, String price, Integer isPreview,boolean saveDb) { + public List buildRentMonth(WxMerchant wxMerchant, Long userId,WxPropertyContract wxPropertyContract, int receivePeriod, Integer lease, Date rentalStartDate, String price, Integer isPreview,boolean saveDb) { String adjustRatio = wxPropertyContract.getAdjustRatio(); - String rentInfo = wxPropertyContract.getRentInfo(); Map shopInfo = new HashMap<>(); - if (rentInfo != null) { - JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); - for (int i = 0, size = rentInfoArray.size(); i < size; i++) { - JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); - shopInfo.put(rentInfoObject.getString("shopNumber"), rentInfoObject.get("buildArea")); + if (wxPropertyContract.getCreateType().intValue() == EnumPropertyCreateType.BY_SHOP.getCode().intValue()) { + List shopids = wxPropertyContract.shopIdsByShop(); + WxShop sq = new WxShop(); + sq.updateTenantInfo(wxPropertyContract); + sq.setIds(shopids); + List shs = wxShopMapper.findList(sq); + if (null != shs && shs.size() > 0 ) { + for (int i = 0 ; i < shs.size() ; i ++) { + WxShop s = shs.get(i); + shopInfo.put(s.getShopNumber(), s.getOperationArea()); + } + } + + }else { + String rentInfo = wxPropertyContract.getRentInfo(); + if (rentInfo != null) { + JSONArray rentInfoArray = JSONArray.parseArray(rentInfo); + for (int i = 0, size = rentInfoArray.size(); i < size; i++) { + JSONObject rentInfoObject = rentInfoArray.getJSONObject(i); + shopInfo.put(rentInfoObject.getString("shopNumber"), rentInfoObject.get("buildArea")); + } } } @@ -813,11 +840,11 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService WxBillFeesStandardsListVo bfsvo = unFixedList.get(j); WxFeesStandards feeStandars = bfsvo.getFeeStandards(); if(EnumFeesStandardsCalcuteUnit.MM.getCode().intValue() == feeStandars.getCalcuteUnit().intValue()) { - bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,wxPropertyContract.getRentArea())); + bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,wxPropertyContract.getRentArea(),false)); }else if (EnumFeesStandardsCalcuteUnit.HU.getCode().intValue() == feeStandars.getCalcuteUnit().intValue()) { - bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1")); + bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1",false)); }else { - bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1")); + bfsvo.setTotal(feeStandars.calcuteTotalMoney(wxPropertyContract.getDecimalSize(), start, end,"1",false)); } bfsvo.setStart(start); bfsvo.setEnd(end);