后台文件上传,账单错误修改
This commit is contained in:
parent
18f00dc655
commit
1260faa8bc
7
pom.xml
7
pom.xml
|
|
@ -196,6 +196,12 @@
|
|||
<scope>system</scope>
|
||||
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/fastdfs-client-java-1.25.jar</systemPath>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>ifishSystem</finalName>
|
||||
|
|
@ -242,6 +248,7 @@
|
|||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.conf</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.ifish.service.AdInfoService;
|
|||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.ResultUtil;
|
||||
import com.ifishNew.help.FastDFSClientI;
|
||||
|
||||
/**
|
||||
* 广告信息
|
||||
|
|
@ -30,7 +31,6 @@ public class AdInfoAction {
|
|||
|
||||
@Autowired
|
||||
private AdInfoService adInfoService;
|
||||
|
||||
/**
|
||||
* 广告信息页面
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.ifish.service.IfishShopService;
|
|||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.ResultUtil;
|
||||
import com.ifishNew.help.FastDFSClientI;
|
||||
|
||||
/**
|
||||
* 商品管理action
|
||||
|
|
|
|||
|
|
@ -21,9 +21,11 @@ import com.ifish.service.InformationService;
|
|||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.ResultUtil;
|
||||
import com.ifishNew.help.FastDFSClientI;
|
||||
|
||||
/**
|
||||
* 资讯信息
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
|
|
@ -35,6 +37,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* 资讯信息页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/information.do")
|
||||
|
|
@ -45,6 +48,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* 资讯信息分页数据
|
||||
*
|
||||
* @param pageData
|
||||
* @param information
|
||||
* @return
|
||||
|
|
@ -58,6 +62,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* app展示
|
||||
*
|
||||
* @param infoId
|
||||
* @param appShow
|
||||
* @return
|
||||
|
|
@ -70,6 +75,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* 新增资讯
|
||||
*
|
||||
* @param information
|
||||
* @param fileUpload
|
||||
* @return
|
||||
|
|
@ -99,6 +105,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* 修改资讯信息
|
||||
*
|
||||
* @param information
|
||||
* @param fileUpload
|
||||
* @return
|
||||
|
|
@ -131,6 +138,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* 删除资讯
|
||||
*
|
||||
* @param infoId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -147,6 +155,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* 根据ID查询资讯信息
|
||||
*
|
||||
* @param infoId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -156,8 +165,7 @@ public class InformationAction {
|
|||
Information info = infoService.getInformationById(infoId);
|
||||
if (info.getUeditorId() != null) {
|
||||
info.setSource(InformationSourceEnum.ueditor.getKey());
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
info.setSource(InformationSourceEnum.other.getKey());
|
||||
}
|
||||
return info;
|
||||
|
|
@ -165,6 +173,7 @@ public class InformationAction {
|
|||
|
||||
/**
|
||||
* 根据ID查找编辑器信息
|
||||
*
|
||||
* @param ueditorId
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,20 +25,29 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.ifish.entity.Menu;
|
||||
import com.ifish.entity.Role;
|
||||
import com.ifish.entity.SecurityUser;
|
||||
import com.ifish.enums.AdTypeEnum;
|
||||
import com.ifish.enums.RoleEnum;
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.exception.IfishException;
|
||||
import com.ifish.menu.IfishMenu;
|
||||
import com.ifish.service.AdminService;
|
||||
import com.ifish.service.PublicService;
|
||||
import com.ifish.ueditor.ActionEnter;
|
||||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import com.ifish.util.getRemoteAddress;
|
||||
import com.ifishNew.bean.CommodityInfoBean;
|
||||
import com.ifishNew.help.FastDFSClientI;
|
||||
import com.ifishNew.mapper.Tbl_Commodity_Info_Mapper;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @ClassName: PublicAction
|
||||
* @Description: 公共页面
|
||||
* @author ggw
|
||||
*/
|
||||
|
||||
@Controller("publicAction")
|
||||
@RequestMapping("/public")
|
||||
public class PublicAction {
|
||||
|
|
@ -53,6 +62,7 @@ public class PublicAction {
|
|||
|
||||
/**
|
||||
* 登陆页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/login.do")
|
||||
|
|
@ -62,6 +72,7 @@ public class PublicAction {
|
|||
|
||||
/**
|
||||
* 文本编辑器配置
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
|
|
@ -84,6 +95,7 @@ public class PublicAction {
|
|||
|
||||
/**
|
||||
* 主页
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/index.do")
|
||||
|
|
@ -115,14 +127,11 @@ public class PublicAction {
|
|||
String redirect = "";
|
||||
if (role.equals(RoleEnum.admin.getKey())) {
|
||||
redirect = "page/admin/home.do";
|
||||
}
|
||||
else if(role.equals(RoleEnum.vender.getKey())){
|
||||
} else if (role.equals(RoleEnum.vender.getKey())) {
|
||||
redirect = "page/vender/tmpDeviceList.do";
|
||||
}
|
||||
else if(role.equals(RoleEnum.user.getKey())){
|
||||
} else if (role.equals(RoleEnum.user.getKey())) {
|
||||
redirect = "page/user/home.do";
|
||||
}
|
||||
else if(role.equals(RoleEnum.factory.getKey())){
|
||||
} else if (role.equals(RoleEnum.factory.getKey())) {
|
||||
redirect = "page/factory/tmpDeviceList.do";
|
||||
}
|
||||
return new ModelAndView("redirect:/" + redirect);
|
||||
|
|
@ -135,14 +144,17 @@ public class PublicAction {
|
|||
|
||||
/**
|
||||
* 修改密码页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/changePwd.do")
|
||||
public ModelAndView changePwd(String status) {
|
||||
return new ModelAndView("roleAll/changePwd", "status", status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/savePwd.do")
|
||||
|
|
@ -161,6 +173,7 @@ public class PublicAction {
|
|||
|
||||
/**
|
||||
* 用户注册
|
||||
*
|
||||
* @param securityUser
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -175,9 +188,12 @@ public class PublicAction {
|
|||
return new ModelAndView("redirect:/page/public/login.do", "status", SysUserEnum.failed101.getKey());
|
||||
}
|
||||
|
||||
/***********************************************测试工具接口***************************************************/
|
||||
/**
|
||||
* *********************************************测试工具接口**************************************************
|
||||
*/
|
||||
/**
|
||||
* 获取厂家列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getVenderList.do")
|
||||
|
|
@ -192,8 +208,10 @@ public class PublicAction {
|
|||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存设备mac
|
||||
*
|
||||
* @param data
|
||||
* @param subStr
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import com.ifish.util.IfishFileUtils;
|
|||
import com.ifish.util.ResultUtil;
|
||||
import com.ifishNew.bean.CommodityInfoBean;
|
||||
import com.ifishNew.help.CommodityInfoHelperI;
|
||||
import com.ifishNew.help.FastDFSClientI;
|
||||
|
||||
/**
|
||||
* 商家信息controller
|
||||
|
|
@ -37,6 +38,9 @@ public class ShopsInfoAction {
|
|||
@Autowired
|
||||
private CommodityInfoHelperI commodityInfoHelperI;
|
||||
|
||||
@Autowired
|
||||
private FastDFSClientI fastDFSClientI;
|
||||
|
||||
/**
|
||||
* 已审核商家信息页面
|
||||
*
|
||||
|
|
@ -130,7 +134,7 @@ public class ShopsInfoAction {
|
|||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis()) + ".png";
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_picture4 + "/" + userId, newImgName, fileUpload);
|
||||
newImgName = fastDFSClientI.uploadFile(IfishFileDirectory.path_picture4 + "/" + userId, newImgName, fileUpload);
|
||||
} catch (IfishException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -2602,6 +2602,9 @@ public class AdminServiceImpl implements AdminService {
|
|||
if (StringUtils.isNotBlank(isTax)) {
|
||||
isTax = BooleanEnum.NO.getKey();
|
||||
factoryList.setIsTax(isTax);
|
||||
} else {
|
||||
isTax = BooleanEnum.NO.getKey();
|
||||
factoryList.setIsTax(isTax);
|
||||
}
|
||||
//支付金额为null时
|
||||
if (payMoney == null) {
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import com.ifish.exception.IfishException;
|
|||
|
||||
/**
|
||||
* 文件处理工具类
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
|
|
@ -20,6 +21,7 @@ public class IfishFileUtils {
|
|||
|
||||
/**
|
||||
* 上传文件并校验尺寸
|
||||
*
|
||||
* @param path
|
||||
* @param fileName
|
||||
* @param multipartFile
|
||||
|
|
@ -44,8 +46,10 @@ public class IfishFileUtils {
|
|||
//传输文件
|
||||
multipartFile.transferTo(newFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param path
|
||||
* @param fileName
|
||||
* @param multipartFile
|
||||
|
|
@ -61,8 +65,10 @@ public class IfishFileUtils {
|
|||
//传输文件
|
||||
multipartFile.transferTo(newFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件
|
||||
*
|
||||
* @param path
|
||||
* @param fileName
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ public class MybatisConfig {
|
|||
|
||||
// //获取当前操作系统(servers_os为服务器设置的属性JAVA_OPTS=%JAVA_OPTS% -Dservers_os=online84)
|
||||
// String servers_os = System.getProperty("servers_os") == null ? "" : System.getProperty("servers_os");
|
||||
|
||||
dataSource.setUsername("ifish");
|
||||
dataSource.setPassword("ifish7pwd");
|
||||
dataSource.setUrl("jdbc\\:mysql\\://localhost\\:3306/myfishdb?characterEncoding\\=UTF-8");
|
||||
|
|
|
|||
|
|
@ -5,8 +5,14 @@
|
|||
*/
|
||||
package com.ifishNew.help;
|
||||
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.exception.IfishException;
|
||||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.ValidateUtil;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import javax.imageio.ImageIO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.csource.fastdfs.ClientGlobal;
|
||||
import org.csource.fastdfs.StorageClient1;
|
||||
|
|
@ -136,10 +142,47 @@ public class FastDFSClient implements FastDFSClientI {
|
|||
return "";
|
||||
}
|
||||
|
||||
if (IfishFileDirectory.env.equals("product")) {
|
||||
return IfishFileDirectory.fastDFS_url_app + url;
|
||||
} else {
|
||||
return IfishFileDirectory.fastDFS_url_local + url;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadFile(String path, String fileName, MultipartFile multipartFile, int width, int height) throws IllegalStateException, IOException {
|
||||
//检验图片尺寸
|
||||
BufferedImage sourceImg = ImageIO.read(multipartFile.getInputStream());
|
||||
int imgWidth = sourceImg.getWidth();
|
||||
int imgHeight = sourceImg.getHeight();
|
||||
if (width != imgWidth || height != imgHeight) {
|
||||
throw new IfishException(SysUserEnum.warn115.getKey(), SysUserEnum.warn115.getValue() + "(" + width + "x" + height + ")");
|
||||
}
|
||||
//文件名
|
||||
File newFile = new File(path, fileName);
|
||||
if (!newFile.exists()) {
|
||||
newFile.mkdirs();
|
||||
}
|
||||
//传输文件
|
||||
//multipartFile.transferTo(newFile);
|
||||
String value = uploadFileToFastDFS(multipartFile);
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uploadFile(String path, String fileName, MultipartFile multipartFile) throws IllegalStateException, IOException {
|
||||
//文件名
|
||||
// File newFile = new File(path, fileName);
|
||||
// if (!newFile.exists()) {
|
||||
// newFile.mkdirs();
|
||||
// }
|
||||
//传输文件
|
||||
//multipartFile.transferTo(newFile);
|
||||
String value = uploadFileToFastDFS(multipartFile);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
package com.ifishNew.help;
|
||||
|
||||
import com.ifish.domain.JsonResult;
|
||||
import java.io.IOException;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
|
|
@ -46,4 +47,8 @@ public interface FastDFSClientI {
|
|||
String uploadFile(String group_name, String local_filename, String file_ext_name) throws Exception;
|
||||
|
||||
String uploadFileToFastDFS(MultipartFile file);
|
||||
|
||||
String uploadFile(String path, String fileName, MultipartFile multipartFile, int width, int height) throws IllegalStateException, IOException;
|
||||
|
||||
String uploadFile(String path, String fileName, MultipartFile multipartFile) throws IllegalStateException, IOException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
<intercept-url pattern="/page/public/savePwd.do" access="isAuthenticated()"/>
|
||||
<!-- 允许所有人访问 -->
|
||||
<intercept-url pattern="/page/public/**" access="permitAll"/>
|
||||
<intercept-url pattern="/page/test/test" access="permitAll"/>
|
||||
<!-- 根据角色访问 -->
|
||||
<intercept-url pattern="/ueditor/ueditor.jsp" access="hasAnyRole('ROLE_ADMIN')" />
|
||||
<intercept-url pattern="/page/user/**" access="hasAnyRole('ROLE_USER')" />
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ ifish_account=ifish
|
|||
#IM\u5b98\u65b9\u624b\u673a\u53f7
|
||||
netease_phone=18501773036
|
||||
#FastDFS\u6587\u4ef6URL\u8bbf\u95ee\u8def\u5f84(\u672c\u5730\u548c\u6d4b\u8bd5\u73af\u5883)
|
||||
fastDFS_url_local=https://app.zhangxinyanv5.top/
|
||||
fastDFS_url_local=http://139.196.24.156:83/
|
||||
#FastDFS\u6587\u4ef6URL\u8bbf\u95ee\u8def\u5f84(\u6b63\u5f0f\u73af\u5883)
|
||||
fastDFS_url_app=http://app.ifish7.com/
|
||||
#\u73af\u5883(local:\u672c\u5730\u73af\u5883,test:\u6d4b\u8bd5\u73af\u5883,\u6b63\u5f0f\u73af\u5883:product)
|
||||
env=test
|
||||
env=product
|
||||
Binary file not shown.
|
|
@ -33,7 +33,12 @@
|
|||
"bSortable": false
|
||||
},
|
||||
{"mData": function (adInfo) {
|
||||
if (adInfo.adImage.indexOf('http') > 1) {
|
||||
return '<img src="' + adInfo.adImage + '" width="50%"/>';
|
||||
} else {
|
||||
return '<img src="<%=picturePath%>Img/adInfo/' + adInfo.adImage + '" width="50%"/>';
|
||||
}
|
||||
|
||||
},
|
||||
"bSortable": false
|
||||
},
|
||||
|
|
@ -104,7 +109,10 @@
|
|||
<div class="main-content">
|
||||
<div class="breadcrumbs" id="breadcrumbs">
|
||||
<script type="text/javascript">
|
||||
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
|
||||
try {
|
||||
ace.settings.check('breadcrumbs', 'fixed')
|
||||
} catch (e) {
|
||||
}
|
||||
</script>
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -8,14 +8,12 @@ String IMPath = "";
|
|||
if (IfishFileDirectory.env.equals("local")) {
|
||||
basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
|
||||
picturePath = request.getScheme() + "://" + request.getServerName() + ":81/";
|
||||
}
|
||||
//测试环境
|
||||
} //测试环境
|
||||
else if (IfishFileDirectory.env.equals("test")) {
|
||||
basePath = "https://"+request.getServerName()+"/";
|
||||
picturePath = "https://"+request.getServerName()+"/";
|
||||
basePath = "http://139.196.24.156:83/";
|
||||
picturePath = "http://139.196.24.156:83/";
|
||||
IMPath = "http://www.zhangxinyanv5.top/neteaseIM/im/index.html";
|
||||
}
|
||||
//正式环境
|
||||
} //正式环境
|
||||
else if (IfishFileDirectory.env.equals("product")) {
|
||||
basePath = "https://" + request.getServerName() + "/";
|
||||
picturePath = "https://" + request.getServerName() + "/";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
<%--
|
||||
Document : test
|
||||
Created on : 2017-9-21, 22:38:06
|
||||
Author : Administrator
|
||||
--%>
|
||||
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>JSP Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
<form action="test" method="post" enctype="multipart/form-data">
|
||||
<input type="file" name="file" /> <input type="submit" value="Submit" /></form>
|
||||
|
||||
<h1>${status}</h1>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue