故障审核和广告审核完善
This commit is contained in:
parent
b8db402ede
commit
ffe409d63f
|
@ -4,6 +4,10 @@ import java.util.List;
|
||||||
import com.ruoyi.bst.ad.domain.Ad;
|
import com.ruoyi.bst.ad.domain.Ad;
|
||||||
import com.ruoyi.bst.ad.domain.AdVO;
|
import com.ruoyi.bst.ad.domain.AdVO;
|
||||||
import com.ruoyi.bst.ad.domain.AdQuery;
|
import com.ruoyi.bst.ad.domain.AdQuery;
|
||||||
|
import com.ruoyi.bst.ad.domain.AdVerifyDTO;
|
||||||
|
import com.ruoyi.bst.fault.domain.Fault;
|
||||||
|
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||||
|
import com.ruoyi.bst.fault.domain.FaultVerifyDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 广告Service接口
|
* 广告Service接口
|
||||||
|
@ -67,4 +71,6 @@ public interface AdService
|
||||||
List<AdVO> toAppVOList(AdQuery adQuery);
|
List<AdVO> toAppVOList(AdQuery adQuery);
|
||||||
|
|
||||||
public int logicalDel(List<Long> adIds);
|
public int logicalDel(List<Long> adIds);
|
||||||
|
|
||||||
|
public int verify(AdVerifyDTO dto);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
package com.ruoyi.bst.ad.service.impl;
|
package com.ruoyi.bst.ad.service.impl;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.ad.domain.AdVerifyDTO;
|
||||||
import com.ruoyi.bst.ad.enums.AdBlong;
|
import com.ruoyi.bst.ad.enums.AdBlong;
|
||||||
|
import com.ruoyi.bst.ad.enums.AdVerifyStatus;
|
||||||
import com.ruoyi.bst.ad.service.AdConverter;
|
import com.ruoyi.bst.ad.service.AdConverter;
|
||||||
import com.ruoyi.bst.area.domain.AreaVO;
|
import com.ruoyi.bst.area.domain.AreaVO;
|
||||||
import com.ruoyi.bst.area.service.AreaService;
|
import com.ruoyi.bst.area.service.AreaService;
|
||||||
import com.ruoyi.bst.order.domain.OrderQuery;
|
import com.ruoyi.bst.fault.domain.Fault;
|
||||||
import com.ruoyi.bst.order.domain.OrderVO;
|
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||||
|
import com.ruoyi.bst.fault.domain.enums.FaultStatus;
|
||||||
import com.ruoyi.bst.order.service.OrderService;
|
import com.ruoyi.bst.order.service.OrderService;
|
||||||
import com.ruoyi.common.core.domain.entity.User;
|
|
||||||
import com.ruoyi.common.core.domain.vo.UserVO;
|
import com.ruoyi.common.core.domain.vo.UserVO;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
@ -110,7 +112,9 @@ public class AdServiceImpl implements AdService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AreaVO area = areaService.selectAreaById(ad.getAreaId());
|
AreaVO area = areaService.selectAreaById(ad.getAreaId());
|
||||||
ad.setStoreId(area.getUserId());
|
if (area.getUserId() != null){
|
||||||
|
ad.setStoreId(area.getUserId());
|
||||||
|
}
|
||||||
ad.setUpdateTime(DateUtils.getNowDate());
|
ad.setUpdateTime(DateUtils.getNowDate());
|
||||||
return adMapper.updateAd(ad);
|
return adMapper.updateAd(ad);
|
||||||
}
|
}
|
||||||
|
@ -166,4 +170,28 @@ public class AdServiceImpl implements AdService
|
||||||
public int logicalDel(List<Long> adIds) {
|
public int logicalDel(List<Long> adIds) {
|
||||||
return adMapper.logicalDel(adIds);
|
return adMapper.logicalDel(adIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int verify(AdVerifyDTO dto) {
|
||||||
|
// 查询故障申报
|
||||||
|
AdVO ad = this.selectAdByAdId(dto.getId());
|
||||||
|
ServiceUtil.assertion(ad == null, "当前广告信息不存在", dto.getId());
|
||||||
|
ServiceUtil.assertion(!AdVerifyStatus.canVerify().contains(ad.getAuditStatus()), "ID为%s的广告当前不允许审核", dto.getId());
|
||||||
|
// 更新故障申报状态
|
||||||
|
boolean pass = dto.getPass() != null && dto.getPass();
|
||||||
|
// 更新故障申报状态
|
||||||
|
Ad data = new Ad();
|
||||||
|
data.setAuditStatus(pass ? AdVerifyStatus.PASSED.getCode() : AdVerifyStatus.REJECTED.getCode());
|
||||||
|
data.setVerifyBy(SecurityUtils.getUserId());
|
||||||
|
data.setVerifyEndTime(LocalDateTime.now());
|
||||||
|
data.setVerifyRemark(dto.getVerifyRemark());
|
||||||
|
data.setVerifyBy(SecurityUtils.getUserId());
|
||||||
|
AdQuery query = new AdQuery();
|
||||||
|
query.setAdId(dto.getId());
|
||||||
|
query.setStatusList(AdVerifyStatus.canVerify());
|
||||||
|
int rows = adMapper.updateByQuery(data, query);
|
||||||
|
ServiceUtil.assertion(rows != 1, "ID为%s的广告审核失败", dto.getId());
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,4 +72,16 @@ public class Fault extends BaseEntity
|
||||||
@Excel(name = "车牌号")
|
@Excel(name = "车牌号")
|
||||||
@ApiModelProperty("车牌号")
|
@ApiModelProperty("车牌号")
|
||||||
private String vehicleNum;
|
private String vehicleNum;
|
||||||
}
|
|
||||||
|
@Excel(name = "审核备注")
|
||||||
|
@ApiModelProperty("审核备注")
|
||||||
|
private String verifyRemark;
|
||||||
|
|
||||||
|
@Excel(name = "审核结束时间")
|
||||||
|
@ApiModelProperty("审核结束时间")
|
||||||
|
private LocalDateTime verifyEndTime ;
|
||||||
|
|
||||||
|
@ApiModelProperty("审核人ID")
|
||||||
|
private Long verifyBy;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -22,4 +22,6 @@ public class FaultQuery extends FaultVO {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private List<LocalDate> createDateRange;
|
private List<LocalDate> createDateRange;
|
||||||
|
|
||||||
|
@ApiModelProperty("故障申报状态列表")
|
||||||
|
private List<String> statusList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,4 +12,6 @@ public class FaultVO extends Fault{
|
||||||
@ApiModelProperty("用户")
|
@ApiModelProperty("用户")
|
||||||
private String areaName;
|
private String areaName;
|
||||||
|
|
||||||
|
@ApiModelProperty("审核人姓名")
|
||||||
|
private String verifyName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.ruoyi.bst.fault.domain;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FaultVerifyDTO {
|
||||||
|
|
||||||
|
@ApiModelProperty("故障申报")
|
||||||
|
@NotNull(message = "故障申报ID不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否通过")
|
||||||
|
@NotNull(message = "是否通过不能为空")
|
||||||
|
private Boolean pass;
|
||||||
|
|
||||||
|
@ApiModelProperty("审核备注")
|
||||||
|
@Size(max = 200, message = "审核备注不能超过200个字符")
|
||||||
|
private String verifyRemark;
|
||||||
|
|
||||||
|
}
|
|
@ -1,18 +1,31 @@
|
||||||
package com.ruoyi.bst.fault.domain.enums;
|
package com.ruoyi.bst.fault.domain.enums;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum FaultStatus {
|
public enum FaultStatus {
|
||||||
|
|
||||||
REJECTED("0", "已驳回"),
|
REJECTED("0", "已驳回"),
|
||||||
PENGDING("1", "待处理"),
|
PENDING("1", "待处理"),
|
||||||
REPAIRING("2", "维修中"),
|
REPAIRING("2", "维修中"),
|
||||||
COMPLETED("3", "已完成");
|
COMPLETED("3", "已完成");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
// 可以审核的故障审核状态
|
||||||
|
public static List<String> canVerify() {
|
||||||
|
return CollectionUtils.map(FaultStatus::getCode, PENDING);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 可以完成的故障审核状态
|
||||||
|
public static List<String> canComplete() {
|
||||||
|
return CollectionUtils.map(FaultStatus::getCode, REPAIRING);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.ruoyi.bst.fault.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.order.domain.OrderQuery;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import com.ruoyi.bst.fault.domain.Fault;
|
import com.ruoyi.bst.fault.domain.Fault;
|
||||||
|
@ -89,4 +90,6 @@ public interface FaultMapper
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Long> selectIdByQuery(@Param("query") FaultQuery query);
|
List<Long> selectIdByQuery(@Param("query") FaultQuery query);
|
||||||
|
|
||||||
|
int updateByQuery(@Param("data") Fault data,@Param("query") FaultQuery query);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bf.user_id,
|
bf.user_id,
|
||||||
bf.vehicle_num,
|
bf.vehicle_num,
|
||||||
bf.store_id,
|
bf.store_id,
|
||||||
|
bf.verify_by,
|
||||||
|
bf.verify_end_time,
|
||||||
|
bf.verify_remark,
|
||||||
ba.name as area_name,
|
ba.name as area_name,
|
||||||
|
su_verify.user_name as verify_name,
|
||||||
su.agent_id
|
su.agent_id
|
||||||
from <include refid="searchTables"/>
|
from <include refid="searchTables"/>
|
||||||
</sql>
|
</sql>
|
||||||
|
@ -30,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bst_fault bf
|
bst_fault bf
|
||||||
left join bst_area ba on bf.area_id = ba.id
|
left join bst_area ba on bf.area_id = ba.id
|
||||||
left join sys_user su on bf.store_id = su.user_id
|
left join sys_user su on bf.store_id = su.user_id
|
||||||
|
left join sys_user su_verify on bf.verify_by = su_verify.user_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="searchCondition">
|
<sql id="searchCondition">
|
||||||
|
@ -252,6 +257,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{data.id}
|
where id = #{data.id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<!--updateByQuery-->
|
||||||
|
<update id="updateByQuery">
|
||||||
|
update bst_fault bf
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<include refid="updateColumns"/>
|
||||||
|
</trim>
|
||||||
|
<where>
|
||||||
|
<include refid="searchCondition"/>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
|
||||||
<sql id="updateColumns">
|
<sql id="updateColumns">
|
||||||
<if test="data.userName != null and data.userName != ''">user_name = #{data.userName},</if>
|
<if test="data.userName != null and data.userName != ''">user_name = #{data.userName},</if>
|
||||||
<if test="data.vehicleCode != null">vehicle_code = #{data.vehicleCode},</if>
|
<if test="data.vehicleCode != null">vehicle_code = #{data.vehicleCode},</if>
|
||||||
|
@ -261,6 +277,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="data.faultDetail != null">fault_detail = #{data.faultDetail},</if>
|
<if test="data.faultDetail != null">fault_detail = #{data.faultDetail},</if>
|
||||||
<if test="data.appealStatus != null and data.appealStatus != ''">appeal_status = #{data.appealStatus},</if>
|
<if test="data.appealStatus != null and data.appealStatus != ''">appeal_status = #{data.appealStatus},</if>
|
||||||
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
<if test="data.createTime != null">create_time = #{data.createTime},</if>
|
||||||
|
<if test="data.verifyBy != null">verify_by = #{data.verifyBy},</if>
|
||||||
|
<if test="data.verifyEndTime != null">verify_end_time = #{data.verifyEndTime},</if>
|
||||||
|
<if test="data.verifyRemark != null">verify_remark = #{data.verifyRemark},</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<delete id="deleteFaultById" parameterType="Long">
|
<delete id="deleteFaultById" parameterType="Long">
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.ruoyi.bst.area.domain.AreaVO;
|
||||||
import com.ruoyi.bst.fault.domain.Fault;
|
import com.ruoyi.bst.fault.domain.Fault;
|
||||||
import com.ruoyi.bst.fault.domain.FaultVO;
|
import com.ruoyi.bst.fault.domain.FaultVO;
|
||||||
import com.ruoyi.bst.fault.domain.FaultQuery;
|
import com.ruoyi.bst.fault.domain.FaultQuery;
|
||||||
|
import com.ruoyi.bst.fault.domain.FaultVerifyDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障Service接口
|
* 故障Service接口
|
||||||
|
@ -72,4 +73,8 @@ public interface FaultService
|
||||||
FaultVO selectFaultByUserId(Long id);
|
FaultVO selectFaultByUserId(Long id);
|
||||||
|
|
||||||
FaultVO handle(Fault fault);
|
FaultVO handle(Fault fault);
|
||||||
|
|
||||||
|
public int verify(FaultVerifyDTO dto);
|
||||||
|
|
||||||
|
public int complete(FaultVerifyDTO dto);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class FaultConverterImpl implements FaultConverter {
|
||||||
po.setPicture(fault.getPicture());
|
po.setPicture(fault.getPicture());
|
||||||
po.setFaultDetail(fault.getFaultDetail());
|
po.setFaultDetail(fault.getFaultDetail());
|
||||||
po.setCreateBy(fault.getCreateBy());
|
po.setCreateBy(fault.getCreateBy());
|
||||||
po.setAppealStatus(FaultStatus.PENGDING.getCode());
|
po.setAppealStatus(FaultStatus.PENDING.getCode());
|
||||||
po.setCreateTime(DateUtils.getNowDate());
|
po.setCreateTime(DateUtils.getNowDate());
|
||||||
po.setUserName(fault.getCreateBy());
|
po.setUserName(fault.getCreateBy());
|
||||||
po.setUserId(fault.getUserId());
|
po.setUserId(fault.getUserId());
|
||||||
|
@ -76,7 +76,7 @@ public class FaultConverterImpl implements FaultConverter {
|
||||||
po.setUserName(dto.getUserName());
|
po.setUserName(dto.getUserName());
|
||||||
po.setFaultDetail(dto.getFaultDetail());
|
po.setFaultDetail(dto.getFaultDetail());
|
||||||
po.setPicture(dto.getFaultPicture());
|
po.setPicture(dto.getFaultPicture());
|
||||||
po.setAppealStatus(FaultStatus.PENGDING.getCode());
|
po.setAppealStatus(FaultStatus.PENDING.getCode());
|
||||||
if (orderDevice != null) {
|
if (orderDevice != null) {
|
||||||
po.setOrderId(orderDevice.getOrderId());
|
po.setOrderId(orderDevice.getOrderId());
|
||||||
po.setVehicleCode(orderDevice.getDeviceSn());
|
po.setVehicleCode(orderDevice.getDeviceSn());
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class FaultDashboardImpl implements FaultDashboard {
|
||||||
private int selectPendingCount(FaultQuery query) {
|
private int selectPendingCount(FaultQuery query) {
|
||||||
FaultQuery pendingQuery = new FaultQuery();
|
FaultQuery pendingQuery = new FaultQuery();
|
||||||
BeanUtils.copyProperties(query, pendingQuery);
|
BeanUtils.copyProperties(query, pendingQuery);
|
||||||
pendingQuery.setAppealStatus(FaultStatus.PENGDING.getCode());
|
pendingQuery.setAppealStatus(FaultStatus.PENDING.getCode());
|
||||||
return faultMapper.selectCount(pendingQuery);
|
return faultMapper.selectCount(pendingQuery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package com.ruoyi.bst.fault.service.impl;
|
package com.ruoyi.bst.fault.service.impl;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.fault.domain.FaultVerifyDTO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -131,10 +133,10 @@ public class FaultServiceImpl implements FaultService
|
||||||
public FaultVO handle(Fault fault) {
|
public FaultVO handle(Fault fault) {
|
||||||
FaultVO vo = faultMapper.selectFaultById(fault.getId());
|
FaultVO vo = faultMapper.selectFaultById(fault.getId());
|
||||||
ServiceUtil.assertion(vo == null,"当前申报信息不存在");
|
ServiceUtil.assertion(vo == null,"当前申报信息不存在");
|
||||||
if (vo.getAppealStatus().equals(FaultStatus.PENGDING.getCode()) && fault.getHandle().equals(FaultHandleStatus.REJECTED.getCode())) {
|
if (vo.getAppealStatus().equals(FaultStatus.PENDING.getCode()) && fault.getHandle().equals(FaultHandleStatus.REJECTED.getCode())) {
|
||||||
vo.setAppealStatus(FaultStatus.REJECTED.getCode());
|
vo.setAppealStatus(FaultStatus.REJECTED.getCode());
|
||||||
}else
|
}else
|
||||||
if (vo.getAppealStatus().equals(FaultStatus.PENGDING.getCode()) && fault.getHandle().equals(FaultHandleStatus.DO.getCode())) {
|
if (vo.getAppealStatus().equals(FaultStatus.PENDING.getCode()) && fault.getHandle().equals(FaultHandleStatus.DO.getCode())) {
|
||||||
vo.setAppealStatus(FaultStatus.REPAIRING.getCode());
|
vo.setAppealStatus(FaultStatus.REPAIRING.getCode());
|
||||||
}else
|
}else
|
||||||
if (vo.getAppealStatus().equals(FaultStatus.REPAIRING.getCode()) && fault.getHandle().equals(FaultHandleStatus.DO.getCode())) {
|
if (vo.getAppealStatus().equals(FaultStatus.REPAIRING.getCode()) && fault.getHandle().equals(FaultHandleStatus.DO.getCode())) {
|
||||||
|
@ -142,4 +144,47 @@ public class FaultServiceImpl implements FaultService
|
||||||
}
|
}
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int verify(FaultVerifyDTO dto) {
|
||||||
|
// 查询故障申报
|
||||||
|
FaultVO fault = this.selectFaultById(dto.getId());
|
||||||
|
ServiceUtil.assertion(fault == null, "当前故障申报信息不存在", dto.getId());
|
||||||
|
ServiceUtil.assertion(!FaultStatus.canVerify().contains(fault.getAppealStatus()), "ID为%s的故障申报当前不允许审核", dto.getId());
|
||||||
|
// 更新故障申报状态
|
||||||
|
boolean pass = dto.getPass() != null && dto.getPass();
|
||||||
|
// 更新故障申报状态
|
||||||
|
Fault data = new Fault();
|
||||||
|
data.setAppealStatus(pass ? FaultStatus.REPAIRING.getCode() : FaultStatus.REJECTED.getCode());
|
||||||
|
data.setVerifyEndTime(LocalDateTime.now());
|
||||||
|
data.setVerifyRemark(dto.getVerifyRemark());
|
||||||
|
data.setVerifyBy(SecurityUtils.getUserId());
|
||||||
|
FaultQuery query = new FaultQuery();
|
||||||
|
query.setId(dto.getId());
|
||||||
|
query.setStatusList(FaultStatus.canVerify());
|
||||||
|
int rows = faultMapper.updateByQuery(data, query);
|
||||||
|
ServiceUtil.assertion(rows != 1, "ID为%s的故障申报审核失败", dto.getId());
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int complete(FaultVerifyDTO dto) {
|
||||||
|
// 查询故障申报
|
||||||
|
FaultVO fault = this.selectFaultById(dto.getId());
|
||||||
|
ServiceUtil.assertion(fault == null, "当前故障申报信息不存在", dto.getId());
|
||||||
|
ServiceUtil.assertion(!FaultStatus.canComplete().contains(fault.getAppealStatus()), "ID为%s的故障申报当前不允许审核", dto.getId());
|
||||||
|
// 更新故障申报状态
|
||||||
|
boolean pass = dto.getPass() != null && dto.getPass();
|
||||||
|
ServiceUtil.assertion(!pass,"当前故障申报不可更新为此状态");
|
||||||
|
// 更新故障申报状态
|
||||||
|
Fault data = new Fault();
|
||||||
|
data.setAppealStatus(FaultStatus.COMPLETED.getCode());
|
||||||
|
data.setVerifyEndTime(LocalDateTime.now());
|
||||||
|
FaultQuery query = new FaultQuery();
|
||||||
|
query.setId(dto.getId());
|
||||||
|
query.setStatusList(FaultStatus.canComplete());
|
||||||
|
int rows = faultMapper.updateByQuery(data, query);
|
||||||
|
ServiceUtil.assertion(rows != 1, "ID为%s的故障申报完成失败", dto.getId());
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,14 @@ package com.ruoyi.web.bst;
|
||||||
import com.ruoyi.bst.ad.domain.Ad;
|
import com.ruoyi.bst.ad.domain.Ad;
|
||||||
import com.ruoyi.bst.ad.domain.AdQuery;
|
import com.ruoyi.bst.ad.domain.AdQuery;
|
||||||
import com.ruoyi.bst.ad.domain.AdVO;
|
import com.ruoyi.bst.ad.domain.AdVO;
|
||||||
|
import com.ruoyi.bst.ad.domain.AdVerifyDTO;
|
||||||
import com.ruoyi.bst.ad.enums.AdBlong;
|
import com.ruoyi.bst.ad.enums.AdBlong;
|
||||||
import com.ruoyi.bst.ad.service.AdConverter;
|
import com.ruoyi.bst.ad.service.AdConverter;
|
||||||
import com.ruoyi.bst.ad.service.AdService;
|
import com.ruoyi.bst.ad.service.AdService;
|
||||||
import com.ruoyi.bst.ad.service.AdValidator;
|
import com.ruoyi.bst.ad.service.AdValidator;
|
||||||
import com.ruoyi.bst.area.service.AreaService;
|
import com.ruoyi.bst.area.service.AreaService;
|
||||||
|
import com.ruoyi.bst.fault.domain.Fault;
|
||||||
|
import com.ruoyi.bst.fault.domain.FaultVerifyDTO;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
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;
|
||||||
|
@ -19,9 +22,11 @@ import com.ruoyi.common.utils.ServiceUtil;
|
||||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.system.user.service.UserService;
|
import com.ruoyi.system.user.service.UserService;
|
||||||
import com.ruoyi.system.user.service.UserValidator;
|
import com.ruoyi.system.user.service.UserValidator;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.checkerframework.checker.units.qual.A;
|
import org.checkerframework.checker.units.qual.A;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
@ -122,4 +127,22 @@ public class AdController extends BaseController
|
||||||
}
|
}
|
||||||
return toAjax(adService.logicalDel(adIds));
|
return toAjax(adService.logicalDel(adIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后台处理或者驳回添加广告申请
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bst:ad:edit')")
|
||||||
|
@Log(title = "广告", businessType = BusinessType.UPDATE)
|
||||||
|
@ApiOperation("后台处理或者驳回添加广告申请")
|
||||||
|
@PutMapping("/handle")
|
||||||
|
public AjaxResult handle(@RequestBody @Validated AdVerifyDTO dto) {
|
||||||
|
if (!isSysAdmin()){
|
||||||
|
return AjaxResult.error("您没有权限处理id为" + dto.getId() + "的广告添加申请");
|
||||||
|
}
|
||||||
|
return toAjax(adService.verify(dto));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,11 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.fault.domain.FaultVerifyDTO;
|
||||||
|
import com.ruoyi.bst.order.domain.dto.OrderVerifyDTO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
@ -121,20 +124,34 @@ public class FaultController extends BaseController
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理或者驳回申报信息
|
* 审核待处理故障申报
|
||||||
* @param fault
|
* @param dto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('bst:fault:edit')")
|
@PreAuthorize("@ss.hasPermi('bst:fault:edit')")
|
||||||
@Log(title = "故障", businessType = BusinessType.UPDATE)
|
@Log(title = "故障", businessType = BusinessType.UPDATE)
|
||||||
@ApiOperation("处理申报信息")
|
@ApiOperation("审核待处理故障申报")
|
||||||
@PutMapping("/handle")
|
@PutMapping("/handle")
|
||||||
public AjaxResult update(@RequestBody Fault fault) {
|
public AjaxResult handle(@RequestBody @Validated FaultVerifyDTO dto) {
|
||||||
if (!faultValidator.canEdit(fault.getId())){
|
if (!faultValidator.canEdit(dto.getId())){
|
||||||
return AjaxResult.error("您没有权限处理id为" + fault.getId() + "的故障申报");
|
return AjaxResult.error("您没有权限处理id为" + dto.getId() + "的故障申报");
|
||||||
}
|
}
|
||||||
faultService.updateFault(faultService.handle(fault));
|
return toAjax(faultService.verify(dto));
|
||||||
return success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成维修中故障申报
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('bst:fault:edit')")
|
||||||
|
@Log(title = "故障", businessType = BusinessType.UPDATE)
|
||||||
|
@ApiOperation("完成维修中故障申报")
|
||||||
|
@PutMapping("/complete")
|
||||||
|
public AjaxResult complete(@RequestBody @Validated FaultVerifyDTO dto) {
|
||||||
|
if (!faultValidator.canEdit(dto.getId())){
|
||||||
|
return AjaxResult.error("您没有权限处理id为" + dto.getId() + "的故障申报");
|
||||||
|
}
|
||||||
|
return toAjax(faultService.complete(dto));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class OrderController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 还车审核
|
* 还车审核
|
||||||
*/
|
*/
|
||||||
@Log(title = "还车审核", businessType = BusinessType.UPDATE)
|
@Log(title = "还车审核", businessType = BusinessType. UPDATE)
|
||||||
@PreAuthorize("@ss.hasPermi('bst:order:verify')")
|
@PreAuthorize("@ss.hasPermi('bst:order:verify')")
|
||||||
@PutMapping("/verify")
|
@PutMapping("/verify")
|
||||||
public AjaxResult verify(@RequestBody @Validated OrderVerifyDTO dto) {
|
public AjaxResult verify(@RequestBody @Validated OrderVerifyDTO dto) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user