浏览代码

queryinfo报错

zhuwei 2 年之前
父节点
当前提交
507ae26db3

+ 2 - 2
blade-service-api/blade-business-api/src/main/java/org/springblade/business/dto/DefaultConfigDTO.java

@@ -24,11 +24,11 @@ import lombok.EqualsAndHashCode;
  * 数据传输对象实体类
  *
  * @author BladeX
- * @since 2022-07-15
+ * @since 2023-07-10
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class DefaultConfigDTO extends DefaultConfig {
-    private static final long serialVersionUID = 1L;
+	private static final long serialVersionUID = 1L;
 
 }

+ 34 - 46
blade-service-api/blade-business-api/src/main/java/org/springblade/business/entity/DefaultConfig.java

@@ -17,10 +17,7 @@
 package org.springblade.business.entity;
 
 import com.baomidou.mybatisplus.annotation.TableName;
-
 import java.io.Serializable;
-
-import io.swagger.annotations.ApiModelProperty;
 import org.springblade.core.mp.base.BaseEntity;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
@@ -29,56 +26,47 @@ import lombok.EqualsAndHashCode;
  * 实体类
  *
  * @author BladeX
- * @since 2022-07-15
+ * @since 2023-07-10
  */
 @Data
 @TableName("u_default_config")
 @EqualsAndHashCode(callSuper = true)
 public class DefaultConfig extends BaseEntity {
 
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主题
-     */
-    @ApiModelProperty("主题")
-    private String theme;
-    /**
-     * 颜色
-     */
-    @ApiModelProperty("颜色")
-    private String color;
-    /**
-     * 首页主题
-     */
-    @ApiModelProperty("首页主题")
-    private String homeTheme;
-    /**
-     * 是否弹出工单提交感谢
-     */
-    @ApiModelProperty("是否弹出工单提交感谢")
-    private Integer opinionView;
-    /**
-     * 电签短信验证
-     */
-    @ApiModelProperty("电签短信验证")
-    private String smsCode;
-    /**
-     * 电签短信验证超时时间
-     */
-    @ApiModelProperty("电签短信验证超时时间")
-    private String smsTimeOut;
+	private static final long serialVersionUID = 1L;
 
-    /**
-     * 截图方式
-     */
-    @ApiModelProperty("截图方式")
-    private String shotWebRtc;
+	/**
+	* 主题
+	*/
+		private String theme;
+	/**
+	* 颜色
+	*/
+		private String color;
+	/**
+	* 首页主题
+	*/
+		private String homeTheme;
+	/**
+	* 是否弹出工单提交感谢
+	*/
+		private Integer opinionView;
+	/**
+	* 电签短信验证
+	*/
+		private String smsCode;
+	/**
+	* 电签短信验证超时时间
+	*/
+		private String smsTimeOut;
+	/**
+	* 截图方式
+	*/
+		private String shotWebRtc;
+	/**
+	* 全屏截图
+	*/
+		private String fullScreen;
 
-    /**
-     * 全屏截图
-     */
-    @ApiModelProperty("全屏截图")
-    private String fullScreen;
 
 }

+ 2 - 2
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/DefaultConfigVO.java

@@ -24,11 +24,11 @@ import lombok.EqualsAndHashCode;
  * 视图实体类
  *
  * @author BladeX
- * @since 2022-07-15
+ * @since 2023-07-10
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
 public class DefaultConfigVO extends DefaultConfig {
-    private static final long serialVersionUID = 1L;
+	private static final long serialVersionUID = 1L;
 
 }

+ 107 - 21
blade-service/blade-business/src/main/java/org/springblade/business/controller/DefaultConfigController.java

@@ -1,29 +1,51 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
 package org.springblade.business.controller;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;
-
 import javax.validation.Valid;
 
 import org.apache.commons.lang.StringUtils;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.BladeUser;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.business.entity.DefaultConfig;
+import org.springblade.business.vo.DefaultConfigVO;
 import org.springblade.business.service.IDefaultConfigService;
 import org.springblade.core.boot.ctrl.BladeController;
 
 import java.util.Date;
 
 /**
- * 控制器
+ *  控制器
  *
  * @author BladeX
- * @since 2022-07-15
+ * @since 2023-07-10
  */
 @RestController
 @AllArgsConstructor
@@ -31,24 +53,90 @@ import java.util.Date;
 @Api(value = "用户客户端配置信息", tags = "用户客户端配置信息")
 public class DefaultConfigController extends BladeController {
 
-    private final IDefaultConfigService defaultConfigService;
-
-    /**
-     * 详情
-     */
-    @GetMapping("/detail")
-    @ApiOperationSupport(order = 2)
-    @ApiOperation(value = "详情", notes = "传入defaultConfig")
-    public R<DefaultConfig> detail(BladeUser user) {
-        DefaultConfig one = this.defaultConfigService.getOne(Wrappers.<DefaultConfig>lambdaQuery().eq(DefaultConfig::getCreateUser, AuthUtil.getUserId()));
-        return R.data(one);
-    }
+	private final IDefaultConfigService defaultConfigService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入defaultConfig")
+	public R<DefaultConfig> detail(DefaultConfig defaultConfig, BladeUser user) {
+		defaultConfig.setCreateUser(user.getUserId());
+		DefaultConfig detail = defaultConfigService.getOne(Condition.getQueryWrapper(defaultConfig));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入defaultConfig")
+	public R<IPage<DefaultConfig>> list(DefaultConfig defaultConfig, Query query) {
+		IPage<DefaultConfig> pages = defaultConfigService.page(Condition.getPage(query), Condition.getQueryWrapper(defaultConfig));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入defaultConfig")
+	public R<IPage<DefaultConfigVO>> page(DefaultConfigVO defaultConfig, Query query) {
+		IPage<DefaultConfigVO> pages = defaultConfigService.selectDefaultConfigPage(Condition.getPage(query), defaultConfig);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入defaultConfig")
+	public R save(@Valid @RequestBody DefaultConfig defaultConfig) {
+		return R.status(defaultConfigService.save(defaultConfig));
+	}
+
+	/**
+	 * 修改 
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入defaultConfig")
+	public R update(@Valid @RequestBody DefaultConfig defaultConfig) {
+		return R.status(defaultConfigService.updateById(defaultConfig));
+	}
+
+	/**
+	 * 新增或修改 
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入defaultConfig")
+	public R submit(@Valid @RequestBody DefaultConfig defaultConfig) {
+		return R.status(defaultConfigService.saveOrUpdate(defaultConfig));
+	}
+
+	
+	/**
+	 * 删除 
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(defaultConfigService.deleteLogic(Func.toLongList(ids)));
+	}
+
+
+/**
+ * 新增或修改
+ */
 
-    /**
-     * 新增或修改
-     */
     @PostMapping("/saveOrUpdate")
-    @ApiOperationSupport(order = 1)
+    @ApiOperationSupport(order = 8)
     @ApiOperation(value = "新增或修改")
     public R<Boolean> saveOrUpdate(@Valid @RequestBody DefaultConfig newConfig) {
         //查询是否存在配置信息
@@ -80,6 +168,4 @@ public class DefaultConfigController extends BladeController {
 
         return R.status(defaultConfigService.save(newConfig));
     }
-
-
 }

+ 11 - 3
blade-service/blade-business/src/main/java/org/springblade/business/mapper/DefaultConfigMapper.java

@@ -20,15 +20,23 @@ import org.springblade.business.entity.DefaultConfig;
 import org.springblade.business.vo.DefaultConfigVO;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-
 import java.util.List;
 
 /**
- * Mapper 接口
+ *  Mapper 接口
  *
  * @author BladeX
- * @since 2022-07-15
+ * @since 2023-07-10
  */
 public interface DefaultConfigMapper extends BaseMapper<DefaultConfig> {
 
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param defaultConfig
+	 * @return
+	 */
+	List<DefaultConfigVO> selectDefaultConfigPage(IPage page, DefaultConfigVO defaultConfig);
+
 }

+ 13 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/DefaultConfigMapper.xml

@@ -4,6 +4,14 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="defaultConfigResultMap" type="org.springblade.business.entity.DefaultConfig">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
         <result column="theme" property="theme"/>
         <result column="color" property="color"/>
         <result column="home_theme" property="homeTheme"/>
@@ -14,4 +22,9 @@
         <result column="full_screen" property="fullScreen"/>
     </resultMap>
 
+
+    <select id="selectDefaultConfigPage" resultMap="defaultConfigResultMap">
+        select * from u_default_config where is_deleted = 0
+    </select>
+
 </mapper>

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -869,7 +869,7 @@
           AND status IN (1, 2)
     </select>
 
-    <select id="getInformationByContractId" resultMap="org.springblade.business.entity.InformationQuery">
+    <select id="getInformationByContractId" resultMap="informationQueryResultMap">
         id,
         wbs_id as wbsId,
         name,

+ 11 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/IDefaultConfigService.java

@@ -22,11 +22,20 @@ import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
 /**
- * 服务类
+ *  服务类
  *
  * @author BladeX
- * @since 2022-07-15
+ * @since 2023-07-10
  */
 public interface IDefaultConfigService extends BaseService<DefaultConfig> {
 
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param defaultConfig
+	 * @return
+	 */
+	IPage<DefaultConfigVO> selectDefaultConfigPage(IPage<DefaultConfigVO> page, DefaultConfigVO defaultConfig);
+
 }

+ 7 - 2
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/DefaultConfigServiceImpl.java

@@ -25,12 +25,17 @@ import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 
 /**
- * 服务实现类
+ *  服务实现类
  *
  * @author BladeX
- * @since 2022-07-15
+ * @since 2023-07-10
  */
 @Service
 public class DefaultConfigServiceImpl extends BaseServiceImpl<DefaultConfigMapper, DefaultConfig> implements IDefaultConfigService {
 
+	@Override
+	public IPage<DefaultConfigVO> selectDefaultConfigPage(IPage<DefaultConfigVO> page, DefaultConfigVO defaultConfig) {
+		return page.setRecords(baseMapper.selectDefaultConfigPage(page, defaultConfig));
+	}
+
 }