|
@@ -5,6 +5,7 @@ import com.caimei.modules.cmpage.entity.CmPageCentre;
|
|
import com.caimei.modules.cmpage.service.CmImageService;
|
|
import com.caimei.modules.cmpage.service.CmImageService;
|
|
import com.caimei.modules.cmpage.service.CmPageCentreService;
|
|
import com.caimei.modules.cmpage.service.CmPageCentreService;
|
|
import com.caimei.modules.newhome.entity.NewPageFloorContent;
|
|
import com.caimei.modules.newhome.entity.NewPageFloorContent;
|
|
|
|
+import com.caimei.modules.opensearch.GenerateUtils;
|
|
import com.caimei.modules.product.entity.ActType;
|
|
import com.caimei.modules.product.entity.ActType;
|
|
import com.caimei.modules.product.service.ActTypeService;
|
|
import com.caimei.modules.product.service.ActTypeService;
|
|
import com.caimei.redis.RedisService;
|
|
import com.caimei.redis.RedisService;
|
|
@@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -51,6 +53,8 @@ public class CmPageCentreController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private RedisService redisService;
|
|
private RedisService redisService;
|
|
|
|
+ @Resource
|
|
|
|
+ private GenerateUtils generateUtils;
|
|
|
|
|
|
@ModelAttribute
|
|
@ModelAttribute
|
|
public CmPageCentre get(@RequestParam(required = false) String id) {
|
|
public CmPageCentre get(@RequestParam(required = false) String id) {
|
|
@@ -109,7 +113,7 @@ public class CmPageCentreController extends BaseController {
|
|
addMessage(redirectAttributes, "保存成功");
|
|
addMessage(redirectAttributes, "保存成功");
|
|
if ("5".equals(cmPageCentre.getType())) {
|
|
if ("5".equals(cmPageCentre.getType())) {
|
|
//清除产品仪器缓存
|
|
//清除产品仪器缓存
|
|
- redisService.removePattern("instrumentData*");redisService.removePattern("insCommodityData*");
|
|
|
|
|
|
+ cleanRedisCache();
|
|
} else if ("6".equals(cmPageCentre.getType())) {
|
|
} else if ("6".equals(cmPageCentre.getType())) {
|
|
//清除活动专题缓存
|
|
//清除活动专题缓存
|
|
redisService.removePattern("activityData*");
|
|
redisService.removePattern("activityData*");
|
|
@@ -121,6 +125,10 @@ public class CmPageCentreController extends BaseController {
|
|
@RequestMapping(value = "delete")
|
|
@RequestMapping(value = "delete")
|
|
public String delete(CmPageCentre cmPageCentre, RedirectAttributes redirectAttributes) {
|
|
public String delete(CmPageCentre cmPageCentre, RedirectAttributes redirectAttributes) {
|
|
cmPageCentreService.delete(cmPageCentre);
|
|
cmPageCentreService.delete(cmPageCentre);
|
|
|
|
+ if ("5".equals(cmPageCentre.getType())) {
|
|
|
|
+ //清除产品仪器缓存
|
|
|
|
+ cleanRedisCache();
|
|
|
|
+ }
|
|
if ("6".equals(cmPageCentre.getType())) {
|
|
if ("6".equals(cmPageCentre.getType())) {
|
|
//清除活动专题缓存
|
|
//清除活动专题缓存
|
|
redisService.removePattern("activityData*");
|
|
redisService.removePattern("activityData*");
|
|
@@ -138,6 +146,7 @@ public class CmPageCentreController extends BaseController {
|
|
cmPageCentreService.updateEnabledStatusByIds(enabledStatus, ids);
|
|
cmPageCentreService.updateEnabledStatusByIds(enabledStatus, ids);
|
|
map.put("success", true);
|
|
map.put("success", true);
|
|
map.put("msg", "修改成功");
|
|
map.put("msg", "修改成功");
|
|
|
|
+ cleanRedisCache();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.debug(e.toString(), e);
|
|
logger.debug(e.toString(), e);
|
|
map.put("success", false);
|
|
map.put("success", false);
|
|
@@ -155,6 +164,7 @@ public class CmPageCentreController extends BaseController {
|
|
cmPageCentreService.updateCrmEnabledStatusByIds(crmEnabledStatus, ids);
|
|
cmPageCentreService.updateCrmEnabledStatusByIds(crmEnabledStatus, ids);
|
|
map.put("success", true);
|
|
map.put("success", true);
|
|
map.put("msg", "修改成功");
|
|
map.put("msg", "修改成功");
|
|
|
|
+ cleanRedisCache();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
logger.debug(e.toString(), e);
|
|
logger.debug(e.toString(), e);
|
|
map.put("success", false);
|
|
map.put("success", false);
|
|
@@ -206,7 +216,7 @@ public class CmPageCentreController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//清除产品仪器缓存
|
|
//清除产品仪器缓存
|
|
- redisService.removePattern("instrumentData*");redisService.removePattern("insCommodityData*");
|
|
|
|
|
|
+ cleanRedisCache();
|
|
//清除活动专题缓存
|
|
//清除活动专题缓存
|
|
redisService.removePattern("activityData*");
|
|
redisService.removePattern("activityData*");
|
|
map.put("success", true);
|
|
map.put("success", true);
|
|
@@ -231,4 +241,14 @@ public class CmPageCentreController extends BaseController {
|
|
}
|
|
}
|
|
return "modules/newhome/newPageFloorContentForm";
|
|
return "modules/newhome/newPageFloorContentForm";
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void cleanRedisCache() {
|
|
|
|
+ //清除产品仪器缓存
|
|
|
|
+ redisService.removePattern("instrumentData*");
|
|
|
|
+ redisService.removePattern("insCommodityData*");
|
|
|
|
+ // 重新生成静态产品仪器页
|
|
|
|
+ generateUtils.generateProductType(286);
|
|
|
|
+ generateUtils.generateProductType(287);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|