Compare commits

...

10 Commits

Author SHA1 Message Date
yan.y be81b0bc16 数字过滤 2026-02-27 16:15:03 +08:00
yan.y f595b2dd68 update 2025-10-23 10:16:58 +08:00
yan.y 4bc9778d38 新增功能及名称控制 2025-09-18 15:01:34 +08:00
yan.y ef74154136 新增功能及名称控制 2025-06-19 17:15:47 +08:00
yan.y 00a3e75e93 新增页面 2025-06-04 16:27:59 +08:00
yan.y 28781bfe79 查询条件修改 2024-11-04 15:08:20 +08:00
yan.y 17184458bb 新增拉黑状态过滤 2024-09-20 11:36:39 +08:00
易焱 4e7fceade8 static file 2022-05-17 17:03:28 +08:00
易焱 665ba949a6 宠物笼设备 2021-01-06 23:38:23 +08:00
易焱 956227c10c 手动生成账单 2020-02-08 22:59:12 +08:00
47 changed files with 3305 additions and 254 deletions

View File

@ -1,73 +1,49 @@
package com.ifish.action;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
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.alibaba.fastjson.JSONObject;
import com.ifish.dao.HardwareTypeAttriDao;
import com.ifish.dao.HardwareVenderDao;
import com.ifish.domain.FactoryVenderData;
import com.ifish.domain.JsonResult;
import com.ifish.entity.Camera;
import com.ifish.entity.CameraActive;
import com.ifish.entity.CameraUser;
import com.ifish.entity.Device;
import com.ifish.entity.DeviceUser;
import com.ifish.entity.FactoryList;
import com.ifish.entity.Grade;
import com.ifish.entity.HardwareType;
import com.ifish.entity.IfishDoctor;
import com.ifish.entity.LiveBanner;
import com.ifish.entity.LiveRoom;
import com.ifish.entity.LoginRecord;
import com.ifish.entity.Menu;
import com.ifish.entity.NeteaseUser;
import com.ifish.entity.OperateRecord;
import com.ifish.entity.PayBill;
import com.ifish.entity.PayeeInfo;
import com.ifish.entity.PushList;
import com.ifish.entity.QuestionsFeedback;
import com.ifish.entity.Role;
import com.ifish.entity.SecurityUser;
import com.ifish.entity.TmpPushRemind;
import com.ifish.entity.Ueditor;
import com.ifish.entity.UpgradeNotes;
import com.ifish.entity.User;
import com.ifish.entity.UserAsset;
import com.ifish.entity.VenderList;
import com.ifish.entity.Version;
import com.ifish.enums.BooleanEnum;
import com.ifish.enums.MenuTypeEnum;
import com.ifish.enums.RoleEnum;
import com.ifish.enums.SysUserEnum;
import com.ifish.enums.UeditorTypeEnum;
import com.ifish.entity.*;
import com.ifish.enums.*;
import com.ifish.excel.DownloadExcel;
import com.ifish.hibernate.Pagination;
import com.ifish.search.CheckNames;
import com.ifish.search.SearchFilter;
import com.ifish.service.AdminService;
import com.ifish.service.GradeService;
import com.ifish.util.IfishFileDirectory;
import com.ifish.util.IfishFileUtils;
import com.ifish.util.IfishUtil;
import com.ifish.util.ResultUtil;
import com.ifish.webService.MyService;
import com.ifish.webService.MyServiceService;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.criterion.Restrictions;
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.Model;
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 javax.annotation.Resource;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.*;
/**
* @author ggw
* @ClassName: AdminAction
* @Description: 管理员页面
* @author ggw
*/
@Controller("adminAction")
@RequestMapping("/admin")
@ -191,6 +167,7 @@ public class AdminAction {
map.put("status", status);
return new ModelAndView("roleAdmin/userDetail", map);
} catch (Exception e) {
e.printStackTrace();
log.error("get userDetail information:error message:{}", e.toString());
}
return new ModelAndView("roleAdmin/userDetail");
@ -311,6 +288,25 @@ public class AdminAction {
return null;
}
/**
* 绑定设备
*
* @param macAddress
* @param userId
* @return
*/
@RequestMapping("/bindPetDevice.do")
@ResponseBody
public Object bindPetDevice(String macAddress, Integer userId) {
try {
return this.adminService.bindPetDevice(macAddress, userId);
} catch (Exception e) {
e.printStackTrace();
log.error("bindDevice:error message:{}", e.toString());
}
return null;
}
/**
* 解除绑定
*
@ -331,6 +327,26 @@ public class AdminAction {
return new ModelAndView("redirect:/page/admin/userDetail.do", map);
}
/**
* 解除绑定
*
* @param deviceUser
* @return
*/
@RequestMapping("/unbindPet.do")
public ModelAndView unbindPet(DevicePetUser deviceUser) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("userId", deviceUser.getPriId().getUserId());
try {
this.adminService.unbindPet(deviceUser);
map.put("status", SysUserEnum.success100.getKey());
} catch (Exception e) {
map.put("status", SysUserEnum.failed101.getKey());
log.error("unbind faild,userId:{},:error message:{}", deviceUser.getPriId().getUserId(), e.toString());
}
return new ModelAndView("redirect:/page/admin/userDetail.do", map);
}
/**
* 授权
*
@ -506,7 +522,20 @@ public class AdminAction {
@ResponseBody
public Object venderListInf(SearchFilter searchFilter) {
try {
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = adminService.getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
searchFilter.setFactoryCode(code);
}
Pagination<VenderList> page = this.adminService.getVenderListByPage(searchFilter);
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
List<FactoryVenderData> factoryVenderData = this.adminService.getFactoryBrandList();
for (VenderList venderList : page.getList()) {
Optional<FactoryVenderData> optionalVenderList = factoryVenderData.stream().filter(f -> f.getBrand_code().equals(venderList.getBrandCode())).findFirst();
optionalVenderList.ifPresent(list -> venderList.setBackground(list.getBackground()));
}
}
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
} catch (Exception e) {
log.error("get venderList page information:error message:{}", e.toString());
@ -567,10 +596,15 @@ public class AdminAction {
* @return
*/
@RequestMapping("/updateVender.do")
public ModelAndView updateVender(VenderList venderList, String base64) {
public ModelAndView updateVender(VenderList venderList, String base64 ,MultipartFile fileUpload) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("venderList", venderList);
try {
if (fileUpload != null) {
String newImgName = System.currentTimeMillis() +".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods,newImgName,fileUpload);
venderList.setBackground(newImgName);
}
String status = this.adminService.UpdateVender(venderList, base64);
map.put("status", status);
if (status.equals(SysUserEnum.success100.getKey())) {
@ -880,6 +914,12 @@ public class AdminAction {
@ResponseBody
public Object hardwareTypeInf(SearchFilter searchFilter) {
try {
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = adminService.getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
searchFilter.setFactoryCode(code);
}
Pagination<HardwareType> page = this.adminService.getHardwareTypeByPage(searchFilter);
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
} catch (Exception e) {
@ -895,7 +935,37 @@ public class AdminAction {
*/
@RequestMapping("/addHardwareType.do")
public ModelAndView addHardwareType() {
return new ModelAndView("roleAdmin/addHardwareType");
List<CheckNames> deviceAttr1List = new ArrayList<>();
deviceAttr1List.add(new CheckNames("1", "S1开关", false));
deviceAttr1List.add(new CheckNames("2", "S2开关", false));
deviceAttr1List.add(new CheckNames("3", "S3开关", false));
deviceAttr1List.add(new CheckNames("4", "S4开关", false));
deviceAttr1List.add(new CheckNames("5", "S5开关", false));
deviceAttr1List.add(new CheckNames("6", "S6开关", false));
deviceAttr1List.add(new CheckNames("7", "S7开关", false));
deviceAttr1List.add(new CheckNames("8", "S8开关", false));
deviceAttr1List.add(new CheckNames("9", "S9开关", false));
deviceAttr1List.add(new CheckNames("10", "S10开关", false));
deviceAttr1List.add(new CheckNames("11", "S11开关", false));
deviceAttr1List.add(new CheckNames("12", "S12开关", false));
List<CheckNames> deviceAttr3List = new ArrayList<>();
deviceAttr3List.add(new CheckNames("13", "加热制冷模式", false));
deviceAttr3List.add(new CheckNames("25", "加热模式温度设置", false));
deviceAttr3List.add(new CheckNames("26", "制冷模式温度设置", false));
deviceAttr3List.add(new CheckNames("27", "喂鱼设置", false));
deviceAttr3List.add(new CheckNames("28", "温度矫正设置-1", false));
deviceAttr3List.add(new CheckNames("29", "延时启动时间设置", false));
deviceAttr3List.add(new CheckNames("30", "电量显示", false));
deviceAttr3List.add(new CheckNames("31", "一键喂鱼按键", false));
deviceAttr3List.add(new CheckNames("32", "温度矫正设置-2", false));
deviceAttr3List.add(new CheckNames("33", "护理灯", false));
deviceAttr3List.add(new CheckNames("34", "温度显示1", false));
deviceAttr3List.add(new CheckNames("35", "温度显示2", false));
Map<String, Object> modelData = new HashMap<>();
modelData.put("list1", deviceAttr1List);
modelData.put("list3", deviceAttr3List);
return new ModelAndView("roleAdmin/addHardwareType", modelData);
}
/**
@ -904,9 +974,9 @@ public class AdminAction {
* @return
*/
@RequestMapping("/saveHardwareType.do")
public ModelAndView saveHardwareType(HardwareType hardwareType) {
public ModelAndView saveHardwareType(HardwareType hardwareType, String attr1, String attr2, String attr3) {
try {
String status = this.adminService.saveHardwareType(hardwareType);
String status = this.adminService.saveHardwareType(hardwareType, attr1, attr2, attr3);
if (status.equals(SysUserEnum.warn107.getKey())) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("hardwareType", hardwareType);
@ -925,25 +995,209 @@ public class AdminAction {
* @return
*/
@RequestMapping("/editHardwareType.do")
public ModelAndView updateHardwareType(String hardwareType) {
public ModelAndView editHardwareType(String hardwareType) {
if (hardwareType != null) {
HardwareType hardware = this.adminService.getHardwareTypeById(hardwareType);
HardwareTypeAttri hardwareTypeAttri = this.adminService.getHardwareTypeAttri(hardwareType);
boolean hasAttr = hardwareTypeAttri != null;
List<CheckNames> deviceAttr1List = new ArrayList<>();
deviceAttr1List.add(new CheckNames("1", "S1开关", hasAttr && hardwareTypeAttri.getSwitchS1() == 1));
deviceAttr1List.add(new CheckNames("2", "S2开关", hasAttr && hardwareTypeAttri.getSwitchS2() == 1));
deviceAttr1List.add(new CheckNames("3", "S3开关", hasAttr && hardwareTypeAttri.getSwitchS3() == 1));
deviceAttr1List.add(new CheckNames("4", "S4开关", hasAttr && hardwareTypeAttri.getSwitchS4() == 1));
deviceAttr1List.add(new CheckNames("5", "S5开关", hasAttr && hardwareTypeAttri.getSwitchS5() == 1));
deviceAttr1List.add(new CheckNames("6", "S6开关", hasAttr && hardwareTypeAttri.getSwitchS6() == 1));
deviceAttr1List.add(new CheckNames("7", "S7开关", hasAttr && hardwareTypeAttri.getSwitchS7() == 1));
deviceAttr1List.add(new CheckNames("8", "S8开关", hasAttr && hardwareTypeAttri.getSwitchS8() == 1));
deviceAttr1List.add(new CheckNames("9", "S9开关", hasAttr && hardwareTypeAttri.getSwitchS9() == 1));
deviceAttr1List.add(new CheckNames("10", "S10开关", hasAttr && hardwareTypeAttri.getSwitchS10() == 1));
deviceAttr1List.add(new CheckNames("11", "S11开关", hasAttr && hardwareTypeAttri.getSwitchS11() == 1));
deviceAttr1List.add(new CheckNames("12", "S12开关", hasAttr && hardwareTypeAttri.getSwitchS12() == 1));
List<CheckNames> deviceAttr3List = new ArrayList<>();
deviceAttr3List.add(new CheckNames("13", "加热制冷模式", hasAttr && hardwareTypeAttri.getHeatingSet() == 1));
deviceAttr3List.add(new CheckNames("25", "加热模式温度设置", hasAttr && hardwareTypeAttri.getTemperature1() == 1));
deviceAttr3List.add(new CheckNames("26", "制冷模式温度设置", hasAttr && hardwareTypeAttri.getTemperature2() == 1));
deviceAttr3List.add(new CheckNames("27", "喂鱼设置", hasAttr && hardwareTypeAttri.getFeedfishSet() == 1));
deviceAttr3List.add(new CheckNames("28", "温度矫正设置-1", hasAttr && hardwareTypeAttri.getChangeTemperSet1() == 1));
deviceAttr3List.add(new CheckNames("32", "温度矫正设置-2", hasAttr && hardwareTypeAttri.getChangeTemperSet2() == 1));
deviceAttr3List.add(new CheckNames("29", "延时启动时间设置", hasAttr && hardwareTypeAttri.getDelayedSet() == 1));
deviceAttr3List.add(new CheckNames("30", "电量显示", hasAttr && hardwareTypeAttri.getElectricityShow() == 1));
deviceAttr3List.add(new CheckNames("31", "一键喂鱼按键", hasAttr && hardwareTypeAttri.getOnceFeedfishSet() == 1));
deviceAttr3List.add(new CheckNames("33", "护理灯", hasAttr && hardwareTypeAttri.getNursingLight() == 1));
deviceAttr3List.add(new CheckNames("34", "温度显示1", hasAttr && hardwareTypeAttri.getTemperatureShow1() == 1));
deviceAttr3List.add(new CheckNames("35", "温度显示2", hasAttr && hardwareTypeAttri.getTemperatureShow2() == 1));
Map<String, Object> map = new HashMap<String, Object>();
map.put("list1", deviceAttr1List);
map.put("list3", deviceAttr3List);
map.put("hardwareType", hardware);
return new ModelAndView("roleAdmin/editHardwareType", map);
}
return new ModelAndView("redirect:/page/admin/hardwareTypeList.do");
}
@Resource
private HardwareTypeAttriDao hardwareTypeAttriDao;
/**
* 更新硬件设备默认名称
*
* @return
*/
@RequestMapping("/doUpdateHardwareAttr.do")
public ModelAndView doUpdateHardwareAttr(String hardwareType,String venderCode) {
if (hardwareType != null) {
FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttri = this.adminService.getFactoryVenderHardwareTypeAttri(hardwareType, venderCode);
Map<String, Object> map = new HashMap<>();
if (factoryVenderHardwareTypeAttri == null) {
factoryVenderHardwareTypeAttri = new FactoryVenderHardwareTypeAttri();
factoryVenderHardwareTypeAttri.setHardwareType(hardwareType);
}
HardwareTypeAttri hardwareTypeAttri = hardwareTypeAttriDao.findUniqueByProperty(Restrictions.eq("hardwareType", hardwareType));
if (hardwareTypeAttri == null) {
hardwareTypeAttri = new HardwareTypeAttri();
}
map.put("hardwareTypeAttrSwitch", hardwareTypeAttri);
map.put("hardwareTypeAttr", factoryVenderHardwareTypeAttri);
return new ModelAndView("roleAdmin/editHardwareTypeAttr", map);
}
return new ModelAndView("redirect:/page/admin/hardwareTypeList.do");
}
/**
* 更新硬件设备默认名称
*
* @return
*/
@RequestMapping("/updateFactoryHardwareTypeAttr.do")
public ModelAndView updateFactoryHardwareTypeAttr(FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttriForm,
@RequestParam("fileUpload1") MultipartFile fileUpload1,
@RequestParam("fileUpload2") MultipartFile fileUpload2,
@RequestParam("fileUpload3") MultipartFile fileUpload3,
@RequestParam("fileUpload4") MultipartFile fileUpload4,
@RequestParam("fileUpload5") MultipartFile fileUpload5,
@RequestParam("fileUpload6") MultipartFile fileUpload6,
@RequestParam("fileUpload7") MultipartFile fileUpload7,
@RequestParam("fileUpload8") MultipartFile fileUpload8,
@RequestParam("fileUpload9") MultipartFile fileUpload9,
@RequestParam("fileUpload10") MultipartFile fileUpload10,
@RequestParam("fileUpload11") MultipartFile fileUpload11,
@RequestParam("fileUpload12") MultipartFile fileUpload12) throws IOException {
if (factoryVenderHardwareTypeAttriForm.getHardwareType() != null) {
FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttri = this.adminService.getFactoryVenderHardwareTypeAttri(factoryVenderHardwareTypeAttriForm.getHardwareType(), factoryVenderHardwareTypeAttriForm.getVenderCode());
if (factoryVenderHardwareTypeAttri == null) {
factoryVenderHardwareTypeAttri = new FactoryVenderHardwareTypeAttri();
factoryVenderHardwareTypeAttri.setHardwareType(factoryVenderHardwareTypeAttriForm.getHardwareType());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS1())) {
factoryVenderHardwareTypeAttri.setSwitchS1(factoryVenderHardwareTypeAttriForm.getSwitchS1());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS2())) {
factoryVenderHardwareTypeAttri.setSwitchS2(factoryVenderHardwareTypeAttriForm.getSwitchS2());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS3())) {
factoryVenderHardwareTypeAttri.setSwitchS3(factoryVenderHardwareTypeAttriForm.getSwitchS3());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS4())) {
factoryVenderHardwareTypeAttri.setSwitchS4(factoryVenderHardwareTypeAttriForm.getSwitchS4());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS5())) {
factoryVenderHardwareTypeAttri.setSwitchS5(factoryVenderHardwareTypeAttriForm.getSwitchS5());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS6())) {
factoryVenderHardwareTypeAttri.setSwitchS6(factoryVenderHardwareTypeAttriForm.getSwitchS6());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS7())) {
factoryVenderHardwareTypeAttri.setSwitchS7(factoryVenderHardwareTypeAttriForm.getSwitchS7());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS8())) {
factoryVenderHardwareTypeAttri.setSwitchS8(factoryVenderHardwareTypeAttriForm.getSwitchS8());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS9())) {
factoryVenderHardwareTypeAttri.setSwitchS9(factoryVenderHardwareTypeAttriForm.getSwitchS9());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS10())) {
factoryVenderHardwareTypeAttri.setSwitchS10(factoryVenderHardwareTypeAttriForm.getSwitchS10());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS11())) {
factoryVenderHardwareTypeAttri.setSwitchS11(factoryVenderHardwareTypeAttriForm.getSwitchS11());
}
if (StringUtils.isNotBlank(factoryVenderHardwareTypeAttriForm.getSwitchS12())) {
factoryVenderHardwareTypeAttri.setSwitchS12(factoryVenderHardwareTypeAttriForm.getSwitchS12());
}
if (!fileUpload1.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload1);
factoryVenderHardwareTypeAttri.setSwitchS1Ico1(imgName);
}
if (!fileUpload2.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload2);
factoryVenderHardwareTypeAttri.setSwitchS2Ico2(imgName);
}
if (!fileUpload3.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload3);
factoryVenderHardwareTypeAttri.setSwitchS3Ico3(imgName);
}
if (!fileUpload4.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload4);
factoryVenderHardwareTypeAttri.setSwitchS4Ico4(imgName);
}
if (!fileUpload5.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload5);
factoryVenderHardwareTypeAttri.setSwitchS5Ico5(imgName);
}
if (!fileUpload6.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload6);
factoryVenderHardwareTypeAttri.setSwitchS6Ico6(imgName);
}
if (!fileUpload7.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload7);
factoryVenderHardwareTypeAttri.setSwitchS7Ico7(imgName);
}
if (!fileUpload8.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload8);
factoryVenderHardwareTypeAttri.setSwitchS8Ico8(imgName);
}
if (!fileUpload9.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload9);
factoryVenderHardwareTypeAttri.setSwitchS9Ico9(imgName);
}
if (!fileUpload10.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload10);
factoryVenderHardwareTypeAttri.setSwitchS10Ico10(imgName);
}
if (!fileUpload11.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload11);
factoryVenderHardwareTypeAttri.setSwitchS11Ico11(imgName);
}
if (!fileUpload12.isEmpty()) {
String imgName = System.currentTimeMillis() + ".png";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, imgName, fileUpload12);
factoryVenderHardwareTypeAttri.setSwitchS12Ico12(imgName);
}
this.adminService.saveFactoryHardwareTypeAttr(factoryVenderHardwareTypeAttri);
}
return new ModelAndView("redirect:/page/admin/factoryList1.do");
}
/**
* 更新硬件类型
*
* @return
*/
@RequestMapping("/updateHardwareType.do")
public ModelAndView updateHardwareType(HardwareType hardwareType) {
public ModelAndView updateHardwareType(HardwareType hardwareType, String attr1, String attr2, String attr3) {
try {
this.adminService.updateHardwareType(hardwareType);
this.adminService.updateHardwareType(hardwareType, attr1, attr2, attr3);
} catch (Exception e) {
log.error("saveOrUpdate hardwareType:error message:{}", e.toString());
}
@ -1167,6 +1421,16 @@ public class AdminAction {
return new ModelAndView("roleAdmin/factoryList");
}
/**
* 电子厂信息
*
* @return
*/
@RequestMapping("/factoryList1.do")
public ModelAndView factoryList1() {
return new ModelAndView("roleAdmin/factoryList1");
}
/**
* 电子厂信息列表
*
@ -1180,9 +1444,38 @@ public class AdminAction {
@ResponseBody
public Object factoryListInf(SearchFilter searchFilter) {
try {
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = adminService.getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
searchFilter.setFactoryCode(code);
}
Pagination<FactoryList> page = this.adminService.getFactoryListByPage(searchFilter);
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
} catch (Exception e) {
e.printStackTrace();
log.error("get factoryListInf information:error message:{}", e.toString());
}
return null;
}
/**
* 电子厂信息列表
*
* @param iDisplayStart
* @param iDisplayLength
* @param sEcho
* @param sSearch
* @return
*/
@RequestMapping("/factoryListInf1.do")
@ResponseBody
public Object factoryListInf1(SearchFilter searchFilter) {
try {
Pagination<HardwareVender> page = this.adminService.getHardwareVenderConfig(searchFilter);
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
} catch (Exception e) {
e.printStackTrace();
log.error("get factoryListInf information:error message:{}", e.toString());
}
return null;
@ -1327,6 +1620,20 @@ public class AdminAction {
return new ModelAndView("roleAdmin/addFactory", map);
}
/**
* 新增电子厂页面
*
* @return
*/
@RequestMapping("/addFactory1.do")
public ModelAndView addFactory1(ModelMap map) {
List<VenderList> venderList = adminService.getVenderList();
List<HardwareType> hardwareType = adminService.getHardwareTypeList();
map.put("venderList", venderList);
map.put("hardwareType", hardwareType);
return new ModelAndView("roleAdmin/addFactory1", map);
}
/**
* 保存电子厂
*
@ -1334,12 +1641,17 @@ public class AdminAction {
* @return
*/
@RequestMapping("/saveFactory.do")
public ModelAndView saveFactory(FactoryList factoryList, String brandCodes, String hardwareTypes) {
public ModelAndView saveFactory(FactoryList factoryList, String brandCodes, String hardwareTypes, MultipartFile fileUpload) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("factoryList", factoryList);
String status = SysUserEnum.failed101.getKey();
try {
status = this.adminService.addFactory(factoryList, brandCodes, hardwareTypes);
String newImgName = "";
if (fileUpload != null) {
newImgName = System.currentTimeMillis() + ".jpg";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, newImgName, fileUpload);
}
status = this.adminService.addFactory(factoryList, brandCodes, hardwareTypes, newImgName);
map.put("status", status);
if (status.equals(SysUserEnum.success100.getKey())) {
return new ModelAndView("redirect:/page/admin/factoryList.do");
@ -1353,6 +1665,36 @@ public class AdminAction {
return new ModelAndView("roleAdmin/addFactory", map);
}
/**
* 保存电子厂
*
* @param factoryList
* @return
*/
@RequestMapping("/saveFactory1.do")
public ModelAndView saveFactory1(Integer id, String brandCodes, String hardwareTypes, MultipartFile fileUpload) {
Map<String, Object> map = new HashMap<>();
String status = SysUserEnum.failed101.getKey();
try {
String newImgName = "";
if (fileUpload != null) {
newImgName = System.currentTimeMillis() + ".jpg";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, newImgName, fileUpload);
}
status = this.adminService.addFactory1(brandCodes, hardwareTypes, newImgName);
map.put("status", status);
if (status.equals(SysUserEnum.success100.getKey())) {
return new ModelAndView("redirect:/page/admin/factoryList1.do");
}
List<VenderList> list = adminService.getVenderList();
map.put("list", list);
} catch (Exception e) {
map.put("status", status);
log.error("addFactory:error message:{}", e.toString());
}
return new ModelAndView("roleAdmin/addFactory1", map);
}
/**
* 删除电子厂
*
@ -1367,6 +1709,21 @@ public class AdminAction {
}
return new ModelAndView("redirect:/page/admin/factoryList.do");
}
/**
* 删除电子厂
*
* @return
*/
@RequestMapping("/deleteFactory1.do")
public ModelAndView deleteFactory1(Integer id) {
try {
HardwareVender hardwareVender = hardwareVenderDao.get(id);
adminService.deleteHardwareVender(hardwareVender);
} catch (Exception e) {
log.error("deleteFactory:error message:{}", e.toString());
}
return new ModelAndView("redirect:/page/admin/factoryList1.do");
}
/**
* 编辑电子厂页面
@ -1424,6 +1781,69 @@ public class AdminAction {
return new ModelAndView("roleAdmin/editFactory", map);
}
/**
* 编辑电子厂页面
*
* @return
*/
@RequestMapping("/editFactory1.do")
public ModelAndView editFactory1(Integer id) {
Map<String, Object> map = new HashMap<>();
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = adminService.getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
//电子厂
FactoryList factoryList = this.adminService.getFactoryByCode(code);
//鱼缸厂
List<VenderList> list = adminService.getVenderList();
Map<String, CheckNames> brandCodeMap = new HashMap<>();
for (VenderList venderList : list) {
CheckNames checkNames = new CheckNames();
checkNames.setChecked(false);
checkNames.setShowValue(venderList.getBrandCode());
checkNames.setShowName(venderList.getBrandName());
brandCodeMap.put(venderList.getBrandCode(), checkNames);
}
//电子厂下选中鱼缸厂
Iterator<VenderList> venderLists = factoryList.getVenderLists().iterator();
while (venderLists.hasNext()) {
VenderList venderList = venderLists.next();
CheckNames checkNames = new CheckNames();
checkNames.setChecked(true);
checkNames.setShowValue(venderList.getBrandCode());
checkNames.setShowName(venderList.getBrandName());
brandCodeMap.put(venderList.getBrandCode(), checkNames);
}
//硬件类型
List<HardwareType> hardwareTypeList = this.adminService.getHardwareTypeList();
Map<String, CheckNames> hardwareTypeMap = new HashMap<>();
for (HardwareType hardwareType : hardwareTypeList) {
CheckNames checkNames = new CheckNames();
checkNames.setChecked(false);
checkNames.setShowValue(hardwareType.getHardwareType());
checkNames.setShowName(hardwareType.getHardwareName());
hardwareTypeMap.put(hardwareType.getHardwareType(), checkNames);
}
//鱼缸厂下选中硬件类型
Iterator<HardwareType> hardwareTypes = factoryList.getHardwareTypeSet().iterator();
while (hardwareTypes.hasNext()) {
HardwareType hardwareType = hardwareTypes.next();
CheckNames checkNames = new CheckNames();
checkNames.setChecked(true);
checkNames.setShowValue(hardwareType.getHardwareType());
checkNames.setShowName(hardwareType.getHardwareName());
hardwareTypeMap.put(hardwareType.getHardwareType(), checkNames);
}
map.put("hardwareTypeMap", hardwareTypeMap);
map.put("factoryList", factoryList);
map.put("brandCodeMap", brandCodeMap);
map.put("hardwareVender", adminService.getHardwareVenderConfigById(id));
return new ModelAndView("roleAdmin/editFactory1", map);
}
/**
* 更新电子厂
*
@ -1431,17 +1851,23 @@ public class AdminAction {
* @return
*/
@RequestMapping("/updateFactory.do")
public ModelAndView updateFactory(FactoryList factoryList, String brandCodes, String hardwareTypes) {
public ModelAndView updateFactory(FactoryList factoryList, String brandCodes, String hardwareTypes, MultipartFile fileUpload) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("factoryList", factoryList);
String status = SysUserEnum.failed101.getKey();
try {
if (fileUpload != null) {
String newImgName = System.currentTimeMillis() + ".jpg";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, newImgName, fileUpload);
factoryList.setBackground(newImgName);
}
status = this.adminService.updateFactory(factoryList, brandCodes, hardwareTypes);
map.put("status", status);
if (status.equals(SysUserEnum.success100.getKey())) {
return new ModelAndView("redirect:/page/admin/factoryList.do");
}
} catch (Exception e) {
e.printStackTrace();
map.put("status", status);
log.error("updateFactory:error message:{}", e.toString());
}
@ -1469,6 +1895,41 @@ public class AdminAction {
return new ModelAndView("roleAdmin/editFactory", map);
}
@Resource
HardwareVenderDao hardwareVenderDao;
/**
* 更新电子厂
*
* @param factoryList
* @return
*/
@RequestMapping("/updateFactory1.do")
public ModelAndView updateFactory1(Integer id, String brandCodes, String hardwareTypes, MultipartFile fileUpload) {
Map<String, Object> map = new HashMap<>();
String status = SysUserEnum.success100.getKey();
try {
HardwareVender hardwareVenderConfigById = adminService.getHardwareVenderConfigById(id);
if (!fileUpload.isEmpty()) {
String newImgName = System.currentTimeMillis() + ".jpg";
IfishFileUtils.uploadFile(IfishFileDirectory.path_img_goods, newImgName, fileUpload);
hardwareVenderConfigById.setBackground(newImgName);
}
hardwareVenderConfigById.setVenderCode(brandCodes);
hardwareVenderConfigById.setHardwareType(hardwareTypes);
hardwareVenderDao.update(hardwareVenderConfigById);
map.put("status", status);
if (status.equals(SysUserEnum.success100.getKey())) {
return new ModelAndView("redirect:/page/admin/factoryList1.do");
}
} catch (Exception e) {
status = SysUserEnum.failed101.getKey();
map.put("status", status);
log.error("updateFactory:error message:{}", e.toString());
}
return new ModelAndView("roleAdmin/editFactory1", map);
}
/**
* ****************************************消息推送列表*****************************************************
*/
@ -2317,4 +2778,21 @@ public class AdminAction {
return false;
}
/**
* 账单生成
*
* @param billMonth
* @return
*/
@RequestMapping("/billGen.do")
@ResponseBody
public Object billGen(String billMonth) {
try {
return adminService.billGen(billMonth);
} catch (Exception e) {
log.error("sendMsgToShops:error message:{}", e.toString());
}
return false;
}
}

View File

@ -7,6 +7,7 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.ifish.entity.*;
import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -238,8 +239,10 @@ public class FactoryAction {
this.adminService.deviceAuthorizeNew(ip,factoryList.getFactoryCode(),deviceIds);
}
for (String dId : deviceIds) {
int id = Integer.parseInt(dId);
this.adminService.deviceFenpeiSingleNew(ip,factoryList.getFactoryCode(),id,brandCode,createCode);
if (NumberUtils.isDigits(dId)) {
int id = Integer.parseInt(dId);
this.adminService.deviceFenpeiSingleNew(ip,factoryList.getFactoryCode(),id,brandCode,createCode);
}
}
return true;
}

View File

@ -0,0 +1,15 @@
package com.ifish.dao;
import com.ifish.entity.DevicePetUser;
import com.ifish.entity.DeviceUser;
import com.ifish.entity.id.PriId;
/**
* @ClassName: DeviceUserDao
* @Description: TODO
* @author ggw
*
*/
public interface DevicePetUserDao extends BaseDao<DevicePetUser, PriId>{
}

View File

@ -0,0 +1,13 @@
package com.ifish.dao;
import com.ifish.entity.FactoryVenderHardwareTypeAttri;
/**
* @ClassName: HardwareTypeDao
* @Description: TODO
* @author ggw
*
*/
public interface FactoryHardwareTypeAttrDao extends BaseDao<FactoryVenderHardwareTypeAttri, Integer>{
}

View File

@ -1,7 +1,9 @@
package com.ifish.dao;
import java.util.List;
import java.util.Map;
import com.ifish.domain.FactoryVenderData;
import com.ifish.entity.FactoryList;
/**
@ -14,4 +16,8 @@ public interface FactoryListDao extends BaseDao<FactoryList, String>{
//获取鱼缸厂下所有属电子厂
public Map<String,String> getFactoryByVenderCode(String venderCode);
void updateFactoryVenderBackgroud(String brandCode, String factory, String background);
List<FactoryVenderData> getFactoryVenderList();
}

View File

@ -0,0 +1,13 @@
package com.ifish.dao;
import com.ifish.entity.HardwareTypeAttri;
/**
* @ClassName: HardwareTypeDao
* @Description: TODO
* @author ggw
*
*/
public interface HardwareTypeAttriDao extends BaseDao<HardwareTypeAttri, Integer>{
}

View File

@ -0,0 +1,12 @@
package com.ifish.dao;
import com.ifish.entity.HardwareVender;
/**
* 广告信息
* @author Administrator
*
*/
public interface HardwareVenderDao extends BaseDao<HardwareVender, Integer>{
}

View File

@ -0,0 +1,24 @@
package com.ifish.daoImpl;
import com.ifish.dao.DevicePetUserDao;
import com.ifish.entity.DevicePetUser;
import com.ifish.entity.id.PriId;
import com.ifish.hibernate.HibernateBaseDao;
import org.springframework.stereotype.Repository;
/**
* @ClassName: DeviceUserDaoImpl
* @Description: TODO
* @author ggw
*
*/
@Repository("devicePetUserDao")
public class DevicePetUserDaoImpl extends HibernateBaseDao<DevicePetUser, PriId> implements DevicePetUserDao {
@Override
protected Class<DevicePetUser> getEntityClass() {
return DevicePetUser.class;
}
}

View File

@ -0,0 +1,24 @@
package com.ifish.daoImpl;
import com.ifish.dao.FactoryHardwareTypeAttrDao;
import com.ifish.entity.FactoryVenderHardwareTypeAttri;
import com.ifish.hibernate.HibernateBaseDao;
import org.springframework.stereotype.Repository;
/**
* @ClassName: HardwareTypeDaoImpl
* @Description: TODO
* @author ggw
*
*/
@Repository("factoryHardwareTypeAttriDao")
public class FactoryHardwareTypeAttrDaoImpl extends HibernateBaseDao<FactoryVenderHardwareTypeAttri, Integer> implements FactoryHardwareTypeAttrDao {
@Override
protected Class<FactoryVenderHardwareTypeAttri> getEntityClass() {
return FactoryVenderHardwareTypeAttri.class;
}
}

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.ifish.domain.FactoryVenderData;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;
@ -40,6 +41,15 @@ public class FactoryListDaoImpl extends HibernateBaseDao<FactoryList, String> im
return returnMap;
}
@Override
public void updateFactoryVenderBackgroud(String brandCode, String factory, String background) {
getSession().createSQLQuery("update tbl_factory_vender set background = '" + background + "' where factory_code = '" + factory + "' and brand_code = '" + brandCode + "';").executeUpdate();
getSession().flush();
}
@Override
public List<FactoryVenderData> getFactoryVenderList() {
List<FactoryVenderData> list = getSession().createSQLQuery("select factory_code,brand_code,background from tbl_factory_vender").setResultTransformer(Transformers.aliasToBean(FactoryVenderData.class)).list();
return list;
}
}

View File

@ -0,0 +1,24 @@
package com.ifish.daoImpl;
import com.ifish.dao.HardwareTypeAttriDao;
import com.ifish.entity.HardwareTypeAttri;
import com.ifish.hibernate.HibernateBaseDao;
import org.springframework.stereotype.Repository;
/**
* @ClassName: HardwareTypeDaoImpl
* @Description: TODO
* @author ggw
*
*/
@Repository("hardwareTypeAttriDao")
public class HardwareTypeDaoAttriImpl extends HibernateBaseDao<HardwareTypeAttri, Integer> implements HardwareTypeAttriDao {
@Override
protected Class<HardwareTypeAttri> getEntityClass() {
return HardwareTypeAttri.class;
}
}

View File

@ -0,0 +1,19 @@
package com.ifish.daoImpl;
import com.ifish.dao.HardwareVenderDao;
import com.ifish.entity.HardwareVender;
import com.ifish.hibernate.HibernateBaseDao;
import org.springframework.stereotype.Repository;
/**
* 广告信息
*/
@Repository
public class HardwareVenderImpl extends HibernateBaseDao<HardwareVender, Integer> implements HardwareVenderDao {
@Override
protected Class<HardwareVender> getEntityClass() {
return HardwareVender.class;
}
}

View File

@ -0,0 +1,38 @@
package com.ifish.domain;
/**
* @author: yan.y
* @Description:
* @Date: Created in 13:41 2025/9/18
* @Modified by:
*/
public class FactoryVenderData {
private String factory_code;
private String brand_code;
private String background;
public String getFactory_code() {
return factory_code;
}
public void setFactory_code(String factory_code) {
this.factory_code = factory_code;
}
public String getBrand_code() {
return brand_code;
}
public void setBrand_code(String brand_code) {
this.brand_code = brand_code;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
}

View File

@ -0,0 +1,89 @@
package com.ifish.entity;
import com.ifish.entity.id.PriId;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName: tbl_device_user
* @date 2015年7月2日 下午16:40:00
*
*/
public class DevicePetUser implements Serializable{
private static final long serialVersionUID = -6056043883433438749L;
//ID
private PriId priId = new PriId();
//显示名称
private String showName;
private String storeName;
private Integer isMaster;
//创建时间
private Date createTime;
//用户
private User user = new User();
//设备
private Device device = new Device();
public DevicePetUser() {}
public DevicePetUser(PriId priId, String showName, String storeName) {
this.priId = priId;
this.showName = showName;
this.storeName = storeName;
}
public PriId getPriId() {
return priId;
}
public void setPriId(PriId priId) {
this.priId = priId;
}
public String getShowName() {
return showName;
}
public void setShowName(String showName) {
this.showName = showName;
}
public String getStoreName() {
return storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public Integer getIsMaster() {
return isMaster;
}
public void setIsMaster(Integer isMaster) {
this.isMaster = isMaster;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Device getDevice() {
return device;
}
public void setDevice(Device device) {
this.device = device;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -0,0 +1,183 @@
package com.ifish.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
*
*/
@Entity
@Table(name="tbl_device_user_attriname")
public class DeviceUserAttriName implements Serializable{
private static final long serialVersionUID = -5155435715428041950L;
/**
* ID
*/
@Id
@Column(name="id")
private Integer id;
@Column(name="user_id")
private Integer userId;
@Column(name="device_id")
private Integer deviceId;
@Column(name="switch_s1")
private String switchS1;
@Column(name="switch_s2")
private String switchS2;
@Column(name="switch_s3")
private String switchS3;
@Column(name="switch_s4")
private String switchS4;
@Column(name="switch_s5")
private String switchS5;
@Column(name="switch_s6")
private String switchS6;
@Column(name="switch_s7")
private String switchS7;
@Column(name="switch_s8")
private String switchS8;
@Column(name="switch_s9")
private String switchS9;
@Column(name="switch_s10")
private String switchS10;
@Column(name="switch_s11")
private String switchS11;
@Column(name="switch_s12")
private String switchS12;
@Column(name="create_time")
private Date createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getDeviceId() {
return deviceId;
}
public void setDeviceId(Integer deviceId) {
this.deviceId = deviceId;
}
public String getSwitchS1() {
return switchS1;
}
public void setSwitchS1(String switchS1) {
this.switchS1 = switchS1;
}
public String getSwitchS2() {
return switchS2;
}
public void setSwitchS2(String switchS2) {
this.switchS2 = switchS2;
}
public String getSwitchS3() {
return switchS3;
}
public void setSwitchS3(String switchS3) {
this.switchS3 = switchS3;
}
public String getSwitchS4() {
return switchS4;
}
public void setSwitchS4(String switchS4) {
this.switchS4 = switchS4;
}
public String getSwitchS5() {
return switchS5;
}
public void setSwitchS5(String switchS5) {
this.switchS5 = switchS5;
}
public String getSwitchS6() {
return switchS6;
}
public void setSwitchS6(String switchS6) {
this.switchS6 = switchS6;
}
public String getSwitchS7() {
return switchS7;
}
public void setSwitchS7(String switchS7) {
this.switchS7 = switchS7;
}
public String getSwitchS8() {
return switchS8;
}
public void setSwitchS8(String switchS8) {
this.switchS8 = switchS8;
}
public String getSwitchS9() {
return switchS9;
}
public void setSwitchS9(String switchS9) {
this.switchS9 = switchS9;
}
public String getSwitchS10() {
return switchS10;
}
public void setSwitchS10(String switchS10) {
this.switchS10 = switchS10;
}
public String getSwitchS11() {
return switchS11;
}
public void setSwitchS11(String switchS11) {
this.switchS11 = switchS11;
}
public String getSwitchS12() {
return switchS12;
}
public void setSwitchS12(String switchS12) {
this.switchS12 = switchS12;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -23,6 +23,9 @@ public class FactoryList implements Serializable{
private String isTax;
//创建时间
private Date createTime;
private String background;
//鱼缸厂
private Set<VenderList> venderLists;
//硬件类型
@ -65,5 +68,12 @@ public class FactoryList implements Serializable{
public void setIsTax(String isTax) {
this.isTax = isTax;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
}

View File

@ -0,0 +1,303 @@
package com.ifish.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
*
*/
@Entity
@Table(name="tbl_factory_vender_hardware_type_attri")
public class FactoryVenderHardwareTypeAttri implements Serializable{
private static final long serialVersionUID = -5155435715428041950L;
/**
* ID
*/
@Id
@Column(name="id")
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
@Column(name="hardware_type")
private String hardwareType;
@Column(name="vender_code")
private String venderCode;
@Column(name="switch_s1")
private String switchS1;
@Column(name="switch_s2")
private String switchS2;
@Column(name="switch_s3")
private String switchS3;
@Column(name="switch_s4")
private String switchS4;
@Column(name="switch_s5")
private String switchS5;
@Column(name="switch_s6")
private String switchS6;
@Column(name="switch_s7")
private String switchS7;
@Column(name="switch_s8")
private String switchS8;
@Column(name="switch_s9")
private String switchS9;
@Column(name="switch_s10")
private String switchS10;
@Column(name="switch_s11")
private String switchS11;
@Column(name="switch_s12")
private String switchS12;
@Column(name="switch_s1_ico1")
private String switchS1Ico1;
@Column(name="switch_s2_ico2")
private String switchS2Ico2;
@Column(name="switch_s3_ico3")
private String switchS3Ico3;
@Column(name="switch_s4_ico4")
private String switchS4Ico4;
@Column(name="switch_s5_ico5")
private String switchS5Ico5;
@Column(name="switch_s6_ico6")
private String switchS6Ico6;
@Column(name="switch_s7_ico7")
private String switchS7Ico7;
@Column(name="switch_s8_ico8")
private String switchS8Ico8;
@Column(name="switch_s9_ico9")
private String switchS9Ico9;
@Column(name="switch_s10_ico10")
private String switchS10Ico10;
@Column(name="switch_s11_ico11")
private String switchS11Ico11;
@Column(name="switch_s12_ico12")
private String switchS12Ico12;
@Column(name="create_time")
private Date createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getVenderCode() {
return venderCode;
}
public void setVenderCode(String venderCode) {
this.venderCode = venderCode;
}
public String getHardwareType() {
return hardwareType;
}
public void setHardwareType(String hardwareType) {
this.hardwareType = hardwareType;
}
public String getSwitchS1() {
return switchS1;
}
public void setSwitchS1(String switchS1) {
this.switchS1 = switchS1;
}
public String getSwitchS2() {
return switchS2;
}
public void setSwitchS2(String switchS2) {
this.switchS2 = switchS2;
}
public String getSwitchS3() {
return switchS3;
}
public void setSwitchS3(String switchS3) {
this.switchS3 = switchS3;
}
public String getSwitchS4() {
return switchS4;
}
public void setSwitchS4(String switchS4) {
this.switchS4 = switchS4;
}
public String getSwitchS5() {
return switchS5;
}
public void setSwitchS5(String switchS5) {
this.switchS5 = switchS5;
}
public String getSwitchS6() {
return switchS6;
}
public void setSwitchS6(String switchS6) {
this.switchS6 = switchS6;
}
public String getSwitchS7() {
return switchS7;
}
public void setSwitchS7(String switchS7) {
this.switchS7 = switchS7;
}
public String getSwitchS8() {
return switchS8;
}
public void setSwitchS8(String switchS8) {
this.switchS8 = switchS8;
}
public String getSwitchS9() {
return switchS9;
}
public void setSwitchS9(String switchS9) {
this.switchS9 = switchS9;
}
public String getSwitchS10() {
return switchS10;
}
public void setSwitchS10(String switchS10) {
this.switchS10 = switchS10;
}
public String getSwitchS11() {
return switchS11;
}
public void setSwitchS11(String switchS11) {
this.switchS11 = switchS11;
}
public String getSwitchS12() {
return switchS12;
}
public void setSwitchS12(String switchS12) {
this.switchS12 = switchS12;
}
public String getSwitchS1Ico1() {
return switchS1Ico1;
}
public void setSwitchS1Ico1(String switchS1Ico1) {
this.switchS1Ico1 = switchS1Ico1;
}
public String getSwitchS2Ico2() {
return switchS2Ico2;
}
public void setSwitchS2Ico2(String switchS2Ico2) {
this.switchS2Ico2 = switchS2Ico2;
}
public String getSwitchS3Ico3() {
return switchS3Ico3;
}
public void setSwitchS3Ico3(String switchS3Ico3) {
this.switchS3Ico3 = switchS3Ico3;
}
public String getSwitchS4Ico4() {
return switchS4Ico4;
}
public void setSwitchS4Ico4(String switchS4Ico4) {
this.switchS4Ico4 = switchS4Ico4;
}
public String getSwitchS5Ico5() {
return switchS5Ico5;
}
public void setSwitchS5Ico5(String switchS5Ico5) {
this.switchS5Ico5 = switchS5Ico5;
}
public String getSwitchS6Ico6() {
return switchS6Ico6;
}
public void setSwitchS6Ico6(String switchS6Ico6) {
this.switchS6Ico6 = switchS6Ico6;
}
public String getSwitchS7Ico7() {
return switchS7Ico7;
}
public void setSwitchS7Ico7(String switchS7Ico7) {
this.switchS7Ico7 = switchS7Ico7;
}
public String getSwitchS8Ico8() {
return switchS8Ico8;
}
public void setSwitchS8Ico8(String switchS8Ico8) {
this.switchS8Ico8 = switchS8Ico8;
}
public String getSwitchS9Ico9() {
return switchS9Ico9;
}
public void setSwitchS9Ico9(String switchS9Ico9) {
this.switchS9Ico9 = switchS9Ico9;
}
public String getSwitchS10Ico10() {
return switchS10Ico10;
}
public void setSwitchS10Ico10(String switchS10Ico10) {
this.switchS10Ico10 = switchS10Ico10;
}
public String getSwitchS11Ico11() {
return switchS11Ico11;
}
public void setSwitchS11Ico11(String switchS11Ico11) {
this.switchS11Ico11 = switchS11Ico11;
}
public String getSwitchS12Ico12() {
return switchS12Ico12;
}
public void setSwitchS12Ico12(String switchS12Ico12) {
this.switchS12Ico12 = switchS12Ico12;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -0,0 +1,303 @@
package com.ifish.entity;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
*
*/
@Entity
@Table(name="tbl_hardware_type_attri")
public class HardwareTypeAttri implements Serializable{
private static final long serialVersionUID = -5155435715428041950L;
/**
* ID
*/
@Id
@Column(name="id")
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
@Column(name="hardware_type")
private String hardwareType;
@Column(name="switch_s1")
private Integer switchS1 = 0;
@Column(name="switch_s2")
private Integer switchS2 = 0;
@Column(name="switch_s3")
private Integer switchS3 = 0;
@Column(name="switch_s4")
private Integer switchS4 = 0;
@Column(name="switch_s5")
private Integer switchS5 = 0;
@Column(name="switch_s6")
private Integer switchS6 = 0;
@Column(name="switch_s7")
private Integer switchS7 = 0;
@Column(name="switch_s8")
private Integer switchS8 = 0;
@Column(name="switch_s9")
private Integer switchS9 = 0;
@Column(name="switch_s10")
private Integer switchS10 = 0;
@Column(name="switch_s11")
private Integer switchS11 = 0;
@Column(name="switch_s12")
private Integer switchS12 = 0;
@Column(name="temperature1")
private Integer temperature1 = 0;
@Column(name="temperature2")
private Integer temperature2 = 0;
@Column(name="heating_set")
private Integer heatingSet = 0;
@Column(name="refrigeration_set")
private Integer refrigerationSet = 0;
@Column(name="feedfish_set")
private Integer feedfishSet = 0;
@Column(name="change_temper_set1")
private Integer changeTemperSet1 = 0;
@Column(name="change_temper_set2")
private Integer changeTemperSet2 = 0;
@Column(name="delayed_set")
private Integer delayedSet = 0;
@Column(name="electricity_show")
private Integer electricityShow = 0;
@Column(name="once_feedfish_set")
private Integer onceFeedfishSet = 0;
@Column(name="nursing_light")
private Integer nursingLight = 0;
@Column(name="temperature_show1")
private Integer temperatureShow1 = 0;
@Column(name="temperature_show2")
private Integer temperatureShow2 = 0;
@Column(name="create_time")
private Date createTime = new Date();
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getHardwareType() {
return hardwareType;
}
public void setHardwareType(String hardwareType) {
this.hardwareType = hardwareType;
}
public Integer getSwitchS1() {
return switchS1;
}
public void setSwitchS1(Integer switchS1) {
this.switchS1 = switchS1;
}
public Integer getSwitchS2() {
return switchS2;
}
public void setSwitchS2(Integer switchS2) {
this.switchS2 = switchS2;
}
public Integer getSwitchS3() {
return switchS3;
}
public void setSwitchS3(Integer switchS3) {
this.switchS3 = switchS3;
}
public Integer getSwitchS4() {
return switchS4;
}
public void setSwitchS4(Integer switchS4) {
this.switchS4 = switchS4;
}
public Integer getSwitchS5() {
return switchS5;
}
public void setSwitchS5(Integer switchS5) {
this.switchS5 = switchS5;
}
public Integer getSwitchS6() {
return switchS6;
}
public void setSwitchS6(Integer switchS6) {
this.switchS6 = switchS6;
}
public Integer getSwitchS7() {
return switchS7;
}
public void setSwitchS7(Integer switchS7) {
this.switchS7 = switchS7;
}
public Integer getSwitchS8() {
return switchS8;
}
public void setSwitchS8(Integer switchS8) {
this.switchS8 = switchS8;
}
public Integer getSwitchS9() {
return switchS9;
}
public void setSwitchS9(Integer switchS9) {
this.switchS9 = switchS9;
}
public Integer getSwitchS10() {
return switchS10;
}
public void setSwitchS10(Integer switchS10) {
this.switchS10 = switchS10;
}
public Integer getSwitchS11() {
return switchS11;
}
public void setSwitchS11(Integer switchS11) {
this.switchS11 = switchS11;
}
public Integer getSwitchS12() {
return switchS12;
}
public void setSwitchS12(Integer switchS12) {
this.switchS12 = switchS12;
}
public Integer getTemperature1() {
return temperature1;
}
public void setTemperature1(Integer temperature1) {
this.temperature1 = temperature1;
}
public Integer getTemperature2() {
return temperature2;
}
public void setTemperature2(Integer temperature2) {
this.temperature2 = temperature2;
}
public Integer getHeatingSet() {
return heatingSet;
}
public void setHeatingSet(Integer heatingSet) {
this.heatingSet = heatingSet;
}
public Integer getRefrigerationSet() {
return refrigerationSet;
}
public void setRefrigerationSet(Integer refrigerationSet) {
this.refrigerationSet = refrigerationSet;
}
public Integer getFeedfishSet() {
return feedfishSet;
}
public void setFeedfishSet(Integer feedfishSet) {
this.feedfishSet = feedfishSet;
}
public Integer getChangeTemperSet1() {
return changeTemperSet1;
}
public void setChangeTemperSet1(Integer changeTemperSet1) {
this.changeTemperSet1 = changeTemperSet1;
}
public Integer getChangeTemperSet2() {
return changeTemperSet2;
}
public void setChangeTemperSet2(Integer changeTemperSet2) {
this.changeTemperSet2 = changeTemperSet2;
}
public Integer getDelayedSet() {
return delayedSet;
}
public void setDelayedSet(Integer delayedSet) {
this.delayedSet = delayedSet;
}
public Integer getElectricityShow() {
return electricityShow;
}
public void setElectricityShow(Integer electricityShow) {
this.electricityShow = electricityShow;
}
public Integer getOnceFeedfishSet() {
return onceFeedfishSet;
}
public void setOnceFeedfishSet(Integer onceFeedfishSet) {
this.onceFeedfishSet = onceFeedfishSet;
}
public Integer getNursingLight() {
return nursingLight;
}
public void setNursingLight(Integer nursingLight) {
this.nursingLight = nursingLight;
}
public Integer getTemperatureShow1() {
return temperatureShow1;
}
public void setTemperatureShow1(Integer temperatureShow1) {
this.temperatureShow1 = temperatureShow1;
}
public Integer getTemperatureShow2() {
return temperatureShow2;
}
public void setTemperatureShow2(Integer temperatureShow2) {
this.temperatureShow2 = temperatureShow2;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -0,0 +1,121 @@
package com.ifish.entity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ifish.handler.CustomDateSerializer;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* 广告位信息
* @author Administrator
*
*/
@Entity
@Table(name="tbl_hardware_vender_config")
public class HardwareVender implements Serializable{
/**
* id
*/
@Id
@Column(name="id")
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
@Column(name="factory_code")
private String factoryCode;
@Column(name="hardware_type")
private String hardwareType;
@Transient
private String hardwareName;
@Transient
private String factoryName;
@Column(name="vender_code")
private String venderCode;
@Transient
private String venderName;
@Column(name="background")
private String background;
@JsonSerialize(using=CustomDateSerializer.class)
@Column(name="create_time")
@Temporal(TemporalType.TIMESTAMP)
private Date createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getVenderCode() {
return venderCode;
}
public void setVenderCode(String venderCode) {
this.venderCode = venderCode;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public String getVenderName() {
return venderName;
}
public void setVenderName(String venderName) {
this.venderName = venderName;
}
public String getHardwareType() {
return hardwareType;
}
public void setHardwareType(String hardwareType) {
this.hardwareType = hardwareType;
}
public String getHardwareName() {
return hardwareName;
}
public void setHardwareName(String hardwareName) {
this.hardwareName = hardwareName;
}
}

View File

@ -32,7 +32,8 @@ public class VenderList implements Serializable{
private Date updateTime;
//创建时间
private Date createTime;
private String background;
public String getBrandCode() {
return brandCode;
}
@ -89,5 +90,13 @@ public class VenderList implements Serializable{
public void setLogo(String logo) {
this.logo = logo;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.ifish.entity">
<class name="DevicePetUser" table="tbl_pet_list" dynamic-insert="true" dynamic-update="true">
<meta attribute="sync-DAO">false</meta>
<composite-id name="priId" class="com.ifish.entity.id.PriId">
<key-property name="userId" column="user_id" type="java.lang.Integer" />
<key-property name="deviceId" column="device_id" type="java.lang.Integer" />
</composite-id>
<property name="showName" column="device_name" type="string" length="255" />
<property name="storeName" column="store_name" type="string" length="255" />
<property name="isMaster" column="is_master" type="java.lang.Integer" length="10" />
<property name="createTime" column="create_time" type="java.util.Date" />
<many-to-one name="user" column="user_id" class="com.ifish.entity.User" update="false" insert="false" lazy="false"/>
<many-to-one name="device" column="device_id" class="com.ifish.entity.Device" update="false" insert="false" lazy="false"/>
</class>
</hibernate-mapping>

View File

@ -1,21 +1,23 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.ifish.entity">
<class name="FactoryList" table="tbl_factory_list" dynamic-insert="true" dynamic-update="true">
<meta attribute="sync-DAO">false</meta>
<id name="factoryCode" column="factory_code" type="string" length="20">
<generator class="assigned"/>
</id>
<property name="factoryName" column="factory_name" type="string" length="20" not-null="true" />
<property name="isTax" column="is_tax" type="string" length="1" />
<property name="createTime" column="create_time" type="timestamp" update="false" />
<set name="venderLists" table="tbl_factory_vender" cascade="save-update">
<key column="factory_code" />
<many-to-many class="VenderList" column="brand_code"/>
<class name="FactoryList" table="tbl_factory_list" dynamic-insert="true" dynamic-update="true">
<meta attribute="sync-DAO">false</meta>
<id name="factoryCode" column="factory_code" type="string" length="20">
<generator class="assigned"/>
</id>
<property name="factoryName" column="factory_name" type="string" length="20" not-null="true"/>
<property name="isTax" column="is_tax" type="string" length="1"/>
<property name="createTime" column="create_time" type="timestamp" update="false"/>
<property name="background" column="background" type="string"/>
<set name="venderLists" table="tbl_factory_vender" cascade="save-update">
<key column="factory_code"/>
<many-to-many class="VenderList" column="brand_code"/>
</set>
<set name="hardwareTypeSet" table="tbl_factory_hardware" cascade="save-update">
<key column="factory_code" />
<many-to-many class="HardwareType" column="hardware_type"/>
<set name="hardwareTypeSet" table="tbl_factory_hardware" cascade="save-update">
<key column="factory_code"/>
<many-to-many class="HardwareType" column="hardware_type"/>
</set>
</class>
</class>
</hibernate-mapping>

View File

@ -29,5 +29,13 @@ public class CheckNames implements Serializable {
public void setChecked(Boolean checked) {
this.checked = checked;
}
public CheckNames() {
}
public CheckNames(String showValue, String showName, Boolean checked) {
this.showValue = showValue;
this.showName = showName;
this.checked = checked;
}
}

View File

@ -47,6 +47,8 @@ public class SearchFilter implements Serializable{
private String sSearch;
//标识
private String sEcho;
private String factoryCode;
public String getSortField() {
return sortField;
@ -168,5 +170,12 @@ public class SearchFilter implements Serializable{
public void setsSearch7(String sSearch7) {
this.sSearch7 = sSearch7;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
}

View File

@ -3,36 +3,11 @@ package com.ifish.service;
import java.util.List;
import java.util.Map;
import com.ifish.domain.FactoryVenderData;
import com.ifish.entity.*;
import org.springframework.web.multipart.MultipartFile;
import com.ifish.domain.JsonResult;
import com.ifish.entity.Camera;
import com.ifish.entity.CameraActive;
import com.ifish.entity.CameraUser;
import com.ifish.entity.Device;
import com.ifish.entity.DeviceUser;
import com.ifish.entity.FactoryList;
import com.ifish.entity.HardwareType;
import com.ifish.entity.IfishDoctor;
import com.ifish.entity.LiveBanner;
import com.ifish.entity.LiveRoom;
import com.ifish.entity.LoginRecord;
import com.ifish.entity.Menu;
import com.ifish.entity.NeteaseUser;
import com.ifish.entity.OperateRecord;
import com.ifish.entity.PayBill;
import com.ifish.entity.PayeeInfo;
import com.ifish.entity.PushList;
import com.ifish.entity.QuestionsFeedback;
import com.ifish.entity.Role;
import com.ifish.entity.SecurityUser;
import com.ifish.entity.TmpPushRemind;
import com.ifish.entity.Ueditor;
import com.ifish.entity.UpgradeNotes;
import com.ifish.entity.User;
import com.ifish.entity.UserAsset;
import com.ifish.entity.VenderList;
import com.ifish.entity.Version;
import com.ifish.enums.RoleEnum;
import com.ifish.hibernate.Pagination;
import com.ifish.search.SearchFilter;
@ -103,10 +78,12 @@ public interface AdminService {
//绑定设备
public boolean bindDevice(String macAddress,Integer userId);
public boolean bindPetDevice(String macAddress,Integer userId);
//解除绑定
public void unbind(DeviceUser deviceUser);
public void unbindPet(DevicePetUser deviceUser);
//设备授权
public boolean deviceLicense(Integer deviceId,String isBlacklist);
@ -186,11 +163,13 @@ public interface AdminService {
public Pagination<HardwareType> getHardwareTypeByPage(SearchFilter searchFilter);
//保存硬件类型
public String saveHardwareType(HardwareType hardwareType);
public String saveHardwareType(HardwareType hardwareType, String attr1, String attr2, String attr3);
//更新硬件类型
public HardwareType updateHardwareType(HardwareType hardwareType);
public HardwareType updateHardwareType(HardwareType hardwareType, String attr1, String attr2, String attr3);
public HardwareTypeAttri getHardwareTypeAttri(String hardwareType);
public FactoryVenderHardwareTypeAttri getFactoryVenderHardwareTypeAttri(String hardwareType, String venderCode);
//删除硬件类型
public void deleteHardwareType(String hardwareType);
@ -208,13 +187,16 @@ public interface AdminService {
//根据编号获取电子厂信息
public FactoryList getFactoryByCode(String code);
List<FactoryVenderData> getFactoryBrandList();
//删除电子厂
public void deleteFactory(String code);
//新增电子厂信息
public String addFactory(FactoryList factoryList,String brandCodes,String hardwareTypes);
public String addFactory(FactoryList factoryList,String brandCodes,String hardwareTypes, String imgName);
public String addFactory1(String brandCodes,String hardwareTypes, String imgName);
//修改电子厂信息
public String updateFactory(FactoryList factoryList,String brandCodes,String hardwareTypes);
@ -331,5 +313,13 @@ public interface AdminService {
//随机发送问题给10个商家
public boolean sendMsgToShops(Integer questionId);
//账单生成
boolean billGen(String month);
void saveFactoryHardwareTypeAttr(FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttri);
Pagination<HardwareVender> getHardwareVenderConfig(SearchFilter searchFilter);
HardwareVender getHardwareVenderConfigById(Integer id);
void deleteHardwareVender(HardwareVender hardwareVender);
}

View File

@ -37,6 +37,8 @@ public interface FactoryService {
//获取厂家下的设备总数量
int getDeviceCountByFactory(String factoryCode);
int getDeviceCountByFactory(String factoryCode, String billMonth);
FactoryList get(String id);
List<FactoryList> getFactoryList();

View File

@ -4,67 +4,28 @@ import java.io.File;
import java.text.Format;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import com.alibaba.fastjson.JSON;
import com.ifish.dao.*;
import com.ifish.domain.*;
import com.ifish.entity.*;
import com.ifish.entity.event.QueueEventBody;
import com.ifish.entity.event.QueueEventEntity;
import com.ifish.service.FactoryService;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ifish.dao.CameraActiveDao;
import com.ifish.dao.CameraDao;
import com.ifish.dao.CameraUserDao;
import com.ifish.dao.DeviceCameraDao;
import com.ifish.dao.DeviceDao;
import com.ifish.dao.DeviceUserDao;
import com.ifish.dao.FactoryListDao;
import com.ifish.dao.GradeDao;
import com.ifish.dao.HardwareTypeDao;
import com.ifish.dao.IfishDoctorDao;
import com.ifish.dao.InformationDao;
import com.ifish.dao.LiveBannerDao;
import com.ifish.dao.LiveRoomDao;
import com.ifish.dao.LoginRecordDao;
import com.ifish.dao.MenuDao;
import com.ifish.dao.NeteaseUserDao;
import com.ifish.dao.OperateRecordDao;
import com.ifish.dao.PayBillDao;
import com.ifish.dao.PayeeInfoDao;
import com.ifish.dao.PushListDao;
import com.ifish.dao.QuestionsFeedbackDao;
import com.ifish.dao.RoleDao;
import com.ifish.dao.SecurityUserDao;
import com.ifish.dao.ShopsInfoDao;
import com.ifish.dao.TmpPushRemindDao;
import com.ifish.dao.UeditorDao;
import com.ifish.dao.UpgradeNotesDao;
import com.ifish.dao.UserDao;
import com.ifish.dao.VenderListDao;
import com.ifish.dao.VersionDao;
import com.ifish.domain.FactoryData;
import com.ifish.domain.FactoryRecordData;
import com.ifish.domain.HardwareTypeData;
import com.ifish.domain.JsonResult;
import com.ifish.domain.RecordData;
import com.ifish.domain.VenderData;
import com.ifish.entity.id.PayBillId;
import com.ifish.enums.BooleanEnum;
import com.ifish.enums.GwellEnum;
@ -87,6 +48,7 @@ import com.ifish.util.IfishUtil;
import com.ifish.util.ResultUtil;
import com.ifishNew.mapper.Tbl_Push_List_Mapper;
import javax.annotation.Resource;
import javax.jms.Destination;
import javax.jms.Session;
@ -107,6 +69,8 @@ public class AdminServiceImpl implements AdminService {
@Autowired
private DeviceDao deviceDao;
@Autowired
private DevicePetUserDao devicePetUserDao;
@Autowired
private CameraDao cameraDao;
@Autowired
private VersionDao versionDao;
@ -149,6 +113,10 @@ public class AdminServiceImpl implements AdminService {
@Autowired
private HardwareTypeDao hardwareTypeDao;
@Autowired
private HardwareTypeAttriDao hardwareTypeAttriDao;
@Autowired
private FactoryHardwareTypeAttrDao factoryHardwareTypeAttrDao;
@Autowired
private SecurityUserDao securityUserDao;
@Autowired
private QuestionsFeedbackDao questionsFeedbackDao;
@ -260,12 +228,26 @@ public class AdminServiceImpl implements AdminService {
@Override
public List<VenderList> getVenderList() {
return getVenderListByPage(null).getList();
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
SearchFilter searchFilter = new SearchFilter();
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
searchFilter.setFactoryCode(code);
}
return getVenderListByPage(searchFilter).getList();
}
@Override
public List<HardwareType> getHardwareTypeList() {
return getHardwareTypeByPage(null).getList();
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
SearchFilter searchFilter = new SearchFilter();
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
searchFilter.setFactoryCode(code);
}
return getHardwareTypeByPage(searchFilter).getList();
}
/**
@ -484,6 +466,8 @@ public class AdminServiceImpl implements AdminService {
map.put("user", user);
List<DeviceUser> deviceUserList = this.deviceUserDao.findByProperty(Restrictions.eq("priId.userId", user.getUserId()));
map.put("deviceUserList", deviceUserList);
List<DevicePetUser> devicePetUserList = this.devicePetUserDao.findByProperty(Restrictions.eq("priId.userId", user.getUserId()));
map.put("devicePetUserList", devicePetUserList);
List<CameraUser> cameraUserList = this.cameraUserDao.findByProperty(Restrictions.eq("cameraUserId.userId", user.getUserId()));
map.put("cameraUserList", cameraUserList);
List<String> cameraIds = new ArrayList<String>();
@ -648,6 +632,36 @@ public class AdminServiceImpl implements AdminService {
return false;
}
@Override
public boolean bindPetDevice(String macAddress, Integer userId) {
if (userId != null && macAddress != null && macAddress.length() > 0) {
User user = this.userDao.get(userId);
Device device = this.deviceDao.findUniqueByProperty(Restrictions.eq("macAddress", macAddress));
if (user != null && device != null) {
Integer deviceId = device.getDeviceId();
DevicePetUser devicePetUser = new DevicePetUser();
devicePetUser.getPriId().setDeviceId(deviceId);
devicePetUser.getPriId().setUserId(userId);
DevicePetUser tmpDeviceUser = this.devicePetUserDao.get(devicePetUser.getPriId());
if (tmpDeviceUser == null) {
List<DevicePetUser> DeviceUserList = this.devicePetUserDao.findByProperty(Restrictions.eq("priId.deviceId", deviceId));
if (DeviceUserList.size() > 0) {
devicePetUser.setIsMaster(1);
} else {
devicePetUser.setIsMaster(0);
}
devicePetUser.setStoreName("宠物店" + (int) (Math.random() * 9000 + 1000));
devicePetUser.setShowName("宠物笼" + (int) (Math.random() * 9000 + 1000));
devicePetUser.setUser(user);
devicePetUser.setDevice(device);
this.devicePetUserDao.save(devicePetUser);
}
return true;
}
}
return false;
}
@Override
public void unbind(DeviceUser deviceUser) {
deviceUser = this.deviceUserDao.get(deviceUser.getPriId());
@ -664,6 +678,22 @@ public class AdminServiceImpl implements AdminService {
}
}
@Override
public void unbindPet(DevicePetUser devicePetUser) {
devicePetUser = this.devicePetUserDao.get(devicePetUser.getPriId());
if (devicePetUser != null) {
//是主控解除所有的绑定
if (devicePetUser.getIsMaster().equals(BooleanEnum.YES.getKey())) {
List<DevicePetUser> list = this.devicePetUserDao.findByProperty(Restrictions.eq("priId.deviceId", devicePetUser.getPriId().getDeviceId()));
for (DevicePetUser curDeviceUser : list) {
devicePetUserDao.delete(curDeviceUser);
}
} else {
devicePetUserDao.delete(devicePetUser);
}
}
}
@Override
public boolean deviceLicense(Integer deviceId, String isBlacklist) {
Device device = this.deviceDao.get(deviceId);
@ -855,6 +885,14 @@ public class AdminServiceImpl implements AdminService {
if (selectField1 != null && selectField1.length() > 0) {
queryList.add(Restrictions.eq("factoryCode", selectField1));
}
if (StringUtils.isNotBlank(searchFilter.getFactoryCode())) {
FactoryList factoryList = this.factoryListDao.get(searchFilter.getFactoryCode());
List<String> typeList = new ArrayList<>();
for (VenderList venderList : factoryList.getVenderLists()) {
typeList.add(venderList.getBrandCode());
}
queryList.add(Restrictions.in("brandCode", typeList.toArray()));
}
//排序
List<Order> orderList = new ArrayList<Order>();
//排序字段
@ -937,6 +975,14 @@ public class AdminServiceImpl implements AdminService {
vender.setLogo(picName + "?timestamp=" + System.currentTimeMillis());
}
venderListDao.save(vender);
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = getSysUserByUserName(userDetails.getUsername());
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
String code = securityUser.getCode();
FactoryList factoryList = factoryListDao.get(code);
factoryList.getVenderLists().add(vender);
factoryListDao.save(factoryList);
}
return SysUserEnum.success100.getKey();
}
}
@ -960,6 +1006,18 @@ public class AdminServiceImpl implements AdminService {
}
tmpVender.setUpdateTime(new Date());
venderListDao.update(tmpVender);
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
if (!securityUser.getRole().equals("ROLE_ADMIN")) {
FactoryList factoryList = getFactoryByCode(code);
Set<VenderList> venderLists = factoryList.getVenderLists();
for (VenderList venderList : venderLists) {
if (venderList.getBrandCode().equals(tmpVender.getBrandCode())) {
factoryListDao.updateFactoryVenderBackgroud(tmpVender.getBrandCode(), code, vender.getBackground());
}
}
}
return SysUserEnum.success100.getKey();
}
}
@ -1205,17 +1263,25 @@ public class AdminServiceImpl implements AdminService {
@Override
public Pagination<HardwareType> getHardwareTypeByPage(SearchFilter searchFilter) {
if (searchFilter != null) {
List<Criterion> queryList = new ArrayList<Criterion>();
List<Criterion> queryList = new ArrayList<>();
//排序条件
List<Order> orderList = new ArrayList<Order>();
List<Order> orderList = new ArrayList<>();
//分页
Integer iDisplayStart = searchFilter.getiDisplayStart();
Integer iDisplayLength = searchFilter.getiDisplayLength();
//输入框过滤
String sSearch = searchFilter.getsSearch();
if (sSearch != null && sSearch.length() > 0) {
if (sSearch != null && !sSearch.isEmpty()) {
queryList.add(Restrictions.like("hardwareName", "%" + sSearch + "%"));
}
if (StringUtils.isNotBlank(searchFilter.getFactoryCode())) {
FactoryList factoryList = this.factoryListDao.get(searchFilter.getFactoryCode());
List<String> typeList = new ArrayList<>();
for (HardwareType hardwareType : factoryList.getHardwareTypeSet()) {
typeList.add(hardwareType.getHardwareType());
}
queryList.add(Restrictions.in("hardwareType", typeList.toArray()));
}
orderList.add(Order.asc("hardwareType"));
Pagination<HardwareType> page = this.hardwareTypeDao.findByCriteria(iDisplayStart, iDisplayLength, orderList, queryList.toArray(new Criterion[queryList.size()]));
return page;
@ -1227,21 +1293,272 @@ public class AdminServiceImpl implements AdminService {
}
@Override
public String saveHardwareType(HardwareType hardwareType) {
public String saveHardwareType(HardwareType hardwareType, String attr1, String attr2, String attr3) {
HardwareType tmp = this.hardwareTypeDao.findUniqueByProperty(Restrictions.eq("hardwareType", hardwareType.getHardwareType()));
if (tmp != null) {
return SysUserEnum.warn107.getKey();
} else {
hardwareType.setCreateTime(new Date());
hardwareType.setUpdateTime(new Date());
HardwareTypeAttri hardwareTypeAttri = new HardwareTypeAttri();
hardwareTypeAttri.setHardwareType(hardwareType.getHardwareType());
String[] attr1List = attr1.split(",");
for (String id : attr1List) {
if (id.equals("1")) {
hardwareTypeAttri.setSwitchS1(1);
}
if (id.equals("2")) {
hardwareTypeAttri.setSwitchS2(1);
}
if (id.equals("3")) {
hardwareTypeAttri.setSwitchS3(1);
}
if (id.equals("4")) {
hardwareTypeAttri.setSwitchS4(1);
}
if (id.equals("5")) {
hardwareTypeAttri.setSwitchS5(1);
}
if (id.equals("6")) {
hardwareTypeAttri.setSwitchS6(1);
}
if (id.equals("7")) {
hardwareTypeAttri.setSwitchS7(1);
}
if (id.equals("8")) {
hardwareTypeAttri.setSwitchS8(1);
}
if (id.equals("9")) {
hardwareTypeAttri.setSwitchS9(1);
}
if (id.equals("10")) {
hardwareTypeAttri.setSwitchS10(1);
}
if (id.equals("11")) {
hardwareTypeAttri.setSwitchS11(1);
}
if (id.equals("12")) {
hardwareTypeAttri.setSwitchS12(1);
}
}
String[] attr3List = attr3.split(",");
for (String id : attr3List) {
if (id.equals("13")) {
hardwareTypeAttri.setHeatingSet(1);
hardwareTypeAttri.setRefrigerationSet(1);
}
if (id.equals("25")) {
hardwareTypeAttri.setTemperature1(1);
}
if (id.equals("26")) {
hardwareTypeAttri.setTemperature2(1);
}
if (id.equals("27")) {
hardwareTypeAttri.setFeedfishSet(1);
}
if (id.equals("28")) {
hardwareTypeAttri.setChangeTemperSet1(1);
}
if (id.equals("29")) {
hardwareTypeAttri.setDelayedSet(1);
}
if (id.equals("30")) {
hardwareTypeAttri.setElectricityShow(1);
}
if (id.equals("31")) {
hardwareTypeAttri.setOnceFeedfishSet(1);
}
if (id.equals("32")) {
hardwareTypeAttri.setChangeTemperSet2(1);
}
if (id.equals("33")) {
hardwareTypeAttri.setNursingLight(1);
}
}
hardwareTypeAttriDao.save(hardwareTypeAttri);
this.hardwareTypeDao.save(hardwareType);
return SysUserEnum.success100.getKey();
}
}
@Override
public HardwareType updateHardwareType(HardwareType hardwareType) {
public HardwareTypeAttri getHardwareTypeAttri(String hardwareType) {
return hardwareTypeAttriDao.findUniqueByProperty(Restrictions.eq("hardwareType", hardwareType));
}
@Override
public FactoryVenderHardwareTypeAttri getFactoryVenderHardwareTypeAttri(String hardwareType, String venderCode) {
return factoryHardwareTypeAttrDao.findUniqueByProperty(Restrictions.eq("hardwareType", hardwareType), Restrictions.eq("venderCode", venderCode));
}
@Override
public HardwareType updateHardwareType(HardwareType hardwareType, String attr1, String attr2, String attr3) {
hardwareType.setUpdateTime(new Date());
HardwareTypeAttri hardwareTypeAttri = hardwareTypeAttriDao.findUniqueByProperty(Restrictions.eq("hardwareType", hardwareType.getHardwareType()));
if (hardwareTypeAttri == null) {
hardwareTypeAttri = new HardwareTypeAttri();
}
hardwareTypeAttri.setHardwareType(hardwareType.getHardwareType());
String[] attr1List = attr1.split(",");
List<String> attr1Arr = Arrays.asList(attr1List);
if (!attr1Arr.contains("1")) {
hardwareTypeAttri.setSwitchS1(0);
}
if (!attr1Arr.contains("2")) {
hardwareTypeAttri.setSwitchS2(0);
}
if (!attr1Arr.contains("3")) {
hardwareTypeAttri.setSwitchS3(0);
}
if (!attr1Arr.contains("4")) {
hardwareTypeAttri.setSwitchS4(0);
}
if (!attr1Arr.contains("5")) {
hardwareTypeAttri.setSwitchS5(0);
}
if (!attr1Arr.contains("6")) {
hardwareTypeAttri.setSwitchS6(0);
}
if (!attr1Arr.contains("7")) {
hardwareTypeAttri.setSwitchS7(0);
}
if (!attr1Arr.contains("8")) {
hardwareTypeAttri.setSwitchS8(0);
}
if (!attr1Arr.contains("9")) {
hardwareTypeAttri.setSwitchS9(0);
}
if (!attr1Arr.contains("10")) {
hardwareTypeAttri.setSwitchS10(0);
}
if (!attr1Arr.contains("11")) {
hardwareTypeAttri.setSwitchS11(0);
}
if (!attr1Arr.contains("12")) {
hardwareTypeAttri.setSwitchS12(0);
}
for (String id : attr1List) {
if (id.equals("1")) {
hardwareTypeAttri.setSwitchS1(1);
}
if (id.equals("2")) {
hardwareTypeAttri.setSwitchS2(1);
}
if (id.equals("3")) {
hardwareTypeAttri.setSwitchS3(1);
}
if (id.equals("4")) {
hardwareTypeAttri.setSwitchS4(1);
}
if (id.equals("5")) {
hardwareTypeAttri.setSwitchS5(1);
}
if (id.equals("6")) {
hardwareTypeAttri.setSwitchS6(1);
}
if (id.equals("7")) {
hardwareTypeAttri.setSwitchS7(1);
}
if (id.equals("8")) {
hardwareTypeAttri.setSwitchS8(1);
}
if (id.equals("9")) {
hardwareTypeAttri.setSwitchS9(1);
}
if (id.equals("10")) {
hardwareTypeAttri.setSwitchS10(1);
}
if (id.equals("11")) {
hardwareTypeAttri.setSwitchS11(1);
}
if (id.equals("12")) {
hardwareTypeAttri.setSwitchS12(1);
}
}
String[] attr3List = attr3.split(",");
List<String> attr3Arr = Arrays.asList(attr3List);
if (!attr3Arr.contains("13")) {
hardwareTypeAttri.setHeatingSet(0);
hardwareTypeAttri.setRefrigerationSet(0);
}
if (!attr3Arr.contains("25")) {
hardwareTypeAttri.setTemperature1(0);
}
if (!attr3Arr.contains("26")) {
hardwareTypeAttri.setTemperature2(0);
}
if (!attr3Arr.contains("27")) {
hardwareTypeAttri.setFeedfishSet(0);
}
if (!attr3Arr.contains("28")) {
hardwareTypeAttri.setChangeTemperSet1(0);
}
if (!attr3Arr.contains("29")) {
hardwareTypeAttri.setDelayedSet(0);
}
if (!attr3Arr.contains("30")) {
hardwareTypeAttri.setElectricityShow(0);
}
if (!attr3Arr.contains("31")) {
hardwareTypeAttri.setOnceFeedfishSet(0);
}
if (!attr3Arr.contains("32")) {
hardwareTypeAttri.setChangeTemperSet2(0);
}
if (!attr3Arr.contains("33")) {
hardwareTypeAttri.setNursingLight(0);
}
if (!attr3Arr.contains("34")) {
hardwareTypeAttri.setTemperatureShow1(0);
}
if (!attr3Arr.contains("35")) {
hardwareTypeAttri.setTemperatureShow2(0);
}
for (String id : attr3List) {
if (id.equals("13")) {
hardwareTypeAttri.setHeatingSet(1);
hardwareTypeAttri.setRefrigerationSet(1);
}
if (id.equals("25")) {
hardwareTypeAttri.setTemperature1(1);
hardwareTypeAttri.setHeatingSet(1);
}
if (id.equals("26")) {
hardwareTypeAttri.setTemperature2(1);
hardwareTypeAttri.setRefrigerationSet(1);
}
if (id.equals("27")) {
hardwareTypeAttri.setFeedfishSet(1);
}
if (id.equals("28")) {
hardwareTypeAttri.setChangeTemperSet1(1);
}
if (id.equals("29")) {
hardwareTypeAttri.setDelayedSet(1);
}
if (id.equals("30")) {
hardwareTypeAttri.setElectricityShow(1);
}
if (id.equals("31")) {
hardwareTypeAttri.setOnceFeedfishSet(1);
}
if (id.equals("32")) {
hardwareTypeAttri.setChangeTemperSet2(1);
}
if (id.equals("33")) {
hardwareTypeAttri.setNursingLight(1);
}
if (id.contains("34")) {
hardwareTypeAttri.setTemperatureShow1(1);
}
if (id.contains("35")) {
hardwareTypeAttri.setTemperatureShow2(1);
}
}
hardwareTypeAttriDao.save(hardwareTypeAttri);
return this.hardwareTypeDao.update(hardwareType);
}
@ -1496,6 +1813,11 @@ public class AdminServiceImpl implements AdminService {
return null;
}
@Override
public List<FactoryVenderData> getFactoryBrandList() {
return factoryListDao.getFactoryVenderList();
}
@Override
public void deleteFactory(String code) {
FactoryList factory = getFactoryByCode(code);
@ -1505,7 +1827,7 @@ public class AdminServiceImpl implements AdminService {
}
@Override
public String addFactory(FactoryList factoryList, String brandCodes, String hardwareTypes) {
public String addFactory(FactoryList factoryList, String brandCodes, String hardwareTypes, String imgName) {
String code = factoryList.getFactoryCode();
if (code != null) {
//编号是否存在
@ -1516,7 +1838,7 @@ public class AdminServiceImpl implements AdminService {
//新增电子厂
factoryList.setCreateTime(new Date());
//鱼缸厂
Set<VenderList> venderLists = new HashSet<VenderList>();
Set<VenderList> venderLists = new HashSet<>();
if (brandCodes != null && brandCodes.length() > 0) {
String[] brandCode = brandCodes.split(",");
for (int i = 0; i < brandCode.length; i++) {
@ -1535,6 +1857,7 @@ public class AdminServiceImpl implements AdminService {
}
factoryList.setHardwareTypeSet(hardwareTypeSet);
}
factoryList.setBackground(imgName);
this.factoryListDao.save(factoryList);
return SysUserEnum.success100.getKey();
}
@ -1542,6 +1865,24 @@ public class AdminServiceImpl implements AdminService {
return SysUserEnum.failed101.getKey();
}
@Override
public String addFactory1(String brandCodes, String hardwareTypes, String imgName) {
if (brandCodes != null && hardwareTypes != null) {
HardwareVender hardwareVender = new HardwareVender();
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
SecurityUser securityUser = getSysUserByUserName(userDetails.getUsername());
String code = securityUser.getCode();
hardwareVender.setFactoryCode(code);
hardwareVender.setVenderCode(brandCodes);
hardwareVender.setHardwareType(hardwareTypes);
hardwareVender.setBackground(imgName);
hardwareVender.setCreateTime(new Date());
hardwareVenderDao.save(hardwareVender);
return SysUserEnum.success100.getKey();
}
return SysUserEnum.failed101.getKey();
}
@Override
public String updateFactory(FactoryList factoryList, String brandCodes, String hardwareTypes) {
//鱼缸厂
@ -1583,6 +1924,9 @@ public class AdminServiceImpl implements AdminService {
if (sSearch != null && sSearch.length() > 0) {
queryList.add(Restrictions.like("factoryName", "%" + sSearch + "%"));
}
if (StringUtils.isNotBlank(searchFilter.getFactoryCode())) {
queryList.add(Restrictions.eq("factoryCode", searchFilter.getFactoryCode()));
}
//排序字段
String sortField = searchFilter.getSortField();
if (StringUtils.isNotBlank(sortField)) {
@ -3077,4 +3421,89 @@ public class AdminServiceImpl implements AdminService {
return false;
}
@Override
public void saveFactoryHardwareTypeAttr(FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttri) {
this.factoryHardwareTypeAttrDao.save(factoryVenderHardwareTypeAttri);
}
@Resource
HardwareVenderDao hardwareVenderDao;
@Override
public Pagination<HardwareVender> getHardwareVenderConfig(SearchFilter searchFilter) {
Integer iDisplayStart = searchFilter.getiDisplayStart();
Integer iDisplayLength = searchFilter.getiDisplayLength();
List<Order> orderList = new ArrayList<>();
orderList.add(Order.desc("createTime"));
Pagination<HardwareVender> hardwareVenderPagination = hardwareVenderDao.findByCriteria(iDisplayStart, iDisplayLength, orderList);
List<HardwareVender> list = hardwareVenderPagination.getList();
for (HardwareVender hardwareVender : list) {
hardwareVender.setVenderName(venderListDao.get(hardwareVender.getVenderCode()).getBrandName());
hardwareVender.setFactoryName(factoryListDao.get(hardwareVender.getFactoryCode()).getFactoryName());
hardwareVender.setHardwareName(hardwareTypeDao.get(hardwareVender.getHardwareType()).getHardwareName());
}
return hardwareVenderPagination;
}
@Override
public HardwareVender getHardwareVenderConfigById(Integer id) {
return hardwareVenderDao.get(id);
}
@Override
public void deleteHardwareVender(HardwareVender hardwareVender) {
hardwareVenderDao.delete(hardwareVender);
}
@Autowired
private FactoryService factoryService;
@Override
public boolean billGen(String billMonth) {
System.out.println("addPayBill begin ...");
List<FactoryList> factoryList = factoryService.getFactoryList();
for (FactoryList list : factoryList) {
PayBill payBill = new PayBill();
String factoryCode = list.getFactoryCode();
String isTax = list.getIsTax();
int number = factoryService.getDeviceCountByFactory(factoryCode, billMonth);
payBill.setFactoryList(list);
payBill.setIsTax(isTax);
payBill.setPayStatus("0");
payBill.setAuthorizeNumber(number);
PayBillId payBillId = new PayBillId();
payBillId.setBillMonth(billMonth);
payBillId.setFactoryCode(factoryCode);
payBill.setPayBillId(payBillId);
payBill.setPayDate(new Date());
payBill.setCreateTime(new Date());
//支付金额
Integer money = 0;
//数量小于1000,每个收费15元
if (number < 1000) {
money = number * 15;
} //数量1000~5000,每个收费12元
else if (number >= 1000 && number < 5000) {
money = number * 12;
} //数量5000~10000,每个收费10元
else if (number >= 5000 && number < 10000) {
money = number * 10;
} //数量大于10000,每个收费8元
else if (number >= 10000) {
money = number * 8;
}
//数量超过1000的且需要收税的每个收税一元
if (number >= 1000 && isTax.equals(BooleanEnum.YES.getKey())) {
payBill.setPayMoney(money + number);
} else {
payBill.setPayMoney(money);
}
if (number > 0) {
factoryService.savePayBill(payBill);
}
}
System.out.println("addPayBill end ...");
return true;
}
}

View File

@ -63,6 +63,13 @@ public class FactoryServiceImpl implements FactoryService {
return count;
}
@Override
public int getDeviceCountByFactory(String factoryCode, String billMonth) {
String year = billMonth.split("-")[0];
String month = billMonth.split("-")[1];
return this.deviceDao.getNumber("SELECT count(1) from tbl_device td where td.is_charge = '0' and is_blacklist = 0 and td.factory_code = '"+ factoryCode +"' and str_to_date(td.authorize_time,'%Y-%m')='" + year + "-" + month + "-00'");
}
@Override
public FactoryList get(String id) {
return this.factoryListDao.get(id);
@ -256,7 +263,7 @@ public class FactoryServiceImpl implements FactoryService {
//授权日期
String sSearch1 = searchFilter.getsSearch1();
if(sSearch1!=null && !sSearch1.equals("")){
queryList.add(Restrictions.sqlRestriction("'"+sSearch1+"'=date_format(create_time,'%Y-%m-%d')"));
queryList.add(Restrictions.sqlRestriction("'"+sSearch1+"'=date_format(authorize_time,'%Y-%m-%d')"));
}
if (hardwareTypeSet != null && hardwareTypeSet.size() != 0) {
@ -268,8 +275,6 @@ public class FactoryServiceImpl implements FactoryService {
queryList.add(Restrictions.eq("isBlacklist", selectField1));
}
String selectField2 = searchFilter.getSelectField2();
if(selectField2!=null && !selectField2.equals("")){
if ("1".equals(selectField2)) {

View File

@ -13,14 +13,8 @@
<intercept-url pattern="/page/public/changePwd.do" access="isAuthenticated()"/>
<intercept-url pattern="/page/public/savePwd.do" access="isAuthenticated()"/>
<!-- 允许所有人访问 -->
<intercept-url pattern="/page/public/**" access="permitAll"/>
<intercept-url pattern="/page/**" access="permitAll"/>
<intercept-url pattern="/page/test/test" access="permitAll"/>
<!-- 根据角色访问 -->
<intercept-url pattern="/ueditor/ueditor.jsp" access="hasAnyRole('ROLE_ADMIN')" />
<intercept-url pattern="/page/user/**" access="hasAnyRole('ROLE_USER')" />
<intercept-url pattern="/page/vender/**" access="hasAnyRole('ROLE_VENDER')" />
<intercept-url pattern="/page/factory/**" access="hasAnyRole('ROLE_FACTORY')" />
<intercept-url pattern="/page/**" access="hasAnyRole('ROLE_ADMIN')" />
<!-- 未认证页面跳转 -->
<access-denied-handler error-page="/page/public/login.do" />

View File

@ -3,7 +3,7 @@
<!-- basic styles -->
<%-- <link href="<%=basePath %>static/css/bootstrap.min.css" rel="stylesheet" /> --%>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="<%=basePath %>static/yun/bootstrap.min.css">
<link href="<%=basePath %>static/css/font-awesome.min.css" rel="stylesheet" />
<!-- ace styles -->
<link href="<%=basePath %>static/css/ace.min.css" rel="stylesheet" />
@ -14,8 +14,8 @@
<!-- basic scripts -->
<%-- <script src="<%=basePath %>static/js/jquery-2.0.3.min.js"></script> --%>
<%-- <script src="<%=basePath %>static/js/bootstrap.min.js"></script> --%>
<script src="//cdn.bootcss.com/jquery/2.0.3/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="<%=basePath %>static/yun/jquery.min.js"></script>
<script src="<%=basePath %>static/yun/bootstrap.min.js"></script>
<!-- ace scripts -->
<script src="<%=basePath %>static/js/ace-elements.min.js"></script>
<script src="<%=basePath %>static/js/ace.min.js"></script>
@ -31,4 +31,4 @@
<script src="<%=basePath%>static/js/dataTableModule.js"></script>
<link href="<%=basePath%>static/validate/bootstrapValidator.min.css" rel="stylesheet"/>
<script src="<%=basePath%>static/validate/bootstrapValidator.min.js"></script>
<script src="<%=basePath%>static/validate/zh_CN.js"></script>
<script src="<%=basePath%>static/validate/zh_CN.js"></script>

View File

@ -4,7 +4,7 @@
String basePath = "";
String picturePath = "";
String IMPath = "";
//本地环境
//本地环境
if (IfishFileDirectory.env.equals("local")) {
basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
picturePath = request.getScheme() + "://" + request.getServerName() + ":81/";

View File

@ -119,6 +119,12 @@
<input type="hidden" name="hardwareTypes" id="hardwareTypes"/>
</div>
</div>
<%-- <div class="form-group">--%>
<%-- <label class="col-xs-3 control-label no-padding-right">背景图<span style="color:red;">*</span></label>--%>
<%-- <div class="col-xs-7">--%>
<%-- <input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control" required/>--%>
<%-- </div>--%>
<%-- </div>--%>
<div class="clearfix form-actions">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-info" type="submit" id="submitBtn"><i class="icon-ok bigger-110"></i>提交</button>&nbsp;&nbsp;&nbsp;&nbsp;

View File

@ -0,0 +1,127 @@
<%@page import="com.ifish.enums.SysUserEnum"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<title>新增鱼缸厂配置</title>
<!-- css and js -->
<%@ include file="../htm/script.jsp" %>
<script type="text/javascript">
$(function(){
//取消
$("#cancelBtn").click(function(){
location.href="<%=basePath%>page/admin/factoryList1.do";
});
$(".venderListCheckbox").change(function(){
var checkboxs = $(".venderListCheckbox");
var brandCodes = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
brandCodes.push($(checkboxs[i]).val());
}
}
$("#brandCodes").val(brandCodes);
});
$(".hardwareTypeCheckbox").change(function(){
var checkboxs = $(".hardwareTypeCheckbox");
var hardwareTypes = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
hardwareTypes.push($(checkboxs[i]).val());
}
}
$("#hardwareTypes").val(hardwareTypes);
});
});
</script>
</head>
<body>
<!-- 头部 -->
<%@ include file="../htm/header.jsp" %>
<!-- 主体 -->
<div class="main-container" id="main-container">
<div class="main-container-inner">
<!-- 侧边栏 -->
<%@ include file="../htm/sidebar.jsp" %>
<!-- 主体内容 -->
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
</script>
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="<%=basePath%>page/public/index.do">首页</a>
</li>
<li>
<a href="<%=basePath%>page/admin/venderList.do">鱼缸厂列表</a>
</li>
</ul>
</div>
<div class="page-content">
<c:set var="failed101" value="<%=SysUserEnum.failed101.getKey()%>"></c:set>
<c:set var="warn106" value="<%=SysUserEnum.warn106.getKey()%>"></c:set>
<c:set var="warn107" value="<%=SysUserEnum.warn107.getKey()%>"></c:set>
<c:if test="${status == warn106}">
<div class="alert alert-block alert-warning">
<i class="icon-ok green"><%=SysUserEnum.warn106.getValue()%></i>
</div>
</c:if>
<c:if test="${status == warn107}">
<div class="alert alert-block alert-warning">
<i class="icon-ok green"><%=SysUserEnum.warn107.getValue()%></i>
</div>
</c:if>
<c:if test="${status == failed101}">
<div class="alert alert-block alert-danger">
<i class="icon-remove red">保存<%=SysUserEnum.failed101.getValue()%></i>
</div>
</c:if>
<h4 class="header smaller lighter blue"></h4>
<div class="row">
<div class="col-xs-12">
<form id="form-add" method="post" class="form-horizontal" action="<%=basePath%>page/admin/saveFactory1.do" enctype="multipart/form-data">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">鱼缸厂<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${venderList }" var="vender">
<label><input type="radio" name="brandCodes" class="venderListCheckbox" value="${vender.brandCode }"/>${vender.brandName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
</div>
</div>
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">硬件类型<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${hardwareType }" var="hardware">
<label><input type="radio" name="hardwareTypes" class="hardwareTypeCheckbox" value="${hardware.hardwareType }"/>${hardware.hardwareName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">背景图<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control" required/>
</div>
</div>
<div class="clearfix form-actions">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-info" type="submit" id="submitBtn"><i class="icon-ok bigger-110"></i>提交</button>&nbsp;&nbsp;&nbsp;&nbsp;
<button class="btn" type="button" id="cancelBtn"><i class="icon-undo bigger-110"></i>取消</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- 设置工具 -->
<%@ include file="../htm/setting.jsp" %>
</div>
</div>
</body>
</html>

View File

@ -30,6 +30,30 @@
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
$(function(){
$(".attr1Checkbox").change(function(){
var checkboxs = $(".attr1Checkbox");
var attr1 = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
attr1.push($(checkboxs[i]).val());
}
}
$("#attr1").val(attr1);
});
$(".attr3Checkbox").change(function(){
var checkboxs = $(".attr3Checkbox");
var attr3 = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
attr3.push($(checkboxs[i]).val());
}
}
$("#attr3").val(attr3);
});
$(".attr1Checkbox").change();
$(".attr3Checkbox").change();
});
</script>
<ul class="breadcrumb">
<li>
@ -117,33 +141,21 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">图标根地址<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="url" name="iconLink" id="iconLink" value="${hardwareType.iconLink }" class="form-control" maxlength="100"/>
<label class="col-sm-3 control-label no-padding-right">设备属性1<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${list1 }" var="checkNames">
<label><input type="checkbox" class="attr1Checkbox" value="${checkNames.showValue }" ${checkNames.checked==true?"checked":""}/>${checkNames.showName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
<input type="hidden" name="attr1" id="attr1"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">选择的图标<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="allIconName" id="allIconName" value="${hardwareType.allIconName }" class="form-control" maxlength="200"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">对应的名称<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="allShowName" id="allShowName" value="${hardwareType.allShowName }" class="form-control" maxlength="200"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">默认图标<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="defaultIconName" id="defaultIconName" value="${hardwareType.defaultIconName }" class="form-control" maxlength="100"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">默认名称<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="defaultShowName" id="defaultShowName" value="${hardwareType.defaultShowName }" class="form-control" maxlength="100"/>
<label class="col-sm-3 control-label no-padding-right">设备属性2<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${list3 }" var="checkNames">
<label><input type="checkbox" class="attr3Checkbox" value="${checkNames.showValue }" ${checkNames.checked==true?"checked":""}/>${checkNames.showName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
<input type="hidden" name="attr3" id="attr3"/>
</div>
</div>
<div class="space-4"></div>

View File

@ -169,6 +169,15 @@
</div>
</div>
<div class="space-4"></div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">背景图<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="hidden" name="background" id="background" value="${venderList.background}"/>
<img id="backgroud" src="<%=picturePath%>Img/goods/${venderList.background}"/>
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control"/>
</div>
</div>
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">联系电话</label>
<div class="col-sm-4">

View File

@ -122,6 +122,13 @@
<input type="hidden" name="hardwareTypes" id="hardwareTypes"/>
</div>
</div>
<%--<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">背景图<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="hidden" name="background" id="background" value="${factoryList.background}"/>
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control"/>
</div>
</div>--%>
<div class="clearfix form-actions">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-info" type="submit" id="submitBtn"><i class="icon-ok bigger-110"></i>提交</button>&nbsp;&nbsp;&nbsp;&nbsp;

View File

@ -0,0 +1,135 @@
<%@page import="com.ifish.enums.SysUserEnum"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<title>编辑鱼缸厂配置</title>
<!-- css and js -->
<%@ include file="../htm/script.jsp" %>
<script type="text/javascript">
$(function(){
//取消
$("#cancelBtn").click(function(){
location.href="<%=basePath%>page/admin/factoryList1.do";
});
//提交
$(".venderListCheckbox").change(function(){
var checkboxs = $(".venderListCheckbox");
var brandCodes = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
brandCodes.push($(checkboxs[i]).val());
}
}
$("#brandCodes").val(brandCodes);
});
$(".hardwareTypeCheckbox").change(function(){
var checkboxs = $(".hardwareTypeCheckbox");
var hardwareTypes = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
hardwareTypes.push($(checkboxs[i]).val());
}
}
$("#hardwareTypes").val(hardwareTypes);
});
$(".venderListCheckbox").change();
$(".hardwareTypeCheckbox").change();
});
</script>
</head>
<body>
<!-- 头部 -->
<%@ include file="../htm/header.jsp" %>
<!-- 主体 -->
<div class="main-container" id="main-container">
<div class="main-container-inner">
<!-- 侧边栏 -->
<%@ include file="../htm/sidebar.jsp" %>
<!-- 主体内容 -->
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
</script>
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="<%=basePath%>page/public/index.do">首页</a>
</li>
<li>
<a href="<%=basePath%>page/admin/venderList.do">电子厂列表</a>
</li>
<li class="active">电子厂维护</li>
</ul>
</div>
<div class="page-content">
<c:set var="failed101" value="<%=SysUserEnum.failed101.getKey()%>"></c:set>
<c:set var="warn106" value="<%=SysUserEnum.warn106.getKey()%>"></c:set>
<c:set var="warn107" value="<%=SysUserEnum.warn107.getKey()%>"></c:set>
<c:if test="${status == warn106}">
<div class="alert alert-block alert-warning">
<i class="icon-ok green"><%=SysUserEnum.warn106.getValue()%></i>
</div>
</c:if>
<c:if test="${status == warn107}">
<div class="alert alert-block alert-warning">
<i class="icon-ok green"><%=SysUserEnum.warn107.getValue()%></i>
</div>
</c:if>
<c:if test="${status == failed101}">
<div class="alert alert-block alert-danger">
<i class="icon-remove red">保存<%=SysUserEnum.failed101.getValue()%></i>
</div>
</c:if>
<h4 class="header smaller lighter blue"></h4>
<div class="row">
<div class="col-xs-12">
<form id="form-add" method="post" class="form-horizontal" action="<%=basePath%>page/admin/updateFactory1.do" method="post" enctype="multipart/form-data">
<input type="hidden" name="id" value="${hardwareVender.id}"/>
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">鱼缸厂<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${brandCodeMap }" var="checkNames">
<label><input type="radio" name="brandCodes" class="venderListCheckbox" value="${checkNames.value.showValue }" ${checkNames.value.checked==true?"checked":""}/>${checkNames.value.showName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
</div>
</div>
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">硬件类型<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${hardwareTypeMap }" var="checkNames">
<label><input type="radio" name="hardwareTypes" class="hardwareTypeCheckbox" value="${checkNames.value.showValue }" ${checkNames.value.checked==true?"checked":""}/>${checkNames.value.showName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">背景图<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="hidden" name="background" id="background" value="${hardwareVender.background}"/>
<img id="avatar" src="<%=picturePath%>Img/goods/${hardwareVender.background}"/>
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control"/>
</div>
</div>
<div class="clearfix form-actions">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-info" type="submit" id="submitBtn"><i class="icon-ok bigger-110"></i>提交</button>&nbsp;&nbsp;&nbsp;&nbsp;
<button class="btn" type="button" id="cancelBtn"><i class="icon-undo bigger-110"></i>取消</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- 设置工具 -->
<%@ include file="../htm/setting.jsp" %>
</div>
</div>
</body>
</html>

View File

@ -13,6 +13,30 @@
$("#cancelBtn").click(function(){
location.href="<%=basePath%>page/admin/hardwareTypeList.do";
});
$(function(){
$(".attr1Checkbox").change(function(){
var checkboxs = $(".attr1Checkbox");
var attr1 = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
attr1.push($(checkboxs[i]).val());
}
}
$("#attr1").val(attr1);
});
$(".attr3Checkbox").change(function(){
var checkboxs = $(".attr3Checkbox");
var attr3 = new Array();
for (var i = 0; i < checkboxs.length; i++) {
if(checkboxs[i].checked){
attr3.push($(checkboxs[i]).val());
}
}
$("#attr3").val(attr3);
});
$(".attr1Checkbox").change();
$(".attr3Checkbox").change();
});
});
</script>
</head>
@ -117,33 +141,21 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">图标根地址<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="url" name="iconLink" id="iconLink" value="${hardwareType.iconLink }" class="form-control" maxlength="100"/>
<label class="col-sm-3 control-label no-padding-right">设备属性1<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${list1 }" var="checkNames">
<label><input type="checkbox" class="attr1Checkbox" value="${checkNames.showValue }" ${checkNames.checked==true?"checked":""}/>${checkNames.showName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
<input type="hidden" name="attr1" id="attr1"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">选择的图标<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="allIconName" id="allIconName" value="${hardwareType.allIconName }" class="form-control" maxlength="200"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">对应的名称<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="allShowName" id="allShowName" value="${hardwareType.allShowName }" class="form-control" maxlength="200"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">默认图标<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="defaultIconName" id="defaultIconName" value="${hardwareType.defaultIconName }" class="form-control" maxlength="100"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">默认名称<span style="color:red;"></span></label>
<div class="col-sm-4">
<input type="text" name="defaultShowName" id="defaultShowName" value="${hardwareType.defaultShowName }" class="form-control" maxlength="100"/>
<label class="col-sm-3 control-label no-padding-right">设备属2<span style="color:red;">*</span></label>
<div class="col-sm-9">
<c:forEach items="${list3 }" var="checkNames">
<label><input type="checkbox" class="attr3Checkbox" value="${checkNames.showValue }" ${checkNames.checked==true?"checked":""}/>${checkNames.showName }</label>&nbsp;&nbsp;&nbsp;&nbsp;
</c:forEach>
<input type="hidden" name="attr3" id="attr3"/>
</div>
</div>
<div class="space-4"></div>

View File

@ -0,0 +1,311 @@
<%@page import="com.ifish.enums.SysUserEnum"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<title>硬件版本信息</title>
<!-- css and js -->
<%@ include file="../htm/script.jsp" %>
<script type="text/javascript">
$(function(){
//取消
$("#cancelBtn").click(function(){
location.href="<%=basePath%>page/admin/factoryList1.do";
});
});
</script>
</head>
<body>
<!-- 头部 -->
<%@ include file="../htm/header.jsp" %>
<!-- 主体 -->
<div class="main-container" id="main-container">
<div class="main-container-inner">
<!-- 侧边栏 -->
<%@ include file="../htm/sidebar.jsp" %>
<!-- 主体内容 -->
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
</script>
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="<%=basePath%>page/public/index.do">首页</a>
</li>
<li>
<a href="<%=basePath%>page/admin/hardwareTypeList.do">硬件类型信息</a>
</li>
<li class="active">硬件类型名称设置</li>
</ul>
</div>
<div class="page-content">
<c:set var="warn107" value="<%=SysUserEnum.warn107.getKey()%>"></c:set>
<c:if test="${status == warn107}">
<div class="alert alert-block alert-warning">
<i class="icon-ok green"><%=SysUserEnum.warn107.getValue()%></i>
</div>
</c:if>
<h4 class="header smaller lighter blue"></h4>
<div class="row">
<div class="col-xs-12">
<form id="form-add" enctype="multipart/form-data" method="post" class="form-horizontal" action="<%=basePath%>page/admin/updateFactoryHardwareTypeAttr.do">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">类型编号<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="hardwareType" id="hardwareType" value="${hardwareTypeAttr.hardwareType }" ${hardwareTypeAttr.hardwareType!=null?'readonly="readonly"':'' } class="form-control" maxlength="10"/>
</div>
</div><div class="form-group">
<label class="col-sm-3 control-label no-padding-right">鱼缸厂编号<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="venderCode" id="venderCode" value="${hardwareTypeAttr.venderCode }" ${hardwareTypeAttr.venderCode!=null?'readonly="readonly"':'' } class="form-control" maxlength="10"/>
</div>
</div>
<c:if test="${hardwareTypeAttrSwitch.switchS1 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关1<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS1" id="switchS1" value="${hardwareTypeAttr.switchS1 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS2 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关2<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS2" id="switchS2" value="${hardwareTypeAttr.switchS2 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS3 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关3<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS3" id="switchS3" value="${hardwareTypeAttr.switchS3 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS4 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关4<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS4" id="switchS4" value="${hardwareTypeAttr.switchS4 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS5 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关5<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS5" id="switchS5" value="${hardwareTypeAttr.switchS5 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS6 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关6<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS6" id="switchS6" value="${hardwareTypeAttr.switchS6 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS7 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关7<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS7" id="switchS7" value="${hardwareTypeAttr.switchS7 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS8 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关8<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS8" id="switchS8" value="${hardwareTypeAttr.switchS8 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS9 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关9<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS9" id="switchS9" value="${hardwareTypeAttr.switchS9 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS10 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关10<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS10" id="switchS10" value="${hardwareTypeAttr.switchS10 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS11 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关11<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS11" id="switchS11" value="${hardwareTypeAttr.switchS11 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS12 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关12<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="text" name="switchS12" id="switchS12" value="${hardwareTypeAttr.switchS12 }" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS1 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关1图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar1" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS1Ico1}"/><br/>
<input type="file" name="fileUpload1" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS2 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关2图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar2" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS2Ico2}"/><br/>
<input type="file" name="fileUpload2" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS3 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关3图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar3" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS3Ico3}"/><br/>
<input type="file" name="fileUpload3" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS4 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关4图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar4" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS4Ico4}"/><br/>
<input type="file" name="fileUpload4" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS5 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关5图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar5" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS5Ico5}"/><br/>
<input type="file" name="fileUpload5" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS6 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关6图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar6" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS6Ico6}"/><br/>
<input type="file" name="fileUpload6" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS7 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关7图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar7" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS7Ico7}"/><br/>
<input type="file" name="fileUpload7" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS8 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关8图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar8" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS8Ico8}"/><br/>
<input type="file" name="fileUpload8" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS9 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关9图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar9" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS9Ico9}"/><br/>
<input type="file" name="fileUpload9" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS10 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关10图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar10" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS10Ico10}"/><br/>
<input type="file" name="fileUpload10" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS11 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关11图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar11" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS11Ico11}"/><br/>
<input type="file" name="fileUpload11" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<c:if test="${hardwareTypeAttrSwitch.switchS12 == 1}">
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">开关12图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<img id="avatar12" src="<%=picturePath%>Img/goods/${hardwareTypeAttr.switchS12Ico12}"/><br/>
<input type="file" name="fileUpload12" accept="image/png,image/jpg,image/jpeg" class="form-control" />
</div>
</div>
</c:if>
<div class="clearfix form-actions">
<div class="col-md-offset-3 col-md-9">
<button class="btn btn-info" type="submit" id="submitBtn"><i class="icon-ok bigger-110"></i>提交</button>&nbsp;&nbsp;&nbsp;&nbsp;
<button class="btn" type="button" id="cancelBtn"><i class="icon-undo bigger-110"></i>取消</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- 设置工具 -->
<%@ include file="../htm/setting.jsp" %>
</div>
</div>
</body>
</html>

View File

@ -159,6 +159,15 @@
</div>
</div>
<div class="space-4"></div>
<div class="form-group">
<label class="col-xs-3 control-label no-padding-right">背景图<span style="color:red;">*</span></label>
<div class="col-xs-7">
<input type="hidden" name="background" id="background" value="${venderList.background}"/>
<img id="backgroud" src="<%=picturePath%>Img/goods/${venderList.background}"/>
<input type="file" name="fileUpload" accept="image/png,image/jpg,image/jpeg" class="form-control"/>
</div>
</div>
<div class="space-4"></div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">联系电话</label>
<div class="col-sm-4">

View File

@ -0,0 +1,139 @@
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<title>鱼缸厂配置</title>
<!-- css and js -->
<%@ include file="../htm/script.jsp" %>
<script type="text/javascript">
$(function(){
//分页
var dataTable = $('#sample-table-2').dataTable({
"sPaginationType": "bootstrap",
//"bProcessing": true,
"bServerSide": true,//指定从服务器端获取数据
"sAjaxSource": "<%=basePath%>page/admin/factoryListInf1.do",
"fnServerData": function(sSource, aoData, fnCallback){
$.ajax({
"dataType": "json",
"type": "POST",
"url": sSource,
"data": aoData,
"cache": false,
"success": function(json){
fnCallback(json);
}
});
},
"aoColumns": [
{ "mData": "id","bSortable": false },
{ "mData": "venderCode","bSortable": false },
{ "mData": "venderName","bSortable": false },
{ "mData": "hardwareType","bSortable": false },
{ "mData": "hardwareName","bSortable": false },
{ "mData": "createTime","bSortable": false },
{ "mData": function(factory){
return '<a href="<%=basePath%>page/admin/doUpdateHardwareAttr.do?hardwareType='+factory.hardwareType+'&venderCode='+ factory.venderCode +'" title="设置名称" class="label label-primary"><span class="icon-edit align-top"></span></a>'
},
"bSortable": false,
"sClass":"center"
},
{ "mData": function(factory){
var detail = '<a href="<%=basePath%>page/admin/editFactory1.do?id='+factory.id+'" title="修改" class="label label-primary"><span class="icon-edit"></span></a> ';
var remove = '<a href="javascript:void(0);" onclick=deleteFactory("'+factory.id+'") title="删除" class="label label-danger"><span class="icon-trash"></span></a>';
return detail+remove;
},
"bSortable": false,
"sClass":"center"
}
],
"oLanguage": {
"sLengthMenu": "每页显示 _MENU_条",
"sZeroRecords": "没有找到符合条件的数据",
"sInfo": "当前第 _START_ - _END_ 条 共计 _TOTAL_ 条",
"sProcessing": "<img src='<%=basePath%>static/css/images/loading.gif'>",
"sInfoEmpty": "木有记录",
"sInfoFiltered": "(从 _MAX_ 条记录中过滤)",
"sSearch": "搜索名称:",
"oPaginate": {
"sFirst": "首页",
"sPrevious": "前一页",
"sNext": "后一页",
"sLast": "尾页"
}
}
});
$("#sample-table-2_length").append('&nbsp;&nbsp;&nbsp;&nbsp;<label><a href="<%=basePath%>page/admin/addFactory1.do" class="btn btn-xs btn-primary"><i class="icon-edit"></i><span class="no-text-shadow">新增</span></a></label>');
$("table th input:checkbox").on("click" , function(){
var that = this;
$(this).closest('table').find('tr > td:first-child input:checkbox').each(function(){
this.checked = that.checked;
$(this).closest('tr').toggleClass('selected');
});
});
});
function deleteFactory(id){
var r = confirm("确定要删除吗?");
if (r == true) {
location.href="<%=basePath%>page/admin/deleteFactory1.do?id="+id;
}
}
</script>
</head>
<body>
<!-- 头部 -->
<%@ include file="../htm/header.jsp" %>
<!-- 主体 -->
<div class="main-container" id="main-container">
<div class="main-container-inner">
<!-- 侧边栏 -->
<%@ include file="../htm/sidebar.jsp" %>
<!-- 主体内容 -->
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
</script>
<ul class="breadcrumb">
<li>
<i class="icon-home home-icon"></i>
<a href="<%=basePath%>page/public/index.do">首页</a>
</li>
<li class="active">鱼缸厂设备配置</li>
</ul>
</div>
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<div class="table-header"></div>
<div class="table-responsive">
<table id="sample-table-2" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>编号</th>
<th>鱼缸厂编号</th>
<th>鱼缸厂名称</th>
<th>硬件类型编号</th>
<th>硬件类型名称</th>
<th>创建时间</th>
<th class="center">设置名称</th>
<th class="center">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- 设置工具 -->
<%@ include file="../htm/setting.jsp" %>
</div>
</div>
</body>
</html>

View File

@ -65,15 +65,6 @@
"bSortable": false,
"sClass":"center"
},
{ "mData": "iconLink","bSortable": false },
{ "mData": function(hardwareType){
return '<p style="word-break:break-all;">'+hardwareType.allIconName+'</p>';
},
"bSortable": false
},
{ "mData": "allShowName","bSortable": false },
{ "mData": "defaultIconName","bSortable": false },
{ "mData": "defaultShowName","bSortable": false },
{ "mData": function(hardwareType){
return '<a href="<%=basePath%>page/admin/editHardwareType.do?hardwareType='+hardwareType.hardwareType+'" title="修改" class="label label-primary"><span class="icon-edit align-top"></span></a>'
},
@ -162,11 +153,6 @@
<th>背光</th>
<th>柜灯</th>
<th>图标</th>
<th>图标根地址</th>
<th>选择的图标</th>
<th>对应的名称</th>
<th>默认图标</th>
<th>默认名称</th>
<th class="center">修改</th>
<th class="center">删除</th>
</tr>

View File

@ -73,6 +73,28 @@
jAlert('绑定失败或出错啦!', '提示');
}
$("#bindDeviceModalBtn").attr("disabled",false);
});
//绑定设备
$("#bindPetDeviceBtn").click(function(){
$("#bindPetDeviceModal").modal("show");
});
$("#bindPetDeviceModalBtn").click(function(){
if($("#petMacAddress").val()==""){
jAlert("设备Mac不能为空", '提示');
return false;
}
$("#bindPetDeviceModalBtn").attr("disabled",true);
$('#form-bindPetDevice').submit();
});
$('#form-bindPetDevice').ajaxForm(function(data){
if(data==true){
location.reload();
jAlert('绑定成功', '提示');
}
else{
jAlert('绑定失败或出错啦!', '提示');
}
$("#bindPetDeviceModalBtn").attr("disabled",false);
});
//绑定摄像头
$("#bindCameraBtn").click(function(){
@ -125,10 +147,14 @@
dataTable.fnPageChange(--pageNum,true);
}
//解除绑定
function unbind(userId,deviceId){
function unbind(userId,deviceId,isdevice){
var r = confirm("确定要解除绑定吗?");
if (r == true) {
location.href="<%=basePath%>page/admin/unbind.do?priId.userId="+userId+"&priId.deviceId="+deviceId;
if (isdevice) {
location.href="<%=basePath%>page/admin/unbind.do?priId.userId="+userId+"&priId.deviceId="+deviceId;
} else {
location.href="<%=basePath%>page/admin/unbindPet.do?priId.userId="+userId+"&priId.deviceId="+deviceId;
}
}
}
//授权
@ -284,6 +310,64 @@
</c:forEach>
</tbody>
</table>
<h4 class="header smaller lighter blue">拥有宠物笼&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn btn-xs btn-primary" id="bindPetDeviceBtn"><i class="icon-edit"></i>新增</button></h4>
<table class="table table-striped table-bordered table-hover">
<col>
<thead>
<tr>
<th class="center">ID</th>
<th>硬件mac</th>
<th>方案名称</th>
<th>厂家名称</th>
<th>连接次数</th>
<th>最后一次登陆时间</th>
<th>显示名称</th>
<th>是否主控</th>
<th>绑定时间</th>
<th>首次激活时间</th>
<th>出厂时间</th>
<th>授权</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach items="${devicePetUserList}" var="deviceUser">
<tr>
<td class="center">${deviceUser.priId.deviceId}</td>
<td>${deviceUser.device.macAddress}</td>
<c:if test="${deviceUser.device.hardwareType==null }">
<td><p style="color:red">...</p></td>
</c:if>
<c:if test="${deviceUser.device.hardwareType!=null }">
<td>${deviceUser.device.hardwareType.hardwareName}</td>
</c:if>
<td>${deviceUser.device.venderList.brandName}</td>
<td>${deviceUser.device.loginCount}</td>
<td>${deviceUser.device.loginTime}</td>
<td>${deviceUser.storeName}<br/>${deviceUser.showName}</td>
<td>${deviceUser.isMaster==0?"<span class='badge label-success'>是</span>":"<span class='badge label-danger'>否</span>"}</td>
<td>${deviceUser.createTime}</td>
<td>${deviceUser.device.firstActivate}</td>
<td>${deviceUser.device.createTime}</td>
<td>${deviceUser.device.isBlacklist==1?"<span class='badge label-danger'>NO</span>":"<span class='badge label-success'>OK</span>"}</td>
<td class="center">
<a href="javascript:void(0);" onclick="unbind('${deviceUser.user.userId}','${deviceUser.device.deviceId}')" class="btn btn-xs btn-danger"><i class="icon-remove">解除绑定</i></a>
<c:if test="${deviceUser.device.isBlacklist==1}">
<a href="javascript:void(0);" onclick="deviceLicense('${deviceUser.user.userId}','${deviceUser.device.deviceId}','0')" class="btn btn-xs btn-primary"><i class="icon-ok">授予权限</i></a>
</c:if>
<c:if test="${deviceUser.device.isBlacklist==0}">
<c:if test="${deviceUser.device.isCharge==1}">
<a href="javascript:void(0);" title="[禁用]" class="btn btn-xs btn-default"><i class="icon-remove">取消授权</i></a>
</c:if>
<c:if test="${deviceUser.device.isCharge==0}">
<a href="javascript:void(0);" onclick="deviceLicense('${deviceUser.user.userId}','${deviceUser.device.deviceId}','1')" class="btn btn-xs btn-danger"><i class="icon-remove">取消授权</i></a>
</c:if>
</c:if>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="space"></div>
<h4 class="header smaller lighter blue">拥有摄像头&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn btn-xs btn-primary" id="bindCameraBtn"><i class="icon-edit"></i>新增</button></h4>
<table class="table table-striped table-bordered table-hover">
@ -380,6 +464,40 @@
</div>
</div>
</form>
<form action="<%=basePath%>page/admin/bindPetDevice.do" class="form-horizontal" method="post" id="form-bindPetDevice">
<div class="modal fade" id="bindPetDeviceModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closeBtn close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">绑定设备</h4>
</div>
<div class="modal-body row">
<div class="col-xs-12">
<div class="form-group">
<label class="col-xs-2 control-label no-padding-right">用户ID<span style="color:red;">*</span></label>
<div class="col-xs-8">
<input type="number" name="userId" value="${user.userId}" readonly="readonly" class="input-medium" required="required">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label no-padding-right">设备Mac<span style="color:red;">*</span></label>
<div class="col-xs-8">
<input type="text" id="petMacAddress" name="macAddress" class="input-medium" required="required" maxlength="20">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="closeBtn btn btn-default">关闭</button>
<button id="bindPetDeviceModalBtn" type="submit" class="btn btn-primary">确定</button>
</div>
</div>
</div>
</div>
</form>
<form action="<%=basePath%>page/admin/bindCamera.do" class="form-horizontal" method="post" id="form-bindCamera">
<div class="modal fade" id="bindCameraModal">
<div class="modal-dialog">

View File

@ -5,6 +5,8 @@
<title>鱼缸厂列表</title>
<!-- css and js -->
<%@ include file="../htm/script.jsp" %>
<link href="<%=basePath%>static/css/datepicker.css" rel="stylesheet"/>
<script src="<%=basePath%>static/js/date-time/bootstrap-datepicker.min.js"></script>
<script type="text/javascript">
$(function(){
@ -54,6 +56,11 @@
},
{ "mData": "contactPhone","bSortable": false },
{ "mData": "contactAddress","bSortable": false },
{ "mData": function (vender) {
return '<img src="<%=picturePath%>Img/goods/' + vender.background + '" width="50%"/>';
},
"bSortable": false
},
{ "mData": "createTime","bSortable": false },
{ "mData": function(vender){
return '<a href="<%=basePath%>page/admin/editVender.do?brandCode='+vender.brandCode+'" title="修改" class="label label-primary"><span class="icon-edit"></span></a>'
@ -164,6 +171,7 @@
<th>APP展示</th>
<th>联系电话</th>
<th>联系地址</th>
<th>背景</th>
<th>创建时间</th>
<th class="center">修改</th>
<th class="center">删除</th>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long