|
|
@@ -17,10 +17,9 @@ import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.customer.bo.LockingReleaseBo;
|
|
|
import com.goafanti.customer.service.CustomerService;
|
|
|
import com.goafanti.user.service.UserService;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDateTime;
|
|
|
@@ -31,16 +30,16 @@ import java.util.List;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
-//@Component
|
|
|
-@RestController
|
|
|
+@Component
|
|
|
+//@RestController
|
|
|
public class ReleaseUserTask {
|
|
|
@Resource
|
|
|
private CustomerService customerService;
|
|
|
@Resource
|
|
|
private UserService userService;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private NoticeMapper noticeMapper;
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private AsyncUtils asyncUtils;
|
|
|
@Value(value = "${dev.name}")
|
|
|
private String devName=null;
|
|
|
@@ -63,8 +62,8 @@ public class ReleaseUserTask {
|
|
|
* 客户释放
|
|
|
*
|
|
|
*/
|
|
|
-// @Scheduled(cron = "0 10 17 * * ?")
|
|
|
- @RequestMapping("/open/test")
|
|
|
+ @Scheduled(cron = "0 48 11 * * ?")
|
|
|
+// @RequestMapping("/open/test")
|
|
|
// @Scheduled(cron = "0 0 1 * * ?")
|
|
|
public void startTask() {
|
|
|
try {
|
|
|
@@ -92,13 +91,21 @@ public class ReleaseUserTask {
|
|
|
for (User admin : userList) {
|
|
|
List<User> users = userMapper.selectClueUserByClueType(admin.getId());
|
|
|
for (User u : users) {
|
|
|
- LocalDateTime clueTime = u.getClueTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ String aid=null;
|
|
|
+ LocalDateTime clueTime = null;
|
|
|
+ //已分配的通知人与时间不同,
|
|
|
+ if (u.getClueProcess()==1){
|
|
|
+ aid=u.getAid();
|
|
|
+ clueTime=u.getClueTransferTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ }else{
|
|
|
+ aid=admin.getId();
|
|
|
+ clueTime=u.getClueTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDateTime();
|
|
|
+ }
|
|
|
LocalDateTime endTime = clueTime.plusDays(15);
|
|
|
long between= ChronoUnit.DAYS.between(now, endTime);
|
|
|
if (between<1){
|
|
|
releaseUserList.add(u);
|
|
|
- String aid=admin.getId();
|
|
|
- if (u.getClueProcess()==1)aid=u.getAid();
|
|
|
+
|
|
|
logList.add(new UserTransferLog(u.getId(), "1",null, 27, "",date));
|
|
|
ln.add(new Notice(UUID.randomUUID().toString(),date, 0, aid,
|
|
|
NoticeStatus.CLUE_USER_RELEASE.getCode(),
|