| @@ -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); | ||||
| @@ -148,9 +148,14 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | if(StringUtils.isBlank(wxRentContract.getBusDiscountRatio())){ | ||||
| wxRentContract.setBusDiscountTime(new Integer(0)); | wxRentContract.setBusDiscountTime(new Integer(0)); | ||||
| } | } | ||||
| MallUserInfo user = getUser(); | |||||
| //MallUserInfo user = getUser(); | |||||
| MallUserInfo user = new MallUserInfo(); | |||||
| user.setId(321127266275430400L); | |||||
| user.setName("alitest"); | |||||
| user.setTenantId("789"); | |||||
| user.setParentTenantId("788"); | |||||
| wxRentContract.updateTenantInfo(user); | wxRentContract.updateTenantInfo(user); | ||||
| //wxRentContract.setTenantId("789"); | |||||
| wxRentContract.setAdjustPeriodHandle(); | wxRentContract.setAdjustPeriodHandle(); | ||||
| wxRentContract.setRentPriceHandle(); | wxRentContract.setRentPriceHandle(); | ||||
| Date oldDate = wxRentContract.getRentalStartDate(); | Date oldDate = wxRentContract.getRentalStartDate(); | ||||
| @@ -711,6 +716,26 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| return wxRentContractService.getContractByContractNumber(wxRentContract); | return wxRentContractService.getContractByContractNumber(wxRentContract); | ||||
| } | } | ||||
| @GetMapping("/init") | |||||
| public ResultData init() { | |||||
| List<WxRentContract> clist = wxRentContractService.findList(new WxRentContract()); | |||||
| for (WxRentContract wrc: clist) { | |||||
| List<Long> shopIds = wrc.shopIdsByRentInfo(); | |||||
| if (null != shopIds) { | |||||
| List<WxShop> shops = wxShopService.getByIds(shopIds); | |||||
| String shopName = ""; | |||||
| for (WxShop shop : shops) { | |||||
| shopName = shopName +","+shop.getShopNumber(); | |||||
| } | |||||
| if(!StringUtils.isBlank(shopName)) { | |||||
| wrc.setShopName(shopName); | |||||
| wxRentContractService.updateRentContract(wrc); | |||||
| } | |||||
| } | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| } | } | ||||
| @@ -73,6 +73,8 @@ UPDATE wx_rent_contract SET STATUS = 10 WHERE STATUS = 8 AND apply_status = 1; | |||||
| UPDATE wx_rent_contract SET STATUS = 1 WHERE STATUS = 9; | UPDATE wx_rent_contract SET STATUS = 1 WHERE STATUS = 9; | ||||
| UPDATE wx_rent_contract wrc INNER JOIN wx_shop s ON wrc.shop_id = s.id SET rent_info = JSON_ARRAY(s.*) WHERE wrc.rent_info IS NULL; | |||||
| @@ -15,5 +15,7 @@ public interface WxMerchantShopMapper extends CommonMapper<WxMerchantShop, Strin | |||||
| void delShops(@Param("merchantId") Long merchantId,@Param("shopList") List<Long> shopIds); | void delShops(@Param("merchantId") Long merchantId,@Param("shopList") List<Long> shopIds); | ||||
| void realDelByMerchantId(@Param("merchantId") Long merchantId); | |||||
| } | } | ||||
| @@ -456,9 +456,25 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | return new ResultData(ErrorCode.MERCHANT_NAME_IS_FOUND); | ||||
| } | } | ||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | |||||
| Date date = new Date(); | Date date = new Date(); | ||||
| wxMerchant.setUpdateDate(date); | wxMerchant.setUpdateDate(date); | ||||
| wxMerchantMapper.updateById(wxMerchant); | wxMerchantMapper.updateById(wxMerchant); | ||||
| //更新商户的商铺 | |||||
| wxMerchantShopMapper.realDelByMerchantId(wxMerchant.getId()); | |||||
| List<Long> shopIds = wxMerchant.getShopids(); | |||||
| for (Long sid: shopIds) { | |||||
| WxMerchantShop mcs = new WxMerchantShop(); | |||||
| mcs.setMerchantId(wxMerchant.getId()); | |||||
| mcs.setShopId(sid); | |||||
| mcs.setIsDel(EnumDelStatus.NOT_DEL.getCode()); | |||||
| mcs.setId(idWorker.nextId()); | |||||
| mcs.updateTenantInfo(wxMerchant); | |||||
| Date shopdate = new Date(); | |||||
| mcs.setUpdateDate(shopdate); | |||||
| mcs.setCreateDate(shopdate); | |||||
| wxMerchantShopMapper.insert(mcs); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS, "商户更新成功"); | return new ResultData(Result.SUCCESS, "商户更新成功"); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("db failed: 商户更新失败, e:" + e.getMessage()); | logger.error("db failed: 商户更新失败, e:" + e.getMessage()); | ||||
| @@ -83,5 +83,9 @@ | |||||
| </foreach> | </foreach> | ||||
| </update> | </update> | ||||
| <delete id="realDelByMerchantId" parameterType="Long"> | |||||
| delete from wx_merchant_shop where merchant_id = #{merchantId} | |||||
| </delete> | |||||
| </mapper> | </mapper> | ||||