Explorar o código

Merge remote-tracking branch 'origin/developerB' into developerB

Aslee %!s(int64=4) %!d(string=hai) anos
pai
achega
43e53100c2

+ 10 - 1
src/main/java/com/caimei/modules/weisha/dao/CmMallOrganizeDao.java

@@ -7,11 +7,20 @@ import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
  * 组织列表DAO接口
  * 组织列表DAO接口
+ *
  * @author plf
  * @author plf
  * @version 2021-03-18
  * @version 2021-03-18
  */
  */
 @MyBatisDao
 @MyBatisDao
 public interface CmMallOrganizeDao extends CrudDao<CmMallOrganize> {
 public interface CmMallOrganizeDao extends CrudDao<CmMallOrganize> {
 
 
-    void updateByStatus(@Param("organizeId") Integer organizeId,@Param("status") String status);
+    void updateByStatus(@Param("organizeId") Integer organizeId, @Param("status") String status);
+
+    /**
+     * 查询组织手机号是否唯一
+     *
+     * @param cmMallOrganize
+     * @return
+     */
+    CmMallOrganize findOrganizeMobileOnly(CmMallOrganize cmMallOrganize);
 }
 }

+ 4 - 0
src/main/java/com/caimei/modules/weisha/service/CmMallOrganizeService.java

@@ -44,4 +44,8 @@ public class CmMallOrganizeService extends CrudService<CmMallOrganizeDao, CmMall
     public void onlineAndOffline(Integer organizeId, String status) {
     public void onlineAndOffline(Integer organizeId, String status) {
         organizeDao.updateByStatus(organizeId, status);
         organizeDao.updateByStatus(organizeId, status);
     }
     }
+
+    public CmMallOrganize findOrganizeMobileOnly(CmMallOrganize cmMallOrganize) {
+        return organizeDao.findOrganizeMobileOnly(cmMallOrganize);
+    }
 }
 }

+ 6 - 1
src/main/java/com/caimei/modules/weisha/web/CmMallOrganizeController.java

@@ -17,7 +17,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 
 
- /**
+/**
  * 组织列表Controller
  * 组织列表Controller
  *
  *
  * @author plf
  * @author plf
@@ -60,6 +60,11 @@ public class CmMallOrganizeController extends BaseController {
         if (!beanValidator(model, cmMallOrganize)) {
         if (!beanValidator(model, cmMallOrganize)) {
             return form(cmMallOrganize, model);
             return form(cmMallOrganize, model);
         }
         }
+        CmMallOrganize organize = cmMallOrganizeService.findOrganizeMobileOnly(cmMallOrganize);
+        if (organize != null) {
+            addMessage(model, "手机号重复,请更换手机号");
+            return form(cmMallOrganize, model);
+        }
         cmMallOrganizeService.save(cmMallOrganize);
         cmMallOrganizeService.save(cmMallOrganize);
         addMessage(redirectAttributes, "保存组织成功");
         addMessage(redirectAttributes, "保存组织成功");
         return "redirect:" + Global.getAdminPath() + "/weisha/cmMallOrganize/?repage";
         return "redirect:" + Global.getAdminPath() + "/weisha/cmMallOrganize/?repage";

+ 11 - 0
src/main/resources/mappings/modules/weisha/CmMallOrganizeMapper.xml

@@ -55,6 +55,7 @@
 				ORDER BY ${page.orderBy}
 				ORDER BY ${page.orderBy}
 			</when>
 			</when>
 			<otherwise>
 			<otherwise>
+				ORDER BY a.addTime DESC
 			</otherwise>
 			</otherwise>
 		</choose>
 		</choose>
 	</select>
 	</select>
@@ -130,5 +131,15 @@
 			updateTime = NOW()
 			updateTime = NOW()
 		WHERE id = #{organizeId}
 		WHERE id = #{organizeId}
 	</update>
 	</update>
+
+	<select id="findOrganizeMobileOnly" resultType="com.caimei.modules.weisha.entity.CmMallOrganize">
+		SELECT
+		<include refid="cmMallOrganizeColumns"/>
+		FROM cm_mall_organize a
+		WHERE a.mobile = #{mobile} AND a.delFlag = 0
+		<if test="id != null">
+			AND a.id != #{id}
+		</if>
+	</select>
 	
 	
 </mapper>
 </mapper>

+ 1 - 0
src/main/resources/mappings/modules/weisha/CmOrganizeBuyerMapper.xml

@@ -61,6 +61,7 @@
 				ORDER BY ${page.orderBy}
 				ORDER BY ${page.orderBy}
 			</when>
 			</when>
 			<otherwise>
 			<otherwise>
+				ORDER BY a.addTime DESC
 			</otherwise>
 			</otherwise>
 		</choose>
 		</choose>
 	</select>
 	</select>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -90,7 +90,7 @@
         <td>返佣订单: ${(order.rebateOrder ne '0' || order.rebateFlag eq '1')?'是':'否'}</td>
         <td>返佣订单: ${(order.rebateOrder ne '0' || order.rebateFlag eq '1')?'是':'否'}</td>
     </tr>
     </tr>
     <tr>
     <tr>
-        <td>订单类型: <c:if test="${order.orderType == 1}">普通订单</c:if><c:if test="${order.orderType == 0}">协销订单</c:if></td>
+        <td>订单类型: <c:if test="${order.orderType == 1}">自主订单</c:if><c:if test="${order.orderType == 0}">协销订单</c:if></td>
         <td>订单来源: ${fns:getDictLabel(order.orderSource,"bp_orderSource","" )}</td>
         <td>订单来源: ${fns:getDictLabel(order.orderSource,"bp_orderSource","" )}</td>
         <td>订单状态:
         <td>订单状态:
             <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||
             <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/weisha/addClubUserForm.jsp

@@ -44,7 +44,7 @@
             var reg = /^1\d{10}$/;
             var reg = /^1\d{10}$/;
             var contractMobile = document.getElementById("contractMobile").value;
             var contractMobile = document.getElementById("contractMobile").value;
             if(!reg.test(contractMobile)){
             if(!reg.test(contractMobile)){
-                alertx("手机号格式不正确");
+                alertx("请输入正确的手机号");
                 $("#contractMobile").val("");
                 $("#contractMobile").val("");
             }
             }
         }
         }
@@ -89,7 +89,7 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><b><font color="red">*</font>手机号:</b></label>
 			<label class="control-label"><b><font color="red">*</font>手机号:</b></label>
 			<div class="controls">
 			<div class="controls">
-				<form:input path="contractMobile" htmlEscape="false" maxlength="11" class="input-xlarge required" onchange="mobileVerification(this)"/>
+				<form:input path="contractMobile" htmlEscape="false" maxlength="11" class="input-xlarge required" id="contractMobile" onchange="mobileVerification(this)"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">

+ 14 - 1
src/main/webapp/WEB-INF/views/modules/weisha/cmMallOrganizeForm.jsp

@@ -23,6 +23,19 @@
 				}
 				}
 			});
 			});
 		});
 		});
+
+		/**
+		 * @param obj
+		 * jquery控制input只能输入数字
+		 */
+		function mobileVerification(obj) {
+			var reg = /^1\d{10}$/;
+			var contractMobile = document.getElementById("contractMobile").value;
+			if(!reg.test(contractMobile)){
+				alertx("请输入正确的手机号");
+				$("#contractMobile").val("");
+			}
+		}
 	</script>
 	</script>
 </head>
 </head>
 <body>
 <body>
@@ -48,7 +61,7 @@
 		<div class="control-group">
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>手机号:</label>
 			<label class="control-label"><font color="red">*</font>手机号:</label>
 			<div class="controls">
 			<div class="controls">
-				<form:input path="mobile" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
+				<form:input path="mobile" htmlEscape="false" maxlength="20" class="input-xlarge required" id="contractMobile" onchange="mobileVerification(this)"/>
 			</div>
 			</div>
 		</div>
 		</div>
 		<div class="control-group">
 		<div class="control-group">