|
|
@@ -19,8 +19,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
+import com.goafanti.common.constant.AFTConstants;
|
|
|
import com.goafanti.common.dao.TOrderNewMapper;
|
|
|
import com.goafanti.common.model.TOrderNew;
|
|
|
+import com.goafanti.common.utils.DateUtils;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
import com.goafanti.order.bo.InputNewOrderDunBo;
|
|
|
import com.goafanti.order.bo.OutNewOrderDunBo;
|
|
|
@@ -28,8 +30,8 @@ import com.goafanti.order.enums.OrderDunProjectType;
|
|
|
import com.goafanti.order.service.NewOrderDunService;
|
|
|
import com.goafanti.order.service.OrderNewService;
|
|
|
|
|
|
-@Component
|
|
|
-//@Controller
|
|
|
+//@Component
|
|
|
+@Controller
|
|
|
public class OrderDunTask {
|
|
|
@Autowired
|
|
|
private OrderNewService orderNewService;
|
|
|
@@ -45,9 +47,9 @@ public class OrderDunTask {
|
|
|
/**
|
|
|
* 每天凌晨2点轮询处理需要催款的信息
|
|
|
*/
|
|
|
-// @RequestMapping(value = "/open/updateorderDun", method = RequestMethod.GET)
|
|
|
-// @ResponseBody
|
|
|
- @Scheduled(cron = "0 0 2 * * ?")
|
|
|
+ @RequestMapping(value = "/open/updateorderDun", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+// @Scheduled(cron = "0 0 2 * * ?")
|
|
|
@Transactional(rollbackFor=Exception.class)
|
|
|
public void updateorderDun(){
|
|
|
try {
|
|
|
@@ -59,16 +61,17 @@ public class OrderDunTask {
|
|
|
Calendar calendar2=Calendar.getInstance();
|
|
|
for (OutNewOrderDunBo o : list) {
|
|
|
calendar2.setTime(o.getCreateTime());
|
|
|
- if (o!=null&&o.getApproval()!=null&&o.getApproval()==2) {
|
|
|
- calendar2.add(Calendar.DATE, o.getWaitDay());
|
|
|
- if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
|
|
|
- updateOrderDun(o);
|
|
|
- Thread.sleep(2000);
|
|
|
- }
|
|
|
+ if (o!=null&&o.getApproval()!=null&&o.getApproval()!=0&&o.getDunType()==1&&o.getWaitDay()!=null) {
|
|
|
+ calendar2.add(Calendar.DATE, o.getWaitDay());
|
|
|
+ if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
|
|
|
+ updateOrderDun(o);
|
|
|
+ Thread.sleep(2000);
|
|
|
+ }
|
|
|
}
|
|
|
if(o.getProjectType()==OrderDunProjectType.HY.getCode()&&o.getDunType()==2) {
|
|
|
calendar2.add(Calendar.DATE, o.getEffectiveCount()*180);
|
|
|
CalendarTimeCleared(calendar2);
|
|
|
+ System.out.println(DateUtils.formatDate(calendar2.getTime(), AFTConstants.YYYYMMDDHHMMSS));
|
|
|
if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
|
|
|
updateOrderDun(o);
|
|
|
Thread.sleep(2000);
|
|
|
@@ -83,9 +86,6 @@ public class OrderDunTask {
|
|
|
if(month>9)year=year+2;
|
|
|
calendar2.set(year, 5, 1);
|
|
|
CalendarTimeCleared(calendar2);
|
|
|
- System.out.println(calendar.getTime());
|
|
|
- System.out.println(calendar2.getTime());
|
|
|
- System.out.println(calendar.getTimeInMillis() > calendar2.getTimeInMillis()?1:0);
|
|
|
if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
|
|
|
updateOrderDun(o);
|
|
|
Thread.sleep(2000);
|
|
|
@@ -118,7 +118,7 @@ public class OrderDunTask {
|
|
|
o.setStartTime(new Date());
|
|
|
newOrderDunService.updateDun(o);
|
|
|
TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
|
|
|
- orderNewService.addNewDunNoticAndSendEmail(t2, t);;
|
|
|
+ orderNewService.addTimingTaskNewDunNoticAndSendEmail(t2, t);;
|
|
|
}
|
|
|
|
|
|
/**
|