Browse Source

一键成团短信推送

Aslee 3 years ago
parent
commit
0126081636

+ 2 - 0
src/main/java/com/caimei/modules/hehe/dao/CmHeheCollageDao.java

@@ -25,4 +25,6 @@ public interface CmHeheCollageDao extends CrudDao<CmHeheCollage> {
     List<Integer> findNoPayCollageOrderIds(String collageId);
     List<Integer> findNoPayCollageOrderIds(String collageId);
 
 
     void cancelOrder(@Param("orderId") Integer orderId, @Param("reason") String reason);
     void cancelOrder(@Param("orderId") Integer orderId, @Param("reason") String reason);
+
+    List<String> getMobilesByCollageId(String collageId);
 }
 }

+ 6 - 1
src/main/java/com/caimei/modules/hehe/service/CmHeheCollageService.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 
 import com.caimei.modules.hehe.dao.CmHeheCollageProductDao;
 import com.caimei.modules.hehe.dao.CmHeheCollageProductDao;
 import com.caimei.modules.hehe.entity.CmHeheCollageMember;
 import com.caimei.modules.hehe.entity.CmHeheCollageMember;
+import com.caimei.modules.sys.utils.SMSUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
@@ -62,9 +63,13 @@ public class CmHeheCollageService extends CrudService<CmHeheCollageDao, CmHeheCo
 
 
 	@Transactional(readOnly = false)
 	@Transactional(readOnly = false)
     public void complete(CmHeheCollage cmHeheCollage) {
     public void complete(CmHeheCollage cmHeheCollage) {
-		// 自动拼成拼
+		// 一键成
 		String collageId = cmHeheCollage.getId();
 		String collageId = cmHeheCollage.getId();
 		cmHeheCollageDao.completeCollage(collageId);
 		cmHeheCollageDao.completeCollage(collageId);
+		// 已支付订单手机号
+		List<String> mobileList = cmHeheCollageDao.getMobilesByCollageId(collageId);
+		// 拼团成功短信推送
+		mobileList.forEach(mobile-> SMSUtils.sendSms(mobile, "您的商品已拼团成功,请赶紧登录呵呵商城小程序查看订单吧。"));
 		// 关闭其它未支付拼团订单
 		// 关闭其它未支付拼团订单
 		List<Integer> orderIdList = cmHeheCollageDao.findNoPayCollageOrderIds(collageId);
 		List<Integer> orderIdList = cmHeheCollageDao.findNoPayCollageOrderIds(collageId);
 		orderIdList.forEach(noPayOrderId->{
 		orderIdList.forEach(noPayOrderId->{

+ 4 - 1
src/main/resources/mappings/modules/hehe/CmHeheCollageMapper.xml

@@ -35,7 +35,7 @@
 		FROM cm_hehe_collage a
 		FROM cm_hehe_collage a
 		<include refid="cmHeheCollageJoins"/>
 		<include refid="cmHeheCollageJoins"/>
 		<where>
 		<where>
-			a.status != 0
+			a.status != 0 and a.status != 3
 			<if test="id != null and id != ''">
 			<if test="id != null and id != ''">
 				AND a.id = #{id}
 				AND a.id = #{id}
 			</if>
 			</if>
@@ -101,6 +101,9 @@
 		select co.orderID from cm_hehe_collage_member chcm left join cm_order co on chcm.orderId = co.orderID
 		select co.orderID from cm_hehe_collage_member chcm left join cm_order co on chcm.orderId = co.orderID
 		where co.receiptStatus = 1 and chcm.collageId = #{collageId}
 		where co.receiptStatus = 1 and chcm.collageId = #{collageId}
 	</select>
 	</select>
+	<select id="getMobilesByCollageId" resultType="java.lang.String">
+		select u.mobile from cm_hehe_user u left join cm_order co on u.userId = co.userID where co.orderID = #{orderId}
+	</select>
 
 
 	<insert id="insert" parameterType="CmHeheCollage"  keyProperty="id" useGeneratedKeys="true">
 	<insert id="insert" parameterType="CmHeheCollage"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_hehe_collage(
 		INSERT INTO cm_hehe_collage(

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheCollageList.jsp

@@ -113,7 +113,7 @@
 				</td>
 				</td>
 				<td>
 				<td>
 					<c:if test="${cmHeheCollage.status eq 1}">
 					<c:if test="${cmHeheCollage.status eq 1}">
-						<a href="${ctx}/hehe/cmHeheCollage/complete?id=${cmHeheCollage.id}">一键拼团</a>
+						<a href="${ctx}/hehe/cmHeheCollage/complete?id=${cmHeheCollage.id}">一键成团<a>
 					</c:if>
 					</c:if>
 					<a href="${ctx}/hehe/cmHeheCollage/memberList?collageId=${cmHeheCollage.id}">拼团成员</a>
 					<a href="${ctx}/hehe/cmHeheCollage/memberList?collageId=${cmHeheCollage.id}">拼团成员</a>
 				</td>
 				</td>