Commit daf402f5 authored by Data-王博's avatar Data-王博

湖北消金 - 提供提前还款接口 提供保存邮件接口

parent 8d271558
......@@ -132,6 +132,17 @@ public class ApiCommonController {
return JsonResult.SUCCESS();
}
@RequestMapping(value = "/hubei/checkDisc", method = {RequestMethod.POST,RequestMethod.GET})
public @ResponseBody JsonResult checkDisc(@RequestParam("applyDt") String applyDt,@RequestParam("docName") String docName){
try {
huBeiService.handleDiscData(HubeiCFCDataType.SEND_ADVANCE_REPAYMENT_CHECK,docName,null,new Integer(1).byteValue(),applyDt);
} catch (Exception e) {
logger.error(e.getMessage(),e);
}
return JsonResult.SUCCESS();
}
@RequestMapping(value = "/hubei/returnDisc", method = {RequestMethod.POST,RequestMethod.GET})
public @ResponseBody JsonResult getReturnDisc(@RequestParam("applyDt") String applyDt,@RequestParam("type") Integer type){
try {
......
package cn.quantgroup.financial.controller;
import cn.quantgroup.financial.json.JsonResult;
import cn.quantgroup.financial.model.MailInfo;
import cn.quantgroup.financial.model.PaymentDetail;
import cn.quantgroup.financial.service.sys.IMailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
/**
* Created by WuKong on 2017/2/19.
*/
@Controller
@RequestMapping("/system")
public class SystemToolsController {
@Autowired
private IMailService mailService;
@RequestMapping(value = "/mailinfo/save", method = RequestMethod.POST)
public @ResponseBody JsonResult saveMailInfo(@RequestBody MailInfo mailInfo){
Long mailId = null;
if(mailInfo !=null){
mailId = mailService.saveMailInfo(mailInfo);
}
return JsonResult.SUCCESS(mailId);
}
@RequestMapping(value = "/mailinfo/delete", method = {RequestMethod.GET,RequestMethod.POST,RequestMethod.DELETE})
public @ResponseBody JsonResult paymentNotify(@RequestParam("mailId") Long mailId){
Integer row = null;
if(mailId!=null){
row = mailService.deleteMailInfo(mailId);
}
return JsonResult.SUCCESS(row);
}
}
......@@ -47,4 +47,6 @@ public interface IHuBeiCFCDao {
Integer getMaxSeqNoByDocId(Long docId);
List<MailInfo> getListByType(Byte type);
}
package cn.quantgroup.financial.dao;
import cn.quantgroup.financial.model.MailInfo;
/**
* Created by WuKong on 2017/2/19.
*/
public interface ISystemDao {
Long saveMailInfo(MailInfo mailInfo);
Integer deleteMailInfo(Long mailId);
}
......@@ -136,4 +136,6 @@ public class HuBeiCFCDaoImpl implements IHuBeiCFCDao {
public List<MailInfo> getListByType(Byte type){
return mailInfoMapper.getByType(type);
}
}
package cn.quantgroup.financial.dao.impl;
import cn.quantgroup.financial.dao.ISystemDao;
import cn.quantgroup.financial.mapper.MailInfoMapper;
import cn.quantgroup.financial.model.MailInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* Created by WuKong on 2017/2/19.
*/
@Service
public class SystemDaoImpl implements ISystemDao {
@Autowired
MailInfoMapper mailInfoMapper;
@Transactional(rollbackFor=Exception.class)
@Override
public Long saveMailInfo(MailInfo mailInfo){
mailInfo.setCreatetime(new Date());
mailInfo.setUpdatetime(new Date());
mailInfoMapper.insert(mailInfo);
return mailInfo.getId();
}
@Transactional(rollbackFor=Exception.class)
@Override
public Integer deleteMailInfo(Long mailId){
return mailInfoMapper.deleteByPrimaryKey(mailId);
}
}
......@@ -797,4 +797,5 @@ public class HuBeiServiceImpl implements IHuBeiService {
return huBeiDocName;
}
}
package cn.quantgroup.financial.service.sys;
import cn.quantgroup.financial.model.MailInfo;
import org.springframework.mail.MailException;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.MimeMessagePreparator;
......@@ -67,4 +68,8 @@ public interface IMailService {
MimeMessage createMimeMessage(InputStream var1) throws MailException;
DataSource getDataSource(String content,String fileName);
Long saveMailInfo(MailInfo mailInfo);
Integer deleteMailInfo(Long id);
}
package cn.quantgroup.financial.service.sys.impl;
import cn.quantgroup.financial.constant.EncodingConfig;
import cn.quantgroup.financial.dao.IHuBeiCFCDao;
import cn.quantgroup.financial.dao.ISystemDao;
import cn.quantgroup.financial.model.MailInfo;
import cn.quantgroup.financial.service.sys.IMailSendCallback;
import cn.quantgroup.financial.service.sys.IMailService;
import org.apache.commons.collections.CollectionUtils;
......@@ -32,6 +35,12 @@ public class MailServiceImpl implements IMailService {
@Autowired
private JavaMailSender javaMailSender;
@Autowired
private IHuBeiCFCDao huBeiCFCDao;
@Autowired
private ISystemDao systemDao;
private static final Logger logger = LoggerFactory.getLogger(MailServiceImpl.class);
/**
......@@ -334,4 +343,20 @@ public class MailServiceImpl implements IMailService {
return (file.exists() && file.isFile()) ? file : null;
}
/**
* 保存邮件信息
* @param mailInfo
* @return
*/
@Override
public Long saveMailInfo(MailInfo mailInfo){
return systemDao.saveMailInfo(mailInfo);
}
@Override
public Integer deleteMailInfo(Long id){
return systemDao.deleteMailInfo(id);
}
}
......@@ -27,7 +27,7 @@
delete from mailinfo
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="cn.quantgroup.financial.model.MailInfo" >
<insert id="insert" parameterType="cn.quantgroup.financial.model.MailInfo" useGeneratedKeys="true" keyProperty="id">
insert into mailinfo (id, mail, mailType,
createTime, updateTime)
values (#{id,jdbcType=BIGINT}, #{mail,jdbcType=VARCHAR}, #{mailtype,jdbcType=TINYINT},
......
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