| @@ -163,7 +163,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); | ||||
| @@ -52,13 +52,13 @@ public class BaseController { | |||||
| }); | }); | ||||
| } | } | ||||
| public MallUserInfo getUser(){ | 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; | return user; | ||||
| } | } | ||||
| @@ -80,10 +80,10 @@ public class BaseController { | |||||
| */ | */ | ||||
| public TenantEntity getTenantInfo(){ | public TenantEntity getTenantInfo(){ | ||||
| Session session = SecurityUtils.getSubject().getSession(); | 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 tenantEntity = new TenantEntity(); | ||||
| tenantEntity.setTenantId(tenantId); | tenantEntity.setTenantId(tenantId); | ||||
| tenantEntity.setParentTenantId(parentTenantId); | tenantEntity.setParentTenantId(parentTenantId); | ||||
| @@ -242,7 +242,7 @@ public class WxAgileContractController extends WxContractBaseController { | |||||
| ResultData result = wxAgileContractService.saveOrUpdate(wxRentContract, user); | ResultData result = wxAgileContractService.saveOrUpdate(wxRentContract, user); | ||||
| //如果是有效的合同编辑,则复制其他设置到影子合同 | //如果是有效的合同编辑,则复制其他设置到影子合同 | ||||
| if (result.code == Result.SUCCESS && null != oldRentContract && isValidEdit) { | if (result.code == Result.SUCCESS && null != oldRentContract && isValidEdit) { | ||||
| wxAgileContractService.copyContractConfig(wxRentContract.getId(), oldRentContract, user, false); | |||||
| wxAgileContractService.copyContractConfig(false,wxRentContract.getId(), oldRentContract, user, false); | |||||
| } | } | ||||
| return result; | return result; | ||||
| @@ -80,7 +80,7 @@ public interface WxAgileContractService { | |||||
| PageInfo<WxContractCustomers> getContractCustomersList(WxContractCustomers record, Integer pageIndex, Integer pageSize); | PageInfo<WxContractCustomers> getContractCustomersList(WxContractCustomers record, Integer pageIndex, Integer pageSize); | ||||
| void copyContractConfig(Long destId,WxRentContract orgContract,MallUserInfo user,boolean isReBuildUnDeposit); | |||||
| void copyContractConfig(boolean copyContractShop,Long destId,WxRentContract orgContract,MallUserInfo user,boolean isReBuildUnDeposit); | |||||
| void renewalAgile(WxRentContract wxRentContract,MallUserInfo user); | void renewalAgile(WxRentContract wxRentContract,MallUserInfo user); | ||||
| @@ -1075,20 +1075,22 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @Override | @Override | ||||
| public void copyContractConfig(Long destId,WxRentContract orgContract,MallUserInfo user,boolean isReBuildUnDeposit) { | |||||
| public void copyContractConfig(boolean copyContractShop,Long destId,WxRentContract orgContract,MallUserInfo user,boolean isReBuildUnDeposit) { | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxContractShop csq = new WxContractShop(); | |||||
| csq.updateTenantInfo(user); | |||||
| csq.setContractId(orgContract.getId()); | |||||
| List<WxContractShop> csqlist = wxContractShopMapper.findList(csq); | |||||
| if (null != csqlist && csqlist.size() > 0 ){ | |||||
| for ( int i = 0 ; i< csqlist.size() ; i ++) { | |||||
| WxContractShop cs = csqlist.get(i); | |||||
| cs.setId(idWorker.nextId()); | |||||
| cs.setContractId(destId); | |||||
| cs.setCreateDate(new Date()); | |||||
| cs.setUpdateDate(new Date()); | |||||
| wxContractShopMapper.insert(cs); | |||||
| if (copyContractShop) { | |||||
| WxContractShop csq = new WxContractShop(); | |||||
| csq.updateTenantInfo(user); | |||||
| csq.setContractId(orgContract.getId()); | |||||
| List<WxContractShop> csqlist = wxContractShopMapper.findList(csq); | |||||
| if (null != csqlist && csqlist.size() > 0 ){ | |||||
| for ( int i = 0 ; i< csqlist.size() ; i ++) { | |||||
| WxContractShop cs = csqlist.get(i); | |||||
| cs.setId(idWorker.nextId()); | |||||
| cs.setContractId(destId); | |||||
| cs.setCreateDate(new Date()); | |||||
| cs.setUpdateDate(new Date()); | |||||
| wxContractShopMapper.insert(cs); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -1270,7 +1272,7 @@ public class WxAgileContractServiceImpl implements WxAgileContractService { | |||||
| rentContract.setLease(array[0]); | rentContract.setLease(array[0]); | ||||
| wxRentContractMapper.insert(rentContract); | wxRentContractMapper.insert(rentContract); | ||||
| copyContractConfig(newContractId, rentContract, user, true); | |||||
| copyContractConfig(true,newContractId, rentContract, user, true); | |||||
| } | } | ||||
| private WxRentContractAgileRenevueItem generateRenevueItem(IdWorker idWorker,WxRentContract rentContract,Long newContractId,Long renevueId) { | private WxRentContractAgileRenevueItem generateRenevueItem(IdWorker idWorker,WxRentContract rentContract,Long newContractId,Long renevueId) { | ||||