|
|
@@ -15,11 +15,13 @@ import javax.mail.MessagingException;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
+import org.apache.xmlbeans.impl.xb.xsdschema.Public;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.goafanti.admin.bo.AdminListBo;
|
|
|
@@ -44,6 +46,7 @@ import com.goafanti.common.model.TDunLog;
|
|
|
import com.goafanti.common.model.TOrderBack;
|
|
|
import com.goafanti.common.model.TOrderDun;
|
|
|
import com.goafanti.common.model.TOrderNew;
|
|
|
+import com.goafanti.common.model.TOrderRefund;
|
|
|
import com.goafanti.common.model.TOrderRefundWithBLOBs;
|
|
|
import com.goafanti.common.model.TOrderTask;
|
|
|
import com.goafanti.common.utils.ExportExcelUtil;
|
|
|
@@ -187,19 +190,23 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
@Override
|
|
|
public int updateServiceOrder(TOrderNew t, Integer isSubmit) {
|
|
|
- OrganizationContactBook contactBook=new OrganizationContactBook();
|
|
|
- contactBook.setId(UUID.randomUUID().toString());
|
|
|
- contactBook.setAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
- contactBook.setUid(t.getBuyerId());
|
|
|
- contactBook.setName(t.getContacts());
|
|
|
- contactBook.setMobile(t.getContactMobile());
|
|
|
- organizationContactBookMapper.insertSelective(contactBook);
|
|
|
+ TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
|
|
|
+ //判断手机号码是否存在
|
|
|
+ if (StringUtils.isNotBlank(t.getContacts())&&StringUtils.isNotBlank(t.getContactMobile())&&
|
|
|
+ organizationContactBookMapper.checkContacts(t2.getBuyerId(), t2.getContactMobile(),TokenManager.getAdminId()==null?"1":TokenManager.getAdminId() )>0) {
|
|
|
+ OrganizationContactBook contactBook=new OrganizationContactBook();
|
|
|
+ contactBook.setId(UUID.randomUUID().toString());
|
|
|
+ contactBook.setAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
+ contactBook.setUid(t2.getBuyerId());
|
|
|
+ contactBook.setName(t.getContacts());
|
|
|
+ contactBook.setMobile(t.getContactMobile());
|
|
|
+ organizationContactBookMapper.insertSelective(contactBook);
|
|
|
+ }
|
|
|
if (isSubmit==1) {
|
|
|
t.setOrderStatus(OrderNewState.QDDS.getCode());
|
|
|
t.setProcessStatus(ProcessStatus.YPYXGLY.getCode());
|
|
|
|
|
|
}
|
|
|
- TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
|
|
|
if (t2.getApproval()==ApprovalNewState.BH.getCode()||
|
|
|
t2.getOrderStatus()==OrderNewState.QDSHJJ.getCode()||
|
|
|
t2.getOrderStatus()==OrderNewState.YBH.getCode()) {
|
|
|
@@ -370,7 +377,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.TDZ.getCode());
|
|
|
tOrderNewMapper.updateByPrimaryKeySelective(tOrder);
|
|
|
return tOrderRefundMapper.insertSelective(t);
|
|
|
}
|
|
|
@@ -465,7 +472,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
TOrderNew tOrder= tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
if (tOrder.getSettlementAmount()==null||
|
|
|
tOrder.getSettlementAmount().doubleValue()==0||
|
|
|
- tOrder.getOrderStatus()==OrderNewState.YTD.getCode()){
|
|
|
+ tOrder.getOrderStatus()==OrderNewState.TDZ.getCode()){
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
@@ -581,7 +588,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
tOrderDunMapper.updateByPrimaryKeySelective(tDun);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public void addNotic(String orderNo,Integer type,AdminListBo a,TOrderNewBo b) {
|
|
|
LoggerUtils.debug(logger, "======================站内消息发送启动===================");
|
|
|
String id="1";
|
|
|
@@ -596,7 +602,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
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>";
|
|
|
@@ -630,5 +635,4 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
addNotic(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo,type,a, b);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|