| @@ -0,0 +1,24 @@ | |||
| #商户分账账户删除提醒 | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(86,'456','16','商户分账账户删除提醒','富茂','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(116,'1001','16','商户分账账户删除提醒','长融世贸广场','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(216,'1002','16','商户分账账户删除提醒','同保楼 同福街','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(316,'1003','16','商户分账账户删除提醒','杭州东站西子国际','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(416,'1004','16','商户分账账户删除提醒','莱迪1086商业中心','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(516,'1005','16','商户分账账户删除提醒','永修铜锣湾广场','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(616,'1006','16','商户分账账户删除提醒','欧堡利亚海悦城','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| insert into wx_msg_validationcode_model(id,tenant_id,type,name,signature,content,createtime,status,minutes,model_id) | |||
| values(716,'1007','16','商户分账账户删除提醒','澳林广场','{merchant}商户的收款账户[{account}]于{time}取消绑定,营销活动与销售分成将无法正常进行,请尽快绑定新收款账户',now(),1,0,null); | |||
| #删除不需要的短信模板 | |||
| delete from wx_msg_validationcode_model where id in (80,82,110,112,210,212,310,312,410,412,510,512,610,612,710,712); | |||
| #商户分账账户新增通知商户内容更新 | |||
| update wx_msg_validationcode_model set content='您于{time}提交了{merchant}商户的收款账户[{account}]绑定,后续销售分成及营销补贴将存入该账户' where id in(81,111,211,311,411,511,611,711); | |||
| #商户分账账户变更通知商户内容更新 | |||
| update wx_msg_validationcode_model set content='您于{time}将{merchant}商户的收款账户变更为[{account}],后续销售分成及营销补贴将存入该账户' where id(83,113,213,313,413,513,613,713); | |||
| @@ -4,6 +4,7 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.enums.EnumMsgSend; | |||
| import com.iformall.service.WxMerchantService; | |||
| import com.iformall.service.WxProfitSharingReceiverService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -77,7 +78,7 @@ public class WxMerchantController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户分账账户ID不能为空"); | |||
| } | |||
| receiver.setTenantId(getTenantId()); | |||
| return wxProfitSharingReceiverService.delReceiver(receiver); | |||
| return wxProfitSharingReceiverService.delReceiver(receiver, EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode()); | |||
| } | |||
| } | |||
| @@ -21,6 +21,7 @@ public enum EnumMsgModel { | |||
| UPDATE_SHARING_ACCOUNT_NOTIFY_MERCHANT(13, "商户分账账户变更通知商户"), | |||
| ACCEPT_SHARING_ACCOUNT_NOTIFY_MANAGER(14, "商户分账账户使用回执"), | |||
| REJECT_SHARING_ACCOUNT_NOTIFY_MANAGER(15, "商户分账账户不使用回执"), | |||
| DELETE_SHARING_ACCOUNT_NOTIFY_MERCHANT(16, "商户分账账户删除提醒"), | |||
| ; | |||
| public static EnumMsgModel getEnum(Integer code) { | |||
| @@ -45,7 +45,7 @@ public interface WxProfitSharingReceiverService { | |||
| ResultData addReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver, List<WxProfitSharingReceiver> delList); | |||
| ResultData delReceiver(WxProfitSharingReceiver receiver); | |||
| ResultData delReceiver(WxProfitSharingReceiver receiver, Integer send); | |||
| ResultData updateReceiver(WxMerchant merchant, WxProfitSharingReceiver receiver); | |||
| @@ -32,8 +32,10 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.*; | |||
| import java.util.stream.Collectors; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Service | |||
| @@ -171,7 +173,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||
| //添加成功才删除账户 | |||
| for (WxProfitSharingReceiver delReceiver : delList) { | |||
| delReceiver(delReceiver); | |||
| delReceiver(delReceiver, EnumMsgSend.MSG_SEND_NOT_IMMEDIATELY.getCode()); | |||
| } | |||
| WxProfitSharingReceiver wxProfitSharingReceiver = new WxProfitSharingReceiver(); | |||
| @@ -199,16 +201,15 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||
| } | |||
| WxMerchantVo wxMerchant = listCVo.get(0); | |||
| //商户手机号 | |||
| String merchantName = wxMerchant.getMerchantName(); | |||
| Set<String> managerPhone = wxMerchant.getShopVoList().parallelStream().map(s -> s.getLinkPhone()) | |||
| .filter(phone -> StringUtils.isNotEmpty(phone)).collect(Collectors.toSet()); | |||
| if (type.equals(EnumMsgModel.ADD_SHARING_ACCOUNT_NOTIFY_MERCHANT.getCode()) || | |||
| type.equals(EnumMsgModel.UPDATE_SHARING_ACCOUNT_NOTIFY_MERCHANT.getCode())) { | |||
| //添加时发送商户 | |||
| String phone = wxMerchant.getMerchantLinkPhone(); | |||
| String time = DateUtils.getSystemTime("yyyy年MM月dd日HH时mm分"); | |||
| sendMsg(phone, account, merchantName, time, type, tenantId); | |||
| String phone = wxMerchant.getMerchantLinkPhone(); | |||
| if (StringUtils.isEmpty(phone)) { | |||
| logger.info("商户联系人电话不存在不发送短信"); | |||
| return; | |||
| } | |||
| String time = DateUtils.getSystemTime("yyyy年MM月dd日HH时mm分"); | |||
| String merchantName = wxMerchant.getMerchantName(); | |||
| sendMsg(phone, account, merchantName, time, type, tenantId); | |||
| } | |||
| @Override | |||
| @@ -244,7 +245,7 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||
| } | |||
| @Override | |||
| public ResultData delReceiver(WxProfitSharingReceiver receiver) { | |||
| public ResultData delReceiver(WxProfitSharingReceiver receiver, Integer send) { | |||
| WxAppinfo appInfo = new WxAppinfo(); | |||
| appInfo.setTenantId(receiver.getTenantId()); | |||
| appInfo.setType(EnumAppType.C.getCode()); | |||
| @@ -306,6 +307,12 @@ public class WxProfitSharingReceiverServiceImpl implements WxProfitSharingReceiv | |||
| receiver.setStatus(EnumProfitSharingReceiverStatus.PROFIT_SHARING_RECEIVER_STATUS_INVALID.getCode()); | |||
| receiver.setUpdateTime(new Date()); | |||
| wxProfitSharingReceiverMapper.updateByPrimaryKeySelective(receiver); | |||
| //发送短信 | |||
| if (send.equals(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode())) { | |||
| sendMsgByType(EnumMsgModel.DELETE_SHARING_ACCOUNT_NOTIFY_MERCHANT.getCode(), receiver.getMerchantId(), receiver.getReceiverAccount(), receiver.getTenantId()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||