|
|
@@ -562,18 +562,15 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public int technicianBackOrder(String orderNo) {
|
|
|
+ public int technicianBackOrder(String orderNo,String reason) {
|
|
|
TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
- if (t.getSettlementAmount().compareTo(new BigDecimal(0))==0) {
|
|
|
+ if (t.getSettlementAmount().compareTo(new BigDecimal(0))==0||
|
|
|
+ t.getProcessStatus()>ProcessStatus.YPZXSGLY.getCode()) {
|
|
|
return -1;
|
|
|
}
|
|
|
t.setOrderStatus(OrderNewState.YBH.getCode());
|
|
|
- try {
|
|
|
- addNoticAndSendEmail(orderNo, null, NoticeStatus.ORDER_BACK.getCode());
|
|
|
- } catch (UnsupportedEncodingException | MessagingException e) {
|
|
|
- LoggerUtils.error(getClass(), "发送邮件失败", e);
|
|
|
- }
|
|
|
- return tOrderNewMapper.updateByPrimaryKey(t);
|
|
|
+ addBackOrder(orderNo, reason);
|
|
|
+ return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -590,9 +587,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
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());
|