瀏覽代碼

[chg]校验逻辑修改

别傲 5 年之前
父節點
當前提交
46cd6fc2d1

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/controller/LiftController.java

@@ -89,7 +89,7 @@ public class LiftController {
     public RestResponse preJudgment(@RequestBody LiftExtensionRequest request) {
         Lift lift = request.getLift();
         String liftId = StrUtil.EMPTY;
-        if (ObjectUtil.isNotEmpty(lift.getId())) {
+        if (ObjectUtil.isNotEmpty(lift)) {
             liftId = lift.getId().toString();
         }
         return liftService.preJudgment(request.getMtCompanyId(), request.getCode(), liftId);

+ 1 - 1
lift-business-service/src/main/java/cn/com/ty/lift/business/library/service/LiftService.java

@@ -221,7 +221,7 @@ public class LiftService {
      */
     public RestResponse modify(Lift lift) {
         String liftId = StrUtil.EMPTY;
-        if (ObjectUtil.isNotEmpty(lift.getId())) {
+        if (ObjectUtil.isNotEmpty(lift)) {
             liftId = lift.getId().toString();
         }
         RestResponse response = preJudgment(null, lift.getRegistrationCode(), liftId);

+ 1 - 1
lift-business-service/src/main/resources/mapper/lift/LiftMapper.xml

@@ -125,7 +125,7 @@
 	<select id="findLiftExist" parameterType="java.lang.String" resultType="java.lang.Long">
 		SELECT id FROM lift
 		WHERE 1=1
-		<if test="liftId ==null ">
+		<if test="liftId == null and liftId = ''">
 			AND registration_code = #{registrationCode,jdbcType=VARCHAR}
 		</if>
 		<if test="liftId!=null and liftId!=''">