|
|
@@ -42,15 +42,6 @@ import java.util.*;
|
|
|
@Component
|
|
|
public class CabinetUtil {
|
|
|
|
|
|
- @Autowired
|
|
|
- ISysDictDataService sysDictDataService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- ITblExpressStaticsService tblExpressStaticsService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- ISysUserService userService;
|
|
|
-
|
|
|
private final static String appid = "bw_open_express_A8C848769E5C04E0";
|
|
|
private final static String appkey = "5AFC6E07CFCF4A359B775D1416A9799A";
|
|
|
|
|
|
@@ -109,16 +100,14 @@ public class CabinetUtil {
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 10 0 ? * ? ")
|
|
|
+// @Scheduled(cron = "0/10 * * * * * ")
|
|
|
private void getExpressStatic() {
|
|
|
- ThreadUtil.execAsync(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
+
|
|
|
+
|
|
|
SysUserBo sysUserBo = new SysUserBo();
|
|
|
sysUserBo.setRoleId(1763484881548447746L);
|
|
|
- PageQuery pageQuery = new PageQuery();
|
|
|
- pageQuery.setPageSize(1000);
|
|
|
- pageQuery.setPageNum(1);
|
|
|
- List<SysUserVo> userlist = userService.selectAllocatedList(sysUserBo,pageQuery).getRows();
|
|
|
+
|
|
|
+ List<SysUserVo> userlist = SpringUtils.getBean(ISysUserService.class).getUserList(sysUserBo);
|
|
|
log.info(String.valueOf(userlist.size()));
|
|
|
for(SysUserVo vo:userlist){
|
|
|
if(!vo.getPhonenumber().isEmpty() && vo.getPhonenumber() != null){
|
|
|
@@ -133,12 +122,12 @@ public class CabinetUtil {
|
|
|
TblExpressStaticsBo query = new TblExpressStaticsBo();
|
|
|
query.setMonth(month);
|
|
|
query.setUserId(vo.getUserId());
|
|
|
- List<TblExpressStaticsVo> list = tblExpressStaticsService.queryList(query);
|
|
|
+ List<TblExpressStaticsVo> list = SpringUtils.getBean(ITblExpressStaticsService.class).queryList(query);
|
|
|
if(list.size() > 0){
|
|
|
bo.setId(list.get(0).getId());
|
|
|
- tblExpressStaticsService.updateByBo(bo);
|
|
|
+ SpringUtils.getBean(ITblExpressStaticsService.class).updateByBo(bo);
|
|
|
}else{
|
|
|
- tblExpressStaticsService.insertByBo(bo);
|
|
|
+ SpringUtils.getBean(ITblExpressStaticsService.class).insertByBo(bo);
|
|
|
}
|
|
|
log.info("----------------------快递员{}结束同步----------------------",vo.getNickName());
|
|
|
}catch (Exception e){
|
|
|
@@ -147,8 +136,7 @@ public class CabinetUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
@@ -303,7 +291,7 @@ public class CabinetUtil {
|
|
|
//获取所有站点led
|
|
|
SysDictDataBo bo =new SysDictDataBo();
|
|
|
bo.setDictType("tbl_sites");
|
|
|
- List<SysDictDataVo> allstations = sysDictDataService.selectDictDataList(bo);
|
|
|
+ List<SysDictDataVo> allstations = SpringUtils.getBean(ISysDictDataService.class).selectDictDataList(bo);
|
|
|
for (SysDictDataVo station:allstations) {
|
|
|
//获取led
|
|
|
if(StringUtils.isNotEmpty(station.getRemark())) {
|
|
|
@@ -335,12 +323,12 @@ public class CabinetUtil {
|
|
|
TblExpressStaticsBo query = new TblExpressStaticsBo();
|
|
|
query.setMonth(month);
|
|
|
query.setUserId(1L);
|
|
|
- List<TblExpressStaticsVo> list = tblExpressStaticsService.queryList(query);
|
|
|
+ List<TblExpressStaticsVo> list = SpringUtils.getBean(ITblExpressStaticsService.class).queryList(query);
|
|
|
if(list.size() > 0){
|
|
|
bo.setId(list.get(0).getId());
|
|
|
- tblExpressStaticsService.updateByBo(bo);
|
|
|
+ SpringUtils.getBean(ITblExpressStaticsService.class).updateByBo(bo);
|
|
|
}else{
|
|
|
- tblExpressStaticsService.insertByBo(bo);
|
|
|
+ SpringUtils.getBean(ITblExpressStaticsService.class).insertByBo(bo);
|
|
|
}
|
|
|
return R.ok(bo);
|
|
|
}catch (Exception e){
|