Commit b0872e69 by zhiwj

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer
parents 4867f45d 9be1a5c6
package com.gic.enterprise.service.outer.impl; package com.gic.enterprise.service.outer.impl;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
...@@ -9,13 +16,6 @@ import com.gic.enterprise.entity.TabCustomGuide; ...@@ -9,13 +16,6 @@ import com.gic.enterprise.entity.TabCustomGuide;
import com.gic.enterprise.entity.TabCustomStore; import com.gic.enterprise.entity.TabCustomStore;
import com.gic.enterprise.service.*; import com.gic.enterprise.service.*;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import java.util.List;
/** /**
* *
* @ClassName: CustomStoreApiServiceImpl * @ClassName: CustomStoreApiServiceImpl
......
package com.gic.enterprise.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* Spring ApplicationContext 工具类
* @ClassName: ApplicationContextUtils

* @Description: 

* @author guojuxing

* @date 2020/11/11 10:22 AM

*/
@Component
public class ApplicationContextUtils implements ApplicationContextAware{
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
ApplicationContextUtils.applicationContext = applicationContext;
}
public static <T> T getBean(String beanName) {
if (applicationContext.containsBean(beanName)) {
return (T) applicationContext.getBean(beanName);
}
return null;
}
public static <T> T getBean(Class<T> clazz) {
return applicationContext.getBean(clazz);
}
}
package com.gic.enterprise.utils.chart; package com.gic.enterprise.utils.chart;
import com.gic.enterprise.dto.HomeStatisticsDTO; import java.util.List;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingAccountBalanceRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import com.gic.enterprise.dto.HomeStatisticsDTO;
import java.util.List; import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingAccountBalanceRecordService;
/** /**
* 余额支付消费明细 * 余额支付消费明细
* @ClassName: BillingAccountBalanceRecord
 * @ClassName: BillingAccountBalanceRecord

...@@ -15,22 +15,18 @@ import java.util.List; ...@@ -15,22 +15,18 @@ import java.util.List;
* @author guojuxing
 * @author guojuxing

* @date 2019/8/23 2:19 PM
 * @date 2019/8/23 2:19 PM

*/ */
@Component @Component("billingAccountBalanceRecord")
public class BillingAccountBalanceRecord implements IFeeChart{ public class BillingAccountBalanceRecord implements IFeeChart{
@Autowired @Autowired
private BillingAccountBalanceRecordService billingAccountBalanceRecordService; private BillingAccountBalanceRecordService billingAccountBalanceRecordService;
private static BillingAccountBalanceRecord billingAccountBalanceRecord;
@PostConstruct
public void init() {
billingAccountBalanceRecord = this;
}
@Override @Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) { public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingAccountBalanceRecord.billingAccountBalanceRecordService.listHomeStatistics(params); return this.billingAccountBalanceRecordService.listHomeStatistics(params);
} }
@Override @Override
public double getFee(Integer enterpriseId, Integer dateType) { public double getFee(Integer enterpriseId, Integer dateType) {
return billingAccountBalanceRecord.billingAccountBalanceRecordService.getFee(enterpriseId, dateType); return this.billingAccountBalanceRecordService.getFee(enterpriseId, dateType);
} }
} }
package com.gic.enterprise.utils.chart; package com.gic.enterprise.utils.chart;
import com.gic.enterprise.dto.HomeStatisticsDTO; import java.util.List;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingDoubleCallingRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import com.gic.enterprise.dto.HomeStatisticsDTO;
import java.util.List; import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingDoubleCallingRecordService;
/** /**
* 双向呼叫消费明细 * 双向呼叫消费明细
* @ClassName: BillingDoubleCallingRecord
 * @ClassName: BillingDoubleCallingRecord

...@@ -15,22 +15,17 @@ import java.util.List; ...@@ -15,22 +15,17 @@ import java.util.List;
* @author guojuxing
 * @author guojuxing

* @date 2019/8/23 2:20 PM
 * @date 2019/8/23 2:20 PM

*/ */
@Component @Component("billingDoubleCallingRecord")
public class BillingDoubleCallingRecord implements IFeeChart{ public class BillingDoubleCallingRecord implements IFeeChart{
@Autowired @Autowired
private BillingDoubleCallingRecordService billingDoubleCallingRecordService; private BillingDoubleCallingRecordService billingDoubleCallingRecordService;
private static BillingDoubleCallingRecord billingDoubleCallingRecord;
@PostConstruct
public void init() {
billingDoubleCallingRecord = this;
}
@Override @Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) { public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingDoubleCallingRecord.billingDoubleCallingRecordService.listHomeStatistics(params); return this.billingDoubleCallingRecordService.listHomeStatistics(params);
} }
@Override @Override
public double getFee(Integer enterpriseId, Integer dateType) { public double getFee(Integer enterpriseId, Integer dateType) {
return billingDoubleCallingRecord.billingDoubleCallingRecordService.getFee(enterpriseId, dateType); return this.billingDoubleCallingRecordService.getFee(enterpriseId, dateType);
} }
} }
...@@ -2,8 +2,6 @@ package com.gic.enterprise.utils.chart; ...@@ -2,8 +2,6 @@ package com.gic.enterprise.utils.chart;
import java.util.List; import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -18,22 +16,17 @@ import com.gic.enterprise.service.BillingInternationalSmsRecordService; ...@@ -18,22 +16,17 @@ import com.gic.enterprise.service.BillingInternationalSmsRecordService;
* @author guojuxing
 * @author guojuxing

* @date 2019/8/23 2:19 PM
 * @date 2019/8/23 2:19 PM

*/ */
@Component @Component("billingInternationSmsRecord")
public class BillingInternationSmsRecord implements IFeeChart{ public class BillingInternationSmsRecord implements IFeeChart{
@Autowired @Autowired
private BillingInternationalSmsRecordService billingInternationalSmsRecordService; private BillingInternationalSmsRecordService billingInternationalSmsRecordService;
private static BillingInternationSmsRecord billingInternationSmsRecord;
@PostConstruct
public void init() {
billingInternationSmsRecord = this;
}
@Override @Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) { public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingInternationSmsRecord.billingInternationalSmsRecordService.listHomeStatistics(params); return this.billingInternationalSmsRecordService.listHomeStatistics(params);
} }
@Override @Override
public double getFee(Integer enterpriseId, Integer dateType) { public double getFee(Integer enterpriseId, Integer dateType) {
return billingInternationSmsRecord.billingInternationalSmsRecordService.getFee(enterpriseId, dateType); return this.billingInternationalSmsRecordService.getFee(enterpriseId, dateType);
} }
} }
package com.gic.enterprise.utils.chart; package com.gic.enterprise.utils.chart;
import com.gic.enterprise.dto.HomeStatisticsDTO; import java.util.List;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingRecordingStorageRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import com.gic.enterprise.dto.HomeStatisticsDTO;
import java.util.List; import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingRecordingStorageRecordService;
/** /**
* 语音存储消费明细 * 语音存储消费明细
* @ClassName: BillingRecordingStorageRecord
 * @ClassName: BillingRecordingStorageRecord

...@@ -15,22 +15,17 @@ import java.util.List; ...@@ -15,22 +15,17 @@ import java.util.List;
* @author guojuxing
 * @author guojuxing

* @date 2019/8/23 2:20 PM
 * @date 2019/8/23 2:20 PM

*/ */
@Component @Component("billingRecordingStorageRecord")
public class BillingRecordingStorageRecord implements IFeeChart{ public class BillingRecordingStorageRecord implements IFeeChart{
@Autowired @Autowired
private BillingRecordingStorageRecordService billingRecordingStorageRecordService; private BillingRecordingStorageRecordService billingRecordingStorageRecordService;
private static BillingRecordingStorageRecord billingRecordingStorageRecord;
@PostConstruct
public void init() {
billingRecordingStorageRecord = this;
}
@Override @Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) { public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingRecordingStorageRecord.billingRecordingStorageRecordService.listHomeStatistics(params); return this.billingRecordingStorageRecordService.listHomeStatistics(params);
} }
@Override @Override
public double getFee(Integer enterpriseId, Integer dateType) { public double getFee(Integer enterpriseId, Integer dateType) {
return billingRecordingStorageRecord.billingRecordingStorageRecordService.getFee(enterpriseId, dateType); return this.billingRecordingStorageRecordService.getFee(enterpriseId, dateType);
} }
} }
package com.gic.enterprise.utils.chart; package com.gic.enterprise.utils.chart;
import com.gic.enterprise.dto.HomeStatisticsDTO; import java.util.List;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingSmsPackageRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import com.gic.enterprise.dto.HomeStatisticsDTO;
import java.util.List; import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingSmsPackageRecordService;
/** /**
* 短信套餐包消费明细 * 短信套餐包消费明细
* @ClassName: BillingSmsPackageRecord
 * @ClassName: BillingSmsPackageRecord

...@@ -15,22 +15,17 @@ import java.util.List; ...@@ -15,22 +15,17 @@ import java.util.List;
* @author guojuxing
 * @author guojuxing

* @date 2019/8/23 2:20 PM
 * @date 2019/8/23 2:20 PM

*/ */
@Component @Component("billingSmsPackageRecord")
public class BillingSmsPackageRecord implements IFeeChart{ public class BillingSmsPackageRecord implements IFeeChart{
@Autowired @Autowired
private BillingSmsPackageRecordService billingSmsPackageRecordService; private BillingSmsPackageRecordService billingSmsPackageRecordService;
private static BillingSmsPackageRecord billingSmsPackageRecord;
@PostConstruct
public void init() {
billingSmsPackageRecord = this;
}
@Override @Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) { public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingSmsPackageRecord.billingSmsPackageRecordService.listHomeStatistics(params); return this.billingSmsPackageRecordService.listHomeStatistics(params);
} }
@Override @Override
public double getFee(Integer enterpriseId, Integer dateType) { public double getFee(Integer enterpriseId, Integer dateType) {
return billingSmsPackageRecord.billingSmsPackageRecordService.getFee(enterpriseId, dateType); return this.billingSmsPackageRecordService.getFee(enterpriseId, dateType);
} }
} }
package com.gic.enterprise.utils.chart; package com.gic.enterprise.utils.chart;
import com.gic.enterprise.dto.HomeStatisticsDTO; import java.util.List;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingSmsRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import com.gic.enterprise.dto.HomeStatisticsDTO;
import java.util.List; import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingSmsRecordService;
/** /**
* 短信消费明细 * 短信消费明细
* @ClassName: BillingSmsRecord
 * @ClassName: BillingSmsRecord

...@@ -15,22 +15,17 @@ import java.util.List; ...@@ -15,22 +15,17 @@ import java.util.List;
* @author guojuxing
 * @author guojuxing

* @date 2019/8/23 2:21 PM
 * @date 2019/8/23 2:21 PM

*/ */
@Component @Component("billingSmsRecord")
public class BillingSmsRecord implements IFeeChart{ public class BillingSmsRecord implements IFeeChart{
@Autowired @Autowired
private BillingSmsRecordService billingSmsRecordService; private BillingSmsRecordService billingSmsRecordService;
private static BillingSmsRecord billingSmsRecord;
@PostConstruct
public void init() {
billingSmsRecord = this;
}
@Override @Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) { public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingSmsRecord.billingSmsRecordService.listHomeStatistics(params); return billingSmsRecordService.listHomeStatistics(params);
} }
@Override @Override
public double getFee(Integer enterpriseId, Integer dateType) { public double getFee(Integer enterpriseId, Integer dateType) {
return billingSmsRecord.billingSmsRecordService.getFee(enterpriseId, dateType); return billingSmsRecordService.getFee(enterpriseId, dateType);
} }
} }
package com.gic.enterprise.utils.chart; package com.gic.enterprise.utils.chart;
import com.gic.enterprise.dto.HomeStatisticsDTO; import java.util.List;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingVoiceCodeRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import com.gic.enterprise.dto.HomeStatisticsDTO;
import java.util.List; import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingVoiceCodeRecordService;
/** /**
* 语音验证码消费明细 * 语音验证码消费明细
* @ClassName: BillingVoiceCodeRecord
 * @ClassName: BillingVoiceCodeRecord

...@@ -15,22 +15,17 @@ import java.util.List; ...@@ -15,22 +15,17 @@ import java.util.List;
* @author guojuxing
 * @author guojuxing

* @date 2019/8/23 2:21 PM
 * @date 2019/8/23 2:21 PM

*/ */
@Component @Component("billingVoiceCodeRecord")
public class BillingVoiceCodeRecord implements IFeeChart{ public class BillingVoiceCodeRecord implements IFeeChart{
@Autowired @Autowired
private BillingVoiceCodeRecordService billingVoiceCodeRecordService; private BillingVoiceCodeRecordService billingVoiceCodeRecordService;
private static BillingVoiceCodeRecord billingVoiceCodeRecord;
@PostConstruct
public void init() {
billingVoiceCodeRecord = this;
}
@Override @Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) { public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingVoiceCodeRecord.billingVoiceCodeRecordService.listHomeStatistics(params); return this.billingVoiceCodeRecordService.listHomeStatistics(params);
} }
@Override @Override
public double getFee(Integer enterpriseId, Integer dateType) { public double getFee(Integer enterpriseId, Integer dateType) {
return billingVoiceCodeRecord.billingVoiceCodeRecordService.getFee(enterpriseId, dateType); return this.billingVoiceCodeRecordService.getFee(enterpriseId, dateType);
} }
} }
...@@ -7,6 +7,7 @@ import java.util.Map; ...@@ -7,6 +7,7 @@ import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import com.gic.enterprise.utils.ApplicationContextUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.core.io.support.PropertiesLoaderUtils; import org.springframework.core.io.support.PropertiesLoaderUtils;
...@@ -36,7 +37,7 @@ public class ReadFeeChartConfig { ...@@ -36,7 +37,7 @@ public class ReadFeeChartConfig {
Set<Map.Entry<Object, Object>> entrySet = properties.entrySet(); Set<Map.Entry<Object, Object>> entrySet = properties.entrySet();
for (Map.Entry<Object, Object> entry : entrySet) { for (Map.Entry<Object, Object> entry : entrySet) {
map.put(Integer.parseInt((String) entry.getKey()), createClass((String) entry.getValue())); map.put(Integer.parseInt((String) entry.getKey()), ApplicationContextUtils.getBean((String) entry.getValue()));
} }
} catch (Exception e) { } catch (Exception e) {
LOGGER.warn("解析config/feechart.properties文件失败:{}", e.getMessage(), e); LOGGER.warn("解析config/feechart.properties文件失败:{}", e.getMessage(), e);
......
###计费中心首页图表 服务配置 ###计费中心首页图表 服务配置
7:com.gic.enterprise.utils.chart.BillingAccountBalanceRecord 7:billingAccountBalanceRecord
3:com.gic.enterprise.utils.chart.BillingSmsRecord 3:billingSmsRecord
4:com.gic.enterprise.utils.chart.BillingSmsPackageRecord 4:billingSmsPackageRecord
8:com.gic.enterprise.utils.chart.BillingInternationSmsRecord 8:billingInternationSmsRecord
\ No newline at end of file \ No newline at end of file
...@@ -232,5 +232,7 @@ ...@@ -232,5 +232,7 @@
or download_user_name like concat('%', #{search}, '%') or download_user_name like concat('%', #{search}, '%')
) )
</if> </if>
order by download_time desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
package com.gic.operation.web.controller; package com.gic.operation.web.controller;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.constant.EnterpriseInitCodeEnum; import com.gic.enterprise.constant.EnterpriseInitCodeEnum;
import com.gic.enterprise.dto.EnterpriseDTO; import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.EnterpriseInitDTO; import com.gic.enterprise.dto.EnterpriseInitDTO;
import com.gic.enterprise.response.EnterpriseRestResponse; import com.gic.enterprise.response.EnterpriseRestResponse;
import com.gic.enterprise.service.EnterpriseApiService; import com.gic.enterprise.service.EnterpriseApiService;
import com.gic.enterprise.service.EnterpriseInitApiService; import com.gic.enterprise.service.EnterpriseInitApiService;
import com.gic.enterprise.utils.UserDetailUtils; import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.marketing.api.dto.sms.EnterpriseSmsSignDTO; import com.gic.marketing.api.dto.sms.EnterpriseSmsSignDTO;
import com.gic.marketing.api.dto.sms.SmsApplicationDTO; import com.gic.marketing.api.dto.sms.SmsApplicationDTO;
import com.gic.operation.web.vo.EnterpriseSmsSignVO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.marketing.api.service.sms.SmsOuterApiService; import com.gic.marketing.api.service.sms.SmsOuterApiService;
import com.gic.operation.web.vo.EnterpriseSmsSignVO;
import com.gic.operation.web.vo.sms.SmsChannelVO;
import com.gic.operation.web.vo.sms.SmsTemplateVO;
import java.util.List;
/** /**
* *
* @ClassName: EnterpriseSmsController * @ClassName: EnterpriseSmsController
...@@ -43,11 +51,45 @@ public class EnterpriseSmsController { ...@@ -43,11 +51,45 @@ public class EnterpriseSmsController {
@Autowired @Autowired
private EnterpriseApiService enterpriseApiService; private EnterpriseApiService enterpriseApiService;
@InitBinder
public void initBinder(WebDataBinder binder) {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(true);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
@RequestMapping("/save-app") @RequestMapping("/save-app")
public RestResponse saveApp(Integer enterpriseId, String appid, String appkey) { public RestResponse saveApp(Integer enterpriseId, String appid, String appkey) {
return ResultControllerUtils.commonResult(smsOuterApiService.saveEnterpriseSmsApp(enterpriseId, appid, appkey)); return ResultControllerUtils.commonResult(smsOuterApiService.saveEnterpriseSmsApp(enterpriseId, appid, appkey));
} }
@RequestMapping("/list-sms-channel")
public RestResponse listSmsChannel() {
return ResultControllerUtils.commonResult(smsOuterApiService.listGicSmsChannel(), SmsChannelVO.class);
}
/**
* 设置优先使用配置
* @param enterpriseId
* @param channelType 短信通道类型(1:腾讯云, 2:大汉三通)
* @return
*/
@RequestMapping("/set-sms-use-default")
public RestResponse setUseFirstSmsApp(Integer enterpriseId, Integer channelType) {
return ResultControllerUtils.commonResult(smsOuterApiService.setUseFirstSmsApp(enterpriseId, channelType));
}
@RequestMapping("/get-sms-template-max-count")
public RestResponse getSmsTemplateMaxCount(Integer enterpriseId) {
return ResultControllerUtils.commonResult(smsOuterApiService.getSmsTempalteMaxCount(enterpriseId));
}
@RequestMapping("/get-sms-app-info")
public RestResponse getAllSmsAppInfoByEid(Integer enterpriseId) {
return ResultControllerUtils.commonResult(smsOuterApiService.getAllSmsAppInfoByEid(enterpriseId));
}
@Deprecated
@RequestMapping("/get-app") @RequestMapping("/get-app")
public RestResponse getApp(Integer enterpriseId) { public RestResponse getApp(Integer enterpriseId) {
return ResultControllerUtils.commonResult(smsOuterApiService.getEnterpriseSmsApp(enterpriseId)); return ResultControllerUtils.commonResult(smsOuterApiService.getEnterpriseSmsApp(enterpriseId));
...@@ -64,17 +106,13 @@ public class EnterpriseSmsController { ...@@ -64,17 +106,13 @@ public class EnterpriseSmsController {
* @Description: * @Description:

 * @author guojuxing 
 * @author guojuxing
* @param enterpriseId * @param enterpriseId
* @param smsSignId 短信签名id * @param tencentSignId 腾讯云短信签名id
* @param smsSignText 短信签名 * @param smsSignText 短信签名
* @param useType
 签名用途 1: 国内短信; 2: 海外短信
* @return com.gic.commons.webapi.reponse.RestResponse
 * @return com.gic.commons.webapi.reponse.RestResponse


 */ 
 */
@RequestMapping("/add-sms") @RequestMapping("/add-sms")
public RestResponse addSms(Integer enterpriseId, String smsSignId, String smsSignText, Integer useType) { public RestResponse addSms(Integer enterpriseId, String tencentSignId, String smsSignText) {
//写死,没有业务,无用。 ServiceResponse<Void> smsResult = smsOuterApiService.saveEnterpriseSmsSign(enterpriseId, tencentSignId, smsSignText);
useType = 1;
ServiceResponse<Void> smsResult = smsOuterApiService.saveEnterpriseSmsSign(enterpriseId, smsSignId, smsSignText,
useType);
if (smsResult.isSuccess()) { if (smsResult.isSuccess()) {
//新增之前判断是否已经初始化完毕 //新增之前判断是否已经初始化完毕
ServiceResponse<EnterpriseInitDTO> result = enterpriseInitApiService ServiceResponse<EnterpriseInitDTO> result = enterpriseInitApiService
...@@ -99,11 +137,9 @@ public class EnterpriseSmsController { ...@@ -99,11 +137,9 @@ public class EnterpriseSmsController {
} }
@RequestMapping("/edit-sms") @RequestMapping("/edit-sms")
public RestResponse editSms(Long signId, String smsSignId, String smsSignText, Integer useType, Integer enterpriseId) { public RestResponse editSms(Integer enterpriseId, Long signId, String tencentSignId, String smsSignText) {
//写死,没有业务,无用。
useType = 1;
return ResultControllerUtils return ResultControllerUtils
.commonResult(smsOuterApiService.editEnterpriseSmsSign(enterpriseId, signId, smsSignId, smsSignText, useType)); .commonResult(smsOuterApiService.editEnterpriseSmsSign(enterpriseId, signId, tencentSignId, smsSignText));
} }
@RequestMapping("/delete-sms") @RequestMapping("/delete-sms")
...@@ -133,6 +169,66 @@ public class EnterpriseSmsController { ...@@ -133,6 +169,66 @@ public class EnterpriseSmsController {
return EnterpriseRestResponse.failure(smsResult); return EnterpriseRestResponse.failure(smsResult);
} }
/**
*
* @param enterpriseId
* @param channelType 短信通道类型(1:腾讯云, 2:大汉三通)
* @param search 模板名称/ID
* @param type 类型: 0普通 1营销
* @param beginTime
* @param endTime
* @param page
* @return
*/
@RequestMapping("/list-sms-channel-template")
public RestResponse channelSmsTemplatePage(Integer enterpriseId, Integer channelType,
String search, Integer type, Date beginTime, Date endTime,
Page<Void> page) {
if (channelType == null) {
//默认腾讯云通道
channelType = 1;
}
return ResultControllerUtils
.commonPageResult(smsOuterApiService.channelSmsTemplatePage(enterpriseId, channelType, search, type, beginTime, endTime, page), SmsTemplateVO.class);
}
@RequestMapping("/get-sms-channel-template-number")
public RestResponse countTemplateByChannel(Integer enterpriseId, Integer channelType) {
if (channelType == null) {
//默认腾讯云通道
channelType = 1;
}
return ResultControllerUtils
.commonResult(smsOuterApiService.countTemplateByChannel(enterpriseId, channelType));
}
@RequestMapping("/sync-sms-channel-template")
public RestResponse checkTemplateStatus(Integer enterpriseId, Integer channelType, boolean checkAll,
Long channelTemplateId) {
if (channelType == null) {
//默认腾讯云通道
channelType = 1;
}
return ResultControllerUtils
.commonResult(smsOuterApiService.checkTemplateStatus(enterpriseId, channelType, checkAll, channelTemplateId));
}
@RequestMapping("/init-sms-channel-template")
public RestResponse initAddChannelTemplate(Integer enterpriseId, Integer channelType) {
if (channelType == null) {
//默认腾讯云通道
channelType = 1;
}
ServiceResponse<Integer> result = smsOuterApiService.initAddChannelTemplate(enterpriseId, channelType);
if (result.isSuccess()) {
return RestResponse.success();
}
RestResponse response = RestResponse.failure(result.getCode(), result.getMessage());
response.setResult(result.getResult());
return response;
}
/** /**
* 是否符合短信业务配置条件 * 是否符合短信业务配置条件
* @param enterpriseId * @param enterpriseId
......
...@@ -15,87 +15,84 @@ import java.util.Date; ...@@ -15,87 +15,84 @@ import java.util.Date;
public class EnterpriseSmsSignVO implements Serializable{ public class EnterpriseSmsSignVO implements Serializable{
private static final long serialVersionUID = -4600331112299383689L; private static final long serialVersionUID = -4600331112299383689L;
/**
* 短信签名主键id
*/
@JsonFormat(shape = JsonFormat.Shape.STRING) @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long signId; private Long signId;
/**
* 企业主键id
*/
private Integer enterpriseId; private Integer enterpriseId;
private String smsSignId;
/**
* 短信签名
*/
private String smsSignText; private String smsSignText;
private String smsAppid;
private Integer useType; /**
private Date createTime; * 腾讯云短信签名id
private Date updateTime; */
private Integer deleteFlag; private String tencentSignId;
/**是否勾选了腾讯云签名**/
private Integer tencentUseFlag;
/**是否勾选了大汉三通签名**/
private Integer dhstUseFlag;
public Long getSignId() { public Long getSignId() {
return signId; return signId;
} }
public void setSignId(Long signId) { public EnterpriseSmsSignVO setSignId(Long signId) {
this.signId = signId; this.signId = signId;
return this;
} }
public Integer getEnterpriseId() { public Integer getEnterpriseId() {
return enterpriseId; return enterpriseId;
} }
public void setEnterpriseId(Integer enterpriseId) { public EnterpriseSmsSignVO setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId; this.enterpriseId = enterpriseId;
} return this;
public String getSmsSignId() {
return smsSignId;
}
public void setSmsSignId(String smsSignId) {
this.smsSignId = smsSignId;
} }
public String getSmsSignText() { public String getSmsSignText() {
return smsSignText; return smsSignText;
} }
public void setSmsSignText(String smsSignText) { public EnterpriseSmsSignVO setSmsSignText(String smsSignText) {
this.smsSignText = smsSignText; this.smsSignText = smsSignText;
return this;
} }
public String getSmsAppid() { public String getTencentSignId() {
return smsAppid; return tencentSignId;
}
public void setSmsAppid(String smsAppid) {
this.smsAppid = smsAppid;
}
public Integer getUseType() {
return useType;
}
public void setUseType(Integer useType) {
this.useType = useType;
}
public Date getCreateTime() {
return createTime;
} }
public void setCreateTime(Date createTime) { public EnterpriseSmsSignVO setTencentSignId(String tencentSignId) {
this.createTime = createTime; this.tencentSignId = tencentSignId;
return this;
} }
public Date getUpdateTime() { public Integer getTencentUseFlag() {
return updateTime; return tencentUseFlag;
} }
public void setUpdateTime(Date updateTime) { public EnterpriseSmsSignVO setTencentUseFlag(Integer tencentUseFlag) {
this.updateTime = updateTime; this.tencentUseFlag = tencentUseFlag;
return this;
} }
public Integer getDeleteFlag() { public Integer getDhstUseFlag() {
return deleteFlag; return dhstUseFlag;
} }
public void setDeleteFlag(Integer deleteFlag) { public EnterpriseSmsSignVO setDhstUseFlag(Integer dhstUseFlag) {
this.deleteFlag = deleteFlag; this.dhstUseFlag = dhstUseFlag;
return this;
} }
@Override @Override
...@@ -103,13 +100,10 @@ public class EnterpriseSmsSignVO implements Serializable{ ...@@ -103,13 +100,10 @@ public class EnterpriseSmsSignVO implements Serializable{
return "EnterpriseSmsSignVO{" + return "EnterpriseSmsSignVO{" +
"signId=" + signId + "signId=" + signId +
", enterpriseId=" + enterpriseId + ", enterpriseId=" + enterpriseId +
", smsSignId='" + smsSignId + '\'' +
", smsSignText='" + smsSignText + '\'' + ", smsSignText='" + smsSignText + '\'' +
", smsAppid='" + smsAppid + '\'' + ", tencentSignId='" + tencentSignId + '\'' +
", useType=" + useType + ", tencentUseFlag=" + tencentUseFlag +
", createTime=" + createTime + ", dhstUseFlag=" + dhstUseFlag +
", updateTime=" + updateTime +
", deleteFlag=" + deleteFlag +
'}'; '}';
} }
} }
package com.gic.operation.web.vo.sms;
import java.io.Serializable;
/**
* 短信通道
* @ClassName: SmsChannelVO

* @Description: 

* @author guojuxing

* @date 2020/11/10 1:42 PM

*/
public class SmsChannelVO implements Serializable{
private static final long serialVersionUID = -2927365477049477598L;
/**
* 短信通道类型(1:腾讯云, 2:大汉三通)
*/
private Integer channelType;
/**
* 短信通道类型名称
*/
private String channelName;
public Integer getChannelType() {
return channelType;
}
public SmsChannelVO setChannelType(Integer channelType) {
this.channelType = channelType;
return this;
}
public String getChannelName() {
return channelName;
}
public SmsChannelVO setChannelName(String channelName) {
this.channelName = channelName;
return this;
}
@Override
public String toString() {
return "SmsChannelVO{" +
"channelType=" + channelType +
", channelName='" + channelName + '\'' +
'}';
}
}
package com.gic.operation.web.vo.sms;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
* 短信通道模板列表
* @ClassName: SmsTemplateVO

* @Description: 

* @author guojuxing

* @date 2020/11/12 10:49 AM

*/
public class SmsTemplateVO implements Serializable{
private static final long serialVersionUID = -4271435356220392959L;
/**
* 0普通 1营销
*/
private Integer type;
/**
* 模板名称
*/
private String name;
/**
* 模板内容 (变量)
*/
private String content;
/**
* 模板内容 ({1}转化为 {会员名称})
*/
private String contentDesc;
private Date createTime;
private Date updateTime;
private Long creatorId;
private String creatorName;
/** 状态:0:已通过;1:待审核;2:已拒绝 */
private Integer status;
/** 渠道短信id **/
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long channelTemplateId;
/**短信通道类型(1:腾讯云, 2:大汉三通)*/
private Integer channelType;
/**第三方运营商模板id*/
private String templateId;
public Integer getType() {
return type;
}
public SmsTemplateVO setType(Integer type) {
this.type = type;
return this;
}
public String getName() {
return name;
}
public SmsTemplateVO setName(String name) {
this.name = name;
return this;
}
public String getContent() {
return content;
}
public SmsTemplateVO setContent(String content) {
this.content = content;
return this;
}
public String getContentDesc() {
return contentDesc;
}
public SmsTemplateVO setContentDesc(String contentDesc) {
this.contentDesc = contentDesc;
return this;
}
public Date getCreateTime() {
return createTime;
}
public SmsTemplateVO setCreateTime(Date createTime) {
this.createTime = createTime;
return this;
}
public Date getUpdateTime() {
return updateTime;
}
public SmsTemplateVO setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
return this;
}
public Long getCreatorId() {
return creatorId;
}
public SmsTemplateVO setCreatorId(Long creatorId) {
this.creatorId = creatorId;
return this;
}
public String getCreatorName() {
return creatorName;
}
public SmsTemplateVO setCreatorName(String creatorName) {
this.creatorName = creatorName;
return this;
}
public Integer getStatus() {
return status;
}
public SmsTemplateVO setStatus(Integer status) {
this.status = status;
return this;
}
public Long getChannelTemplateId() {
return channelTemplateId;
}
public SmsTemplateVO setChannelTemplateId(Long channelTemplateId) {
this.channelTemplateId = channelTemplateId;
return this;
}
public Integer getChannelType() {
return channelType;
}
public SmsTemplateVO setChannelType(Integer channelType) {
this.channelType = channelType;
return this;
}
public String getTemplateId() {
return templateId;
}
public SmsTemplateVO setTemplateId(String templateId) {
this.templateId = templateId;
return this;
}
@Override
public String toString() {
return "SmsTemplateVO{" +
"type=" + type +
", name='" + name + '\'' +
", content='" + content + '\'' +
", contentDesc='" + contentDesc + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
", creatorId=" + creatorId +
", creatorName='" + creatorName + '\'' +
", status=" + status +
", channelTemplateId=" + channelTemplateId +
", channelType=" + channelType +
", templateId='" + templateId + '\'' +
'}';
}
}
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