|
|
@@ -21,6 +21,8 @@ import javax.mail.MessagingException;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import org.apache.commons.beanutils.BeanUtils;
|
|
|
+import org.apache.commons.beanutils.ConvertUtils;
|
|
|
+import org.apache.commons.beanutils.converters.DateConverter;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFCell;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFRow;
|
|
|
@@ -35,6 +37,7 @@ import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.alibaba.druid.sql.parser.Token;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.goafanti.admin.bo.AdminListBo;
|
|
|
import com.goafanti.common.bo.EmailBo;
|
|
|
@@ -548,7 +551,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
|
|
|
public void addNewDunNoticAndSendEmail(TOrderNew t2, OutNewOrderDunBo o) {
|
|
|
- AdminListBo a = adminMapper.getDeptNameByAid(t2.getSalesmanId());
|
|
|
+ AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
|
|
|
TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(t2.getOrderNo());
|
|
|
addNotic(t2.getOrderNo(),NoticeStatus.ORDER_DUN.getCode(),a, b);
|
|
|
try {
|
|
|
@@ -563,24 +566,25 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
LoggerUtils.debug(logger, "======================邮件信息发送===================");
|
|
|
String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + orderNo + "</div>";
|
|
|
OutNewOrderDunBo ob=new OutNewOrderDunBo();
|
|
|
- if(dunId!=null) {
|
|
|
- try {
|
|
|
- BeanUtils.copyProperties(ob, newOrderDunMapper.selectByPrimaryKey(dunId));
|
|
|
- } catch (IllegalAccessException | InvocationTargetException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ if(dunId!=null)
|
|
|
+ try {
|
|
|
+ ConvertUtils.register(new DateConverter(null), java.util.Date.class);
|
|
|
+ BeanUtils.copyProperties(ob, newOrderDunMapper.selectByPrimaryKey(dunId));
|
|
|
+ } catch (IllegalAccessException | InvocationTargetException e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
+ AdminListBo a2 = adminMapper.getDeptNameByAid(b.getSalesmanId());
|
|
|
//发送驳回邮件
|
|
|
//String subject, String address, String deptname, String sender,
|
|
|
//String content , String orderNo,String date ,String dunStatusName,Integer type
|
|
|
EmailBo bo = new EmailBo("催收通知", b.getEmail(), a.getDepartmentName(), a.getName(),
|
|
|
- content, orderNo,new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),ob.getDunTypeName(),b.getUserName(),1);
|
|
|
+ content, orderNo,new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),ob.getDunTypeName(),a2.getName(),b.getUserName(),1);
|
|
|
if(StringUtils.isNotBlank(b.getEmail())) {
|
|
|
SendEmailUtil.getInstance().patentSend(bo);
|
|
|
}
|
|
|
LoggerUtils.debug(logger, "=========================================发送邮件成功");
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private void addBackOrder(String orderNo, String reason) {
|
|
|
@@ -1078,7 +1082,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if(StringUtils.isNotBlank(adminIds)) {
|
|
|
adminIds=adminIds.substring(0, adminIds.length()-1);
|
|
|
EmailBo bo = new EmailBo(NoticeStatus.getValueByCode(type), adminIds, a.getDepartmentName(), a.getName(), "请登录查看"
|
|
|
- ,null,null,null,null,0);
|
|
|
+ ,null,null,null,null,null,0);
|
|
|
try {
|
|
|
//使用专利邮件模板
|
|
|
SendEmailUtil.getInstance().patentSend(bo);
|