优化代码
This commit is contained in:
parent
20013ee0da
commit
9979de350b
|
|
@ -1,162 +0,0 @@
|
|||
//package com.qihang.oms.common;
|
||||
//
|
||||
//import com.qihang.common.common.AjaxResult;
|
||||
//import com.qihang.common.common.PageResult;
|
||||
//import com.qihang.common.common.TableDataInfo;
|
||||
//import com.qihang.common.enums.HttpStatus;
|
||||
//import com.qihang.common.utils.StringUtils;
|
||||
//import com.qihang.oms.domain.OOrder;
|
||||
//import com.qihang.security.LoginUser;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * web层通用数据处理
|
||||
// *
|
||||
// * @author qihang
|
||||
// */
|
||||
//public class BaseController
|
||||
//{
|
||||
// protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
//
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 返回成功
|
||||
// */
|
||||
// public AjaxResult success()
|
||||
// {
|
||||
// return AjaxResult.success();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 返回失败消息
|
||||
// */
|
||||
// public AjaxResult error()
|
||||
// {
|
||||
// return AjaxResult.error();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 返回成功消息
|
||||
// */
|
||||
// public AjaxResult success(String message)
|
||||
// {
|
||||
// return AjaxResult.success(message);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 返回成功消息
|
||||
// */
|
||||
// public AjaxResult success(Object data)
|
||||
// {
|
||||
// return AjaxResult.success(data);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 返回失败消息
|
||||
// */
|
||||
// public AjaxResult error(String message)
|
||||
// {
|
||||
// return AjaxResult.error(message);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 返回警告消息
|
||||
// */
|
||||
// public AjaxResult warn(String message)
|
||||
// {
|
||||
// return AjaxResult.warn(message);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 响应返回结果
|
||||
// *
|
||||
// * @param rows 影响行数
|
||||
// * @return 操作结果
|
||||
// */
|
||||
// protected AjaxResult toAjax(int rows)
|
||||
// {
|
||||
// return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 响应返回结果
|
||||
// *
|
||||
// * @param result 结果
|
||||
// * @return 操作结果
|
||||
// */
|
||||
// protected AjaxResult toAjax(boolean result)
|
||||
// {
|
||||
// return result ? success() : error();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 页面跳转
|
||||
// */
|
||||
// public String redirect(String url)
|
||||
// {
|
||||
// return StringUtils.format("redirect:{}", url);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取用户缓存信息
|
||||
// */
|
||||
// public LoginUser getLoginUser()
|
||||
// {
|
||||
// return SecurityUtils.getLoginUser();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取登录用户id
|
||||
// */
|
||||
// public Long getUserId()
|
||||
// {
|
||||
// return getLoginUser().getUserId();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取登录部门id
|
||||
// */
|
||||
// public Long getDeptId()
|
||||
// {
|
||||
// return getLoginUser().getDeptId();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取登录用户名
|
||||
// */
|
||||
// public String getUsername()
|
||||
// {
|
||||
// return getLoginUser().getUsername();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 响应请求分页数据
|
||||
// */
|
||||
// @SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
// protected TableDataInfo getDataTable(List<?> list)
|
||||
// {
|
||||
// TableDataInfo rspData = new TableDataInfo();
|
||||
// rspData.setCode(HttpStatus.SUCCESS);
|
||||
// rspData.setMsg("查询成功");
|
||||
// rspData.setRows(list);
|
||||
//// rspData.setTotal(new PageInfo(list).getTotal());
|
||||
// rspData.setTotal(list.size());
|
||||
// return rspData;
|
||||
// }
|
||||
// protected TableDataInfo getDataTable(PageResult<?> pageResult)
|
||||
// {
|
||||
// TableDataInfo rspData = new TableDataInfo();
|
||||
// rspData.setCode(HttpStatus.SUCCESS);
|
||||
// rspData.setMsg("查询成功");
|
||||
// rspData.setRows(pageResult.getRecords());
|
||||
//// rspData.setTotal(new PageInfo(list).getTotal());
|
||||
// rspData.setTotal(pageResult.getTotal());
|
||||
// return rspData;
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
|
@ -1,121 +0,0 @@
|
|||
//package com.qihang.oms.common;
|
||||
//
|
||||
//
|
||||
//import com.qihang.common.common.ServiceException;
|
||||
//import com.qihang.common.enums.HttpStatus;
|
||||
//import com.qihang.security.LoginUser;
|
||||
//import org.springframework.security.core.Authentication;
|
||||
//import org.springframework.security.core.context.SecurityContextHolder;
|
||||
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
//
|
||||
///**
|
||||
// * 安全服务工具类
|
||||
// *
|
||||
// * @author qihang
|
||||
// */
|
||||
//public class SecurityUtils
|
||||
//{
|
||||
// /**
|
||||
// * 用户ID
|
||||
// **/
|
||||
// public static Long getUserId()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// return getLoginUser().getUserId();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw new ServiceException("获取用户ID异常", HttpStatus.UNAUTHORIZED);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取部门ID
|
||||
// **/
|
||||
// public static Long getDeptId()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// return getLoginUser().getDeptId();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw new ServiceException("获取部门ID异常", HttpStatus.UNAUTHORIZED);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取用户账户
|
||||
// **/
|
||||
// public static String getUsername()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// return getLoginUser().getUsername();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw new ServiceException("获取用户账户异常", HttpStatus.UNAUTHORIZED);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取用户
|
||||
// **/
|
||||
// public static LoginUser getLoginUser()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// return (LoginUser) getAuthentication().getPrincipal();
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// throw new ServiceException("获取用户信息异常", HttpStatus.UNAUTHORIZED);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取Authentication
|
||||
// */
|
||||
// public static Authentication getAuthentication()
|
||||
// {
|
||||
// return SecurityContextHolder.getContext().getAuthentication();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 生成BCryptPasswordEncoder密码
|
||||
// *
|
||||
// * @param password 密码
|
||||
// * @return 加密字符串
|
||||
// */
|
||||
// public static String encryptPassword(String password)
|
||||
// {
|
||||
// BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
// return passwordEncoder.encode(password);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 判断密码是否相同
|
||||
// *
|
||||
// * @param rawPassword 真实密码
|
||||
// * @param encodedPassword 加密后字符
|
||||
// * @return 结果
|
||||
// */
|
||||
// public static boolean matchesPassword(String rawPassword, String encodedPassword)
|
||||
// {
|
||||
// BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
|
||||
// return passwordEncoder.matches(rawPassword, encodedPassword);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 是否为管理员
|
||||
// *
|
||||
// * @param userId 用户ID
|
||||
// * @return 结果
|
||||
// */
|
||||
// public static boolean isAdmin(Long userId)
|
||||
// {
|
||||
// return userId != null && 1L == userId;
|
||||
// }
|
||||
//}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
//package cn.qihangerp.oms.vo;
|
||||
//
|
||||
//
|
||||
//import java.math.BigDecimal;
|
||||
//
|
||||
//public class GoodsSpecListVo {
|
||||
//
|
||||
// private Long id;
|
||||
// private Long goodsId;
|
||||
//
|
||||
// /** 商品名称 */
|
||||
// private String name;
|
||||
//
|
||||
// /** 商品编号 */
|
||||
// private String number;
|
||||
// private String specNum;
|
||||
// private String colorValue;
|
||||
// /** 商品图片地址 */
|
||||
// private String colorImage;
|
||||
// private String sizeValue;
|
||||
// private String styleValue;
|
||||
// private BigDecimal purPrice;
|
||||
//
|
||||
// public Long getId() {
|
||||
// return id;
|
||||
// }
|
||||
//
|
||||
// public void setId(Long id) {
|
||||
// this.id = id;
|
||||
// }
|
||||
//
|
||||
// public Long getGoodsId() {
|
||||
// return goodsId;
|
||||
// }
|
||||
//
|
||||
// public void setGoodsId(Long goodsId) {
|
||||
// this.goodsId = goodsId;
|
||||
// }
|
||||
//
|
||||
// public String getName() {
|
||||
// return name;
|
||||
// }
|
||||
//
|
||||
// public void setName(String name) {
|
||||
// this.name = name;
|
||||
// }
|
||||
//
|
||||
// public String getNumber() {
|
||||
// return number;
|
||||
// }
|
||||
//
|
||||
// public void setNumber(String number) {
|
||||
// this.number = number;
|
||||
// }
|
||||
//
|
||||
// public String getSpecNum() {
|
||||
// return specNum;
|
||||
// }
|
||||
//
|
||||
// public void setSpecNum(String specNum) {
|
||||
// this.specNum = specNum;
|
||||
// }
|
||||
//
|
||||
// public String getColorValue() {
|
||||
// return colorValue;
|
||||
// }
|
||||
//
|
||||
// public void setColorValue(String colorValue) {
|
||||
// this.colorValue = colorValue;
|
||||
// }
|
||||
//
|
||||
// public String getColorImage() {
|
||||
// return colorImage;
|
||||
// }
|
||||
//
|
||||
// public void setColorImage(String colorImage) {
|
||||
// this.colorImage = colorImage;
|
||||
// }
|
||||
//
|
||||
// public String getSizeValue() {
|
||||
// return sizeValue;
|
||||
// }
|
||||
//
|
||||
// public void setSizeValue(String sizeValue) {
|
||||
// this.sizeValue = sizeValue;
|
||||
// }
|
||||
//
|
||||
// public String getStyleValue() {
|
||||
// return styleValue;
|
||||
// }
|
||||
//
|
||||
// public void setStyleValue(String styleValue) {
|
||||
// this.styleValue = styleValue;
|
||||
// }
|
||||
//
|
||||
// public BigDecimal getPurPrice() {
|
||||
// return purPrice;
|
||||
// }
|
||||
//
|
||||
// public void setPurPrice(BigDecimal purPrice) {
|
||||
// this.purPrice = purPrice;
|
||||
// }
|
||||
//}
|
||||
Loading…
Reference in New Issue