merge:冲突处理

This commit is contained in:
zhangzq
2024-06-07 16:59:20 +08:00
parent c33ffe440b
commit 91e0ce0752
15 changed files with 64 additions and 150 deletions

View File

@@ -16,6 +16,7 @@ import org.nl.modules.common.exception.BadRequestException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Map;
import java.util.Set;
@@ -28,7 +29,7 @@ import java.util.Set;
@Service
public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMapper, MdPbPapervehicle> implements IMdPbPapervehicleService {
@Autowired
@Resource
private MdPbPapervehicleMapper mdPbPapervehicleMapper;
@Override
@@ -46,7 +47,7 @@ public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMap
String now = DateUtil.now();
entity.setIvt_id(IdUtil.getSnowflake(1, 1).nextIdStr());
entity.setUpdate_optid(Long.valueOf(currentUserId));
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);
mdPbPapervehicleMapper.insert(entity);
@@ -62,7 +63,7 @@ public class MdPbPapervehicleServiceImpl extends ServiceImpl<MdPbPapervehicleMap
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
entity.setUpdate_optid(Long.valueOf(currentUserId));
entity.setUpdate_optid(currentUserId);
entity.setUpdate_optname(nickName);
entity.setUpdate_time(now);

View File

@@ -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));
// }
//}

View File

@@ -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);
}

View File

@@ -21,7 +21,7 @@
//import org.nl.modules.common.exception.BadRequestException;
//import org.nl.modules.common.utils.FileUtil;
//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.dto.LocalStorageQueryCriteria;
//import org.springframework.data.domain.Pageable;

View File

@@ -16,7 +16,7 @@
//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.LocalStorageQueryCriteria;
//import org.springframework.data.domain.Pageable;

View File

@@ -29,8 +29,8 @@
//import org.nl.modules.common.utils.PageUtil;
//import org.nl.modules.common.utils.QueryHelp;
//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.dto.LocalStorageDto;
//import org.nl.modules.tools.service.dto.LocalStorageQueryCriteria;
@@ -56,24 +56,24 @@
//@RequiredArgsConstructor
//public class LocalStorageServiceImpl implements LocalStorageService {
//
// private final LocalStorageRepository localStorageRepository;
// private final IToolLocalStorageService IToolLocalStorageService;
// private final LocalStorageMapper localStorageMapper;
// private final FileProperties properties;
//
// @Override
// 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));
// }
//
// @Override
// 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
// 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);
// return localStorageMapper.toDto(localStorage);
// }
@@ -98,7 +98,7 @@
// type,
// FileUtil.getSize(multipartFile.getSize())
// );
// return localStorageRepository.save(localStorage);
// return IToolLocalStorageService.save(localStorage);
// } catch (Exception e) {
// FileUtil.del(file);
// throw e;
@@ -108,19 +108,19 @@
// @Override
// @Transactional(rollbackFor = Exception.class)
// 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());
// localStorage.copy(resources);
// localStorageRepository.save(localStorage);
// IToolLocalStorageService.save(localStorage);
// }
//
// @Override
// @Transactional(rollbackFor = Exception.class)
// public void deleteAll(Long[] 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());
// localStorageRepository.delete(storage);
// IToolLocalStorageService.delete(storage);
// }
// }
//

View File

@@ -19,7 +19,7 @@
//import org.mapstruct.Mapper;
//import org.mapstruct.ReportingPolicy;
//import org.nl.modules.common.base.BaseMapper;
//import org.nl.modules.tools.domain.LocalStorage;
//
//import org.nl.modules.tools.service.dto.LocalStorageDto;
//
///**

View File

@@ -22,7 +22,7 @@ import static org.quartz.TriggerBuilder.newTrigger;
public class QuartzManage {
private static final String JOB_NAME = "TASK_";
@Resource(name = "scheduler")
@Resource(name = "quartzScheduler")
private Scheduler scheduler;
public void addJob(SysQuartzJob quartzJob) {

View File

@@ -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.dto.OnlineUserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Pageable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@@ -16,6 +17,7 @@ import java.io.Serializable;
* @since 2022-12-20
*/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("tool_local_storage")
public class ToolLocalStorage implements Serializable {
@@ -78,5 +80,14 @@ public class ToolLocalStorage implements Serializable {
*/
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;
}
}

View File

@@ -14,12 +14,14 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.nl.modules.common.config.FileProperties;
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.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
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.RedissonClient;
import org.springframework.stereotype.Component;
@@ -39,7 +41,7 @@ public class AutoSaveIvtExcel {
private final FileProperties properties;
private final LocalStorageRepository localStorageRepository;
private final IToolLocalStorageService iToolLocalStorageService;
@SneakyThrows
public void run() {
@@ -106,14 +108,14 @@ public class AutoSaveIvtExcel {
String nowStr = format.format(date) + "-";
String path = properties.getPath().getPath() + type + File.separator + nowStr + "0库存报表.xls";
FileOutputStream fileOut = new FileOutputStream(path);
LocalStorage localStorage = new LocalStorage(
ToolLocalStorage localStorage = new ToolLocalStorage(
nowStr + "0库存报表.xls",
nowStr + "0库存报表",
"xls",
path,
type,
"");
localStorageRepository.save(localStorage);
iToolLocalStorageService.save(localStorage);
workbook.write(fileOut);
fileOut.close();

View File

@@ -12,9 +12,11 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.nl.modules.common.config.FileProperties;
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.system.service.tools.IToolLocalStorageService;
import org.nl.system.service.tools.dao.ToolLocalStorage;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
@@ -34,7 +36,7 @@ public class AutoSaveIvtExcelTwo {
private final FileProperties properties;
private final LocalStorageRepository localStorageRepository;
private final IToolLocalStorageService iToolLocalStorageService;
@SneakyThrows
public void run() {
@@ -101,14 +103,14 @@ public class AutoSaveIvtExcelTwo {
String nowStr = format.format(date) + "-";
String path = properties.getPath().getPath() + type + File.separator + nowStr + "8库存报表.xls";
FileOutputStream fileOut = new FileOutputStream(path);
LocalStorage localStorage = new LocalStorage(
ToolLocalStorage localStorage = new ToolLocalStorage(
nowStr + "8库存报表.xls",
nowStr + "8库存报表",
"xls",
path,
type,
"");
localStorageRepository.save(localStorage);
iToolLocalStorageService.save(localStorage);
workbook.write(fileOut);
fileOut.close();

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
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.utils.FileUtil;
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.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
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.redisson.api.RLock;
import org.redisson.api.RedissonClient;
@@ -44,7 +47,7 @@ public class AutoSendIvtExcel {
private final FileProperties properties;
private final LocalStorageRepository localStorageRepository;
private final IToolLocalStorageService iToolLocalStorageService;
private final LmsToMesService lmsToMesService;
@@ -113,22 +116,22 @@ public class AutoSendIvtExcel {
String nowStr = format.format(date);
String path = properties.getPath().getPath() + type + File.separator + "当天库存报表.xls";
FileOutputStream fileOut = new FileOutputStream(path);
LocalStorage localStorage1 = new LocalStorage();
ToolLocalStorage localStorage1 = new ToolLocalStorage();
localStorage1.setName("当天库存报表");
LocalStorage local = localStorageRepository.findByName("当天库存报表");
ToolLocalStorage local = iToolLocalStorageService.getOne(new QueryWrapper<ToolLocalStorage>().eq("name","当天库存报表"));
if (ObjectUtil.isNotEmpty(local)){
local.setUpdateTime(DateUtil.date().toTimestamp());
localStorageRepository.save(local);
local.setUpdate_time(DateUtil.now());
iToolLocalStorageService.save(local);
}else {
LocalStorage localStorage = new LocalStorage(
ToolLocalStorage localStorage = new ToolLocalStorage(
"当天库存报表.xls",
"当天库存报表",
"xls",
path,
type,
"");
localStorageRepository.save(localStorage);
iToolLocalStorageService.save(localStorage);
}
workbook.write(fileOut);

View File

@@ -21,12 +21,12 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.nl.common.utils.IdUtil;
import org.nl.modules.common.config.FileProperties;
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.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
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.ext.mes.service.LmsToMesService;
import org.redisson.api.RLock;
@@ -50,7 +50,7 @@ public class AutoSendSalesIvt {
private final FileProperties properties;
private final LocalStorageRepository localStorageRepository;
private final org.nl.system.service.tools.IToolLocalStorageService IToolLocalStorageService;
private final LmsToMesService lmsToMesService;
@@ -269,7 +269,7 @@ public class AutoSendSalesIvt {
.map(row -> row.getDoubleValue("canuse_qty"))
.reduce(Double::sum).orElse(0.000);
resultJson.put("day5", NumberUtil.round(qty90, 3));
// 合计
double day_sum = NumberUtil.add(qty15, qty15_30, qty31_60, qty61_90, qty90).doubleValue();
resultJson.put("day_sum", NumberUtil.round(day_sum, 3));
@@ -495,7 +495,7 @@ public class AutoSendSalesIvt {
path,
type,
"");
localStorageRepository.save(localStorage);*/
IToolLocalStorageService.save(localStorage);*/
// 调用接口传送图片名称
JSONObject resultParam = lmsToMesService.sendSalesIvtMsg(fileName);

View File

@@ -16,10 +16,10 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.CodeUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
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.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;