发货 流程
This commit is contained in:
parent
8c0baa7280
commit
580e4d573d
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.bonus.gzgqj.business.plan.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FileUploadVo {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
private String fileName;
|
||||||
|
/**
|
||||||
|
* 文件路径
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
/**
|
||||||
|
* 业务id
|
||||||
|
*/
|
||||||
|
private String ownId;
|
||||||
|
|
||||||
|
private String createTime;
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String creator;
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务表名称
|
||||||
|
*/
|
||||||
|
private String modelTable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务表名称
|
||||||
|
*/
|
||||||
|
private String suffix;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.bonus.gzgqj.business.plan.mapper;
|
||||||
|
|
||||||
|
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface FileUploadMapper {
|
||||||
|
/**
|
||||||
|
* 文件上传
|
||||||
|
* @param vo
|
||||||
|
*/
|
||||||
|
void insertFileUpload(FileUploadVo vo);
|
||||||
|
}
|
||||||
|
|
@ -5,10 +5,10 @@ import cn.hutool.core.collection.ListUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.bonus.gzgqj.business.plan.entity.*;
|
import com.bonus.gzgqj.business.plan.entity.*;
|
||||||
import com.bonus.gzgqj.business.plan.mapper.PlanOutMapper;
|
import com.bonus.gzgqj.business.plan.mapper.PlanOutMapper;
|
||||||
import com.bonus.gzgqj.manager.common.util.R;
|
import com.bonus.gzgqj.business.utils.FileUploadService;
|
||||||
import com.bonus.gzgqj.manager.common.util.SecurityUtils;
|
import com.bonus.gzgqj.business.utils.IDUtils;
|
||||||
import com.bonus.gzgqj.manager.common.util.StringHelper;
|
import com.bonus.gzgqj.business.utils.SystemUtils;
|
||||||
import com.bonus.gzgqj.manager.common.util.StringUtils;
|
import com.bonus.gzgqj.manager.common.util.*;
|
||||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -16,21 +16,28 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.omg.CORBA.INTERNAL;
|
import org.omg.CORBA.INTERNAL;
|
||||||
|
import org.omg.CORBA.PUBLIC_MEMBER;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
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 org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PlanOutServiceImpl implements PlanOutService{
|
public class PlanOutServiceImpl implements PlanOutService{
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PlanOutMapper mapper;
|
private PlanOutMapper mapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FileUploadService uploadService;
|
||||||
/**
|
/**
|
||||||
* 查询工程需要的系那个
|
* 查询工程需要的系那个
|
||||||
* @param data
|
* @param data
|
||||||
|
|
@ -117,10 +124,42 @@ public class PlanOutServiceImpl implements PlanOutService{
|
||||||
//出库记录单存储
|
//出库记录单存储
|
||||||
vo.setCreater(userId+"");
|
vo.setCreater(userId+"");
|
||||||
int num=mapper.insertProOutInfo(vo);
|
int num=mapper.insertProOutInfo(vo);
|
||||||
|
//存储文件
|
||||||
|
List<FileUploadVo> fileList=uploadService.uploadImage(files,vo.getId(),"t_plan_out");
|
||||||
|
if(StringUtils.isEmpty(fileList) || fileList.size()!=files.length){
|
||||||
|
return ServerResponse.createErroe("发货失败");
|
||||||
|
}
|
||||||
if(num>0){
|
if(num>0){
|
||||||
//计算 本次全部发货数量及整改数量 最后同步到 工程 -计划-发货统计表中
|
//计算 本次全部发货数量及整改数量 最后同步到 工程 -计划-发货统计表中
|
||||||
int allFhNum=0;
|
int allFhNum=0;
|
||||||
int allTzNum=0;
|
int allTzNum=0;
|
||||||
|
//处理 发货单
|
||||||
|
boolean a= planOutInfo(list,vo,allFhNum,allTzNum);
|
||||||
|
if(!a){
|
||||||
|
return ServerResponse.createErroe("发货失败");
|
||||||
|
}
|
||||||
|
//处理新增发货单
|
||||||
|
boolean b=addOutPlanInfo(addList,vo,allFhNum);
|
||||||
|
if(!b){
|
||||||
|
return ServerResponse.createErroe("发货失败");
|
||||||
|
}
|
||||||
|
//处理 发货后 统计及 详情数据
|
||||||
|
boolean c= updateProPlan(vo,allFhNum,allTzNum);
|
||||||
|
if(!c){
|
||||||
|
return ServerResponse.createErroe("发货失败");
|
||||||
|
}
|
||||||
|
return ServerResponse.createBySuccessMsg("发货成功");
|
||||||
|
}else {
|
||||||
|
return ServerResponse.createErroe("发货失败");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return ServerResponse.createSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean planOutInfo(List<ProOutDetail> list,ProOutInfoVo vo,int allFhNum, int allTzNum){
|
||||||
|
try {
|
||||||
for (ProOutDetail details:list){
|
for (ProOutDetail details:list){
|
||||||
allFhNum=allFhNum+details.getFhNum();
|
allFhNum=allFhNum+details.getFhNum();
|
||||||
allTzNum=allTzNum+details.getTzNum();
|
allTzNum=allTzNum+details.getTzNum();
|
||||||
|
|
@ -128,7 +167,7 @@ public class PlanOutServiceImpl implements PlanOutService{
|
||||||
ProNeedInfo data=mapper.getProNeedInfo(details);
|
ProNeedInfo data=mapper.getProNeedInfo(details);
|
||||||
if(data==null){
|
if(data==null){
|
||||||
mapper.deleteProOut(vo);
|
mapper.deleteProOut(vo);
|
||||||
return ServerResponse.createErroe("未找到发货内容,发货失败");
|
return false;
|
||||||
}else{
|
}else{
|
||||||
ProNeedInfo insertObj=new ProNeedInfo();
|
ProNeedInfo insertObj=new ProNeedInfo();
|
||||||
BeanUtils.copyProperties(insertObj,data);
|
BeanUtils.copyProperties(insertObj,data);
|
||||||
|
|
@ -148,11 +187,62 @@ public class PlanOutServiceImpl implements PlanOutService{
|
||||||
data.setFhNum(fhNum+fhNum2);
|
data.setFhNum(fhNum+fhNum2);
|
||||||
data.setTzNum(tzNum+tzNum2);
|
data.setTzNum(tzNum+tzNum2);
|
||||||
mapper.updateNeedInfo(data);
|
mapper.updateNeedInfo(data);
|
||||||
|
return true;
|
||||||
}else {
|
}else {
|
||||||
return ServerResponse.createErroe("发货失败");
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工程 -统计数据
|
||||||
|
* @param allTzNum
|
||||||
|
* @param vo
|
||||||
|
* @param allFhNum
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Boolean updateProPlan( ProOutInfoVo vo,int allFhNum, int allTzNum){
|
||||||
|
try {
|
||||||
|
//更新工程 总数据信息
|
||||||
|
ProPlanInfoVo data= mapper.getProPlanInfo(vo);
|
||||||
|
int recordNum=data.getRecordNum();
|
||||||
|
int outNum= data.getOutNum();
|
||||||
|
int needNum= data.getNeedNum();
|
||||||
|
recordNum=recordNum+1;
|
||||||
|
outNum=outNum+allFhNum;
|
||||||
|
data.setRecordNum(recordNum);
|
||||||
|
//发货数量
|
||||||
|
data.setOutNum(outNum);
|
||||||
|
//调整数量
|
||||||
|
data.setTzNum(allTzNum);
|
||||||
|
//更新 发货状态
|
||||||
|
if(needNum>outNum+allTzNum){
|
||||||
|
data.setStatus(1);
|
||||||
|
}else {
|
||||||
|
data.setStatus(2);
|
||||||
|
}
|
||||||
|
data.setLastDay(vo.getCreateDay());
|
||||||
|
//更新 工程-计划 -统计表
|
||||||
|
mapper.updatePriPlanInfo(data);
|
||||||
|
return true;
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 处理 新增 需求 及发货单
|
||||||
|
* 传入
|
||||||
|
* 新增集合、发货单、发货数量
|
||||||
|
*/
|
||||||
|
public Boolean addOutPlanInfo(List<ProAddInfoDetails> addList, ProOutInfoVo vo,int allFhNum){
|
||||||
|
try {
|
||||||
//是否有 新增
|
//是否有 新增
|
||||||
if(StringUtils.isNotEmpty(addList)){
|
if(StringUtils.isNotEmpty(addList)){
|
||||||
//全部新增发货清单
|
//全部新增发货清单
|
||||||
|
|
@ -176,41 +266,24 @@ public class PlanOutServiceImpl implements PlanOutService{
|
||||||
if(num2>=0){
|
if(num2>=0){
|
||||||
//新增 工程-计划-发货 清单表
|
//新增 工程-计划-发货 清单表
|
||||||
mapper.addNeedInfo(insertObj);
|
mapper.addNeedInfo(insertObj);
|
||||||
|
return true;
|
||||||
}else {
|
}else {
|
||||||
return ServerResponse.createErroe("发货失败");
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//更新工程 总数据信息
|
}catch (Exception e){
|
||||||
ProPlanInfoVo data= mapper.getProPlanInfo(vo);
|
|
||||||
int recordNum=data.getRecordNum();
|
|
||||||
int outNum= data.getOutNum();
|
|
||||||
int needNum= data.getNeedNum();
|
|
||||||
recordNum=recordNum+1;
|
|
||||||
outNum=outNum+allFhNum;
|
|
||||||
data.setRecordNum(recordNum);
|
|
||||||
//发货数量
|
|
||||||
data.setOutNum(outNum);
|
|
||||||
//调整数量
|
|
||||||
data.setTzNum(allTzNum);
|
|
||||||
//更新 发货状态
|
|
||||||
if(needNum>outNum+allTzNum){
|
|
||||||
data.setStatus(1);
|
|
||||||
}else {
|
|
||||||
data.setStatus(2);
|
|
||||||
}
|
|
||||||
data.setLastDay(vo.getCreateDay());
|
|
||||||
//更新 工程-计划 -统计表
|
|
||||||
mapper.updatePriPlanInfo(data);
|
|
||||||
|
|
||||||
}else {
|
|
||||||
return ServerResponse.createErroe("发货失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.toString(),e);
|
log.error(e.toString(),e);
|
||||||
}
|
}
|
||||||
return ServerResponse.createSuccess();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String suffx= IDUtils.getSuffix("/C/SSSK4555.PNG");
|
||||||
|
System.err.println(suffx);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.bonus.gzgqj.business.utils;
|
||||||
|
|
||||||
|
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||||
|
import com.bonus.gzgqj.business.plan.mapper.FileUploadMapper;
|
||||||
|
import com.bonus.gzgqj.manager.common.util.DateTimeHelper;
|
||||||
|
import com.bonus.gzgqj.manager.common.util.SecurityUtils;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.bonus.gzgqj.business.utils.IDUtils.getSuffix;
|
||||||
|
import static com.bonus.gzgqj.business.utils.IDUtils.isImageFileExtension;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件上传业务
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class FileUploadService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FileUploadMapper mapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件
|
||||||
|
*/
|
||||||
|
public List<FileUploadVo> uploadImage(MultipartFile[] files , String outId, String table){
|
||||||
|
List<FileUploadVo> list=new ArrayList<>();
|
||||||
|
try {
|
||||||
|
for (MultipartFile file : files) {
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
String suffix=IDUtils.getSuffix(fileName);
|
||||||
|
String newPath= SystemUtils.getUploadPath()+ DateTimeHelper.getNowYMD()+"/"+ IDUtils.createID()+suffix;
|
||||||
|
File uploadFile = new File(newPath);
|
||||||
|
//生成文件夹
|
||||||
|
if (!uploadFile.getParentFile().exists()) {
|
||||||
|
uploadFile.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
String fileType=isImageFileExtension(fileName);
|
||||||
|
// 存入临时文件
|
||||||
|
file.transferTo(uploadFile);
|
||||||
|
FileUploadVo vo=new FileUploadVo();
|
||||||
|
vo.setFileName(fileName);
|
||||||
|
vo.setFileUrl(newPath);
|
||||||
|
vo.setOwnId(outId);
|
||||||
|
vo.setModelTable(table);
|
||||||
|
vo.setSuffix(suffix);
|
||||||
|
vo.setFileType(fileType);
|
||||||
|
String userId= SecurityUtils.getUserId()+"";
|
||||||
|
vo.setCreator(userId);
|
||||||
|
list.add(vo);
|
||||||
|
mapper.insertFileUpload(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.bonus.gzgqj.business.utils;
|
||||||
|
|
||||||
|
public class IDUtils {
|
||||||
|
private static byte[] lock = new byte[0];
|
||||||
|
|
||||||
|
// 位数,默认是8位
|
||||||
|
private final static long w = 100000000;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 传入文件 名称
|
||||||
|
* @param fileName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getSuffix(String fileName){
|
||||||
|
return fileName.substring(fileName.lastIndexOf('.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.err.println(createID());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String createID() {
|
||||||
|
long r = 0;
|
||||||
|
synchronized (lock) {
|
||||||
|
r = (long) ((Math.random() + 1) * w);
|
||||||
|
}
|
||||||
|
|
||||||
|
return System.currentTimeMillis() + String.valueOf(r).substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是文件/图片
|
||||||
|
* @param name
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String isImageFileExtension(String name) {
|
||||||
|
name=name.toLowerCase();
|
||||||
|
String[] imageFormats = {"jpg", "jpeg", "png", "gif", "bmp", "tiff"};
|
||||||
|
for (String format : imageFormats) {
|
||||||
|
if (format.equals(name)) { // 判断扩展名
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "2"; // 不是支持的图片格式
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.bonus.gzgqj.business.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class SystemUtils {
|
||||||
|
|
||||||
|
public static String windowsPath;
|
||||||
|
|
||||||
|
|
||||||
|
public static String linuxPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动注入
|
||||||
|
*
|
||||||
|
* @param windowsPath
|
||||||
|
*/
|
||||||
|
@Value("${file.upload_path.windows}")
|
||||||
|
public void setWindowsPath(String windowsPath) {
|
||||||
|
SystemUtils.windowsPath = windowsPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动注入
|
||||||
|
*
|
||||||
|
* @param linuxPath
|
||||||
|
*/
|
||||||
|
@Value("${file.upload_path.linux}")
|
||||||
|
public void setLinuxPath(String linuxPath) {
|
||||||
|
SystemUtils.linuxPath = linuxPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回系统
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getSystem() {
|
||||||
|
String os = System.getProperty("os.name");
|
||||||
|
//Windows操作系统
|
||||||
|
if (os != null && os.toLowerCase().startsWith("windows")) {
|
||||||
|
return "windows";
|
||||||
|
} else if (os != null && os.toLowerCase().startsWith("linux")) {//Linux操作系统
|
||||||
|
return "linux";
|
||||||
|
} else { //其它操作系统
|
||||||
|
return "other";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件上传路径
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String getUploadPath() {
|
||||||
|
String os = getSystem();
|
||||||
|
System.err.println("当前系统是=" + os);
|
||||||
|
if ("windows".equals(os)) {
|
||||||
|
return windowsPath;
|
||||||
|
} else if ("linux".equals(os)) {
|
||||||
|
return linuxPath;
|
||||||
|
} else {
|
||||||
|
return windowsPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.bonus.gzgqj.manager.common.config;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bonus.gzgqj.business.utils.SystemUtils;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
@Configuration
|
||||||
|
public class WebMvcConfig implements WebMvcConfigurer {
|
||||||
|
/**
|
||||||
|
* 跨域支持
|
||||||
|
* @return
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public WebMvcConfigurer corsConfigurer() {
|
||||||
|
return new WebMvcConfigurer() {
|
||||||
|
@Override
|
||||||
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
|
registry.addMapping("/**").allowedMethods("*");
|
||||||
|
// registry.addMapping("/**")
|
||||||
|
// .allowedOrigins("http://example.com")
|
||||||
|
// .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||||
|
// .allowedHeaders("*")
|
||||||
|
// .allowCredentials(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部文件访问
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
String filePath= SystemUtils.getUploadPath();//获取文件上传路径
|
||||||
|
/** 本地文件上传路径 */
|
||||||
|
registry.addResourceHandler("/statics/**")
|
||||||
|
.addResourceLocations("file:" + filePath);
|
||||||
|
registry.addResourceHandler("/files/**")
|
||||||
|
.addResourceLocations("file:"+filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -38,6 +38,12 @@ zhly:
|
||||||
aq:
|
aq:
|
||||||
enable: false
|
enable: false
|
||||||
|
|
||||||
|
file:
|
||||||
|
upload_path:
|
||||||
|
windows: D://files//zg_gqj//
|
||||||
|
linux: /home/zg_gqj/files//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jwt:
|
jwt:
|
||||||
secret: your_secret_key
|
secret: your_secret_key
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.bonus.gzgqj.business.plan.mapper.FileUploadMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertFileUpload" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into bm_file_upload(
|
||||||
|
file_name,
|
||||||
|
file_url,
|
||||||
|
create_time,
|
||||||
|
creator,
|
||||||
|
model_table,
|
||||||
|
own_id,
|
||||||
|
suffix,
|
||||||
|
file_type
|
||||||
|
)values(#{fileName},#{fileUrl},now(),#{creator},#{modelTable},#{ownId},#{suffix},#{fileType})
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
</select>
|
</select>
|
||||||
<select id="getPorInfoDetail" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
<select id="getPorInfoDetail" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||||
select pni.id,pni.pro_id proId,pni.type,pni.name,pni.module,pni.module_id,pni.need_type needType,
|
select pni.id,pni.pro_id proId,pni.type,pni.name,pni.module,pni.module_id,pni.need_type needType,
|
||||||
IFNULL(pni.unit,'-') unit ,pni.need_num needNum ,pni.fh_num fhNum ,pro.`NAME` proName ,IF(pni.need_num-pni.fh_num<0,0,pni.need_num-pni.fh_num) diff
|
IFNULL(pni.unit,'-') unit ,pni.need_num needNum ,pni.fh_num fhNum ,pro.`NAME` proName ,IF(pni.need_num-pni.fh_num <0,0,pni.need_num-pni.fh_num) diff
|
||||||
from t_pro_need_info pni
|
from t_pro_need_info pni
|
||||||
LEFT JOIN bm_project pro on pni.pro_id=pro.id
|
LEFT JOIN bm_project pro on pni.pro_id=pro.id
|
||||||
<where>
|
<where>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue