帮助中心
This commit is contained in:
parent
5b56c1f1ce
commit
929d16c25b
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.bst.article.domain;
|
package com.ruoyi.bst.article.domain;
|
||||||
|
|
||||||
public class ArticleVO {
|
public class ArticleVO extends Article {
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,6 @@ public interface ArticleMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteArticleByIds(Long[] ids);
|
public int deleteArticleByIds(Long[] ids);
|
||||||
|
|
||||||
|
public ArticleVO selectChildrenByiId(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectChildrenByiId" resultType="com.ruoyi.bst.article.domain.ArticleVO">
|
||||||
|
<include refid="selectArticleVo"/>
|
||||||
|
where id = #{categoryId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertArticle" parameterType="Article" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertArticle" parameterType="Article" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into bst_article
|
insert into bst_article
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
|
|
@ -60,4 +60,6 @@ public interface ArticleService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteArticleById(Long id);
|
public int deleteArticleById(Long id);
|
||||||
|
|
||||||
|
public ArticleVO selectChildrenByCategoryId(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,4 +116,9 @@ public class ArticleServiceImpl implements ArticleService
|
||||||
{
|
{
|
||||||
return articleMapper.deleteArticleById(id);
|
return articleMapper.deleteArticleById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArticleVO selectChildrenByCategoryId(Long id) {
|
||||||
|
return articleMapper.selectChildrenByiId(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
package com.ruoyi.bst.articleCategory.domain;
|
package com.ruoyi.bst.articleCategory.domain;
|
||||||
|
|
||||||
public class ArticleCategoryQuery extends ArticleCategory {
|
public class ArticleCategoryQuery extends ArticleCategory {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,14 @@ package com.ruoyi.bst.articleCategory.service.impl;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.ruoyi.bst.area.domain.AreaQuery;
|
||||||
|
import com.ruoyi.bst.area.domain.AreaVO;
|
||||||
import com.ruoyi.bst.device.utils.DeviceUtil;
|
import com.ruoyi.bst.device.utils.DeviceUtil;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.utils.ServiceUtil;
|
import com.ruoyi.common.utils.ServiceUtil;
|
||||||
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.bst.articleCategory.mapper.ArticleCategoryMapper;
|
import com.ruoyi.bst.articleCategory.mapper.ArticleCategoryMapper;
|
||||||
|
@ -36,9 +40,19 @@ public class ArticleCategoryServiceImpl implements ArticleCategoryService
|
||||||
@Override
|
@Override
|
||||||
public ArticleCategoryVO selectArticleCategoryById(Long id)
|
public ArticleCategoryVO selectArticleCategoryById(Long id)
|
||||||
{
|
{
|
||||||
return articleCategoryMapper.selectArticleCategoryById(id);
|
if (id == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ArticleCategoryQuery query = new ArticleCategoryQuery();
|
||||||
|
query.setId(id);
|
||||||
|
return this.selectOne(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArticleCategoryVO selectOne(ArticleCategoryQuery query){
|
||||||
|
PageHelper.startPage(1, 1);
|
||||||
|
List<ArticleCategoryVO> list = articleCategoryMapper.selectArticleCategoryList(query);
|
||||||
|
return CollectionUtils.firstElement(list);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 查询文章分类列表
|
* 查询文章分类列表
|
||||||
*
|
*
|
||||||
|
|
|
@ -52,4 +52,8 @@ public class Fault extends BaseEntity
|
||||||
@ApiModelProperty("用户id")
|
@ApiModelProperty("用户id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
@Excel(name = "是否处理")
|
||||||
|
@ApiModelProperty("是否处理")
|
||||||
|
private String handle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,4 +14,6 @@ public class FaultVO extends Fault{
|
||||||
@ApiModelProperty("故障原因")
|
@ApiModelProperty("故障原因")
|
||||||
private String faultSite;
|
private String faultSite;
|
||||||
|
|
||||||
|
@ApiModelProperty("车牌号")
|
||||||
|
private String vehicleNum;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.bst.fault.domain.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum FaultHandleStatus {
|
||||||
|
|
||||||
|
REJECTED("0", "驳回"),
|
||||||
|
DO("1", "处理");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
}
|
|
@ -7,9 +7,10 @@ import lombok.Getter;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum FaultStatus {
|
public enum FaultStatus {
|
||||||
|
|
||||||
STORAGE("0", "已驳回"),
|
REJECTED("0", "已驳回"),
|
||||||
AVAILABLE("1", "已提交"),
|
PENGDING("1", "待处理"),
|
||||||
RESERVED("2", "维修中");
|
REPAIRING("2", "维修中"),
|
||||||
|
COMPLETED("3", "已完成");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
|
@ -18,7 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bf.appeal_status,
|
bf.appeal_status,
|
||||||
bf.create_time,
|
bf.create_time,
|
||||||
bf.order_end_time,
|
bf.order_end_time,
|
||||||
bf.user_id
|
bf.user_id,
|
||||||
|
bf.vehicle_num
|
||||||
from bst_fault bf
|
from bst_fault bf
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
@ -50,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectFaultVo"/>
|
<include refid="selectFaultVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectFaultByUserId" resultType="com.ruoyi.bst.fault.domain.FaultVO">
|
<select id="selectFaultByUserId" resultType="com.ruoyi.bst.fault.domain.FaultVO">
|
||||||
select
|
select
|
||||||
order_end_time,
|
order_end_time,
|
||||||
|
@ -72,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="appealStatus != null and appealStatus != ''">appeal_status,</if>
|
<if test="appealStatus != null and appealStatus != ''">appeal_status,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="userId != null">user_id,</if>
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="vehicle_num != null">vehicle_num,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="userName != null and userName != ''">#{userName},</if>
|
<if test="userName != null and userName != ''">#{userName},</if>
|
||||||
|
@ -83,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="appealStatus != null and appealStatus != ''">#{appealStatus},</if>
|
<if test="appealStatus != null and appealStatus != ''">#{appealStatus},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="vehicle_num != null">#{vehicleNum},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ public class AppArticleController extends BaseController {
|
||||||
private ArticleService articleService;
|
private ArticleService articleService;
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("查看文章信息")
|
@ApiOperation("查看文章")
|
||||||
@GetMapping("/detail")
|
@GetMapping
|
||||||
@Anonymous
|
@Anonymous
|
||||||
public AjaxResult getCategoryList(ArticleQuery query) {
|
public AjaxResult getCategoryList(ArticleQuery query) {
|
||||||
if(query.getId() == null){
|
if(query.getId() == null){
|
||||||
|
|
|
@ -1,17 +1,24 @@
|
||||||
package com.ruoyi.web.app;
|
package com.ruoyi.web.app;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.article.domain.ArticleVO;
|
||||||
|
import com.ruoyi.bst.article.service.ArticleService;
|
||||||
import com.ruoyi.bst.articleCategory.domain.ArticleCategoryQuery;
|
import com.ruoyi.bst.articleCategory.domain.ArticleCategoryQuery;
|
||||||
|
import com.ruoyi.bst.articleCategory.domain.ArticleCategoryVO;
|
||||||
import com.ruoyi.bst.articleCategory.domain.enums.ArticleCategoryStatus;
|
import com.ruoyi.bst.articleCategory.domain.enums.ArticleCategoryStatus;
|
||||||
import com.ruoyi.bst.articleCategory.service.ArticleCategoryService;
|
import com.ruoyi.bst.articleCategory.service.ArticleCategoryService;
|
||||||
import com.ruoyi.common.annotation.Anonymous;
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/app/articleCategory")
|
@RequestMapping("/app/articleCategory")
|
||||||
|
@ -20,11 +27,26 @@ public class AppAtricleCategoryController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ArticleCategoryService articleCategoryService;
|
private ArticleCategoryService articleCategoryService;
|
||||||
|
|
||||||
@ApiOperation("展示分类信息")
|
@Autowired
|
||||||
@GetMapping("/list")
|
private ArticleService articleService;
|
||||||
|
|
||||||
|
@ApiOperation("帮助中心")
|
||||||
|
@GetMapping
|
||||||
@Anonymous
|
@Anonymous
|
||||||
public AjaxResult getCategoryList(ArticleCategoryQuery query) {
|
public TableDataInfo getCategoryList(ArticleCategoryQuery query) {
|
||||||
|
startPage();
|
||||||
query.setCategoryStatus(ArticleCategoryStatus.ENABLED.getCode());
|
query.setCategoryStatus(ArticleCategoryStatus.ENABLED.getCode());
|
||||||
return success(articleCategoryService.selectArticleCategoryList(query));
|
|
||||||
|
//查询分类的文章
|
||||||
|
List<ArticleCategoryVO> list = articleCategoryService.selectArticleCategoryList(query);
|
||||||
|
list.forEach(articleCategoryVO -> {
|
||||||
|
ArticleVO children = articleService.selectChildrenByCategoryId(articleCategoryVO.getId());
|
||||||
|
List<ArticleVO> childrenList = new ArrayList<>();
|
||||||
|
if (children != null) {
|
||||||
|
childrenList.add(children);
|
||||||
|
}
|
||||||
|
articleCategoryVO.setChildren(childrenList);
|
||||||
|
});
|
||||||
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,10 +5,13 @@ import com.ruoyi.bst.device.service.DeviceService;
|
||||||
import com.ruoyi.bst.fault.domain.Fault;
|
import com.ruoyi.bst.fault.domain.Fault;
|
||||||
import com.ruoyi.bst.fault.domain.FaultQuery;
|
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||||
import com.ruoyi.bst.fault.domain.FaultVO;
|
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||||
|
import com.ruoyi.bst.fault.domain.enums.FaultHandleStatus;
|
||||||
|
import com.ruoyi.bst.fault.domain.enums.FaultStatus;
|
||||||
import com.ruoyi.bst.fault.service.FaultService;
|
import com.ruoyi.bst.fault.service.FaultService;
|
||||||
import com.ruoyi.bst.order.service.OrderService;
|
import com.ruoyi.bst.order.service.OrderService;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -45,28 +48,45 @@ public class AppFaultController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult update(@RequestBody Fault fault) {
|
||||||
|
FaultVO faultVO = faultService.selectFaultById(fault.getId());
|
||||||
|
if (faultVO.getAppealStatus().equals(FaultStatus.PENGDING.getCode()) && fault.getHandle().equals(FaultHandleStatus.REJECTED.getCode())) {
|
||||||
|
faultVO.setAppealStatus(FaultStatus.REJECTED.getCode());
|
||||||
|
}else
|
||||||
|
if (faultVO.getAppealStatus().equals(FaultStatus.PENGDING.getCode()) && fault.getHandle().equals(FaultHandleStatus.DO.getCode())) {
|
||||||
|
faultVO.setAppealStatus(FaultStatus.REPAIRING.getCode());
|
||||||
|
}else
|
||||||
|
if (faultVO.getAppealStatus().equals(FaultStatus.REPAIRING.getCode()) && fault.getHandle().equals(FaultHandleStatus.DO.getCode())) {
|
||||||
|
faultVO.setAppealStatus(FaultStatus.COMPLETED.getCode());
|
||||||
|
}
|
||||||
|
faultService.updateFault(faultVO);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史申报查询
|
||||||
|
* @param query
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public AjaxResult get(FaultQuery query) {
|
public TableDataInfo get(FaultQuery query) {
|
||||||
|
startPage();
|
||||||
query.setUserId(getUserId());
|
query.setUserId(getUserId());
|
||||||
List<FaultVO> list = faultService.selectFaultList(query);
|
List<FaultVO> list = faultService.selectFaultList(query);
|
||||||
List<FaultVO> validList = new ArrayList<>();
|
List<FaultVO> validList = new ArrayList<>();
|
||||||
|
|
||||||
list.forEach(faultVO -> {
|
list.forEach(faultVO -> {
|
||||||
DeviceVO deviceVO = deviceService.selectDeviceBySn(faultVO.getVehicleCode());
|
DeviceVO deviceVO = deviceService.selectDeviceBySn(faultVO.getVehicleCode());
|
||||||
|
// 查询的设备不能为空
|
||||||
if (deviceVO == null){
|
if (deviceVO == null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Long orderId = deviceVO.getOrderId();
|
Long orderId = deviceVO.getOrderId();
|
||||||
if (orderId == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LocalDateTime orderEndTime = orderService.selectOrderById(orderId).getEndTime();
|
LocalDateTime orderEndTime = orderService.selectOrderById(orderId).getEndTime();
|
||||||
if (orderEndTime == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
faultVO.setOrderEndTime(orderEndTime);
|
faultVO.setOrderEndTime(orderEndTime);
|
||||||
validList.add(faultVO);
|
validList.add(faultVO);
|
||||||
});
|
});
|
||||||
return success(validList);
|
return getDataTable(validList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user