@@ -0,0 +1,132 @@ | |||
package com.qtzl.alterSales.dao.entity.second; | |||
import cn.com.taiji.common.entity.StringUUIDEntity; | |||
import javax.persistence.Column; | |||
import javax.persistence.Entity; | |||
import javax.persistence.Table; | |||
import java.time.LocalDateTime; | |||
@Entity | |||
@Table(name = "AFL_SMS_CONFIG") | |||
public class AflSmsConfig extends StringUUIDEntity { | |||
/** 渠道编号 */ | |||
private String agentId; | |||
/** 指定车牌颜色限制 */ | |||
private String vehicleJson; | |||
/** 是否启用短信提醒 1 开启 2关闭 */ | |||
private Integer isEnabled; | |||
/** 短信发送开始时间 */ | |||
private LocalDateTime sendTimeStart; | |||
/** 短信发送结束时间 */ | |||
private LocalDateTime sendTimeEnd; | |||
/** 每天最大提醒次数 */ | |||
private Integer maxCountPerDay; | |||
/** 每月最大提醒次数 */ | |||
private Integer maxCountPerMonth; | |||
/** 按天/ 按月控制最大提醒 1 天 2 月 */ | |||
private Integer type; | |||
/** 创建时间 */ | |||
private LocalDateTime insertTime; | |||
/** 更新时间 */ | |||
private LocalDateTime updateTime; | |||
@Column( name = "AGENT_ID") | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
@Column( name = "VEHICLE_JSON") | |||
public String getVehicleJson() { | |||
return vehicleJson; | |||
} | |||
public void setVehicleJson(String vehicleJson) { | |||
this.vehicleJson = vehicleJson; | |||
} | |||
@Column( name = "IS_ENABLED") | |||
public Integer getIsEnabled() { | |||
return isEnabled; | |||
} | |||
public void setIsEnabled(Integer isEnabled) { | |||
this.isEnabled = isEnabled; | |||
} | |||
@Column( name = "SEND_TIME_START") | |||
public LocalDateTime getSendTimeStart() { | |||
return sendTimeStart; | |||
} | |||
public void setSendTimeStart(LocalDateTime sendTimeStart) { | |||
this.sendTimeStart = sendTimeStart; | |||
} | |||
@Column( name = "SEND_TIME_END") | |||
public LocalDateTime getSendTimeEnd() { | |||
return sendTimeEnd; | |||
} | |||
public void setSendTimeEnd(LocalDateTime sendTimeEnd) { | |||
this.sendTimeEnd = sendTimeEnd; | |||
} | |||
@Column( name = "MAX_COUNT_PER_DAY") | |||
public Integer getMaxCountPerDay() { | |||
return maxCountPerDay; | |||
} | |||
public void setMaxCountPerDay(Integer maxCountPerDay) { | |||
this.maxCountPerDay = maxCountPerDay; | |||
} | |||
@Column( name = "MAX_COUNT_PER_MONTH") | |||
public Integer getMaxCountPerMonth() { | |||
return maxCountPerMonth; | |||
} | |||
public void setMaxCountPerMonth(Integer maxCountPerMonth) { | |||
this.maxCountPerMonth = maxCountPerMonth; | |||
} | |||
@Column( name = "TYPE") | |||
public Integer getType() { | |||
return type; | |||
} | |||
public void setType(Integer type) { | |||
this.type = type; | |||
} | |||
@Column( name = "INSERT_TIME") | |||
public LocalDateTime getInsertTime() { | |||
return insertTime; | |||
} | |||
public void setInsertTime(LocalDateTime insertTime) { | |||
this.insertTime = insertTime; | |||
} | |||
@Column( name = "UPDATE_TIME") | |||
public LocalDateTime getUpdateTime() { | |||
return updateTime; | |||
} | |||
public void setUpdateTime(LocalDateTime updateTime) { | |||
this.updateTime = updateTime; | |||
} | |||
} |
@@ -0,0 +1,120 @@ | |||
package com.qtzl.alterSales.dao.entity.second; | |||
import cn.com.taiji.common.entity.StringUUIDEntity; | |||
import javax.persistence.Column; | |||
import javax.persistence.Entity; | |||
import javax.persistence.Table; | |||
import java.time.LocalDateTime; | |||
@Entity | |||
@Table(name = "AFL_SMS_RECORD") | |||
public class AflSmsRecord extends StringUUIDEntity { | |||
/** 手机号 */ | |||
private String mobile; | |||
/** 短信内容 */ | |||
private String content; | |||
/** 发送时间 */ | |||
private LocalDateTime sendTime; | |||
/** 业务类型 */ | |||
private String businessType; | |||
/** 0 成功 1 失败 */ | |||
private String status; | |||
/** 错误信息 */ | |||
private String errorMsg; | |||
/** 业务Id */ | |||
private String businessId; | |||
/** 渠道编号 */ | |||
private String agentId; | |||
/** 车辆编号 */ | |||
private String vehicleId; | |||
@Column(name = "VEHICLE_ID") | |||
public String getVehicleId() { | |||
return vehicleId; | |||
} | |||
public void setVehicleId(String vehicleId) { | |||
this.vehicleId = vehicleId; | |||
} | |||
@Column(name = "MOBILE") | |||
public String getMobile() { | |||
return mobile; | |||
} | |||
public void setMobile(String mobile) { | |||
this.mobile = mobile; | |||
} | |||
@Column(name = "CONTENT") | |||
public String getContent() { | |||
return content; | |||
} | |||
public void setContent(String content) { | |||
this.content = content; | |||
} | |||
@Column(name = "SEND_TIME") | |||
public LocalDateTime getSendTime() { | |||
return sendTime; | |||
} | |||
public void setSendTime(LocalDateTime sendTime) { | |||
this.sendTime = sendTime; | |||
} | |||
@Column(name = "BUSINESS_TYPE") | |||
public String getBusinessType() { | |||
return businessType; | |||
} | |||
public void setBusinessType(String businessType) { | |||
this.businessType = businessType; | |||
} | |||
@Column(name = "STATUS") | |||
public String getStatus() { | |||
return status; | |||
} | |||
public void setStatus(String status) { | |||
this.status = status; | |||
} | |||
@Column(name = "ERROR_MSG") | |||
public String getErrorMsg() { | |||
return errorMsg; | |||
} | |||
public void setErrorMsg(String errorMsg) { | |||
this.errorMsg = errorMsg; | |||
} | |||
@Column(name = "BUSINESS_ID") | |||
public String getBusinessId() { | |||
return businessId; | |||
} | |||
public void setBusinessId(String businessId) { | |||
this.businessId = businessId; | |||
} | |||
@Column(name = "AGENT_ID") | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
} |
@@ -0,0 +1,24 @@ | |||
package com.qtzl.alterSales.dao.repo.jpa.second; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import com.qtzl.alterSales.dao.entity.second.AflSmsConfig; | |||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | |||
import org.springframework.data.jpa.repository.Query; | |||
public interface AflSmsConfigRepo extends AbstractJpaRepo<AflSmsConfig, String>, JpaSpecificationExecutor<AflSmsConfig>{ | |||
/* | |||
* 通过渠道Id查询记录 | |||
*/ | |||
@Query("from AflSmsConfig where agentId = ?1 ") | |||
AflSmsConfig findByAgentId(String agentId); | |||
/* | |||
* 通过渠道Id查询记录 | |||
*/ | |||
@Query("from AflSmsConfig where agentId = ?1 and id <> ?2 ") | |||
AflSmsConfig getByAgentId(String agentId, String id); | |||
@Query("from AflSmsConfig where id = ?1 ") | |||
AflSmsConfig getInfoById(String id); | |||
} |
@@ -0,0 +1,17 @@ | |||
package com.qtzl.alterSales.dao.repo.jpa.second; | |||
import cn.com.taiji.common.repo.jpa.AbstractJpaRepo; | |||
import com.qtzl.alterSales.dao.entity.second.AflSmsRecord; | |||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | |||
import org.springframework.data.jpa.repository.Query; | |||
import java.util.List; | |||
public interface AflSmsRecordRepo extends AbstractJpaRepo<AflSmsRecord, String>, JpaSpecificationExecutor<AflSmsRecord>{ | |||
/* | |||
* 通过手机号与业务Id查询记录 | |||
*/ | |||
@Query("from AflSmsRecord where mobile = ?1 and businessId=?2 ") | |||
public List<AflSmsRecord> findByMobileandBusinessId(String mobile, String businessId); | |||
} |
@@ -0,0 +1,46 @@ | |||
package com.qtzl.alterSales.manager.handler; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import com.qtzl.alterSales.manager.abstracts.AbstractAfterSalesManager; | |||
import com.qtzl.alterSales.manager.model.protocol.NoAttributeResponse; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigAddRequest; | |||
import com.qtzl.alterSales.manager.service.AflSmsConfigManager; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.txffp.api.core.manager.comm.annotation.ApiHandler; | |||
import org.springframework.stereotype.Service; | |||
import javax.annotation.Resource; | |||
/*** | |||
* <p> | |||
* 短信配置 | |||
* </p> | |||
* @author hyy | |||
* {@code @date} 2024/6/23 13:32 | |||
**/ | |||
@Service | |||
@ApiHandler | |||
public class AflSmsConfigAddHandler extends AbstractAfterSalesManager<AflSmsConfigAddRequest> { | |||
@Resource | |||
private AflSmsConfigManager aflSmsConfigManager; | |||
public AflSmsConfigAddHandler() { | |||
super(AfterSalesCmd.SMSCONFIGADD, AflSmsConfigAddRequest.class); | |||
} | |||
@Override | |||
public String handleInternal(String filename, AflSmsConfigAddRequest aflSmsConfigAddRequest) throws ServiceHandleException { | |||
try { | |||
aflSmsConfigManager.add(aflSmsConfigAddRequest); | |||
} catch (Exception e) { | |||
if (e instanceof ServiceHandleException) { | |||
throw e; | |||
} | |||
logger.error("选装-短信管理-新增:{}", e.getMessage()); | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("操作失败"); | |||
} | |||
return new NoAttributeResponse().toJson(); | |||
} | |||
} |
@@ -0,0 +1,47 @@ | |||
package com.qtzl.alterSales.manager.handler; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import com.qtzl.alterSales.manager.abstracts.AbstractAfterSalesManager; | |||
import com.qtzl.alterSales.manager.model.protocol.NoAttributeResponse; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigEditRequest; | |||
import com.qtzl.alterSales.manager.service.AflSmsConfigManager; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.txffp.api.core.manager.comm.annotation.ApiHandler; | |||
import org.springframework.stereotype.Service; | |||
import javax.annotation.Resource; | |||
/*** | |||
* <p> | |||
* 短信配置 | |||
* </p> | |||
* @author hyy | |||
* {@code @date} 2024/6/23 13:32 | |||
**/ | |||
@Service | |||
@ApiHandler | |||
public class AflSmsConfigEditHandler extends AbstractAfterSalesManager<AflSmsConfigEditRequest> { | |||
@Resource | |||
private AflSmsConfigManager aflSmsConfigManager; | |||
public AflSmsConfigEditHandler() { | |||
super(AfterSalesCmd.SMSCONFIGEDIT, AflSmsConfigEditRequest.class); | |||
} | |||
@Override | |||
public String handleInternal(String filename, AflSmsConfigEditRequest aflSmsConfigEditRequest) throws ServiceHandleException { | |||
try { | |||
aflSmsConfigManager.edit(aflSmsConfigEditRequest); | |||
} catch (Exception e) { | |||
if (e instanceof ServiceHandleException) { | |||
throw e; | |||
} | |||
logger.error("选装-短信管理-编辑:{}", e.getMessage()); | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("操作失败"); | |||
} | |||
return new NoAttributeResponse().toJson(); | |||
} | |||
} |
@@ -0,0 +1,103 @@ | |||
package com.qtzl.alterSales.manager.handler; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.pub.BeanTools; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import cn.hutool.core.util.DesensitizedUtil; | |||
import com.google.common.collect.Lists; | |||
import com.qtzl.alterSales.dao.entity.second.AflMobileApplicationInfo; | |||
import com.qtzl.alterSales.dao.entity.second.AflSmsConfig; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.AflSmsConfigRepo; | |||
import com.qtzl.alterSales.manager.abstracts.AbstractAfterSalesManager; | |||
import com.qtzl.alterSales.manager.model.protocol.NoAttributeResponse; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.*; | |||
import com.qtzl.alterSales.manager.service.AflSmsConfigManager; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.qtzl.alterSales.manager.vo.AflCertificationInfoVo; | |||
import com.qtzl.alterSales.manager.vo.AflMobileApplicationInfoVo; | |||
import com.qtzl.alterSales.manager.vo.AflSmsConfigVo; | |||
import com.txffp.api.core.manager.comm.annotation.ApiHandler; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.data.domain.Page; | |||
import org.springframework.data.domain.PageRequest; | |||
import org.springframework.data.domain.Sort; | |||
import org.springframework.stereotype.Service; | |||
import javax.annotation.Resource; | |||
import javax.persistence.criteria.Predicate; | |||
import java.util.Date; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/*** | |||
* <p> | |||
* 短信配置 | |||
* </p> | |||
* @author hyy | |||
* {@code @date} 2024/6/23 13:32 | |||
**/ | |||
@Service | |||
@ApiHandler | |||
public class AflSmsConfigListHandler extends AbstractAfterSalesManager<AflSmsConfigPageRequest> { | |||
@Resource | |||
private AflSmsConfigRepo aflSmsConfigRepo; | |||
public AflSmsConfigListHandler() { | |||
super(AfterSalesCmd.SMSCONFIGLIST, AflSmsConfigPageRequest.class); | |||
} | |||
@Override | |||
public String handleInternal(String filename, AflSmsConfigPageRequest request) throws ServiceHandleException { | |||
try { | |||
Page<AflSmsConfig> page = select(request); | |||
return toResponse(page,request).toJson(); | |||
} catch (Exception e) { | |||
if (e instanceof ServiceHandleException) { | |||
throw e; | |||
} | |||
logger.error("选装-短信管理查询失败:{}", e.getMessage()); | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("查询失败"); | |||
} | |||
} | |||
private AflSmsConfigPageResponse toResponse(Page<AflSmsConfig> page, AflSmsConfigPageRequest request) { | |||
final AflSmsConfigPageResponse response = new AflSmsConfigPageResponse(); | |||
response.setCurrentPage(request.getPageNo()); | |||
response.setPageSize(request.getPageSize()); | |||
response.setPageCount(page.getTotalPages()); | |||
response.setTotalCount(page.getTotalElements()); | |||
if (isEmpty(page.getContent())) { | |||
response.setData(Lists.newArrayList()); | |||
return response; | |||
} | |||
List<AflSmsConfigVo> formVoList = page.getContent().stream().map(this::toVo).collect(Collectors.toList()); | |||
response.setData(formVoList); | |||
return response; | |||
} | |||
private Page<AflSmsConfig> select(AflSmsConfigPageRequest request) throws ServiceHandleException { | |||
if (request.getPageSize() > 100) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("请求每页数量过大 " + request.getPageSize()); | |||
} | |||
return aflSmsConfigRepo.findAll(((root, query, cb) -> { | |||
List<Predicate> list = Lists.newArrayList(); | |||
if (!StringUtils.isEmpty(request.getAgentId())) { | |||
list.add(cb.equal(root.<String>get("agentId"), request.getAgentId())); | |||
} | |||
if (request.getIsEnabled()!=null) { | |||
list.add(cb.equal(root.<Integer>get("isEnabled"), request.getIsEnabled())); | |||
} | |||
Predicate[] p = new Predicate[list.size()]; | |||
return cb.and(list.toArray(p)); | |||
}), PageRequest.of(request.getPageNo() - 1, request.getPageSize(), | |||
Sort.by(Sort.Direction.DESC, "insertTime"))); | |||
} | |||
private AflSmsConfigVo toVo(AflSmsConfig aflSmsConfig) { | |||
AflSmsConfigVo aflSmsConfigVo = new AflSmsConfigVo(); | |||
BeanUtil.copyProperties(aflSmsConfig, aflSmsConfigVo); | |||
return aflSmsConfigVo; | |||
} | |||
} |
@@ -0,0 +1,112 @@ | |||
package com.qtzl.alterSales.manager.handler; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import cn.hutool.core.bean.BeanUtil; | |||
import com.google.common.collect.Lists; | |||
import com.qtzl.alterSales.dao.entity.second.AflSmsConfig; | |||
import com.qtzl.alterSales.dao.entity.second.AflSmsRecord; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.AflSmsRecordRepo; | |||
import com.qtzl.alterSales.manager.abstracts.AbstractAfterSalesManager; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigPageRequest; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigPageResponse; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsRecordPageRequest; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsRecordPageResponse; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.qtzl.alterSales.manager.vo.AflSmsConfigVo; | |||
import com.qtzl.alterSales.manager.vo.AflSmsReocrdVo; | |||
import com.txffp.api.core.manager.comm.annotation.ApiHandler; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.data.domain.Page; | |||
import org.springframework.data.domain.PageRequest; | |||
import org.springframework.data.domain.Sort; | |||
import org.springframework.stereotype.Service; | |||
import javax.annotation.Resource; | |||
import javax.persistence.criteria.Predicate; | |||
import java.time.LocalDateTime; | |||
import java.util.List; | |||
import java.util.stream.Collectors; | |||
/*** | |||
* <p> | |||
* 短信查询 | |||
* </p> | |||
* @author hyy | |||
* {@code @date} 2024/6/23 13:32 | |||
**/ | |||
@Service | |||
@ApiHandler | |||
public class AflSmsRecordListHandler extends AbstractAfterSalesManager<AflSmsRecordPageRequest> { | |||
@Resource | |||
private AflSmsRecordRepo aflSmsRecordRepo; | |||
public AflSmsRecordListHandler() { | |||
super(AfterSalesCmd.SMSRECORDLIST, AflSmsRecordPageRequest.class); | |||
} | |||
@Override | |||
public String handleInternal(String filename, AflSmsRecordPageRequest request) throws ServiceHandleException { | |||
try { | |||
Page<AflSmsRecord> page = select(request); | |||
return toResponse(page,request).toJson(); | |||
} catch (Exception e) { | |||
if (e instanceof ServiceHandleException) { | |||
throw e; | |||
} | |||
logger.error("选装-短信管理查询失败:{}", e.getMessage()); | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("查询失败"); | |||
} | |||
} | |||
private AflSmsRecordPageResponse toResponse(Page<AflSmsRecord> page, AflSmsRecordPageRequest request) { | |||
final AflSmsRecordPageResponse response = new AflSmsRecordPageResponse(); | |||
response.setCurrentPage(request.getPageNo()); | |||
response.setPageSize(request.getPageSize()); | |||
response.setPageCount(page.getTotalPages()); | |||
response.setTotalCount(page.getTotalElements()); | |||
if (isEmpty(page.getContent())) { | |||
response.setData(Lists.newArrayList()); | |||
return response; | |||
} | |||
List<AflSmsReocrdVo> formVoList = page.getContent().stream().map(this::toVo).collect(Collectors.toList()); | |||
response.setData(formVoList); | |||
return response; | |||
} | |||
private Page<AflSmsRecord> select(AflSmsRecordPageRequest request) throws ServiceHandleException { | |||
if (request.getPageSize() > 100) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("请求每页数量过大 " + request.getPageSize()); | |||
} | |||
return aflSmsRecordRepo.findAll(((root, query, cb) -> { | |||
List<Predicate> list = Lists.newArrayList(); | |||
if (!StringUtils.isEmpty(request.getAgentId())) { | |||
list.add(cb.equal(root.<String>get("agentId"), request.getAgentId())); | |||
} | |||
if (!StringUtils.isEmpty(request.getMobile())) { | |||
list.add(cb.equal(root.<String>get("mobile"), request.getMobile())); | |||
} | |||
if (!StringUtils.isEmpty(request.getStatus())) { | |||
list.add(cb.equal(root.<String>get("status"), request.getStatus())); | |||
} | |||
if (!StringUtils.isEmpty(request.getVehicleId())) { | |||
list.add(cb.equal(root.<String>get("vehicleId"), request.getVehicleId())); | |||
} | |||
if (request.getStartTime() != null) { | |||
list.add(cb.greaterThanOrEqualTo(root.<LocalDateTime>get("sendTime"), request.getStartTime())); | |||
} | |||
if (request.getEndTime() != null) { | |||
list.add(cb.lessThanOrEqualTo(root.<LocalDateTime>get("sendTime"), request.getEndTime())); | |||
} | |||
Predicate[] p = new Predicate[list.size()]; | |||
return cb.and(list.toArray(p)); | |||
}), PageRequest.of(request.getPageNo() - 1, request.getPageSize(), | |||
Sort.by(Sort.Direction.DESC, "sendTime"))); | |||
} | |||
private AflSmsReocrdVo toVo(AflSmsRecord aflSmsRecord) { | |||
AflSmsReocrdVo aflSmsReocrdVo = new AflSmsReocrdVo(); | |||
BeanUtil.copyProperties(aflSmsRecord, aflSmsReocrdVo); | |||
return aflSmsReocrdVo; | |||
} | |||
} |
@@ -0,0 +1,103 @@ | |||
package com.qtzl.alterSales.manager.model.protocol.sales; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.txffp.api.core.manager.comm.annotation.Api; | |||
import java.time.LocalDateTime; | |||
/*** | |||
* <p> | |||
* 短信配置新增 | |||
* </p> | |||
**/ | |||
@Api(cmdClazz = AfterSalesCmd.class, cmd = "SMSCONFIGADD") | |||
public class AflSmsConfigAddRequest extends BaseModel { | |||
private String agentId; | |||
/** 指定车牌颜色限制 */ | |||
private String vehicleJson; | |||
/** 是否启用短信提醒 1 开启 2关闭 */ | |||
private Integer isEnabled; | |||
/** 每天最大提醒次数 */ | |||
private Integer maxCountPerDay; | |||
/** 每月最大提醒次数 */ | |||
private Integer maxCountPerMonth; | |||
/** 短信发送开始时间 */ | |||
private LocalDateTime sendTimeStart; | |||
/** 短信发送结束时间 */ | |||
private LocalDateTime sendTimeEnd; | |||
/** 按天/ 按月控制最大提醒 1 天 2 月 */ | |||
private Integer type; | |||
public Integer getMaxCountPerDay() { | |||
return maxCountPerDay; | |||
} | |||
public void setMaxCountPerDay(Integer maxCountPerDay) { | |||
this.maxCountPerDay = maxCountPerDay; | |||
} | |||
public Integer getMaxCountPerMonth() { | |||
return maxCountPerMonth; | |||
} | |||
public void setMaxCountPerMonth(Integer maxCountPerMonth) { | |||
this.maxCountPerMonth = maxCountPerMonth; | |||
} | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
public String getVehicleJson() { | |||
return vehicleJson; | |||
} | |||
public void setVehicleJson(String vehicleJson) { | |||
this.vehicleJson = vehicleJson; | |||
} | |||
public Integer getIsEnabled() { | |||
return isEnabled; | |||
} | |||
public void setIsEnabled(Integer isEnabled) { | |||
this.isEnabled = isEnabled; | |||
} | |||
public LocalDateTime getSendTimeStart() { | |||
return sendTimeStart; | |||
} | |||
public void setSendTimeStart(LocalDateTime sendTimeStart) { | |||
this.sendTimeStart = sendTimeStart; | |||
} | |||
public LocalDateTime getSendTimeEnd() { | |||
return sendTimeEnd; | |||
} | |||
public void setSendTimeEnd(LocalDateTime sendTimeEnd) { | |||
this.sendTimeEnd = sendTimeEnd; | |||
} | |||
public Integer getType() { | |||
return type; | |||
} | |||
public void setType(Integer type) { | |||
this.type = type; | |||
} | |||
} |
@@ -0,0 +1,112 @@ | |||
package com.qtzl.alterSales.manager.model.protocol.sales; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import com.qtzl.alterSales.manager.service.AfterSalesCmd; | |||
import com.txffp.api.core.manager.comm.annotation.Api; | |||
import java.time.LocalDateTime; | |||
/*** | |||
* <p> | |||
* 短信配置新增 | |||
* </p> | |||
**/ | |||
@Api(cmdClazz = AfterSalesCmd.class, cmd = "SMSCONFIGEDIT") | |||
public class AflSmsConfigEditRequest extends BaseModel { | |||
private String id; | |||
private String agentId; | |||
/** 指定车牌颜色限制 */ | |||
private String vehicleJson; | |||
/** 是否启用短信提醒 1 开启 2关闭 */ | |||
private Integer isEnabled; | |||
/** 每天最大提醒次数 */ | |||
private Integer maxCountPerDay; | |||
/** 每月最大提醒次数 */ | |||
private Integer maxCountPerMonth; | |||
/** 短信发送开始时间 */ | |||
private LocalDateTime sendTimeStart; | |||
/** 短信发送结束时间 */ | |||
private LocalDateTime sendTimeEnd; | |||
/** 按天/ 按月控制最大提醒 1 天 2 月 */ | |||
private Integer type; | |||
public String getId() { | |||
return id; | |||
} | |||
public void setId(String id) { | |||
this.id = id; | |||
} | |||
public Integer getMaxCountPerDay() { | |||
return maxCountPerDay; | |||
} | |||
public void setMaxCountPerDay(Integer maxCountPerDay) { | |||
this.maxCountPerDay = maxCountPerDay; | |||
} | |||
public Integer getMaxCountPerMonth() { | |||
return maxCountPerMonth; | |||
} | |||
public void setMaxCountPerMonth(Integer maxCountPerMonth) { | |||
this.maxCountPerMonth = maxCountPerMonth; | |||
} | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
public String getVehicleJson() { | |||
return vehicleJson; | |||
} | |||
public void setVehicleJson(String vehicleJson) { | |||
this.vehicleJson = vehicleJson; | |||
} | |||
public Integer getIsEnabled() { | |||
return isEnabled; | |||
} | |||
public void setIsEnabled(Integer isEnabled) { | |||
this.isEnabled = isEnabled; | |||
} | |||
public LocalDateTime getSendTimeStart() { | |||
return sendTimeStart; | |||
} | |||
public void setSendTimeStart(LocalDateTime sendTimeStart) { | |||
this.sendTimeStart = sendTimeStart; | |||
} | |||
public LocalDateTime getSendTimeEnd() { | |||
return sendTimeEnd; | |||
} | |||
public void setSendTimeEnd(LocalDateTime sendTimeEnd) { | |||
this.sendTimeEnd = sendTimeEnd; | |||
} | |||
public Integer getType() { | |||
return type; | |||
} | |||
public void setType(Integer type) { | |||
this.type = type; | |||
} | |||
} |
@@ -0,0 +1,30 @@ | |||
package com.qtzl.alterSales.manager.model.protocol.sales; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractAfterSalesPageRequest; | |||
/** | |||
* 短信配置分页请求 | |||
*/ | |||
public class AflSmsConfigPageRequest extends AbstractAfterSalesPageRequest<AflSmsConfigPageResponse> { | |||
private String agentId; | |||
/** 是否启用短信提醒 1 开启 2关闭 */ | |||
private Integer isEnabled; | |||
public Integer getIsEnabled() { | |||
return isEnabled; | |||
} | |||
public void setIsEnabled(Integer isEnabled) { | |||
this.isEnabled = isEnabled; | |||
} | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
} |
@@ -0,0 +1,9 @@ | |||
package com.qtzl.alterSales.manager.model.protocol.sales; | |||
import com.qtzl.alterSales.dao.entity.second.AflSignChannelsInfo; | |||
import com.qtzl.alterSales.dao.entity.second.AflSmsConfig; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractAfterSalesPageResponse; | |||
import com.qtzl.alterSales.manager.vo.AflSmsConfigVo; | |||
public class AflSmsConfigPageResponse extends AbstractAfterSalesPageResponse<AflSmsConfigVo> { | |||
} |
@@ -0,0 +1,88 @@ | |||
package com.qtzl.alterSales.manager.model.protocol.sales; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractAfterSalesPageRequest; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 短信配置分页请求 | |||
*/ | |||
public class AflSmsRecordPageRequest extends AbstractAfterSalesPageRequest<AflSmsRecordPageResponse> { | |||
/** 手机号 */ | |||
private String mobile; | |||
/** 开始时间 */ | |||
private LocalDateTime startTime; | |||
/** 结束时间 */ | |||
private LocalDateTime endTime; | |||
/** 业务类型 */ | |||
private String businessType; | |||
/** 0 成功 1 失败 */ | |||
private String status; | |||
/** 渠道编号 */ | |||
private String agentId; | |||
/** 车辆编号 */ | |||
private String vehicleId; | |||
public String getMobile() { | |||
return mobile; | |||
} | |||
public void setMobile(String mobile) { | |||
this.mobile = mobile; | |||
} | |||
public LocalDateTime getStartTime() { | |||
return startTime; | |||
} | |||
public void setStartTime(LocalDateTime startTime) { | |||
this.startTime = startTime; | |||
} | |||
public LocalDateTime getEndTime() { | |||
return endTime; | |||
} | |||
public void setEndTime(LocalDateTime endTime) { | |||
this.endTime = endTime; | |||
} | |||
public String getBusinessType() { | |||
return businessType; | |||
} | |||
public void setBusinessType(String businessType) { | |||
this.businessType = businessType; | |||
} | |||
public String getStatus() { | |||
return status; | |||
} | |||
public void setStatus(String status) { | |||
this.status = status; | |||
} | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
public String getVehicleId() { | |||
return vehicleId; | |||
} | |||
public void setVehicleId(String vehicleId) { | |||
this.vehicleId = vehicleId; | |||
} | |||
} |
@@ -0,0 +1,7 @@ | |||
package com.qtzl.alterSales.manager.model.protocol.sales; | |||
import com.qtzl.alterSales.manager.model.protocol.AbstractAfterSalesPageResponse; | |||
import com.qtzl.alterSales.manager.vo.AflSmsReocrdVo; | |||
public class AflSmsRecordPageResponse extends AbstractAfterSalesPageResponse<AflSmsReocrdVo> { | |||
} |
@@ -0,0 +1,19 @@ | |||
package com.qtzl.alterSales.manager.service; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigAddRequest; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigEditRequest; | |||
/*** | |||
* <p> | |||
* 短信配置 | |||
* </p> | |||
* @author hyy | |||
* {@code @date} 2024/4/19 22:19 | |||
**/ | |||
public interface AflSmsConfigManager { | |||
void add(AflSmsConfigAddRequest aflSmsConfigAddRequest)throws ServiceHandleException; | |||
void edit(AflSmsConfigEditRequest aflSmsConfigEditRequest)throws ServiceHandleException; | |||
} |
@@ -0,0 +1,88 @@ | |||
package com.qtzl.alterSales.manager.service; | |||
import cn.com.taiji.common.manager.net.http.ServiceHandleException; | |||
import com.qtzl.alterSales.dao.entity.second.AflSmsConfig; | |||
import com.qtzl.alterSales.dao.repo.jpa.second.AflSmsConfigRepo; | |||
import com.qtzl.alterSales.manager.model.protocol.UcServiceError; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigAddRequest; | |||
import com.qtzl.alterSales.manager.model.protocol.sales.AflSmsConfigEditRequest; | |||
import org.apache.commons.lang3.StringUtils; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.stereotype.Service; | |||
import javax.annotation.Resource; | |||
import java.time.LocalDateTime; | |||
/*** | |||
* <p> | |||
* 短信配置 | |||
* </p> | |||
* @author hyy | |||
* {@code @date} 2024/4/19 22:21 | |||
**/ | |||
@Service | |||
public class AflSmsConfigManagerImpl implements AflSmsConfigManager { | |||
@Resource | |||
private AflSmsConfigRepo aflSmsConfigRepo; | |||
@Override | |||
public void add(AflSmsConfigAddRequest aflSmsConfigAddRequest) throws ServiceHandleException { | |||
AflSmsConfig aflSmsConfig = new AflSmsConfig(); | |||
if(StringUtils.isEmpty(aflSmsConfigAddRequest.getAgentId())){ | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("渠道编号必填"); | |||
} | |||
if(null==aflSmsConfigAddRequest.getType()){ | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("按天/按月控制最大提醒必填"); | |||
} | |||
if(aflSmsConfigAddRequest.getType()==1){ | |||
if(null==aflSmsConfigAddRequest.getMaxCountPerDay()) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("每天最大提醒次数必填"); | |||
} | |||
}else if(aflSmsConfigAddRequest.getType()==2){ | |||
if(null==aflSmsConfigAddRequest.getMaxCountPerMonth()) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("每月最大提醒次数必填"); | |||
} | |||
} | |||
AflSmsConfig aflSmsConfigTwo = aflSmsConfigRepo.findByAgentId(aflSmsConfigAddRequest.getAgentId()); | |||
if (null != aflSmsConfigTwo) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("渠道已配置,不允许重复,请核实"); | |||
} | |||
BeanUtils.copyProperties(aflSmsConfigAddRequest, aflSmsConfig); | |||
aflSmsConfig.setInsertTime(LocalDateTime.now()); | |||
aflSmsConfigRepo.save(aflSmsConfig); | |||
} | |||
@Override | |||
public void edit(AflSmsConfigEditRequest aflSmsConfigEditRequest) throws ServiceHandleException { | |||
if(StringUtils.isEmpty(aflSmsConfigEditRequest.getId())){ | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("id必传"); | |||
} | |||
if(StringUtils.isEmpty(aflSmsConfigEditRequest.getAgentId())){ | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("渠道编号必填"); | |||
} | |||
if(null==aflSmsConfigEditRequest.getType()){ | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("按天/按月控制最大提醒必填"); | |||
} | |||
if(aflSmsConfigEditRequest.getType()==1){ | |||
if(null==aflSmsConfigEditRequest.getMaxCountPerDay()) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("每天最大提醒次数必填"); | |||
} | |||
}else if(aflSmsConfigEditRequest.getType()==2){ | |||
if(null==aflSmsConfigEditRequest.getMaxCountPerMonth()) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("每月最大提醒次数必填"); | |||
} | |||
} | |||
AflSmsConfig aflSmsConfig = aflSmsConfigRepo.getInfoById(aflSmsConfigEditRequest.getId()); | |||
if (null == aflSmsConfig) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("查不到数据"); | |||
} | |||
AflSmsConfig aflSmsConfigTwo = aflSmsConfigRepo.getByAgentId(aflSmsConfigEditRequest.getAgentId(),aflSmsConfigEditRequest.getId()); | |||
if (null != aflSmsConfigTwo) { | |||
throw UcServiceError.BUSINESS_VALIDATE_ERR.toHandleException("渠道已配置,不允许重复,请核实"); | |||
} | |||
BeanUtils.copyProperties(aflSmsConfigEditRequest, aflSmsConfig); | |||
aflSmsConfig.setUpdateTime(LocalDateTime.now()); | |||
aflSmsConfigRepo.save(aflSmsConfig); | |||
} | |||
} |
@@ -174,6 +174,11 @@ public enum AfterSalesCmd implements ApiCmd { | |||
CERTIFICATION("实名认证", UcServiceType.AFTERSALES), | |||
USERINFO("获取用户手机、实名信息", UcServiceType.AFTERSALES), | |||
FINDBYPAYIDPACCOUNTPAYRESULT("查询-渠道方主动查询通行流水结果", UcServiceType.AFTERSALES), | |||
// 短信/配置相关接口 | |||
SMSCONFIGADD("短信配置添加", UcServiceType.AFTERSALES), | |||
SMSCONFIGEDIT("短信配置编辑", UcServiceType.AFTERSALES), | |||
SMSCONFIGLIST("短信配置列表", UcServiceType.AFTERSALES), | |||
SMSRECORDLIST("短信列表", UcServiceType.AFTERSALES), | |||
; | |||
private String value; |
@@ -0,0 +1,135 @@ | |||
package com.qtzl.alterSales.manager.vo; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import com.qtzl.alterSales.manager.model.protocol.center.excel.ExcelExport; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 激活信息管理vo; | |||
* @author : zhangxin | |||
* @date : 2024-6-27 | |||
*/ | |||
public class AflSmsConfigVo extends BaseModel { | |||
/** id */ | |||
private String id; | |||
/** 渠道编号 */ | |||
private String agentId; | |||
/** 指定车牌颜色限制 */ | |||
private String vehicleJson; | |||
/** 是否启用短信提醒 1 开启 2关闭 */ | |||
private Integer isEnabled; | |||
/** 短信发送开始时间 */ | |||
private LocalDateTime sendTimeStart; | |||
/** 短信发送结束时间 */ | |||
private LocalDateTime sendTimeEnd; | |||
/** 每天最大提醒次数 */ | |||
private Integer maxCountPerDay; | |||
/** 每月最大提醒次数 */ | |||
private Integer maxCountPerMonth; | |||
/** 按天/ 按月控制最大提醒 1 天 2 月 */ | |||
private Integer type; | |||
/** 创建时间 */ | |||
private LocalDateTime insertTime; | |||
/** 更新时间 */ | |||
private LocalDateTime updateTime; | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
public String getVehicleJson() { | |||
return vehicleJson; | |||
} | |||
public void setVehicleJson(String vehicleJson) { | |||
this.vehicleJson = vehicleJson; | |||
} | |||
public Integer getIsEnabled() { | |||
return isEnabled; | |||
} | |||
public void setIsEnabled(Integer isEnabled) { | |||
this.isEnabled = isEnabled; | |||
} | |||
public LocalDateTime getSendTimeStart() { | |||
return sendTimeStart; | |||
} | |||
public void setSendTimeStart(LocalDateTime sendTimeStart) { | |||
this.sendTimeStart = sendTimeStart; | |||
} | |||
public LocalDateTime getSendTimeEnd() { | |||
return sendTimeEnd; | |||
} | |||
public void setSendTimeEnd(LocalDateTime sendTimeEnd) { | |||
this.sendTimeEnd = sendTimeEnd; | |||
} | |||
public Integer getMaxCountPerDay() { | |||
return maxCountPerDay; | |||
} | |||
public void setMaxCountPerDay(Integer maxCountPerDay) { | |||
this.maxCountPerDay = maxCountPerDay; | |||
} | |||
public Integer getMaxCountPerMonth() { | |||
return maxCountPerMonth; | |||
} | |||
public void setMaxCountPerMonth(Integer maxCountPerMonth) { | |||
this.maxCountPerMonth = maxCountPerMonth; | |||
} | |||
public Integer getType() { | |||
return type; | |||
} | |||
public void setType(Integer type) { | |||
this.type = type; | |||
} | |||
public LocalDateTime getInsertTime() { | |||
return insertTime; | |||
} | |||
public void setInsertTime(LocalDateTime insertTime) { | |||
this.insertTime = insertTime; | |||
} | |||
public LocalDateTime getUpdateTime() { | |||
return updateTime; | |||
} | |||
public void setUpdateTime(LocalDateTime updateTime) { | |||
this.updateTime = updateTime; | |||
} | |||
public String getId() { | |||
return id; | |||
} | |||
public void setId(String id) { | |||
this.id = id; | |||
} | |||
} |
@@ -0,0 +1,123 @@ | |||
package com.qtzl.alterSales.manager.vo; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import java.time.LocalDateTime; | |||
/** | |||
* 激活信息管理vo; | |||
* @author : zhangxin | |||
* @date : 2024-6-27 | |||
*/ | |||
public class AflSmsReocrdVo extends BaseModel { | |||
/** id */ | |||
private String id; | |||
/** 手机号 */ | |||
private String mobile; | |||
/** 短信内容 */ | |||
private String content; | |||
/** 发送时间 */ | |||
private LocalDateTime sendTime; | |||
/** 业务类型 */ | |||
private String businessType; | |||
/** 0 成功 1 失败 */ | |||
private String status; | |||
/** 错误信息 */ | |||
private String errorMsg; | |||
/** 业务Id */ | |||
private String businessId; | |||
/** 渠道编号 */ | |||
private String agentId; | |||
/** 车辆编号 */ | |||
private String vehicleId; | |||
public String getId() { | |||
return id; | |||
} | |||
public void setId(String id) { | |||
this.id = id; | |||
} | |||
public String getMobile() { | |||
return mobile; | |||
} | |||
public void setMobile(String mobile) { | |||
this.mobile = mobile; | |||
} | |||
public String getContent() { | |||
return content; | |||
} | |||
public void setContent(String content) { | |||
this.content = content; | |||
} | |||
public LocalDateTime getSendTime() { | |||
return sendTime; | |||
} | |||
public void setSendTime(LocalDateTime sendTime) { | |||
this.sendTime = sendTime; | |||
} | |||
public String getBusinessType() { | |||
return businessType; | |||
} | |||
public void setBusinessType(String businessType) { | |||
this.businessType = businessType; | |||
} | |||
public String getStatus() { | |||
return status; | |||
} | |||
public void setStatus(String status) { | |||
this.status = status; | |||
} | |||
public String getErrorMsg() { | |||
return errorMsg; | |||
} | |||
public void setErrorMsg(String errorMsg) { | |||
this.errorMsg = errorMsg; | |||
} | |||
public String getBusinessId() { | |||
return businessId; | |||
} | |||
public void setBusinessId(String businessId) { | |||
this.businessId = businessId; | |||
} | |||
public String getAgentId() { | |||
return agentId; | |||
} | |||
public void setAgentId(String agentId) { | |||
this.agentId = agentId; | |||
} | |||
public String getVehicleId() { | |||
return vehicleId; | |||
} | |||
public void setVehicleId(String vehicleId) { | |||
this.vehicleId = vehicleId; | |||
} | |||
} |