Commit 185c63bd authored by tangwei's avatar tangwei

增加短信通知

parent 5cfd42ec
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.DealerReviewEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.MaintenanceTypeEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.MaintenanceTypeEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceDto; import com.yeejoin.amos.boot.module.hygf.api.dto.AcceptanceDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.*;
...@@ -24,6 +25,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel; ...@@ -24,6 +25,7 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.RegionModel; import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -75,8 +77,10 @@ public class MaintenanceServiceImpl extends BaseService<MaintenanceDto,Maintenan ...@@ -75,8 +77,10 @@ public class MaintenanceServiceImpl extends BaseService<MaintenanceDto,Maintenan
@Autowired @Autowired
RedisUtils redisUtil; RedisUtils redisUtil;
private static final String regionRedis="app_region_redis_data"; private static final String regionRedis="app_region_redis_data";
private static final Integer isSignAnAgreement = 1; private static final Integer isSignAnAgreement = 1;
private static final String SMSTEMPCODENO="SMS_HYGF_0003";
private static final String SMSTEMPCODEYES="SMS_HYGF_0004";
@Value("${amos.secret.key}") @Value("${amos.secret.key}")
String secretKey; String secretKey;
...@@ -292,6 +296,16 @@ public class MaintenanceServiceImpl extends BaseService<MaintenanceDto,Maintenan ...@@ -292,6 +296,16 @@ public class MaintenanceServiceImpl extends BaseService<MaintenanceDto,Maintenan
if (maintenanceLog.getOperationResults().equals(MaintenanceUtil.BH)) { if (maintenanceLog.getOperationResults().equals(MaintenanceUtil.BH)) {
maintenance.setReviewStatus(MaintenanceUtil.BH); maintenance.setReviewStatus(MaintenanceUtil.BH);
maintenanceMapper.updateById(maintenance); maintenanceMapper.updateById(maintenance);
HashMap<String, String> params = new HashMap<>(3);
params.put("code","不通过");
params.put("mobile",maintenanceDto.getTelephone());
params.put("smsCode", SMSTEMPCODENO);
FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
return maintenance; return maintenance;
} else { } else {
//如果通过添加平台账号 //如果通过添加平台账号
...@@ -346,6 +360,13 @@ public class MaintenanceServiceImpl extends BaseService<MaintenanceDto,Maintenan ...@@ -346,6 +360,13 @@ public class MaintenanceServiceImpl extends BaseService<MaintenanceDto,Maintenan
publicAgencyUser.setRole(JSON.toJSONString(roleIds)); publicAgencyUser.setRole(JSON.toJSONString(roleIds));
publicAgencyUserMapper.updateById(publicAgencyUser); publicAgencyUserMapper.updateById(publicAgencyUser);
maintenanceMapper.updateById(maintenance); maintenanceMapper.updateById(maintenance);
HashMap<String, String> params = new HashMap<>(3);
params.put("code","通过");
params.put("mobile",maintenanceDto.getTelephone());
params.put("smsCode", SMSTEMPCODEYES);
FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
return maintenance; return maintenance;
} catch (Exception e) { } catch (Exception e) {
if (userResult != null && userResult.getResult() != null if (userResult != null && userResult.getResult() != null
......
...@@ -129,6 +129,10 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -129,6 +129,10 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
@Autowired @Autowired
UserEmpowerMapper userEmpowerMapper; UserEmpowerMapper userEmpowerMapper;
private static final String SMSTEMPCODENO="SMS_HYGF_0003";
private static final String SMSTEMPCODEYES="SMS_HYGF_0004";
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -571,7 +575,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -571,7 +575,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
String meg= String.valueOf(kv.get("approveInfo")); String meg= String.valueOf(kv.get("approveInfo"));
params.put("code","不通过"); params.put("code","不通过");
params.put("mobile",unitInfo.getAdminPhone()); params.put("mobile",unitInfo.getAdminPhone());
params.put("smsCode", smsTempCode); params.put("smsCode", SMSTEMPCODENO);
approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核不通过"; approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核不通过";
FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params); FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
}else{ }else{
...@@ -619,6 +623,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -619,6 +623,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
// Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId()); // Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId());
approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核通过"; approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核通过";
} }
} }
// 2. 更新流程状态 // 2. 更新流程状态
...@@ -642,11 +647,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -642,11 +647,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
dealerReview.setFlowTaskId(basicGridAcceptance.getNextTaskId()); dealerReview.setFlowTaskId(basicGridAcceptance.getNextTaskId());
dealerReviewService.saveDealerReview(dealerReview,false,true,unitInfo.getName(),approvalStatue); dealerReviewService.saveDealerReview(dealerReview,false,true,unitInfo.getName(),approvalStatue);
this.saveOrUpdate(unitInfo);
HashMap<String, String> params = new HashMap<>(3);
params.put("code","通过");
params.put("mobile",unitInfo.getAdminPhone());
params.put("smsCode", SMSTEMPCODEYES);
FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
this.saveOrUpdate(unitInfo);
}catch (Exception e){ }catch (Exception e){
if (!ObjectUtils.isEmpty(unitInfo.getAmosCompanySeq())) { if (!ObjectUtils.isEmpty(unitInfo.getAmosCompanySeq())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment