Commit f15c2e36 by zhuyajie

1002544

parent 54d33d2d
...@@ -9,6 +9,7 @@ import com.pcloud.book.custom.vo.EditCustomPlanModuleVO; ...@@ -9,6 +9,7 @@ import com.pcloud.book.custom.vo.EditCustomPlanModuleVO;
import com.pcloud.book.custom.vo.ModuleSuggestionVO; import com.pcloud.book.custom.vo.ModuleSuggestionVO;
import com.pcloud.book.custom.vo.SuggestionListVO; import com.pcloud.book.custom.vo.SuggestionListVO;
import com.pcloud.common.page.PageBeanNew; import com.pcloud.common.page.PageBeanNew;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -42,4 +43,8 @@ public interface CustomPlanBiz { ...@@ -42,4 +43,8 @@ public interface CustomPlanBiz {
Integer addSuggestion4Module(AddSuggestionVO addSuggestionVO); Integer addSuggestion4Module(AddSuggestionVO addSuggestionVO);
Integer addCustomPlan4User(AddCustomPlan4UserVO addCustomPlan4UserVO); Integer addCustomPlan4User(AddCustomPlan4UserVO addCustomPlan4UserVO);
public Boolean getUserInputPermission(String userWxId, Integer planId);
List<Integer> getPlanIdListByUser(String wxId);
} }
...@@ -36,6 +36,7 @@ import com.pcloud.common.utils.BeanUtils; ...@@ -36,6 +36,7 @@ import com.pcloud.common.utils.BeanUtils;
import com.pcloud.common.utils.ListUtils; import com.pcloud.common.utils.ListUtils;
import com.pcloud.common.utils.QrcodeUtils; import com.pcloud.common.utils.QrcodeUtils;
import com.pcloud.common.utils.UUIDUitl; import com.pcloud.common.utils.UUIDUitl;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import com.pcloud.common.utils.httpclient.UrlUtils; import com.pcloud.common.utils.httpclient.UrlUtils;
import com.pcloud.common.utils.string.StringUtil; import com.pcloud.common.utils.string.StringUtil;
import com.pcloud.feedback.paper.dto.PaperDto; import com.pcloud.feedback.paper.dto.PaperDto;
...@@ -344,6 +345,9 @@ public class CustomPlanBizImpl implements CustomPlanBiz { ...@@ -344,6 +345,9 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
list.add(suggestion); list.add(suggestion);
}); });
customPlanModuleSuggestionMapper.batchInsert(list); customPlanModuleSuggestionMapper.batchInsert(list);
//添加填写记录缓存
String key = "BOOK:CUSTOMER_PLAN_SUGGESTION_RECORD:"+wxId+"-"+planId;
JedisClusterUtils.setJson(key, wxId);
ThreadPoolUtils.OTHER_THREAD_POOL.execute(() -> { ThreadPoolUtils.OTHER_THREAD_POOL.execute(() -> {
CustomPlan customPlan = customPlanMapper.getById(planId); CustomPlan customPlan = customPlanMapper.getById(planId);
if (!StringUtil.isEmpty(customPlan.getConfirmFeedbackReply()) && addSuggestionVO.getRobotWxId() != null) { if (!StringUtil.isEmpty(customPlan.getConfirmFeedbackReply()) && addSuggestionVO.getRobotWxId() != null) {
...@@ -368,4 +372,20 @@ public class CustomPlanBizImpl implements CustomPlanBiz { ...@@ -368,4 +372,20 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
public Integer addCustomPlan4User(AddCustomPlan4UserVO addCustomPlan4UserVO) { public Integer addCustomPlan4User(AddCustomPlan4UserVO addCustomPlan4UserVO) {
return customPlanModuleSuggestionMapper.addCustomPlan4User(addCustomPlan4UserVO); return customPlanModuleSuggestionMapper.addCustomPlan4User(addCustomPlan4UserVO);
} }
@Override
public Boolean getUserInputPermission(String userWxId, Integer planId) {
Boolean canInput = true;
String key = "BOOK:CUSTOMER_PLAN_SUGGESTION_RECORD:"+userWxId+"-"+planId;
String value = JedisClusterUtils.getJson(key, String.class);
if (!StringUtil.isEmpty(value)){
canInput = false;
}
return canInput;
}
@Override
public List<Integer> getPlanIdListByUser(String wxId){
return customPlanModuleSuggestionMapper.getPlanIdListByUser(wxId);
}
} }
...@@ -25,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -25,7 +25,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@RequestMapping("customPlan") @RequestMapping("customPlan")
@RestController("customPlanFacade") @RestController("customPlanFacade")
...@@ -164,4 +166,12 @@ public class CustomPlanFacade { ...@@ -164,4 +166,12 @@ public class CustomPlanFacade {
return new ResponseDto<>(id); return new ResponseDto<>(id);
} }
@ApiOperation("获取用户定制单满意度填写权限")
@GetMapping("getUserInputPermission")
public ResponseDto<?>getUserInputPermission(@RequestParam("userWxId") String userWxId,@RequestParam("planId") Integer planId){
Boolean canInput = customPlanBiz.getUserInputPermission(userWxId, planId);
Map<String, Object> map = new HashMap<>();
map.put("canInput", canInput);
return new ResponseDto<>(map);
}
} }
...@@ -29,4 +29,6 @@ public interface CustomPlanModuleSuggestionMapper { ...@@ -29,4 +29,6 @@ public interface CustomPlanModuleSuggestionMapper {
Integer addCustomPlan4User(AddCustomPlan4UserVO addCustomPlan4UserVO); Integer addCustomPlan4User(AddCustomPlan4UserVO addCustomPlan4UserVO);
Integer getLatestPlanId(String wxId); Integer getLatestPlanId(String wxId);
List<Integer> getPlanIdListByUser(@Param("wxId") String wxId);
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.pcloud.book.book.entity.Book; ...@@ -7,6 +7,7 @@ import com.pcloud.book.book.entity.Book;
import com.pcloud.book.consumer.content.ResourceConsr; import com.pcloud.book.consumer.content.ResourceConsr;
import com.pcloud.book.consumer.feedback.FeedbackConsr; import com.pcloud.book.consumer.feedback.FeedbackConsr;
import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr; import com.pcloud.book.consumer.wechatgroup.WechatGroupConsr;
import com.pcloud.book.custom.biz.CustomPlanBiz;
import com.pcloud.book.group.biz.WeixinQrcodeBiz; import com.pcloud.book.group.biz.WeixinQrcodeBiz;
import com.pcloud.book.guide.biz.PcloudGuideBiz; import com.pcloud.book.guide.biz.PcloudGuideBiz;
import com.pcloud.book.keywords.enums.ReplyTypeEnum; import com.pcloud.book.keywords.enums.ReplyTypeEnum;
...@@ -109,6 +110,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -109,6 +110,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
private ResourceConsr resourceConsr; private ResourceConsr resourceConsr;
@Value("${system.env}") @Value("${system.env}")
private String envStr; private String envStr;
@Autowired
private CustomPlanBiz customPlanBiz;
@Value("${wechat.group.link.prefix}") @Value("${wechat.group.link.prefix}")
private String wechatLinkPrefix; private String wechatLinkPrefix;
...@@ -1107,7 +1110,10 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -1107,7 +1110,10 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
if (null!=pcloudRobot && null!=pcloudRobot.getRobotType()){ if (null!=pcloudRobot && null!=pcloudRobot.getRobotType()){
List<Long> paperIds = personalStageDao.getPaperIdListByRobotClassify(pcloudRobot.getRobotType().longValue()); List<Long> paperIds = personalStageDao.getPaperIdListByRobotClassify(pcloudRobot.getRobotType().longValue());
if (!ListUtils.isEmpty(paperIds)){ if (!ListUtils.isEmpty(paperIds)){
feedbackConsr.deleteUserAnswerRecord(paperIds, userWxId); for (Long paperId:paperIds){
String paperKey = "FEEDBACK:USER_RECORD:"+userWxId+"-"+paperId;
JedisClusterUtils.del(paperKey);
}
} }
} }
//删除书名和阅读偏好缓存 //删除书名和阅读偏好缓存
...@@ -1115,5 +1121,14 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz { ...@@ -1115,5 +1121,14 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
String readingKey ="BOOK:READING_STYLE:" + userWxId + "-" + robotId; String readingKey ="BOOK:READING_STYLE:" + userWxId + "-" + robotId;
JedisClusterUtils.del(bookKey); JedisClusterUtils.del(bookKey);
JedisClusterUtils.del(readingKey); JedisClusterUtils.del(readingKey);
//清除定制单填写记录
List<Integer> planIds = customPlanBiz.getPlanIdListByUser(userWxId);
if (!ListUtils.isEmpty(planIds)){
for (Integer planId : planIds){
String planKey = "BOOK:CUSTOMER_PLAN_SUGGESTION_RECORD:"+userWxId+"-"+planId;
JedisClusterUtils.del(planKey);
}
} }
}
} }
...@@ -97,4 +97,10 @@ ...@@ -97,4 +97,10 @@
order by create_time desc order by create_time desc
limit 1 limit 1
</select> </select>
<select id="getPlanIdListByUser" parameterType="string" resultType="Integer">
SELECT DISTINCT plan_id
FROM custom_plan_module_suggestion
WHERE wx_id = #{wxId}
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment