|
@@ -5,21 +5,19 @@ import com.simuwang.base.common.support.MybatisPage;
|
|
|
import com.simuwang.base.components.UserAuthService;
|
|
|
import com.simuwang.base.mapper.daq.ChannelEmailMapper;
|
|
|
import com.simuwang.base.mapper.daq.ChannelMapper;
|
|
|
-import com.simuwang.base.pojo.dos.ChannelEmailInfoDO;
|
|
|
-import com.simuwang.base.pojo.dos.ChannelInfoDO;
|
|
|
-import com.simuwang.base.pojo.dos.ChannelPageInfoDO;
|
|
|
-import com.simuwang.base.pojo.dos.CompanyEmailSendHistoryDO;
|
|
|
+import com.simuwang.base.mapper.daq.ChannelResponbilityMapper;
|
|
|
+import com.simuwang.base.pojo.dos.*;
|
|
|
import com.simuwang.base.pojo.dto.GetByIdQuery;
|
|
|
import com.simuwang.base.pojo.dto.query.ChannelIdPageQuery;
|
|
|
import com.simuwang.base.pojo.dto.query.ChannelPageQuery;
|
|
|
-import com.simuwang.base.pojo.vo.ChannelEmailInfoVO;
|
|
|
-import com.simuwang.base.pojo.vo.ChannelInfoVO;
|
|
|
-import com.simuwang.base.pojo.vo.ChannelPageInfoVO;
|
|
|
-import com.simuwang.base.pojo.vo.CompanyEmailSendHistoryVO;
|
|
|
+import com.simuwang.base.pojo.vo.*;
|
|
|
+import com.simuwang.daq.service.AbstractEmailParser;
|
|
|
import com.simuwang.manage.service.ChannelService;
|
|
|
import com.simuwang.shiro.utils.UserUtils;
|
|
|
import com.smppw.common.pojo.ResultVo;
|
|
|
import com.smppw.common.pojo.enums.status.ResultCode;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -37,9 +35,10 @@ public class ChannelServiceImpl implements ChannelService {
|
|
|
@Autowired
|
|
|
private ChannelEmailMapper channelEmailMapper;
|
|
|
@Autowired
|
|
|
- private UserAuthService UserAuthService;
|
|
|
- @Autowired
|
|
|
private UserAuthService userAuthService;
|
|
|
+ @Autowired
|
|
|
+ private ChannelResponbilityMapper channelResponbilityMapper;
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(ChannelServiceImpl.class);
|
|
|
|
|
|
@Override
|
|
|
public ResultVo saveChannel(ChannelInfoVO channel) {
|
|
@@ -152,4 +151,31 @@ public class ChannelServiceImpl implements ChannelService {
|
|
|
ChannelEmailInfoDO channelEmailInfoDO = channelEmailMapper.selectById(channelId);
|
|
|
return channelEmailInfoDO == null;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResultVo saveChannelResponsibility(ChannelResponsibilityInfoVO channelResponsibilityInfoVO) {
|
|
|
+ ResultVo vo = new ResultVo(ResultCode.SAVE_SUCCESS.getCode());
|
|
|
+ try{
|
|
|
+ ChannelResponsibilityInfoDO channelResponsibilityInfoDO = new ChannelResponsibilityInfoDO();
|
|
|
+ BeanUtil.copyProperties(channelResponsibilityInfoVO, channelResponsibilityInfoDO);
|
|
|
+ Integer userId = UserUtils.getLoginUser().getUserId();
|
|
|
+ channelResponsibilityInfoDO.setUpdaterId(userId);
|
|
|
+ channelResponsibilityInfoDO.setIsvalid(1);
|
|
|
+ channelResponsibilityInfoDO.setUpdateTime(new Date());
|
|
|
+ ChannelResponsibilityInfoDO oldchannelResponsibilityInfoDO = channelResponbilityMapper.select(channelResponsibilityInfoDO);
|
|
|
+ if (oldchannelResponsibilityInfoDO != null) {
|
|
|
+ channelResponsibilityInfoDO.setId(oldchannelResponsibilityInfoDO.getId());
|
|
|
+ channelResponbilityMapper.updateChannelResponsibilityInfoDO(channelResponsibilityInfoDO);
|
|
|
+ }else{
|
|
|
+ channelResponsibilityInfoDO.setCreatorId(userId);
|
|
|
+ channelResponsibilityInfoDO.setCreateTime(new Date());
|
|
|
+ channelResponbilityMapper.saveChannelResponsibilityInfoDO(channelResponsibilityInfoDO);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error(e.getMessage(),e);
|
|
|
+ vo.setCode(ResultCode.SAVE_FAILED.getCode());
|
|
|
+ vo.setMsg(e.getMessage());
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
}
|