| @@ -154,7 +154,7 @@ public class ShiroConfig { | |||||
| filterChainDefinitionMap.put("/logout", "authc"); | filterChainDefinitionMap.put("/logout", "authc"); | ||||
| // filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); | // filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); | ||||
| filterChainDefinitionMap.put("/**", "anon"); | |||||
| // filterChainDefinitionMap.put("/**", "anon"); | |||||
| shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); | shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); | ||||
| @@ -618,6 +618,28 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| return new ResultData(Result.ERROR,e.getMessage()); | return new ResultData(Result.ERROR,e.getMessage()); | ||||
| } | } | ||||
| //如果是租金+物业合同,如果没有物业合同或者物业合同不是草稿状态,不能提交审核 | |||||
| if (rentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | |||||
| if (null == wxRentContract.getPropertyId()) { | |||||
| return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); | |||||
| } | |||||
| WxPropertyContract property = wxPropertyContractService.getSimpleDetail(wxRentContract.getPropertyId()); | |||||
| if (null == property) { | |||||
| return new ResultData(Result.ERROR,"未创建物业合同,请先完善。"); | |||||
| } | |||||
| if (property.getStatus().intValue() == EnumRentContractStatus.UNWRITE.getCode().intValue()) { | |||||
| return new ResultData(Result.ERROR,"物业合同未完善,请先完善。"); | |||||
| } | |||||
| if (property.getStatus().intValue() != EnumRentContractStatus.DRAFT.getCode().intValue()) { | |||||
| return new ResultData(Result.ERROR,"物业合同当前状态不能提交审批。"); | |||||
| } | |||||
| WxPropertyContract wpc = new WxPropertyContract(); | |||||
| wpc.setStatus(EnumRentContractStatus.DRAFT.getCode()); | |||||
| wpc.setRentContractId(rentContract.getId()); | |||||
| wpc.setOperationType(EnumRentShopType.SHOP.getCode()); | |||||
| List<WxPropertyContract> list = wxPropertyContractService.findList(wpc); | |||||
| } | |||||
| if(rentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | if(rentContract.getOperationType().intValue() == EnumContractOperationType.PART.getCode().intValue()) { | ||||
| if (rentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | if (rentContract.getRentShopType().intValue() == EnumRentShopType.SHOP.getCode().intValue()) { | ||||
| @@ -48,6 +48,7 @@ public class ContractSchedule { | |||||
| try { | try { | ||||
| //租金合同 | //租金合同 | ||||
| wxRentContractService.outDateContract(wxMall); | wxRentContractService.outDateContract(wxMall); | ||||
| wxRentContractService.readyToNomal(wxMall); | |||||
| }catch(Exception e) { | }catch(Exception e) { | ||||
| log.error("rentcontract outDate error.",e); | log.error("rentcontract outDate error.",e); | ||||
| } | } | ||||
| @@ -21,15 +21,11 @@ import java.util.List; | |||||
| @TableName(value = "wx_mall") | @TableName(value = "wx_mall") | ||||
| @Data | @Data | ||||
| @EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
| public class WxMall extends BaseEntity { | |||||
| public class WxMall extends TenantEntity { | |||||
| @TableId(type= IdType.AUTO) | @TableId(type= IdType.AUTO) | ||||
| protected Long id; | protected Long id; | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="父租户ID",name="parentTenantId") | |||||
| private String parentTenantId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="商场名",name="name") | @io.swagger.annotations.ApiModelProperty(value="商场名",name="name") | ||||
| private String name; | private String name; | ||||
| @TableField(value = "`group`") | @TableField(value = "`group`") | ||||
| @@ -88,6 +88,8 @@ public interface WxPropertyContractService { | |||||
| void outDateContract(WxMall wxMall); | void outDateContract(WxMall wxMall); | ||||
| void readyToNomal(WxMall wxMall); | |||||
| WxPropertyContract getSimpleDetail(@Param("id") Long id); | WxPropertyContract getSimpleDetail(@Param("id") Long id); | ||||
| void updatePropertyContract(WxPropertyContract record); | void updatePropertyContract(WxPropertyContract record); | ||||
| @@ -110,6 +110,12 @@ public interface WxRentContractService { | |||||
| */ | */ | ||||
| void outDateContract(WxMall wxMall); | void outDateContract(WxMall wxMall); | ||||
| /** | |||||
| * 已签约未计租 变为计租中 | |||||
| * @param wxMall | |||||
| */ | |||||
| void readyToNomal(WxMall wxMall); | |||||
| WxRentContract getSimpleDeatil(Long id); | WxRentContract getSimpleDeatil(Long id); | ||||
| /** | /** | ||||
| @@ -1135,6 +1135,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| //查询有计租合同的商户 | //查询有计租合同的商户 | ||||
| WxPropertyContract wr = new WxPropertyContract(); | WxPropertyContract wr = new WxPropertyContract(); | ||||
| wr.setStatuss(EnumRentContractStatus.getValidStatus()); | wr.setStatuss(EnumRentContractStatus.getValidStatus()); | ||||
| wr.updateTenantInfo(wxMall); | |||||
| List<WxPropertyContract> contractList = wxPropertyContractMapper.findList(wr); | List<WxPropertyContract> contractList = wxPropertyContractMapper.findList(wr); | ||||
| for (WxPropertyContract contract: contractList) { | for (WxPropertyContract contract: contractList) { | ||||
| try { | try { | ||||
| @@ -1159,6 +1160,26 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| public void updatePropertyContract(WxPropertyContract record) { | public void updatePropertyContract(WxPropertyContract record) { | ||||
| wxPropertyContractMapper.updateById(record); | wxPropertyContractMapper.updateById(record); | ||||
| } | } | ||||
| @Override | |||||
| public void readyToNomal(WxMall wxMall) { | |||||
| WxPropertyContract wr = new WxPropertyContract(); | |||||
| wr.setStatus(EnumRentContractStatus.READY_FOR_PAING.getCode()); | |||||
| wr.updateTenantInfo(wxMall); | |||||
| List<WxPropertyContract> contractList = wxPropertyContractMapper.findList(wr); | |||||
| for (WxPropertyContract contract: contractList) { | |||||
| try { | |||||
| if (contract.getRentalStartDate().before(new Date())) { | |||||
| contract.setStatus(EnumRentContractStatus.PAING.getCode()); | |||||
| wxPropertyContractMapper.updateById(contract); | |||||
| } | |||||
| }catch(Exception e) { | |||||
| logger.error("WxPropertyContract["+contract.getId()+"] outDateContract error.",e); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -2517,6 +2517,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //查询有计租合同的商户 | //查询有计租合同的商户 | ||||
| WxRentContract wr = new WxRentContract(); | WxRentContract wr = new WxRentContract(); | ||||
| wr.setStatuss(EnumRentContractStatus.getValidStatus()); | wr.setStatuss(EnumRentContractStatus.getValidStatus()); | ||||
| wr.updateTenantInfo(wxMall); | |||||
| List<Long> merchantIds = wxRentContractMapper.getMerchantIdsByStatuss(wr); | List<Long> merchantIds = wxRentContractMapper.getMerchantIdsByStatuss(wr); | ||||
| for (Long mid: merchantIds) { | for (Long mid: merchantIds) { | ||||
| if (null == mid) { | if (null == mid) { | ||||
| @@ -2569,6 +2570,22 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void readyToNomal(WxMall wxMall) { | |||||
| WxRentContract wr = new WxRentContract(); | |||||
| wr.setStatus(EnumRentContractStatus.READY_FOR_PAING.getCode()); | |||||
| wr.updateTenantInfo(wxMall); | |||||
| List<WxRentContract> rentList = wxRentContractMapper.findList(wr); | |||||
| if (null != rentList && rentList.size() > 0 ) { | |||||
| for (WxRentContract wrc : rentList) { | |||||
| if (wrc.getRentalStartDate().before(new Date())) { | |||||
| wrc.setStatus(EnumRentContractStatus.PAING.getCode()); | |||||
| wxRentContractMapper.updateStatus(wrc); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | @Override | ||||
| public WxRentContract getSimpleDeatil(Long id) { | public WxRentContract getSimpleDeatil(Long id) { | ||||
| return wxRentContractMapper.selectById(id); | return wxRentContractMapper.selectById(id); | ||||
| @@ -2593,4 +2610,5 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| return exists; | return exists; | ||||
| } | } | ||||
| } | } | ||||