|
|
@@ -16,10 +16,7 @@ import com.goafanti.common.enums.OfficialPatentType;
|
|
|
import com.goafanti.common.enums.OrderLogProcess;
|
|
|
import com.goafanti.common.error.BusinessException;
|
|
|
import com.goafanti.common.model.*;
|
|
|
-import com.goafanti.common.utils.AsyncUtils;
|
|
|
-import com.goafanti.common.utils.LoggerUtils;
|
|
|
-import com.goafanti.common.utils.SendEmailUtil;
|
|
|
-import com.goafanti.common.utils.StringUtils;
|
|
|
+import com.goafanti.common.utils.*;
|
|
|
import com.goafanti.common.utils.excel.NewExcelUtil;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.JDBCIdGenerator;
|
|
|
@@ -129,6 +126,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
private TOrderPaymentMapper tOrderPaymentMapper;
|
|
|
@Autowired
|
|
|
private TOrderHighTechMapper tOrderHighTechMapper;
|
|
|
+ @Autowired
|
|
|
+ private AdminUserCountMapper adminUserCountMapper;
|
|
|
+
|
|
|
|
|
|
@Value(value = "${upload.path}")
|
|
|
private String uploadPath = null;
|
|
|
@@ -138,8 +138,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
@Override
|
|
|
public int createServiceOrder(String uid,Integer userType, Integer orderType,Integer salesType,String channelId,String other) {
|
|
|
BigDecimal initial = new BigDecimal(0);
|
|
|
+ Date date=new Date();
|
|
|
TOrderNew t=new TOrderNew();
|
|
|
- Date date = new Date();
|
|
|
String orderNo=idGenerator.generateId().toString();
|
|
|
t.setOrderNo(orderNo);
|
|
|
t.setOrderType(orderType);
|
|
|
@@ -468,6 +468,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
@Override
|
|
|
public int updateServiceOrder(TOrderNewWithBLOBs t, Integer isSubmit) {
|
|
|
+ Date date=new Date();
|
|
|
TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
|
|
|
//判断手机号码是否存在
|
|
|
if (StringUtils.isNotBlank(t.getContacts())&&StringUtils.isNotBlank(t.getContactMobile())&&
|
|
|
@@ -586,7 +587,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
t2.getApproval().equals(ApprovalNewState.DSZBH.getCode()) ||
|
|
|
t2.getOrderStatus().equals(OrderNewState.QDSHJJ.getCode()) ||
|
|
|
t2.getOrderStatus().equals(OrderNewState.YBH.getCode())) {
|
|
|
- t.setCreateTime(new Date());
|
|
|
+ t.setCreateTime(date);
|
|
|
tOrderBackMapper.updateByOrderNoAndBackStatus(t.getOrderNo());
|
|
|
}
|
|
|
// 0 相等
|
|
|
@@ -603,7 +604,44 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
t.setLiquidationStatus(LiquidationNewState.WAIT_PAY_FIRST_BALANCE.getCode());
|
|
|
}
|
|
|
}
|
|
|
- return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
+ tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
+ updateAdminUserCountOrder(t2.getSalesmanId(),t2.getCreateTime());
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void updateAdminUserCountOrder(String aid,Date transferTime) {
|
|
|
+ String startTime= DateUtils.formatDate(transferTime,AFTConstants.YYYYMMDD);
|
|
|
+ String endTime=startTime+" 23:59:59";
|
|
|
+ AdminUserCount adminUserCount = adminUserCountMapper.selectByaidAndDate(aid, startTime);
|
|
|
+ Integer orderCount = tOrderNewMapper.selectAidAndDate(aid, startTime, endTime);
|
|
|
+
|
|
|
+ if (adminUserCount==null){
|
|
|
+ AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
+ selectAUC.setOrderCount(orderCount);
|
|
|
+ adminUserCountMapper.insertSelective(selectAUC);
|
|
|
+ }else {
|
|
|
+ AdminUserCount selectAUC=userMapper.selectByaidAndDate(aid,startTime,endTime);
|
|
|
+ AdminUserCount newAUC=new AdminUserCount();
|
|
|
+ newAUC.setId(adminUserCount.getId());
|
|
|
+ if (selectAUC==null){
|
|
|
+ newAUC.setPrivateCount(0);
|
|
|
+ newAUC.setChannelCount(0);
|
|
|
+ newAUC.setSignCount(0);
|
|
|
+ newAUC.setOrderCount(orderCount);
|
|
|
+ }else {
|
|
|
+ if (selectAUC.getPrivateCount()==null)selectAUC.setPrivateCount(0);
|
|
|
+ if (selectAUC.getChannelCount()==null)selectAUC.setChannelCount(0);
|
|
|
+ if (selectAUC.getSignCount()==null)selectAUC.setSignCount(0);
|
|
|
+ newAUC.setPrivateCount(selectAUC.getPrivateCount());
|
|
|
+ newAUC.setChannelCount(selectAUC.getChannelCount());
|
|
|
+ newAUC.setSignCount(selectAUC.getSignCount());
|
|
|
+ newAUC.setOrderCount(orderCount);
|
|
|
+ }
|
|
|
+
|
|
|
+ adminUserCountMapper.updateByPrimaryKeySelective(newAUC);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void updateOrderMid(TOrderNew t) {
|
|
|
@@ -1069,6 +1107,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
TOrderNewBo order = tOrderNewMapper.getSaleIdByOno(t2.getOrderNo());
|
|
|
pushGeneralSendNoticeAndEmail(aids, type,order, TokenManager.getAdminId(),t2.getApproval());
|
|
|
+ updateAdminUserCountOrder(t2.getSalesmanId(),t2.getCreateTime());
|
|
|
return 1;
|
|
|
}
|
|
|
|