diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java
index 2135899e..e4cea00e 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/index/service/DashboardService.java
@@ -160,7 +160,7 @@ public class DashboardService {
// 设备故障
AbnormalQuery abnormalQuery = new AbnormalQuery();
- abnormalQuery.setStatus(AbnormalStatus.UNREAD.getStatus());
+ abnormalQuery.setStatus(AbnormalStatus.UNDO.getStatus());
vo.setAbnormalCount(abnormalService.selectCount(abnormalQuery));
// 投诉意见
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java
index 75190a85..222930b9 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/Abnormal.java
@@ -32,6 +32,18 @@ public class Abnormal extends BaseEntity
@ApiModelProperty("设备ID")
private Long deviceId;
+ @ApiModelProperty("设备SN码")
+ private String deviceNo;
+
+ @ApiModelProperty("订单id")
+ private Long orderId;
+
+ @ApiModelProperty("订单编号")
+ private String orderNo;
+
+ @ApiModelProperty("商户id")
+ private Long storeId;
+
/** 故障描述 */
@ApiModelProperty("故障描述")
@Excel(name = "故障描述")
@@ -58,6 +70,7 @@ public class Abnormal extends BaseEntity
@Size(max = 200, message = "联系地址长度不能超过200个字符")
private String address;
- @ApiModelProperty("状态:1-未读,2-已读")
+ @ApiModelProperty("状态:1-未处理,2-驳回 3-已处理")
private String status;
+
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalQuery.java
index d72d9c3d..f8f8ec40 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalQuery.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalQuery.java
@@ -13,7 +13,5 @@ public class AbnormalQuery extends Abnormal {
@ApiModelProperty("关键词,可以是故障描述、故障编号")
private String keyword;
- @ApiModelProperty("设备编号")
- private String deviceNo;
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalVO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalVO.java
index 7492cc7c..445d4007 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalVO.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/AbnormalVO.java
@@ -10,9 +10,6 @@ import lombok.Data;
@Data
public class AbnormalVO extends Abnormal {
- @ApiModelProperty("设备编号")
- private String deviceNo;
-
@ApiModelProperty("用户名称")
private String userName;
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/enums/AbnormalStatus.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/enums/AbnormalStatus.java
index 26e30f77..21acd888 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/enums/AbnormalStatus.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/domain/enums/AbnormalStatus.java
@@ -11,8 +11,10 @@ import lombok.Getter;
@AllArgsConstructor
public enum AbnormalStatus {
- UNREAD("1", "未读"),
- READ("2", "已读");
+ UNDO("1", "修改状态为未处理"),
+ OVERRULE("2", "修改状态为驳回"),
+ DO("3", "修改状态为已处理");
+
private final String status;
private final String msg;
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java
index 4d9f8f44..c0511336 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.java
@@ -74,4 +74,6 @@ public interface AbnormalMapper
* 查询数量
*/
int selectCount(AbnormalQuery query);
+
+ int updateAbnormalByOrderId(String orderId);
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.xml
index 1e593b71..e603755e 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.xml
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/mapper/AbnormalMapper.xml
@@ -18,9 +18,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sa.create_time,
sa.create_by,
sa.update_time,
+ sa.device_no,
sa.update_by,
sa.deleted,
sa.user_id,
+ sa.order_no,
+ sa.order_id,
+ sa.store_id,
su.user_name as user_name,
sd.device_no as device_no
from
@@ -45,6 +49,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and sa.`status` = #{status}
and sa.`user_id` = #{userId}
and sa.`deleted` = #{deleted}
+ and sa.`order_no` = #{orderNo}
+ and sa.`order_id` = #{orderId}
+ and sa.`store_id` = #{storeId}
and sa.deleted = false
and (
@@ -73,6 +80,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into ss_abnormal
device_id,
+ order_no,
+ order_id,
+ store_id,
+ device_no,
content,
`name`,
mobile,
@@ -87,6 +98,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{deviceId},
+ #{orderNo},
+ #{orderId},
+ #{storeId},
+ #{deviceNo},
#{content},
#{name},
#{mobile},
@@ -102,19 +117,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- update ss_abnormal
+ update ss_abnormal sa
- device_no = #{deviceId},
+ device_id = #{deviceId},
+ device_no = #{deviceNo},
content = #{content},
- `name` = #{name},
+ name = #{name},
mobile = #{mobile},
address = #{address},
- `status` = #{status},
+ status = #{status},
update_time = #{updateTime},
update_by = #{updateBy},
- user_id = #{userId},
+ user_id = #{userId}
- where abnormal_id = #{abnormalId}
+ where sa.abnormal_id = #{abnormalId}
@@ -126,6 +142,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+ update ss_abnormal sa
+
+ device_id = #{deviceId},
+ content = #{content},
+ name = #{name},
+ mobile = #{mobile},
+ address = #{address},
+ status = #{status},
+ update_time = #{updateTime},
+ update_by = #{updateBy},
+ user_id = #{userId}
+
+ where sa.order_no = #{orderNo}
+
+
delete from ss_abnormal where abnormal_id = #{abnormalId}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/AbnormalService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/AbnormalService.java
index dad4c0fe..610ce46e 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/AbnormalService.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/AbnormalService.java
@@ -66,4 +66,6 @@ public interface AbnormalService
* 查询数量
*/
int selectCount(AbnormalQuery query);
+
+ int updateAbnormalByOrderId(AbnormalQuery query);
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalConverterImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalConverterImpl.java
index 9dec3309..d9974f4c 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalConverterImpl.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalConverterImpl.java
@@ -7,7 +7,9 @@ import com.ruoyi.ss.abnormal.domain.enums.AbnormalStatus;
import com.ruoyi.ss.abnormal.service.AbnormalConverter;
import com.ruoyi.ss.abnormal.service.AbnormalService;
import com.ruoyi.ss.device.domain.vo.DeviceVO;
+import com.ruoyi.ss.device.mapper.DeviceMapper;
import com.ruoyi.ss.device.service.DeviceService;
+import com.ruoyi.ss.store.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -24,6 +26,10 @@ public class AbnormalConverterImpl implements AbnormalConverter {
@Autowired
private DeviceService deviceService;
+ @Autowired
+ private StoreService storeService;
+
+
@Override
public Abnormal toPo(AbnormalSubmitDTO dto) {
if (dto == null) {
@@ -35,11 +41,15 @@ public class AbnormalConverterImpl implements AbnormalConverter {
Abnormal po = new Abnormal();
po.setUserId(dto.getUserId());
po.setDeviceId(device.getDeviceId());
+ po.setOrderNo(dto.getOrderNo());
+ po.setStoreId(dto.getStoreId());
+ po.setDeviceNo(dto.getDeviceNo());
po.setContent(dto.getContent());
+ po.setOrderId(dto.getOrderId());
po.setName(dto.getName());
po.setMobile(dto.getMobile());
po.setAddress(dto.getAddress());
- po.setStatus(AbnormalStatus.UNREAD.getStatus());
+ po.setStatus(AbnormalStatus.UNDO.getStatus());
po.setCreateBy(dto.getCreateBy());
return po;
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java
index 3c2acb37..2697e33d 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/abnormal/service/impl/AbnormalServiceImpl.java
@@ -101,4 +101,9 @@ public class AbnormalServiceImpl implements AbnormalService
public int selectCount(AbnormalQuery query) {
return abnormalMapper.selectCount(query);
}
+
+ @Override
+ public int updateAbnormalByOrderId(AbnormalQuery query) {
+ return abnormalMapper.updateAbnormalByOrderId(query.getOrderNo());
+ }
}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceServiceImpl.java
index 0047283e..3d079542 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceServiceImpl.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/service/impl/DeviceServiceImpl.java
@@ -13,6 +13,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
+import com.ruoyi.ss.snLog.domain.SnLog;
import com.ruoyi.ss.transactionBill.service.TransactionAssembler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -244,10 +245,18 @@ public class DeviceServiceImpl implements DeviceService
data.setUpdateTime(DateUtils.getNowDate());
Integer result = transactionTemplate.execute(status -> {
+ deviceMapper.selectByDeviceNo(data.getDeviceNo());
+
// 更新主表
int update = deviceMapper.updateSmDevice(data);
ServiceUtil.assertion(update != 1, "更新设备失败");
+ // 生成SnLog记录
+ SnLog snLog = new SnLog();
+ snLog.setDeviceId(data.getDeviceId());
+ snLog.setUserId(SecurityUtils.getUserId());
+ snLog.setMac(data.getMac());
+
// 后校验
DeviceVO vo = this.selectById(data.getDeviceId());
deviceAssembler.assembleBonusList(vo);
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLog.java b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLog.java
new file mode 100644
index 00000000..6c92ec46
--- /dev/null
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLog.java
@@ -0,0 +1,43 @@
+package com.ruoyi.ss.snLog.domain;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * Sn码更换日志对象 ss_sn_log
+ *
+ * @author ruoyi
+ * @date 2025-03-31
+ */
+@Data
+public class SnLog extends BaseEntity
+{
+ private static final long serialVersionUID = 1L;
+
+ private Long id;
+
+ @Excel(name = "设备id")
+ @ApiModelProperty("设备id")
+ private Long deviceId;
+
+ @Excel(name = "操作人id")
+ @ApiModelProperty("操作人id")
+ private Long userId;
+
+ @Excel(name = "设备Mac号")
+ @ApiModelProperty("设备Mac号")
+ private String mac;
+
+ @Excel(name = "原sn")
+ @ApiModelProperty("原sn")
+ private String oldSn;
+
+ @Excel(name = "当前sn")
+ @ApiModelProperty("当前sn")
+ private String newSn;
+
+}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLogQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLogQuery.java
new file mode 100644
index 00000000..937c7943
--- /dev/null
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLogQuery.java
@@ -0,0 +1,7 @@
+package com.ruoyi.ss.snLog.domain;
+
+import lombok.Data;
+
+@Data
+public class SnLogQuery extends SnLog {
+}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLogVO.java b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLogVO.java
new file mode 100644
index 00000000..2d532162
--- /dev/null
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/domain/SnLogVO.java
@@ -0,0 +1,8 @@
+package com.ruoyi.ss.snLog.domain;
+
+import lombok.Data;
+
+@Data
+public class SnLogVO extends SnLog {
+
+}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/mapper/SnLogMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/mapper/SnLogMapper.java
new file mode 100644
index 00000000..33a8e7fb
--- /dev/null
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/mapper/SnLogMapper.java
@@ -0,0 +1,74 @@
+package com.ruoyi.ss.snLog.mapper;
+
+import java.util.List;
+import com.ruoyi.ss.snLog.domain.SnLog;
+import com.ruoyi.ss.snLog.domain.SnLogVO;
+import com.ruoyi.ss.snLog.domain.SnLogQuery;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * Sn码更换日志Mapper接口
+ *
+ * @author ruoyi
+ * @date 2025-03-31
+ */
+public interface SnLogMapper
+{
+ /**
+ * 查询Sn码更换日志
+ *
+ * @param id Sn码更换日志主键
+ * @return Sn码更换日志
+ */
+ SnLogVO selectSnLogById(Long id);
+
+ /**
+ * 查询Sn码更换日志列表
+ *
+ * @param query Sn码更换日志
+ * @return Sn码更换日志集合
+ */
+ List selectSnLogList(@Param("query")SnLogQuery query);
+
+ /**
+ * 新增Sn码更换日志
+ *
+ * @param snLog Sn码更换日志
+ * @return 结果
+ */
+ int insertSnLog(SnLog snLog);
+
+ /**
+ * 批量新增Sn码更换日志
+ */
+ int batchInsert(@Param("list") List extends SnLog> list);
+
+ /**
+ * 批量修改Sn码更换日志
+ */
+ int batchUpdate(@Param("list") List extends SnLog> list);
+
+ /**
+ * 修改Sn码更换日志
+ *
+ * @param snLog Sn码更换日志
+ * @return 结果
+ */
+ public int updateSnLog(@Param("data") SnLog snLog);
+
+ /**
+ * 删除Sn码更换日志
+ *
+ * @param id Sn码更换日志主键
+ * @return 结果
+ */
+ int deleteSnLogById(Long id);
+
+ /**
+ * 批量删除Sn码更换日志
+ *
+ * @param ids 需要删除的数据主键集合
+ * @return 结果
+ */
+ public int deleteSnLogByIds(Long[] ids);
+}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/service/SnLogService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/service/SnLogService.java
new file mode 100644
index 00000000..287d6fc3
--- /dev/null
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/service/SnLogService.java
@@ -0,0 +1,63 @@
+package com.ruoyi.ss.snLog.service;
+
+import java.util.List;
+import com.ruoyi.ss.snLog.domain.SnLog;
+import com.ruoyi.ss.snLog.domain.SnLogVO;
+import com.ruoyi.ss.snLog.domain.SnLogQuery;
+
+/**
+ * Sn码更换日志Service接口
+ *
+ * @author ruoyi
+ * @date 2025-03-31
+ */
+public interface SnLogService
+{
+ /**
+ * 查询Sn码更换日志
+ *
+ * @param id Sn码更换日志主键
+ * @return Sn码更换日志
+ */
+ public SnLogVO selectSnLogById(Long id);
+
+ /**
+ * 查询Sn码更换日志列表
+ *
+ * @param snLog Sn码更换日志
+ * @return Sn码更换日志集合
+ */
+ public List selectSnLogList(SnLogQuery snLog);
+
+ /**
+ * 新增Sn码更换日志
+ *
+ * @param snLog Sn码更换日志
+ * @return 结果
+ */
+ public int insertSnLog(SnLog snLog);
+
+ /**
+ * 修改Sn码更换日志
+ *
+ * @param snLog Sn码更换日志
+ * @return 结果
+ */
+ public int updateSnLog(SnLog snLog);
+
+ /**
+ * 批量删除Sn码更换日志
+ *
+ * @param ids 需要删除的Sn码更换日志主键集合
+ * @return 结果
+ */
+ public int deleteSnLogByIds(Long[] ids);
+
+ /**
+ * 删除Sn码更换日志信息
+ *
+ * @param id Sn码更换日志主键
+ * @return 结果
+ */
+ public int deleteSnLogById(Long id);
+}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/service/impl/SnLogServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/service/impl/SnLogServiceImpl.java
new file mode 100644
index 00000000..80a4a290
--- /dev/null
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/snLog/service/impl/SnLogServiceImpl.java
@@ -0,0 +1,97 @@
+package com.ruoyi.ss.snLog.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.ss.snLog.mapper.SnLogMapper;
+import com.ruoyi.ss.snLog.domain.SnLog;
+import com.ruoyi.ss.snLog.domain.SnLogVO;
+import com.ruoyi.ss.snLog.domain.SnLogQuery;
+import com.ruoyi.ss.snLog.service.SnLogService;
+
+/**
+ * Sn码更换日志Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2025-03-31
+ */
+@Service
+public class SnLogServiceImpl implements SnLogService
+{
+ @Autowired
+ private SnLogMapper snLogMapper;
+
+ /**
+ * 查询Sn码更换日志
+ *
+ * @param id Sn码更换日志主键
+ * @return Sn码更换日志
+ */
+ @Override
+ public SnLogVO selectSnLogById(Long id)
+ {
+ return snLogMapper.selectSnLogById(id);
+ }
+
+ /**
+ * 查询Sn码更换日志列表
+ *
+ * @param snLog Sn码更换日志
+ * @return Sn码更换日志
+ */
+ @Override
+ public List selectSnLogList(SnLogQuery snLog)
+ {
+ return snLogMapper.selectSnLogList(snLog);
+ }
+
+ /**
+ * 新增Sn码更换日志
+ *
+ * @param snLog Sn码更换日志
+ * @return 结果
+ */
+ @Override
+ public int insertSnLog(SnLog snLog)
+ {
+ return snLogMapper.insertSnLog(snLog);
+ }
+
+ /**
+ * 修改Sn码更换日志
+ *
+ * @param snLog Sn码更换日志
+ * @return 结果
+ */
+ @Override
+ public int updateSnLog(SnLog snLog)
+ {
+ snLog.setUpdateTime(DateUtils.getNowDate());
+ return snLogMapper.updateSnLog(snLog);
+ }
+
+ /**
+ * 批量删除Sn码更换日志
+ *
+ * @param ids 需要删除的Sn码更换日志主键
+ * @return 结果
+ */
+ @Override
+ public int deleteSnLogByIds(Long[] ids)
+ {
+ return snLogMapper.deleteSnLogByIds(ids);
+ }
+
+ /**
+ * 删除Sn码更换日志信息
+ *
+ * @param id Sn码更换日志主键
+ * @return 结果
+ */
+ @Override
+ public int deleteSnLogById(Long id)
+ {
+ return snLogMapper.deleteSnLogById(id);
+ }
+}
diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillValidatorImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillValidatorImpl.java
index 724f7bfc..4a7108ae 100644
--- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillValidatorImpl.java
+++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillValidatorImpl.java
@@ -421,6 +421,9 @@ public class TransactionBillValidatorImpl extends BaseValidator implements Trans
@Override
public boolean canViewOrder(TransactionBillVO bill, Long userId) {
+ if (bill == null) {
+ return false;
+ }
return this.isMch(bill, userId)
|| this.isUser(bill, userId)
|| this.isAgent(bill, userId)
diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppAbnormalController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppAbnormalController.java
index 758b9f52..051c8624 100644
--- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppAbnormalController.java
+++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppAbnormalController.java
@@ -10,6 +10,14 @@ import com.ruoyi.ss.abnormal.domain.AbnormalQuery;
import com.ruoyi.ss.abnormal.service.AbnormalConverter;
import com.ruoyi.ss.abnormal.service.AbnormalValidator;
import com.ruoyi.ss.abnormal.service.AbnormalService;
+import com.ruoyi.ss.device.domain.vo.DeviceVO;
+import com.ruoyi.ss.device.service.DeviceService;
+import com.ruoyi.ss.payBill.domain.PayBillVO;
+import com.ruoyi.ss.payBill.service.PayBillService;
+import com.ruoyi.ss.transactionBill.domain.TransactionBill;
+import com.ruoyi.ss.transactionBill.domain.vo.TransactionBillVO;
+import com.ruoyi.ss.transactionBill.service.TransactionBillService;
+import com.ruoyi.ss.vipOrder.service.VipOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@@ -34,11 +42,33 @@ public class AppAbnormalController extends BaseController {
@Autowired
private AbnormalConverter abnormalConverter;
+ @Autowired
+ private TransactionBillService transactionBillService;
+
+ @Autowired
+ private DeviceService deviceService;
+
@ApiOperation("提交设备故障反馈")
@PostMapping("/submit")
public AjaxResult submit(@RequestBody @Validated(ValidGroup.FrontCreate.class) AbnormalSubmitDTO data) {
data.setUserId(getUserId());
data.setCreateBy(getUsername());
+ TransactionBillVO vo = transactionBillService.selectSmTransactionBillByBillId(data.getOrderId());
+ if (vo != null) {
+ data.setOrderNo(vo.getBillNo());
+ // 获取订单商户id
+ if (vo.getMchId() != null) {
+ data.setStoreId(vo.getMchId());
+ }
+ }
+ // 获取设备商户id
+ DeviceVO deviceVO = deviceService.selectByDeviceNo(data.getDeviceNo());
+ if (deviceVO != null) {
+ Long storeId = deviceVO.getStoreId();
+ if (storeId != null) {
+ data.setStoreId(storeId);
+ }
+ }
return success(abnormalService.insertAbnormal(abnormalConverter.toPo(data)));
}
diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/mch/MchAbnormalController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/mch/MchAbnormalController.java
new file mode 100644
index 00000000..77e3d463
--- /dev/null
+++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/mch/MchAbnormalController.java
@@ -0,0 +1,42 @@
+package com.ruoyi.web.controller.mch;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.ss.abnormal.domain.AbnormalQuery;
+import com.ruoyi.ss.abnormal.service.AbnormalService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/mch/abnormal")
+public class MchAbnormalController extends BaseController {
+
+ @Autowired
+ private AbnormalService abnormalService;
+
+ @ApiOperation("商户处理申诉状态")
+ @PutMapping
+ public AjaxResult updateAbnormalStatus(AbnormalQuery query) {
+ return AjaxResult.success(abnormalService.updateAbnormal(query));
+ }
+
+ @ApiOperation("商户查询用户故障反馈列表")
+ @GetMapping("/list")
+ public TableDataInfo abnormalList(AbnormalQuery query) {
+ startPage();
+ query.setStoreId(getUserId());
+ return getDataTable(abnormalService.selectAbnormalList(query));
+ }
+
+ @ApiOperation("商户查询用户故障反馈详情")
+ @GetMapping("/{id}")
+ public AjaxResult selectAbnormal(Long id) {
+ return AjaxResult.success(abnormalService.selectAbnormalByAbnormalId(id));
+ }
+}
diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SnLogController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SnLogController.java
new file mode 100644
index 00000000..3dcbfd73
--- /dev/null
+++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SnLogController.java
@@ -0,0 +1,101 @@
+package com.ruoyi.web.controller.ss;
+
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.ss.snLog.domain.SnLog;
+import com.ruoyi.ss.snLog.domain.SnLogQuery;
+import com.ruoyi.ss.snLog.domain.SnLogVO;
+import com.ruoyi.ss.snLog.service.SnLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * Sn码更换日志Controller
+ *
+ * @author ruoyi
+ * @date 2025-03-31
+ */
+@RestController
+@RequestMapping("/ss/snLog")
+public class SnLogController extends BaseController
+{
+ @Autowired
+ private SnLogService snLogService;
+
+ /**
+ * 查询Sn码更换日志列表
+ */
+ @PreAuthorize("@ss.hasPermi('ss:snLog:list')")
+ @GetMapping("/list")
+ public TableDataInfo list(SnLogQuery query)
+ {
+ startPage();
+ startOrderBy();
+ List list = snLogService.selectSnLogList(query);
+ return getDataTable(list);
+ }
+
+ /**
+ * 导出Sn码更换日志列表
+ */
+ @PreAuthorize("@ss.hasPermi('ss:snLog:export')")
+ @Log(title = "Sn码更换日志", businessType = BusinessType.EXPORT)
+ @PostMapping("/export")
+ public void export(HttpServletResponse response, SnLogQuery query)
+ {
+ List list = snLogService.selectSnLogList(query);
+ ExcelUtil util = new ExcelUtil(SnLogVO.class);
+ util.exportExcel(response, list, "Sn码更换日志数据");
+ }
+
+ /**
+ * 获取Sn码更换日志详细信息
+ */
+ @PreAuthorize("@ss.hasPermi('ss:snLog:query')")
+ @GetMapping(value = "/{id}")
+ public AjaxResult getInfo(@PathVariable("id") Long id)
+ {
+ return success(snLogService.selectSnLogById(id));
+ }
+
+ /**
+ * 新增Sn码更换日志
+ */
+ @PreAuthorize("@ss.hasPermi('ss:snLog:add')")
+ @Log(title = "Sn码更换日志", businessType = BusinessType.INSERT)
+ @PostMapping
+ public AjaxResult add(@RequestBody SnLog snLog)
+ {
+ return toAjax(snLogService.insertSnLog(snLog));
+ }
+
+ /**
+ * 修改Sn码更换日志
+ */
+ @PreAuthorize("@ss.hasPermi('ss:snLog:edit')")
+ @Log(title = "Sn码更换日志", businessType = BusinessType.UPDATE)
+ @PutMapping
+ public AjaxResult edit(@RequestBody SnLog snLog)
+ {
+ return toAjax(snLogService.updateSnLog(snLog));
+ }
+
+ /**
+ * 删除Sn码更换日志
+ */
+ @PreAuthorize("@ss.hasPermi('ss:snLog:remove')")
+ @Log(title = "Sn码更换日志", businessType = BusinessType.DELETE)
+ @DeleteMapping("/{ids}")
+ public AjaxResult remove(@PathVariable Long[] ids)
+ {
+ return toAjax(snLogService.deleteSnLogByIds(ids));
+ }
+}
diff --git a/smart-switch-web/src/main/resources/application-dev.yml b/smart-switch-web/src/main/resources/application-dev.yml
index 764ae9fe..043f9fd6 100644
--- a/smart-switch-web/src/main/resources/application-dev.yml
+++ b/smart-switch-web/src/main/resources/application-dev.yml
@@ -27,7 +27,7 @@ wx:
apiV3Key: 49819e0f0abdb2df3246f7b27f264d75
# 密钥所在位置
# privateKeyPath: H:/project/创特/证书/wxpay-kg/apiclient_key.pem
- privateKeyPath: D:/project/证书/wxpay-kg/apiclient_key.pem
+ privateKeyPath: D:/Work/SmSwitch/wxpay-kg/apiclient_key.pem
# 证书序列号
merchantSerialNumber: 6AD69237C0F22A9AE51A64F1927E3A0962AC1FB0
# 转账回调地址
@@ -127,11 +127,12 @@ ali:
# 应用私钥
privateKey: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCYZr1VQ3FAD3PwcFMTC0sYWRRrxMu3bweEnXU2uK/o+3wxzrnax5l/SUvQJ3CeWUPC7X0cCNMhCVn0NYL08zIMyI9E5x42ry1qvKBRLhBUkctC9XTnIdTjuMbj5XqWuowLlVTP5EdGt4byyEUIh0wGa6WnS9yGn117jfFBii+E7MP+gDXe0HTmxafh8W+VOnAonaBIOLxV5h+AkkK5XKxn/S9EbiVsy/ce7QPkPLBBd1LvjxdHwJ267G9iH0aBhHIxfMKLcfG547Hug+gTcQRkp5Akk05jPiCPBPHYGETE5fAwSiQHsnCUa9AibqcbD1+9Dw1UkSoudeVqbgnB7KzhAgMBAAECggEAZho28J+9iQCRWV23moOvbQGJN+Zh4WQmckeXlvDHEd0iyK/KPnQJN4jgnPU/cyc0yayYbCbRZEnClWUgdoFUX9IigjQhPtvAHsl+0sR8tlvzBMoz5wH4ghRyU46TwdX7K2uBpcI3qn4ckB1yepNCcO6/zcR6W0r7s2JWZuVwjqmR++ixdV8jqg06kxWu39II68ormgflCvkOlJWhPbEeEDUqgRJUDx2r+iJZORlNIj0cT8BgCo4qfeyQWNpANhTBDpC3zXeBBmg5iG8JQTTokEeqwV8Ph1/JR6dOXT3Fn5Ok0tRndhS++XUB8Zqgc3q6F9Fe/za7225TBhV7TnOvvQKBgQDkMttCWNpZWSyQvjK/KMtd3c80XCC8ch0E3ReA1sZRSnsFfOwHb8+pdHeY54DgBtFohP9bmkb+tRtGwgpgWawSWD1iErX8FD78lqPHzJjUiQ+a1vJIkvfp1fJX4HlDTy3PuVW/OZgDL0udCSeTVmr/zBr1nLRdDkYlj9+Ra3bWAwKBgQCq9+NaX354pc6Qawtst4CNhV4NxSMiqefSXx8XV0hlzPnmb4PoBjj/lzdSKgcc7pxunLMmGK9pxDBDqi6y219ciPf5bZKlxoUo7GGHtt1yiMsRduAEHUaitQjXUAo5QXh0kqF4eu+JrXiGCjnNA6s3aQM2VK5szgicx+bbtpf+SwKBgB2Cgh4rVVk2ke/J2NAlm17xHyl7PHSCIUSOvspXe9/pTM1h4Tf4+pbES+8HCQBvgUcN4+PZqJKpovRchXD+R6U7qfxzxPrrN1X8uQNObvkVHGJ+p2hBMTQZCbTZf3T32UnCgtcuwHyw8gtFsst34nBf2aCneh+KiAG1gEjS59Q3AoGAH3oYL7FZNZlBWLF8nv2B+4xMbriW6XDir4a30LJPL/73G4f4fyV2JQiQNN5sBNWhk3PiP+dXlF98i1iv1FozSnQlQ5T65O6R4aDzq+rtBoNM7+A1Ckzhjl9KS2n/F9+H7953QBlSNMTtZbBISAie40rAPqaEnp+oUkUzqcwKW9UCgYAp+2aBq+lumJWGugoxkm8G3hJPO9B2Q/Ogn0+DrCL8GQFoiSYmF+x1d0K2fGglq8CjIK/HnzP7k3qn5ZQlkyn6UzVD0UbibWU2WSdh3100tJ9vpgngGkPaxx5+ZxDxzH8ljIwJZPWKK+xsbW+kX+DFIGBJ038zXwZ5TWKLPIasrw==
# 应用公钥证书地址
- appCertPath: D:\project\证书\alipay\appCertPublicKey_2021004193649611.crt
+# appCertPath: D:\project\证书\alipay\appCertPublicKey_2021004193649611.crt
+ appCertPath: D:\Work\SmSwitch\alipay\appCertPublicKey_2021004193649611.crt
# 支付宝公钥证书地址
- alipayCertPath: D:\project\证书\alipay\alipayCertPublicKey_RSA2.crt
+ alipayCertPath: D:\Work\SmSwitch\alipay\alipayCertPublicKey_RSA2.crt
# 支付宝根证书地址
- alipayRootCertPath: D:\project\证书\alipay\alipayRootCert.crt
+ alipayRootCertPath: D:\Work\SmSwitch\alipay\alipayRootCert.crt
# AES秘钥
aesPrivateKey: FGhCgOURrXkhGs36PUTHfg==
# 通知地址