新增页面

This commit is contained in:
yan.y 2025-06-04 16:27:59 +08:00
parent 28781bfe79
commit 00a3e75e93
20 changed files with 1470 additions and 98 deletions

View File

@ -1,5 +1,6 @@
package com.ifish.action;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
@ -8,6 +9,9 @@ import java.util.List;
import java.util.Map;
import com.ifish.entity.*;
import com.ifish.util.IfishFileDirectory;
import com.ifish.util.IfishFileUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -15,6 +19,7 @@ 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;
@ -38,9 +43,9 @@ import com.ifish.webService.MyService;
import com.ifish.webService.MyServiceService;
/**
* @author ggw
* @ClassName: AdminAction
* @Description: 管理员页面
* @author ggw
*/
@Controller("adminAction")
@RequestMapping("/admin")
@ -908,7 +913,32 @@ 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("25", "加热模式温度设置", false));
deviceAttr3List.add(new CheckNames("26", "制冷模式温度设置", false));
deviceAttr3List.add(new CheckNames("27", "喂鱼设置", false));
deviceAttr3List.add(new CheckNames("28", "温度矫正设置-两个", false));
deviceAttr3List.add(new CheckNames("29", "延时启动时间设置", false));
deviceAttr3List.add(new CheckNames("30", "电量显示", false));
deviceAttr3List.add(new CheckNames("31", "一键喂鱼按键", false));
Map<String, Object> modelData = new HashMap<>();
modelData.put("list1", deviceAttr1List);
modelData.put("list3", deviceAttr3List);
return new ModelAndView("roleAdmin/addHardwareType", modelData);
}
/**
@ -917,9 +947,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);
@ -938,25 +968,196 @@ 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);
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("25", "加热模式温度设置", false));
deviceAttr3List.add(new CheckNames("26", "制冷模式温度设置", false));
deviceAttr3List.add(new CheckNames("27", "喂鱼设置", false));
deviceAttr3List.add(new CheckNames("28", "温度矫正设置-两个", false));
deviceAttr3List.add(new CheckNames("29", "延时启动时间设置", false));
deviceAttr3List.add(new CheckNames("30", "电量显示", false));
deviceAttr3List.add(new CheckNames("31", "一键喂鱼按键", false));
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");
}
/**
* 更新硬件设备默认名称
*
* @return
*/
@RequestMapping("/doUpdateHardwareAttr.do")
public ModelAndView doUpdateHardwareAttr(String hardwareType) {
if (hardwareType != null) {
FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttri = this.adminService.getFactoryVenderHardwareTypeAttri(hardwareType);
Map<String, Object> map = new HashMap<String, Object>();
if (factoryVenderHardwareTypeAttri == null) {
factoryVenderHardwareTypeAttri = new FactoryVenderHardwareTypeAttri();
factoryVenderHardwareTypeAttri.setHardwareType(hardwareType);
}
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());
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/hardwareTypeList.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());
}
@ -1196,6 +1397,7 @@ public class AdminAction {
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;
@ -1347,12 +1549,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");
@ -1444,11 +1651,16 @@ 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.isEmpty()) {
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())) {
@ -2332,6 +2544,7 @@ public class AdminAction {
/**
* 账单生成
*
* @param billMonth
* @return
*/

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

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

@ -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,57 @@
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 Integer switchS1;
@Column(name="switch_s2")
private Integer switchS2;
@Column(name="switch_s3")
private Integer switchS3;
@Column(name="switch_s4")
private Integer switchS4;
@Column(name="switch_s5")
private Integer switchS5;
@Column(name="switch_s6")
private Integer switchS6;
@Column(name="switch_s7")
private Integer switchS7;
@Column(name="switch_s8")
private Integer switchS8;
@Column(name="switch_s9")
private Integer switchS9;
@Column(name="switch_s10")
private Integer switchS10;
@Column(name="switch_s11")
private Integer switchS11;
@Column(name="switch_s12")
private Integer switchS12;
@Column(name="create_time")
private Date 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;
//硬件类型
@ -66,4 +69,11 @@ public class FactoryList implements Serializable{
this.isTax = isTax;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
}

View File

@ -0,0 +1,293 @@
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="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 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,271 @@
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;
@Column(name="switch_s2")
private Integer switchS2;
@Column(name="switch_s3")
private Integer switchS3;
@Column(name="switch_s4")
private Integer switchS4;
@Column(name="switch_s5")
private Integer switchS5;
@Column(name="switch_s6")
private Integer switchS6;
@Column(name="switch_s7")
private Integer switchS7;
@Column(name="switch_s8")
private Integer switchS8;
@Column(name="switch_s9")
private Integer switchS9;
@Column(name="switch_s10")
private Integer switchS10;
@Column(name="switch_s11")
private Integer switchS11;
@Column(name="switch_s12")
private Integer switchS12;
@Column(name="temperature1")
private Integer temperature1;
@Column(name="temperature2")
private Integer temperature2;
@Column(name="heating_set")
private Integer heatingSet;
@Column(name="refrigeration_set")
private Integer refrigerationSet;
@Column(name="feedfish_set")
private Integer feedfishSet;
@Column(name="change_temper_set1")
private Integer changeTemperSet1;
@Column(name="change_temper_set2")
private Integer changeTemperSet2;
@Column(name="delayed_set")
private Integer delayedSet;
@Column(name="electricity_show")
private Integer electricityShow;
@Column(name="once_feedfish_set")
private Integer onceFeedfishSet;
@Column(name="create_time")
private Date createTime;
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 Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -1,20 +1,22 @@
<?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" />
<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" />
<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" />
<key column="factory_code"/>
<many-to-many class="HardwareType" column="hardware_type"/>
</set>
</class>

View File

@ -30,4 +30,12 @@ public class CheckNames implements Serializable {
this.checked = checked;
}
public CheckNames() {
}
public CheckNames(String showValue, String showName, Boolean checked) {
this.showValue = showValue;
this.showName = showName;
this.checked = checked;
}
}

View File

@ -162,10 +162,12 @@ 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);
//删除硬件类型
public void deleteHardwareType(String hardwareType);
@ -189,7 +191,7 @@ public interface AdminService {
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 updateFactory(FactoryList factoryList,String brandCodes,String hardwareTypes);
@ -310,4 +312,5 @@ public interface AdminService {
//账单生成
boolean billGen(String month);
void saveFactoryHardwareTypeAttr(FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttri);
}

View File

@ -122,6 +122,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;
@ -1248,21 +1252,171 @@ 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("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);
hardwareTypeAttri.setChangeTemperSet2(1);
}
if (id.equals("29")) {
hardwareTypeAttri.setDelayedSet(1);
}
if (id.equals("30")) {
hardwareTypeAttri.setElectricityShow(1);
}
if (id.equals("31")) {
hardwareTypeAttri.setOnceFeedfishSet(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) {
return factoryHardwareTypeAttrDao.findUniqueByProperty(Restrictions.eq("hardwareType", hardwareType));
}
@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(",");
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("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);
hardwareTypeAttri.setChangeTemperSet2(1);
}
if (id.equals("29")) {
hardwareTypeAttri.setDelayedSet(1);
}
if (id.equals("30")) {
hardwareTypeAttri.setElectricityShow(1);
}
if (id.equals("31")) {
hardwareTypeAttri.setOnceFeedfishSet(1);
}
}
hardwareTypeAttriDao.save(hardwareTypeAttri);
return this.hardwareTypeDao.update(hardwareType);
}
@ -1526,7 +1680,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) {
//编号是否存在
@ -1556,6 +1710,7 @@ public class AdminServiceImpl implements AdminService {
}
factoryList.setHardwareTypeSet(hardwareTypeSet);
}
factoryList.setBackground(imgName);
this.factoryListDao.save(factoryList);
return SysUserEnum.success100.getKey();
}
@ -3098,6 +3253,11 @@ public class AdminServiceImpl implements AdminService {
return false;
}
@Override
public void saveFactoryHardwareTypeAttr(FactoryVenderHardwareTypeAttri factoryVenderHardwareTypeAttri) {
this.factoryHardwareTypeAttrDao.save(factoryVenderHardwareTypeAttri);
}
@Autowired
private FactoryService factoryService;

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

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

@ -122,6 +122,14 @@
<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

@ -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,250 @@
<%@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/hardwareTypeList.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="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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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="file" name="fileUpload1" 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">开关2图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload2" 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">开关3图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload3" 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">开关4图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload4" 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">开关5图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload5" 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">开关6图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload6" 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">开关7图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload7" 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">开关8图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload8" 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">开关9图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload9" 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">开关10图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload10" 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">开关11图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload11" 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">开关12图标<span style="color:red;">*</span></label>
<div class="col-sm-4">
<input type="file" name="fileUpload12" 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

@ -65,21 +65,18 @@
"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>'
},
"bSortable": false,
"sClass":"center"
},
{ "mData": function(hardwareType){
return '<a href="<%=basePath%>page/admin/doUpdateHardwareAttr.do?hardwareType='+hardwareType.hardwareType+'" title="设置名称" class="label label-primary"><span class="icon-edit align-top"></span></a>'
},
"bSortable": false,
"sClass":"center"
},
{ "mData": function(hardwareType){
return '<a href="javascript:void(0);" onclick=deleteHardwareType("'+hardwareType.hardwareType+'") title="删除" class="label label-danger"><span class="icon-trash align-top"></span></a>';
},
@ -162,12 +159,8 @@
<th>背光</th>
<th>柜灯</th>
<th>图标</th>
<th>图标根地址</th>
<th>选择的图标</th>
<th>对应的名称</th>
<th>默认图标</th>
<th>默认名称</th>
<th class="center">修改</th>
<th class="center">设置名称</th>
<th class="center">删除</th>
</tr>
</thead>