Jelajahi Sumber

分销系统V.1.0.0

kaick 1 tahun lalu
induk
melakukan
44d6650102

+ 11 - 9
src/main/java/com/caimei365/commodity/controller/ReportingClubApi.java

@@ -273,15 +273,17 @@ public class ReportingClubApi {
             return ResponseJson.error("参数异常!", null);
         }
         for (String id : ids) {
-            CmReportingClub cmReportingClubById = cmReportingClubService.getCmReportingClubById(id);
-            if (null != cmReportingClubById && cmReportingClubById.orderStatus() == 1) {
-                cmReportingClubService.updateCmReportingClub(new CmReportingClub()
-                        .id(id)
-                        .splitSettleStatus(3)
-                        .splitSettleTime(new Date())
-                );
-            } else {
-                return ResponseJson.error("订单异常!", null);
+            if(StringUtils.isNotBlank(id)){
+                CmReportingClub cmReportingClubById = cmReportingClubService.getCmReportingClubById(id);
+                if (null != cmReportingClubById && cmReportingClubById.orderStatus() == 1) {
+                    cmReportingClubService.updateCmReportingClub(new CmReportingClub()
+                            .id(id)
+                            .splitSettleStatus(3)
+                            .splitSettleTime(new Date())
+                    );
+                } else {
+                    return ResponseJson.error("订单异常!", null);
+                }
             }
         }
         return ResponseJson.success("确认成功!", null);

+ 3 - 0
src/main/java/com/caimei365/commodity/mapper/CmReportingClubMapper.java

@@ -47,6 +47,7 @@ public interface CmReportingClubMapper
      */
     public String getById(CmReportingClub cmReportingClub);
 
+
     /**
      * 通过对象查询机构报备Ids
      *
@@ -63,6 +64,8 @@ public interface CmReportingClubMapper
      */
     public int getCmReportingClubCount(CmReportingClub cmReportingClub);
 
+    int findUserByMobile(@Param("mobile") String mobile, @Param("oldUserId") Integer oldUserId, @Param("userIdentity") Integer userIdentity);
+
     /**
      * 新增机构报备
      *

+ 4 - 0
src/main/java/com/caimei365/commodity/service/impl/CmReportingClubServiceImpl.java

@@ -165,6 +165,10 @@ public class CmReportingClubServiceImpl implements CmReportingClubService {
      */
     @Override
     public ResponseJson addCmReportingClub(CmReportingClub cmReportingClub) {
+        int userByMobile = cmReportingClubMapper.findUserByMobile(cmReportingClub.mobile(), null, null);
+        if (userByMobile >0) {
+            return ResponseJson.error("抱歉,该手机号已注册!");
+        }
         CmReportingClub byCmReportingClub = cmReportingClubMapper.getByCmReportingClub(new CmReportingClub()
                 .mobile(cmReportingClub.mobile())
                 .productId(cmReportingClub.productId())

+ 12 - 0
src/main/resources/mapper/CmReportingClubMapper.xml

@@ -241,6 +241,18 @@
 		limit 0,1
 	</select>
 
+	<select id="findUserByMobile"  resultType="int">
+		select count (1)
+		FROM user user
+		WHERE user.bindMobile=#{mobile}
+		<if test="oldUserId !=null and oldUserId !=''">
+			and user.userId!=#{oldUserId}
+		</if>
+		<if test="userIdentity !=null">
+			and user.userIdentity=#{userIdentity}
+		</if>
+		limit 0,1
+	</select>
 	<insert id="addCmReportingClub" parameterType="com.caimei365.commodity.model.po.CmReportingClub" useGeneratedKeys="true" keyProperty="id">
 		insert into cm_reporting_club
 		<trim prefix="(" suffix=")" suffixOverrides=",">