Merge pull request 'qq1' (#1) from cqq into develop

pull/2/head
prxhap34i 1 month ago
commit 177ea969b9

2
.gitignore vendored

@ -4,7 +4,7 @@ node_modules/
# 忽略Logs
logs
*.log
#
# 忽略/dist目录相对.gitignore文件所在目录
/dist

@ -5,6 +5,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/

@ -1,7 +1,6 @@
package com.annotation;
import java.lang.annotation.*;
/**
* Token
*/

@ -4,7 +4,6 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/

@ -21,7 +21,7 @@ public class InterceptorConfig extends WebMvcConfigurationSupport{
registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**");
super.addInterceptors(registry);
}
/**
* springboot 2.0WebMvcConfigurationSupport访addResourceHandlers
*/

@ -5,7 +5,6 @@ import java.util.Date;
import org.apache.ibatis.reflection.MetaObject;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
/**
*
*/

@ -6,7 +6,6 @@ import org.springframework.context.annotation.Configuration;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
/**
* mybatis-plus
*/

@ -31,13 +31,12 @@ import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;
/**
* 线
*
* @author
* @email
*/
*/
@RestController
@Controller
@RequestMapping("/chat")
@ -60,10 +59,9 @@ public class ChatController {
@Autowired
private YishengService yishengService;
/**
*
*/
*
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
@ -87,25 +85,24 @@ public class ChatController {
}
return R.ok().put("data", page);
}
/**
*
*/
*
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
ChatEntity chat = chatService.selectById(id);
if(chat !=null){
//entity转view
//entity转view
ChatView view = new ChatView();
BeanUtils.copyProperties( chat , view );//把实体数据重构到view中
//级联表
//级联表
YonghuEntity yonghu = yonghuService.selectById(chat.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
@ -114,10 +111,9 @@ public class ChatController {
}
}
/**
*
*/
*
*/
@RequestMapping("/save")
public R save(@RequestBody ChatEntity chat, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,chat:{}",this.getClass().getName(),chat.toString());
@ -146,10 +142,9 @@ public class ChatController {
return R.error(511,"表中有相同数据");
}
}
/**
*
*/
*
*/
@RequestMapping("/update")
public R update(@RequestBody ChatEntity chat, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,chat:{}",this.getClass().getName(),chat.toString());
@ -159,6 +154,7 @@ public class ChatController {
// return R.error(511,"永远不会进入");
// else if("用户".equals(role))
// chat.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
//根据字段查询是否有相同数据
Wrapper<ChatEntity> queryWrapper = new EntityWrapper<ChatEntity>()
.notIn("id",chat.getId())
@ -180,9 +176,10 @@ public class ChatController {
}
}
/**
*
*/
*
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
@ -191,6 +188,7 @@ public class ChatController {
}
/**
*
*/
@ -219,20 +217,15 @@ public class ChatController {
for(List<String> data:dataList){
//循环
ChatEntity chatEntity = new ChatEntity();
// chatEntity.setYonghuId(Integer.valueOf(data.get(0))); //提问用户 要改的
// chatEntity.setChatIssue(data.get(0)); //问题 要改的
// chatEntity.setIssueTime(new Date(data.get(0))); //问题时间 要改的
// chatEntity.setChatReply(data.get(0)); //回复 要改的
// chatEntity.setReplyTime(new Date(data.get(0))); //回复时间 要改的
// chatEntity.setZhuangtaiTypes(Integer.valueOf(data.get(0))); //状态 要改的
// chatEntity.setChatTypes(Integer.valueOf(data.get(0))); //数据类型 要改的
// chatEntity.setInsertTime(date);//时间
chatList.add(chatEntity);
//把要查询是否重复的字段放入map中
}
//查询是否重复
chatService.insertBatch(chatList);
return R.ok();
@ -248,20 +241,19 @@ public class ChatController {
/**
*
*/
*
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
// 没有指定排序字段就默认id倒序
if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
params.put("orderBy","id");
}
PageUtils page = chatService.queryPage(params);
//字典表数据转换
List<ChatView> list =(List<ChatView>)page.getList();
for(ChatView c:list)
@ -269,26 +261,28 @@ public class ChatController {
return R.ok().put("data", page);
}
/**
*
*/
*
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id, HttpServletRequest request){
logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
ChatEntity chat = chatService.selectById(id);
if(chat !=null){
//entity转view
ChatView view = new ChatView();
BeanUtils.copyProperties( chat , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(chat.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
@ -298,9 +292,10 @@ public class ChatController {
}
/**
*
*/
*
*/
@RequestMapping("/add")
public R add(@RequestBody ChatEntity chat, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,chat:{}",this.getClass().getName(),chat.toString());

@ -35,6 +35,7 @@ import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*/
@ -65,7 +66,6 @@ public class CommonController{
/**
*
*
* @param face1 1
* @param face2 2
* @return
@ -105,7 +105,8 @@ public class CommonController{
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
/**
* tablecolumn()
* @return
@ -125,7 +126,8 @@ public class CommonController{
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
/**
* tablecolumn
* @return
@ -140,7 +142,8 @@ public class CommonController{
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* tablesfsh
* @param map
@ -152,7 +155,8 @@ public class CommonController{
commonService.sh(map);
return R.ok();
}
/**
*
* @param tableName
@ -194,6 +198,7 @@ public class CommonController{
return R.ok().put("count", count);
}
/**
*
*/
@ -206,6 +211,7 @@ public class CommonController{
}
/**
*
*/
@ -218,7 +224,8 @@ public class CommonController{
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
*
*/
@ -231,7 +238,8 @@ public class CommonController{
List<Map<String, Object>> result = commonService.selectGroup(params);
return R.ok().put("data", result);
}
/**
*
*/
@ -247,12 +255,7 @@ public class CommonController{
}
/**
*
*
*
*
*/
/**
*
@ -269,16 +272,16 @@ public class CommonController{
}
/**
tableName
condition1 1
condition1Value 1
average
Number(res.data.value.toFixed(1))
if(res.data){}
* */
/**
tableName
condition1 1
condition1Value 1
average
Number(res.data.value.toFixed(1))
if(res.data){}
* */
@IgnoreAuth
@RequestMapping("/queryScore")
public R queryScore(@RequestParam Map<String, Object> params) {
@ -287,6 +290,7 @@ public class CommonController{
return R.ok().put("data", queryScore);
}
/**
*
* tableName
@ -300,7 +304,6 @@ public class CommonController{
return R.ok().put("data", result);
}
/**
*
* tableName
@ -326,9 +329,9 @@ public class CommonController{
return R.ok().put("data", result);
}
/**
*
*
* 1
* tableName
* groupColumn
* dateFormatType 1: 2: 3:

Loading…
Cancel
Save