wuwen vor 5 Jahren
Ursprung
Commit
df963f7dd9

+ 440 - 0
src/main/java/com/ssj/bean/sys/fx/domain/MerchantBackup.java

@@ -0,0 +1,440 @@
+package com.ssj.bean.sys.fx.domain;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import org.hibernate.annotations.Fetch;
+import org.hibernate.annotations.FetchMode;
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+
+import com.ssj.bean.common.framework.core.domain.BaseEntity;
+import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
+
+@Entity
+@Table(name = "fx_merchant_backup")
+public class MerchantBackup extends BaseEntity {
+	
+    private static final long serialVersionUID = 1L;
+    
+    private String posCode;
+    
+    private String orgCode;
+
+    private String  manageUserId;
+
+    private String parentPosCode;
+
+    private Integer type;
+
+    private Integer level;
+
+    private String unitName;
+
+    private String legalPerson;
+
+    private String phone;
+
+    private String deputyName;
+
+    private String deputyPhone;
+
+    private Integer status;
+
+    private String location;
+
+    private String remarks;
+    
+    private Date createTime;
+    
+    private Double price;
+    
+    private Double hardwarePrice;
+    
+    private String saleLoginName;
+
+	private Double outPrice;
+	
+	private String libId;
+	
+	private TbLibJoin libJoin;
+	
+	private Integer portNum;
+	
+	private Integer libService;
+	
+	private Integer libServiceMonth;
+	
+	private Integer platformService;
+	
+	private Integer signService;
+	
+	private Integer hardwareService;
+	
+	private Date signTime;
+	
+	private Date endSignTime;
+	
+	private Date curSummaryTime;
+
+	private Date nextSummaryTime;
+	
+	private Integer curIsSummary;
+	
+	private String address;
+	
+	private Integer signType;
+	
+	private Integer mealType;
+	
+	private Date startActiveTime;
+	
+	private Date activeTime;
+	
+	private Date computeTime;
+    
+	private String backupMonth;
+
+	@Transient
+	private List<Merchant> subMerchants=new ArrayList<Merchant>();
+	
+	public String getSaleLoginName() {
+		return saleLoginName;
+	}
+
+	public void setSaleLoginName(String saleLoginName) {
+		this.saleLoginName = saleLoginName;
+	}
+
+	public Date getSignTime() {
+		return signTime;
+	}
+
+	public void setSignTime(Date signTime) {
+		this.signTime = signTime;
+	}
+
+	public String getOrgCode() {
+		return orgCode;
+	}
+
+	public void setOrgCode(String orgCode) {
+		this.orgCode = orgCode;
+	}
+
+	public String getPosCode() {
+		return posCode;
+	}
+
+	public void setPosCode(String posCode) {
+		this.posCode = posCode;
+	}
+
+	public String getManageUserId() {
+		return manageUserId;
+	}
+
+	public void setManageUserId(String manageUserId) {
+		this.manageUserId = manageUserId;
+	}
+
+	public String getParentPosCode() {
+		return parentPosCode;
+	}
+
+	public void setParentPosCode(String parentPosCode) {
+		this.parentPosCode = parentPosCode;
+	}
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public Integer getLevel() {
+		return level;
+	}
+
+	public void setLevel(Integer level) {
+		this.level = level;
+	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	public String getLegalPerson() {
+		return legalPerson;
+	}
+
+	public void setLegalPerson(String legalPerson) {
+		this.legalPerson = legalPerson;
+	}
+
+	public String getPhone() {
+		return phone;
+	}
+
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+
+	public String getDeputyName() {
+		return deputyName;
+	}
+
+	public void setDeputyName(String deputyName) {
+		this.deputyName = deputyName;
+	}
+
+	public String getDeputyPhone() {
+		return deputyPhone;
+	}
+
+	public void setDeputyPhone(String deputyPhone) {
+		this.deputyPhone = deputyPhone;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public String getLocation() {
+		return location;
+	}
+
+	public void setLocation(String location) {
+		this.location = location;
+	}
+
+	public String getRemarks() {
+		return remarks;
+	}
+
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public Double getPrice() {
+		return price;
+	}
+
+	public void setPrice(Double price) {
+		this.price = price;
+	}
+
+	public static long getSerialversionuid() {
+		return serialVersionUID;
+	}
+
+
+	public Double getOutPrice() {
+		return outPrice;
+	}
+
+	public void setOutPrice(Double outPrice) {
+		this.outPrice = outPrice;
+	}
+
+	public String getLibId() {
+		return libId;
+	}
+
+	public void setLibId(String libId) {
+		this.libId = libId;
+	}
+
+	public Integer getLibService() {
+		return libService;
+	}
+
+	public void setLibService(Integer libService) {
+		this.libService = libService;
+	}
+
+	public Integer getPlatformService() {
+		return platformService;
+	}
+
+	public void setPlatformService(Integer platformService) {
+		this.platformService = platformService;
+	}
+
+	public Date getEndSignTime() {
+		return endSignTime;
+	}
+
+	public void setEndSignTime(Date endSignTime) {
+		this.endSignTime = endSignTime;
+	}
+	
+	public Integer getPortNum() {
+		return portNum;
+	}
+
+	public void setPortNum(Integer portNum) {
+		this.portNum = portNum;
+	}
+
+	public Date getNextSummaryTime() {
+		return nextSummaryTime;
+	}
+
+	public void setNextSummaryTime(Date nextSummaryTime) {
+		this.nextSummaryTime = nextSummaryTime;
+	}
+
+	public Date getCurSummaryTime() {
+		return curSummaryTime;
+	}
+
+	public void setCurSummaryTime(Date curSummaryTime) {
+		this.curSummaryTime = curSummaryTime;
+	}
+
+	@OneToOne(cascade = { CascadeType.PERSIST}, fetch=FetchType.EAGER)
+	@JoinColumn(name="libId",updatable =false,insertable =false)
+	@NotFound(action=NotFoundAction.IGNORE)
+	@Fetch(FetchMode.SELECT)
+	public TbLibJoin getLibJoin() {
+		return libJoin;
+	}
+
+	public void setLibJoin(TbLibJoin libJoin) {
+		this.libJoin = libJoin;
+	}
+
+	public Integer getCurIsSummary() {
+		return curIsSummary;
+	}
+
+	public void setCurIsSummary(Integer curIsSummary) {
+		this.curIsSummary = curIsSummary;
+	}
+
+	public Integer getSignService() {
+		return signService;
+	}
+
+	public void setSignService(Integer signService) {
+		this.signService = signService;
+	}
+	
+	@Transient
+	public List<Merchant> getSubMerchants() {
+		return subMerchants;
+	}
+
+	public void setSubMerchants(List<Merchant> subMerchants) {
+		this.subMerchants = subMerchants;
+	}
+
+	public Integer getHardwareService() {
+		return hardwareService;
+	}
+
+	public void setHardwareService(Integer hardwareService) {
+		this.hardwareService = hardwareService;
+	}
+
+	public Double getHardwarePrice() {
+		return hardwarePrice;
+	}
+
+	public void setHardwarePrice(Double hardwarePrice) {
+		this.hardwarePrice = hardwarePrice;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public Integer getSignType() {
+		return signType;
+	}
+
+	public void setSignType(Integer signType) {
+		this.signType = signType;
+	}
+
+	public Integer getLibServiceMonth() {
+		return libServiceMonth;
+	}
+
+	public void setLibServiceMonth(Integer libServiceMonth) {
+		this.libServiceMonth = libServiceMonth;
+	}
+
+	public Integer getMealType() {
+		return mealType;
+	}
+
+	public void setMealType(Integer mealType) {
+		this.mealType = mealType;
+	}
+
+	public Date getActiveTime() {
+		return activeTime;
+	}
+
+	public void setActiveTime(Date activeTime) {
+		this.activeTime = activeTime;
+	}
+
+	public Date getComputeTime() {
+		return computeTime;
+	}
+
+	public void setComputeTime(Date computeTime) {
+		this.computeTime = computeTime;
+	}
+
+	public Date getStartActiveTime() {
+		return startActiveTime;
+	}
+
+	public void setStartActiveTime(Date startActiveTime) {
+		this.startActiveTime = startActiveTime;
+	}
+
+	public String getBackupMonth() {
+		return backupMonth;
+	}
+
+	public void setBackupMonth(String backupMonth) {
+		this.backupMonth = backupMonth;
+	}
+
+}

+ 16 - 0
src/main/java/com/ssj/dao/sys/fx/dao/MerchantBackupDao.java

@@ -0,0 +1,16 @@
+package com.ssj.dao.sys.fx.dao;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import com.ssj.bean.sys.fx.domain.MerchantBackup;
+
+@Repository
+public interface MerchantBackupDao extends JpaRepository<MerchantBackup, String> {
+	
+	public Page<MerchantBackup> findAll(Specification<MerchantBackup> specification, Pageable page);
+	
+}

+ 18 - 0
src/main/java/com/ssj/service/sys/fx/service/MerchantBackupService.java

@@ -0,0 +1,18 @@
+package com.ssj.service.sys.fx.service;
+
+import java.util.Map;
+
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+
+import com.ssj.bean.sys.fx.domain.MerchantBackup;
+import com.ssj.framework.core.common.service.BaseService;
+
+public interface MerchantBackupService extends BaseService<MerchantBackup, String> {
+	
+	Page<MerchantBackup> findMerchantBackupByPage(Map<String, Object> params, Pageable sp);
+	
+	void runMerchantBackup();
+	
+
+}

+ 78 - 0
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantBackupServiceImpl.java

@@ -0,0 +1,78 @@
+package com.ssj.service.sys.fx.service.impl;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.data.repository.PagingAndSortingRepository;
+import org.springframework.stereotype.Service;
+
+import com.ssj.bean.sys.fx.domain.Merchant;
+import com.ssj.bean.sys.fx.domain.MerchantBackup;
+import com.ssj.dao.sys.fx.dao.MerchantBackupDao;
+import com.ssj.dao.sys.fx.dao.MerchantDao;
+import com.ssj.framework.basic.utils.DateHelper;
+import com.ssj.framework.core.common.service.BaseServiceImpl;
+import com.ssj.framework.core.persistence.DynamicSpecifications;
+import com.ssj.framework.core.persistence.SearchFilter;
+import com.ssj.service.sys.fx.service.MerchantBackupService;
+
+
+@Service
+public class MerchantBackupServiceImpl extends BaseServiceImpl<MerchantBackup, String> implements MerchantBackupService {
+	
+	private  Logger logger = LoggerFactory.getLogger(this.getClass());
+	
+	@Autowired
+	private MerchantBackupDao dao;
+	
+	@Autowired
+	private MerchantDao merchantDao;
+
+    @Override
+    public PagingAndSortingRepository<MerchantBackup, String> getDao() {
+        return dao;
+    }
+
+	@Override
+	public Page<MerchantBackup> findMerchantBackupByPage(Map<String, Object> params,Pageable sp) {
+		Map<String, SearchFilter> filters = SearchFilter.parse(params);
+		Specification<MerchantBackup> specification = DynamicSpecifications.bySearchFilter(filters.values(), MerchantBackup.class);
+		return dao.findAll(specification, sp);
+	}
+    
+	@Override
+	public void runMerchantBackup() {
+		logger.info("1号备份保存上个月的商户数据,任务开始...");
+		List<MerchantBackup> merchantBackups=new ArrayList<MerchantBackup>();
+		List<Merchant> merchants=merchantDao.findAll();
+		for (Merchant merchant : merchants) {
+			try {
+				MerchantBackup merchantBackup=new MerchantBackup();
+				BeanUtils.copyProperties(merchant, merchantBackup);
+				merchantBackup.setBackupMonth(DateHelper.formatDateByFormat(new Date(), "yyyy-MM"));
+				merchantBackups.add(merchantBackup);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+		this.save(merchantBackups);
+		logger.info("1号备份保存上个月的商户数据,任务结束。.");
+	}
+    
+    
+    
+    
+
+
+}
+
+

+ 376 - 1
src/main/java/com/ssj/sys/controller/FxController.java

@@ -51,6 +51,7 @@ import com.ssj.bean.sys.fx.domain.DeviceAct;
 import com.ssj.bean.sys.fx.domain.DeviceParts;
 import com.ssj.bean.sys.fx.domain.DevicePartsAct;
 import com.ssj.bean.sys.fx.domain.Merchant;
+import com.ssj.bean.sys.fx.domain.MerchantBackup;
 import com.ssj.bean.sys.organization.domain.Organization;
 import com.ssj.bean.sys.role.domain.Admin;
 import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
@@ -72,6 +73,7 @@ import com.ssj.service.sys.fx.service.DevicePartsActService;
 import com.ssj.service.sys.fx.service.DevicePartsService;
 import com.ssj.service.sys.fx.service.DeviceService;
 import com.ssj.service.sys.fx.service.MerchantAreaService;
+import com.ssj.service.sys.fx.service.MerchantBackupService;
 import com.ssj.service.sys.fx.service.MerchantService;
 import com.ssj.service.sys.fx.service.MerchantSignService;
 import com.ssj.service.sys.role.service.AdminService;
@@ -96,6 +98,9 @@ public class FxController  extends BaseController {
 	private MerchantService merchantService;
 	
 	@Autowired
+	private MerchantBackupService merchantBackupService;
+	
+	@Autowired
 	private MerchantSignService merchantSignService;
 	
 	@Autowired
@@ -361,6 +366,46 @@ public class FxController  extends BaseController {
     }
 	
 	
+	
+	@RequestMapping("/merchantBackupList")
+    public String merchantBackupList(Model model,
+            @RequestParam(required = false, defaultValue = "10") int pageSize,
+            @RequestParam(required = false, defaultValue = "1") int pageNo)throws Exception {
+		HttpSession session = request.getSession();
+		Admin admin =(Admin) session.getAttribute("admin");
+		Merchant merchant=merchantService.getMerchantByPosCode(admin.getLoginName());
+		
+	 	Map<String, Object> params = new HashMap<String, Object>();
+        params.put("LIKE_unitName", request.getParameter("LIKE_unitName")==null?"":request.getParameter("LIKE_unitName"));
+        params.put("LIKE_posCode", request.getParameter("LIKE_posCode")==null?"":request.getParameter("LIKE_posCode"));
+        params.put("EQ_backupMonth", request.getParameter("EQ_backupMonth")==null||StringUtils.isEmpty(request.getParameter("EQ_backupMonth").toString())? DateHelper.format(new Date(),"yyyy-MM") :request.getParameter("EQ_backupMonth").toString());
+        
+        if(request.getParameter("signType")!=null ) {
+        	if("0".equals(request.getParameter("signType").toString())){
+        		params.put("EQ_signType", 0);
+        	}else if("1".equals(request.getParameter("signType").toString())){
+        		params.put("GTE_signType", 1);
+        	}
+        }
+        params.put("NOT_status", 4);
+        
+        SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<MerchantBackup> page = merchantBackupService.findMerchantBackupByPage(params, initPage(pageNo, pageSize, Direction.DESC, new String[]{"createTime"}));
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list", page.getContent());
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        params.put("signType", request.getParameter("signType")==null?"":request.getParameter("signType"));
+        model.addAttribute("search", params);
+        model.addAttribute("curMerchant", merchant);
+        return "sys/fx/merchantBackupList";
+    }
+	
+	
 	//得到下一级的商户
 	private List<Merchant> findMerchantByNext(String orgCode){
 		List<Merchant> list=new ArrayList<Merchant>();
@@ -746,6 +791,50 @@ public class FxController  extends BaseController {
 	
 	
 	
+	@RequestMapping("/merchantBackupInfo")
+    public String merchantBackupInfo(Model model,String id)throws Exception {
+		
+		HttpSession session = request.getSession();
+		Admin admin =(Admin) session.getAttribute("admin");
+		Merchant curMerchant=merchantService.getMerchantByPosCode(admin.getLoginName());
+		
+		MerchantBackup merchant=new MerchantBackup();
+		List<PositionSchoolV1Dto> positionSchoolV1Dtos=new ArrayList<PositionSchoolV1Dto>();
+		String schoolText="";
+		
+		if(StringUtils.isNotEmpty(id)){
+			merchant=merchantBackupService.getById(id);
+			
+			if(merchant!=null && StringUtils.isNotEmpty(merchant.getLibId())) { 
+				 positionSchoolV1Dtos= merchantAreaService.findSchoolList(merchant.getLibId());
+				 if(positionSchoolV1Dtos!=null) {
+					 for (PositionSchoolV1Dto positionSchoolV1Dto : positionSchoolV1Dtos) {
+						 schoolText=schoolText+positionSchoolV1Dto.getSchoolName()+";";
+					 }
+					 if(schoolText.endsWith(";")) {
+						 schoolText=schoolText.substring(0, schoolText.length()-1);
+					 }
+				 }
+			}
+			
+		}
+		List<Merchant> list=merchantService.findMerchantByPage();
+		
+		List<CnArea> areaList = cnAreaService.findByTypeList("1");
+		model.addAttribute("areaList", areaList);
+		
+		List<TbLibJoin> joinList=libJoinService.findAll();
+		
+		model.addAttribute("positionSchoolV1Dtos", positionSchoolV1Dtos);
+		model.addAttribute("schoolText", schoolText);
+		model.addAttribute("joinList", joinList);
+		model.addAttribute("poslist", list);
+		model.addAttribute("merchant", merchant);
+		model.addAttribute("curMerchant", curMerchant);
+        return "sys/fx/merchantBackupInfo";
+    }
+	
+	
 	
 	@RequestMapping("/merchantAllot")
     public String merchantAllot(Model model,String id)throws Exception {
@@ -1714,7 +1803,7 @@ public class FxController  extends BaseController {
             	params.put("LIKE_orgCode", merchant.getOrgCode());
             }
             
-            Page<Merchant> list = merchantService.findMerchantByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"signType","createTime"}));
+            Page<Merchant> list = merchantService.findMerchantByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"createTime"}));
     		List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
     		myColumns3.add(new ExcelColumn("商户账号", "posCode", 20));
     		myColumns3.add(new ExcelColumn("商户编码", "orgCode", 20));
@@ -1771,6 +1860,292 @@ public class FxController  extends BaseController {
     }  
     
     
+    @RequestMapping(value = "/exportMerchantBackup", method = RequestMethod.POST)
+    @ResponseBody
+    public void exportMerchantBackup( HttpServletRequest request, HttpServletResponse response) {  
+    	ServletOutputStream os = null;
+    	try { 
+    		String libName="商户备份数据";
+    		os = response.getOutputStream(); //获得输出流  
+    		response.reset();   //清空输出流  
+    		String fileName = new String(libName.getBytes("gb2312"), "ISO8859-1") +".xlsx";  
+    		response.setHeader("Content-disposition", "attachment; filename="+ fileName); //设定输出文件头  
+    		response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+    		response.setCharacterEncoding("utf-8");
+
+    		Map<String, Object> params = new HashMap<String, Object>();
+            params.put("LIKE_unitName", request.getParameter("LIKE_unitName")==null?"":request.getParameter("LIKE_unitName"));
+            params.put("LIKE_posCode", request.getParameter("LIKE_posCode")==null?"":request.getParameter("LIKE_posCode"));
+            params.put("EQ_backupMonth", request.getParameter("EQ_backupMonth")==null||StringUtils.isEmpty(request.getParameter("EQ_backupMonth").toString())? DateHelper.format(new Date(),"yyyy-MM") :request.getParameter("EQ_backupMonth"));
+            
+            if(request.getParameter("signType")!=null ) {
+            	if("0".equals(request.getParameter("signType").toString())){
+            		params.put("EQ_signType", 0);
+            	}else if("1".equals(request.getParameter("signType").toString())){
+            		params.put("GTE_signType", 1);
+            	}
+            }
+            params.put("NOT_status", 4);
+            
+            Page<MerchantBackup> list = merchantBackupService.findMerchantBackupByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"createTime"}));
+    		List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
+    		myColumns3.add(new ExcelColumn("备份月份", "backupMonth", 20));
+    		myColumns3.add(new ExcelColumn("商户账号", "posCode", 20));
+    		myColumns3.add(new ExcelColumn("商户编码", "orgCode", 20));
+    		myColumns3.add(new ExcelColumn("商户类别", "type", 20));
+    		myColumns3.add(new ExcelColumn("商户级别", "level", 20));
+    		myColumns3.add(new ExcelColumn("商户名称:合作名称/合作校区", "unitName", 40));
+    		myColumns3.add(new ExcelColumn("法人姓名", "legalPerson", 20));
+    		myColumns3.add(new ExcelColumn("法人电话", "phone", 20));
+    		myColumns3.add(new ExcelColumn("商户代表", "deputyName", 20));
+    		myColumns3.add(new ExcelColumn("代表电话", "deputyPhone", 20));
+    		
+    		myColumns3.add(new ExcelColumn("套餐:套餐类型", "mealType", 20));
+    		myColumns3.add(new ExcelColumn("套餐:服务包类型	", "signType", 20));
+    		myColumns3.add(new ExcelColumn("签约端口数量", "portNum", 20));
+    		myColumns3.add(new ExcelColumn("机构塾币", "libService_0", 20));
+    		myColumns3.add(new ExcelColumn("平台塾币", "platformService", 20));
+    		myColumns3.add(new ExcelColumn("套餐人数", "libService_1", 20));
+    		myColumns3.add(new ExcelColumn("充值/已结算(月份)", "monthStr", 20));
+    		myColumns3.add(new ExcelColumn("合同开始日期", "signTime", 20));
+    		myColumns3.add(new ExcelColumn("合同结束日期", "endSignTime", 20));
+    		
+    		myColumns3.add(new ExcelColumn("激活开始日期", "startActiveTimeStr", 20));
+    		myColumns3.add(new ExcelColumn("激活结束日期", "activeTimeStr", 20));
+    		myColumns3.add(new ExcelColumn("计费开始日", "computeTimeStr", 20));
+    		myColumns3.add(new ExcelColumn("下个结算日", "nextSummaryTime", 20));
+    		
+    		myColumns3.add(new ExcelColumn("关联机构", "joinName", 20));
+    		myColumns3.add(new ExcelColumn("关联学校", "schoolName", 20));
+    		
+    		myColumns3.add(new ExcelColumn("签约数(练习册用)", "signService", 20));
+    		myColumns3.add(new ExcelColumn("硬件数量", "hardwareService", 20));
+    		myColumns3.add(new ExcelColumn("服务:签约单价", "price", 20));
+    		myColumns3.add(new ExcelColumn("硬件:签约单价", "hardwarePrice", 20));
+    		myColumns3.add(new ExcelColumn("平台服务费", "outPrice", 20));
+    		
+    		myColumns3.add(new ExcelColumn("状态", "status", 20));
+    		myColumns3.add(new ExcelColumn("创建时间", "createTime", 20));
+    		
+    		CustomizeToExcel.downFile(myColumns3, objectMerchantBackupToMap(list.getContent()), os);
+    	}catch (IOException e) {  
+    		e.printStackTrace();  
+    	}catch (Exception e1){
+    		e1.printStackTrace();
+    	}finally{
+    		if(os != null){
+    			try {
+    				os.flush();
+    				os.close(); 
+    			} catch (IOException e) {
+    				e.printStackTrace();
+    			}  
+    		}
+    	}
+    }  
+    
+    
+    private List<Map<String, Object>> objectMerchantBackupToMap(List<MerchantBackup> list) throws Exception {
+		if (list == null)
+			return null;
+		List<Map<String, Object>> maps=new ArrayList<Map<String,Object>>();
+		Map<String, Object> map=null;
+		for (MerchantBackup obj : list) {
+			map = new HashMap<String, Object>();
+			BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass());
+			PropertyDescriptor[] propertyDescriptors = beanInfo
+					.getPropertyDescriptors();
+			for (PropertyDescriptor property : propertyDescriptors) {
+				String key = property.getName();
+				if (key.compareToIgnoreCase("class") == 0) {
+					continue;
+				}
+				Method getter = property.getReadMethod();
+				Object value = getter != null ? getter.invoke(obj) : null;
+				if("type".equals(key)){
+					String str="";
+					switch (value!=null ?value.toString():"") {
+					case "1":
+						str="直接签约(旧模式)";
+						break;
+					case "2":
+						str="内部消耗";
+						break;
+					case "3":
+						str="外部签约";
+						break;
+					case "4":
+						str="内部不结算(财务)";
+						break;
+					case "5":
+						str="直接签约(新模式)";
+						break;
+					case "6":
+						str="旧转新(新不结算)";
+						break;
+					case "7":
+						str="旧转新(新旧不结算)";
+						break;
+					default:
+						str="";
+						break;
+					}
+					map.put(key,  str);
+				}else if("level".equals(key)){
+					String str="";
+					switch (value!=null ?value.toString():"") {
+					case "1":
+						str="市代";
+						break;
+					case "2":
+						str="区代";
+						break;
+					case "3":
+						str="学校独家";
+						break;
+					case "4":
+						str="普通";
+						break;
+					default:
+						str="";
+						break;
+					}
+					map.put(key,  str);
+				}else if("status".equals(key)){
+					String str="";
+					switch (value!=null ?value.toString():"") {
+					case "1":
+						str="待签";
+						break;
+					case "2":
+						str="已签待交付";
+						break;
+					case "3":
+						str="已签已交付";
+						break;
+					case "4":
+						str="删除";
+						break;
+					default:
+						str="";
+						break;
+					}
+					map.put(key,  str);
+				}else if("signType".equals(key)){
+					String str="";
+					String monthStr="";
+					String startActiveTimeStr="";
+					String activeTimeStr="";
+					String computeTimeStr="";
+					String libService_0="";
+					String libService_1="";
+					switch (value!=null ?value.toString():"") {
+					case "0":
+						str="旧兼容模式";
+						monthStr="";
+						startActiveTimeStr="";
+						activeTimeStr="";
+						computeTimeStr="";
+						libService_0=obj.getLibService()+"";
+						break;
+					case "1":
+						str="服务包1";
+						monthStr=obj.getLibServiceMonth()+"/"+obj.getCurIsSummary();
+						startActiveTimeStr=DateHelper.format(obj.getStartActiveTime(), "yyyy-MM-dd") ;
+						activeTimeStr=DateHelper.format(obj.getActiveTime(), "yyyy-MM-dd") ;
+						if(obj.getComputeTime()!=null) {
+							computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						}
+						libService_1=obj.getLibService()+"";
+						break;
+					case "2":
+						str="服务包2";
+						monthStr=obj.getLibServiceMonth()+"/"+obj.getCurIsSummary();
+						startActiveTimeStr=DateHelper.format(obj.getStartActiveTime(), "yyyy-MM-dd") ;
+						activeTimeStr=DateHelper.format(obj.getActiveTime(), "yyyy-MM-dd") ;
+						if(obj.getComputeTime()!=null) {
+							computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						}
+						libService_1=obj.getLibService()+"";
+						break;
+					case "3":
+						str="服务包3";
+						monthStr=obj.getLibServiceMonth()+"/"+obj.getCurIsSummary();
+						startActiveTimeStr=DateHelper.format(obj.getStartActiveTime(), "yyyy-MM-dd") ;
+						activeTimeStr=DateHelper.format(obj.getActiveTime(), "yyyy-MM-dd") ;
+						if(obj.getComputeTime()!=null) {
+							computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						}
+						libService_1=obj.getLibService()+"";
+						break;
+					default:
+						str="";
+						monthStr="";
+						startActiveTimeStr="";
+						activeTimeStr="" ;
+						computeTimeStr="";
+						libService_0="";
+						libService_1="";
+						break;
+					}
+					map.put(key,  str);
+					map.put("monthStr",monthStr);
+					map.put("startActiveTimeStr", startActiveTimeStr);
+					map.put("activeTimeStr", activeTimeStr);
+					map.put("computeTimeStr", computeTimeStr);
+					map.put("libService_0", libService_0);
+					map.put("libService_1", libService_1);
+				}else if("mealType".equals(key)){
+					String str="";
+					switch (value!=null ?value.toString():"") {
+					case "0":
+						str="旧兼容模式";
+						break;
+					case "1":
+						str="优选套餐";
+						break;
+					case "2":
+						str="VIP套餐";
+						break;
+					case "3":
+						str="尊享套餐";
+						break;
+					default:
+						str="";
+						break;
+					}
+					map.put(key,  str);
+				}else if("signTime".equals(key)){
+					map.put(key,DateHelper.format(obj.getSignTime(), "yyyy-MM-dd"));
+				}else if("endSignTime".equals(key)){
+					map.put(key,DateHelper.format(obj.getEndSignTime(), "yyyy-MM-dd"));
+				}else if("nextSummaryTime".equals(key)){
+					map.put(key,DateHelper.format(obj.getNextSummaryTime(), "yyyy-MM-dd"));
+				}else {
+					map.put(key, value);
+				} 
+			}
+			List<PositionSchoolV1Dto> positionSchoolV1Dtos=new ArrayList<PositionSchoolV1Dto>();
+			String schoolText="";
+			if(StringUtils.isNotEmpty(obj.getLibId())) { 
+				 positionSchoolV1Dtos= merchantAreaService.findSchoolList(obj.getLibId());
+				 if(positionSchoolV1Dtos!=null) {
+					 for (PositionSchoolV1Dto positionSchoolV1Dto : positionSchoolV1Dtos) {
+						 schoolText=schoolText+positionSchoolV1Dto.getSchoolName()+";";
+					 }
+					 if(schoolText.endsWith(";")) {
+						 schoolText=schoolText.substring(0, schoolText.length()-1);
+					 }
+				 }
+			}
+			map.put("joinName", obj.getLibJoin()!=null ? obj.getLibJoin().getLeagueName() : "");
+			map.put("schoolName", schoolText);
+			maps.add(map);
+		}
+		return maps;
+	}
+    
+    
     private List<Map<String, Object>> objectMerchantToMap(List<Merchant> list) throws Exception {
 		if (list == null)
 			return null;

+ 23 - 20
src/main/resources/templates/sys/fx/merchantAdd.html

@@ -71,20 +71,20 @@ dtext{
 		<ul class="forminfo">
 			<li style="margin-bottom: 20px">
 				<label>商户账号:<b>*</b></label>
-				<input th:if="${merchant.id==null}" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}"/>
+				<input autocomplete="off"  th:if="${merchant.id==null}" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}"/>
 				<label th:if="${merchant.id==null}" style="width: 230px;color:red">&nbsp;[提交后无法修改,只可包含字母/数字 ]</label>
-				<input th:if="${merchant.id!=null}" disabled="disabled" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}"/>
+				<input autocomplete="off"  th:if="${merchant.id!=null}" disabled="disabled" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}"/>
 				<br/>
 			</li>
 			<li th:if="${merchant.id==null}" style="margin-bottom: 20px">
 				<label>初始密码:<b>*</b></label>
-				<input type="text" id="password" class="dfinput fl" name="password"  style="float: left;" value=""/>
+				<input type="text" id="password" class="dfinput fl" name="password"  style="float: left;" value="00000000" autocomplete="off" />
 				
 				<br/>
 			</li>
 			<li>
 				<label>商户名称:合作名称/合作校区<b>*</b></label>
-				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}"/>
+				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}" autocomplete="off" />
 			</li>
 			
 			<li id="location_wrap" >
@@ -158,7 +158,7 @@ dtext{
 			
 			<li>
 				<label><b >【服务包模式】</b>充值月份数:<b>*</b></label>
-				<input type="number" id="libServiceMonth" min="0" class="dfinput fl" name="libServiceMonth" th:value="${merchant.libServiceMonth!=null ? merchant.libServiceMonth : 0}"/>
+				<input type="number" id="libServiceMonth" min="0" class="dfinput fl" name="libServiceMonth" th:value="${merchant.libServiceMonth!=null ? merchant.libServiceMonth : 0}" autocomplete="off"/>
 				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red">[增量添加数值为续费开通 ]</text>
 			</li>
 			
@@ -178,12 +178,12 @@ dtext{
 			
 			<li>
 				<label>签约数量(练习册用):<b>*</b></label>
-				<input type="text" id="signService" class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}"/>
+				<input type="text" id="signService" class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}" autocomplete="off"/>
 			</li>
 			
 			<li>
 				<label>合同硬件采购数量:<b>*</b></label>
-				<input type="text" id="hardwareService" class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}"/>
+				<input type="text" id="hardwareService" class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}" autocomplete="off"/>
 			</li>
 			
 			<li >
@@ -200,10 +200,10 @@ dtext{
 				<label>商户级别:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="level" id="level" class="select1"> 
+						<option value="4" th:selected="${merchant.level==4 ? true : false}">普通</option>
 						<option value="1" th:selected="${merchant.level==1 ? true : false}">市代</option>
 						<option value="2" th:selected="${merchant.level==2 ? true : false}">区代</option>
 						<option value="3" th:selected="${merchant.level==3 ? true : false}">学校独家</option>
-						<option value="4" th:selected="${merchant.level==4 ? true : false}">普通</option>
 					</select>
 				</div>
 			</li>
@@ -212,9 +212,10 @@ dtext{
 				<label>商户级别:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="level" id="level" class="select1"> 
+						<option value="4" th:if="${curMerchant.level<=1 || curMerchant.level<=2 || curMerchant.level<=3}" th:selected="${merchant.level==4 ? true : false}">普通</option>
 						<option value="2" th:if="${curMerchant.level<=1}" th:selected="${merchant.level==2 ? true : false}">区代</option>
 						<option value="3" th:if="${curMerchant.level<=1 || curMerchant.level<=2}" th:selected="${merchant.level==3 ? true : false}">学校独家</option>
-						<option value="4" th:if="${curMerchant.level<=1 || curMerchant.level<=2 || curMerchant.level<=3}" th:selected="${merchant.level==4 ? true : false}">普通</option>
+						
 					</select>
 				</div>
 			</li>
@@ -224,11 +225,11 @@ dtext{
 				<label>商户类型:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="type" id="type" class="select1"> 
+						<option value="5" th:selected="${merchant.type==5 ? true : false}">直接签约(新模式)</option>
 						<option value="1" th:selected="${merchant.type==1 ? true : false}">直接签约(旧模式)</option>
 						<option value="2" th:selected="${merchant.type==2 ? true : false}">内部消耗</option>
 						<option value="3" th:selected="${merchant.type==3 ? true : false}">外部签约</option>
 						<option value="4" th:selected="${merchant.type==4 ? true : false}">内部不结算(财务)</option>
-						<option value="5" th:selected="${merchant.type==5 ? true : false}">直接签约(新模式)</option>
 						<option value="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
 						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
 					</select>
@@ -239,10 +240,12 @@ dtext{
 				<label>商户类型:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="type" id="type" class="select1"> 
+						<option value="5" th:selected="${merchant.type==5 ? true : false}">直接签约(新模式)</option>
+						
 						<option value="1" th:selected="${merchant.type==1 ? true : false}">直接签约(旧模式)</option>
 						<option value="2" th:selected="${merchant.type==2 ? true : false}">内部消耗</option>
 						<option value="4" th:selected="${merchant.type==4 ? true : false}">内部不结算(财务)</option>
-						<option value="5" th:selected="${merchant.type==5 ? true : false}">直接签约(新模式)</option>
+						
 						<option value="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
 						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
 					</select>
@@ -272,44 +275,44 @@ dtext{
 				
 		    <li>
 				<label>服务包充值金额 / 服务:签约单价<b></b></label>
-				<input type="text" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}"/>
+				<input type="text" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off"/>
 			</li>
 			
 			<li>
 				<label><b >【服务包模式】</b>平台管理费金额<b></b></label>
-				<input type="text" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}"/>
+				<input type="text" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}" autocomplete="off"/>
 			</li>
 			
 			<li>
 				<label>硬件:签约单价<b></b></label>
-				<input type="text" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice}"/>
+				<input type="text" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice}" autocomplete="off"/>
 			</li>
 			
 			<li>
 				<label>法人姓名 :<b></b></label>
-				<input type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}"/>
+				<input type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}" autocomplete="off"/>
 			</li>
 			<li>
 				<label>法人电话:<b></b></label>
-				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}"/>
+				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off"/>
 			</li>
 			<li>
 				<label>代表姓名:<b></b></label>
-				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}"/>
+				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off"/>
 			</li>
 			<li>
 				<label>代表电话:<b></b></label>
-				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}"/>
+				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off"/>
 			</li>
 		
 			<li>
 				<label>商户备注:<b></b></label>
-				<input type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}"/>
+				<input type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off"/>
 			</li>
 
 			<li>
 				<label>地址:<b></b></label>
-				<input type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}"/>
+				<input type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off"/>
 			</li>
 
 			<li>

+ 738 - 0
src/main/resources/templates/sys/fx/merchantBackupInfo.html

@@ -0,0 +1,738 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/js/city/city.json.js}"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/js/city/citySetMe_V.js}"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/js/city/Popt.js}"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+ <style type="text/css">
+   body{min-width:180px;}
+       .select1{
+   		    width:100%;
+		    height: 32px;
+		    line-height: 32px;
+		    border-top: solid 1px #a7b5bc;
+		    border-left: solid 1px #a7b5bc;
+		    border-right: solid 1px #ced9df;
+		    border-bottom: solid 1px #ced9df;
+		    opacity:1;
+	        margin-bottom: 10px;
+    	}
+    	.btn{
+    	  width: 100px;
+    	}
+     label.control-label-error {color: Red;}	
+     
+._citys {     background-color: whitesmoke;width: 450px; display: inline-block; border: 2px solid #eee; padding: 5px; position: relative; }
+._citys span { color: #05920a; height: 15px; width: 15px; line-height: 15px; text-align: center; border-radius: 3px; position: absolute; right: 10px; top: 10px; border: 1px solid #05920a; cursor: pointer; }
+._citys0 { width: 95%; height: 34px; line-height: 34px; display: inline-block; border-bottom: 2px solid #05920a; padding: 0px 5px; font-size:14px; font-weight:bold; margin-left:6px; }
+._citys0 li { display: inline-block; line-height: 34px; font-size: 15px; color: #888; width: 80px; text-align: center; cursor: pointer; }
+._citys1 { width: 100%; display: inline-block; padding: 10px 0; }
+._citys1 a { width: 83px; height: 35px; display: inline-block; background-color: #f5f5f5; color: #666; margin-left: 6px; margin-top: 3px; line-height: 35px; text-align: center; cursor: pointer; font-size: 12px; border-radius: 5px; overflow: hidden; }
+._citys1 a:hover { color: #fff; background-color: #05920a; }
+.AreaS { background-color: #05920a !important; color: #fff !important; }
+#school{
+	margin-left: 110px;
+	padding-bottom: 10px;
+}  
+#school span{
+  	min-width: 25%;
+    float: left;
+    margin-bottom: 10px;
+}
+.joinseachform li{
+	width: 50%;
+	margin-right: 0px;
+	padding-right: 0px;
+}
+
+.schoolseachform li{
+	width: 50%;
+	margin-right: 0px;
+	padding-right: 0px;
+}    
+
+dtext{
+	color: red;
+	cursor: pointer;
+}  
+
+.forminfo li label{
+	width: 250px;
+	text-align: right;
+	padding-right: 10px
+}
+  
+   
+</style>
+<body>
+<div class="formbody">
+		<ul class="forminfo">
+			<li style="margin-bottom: 20px">
+				<label>商户账号:<b>*</b></label>
+				<input th:if="${merchant.id==null}" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}"/>
+				<label th:if="${merchant.id==null}" style="width: 230px;color:red">&nbsp;[提交后无法修改,只可包含字母/数字 ]</label>
+				<input th:if="${merchant.id!=null}" disabled="disabled" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}"/>
+				<br/>
+			</li>
+			<li>
+				<label>商户名称:合作名称/合作校区<b>*</b></label>
+				<input type="text" id="unitname" class="dfinput fl" disabled="disabled" name="unitname" th:value="${merchant.unitName}"/>
+			</li>
+			
+			<li id="location_wrap" >
+				<label th:if="${merchant.location==null || merchant.location==''}">商户区域:<b>*</b></label>
+				<label th:if="${merchant.location!=null && merchant.location!=''}">修改区域:<b>*</b></label>
+				<div class="wrap">
+					<div class="vocation" style="margin-right: 5px; width: 100px">
+						<select name="province" id="province" class="select1" disabled="disabled" > 
+							<option data-type="1" value="" >选择省</option>
+						</select>
+					</div>
+					
+					<div class="vocation" style="margin-right: 5px; width: 100px" >
+						<select name="city" id="city" class="select1" disabled="disabled" >
+							<option data-type="2" value="" >选择市</option>
+						</select>
+					</div>
+					
+					<div class="vocation" style="margin-right: 5px; width: 100px" >
+						<select name="area" id="area" class="select1" disabled="disabled">
+							<option data-type="3" value="" >选择区</option>
+						</select>
+					</div>
+					
+					<div class="vocation" style="margin-right: 5px; width: 130px">
+						<input name="libId" id="libId" class="select1"  type="text"  disabled="disabled">
+						<input name="radiolibId" id="radiolibId"  type="hidden" >
+					</div>
+					
+					<div class="vocation" style="margin-right: 5px; width: 130px">
+						<input name="schooltext" id="schooltext" class="select1"  type="text"  disabled="disabled">
+					</div>
+
+				</div>
+			</li>
+
+		<li>
+				<label>套餐:套餐类型<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="mealType" id="mealType" class="select1"  disabled="disabled"> 
+						<option value="0" th:selected="${merchant.mealType==0 ? true : false}">合同签约模式(旧模式)</option>
+						<option value="1" th:selected="${merchant.mealType==1 ? true : false}">优选套餐</option>
+						<option value="2" th:selected="${merchant.mealType==2 ? true : false}">VIP套餐</option>
+						<option value="3" th:selected="${merchant.mealType==3 ? true : false}">尊享套餐</option>
+					</select>
+				</div>
+			</li>
+			
+			<li>
+				<label>套餐:服务包类型<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="signType" id="signType" class="select1"  disabled="disabled"> 
+						<option value="0" th:selected="${merchant.signType==0 ? true : false}">合同签约模式(旧模式)</option>
+						<option value="1" th:selected="${merchant.signType==1 ? true : false}">服务包1</option>
+						<option value="2" th:selected="${merchant.signType==2 ? true : false}">服务包2</option>
+						<option value="3" th:selected="${merchant.signType==3 ? true : false}">服务包3</option>
+					</select>
+				</div>
+				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red">[修改套餐模式,不会影响加油包有效性 ]</text>
+			</li>
+			
+
+			<li>
+				<label>合同日期:<b >*</b></label>
+				<input type="hidden"  id="minDate" value="2020-01-01" disabled="disabled">
+				<input disabled="disabled" type="text" id="signTime" name="signTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'minDate\')}'})" autocomplete="off" th:value="${#dates.format(merchant.signTime, 'yyyy-MM-dd')}" class="scinput date_width " placeholder="合同开始日期">
+				&nbsp;&nbsp;&nbsp;~~&nbsp;&nbsp;
+				<input disabled="disabled" type="text" id="endSignTime" name="endSignTime"   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'signTime\')}'})"  autocomplete="off" th:value="${#dates.format(merchant.endSignTime, 'yyyy-MM-dd')}" class="scinput date_width" placeholder="合同结束日期">
+			</li>
+			
+			<li>
+				<label><b >【服务包模式】</b>充值月份数:<b>*</b></label>
+				<input disabled="disabled" type="number" id="libServiceMonth" min="0" class="dfinput fl" name="libServiceMonth" th:value="${merchant.libServiceMonth!=null ? merchant.libServiceMonth : 0}" autocomplete="off"/>
+				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red">[增量添加数值为续费开通 ]</text>
+			</li>
+			
+			<li>
+				<label><b >【服务包模式】</b>激活开始日期:<b >*</b></label>
+				<input disabled="disabled" type="text"  class="dfinput fl"  id="startActiveTime" name="startActiveTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.startActiveTime, 'yyyy-MM-dd')}" placeholder="合同开始激活日期">
+			</li>
+			<li>
+				<label><b >【服务包模式】</b>激活结束日期:<b >*</b></label>
+				<input disabled="disabled" type="text"  class="dfinput fl"  id="activeTime" name="activeTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.activeTime, 'yyyy-MM-dd')}" placeholder="合同结束激活日期">
+			</li>
+			
+			<li>
+				<label><b >【服务包模式】</b>计费开始日期:<b ></b></label>
+				<input disabled="disabled" type="text"  class="dfinput fl"  id="computeTime" name="computeTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.computeTime, 'yyyy-MM-dd')}" placeholder="计费开始日期">
+			</li>
+			
+						<li>
+				<label>签约数量(练习册用):<b>*</b></label>
+				<input disabled="disabled" type="text" id="signService" class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}" autocomplete="off"/>
+			</li>
+			
+			<li>
+				<label>合同硬件采购数量:<b>*</b></label>
+				<input disabled="disabled" type="text" id="hardwareService" class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}" autocomplete="off"/>
+			</li>
+			
+			<li >
+				<label>上级渠道<b >*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select disabled="disabled" name="parentposcode" id="parentposcode" class="select1" th:disabled="${merchant.id!=null || curMerchant.orgCode ne 'SSJ-FX' ? 'true' : 'false'}" > 
+						<option th:if="${merchant.id==null || merchant.parentPosCode=='' || merchant.parentPosCode==null }" data-orgcode="" data-id="" value="" >无商户上级</option>
+						<option th:each="item:${poslist}" th:selected="${merchant.id==null ?  (curMerchant.posCode  eq item.posCode ? true : false) : (merchant.parentPosCode  eq item.posCode ? true : false)}" th:if="${item.orgCode ne 'SSJ-FX' && #strings.contains(item.orgCode,curMerchant.orgCode) }" th:data-orgcode="${item.orgCode}" th:data-id="${item.id}" th:value="${item.posCode}" th:text="${item.unitName}+' ['+${item.posCode}+']'"></option>
+					</select>
+				</div>
+			</li>
+
+			<li th:if="${curMerchant.orgCode eq 'SSJ-FX'}" >
+				<label>商户级别:<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="level" id="level" class="select1" disabled="disabled"> 
+						<option value="4" th:selected="${merchant.level==4 ? true : false}">普通</option>
+						<option value="1" th:selected="${merchant.level==1 ? true : false}">市代</option>
+						<option value="2" th:selected="${merchant.level==2 ? true : false}">区代</option>
+						<option value="3" th:selected="${merchant.level==3 ? true : false}">学校独家</option>
+					</select>
+				</div>
+			</li>
+			
+			<li th:if="${curMerchant.orgCode ne 'SSJ-FX'}" >
+				<label>商户级别:<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="level" id="level" class="select1" disabled="disabled"> 
+						<option value="4" th:if="${curMerchant.level<=1 || curMerchant.level<=2 || curMerchant.level<=3}" th:selected="${merchant.level==4 ? true : false}">普通</option>
+						<option value="2" th:if="${curMerchant.level<=1}" th:selected="${merchant.level==2 ? true : false}">区代</option>
+						<option value="3" th:if="${curMerchant.level<=1 || curMerchant.level<=2}" th:selected="${merchant.level==3 ? true : false}">学校独家</option>
+						
+					</select>
+				</div>
+			</li>
+			
+			<li  >
+				<label>商户类型:<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="type" id="type" class="select1" disabled="disabled"> 
+						<option value="5" th:selected="${merchant.type==5 ? true : false}">直接签约(新模式)</option>
+						<option value="1" th:selected="${merchant.type==1 ? true : false}">直接签约(旧模式)</option>
+						<option value="2" th:selected="${merchant.type==2 ? true : false}">内部消耗</option>
+						<option value="3" th:selected="${merchant.type==3 ? true : false}">外部签约</option>
+						<option value="4" th:selected="${merchant.type==4 ? true : false}">内部不结算(财务)</option>
+						<option value="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
+						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
+					</select>
+				</div>
+			</li>
+			
+			
+			<li style="display: none;">
+				<label>签约状态:<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="status" id="status" class="select1" disabled="disabled"> 
+						<option value="3" th:selected="${merchant.status==3 ? true : false}">已签已交付</option>
+						<option value="1" th:selected="${merchant.status==1 ? true : false}">待签</option>
+						<option value="2" th:selected="${merchant.status==2 ? true : false}">已签待交付</option>
+						
+					</select>
+				</div>
+			</li>
+				
+		    <li>
+				<label>服务包充值金额 / 服务:签约单价<b></b></label>
+				<input disabled="disabled" type="text" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off"/>
+			</li>
+			
+			<li>
+				<label><b >【服务包模式】</b>平台管理费金额<b></b></label>
+				<input disabled="disabled" type="text" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}" autocomplete="off"/>
+			</li>
+			
+			<li>
+				<label>硬件:签约单价<b></b></label>
+				<input disabled="disabled" type="text" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice}" autocomplete="off"/>
+			</li>
+			
+			<li>
+				<label>法人姓名 :<b></b></label>
+				<input disabled="disabled" type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}" autocomplete="off"/>
+			</li>
+			<li>
+				<label>法人电话:<b></b></label>
+				<input disabled="disabled" type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off"/>
+			</li>
+			<li>
+				<label>代表姓名:<b></b></label>
+				<input disabled="disabled" type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off"/>
+			</li>
+			<li>
+				<label>代表电话:<b></b></label>
+				<input disabled="disabled" type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off"/>
+			</li>
+		
+			<li>
+				<label>商户备注:<b></b></label>
+				<input disabled="disabled" type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off"/>
+			</li>
+
+			<li>
+				<label>地址:<b></b></label>
+				<input disabled="disabled" type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off"/>
+			</li>
+			
+			
+		
+		</ul>
+		<br/><br/><br/>
+</div>
+
+
+<div class="formbody" id="schoollist" style="display: none">
+	<div class="rightinfo">
+			<ul class="seachform">
+			    <li>
+				 	<label style="color:red">已选择:</label>
+				 	<sldiv id="selectschoollist">
+					 	<label th:each="item:${positionSchoolV1Dtos}"><sdiv><stext th:data-val="${item.id}"></stext>[[${item.schoolName}]]<dtext >[X]</dtext></sdiv></label>
+				 	</sldiv>
+			    </li>
+				
+			</ul>
+	
+	
+			<ul class="seachform">
+			    <li>
+				 	<label>学校名称:</label>
+				 	<input name="likeschoolname" id="likeschoolname" type="text" class="scinput" />
+			    </li>
+				<li>
+					<input type="button" class="scbtn" value="全局查询" onclick="funcblurschoollist()" style="height: 32px;"/>
+				</li>
+			</ul>
+			
+			<ul class="seachform schoolseachform">
+			   
+			</ul>
+			<br/><br/>
+	</div>
+	<div class="pagin" style="float: left;width: 90%;">
+	    	<div class="message">共<i class="blue schoolcountNum">0</i>条记录,当前显示第&nbsp;<i class="blue schoolpageNo">0</i>页</div>
+			    <form id="splitFrom" name="splitFrom" >
+						<input type="hidden" id="pageNo" name="pageNo" value="1">
+						<input type="hidden" id="pageSize" name="pageSize" value="20">
+						<ul class="paginList schoolpaginList">
+							
+						</ul>
+				</form>
+				<br/><br/>
+		</div>
+</div>
+
+
+
+<div class="formbody" id="likejoinlist" style="display: none">
+	<div class="rightinfo">
+			<ul class="seachform">
+			    <li>
+				 	<label>机构名称:</label>
+				 	<input name="likename" id="likename" type="text" class="scinput" />
+			    </li>
+				<li>
+					<input type="button" class="scbtn" value="全局查询" onclick="funcblurlibIdlist()" style="height: 32px;"/>
+				</li>
+			</ul>
+			
+			<ul class="seachform joinseachform">
+			   
+			</ul>
+			<br/><br/>
+	</div>
+	<div class="pagin" style="float: left;width: 90%;">
+	    	<div class="message">共<i class="blue countNum">0</i>条记录,当前显示第&nbsp;<i class="blue pageNo">0</i>页</div>
+			    <form id="splitFrom" name="splitFrom" >
+						<input type="hidden" id="pageNo" name="pageNo" value="1">
+						<input type="hidden" id="pageSize" name="pageSize" value="20">
+						<ul class="paginList joinpaginList">
+							
+						</ul>
+				</form>
+				<br/><br/>
+		</div>
+</div>
+
+
+
+</body>
+<script type="text/javascript">
+
+var areaUrl="[[${sysUrl}]]/sys/fx/areaList";
+var areaPageUrl="[[${sysUrl}]]/sys/fx/areaListPage";
+var likejoinUrl="[[${sysUrl}]]/sys/fx/likejoinList";
+var curLocation="[[${merchant.location}]]";
+var curLibJoin="[[${merchant.libJoin!=null ?  merchant.libJoin.leagueName : '' }]]";
+var curLibJoinId="[[${merchant.libJoin!=null ? merchant.libJoin.id : '' }]]";
+var schoolText="[[${schoolText}]]";
+
+
+
+
+$(function (){
+	$("#location_txt").click(function (){
+		$("#location_wrap").show();
+	})
+	
+	$(".radiolib").on("change",function(){
+	    alert("");
+	});
+	
+	$("#selectschoollist").on("click","dtext",function(){
+		$(this).parent().remove();
+		
+		var schoollist=[];
+		 $.each($('stext'),function(){
+	       	schoollist.push($(this).text());
+	    });
+	 	$("#schooltext").val(schoollist.join(";"));
+	});
+	
+	funcinitprovince();
+	
+})
+
+
+function funcinitprovince(){
+	var val = 0;
+	var type =1;
+	
+	$("#province").html("<option value='' >选择省</option>");
+	
+	var params ={ 'type' : type,'upId':val}
+	$.post(areaUrl,params,function(data){
+		if(data.meta.success){
+			var html=[];
+			for (var i = 0; i < data.data.length; i++) {
+				html.push("<option "+((curLocation.indexOf(data.data[i].name)!=-1) ? 'selected' : '')+" data-type='"+data.data[i].type+"' value='"+data.data[i].id+"' >"+data.data[i].name+"</option>");
+			}
+			$("#province").append(html.join(""));
+			funcprovince();
+		}else{
+			
+		}
+	});
+}
+
+
+function funcprovince(){
+	var val = $('#province  option:selected').val();
+	var type = $('#province  option:selected').data("type");
+	
+	$("#city").html("<option value='' >选择市</option>");
+	
+	var params ={ 'type' : (type+1),'upId':val}
+	$.post(areaUrl,params,function(data){
+		if(data.meta.success){
+			var html=[];
+			for (var i = 0; i < data.data.length; i++) {
+				html.push("<option "+((curLocation.indexOf(data.data[i].name)!=-1) ? 'selected' : '')+" data-type='"+data.data[i].type+"' value='"+data.data[i].id+"' >"+data.data[i].name+"</option>");
+			}
+			$("#city").append(html.join(""));
+			funccity();
+		}else{
+			
+		}
+	});
+}
+
+function funccity(){
+	var val = $('#city  option:selected').val();
+	var type = $('#city  option:selected').data("type");
+	
+	$("#area").html("<option value='' >选择区</option>");
+	//$("#libId").hide();
+	//$("#school").html("").hide();
+	
+	var params ={ 'type' : (type+1),'upId':val}
+	$.post(areaUrl,params,function(data){
+		if(data.meta.success){
+			var html=[];
+			for (var i = 0; i < data.data.length; i++) {
+				html.push("<option "+((curLocation.indexOf(data.data[i].name)!=-1) ? 'selected' : '')+" data-type='"+data.data[i].type+"' value='"+data.data[i].id+"' >"+data.data[i].name+"</option>");
+			}
+			$("#area").append(html.join(""));
+			funcarea();
+		}else{
+			
+		}
+	});
+}
+
+function funcarea(){
+	if(curLibJoin!=''){
+		$("#libId").val(curLibJoin);
+		$("#radiolibId").val(curLibJoinId);
+		$("#schooltext").val(schoolText);
+		funclibId();
+	}
+	$("#libId").show();
+	$("#funcblurschooltext").show();
+}
+
+function funclibId(){
+	
+	//$("#school").html("").show();
+	
+	var val = $('#area  option:selected').val();
+	var type = $('#area  option:selected').data("type");
+	
+	var params ={ 'type' : (type+1),'upId':val}
+	$.post(areaUrl,params,function(data){
+		if(data.meta.success){
+			var html=[];
+			for (var i = 0; i < data.data.length; i++) {
+				html.push("<span><input name='school' type='checkbox' value='"+data.data[i].id+"'> "+data.data[i].name+"</span>");
+			}
+			//$("#school").append(html.join(""));
+		}else{
+			
+		}
+	});
+}
+
+var likejoinlistindex=null;
+var schoollistindex=null;
+function funcblurlibId(){
+	
+	funcblurlibIdlist();
+	
+	likejoinlistindex =layer.open({
+		    type: 1,
+		    title: '选择机构',
+		    closeBtn: 1, //不显示关闭按钮
+		    shift: 0.8,
+		    offset: '150px',
+		    area: ['80%', '60%'],
+		    content: $("#likejoinlist")
+	});
+}
+
+function funcblurschooltext(){
+	
+	funcblurschoollist();
+
+	schoollistindex =layer.open({
+		    type: 1,
+		    title: '选择学校',
+		    closeBtn: 1, //不显示关闭按钮
+		    shift: 0.8,
+		    offset: '150px',
+		    area: ['80%', '60%'],
+		    content: $("#schoollist")
+	});
+}
+
+
+function funcblurschoollist(pageNo){
+	$(".schoolseachform").html("");
+	var val = $('#area  option:selected').val();
+	var type = $('#area  option:selected').data("type");
+
+	var params ={ 
+			'type' : (type+1),
+			'upId':val,
+			'area' : $("#area option:selected").text(),
+			'name' : $("#likeschoolname").val(),
+			'pageNo' : pageNo,
+			'pageSize':16
+			}
+	
+	$.post(areaPageUrl,params,function(data){
+		if(data.meta.success){
+			var html=[];
+			for (var i = 0; i < data.data.jsonList.length; i++) {
+				html.push("<li><label><text  data-value='"+data.data.jsonList[i].id+"' name='schoolcheckbox' type='checkbox' onclick='funcblurschoolcheckbox(this)' >"+data.data.jsonList[i].name+"</text></label></li>");
+			}
+
+			var countPage=data.data.countPage;
+			var pageNo=data.data.pageNo;
+			$(".schoolcountNum").html(data.data.countNum);
+			$(".schoolpageNo").html(data.data.pageNo);
+			
+			var pagehtml=[];
+			if(pageNo>1){
+				pagehtml.push('<li class="paginItem"><a href="javascript:;" onclick="javascript:funcblurschoollist('+(pageNo-1)+');"><span class="pagepre"></span></a></li>');
+			}
+			for (var i = 1; i <= countPage; i++) {
+				if(i==pageNo){
+					pagehtml.push('<li class="paginItem  current"><a href="javascript:;" onclick="javascript:funcblurschoollist(\''+i+'\');return false;">'+i+'</a></li>' );
+				}else{
+					pagehtml.push('<li class="paginItem"><a href="javascript:;" onclick="javascript:funcblurschoollist(\''+i+'\');return false;">'+i+'</a></li>' );
+				}
+			}
+			if(countPage>pageNo){
+				pagehtml.push('<li class="paginItem"><a href="javascript:;" onclick="javascript:funcblurschoollist('+(pageNo+1)+');"><span class="pagenxt"></span></a></li>');
+			}
+			
+			$(".schoolpaginList").html(pagehtml.join(''));
+			$(".schoolseachform").append(html.join(""));
+		}else{
+			
+		}
+	});
+}
+
+
+
+function funcblurlibIdlist(pageNo){
+	$(".joinseachform").html("");
+	var params ={ 
+			'province' : $("#province option:selected").text(),
+			'city' : $("#city option:selected").text(),
+			'area' : $("#area option:selected").text(),
+			'name' : $("#likename").val(),
+			'pageNo' : pageNo,
+			'pageSize':16
+			}
+	
+	$.post(likejoinUrl,params,function(data){
+		if(data.meta.success){
+			var html=[];
+			for (var i = 0; i < data.data.jsonList.length; i++) {
+				html.push("<li><label><input name='radiolib' value='"+data.data.jsonList[i].id+"' type='radio' onchange='funcblurlibIdradio(this)' >"+data.data.jsonList[i].leagueName+"</label></li>");
+			}
+
+			var countPage=data.data.countPage;
+			var pageNo=data.data.pageNo;
+			$(".countNum").html(data.data.countNum);
+			$(".pageNo").html(data.data.pageNo);
+			
+			var pagehtml=[];
+			if(pageNo>1){
+				pagehtml.push('<li class="paginItem"><a href="javascript:;" onclick="javascript:funcblurlibIdlist('+(pageNo-1)+');"><span class="pagepre"></span></a></li>');
+			}
+			for (var i = 1; i <= countPage; i++) {
+				if(i==pageNo){
+					pagehtml.push('<li class="paginItem  current"><a href="javascript:;" onclick="javascript:funcblurlibIdlist(\''+i+'\');return false;">'+i+'</a></li>' );
+				}else{
+					pagehtml.push('<li class="paginItem"><a href="javascript:;" onclick="javascript:funcblurlibIdlist(\''+i+'\');return false;">'+i+'</a></li>' );
+				}
+			}
+			if(countPage>pageNo){
+				pagehtml.push('<li class="paginItem"><a href="javascript:;" onclick="javascript:funcblurlibIdlist('+(pageNo+1)+');"><span class="pagenxt"></span></a></li>');
+			}
+			
+			$(".joinpaginList").html(pagehtml.join(''));
+			$(".joinseachform").append(html.join(""));
+		}else{
+			
+		}
+	});
+}
+
+
+function funcblurlibIdradio(obj){
+	
+	var libtext = $("input[name=radiolib]:checked").parent("label").text();
+	var libId = $("input[name=radiolib]:checked").val();
+	
+	$("#radiolibId").val(libId);
+	$("#libId").val(libtext);
+	
+	funclibId();
+	
+	layer.close(likejoinlistindex);	
+}
+
+function funcblurschoolcheckbox(obj){
+ 	$("#selectschoollist").append('<label><sdiv><stext data-val="'+$(obj).data("value")+'">'+$(obj).parent("label").text()+'</stext>  <dtext >[X]</dtext></sdiv></label>');
+ 	
+ 	var schoollist=[];
+	 $.each($('stext'),function(){
+       	schoollist.push($(this).text());
+    });
+ 	$("#schooltext").val(schoollist.join(";"));
+}
+
+var id='[[${param.id}]]';
+function push_user(){
+	//新增的
+	if(id==''){
+		var url="[[${sysUrl}]]/sys/fx/checkMerchant";
+		var params ={ 'name' : $("#poscode").val()}
+		$.post(url,params,function(data){
+			if(data.meta.success){
+				save();
+			}else{
+				parent.layer.msg(data.meta.message,{icon:11});
+			}
+		});
+	}else{
+		//修改的
+		save();
+	}
+}
+
+function save(){
+	
+	 var schoollist=[];
+	 $.each($('stext'),function(){
+        schoollist.push($(this).data("val"));
+    });
+	parent.layer.confirm("您确定要保存商户信息?", {
+		icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+	}, function(){
+		var url="[[${sysUrl}]]/sys/fx/saveMerchant";
+		if( $("#poscode").val()==''){
+			alert("商户账号不能为空");
+			return ;
+		}
+		var params ={
+		 	'id' : id,
+            'posCode' : $("#poscode").val(),
+            'type' : $("#type").val(),
+            'level' : $("#level").val(),
+            'unitName' : $("#unitname").val(),
+            'legalPerson' : $("#legalperson").val(),
+            'phone' : $("#phone").val(),
+            'deputyName' : $("#deputyname").val(),
+            'deputyPhone' : $("#deputyphone").val(),
+            'status':$("#status").val(),
+            'parentPosCode':$("#parentposcode").val(),
+            'price':$("#price").val(),
+	 		'outPrice':$("#outPrice").val(),
+            'remarks':$("#remarks").val(),
+            'password':$("#password").val(),
+            
+            'startTime':$("#signTime").val(),
+            'endTime':$("#endSignTime").val(),
+            
+            'province':$("#province").val(),
+            'city':$("#city").val(),
+            'area':$("#area").val(),
+            'libId':$("#radiolibId").val(),
+            'location':
+            	($("#province option:selected").text()!='选择省' ? $("#province option:selected").text() : '') +
+            			($("#city option:selected").text()!='选择市' ? $("#city option:selected").text() : '') +
+            			($("#area option:selected").text()!='选择区' ? $("#area option:selected").text() : ''),
+            'schoollist':schoollist.join(";")
+        };
+		$.post(url,params,function(data){
+			if(data.meta.success){
+				parent.layer.msg("保存成功",{icon:1});
+				parent.location.reload();
+				parent.layer.close(parent.layer.getFrameIndex(window.name));
+			}else{
+				parent.layer.msg(data.meta.message,{icon:11});
+			}
+		});
+	});
+}
+
+
+
+</script>
+</html>

+ 619 - 0
src/main/resources/templates/sys/fx/merchantBackupList.html

@@ -0,0 +1,619 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	#mealServiceAdd .zwfb_shop_table {
+		margin-top: 10px
+	}
+	#mealServiceAdd tbody {
+	    display: table-row-group;
+	    vertical-align: middle;
+    	border-color: inherit;
+	}
+	#mealServiceAdd .fwmc_xxk {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#mealServiceAdd .fwmc_xxk li {
+	    float: left;
+	    width: 150px;
+	    height: 52px;
+	    border: 1px solid #ddd;
+	    font-size: 18px;
+	    color: #666;
+	    margin-right: 30px;
+	    text-align: center;
+	    margin-bottom: 25px;
+	    overflow: hidden;
+	    cursor: pointer;
+	}
+	#mealServiceAdd .fwmc_xxk li p {
+	    line-height: 18px;
+	    font-size: 12px;
+	    color: #999;
+	    margin-top: 5px;
+	}
+	#mealServiceAdd .zwsl_num {
+	    margin-left: 20px;
+	    font-size: 16px;
+	    color: #333;
+	}
+	#mealServiceAdd .zwsl_num span {
+	    color: #999;
+	    font-size: 12px;
+	    padding-left: 10px;
+	}
+	#mealServiceAdd .nmb_jj {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#mealServiceAdd .nmb_jj li.jian {
+	    border-right: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#mealServiceAdd .nmb_jj li {
+	    float: left;
+	    text-align: center;
+	    line-height: 30px;
+	    border: 1px solid #ddd;
+	    font-size: 20px;
+	    padding: 0 8px;
+	}
+	#mealServiceAdd .nmb_jj li .srkk {
+	    width: 30px;
+	    font-size: 16px;
+	    border: none;
+	    line-height: 30px;
+	    text-align: center;
+	    outline: 0;
+	    background: #FFF;
+	}
+	#mealServiceAdd .nmb_jj li.jia {
+	    border-left: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#mealServiceAdd a.ty_but {
+	    width: 130px;
+	    height: 40px;
+	    line-height: 40px;
+	    text-align: center;
+	    display: block;
+	    font-size: 16px;
+	    color: #fff;
+	    border-radius: 3px;
+	    background: #169ed8;
+	}
+	#mealServiceAdd a.ty_but:hover {
+	    background: #1187ba;
+	}
+	#mealServiceAdd .fwmc_xxk li.sign_type_select_on {
+	    background: url(/static/sys/images/fwkk.jpg) no-repeat center;
+	    color: #169ed8;
+	    border: 1px solid #169ed8;
+	}
+	
+</style>
+<body>
+
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/fx/merchantBackupList.html}" method="post">
+	<input type="hidden" name="reportType" id="reportType" />
+	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<ul class="seachform">
+		<li>
+		 <label>商户名称</label>
+		  <input name=LIKE_orgCode type="hidden" class="scinput" th:value="${search.get('LIKE_orgCode')}"/>
+		  <input name="LIKE_unitName" type="text" class="scinput" th:value="${search.get('LIKE_unitName')}"/>
+	    </li>
+		    
+	    <li>
+		 <label>商户账号</label>
+		  <input name="LIKE_posCode" type="text" class="scinput" th:value="${search.get('LIKE_posCode')}"/>
+	    </li>
+		    
+	    <li>
+		 <label>商户模式</label>
+		 	<select class="scinput select_width" name="signType" id="signType"   style="width: 150px;" >
+		 	 	<option value="" >全部</option>
+				<option value="0"  th:selected="${search.get('signType') eq '0' ? true : false}" >旧模式</option>
+				<option value="1"  th:selected="${search.get('signType') eq '1' ? true : false}">新模式</option>
+			</select>
+	    </li>
+	    
+	 	<li>
+		 <label>备份月份</label>
+		 <input type="text" id="EQ_backupMonth" name="EQ_backupMonth" th:value="${search.get('EQ_backupMonth')}"  onfocus="WdatePicker({dateFmt:'yyyy-MM'})" autocomplete="off"  class="scinput date_width " placeholder="备份月份">
+	    </li>
+	    
+		<li>
+			<input type="button" class="scbtn" value="查询" />
+		</li>
+
+	</ul>
+	</form>
+	<ul style="margin-bottom: 10px" >
+	  <li>
+		<input type="button" id="button" class="scbtn" value="导出商户" />
+      </li>
+	</ul>
+	 
+	
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+				<th >备份月份</th>
+		    	<th >商户账号</th>
+		    	<th >单位名称 </th>
+		    	<th >关联机构 </th>
+		    	<th >商户套餐 </th>
+		    	<th >商户模式 </th>
+		    	<th style="width: 60px;">签约端口数量</th>
+		    	<th style="width: 60px;">服务人数/塾币</th>
+		    	<th style="width: 60px;">平台塾币</th>
+		    	<th style="max-width: 160px;" >合同日期</th>
+		    	<th>充值/已结算(月份)</th>
+		    	<th style="width: 60px;" >激活开始日期</th>
+		    	<th style="width: 60px;" >激活结束日期</th>
+		    	<th style="width: 60px;" >计费开始日</th>
+		    	<th style="width: 60px;" >下个结算日</th>
+		        <th  >操作</th> 
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+					
+					<td th:title="${item.backupMonth}" th:text="${item.backupMonth}"></td>
+					<td th:title="${item.posCode}" th:text="${item.posCode}"></td>
+					<td th:title="${item.unitName}" th:text="${item.unitName}"></td>
+
+					<td  th:title="${item.libJoin!=null ? item.libJoin.leagueName : '' }" >
+						<a href="javascript:;" th:onclick="'openNew(\''+${item.libId}+'\')'" th:if="${item.libId!='' && item.libId!=null}"	class="tablelink">[[${item.libJoin.leagueName}]]</a>
+					</td>
+					
+					<td  th:switch="${item.mealType}">
+					   <span th:case="0" style="color:red">旧兼容模式</span>
+					   <span th:case="1" >优选套餐</span>
+					   <span th:case="2" >VIP套餐</span>
+					   <span th:case="3" >尊享套餐</span>
+					   <span th:case="*" style="color:red">旧兼容模式</span>
+					</td>
+					
+					<td  th:switch="${item.signType}">
+					   <span th:case="0" style="color:red">旧兼容模式</span>
+					   <span th:case="1" >服务包1</span>
+					   <span th:case="2" >服务包2</span>
+					   <span th:case="3" >服务包3</span>
+					   <span th:case="*" style="color:red">旧兼容模式</span>
+					</td>
+					
+					<td  th:text="${item.portNum}"></td>
+					<td  th:text="${item.libService}"></td>
+					<td  th:text="${item.platformService}"></td>
+					
+					<td th:title="${item.signTime!=null ?  #dates.format(item.signTime, 'yyyy-MM-dd')+'~'+#dates.format(item.endSignTime, 'yyyy-MM-dd') : '--' }"  th:text="${item.signTime!=null ?  #dates.format(item.signTime, 'yyyy-MM-dd')+'~'+#dates.format(item.endSignTime, 'yyyy-MM-dd') : '--' }"></td>
+					<td >
+					   <span th:if="${item.libServiceMonth>0  && ( item.signType==1 || item.signType==2 || item.signType==3 )}"  style="color: red">[[${item.libServiceMonth +' / '+ item.curIsSummary}]]</span>
+					   <span th:if="${item.nextSummaryTime==null && ( item.signType==1 || item.signType==2 || item.signType==3 )}" >已结清</span>
+					</td>
+					<td  th:text="${#calendars.format(item.startActiveTime,'yyyy-MM-dd')}" ></td> 
+					<td  th:text="${#calendars.format(item.activeTime,'yyyy-MM-dd')}" ></td> 
+					<td  th:text="${#calendars.format(item.computeTime,'yyyy-MM-dd')}" ></td> 
+					<td  th:text="${#calendars.format(item.nextSummaryTime,'yyyy-MM-dd')}" ></td> 
+				
+					<td  >   
+						<a href="javascript:;" th:onclick="'infomerchant(\''+${item.id}+'\')'"  	class="tablelink">查看</a>
+					 </td>  
+			</tr>
+		</tbody>
+	</table> 
+	
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+</body>
+
+
+<script type="text/javascript">
+
+
+$(function () {
+	
+	$("#reduce_num").click(function (){
+		if($("#add_service_num").val()<=1){
+			parent.layer.msg("塾币不能小于1。",{icon:11});
+			return;
+		}
+		$("#add_service_num").val(parseInt($("#add_service_num").val())-1);
+	});
+	
+	$("#add_num").click(function (){
+		$("#add_service_num").val(parseInt($("#add_service_num").val())+1);
+	});
+	
+	$("#meal_reduce_num").click(function (){
+		if($("#meal_add_service_num").val()<=1){
+			parent.layer.msg("添加加油包数量不能小于1",{icon:11});
+			return;
+		}
+		$("#meal_add_service_num").val(parseInt($("#meal_add_service_num").val())-1);
+	});
+	
+	$("#meal_add_num").click(function (){
+		$("#meal_add_service_num").val(parseInt($("#meal_add_service_num").val())+1);
+	});
+	
+	$(".sign_type_select").click(function (){
+		$(".sign_type_select").removeClass("sign_type_select_on");
+		$(this).addClass("sign_type_select_on");
+	});
+	
+
+})
+
+
+function save(){
+	var type= $("#service_type").val();
+	var num=$("#add_service_num").val();
+	var merchantId=$("#merchant_id").val();
+	
+	var url="[[${sysUrl}]]/sys/fx/merchant/update/"+merchantId;
+	var params ={
+        'type' : type,
+        'num':num
+    };
+	$.post(url,params,function(data){
+		if(data.meta.success){
+			parent.layer.msg("设置成功",{icon:1});
+			parent.location.reload();
+			parent.layer.close(parent.layer.getFrameIndex(window.name));
+		}else{
+			parent.layer.msg(data.meta.message,{icon:11});
+		}
+	});
+}
+
+
+function joinServiceAdd(type){
+	var title='';
+	if(type==1){
+		title="添加机构塾币";
+	}else if(type==3){
+		title="添加平台塾币";
+	}else{
+		title="添加机构端口";
+	}
+	$("#add_service_num").val(1)
+	 $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+$("#merchant_id").val(),
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  $("#service_type").val(type);
+	    		  layer.open({
+	    			    type: 1,
+	    			    title: title,
+	    			    closeBtn: 1, //不显示关闭按钮
+	    			    shift: 0.8,
+	    			    offset: '150px',
+	    			    area: ['40%', '40%'],
+	    			    content: $("#joinServiceAdd")
+	    			});
+	    		  
+	    	  }else{
+	    		  parent.layer.msg(responseStr.meta.message,{icon:11});
+	    	  }
+	      }
+	      ,
+	      error : function (responseStr) {
+	    	  parent.layer.msg("查询失败,请刷新后重试!",{icon:11});
+	      }
+	  });
+	
+
+}
+
+
+function mealServiceAdd(id){
+	  $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+id,
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  $("#meal_merchant_id").val(id);
+	    		  var meal_merchant_li1="旧兼容模式";
+	    		  switch (responseStr.data.merchant.signType) {
+					case 1:
+						meal_merchant_li1="优选套餐";
+						break;
+					case 2:
+						meal_merchant_li1="VIP套餐";
+						break;
+					case 3:
+						meal_merchant_li1="尊享套餐";
+						break;
+					default:
+						break;
+					}
+	    		  $("#meal_merchant_li1").html("["+responseStr.data.merchant.unitName+"] 商户当前套餐模式:"+meal_merchant_li1);
+	    		  $("#meal_merchant_li2").html("["+responseStr.data.merchant.unitName+"] 商户当前套餐人数:"+responseStr.data.merchant.libService);
+	    		  layer.open({
+    			    type: 1,
+    			    title: "["+responseStr.data.merchant.unitName+"]"+' 添加加油包',
+    			    closeBtn: 1, //不显示关闭按钮
+    			    shift: 0.8,
+    			    offset: '150px',
+    			    area: ['40%', '40%'],
+    			    content: $("#mealServiceAdd")
+    			 });
+	    	  }else{
+	    		  parent.layer.msg(responseStr.meta.message,{icon:11});
+	    	  }
+	      }
+	      ,
+	      error : function (responseStr) {
+	    	  parent.layer.msg("查询失败,请刷新后重试!",{icon:11});
+	      }
+	  });
+}
+
+
+
+function saveMeal(){
+	parent.layer.confirm("确定为此商户添加加油包?", {
+		icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+	}, function(){
+		var type=$(".sign_type_select_on").data("type");
+		var num=$("#meal_add_service_num").val();
+		var merchantId=$("#meal_merchant_id").val();
+		var url="[[${sysUrl}]]/sys/fx/merchant/updateMeal/"+merchantId;
+		var params ={
+	        'num':num,
+	        'type':type
+	    };
+		$.post(url,params,function(data){
+			if(data.meta.success){
+				parent.layer.msg("添加成功",{icon:1});
+				parent.location.reload();
+				parent.layer.close(parent.layer.getFrameIndex(window.name));
+			}else{
+				parent.layer.msg(data.meta.message,{icon:11});
+			}
+		});
+	});
+}
+
+
+
+
+function joinServiceEdit(id){
+	  $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+id,
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  
+	    		  $("#merchant_id").val(id);
+	    		  $("#lib_service_num").html(responseStr.data.merchant.libService);
+	    		  $("#platform_service_num").html(responseStr.data.merchant.platformService);
+	    		  $("#port_num").html(responseStr.data.merchant.portNum);
+	    		  
+	    		  if(responseStr.data.isPortNum){
+	    			  $(".isportnum").show();
+	    		  }else{
+	    			  $(".isportnum").hide();
+	    		  }
+	    		  
+	    		  layer.open({
+    			    type: 1,
+    			    title: '管理塾币',
+    			    closeBtn: 1, //不显示关闭按钮
+    			    shift: 0.8,
+    			    offset: '150px',
+    			    area: ['40%', '40%'],
+    			    content: $("#joinServiceEdit")
+	    		 });
+	    		  
+	    	  }else{
+	    		  parent.layer.msg(responseStr.meta.message,{icon:11});
+	    	  }
+	      }
+	      ,
+	      error : function (responseStr) {
+	    	  parent.layer.msg("查询失败,请刷新后重试!",{icon:11});
+	      }
+	  });
+}
+</script>
+
+<script type="text/javascript">
+
+	function  openNew(libId) {
+		//@{/sys/admin/curator/index.html(libId=${item.libId})}
+		window.open('[[${sysUrl}]]/sys/admin/curator/index.html?libId='+libId);
+	}
+		function merchantallot(type){
+			var id=$("#merchant_id").val();
+			var title="";
+			if(type==1){
+				title="分配机构塾币";
+			}else{
+				title="分配平台塾币";
+			}
+			layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '150px',
+			    area: ['40%', '40%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantAllot.html?id='+id+'&type='+type
+			});
+		}
+
+		
+		
+		
+		function infomerchant(id){
+			var title="查看商户";
+			
+			parent.layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '10px',
+			    area: ['90%', '95%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantBackupInfo.html?id='+id
+			});
+		}
+
+
+		function savemerchant(id){
+			var title="开通商户";
+			if(id!=null && id!='' && id!=undefined){
+				title="修改商户";
+			}
+			parent.layer.open({
+			    type: 2,
+			    title: title,
+			    closeBtn: 1, //不显示关闭按钮
+			    shift: 0.8,
+			    offset: '10px',
+			    area: ['90%', '95%'],
+			    content: '[[${sysUrl}]]/sys/fx/merchantAdd.html?id='+id
+			});
+		}
+		
+		
+		
+		function untyingmerchant(id){
+			
+			parent.layer.confirm("确定解绑机构?<br/>此动作会清空机构下塾币<br/>但此商户下的塾币会保留", {
+				icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+			}, function(){
+				$.ajax({
+					url : "[[${sysUrl}]]/sys/fx/merchant/untying",
+					type : "post",
+					data : {id:id},
+					dataType : "json",
+					success : function(data) {
+						if(data.meta.success){
+							parent.layer.msg("操作成功",{icon:1});
+					    	setTimeout(function(){
+					    		location.reload();
+							},1000);
+						}else{
+							alert("操作异常,请刷新后重试...")
+						}
+					}
+				});
+			});
+			
+		}
+
+
+		function updatemerchant(id,status){  
+			
+			if(status==4){
+				parent.layer.confirm("确定操作删除?", {
+					icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+				}, function(){
+					$.ajax({
+						url : "[[${sysUrl}]]/sys/fx/updateMerchant",
+						type : "post",
+						data : {id:id,status:status},
+						dataType : "json",
+						success : function(data) {
+							if(data.meta.success){
+								parent.layer.msg("操作成功",{icon:1});
+						    	setTimeout(function(){
+						    		location.reload();
+								},1000);
+							}else{
+								alert("操作异常,请刷新后重试...")
+							}
+						}
+					});
+				});
+			}else{
+				
+				$.ajax({
+					url : "[[${sysUrl}]]/sys/fx/updateMerchant",
+					type : "post",
+					data : {id:id,status:status},
+					dataType : "json",
+					success : function(data) {
+						if(data.meta.success){
+							parent.layer.msg("操作成功",{icon:1});
+					    	setTimeout(function(){
+					    		location.reload();
+							},1000);
+						}else{
+							alert("操作异常,请刷新后重试...")
+						}
+					}
+				});
+			}
+		}
+	
+	
+</script>
+
+<script type="text/javascript">
+$("#button").on('click',function(){
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportMerchantBackup";
+	$("#seachform").submit();
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantBackupList.html";
+});
+</script>
+
+
+
+
+</html>

+ 92 - 42
src/main/resources/templates/sys/fx/merchantInfo.html

@@ -59,11 +59,13 @@ dtext{
 	color: red;
 	cursor: pointer;
 }  
- .forminfo li label{
-	width: 180px;
+
+.forminfo li label{
+	width: 250px;
 	text-align: right;
 	padding-right: 10px
 }
+  
    
 </style>
 <body>
@@ -115,73 +117,121 @@ dtext{
 				</div>
 			</li>
 
+		<li>
+				<label>套餐:套餐类型<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="mealType" id="mealType" class="select1"  disabled="disabled"> 
+						<option value="0" th:selected="${merchant.mealType==0 ? true : false}">合同签约模式(旧模式)</option>
+						<option value="1" th:selected="${merchant.mealType==1 ? true : false}">优选套餐</option>
+						<option value="2" th:selected="${merchant.mealType==2 ? true : false}">VIP套餐</option>
+						<option value="3" th:selected="${merchant.mealType==3 ? true : false}">尊享套餐</option>
+					</select>
+				</div>
+			</li>
+			
 			<li>
-				<label>套餐:套餐模式<b>*</b></label>
+				<label>套餐:服务包类型<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
-					<select name="signType" id="signType" class="select1" disabled="disabled"  > 
-						<option value="0" th:selected="${merchant.signType==0 ? true : false}">旧模式</option>
-						<option value="1" th:selected="${merchant.signType==1 ? true : false}">优选套餐</option>
-						<option value="2" th:selected="${merchant.signType==2 ? true : false}">VIP套餐</option>
-						<option value="3" th:selected="${merchant.signType==3 ? true : false}">尊享套餐</option>
+					<select name="signType" id="signType" class="select1"  disabled="disabled"> 
+						<option value="0" th:selected="${merchant.signType==0 ? true : false}">合同签约模式(旧模式</option>
+						<option value="1" th:selected="${merchant.signType==1 ? true : false}">服务包1</option>
+						<option value="2" th:selected="${merchant.signType==2 ? true : false}">服务包2</option>
+						<option value="3" th:selected="${merchant.signType==3 ? true : false}">服务包3</option>
 					</select>
 				</div>
+				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red">[修改套餐模式,不会影响加油包有效性 ]</text>
 			</li>
+			
 
 			<li>
-				<label>[合同签约]/[套餐模式]时间:<b >*</b></label>
-				<input type="text" id="signTime" disabled="disabled" name="signTime"  onclick="WdatePicker()" th:value="${#dates.format(merchant.signTime, 'yyyy-MM-dd')}" class="scinput date_width " placeholder="开始时间">
+				<label>合同日期:<b >*</b></label>
+				<input type="hidden"  id="minDate" value="2020-01-01" disabled="disabled">
+				<input disabled="disabled" type="text" id="signTime" name="signTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'minDate\')}'})" autocomplete="off" th:value="${#dates.format(merchant.signTime, 'yyyy-MM-dd')}" class="scinput date_width " placeholder="合同开始日期">
 				&nbsp;&nbsp;&nbsp;~~&nbsp;&nbsp;
-				<input type="text" id="endSignTime" disabled="disabled" name="endSignTime"  onclick="WdatePicker()" th:value="${#dates.format(merchant.endSignTime, 'yyyy-MM-dd')}" class="scinput date_width" placeholder="结束时间">
+				<input disabled="disabled" type="text" id="endSignTime" name="endSignTime"   onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'signTime\')}'})"  autocomplete="off" th:value="${#dates.format(merchant.endSignTime, 'yyyy-MM-dd')}" class="scinput date_width" placeholder="合同结束日期">
 			</li>
 			
 			<li>
-				<label>签约数量(练习册用):<b>*</b></label>
-				<input type="text" id="signService" disabled="disabled"  class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}"/>
+				<label><b >【服务包模式】</b>充值月份数:<b>*</b></label>
+				<input disabled="disabled" type="number" id="libServiceMonth" min="0" class="dfinput fl" name="libServiceMonth" th:value="${merchant.libServiceMonth!=null ? merchant.libServiceMonth : 0}" autocomplete="off"/>
+				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red">[增量添加数值为续费开通 ]</text>
 			</li>
 			
 			<li>
-				<label>合同硬件采购数量:<b>*</b></label>
-				<input type="text" id="hardwareService" disabled="disabled"  class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}"/>
+				<label><b >【服务包模式】</b>激活开始日期:<b >*</b></label>
+				<input disabled="disabled" type="text"  class="dfinput fl"  id="startActiveTime" name="startActiveTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.startActiveTime, 'yyyy-MM-dd')}" placeholder="合同开始激活日期">
+			</li>
+			<li>
+				<label><b >【服务包模式】</b>激活结束日期:<b >*</b></label>
+				<input disabled="disabled" type="text"  class="dfinput fl"  id="activeTime" name="activeTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.activeTime, 'yyyy-MM-dd')}" placeholder="合同结束激活日期">
 			</li>
 			
+			<li>
+				<label><b >【服务包模式】</b>计费开始日期:<b ></b></label>
+				<input disabled="disabled" type="text"  class="dfinput fl"  id="computeTime" name="computeTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.computeTime, 'yyyy-MM-dd')}" placeholder="计费开始日期">
+			</li>
+			
+						<li>
+				<label>签约数量(练习册用):<b>*</b></label>
+				<input disabled="disabled" type="text" id="signService" class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}" autocomplete="off"/>
+			</li>
 			
+			<li>
+				<label>合同硬件采购数量:<b>*</b></label>
+				<input disabled="disabled" type="text" id="hardwareService" class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}" autocomplete="off"/>
+			</li>
 			
 			<li >
-				<label>上级商户:上级渠道:<b >*</b></label>
+				<label>上级渠道<b >*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
-					<select name="parentposcode" id="parentposcode" disabled="disabled" class="select1" > 
+					<select disabled="disabled" name="parentposcode" id="parentposcode" class="select1" th:disabled="${merchant.id!=null || curMerchant.orgCode ne 'SSJ-FX' ? 'true' : 'false'}" > 
 						<option th:if="${merchant.id==null || merchant.parentPosCode=='' || merchant.parentPosCode==null }" data-orgcode="" data-id="" value="" >无商户上级</option>
 						<option th:each="item:${poslist}" th:selected="${merchant.id==null ?  (curMerchant.posCode  eq item.posCode ? true : false) : (merchant.parentPosCode  eq item.posCode ? true : false)}" th:if="${item.orgCode ne 'SSJ-FX' && #strings.contains(item.orgCode,curMerchant.orgCode) }" th:data-orgcode="${item.orgCode}" th:data-id="${item.id}" th:value="${item.posCode}" th:text="${item.unitName}+' ['+${item.posCode}+']'"></option>
 					</select>
 				</div>
 			</li>
-			
-			<li>
+
+			<li th:if="${curMerchant.orgCode eq 'SSJ-FX'}" >
 				<label>商户级别:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="level" id="level" class="select1" disabled="disabled"> 
-						<option value="" >无</option>
+						<option value="4" th:selected="${merchant.level==4 ? true : false}">普通</option>
 						<option value="1" th:selected="${merchant.level==1 ? true : false}">市代</option>
 						<option value="2" th:selected="${merchant.level==2 ? true : false}">区代</option>
 						<option value="3" th:selected="${merchant.level==3 ? true : false}">学校独家</option>
-						<option value="4" th:selected="${merchant.level==4 ? true : false}">普通</option>
 					</select>
 				</div>
 			</li>
 			
-			<li>
+			<li th:if="${curMerchant.orgCode ne 'SSJ-FX'}" >
+				<label>商户级别:<b>*</b></label>
+				<div class="vocation" style="margin-right: 5px; width: 345px">
+					<select name="level" id="level" class="select1" disabled="disabled"> 
+						<option value="4" th:if="${curMerchant.level<=1 || curMerchant.level<=2 || curMerchant.level<=3}" th:selected="${merchant.level==4 ? true : false}">普通</option>
+						<option value="2" th:if="${curMerchant.level<=1}" th:selected="${merchant.level==2 ? true : false}">区代</option>
+						<option value="3" th:if="${curMerchant.level<=1 || curMerchant.level<=2}" th:selected="${merchant.level==3 ? true : false}">学校独家</option>
+						
+					</select>
+				</div>
+			</li>
+			
+			<li  >
 				<label>商户类型:<b>*</b></label>
-				<div class="vocation" style="margin-right: 5px; width: 345px" disabled="disabled">
+				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="type" id="type" class="select1" disabled="disabled"> 
-						<option value="1" th:selected="${merchant.type==1 ? true : false}">直接签约</option>
+						<option value="5" th:selected="${merchant.type==5 ? true : false}">直接签约(新模式)</option>
+						<option value="1" th:selected="${merchant.type==1 ? true : false}">直接签约(旧模式)</option>
 						<option value="2" th:selected="${merchant.type==2 ? true : false}">内部消耗</option>
 						<option value="3" th:selected="${merchant.type==3 ? true : false}">外部签约</option>
 						<option value="4" th:selected="${merchant.type==4 ? true : false}">内部不结算(财务)</option>
+						<option value="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
+						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
 					</select>
 				</div>
 			</li>
 			
-			 <li>
+			
+			<li style="display: none;">
 				<label>签约状态:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="status" id="status" class="select1" disabled="disabled"> 
@@ -193,49 +243,49 @@ dtext{
 				</div>
 			</li>
 				
-		 	 <li>
-				<label>服务:签约单价<b>*</b></label>
-				<div class="vocation" style="margin-right: 5px; width: 345px">
-					<select name="price" id="price" class="select1" disabled="disabled"> 
-						<option value="0" th:selected="${merchant.price!=50.0 && merchant.price!=55.0 && merchant.price!=68.0 ? true : false}">请选择</option>
-						<option value="50" th:selected="${merchant.price==50.0 ? true : false}">50.0</option>
-						<option value="55" th:selected="${merchant.price==55.0 ? true : false}">55.0</option>
-						<option value="68" th:selected="${merchant.price==68.0 ? true : false}">68.0</option>
-					</select>
-				</div>
+		    <li>
+				<label>服务包充值金额 / 服务:签约单价<b></b></label>
+				<input disabled="disabled" type="text" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off"/>
+			</li>
+			
+			<li>
+				<label><b >【服务包模式】</b>平台管理费金额<b></b></label>
+				<input disabled="disabled" type="text" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}" autocomplete="off"/>
 			</li>
 			
 			<li>
 				<label>硬件:签约单价<b></b></label>
-				<input type="text" id="hardwarePrice" class="dfinput fl" disabled="disabled" name="hardwarePrice" th:value="${merchant.hardwarePrice}"/>
+				<input disabled="disabled" type="text" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice}" autocomplete="off"/>
 			</li>
 			
 			<li>
 				<label>法人姓名 :<b></b></label>
-				<input type="text" id="legalperson" class="dfinput fl" disabled="disabled" name="legalperson" th:value="${merchant.legalPerson}"/>
+				<input disabled="disabled" type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}" autocomplete="off"/>
 			</li>
 			<li>
 				<label>法人电话:<b></b></label>
-				<input type="text" id="phone" class="dfinput fl" disabled="disabled" name="phone" th:value="${merchant.phone}"/>
+				<input disabled="disabled" type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off"/>
 			</li>
 			<li>
 				<label>代表姓名:<b></b></label>
-				<input type="text" id="deputyname" class="dfinput fl" disabled="disabled" name="deputyname"  th:value="${merchant.deputyName}"/>
+				<input disabled="disabled" type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off"/>
 			</li>
 			<li>
 				<label>代表电话:<b></b></label>
-				<input type="text" id="deputyphone" class="dfinput fl" disabled="disabled" name=deputyphone th:value="${merchant.deputyPhone}"/>
+				<input disabled="disabled" type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off"/>
 			</li>
 		
 			<li>
 				<label>商户备注:<b></b></label>
-				<input type="text" id="remarks" class="dfinput fl" disabled="disabled" name="remarks"  th:value="${merchant.remarks}"/>
+				<input disabled="disabled" type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off"/>
 			</li>
+
 			<li>
 				<label>地址:<b></b></label>
-				<input type="text" id="address" class="dfinput fl" disabled="disabled" name="address"  th:value="${merchant.address}"/>
+				<input disabled="disabled" type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off"/>
 			</li>
 			
+			
 		
 		</ul>
 		<br/><br/><br/>