后台文件上传,账单错误修改

This commit is contained in:
xiehonglong 2017-09-22 16:28:55 +08:00
parent 18f00dc655
commit 1260faa8bc
17 changed files with 797 additions and 674 deletions

View File

@ -196,6 +196,12 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${basedir}/src/main/webapp/WEB-INF/lib/fastdfs-client-java-1.25.jar</systemPath> <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/fastdfs-client-java-1.25.jar</systemPath>
</dependency> </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> </dependencies>
<build> <build>
<finalName>ifishSystem</finalName> <finalName>ifishSystem</finalName>
@ -242,6 +248,7 @@
<includes> <includes>
<include>**/*.xml</include> <include>**/*.xml</include>
<include>**/*.properties</include> <include>**/*.properties</include>
<include>**/*.conf</include>
</includes> </includes>
</resource> </resource>
</resources> </resources>

View File

@ -18,6 +18,7 @@ import com.ifish.service.AdInfoService;
import com.ifish.util.IfishFileDirectory; import com.ifish.util.IfishFileDirectory;
import com.ifish.util.IfishFileUtils; import com.ifish.util.IfishFileUtils;
import com.ifish.util.ResultUtil; import com.ifish.util.ResultUtil;
import com.ifishNew.help.FastDFSClientI;
/** /**
* 广告信息 * 广告信息
@ -30,7 +31,6 @@ public class AdInfoAction {
@Autowired @Autowired
private AdInfoService adInfoService; private AdInfoService adInfoService;
/** /**
* 广告信息页面 * 广告信息页面
* *

View File

@ -23,6 +23,7 @@ import com.ifish.service.IfishShopService;
import com.ifish.util.IfishFileDirectory; import com.ifish.util.IfishFileDirectory;
import com.ifish.util.IfishFileUtils; import com.ifish.util.IfishFileUtils;
import com.ifish.util.ResultUtil; import com.ifish.util.ResultUtil;
import com.ifishNew.help.FastDFSClientI;
/** /**
* 商品管理action * 商品管理action

View File

@ -21,156 +21,165 @@ import com.ifish.service.InformationService;
import com.ifish.util.IfishFileDirectory; import com.ifish.util.IfishFileDirectory;
import com.ifish.util.IfishFileUtils; import com.ifish.util.IfishFileUtils;
import com.ifish.util.ResultUtil; import com.ifish.util.ResultUtil;
import com.ifishNew.help.FastDFSClientI;
/** /**
* 资讯信息 * 资讯信息
*
* @author Administrator * @author Administrator
* *
*/ */
@Controller @Controller
public class InformationAction { public class InformationAction {
@Autowired @Autowired
private InformationService infoService; private InformationService infoService;
/** /**
* 资讯信息页面 * 资讯信息页面
* @return *
*/ * @return
@RequestMapping(value="/information.do") */
public ModelAndView information(Model model){ @RequestMapping(value = "/information.do")
model.addAttribute("ueditorMap", infoService.getUeditors()); public ModelAndView information(Model model) {
return new ModelAndView("information/information"); model.addAttribute("ueditorMap", infoService.getUeditors());
} return new ModelAndView("information/information");
}
/** /**
* 资讯信息分页数据 * 资讯信息分页数据
* @param pageData *
* @param information * @param pageData
* @return * @param information
*/ * @return
@RequestMapping(value="/informationData.do") */
@ResponseBody @RequestMapping(value = "/informationData.do")
public PageDataDto getInformationByPage(PageDataDto pageData,Information information){ @ResponseBody
pageData.pageData(infoService.getInformationByPage(pageData, information)); public PageDataDto getInformationByPage(PageDataDto pageData, Information information) {
return pageData; pageData.pageData(infoService.getInformationByPage(pageData, information));
} return pageData;
}
/** /**
* app展示 * app展示
* @param infoId *
* @param appShow * @param infoId
* @return * @param appShow
*/ * @return
@RequestMapping("/informationShowUpdate.do") */
@ResponseBody @RequestMapping("/informationShowUpdate.do")
public JsonResult informationShowUpdate(@RequestParam Integer infoId,@RequestParam boolean appShow) { @ResponseBody
return infoService.informationShowUpdate(infoId,appShow); public JsonResult informationShowUpdate(@RequestParam Integer infoId, @RequestParam boolean appShow) {
} return infoService.informationShowUpdate(infoId, appShow);
}
/** /**
* 新增资讯 * 新增资讯
* @param information *
* @param fileUpload * @param information
* @return * @param fileUpload
*/ * @return
@RequestMapping(value="/addInformation.do") */
@ResponseBody @RequestMapping(value = "/addInformation.do")
public JsonResult addInformation(Information information,MultipartFile fileUpload){ @ResponseBody
//上传文件不能为空 public JsonResult addInformation(Information information, MultipartFile fileUpload) {
if(fileUpload==null){ //上传文件不能为空
throw new IfishException(SysUserEnum.warn114); if (fileUpload == null) {
} throw new IfishException(SysUserEnum.warn114);
//上传图片 }
String newImgName = null; //上传图片
try { String newImgName = null;
//上传文件 try {
newImgName = String.valueOf(System.currentTimeMillis())+".png"; //上传文件
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_information,newImgName,fileUpload); newImgName = String.valueOf(System.currentTimeMillis()) + ".png";
} catch (IfishException e){ IfishFileUtils.uploadFile(IfishFileDirectory.path_img_information, newImgName, fileUpload);
throw e; } catch (IfishException e) {
} catch (Exception e) { throw e;
throw new IfishException(SysUserEnum.warn113); } catch (Exception e) {
} throw new IfishException(SysUserEnum.warn113);
information.setImage(newImgName); }
//新增资讯 information.setImage(newImgName);
return infoService.addInformation(information); //新增资讯
} return infoService.addInformation(information);
}
/** /**
* 修改资讯信息 * 修改资讯信息
* @param information *
* @param fileUpload * @param information
* @return * @param fileUpload
*/ * @return
@RequestMapping(value="/updateInformation.do") */
@ResponseBody @RequestMapping(value = "/updateInformation.do")
public JsonResult updateInformation(Information information,MultipartFile fileUpload){ @ResponseBody
String newImgName = null; public JsonResult updateInformation(Information information, MultipartFile fileUpload) {
//String oldImgName = information.getImage(); String newImgName = null;
//上传新资讯图 //String oldImgName = information.getImage();
if(fileUpload!=null){ //上传新资讯图
try { if (fileUpload != null) {
//上传文件 try {
newImgName = String.valueOf(System.currentTimeMillis())+".png"; //上传文件
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_information,newImgName,fileUpload); newImgName = String.valueOf(System.currentTimeMillis()) + ".png";
} catch (IfishException e){ IfishFileUtils.uploadFile(IfishFileDirectory.path_img_information, newImgName, fileUpload);
throw e; } catch (IfishException e) {
} catch (Exception e) { throw e;
throw new IfishException(SysUserEnum.warn113); } catch (Exception e) {
} throw new IfishException(SysUserEnum.warn113);
information.setImage(newImgName); }
} information.setImage(newImgName);
JsonResult jsonResult = infoService.updateInformation(information); }
//删除老资讯图 JsonResult jsonResult = infoService.updateInformation(information);
/*if(newImgName!=null && StringUtils.isNotBlank(oldImgName)){ //删除老资讯图
/*if(newImgName!=null && StringUtils.isNotBlank(oldImgName)){
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_information, oldImgName); IfishFileUtils.deleteFile(IfishFileDirectory.path_img_information, oldImgName);
}*/ }*/
return jsonResult; return jsonResult;
} }
/** /**
* 删除资讯 * 删除资讯
* @param infoId *
* @return * @param infoId
*/ * @return
@RequestMapping(value="/deleteInformation.do") */
@ResponseBody @RequestMapping(value = "/deleteInformation.do")
public JsonResult deleteInformation(Integer infoId){ @ResponseBody
String image = infoService.deleteInformation(infoId); public JsonResult deleteInformation(Integer infoId) {
//删除资讯图 String image = infoService.deleteInformation(infoId);
if(StringUtils.isNotBlank(image)){ //删除资讯图
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_information, image); if (StringUtils.isNotBlank(image)) {
} IfishFileUtils.deleteFile(IfishFileDirectory.path_img_information, image);
return ResultUtil.success(); }
} return ResultUtil.success();
}
/** /**
* 根据ID查询资讯信息 * 根据ID查询资讯信息
* @param infoId *
* @return * @param infoId
*/ * @return
@RequestMapping(value="/getInformationById.do") */
@ResponseBody @RequestMapping(value = "/getInformationById.do")
public Information getInformationById(Integer infoId){ @ResponseBody
Information info = infoService.getInformationById(infoId); public Information getInformationById(Integer infoId) {
if(info.getUeditorId()!=null){ Information info = infoService.getInformationById(infoId);
info.setSource(InformationSourceEnum.ueditor.getKey()); if (info.getUeditorId() != null) {
} info.setSource(InformationSourceEnum.ueditor.getKey());
else{ } else {
info.setSource(InformationSourceEnum.other.getKey()); info.setSource(InformationSourceEnum.other.getKey());
} }
return info; return info;
} }
/** /**
* 根据ID查找编辑器信息 * 根据ID查找编辑器信息
* @param ueditorId *
* @return * @param ueditorId
*/ * @return
@RequestMapping("/information/getUeditorById.do") */
@ResponseBody @RequestMapping("/information/getUeditorById.do")
public Ueditor editUeditor(Integer ueditorId) { @ResponseBody
return infoService.getUeditorById(ueditorId); public Ueditor editUeditor(Integer ueditorId) {
} return infoService.getUeditorById(ueditorId);
}
} }

View File

@ -25,199 +25,217 @@ import com.alibaba.fastjson.JSONObject;
import com.ifish.entity.Menu; import com.ifish.entity.Menu;
import com.ifish.entity.Role; import com.ifish.entity.Role;
import com.ifish.entity.SecurityUser; import com.ifish.entity.SecurityUser;
import com.ifish.enums.AdTypeEnum;
import com.ifish.enums.RoleEnum; import com.ifish.enums.RoleEnum;
import com.ifish.enums.SysUserEnum; import com.ifish.enums.SysUserEnum;
import com.ifish.exception.IfishException;
import com.ifish.menu.IfishMenu; import com.ifish.menu.IfishMenu;
import com.ifish.service.AdminService; import com.ifish.service.AdminService;
import com.ifish.service.PublicService; import com.ifish.service.PublicService;
import com.ifish.ueditor.ActionEnter; 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.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 * @ClassName: PublicAction
* @Description: 公共页面 * @Description: 公共页面
* @author ggw * @author ggw
*/ */
@Controller("publicAction") @Controller("publicAction")
@RequestMapping("/public") @RequestMapping("/public")
public class PublicAction { public class PublicAction {
@Autowired @Autowired
private PublicService publicService; private PublicService publicService;
@Autowired @Autowired
private AdminService adminService; private AdminService adminService;
private static Logger log = LoggerFactory.getLogger(PublicAction.class); private static Logger log = LoggerFactory.getLogger(PublicAction.class);
/** /**
* 登陆页面 * 登陆页面
* @return *
*/ * @return
@RequestMapping("/login.do") */
public ModelAndView login(String status) { @RequestMapping("/login.do")
return new ModelAndView("roleAll/login","status",status); public ModelAndView login(String status) {
} return new ModelAndView("roleAll/login", "status", status);
}
/** /**
* 文本编辑器配置 * 文本编辑器配置
* @param request *
* @param response * @param request
*/ * @param response
@RequestMapping("/config.do") */
public void config(HttpServletRequest request,HttpServletResponse response){ @RequestMapping("/config.do")
try { public void config(HttpServletRequest request, HttpServletResponse response) {
request.setCharacterEncoding( "utf-8" ); try {
response.setHeader("Content-Type" , "text/html"); request.setCharacterEncoding("utf-8");
response.setContentType("application/json"); response.setHeader("Content-Type", "text/html");
String rootPath = request.getSession().getServletContext().getRealPath( "/" ); response.setContentType("application/json");
String exec = new ActionEnter( request, rootPath ).exec(); String rootPath = request.getSession().getServletContext().getRealPath("/");
PrintWriter writer = response.getWriter(); String exec = new ActionEnter(request, rootPath).exec();
writer.write(exec); PrintWriter writer = response.getWriter();
writer.flush(); writer.write(exec);
writer.close(); writer.flush();
} catch (Exception e) { writer.close();
e.printStackTrace(); } catch (Exception e) {
} e.printStackTrace();
} }
}
/** /**
* 主页 * 主页
* @return *
*/ * @return
@RequestMapping("/index.do") */
public ModelAndView index() { @RequestMapping("/index.do")
String role = null; public ModelAndView index() {
String userName = null; String role = null;
try { String userName = null;
//登录用户 try {
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); //登录用户
userName = userDetails.getUsername(); UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
//根据登录用户角色类型跳转 userName = userDetails.getUsername();
Collection<? extends GrantedAuthority> authorities = SecurityContextHolder.getContext().getAuthentication().getAuthorities(); //根据登录用户角色类型跳转
for(GrantedAuthority grantedAuthority : authorities) { Collection<? extends GrantedAuthority> authorities = SecurityContextHolder.getContext().getAuthentication().getAuthorities();
role = grantedAuthority.getAuthority(); for (GrantedAuthority grantedAuthority : authorities) {
} role = grantedAuthority.getAuthority();
//菜单初始化 }
if(role!=null && userName!=null){ //菜单初始化
Role curRole = this.adminService.get(role); if (role != null && userName != null) {
List<Menu> menuList = new ArrayList<Menu>(); Role curRole = this.adminService.get(role);
menuList.addAll(curRole.getMenuList()); List<Menu> menuList = new ArrayList<Menu>();
//默认选择菜单 menuList.addAll(curRole.getMenuList());
IfishMenu.initChioceMenu(userName, null); //默认选择菜单
//用户菜单 IfishMenu.initChioceMenu(userName, null);
if(userName!=null){ //用户菜单
IfishMenu.initMenu(userName, menuList); if (userName != null) {
} IfishMenu.initMenu(userName, menuList);
} }
//重定向 }
String redirect = ""; //重定向
if(role.equals(RoleEnum.admin.getKey())){ String redirect = "";
redirect = "page/admin/home.do"; 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"; redirect = "page/vender/tmpDeviceList.do";
} } else if (role.equals(RoleEnum.user.getKey())) {
else if(role.equals(RoleEnum.user.getKey())){ redirect = "page/user/home.do";
redirect = "page/user/home.do"; } else if (role.equals(RoleEnum.factory.getKey())) {
} redirect = "page/factory/tmpDeviceList.do";
else if(role.equals(RoleEnum.factory.getKey())){ }
redirect = "page/factory/tmpDeviceList.do"; return new ModelAndView("redirect:/" + redirect);
} } catch (Exception e) {
return new ModelAndView("redirect:/"+redirect); e.printStackTrace();
} catch (Exception e) { log.error("index page:role:{},error message:{}", role, e.toString());
e.printStackTrace(); }
log.error("index page:role:{},error message:{}",role,e.toString()); return new ModelAndView("redirect:login.do");
} }
return new ModelAndView("redirect:login.do");
}
/** /**
* 修改密码页面 * 修改密码页面
* @return *
*/ * @return
@RequestMapping("/changePwd.do") */
public ModelAndView changePwd(String status) { @RequestMapping("/changePwd.do")
return new ModelAndView("roleAll/changePwd","status",status); public ModelAndView changePwd(String status) {
} return new ModelAndView("roleAll/changePwd", "status", status);
/** }
* 修改密码
* @return
*/
@RequestMapping("/savePwd.do")
public ModelAndView savePwd(String username,String oldPassword,String newPassword) {
try {
SecurityUser securityUser = publicService.updateSecurityPwd(username, oldPassword, newPassword);
if(securityUser!=null){
return new ModelAndView("redirect:/page/public/changePwd.do","status",SysUserEnum.success100.getKey());
}
return new ModelAndView("redirect:/page/public/changePwd.do","status",SysUserEnum.warn105.getKey());
} catch (Exception e) {
log.error("update password:userName:{},error message:{}",username,e.toString());
}
return new ModelAndView("redirect:/page/public/changePwd.do","status",SysUserEnum.failed101.getKey());
}
/** /**
* 用户注册 * 修改密码
* @param securityUser *
* @return * @return
*/ */
@RequestMapping("/signup.do") @RequestMapping("/savePwd.do")
public ModelAndView signup(SecurityUser securityUser) { public ModelAndView savePwd(String username, String oldPassword, String newPassword) {
try { try {
String code = publicService.createSysUser(securityUser); SecurityUser securityUser = publicService.updateSecurityPwd(username, oldPassword, newPassword);
return new ModelAndView("redirect:/page/public/login.do","status",code); if (securityUser != null) {
} catch (Exception e) { return new ModelAndView("redirect:/page/public/changePwd.do", "status", SysUserEnum.success100.getKey());
log.error("securityUser register:userName:{},error message:{}",securityUser.getUsername(),e.toString()); }
} return new ModelAndView("redirect:/page/public/changePwd.do", "status", SysUserEnum.warn105.getKey());
return new ModelAndView("redirect:/page/public/login.do","status",SysUserEnum.failed101.getKey()); } catch (Exception e) {
} log.error("update password:userName:{},error message:{}", username, e.toString());
}
return new ModelAndView("redirect:/page/public/changePwd.do", "status", SysUserEnum.failed101.getKey());
}
/***********************************************测试工具接口***************************************************/ /**
/** * 用户注册
* 获取厂家列表 *
* @return * @param securityUser
*/ * @return
@RequestMapping("/getVenderList.do") */
@ResponseBody @RequestMapping("/signup.do")
public Object getVenderList(HttpServletResponse response,String factoryCode) { public ModelAndView signup(SecurityUser securityUser) {
response.setHeader("Access-Control-Allow-Origin", "*"); try {
Map<String, Object> map = new HashMap<String, Object>(); String code = publicService.createSysUser(securityUser);
try { return new ModelAndView("redirect:/page/public/login.do", "status", code);
map = publicService.getVenderList(factoryCode); } catch (Exception e) {
} catch (Exception e) { log.error("securityUser register:userName:{},error message:{}", securityUser.getUsername(), e.toString());
log.error("get venderList information to test tool:error message:{}",e.toString()); }
} return new ModelAndView("redirect:/page/public/login.do", "status", SysUserEnum.failed101.getKey());
return map; }
}
/** /**
* 保存设备mac * *********************************************测试工具接口**************************************************
* @param data */
* @param subStr /**
* @return * 获取厂家列表
*/ *
@RequestMapping("/saveMacAddress.do") * @return
@ResponseBody */
public Object saveMacAddress(Map<String, String> data,String subStr,HttpServletRequest request,HttpServletResponse response) { @RequestMapping("/getVenderList.do")
response.setHeader("Access-Control-Allow-Origin", "*"); @ResponseBody
try { public Object getVenderList(HttpServletResponse response, String factoryCode) {
String ip = getRemoteAddress.getIp(request); response.setHeader("Access-Control-Allow-Origin", "*");
JSONObject json = JSONObject.parseObject(subStr); Map<String, Object> map = new HashMap<String, Object>();
String brandCode = json.getString("brandCode"); try {
String factoryCode = json.getString("factoryCode"); map = publicService.getVenderList(factoryCode);
String isBlacklist = json.getString("isBlacklist"); } catch (Exception e) {
String macs = json.getString("mac"); log.error("get venderList information to test tool:error message:{}", e.toString());
String hardType = json.getString("hardType"); }
String[] mac = macs.equals("")?null:macs.split(","); return map;
String[] hardTypes = hardType.equals("")?null:hardType.split(","); }
Map<String, Object> map = this.publicService.saveDevices(factoryCode,isBlacklist,brandCode,ip, mac, hardTypes);
JSONObject returnJson = new JSONObject(map); /**
return returnJson.toString(); * 保存设备mac
} catch (Exception e) { *
log.error("save macAddress from test tool:error message:{}",e.toString()); * @param data
} * @param subStr
return null; * @return
} */
@RequestMapping("/saveMacAddress.do")
@ResponseBody
public Object saveMacAddress(Map<String, String> data, String subStr, HttpServletRequest request, HttpServletResponse response) {
response.setHeader("Access-Control-Allow-Origin", "*");
try {
String ip = getRemoteAddress.getIp(request);
JSONObject json = JSONObject.parseObject(subStr);
String brandCode = json.getString("brandCode");
String factoryCode = json.getString("factoryCode");
String isBlacklist = json.getString("isBlacklist");
String macs = json.getString("mac");
String hardType = json.getString("hardType");
String[] mac = macs.equals("") ? null : macs.split(",");
String[] hardTypes = hardType.equals("") ? null : hardType.split(",");
Map<String, Object> map = this.publicService.saveDevices(factoryCode, isBlacklist, brandCode, ip, mac, hardTypes);
JSONObject returnJson = new JSONObject(map);
return returnJson.toString();
} catch (Exception e) {
log.error("save macAddress from test tool:error message:{}", e.toString());
}
return null;
}
} }

View File

@ -21,6 +21,7 @@ import com.ifish.util.IfishFileUtils;
import com.ifish.util.ResultUtil; import com.ifish.util.ResultUtil;
import com.ifishNew.bean.CommodityInfoBean; import com.ifishNew.bean.CommodityInfoBean;
import com.ifishNew.help.CommodityInfoHelperI; import com.ifishNew.help.CommodityInfoHelperI;
import com.ifishNew.help.FastDFSClientI;
/** /**
* 商家信息controller * 商家信息controller
@ -37,6 +38,9 @@ public class ShopsInfoAction {
@Autowired @Autowired
private CommodityInfoHelperI commodityInfoHelperI; private CommodityInfoHelperI commodityInfoHelperI;
@Autowired
private FastDFSClientI fastDFSClientI;
/** /**
* 已审核商家信息页面 * 已审核商家信息页面
* *
@ -130,7 +134,7 @@ public class ShopsInfoAction {
try { try {
//上传文件 //上传文件
newImgName = String.valueOf(System.currentTimeMillis()) + ".png"; 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) { } catch (IfishException e) {
throw e; throw e;
} catch (Exception e) { } catch (Exception e) {
@ -265,8 +269,8 @@ public class ShopsInfoAction {
*/ */
@RequestMapping("/shopsInfo/updategoodsInfo.do") @RequestMapping("/shopsInfo/updategoodsInfo.do")
@ResponseBody @ResponseBody
public JsonResult updateGoodsInfoJsonResult(CommodityInfoBean commodityInfoBean,boolean appShow) { public JsonResult updateGoodsInfoJsonResult(CommodityInfoBean commodityInfoBean, boolean appShow) {
return commodityInfoHelperI.updateCommodityInfo(commodityInfoBean,appShow); return commodityInfoHelperI.updateCommodityInfo(commodityInfoBean, appShow);
} }
/** /**

View File

@ -2602,6 +2602,9 @@ public class AdminServiceImpl implements AdminService {
if (StringUtils.isNotBlank(isTax)) { if (StringUtils.isNotBlank(isTax)) {
isTax = BooleanEnum.NO.getKey(); isTax = BooleanEnum.NO.getKey();
factoryList.setIsTax(isTax); factoryList.setIsTax(isTax);
} else {
isTax = BooleanEnum.NO.getKey();
factoryList.setIsTax(isTax);
} }
//支付金额为null时 //支付金额为null时
if (payMoney == null) { if (payMoney == null) {

View File

@ -13,64 +13,70 @@ import com.ifish.exception.IfishException;
/** /**
* 文件处理工具类 * 文件处理工具类
*
* @author Administrator * @author Administrator
* *
*/ */
public class IfishFileUtils { public class IfishFileUtils {
/** /**
* 上传文件并校验尺寸 * 上传文件并校验尺寸
* @param path *
* @param fileName * @param path
* @param multipartFile * @param fileName
* @param width * @param multipartFile
* @param height * @param width
* @throws IllegalStateException * @param height
* @throws IOException * @throws IllegalStateException
*/ * @throws IOException
public static void uploadFile(String path,String fileName,MultipartFile multipartFile,int width,int height) throws IllegalStateException, IOException{ */
//检验图片尺寸 public static void uploadFile(String path, String fileName, MultipartFile multipartFile, int width, int height) throws IllegalStateException, IOException {
BufferedImage sourceImg =ImageIO.read(multipartFile.getInputStream()); //检验图片尺寸
BufferedImage sourceImg = ImageIO.read(multipartFile.getInputStream());
int imgWidth = sourceImg.getWidth(); int imgWidth = sourceImg.getWidth();
int imgHeight = sourceImg.getHeight(); int imgHeight = sourceImg.getHeight();
if(width!=imgWidth || height!=imgHeight){ if (width != imgWidth || height != imgHeight) {
throw new IfishException(SysUserEnum.warn115.getKey(),SysUserEnum.warn115.getValue()+"("+width+"x"+height+")"); throw new IfishException(SysUserEnum.warn115.getKey(), SysUserEnum.warn115.getValue() + "(" + width + "x" + height + ")");
} }
//文件名 //文件名
File newFile = new File(path,fileName); File newFile = new File(path, fileName);
if(!newFile.exists()){ if (!newFile.exists()) {
newFile.mkdirs(); newFile.mkdirs();
} }
//传输文件 //传输文件
multipartFile.transferTo(newFile); multipartFile.transferTo(newFile);
} }
/**
* 上传文件 /**
* @param path * 上传文件
* @param fileName *
* @param multipartFile * @param path
* @throws IllegalStateException * @param fileName
* @throws IOException * @param multipartFile
*/ * @throws IllegalStateException
public static void uploadFile(String path,String fileName,MultipartFile multipartFile) throws IllegalStateException, IOException{ * @throws IOException
//文件名 */
File newFile = new File(path,fileName); public static void uploadFile(String path, String fileName, MultipartFile multipartFile) throws IllegalStateException, IOException {
if(!newFile.exists()){ //文件名
newFile.mkdirs(); File newFile = new File(path, fileName);
} if (!newFile.exists()) {
//传输文件 newFile.mkdirs();
multipartFile.transferTo(newFile); }
} //传输文件
/** multipartFile.transferTo(newFile);
* 删除文件 }
* @param path
* @param fileName /**
*/ * 删除文件
public static void deleteFile(String path,String fileName){ *
File file = new File(path, fileName); * @param path
if(file.exists()){ * @param fileName
file.delete(); */
} public static void deleteFile(String path, String fileName) {
} File file = new File(path, fileName);
if (file.exists()) {
file.delete();
}
}
} }

View File

@ -31,7 +31,6 @@ public class MybatisConfig {
// //获取当前操作系统(servers_os为服务器设置的属性JAVA_OPTS=%JAVA_OPTS% -Dservers_os=online84) // //获取当前操作系统(servers_os为服务器设置的属性JAVA_OPTS=%JAVA_OPTS% -Dservers_os=online84)
// String servers_os = System.getProperty("servers_os") == null ? "" : System.getProperty("servers_os"); // String servers_os = System.getProperty("servers_os") == null ? "" : System.getProperty("servers_os");
dataSource.setUsername("ifish"); dataSource.setUsername("ifish");
dataSource.setPassword("ifish7pwd"); dataSource.setPassword("ifish7pwd");
dataSource.setUrl("jdbc\\:mysql\\://localhost\\:3306/myfishdb?characterEncoding\\=UTF-8"); dataSource.setUrl("jdbc\\:mysql\\://localhost\\:3306/myfishdb?characterEncoding\\=UTF-8");

View File

@ -5,8 +5,14 @@
*/ */
package com.ifishNew.help; package com.ifishNew.help;
import com.ifish.enums.SysUserEnum;
import com.ifish.exception.IfishException;
import com.ifish.util.IfishFileDirectory; import com.ifish.util.IfishFileDirectory;
import com.ifish.util.ValidateUtil; 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.apache.commons.lang3.StringUtils;
import org.csource.fastdfs.ClientGlobal; import org.csource.fastdfs.ClientGlobal;
import org.csource.fastdfs.StorageClient1; import org.csource.fastdfs.StorageClient1;
@ -136,10 +142,47 @@ public class FastDFSClient implements FastDFSClientI {
return ""; return "";
} }
return IfishFileDirectory.fastDFS_url_app + url; if (IfishFileDirectory.env.equals("product")) {
return IfishFileDirectory.fastDFS_url_app + url;
} else {
return IfishFileDirectory.fastDFS_url_local + url;
}
} catch (Exception e) { } catch (Exception e) {
return ""; 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;
}
} }

View File

@ -6,6 +6,7 @@
package com.ifishNew.help; package com.ifishNew.help;
import com.ifish.domain.JsonResult; import com.ifish.domain.JsonResult;
import java.io.IOException;
import org.springframework.web.multipart.MultipartFile; 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 uploadFile(String group_name, String local_filename, String file_ext_name) throws Exception;
String uploadFileToFastDFS(MultipartFile file); 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;
} }

View File

@ -14,6 +14,7 @@
<intercept-url pattern="/page/public/savePwd.do" access="isAuthenticated()"/> <intercept-url pattern="/page/public/savePwd.do" access="isAuthenticated()"/>
<!-- 允许所有人访问 --> <!-- 允许所有人访问 -->
<intercept-url pattern="/page/public/**" access="permitAll"/> <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="/ueditor/ueditor.jsp" access="hasAnyRole('ROLE_ADMIN')" />
<intercept-url pattern="/page/user/**" access="hasAnyRole('ROLE_USER')" /> <intercept-url pattern="/page/user/**" access="hasAnyRole('ROLE_USER')" />

View File

@ -23,8 +23,8 @@ ifish_account=ifish
#IM\u5b98\u65b9\u624b\u673a\u53f7 #IM\u5b98\u65b9\u624b\u673a\u53f7
netease_phone=18501773036 netease_phone=18501773036
#FastDFS\u6587\u4ef6URL\u8bbf\u95ee\u8def\u5f84(\u672c\u5730\u548c\u6d4b\u8bd5\u73af\u5883) #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\u6587\u4ef6URL\u8bbf\u95ee\u8def\u5f84(\u6b63\u5f0f\u73af\u5883)
fastDFS_url_app=http://app.ifish7.com/ fastDFS_url_app=http://app.ifish7.com/
#\u73af\u5883(local:\u672c\u5730\u73af\u5883,test:\u6d4b\u8bd5\u73af\u5883,\u6b63\u5f0f\u73af\u5883:product) #\u73af\u5883(local:\u672c\u5730\u73af\u5883,test:\u6d4b\u8bd5\u73af\u5883,\u6b63\u5f0f\u73af\u5883:product)
env=test env=product

View File

@ -2,273 +2,281 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>广告信息</title> <title>广告信息</title>
<!-- css and js --> <!-- css and js -->
<%@ include file="../htm/script.jsp" %> <%@ include file="../htm/script.jsp" %>
<script type="text/javascript"> <script type="text/javascript">
var dt = null; var dt = null;
$(function(){ $(function () {
//modal初始化 //modal初始化
myModule.modalInit(); myModule.modalInit();
//dataTable模块 //dataTable模块
myModule.URL = { myModule.URL = {
dataSourceUrl:"<%=basePath%>page/adInfoData.do", dataSourceUrl: "<%=basePath%>page/adInfoData.do",
addUrl:"<%=basePath%>page/addAdInfo.do", addUrl: "<%=basePath%>page/addAdInfo.do",
updateUrl:"<%=basePath%>page/updateAdInfo.do", updateUrl: "<%=basePath%>page/updateAdInfo.do",
deleteUrl:"<%=basePath%>page/deleteAdInfo.do", deleteUrl: "<%=basePath%>page/deleteAdInfo.do",
getByIdUrl:"<%=basePath%>page/getAdInfoById.do", getByIdUrl: "<%=basePath%>page/getAdInfoById.do",
}; };
//dataTable //dataTable
dt = myModule.dataTable(true,'#sample-table-2',[ dt = myModule.dataTable(true, '#sample-table-2', [
{ "mData": "adId","bSortable": false }, {"mData": "adId", "bSortable": false},
{ "mData": function(adInfo){ {"mData": function (adInfo) {
return adInfo.isShow=='1'?'<span class="green">是</span>':'<span class="red">否</span>'; return adInfo.isShow == '1' ? '<span class="green">是</span>' : '<span class="red">否</span>';
}, },
"bSortable": false "bSortable": false
}, },
{ "mData": function(adInfo){ {"mData": function (adInfo) {
return $("#adType_"+adInfo.adType).val(); return $("#adType_" + adInfo.adType).val();
}, },
"bSortable": false "bSortable": false
}, },
{ "mData": function(adInfo){ {"mData": function (adInfo) {
return '<img src="<%=picturePath%>Img/adInfo/'+adInfo.adImage+'" width="50%"/>'; if (adInfo.adImage.indexOf('http') > 1) {
}, return '<img src="' + adInfo.adImage + '" width="50%"/>';
"bSortable": false } else {
}, return '<img src="<%=picturePath%>Img/adInfo/' + adInfo.adImage + '" width="50%"/>';
{ "mData": function(adInfo){ }
return '<a href="'+adInfo.adLink+'" target="_blank">'+adInfo.adLink+'</a>';
},
"bSortable": false
},
{ "mData": "orderNum","bSortable": false },
{ "mData": "updateTime","bSortable": false },
{ "mData": "createTime","bSortable": false },
{ "mData": function(adInfo){
return '<a href="javascript:void(0);" onclick="findById(this,'+adInfo.adId+');" class="label label-primary"><i class="icon-edit"></i></a> '
+'<a href="javascript:void(0);" onclick="deleteById(this,'+adInfo.adId+');" class="label label-danger"><i class="icon-trash"></i></a>';
},
"bSortable": false,
"sClass":"center"
}
]);
$("#sample-table-2_length").append('&nbsp;&nbsp;是否显示:<select name="isShow" class="input-xlarge searchClass">'
+'<option value="">请选择</option>'
+'<c:forEach items="<%=BooleanEnum.getJson()%>" var="local">'
+'<option value="${local.key}">${local.value}</option>'
+'</c:forEach>'
+'</select>'
);
$(".searchBtn").click(function(){
$("button[name='adType']").removeClass("searchClass");
$(this).addClass("searchClass");
dt.fnDraw();
});
//自动查询
$(".searchClass").change(function(){
dt.fnDraw();
});
//异步提交新增表单
myModule.addAjaxFrom("#addSubmitBtn",'#form-add',dt);
//异步提交修改表单
myModule.updateAjaxFrom("#updateSubmitBtn",'#form-update',dt);
});
//修改
function findById(el,adId){
//重置表单
$("#form-update").data('bootstrapValidator').resetForm(true);
//数据
var jsonData = {"adId":adId};
//赋值属性
var columns = ["adId","adType","adLink","isShow","adImage","orderNum"];
myModule.findByIdFunction(el,'#updateModal',jsonData,columns);
}
//删除
function deleteById(el,adId){
var jsonData = {"adId":adId};
myModule.deleteFunction(el,jsonData,dt);
}
</script>
</head>
<body> },
<!-- 头部 --> "bSortable": false
<%@ include file="../htm/header.jsp" %> },
<!-- 主体 --> {"mData": function (adInfo) {
<div class="main-container" id="main-container"> return '<a href="' + adInfo.adLink + '" target="_blank">' + adInfo.adLink + '</a>';
<div class="main-container-inner"> },
<!-- 侧边栏 --> "bSortable": false
<%@ include file="../htm/sidebar.jsp" %> },
<!-- 主体内容 --> {"mData": "orderNum", "bSortable": false},
<div class="main-content"> {"mData": "updateTime", "bSortable": false},
<div class="breadcrumbs" id="breadcrumbs"> {"mData": "createTime", "bSortable": false},
<script type="text/javascript"> {"mData": function (adInfo) {
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){} return '<a href="javascript:void(0);" onclick="findById(this,' + adInfo.adId + ');" class="label label-primary"><i class="icon-edit"></i></a> '
</script> + '<a href="javascript:void(0);" onclick="deleteById(this,' + adInfo.adId + ');" class="label label-danger"><i class="icon-trash"></i></a>';
<ul class="breadcrumb"> },
<li> "bSortable": false,
<i class="icon-home home-icon"></i> "sClass": "center"
<a href="<%=basePath%>page/public/index.do">首页</a> }
</li> ]);
<li class="active">广告信息</li> $("#sample-table-2_length").append('&nbsp;&nbsp;是否显示:<select name="isShow" class="input-xlarge searchClass">'
</ul> + '<option value="">请选择</option>'
</div> + '<c:forEach items="<%=BooleanEnum.getJson()%>" var="local">'
<div class="page-content"> + '<option value="${local.key}">${local.value}</option>'
<div class="row"> + '</c:forEach>'
<div class="col-xs-12"> + '</select>'
<div class="table-responsive"> );
<c:forEach items="<%=AdTypeEnum.getJson()%>" var="local"> $(".searchBtn").click(function () {
<button class="btn btn-primary searchBtn" name="adType" value="${local.key}">${local.value}</button> $("button[name='adType']").removeClass("searchClass");
</c:forEach> $(this).addClass("searchClass");
<table id="sample-table-2" class="table table-striped table-bordered table-hover"> dt.fnDraw();
<thead> });
<tr> //自动查询
<th>ID</th> $(".searchClass").change(function () {
<th>显示</th> dt.fnDraw();
<th>广告类型</th> });
<th>广告图</th> //异步提交新增表单
<th>广告链接</th> myModule.addAjaxFrom("#addSubmitBtn", '#form-add', dt);
<th>排序</th> //异步提交修改表单
<th>更新</th> myModule.updateAjaxFrom("#updateSubmitBtn", '#form-update', dt);
<th>创建</th> });
<th>操作</th> //修改
</tr> function findById(el, adId) {
</thead> //重置表单
</table> $("#form-update").data('bootstrapValidator').resetForm(true);
</div> //数据
</div> var jsonData = {"adId": adId};
</div> //赋值属性
</div> var columns = ["adId", "adType", "adLink", "isShow", "adImage", "orderNum"];
</div> myModule.findByIdFunction(el, '#updateModal', jsonData, columns);
<c:forEach items="<%=AdTypeEnum.getJson()%>" var="local"> }
<input type="hidden" id="adType_${local.key}" value="${local.value}"/> //删除
</c:forEach> function deleteById(el, adId) {
<form action="" enctype="multipart/form-data" class="form-horizontal" method="post" id="form-add"> var jsonData = {"adId": adId};
<div class="modal fade" id="addModal"> myModule.deleteFunction(el, jsonData, dt);
<div class="modal-dialog"> }
<div class="modal-content"> </script>
<div class="modal-header"> </head>
<button type="button" class="closeBtn close">
<span aria-hidden="true">&times;</span> <body>
</button> <!-- 头部 -->
<h4 class="modal-title">新增</h4> <%@ include file="../htm/header.jsp" %>
</div> <!-- 主体 -->
<div class="modal-body row"> <div class="main-container" id="main-container">
<div class="col-xs-12"> <div class="main-container-inner">
<div class="form-group"> <!-- 侧边栏 -->
<label class="col-xs-3 control-label no-padding-right">广告类型<span style="color:red;">*</span></label> <%@ include file="../htm/sidebar.jsp" %>
<div class="col-xs-7"> <!-- 主体内容 -->
<select name="adType" class="form-control"> <div class="main-content">
<c:forEach items="<%=AdTypeEnum.getJson()%>" var="local"> <div class="breadcrumbs" id="breadcrumbs">
<option value="${local.key}">${local.value}</option> <script type="text/javascript">
</c:forEach> try {
</select> ace.settings.check('breadcrumbs', 'fixed')
</div> } catch (e) {
</div> }
<div class="form-group"> </script>
<label class="col-xs-3 control-label no-padding-right">广告图<span style="color:red;">*</span></label> <ul class="breadcrumb">
<div class="col-xs-7"> <li>
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control" required/> <i class="icon-home home-icon"></i>
</div> <a href="<%=basePath%>page/public/index.do">首页</a>
</div> </li>
<div class="form-group"> <li class="active">广告信息</li>
<label class="col-xs-3 control-label no-padding-right">广告链接<span style="color:red;">*</span></label> </ul>
<div class="col-xs-7"> </div>
<input type="url" name="adLink" class="form-control" maxlength="200" required> <div class="page-content">
</div> <div class="row">
</div> <div class="col-xs-12">
<div class="form-group"> <div class="table-responsive">
<label class="col-xs-3 control-label no-padding-right">是否显示<span style="color:red;">*</span></label> <c:forEach items="<%=AdTypeEnum.getJson()%>" var="local">
<div class="col-xs-7"> <button class="btn btn-primary searchBtn" name="adType" value="${local.key}">${local.value}</button>
<select name="isShow" class="form-control"> </c:forEach>
<c:forEach items="<%=BooleanEnum.getJson()%>" var="local"> <table id="sample-table-2" class="table table-striped table-bordered table-hover">
<option value="${local.key}">${local.value}</option> <thead>
</c:forEach> <tr>
</select> <th>ID</th>
</div> <th>显示</th>
</div> <th>广告类型</th>
<div class="form-group"> <th>广告图</th>
<label class="col-xs-3 control-label no-padding-right">排序号<span style="color:red;">*</span></label> <th>广告链接</th>
<div class="col-xs-7"> <th>排序</th>
<input type="number" name="orderNum" class="form-control" max="99" required/> <th>更新</th>
</div> <th>创建</th>
</div> <th>操作</th>
</div> </tr>
</div> </thead>
<div class="modal-footer"> </table>
<button type="button" class="closeBtn btn btn-default">关闭</button> </div>
<button type="button" id="addSubmitBtn" class="btn btn-primary">确定</button> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <c:forEach items="<%=AdTypeEnum.getJson()%>" var="local">
</form> <input type="hidden" id="adType_${local.key}" value="${local.value}"/>
<form action="" enctype="multipart/form-data" class="form-horizontal" method="post" id="form-update"> </c:forEach>
<div class="modal fade" id="updateModal"> <form action="" enctype="multipart/form-data" class="form-horizontal" method="post" id="form-add">
<div class="modal-dialog"> <div class="modal fade" id="addModal">
<div class="modal-content"> <div class="modal-dialog">
<div class="modal-header"> <div class="modal-content">
<button type="button" class="closeBtn close"> <div class="modal-header">
<span aria-hidden="true">&times;</span> <button type="button" class="closeBtn close">
</button> <span aria-hidden="true">&times;</span>
<h4 class="modal-title">修改</h4> </button>
</div> <h4 class="modal-title">新增</h4>
<div class="modal-body row"> </div>
<div class="col-xs-12"> <div class="modal-body row">
<div class="form-group"> <div class="col-xs-12">
<label class="col-xs-3 control-label no-padding-right">广告类型<span style="color:red;">*</span></label> <div class="form-group">
<div class="col-xs-7"> <label class="col-xs-3 control-label no-padding-right">广告类型<span style="color:red;">*</span></label>
<input type="hidden" name="adId" id="adId"> <div class="col-xs-7">
<select name="adType" id="adType" class="form-control"> <select name="adType" class="form-control">
<c:forEach items="<%=AdTypeEnum.getJson()%>" var="local"> <c:forEach items="<%=AdTypeEnum.getJson()%>" var="local">
<option value="${local.key}">${local.value}</option> <option value="${local.key}">${local.value}</option>
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-xs-3 control-label no-padding-right">广告图<span style="color:red;">*</span></label> <label class="col-xs-3 control-label no-padding-right">广告图<span style="color:red;">*</span></label>
<div class="col-xs-7"> <div class="col-xs-7">
<input type="hidden" name="adImage" id="adImage"/> <input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control" required/>
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control"/> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-xs-3 control-label no-padding-right">广告链接<span style="color:red;">*</span></label>
<label class="col-xs-3 control-label no-padding-right">广告链接<span style="color:red;">*</span></label> <div class="col-xs-7">
<div class="col-xs-7"> <input type="url" name="adLink" class="form-control" maxlength="200" required>
<input type="url" name="adLink" id="adLink" class="form-control" maxlength="200" required/> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-xs-3 control-label no-padding-right">是否显示<span style="color:red;">*</span></label>
<label class="col-xs-3 control-label no-padding-right">是否显示<span style="color:red;">*</span></label> <div class="col-xs-7">
<div class="col-xs-7"> <select name="isShow" class="form-control">
<select name="isShow" id="isShow" class="form-control"> <c:forEach items="<%=BooleanEnum.getJson()%>" var="local">
<c:forEach items="<%=BooleanEnum.getJson()%>" var="local"> <option value="${local.key}">${local.value}</option>
<option value="${local.key}">${local.value}</option> </c:forEach>
</c:forEach> </select>
</select> </div>
</div> </div>
</div> <div class="form-group">
<div class="form-group"> <label class="col-xs-3 control-label no-padding-right">排序号<span style="color:red;">*</span></label>
<label class="col-xs-3 control-label no-padding-right">排序号<span style="color:red;">*</span></label> <div class="col-xs-7">
<div class="col-xs-7"> <input type="number" name="orderNum" class="form-control" max="99" required/>
<input type="number" name="orderNum" id="orderNum" class="form-control" max="99" required/> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="modal-footer">
<div class="modal-footer"> <button type="button" class="closeBtn btn btn-default">关闭</button>
<button type="button" class="closeBtn btn btn-default">关闭</button> <button type="button" id="addSubmitBtn" class="btn btn-primary">确定</button>
<button type="button" id="updateSubmitBtn" class="btn btn-primary">确定</button> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </form>
</form> <form action="" enctype="multipart/form-data" class="form-horizontal" method="post" id="form-update">
<!-- 设置工具 --> <div class="modal fade" id="updateModal">
<%@ include file="../htm/setting.jsp" %> <div class="modal-dialog">
</div> <div class="modal-content">
</div> <div class="modal-header">
</body> <button type="button" class="closeBtn close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">修改</h4>
</div>
<div class="modal-body row">
<div class="col-xs-12">
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">广告类型<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="hidden" name="adId" id="adId">
<select name="adType" id="adType" class="form-control">
<c:forEach items="<%=AdTypeEnum.getJson()%>" var="local">
<option value="${local.key}">${local.value}</option>
</c:forEach>
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">广告图<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="hidden" name="adImage" id="adImage"/>
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">广告链接<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="url" name="adLink" id="adLink" class="form-control" maxlength="200" required/>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">是否显示<span style="color:red;">*</span></label>
<div class="col-xs-7">
<select name="isShow" id="isShow" class="form-control">
<c:forEach items="<%=BooleanEnum.getJson()%>" var="local">
<option value="${local.key}">${local.value}</option>
</c:forEach>
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">排序号<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="number" name="orderNum" id="orderNum" class="form-control" max="99" required/>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="closeBtn btn btn-default">关闭</button>
<button type="button" id="updateSubmitBtn" class="btn btn-primary">确定</button>
</div>
</div>
</div>
</div>
</form>
<!-- 设置工具 -->
<%@ include file="../htm/setting.jsp" %>
</div>
</div>
</body>
</html> </html>

View File

@ -1,26 +1,24 @@
<%@page import="com.ifish.util.IfishFileDirectory"%> <%@page import="com.ifish.util.IfishFileDirectory"%>
<%@ page language="java" pageEncoding="utf-8"%> <%@ page language="java" pageEncoding="utf-8"%>
<% <%
String basePath = ""; String basePath = "";
String picturePath = ""; String picturePath = "";
String IMPath = ""; String IMPath = "";
//本地环境 //本地环境
if(IfishFileDirectory.env.equals("local")){ if (IfishFileDirectory.env.equals("local")) {
basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
picturePath = request.getScheme()+"://"+request.getServerName()+":81/"; picturePath = request.getScheme() + "://" + request.getServerName() + ":81/";
} } //测试环境
//测试环境 else if (IfishFileDirectory.env.equals("test")) {
else if(IfishFileDirectory.env.equals("test")){ basePath = "http://139.196.24.156:83/";
basePath = "https://"+request.getServerName()+"/"; picturePath = "http://139.196.24.156:83/";
picturePath = "https://"+request.getServerName()+"/"; IMPath = "http://www.zhangxinyanv5.top/neteaseIM/im/index.html";
IMPath = "http://www.zhangxinyanv5.top/neteaseIM/im/index.html"; } //正式环境
} else if (IfishFileDirectory.env.equals("product")) {
//正式环境 basePath = "https://" + request.getServerName() + "/";
else if(IfishFileDirectory.env.equals("product")){ picturePath = "https://" + request.getServerName() + "/";
basePath = "https://"+request.getServerName()+"/"; IMPath = "https://www.ifish7.com/neteaseIM/im/index.html";
picturePath = "https://"+request.getServerName()+"/"; }
IMPath = "https://www.ifish7.com/neteaseIM/im/index.html";
}
//https //https
%> %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

View File

@ -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>