提交设备故障反馈
This commit is contained in:
parent
5d9b71528b
commit
7960c085dd
|
@ -245,11 +245,7 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
data.setUpdateTime(DateUtils.getNowDate());
|
data.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
|
||||||
Integer result = transactionTemplate.execute(status -> {
|
Integer result = transactionTemplate.execute(status -> {
|
||||||
deviceMapper.selectByDeviceNo(data.getDeviceNo());
|
// deviceMapper.selectByDeviceId(data.getDeviceNo());
|
||||||
|
|
||||||
// 更新主表
|
|
||||||
int update = deviceMapper.updateSmDevice(data);
|
|
||||||
ServiceUtil.assertion(update != 1, "更新设备失败");
|
|
||||||
|
|
||||||
// 生成SnLog记录
|
// 生成SnLog记录
|
||||||
SnLog snLog = new SnLog();
|
SnLog snLog = new SnLog();
|
||||||
|
@ -257,6 +253,12 @@ public class DeviceServiceImpl implements DeviceService
|
||||||
snLog.setUserId(SecurityUtils.getUserId());
|
snLog.setUserId(SecurityUtils.getUserId());
|
||||||
snLog.setMac(data.getMac());
|
snLog.setMac(data.getMac());
|
||||||
|
|
||||||
|
// 更新主表
|
||||||
|
int update = deviceMapper.updateSmDevice(data);
|
||||||
|
ServiceUtil.assertion(update != 1, "更新设备失败");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 后校验
|
// 后校验
|
||||||
DeviceVO vo = this.selectById(data.getDeviceId());
|
DeviceVO vo = this.selectById(data.getDeviceId());
|
||||||
deviceAssembler.assembleBonusList(vo);
|
deviceAssembler.assembleBonusList(vo);
|
||||||
|
|
|
@ -53,17 +53,28 @@ public class AppAbnormalController extends BaseController {
|
||||||
public AjaxResult submit(@RequestBody @Validated(ValidGroup.FrontCreate.class) AbnormalSubmitDTO data) {
|
public AjaxResult submit(@RequestBody @Validated(ValidGroup.FrontCreate.class) AbnormalSubmitDTO data) {
|
||||||
data.setUserId(getUserId());
|
data.setUserId(getUserId());
|
||||||
data.setCreateBy(getUsername());
|
data.setCreateBy(getUsername());
|
||||||
TransactionBillVO vo = transactionBillService.selectSmTransactionBillByBillId(data.getOrderId());
|
TransactionBillVO transactionBillVO = transactionBillService.selectSmTransactionBillByBillId(data.getOrderId());
|
||||||
if (vo != null) {
|
DeviceVO deviceVO = deviceService.selectByDeviceNo(data.getDeviceNo());
|
||||||
data.setOrderNo(vo.getBillNo());
|
if (data.getOrderId() != null && data.getDeviceNo() != null) {
|
||||||
// 获取订单商户id
|
if (transactionBillVO == null) {
|
||||||
if (vo.getMchId() != null) {
|
return AjaxResult.error("当前订单不存在");
|
||||||
data.setStoreId(vo.getMchId());
|
}
|
||||||
|
if (deviceVO == null) {
|
||||||
|
return AjaxResult.error("当前设备不存在");
|
||||||
|
}
|
||||||
|
if (!transactionBillVO.getDeviceNo().equals(data.getDeviceNo())) {
|
||||||
|
return AjaxResult.error("当前设备与订单无关联");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取订单商户id
|
||||||
|
if ( data.getOrderId()!= null) {
|
||||||
|
data.setOrderNo(transactionBillVO.getBillNo());
|
||||||
|
if(transactionBillVO.getMchId()!=null){
|
||||||
|
data.setStoreId(transactionBillVO.getMchId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取设备商户id
|
// 获取设备商户id
|
||||||
DeviceVO deviceVO = deviceService.selectByDeviceNo(data.getDeviceNo());
|
if (data.getDeviceNo() != null) {
|
||||||
if (deviceVO != null) {
|
|
||||||
Long storeId = deviceVO.getStoreId();
|
Long storeId = deviceVO.getStoreId();
|
||||||
if (storeId != null) {
|
if (storeId != null) {
|
||||||
data.setStoreId(storeId);
|
data.setStoreId(storeId);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user