|
|
@@ -258,11 +258,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
if(pageSize==null||pageSize<0)pageSize=10;
|
|
|
if(pageNo==null||pageNo<0)pageNo=1;
|
|
|
- if (specially!=null&&(specially==0||specially==5)) {
|
|
|
+ if (specially!=null&&(specially==0||specially==2||specially==5)) {
|
|
|
params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
}else if(specially!=null&&specially==4){
|
|
|
params.put("distribution",distribution);
|
|
|
}
|
|
|
+ //0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询
|
|
|
params.put("specially",specially);
|
|
|
|
|
|
if (StringUtils.isNotBlank(name)) params.put("name", name);
|
|
|
@@ -302,11 +303,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
ob.setBackStatus(0);//待处理
|
|
|
ob.setInitiate(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
ob.setAccept(tOrder.getSalesmanId());
|
|
|
- // 新增站内消息
|
|
|
- addNotic(orderNo,NoticeStatus.ORDER_BACK.getCode());
|
|
|
- // 发送邮件
|
|
|
try {
|
|
|
- sendEmail(orderNo,null);
|
|
|
+ addNoticAndSendEmail(orderNo, null, NoticeStatus.ORDER_BACK.getCode());
|
|
|
} catch (UnsupportedEncodingException | MessagingException e) {
|
|
|
LoggerUtils.error(getClass(), "发送邮件失败", e);
|
|
|
}
|
|
|
@@ -315,18 +313,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
|
|
|
|
|
|
- public void addNotic(String orderNo,Integer type) {
|
|
|
- String id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
- AdminListBo a = adminMapper.getDeptNameByAid(id);
|
|
|
- String str=NoticeStatus.getValueByCode(type)+": 订单编号 -"+orderNo+", 操作人:"+a.getDepartmentName()+"-"+a.getName()+"。";
|
|
|
- Notice n =new Notice();
|
|
|
- n.setId(UUID.randomUUID().toString());
|
|
|
- n.setAid(id);
|
|
|
- n.setNoticeType(type);
|
|
|
- n.setContent(str);
|
|
|
- n.setReaded(0);//未读
|
|
|
- noticeMapper.insertSelective(n);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -383,7 +370,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
t.setResult("");
|
|
|
TOrderNew tOrder=new TOrderNew();
|
|
|
tOrder.setOrderNo(t.getOrderNo());
|
|
|
- tOrder.setOrderStatus(OrderNewState.YTD.getCode());
|
|
|
+ //tOrder.setOrderStatus(OrderNewState.YTD.getCode());
|
|
|
tOrderNewMapper.updateByPrimaryKeySelective(tOrder);
|
|
|
return tOrderRefundMapper.insertSelective(t);
|
|
|
}
|
|
|
@@ -462,7 +449,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
@Override
|
|
|
public int deleteOrderNew(String orderNo) {
|
|
|
TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
- if (t.getOrderStatus()==OrderNewState.YBH.getCode()||t.getOrderStatus()==OrderNewState.YTD.getCode()) {
|
|
|
+ if (t.getOrderStatus()==OrderNewState.YBH.getCode()||t.getOrderStatus()==OrderNewState.YTD.getCode()||
|
|
|
+ t.getOrderStatus()==OrderNewState.DQD.getCode()||t.getOrderStatus()==OrderNewState.QDSHJJ.getCode()) {
|
|
|
t.setOrderNo(orderNo);
|
|
|
t.setDeleteSign(1);//作废
|
|
|
return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
@@ -491,6 +479,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
if(pageSize==null||pageSize<0)pageSize=10;
|
|
|
if(pageNo==null||pageNo<0)pageNo=1;
|
|
|
+ params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
if (StringUtils.isNotBlank(name)) params.put("name", name);
|
|
|
if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
|
|
|
if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
|
|
|
@@ -572,10 +561,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return -1;
|
|
|
}
|
|
|
t.setOrderStatus(OrderNewState.YBH.getCode());
|
|
|
- //sendEmail
|
|
|
- addNotic(orderNo,NoticeStatus.ORDER_BACK.getCode());
|
|
|
try {
|
|
|
- sendEmail(orderNo,null);
|
|
|
+ addNoticAndSendEmail(orderNo, null, NoticeStatus.ORDER_BACK.getCode());
|
|
|
} catch (UnsupportedEncodingException | MessagingException e) {
|
|
|
LoggerUtils.error(getClass(), "发送邮件失败", e);
|
|
|
}
|
|
|
@@ -595,19 +582,30 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- @Override
|
|
|
- public void sendEmail(String orderNo,String dunId) throws UnsupportedEncodingException, MessagingException{
|
|
|
- String id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
- AdminListBo a = adminMapper.getDeptNameByAid(id);
|
|
|
- TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(orderNo);
|
|
|
+ public void addNotic(String orderNo,Integer type,AdminListBo a,TOrderNewBo b) {
|
|
|
+ LoggerUtils.debug(logger, "======================站内消息发送启动===================");
|
|
|
+ String id="1";
|
|
|
+ if (type==NoticeStatus.ORDER_DUN.getCode()) id=b.getSalesmanId();
|
|
|
+ if (type==NoticeStatus.ORDER_BACK.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
+ String str=NoticeStatus.getValueByCode(type)+": 订单编号 -"+orderNo+", 操作人:"+a.getDepartmentName()+"-"+a.getName()+"。";
|
|
|
+ Notice n =new Notice();
|
|
|
+ n.setId(UUID.randomUUID().toString());
|
|
|
+ n.setAid(b.getSalesmanId());
|
|
|
+ n.setNoticeType(type);
|
|
|
+ n.setContent(str);
|
|
|
+ n.setReaded(0);//未读
|
|
|
+ noticeMapper.insertSelective(n);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void sendEmail(String orderNo,String dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
|
|
|
+ LoggerUtils.debug(logger, "======================邮件信息发送===================");
|
|
|
String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + orderNo + "</div>";
|
|
|
String tite="订单驳回";
|
|
|
if(StringUtils.isNotBlank(dunId)) {
|
|
|
TOrderDun tDun=tOrderDunMapper.selectByPrimaryKey(dunId);
|
|
|
content +="<div>催收时间: " + new SimpleDateFormat("yyyy-MM-dd").format(tDun.getCreateTime()) +
|
|
|
"</div><div>催收科目: " + OrderDunSubject.getValueByCode(tDun.getDunSubject()) +
|
|
|
- "</div><div>催收情况: " + (tDun.getDunStatus()==1?"已完成":"未完成") +"</div>";
|
|
|
+ "</div><div>催收情况: " + (tDun.getDunStatus()==2?"已完成":"已启动") +"</div>";
|
|
|
tite="催收通知";
|
|
|
}
|
|
|
//发送驳回邮件
|
|
|
@@ -616,6 +614,21 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
SendEmailUtil.getInstance().send(bo);
|
|
|
LoggerUtils.debug(logger, "=========================================发送邮件成功");
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void addNoticAndSendEmail(String orderNo,OrderDunTaskBo t,Integer type)
|
|
|
+ throws UnsupportedEncodingException, MessagingException {
|
|
|
+ TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo);
|
|
|
+ String id="1";
|
|
|
+ if (type==NoticeStatus.ORDER_DUN.getCode()) id=b.getSalesmanId();
|
|
|
+ if (type==NoticeStatus.ORDER_BACK.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
+ AdminListBo a = adminMapper.getDeptNameByAid(id);
|
|
|
+ sendEmail(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo, t==null?null:t.getId(), a, b);
|
|
|
+ addNotic(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo,type,a, b);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|