diff --git a/src/main/java/com/gxwebsoft/hjm/controller/HjmViolationController.java b/src/main/java/com/gxwebsoft/hjm/controller/HjmViolationController.java index 0d0520b..acede29 100644 --- a/src/main/java/com/gxwebsoft/hjm/controller/HjmViolationController.java +++ b/src/main/java/com/gxwebsoft/hjm/controller/HjmViolationController.java @@ -70,14 +70,14 @@ public class HjmViolationController extends BaseController { User loginUser = getLoginUser(); if (loginUser != null) { hjmViolation.setUserId(loginUser.getUserId()); - } - final HjmCar car = hjmCarService.getByCode(hjmViolation.getCode()); - if (ObjUtil.isEmpty(car)) { - return fail("车辆编号不存在"); - } - if (hjmViolationService.save(hjmViolation)) { - hjmViolationService.send(hjmViolation); - return success("添加成功"); + final HjmCar car = hjmCarService.getByCode(hjmViolation.getCode()); + if (ObjUtil.isEmpty(car)) { + return fail("车辆编号不存在"); + } + if (hjmViolationService.save(hjmViolation)) { + hjmViolationService.send(hjmViolation); + return success("添加成功"); + } } return fail("添加失败"); } diff --git a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmViolationMapper.xml b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmViolationMapper.xml index cde0134..2c8f616 100644 --- a/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmViolationMapper.xml +++ b/src/main/java/com/gxwebsoft/hjm/mapper/xml/HjmViolationMapper.xml @@ -4,7 +4,7 @@ - SELECT a.*,b.image + SELECT DISTINCT a.*,b.image FROM hjm_violation a LEFT JOIN hjm_car b ON a.code = b.code LEFT JOIN gxwebsoft_core.sys_organization c ON b.organization_id = c.organization_id