merge:冲突处理
This commit is contained in:
@@ -16,6 +16,7 @@ import org.nl.modules.common.exception.BadRequestException;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ import java.util.Set;
|
|||||||
@Service
|
@Service
|
||||||
public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMapper, MdPbPapervehicle> implements IMdPbPapervehicleService {
|
public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMapper, MdPbPapervehicle> implements IMdPbPapervehicleService {
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private MdPbPapervehicleMapper mdPbPapervehicleMapper;
|
private MdPbPapervehicleMapper mdPbPapervehicleMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -46,7 +47,7 @@ public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMap
|
|||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
entity.setIvt_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
entity.setIvt_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
entity.setUpdate_optid(Long.valueOf(currentUserId));
|
entity.setUpdate_optid(currentUserId);
|
||||||
entity.setUpdate_optname(nickName);
|
entity.setUpdate_optname(nickName);
|
||||||
entity.setUpdate_time(now);
|
entity.setUpdate_time(now);
|
||||||
mdPbPapervehicleMapper.insert(entity);
|
mdPbPapervehicleMapper.insert(entity);
|
||||||
@@ -62,7 +63,7 @@ public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMap
|
|||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
entity.setUpdate_optid(Long.valueOf(currentUserId));
|
entity.setUpdate_optid(currentUserId);
|
||||||
entity.setUpdate_optname(nickName);
|
entity.setUpdate_optname(nickName);
|
||||||
entity.setUpdate_time(now);
|
entity.setUpdate_time(now);
|
||||||
|
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
///*
|
|
||||||
// * Copyright 2019-2020 Zheng Jie
|
|
||||||
// *
|
|
||||||
// * Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// * you may not use this file except in compliance with the License.
|
|
||||||
// * You may obtain a copy of the License at
|
|
||||||
// *
|
|
||||||
// * http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
// *
|
|
||||||
// * Unless required by applicable law or agreed to in writing, software
|
|
||||||
// * distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// * See the License for the specific language governing permissions and
|
|
||||||
// * limitations under the License.
|
|
||||||
// */
|
|
||||||
//package org.nl.modules.tools.domain;
|
|
||||||
//
|
|
||||||
//import cn.hutool.core.bean.BeanUtil;
|
|
||||||
//import cn.hutool.core.bean.copier.CopyOptions;
|
|
||||||
//import lombok.Getter;
|
|
||||||
//import lombok.NoArgsConstructor;
|
|
||||||
//import lombok.Setter;
|
|
||||||
//import org.nl.modules.common.base.BaseEntity;
|
|
||||||
//
|
|
||||||
//import javax.persistence.*;
|
|
||||||
//import java.io.Serializable;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @author Zheng Jie
|
|
||||||
// * @date 2019-09-05
|
|
||||||
// */
|
|
||||||
//@Getter
|
|
||||||
//@Setter
|
|
||||||
//@Entity
|
|
||||||
//@Table(name = "tool_local_storage")
|
|
||||||
//@NoArgsConstructor
|
|
||||||
//public class LocalStorage extends BaseEntity implements Serializable {
|
|
||||||
//
|
|
||||||
// @Id
|
|
||||||
// @Column(name = "storage_id")
|
|
||||||
//
|
|
||||||
// @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
||||||
// private Long id;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private String realName;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private String name;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private String suffix;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private String path;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private String type;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// private String size;
|
|
||||||
//
|
|
||||||
// public LocalStorage(String realName, String name, String suffix, String path, String type, String size) {
|
|
||||||
// this.realName = realName;
|
|
||||||
// this.name = name;
|
|
||||||
// this.suffix = suffix;
|
|
||||||
// this.path = path;
|
|
||||||
// this.type = type;
|
|
||||||
// this.size = size;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public void copy(LocalStorage source) {
|
|
||||||
// BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2019-2020 Zheng Jie
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.nl.modules.tools.repository;
|
|
||||||
|
|
||||||
import org.nl.modules.tools.domain.LocalStorage;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Zheng Jie
|
|
||||||
* @date 2019-09-05
|
|
||||||
*/
|
|
||||||
public interface LocalStorageRepository extends JpaRepository<LocalStorage, Long>, JpaSpecificationExecutor<LocalStorage> {
|
|
||||||
|
|
||||||
@Query(value = "select a from LocalStorage a where a.name = ?1")
|
|
||||||
LocalStorage findByName(String name);
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
//import org.nl.modules.common.exception.BadRequestException;
|
//import org.nl.modules.common.exception.BadRequestException;
|
||||||
//import org.nl.modules.common.utils.FileUtil;
|
//import org.nl.modules.common.utils.FileUtil;
|
||||||
//import org.nl.modules.logging.annotation.Log;
|
//import org.nl.modules.logging.annotation.Log;
|
||||||
//import org.nl.modules.tools.domain.LocalStorage;
|
//
|
||||||
//import org.nl.modules.tools.service.LocalStorageService;
|
//import org.nl.modules.tools.service.LocalStorageService;
|
||||||
//import org.nl.modules.tools.service.dto.LocalStorageQueryCriteria;
|
//import org.nl.modules.tools.service.dto.LocalStorageQueryCriteria;
|
||||||
//import org.springframework.data.domain.Pageable;
|
//import org.springframework.data.domain.Pageable;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
//package org.nl.modules.tools.service;
|
//package org.nl.modules.tools.service;
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//import org.nl.modules.tools.domain.LocalStorage;
|
//
|
||||||
//import org.nl.modules.tools.service.dto.LocalStorageDto;
|
//import org.nl.modules.tools.service.dto.LocalStorageDto;
|
||||||
//import org.nl.modules.tools.service.dto.LocalStorageQueryCriteria;
|
//import org.nl.modules.tools.service.dto.LocalStorageQueryCriteria;
|
||||||
//import org.springframework.data.domain.Pageable;
|
//import org.springframework.data.domain.Pageable;
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
//import org.nl.modules.common.utils.PageUtil;
|
//import org.nl.modules.common.utils.PageUtil;
|
||||||
//import org.nl.modules.common.utils.QueryHelp;
|
//import org.nl.modules.common.utils.QueryHelp;
|
||||||
//import org.nl.modules.common.utils.ValidationUtil;
|
//import org.nl.modules.common.utils.ValidationUtil;
|
||||||
//import org.nl.modules.tools.domain.LocalStorage;
|
//
|
||||||
//import org.nl.modules.tools.repository.LocalStorageRepository;
|
//
|
||||||
//import org.nl.modules.tools.service.LocalStorageService;
|
//import org.nl.modules.tools.service.LocalStorageService;
|
||||||
//import org.nl.modules.tools.service.dto.LocalStorageDto;
|
//import org.nl.modules.tools.service.dto.LocalStorageDto;
|
||||||
//import org.nl.modules.tools.service.dto.LocalStorageQueryCriteria;
|
//import org.nl.modules.tools.service.dto.LocalStorageQueryCriteria;
|
||||||
@@ -56,24 +56,24 @@
|
|||||||
//@RequiredArgsConstructor
|
//@RequiredArgsConstructor
|
||||||
//public class LocalStorageServiceImpl implements LocalStorageService {
|
//public class LocalStorageServiceImpl implements LocalStorageService {
|
||||||
//
|
//
|
||||||
// private final LocalStorageRepository localStorageRepository;
|
// private final IToolLocalStorageService IToolLocalStorageService;
|
||||||
// private final LocalStorageMapper localStorageMapper;
|
// private final LocalStorageMapper localStorageMapper;
|
||||||
// private final FileProperties properties;
|
// private final FileProperties properties;
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public Object queryAll(LocalStorageQueryCriteria criteria, Pageable pageable) {
|
// public Object queryAll(LocalStorageQueryCriteria criteria, Pageable pageable) {
|
||||||
// Page<LocalStorage> page = localStorageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
// Page<LocalStorage> page = IToolLocalStorageService.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
||||||
// return PageUtil.toPage(page.map(localStorageMapper::toDto));
|
// return PageUtil.toPage(page.map(localStorageMapper::toDto));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public List<LocalStorageDto> queryAll(LocalStorageQueryCriteria criteria) {
|
// public List<LocalStorageDto> queryAll(LocalStorageQueryCriteria criteria) {
|
||||||
// return localStorageMapper.toDto(localStorageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)));
|
// return localStorageMapper.toDto(IToolLocalStorageService.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public LocalStorageDto findById(Long id) {
|
// public LocalStorageDto findById(Long id) {
|
||||||
// LocalStorage localStorage = localStorageRepository.findById(id).orElseGet(LocalStorage::new);
|
// LocalStorage localStorage = IToolLocalStorageService.findById(id).orElseGet(LocalStorage::new);
|
||||||
// ValidationUtil.isNull(localStorage.getId(), "LocalStorage", "id", id);
|
// ValidationUtil.isNull(localStorage.getId(), "LocalStorage", "id", id);
|
||||||
// return localStorageMapper.toDto(localStorage);
|
// return localStorageMapper.toDto(localStorage);
|
||||||
// }
|
// }
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
// type,
|
// type,
|
||||||
// FileUtil.getSize(multipartFile.getSize())
|
// FileUtil.getSize(multipartFile.getSize())
|
||||||
// );
|
// );
|
||||||
// return localStorageRepository.save(localStorage);
|
// return IToolLocalStorageService.save(localStorage);
|
||||||
// } catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
// FileUtil.del(file);
|
// FileUtil.del(file);
|
||||||
// throw e;
|
// throw e;
|
||||||
@@ -108,19 +108,19 @@
|
|||||||
// @Override
|
// @Override
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
// public void update(LocalStorage resources) {
|
// public void update(LocalStorage resources) {
|
||||||
// LocalStorage localStorage = localStorageRepository.findById(resources.getId()).orElseGet(LocalStorage::new);
|
// LocalStorage localStorage = IToolLocalStorageService.findById(resources.getId()).orElseGet(LocalStorage::new);
|
||||||
// ValidationUtil.isNull(localStorage.getId(), "LocalStorage", "id", resources.getId());
|
// ValidationUtil.isNull(localStorage.getId(), "LocalStorage", "id", resources.getId());
|
||||||
// localStorage.copy(resources);
|
// localStorage.copy(resources);
|
||||||
// localStorageRepository.save(localStorage);
|
// IToolLocalStorageService.save(localStorage);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
// public void deleteAll(Long[] ids) {
|
// public void deleteAll(Long[] ids) {
|
||||||
// for (Long id : ids) {
|
// for (Long id : ids) {
|
||||||
// LocalStorage storage = localStorageRepository.findById(id).orElseGet(LocalStorage::new);
|
// LocalStorage storage = IToolLocalStorageService.findById(id).orElseGet(LocalStorage::new);
|
||||||
// FileUtil.del(storage.getPath());
|
// FileUtil.del(storage.getPath());
|
||||||
// localStorageRepository.delete(storage);
|
// IToolLocalStorageService.delete(storage);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
//import org.mapstruct.Mapper;
|
//import org.mapstruct.Mapper;
|
||||||
//import org.mapstruct.ReportingPolicy;
|
//import org.mapstruct.ReportingPolicy;
|
||||||
//import org.nl.modules.common.base.BaseMapper;
|
//import org.nl.modules.common.base.BaseMapper;
|
||||||
//import org.nl.modules.tools.domain.LocalStorage;
|
//
|
||||||
//import org.nl.modules.tools.service.dto.LocalStorageDto;
|
//import org.nl.modules.tools.service.dto.LocalStorageDto;
|
||||||
//
|
//
|
||||||
///**
|
///**
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import static org.quartz.TriggerBuilder.newTrigger;
|
|||||||
public class QuartzManage {
|
public class QuartzManage {
|
||||||
private static final String JOB_NAME = "TASK_";
|
private static final String JOB_NAME = "TASK_";
|
||||||
|
|
||||||
@Resource(name = "scheduler")
|
@Resource(name = "quartzScheduler")
|
||||||
private Scheduler scheduler;
|
private Scheduler scheduler;
|
||||||
|
|
||||||
public void addJob(SysQuartzJob quartzJob) {
|
public void addJob(SysQuartzJob quartzJob) {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import org.nl.system.service.user.ISysUserService;
|
|||||||
import org.nl.system.service.user.dao.SysUser;
|
import org.nl.system.service.user.dao.SysUser;
|
||||||
import org.nl.system.service.user.dto.OnlineUserDto;
|
import org.nl.system.service.user.dto.OnlineUserDto;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ import java.io.Serializable;
|
|||||||
* @since 2022-12-20
|
* @since 2022-12-20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@TableName("tool_local_storage")
|
@TableName("tool_local_storage")
|
||||||
public class ToolLocalStorage implements Serializable {
|
public class ToolLocalStorage implements Serializable {
|
||||||
@@ -78,5 +80,14 @@ public class ToolLocalStorage implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String update_time;
|
private String update_time;
|
||||||
|
|
||||||
|
public ToolLocalStorage(String realName, String name, String suffix, String path, String type, String size) {
|
||||||
|
this.real_name = realName;
|
||||||
|
this.name = name;
|
||||||
|
this.suffix = suffix;
|
||||||
|
this.path = path;
|
||||||
|
this.type = type;
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.nl.modules.common.config.FileProperties;
|
import org.nl.modules.common.config.FileProperties;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
import org.nl.modules.tools.domain.LocalStorage;
|
|
||||||
import org.nl.modules.tools.repository.LocalStorageRepository;
|
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
|
import org.nl.system.service.tools.IToolLocalStorageService;
|
||||||
|
import org.nl.system.service.tools.dao.ToolLocalStorage;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -39,7 +41,7 @@ public class AutoSaveIvtExcel {
|
|||||||
|
|
||||||
private final FileProperties properties;
|
private final FileProperties properties;
|
||||||
|
|
||||||
private final LocalStorageRepository localStorageRepository;
|
private final IToolLocalStorageService iToolLocalStorageService;
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -106,14 +108,14 @@ public class AutoSaveIvtExcel {
|
|||||||
String nowStr = format.format(date) + "-";
|
String nowStr = format.format(date) + "-";
|
||||||
String path = properties.getPath().getPath() + type + File.separator + nowStr + "0库存报表.xls";
|
String path = properties.getPath().getPath() + type + File.separator + nowStr + "0库存报表.xls";
|
||||||
FileOutputStream fileOut = new FileOutputStream(path);
|
FileOutputStream fileOut = new FileOutputStream(path);
|
||||||
LocalStorage localStorage = new LocalStorage(
|
ToolLocalStorage localStorage = new ToolLocalStorage(
|
||||||
nowStr + "0库存报表.xls",
|
nowStr + "0库存报表.xls",
|
||||||
nowStr + "0库存报表",
|
nowStr + "0库存报表",
|
||||||
"xls",
|
"xls",
|
||||||
path,
|
path,
|
||||||
type,
|
type,
|
||||||
"");
|
"");
|
||||||
localStorageRepository.save(localStorage);
|
iToolLocalStorageService.save(localStorage);
|
||||||
workbook.write(fileOut);
|
workbook.write(fileOut);
|
||||||
|
|
||||||
fileOut.close();
|
fileOut.close();
|
||||||
|
|||||||
@@ -12,9 +12,11 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.nl.modules.common.config.FileProperties;
|
import org.nl.modules.common.config.FileProperties;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
import org.nl.modules.tools.domain.LocalStorage;
|
|
||||||
import org.nl.modules.tools.repository.LocalStorageRepository;
|
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.system.service.tools.IToolLocalStorageService;
|
||||||
|
import org.nl.system.service.tools.dao.ToolLocalStorage;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -34,7 +36,7 @@ public class AutoSaveIvtExcelTwo {
|
|||||||
|
|
||||||
private final FileProperties properties;
|
private final FileProperties properties;
|
||||||
|
|
||||||
private final LocalStorageRepository localStorageRepository;
|
private final IToolLocalStorageService iToolLocalStorageService;
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -101,14 +103,14 @@ public class AutoSaveIvtExcelTwo {
|
|||||||
String nowStr = format.format(date) + "-";
|
String nowStr = format.format(date) + "-";
|
||||||
String path = properties.getPath().getPath() + type + File.separator + nowStr + "8库存报表.xls";
|
String path = properties.getPath().getPath() + type + File.separator + nowStr + "8库存报表.xls";
|
||||||
FileOutputStream fileOut = new FileOutputStream(path);
|
FileOutputStream fileOut = new FileOutputStream(path);
|
||||||
LocalStorage localStorage = new LocalStorage(
|
ToolLocalStorage localStorage = new ToolLocalStorage(
|
||||||
nowStr + "8库存报表.xls",
|
nowStr + "8库存报表.xls",
|
||||||
nowStr + "8库存报表",
|
nowStr + "8库存报表",
|
||||||
"xls",
|
"xls",
|
||||||
path,
|
path,
|
||||||
type,
|
type,
|
||||||
"");
|
"");
|
||||||
localStorageRepository.save(localStorage);
|
iToolLocalStorageService.save(localStorage);
|
||||||
workbook.write(fileOut);
|
workbook.write(fileOut);
|
||||||
|
|
||||||
fileOut.close();
|
fileOut.close();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -16,12 +17,14 @@ import org.hibernate.criterion.Example;
|
|||||||
import org.nl.modules.common.config.FileProperties;
|
import org.nl.modules.common.config.FileProperties;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
import org.nl.modules.common.utils.ValidationUtil;
|
import org.nl.modules.common.utils.ValidationUtil;
|
||||||
import org.nl.modules.tools.domain.LocalStorage;
|
|
||||||
import org.nl.modules.tools.repository.LocalStorageRepository;
|
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
|
import org.nl.system.service.tools.IToolLocalStorageService;
|
||||||
|
import org.nl.system.service.tools.dao.ToolLocalStorage;
|
||||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
@@ -44,7 +47,7 @@ public class AutoSendIvtExcel {
|
|||||||
|
|
||||||
private final FileProperties properties;
|
private final FileProperties properties;
|
||||||
|
|
||||||
private final LocalStorageRepository localStorageRepository;
|
private final IToolLocalStorageService iToolLocalStorageService;
|
||||||
|
|
||||||
private final LmsToMesService lmsToMesService;
|
private final LmsToMesService lmsToMesService;
|
||||||
|
|
||||||
@@ -114,21 +117,21 @@ public class AutoSendIvtExcel {
|
|||||||
String path = properties.getPath().getPath() + type + File.separator + "当天库存报表.xls";
|
String path = properties.getPath().getPath() + type + File.separator + "当天库存报表.xls";
|
||||||
FileOutputStream fileOut = new FileOutputStream(path);
|
FileOutputStream fileOut = new FileOutputStream(path);
|
||||||
|
|
||||||
LocalStorage localStorage1 = new LocalStorage();
|
ToolLocalStorage localStorage1 = new ToolLocalStorage();
|
||||||
localStorage1.setName("当天库存报表");
|
localStorage1.setName("当天库存报表");
|
||||||
LocalStorage local = localStorageRepository.findByName("当天库存报表");
|
ToolLocalStorage local = iToolLocalStorageService.getOne(new QueryWrapper<ToolLocalStorage>().eq("name","当天库存报表"));
|
||||||
if (ObjectUtil.isNotEmpty(local)){
|
if (ObjectUtil.isNotEmpty(local)){
|
||||||
local.setUpdateTime(DateUtil.date().toTimestamp());
|
local.setUpdate_time(DateUtil.now());
|
||||||
localStorageRepository.save(local);
|
iToolLocalStorageService.save(local);
|
||||||
}else {
|
}else {
|
||||||
LocalStorage localStorage = new LocalStorage(
|
ToolLocalStorage localStorage = new ToolLocalStorage(
|
||||||
"当天库存报表.xls",
|
"当天库存报表.xls",
|
||||||
"当天库存报表",
|
"当天库存报表",
|
||||||
"xls",
|
"xls",
|
||||||
path,
|
path,
|
||||||
type,
|
type,
|
||||||
"");
|
"");
|
||||||
localStorageRepository.save(localStorage);
|
iToolLocalStorageService.save(localStorage);
|
||||||
}
|
}
|
||||||
workbook.write(fileOut);
|
workbook.write(fileOut);
|
||||||
|
|
||||||
|
|||||||
@@ -21,12 +21,12 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.modules.common.config.FileProperties;
|
import org.nl.modules.common.config.FileProperties;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
import org.nl.modules.tools.domain.LocalStorage;
|
|
||||||
import org.nl.modules.tools.repository.LocalStorageRepository;
|
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||||
|
import org.nl.system.service.tools.IToolLocalStorageService;
|
||||||
import org.nl.wms.createmsg.CreateMsg;
|
import org.nl.wms.createmsg.CreateMsg;
|
||||||
import org.nl.wms.ext.mes.service.LmsToMesService;
|
import org.nl.wms.ext.mes.service.LmsToMesService;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
@@ -50,7 +50,7 @@ public class AutoSendSalesIvt {
|
|||||||
|
|
||||||
private final FileProperties properties;
|
private final FileProperties properties;
|
||||||
|
|
||||||
private final LocalStorageRepository localStorageRepository;
|
private final org.nl.system.service.tools.IToolLocalStorageService IToolLocalStorageService;
|
||||||
|
|
||||||
private final LmsToMesService lmsToMesService;
|
private final LmsToMesService lmsToMesService;
|
||||||
|
|
||||||
@@ -495,7 +495,7 @@ public class AutoSendSalesIvt {
|
|||||||
path,
|
path,
|
||||||
type,
|
type,
|
||||||
"");
|
"");
|
||||||
localStorageRepository.save(localStorage);*/
|
IToolLocalStorageService.save(localStorage);*/
|
||||||
|
|
||||||
// 调用接口传送图片名称
|
// 调用接口传送图片名称
|
||||||
JSONObject resultParam = lmsToMesService.sendSalesIvtMsg(fileName);
|
JSONObject resultParam = lmsToMesService.sendSalesIvtMsg(fileName);
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ import com.alibaba.fastjson.JSONArray;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.utils.CodeUtil;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
|||||||
Reference in New Issue
Block a user