|
@@ -8,12 +8,23 @@ import cn.hutool.extra.template.TemplateConfig;
|
|
|
import cn.hutool.extra.template.TemplateEngine;
|
|
|
import cn.hutool.extra.template.TemplateUtil;
|
|
|
import cn.hutool.poi.word.Word07Writer;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
import com.zhongzheng.modules.alioss.bo.OssRequest;
|
|
|
import com.zhongzheng.modules.alioss.service.impl.OssServiceImpl;
|
|
|
+import com.zhongzheng.modules.alisms.service.IAliSmsService;
|
|
|
import com.zhongzheng.modules.base.bo.UserProfileFit;
|
|
|
+import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
+import com.zhongzheng.modules.inform.bo.InformUserAddBo;
|
|
|
+import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
|
+import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
|
+import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
|
+import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
+import com.zhongzheng.modules.user.service.IUserService;
|
|
|
+import com.zhongzheng.modules.user.vo.UserVo;
|
|
|
import org.apache.http.entity.ContentType;
|
|
|
import org.apache.poi.xwpf.usermodel.BreakType;
|
|
|
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
|
@@ -59,9 +70,30 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
|
|
|
@Value("${zhongzheng.profile}")
|
|
|
private String ZHONGZHENG_PROFILE;
|
|
|
|
|
|
- @Autowired()
|
|
|
+ @Autowired
|
|
|
private OssServiceImpl ossService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IGoodsService iGoodsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IUserService iUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IInformUserService iInformUserService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IInformRemindService informRemindService;
|
|
|
+
|
|
|
+ @Value("${aliyun.sms.materialReviewCode}")
|
|
|
+ private String materialReviewCode;
|
|
|
+
|
|
|
+ @Value("${aliyun.sms.NotificationOfFailureCode}")
|
|
|
+ private String NotificationOfFailureCode;
|
|
|
+
|
|
|
@Override
|
|
|
public UserProfileVo queryById(Long id){
|
|
|
UserProfileQueryBo userProfileQueryBo = new UserProfileQueryBo();
|
|
@@ -205,9 +237,85 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
|
|
|
update.setUpdateTime(DateUtils.getNowTime());
|
|
|
update.setAuditTime(DateUtils.getNowTime());
|
|
|
update.setChangeStatus(1);
|
|
|
+ sendAuidit(update);
|
|
|
return this.updateById(update);
|
|
|
}
|
|
|
|
|
|
+ private void sendAuidit(UserProfile bo) {
|
|
|
+ UserProfileVo userProfileVo = this.queryById(bo.getId());
|
|
|
+ if (bo.getStatus().equals(1)) {
|
|
|
+ InformRemindVo informRemindVo = informRemindService.queryById(3L);
|
|
|
+ if (informRemindVo.getWayStatus().equals(1)) {
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(userProfileVo.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(3L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setRemind("报名资料审核通过通知");
|
|
|
+ informUserAddBo.setGoodsId(userProfileVo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(userProfileVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您填写的"+goodsVo1.getGoodsName()+"课程报名信息审核成功,请尽快去学习吧");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informRemindVo.getNoteStatus().equals(1)){
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(userProfileVo.getUserId());
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(3L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setRemind("报名资料审核通过通知");
|
|
|
+ informUserAddBo.setGoodsId(userProfileVo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(userProfileVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "已经开通,请尽快去学习吧。");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ UserVo userVo = iUserService.queryById(userProfileVo.getUserId());
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goods", goodsVo1.getGoodsName());
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), materialReviewCode);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ InformRemindVo informRemindTwoVo = informRemindService.queryById(4L);
|
|
|
+ if (informRemindTwoVo.getWayStatus().equals(1)) {
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(userProfileVo.getUserId());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(4L);
|
|
|
+ informUserAddBo.setSystemStatus(1);
|
|
|
+ informUserAddBo.setRemind("报名资料审核不通过通知");
|
|
|
+ informUserAddBo.setGoodsId(userProfileVo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(userProfileVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您填写的"+goodsVo1.getGoodsName()+"课程报名信息审核不通过,请重新完善吧");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ }
|
|
|
+ if (informRemindTwoVo.getNoteStatus().equals(1)){
|
|
|
+ InformUserAddBo informUserAddBo = new InformUserAddBo();
|
|
|
+ informUserAddBo.setUserId(userProfileVo.getUserId());
|
|
|
+ informUserAddBo.setSendTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setSendStatus(1);
|
|
|
+ informUserAddBo.setCreateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ informUserAddBo.setRemindId(3L);
|
|
|
+ informUserAddBo.setSystemStatus(3);
|
|
|
+ informUserAddBo.setRemind("报名资料审核不通过通知");
|
|
|
+ informUserAddBo.setGoodsId(userProfileVo.getGoodsId());
|
|
|
+ GoodsVo goodsVo1 = iGoodsService.queryById(userProfileVo.getGoodsId());
|
|
|
+ informUserAddBo.setText("尊敬的用户:您填写的"+goodsVo1.getGoodsName()+"课程报名信息审核不通过,请重新完善吧");
|
|
|
+ iInformUserService.insertByAddBo(informUserAddBo);
|
|
|
+ UserVo userVo = iUserService.queryById(userProfileVo.getUserId());
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("goods", goodsVo1.getGoodsName());
|
|
|
+ IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), NotificationOfFailureCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<UserProfileVo> listRecord(UserProfileQueryBo bo) {
|
|
|
return baseMapper.listRecord(bo);
|