zhijiezhao 3 سال پیش
والد
کامیت
b7b988b302

+ 7 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheProductDao.java

@@ -39,4 +39,11 @@ public interface CmHeheProductDao extends CrudDao<CmHeheProduct> {
      * @param productId
      */
     void deleteActivityProduct(Integer productId);
+
+    /**
+     *
+     * @param product
+     * @return
+     */
+    List<Product> findCouponProduct(Product product);
 }

+ 2 - 0
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -67,6 +67,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
     public List<CmPayShop> exports(Page<CmPayShop> cmPayShopPage, CmPayShop cmPayShop) {
         Page<CmPayShop> result = super.findPage(cmPayShopPage, cmPayShop);
         List<CmPayShop> list = result.getList();
+        //线下分账出现空订单号会导出不了,如果正式有,打开这个注释
+//        list.removeIf(c->"6".equals(c.getPayType()));
         list.forEach(l -> {
             if (l.getStatus().equals("1")) {
                 //1建设银行7297, 2中信银行0897, 3中信银行7172, 4广发银行0115, 5广发银行5461, 6线上分账

+ 2 - 3
src/main/java/com/caimei/modules/order/service/CmReturnedPurchaseService.java

@@ -640,12 +640,11 @@ public class CmReturnedPurchaseService extends CrudService<CmReturnedPurchaseDao
                         beanHistory.setNum(500);
                         beanHistory.setPushStatus(0);
                         beanHistory.setAddTime(new Date());
-                        int beans = user.getUserBeans() + 500;
-                        newCmClubDao.insertBeansHistory(beansHistory);
+                        newCmClubDao.insertBeansHistory(beanHistory);
+                        int beans = cmUserDao.findUserBeans(newOrder.getUserID()) + 500;
                         cmUserDao.updateUserBeans(newOrder.getUserID(), beans);
                     }
                 }
-
             }
             //优惠券退回
             CmCouponOrderRecord couponOrderRecord = newOrder.getCouponOrderRecord();

+ 22 - 1
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -1343,6 +1343,26 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             int userBeans = user.getUserBeans() + order.getUserBeans();
             cmUserDao.updateUserBeans(order.getUserID(), userBeans);
         }
+
+        if (order.getPayTotalFee() != null && order.getPayTotalFee() < 1000) {
+            //查本单是否扣豆子,有就返回
+            UserBeansHistory bean = newCmClubDao.findLowOrder(order.getOrderID());
+            if (bean != null) {
+                //有扣豆子记录
+                UserBeansHistory beansHistory = new UserBeansHistory();
+                beansHistory.setUserId(order.getUserID());
+                beansHistory.setOrderId(order.getOrderID());
+                beansHistory.setBeansType(16);
+                beansHistory.setType(1);
+                beansHistory.setNum(500);
+                beansHistory.setPushStatus(0);
+                beansHistory.setAddTime(new Date());
+                newCmClubDao.insertBeansHistory(beansHistory);
+                int beans = cmUserDao.findUserBeans(order.getUserID()) + 500;
+                cmUserDao.updateUserBeans(order.getUserID(), beans);
+            }
+        }
+
         //取消订单短信推送(取消订单推送)
         /*try {
             if (user != null && StringUtils.isNotBlank(user.getBindMobile()) && "0".equals(order.getRebateFlag())) {
@@ -1811,7 +1831,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         for (NewOrder order : results) {
             Double ableUserMoney = 0d;
             CmUser user = cmUserDao.get(order.getUserID().toString());
-            if (null != user && null != user.getAbleUserMoney()){
+            if (null != user && null != user.getAbleUserMoney()) {
                 ableUserMoney = user.getAbleUserMoney();
             }
             order.setAbleUserMoney(ableUserMoney);
@@ -1913,6 +1933,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
         }
         return pageResult;
     }
+
     /**
      * 判断是否是游客
      *

+ 2 - 0
src/main/java/com/caimei/modules/user/dao/CmUserDao.java

@@ -80,4 +80,6 @@ public interface CmUserDao extends CrudDao<CmUser> {
     void updateByClubStatus(@Param("clubStatus") int clubStatus, @Param("confirmUserId") Integer confirmUserId);
 
     Date findByConfirmTime(Integer userId);
+
+    Integer findUserBeans(Integer userId);
 }

+ 18 - 0
src/main/java/com/caimei/modules/user/entity/CmUser.java

@@ -108,6 +108,8 @@ public class CmUser extends DataEntity<CmUser> {
     private String address;        // 详细地址
     private boolean pending = false; //是否有待审核提现
     private String shortName;   //机构简称
+    private String userIds;  //用户id","隔开
+    private boolean storeStatus = false; //是否存在数据库
 
     public CmUser() {
         super();
@@ -843,4 +845,20 @@ public class CmUser extends DataEntity<CmUser> {
     public void setShortName(String shortName) {
         this.shortName = shortName;
     }
+
+    public String getUserIds() {
+        return userIds;
+    }
+
+    public void setUserIds(String userIds) {
+        this.userIds = userIds;
+    }
+
+    public boolean isStoreStatus() {
+        return storeStatus;
+    }
+
+    public void setStoreStatus(boolean storeStatus) {
+        this.storeStatus = storeStatus;
+    }
 }

BIN
src/main/resources/export/payList.xls


+ 33 - 0
src/main/resources/mappings/modules/hehe/CmHeheProductMapper.xml

@@ -163,6 +163,39 @@
 		</choose>
 	</select>
 
+	<select id="findCouponProduct" resultType="com.caimei.modules.product.entity.Product">
+		SELECT
+		a.*,s.name AS "shopName"
+		FROM cm_hehe_product
+		     product a
+		LEFT JOIN shop s on s.shopID = a.shopID
+		<where>
+			<if test="productID != null" >
+				AND a.productID = #{productID}
+			</if>
+			<if test="name != null and name != ''">
+				AND a.name LIKE concat('%',#{name},'%')
+			</if>
+			<if test="shopName != null and shopName != ''">
+				AND s.name LIKE concat('%',#{shopName},'%')
+			</if>
+			<if test="ids != null and ids.size() > 0 ">
+				AND a.productID NOT IN
+				<foreach collection="ids" open="(" close=")" item="id" separator=",">
+					#{id}
+				</foreach>
+			</if>
+		</where>
+		<choose>
+			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
+				ORDER BY ${page.orderBy}
+			</when>
+			<otherwise>
+				order by a.productID
+			</otherwise>
+		</choose>
+	</select>
+
 
 	<update id="deleteActivityProduct">
 		UPDATE cm_hehe_activity_product SET delFlag = 1 WHERE productId = #{productId}

+ 572 - 561
src/main/resources/mappings/modules/user/CmUserMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="com.caimei.modules.user.dao.CmUserDao">
 
     <sql id="cmUserColumns">
-		a.userID AS "userID",
+        a.userID AS "userID",
 		a.mobile AS "mobile",
 		a.userOrganizeID AS "userOrganizeID",
 		a.bindMobile AS "bindMobile",
@@ -76,7 +76,7 @@
 		a.isMeiDaoAuthorized AS "isMeiDaoAuthorized",
 		a.guideFlag AS "guideFlag",
 		a.userPermission AS "userPermission"
-	</sql>
+    </sql>
 
     <sql id="cmUserJoins">
     </sql>
@@ -104,11 +104,11 @@
                 <if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
                 <if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
                 <if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-				OR a.bindMobile LIKE
-				<if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
-				<if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
-				<if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
-				)
+                OR a.bindMobile LIKE
+                <if test="dbName == 'oracle'">'%'||#{mobile}||'%'</if>
+                <if test="dbName == 'mssql'">'%'+#{mobile}+'%'</if>
+                <if test="dbName == 'mysql'">concat('%',#{mobile},'%')</if>
+                )
             </if>
             <if test="email != null and email != ''">
                 AND a.email LIKE
@@ -122,15 +122,15 @@
                 <if test="dbName == 'mssql'">'%'+#{userName}+'%'</if>
                 <if test="dbName == 'mysql'">concat('%',#{userName},'%')</if>
             </if>
-			<if test="startTime != null and startTime != ''">
-				AND (a.registerTime &gt; #{startTime} OR  a.registerTime = #{startTime})
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND (a.registerTime &lt; #{endTime} OR  a.registerTime = #{endTime})
-			</if>
-			<if test="userOrganizeID != null and userOrganizeID != ''">
-				AND a.userOrganizeID = #{userOrganizeID}
-			</if>
+            <if test="startTime != null and startTime != ''">
+                AND (a.registerTime &gt; #{startTime} OR a.registerTime = #{startTime})
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND (a.registerTime &lt; #{endTime} OR a.registerTime = #{endTime})
+            </if>
+            <if test="userOrganizeID != null and userOrganizeID != ''">
+                AND a.userOrganizeID = #{userOrganizeID}
+            </if>
             <choose>
                 <when test="registerUserTypeID != null and registerUserTypeID != ''">
                     AND a.registerUserTypeID = #{registerUserTypeID}
@@ -153,56 +153,56 @@
         </choose>
     </select>
 
-	<!--适用于企业通过手机号码查询用户-->
-	<select id="findListBuyBindMobile" resultType="CmUser">
-		SELECT
-		*
-		FROM user a
-		<where>
-			a.bindMobile = #{bindMobile}
-			<if test="clubID != null and clubID != ''">
-				AND a.clubID != #{clubID}
-			</if>
-		</where>
-	</select>
-
-	<!--星范商城查询会所-->
-	<select id="findListBuyUserInfo" resultType="CmUser">
-		SELECT
-		a.*
-		,c.linkMan AS "linkMan"
-		,t.name as "town"
-		,ci.name as "city"
-		,p.name as "province"
-		,c.address AS "address"
-		FROM user a
-		LEFT JOIN club c on c.userID = a.userID
-		LEFT JOIN town t on t.townID = c.townID
-		LEFT JOIN city ci ON ci.cityID = c.cityID
-		LEFT JOIN province p ON p.provinceID = c.provinceID
-		<where>
-			a.userOrganizeID = #{userOrganizeID}
-			<if test="bindMobile != null and bindMobile != ''">
-				AND a.bindMobile LIKE concat('%',#{bindMobile},'%')
-			</if>
-			<if test="name != null and name != ''">
-				AND a.name LIKE concat('%',#{name},'%')
-			</if>
-			<if test="linkMan != null and linkMan != ''">
-				AND c.linkMan LIKE concat('%',#{linkMan},'%')
-			</if>
-			<if test="startTime != null and startTime != ''">
-				AND a.registerTime <![CDATA[  >=  ]]> #{startTime}
-			</if>
-			<if test="endTime != null and endTime != ''">
-				AND a.registerTime <![CDATA[   <=  ]]> #{endTime}
-			</if>
-			<if test="clubStatus != null and clubStatus != ''">
-				AND a.clubStatus = #{clubStatus}
-			</if>
-		</where>
-		ORDER BY a.registerTime DESC
-	</select>
+    <!--适用于企业通过手机号码查询用户-->
+    <select id="findListBuyBindMobile" resultType="CmUser">
+        SELECT
+        *
+        FROM user a
+        <where>
+            a.bindMobile = #{bindMobile}
+            <if test="clubID != null and clubID != ''">
+                AND a.clubID != #{clubID}
+            </if>
+        </where>
+    </select>
+
+    <!--星范商城查询会所-->
+    <select id="findListBuyUserInfo" resultType="CmUser">
+        SELECT
+        a.*
+        ,c.linkMan AS "linkMan"
+        ,t.name as "town"
+        ,ci.name as "city"
+        ,p.name as "province"
+        ,c.address AS "address"
+        FROM user a
+        LEFT JOIN club c on c.userID = a.userID
+        LEFT JOIN town t on t.townID = c.townID
+        LEFT JOIN city ci ON ci.cityID = c.cityID
+        LEFT JOIN province p ON p.provinceID = c.provinceID
+        <where>
+            a.userOrganizeID = #{userOrganizeID}
+            <if test="bindMobile != null and bindMobile != ''">
+                AND a.bindMobile LIKE concat('%',#{bindMobile},'%')
+            </if>
+            <if test="name != null and name != ''">
+                AND a.name LIKE concat('%',#{name},'%')
+            </if>
+            <if test="linkMan != null and linkMan != ''">
+                AND c.linkMan LIKE concat('%',#{linkMan},'%')
+            </if>
+            <if test="startTime != null and startTime != ''">
+                AND a.registerTime <![CDATA[  >=  ]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND a.registerTime <![CDATA[   <=  ]]> #{endTime}
+            </if>
+            <if test="clubStatus != null and clubStatus != ''">
+                AND a.clubStatus = #{clubStatus}
+            </if>
+        </where>
+        ORDER BY a.registerTime DESC
+    </select>
 
     <select id="findAllList" resultType="CmUser">
         SELECT
@@ -223,374 +223,375 @@
     </select>
 
     <insert id="insert" parameterType="CmUser" keyProperty="userID" useGeneratedKeys="true">
-		INSERT INTO user(
-			userOrganizeID,
-			account,
-		  	realName,
-		  	userIdentity,
-		  	companyUserID,
-		  	openID,
-			mobile,
-			bindMobile,
-			userPermission,
-			email,
-			userName,
-			source,
-			image,
-			password,
-			userLevelID,
-			name,
-			nick,
-			sex,
-			registerUserTypeID,
-			manufacturerFlag,
-			manufacturerStatus,
-			shopID,
-			serviceProviderFlag,
-			clubFlag,
-			masterFlag,
-			normalFlag,
-			auditStatus,
-			auditTime,
-			auditNote,
-			registerTime,
-			registerIP,
-			loginTime,
-			loginFailTime,
-			loginIP,
-			validFlag,
-			emailCheckFlag,
-			mobileCheckFlag,
-			clubStatus,
-			<if test="clubID != null and clubID != ''">
-			clubID,
-			</if>
-			agreeFlag,
-			activationCode,
-			activationDate,
-			serviceProviderStatus,
-			serviceProviderID,
-			masterStatus,
-			masterID,
-			userMoney,
-			ableUserMoney,
-			point,
-			shopERPFlag,
-			fromUserID,
-			fromUserName,
-			logoffTime,
-			appKey,
-			appSecret,
-			sampleFlag,
-			scanFlag,
-			sysroleid,
-			gender,
-			age,
-			salerbuyer,
-			position,
-			skill,
-			workage,
-			wechat,
-			qq,
-			smsFlag,
-			userBeans,
-			privateShopFlag,
-			privateClubFlag,
-			isMeiDaoAuthorized
-		) VALUES (
-			#{userOrganizeID},
-			#{account},
-		  	#{realName},
-		  	#{userIdentity},
-		  	#{companyUserID},
-		  	#{openID},
-			#{mobile},
-			#{bindMobile},
-			#{userPermission},
-			#{email},
-			#{userName},
-			#{source},
-			#{image},
-			#{password},
-			#{userLevelID},
-			#{name},
-			#{nick},
-			#{sex},
-			#{registerUserTypeID},
-			#{manufacturerFlag},
-			#{manufacturerStatus},
-			#{shopID},
-			#{serviceProviderFlag},
-			#{clubFlag},
-			#{masterFlag},
-			#{normalFlag},
-			#{auditStatus},
-			#{auditTime},
-			#{auditNote},
-			#{registerTime},
-			#{registerIP},
-			#{loginTime},
-			#{loginFailTime},
-			#{loginIP},
-			#{validFlag},
-			#{emailCheckFlag},
-			#{mobileCheckFlag},
-			#{clubStatus},
-			<if test="clubID != null and clubID != ''">
-			#{clubID},
-			</if>
-			#{agreeFlag},
-			#{activationCode},
-			#{activationDate},
-			#{serviceProviderStatus},
-			#{serviceProviderID},
-			#{masterStatus},
-			#{masterID},
-			#{userMoney},
-			#{ableUserMoney},
-			#{point},
-			#{shopERPFlag},
-			#{fromUserID},
-			#{fromUserName},
-			#{logoffTime},
-			#{appKey},
-			#{appSecret},
-			#{sampleFlag},
-			#{scanFlag},
-			#{sysroleid},
-			#{gender},
-			#{age},
-			#{salerbuyer},
-			#{position},
-			#{skill},
-			#{workage},
-			#{wechat},
-			#{qq},
-			#{smsFlag},
-			#{userBeans},
-			#{privateShopFlag},
-			#{privateClubFlag},
-			#{isMeiDaoAuthorized}
-		)
-	</insert>
+        INSERT INTO user(
+        userOrganizeID,
+        account,
+        realName,
+        userIdentity,
+        companyUserID,
+        openID,
+        mobile,
+        bindMobile,
+        userPermission,
+        email,
+        userName,
+        source,
+        image,
+        password,
+        userLevelID,
+        name,
+        nick,
+        sex,
+        registerUserTypeID,
+        manufacturerFlag,
+        manufacturerStatus,
+        shopID,
+        serviceProviderFlag,
+        clubFlag,
+        masterFlag,
+        normalFlag,
+        auditStatus,
+        auditTime,
+        auditNote,
+        registerTime,
+        registerIP,
+        loginTime,
+        loginFailTime,
+        loginIP,
+        validFlag,
+        emailCheckFlag,
+        mobileCheckFlag,
+        clubStatus,
+        <if test="clubID != null and clubID != ''">
+            clubID,
+        </if>
+        agreeFlag,
+        activationCode,
+        activationDate,
+        serviceProviderStatus,
+        serviceProviderID,
+        masterStatus,
+        masterID,
+        userMoney,
+        ableUserMoney,
+        point,
+        shopERPFlag,
+        fromUserID,
+        fromUserName,
+        logoffTime,
+        appKey,
+        appSecret,
+        sampleFlag,
+        scanFlag,
+        sysroleid,
+        gender,
+        age,
+        salerbuyer,
+        position,
+        skill,
+        workage,
+        wechat,
+        qq,
+        smsFlag,
+        userBeans,
+        privateShopFlag,
+        privateClubFlag,
+        isMeiDaoAuthorized
+        ) VALUES (
+        #{userOrganizeID},
+        #{account},
+        #{realName},
+        #{userIdentity},
+        #{companyUserID},
+        #{openID},
+        #{mobile},
+        #{bindMobile},
+        #{userPermission},
+        #{email},
+        #{userName},
+        #{source},
+        #{image},
+        #{password},
+        #{userLevelID},
+        #{name},
+        #{nick},
+        #{sex},
+        #{registerUserTypeID},
+        #{manufacturerFlag},
+        #{manufacturerStatus},
+        #{shopID},
+        #{serviceProviderFlag},
+        #{clubFlag},
+        #{masterFlag},
+        #{normalFlag},
+        #{auditStatus},
+        #{auditTime},
+        #{auditNote},
+        #{registerTime},
+        #{registerIP},
+        #{loginTime},
+        #{loginFailTime},
+        #{loginIP},
+        #{validFlag},
+        #{emailCheckFlag},
+        #{mobileCheckFlag},
+        #{clubStatus},
+        <if test="clubID != null and clubID != ''">
+            #{clubID},
+        </if>
+        #{agreeFlag},
+        #{activationCode},
+        #{activationDate},
+        #{serviceProviderStatus},
+        #{serviceProviderID},
+        #{masterStatus},
+        #{masterID},
+        #{userMoney},
+        #{ableUserMoney},
+        #{point},
+        #{shopERPFlag},
+        #{fromUserID},
+        #{fromUserName},
+        #{logoffTime},
+        #{appKey},
+        #{appSecret},
+        #{sampleFlag},
+        #{scanFlag},
+        #{sysroleid},
+        #{gender},
+        #{age},
+        #{salerbuyer},
+        #{position},
+        #{skill},
+        #{workage},
+        #{wechat},
+        #{qq},
+        #{smsFlag},
+        #{userBeans},
+        #{privateShopFlag},
+        #{privateClubFlag},
+        #{isMeiDaoAuthorized}
+        )
+    </insert>
 
     <update id="update">
-		UPDATE user SET
-		<if test="account != null and account != ''">
-			account = #{account},
-		</if>
-		<if test="bindMobile != null and bindMobile != ''">
-			bindMobile = #{bindMobile},
-		  	</if>
-		<if test="realName != null">
-			realName = #{realName},
-		  	</if>
-		<if test="userIdentity != null and userIdentity != ''">
-			userIdentity = #{userIdentity},
-		  	</if>
-		<if test="companyUserID != null and companyUserID != ''">
-			companyUserID = #{companyUserID},
-		  	</if>
-		<if test="openID != null and openID != ''">
-			openID = #{openID},
-			</if>
-		<if test="mobile != null and mobile != ''">
-			mobile = #{mobile},
-			</if>
-		<if test="userPermission != null and userPermission != ''">
-			userPermission = #{userPermission},
-			</if>
-		<if test="email != null and email != ''">
-			email = #{email},
-			</if>
-		<if test="userName != null and userName != ''">
-			userName = #{userName},
-			</if>
-		<if test="image != null and image != ''">
-			image = #{image},
-			</if>
-		<if test="password != null and password != ''">
-			password = #{password},
-			</if>
-		<if test="userLevelID != null and userLevelID != ''">
-			userLevelID = #{userLevelID},
-			</if>
-		<if test="name != null and name != ''">
-			name = #{name},
-			</if>
-		<if test="nick != null and nick != ''">
-			nick = #{nick},
-			</if>
-		<if test="sex != null and sex != ''">
-			sex = #{sex},
-			</if>
-		<if test="registerUserTypeID != null and registerUserTypeID != ''">
-			registerUserTypeID = #{registerUserTypeID},
-			</if>
-		<if test="manufacturerFlag != null and manufacturerFlag != ''">
-			manufacturerFlag = #{manufacturerFlag},
-			</if>
-		<if test="manufacturerStatus != null and manufacturerStatus != ''">
-			manufacturerStatus = #{manufacturerStatus},
-			</if>
-		<if test="shopID != null and shopID != ''">
-			shopID = #{shopID},
-			</if>
-		<if test="serviceProviderFlag != null and serviceProviderFlag != ''">
-			serviceProviderFlag = #{serviceProviderFlag},
-			</if>
-		<if test="clubFlag != null and clubFlag != ''">
-			clubFlag = #{clubFlag},
-			</if>
-		<if test="masterFlag != null and masterFlag != ''">
-			masterFlag = #{masterFlag},
-			</if>
-		<if test="normalFlag != null and normalFlag != ''">
-			normalFlag = #{normalFlag},
-			</if>
-		<if test="auditStatus != null and auditStatus != ''">
-			auditStatus = #{auditStatus},
-			</if>
-		<if test="auditTime != null">
-			auditTime = #{auditTime},
-			</if>
-		<if test="auditNote != null and auditNote != ''">
-			auditNote = #{auditNote},
-			</if>
-		<if test="registerTime != null ">
-			registerTime = #{registerTime},
-			</if>
-		<if test="registerIP != null and registerIP != ''">
-			registerIP = #{registerIP},
-			</if>
-		<if test="loginTime != null and loginTime != ''">
-			loginTime = #{loginTime},
-			</if>
-		<if test="loginFailTime != null and loginFailTime != ''">
-			loginFailTime = #{loginFailTime},
-			</if>
-		<if test="loginIP != null and loginIP != ''">
-			loginIP = #{loginIP},
-			</if>
-		<if test="validFlag != null and validFlag != ''">
-			validFlag = #{validFlag},
-			</if>
-		<if test="emailCheckFlag != null and emailCheckFlag != ''">
-			emailCheckFlag = #{emailCheckFlag},
-			</if>
-		<if test="mobileCheckFlag != null and mobileCheckFlag != ''">
-			mobileCheckFlag = #{mobileCheckFlag},
-			</if>
-		<if test="clubStatus != null and clubStatus != ''">
-			clubStatus = #{clubStatus},
-			</if>
-		<if test="clubID != null and clubID != ''">
-			clubID = #{clubID},
-			</if>
-		<if test="agreeFlag != null and agreeFlag != ''">
-			agreeFlag = #{agreeFlag},
-			</if>
-		<if test="activationCode != null and activationCode != ''">
-			activationCode = #{activationCode},
-			</if>
-		<if test="activationDate != null ">
-			activationDate = #{activationDate},
-			</if>
-		<if test="serviceProviderStatus != null and serviceProviderStatus != ''">
-			serviceProviderStatus = #{serviceProviderStatus},
-			</if>
-		<if test="serviceProviderID != null and serviceProviderID != ''">
-			serviceProviderID = #{serviceProviderID},
-			</if>
-		<if test="masterStatus != null and masterStatus != ''">
-			masterStatus = #{masterStatus},
-			</if>
-		<if test="masterID != null and masterID != ''">
-			masterID = #{masterID},
-			</if>
-		<if test="userMoney != null and userMoney != ''">
-			userMoney = #{userMoney},
-			</if>
-		<if test="point != null and point != ''">
-			point = #{point},
-			</if>
-		<if test="shopERPFlag != null and shopERPFlag != ''">
-			shopERPFlag = #{shopERPFlag},
-			</if>
-		<if test="fromUserID != null and fromUserID != ''">
-			fromUserID = #{fromUserID},
-			</if>
-		<if test="fromUserName != null and fromUserName != ''">
-			fromUserName = #{fromUserName},
-			</if>
-		<if test="logoffTime != null and logoffTime != ''">
-			logoffTime = #{logoffTime},
-			</if>
-		<if test="appKey != null and appKey != ''">
-			appKey = #{appKey},
-			</if>
-		<if test="appSecret != null and appSecret != ''">
-			appSecret = #{appSecret},
-			</if>
-		<if test="sampleFlag != null and sampleFlag != ''">
-			sampleFlag = #{sampleFlag},
-			</if>
-		<if test="scanFlag != null and scanFlag != ''">
-			scanFlag = #{scanFlag},
-			</if>
-		<if test="sysroleid != null and sysroleid != ''">
-			sysroleid = #{sysroleid},
-			</if>
-		<if test="gender != null and gender != ''">
-			gender = #{gender},
-			</if>
-		<if test="age != null and age != ''">
-			age = #{age},
-			</if>
-		<if test="salerbuyer != null and salerbuyer != ''">
-			salerbuyer = #{salerbuyer},
-			</if>
-		<if test="position != null and position != ''">
-			position = #{position},
-			</if>
-		<if test="skill != null and skill != ''">
-			skill = #{skill},
-			</if>
-		<if test="workage != null and workage != ''">
-			workage = #{workage},
-			</if>
-		<if test="wechat != null and wechat != ''">
-			wechat = #{wechat},
-			</if>
-		<if test="qq != null and qq != ''">
-			qq = #{qq},
-			</if>
-		<if test="smsFlag != null and smsFlag != ''">
-			smsFlag = #{smsFlag},
-			</if>
-		<if test="userBeans != null and userBeans != ''">
-			userBeans = #{userBeans},
-			</if>
-		<if test="privateShopFlag != null and privateShopFlag != ''">
-			privateShopFlag = #{privateShopFlag},
-			</if>
-		<if test="privateClubFlag != null and privateClubFlag != ''">
-			privateClubFlag = #{privateClubFlag},
-			</if>
-		<if test="isMeiDaoAuthorized != null and isMeiDaoAuthorized != ''">
-			isMeiDaoAuthorized = #{isMeiDaoAuthorized},
-			</if>
-		<if test="guideFlag != null and guideFlag != ''">
-			guideFlag = #{guideFlag},
-		</if>
-		userID = #{userID}
-		WHERE userID = #{userID}
-	</update>
+        UPDATE user SET
+        <if test="account != null and account != ''">
+            account = #{account},
+        </if>
+        <if test="bindMobile != null and bindMobile != ''">
+            bindMobile = #{bindMobile},
+        </if>
+        <if test="realName != null">
+            realName = #{realName},
+        </if>
+        <if test="userIdentity != null and userIdentity != ''">
+            userIdentity = #{userIdentity},
+        </if>
+        <if test="companyUserID != null and companyUserID != ''">
+            companyUserID = #{companyUserID},
+        </if>
+        <if test="openID != null and openID != ''">
+            openID = #{openID},
+        </if>
+        <if test="mobile != null and mobile != ''">
+            mobile = #{mobile},
+        </if>
+        <if test="userPermission != null and userPermission != ''">
+            userPermission = #{userPermission},
+        </if>
+        <if test="email != null and email != ''">
+            email = #{email},
+        </if>
+        <if test="userName != null and userName != ''">
+            userName = #{userName},
+        </if>
+        <if test="image != null and image != ''">
+            image = #{image},
+        </if>
+        <if test="password != null and password != ''">
+            password = #{password},
+        </if>
+        <if test="userLevelID != null and userLevelID != ''">
+            userLevelID = #{userLevelID},
+        </if>
+        <if test="name != null and name != ''">
+            name = #{name},
+        </if>
+        <if test="nick != null and nick != ''">
+            nick = #{nick},
+        </if>
+        <if test="sex != null and sex != ''">
+            sex = #{sex},
+        </if>
+        <if test="registerUserTypeID != null and registerUserTypeID != ''">
+            registerUserTypeID = #{registerUserTypeID},
+        </if>
+        <if test="manufacturerFlag != null and manufacturerFlag != ''">
+            manufacturerFlag = #{manufacturerFlag},
+        </if>
+        <if test="manufacturerStatus != null and manufacturerStatus != ''">
+            manufacturerStatus = #{manufacturerStatus},
+        </if>
+        <if test="shopID != null and shopID != ''">
+            shopID = #{shopID},
+        </if>
+        <if test="serviceProviderFlag != null and serviceProviderFlag != ''">
+            serviceProviderFlag = #{serviceProviderFlag},
+        </if>
+        <if test="clubFlag != null and clubFlag != ''">
+            clubFlag = #{clubFlag},
+        </if>
+        <if test="masterFlag != null and masterFlag != ''">
+            masterFlag = #{masterFlag},
+        </if>
+        <if test="normalFlag != null and normalFlag != ''">
+            normalFlag = #{normalFlag},
+        </if>
+        <if test="auditStatus != null and auditStatus != ''">
+            auditStatus = #{auditStatus},
+        </if>
+        <if test="auditTime != null">
+            auditTime = #{auditTime},
+        </if>
+        <if test="auditNote != null and auditNote != ''">
+            auditNote = #{auditNote},
+        </if>
+        <if test="registerTime != null ">
+            registerTime = #{registerTime},
+        </if>
+        <if test="registerIP != null and registerIP != ''">
+            registerIP = #{registerIP},
+        </if>
+        <if test="loginTime != null and loginTime != ''">
+            loginTime = #{loginTime},
+        </if>
+        <if test="loginFailTime != null and loginFailTime != ''">
+            loginFailTime = #{loginFailTime},
+        </if>
+        <if test="loginIP != null and loginIP != ''">
+            loginIP = #{loginIP},
+        </if>
+        <if test="validFlag != null and validFlag != ''">
+            validFlag = #{validFlag},
+        </if>
+        <if test="emailCheckFlag != null and emailCheckFlag != ''">
+            emailCheckFlag = #{emailCheckFlag},
+        </if>
+        <if test="mobileCheckFlag != null and mobileCheckFlag != ''">
+            mobileCheckFlag = #{mobileCheckFlag},
+        </if>
+        <if test="clubStatus != null and clubStatus != ''">
+            clubStatus = #{clubStatus},
+        </if>
+        <if test="clubID != null and clubID != ''">
+            clubID = #{clubID},
+        </if>
+        <if test="agreeFlag != null and agreeFlag != ''">
+            agreeFlag = #{agreeFlag},
+        </if>
+        <if test="activationCode != null and activationCode != ''">
+            activationCode = #{activationCode},
+        </if>
+        <if test="activationDate != null ">
+            activationDate = #{activationDate},
+        </if>
+        <if test="serviceProviderStatus != null and serviceProviderStatus != ''">
+            serviceProviderStatus = #{serviceProviderStatus},
+        </if>
+        <if test="serviceProviderID != null and serviceProviderID != ''">
+            serviceProviderID = #{serviceProviderID},
+        </if>
+        <if test="masterStatus != null and masterStatus != ''">
+            masterStatus = #{masterStatus},
+        </if>
+        <if test="masterID != null and masterID != ''">
+            masterID = #{masterID},
+        </if>
+        <if test="userMoney != null and userMoney != ''">
+            userMoney = #{userMoney},
+        </if>
+        <if test="point != null and point != ''">
+            point = #{point},
+        </if>
+        <if test="shopERPFlag != null and shopERPFlag != ''">
+            shopERPFlag = #{shopERPFlag},
+        </if>
+        <if test="fromUserID != null and fromUserID != ''">
+            fromUserID = #{fromUserID},
+        </if>
+        <if test="fromUserName != null and fromUserName != ''">
+            fromUserName = #{fromUserName},
+        </if>
+        <if test="logoffTime != null and logoffTime != ''">
+            logoffTime = #{logoffTime},
+        </if>
+        <if test="appKey != null and appKey != ''">
+            appKey = #{appKey},
+        </if>
+        <if test="appSecret != null and appSecret != ''">
+            appSecret = #{appSecret},
+        </if>
+        <if test="sampleFlag != null and sampleFlag != ''">
+            sampleFlag = #{sampleFlag},
+        </if>
+        <if test="scanFlag != null and scanFlag != ''">
+            scanFlag = #{scanFlag},
+        </if>
+        <if test="sysroleid != null and sysroleid != ''">
+            sysroleid = #{sysroleid},
+        </if>
+        <if test="gender != null and gender != ''">
+            gender = #{gender},
+        </if>
+        <if test="age != null and age != ''">
+            age = #{age},
+        </if>
+        <if test="salerbuyer != null and salerbuyer != ''">
+            salerbuyer = #{salerbuyer},
+        </if>
+        <if test="position != null and position != ''">
+            position = #{position},
+        </if>
+        <if test="skill != null and skill != ''">
+            skill = #{skill},
+        </if>
+        <if test="workage != null and workage != ''">
+            workage = #{workage},
+        </if>
+        <if test="wechat != null and wechat != ''">
+            wechat = #{wechat},
+        </if>
+        <if test="qq != null and qq != ''">
+            qq = #{qq},
+        </if>
+        <if test="smsFlag != null and smsFlag != ''">
+            smsFlag = #{smsFlag},
+        </if>
+        <if test="userBeans != null and userBeans != ''">
+            userBeans = #{userBeans},
+        </if>
+        <if test="privateShopFlag != null and privateShopFlag != ''">
+            privateShopFlag = #{privateShopFlag},
+        </if>
+        <if test="privateClubFlag != null and privateClubFlag != ''">
+            privateClubFlag = #{privateClubFlag},
+        </if>
+        <if test="isMeiDaoAuthorized != null and isMeiDaoAuthorized != ''">
+            isMeiDaoAuthorized = #{isMeiDaoAuthorized},
+        </if>
+        <if test="guideFlag != null and guideFlag != ''">
+            guideFlag = #{guideFlag},
+        </if>
+        userID = #{userID}
+        WHERE userID = #{userID}
+    </update>
 
     <delete id="delete">
-		DELETE FROM user
-		WHERE userID = #{userID}
-	</delete>
+        DELETE
+        FROM user
+        WHERE userID = #{userID}
+    </delete>
 
     <select id="findUserByRegisterType" resultType="CmUser">
         SELECT
@@ -625,18 +626,18 @@
     <update id="updateEmployeeStatus">
         UPDATE user
         <set>
-			<if test="userPermission != null and userPermission != ''">
-				userPermission = #{userPermission},
-			</if>
+            <if test="userPermission != null and userPermission != ''">
+                userPermission = #{userPermission},
+            </if>
             <if test="clubStatus != null and clubStatus != ''">
                 clubStatus = #{clubStatus},
             </if>
             <if test="manufacturerStatus != null and manufacturerStatus != ''">
                 manufacturerStatus = #{manufacturerStatus},
             </if>
-			<if test="tipStatus != null and tipStatus != ''">
-				tipStatus = #{tipStatus},
-			</if>
+            <if test="tipStatus != null and tipStatus != ''">
+                tipStatus = #{tipStatus},
+            </if>
         </set>
         WHERE companyUserID=#{companyUserID} AND userID != #{companyUserID}
     </update>
@@ -647,41 +648,41 @@
             <if test="manufacturerStatus != null and manufacturerStatus != ''">
                 manufacturerStatus = #{manufacturerStatus},
             </if>
-			<if test="validFlag != null and validFlag != ''">
-				validFlag = #{validFlag},
-			</if>
+            <if test="validFlag != null and validFlag != ''">
+                validFlag = #{validFlag},
+            </if>
         </set>
         WHERE userID = #{userID}
     </update>
 
     <update id="updateShopStatus">
-		UPDATE shop
+        UPDATE shop
         <set>
             <if test="status != null and status != ''">
                 status = #{status},
             </if>
         </set>
         WHERE userID = #{userID}
-	</update>
+    </update>
 
     <update id="updateUserAudit">
         UPDATE user
         <set>
-			<if test="auditStatus != null and auditStatus != ''">
-				auditStatus = #{auditStatus},
-			</if>
+            <if test="auditStatus != null and auditStatus != ''">
+                auditStatus = #{auditStatus},
+            </if>
             <if test="auditNote != null and auditNote != ''">
                 auditNote = #{auditNote},
             </if>
             <if test="manufacturerStatus != null and manufacturerStatus != ''">
                 manufacturerStatus = #{manufacturerStatus},
             </if>
-			<if test="auditTime != null and auditTime != ''">
-				auditTime = #{auditTime},
-			</if>
-			<if test="validFlag != null and validFlag != ''">
-				validFlag = #{validFlag},
-			</if>
+            <if test="auditTime != null and auditTime != ''">
+                auditTime = #{auditTime},
+            </if>
+            <if test="validFlag != null and validFlag != ''">
+                validFlag = #{validFlag},
+            </if>
         </set>
         WHERE userID = #{userId}
     </update>
@@ -689,130 +690,140 @@
     <update id="updateShopAudit">
         UPDATE shop
         <set>
-			<if test="auditStatus != null and auditStatus != ''">
-				auditStatus = #{auditStatus},
-			</if>
+            <if test="auditStatus != null and auditStatus != ''">
+                auditStatus = #{auditStatus},
+            </if>
             <if test="auditNote != null and auditNote != ''">
                 auditNote = #{auditNote},
             </if>
             <if test="manufacturerStatus != null and manufacturerStatus != ''">
                 status = #{manufacturerStatus},
             </if>
-			<if test="auditTime != null and auditTime != ''">
-				auditTime = #{auditTime},
-			</if>
+            <if test="auditTime != null and auditTime != ''">
+                auditTime = #{auditTime},
+            </if>
         </set>
         WHERE shopID = #{shopId}
     </update>
 
 
-	<update id="updateEmployeePermission">
-		UPDATE user SET userPermission = #{userPermission}
-		WHERE companyUserID=#{companyUserID} AND userID != #{companyUserID} AND auditStatus = '1'
-	</update>
-
-
-	<update id="updateUserInfo">
-		UPDATE user SET
-		realName = #{realName},
-		name = #{name},
-		userName = #{userName},
-		bindMobile = #{bindMobile},
-		email = #{email}
-		WHERE userID = #{userID}
-	</update>
-
-	<update id="initEmployeeInfo">
-		UPDATE user SET
-		    companyUserID = NULL,
-		    userIdentity = '0',
-		    userPermission = '1',
-		    registerUserTypeID = '10' ,
-		    auditStatus = NULL ,
-		    auditTime = NULL ,
-		    userName = realName,
-		    name = NULL ,
-			clubID = NULL ,
-			clubStatus = NULL ,
-			shopID = NULL ,
-			manufacturerStatus = NULL ,
-			tipStatus = '1'
-		WHERE companyUserID=#{companyUserID} AND userID != #{companyUserID}
-	</update>
-
-	<update id="updateAbleUserMoney">
-		UPDATE user SET
-		    ableUserMoney = #{ableUserMoney}
-		WHERE userID = #{userId}
-	</update>
-
-	<update id="updateMoney">
-		UPDATE user SET
-			userMoney =  #{userMoney},
-		    ableUserMoney = #{ableUserMoney}
-		WHERE userID = #{userID}
-	</update>
-
-	<select id="findUserByMobile" resultType="CmUser">
-		SELECT
-		<include refid="cmUserColumns"/>
-		FROM user a
-		WHERE a.mobile=#{mobile}
-	</select>
-
-	<select id="getUserPayOrder" resultType="com.caimei.modules.order.entity.NewShopOrder">
+    <update id="updateEmployeePermission">
+        UPDATE user
+        SET userPermission = #{userPermission}
+        WHERE companyUserID = #{companyUserID}
+          AND userID != #{companyUserID}
+          AND auditStatus = '1'
+    </update>
+
+
+    <update id="updateUserInfo">
+        UPDATE user
+        SET realName   = #{realName},
+            name       = #{name},
+            userName   = #{userName},
+            bindMobile = #{bindMobile},
+            email      = #{email}
+        WHERE userID = #{userID}
+    </update>
+
+    <update id="initEmployeeInfo">
+        UPDATE user
+        SET companyUserID      = NULL,
+            userIdentity       = '0',
+            userPermission     = '1',
+            registerUserTypeID = '10',
+            auditStatus        = NULL,
+            auditTime          = NULL,
+            userName           = realName,
+            name               = NULL,
+            clubID             = NULL,
+            clubStatus         = NULL,
+            shopID             = NULL,
+            manufacturerStatus = NULL,
+            tipStatus          = '1'
+        WHERE companyUserID = #{companyUserID}
+          AND userID != #{companyUserID}
+    </update>
+
+    <update id="updateAbleUserMoney">
+        UPDATE user
+        SET ableUserMoney = #{ableUserMoney}
+        WHERE userID = #{userId}
+    </update>
+
+    <update id="updateMoney">
+        UPDATE user
+        SET userMoney     = #{userMoney},
+            ableUserMoney = #{ableUserMoney}
+        WHERE userID = #{userID}
+    </update>
+
+    <select id="findUserByMobile" resultType="CmUser">
+        SELECT
+        <include refid="cmUserColumns"/>
+        FROM user a
+        WHERE a.mobile=#{mobile}
+    </select>
+
+    <select id="getUserPayOrder" resultType="com.caimei.modules.order.entity.NewShopOrder">
         select *
         from cm_shop_order
-        where
-        (`status` = 2 || `status` = 3 || `status` = 4 || `status` = 5)
-        AND userID=#{userId}
+        where (`status` = 2 || `status` = 3 || `status` = 4 || `status` = 5)
+          AND userID = #{userId}
     </select>
     <select id="selectByMobileOrEmail" resultType="com.caimei.modules.user.entity.CmUser">
-		select u.*,cu.mobile as operatorMobile from user u
-		left join cm_mall_operation_user cu on cu.userID = u.userID
-		where (u.bindMobile = #{mobileOrEmail}
-		or u.email = #{mobileOrEmail}
-		or (cu.mobile = #{mobileOrEmail} and cu.delFlag != 1))
-		AND u.userIdentity IN (1,2,3,4)
-		AND u.userOrganizeID = 0
-		<if test="source == 'www'">
-			AND u.registerUserTypeID IN (1,3,4)
-		</if>
-		<if test="source == 'crm'">
-			AND u.registerUserTypeID IN (1,2,3,32,4)
-		</if>
-	</select>
-
-	<update id="updateUserBeans">
-		UPDATE USER SET userBeans = #{userBeans} WHERE userID = #{userID}
-	</update>
-
-	<select id="findUserByOrganizeId" resultType="com.caimei.modules.user.entity.CmUser">
-		SELECT
-		<include refid="cmUserColumns"/>
-		FROM user a
-		WHERE a.userOrganizeID=#{organizeId}
-		limit 1
-	</select>
-
-	<select id="getOrganizeStoreName" resultType="java.lang.String">
-		select name from cm_organize_store where id = #{organizeStoreId}
-	</select>
-
-	<update id="updateByClubStatus">
-		UPDATE user SET clubStatus = #{clubStatus} WHERE userID = #{confirmUserId}
-	</update>
-
-	<select id="findByConfirmTime" resultType="date">
-		SELECT
-		  confirmTime
-		FROM
-		  club_confirm_record
-		WHERE
-		  userId = #{userId}
-		ORDER BY
-		  confirmTime DESC
-		LIMIT
-		  1
-  </select>
+        select u.*,cu.mobile as operatorMobile from user u
+        left join cm_mall_operation_user cu on cu.userID = u.userID
+        where (u.bindMobile = #{mobileOrEmail}
+        or u.email = #{mobileOrEmail}
+        or (cu.mobile = #{mobileOrEmail} and cu.delFlag != 1))
+        AND u.userIdentity IN (1,2,3,4)
+        AND u.userOrganizeID = 0
+        <if test="source == 'www'">
+            AND u.registerUserTypeID IN (1,3,4)
+        </if>
+        <if test="source == 'crm'">
+            AND u.registerUserTypeID IN (1,2,3,32,4)
+        </if>
+    </select>
+
+    <update id="updateUserBeans">
+        UPDATE USER
+        SET userBeans = #{userBeans}
+        WHERE userID = #{userID}
+    </update>
+
+    <select id="findUserByOrganizeId" resultType="com.caimei.modules.user.entity.CmUser">
+        SELECT
+        <include refid="cmUserColumns"/>
+        FROM user a
+        WHERE a.userOrganizeID=#{organizeId}
+        limit 1
+    </select>
+
+    <select id="getOrganizeStoreName" resultType="java.lang.String">
+        select name
+        from cm_organize_store
+        where id = #{organizeStoreId}
+    </select>
+
+    <update id="updateByClubStatus">
+        UPDATE user
+        SET clubStatus = #{clubStatus}
+        WHERE userID = #{confirmUserId}
+    </update>
+
+    <select id="findByConfirmTime" resultType="date">
+        SELECT confirmTime
+        FROM club_confirm_record
+        WHERE userId = #{userId}
+        ORDER BY confirmTime DESC
+        LIMIT 1
+    </select>
+
+    <select id="findUserBeans" resultType="java.lang.Integer">
+        select userBeans
+        from user
+        where userID = #{userId}
+    </select>
 </mapper>

+ 2 - 3
src/main/webapp/static/modules/bulkpurchase/orderForm.js

@@ -1273,7 +1273,7 @@ function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金
             if (touchPrice >= item.touchPrice) {
                 if (item.discount * 1 === 1) {
                     var b = Math.floor(touchPrice/item.touchPrice);
-                    reducedPrice = b * item.reducedPrice;
+                    reducedPrice += (b * item.reducedPrice);
                     payTotalFee -= reducedPrice;
                 } else {
                     reducedPrice += item.reducedPrice;
@@ -1300,7 +1300,6 @@ function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金
     $(".svipFullReduction").text(svipFullReduction);
     $("#svipFullReduction").val(svipFullReduction);
     $("#discount").val('0.00');
-
     setProductTotalFee(); //重新设置经理折扣
 }
 
@@ -2057,7 +2056,7 @@ function setProductTotalFee() {
             if (touchPrice >= item.touchPrice) {
                 if (item.discount * 1 === 1) {
                     var b = Math.floor(touchPrice/item.touchPrice);
-                    reducedPrice = b * item.reducedPrice;
+                    reducedPrice += (b * item.reducedPrice);
                     payTotalFee -= reducedPrice;
                 } else {
                     reducedPrice += item.reducedPrice;