|
@@ -739,7 +739,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
public void addNewDunNoticAndSendEmail(String orderNo, OutNewOrderDunBo o) {
|
|
public void addNewDunNoticAndSendEmail(String orderNo, OutNewOrderDunBo o) {
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(orderNo);
|
|
TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(orderNo);
|
|
|
- addNotic(orderNo,NoticeStatus.ORDER_DUN.getCode(),a, b);
|
|
|
|
|
|
|
+ addNotic(NoticeStatus.ORDER_DUN.getCode(),a, b);
|
|
|
try {
|
|
try {
|
|
|
NewDunsendEmail(orderNo,o.getId(), a, b);
|
|
NewDunsendEmail(orderNo,o.getId(), a, b);
|
|
|
} catch (UnsupportedEncodingException | MessagingException e) {
|
|
} catch (UnsupportedEncodingException | MessagingException e) {
|
|
@@ -749,7 +749,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
public void addTimingTaskNewDunNoticAndSendEmail(TOrderNew t2, OutNewOrderDunBo o) {
|
|
public void addTimingTaskNewDunNoticAndSendEmail(TOrderNew t2, OutNewOrderDunBo o) {
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid("1");
|
|
AdminListBo a = adminMapper.getDeptNameByAid("1");
|
|
|
TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(t2.getOrderNo());
|
|
TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(t2.getOrderNo());
|
|
|
- addNotic(t2.getOrderNo(),NoticeStatus.ORDER_DUN.getCode(),a, b);
|
|
|
|
|
|
|
+ addNotic(NoticeStatus.ORDER_DUN.getCode(),a, b);
|
|
|
try {
|
|
try {
|
|
|
NewDunsendEmail(t2.getOrderNo(),o.getId(), a, b);
|
|
NewDunsendEmail(t2.getOrderNo(),o.getId(), a, b);
|
|
|
} catch (UnsupportedEncodingException | MessagingException e) {
|
|
} catch (UnsupportedEncodingException | MessagingException e) {
|
|
@@ -770,7 +770,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
//发送驳回邮件
|
|
//发送驳回邮件
|
|
|
if(SendEmailUtil.isEmail(b.getEmail())) {
|
|
if(SendEmailUtil.isEmail(b.getEmail())) {
|
|
|
EmailBo bo = new EmailBo("催收通知", b.getEmail(), a.getDepartmentName(), a.getName(),
|
|
EmailBo bo = new EmailBo("催收通知", b.getEmail(), a.getDepartmentName(), a.getName(),
|
|
|
- "", orderNo,new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),dunTypeName,a2.getName(),b.getUserName(),1,0);
|
|
|
|
|
|
|
+ "", orderNo,b.getContractNo(),new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),dunTypeName,a2.getName(),b.getUserName(),1,0);
|
|
|
if(StringUtils.isNotBlank(b.getEmail())) {
|
|
if(StringUtils.isNotBlank(b.getEmail())) {
|
|
|
asyncUtils.patentSend(bo);
|
|
asyncUtils.patentSend(bo);
|
|
|
}
|
|
}
|
|
@@ -798,7 +798,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
@Override
|
|
|
- public Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo, String starTime, String endTime,
|
|
|
|
|
|
|
+ public Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo,String contractNo, String starTime, String endTime,
|
|
|
Integer specially, String adminName,String depId,Integer newStatus,Integer pageNo, Integer pageSize) {
|
|
Integer specially, String adminName,String depId,Integer newStatus,Integer pageNo, Integer pageSize) {
|
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
Map<String, Object> params = new HashMap<String, Object>();
|
|
|
if(pageSize==null||pageSize<0)pageSize=10;
|
|
if(pageSize==null||pageSize<0)pageSize=10;
|
|
@@ -809,6 +809,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
|
|
if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
|
|
|
if (StringUtils.isNotBlank(adminName)) params.put("adminName", adminName);
|
|
if (StringUtils.isNotBlank(adminName)) params.put("adminName", adminName);
|
|
|
if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
|
|
if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
|
|
|
|
|
+ if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
|
|
|
if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
|
|
if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
|
|
|
if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
|
|
if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
|
|
|
Integer i=null;
|
|
Integer i=null;
|
|
@@ -1067,12 +1068,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
* @throws IOException
|
|
* @throws IOException
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public void exportOrderDunData(String name,String orderNo,String starTime,String endTime,Integer specially,String adminName,
|
|
|
|
|
|
|
+ public void exportOrderDunData(String name,String orderNo,String contractNo,String starTime,String endTime,Integer specially,String adminName,
|
|
|
String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws Exception {
|
|
String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws Exception {
|
|
|
OutputStream out = response.getOutputStream();
|
|
OutputStream out = response.getOutputStream();
|
|
|
try {
|
|
try {
|
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
|
- List<outOrderDunListBo> list=(List<outOrderDunListBo>) dunOrderNewList( name, orderNo, starTime, endTime,
|
|
|
|
|
|
|
+ List<outOrderDunListBo> list=(List<outOrderDunListBo>) dunOrderNewList( name, orderNo, contractNo, starTime, endTime,
|
|
|
specially, adminName, depId,newStatus, pageNo, pageSize).getList();
|
|
specially, adminName, depId,newStatus, pageNo, pageSize).getList();
|
|
|
|
|
|
|
|
String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","签单金额","应收款","已收款","拨款比例","结算状态","未收款","项目状态","催收科目","催款状态","催款启动时间","签单时间"};
|
|
String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","签单金额","应收款","已收款","拨款比例","结算状态","未收款","项目状态","催收科目","催款状态","催款启动时间","签单时间"};
|
|
@@ -1220,23 +1221,25 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (type==NoticeStatus.ORDER_BACK.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
if (type==NoticeStatus.ORDER_BACK.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
if (type==NoticeStatus.ORDER_APPROVA_NO.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
if (type==NoticeStatus.ORDER_APPROVA_NO.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid(id);
|
|
AdminListBo a = adminMapper.getDeptNameByAid(id);
|
|
|
- sendEmail(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo, t==null?null:t.getId(), a, b);
|
|
|
|
|
|
|
+ sendEmail( t==null?null:t.getId(), a, b);
|
|
|
|
|
|
|
|
- addNotic(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo,type,a, b);
|
|
|
|
|
|
|
+ addNotic(type,a, b);
|
|
|
}
|
|
}
|
|
|
- public void addNotic(String orderNo,Integer type,AdminListBo a,TOrderNewBo b) {
|
|
|
|
|
- String str=NoticeStatus.getValueByCode(type)+": 订单编号 -"+orderNo+", 操作人:"+a.getDepartmentName()+"-"+a.getName()+"。";
|
|
|
|
|
|
|
+ public void addNotic(Integer type,AdminListBo a,TOrderNewBo b) {
|
|
|
|
|
+ StringBuffer sb=new StringBuffer();
|
|
|
|
|
+ sb=sb.append(b.getUserName()).append(", 合同编号-").append(b.getContractNo())
|
|
|
|
|
+ .append(", 订单编号-").append(b.getOrderNo()).append(", 操作人: ").append(a.getDepartmentName()).append("-").append(a.getName()).append("。");
|
|
|
Notice n =new Notice();
|
|
Notice n =new Notice();
|
|
|
n.setId(UUID.randomUUID().toString());
|
|
n.setId(UUID.randomUUID().toString());
|
|
|
n.setAid(b.getSalesmanId());
|
|
n.setAid(b.getSalesmanId());
|
|
|
n.setNoticeType(type);
|
|
n.setNoticeType(type);
|
|
|
- n.setContent(str);
|
|
|
|
|
|
|
+ n.setContent(sb.toString());
|
|
|
n.setReaded(0);//未读
|
|
n.setReaded(0);//未读
|
|
|
asyncUtils.addNotice(n);
|
|
asyncUtils.addNotice(n);
|
|
|
}
|
|
}
|
|
|
- public void sendEmail(String orderNo,String dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
|
|
|
|
|
|
|
+ public void sendEmail(String dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
|
|
|
LoggerUtils.debug(logger, "======================邮件信息发送===================");
|
|
LoggerUtils.debug(logger, "======================邮件信息发送===================");
|
|
|
- String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + orderNo + "</div>";
|
|
|
|
|
|
|
+ String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + b.getOrderNo() + "</div><div>合同编号: " + b.getContractNo() + "</div>";
|
|
|
String tite="订单驳回";
|
|
String tite="订单驳回";
|
|
|
if(StringUtils.isNotBlank(dunId)) {
|
|
if(StringUtils.isNotBlank(dunId)) {
|
|
|
TOrderDun tDun=tOrderDunMapper.selectByPrimaryKey(dunId);
|
|
TOrderDun tDun=tOrderDunMapper.selectByPrimaryKey(dunId);
|
|
@@ -1295,7 +1298,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (!nlist.isEmpty()&&StringUtils.isNotBlank(adminIds)) {
|
|
if (!nlist.isEmpty()&&StringUtils.isNotBlank(adminIds)) {
|
|
|
adminIds=adminIds.substring(0, adminIds.length()-1);
|
|
adminIds=adminIds.substring(0, adminIds.length()-1);
|
|
|
EmailBo bo = new EmailBo(NoticeStatus.getValueByCode(type), adminIds, a.getDepartmentName(), a.getName(), "请登录查看"
|
|
EmailBo bo = new EmailBo(NoticeStatus.getValueByCode(type), adminIds, a.getDepartmentName(), a.getName(), "请登录查看"
|
|
|
- ,null,null,null,null,null,0,approval);
|
|
|
|
|
|
|
+ ,null,null,null,null,null,null,0,approval);
|
|
|
try {
|
|
try {
|
|
|
//使用专利邮件模板
|
|
//使用专利邮件模板
|
|
|
asyncUtils.patentSend(bo);
|
|
asyncUtils.patentSend(bo);
|
|
@@ -1399,6 +1402,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (StringUtils.isNotBlank(in.getDepId())) params.put("depId", in.getDepId());
|
|
if (StringUtils.isNotBlank(in.getDepId())) params.put("depId", in.getDepId());
|
|
|
if (StringUtils.isNotBlank(in.getAdminName())) params.put("adminName", in.getAdminName());
|
|
if (StringUtils.isNotBlank(in.getAdminName())) params.put("adminName", in.getAdminName());
|
|
|
if (StringUtils.isNotBlank(in.getOrderNo())) params.put("orderNo", in.getOrderNo());
|
|
if (StringUtils.isNotBlank(in.getOrderNo())) params.put("orderNo", in.getOrderNo());
|
|
|
|
|
+ if (StringUtils.isNotBlank(in.getContractNo())) params.put("contractNo", in.getContractNo());
|
|
|
if (StringUtils.isNotBlank(in.getStarTime())) params.put("starTime", in.getStarTime());
|
|
if (StringUtils.isNotBlank(in.getStarTime())) params.put("starTime", in.getStarTime());
|
|
|
if (StringUtils.isNotBlank(in.getEndTime())) params.put("endTime", in.getEndTime()+" 23:59:59");
|
|
if (StringUtils.isNotBlank(in.getEndTime())) params.put("endTime", in.getEndTime()+" 23:59:59");
|
|
|
if (StringUtils.isNotBlank(in.gettStarTime())) params.put("tStarTime", in.gettStarTime());
|
|
if (StringUtils.isNotBlank(in.gettStarTime())) params.put("tStarTime", in.gettStarTime());
|