|
|
@@ -10,14 +10,15 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
|
import com.goafanti.common.model.User;
|
|
|
import com.goafanti.common.utils.LoggerUtils;
|
|
|
import com.goafanti.customer.bo.LockingReleaseBo;
|
|
|
import com.goafanti.customer.service.CustomerService;
|
|
|
import com.goafanti.user.service.UserService;
|
|
|
-//@Component
|
|
|
-@Controller
|
|
|
+@Component
|
|
|
+//@Controller
|
|
|
public class ReleaseUserTask {
|
|
|
@Resource
|
|
|
private CustomerService customerServiceImpl;
|
|
|
@@ -29,9 +30,9 @@ public class ReleaseUserTask {
|
|
|
/**
|
|
|
* 每天凌晨一点将客户和业务转为待释放
|
|
|
*/
|
|
|
- @SuppressWarnings("null")
|
|
|
-// @Scheduled(cron = "0 0 1 * * ?")
|
|
|
- @RequestMapping(value = "/updateUser")
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 12 * * ?")
|
|
|
+// @RequestMapping(value = "/open/updateUser", method = RequestMethod.GET)
|
|
|
public void updateUser(){
|
|
|
try {
|
|
|
List<User> userList = userServiceImpl.selectUserByRoleName("营销员","营销经理");
|
|
|
@@ -40,12 +41,14 @@ public class ReleaseUserTask {
|
|
|
List<LockingReleaseBo> userTmpList = null;
|
|
|
List<LockingReleaseBo> businessTmpList = null;
|
|
|
for(User u : userList){
|
|
|
- userTmpList = customerServiceImpl.selectWaitReleaseCustomer(u.getId());
|
|
|
+ //userTmpList = customerServiceImpl.selectWaitReleaseCustomer(u.getId());
|
|
|
+ userTmpList = customerServiceImpl.selectWaitReleaseCustomer("1");
|
|
|
lockUserList.addAll(userTmpList);
|
|
|
- businessTmpList = customerServiceImpl.selectWaitReleaseBusiness(u.getId());
|
|
|
+ //businessTmpList = customerServiceImpl.selectWaitReleaseBusiness(u.getId());
|
|
|
+ businessTmpList = customerServiceImpl.selectWaitReleaseBusiness("1");
|
|
|
lockBusinessList.addAll(businessTmpList);
|
|
|
}
|
|
|
- List<LockingReleaseBo> newList=null;
|
|
|
+ List<LockingReleaseBo> newList=new ArrayList<LockingReleaseBo>();
|
|
|
for(int i=0;i<userTmpList.size();i++){
|
|
|
newList.add(userTmpList.get(i));
|
|
|
if(pointsDataLimit == newList.size()||i == userTmpList.size()-1){
|
|
|
@@ -72,14 +75,16 @@ public class ReleaseUserTask {
|
|
|
LoggerUtils.error(getClass(), "=============================================", e);
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 将待释放的代码释放出去
|
|
|
+ */
|
|
|
|
|
|
- @SuppressWarnings("null")
|
|
|
-// @Scheduled(cron = "0 0 1 * * ?")
|
|
|
- @RequestMapping(value = "/releaseUser")
|
|
|
+ @Scheduled(cron = "0 0 13 * * ?")
|
|
|
+// @RequestMapping(value = "/open/releaseUser", method = RequestMethod.GET)
|
|
|
public void releaseUser(){
|
|
|
try {
|
|
|
List<LockingReleaseBo> lockList=customerServiceImpl.selectPendinglockUserList();
|
|
|
- List<LockingReleaseBo> newList=null;
|
|
|
+ List<LockingReleaseBo> newList=new ArrayList<>();
|
|
|
for(int i=0;i<lockList.size();i++){
|
|
|
newList.add(lockList.get(i));
|
|
|
if(pointsDataLimit == newList.size()||i == lockList.size()-1){
|