初始化
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.domain.JsonResult;
|
||||
import com.ifish.entity.AdInfo;
|
||||
import com.ifish.enums.AdTypeEnum;
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.exception.IfishException;
|
||||
import com.ifish.search.PageDataDto;
|
||||
import com.ifish.service.AdInfoService;
|
||||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.ResultUtil;
|
||||
|
||||
/**
|
||||
* 广告信息
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class AdInfoAction {
|
||||
|
||||
@Autowired
|
||||
private AdInfoService adInfoService;
|
||||
|
||||
/**
|
||||
* 广告信息页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/adInfo.do")
|
||||
public ModelAndView adInfo() {
|
||||
return new ModelAndView("adInfo/adInfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告分页数据
|
||||
*
|
||||
* @param pageData
|
||||
* @param adinfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/adInfoData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getAdInfosByPage(PageDataDto pageData, AdInfo adinfo) {
|
||||
pageData.pageData(adInfoService.getAdInfosByPage(pageData, adinfo));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增广告
|
||||
*
|
||||
* @param adInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/addAdInfo.do")
|
||||
@ResponseBody
|
||||
public JsonResult addAdInfo(AdInfo adInfo, MultipartFile fileUpload) {
|
||||
//上传文件不能为空
|
||||
if (fileUpload == null) {
|
||||
throw new IfishException(SysUserEnum.warn114);
|
||||
}
|
||||
//上传广告图
|
||||
String newImgName = null;
|
||||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis()) + ".png";
|
||||
Integer adType = adInfo.getAdType();
|
||||
//首页广告尺寸750x138
|
||||
if (AdTypeEnum.one.getKey().equals(adType)) {
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_ad, newImgName, fileUpload, 750, 138);
|
||||
} //loading页面广告尺寸750×1154
|
||||
else if (AdTypeEnum.seven.getKey().equals(adType)) {
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_ad, newImgName, fileUpload, 750, 1154);
|
||||
} else {
|
||||
//其他广告尺寸750x320
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_ad, newImgName, fileUpload, 750, 320);
|
||||
}
|
||||
} catch (IfishException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IfishException(SysUserEnum.warn113);
|
||||
}
|
||||
adInfo.setAdImage(newImgName);
|
||||
//新增广告
|
||||
return adInfoService.addAdInfo(adInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广告信息
|
||||
*
|
||||
* @param adInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/updateAdInfo.do")
|
||||
@ResponseBody
|
||||
public JsonResult updateAdInfo(AdInfo adInfo, MultipartFile fileUpload) {
|
||||
String newImgName = null;
|
||||
//String oldImgName = adInfo.getAdImage();
|
||||
//上传新广告图
|
||||
if (fileUpload != null) {
|
||||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis()) + ".png";
|
||||
Integer adType = adInfo.getAdType();
|
||||
//首页广告尺寸750x138
|
||||
if (AdTypeEnum.one.getKey().equals(adType)) {
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_ad, newImgName, fileUpload, 750, 138);
|
||||
} //loading页面广告尺寸750×1154
|
||||
else if (AdTypeEnum.seven.getKey().equals(adType)) {
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_ad, newImgName, fileUpload, 750, 1154);
|
||||
} else {
|
||||
//其他广告尺寸750x320
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_ad, newImgName, fileUpload, 750, 320);
|
||||
}
|
||||
} catch (IfishException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IfishException(SysUserEnum.warn113);
|
||||
}
|
||||
adInfo.setAdImage(newImgName);
|
||||
}
|
||||
JsonResult jsonResult = adInfoService.updateAdInfo(adInfo);
|
||||
//删除老广告图
|
||||
/*if(StringUtils.isNotBlank(oldImgName)){
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_ad, oldImgName);
|
||||
}*/
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广告
|
||||
*
|
||||
* @param adId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/deleteAdInfo.do")
|
||||
@ResponseBody
|
||||
public JsonResult deleteAdInfo(Integer adId) {
|
||||
String adImage = adInfoService.deleteAdInfo(adId);
|
||||
//删除广告图
|
||||
if (StringUtils.isNotBlank(adImage)) {
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_ad, adImage);
|
||||
}
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询广告信息
|
||||
*
|
||||
* @param adId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getAdInfoById.do")
|
||||
@ResponseBody
|
||||
public AdInfo getAdInfoById(Integer adId) {
|
||||
return adInfoService.getAdInfoById(adId);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,151 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.domain.JsonResult;
|
||||
import com.ifish.entity.Coupon;
|
||||
import com.ifish.entity.CouponRecord;
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.exception.IfishException;
|
||||
import com.ifish.search.PageDataDto;
|
||||
import com.ifish.service.CouponService;
|
||||
|
||||
/**
|
||||
* 广告信息
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class CouponAction {
|
||||
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
|
||||
/**
|
||||
* 优惠券信息页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/coupon.do")
|
||||
public ModelAndView coupon(){
|
||||
return new ModelAndView("coupon/coupon");
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告分页数据
|
||||
* @param pageData
|
||||
* @param adinfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/couponData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getCouponsByPage(PageDataDto pageData,Coupon coupon){
|
||||
pageData.pageData(couponService.getCouponsByPage(pageData, coupon));
|
||||
return pageData;
|
||||
}
|
||||
/**
|
||||
* 新增优惠券
|
||||
* @param coupon
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/addCoupon.do")
|
||||
@ResponseBody
|
||||
public JsonResult saveCoupon(Coupon coupon){
|
||||
//校验参数
|
||||
validateParam(coupon);
|
||||
return couponService.addCoupon(coupon);
|
||||
}
|
||||
/**
|
||||
* 修改优惠券
|
||||
* @param coupon
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/updateCoupon.do")
|
||||
@ResponseBody
|
||||
public JsonResult updateCoupon(Coupon coupon){
|
||||
//校验参数
|
||||
validateParam(coupon);
|
||||
return couponService.updateCoupon(coupon);
|
||||
}
|
||||
/**
|
||||
* 校验参数
|
||||
* @param coupon
|
||||
*/
|
||||
public void validateParam(Coupon coupon){
|
||||
Integer moneyValue = coupon.getMoneyValue();
|
||||
Integer useNeedMoney = coupon.getUseNeedMoney();
|
||||
if(useNeedMoney!=null && useNeedMoney<=moneyValue){
|
||||
throw new IfishException(SysUserEnum.failed101.getKey(), "消费金额不能小于RMB价值");
|
||||
}
|
||||
Date validStartDate = coupon.getValidStartDate();
|
||||
Date validEndDate = coupon.getValidEndDate();
|
||||
if(validStartDate!=null && validEndDate!=null){
|
||||
if(validStartDate.compareTo(validEndDate)>0){
|
||||
throw new IfishException(SysUserEnum.failed101.getKey(), "结束日期不能小于开始日期");
|
||||
}
|
||||
}
|
||||
else if(validStartDate!=null && validEndDate==null){
|
||||
throw new IfishException(SysUserEnum.failed101.getKey(), "日期要么都填写要么都不填写");
|
||||
}
|
||||
else if(validStartDate==null && validEndDate!=null){
|
||||
throw new IfishException(SysUserEnum.failed101.getKey(), "日期要么都填写要么都不填写");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param coupon
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/deleteCoupon.do")
|
||||
@ResponseBody
|
||||
public JsonResult deleteCoupon(Integer couponId){
|
||||
return couponService.deleteCoupon(couponId);
|
||||
}
|
||||
/**
|
||||
* 根据ID查找
|
||||
* @param couponId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/getCouponById.do")
|
||||
@ResponseBody
|
||||
public Coupon getCouponById(Integer couponId){
|
||||
return couponService.getCouponById(couponId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券信息页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/couponRecord.do")
|
||||
public ModelAndView couponRecord(){
|
||||
return new ModelAndView("coupon/couponRecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告分页数据
|
||||
* @param pageData
|
||||
* @param adinfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/couponRecordData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getCouponRecordsByPage(PageDataDto pageData,CouponRecord couponRecord){
|
||||
pageData.pageData(couponService.getCouponRecordsByPage(pageData, couponRecord));
|
||||
return pageData;
|
||||
}
|
||||
/**
|
||||
* 使用优惠券
|
||||
* @param recordId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/useCoupon.do")
|
||||
@ResponseBody
|
||||
public JsonResult useCoupon(Integer recordId){
|
||||
return couponService.useCoupon(recordId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,386 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.entity.Device;
|
||||
import com.ifish.entity.FactoryList;
|
||||
import com.ifish.entity.OperateRecord;
|
||||
import com.ifish.entity.PayBill;
|
||||
import com.ifish.entity.PayeeInfo;
|
||||
import com.ifish.entity.QuestionsFeedback;
|
||||
import com.ifish.entity.SecurityUser;
|
||||
import com.ifish.hibernate.Pagination;
|
||||
import com.ifish.search.SearchFilter;
|
||||
import com.ifish.service.AdminService;
|
||||
import com.ifish.service.FactoryService;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import com.ifish.util.getRemoteAddress;
|
||||
|
||||
/**
|
||||
* @ClassName: FactoryAction
|
||||
* @Description: 电子厂用户
|
||||
* @author ggw
|
||||
*/
|
||||
|
||||
@Controller("factoryAction")
|
||||
@RequestMapping("/factory")
|
||||
public class FactoryAction {
|
||||
|
||||
@Autowired
|
||||
private FactoryService factoryService;
|
||||
@Autowired
|
||||
private AdminService adminService;
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(FactoryAction.class);
|
||||
|
||||
/**
|
||||
* 获取登录用户隶属厂家
|
||||
* @return
|
||||
*/
|
||||
public FactoryList getFactoryListByUserName(){
|
||||
SecurityUser securityUser = adminService.getSysUserByUserName(getLoginUserName());
|
||||
if(securityUser!=null){
|
||||
String code = securityUser.getCode();
|
||||
return this.adminService.getFactoryByCode(code);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 获取登录用户名
|
||||
* @return
|
||||
*/
|
||||
public String getLoginUserName(){
|
||||
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
return userDetails.getUsername();
|
||||
}
|
||||
/**
|
||||
* 主页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/home.do")
|
||||
public ModelAndView index() {
|
||||
return new ModelAndView("roleFactory/home");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/tmpDeviceList.do")
|
||||
public ModelAndView tmpDeviceList(ModelMap map) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
//硬件类型
|
||||
map.put("list1", factoryList.getHardwareTypeSet());
|
||||
//鱼缸厂
|
||||
map.put("list2", factoryList.getVenderLists());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("tmpDeviceList:error message:{}",e.toString());
|
||||
}
|
||||
return new ModelAndView("roleFactory/tmpDeviceList",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备授权页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceAssignList.do")
|
||||
public ModelAndView deviceAssignList() {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
//硬件类型
|
||||
map.put("list1", factoryList.getHardwareTypeSet());
|
||||
//鱼缸厂
|
||||
map.put("list2", factoryList.getVenderLists());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("deviceAssignList:error message:{}",e.toString());
|
||||
}
|
||||
return new ModelAndView("roleFactory/deviceAssignList",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权
|
||||
* @param tmpDevice
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceAuthorize.do")
|
||||
@ResponseBody
|
||||
public Object deviceAuthorize(SearchFilter searchFilter,HttpServletRequest request) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
String ip = getRemoteAddress.getIp(request);
|
||||
this.adminService.deviceAuthorize(ip,factoryList.getFactoryCode(),searchFilter);
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("deviceAuthorize:error message:{}",e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新分配
|
||||
* @param createCode
|
||||
* @param brandCode
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceFenpei.do")
|
||||
@ResponseBody
|
||||
public Object deviceFenpei(String createCode,String brandCode,HttpServletRequest request) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
String ip = getRemoteAddress.getIp(request);
|
||||
this.adminService.deviceFenpei(ip,factoryList.getFactoryCode(),createCode,brandCode);
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("deviceFenpei:error message:{}",e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个重新分配
|
||||
* @param createCode
|
||||
* @param brandCode
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceFenpeiSingle.do")
|
||||
@ResponseBody
|
||||
public Object deviceFenpeiSingle(Integer deviceId,String brandCode,HttpServletRequest request) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
String ip = getRemoteAddress.getIp(request);
|
||||
this.adminService.deviceFenpeiSingle(ip,factoryList.getFactoryCode(),deviceId,brandCode);
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("deviceFenpei:error message:{}",e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/tmpDeviceListInf.do")
|
||||
@ResponseBody
|
||||
public Object tmpDeviceListInf(SearchFilter searchFilter) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
searchFilter.setSelectField3(factoryList.getFactoryCode());
|
||||
Pagination<Device> page = this.factoryService.getDeviceByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
else{
|
||||
Pagination<Device> page = new Pagination<Device>(0,0,0,new ArrayList<Device>());
|
||||
return IfishUtil.returnPageData(page , searchFilter.getsEcho());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("get tmpDeviceListInf information:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 问题反馈列表页面
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/questionList.do")
|
||||
public ModelAndView questionList(String status) {
|
||||
return new ModelAndView("roleFactory/questionList","status",status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 问题反馈列表
|
||||
* @param iDisplayStart
|
||||
* @param iDisplayLength
|
||||
* @param sEcho
|
||||
* @param sSearch
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/questionInf.do")
|
||||
@ResponseBody
|
||||
public Object questionInf(SearchFilter searchFilter) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
searchFilter.setSelectField2(getLoginUserName());
|
||||
}
|
||||
Pagination<QuestionsFeedback> page = this.adminService.getQusetionByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
} catch (Exception e) {
|
||||
log.error("get questions page information:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 回答用户反馈
|
||||
* @param questionsFeedback
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/replyQuestion.do")
|
||||
@ResponseBody
|
||||
public Object replyQuestion(QuestionsFeedback questionsFeedback){
|
||||
//推送消息给用户
|
||||
try {
|
||||
//更新
|
||||
return this.adminService.questionsReply(questionsFeedback);
|
||||
} catch (Exception e) {
|
||||
log.error("replyQuestion:error message:{}",e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传Excel
|
||||
* @param user
|
||||
* @param fileUpload
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/uploadExcel.do")
|
||||
@ResponseBody
|
||||
public Object upload(@RequestParam String brandCode,@RequestParam MultipartFile fileUpload,HttpServletRequest request){
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
String ip = getRemoteAddress.getIp(request);
|
||||
this.factoryService.uploadExcel(ip,factoryList.getFactoryCode(),brandCode,fileUpload);
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("uploadExcel:error message:{}",e.toString());
|
||||
return e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 操作记录页面
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/operateRecord.do")
|
||||
public ModelAndView operateRecord() {
|
||||
return new ModelAndView("roleFactory/operateRecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作记录列表
|
||||
* @param iDisplayStart
|
||||
* @param iDisplayLength
|
||||
* @param sEcho
|
||||
* @param sSearch
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/operateRecordInf.do")
|
||||
@ResponseBody
|
||||
public Object operateRecordInf(SearchFilter searchFilter) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
searchFilter.setsSearch1(factoryList.getFactoryCode());
|
||||
}
|
||||
Pagination<OperateRecord> page = this.adminService.getOperateRecordByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
} catch (Exception e) {
|
||||
log.error("operateRecordInf:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 支付后台
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/payBill.do")
|
||||
public ModelAndView payBill() {
|
||||
PayeeInfo payeeInfo = this.adminService.getPayeeInfo(1);
|
||||
return new ModelAndView("roleFactory/payBill","payeeInfo",payeeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付后台信息列表
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/payBillInf.do")
|
||||
@ResponseBody
|
||||
public Object payBillInf(SearchFilter searchFilter) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
searchFilter.setsSearch(factoryList.getFactoryCode());
|
||||
}
|
||||
Pagination<PayBill> page = this.adminService.getPayBillByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
} catch (Exception e) {
|
||||
log.error("payBillInf:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付详情页面
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/payDetail.do")
|
||||
public ModelAndView operateRecord(ModelMap map,String billMonth) {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
map.put("factoryCode", factoryList.getFactoryCode());
|
||||
}
|
||||
map.put("billMonth", billMonth);
|
||||
return new ModelAndView("roleFactory/payDetail",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付详情列表
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/payDetailInf.do")
|
||||
@ResponseBody
|
||||
public Object payDetailInf(SearchFilter searchFilter) {
|
||||
try {
|
||||
Pagination<OperateRecord> page = this.adminService.getOperateRecordByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
} catch (Exception e) {
|
||||
log.error("payDetailInf:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.entity.GoldExpendRecord;
|
||||
import com.ifish.entity.GoldGetRecord;
|
||||
import com.ifish.entity.GoldTask;
|
||||
import com.ifish.enums.GoldExpendTypeEnum;
|
||||
import com.ifish.hibernate.Pagination;
|
||||
import com.ifish.search.PageDataDto;
|
||||
import com.ifish.search.SearchFilter;
|
||||
import com.ifish.service.GoldService;
|
||||
import com.ifish.util.IfishUtil;
|
||||
|
||||
/**
|
||||
* 金币信息
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "/gold")
|
||||
public class GoldAction {
|
||||
|
||||
@Autowired
|
||||
private GoldService goldService;
|
||||
|
||||
/**
|
||||
* 金币规则页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/goldRule.do")
|
||||
public ModelAndView goldRule() {
|
||||
return new ModelAndView("gold/goldRule");
|
||||
}
|
||||
|
||||
/**
|
||||
* 规则信息
|
||||
*
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/goldRuleInf.do")
|
||||
@ResponseBody
|
||||
public Object goldRuleInf(SearchFilter searchFilter) {
|
||||
Pagination<GoldTask> page = goldService.getGoldRuleByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增规则
|
||||
*
|
||||
* @param goldRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addGoldRule.do")
|
||||
@ResponseBody
|
||||
public Object addGoldRule(GoldTask goldRule) {
|
||||
return goldService.addGoldRule(goldRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规则
|
||||
*
|
||||
* @param goldRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateGoldRule.do")
|
||||
@ResponseBody
|
||||
public Object updateGoldRule(GoldTask goldRule) {
|
||||
return goldService.updateGoldRule(goldRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取规则
|
||||
*
|
||||
* @param ruleType
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getGoldRuleById.do")
|
||||
@ResponseBody
|
||||
public GoldTask getGoldRuleById(String ruleType) {
|
||||
return goldService.getGoldRuleById(ruleType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规则
|
||||
*
|
||||
* @param ruleType
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteGoldRule.do")
|
||||
@ResponseBody
|
||||
public Object deleteGoldRule(String ruleType) {
|
||||
return goldService.deleteGoldRule(ruleType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 经验金币记录页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/goldGetRecord.do")
|
||||
public ModelAndView goldGetRecord() {
|
||||
return new ModelAndView("gold/goldGetRecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* 金币获取记录
|
||||
*
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("goldGetRecordInf.do")
|
||||
@ResponseBody
|
||||
public Object goldGetRecordInf(SearchFilter searchFilter) {
|
||||
Pagination<GoldGetRecord> page = goldService.getGoldGetRecordByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
|
||||
/**
|
||||
* 金币任务
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "getGoldTask.do")
|
||||
@ResponseBody
|
||||
public Object getGoldTask(Integer userId) {
|
||||
return goldService.getGoldTask(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 金币消耗记录页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/goldExpendRecord.do")
|
||||
public ModelAndView goldExpendRecord(Model model) {
|
||||
model.addAttribute("typeMap", GoldExpendTypeEnum.getJson());
|
||||
return new ModelAndView("gold/goldExpendRecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* 金币消耗记录
|
||||
*
|
||||
* @param param 参数
|
||||
* @param returnData 返回对象
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("goldExpendRecordInf.do")
|
||||
@ResponseBody
|
||||
public PageDataDto goldExpendRecordInf(PageDataDto pageData, GoldExpendRecord record) {
|
||||
pageData.pageData(goldService.getGoldExpendRecordByPage(pageData, record));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
*
|
||||
* @param ruleType
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "finishTask.do")
|
||||
@ResponseBody
|
||||
public Object finishTask(String ruleType, Integer userId) {
|
||||
return goldService.finishTask(ruleType, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
*
|
||||
* @param ruleType
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "finishTaskAddGoldValueByAdmin.do")
|
||||
@ResponseBody
|
||||
public Object finishTaskAddGoldValueByAdmin(String ruleType, Integer userId, String gold) {
|
||||
return goldService.finishTaskAddGoldValueByAdmin(ruleType, userId, gold);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.entity.Grade;
|
||||
import com.ifish.entity.GradeRecord;
|
||||
import com.ifish.entity.GradeTask;
|
||||
import com.ifish.hibernate.Pagination;
|
||||
import com.ifish.search.SearchFilter;
|
||||
import com.ifish.service.GradeService;
|
||||
import com.ifish.util.IfishUtil;
|
||||
|
||||
|
||||
/**
|
||||
* 等级信息
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value="/grade")
|
||||
public class GradeAction {
|
||||
@Autowired
|
||||
private GradeService gradeService;
|
||||
|
||||
/**
|
||||
* 等级页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/grade.do")
|
||||
public ModelAndView grade(){
|
||||
return new ModelAndView("grade/grade");
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级信息
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/gradeInf.do")
|
||||
@ResponseBody
|
||||
public Object gradeInf(SearchFilter searchFilter){
|
||||
Pagination<Grade> page = gradeService.getGradeByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取等级信息
|
||||
* @param gradeNum
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getGradeById.do")
|
||||
@ResponseBody
|
||||
public Object getGradeById(Integer gradeNum){
|
||||
return gradeService.getGradeById(gradeNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增等级
|
||||
* @param grade
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addGrade.do")
|
||||
@ResponseBody
|
||||
public Object addGrade(Grade grade){
|
||||
return gradeService.addGrade(grade);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改等级
|
||||
* @param grade
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateGrade")
|
||||
@ResponseBody
|
||||
public Object updateGrade(Grade grade){
|
||||
return gradeService.updateGrade(grade);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除等级
|
||||
* @param gradeNum
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteGrade.do")
|
||||
@ResponseBody
|
||||
public Object deleteGrade(Integer gradeNum){
|
||||
return gradeService.deleteGrade(gradeNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 等级规则页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/gradeRule.do")
|
||||
public ModelAndView gradeRule(){
|
||||
return new ModelAndView("grade/gradeRule");
|
||||
}
|
||||
|
||||
/**
|
||||
* 规则信息
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/gradeRuleInf.do")
|
||||
@ResponseBody
|
||||
public Object gradeRuleInf(SearchFilter searchFilter){
|
||||
Pagination<GradeTask> page = gradeService.getGradeRuleByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增规则
|
||||
* @param gradeRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addGradeRule.do")
|
||||
@ResponseBody
|
||||
public Object addGradeRule(GradeTask gradeRule){
|
||||
return gradeService.addGradeRule(gradeRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规则
|
||||
* @param gradeRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateGradeRule.do")
|
||||
@ResponseBody
|
||||
public Object updateGradeRule(GradeTask gradeRule){
|
||||
return gradeService.updateGradeRule(gradeRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取规则
|
||||
* @param ruleType
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getGradeRuleById.do")
|
||||
@ResponseBody
|
||||
public GradeTask getGradeRuleById(String ruleType){
|
||||
return gradeService.getGradeRuleById(ruleType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规则
|
||||
* @param ruleType
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deleteGradeRule.do")
|
||||
@ResponseBody
|
||||
public Object deleteGradeRule(String ruleType){
|
||||
return gradeService.deleteGradeRule(ruleType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 经验获取记录页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/gradeRecord.do")
|
||||
public ModelAndView gradeRecord(Model model){
|
||||
List<GradeTask> list = gradeService.getGradeRuleList(null);
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
for (GradeTask gradeRule : list) {
|
||||
map.put(gradeRule.getRuleType(), gradeRule.getRuleName());
|
||||
}
|
||||
model.addAttribute("ruleTypeMap", map);
|
||||
return new ModelAndView("grade/gradeRecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* 经验获取记录
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("gradeRecordInf.do")
|
||||
@ResponseBody
|
||||
public Object gradeRecordInf(SearchFilter searchFilter){
|
||||
Pagination<GradeRecord> page = gradeService.getGradeRecordByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
|
||||
/**
|
||||
* 经验任务
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="getGradeTask.do")
|
||||
@ResponseBody
|
||||
public Object getGradeTask(Integer userId){
|
||||
return gradeService.getGradeTask(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
* @param ruleType
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="finishTask.do")
|
||||
@ResponseBody
|
||||
public Object finishTask(String ruleType,Integer userId){
|
||||
return gradeService.finishTask(ruleType, userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.domain.JsonResult;
|
||||
import com.ifish.entity.IfishGoods;
|
||||
import com.ifish.entity.IfishShop;
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.exception.IfishException;
|
||||
import com.ifish.search.PageDataDto;
|
||||
import com.ifish.service.IfishGoodsService;
|
||||
import com.ifish.service.IfishShopService;
|
||||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.ResultUtil;
|
||||
|
||||
/**
|
||||
* 商品管理action
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class IfishGoodsAction {
|
||||
|
||||
@Autowired
|
||||
private IfishGoodsService ifishGoodsService;
|
||||
@Autowired
|
||||
private IfishShopService ifishShopService;
|
||||
|
||||
/**
|
||||
* 信息页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/ifishGoods.do")
|
||||
public ModelAndView IfishGoods(Model model){
|
||||
List<IfishShop> list = ifishShopService.getAllIfishShop();
|
||||
model.addAttribute("ifishShopList", list);
|
||||
return new ModelAndView("ifishShop/ifishGoods");
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
* @param pageData
|
||||
* @param IfishGoods
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/ifishGoodsData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getIfishGoodsByPage(PageDataDto pageData,IfishGoods ifishGoods){
|
||||
pageData.pageData(ifishGoodsService.getIfishGoodsByPage(pageData, ifishGoods));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param ifishGoods
|
||||
* @param fileUpload
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/addIfishGoods.do")
|
||||
@ResponseBody
|
||||
public JsonResult addIfishGoods(IfishGoods ifishGoods,MultipartFile fileUpload){
|
||||
//上传广告图
|
||||
String newImgName = ifishGoods.getGoodsPicture();
|
||||
//复制商品时可不上传商品图片
|
||||
if(newImgName==null){
|
||||
//上传文件不能为空
|
||||
if(fileUpload==null){
|
||||
throw new IfishException(SysUserEnum.warn114);
|
||||
}
|
||||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis())+".png";
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods,newImgName,fileUpload);
|
||||
} catch (IfishException e){
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IfishException(SysUserEnum.warn113);
|
||||
}
|
||||
ifishGoods.setGoodsPicture(newImgName);
|
||||
}
|
||||
//新增广告
|
||||
return ifishGoodsService.addIfishGoods(ifishGoods);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param ifishGoods
|
||||
* @param fileUpload
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/updateIfishGoods.do")
|
||||
@ResponseBody
|
||||
public JsonResult updateIfishGoods(IfishGoods ifishGoods,MultipartFile fileUpload){
|
||||
String newImgName = null;
|
||||
//String oldImgName = ifishGoods.getGoodsPicture();
|
||||
//上传新广告图
|
||||
if(fileUpload!=null){
|
||||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis())+".png";
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods,newImgName,fileUpload);
|
||||
} catch (IfishException e){
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IfishException(SysUserEnum.warn113);
|
||||
}
|
||||
ifishGoods.setGoodsPicture(newImgName);
|
||||
}
|
||||
JsonResult jsonResult = null;
|
||||
try {
|
||||
//更新
|
||||
jsonResult = ifishGoodsService.updateIfishGoods(ifishGoods);
|
||||
} catch (Exception e) {
|
||||
//异常则删除新上传的图片
|
||||
if(newImgName!=null){
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_goods, newImgName);
|
||||
}
|
||||
throw new IfishException(SysUserEnum.failed101.getKey(),e.getMessage());
|
||||
}
|
||||
//删除老广告图
|
||||
/*if(newImgName!=null && StringUtils.isNotBlank(oldImgName)){
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_goods, oldImgName);
|
||||
}*/
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param goodsId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/deleteIfishGoods.do")
|
||||
@ResponseBody
|
||||
public JsonResult deleteIfishGoods(@RequestParam("id") Integer goodsId){
|
||||
String adImage = ifishGoodsService.deleteIfishGoods(goodsId);
|
||||
//删除广告图
|
||||
if(StringUtils.isNotBlank(adImage)){
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_goods, adImage);
|
||||
}
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param goodsId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/getIfishGoodsById.do")
|
||||
@ResponseBody
|
||||
public IfishGoods getIfishGoodsById(@RequestParam("id") Integer goodsId){
|
||||
return ifishGoodsService.getIfishGoodsById(goodsId);
|
||||
}
|
||||
|
||||
/**
|
||||
* app是否显示
|
||||
* @param goodId
|
||||
* @param isShow
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/ifishGoodsShowUpdate.do")
|
||||
@ResponseBody
|
||||
public JsonResult informationShowUpdate(@RequestParam Integer goodsId,@RequestParam boolean isShow) {
|
||||
return ifishGoodsService.IfishGoodsShowUpdate(goodsId, isShow);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.domain.JsonResult;
|
||||
import com.ifish.entity.IfishShop;
|
||||
import com.ifish.search.PageDataDto;
|
||||
import com.ifish.service.IfishShopService;
|
||||
|
||||
/**
|
||||
* 店铺管理action
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class IfishShopAction {
|
||||
|
||||
@Autowired
|
||||
private IfishShopService ifishShopService;
|
||||
|
||||
/**
|
||||
* 店铺管理
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/ifishShop.do")
|
||||
public ModelAndView ifishShop(){
|
||||
return new ModelAndView("ifishShop/ifishShop");
|
||||
}
|
||||
/**
|
||||
* 店铺信息数据
|
||||
* @param pageData
|
||||
* @param ifishShop
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/ifishShopData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getIfishShopByPage(PageDataDto pageData,IfishShop ifishShop){
|
||||
pageData.pageData(ifishShopService.getIfishShopByPage(pageData, ifishShop));
|
||||
return pageData;
|
||||
}
|
||||
/**
|
||||
* 新增
|
||||
* @param ifishShop
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/addIfishShop.do")
|
||||
@ResponseBody
|
||||
public JsonResult addIfishShop(IfishShop ifishShop){
|
||||
return ifishShopService.addIfishShop(ifishShop);
|
||||
}
|
||||
/**
|
||||
* 修改
|
||||
* @param ifishShop
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/updateIfishShop.do")
|
||||
@ResponseBody
|
||||
public JsonResult updateIfishShop(IfishShop ifishShop){
|
||||
return ifishShopService.updateIfishShop(ifishShop);
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/deleteIfishShop.do")
|
||||
@ResponseBody
|
||||
public JsonResult deleteIfishShop(Integer shopId){
|
||||
return ifishShopService.deleteIfishShop(shopId);
|
||||
}
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param shopId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/getIfishShopById.do")
|
||||
@ResponseBody
|
||||
public IfishShop getIfishShopById(Integer shopId){
|
||||
return ifishShopService.getIfishShopById(shopId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.domain.JsonResult;
|
||||
import com.ifish.entity.Information;
|
||||
import com.ifish.entity.Ueditor;
|
||||
import com.ifish.enums.InformationSourceEnum;
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.exception.IfishException;
|
||||
import com.ifish.search.PageDataDto;
|
||||
import com.ifish.service.InformationService;
|
||||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.ResultUtil;
|
||||
|
||||
/**
|
||||
* 资讯信息
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class InformationAction {
|
||||
|
||||
@Autowired
|
||||
private InformationService infoService;
|
||||
|
||||
/**
|
||||
* 资讯信息页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/information.do")
|
||||
public ModelAndView information(Model model){
|
||||
model.addAttribute("ueditorMap", infoService.getUeditors());
|
||||
return new ModelAndView("information/information");
|
||||
}
|
||||
|
||||
/**
|
||||
* 资讯信息分页数据
|
||||
* @param pageData
|
||||
* @param information
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/informationData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getInformationByPage(PageDataDto pageData,Information information){
|
||||
pageData.pageData(infoService.getInformationByPage(pageData, information));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* app展示
|
||||
* @param infoId
|
||||
* @param appShow
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/informationShowUpdate.do")
|
||||
@ResponseBody
|
||||
public JsonResult informationShowUpdate(@RequestParam Integer infoId,@RequestParam boolean appShow) {
|
||||
return infoService.informationShowUpdate(infoId,appShow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资讯
|
||||
* @param information
|
||||
* @param fileUpload
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/addInformation.do")
|
||||
@ResponseBody
|
||||
public JsonResult addInformation(Information information,MultipartFile fileUpload){
|
||||
//上传文件不能为空
|
||||
if(fileUpload==null){
|
||||
throw new IfishException(SysUserEnum.warn114);
|
||||
}
|
||||
//上传图片
|
||||
String newImgName = null;
|
||||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis())+".png";
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_information,newImgName,fileUpload);
|
||||
} catch (IfishException e){
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IfishException(SysUserEnum.warn113);
|
||||
}
|
||||
information.setImage(newImgName);
|
||||
//新增资讯
|
||||
return infoService.addInformation(information);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改资讯信息
|
||||
* @param information
|
||||
* @param fileUpload
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/updateInformation.do")
|
||||
@ResponseBody
|
||||
public JsonResult updateInformation(Information information,MultipartFile fileUpload){
|
||||
String newImgName = null;
|
||||
//String oldImgName = information.getImage();
|
||||
//上传新资讯图
|
||||
if(fileUpload!=null){
|
||||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis())+".png";
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_information,newImgName,fileUpload);
|
||||
} catch (IfishException e){
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IfishException(SysUserEnum.warn113);
|
||||
}
|
||||
information.setImage(newImgName);
|
||||
}
|
||||
JsonResult jsonResult = infoService.updateInformation(information);
|
||||
//删除老资讯图
|
||||
/*if(newImgName!=null && StringUtils.isNotBlank(oldImgName)){
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_information, oldImgName);
|
||||
}*/
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资讯
|
||||
* @param infoId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/deleteInformation.do")
|
||||
@ResponseBody
|
||||
public JsonResult deleteInformation(Integer infoId){
|
||||
String image = infoService.deleteInformation(infoId);
|
||||
//删除资讯图
|
||||
if(StringUtils.isNotBlank(image)){
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_img_information, image);
|
||||
}
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询资讯信息
|
||||
* @param infoId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="/getInformationById.do")
|
||||
@ResponseBody
|
||||
public Information getInformationById(Integer infoId){
|
||||
Information info = infoService.getInformationById(infoId);
|
||||
if(info.getUeditorId()!=null){
|
||||
info.setSource(InformationSourceEnum.ueditor.getKey());
|
||||
}
|
||||
else{
|
||||
info.setSource(InformationSourceEnum.other.getKey());
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查找编辑器信息
|
||||
* @param ueditorId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/information/getUeditorById.do")
|
||||
@ResponseBody
|
||||
public Ueditor editUeditor(Integer ueditorId) {
|
||||
return infoService.getUeditorById(ueditorId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ifish.entity.Menu;
|
||||
import com.ifish.entity.Role;
|
||||
import com.ifish.entity.SecurityUser;
|
||||
import com.ifish.enums.RoleEnum;
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.menu.IfishMenu;
|
||||
import com.ifish.service.AdminService;
|
||||
import com.ifish.service.PublicService;
|
||||
import com.ifish.ueditor.ActionEnter;
|
||||
import com.ifish.util.getRemoteAddress;
|
||||
|
||||
/**
|
||||
* @ClassName: PublicAction
|
||||
* @Description: 公共页面
|
||||
* @author ggw
|
||||
*/
|
||||
|
||||
@Controller("publicAction")
|
||||
@RequestMapping("/public")
|
||||
public class PublicAction {
|
||||
|
||||
@Autowired
|
||||
private PublicService publicService;
|
||||
|
||||
@Autowired
|
||||
private AdminService adminService;
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(PublicAction.class);
|
||||
|
||||
/**
|
||||
* 登陆页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/login.do")
|
||||
public ModelAndView login(String status) {
|
||||
return new ModelAndView("roleAll/login","status",status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本编辑器配置
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@RequestMapping("/config.do")
|
||||
public void config(HttpServletRequest request,HttpServletResponse response){
|
||||
try {
|
||||
request.setCharacterEncoding( "utf-8" );
|
||||
response.setHeader("Content-Type" , "text/html");
|
||||
response.setContentType("application/json");
|
||||
String rootPath = request.getSession().getServletContext().getRealPath( "/" );
|
||||
String exec = new ActionEnter( request, rootPath ).exec();
|
||||
PrintWriter writer = response.getWriter();
|
||||
writer.write(exec);
|
||||
writer.flush();
|
||||
writer.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/index.do")
|
||||
public ModelAndView index() {
|
||||
String role = null;
|
||||
String userName = null;
|
||||
try {
|
||||
//登录用户
|
||||
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
userName = userDetails.getUsername();
|
||||
//根据登录用户角色类型跳转
|
||||
Collection<? extends GrantedAuthority> authorities = SecurityContextHolder.getContext().getAuthentication().getAuthorities();
|
||||
for(GrantedAuthority grantedAuthority : authorities) {
|
||||
role = grantedAuthority.getAuthority();
|
||||
}
|
||||
//菜单初始化
|
||||
if(role!=null && userName!=null){
|
||||
Role curRole = this.adminService.get(role);
|
||||
List<Menu> menuList = new ArrayList<Menu>();
|
||||
menuList.addAll(curRole.getMenuList());
|
||||
//默认选择菜单
|
||||
IfishMenu.initChioceMenu(userName, null);
|
||||
//用户菜单
|
||||
if(userName!=null){
|
||||
IfishMenu.initMenu(userName, menuList);
|
||||
}
|
||||
}
|
||||
//重定向
|
||||
String redirect = "";
|
||||
if(role.equals(RoleEnum.admin.getKey())){
|
||||
redirect = "page/admin/home.do";
|
||||
}
|
||||
else if(role.equals(RoleEnum.vender.getKey())){
|
||||
redirect = "page/vender/tmpDeviceList.do";
|
||||
}
|
||||
else if(role.equals(RoleEnum.user.getKey())){
|
||||
redirect = "page/user/home.do";
|
||||
}
|
||||
else if(role.equals(RoleEnum.factory.getKey())){
|
||||
redirect = "page/factory/tmpDeviceList.do";
|
||||
}
|
||||
return new ModelAndView("redirect:/"+redirect);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("index page:role:{},error message:{}",role,e.toString());
|
||||
}
|
||||
return new ModelAndView("redirect:login.do");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密码页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/changePwd.do")
|
||||
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
|
||||
*/
|
||||
@RequestMapping("/signup.do")
|
||||
public ModelAndView signup(SecurityUser securityUser) {
|
||||
try {
|
||||
String code = publicService.createSysUser(securityUser);
|
||||
return new ModelAndView("redirect:/page/public/login.do","status",code);
|
||||
} catch (Exception e) {
|
||||
log.error("securityUser register:userName:{},error message:{}",securityUser.getUsername(),e.toString());
|
||||
}
|
||||
return new ModelAndView("redirect:/page/public/login.do","status",SysUserEnum.failed101.getKey());
|
||||
}
|
||||
|
||||
/***********************************************测试工具接口***************************************************/
|
||||
/**
|
||||
* 获取厂家列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getVenderList.do")
|
||||
@ResponseBody
|
||||
public Object getVenderList(HttpServletResponse response,String factoryCode) {
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
try {
|
||||
map = publicService.getVenderList(factoryCode);
|
||||
} catch (Exception e) {
|
||||
log.error("get venderList information to test tool:error message:{}",e.toString());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
/**
|
||||
* 保存设备mac
|
||||
* @param data
|
||||
* @param subStr
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,284 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.domain.JsonResult;
|
||||
import com.ifish.entity.ShopsInfo;
|
||||
import com.ifish.enums.ShopsStatusEnum;
|
||||
import com.ifish.enums.SysUserEnum;
|
||||
import com.ifish.exception.IfishException;
|
||||
import com.ifish.search.PageDataDto;
|
||||
import com.ifish.service.ShopsInfoService;
|
||||
import com.ifish.util.IfishFileDirectory;
|
||||
import com.ifish.util.IfishFileUtils;
|
||||
import com.ifish.util.ResultUtil;
|
||||
import com.ifishNew.bean.CommodityInfoBean;
|
||||
import com.ifishNew.help.CommodityInfoHelperI;
|
||||
|
||||
/**
|
||||
* 商家信息controller
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class ShopsInfoAction {
|
||||
|
||||
@Autowired
|
||||
private ShopsInfoService shopsInfoService;
|
||||
|
||||
@Autowired
|
||||
private CommodityInfoHelperI commodityInfoHelperI;
|
||||
|
||||
/**
|
||||
* 已审核商家信息页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfo.do")
|
||||
public ModelAndView shopsInfo() {
|
||||
return new ModelAndView("shopsInfo/shopsInfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* 已审核分页数据
|
||||
*
|
||||
* @param pageData
|
||||
* @param shopsInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfoData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getShopsInfoByPage(PageDataDto pageData, ShopsInfo shopsInfo) {
|
||||
shopsInfo.setStatus(ShopsStatusEnum.status1.getKey());
|
||||
pageData.pageData(shopsInfoService.getShopsInfoByPage(pageData, shopsInfo));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 未审核商家信息页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfo2.do")
|
||||
public ModelAndView shopsInfo2() {
|
||||
return new ModelAndView("shopsInfo/shopsInfo2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 未审核分页数据
|
||||
*
|
||||
* @param pageData
|
||||
* @param shopsInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfoData2.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getShopsInfoByPage2(PageDataDto pageData, ShopsInfo shopsInfo) {
|
||||
shopsInfo.setStatus(ShopsStatusEnum.status1.getKey());
|
||||
pageData.pageData(shopsInfoService.getShopsInfoByPage2(pageData, shopsInfo));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*
|
||||
* @param shopsId
|
||||
* @param appShow
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfo/appShowUpdate.do")
|
||||
@ResponseBody
|
||||
public JsonResult appShowUpdate(Integer shopsId, boolean appShow) {
|
||||
return shopsInfoService.shopsInfoShowUpdate(shopsId, appShow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否屏蔽
|
||||
*
|
||||
* @param shopsId
|
||||
* @param isPingBi
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfo/pingBiUpdate.do")
|
||||
@ResponseBody
|
||||
public JsonResult isPingBiWeChat(Integer shopsId, boolean isPingBi) {
|
||||
return shopsInfoService.isPingBiWeChat(shopsId, isPingBi);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传封面
|
||||
*
|
||||
* @param shopsId
|
||||
* @param fileUpload
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfo/uploadPicture.do")
|
||||
@ResponseBody
|
||||
public JsonResult uploadPicture(Integer shopsId, Integer userId, MultipartFile fileUpload) {
|
||||
String newImgName = null;
|
||||
String oldImgName = null;
|
||||
//上传新封面图
|
||||
if (fileUpload != null) {
|
||||
try {
|
||||
//上传文件
|
||||
newImgName = String.valueOf(System.currentTimeMillis()) + ".png";
|
||||
IfishFileUtils.uploadFile(IfishFileDirectory.path_picture4 + "/" + userId, newImgName, fileUpload);
|
||||
} catch (IfishException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw new IfishException(SysUserEnum.warn113);
|
||||
}
|
||||
//老封面图
|
||||
oldImgName = shopsInfoService.updatePicture(shopsId, newImgName);
|
||||
}
|
||||
//删除老封面图
|
||||
if (StringUtils.isNotBlank(oldImgName)) {
|
||||
IfishFileUtils.deleteFile(IfishFileDirectory.path_picture4 + "/" + userId, oldImgName);
|
||||
}
|
||||
return ResultUtil.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家审核页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsInfo/reviewPage.do")
|
||||
public ModelAndView review(Model model, Integer shopsId) {
|
||||
model.addAttribute("shopsInfo", shopsInfoService.getShopsInfoById(shopsId));
|
||||
return new ModelAndView("shopsInfo/reviewPage");
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家审核
|
||||
*
|
||||
* @param shopsId
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsInfo/reviewShops.do")
|
||||
public ModelAndView reviewShops(Model model, Integer shopsId, String status, String reason) {
|
||||
JsonResult jsonResult = shopsInfoService.reviewShopsInfo(shopsId, status, reason);
|
||||
model.addAttribute("status", jsonResult.getResult());
|
||||
model.addAttribute("msg", jsonResult.getMsg());
|
||||
//return new ModelAndView("redirect:/page/shopsInfo2.do");
|
||||
return new ModelAndView("shopsInfo/shopsInfo2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 看护列表页面
|
||||
*
|
||||
* @param model
|
||||
* @param shopsUserId
|
||||
* @param shopsId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsInfo/lookList.do")
|
||||
public ModelAndView lookList(Model model, Integer shopsUserId, Integer shopsId) {
|
||||
model.addAttribute("shopsUserId", shopsUserId);
|
||||
model.addAttribute("shopsInfo", shopsInfoService.getShopsInfoById(shopsId));
|
||||
return new ModelAndView("shopsInfo/lookList");
|
||||
}
|
||||
|
||||
/**
|
||||
* 看护列表数据
|
||||
*
|
||||
* @param pageData
|
||||
* @param shopsUserId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsInfo/lookListInfo.do")
|
||||
@ResponseBody
|
||||
public PageDataDto lookListInfo(PageDataDto pageData, Integer shopsUserId) {
|
||||
pageData.pageData(shopsInfoService.getLookListInfo(pageData, shopsUserId));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家会员页面
|
||||
*
|
||||
* @param model
|
||||
* @param shopsId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsUserInfo.do")
|
||||
public ModelAndView shopsUserInfo(Model model, Integer shopsId) {
|
||||
model.addAttribute("shopsId", shopsId);
|
||||
model.addAttribute("shopsInfo", shopsInfoService.getShopsInfoById(shopsId));
|
||||
return new ModelAndView("shopsInfo/shopsUserInfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* 商家会员信息
|
||||
*
|
||||
* @param pageData
|
||||
* @param shopsId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsUserInfo/shopsUserInfoData.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getShopsUserInfoByPage(PageDataDto pageData, Integer shopsId) {
|
||||
pageData.pageData(shopsInfoService.getShopsUserInfoByPage(pageData, shopsId));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备注
|
||||
*
|
||||
* @param shopsId
|
||||
* @param remark
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsInfo/updateRemark.do")
|
||||
@ResponseBody
|
||||
public JsonResult updateShopsInfoRemark(Integer shopsId, String remark) {
|
||||
return shopsInfoService.updateShopsInfoRemark(shopsId, remark);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品管理页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsInfo/goodsView.do")
|
||||
@ResponseBody
|
||||
public ModelAndView getGoodsView() {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
mv = commodityInfoHelperI.getGoodsPage(mv);
|
||||
mv.setViewName("shopsInfo/goodsView");
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*
|
||||
* @param commodityInfoBean
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/shopsInfo/updategoodsInfo.do")
|
||||
@ResponseBody
|
||||
public JsonResult updateGoodsInfoJsonResult(CommodityInfoBean commodityInfoBean,boolean appShow) {
|
||||
return commodityInfoHelperI.updateCommodityInfo(commodityInfoBean,appShow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品分页数据
|
||||
*
|
||||
* @param pageData
|
||||
* @param commodityInfoBean
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/shopsInfo/getGoodsList.do")
|
||||
@ResponseBody
|
||||
public PageDataDto getShopsInfoByPage2(PageDataDto pageData, CommodityInfoBean commodityInfoBean) {
|
||||
return commodityInfoHelperI.getCommodityInfoByPage(pageData, commodityInfoBean);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* @ClassName: UserAction
|
||||
* @Description: 普通用户
|
||||
* @author ggw
|
||||
*/
|
||||
|
||||
@Controller("userAction")
|
||||
@RequestMapping("/user")
|
||||
public class UserAction {
|
||||
|
||||
//private static Logger log = LoggerFactory.getLogger(UserAction.class);
|
||||
|
||||
/**
|
||||
* 主页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/home.do")
|
||||
public ModelAndView index() {
|
||||
return new ModelAndView("roleUser/home");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.ifish.action;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.entity.Device;
|
||||
import com.ifish.entity.FactoryList;
|
||||
import com.ifish.entity.HardwareType;
|
||||
import com.ifish.entity.QuestionsFeedback;
|
||||
import com.ifish.entity.SecurityUser;
|
||||
import com.ifish.entity.VenderList;
|
||||
import com.ifish.hibernate.Pagination;
|
||||
import com.ifish.search.SearchFilter;
|
||||
import com.ifish.service.AdminService;
|
||||
import com.ifish.service.FactoryService;
|
||||
import com.ifish.util.IfishUtil;
|
||||
|
||||
/**
|
||||
* @ClassName: VenderAction
|
||||
* @Description: 厂家页面
|
||||
* @author ggw
|
||||
*/
|
||||
|
||||
@Controller("venderAction")
|
||||
@RequestMapping("/vender")
|
||||
public class VenderAction {
|
||||
|
||||
@Autowired
|
||||
private AdminService adminService;
|
||||
@Autowired
|
||||
private FactoryService factoryService;
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(VenderAction.class);
|
||||
|
||||
/**
|
||||
* 获取登录用户隶属厂家
|
||||
* @return
|
||||
*/
|
||||
public VenderList getVenderListByUserName(){
|
||||
SecurityUser securityUser = adminService.getSysUserByUserName(getLoginUserName());
|
||||
if(securityUser!=null){
|
||||
String code = securityUser.getCode();
|
||||
return this.adminService.getVenderById(code);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 获取登录用户名
|
||||
* @return
|
||||
*/
|
||||
public String getLoginUserName(){
|
||||
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
return userDetails.getUsername();
|
||||
}
|
||||
/**
|
||||
* 主页
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/home.do")
|
||||
public ModelAndView index() {
|
||||
return new ModelAndView("roleVender/home");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息页面
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/tmpDeviceList.do")
|
||||
public ModelAndView tmpDeviceList(ModelMap map) {
|
||||
try {
|
||||
VenderList venderList = getVenderListByUserName();
|
||||
if(venderList!=null){
|
||||
//电子厂
|
||||
Map<String, String> factoryMap = factoryService.getFactoryByVenderCode(venderList.getBrandCode());
|
||||
//硬件类型
|
||||
Map<String, String> hardwareTypeMap = new HashMap<String, String>();
|
||||
for (Map.Entry<String, String> entry: factoryMap.entrySet()) {
|
||||
FactoryList factoryList = this.adminService.getFactoryByCode(entry.getKey());
|
||||
Set<HardwareType> hardwareSet = factoryList.getHardwareTypeSet();
|
||||
for (HardwareType hardwareType : hardwareSet) {
|
||||
hardwareTypeMap.put(hardwareType.getHardwareType(), hardwareType.getHardwareName());
|
||||
}
|
||||
}
|
||||
map.put("factoryMap", factoryMap);
|
||||
map.put("hardwareTypeMap", hardwareTypeMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("tmpDeviceList:error message:{}",e.toString());
|
||||
}
|
||||
return new ModelAndView("roleVender/tmpDeviceList",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/tmpDeviceListInf.do")
|
||||
@ResponseBody
|
||||
public Object tmpDeviceListInf(SearchFilter searchFilter) {
|
||||
try {
|
||||
VenderList venderList = getVenderListByUserName();
|
||||
if(venderList!=null){
|
||||
searchFilter.setSelectField1(venderList.getBrandCode());
|
||||
Pagination<Device> page = this.factoryService.getDeviceByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
else{
|
||||
Pagination<Device> page = new Pagination<Device>(0,0,0,new ArrayList<Device>());
|
||||
return IfishUtil.returnPageData(page , searchFilter.getsEcho());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("get tmpDeviceListInf information:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 问题反馈列表页面
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/questionList.do")
|
||||
public ModelAndView questionList(String status) {
|
||||
return new ModelAndView("roleVender/questionList","status",status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 问题反馈列表
|
||||
* @param iDisplayStart
|
||||
* @param iDisplayLength
|
||||
* @param sEcho
|
||||
* @param sSearch
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/questionInf.do")
|
||||
@ResponseBody
|
||||
public Object questionInf(SearchFilter searchFilter) {
|
||||
try {
|
||||
VenderList venderList = getVenderListByUserName();
|
||||
if(venderList!=null){
|
||||
searchFilter.setSelectField2(getLoginUserName());
|
||||
}
|
||||
Pagination<QuestionsFeedback> page = this.adminService.getQusetionByPage(searchFilter);
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
} catch (Exception e) {
|
||||
log.error("get questions page information:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 回答用户反馈
|
||||
* @param questionsFeedback
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/replyQuestion.do")
|
||||
@ResponseBody
|
||||
public Object replyQuestion(QuestionsFeedback questionsFeedback){
|
||||
try {
|
||||
return this.adminService.questionsReply(questionsFeedback);
|
||||
} catch (Exception e) {
|
||||
log.error("replyQuestion:error message:{}",e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.AdInfo;
|
||||
|
||||
/**
|
||||
* 广告信息
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface AdInfoDao extends BaseDao<AdInfo, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.criterion.Criterion;
|
||||
import org.hibernate.criterion.Order;
|
||||
|
||||
import com.ifish.hibernate.Pagination;
|
||||
|
||||
/**
|
||||
* @ClassName: BaseDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface BaseDao<T, ID extends Serializable> {
|
||||
|
||||
public T get(ID id);
|
||||
|
||||
public T save(T t);
|
||||
|
||||
public T update(T t);
|
||||
|
||||
public void delete(T t);
|
||||
|
||||
public List<T> findByProperty(Criterion... criterions);
|
||||
|
||||
public List<T> findByProperty(Order order,Criterion... criterions);
|
||||
|
||||
public T findUniqueByProperty(Criterion... criterions);
|
||||
|
||||
public int countByProperty(Criterion... criterion);
|
||||
|
||||
public Pagination<T> findByCriteria(Integer firstResult,Integer pageSize,List<Order> orders,Criterion... criterion);
|
||||
|
||||
public Pagination<T> findByJoinCriteria(Integer firstResult,Integer pageSize,List<Order> orders,Map<String,List<Criterion>> joinMap,Criterion[] criterion);
|
||||
|
||||
public Pagination<T> findByJoinCriteria(Integer firstResult,Integer pageSize,List<Order> orders,Map<String,List<Criterion>> joinMap,Map<String,Order> orderMap,Criterion[] criterion);
|
||||
|
||||
public Criteria createCriteria(List<Order> orders,Criterion... criterions);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.CameraActive;
|
||||
|
||||
/**
|
||||
* @ClassName: CameraActiveDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface CameraActiveDao extends BaseDao<CameraActive, String>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Camera;
|
||||
|
||||
/**
|
||||
* @ClassName: CameraDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface CameraDao extends BaseDao<Camera, String>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.CameraUser;
|
||||
import com.ifish.entity.id.CameraUserId;
|
||||
|
||||
/**
|
||||
* @ClassName: CameraUserDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface CameraUserDao extends BaseDao<CameraUser, CameraUserId>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Comment;
|
||||
|
||||
/**
|
||||
* @ClassName: CommentDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface CommentDao extends BaseDao<Comment, Integer>{
|
||||
|
||||
public Integer getPinglunNum(Integer ueditorId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Coupon;
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface CouponDao extends BaseDao<Coupon, Integer> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.CouponRecord;
|
||||
|
||||
/**
|
||||
* 优惠券兑换记录
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface CouponRecordDao extends BaseDao<CouponRecord, Integer> {
|
||||
|
||||
/**
|
||||
* 查询兑换券的兑换数量
|
||||
* @param couponId
|
||||
* @return
|
||||
*/
|
||||
int getCouponRecordCountByCouponId(Integer couponId);
|
||||
|
||||
/**
|
||||
* 查询用户的兑换数量
|
||||
* @param couponId
|
||||
* @return
|
||||
*/
|
||||
int getCouponRecordCountByUser(Integer userId,Integer couponId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.DeviceCamera;
|
||||
import com.ifish.entity.id.DeviceCameraId;
|
||||
|
||||
/**
|
||||
* @ClassName: DeviceCameraDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface DeviceCameraDao extends BaseDao<DeviceCamera, DeviceCameraId>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ifish.entity.Device;
|
||||
import com.ifish.entity.UpgradeNotes;
|
||||
|
||||
/**
|
||||
* @ClassName: DeviceDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface DeviceDao extends BaseDao<Device, Integer>{
|
||||
|
||||
public int OnUpgrade(UpgradeNotes upgradeNotes);
|
||||
|
||||
//分组统计获取数据
|
||||
public List<?> getReportDataByGroup(String sql,Class<?> claz);
|
||||
|
||||
//获取数量
|
||||
public int getNumber(String sql);
|
||||
|
||||
//执行SQL
|
||||
public int executeSql(String sql);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.DeviceUser;
|
||||
import com.ifish.entity.id.PriId;
|
||||
|
||||
/**
|
||||
* @ClassName: DeviceUserDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface DeviceUserDao extends BaseDao<DeviceUser, PriId>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.ifish.entity.FactoryList;
|
||||
|
||||
/**
|
||||
* @ClassName: FactoryListDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface FactoryListDao extends BaseDao<FactoryList, String>{
|
||||
|
||||
//获取鱼缸厂下所有属电子厂
|
||||
public Map<String,String> getFactoryByVenderCode(String venderCode);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.GoldControl;
|
||||
import com.ifish.entity.GoldControlId;
|
||||
|
||||
/**
|
||||
* 金币控制信息
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface GoldControlDao extends BaseDao<GoldControl, GoldControlId> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.GoldExpendRecord;
|
||||
|
||||
/**
|
||||
* 金币消耗记录
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface GoldExpendRecordDao extends BaseDao<GoldExpendRecord, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.GoldGetRecord;
|
||||
|
||||
/**
|
||||
* 获取金币记录
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface GoldGetRecordDao extends BaseDao<GoldGetRecord, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.GoldTask;
|
||||
|
||||
/**
|
||||
* 金币获取规则
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface GoldRuleDao extends BaseDao<GoldTask, String> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.GradeControl;
|
||||
import com.ifish.entity.GradeControlId;
|
||||
|
||||
/**
|
||||
* 等级经验控制
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface GradeControlDao extends BaseDao<GradeControl, GradeControlId> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Grade;
|
||||
|
||||
/**
|
||||
* @ClassName: GradeDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface GradeDao extends BaseDao<Grade, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.GradeRecord;
|
||||
|
||||
/**
|
||||
* @ClassName: GradeRecordDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface GradeRecordDao extends BaseDao<GradeRecord, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.GradeTask;
|
||||
|
||||
/**
|
||||
* @ClassName: GradeRuleDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface GradeRuleDao extends BaseDao<GradeTask, String>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.HardwareType;
|
||||
|
||||
/**
|
||||
* @ClassName: HardwareTypeDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface HardwareTypeDao extends BaseDao<HardwareType, String>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.IfishDoctor;
|
||||
|
||||
/**
|
||||
* @ClassName: IfishDoctorDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface IfishDoctorDao extends BaseDao<IfishDoctor, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.IfishGoods;
|
||||
|
||||
/**
|
||||
* 商品管理dao
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface IfishGoodsDao extends BaseDao<IfishGoods, Integer> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.IfishShop;
|
||||
|
||||
/**
|
||||
* 店铺管理dao
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface IfishShopDao extends BaseDao<IfishShop, Integer> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Information;
|
||||
|
||||
/**
|
||||
* @ClassName: InformationDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface InformationDao extends BaseDao<Information, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.InformationStats;
|
||||
|
||||
/**
|
||||
* 资讯数据统计
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface InformationStatsDao extends BaseDao<InformationStats, Integer> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.LiveBanner;
|
||||
|
||||
/**
|
||||
* @ClassName: LiveBannerDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface LiveBannerDao extends BaseDao<LiveBanner, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.LiveRoom;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName: LiveRoomDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface LiveRoomDao extends BaseDao<LiveRoom, Integer>{
|
||||
|
||||
/**
|
||||
* 更新直播推荐信息
|
||||
* @param roomId
|
||||
* @param isTuijian
|
||||
* @param tuijianNum
|
||||
* @return
|
||||
*/
|
||||
public int updateIsTuijian(Integer roomId,String isTuijian,Integer tuijianNum);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.LoginRecord;
|
||||
|
||||
/**
|
||||
* @ClassName: LoginRecordDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface LoginRecordDao extends BaseDao<LoginRecord, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Menu;
|
||||
|
||||
/**
|
||||
* @ClassName: MenuDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface MenuDao extends BaseDao<Menu, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.NeteaseUser;
|
||||
|
||||
/**
|
||||
* @ClassName: NeteaseUserDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface NeteaseUserDao extends BaseDao<NeteaseUser, String>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.OperateRecord;
|
||||
|
||||
/**
|
||||
* @ClassName: OperateRecordDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface OperateRecordDao extends BaseDao<OperateRecord, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.PayBill;
|
||||
import com.ifish.entity.id.PayBillId;
|
||||
|
||||
/**
|
||||
* @ClassName: PayBillDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface PayBillDao extends BaseDao<PayBill, PayBillId>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.PayeeInfo;
|
||||
|
||||
/**
|
||||
* @ClassName: PayeeInfoDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface PayeeInfoDao extends BaseDao<PayeeInfo, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.PushList;
|
||||
|
||||
/**
|
||||
* @ClassName: PushListDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface PushListDao extends BaseDao<PushList, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.QuestionsFeedback;
|
||||
|
||||
/**
|
||||
* @ClassName: QuestionsFeedbackDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface QuestionsFeedbackDao extends BaseDao<QuestionsFeedback, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Role;
|
||||
|
||||
/**
|
||||
* @ClassName: RoleDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface RoleDao extends BaseDao<Role, String>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.SecurityUser;
|
||||
|
||||
/**
|
||||
* @ClassName: SecurityUserDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface SecurityUserDao extends BaseDao<SecurityUser, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ifish.entity.ShopsInfo;
|
||||
|
||||
/**
|
||||
* @ClassName: ShopsInfoDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface ShopsInfoDao extends BaseDao<ShopsInfo, Integer>{
|
||||
|
||||
/**
|
||||
* 随机取得用户ID
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> getShopsUserIdByRand(Integer userId);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.ShopsUserInfo;
|
||||
import com.ifish.entity.id.ShopsUserInfoId;
|
||||
|
||||
/**
|
||||
* 商家会员信息dao
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface ShopsUserInfoDao extends BaseDao<ShopsUserInfo, ShopsUserInfoId>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.TmpPushRemind;
|
||||
import com.ifish.entity.id.PriId;
|
||||
|
||||
/**
|
||||
* @ClassName: TmpPushRemindDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface TmpPushRemindDao extends BaseDao<TmpPushRemind, PriId>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Ueditor;
|
||||
|
||||
/**
|
||||
* @ClassName: UeditorDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface UeditorDao extends BaseDao<Ueditor, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.UpgradeNotes;
|
||||
;
|
||||
|
||||
/**
|
||||
* @ClassName: UpgradeNotesDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface UpgradeNotesDao extends BaseDao<UpgradeNotes, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.UserAsset;
|
||||
|
||||
/**
|
||||
* 用户资产(金币,经验值等信息)
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public interface UserAssetDao extends BaseDao<UserAsset, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ifish.entity.User;
|
||||
|
||||
/**
|
||||
* @ClassName: UserDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface UserDao extends BaseDao<User, Integer>{
|
||||
|
||||
/**
|
||||
* 更新备注
|
||||
* @param user
|
||||
*/
|
||||
public void updateRemarks(User user);
|
||||
|
||||
/**
|
||||
* 查询用户ID
|
||||
* @param pushType
|
||||
* @param firstResult
|
||||
* @param maxResults
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> getUserIds(String pushType,Integer firstResult, int maxResults);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.VenderList;
|
||||
|
||||
/**
|
||||
* @ClassName: VenderListDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface VenderListDao extends BaseDao<VenderList, String>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.ifish.dao;
|
||||
|
||||
import com.ifish.entity.Version;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName: VersionDao
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
public interface VersionDao extends BaseDao<Version, Integer>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.AdInfoDao;
|
||||
import com.ifish.entity.AdInfo;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 广告信息
|
||||
*/
|
||||
@Repository
|
||||
public class AdInfoDaoImpl extends HibernateBaseDao<AdInfo, Integer> implements AdInfoDao {
|
||||
|
||||
@Override
|
||||
protected Class<AdInfo> getEntityClass() {
|
||||
return AdInfo.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.CameraActiveDao;
|
||||
import com.ifish.entity.CameraActive;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: CameraActiveDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("cameraActiveDao")
|
||||
public class CameraActiveDaoImpl extends HibernateBaseDao<CameraActive, String> implements CameraActiveDao {
|
||||
|
||||
@Override
|
||||
protected Class<CameraActive> getEntityClass() {
|
||||
return CameraActive.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.CameraDao;
|
||||
import com.ifish.entity.Camera;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: CameraDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("cameraDao")
|
||||
public class CameraDaoImpl extends HibernateBaseDao<Camera, String> implements CameraDao {
|
||||
|
||||
@Override
|
||||
protected Class<Camera> getEntityClass() {
|
||||
return Camera.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.CameraUserDao;
|
||||
import com.ifish.entity.CameraUser;
|
||||
import com.ifish.entity.id.CameraUserId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: CameraUserDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("cameraUserDao")
|
||||
public class CameraUserDaoImpl extends HibernateBaseDao<CameraUser, CameraUserId> implements CameraUserDao {
|
||||
|
||||
@Override
|
||||
protected Class<CameraUser> getEntityClass() {
|
||||
return CameraUser.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.CommentDao;
|
||||
import com.ifish.entity.Comment;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: CommentDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository()
|
||||
public class CommentDaoImpl extends HibernateBaseDao<Comment, Integer> implements CommentDao {
|
||||
|
||||
@Override
|
||||
protected Class<Comment> getEntityClass() {
|
||||
return Comment.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getPinglunNum(Integer ueditorId) {
|
||||
//查询评论数据
|
||||
String sql = "SELECT count(*) FROM tbl_comment where ueditor_id=?";
|
||||
return ((Number)getSession().createSQLQuery(sql).setInteger(0, ueditorId).uniqueResult()).intValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.CouponDao;
|
||||
import com.ifish.entity.Coupon;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class CouponDaoImpl extends HibernateBaseDao<Coupon, Integer> implements CouponDao {
|
||||
|
||||
@Override
|
||||
protected Class<Coupon> getEntityClass() {
|
||||
return Coupon.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.CouponRecordDao;
|
||||
import com.ifish.entity.CouponRecord;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 优惠价兑换记录
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class CouponRecordDaoImpl extends HibernateBaseDao<CouponRecord, Integer> implements CouponRecordDao {
|
||||
|
||||
@Override
|
||||
protected Class<CouponRecord> getEntityClass() {
|
||||
return CouponRecord.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCouponRecordCountByCouponId(Integer couponId) {
|
||||
String sql = "select count(*) from tbl_coupon_record where coupon_id=?";
|
||||
return ((BigInteger)getSession().createSQLQuery(sql).setInteger(0, couponId).uniqueResult()).intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCouponRecordCountByUser(Integer userId, Integer couponId) {
|
||||
String sql = "select count(*) from tbl_coupon_record where user_id=? and coupon_id=?";
|
||||
return ((BigInteger)getSession().createSQLQuery(sql).setInteger(0, userId).setInteger(1, couponId).uniqueResult()).intValue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.DeviceCameraDao;
|
||||
import com.ifish.entity.DeviceCamera;
|
||||
import com.ifish.entity.id.DeviceCameraId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: DeviceCameraDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("deviceCameraDao")
|
||||
public class DeviceCameraDaoImpl extends HibernateBaseDao<DeviceCamera, DeviceCameraId> implements DeviceCameraDao {
|
||||
|
||||
@Override
|
||||
protected Class<DeviceCamera> getEntityClass() {
|
||||
return DeviceCamera.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.transform.Transformers;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.DeviceDao;
|
||||
import com.ifish.entity.Device;
|
||||
import com.ifish.entity.UpgradeNotes;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: DeviceDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("deviceDao")
|
||||
public class DeviceDaoImpl extends HibernateBaseDao<Device, Integer> implements DeviceDao {
|
||||
|
||||
@Override
|
||||
protected Class<Device> getEntityClass() {
|
||||
return Device.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int OnUpgrade(UpgradeNotes upgradeNotes) {
|
||||
Integer upgradeVersion = upgradeNotes.getUpgradeVersion();
|
||||
Integer sdkVersion = upgradeNotes.getSdkVersion();
|
||||
sdkVersion = sdkVersion==null?-1:sdkVersion;
|
||||
String factoryCode = upgradeNotes.getFactoryList().getFactoryCode();
|
||||
String brandCode = upgradeNotes.getVenderList().getBrandCode();
|
||||
String hardwareType = upgradeNotes.getHardwareType().getHardwareType();
|
||||
String sql = "update tbl_device SET is_upgrade=1,upgrade_version=? where IF(? != '', factory_code=?, true) and IF(? != '', brand_code=?, true) and IF(? != '', hardware_type=?, true) and IF(? != -1, sdk_version=?, true)";
|
||||
int number = this.getSession().createSQLQuery(sql)
|
||||
.setInteger(0, upgradeVersion)
|
||||
.setString(1, factoryCode)
|
||||
.setString(2, factoryCode)
|
||||
.setString(3, brandCode)
|
||||
.setString(4, brandCode)
|
||||
.setString(5, hardwareType)
|
||||
.setString(6, hardwareType)
|
||||
.setInteger(7, sdkVersion)
|
||||
.setInteger(8, sdkVersion)
|
||||
.executeUpdate();
|
||||
return number;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> getReportDataByGroup(String sql,Class<?> claz) {
|
||||
return this.getSession().createSQLQuery(sql).setResultTransformer(Transformers.aliasToBean(claz)).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumber(String sql) {
|
||||
return ((BigInteger) this.getSession().createSQLQuery(sql).uniqueResult()).intValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int executeSql(String sql) {
|
||||
return this.getSession().createSQLQuery(sql).executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.DeviceUserDao;
|
||||
import com.ifish.entity.DeviceUser;
|
||||
import com.ifish.entity.id.PriId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: DeviceUserDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("deviceUserDao")
|
||||
public class DeviceUserDaoImpl extends HibernateBaseDao<DeviceUser, PriId> implements DeviceUserDao {
|
||||
|
||||
@Override
|
||||
protected Class<DeviceUser> getEntityClass() {
|
||||
return DeviceUser.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.transform.Transformers;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.FactoryListDao;
|
||||
import com.ifish.entity.FactoryList;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: FactoryListDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("factoryListDao")
|
||||
public class FactoryListDaoImpl extends HibernateBaseDao<FactoryList, String> implements FactoryListDao {
|
||||
|
||||
@Override
|
||||
protected Class<FactoryList> getEntityClass() {
|
||||
return FactoryList.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map<String, String> getFactoryByVenderCode(String venderCode) {
|
||||
List<Map<String,String>> list = getSession().createSQLQuery("select factory_code,factory_name from tbl_factory_list where factory_code in (select factory_code from tbl_factory_vender where brand_code=?)")
|
||||
.setParameter(0, venderCode)
|
||||
.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP)
|
||||
.list();
|
||||
Map<String, String> returnMap = new HashMap<String, String>();
|
||||
for (Map<String, String> map : list) {
|
||||
returnMap.put(map.get("factory_code"), map.get("factory_name"));
|
||||
}
|
||||
return returnMap;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GoldControlDao;
|
||||
import com.ifish.entity.GoldControl;
|
||||
import com.ifish.entity.GoldControlId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 金币控制信息
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class GoldControlDaoImpl extends HibernateBaseDao<GoldControl, GoldControlId> implements GoldControlDao{
|
||||
|
||||
@Override
|
||||
protected Class<GoldControl> getEntityClass() {
|
||||
return GoldControl.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GoldExpendRecordDao;
|
||||
import com.ifish.entity.GoldExpendRecord;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 金币消耗记录
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class GoldExpendRecordDaoImpl extends HibernateBaseDao<GoldExpendRecord, Integer> implements GoldExpendRecordDao {
|
||||
|
||||
@Override
|
||||
protected Class<GoldExpendRecord> getEntityClass() {
|
||||
return GoldExpendRecord.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GoldGetRecordDao;
|
||||
import com.ifish.entity.GoldGetRecord;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 金币获取记录
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class GoldGetRecordDaoImpl extends HibernateBaseDao<GoldGetRecord, Integer> implements GoldGetRecordDao {
|
||||
|
||||
@Override
|
||||
protected Class<GoldGetRecord> getEntityClass() {
|
||||
return GoldGetRecord.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GoldRuleDao;
|
||||
import com.ifish.entity.GoldTask;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 金币获取规则
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class GoldRuleImpl extends HibernateBaseDao<GoldTask, String> implements GoldRuleDao {
|
||||
|
||||
@Override
|
||||
protected Class<GoldTask> getEntityClass() {
|
||||
return GoldTask.class;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GradeControlDao;
|
||||
import com.ifish.entity.GradeControl;
|
||||
import com.ifish.entity.GradeControlId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 等级信息控制
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class GradeControlDaoImpl extends HibernateBaseDao<GradeControl, GradeControlId> implements GradeControlDao {
|
||||
|
||||
@Override
|
||||
protected Class<GradeControl> getEntityClass() {
|
||||
return GradeControl.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GradeDao;
|
||||
import com.ifish.entity.Grade;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: GradeDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public class GradeDaoImpl extends HibernateBaseDao<Grade, Integer> implements GradeDao {
|
||||
|
||||
@Override
|
||||
protected Class<Grade> getEntityClass() {
|
||||
return Grade.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GradeRecordDao;
|
||||
import com.ifish.entity.GradeRecord;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: GradeRecordDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public class GradeRecordDaoImpl extends HibernateBaseDao<GradeRecord, Integer> implements GradeRecordDao {
|
||||
|
||||
@Override
|
||||
protected Class<GradeRecord> getEntityClass() {
|
||||
return GradeRecord.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.GradeRuleDao;
|
||||
import com.ifish.entity.GradeTask;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: GradeRuleImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public class GradeRuleImpl extends HibernateBaseDao<GradeTask, String> implements GradeRuleDao {
|
||||
|
||||
@Override
|
||||
protected Class<GradeTask> getEntityClass() {
|
||||
return GradeTask.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.HardwareTypeDao;
|
||||
import com.ifish.entity.HardwareType;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: HardwareTypeDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("hardwareTypeDao")
|
||||
public class HardwareTypeDaoImpl extends HibernateBaseDao<HardwareType, String> implements HardwareTypeDao {
|
||||
|
||||
|
||||
@Override
|
||||
protected Class<HardwareType> getEntityClass() {
|
||||
return HardwareType.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.IfishDoctorDao;
|
||||
import com.ifish.entity.IfishDoctor;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: IfishDoctorDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public class IfishDoctorDaoImpl extends HibernateBaseDao<IfishDoctor, Integer> implements IfishDoctorDao {
|
||||
|
||||
@Override
|
||||
protected Class<IfishDoctor> getEntityClass() {
|
||||
return IfishDoctor.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.IfishGoodsDao;
|
||||
import com.ifish.entity.IfishGoods;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 商品管理dao
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class IfishGoodsDaoImpl extends HibernateBaseDao<IfishGoods,Integer> implements IfishGoodsDao {
|
||||
|
||||
@Override
|
||||
protected Class<IfishGoods> getEntityClass() {
|
||||
return IfishGoods.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.IfishShopDao;
|
||||
import com.ifish.entity.IfishShop;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 店铺管理dao
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class IfishShopDaoImpl extends HibernateBaseDao<IfishShop,Integer> implements IfishShopDao {
|
||||
|
||||
@Override
|
||||
protected Class<IfishShop> getEntityClass() {
|
||||
return IfishShop.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.InformationDao;
|
||||
import com.ifish.entity.Information;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: InformationDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("informationDao")
|
||||
public class InformationDaoImpl extends HibernateBaseDao<Information, Integer> implements InformationDao {
|
||||
|
||||
@Override
|
||||
protected Class<Information> getEntityClass() {
|
||||
return Information.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.InformationStatsDao;
|
||||
import com.ifish.entity.InformationStats;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 资讯数据统计
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class InformationStatsDaoImpl extends HibernateBaseDao<InformationStats, Integer> implements InformationStatsDao {
|
||||
|
||||
@Override
|
||||
protected Class<InformationStats> getEntityClass() {
|
||||
return InformationStats.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.LiveBannerDao;
|
||||
import com.ifish.entity.LiveBanner;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: LiveBannerDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class LiveBannerDaoImpl extends HibernateBaseDao<LiveBanner, Integer> implements LiveBannerDao {
|
||||
|
||||
@Override
|
||||
protected Class<LiveBanner> getEntityClass() {
|
||||
return LiveBanner.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.LiveRoomDao;
|
||||
import com.ifish.entity.LiveRoom;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: LiveRoomDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class LiveRoomDaoImpl extends HibernateBaseDao<LiveRoom, Integer> implements LiveRoomDao {
|
||||
|
||||
@Override
|
||||
protected Class<LiveRoom> getEntityClass() {
|
||||
return LiveRoom.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateIsTuijian(Integer roomId, String isTuijian, Integer tuijianNum) {
|
||||
String sql = "update tbl_live_room set is_tuijian=?,tuijian_num=? where room_id=?";
|
||||
return getSession().createSQLQuery(sql).setString(0, isTuijian).setInteger(1, tuijianNum).setInteger(2, roomId).executeUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.LoginRecordDao;
|
||||
import com.ifish.entity.LoginRecord;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: LoginRecordDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("loginRecordDao")
|
||||
public class LoginRecordDaoImpl extends HibernateBaseDao<LoginRecord, Integer> implements LoginRecordDao {
|
||||
|
||||
@Override
|
||||
protected Class<LoginRecord> getEntityClass() {
|
||||
return LoginRecord.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.MenuDao;
|
||||
import com.ifish.entity.Menu;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: CameraDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public class MenuDaoImpl extends HibernateBaseDao<Menu, Integer> implements MenuDao {
|
||||
|
||||
@Override
|
||||
protected Class<Menu> getEntityClass() {
|
||||
return Menu.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.NeteaseUserDao;
|
||||
import com.ifish.entity.NeteaseUser;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: NeteaseUserDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("neteaseUserDao")
|
||||
public class NeteaseUserDaoImpl extends HibernateBaseDao<NeteaseUser, String> implements NeteaseUserDao {
|
||||
|
||||
@Override
|
||||
protected Class<NeteaseUser> getEntityClass() {
|
||||
return NeteaseUser.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.OperateRecordDao;
|
||||
import com.ifish.entity.OperateRecord;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: OperateRecordDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("operateRecordDao")
|
||||
public class OperateRecordDaoImpl extends HibernateBaseDao<OperateRecord, Integer> implements OperateRecordDao {
|
||||
|
||||
@Override
|
||||
protected Class<OperateRecord> getEntityClass() {
|
||||
return OperateRecord.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.PayBillDao;
|
||||
import com.ifish.entity.PayBill;
|
||||
import com.ifish.entity.id.PayBillId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: PayBillDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("payBillDao")
|
||||
public class PayBillDaoImpl extends HibernateBaseDao<PayBill, PayBillId> implements PayBillDao {
|
||||
|
||||
@Override
|
||||
protected Class<PayBill> getEntityClass() {
|
||||
return PayBill.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.PayeeInfoDao;
|
||||
import com.ifish.entity.PayeeInfo;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: PayeeInfoDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("payeeInfoDao")
|
||||
public class PayeeInfoDaoImpl extends HibernateBaseDao<PayeeInfo, Integer> implements PayeeInfoDao {
|
||||
|
||||
@Override
|
||||
protected Class<PayeeInfo> getEntityClass() {
|
||||
return PayeeInfo.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.PushListDao;
|
||||
import com.ifish.entity.PushList;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: PushListDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("pushListDao")
|
||||
public class PushListDaoImpl extends HibernateBaseDao<PushList, Integer> implements PushListDao {
|
||||
|
||||
@Override
|
||||
protected Class<PushList> getEntityClass() {
|
||||
return PushList.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.QuestionsFeedbackDao;
|
||||
import com.ifish.entity.QuestionsFeedback;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: QuestionsFeedbackDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("questionsFeedbackDao")
|
||||
public class QuestionsFeedbackDaoImpl extends HibernateBaseDao<QuestionsFeedback, Integer> implements QuestionsFeedbackDao {
|
||||
|
||||
@Override
|
||||
protected Class<QuestionsFeedback> getEntityClass() {
|
||||
return QuestionsFeedback.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.RoleDao;
|
||||
import com.ifish.entity.Role;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: RoleDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository
|
||||
public class RoleDaoImpl extends HibernateBaseDao<Role, String> implements RoleDao {
|
||||
|
||||
@Override
|
||||
protected Class<Role> getEntityClass() {
|
||||
return Role.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.SecurityUserDao;
|
||||
import com.ifish.entity.SecurityUser;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: SecurityUserDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
@Repository("securityUserDao")
|
||||
public class SecurityUserDaoImpl extends HibernateBaseDao<SecurityUser, Integer> implements SecurityUserDao {
|
||||
|
||||
@Override
|
||||
protected Class<SecurityUser> getEntityClass() {
|
||||
return SecurityUser.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.ShopsInfoDao;
|
||||
import com.ifish.entity.ShopsInfo;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: ShopsInfoDaoImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("shopsInfoDao")
|
||||
public class ShopsInfoDaoImpl extends HibernateBaseDao<ShopsInfo, Integer> implements ShopsInfoDao {
|
||||
|
||||
@Override
|
||||
protected Class<ShopsInfo> getEntityClass() {
|
||||
return ShopsInfo.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Integer> getShopsUserIdByRand(Integer userId) {
|
||||
String sql = "SELECT user_id FROM tbl_shops_info WHERE status='1' AND user_id!=? AND app_show='1' ORDER BY RAND() LIMIT 10";
|
||||
List<Integer> list = this.getSession().createSQLQuery(sql).setParameter(0, userId).list();
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.ShopsUserInfoDao;
|
||||
import com.ifish.entity.ShopsUserInfo;
|
||||
import com.ifish.entity.id.ShopsUserInfoId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* 商家会员信息
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@Repository
|
||||
public class ShopsUserInfoDaoImpl extends HibernateBaseDao<ShopsUserInfo, ShopsUserInfoId> implements ShopsUserInfoDao{
|
||||
|
||||
@Override
|
||||
protected Class<ShopsUserInfo> getEntityClass() {
|
||||
return ShopsUserInfo.class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.ifish.daoImpl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.ifish.dao.TmpPushRemindDao;
|
||||
import com.ifish.entity.TmpPushRemind;
|
||||
import com.ifish.entity.id.PriId;
|
||||
import com.ifish.hibernate.HibernateBaseDao;
|
||||
|
||||
/**
|
||||
* @ClassName: TmpPushRemindImpl
|
||||
* @Description: TODO
|
||||
* @author ggw
|
||||
*
|
||||
*/
|
||||
|
||||
@Repository("tmpPushRemindDao")
|
||||
public class TmpPushRemindDaoImpl extends HibernateBaseDao<TmpPushRemind, PriId> implements TmpPushRemindDao {
|
||||
|
||||
@Override
|
||||
protected Class<TmpPushRemind> getEntityClass() {
|
||||
return TmpPushRemind.class;
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user