Commit 400cca1a by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer

 Conflicts:
	gic-platform-enterprise-web/src/main/resources/dubbo-gic-platform-enterprise-web.xml
parents 7433a5c3 1ef70e04
......@@ -59,14 +59,9 @@ public interface Constants {
*/
String TODO_ITEM_AUDIT = "audit";
/**
* 账户余额不足
* 产品通知
*/
String TODO_ITEM_ACCOUNT_BALANCE = "account_balance";
/**
* 门店分组
*/
String TODO_ITEM_STORE_GROUP = "store_group";
String PRODUCT = "product";
// -----------------------待办事项跳转url-------------------------------
/**
......
package com.gic.enterprise.dto;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
......@@ -14,9 +12,6 @@ import java.util.Date;
public class ProjectItemDTO implements Serializable {
private static final long serialVersionUID = -394928332987419164L;
public interface SaveValid{
}
/**
*
......@@ -26,36 +21,30 @@ public class ProjectItemDTO implements Serializable {
/**
* 审批项名称
*/
@NotBlank(message = "审批项名称不能为空", groups = SaveValid.class)
private String projectItemName;
/**
* 审批项code
*/
@NotBlank(message = "审批项code不能为空", groups = SaveValid.class)
private String projectItemCode;
/**
* 审批项描述
*/
@NotBlank(message = "审批项描述不能为空", groups = SaveValid.class)
private String projectItemDesc;
/**
* 项目id
*/
@NotNull(message = "项目id不能为空", groups = SaveValid.class)
private Integer projectId;
/**
* 回调地址
*/
@NotBlank(message = "回调地址不能为空", groups = SaveValid.class)
private String callbackUrl;
/**
* 使用状态 1:可用 0:禁用
*/
@NotNull(message = "使用状态不能为空", groups = SaveValid.class)
private Integer useStatus;
/**
......@@ -68,19 +57,16 @@ public class ProjectItemDTO implements Serializable {
*/
private Date updateTime;
@NotBlank(message = "是否为平台项目不能为空", groups = SaveValid.class)
private Integer isPlatform;
/**
* 审核截止时长 单位:天
*/
@NotNull(message = "审核截止时间不能为空", groups = SaveValid.class)
private Integer auditExpireDuration;
/**
* 审批模板类型 0:普通审批项, 1:风险模式审批, 2:导出完整数据
*/
@NotNull(message = "审批模板类型不能为空", groups = SaveValid.class)
private Integer auditTemplateType;
public Integer getProjectItemId() {
......
......@@ -106,7 +106,7 @@ public class SmsRecordDTO implements Serializable {
/**
* 会员ecuId
*/
@NotNull(message = "会员ecuId不能为空", groups = SmsRecordValid.class)
// @NotNull(message = "会员ecuId不能为空", groups = SmsRecordValid.class)
private Long ecuId;
/**
......
package com.gic.enterprise.qo;
import java.util.List;
/**
*
* @Description:
......@@ -18,6 +20,7 @@ public class AppletServiceConfigQO extends PageQO {
private Integer type;
private Integer pageNum;
private String orderBy;
private List<Long> appIdList;
public Integer getSortColumn() {
return sortColumn;
......@@ -74,4 +77,12 @@ public class AppletServiceConfigQO extends PageQO {
public String getOrderBy() {
return orderBy;
}
public List<Long> getAppIdList() {
return appIdList;
}
public void setConfigIdList(List<Long> appIdList) {
this.appIdList = appIdList;
}
}
package com.gic.enterprise.qo;
import com.gic.enterprise.dto.ProjectItemDTO;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
......@@ -17,80 +12,49 @@ public class ProjectItemQO extends PageQO {
private static final long serialVersionUID = 1218293562538399805L;
public interface SaveValid{
}
public interface DelValid{
}
public interface ListValid{
}
/**
*
*/
@NotNull(message = "审批项id不能为空", groups = {DelValid.class})
private Integer projectItemId;
/**
* 审批项名称
*/
@org.hibernate.validator.constraints.NotBlank(message = "审批项名称不能为空", groups = {SaveValid.class})
private String projectItemName;
@NotBlank(message = "审批项code不能为空", groups = ProjectItemDTO.SaveValid.class)
private String projectItemCode;
/**
* 审批项描述
*/
@org.hibernate.validator.constraints.NotBlank(message = "审批项描述不能为空", groups = {SaveValid.class})
private String projectItemDesc;
/**
* 项目id
*/
@NotNull(message = "项目id不能为空", groups = {SaveValid.class, ListValid.class})
private Integer projectId;
/**
* 回调地址
*/
@org.hibernate.validator.constraints.NotBlank(message = "回调地址不能为空", groups = {SaveValid.class})
private String callbackUrl;
/**
* 使用状态 1:可用 0:禁用
*/
@NotNull(message = "使用状态不能为空", groups = {SaveValid.class})
private Integer useStatus;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
private String search;
@NotBlank(message = "是否为平台项目不能为空", groups = ProjectItemDTO.SaveValid.class)
private Integer isPlatform;
/**
* 审核截止时长 单位:天
*/
@NotNull(message = "审核截止时间不能为空", groups = ProjectItemDTO.SaveValid.class)
private Integer auditExpireDuration;
/**
* 审批模板类型 0:普通审批项, 1:风险模式审批, 2:导出完整数据
*/
@NotNull(message = "审批模板类型不能为空", groups = ProjectItemDTO.SaveValid.class)
private Integer auditTemplateType;
private List<Integer> projectItemList;
......@@ -151,22 +115,6 @@ public class ProjectItemQO extends PageQO {
this.useStatus = useStatus;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getSearch() {
return search;
}
......
......@@ -12,13 +12,7 @@ import javax.validation.constraints.NotNull;
public class ProjectQO extends PageQO {
private static final long serialVersionUID = -3584081588337122486L;
public interface SaveValid {}
public interface DelValid {}
@NotNull(message = "项目id不能为空", groups = DelValid.class)
private Integer projectId;
@org.hibernate.validator.constraints.NotBlank(message = "项目名称不能为空", groups = SaveValid.class)
private String projectName;
public Integer getProjectId() {
......
......@@ -34,6 +34,11 @@ public class TabAppletServiceConfig {
/**
*
*/
private Long configId;
/**
*
*/
private Date createTime;
/**
......@@ -86,6 +91,14 @@ public class TabAppletServiceConfig {
this.type = type;
}
public Long getConfigId() {
return configId;
}
public void setConfigId(Long configId) {
this.configId = configId;
}
public Date getCreateTime() {
return createTime;
}
......
......@@ -51,7 +51,7 @@ public class BillingAccountServiceImpl implements BillingAccountService{
double newTotal = new BigDecimal(tabBillingAccount.getAccountBalance().toString()).add(new BigDecimal(totalFee + "")).doubleValue();
logger.info("商户:{}, 充值/退款前余额:{}, 充值/退款金额:{}, 充值/退款后余额:{}", enterpriseId, tabBillingAccount.getAccountBalance(), totalFee, newTotal);
UserDTO user = userApiService.getUserByEnterpriseId(enterpriseId).getResult();
todoItemService.finishTodoItem(enterpriseId, user.getUserId(), Constants.TODO_ITEM_ACCOUNT_BALANCE, Constants.TODO_ITEM_ACCOUNT_BALANCE_URL);
todoItemService.finishTodoItem(enterpriseId, user.getUserId(), Constants.PRODUCT, Constants.TODO_ITEM_ACCOUNT_BALANCE_URL);
return tabBillingAccountMapper.updateAccountAfterRechargeOrRefund(totalFee, enterpriseId);
}
......
......@@ -77,7 +77,11 @@ public class BillingEnterpriseSmsPackageServiceImpl implements BillingEnterprise
RedisUtil.lock(Constants.ENTERPRISE_BILLING_SMS_PACKAGE_COUNT_LOCK + enterpriseId, 30L);
logger.info("redis中没有套餐包 查询数据库:{}", enterpriseId);
Integer totalSms = tabBillingEnterpriseSmsPackageMapper.getTotalSmsInPackageByEnterpriseId(enterpriseId);
smsCountR.set(totalSms);
if (totalSms != null) {
smsCountR.set(totalSms);
} else {
smsCountR.set(0);
}
RedisUtil.unlock(Constants.ENTERPRISE_BILLING_SMS_PACKAGE_COUNT_LOCK + enterpriseId);
}
return smsCountR;
......
......@@ -95,6 +95,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
if (projectItem == null) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
auditLogDTO.setProjectItemId(projectItem.getProjectItemId());
auditLogDTO.setProjectItemName(projectItem.getProjectItemName());
// 判断申请人是否存在
......@@ -104,21 +105,29 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
}
auditLogDTO.setApplyUserName(userServiceResponse.getResult().getUserName());
auditLogDTO.setApplyUserPhone(userServiceResponse.getResult().getPhoneNumber());
// 判断有没有审核员, 没有审核员就返回错误
// 如果审批项是被禁用的 直接通过
if (projectItem.getUseStatus() == 0 || userServiceResponse.getResult().getSuperAdmin() == 1) {
String extraInfo = auditLogDTO.getExtraInfo();
JSONObject jsonObject = JSON.parseObject(extraInfo);
jsonObject.put("auditResult", DataSecurityAuditEnum.PASS.getCode());
String[] callback = projectItem.getCallbackUrl().split(GlobalInfo.FLAG_COMMA);
AsyncCallbackUtils.callBack(jsonObject, callback[0], callback[1]);
return EnterpriseServiceResponse.success();
}
// 判断有没有审核员, 没有审核员就返回错误
ServiceResponse<List<AuditorDTO>> auditorResponse = auditorApiService.listAuditorByProject(auditLogDTO.getProjectItemId(), auditLogDTO.getApplyUserId(), auditLogDTO.getEnterpriseId());
List<AuditorDTO> auditorList = Collections.emptyList();
if (userServiceResponse.getResult().getSuperAdmin() == 0) {
// 普通管理员需要判断是否有审核员
if (!auditorResponse.isSuccess()) {
return EnterpriseServiceResponse.failure(auditorResponse.getCode(), auditorResponse.getMessage());
}
auditorList = auditorResponse.getResult();
List<AuditorDTO> openidList = auditorList.stream().filter(e -> StringUtils.isNotBlank(e.getOpenid())).collect(Collectors.toList());
List<AuditorDTO> userIdList = auditorList.stream().filter(e -> e.getUserId() != null).collect(Collectors.toList());
if (CollectionUtils.isEmpty(openidList) && CollectionUtils.isEmpty(userIdList)) {
return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "审核员没有绑定微信或管理员");
}
// 普通管理员需要判断是否有审核员
if (!auditorResponse.isSuccess()) {
return EnterpriseServiceResponse.failure(auditorResponse.getCode(), auditorResponse.getMessage());
}
auditorList = auditorResponse.getResult();
List<AuditorDTO> openidList = auditorList.stream().filter(e -> StringUtils.isNotBlank(e.getOpenid())).collect(Collectors.toList());
List<AuditorDTO> userIdList = auditorList.stream().filter(e -> e.getUserId() != null).collect(Collectors.toList());
if (CollectionUtils.isEmpty(openidList) && CollectionUtils.isEmpty(userIdList)) {
return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "审核员没有绑定微信或管理员");
}
// 判断审批项是否禁用
if (Constants.DEL_STATUS.equals(projectItem.getUseStatus())) {
......@@ -174,20 +183,20 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
// sendWxMessage();
}
// 如果申请人是超管 自动审批
if (userServiceResponse.getResult().getSuperAdmin() == 1) {
AuditLogDTO autoAudit = new AuditLogDTO();
autoAudit.setEnterpriseId(auditLogDTO.getEnterpriseId());
autoAudit.setApplyUserId(auditLogDTO.getApplyUserId());
autoAudit.setAuditorId(auditLogDTO.getApplyUserId());
autoAudit.setAuditResult(DataSecurityAuditEnum.PASS.getCode());
autoAudit.setAuditorPhone(auditLogDTO.getApplyUserPhone());
autoAudit.setAuditorName(auditLogDTO.getAuditorName());
autoAudit.setAuditLogId(auditLogId);
autoAudit.setAuditReason("自动审批");
this.audit(autoAudit);
}
// // 如果申请人是超管 自动审批
// if (userServiceResponse.getResult().getSuperAdmin() == 1) {
// AuditLogDTO autoAudit = new AuditLogDTO();
// autoAudit.setEnterpriseId(auditLogDTO.getEnterpriseId());
// autoAudit.setApplyUserId(auditLogDTO.getApplyUserId());
// autoAudit.setAuditorId(auditLogDTO.getApplyUserId());
// autoAudit.setAuditResult(DataSecurityAuditEnum.PASS.getCode());
// autoAudit.setAuditorPhone(auditLogDTO.getApplyUserPhone());
// autoAudit.setAuditorName(auditLogDTO.getAuditorName());
// autoAudit.setAuditLogId(auditLogId);
// autoAudit.setAuditReason("自动审批");
// this.audit(autoAudit);
//
// }
return EnterpriseServiceResponse.success();
......@@ -335,7 +344,7 @@ public class AuditLogApiServiceImpl implements AuditLogApiService {
String position = userTypeEnum != null ? userTypeEnum.getMessage() : "";
String[] keyWord = {enterprise.getEnterpriseName(), auditorDTO.getAuditorName(), position, auditLogDTO.getProjectItemName()};
// todo 跳转地址
this.wxTemplateRouterApiService.sendForDownloadData(auditorDTO.getOpenid(), null, keyWord);
this.wxTemplateRouterApiService.sendForDownloadData(auditorDTO.getOpenid(), String.format("/wechat-approve.html?auditLogId=%d&openid=%s", auditLogDTO.getAuditLogId(), auditorDTO.getOpenid()), keyWord);
}
}
......@@ -15,7 +15,6 @@ import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.enterprise.service.*;
import com.gic.redis.data.util.RedisUtil;
import org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -233,7 +232,7 @@ public class BillingAccountApiServiceImpl implements BillingAccountApiService {
// 事项详情
todoItemDTO.setItemContent("您的GIC商户余额已欠费");
// 事项code 在运维后台字典配置 类目:待办事项类型
todoItemDTO.setItemType(Constants.TODO_ITEM_ACCOUNT_BALANCE);
todoItemDTO.setItemType(Constants.PRODUCT);
// 跳转地址 待办事项点击后要跳转的地址
todoItemDTO.setItemInfoUrl(Constants.TODO_ITEM_ACCOUNT_BALANCE_URL);
todoItemApiService.saveTodoItem(todoItemDTO);
......
......@@ -90,7 +90,7 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
Integer unitFee = accountStandardService.queryUnitFee(enterpriseId, AccountStandardEnum.SMS.getCode());
double needFee = (double) (missCount * unitFee) / 1000;
if (needFee - accountBalance > 5000d) {
if (needFee - accountBalance > billingAccount.getCreditLine()) {
logger.info("enterpriseId:{}, 余额:{}, 发送条数:{}, 不能发送", enterpriseId, accountBalance, sendCount);
return EnterpriseServiceResponse.failure(ErrorCode.OPERATION_FAILED.getCode(), "余额不足, 不能发送");
} else {
......@@ -101,6 +101,7 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
@Override
public ServiceResponse<Void> saveSmsRecord(SmsRecordDTO smsRecordDTO) {
logger.info("收到国内短信计费信息:{}", JSON.toJSONString(smsRecordDTO));
if (StringUtils.isBlank(smsRecordDTO.getNationCode())) {
smsRecordDTO.setNationCode("+86");
}
......@@ -115,12 +116,13 @@ public class SmsRecordApiServiceImpl implements SmsRecordApiService {
if (StringUtils.equals("86", smsRecordDTO.getNationCode()) || StringUtils.equals("+86", smsRecordDTO.getNationCode())) {
ServiceResponse paramResult = ValidUtil.allCheckValidate(smsRecordDTO, SmsRecordDTO.SmsRecordValid.class);
if (!paramResult.isSuccess()) {
logger.info("短信验证不通过:{}", paramResult.getMessage());
return paramResult;
}
GicMQClient client = GICMQClientUtil.getClientInstance();
try {
String json = JSON.toJSONString(smsRecordDTO);
logger.info("收到国内短信计费信息:{}", json);
// logger.info("收到国内短信计费信息:{}", json);
client.sendMessage("smsMq", json);
// this.run(json);
} catch (Exception e) {
......
package com.gic.enterprise.utils.chart;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.gic.enterprise.dto.HomeStatisticsDTO;
import com.gic.enterprise.qo.HomeStatisticsQO;
import com.gic.enterprise.service.BillingInternationalSmsRecordService;
/**
* 余额支付消费明细
* @ClassName: BillingAccountBalanceRecord

* @Description: 

* @author guojuxing

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

*/
@Component
public class BillingInternationSmsRecord implements IFeeChart{
@Autowired
private BillingInternationalSmsRecordService billingInternationalSmsRecordService;
private static BillingInternationSmsRecord billingInternationSmsRecord;
@PostConstruct
public void init() {
billingInternationSmsRecord = this;
}
@Override
public List<HomeStatisticsDTO> listHomeStatistics(HomeStatisticsQO params) {
return billingInternationSmsRecord.billingInternationalSmsRecordService.listHomeStatistics(params);
}
@Override
public double getFee(Integer enterpriseId, Integer dateType) {
return billingInternationSmsRecord.billingInternationalSmsRecordService.getFee(enterpriseId, dateType);
}
}
......@@ -24,6 +24,7 @@ public class FeeChartUtils {
// getPageMap.put(FeeTypeEnum.RECORDING_STORAGE.getCode(), new BillingRecordingStorageRecord());
getPageMap.put(FeeTypeEnum.SMS.getCode(), new BillingSmsRecord());
getPageMap.put(FeeTypeEnum.SMS_PACKAGE.getCode(), new BillingSmsPackageRecord());
getPageMap.put(FeeTypeEnum.INTERNATIONAL_SMS.getCode(), new BillingInternationSmsRecord());
// getPageMap.put(FeeTypeEnum.VOICE_CODE.getCode(), new BillingVoiceCodeRecord());
}
......
......@@ -7,12 +7,14 @@
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="config_id" jdbcType="BIGINT" property="configId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="status" jdbcType="INTEGER" property="status" />
</resultMap>
<sql id="Base_Column_List">
applet_service_id, enterprise_id, app_id, name, type, create_time, update_time, status
applet_service_id, enterprise_id, app_id, name, type, config_id, create_time, update_time,
status
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -26,11 +28,13 @@
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabAppletServiceConfig">
insert into tab_applet_service_config (applet_service_id, enterprise_id, app_id,
name, type, create_time,
update_time, status)
name, type, config_id,
create_time, update_time, status
)
values (#{appletServiceId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{appId,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER})
#{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{configId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabAppletServiceConfig">
insert into tab_applet_service_config
......@@ -50,6 +54,9 @@
<if test="type != null">
type,
</if>
<if test="configId != null">
config_id,
</if>
<if test="createTime != null">
create_time,
</if>
......@@ -76,6 +83,9 @@
<if test="type != null">
#{type,jdbcType=INTEGER},
</if>
<if test="configId != null">
#{configId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -102,6 +112,9 @@
<if test="type != null">
type = #{type,jdbcType=INTEGER},
</if>
<if test="configId != null">
config_id = #{configId,jdbcType=BIGINT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
......@@ -120,6 +133,7 @@
app_id = #{appId,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=INTEGER},
config_id = #{configId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
status = #{status,jdbcType=INTEGER}
......@@ -156,6 +170,12 @@
<if test="search != null and search != '' ">
and name like concat('%', #{search}, '%')
</if>
<if test="null != configId and configId.size &gt; 0">
and config_id in
<foreach close=")" collection="configId" index="index" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="getAppByAppId" resultMap="BaseResultMap">
select
......
......@@ -2,6 +2,8 @@ package com.gic.enterprise.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.ChannelResourceDTO;
import com.gic.auth.service.ResourceApiService;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.log.LogUtils;
import com.gic.enterprise.constant.applet.AppletServiceConfigEnum;
......@@ -10,6 +12,7 @@ import com.gic.enterprise.qo.AppletServiceConfigQO;
import com.gic.enterprise.service.AppletServiceConfigApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.utils.UserDetailUtils;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -25,15 +28,27 @@ public class AppletServiceConfigController {
@Autowired
private AppletServiceConfigApiService appletServiceConfigApiService;
@Autowired
private ResourceApiService resourceApiService;
@RequestMapping("list-applet")
public RestResponse listApplet(AppletServiceConfigQO appletServiceConfigQO) {
ChannelResourceDTO channelResourceDTO = resourceApiService.getChannelResourceByUserId(UserDetailUtils.getUserDetail().getUserId()).getResult();
if (channelResourceDTO == null || CollectionUtils.isEmpty(channelResourceDTO.getAppletConfigIdList())) {
return RestResponse.success(new Page<>());
}
appletServiceConfigQO.setConfigIdList(channelResourceDTO.getAppletConfigIdList());
ServiceResponse<Page<AppletServiceConfigDTO>> serviceResponse = appletServiceConfigApiService.listApplet(UserDetailUtils.getUserDetail().getEnterpriseId(), appletServiceConfigQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("list-service")
public RestResponse listService(AppletServiceConfigQO appletServiceConfigQO) {
ChannelResourceDTO channelResourceDTO = resourceApiService.getChannelResourceByUserId(UserDetailUtils.getUserDetail().getUserId()).getResult();
if (channelResourceDTO == null || CollectionUtils.isEmpty(channelResourceDTO.getServiceConfigIdList())) {
return RestResponse.success(new Page<>());
}
appletServiceConfigQO.setConfigIdList(channelResourceDTO.getAppletConfigIdList());
ServiceResponse<Page<AppletServiceConfigDTO>> serviceResponse = appletServiceConfigApiService.listService(UserDetailUtils.getUserDetail().getEnterpriseId(), appletServiceConfigQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
......
......@@ -121,4 +121,5 @@
<dubbo:reference interface="com.gic.mall.share.api.service.ShopApiService" id="shopApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.mall.api.service.MallActivityThemeApiService" id="mallActivityThemeApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.data.api.service.StoreStatisicsApiService" id="storeStatisicsApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.auth.service.ResourceApiService" id="resourceApiService" timeout="6000"/>
</beans>
......@@ -64,7 +64,9 @@ public class EnterpriseSmsController {
* @return com.gic.commons.webapi.reponse.RestResponse


 */
@RequestMapping("/add-sms")
public RestResponse addSms(Integer enterpriseId, String smsSignId, String smsSignText, int useType) {
public RestResponse addSms(Integer enterpriseId, String smsSignId, String smsSignText, Integer useType) {
//写死,没有业务,无用。
useType = 1;
ServiceResponse<Void> smsResult = smsOuterApiService.saveEnterpriseSmsSign(enterpriseId, smsSignId, smsSignText,
useType);
if (smsResult.isSuccess()) {
......@@ -91,7 +93,9 @@ public class EnterpriseSmsController {
}
@RequestMapping("/edit-sms")
public RestResponse editSms(Long signId, String smsSignId, String smsSignText, int useType, Integer enterpriseId) {
public RestResponse editSms(Long signId, String smsSignId, String smsSignText, Integer useType, Integer enterpriseId) {
//写死,没有业务,无用。
useType = 1;
return ResultControllerUtils
.commonResult(smsOuterApiService.editEnterpriseSmsSign(enterpriseId, signId, smsSignId, smsSignText, useType));
}
......@@ -147,19 +151,9 @@ public class EnterpriseSmsController {
Page<EnterpriseSmsSignDTO> page1 = result.getResult();
if (page1 != null) {
List<EnterpriseSmsSignDTO> list = page1.getResult();
int chinaCount = 0;
int foreignCount = 0;
if (CollectionUtils.isNotEmpty(list)) {
for (EnterpriseSmsSignDTO dto : list) {
if (dto.getUseType().intValue() == 1) {
chinaCount = chinaCount + 1;
} else if (dto.getUseType().intValue() == 2) {
foreignCount = foreignCount + 1;
}
if (chinaCount > 0 && foreignCount > 0) {
return true;
}
}
//有一条数据就符合条件
return true;
}
}
}
......
package com.gic.operation.web.controller;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.ProjectDTO;
import com.gic.enterprise.qo.PageQO;
import com.gic.enterprise.qo.ProjectQO;
import com.gic.enterprise.service.ProjectApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -28,14 +25,14 @@ public class ProjectController {
private ProjectApiService projectApiService;
@RequestMapping("/save-project")
public RestResponse saveOrUpdateProject(@Validated(ProjectQO.SaveValid.class) ProjectQO projectQO) {
public RestResponse saveOrUpdateProject(ProjectQO projectQO) {
ProjectDTO projectDTO = EntityUtil.changeEntityByJSON(ProjectDTO.class, projectQO);
ServiceResponse<Integer> serviceResponse = projectApiService.saveOrUpdateProject(projectDTO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/del-project")
public RestResponse delProject(@Validated(ProjectQO.DelValid.class) ProjectQO projectQO) {
public RestResponse delProject(ProjectQO projectQO) {
ServiceResponse<Integer> serviceResponse = projectApiService.delProject(projectQO.getProjectId());
return ResultControllerUtils.commonResult(serviceResponse);
}
......
......@@ -9,7 +9,6 @@ import com.gic.enterprise.qo.ProjectItemQO;
import com.gic.enterprise.service.ProjectItemApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -26,20 +25,20 @@ public class ProjectItemController {
private ProjectItemApiService projectItemApiService;
@RequestMapping("/save-project-item")
public RestResponse saveProjectItem(@Validated({ProjectItemQO.SaveValid.class}) ProjectItemQO projectItemQO) {
public RestResponse saveProjectItem(ProjectItemQO projectItemQO) {
ProjectItemDTO projectItemDTO = EntityUtil.changeEntityByJSON(ProjectItemDTO.class, projectItemQO);
ServiceResponse<Integer> serviceResponse = projectItemApiService.saveOrUpdateProjectItem(projectItemDTO);
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/del-project-item")
public RestResponse delProjectItem(@Validated({ProjectItemQO.DelValid.class}) ProjectItemQO projectItemQO) {
public RestResponse delProjectItem(ProjectItemQO projectItemQO) {
ServiceResponse<Integer> serviceResponse = projectItemApiService.delProjectItem(projectItemQO.getProjectItemId());
return ResultControllerUtils.commonResult(serviceResponse);
}
@RequestMapping("/list-project-item")
public RestResponse listProjectItem(@Validated({ProjectItemQO.ListValid.class}) ProjectItemQO projectItemQO) {
public RestResponse listProjectItem(ProjectItemQO projectItemQO) {
ServiceResponse<Page<ProjectItemDTO>> serviceResponse = projectItemApiService.listProjectItem(projectItemQO);
return ResultControllerUtils.commonResult(serviceResponse);
}
......
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