Browse Source

fix

release_toaliyun_real
winter 1 year ago
parent
commit
1511064434
6 changed files with 54 additions and 25 deletions
  1. +1
    -1
      mallinkAdmin/src/main/java/com/iformall/config/ShiroConfig.java
  2. +11
    -11
      mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java
  3. +0
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java
  4. +4
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxFeesStandards.java
  5. +1
    -1
      mallinkService/src/main/java/com/iformall/service/helper/WxRentContractHelper.java
  6. +37
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java

+ 1
- 1
mallinkAdmin/src/main/java/com/iformall/config/ShiroConfig.java View File

@@ -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);


+ 11
- 11
mallinkAdmin/src/main/java/com/iformall/controller/base/BaseController.java View File

@@ -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);


+ 0
- 1
mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java View File

@@ -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();


+ 4
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxFeesStandards.java View File

@@ -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";
}


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

@@ -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);


+ 37
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java View File

@@ -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<WxBillProperty> 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<WxBillProperty> buildRentMonth(WxMerchant wxMerchant, Long userId, WxPropertyContract wxPropertyContract, int receivePeriod, Integer lease, Date rentalStartDate, String price, Integer isPreview,boolean saveDb) {
public List<WxBillProperty> 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<String, Object> 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<Long> shopids = wxPropertyContract.shopIdsByShop();
WxShop sq = new WxShop();
sq.updateTenantInfo(wxPropertyContract);
sq.setIds(shopids);
List<WxShop> 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);


Loading…
Cancel
Save