소스 검색

新增业务项目时字段长度限制,修改订单管理时查询语句错误的情况

limin 7 년 전
부모
커밋
80dece5ecb

+ 20 - 3
src/main/java/com/goafanti/business/controller/UserJtBusinessController.java

@@ -20,6 +20,7 @@ import com.goafanti.common.enums.ProjectAuditStatus;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.model.JtTag;
+import com.goafanti.common.utils.StringUtils;
 
 @RestController
 @RequestMapping(value = "/api/user/jtBusiness")
@@ -115,12 +116,28 @@ public class UserJtBusinessController extends CertifyApiController{
 		jtBusinessProject.setCreateTime(null);
 		jtBusinessProject.setNumber(null);
 		disposeProjectParam(result, jtBusinessProject);
-		if(result.getError().size()>0) {
-			return result;
-		}
 		if(jtBusinessProject.getPrice()==null) {
 			result.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "价格不可为空,"));
 		}
+		//判断各项数据长度
+		if(StringUtils.isNotBlank(jtBusinessProject.getName()) && jtBusinessProject.getName().length() > 16){
+			result.getError().add(buildError("16", "项目名称字数不能超过16"));
+		}
+		if(StringUtils.isNotBlank(jtBusinessProject.getAdvertisement()) && jtBusinessProject.getAdvertisement().length() > 128){
+			result.getError().add(buildError("128", "项目营销说明字数不能超过128"));
+		}
+		if(StringUtils.isNotBlank(jtBusinessProject.getValue()) && jtBusinessProject.getValue().length() > 1024){
+			result.getError().add(buildError("1024", "业务项目价值及作用字数不能超过1024"));
+		}
+		if(StringUtils.isNotBlank(jtBusinessProject.getApplyConditions()) && jtBusinessProject.getApplyConditions().length() > 512){
+			result.getError().add(buildError("512", "项目客户条件字数不能超过512"));
+		}
+		if(StringUtils.isNotBlank(jtBusinessProject.getIntroduce()) && jtBusinessProject.getIntroduce().length() > 2048){
+			result.getError().add(buildError("2048", "项目服务内容字数不能超过2048"));
+		}
+		if(result.getError().size()>0) {
+			return result;
+		}
 		jtBusinessService.updateProject(jtBusinessProject);
 		return result;
 	}

+ 3 - 3
src/main/java/com/goafanti/common/mapper/JtOrderMapper.xml

@@ -513,10 +513,10 @@ count(0)
   <if test="orderType!=null ">
   and (jtod.commodity_type=#{orderType,jdbcType=INTEGER} or (#{orderType,jdbcType=INTEGER}=10 and (jtod.commodity_type=1 or jtod.commodity_type=0)))
   </if>
-  order by x.createTime desc
-  	<if test="page_sql!=null">
+<!--   order by x.createTime desc -->
+  	<!-- <if test="page_sql!=null">
 			${page_sql}
-	</if>
+	</if> -->
   </select>
   <select id="appSearchJtOrderList" resultType="com.goafanti.order.bo.JtOrderResultDetail">
    select x.* from