wuwen il y a 4 ans
Parent
commit
8185485a48

+ 84 - 23
src/main/java/com/ssj/bean/sys/fx/domain/Merchant.java

@@ -70,14 +70,8 @@ public class Merchant extends BaseEntity {
 	
 	private Integer portNum;
 	
-	private Integer portNumOdd;
-	
 	private Integer libService;
 	
-	private Integer libServiceOdd;
-	
-	private Date changeTime;
-	
 	private Integer libServiceMonth;
 	
 	private Integer platformService;
@@ -110,7 +104,24 @@ public class Merchant extends BaseEntity {
 	
 	private Date computeTime;
 	
-
+	private Double munitPrice;
+	
+	private String signerPerson;
+	
+	private String contractNo;
+	
+	private Date contractTime;
+	
+	private Integer posType;
+	
+	private Integer buyMonth;
+	
+	private Integer giveMonth;
+	
+    private Double plusAmountPrice;
+    
+    private Double plusMonthPrice;
+	
 	@Transient
 	private List<Merchant> subMerchants=new ArrayList<Merchant>();
 	
@@ -436,36 +447,86 @@ public class Merchant extends BaseEntity {
 		this.startActiveTime = startActiveTime;
 	}
 
-	public Integer getLibServiceOdd() {
-		return libServiceOdd;
+
+	public Date getEndActiveTime() {
+		return endActiveTime;
 	}
 
-	public void setLibServiceOdd(Integer libServiceOdd) {
-		this.libServiceOdd = libServiceOdd;
+	public void setEndActiveTime(Date endActiveTime) {
+		this.endActiveTime = endActiveTime;
 	}
 
-	public Date getChangeTime() {
-		return changeTime;
+
+	public Double getMunitPrice() {
+		return munitPrice;
 	}
 
-	public void setChangeTime(Date changeTime) {
-		this.changeTime = changeTime;
+	public void setMunitPrice(Double munitPrice) {
+		this.munitPrice = munitPrice;
 	}
 
-	public Integer getPortNumOdd() {
-		return portNumOdd;
+	public String getSignerPerson() {
+		return signerPerson;
 	}
 
-	public void setPortNumOdd(Integer portNumOdd) {
-		this.portNumOdd = portNumOdd;
+	public void setSignerPerson(String signerPerson) {
+		this.signerPerson = signerPerson;
 	}
 
-	public Date getEndActiveTime() {
-		return endActiveTime;
+	public String getContractNo() {
+		return contractNo;
 	}
 
-	public void setEndActiveTime(Date endActiveTime) {
-		this.endActiveTime = endActiveTime;
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+
+	public Date getContractTime() {
+		return contractTime;
+	}
+
+	public void setContractTime(Date contractTime) {
+		this.contractTime = contractTime;
+	}
+
+	public Integer getPosType() {
+		return posType;
+	}
+
+	public void setPosType(Integer posType) {
+		this.posType = posType;
+	}
+
+	public Integer getBuyMonth() {
+		return buyMonth;
+	}
+
+	public void setBuyMonth(Integer buyMonth) {
+		this.buyMonth = buyMonth;
+	}
+
+	public Integer getGiveMonth() {
+		return giveMonth;
+	}
+
+	public void setGiveMonth(Integer giveMonth) {
+		this.giveMonth = giveMonth;
+	}
+
+	public Double getPlusAmountPrice() {
+		return plusAmountPrice;
+	}
+
+	public void setPlusAmountPrice(Double plusAmountPrice) {
+		this.plusAmountPrice = plusAmountPrice;
+	}
+
+	public Double getPlusMonthPrice() {
+		return plusMonthPrice;
+	}
+
+	public void setPlusMonthPrice(Double plusMonthPrice) {
+		this.plusMonthPrice = plusMonthPrice;
 	}
 	
 	

+ 82 - 22
src/main/java/com/ssj/bean/sys/fx/domain/MerchantBackup.java

@@ -70,14 +70,8 @@ public class MerchantBackup extends BaseEntity {
 	
 	private Integer portNum;
 	
-	private Integer portNumOdd;
-	
 	private Integer libService;
 	
-	private Integer libServiceOdd;
-	
-	private Date changeTime;
-	
 	private Integer libServiceMonth;
 	
 	private Integer platformService;
@@ -110,6 +104,24 @@ public class MerchantBackup extends BaseEntity {
 	
 	private Date computeTime;
     
+	private Double munitPrice;
+	
+	private String signerPerson;
+	
+	private String contractNo;
+	
+	private Date contractTime;
+	
+	private Integer posType;
+	
+	private Integer buyMonth;
+	
+	private Integer giveMonth;
+	
+    private Double plusAmountPrice;
+    
+    private Double plusMonthPrice;
+	
 	private String backupMonth;
 
 	@Transient
@@ -445,36 +457,84 @@ public class MerchantBackup extends BaseEntity {
 		this.backupMonth = backupMonth;
 	}
 
-	public Integer getPortNumOdd() {
-		return portNumOdd;
+	public Date getEndActiveTime() {
+		return endActiveTime;
 	}
 
-	public void setPortNumOdd(Integer portNumOdd) {
-		this.portNumOdd = portNumOdd;
+	public void setEndActiveTime(Date endActiveTime) {
+		this.endActiveTime = endActiveTime;
 	}
 
-	public Integer getLibServiceOdd() {
-		return libServiceOdd;
+	public String getSignerPerson() {
+		return signerPerson;
 	}
 
-	public void setLibServiceOdd(Integer libServiceOdd) {
-		this.libServiceOdd = libServiceOdd;
+	public void setSignerPerson(String signerPerson) {
+		this.signerPerson = signerPerson;
 	}
 
-	public Date getChangeTime() {
-		return changeTime;
+	public String getContractNo() {
+		return contractNo;
 	}
 
-	public void setChangeTime(Date changeTime) {
-		this.changeTime = changeTime;
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
 	}
 
-	public Date getEndActiveTime() {
-		return endActiveTime;
+	public Date getContractTime() {
+		return contractTime;
 	}
 
-	public void setEndActiveTime(Date endActiveTime) {
-		this.endActiveTime = endActiveTime;
+	public void setContractTime(Date contractTime) {
+		this.contractTime = contractTime;
+	}
+
+	public Integer getPosType() {
+		return posType;
+	}
+
+	public void setPosType(Integer posType) {
+		this.posType = posType;
+	}
+
+	public Double getMunitPrice() {
+		return munitPrice;
+	}
+
+	public void setMunitPrice(Double munitPrice) {
+		this.munitPrice = munitPrice;
+	}
+
+	public Integer getBuyMonth() {
+		return buyMonth;
+	}
+
+	public void setBuyMonth(Integer buyMonth) {
+		this.buyMonth = buyMonth;
+	}
+
+	public Integer getGiveMonth() {
+		return giveMonth;
+	}
+
+	public void setGiveMonth(Integer giveMonth) {
+		this.giveMonth = giveMonth;
+	}
+
+	public Double getPlusAmountPrice() {
+		return plusAmountPrice;
+	}
+
+	public void setPlusAmountPrice(Double plusAmountPrice) {
+		this.plusAmountPrice = plusAmountPrice;
+	}
+
+	public Double getPlusMonthPrice() {
+		return plusMonthPrice;
+	}
+
+	public void setPlusMonthPrice(Double plusMonthPrice) {
+		this.plusMonthPrice = plusMonthPrice;
 	}
 
 }

+ 3 - 3
src/main/java/com/ssj/service/sys/fx/service/MerchantService.java

@@ -14,15 +14,15 @@ import com.ssj.framework.core.common.service.BaseService;
 public interface MerchantService extends BaseService<Merchant, String> {
 	
 	//保存旧模式的商户
-	Response saveMerchantByUsed(Merchant merchant,String startTime,String endTime
+	Response saveMerchantByUsed(Merchant merchant,String startTime,String endTime,String contractTimeStr
     		,String password,String province,String city,String area,String schoollist,String location,Admin curadmin);
 	
 	//保存新模式的商户
-	Response saveMerchantByNew(Merchant merchant,String startTime,String endTime,String startActiveTimeStr,String activeTimeStr,String computeTimeStr
+	Response saveMerchantByNew(Merchant merchant,String startTime,String endTime,String startActiveTimeStr,String activeTimeStr,String computeTimeStr,String contractTimeStr
     		,String password,String province,String city,String area,String schoollist,String location,Admin curadmin);
 	
 	//保存新模式的商户
-	Response saveMerchantByNew_Sc(Merchant merchant,String startTime,String endTime,String activeTimeStr,String endActiveTimeStr
+	Response saveMerchantByNew_Sc(Merchant merchant,String startTime,String endTime,String activeTimeStr,String endActiveTimeStr,String contractTimeStr
     		,String password,String province,String city,String area,String schoollist,String location,Admin curadmin);
 	
 	//导入商户数据,生成帐号

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

@@ -51,21 +51,21 @@ public class MerchantBackupServiceImpl extends BaseServiceImpl<MerchantBackup, S
     
 	@Override
 	public void runMerchantBackup() {
-		logger.info("月最后一天备份保存上个月的商户数据,任务开始...");
+		logger.info("备份保存上个月的商户数据,任务开始...");
 		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(DateHelper.getLastMonthFirstDay(new Date()), "yyyy-MM"));
+				merchantBackup.setBackupMonth(DateHelper.formatDateByFormat(DateHelper.getLastMonthFirstDay(new Date()), "yyyy-MM").replace("/", ""));
 				merchantBackups.add(merchantBackup);
 			} catch (Exception e) {
 				e.printStackTrace();
 			}
 		}
 		this.save(merchantBackups);
-		logger.info("月最后一天备份保存上个月的商户数据,任务结束。.");
+		logger.info("备份保存上个月的商户数据,任务结束。.");
 	}
     
     

+ 50 - 21
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantServiceImpl.java

@@ -60,8 +60,6 @@ import com.ssj.service.weixin.push.service.PushTemplateService;
 import com.ssj.service.weixin.sales.service.LibVipServiceService;
 import com.ssj.taskthread.ThreadPool;
 
-import sun.swing.StringUIClientPropertyKey;
-
 
 @Service
 public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> implements MerchantService {
@@ -1225,8 +1223,7 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 	@Override
 	@Transactional
 	public Response saveMerchantByUsed(
-			Merchant merchant,
-			String startTime,String endTime,String password,String province,String city,String area,String schoollist,String location,
+			Merchant merchant,String startTime,String endTime,String contractTimeStr,String password,String province,String city,String area,String schoollist,String location,
 			Admin curadmin) {
 		
 		Response response=new Response();
@@ -1261,6 +1258,14 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				oldmerchant.setLibServiceMonth(0);
 				oldmerchant.setLocation(location);
 				
+				oldmerchant.setMunitPrice(merchant.getMunitPrice());
+				oldmerchant.setSignerPerson(merchant.getSignerPerson());
+				oldmerchant.setContractNo(merchant.getContractNo());
+				//合同签约时间
+				if(StringUtils.isNotEmpty(contractTimeStr)) {
+					oldmerchant.setContractTime(DateHelper.parseDate(contractTimeStr, "yyyy-MM-dd"));
+				}
+				
 				//删除所有关联的学校
 				List<MerchantArea> merchantAreas=merchantAreaService.findSchoolByMerchantList(merchant.getId());
 				for (MerchantArea merchantArea : merchantAreas) {
@@ -1343,6 +1348,7 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				merchant.setHardwareService(0);
 				merchant.setHardwarePrice((double)0);
 				merchant.setLibServiceMonth(0);
+				merchant.setContractTime(startTime!=null ? DateHelper.parseDate(contractTimeStr, "yyyy-MM-dd") : null);
 				merchant.setSignTime(startTime!=null ? DateHelper.parseDate(startTime, "yyyy-MM-dd"): null);
 				merchant.setEndSignTime(endTime!=null ? DateHelper.parseDate(endTime, "yyyy-MM-dd"): null);
 				merchant.setCreateTime(new Date());
@@ -1415,24 +1421,18 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 	@Transactional
 	public Response saveMerchantByNew(
 				Merchant merchant,
-				String startTime,String endTime,String startActiveTimeStr,String activeTimeStr,String computeTimeStr,String password,String province,String city,String area,String schoollist,String location,
+				String startTime,String endTime,String startActiveTimeStr,String activeTimeStr,String computeTimeStr,String contractTimeStr,String password,String province,String city,String area,String schoollist,String location,
 				Admin curadmin) {
 		Response response=new Response();
 		
+		
 		if(StringUtils.isNotEmpty(merchant.getId())){
-				
+			
 				boolean isSignType=false;//修改了服务包
 				boolean isServiceMonth=false;//修改了月份
 				
 				Merchant oldmerchant =this.getById(merchant.getId());
 				
-				//发生了旧转新,记录旧模式的币,端,当前时间。
-				if(oldmerchant.getSignType()==0) {
-					oldmerchant.setLibServiceOdd(oldmerchant.getLibService());
-					oldmerchant.setPortNumOdd(oldmerchant.getPortNum());
-					oldmerchant.setChangeTime(new Date());
-				}
-				
 				if(StringUtils.isNotEmpty(merchant.getLibId())) {
 					Merchant libMerchant=this.getMerchantByLibId(merchant.getLibId());
 					if(libMerchant!=null && !libMerchant.getId().equals(merchant.getId())) {
@@ -1477,6 +1477,19 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				oldmerchant.setLibServiceMonth(merchant.getLibServiceMonth());
 				oldmerchant.setLocation(location);
 				
+				oldmerchant.setMunitPrice(merchant.getMunitPrice());
+				oldmerchant.setSignerPerson(merchant.getSignerPerson());
+				oldmerchant.setBuyMonth(merchant.getBuyMonth());
+				oldmerchant.setGiveMonth(merchant.getGiveMonth());
+				oldmerchant.setContractNo(merchant.getContractNo());
+				oldmerchant.setPlusAmountPrice(merchant.getPlusAmountPrice());
+				oldmerchant.setPlusMonthPrice(merchant.getPlusMonthPrice());
+				
+				//合同签约时间
+				if(StringUtils.isNotEmpty(contractTimeStr)) {
+					oldmerchant.setContractTime(DateHelper.parseDate(contractTimeStr, "yyyy-MM-dd"));
+				}
+				
 				//合同日期
 				if(StringUtils.isNotEmpty(startTime)) {
 					oldmerchant.setSignTime(DateHelper.parseDate(startTime, "yyyy-MM-dd"));
@@ -1637,6 +1650,10 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				merchant.setSaleLoginName(curadmin.getLoginName());
 				merchant.setCurIsSummary(0);
 				
+				//合同签约时间
+				if(StringUtils.isNotEmpty(contractTimeStr)) {
+					merchant.setContractTime(DateHelper.parseDate(contractTimeStr, "yyyy-MM-dd"));
+				}
 				if(StringUtils.isNotEmpty(startActiveTimeStr)) {
 					merchant.setStartActiveTime(DateHelper.parseDate(startActiveTimeStr, "yyyy-MM-dd"));
 				}
@@ -1681,6 +1698,7 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 					case 3:
 						merchant.setLibService(100);
 						merchant.setPortNum(400);
+						break;
 					case 4:
 						merchant.setLibService(20);
 						merchant.setPortNum(200);
@@ -1789,7 +1807,7 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 	//保存学校模式商户
 	@Override
 	public Response saveMerchantByNew_Sc(Merchant merchant, String startTime, String endTime,
-			String activeTimeStr, String endActiveTimeStr, String password, String province, String city, String area,
+			String activeTimeStr, String endActiveTimeStr,String contractTimeStr, String password, String province, String city, String area,
 			String schoollist, String location, Admin curadmin) {
 		Response response=new Response();
 		
@@ -1800,13 +1818,6 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				
 				Merchant oldmerchant =this.getById(merchant.getId());
 				
-				//发生了旧转新,记录旧模式的币,端,当前时间。
-				if(oldmerchant.getSignType()==0) {
-					oldmerchant.setLibServiceOdd(oldmerchant.getLibService());
-					oldmerchant.setPortNumOdd(oldmerchant.getPortNum());
-					oldmerchant.setChangeTime(new Date());
-				}
-				
 				if(StringUtils.isNotEmpty(merchant.getLibId())) {
 					Merchant libMerchant=this.getMerchantByLibId(merchant.getLibId());
 					if(libMerchant!=null && !libMerchant.getId().equals(merchant.getId())) {
@@ -1841,6 +1852,20 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				oldmerchant.setLibServiceMonth(merchant.getLibServiceMonth());
 				oldmerchant.setLocation(location);
 				
+				oldmerchant.setMunitPrice(merchant.getMunitPrice());
+				oldmerchant.setSignerPerson(merchant.getSignerPerson());
+				oldmerchant.setContractNo(merchant.getContractNo());
+				oldmerchant.setBuyMonth(merchant.getBuyMonth());
+				oldmerchant.setGiveMonth(merchant.getGiveMonth());
+				oldmerchant.setContractNo(merchant.getContractNo());
+				oldmerchant.setPlusAmountPrice(merchant.getPlusAmountPrice());
+				oldmerchant.setPlusMonthPrice(merchant.getPlusMonthPrice());
+				
+				//合同签约时间
+				if(StringUtils.isNotEmpty(contractTimeStr)) {
+					oldmerchant.setContractTime(DateHelper.parseDate(contractTimeStr, "yyyy-MM-dd"));
+				}
+				
 				//合同日期
 				if(StringUtils.isNotEmpty(startTime)) {
 					oldmerchant.setSignTime(DateHelper.parseDate(startTime, "yyyy-MM-dd"));
@@ -1998,6 +2023,10 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				merchant.setSaleLoginName(curadmin.getLoginName());
 				merchant.setCurIsSummary(0);
 				
+				if(StringUtils.isNotEmpty(contractTimeStr)) {
+					merchant.setContractTime(DateHelper.parseDate(contractTimeStr, "yyyy-MM-dd"));
+				}
+				
 				if(StringUtils.isNotEmpty(activeTimeStr)) {
 					merchant.setStartActiveTime(DateHelper.parseDate(activeTimeStr, "yyyy-MM-dd"));
 					merchant.setActiveTime(DateHelper.parseDate(activeTimeStr, "yyyy-MM-dd"));

+ 60 - 35
src/main/java/com/ssj/sys/controller/FxController.java

@@ -1536,62 +1536,87 @@ public class FxController  extends BaseController {
     }
 	
 	
+	//塾币商户建立
+	@RequestMapping("/saveMerchant_old")
+	@ResponseBody
+    public Response saveMerchantOld(Model model,Merchant merchant,String startTime,String endTime,String activeTimeStr,String endActiveTimeStr,String contractTimeStr
+    		,String password,String province,String city,String area,String schoollist,String location)throws Exception {
+		Response response = new  Response();
+		HttpSession session = request.getSession();
+		Admin curadmin =(Admin) session.getAttribute("admin");
+		
+		if(!merchant.getSignType().equals(0)) {
+			response.failure("不支持开通此类型商户");
+	        return response;
+		}
+	    return merchantService.saveMerchantByUsed(merchant, startTime, endTime,contractTimeStr, password, province, city, area, schoollist, location, curadmin);
+    }
 	
+	
+	//端口商户建立
 	@RequestMapping("/saveMerchant")
 	@ResponseBody
     public Response saveMerchant(Model model,Merchant merchant,String startTime,String endTime,String startActiveTimeStr,String activeTimeStr,String computeTimeStr
-    		,String password,String province,String city,String area,String schoollist,String location)throws Exception {
+    		,String contractTimeStr,String password,String province,String city,String area,String schoollist,String location)throws Exception {
 		Response response = new  Response();
 		HttpSession session = request.getSession();
 		Admin curadmin =(Admin) session.getAttribute("admin");
 		
-		//签约模式
 		if(merchant.getSignType().equals(0)) {
-			
-	        return merchantService.saveMerchantByUsed(merchant, startTime, endTime, password, province, city, area, schoollist, location, curadmin);
-		}else {
-			
-			if(StringUtils.isEmpty(startActiveTimeStr)) {
-				response.failure("新模式的开始激活日期不可为空");
-		        return response;
-			}
-			if(StringUtils.isEmpty(activeTimeStr)) {
-				response.failure("新模式的结束激活日期不可为空");
-		        return response;
-			}
-			if(merchant.getLibServiceMonth()==null || merchant.getLibServiceMonth()<=0) {
-				response.failure("新模式的充值月份数不可小于0");
-		        return response;
-			}
-	        return merchantService.saveMerchantByNew(merchant, startTime, endTime,startActiveTimeStr,activeTimeStr, computeTimeStr, password, province, city, area, schoollist, location, curadmin);
+			response.failure("不支持开通此类型商户");
+	        return response;
+		}
+		if(StringUtils.isEmpty(startActiveTimeStr)) {
+			response.failure("新模式的开始激活日期不可为空");
+	        return response;
 		}
+		if(StringUtils.isEmpty(activeTimeStr)) {
+			response.failure("新模式的结束激活日期不可为空");
+	        return response;
+		}
+		if(merchant.getBuyMonth()==null) {
+			merchant.setBuyMonth(0);
+		}
+		if(merchant.getGiveMonth()==null) {
+			merchant.setGiveMonth(0);
+		}
+		merchant.setLibServiceMonth(merchant.getBuyMonth()+merchant.getGiveMonth());
+		if(merchant.getLibServiceMonth()==null || merchant.getLibServiceMonth()<=0) {
+			response.failure("新模式的充值月份数不可小于0");
+	        return response;
+		}
+        return merchantService.saveMerchantByNew(merchant, startTime, endTime,startActiveTimeStr,activeTimeStr, computeTimeStr,contractTimeStr, password, province, city, area, schoollist, location, curadmin);
+		
     }
 	
-	
+	//学校商户建立
 	@RequestMapping("/saveMerchant_sc")
 	@ResponseBody
     public Response saveMerchantSc(Model model,Merchant merchant,String startTime,String endTime,String activeTimeStr,String endActiveTimeStr
-    		,String password,String province,String city,String area,String schoollist,String location)throws Exception {
+    		,String contractTimeStr,String password,String province,String city,String area,String schoollist,String location)throws Exception {
 		Response response = new  Response();
 		HttpSession session = request.getSession();
 		Admin curadmin =(Admin) session.getAttribute("admin");
 		
-		//签约模式
 		if(merchant.getSignType().equals(0)) {
-			
-	        return merchantService.saveMerchantByUsed(merchant, startTime, endTime, password, province, city, area, schoollist, location, curadmin);
-		}else {
-			
-			if(StringUtils.isEmpty(activeTimeStr)) {
-				response.failure("试用开始时间不可为空");
-		        return response;
-			}
-			if(StringUtils.isEmpty(endActiveTimeStr)) {
-				response.failure("试用结束时间不可为空");
-		        return response;
-			}
-	        return merchantService.saveMerchantByNew_Sc(merchant, startTime, endTime,activeTimeStr, endActiveTimeStr, password, province, city, area, schoollist, location, curadmin);
+			response.failure("不支持开通此类型商户");
+	        return response;
+		}
+		if(StringUtils.isEmpty(activeTimeStr)) {
+			response.failure("试用开始时间不可为空");
+	        return response;
+		}
+		if(StringUtils.isEmpty(endActiveTimeStr)) {
+			response.failure("试用结束时间不可为空");
+	        return response;
+		}
+		if(merchant.getBuyMonth()==null) {
+			merchant.setBuyMonth(0);
+		}
+		if(merchant.getGiveMonth()==null) {
+			merchant.setGiveMonth(0);
 		}
+        return merchantService.saveMerchantByNew_Sc(merchant, startTime, endTime,activeTimeStr, endActiveTimeStr,contractTimeStr, password, province, city, area, schoollist, location, curadmin);
     }
 	
 	

+ 11 - 11
src/main/java/com/ssj/sys/controller/LoginController.java

@@ -72,17 +72,17 @@ public class LoginController extends BaseController {
     			request.setAttribute("error", "用户登录已锁定,已锁定30分!");
     			return "sys/login/login";
     		}
-    		String requestCaptcha = request.getParameter("captcha");
-    		if (StringUtil.isEmpty(requestCaptcha) ) {
-    			model.addAttribute("imgUrl",PropertiesUtil.getValue("STATIC_FILE_URL"));
-    			request.setAttribute("error", "验证码不能为空!");
-    			 return "sys/login/login";
-    		}
-    		if(!requestCaptcha.equalsIgnoreCase(captcha)){
-    			model.addAttribute("imgUrl",PropertiesUtil.getValue("STATIC_FILE_URL"));
-    			request.setAttribute("error", "验证码错误!");
-    			 return "sys/login/login";
-    		}
+//    		String requestCaptcha = request.getParameter("captcha");
+//    		if (StringUtil.isEmpty(requestCaptcha) ) {
+//    			model.addAttribute("imgUrl",PropertiesUtil.getValue("STATIC_FILE_URL"));
+//    			request.setAttribute("error", "验证码不能为空!");
+//    			 return "sys/login/login";
+//    		}
+//    		if(!requestCaptcha.equalsIgnoreCase(captcha)){
+//    			model.addAttribute("imgUrl",PropertiesUtil.getValue("STATIC_FILE_URL"));
+//    			request.setAttribute("error", "验证码错误!");
+//    			 return "sys/login/login";
+//    		}
     		Admin admin=adminService.longin(loginname, password);
     		if(admin==null){
     			request.setAttribute("error", "账号密码错误!");

+ 12 - 4
src/main/java/com/ssj/task/sz/MerchantSummaryTask.java

@@ -1,5 +1,8 @@
 package com.ssj.task.sz;
 
+import java.util.Calendar;
+import java.util.Date;
+
 import org.quartz.DisallowConcurrentExecution;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
@@ -24,10 +27,15 @@ public class MerchantSummaryTask implements Job{
 		
 		//先进行上一个月的数据备份,再进行下面的结算。
 		try{
-			MerchantBackupService merchantBackupService = SystemResourceLocator.getBean(MerchantBackupService.class);
-			merchantBackupService.runMerchantBackup();
+			Calendar calendar=Calendar.getInstance();
+			calendar.setTime(new Date());
+			int day=calendar.get(Calendar.DATE);
+			if(day==1) {
+				MerchantBackupService merchantBackupService = SystemResourceLocator.getBean(MerchantBackupService.class);
+				merchantBackupService.runMerchantBackup();
+			}
 		}catch (Exception e) {
-			logger.error("【商户备份】月最后一天商户数据备份定时任务,异常:"+e.getMessage());
+			logger.error("【商户备份】月商户数据备份定时任务,异常:"+e.getMessage());
 		}
 		
 		//12点定时任务,处理签约模式的数据
@@ -54,5 +62,5 @@ public class MerchantSummaryTask implements Job{
 		
 		
 
-	}
+	}	
 }

+ 149 - 126
src/main/resources/templates/sys/fx/merchantAdd.html

@@ -60,31 +60,39 @@ dtext{
 	cursor: pointer;
 }
 .forminfo li label{
-	width: 250px;
+	width: 200px;
 	text-align: right;
 	padding-right: 10px
 }
   
 </style>
 <body>
+
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">商户建立</a></li>
+		<li><a href="#">端口商户建立</a></li>
+	</ul>
+</div>
+
 <div class="formbody">
-		<ul class="forminfo">
+		<ul class="forminfo" style="min-width: 830px;">
 			<li style="margin-bottom: 20px">
 				<label>商户账号:<b>*</b></label>
-				<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 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}"/>
+				<input autocomplete="off"  th:if="${merchant.id==null}" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}" placeholder=" 请输入端口商户账号,由字母或数字组成" />
+				<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="00000000" autocomplete="off" />
+				<input type="text" id="password" class="dfinput fl" name="password"  style="float: left;" value="00000000" autocomplete="off" placeholder=" 输入端口商户密码,默认:00000000" />
 				
 				<br/>
 			</li>
 			<li>
-				<label>商户名称:合作名称/合作校区<b>*</b></label>
-				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}" autocomplete="off" />
+				<label>商户名称:合作名称/合作校区<b>*</b></label>
+				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}" autocomplete="off"  placeholder=" 请输入端口商户名称" />
 			</li>
 			
 			<li id="location_wrap" >
@@ -110,48 +118,38 @@ dtext{
 					</div>
 					
 					<div class="vocation" style="margin-right: 5px; width: 130px">
-						<input name="libId" id="libId" class="select1"  type="text" autocomplete="off" onfocus="funcblurlibId()" >
+						<input name="libId" id="libId" class="select1"  type="text" autocomplete="off" onfocus="funcblurlibId()" placeholder=" 请选择绑定机构" >
 						<input name="radiolibId" id="radiolibId"  type="hidden" >
 					</div>
 					
 					<div class="vocation" style="margin-right: 5px; width: 130px">
-						<input name="schooltext" id="schooltext" class="select1" autocomplete="off" type="text" onfocus="funcblurschooltext()"  >
+						<input name="schooltext" id="schooltext" class="select1" autocomplete="off" type="text" onfocus="funcblurschooltext()"  placeholder=" 请选择绑定学校"  >
 					</div>
 					
 				</div>
 			</li>
+
 			
 			<li>
-				<label>合同日期:<b >*</b></label>
-				<input type="hidden"  id="minDate" value="2020-01-01" >
-				<input 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" 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>
+				<label>套餐:套餐类型:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="mealType" id="mealType" class="select1"  > 
-						<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>
-						<option value="4" th:selected="${merchant.mealType==4 ? 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"  > 
-						<option value="0" th:selected="${merchant.signType==0 ? true : false}" data-val="0">合同签约模式(旧模式)</option>
-						<option value="1" th:selected="${merchant.signType==1 ? true : false}" data-val="30" >服务包1</option>
-						<option value="2" th:selected="${merchant.signType==2 ? true : false}" data-val="50" >服务包2</option>
-						<option value="3" th:selected="${merchant.signType==3 ? true : false}" data-val="100" >服务包3</option>
-						<option value="4" th:selected="${merchant.signType==4 ? true : false}" data-val="20" >服务包4</option>
-						<option value="5" th:selected="${merchant.signType==5 ? true : false}" th:data-val="${merchant.libService!=null ? merchant.libService : 0}" >服务包5</option>
+						<option value="1" th:selected="${merchant.signType==1 ? true : false}" data-val="30" data-upval="800" >服务包1</option>
+						<option value="2" th:selected="${merchant.signType==2 ? true : false}" data-val="50" data-upval="1200" >服务包2</option>
+						<option value="3" th:selected="${merchant.signType==3 ? true : false}" data-val="100" data-upval="2000" >服务包3</option>
+						<option value="4" th:selected="${merchant.signType==4 ? true : false}" data-val="20" data-upval="400" >服务包4</option>
+						<option value="5" th:selected="${merchant.signType==5 ? true : false}" th:data-val="${merchant.libService!=null ? merchant.libService : 0}" data-upval="0" >服务包5</option>
 					</select>
 				</div>
 				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red">[ 修改套餐模式,不会影响加油包有效性 ]</text>
@@ -163,49 +161,75 @@ dtext{
 				<text id="libServiceTips" style="width: 230px;color:red;display: none;">[ 请输入服务包5的服务人数 ]</text>
 			</li>
 			
+			<li>
+				<label>服务包/套餐单价:平台管理费:<b>*</b></label>
+				<input type="number" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}" autocomplete="off" placeholder=" 请输入平台管理费金额" />
+			</li>
+			
+			<li>
+				<label>服务包/总价(收入):<b>*</b></label>
+				<input type="number" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off" placeholder=" 请输入服务包总价"/>
+			</li>	
 			
+			<li style="display: none">
+				<label>服务包/月单价(成本):<b>*</b></label>
+				<input type="number" id="munitPrice" class="dfinput fl" name="munitPrice" th:value="${merchant.munitPrice==null ? 0 : merchant.munitPrice}" autocomplete="off" placeholder=" 请输入服务包单价" />
+			</li>
 			
 			<li>
-				<label>充值月份数:<b>*</b></label>
-				<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>
+				<label>购买月份数:<b>*</b></label>
+				<input type="number" id="buyMonth" min="0" class="dfinput fl" name="buyMonth" th:value="${merchant.buyMonth!=null ? merchant.buyMonth : 0}" autocomplete="off"/>
 			</li>
 			
 			<li>
-				<label>激活开始日期:<b >*</b></label>
-				<input 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="合同开始激活日期">
+				<label>赠送月份数:<b>*</b></label>
+				<input type="number" id="giveMonth" min="0" class="dfinput fl" name="giveMonth" th:value="${merchant.giveMonth!=null ? merchant.giveMonth : 0}" autocomplete="off"/>
+				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red"></text>
 			</li>
+			
 			<li>
-				<label>激活结束日期:<b >*</b></label>
-				<input 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="合同结束激活日期">
+				<label>加油包/月包单价:<b>*</b></label>
+				<input type="number" id="plusAmountPrice" class="dfinput fl" name="plusAmountPrice" th:value="${merchant.plusAmountPrice==null ? 0 : merchant.plusAmountPrice}" autocomplete="off" placeholder=" 请输入服务包单价" />
 			</li>
 			
-			<li style="display: none">
-				<label>计费开始日期:<b ></b></label>
-				<input 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>
+				<label>加油包/量包单价:<b>*</b></label>
+				<input type="number" id="plusMonthPrice" class="dfinput fl" name="plusMonthPrice" th:value="${merchant.plusMonthPrice==null ? 0 : merchant.plusMonthPrice}" autocomplete="off" placeholder=" 请输入服务包单价" />
 			</li>
 			
+						
 			<li>
-				<label>签约数量(练习册用):<b>*</b></label>
-				<input type="text" id="signService" class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}" autocomplete="off"/>
+				<label>合同日期:<b >*</b></label>
+				<input type="hidden"  id="minDate" value="2020-01-01" >
+				<input 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" 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="hardwareService" class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}" autocomplete="off"/>
+				<label>激活开始日期:<b >*</b></label>
+				<input 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></label>
+				<input 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 th:style="${merchant.computeTime==null ? 'display: none' : ''}">
+				<label>计费开始日期:<b >*</b></label>
+				<input 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>
+			<li style="display: none">
+				<label>上级渠道<b >*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select 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>
+						<option th:each="item:${poslist}" th:selected="${merchant.id==null ?  (item.posCode  eq 'ssj001' ? 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'}" >
+			<li style="display: none">
 				<label>商户级别:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="level" id="level" class="select1"> 
@@ -216,60 +240,22 @@ dtext{
 					</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"> 
-						<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 th:if="${curMerchant.orgCode eq 'SSJ-FX' && curMerchant.posCode ne 'sishujia' }" >
-				<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="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
-						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
-					</select>
-				</div>
-			</li>
-			
-			<li th:if="${curMerchant.orgCode eq 'SSJ-FX-aijia001-ssj001' || curMerchant.posCode eq 'sishujia'}" >
+
+			<li>
 				<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="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="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
-						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
-					</select>
-				</div>
-			</li>
-			
-			<li th:if="${curMerchant.orgCode ne 'SSJ-FX' && curMerchant.orgCode ne 'SSJ-FX-aijia001-ssj001' && curMerchant.posCode ne 'sishujia' }" >
-				<label>商户类型:<b>*</b></label>
-				<div class="vocation" style="margin-right: 5px; width: 345px">
-					<select name="type" id="type" class="select1"> 
 						<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">
@@ -277,57 +263,74 @@ dtext{
 						<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 type="text" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off"/>
+
+			
+			<li style="display: none">
+				<label>签约数量(练习册用):<b></b></label>
+				<input type="text" id="signService" class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}" autocomplete="off"/>
+			</li>
+			
+			<li style="display: none">
+				<label>合同硬件采购数量:<b></b></label>
+				<input type="text" id="hardwareService" class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}" autocomplete="off"/>
+			</li>
+			
+			<li style="display: none">
+				<label>硬件:签约单价:<b></b></label>
+				<input type="number" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice==null ? 0 : merchant.hardwarePrice }" autocomplete="off" placeholder=" 请输入硬件:签约单价" />
+			</li>
+			
+			
+			<li>
+				<label>甲方签约人 :<b></b></label>
+				<input type="text" id="signerPerson" class="dfinput fl" name="signerPerson" th:value="${merchant.signerPerson}" autocomplete="off" placeholder=" 请输入甲方签约人"/>
 			</li>
 			
 			<li>
-				<label>平台管理费金额<b></b></label>
-				<input type="text" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}" autocomplete="off"/>
+				<label>合同编号 :<b></b></label>
+				<input type="text" id="contractNo" class="dfinput fl" name="contractNo" th:value="${merchant.contractNo}" autocomplete="off" placeholder=" 请输入合同编号" />
 			</li>
 			
 			<li>
-				<label>硬件:签约单价<b></b></label>
-				<input type="text" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice}" autocomplete="off"/>
+				<label>合同签约时间 :<b></b></label>
+				<input type="text" id="contractTime" class="dfinput fl" name="contractTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${#dates.format(merchant.contractTime, 'yyyy-MM-dd')}"  autocomplete="off" placeholder=" 请输入合同签约时间"/>
+			</li>
+			
+			<li>
+				<label>地址:<b></b></label>
+				<input type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off" placeholder=" 请输入地址" />
 			</li>
 			
 			<li>
 				<label>法人姓名 :<b></b></label>
-				<input type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}" autocomplete="off"/>
+				<input type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}" autocomplete="off" placeholder=" 请输入法人姓名" />
 			</li>
 			<li>
 				<label>法人电话:<b></b></label>
-				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off"/>
+				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off" placeholder=" 请输入法人电话" />
 			</li>
 			<li>
 				<label>代表姓名:<b></b></label>
-				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off"/>
+				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off" placeholder=" 请输入代表姓名" />
 			</li>
 			<li>
 				<label>代表电话:<b></b></label>
-				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off"/>
+				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off" placeholder=" 请输入代表电话"/>
 			</li>
 		
 			<li>
 				<label>商户备注:<b></b></label>
-				<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}" autocomplete="off"/>
+				<input type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off" placeholder=" 请输入商户备注" />
 			</li>
 
-			<li>
+			<li style="padding-top: 10px">
 				<label>&nbsp;</label>
-				<button type="submit" onclick="push_user();" class="btn">提交</button>
-				<button type="button" class="btn" onclick="closeWin();">取消</button>
+				<button type="button" class="btn" onclick="javascript:location.reload();" style="background: #ccc;">清空</button>
+				<button type="submit" onclick="push_user();" class="btn" style="width: 137px;margin-left: 20px;">保存</button>
 			</li>
 		</ul>
 		<br/><br/><br/>
@@ -433,9 +436,18 @@ $(function (){
 	    alert("");
 	});
 	
+	if(id==''){
+		var val=$("#signType").find("option:selected").data("val");
+		$("#libService").val(val);
+		var upval=$("#signType").find("option:selected").data("upval");
+    	$("#munitPrice").val(upval);
+	}
+    
 	$("#signType").on("change",function(){
 	    var val=$(this).find("option:selected").data("val");
 	    $("#libService").val(val);
+		var upval=$(this).find("option:selected").data("upval");
+    	$("#munitPrice").val(upval);
 	    if($(this).val()<=4){
 	    	$("#libServiceTips").hide();
 	    }else{
@@ -762,18 +774,18 @@ function save(){
 		parent.layer.msg("商户名称不能为空",{icon:11});
 		return
 	}
-	if($("#signTime").val()==''){
-		parent.layer.msg("合同开始日期不能为空",{icon:11});
-		return
-	}
-	if($("#endSignTime").val()==''){
-		parent.layer.msg("合同结束日期不能为空",{icon:11});
-		return
-	}
-	if($("#signType").val()!='' && $("#signType").val()>=1 && $("#libServiceMonth").val()<=0){
-		parent.layer.msg("新模式充值月份数不可小于0",{icon:11});
-		return
-	}
+// 	if($("#signTime").val()==''){
+// 		parent.layer.msg("合同开始日期不能为空",{icon:11});
+// 		return
+// 	}
+// 	if($("#endSignTime").val()==''){
+// 		parent.layer.msg("合同结束日期不能为空",{icon:11});
+// 		return
+// 	}
+// 	if($("#signType").val()!='' && $("#signType").val()>=1 && $("#libServiceMonth").val()<=0){
+// 		parent.layer.msg("新模式充值月份数不可小于0",{icon:11});
+// 		return
+// 	}
 	if($("#signType").val()!='' && $("#signType").val()>=1 && $("#curSummaryTime").val()==''){
 		parent.layer.msg("新模式激活时间不可为空",{icon:11});
 		return
@@ -822,6 +834,17 @@ function save(){
             'activeTimeStr':$("#activeTime").val(),
             'computeTimeStr':$("#computeTime").val(),
             
+            
+            'munitPrice':$("#munitPrice").val(),
+            'signerPerson':$("#signerPerson").val(),
+            'contractNo':$("#contractNo").val(),
+            'contractTimeStr':$("#contractTime").val(),
+            'posType':2,
+            'buyMonth':$("#buyMonth").val(),
+            'giveMonth':$("#giveMonth").val(),
+            'plusAmountPrice':$("#plusAmountPrice").val(),
+            'plusMonthPrice':$("#plusMonthPrice").val(),
+            
             'province':$("#province").val(),
             'city':$("#city").val(),
 			'address':$("#address").val(),

+ 70 - 96
src/main/resources/templates/sys/fx/merchantAdd_old.html

@@ -60,31 +60,37 @@ dtext{
 	cursor: pointer;
 }
 .forminfo li label{
-	width: 250px;
+	width: 200px;
 	text-align: right;
 	padding-right: 10px
 }
   
 </style>
 <body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">商户建立</a></li>
+		<li><a href="#">塾币商户建立</a></li>
+	</ul>
+</div>
 <div class="formbody">
-		<ul class="forminfo">
+			<ul class="forminfo" style="min-width: 830px;">
 			<li style="margin-bottom: 20px">
 				<label>商户账号:<b>*</b></label>
-				<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 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}"/>
+				<input autocomplete="off"  th:if="${merchant.id==null}" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}" placeholder=" 请输入塾币商户账号,由字母或数字组成" />
+				<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="00000000" autocomplete="off" />
+				<input type="text" id="password" class="dfinput fl" name="password"  style="float: left;" value="00000000" autocomplete="off" placeholder=" 输入塾币商户密码,默认:00000000" />
 				
 				<br/>
 			</li>
 			<li>
-				<label>商户名称:合作名称/合作校区<b>*</b></label>
-				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}" autocomplete="off" />
+				<label>商户名称:合作名称/合作校区<b>*</b></label>
+				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}" autocomplete="off"  placeholder=" 请输入塾币商户名称" />
 			</li>
 			
 			<li id="location_wrap" >
@@ -110,12 +116,12 @@ dtext{
 					</div>
 					
 					<div class="vocation" style="margin-right: 5px; width: 130px">
-						<input name="libId" id="libId" class="select1"  type="text" autocomplete="off" onfocus="funcblurlibId()" >
+						<input name="libId" id="libId" class="select1"  type="text" autocomplete="off" onfocus="funcblurlibId()" placeholder=" 请选择绑定机构" >
 						<input name="radiolibId" id="radiolibId"  type="hidden" >
 					</div>
 					
 					<div class="vocation" style="margin-right: 5px; width: 130px">
-						<input name="schooltext" id="schooltext" class="select1" autocomplete="off" type="text" onfocus="funcblurschooltext()"  >
+						<input name="schooltext" id="schooltext" class="select1" autocomplete="off" type="text" onfocus="funcblurschooltext()"  placeholder=" 请选择绑定学校"  >
 					</div>
 					
 				</div>
@@ -129,46 +135,35 @@ dtext{
 				<input 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>
+			<li style="display: none">
 				<label>套餐:套餐类型<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="mealType" id="mealType" class="select1"  > 
-						<option value="0" th:selected="${merchant.mealType==0 ? true : false}">合同签约模式(模式)</option>
+						<option value="0" th:selected="${merchant.mealType==0 ? 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="signType" id="signType" class="select1"  > 
-						<option value="0" th:selected="${merchant.signType==0 ? true : false}" data-val="0">合同签约模式(模式)</option>
+						<option value="0" th:selected="${merchant.signType==0 ? true : false}" data-val="0">合同签约模式(塾币模式)</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="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}" autocomplete="off"/>
-			</li>
-			
-			<li >
+		
+			<li style="display: none">
 				<label>上级渠道<b >*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select 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>
+						<option th:each="item:${poslist}" th:selected="${merchant.id==null ?  (item.posCode  eq 'ssj001'  ? 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'}" >
+			<li>
 				<label>商户级别:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="level" id="level" class="select1"> 
@@ -179,113 +174,87 @@ dtext{
 					</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"> 
-						<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 th:if="${curMerchant.orgCode eq 'SSJ-FX' && curMerchant.posCode ne 'sishujia' }" >
+
+			<li>
 				<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="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>
+						<option value="4" th:selected="${merchant.type==4 ? true : false}">内部不结算(财务)</option>
 					</select>
 				</div>
 			</li>
-			
-			<li th:if="${curMerchant.orgCode eq 'SSJ-FX-aijia001-ssj001' || curMerchant.posCode eq 'sishujia'}" >
-				<label>商户类型:<b>*</b></label>
+
+			 <li style="display: none;">
+				<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="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
-						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
+					<select name="status" id="status" class="select1"> 
+						<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 th:if="${curMerchant.orgCode ne 'SSJ-FX' && curMerchant.orgCode ne 'SSJ-FX-aijia001-ssj001' && curMerchant.posCode ne 'sishujia' }" >
-				<label>商户类型:<b>*</b></label>
+			<li>
+				<label>签约塾币单价:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
-					<select name="type" id="type" class="select1"> 
-						<option value="3" th:selected="${merchant.type==3 ? true : false}">外部签约</option>
+					<select name="type" id="price" class="select1"> 
+						<option value="50" th:selected="${'50.0'==merchant.price+'' ? true : false}">50</option>
+						<option value="68" th:selected="${'68.0'==merchant.price+'' ? true : false}">68</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"> 
-						<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>
+				<label>甲方签约人 :<b></b></label>
+				<input type="text" id="signerPerson" class="dfinput fl" name="signerPerson" th:value="${merchant.signerPerson}" autocomplete="off" placeholder=" 请输入甲方签约人"/>
 			</li>
-				
-		    <li>
-				<label>服务:签约单价<b></b></label>
-				<input type="text" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off"/>
+			
+			<li>
+				<label>合同编号 :<b></b></label>
+				<input type="text" id="contractNo" class="dfinput fl" name="contractNo" th:value="${merchant.contractNo}" autocomplete="off" placeholder=" 请输入合同编号" />
 			</li>
 			
 			<li>
-				<label>硬件:签约单价<b></b></label>
-				<input type="text" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice}" autocomplete="off"/>
+				<label>合同签约时间 :<b></b></label>
+				<input type="text" id="contractTime" class="dfinput fl" name="contractTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${#dates.format(merchant.contractTime, 'yyyy-MM-dd')}"  autocomplete="off" placeholder=" 请输入合同签约时间"/>
+			</li>
+			
+			<li>
+				<label>地址:<b></b></label>
+				<input type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off" placeholder=" 请输入地址" />
 			</li>
 			
 			<li>
 				<label>法人姓名 :<b></b></label>
-				<input type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}" autocomplete="off"/>
+				<input type="text" id="legalPerson" class="dfinput fl" name="legalPerson" th:value="${merchant.legalPerson}" autocomplete="off" placeholder=" 请输入法人姓名" />
 			</li>
 			<li>
 				<label>法人电话:<b></b></label>
-				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off"/>
+				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off" placeholder=" 请输入法人电话" />
 			</li>
 			<li>
 				<label>代表姓名:<b></b></label>
-				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off"/>
+				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off" placeholder=" 请输入代表姓名" />
 			</li>
 			<li>
 				<label>代表电话:<b></b></label>
-				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off"/>
+				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off" placeholder=" 请输入代表电话"/>
 			</li>
 		
 			<li>
 				<label>商户备注:<b></b></label>
-				<input type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off"/>
+				<input type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off" placeholder=" 请输入商户备注" />
 			</li>
-
-			<li>
-				<label>地址:<b></b></label>
-				<input type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off"/>
-			</li>
-
-			<li>
+			
+			<li style="padding-top: 10px">
 				<label>&nbsp;</label>
-				<button type="submit" onclick="push_user();" class="btn">提交</button>
-				<button type="button" class="btn" onclick="closeWin();">取消</button>
+				<button type="button" class="btn" onclick="javascript:location.reload();" style="background: #ccc;">清空</button>
+				<button type="submit" onclick="push_user();" class="btn" style="width: 137px;margin-left: 20px;">保存</button>
 			</li>
 		</ul>
 		<br/><br/><br/>
@@ -736,7 +705,7 @@ function save(){
 	parent.layer.confirm(title, {
 		icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
 	}, function(){
-		var url="[[${sysUrl}]]/sys/fx/saveMerchant";
+		var url="[[${sysUrl}]]/sys/fx/saveMerchant_old";
 		if( $("#poscode").val()==''){
 			alert("商户账号不能为空");
 			return ;
@@ -765,6 +734,11 @@ function save(){
      
             'startTime':$("#signTime").val(),
             'endTime':$("#endSignTime").val(),
+            
+            'signerPerson':$("#signerPerson").val(),
+            'contractNo':$("#contractNo").val(),
+            'contractTimeStr':$("#contractTime").val(),
+            'posType':1,
 
             'province':$("#province").val(),
             'city':$("#city").val(),

+ 130 - 114
src/main/resources/templates/sys/fx/merchantAdd_sc.html

@@ -60,31 +60,37 @@ dtext{
 	cursor: pointer;
 }
 .forminfo li label{
-	width: 250px;
+	width: 200px;
 	text-align: right;
 	padding-right: 10px
 }
   
 </style>
 <body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">商户建立</a></li>
+		<li><a href="#">学校商户建立</a></li>
+	</ul>
+</div>
 <div class="formbody">
-		<ul class="forminfo">
+		<ul class="forminfo" style="min-width: 830px;">
 			<li style="margin-bottom: 20px">
 				<label>商户账号:<b>*</b></label>
-				<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 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}"/>
+				<input autocomplete="off"  th:if="${merchant.id==null}" type="text" id="poscode" class="dfinput fl" name="poscode" style="float: left;" th:value="${merchant.posCode}" placeholder=" 请输入学校商户账号,由字母或数字组成" />
+				<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="00000000" autocomplete="off" />
+				<input type="text" id="password" class="dfinput fl" name="password"  style="float: left;" value="00000000" autocomplete="off" placeholder=" 输入学校商户密码,默认:00000000" />
 				
 				<br/>
 			</li>
 			<li>
-				<label>商户名称:合作名称/合作校区<b>*</b></label>
-				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}" autocomplete="off" />
+				<label>商户名称:合作名称/合作校区<b>*</b></label>
+				<input type="text" id="unitname" class="dfinput fl" name="unitname" th:value="${merchant.unitName}" autocomplete="off"  placeholder=" 请输入学校商户名称" />
 			</li>
 			
 			<li id="location_wrap" >
@@ -110,48 +116,36 @@ dtext{
 					</div>
 					
 					<div class="vocation" style="margin-right: 5px; width: 130px">
-						<input name="libId" id="libId" class="select1"  type="text" autocomplete="off" onfocus="funcblurlibId()" >
+						<input name="libId" id="libId" class="select1"  type="text" autocomplete="off" onfocus="funcblurlibId()" placeholder=" 请选择绑定机构" >
 						<input name="radiolibId" id="radiolibId"  type="hidden" >
 					</div>
 					
 					<div class="vocation" style="margin-right: 5px; width: 130px">
-						<input name="schooltext" id="schooltext" class="select1" autocomplete="off" type="text" onfocus="funcblurschooltext()"  >
+						<input name="schooltext" id="schooltext" class="select1" autocomplete="off" type="text" onfocus="funcblurschooltext()"  placeholder=" 请选择绑定学校"  >
 					</div>
 					
 				</div>
 			</li>
-			
-			<li>
-				<label>合同日期:<b >*</b></label>
-				<input type="hidden"  id="minDate" value="2020-01-01" >
-				<input 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" 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>
+				<label>套餐:套餐类型:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="mealType" id="mealType" class="select1"  > 
-						<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>
 						<option value="4" th:selected="${merchant.mealType==4 ? 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"  > 
-						<option value="0" th:selected="${merchant.signType==0 ? true : false}" data-val="0">合同签约模式(旧模式)</option>
-						<option value="1" th:selected="${merchant.signType==1 ? true : false}" data-val="30" >服务包1</option>
-						<option value="2" th:selected="${merchant.signType==2 ? true : false}" data-val="50" >服务包2</option>
-						<option value="3" th:selected="${merchant.signType==3 ? true : false}" data-val="100" >服务包3</option>
-						<option value="4" th:selected="${merchant.signType==4 ? true : false}" data-val="20" >服务包4</option>
-						<option value="5" th:selected="${merchant.signType==5 ? true : false}" th:data-val="${merchant.libService!=null ? merchant.libService : 0}" >服务包5</option>
+						<option value="5" th:selected="${merchant.signType==5 ? true : false}" th:data-val="${merchant.libService!=null ? merchant.libService : 0}" data-upval="0" >服务包5</option>
+						<option value="1" th:selected="${merchant.signType==1 ? true : false}" data-val="30" data-upval="800" >服务包1</option>
+						<option value="2" th:selected="${merchant.signType==2 ? true : false}" data-val="50" data-upval="1200" >服务包2</option>
+						<option value="3" th:selected="${merchant.signType==3 ? true : false}" data-val="100" data-upval="2000" >服务包3</option>
+						<option value="4" th:selected="${merchant.signType==4 ? true : false}" data-val="20" data-upval="400" >服务包4</option>
 					</select>
 				</div>
 				<text th:if="${merchant.id!=null}"  style="width: 230px;color:red">[ 修改套餐模式,不会影响加油包有效性 ]</text>
@@ -164,37 +158,41 @@ dtext{
 			</li>
 
 			<li>
-				<label>试用开始时间:<b >*</b></label>
-				<input 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="试用开始时间日期">
+				<label>服务包/套餐单价:平台管理费:<b>*</b></label>
+				<input type="number" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}" autocomplete="off" placeholder=" 请输入平台管理费金额" />
 			</li>
 			
 			<li>
-				<label>试用结束时间:<b >*</b></label>
-				<input type="text"  class="dfinput fl"  id="endActiveTime" name="endActiveTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.endActiveTime, 'yyyy-MM-dd')}" placeholder="试用结束时间日期">
+				<label>服务包/总价(收入):<b>*</b></label>
+				<input type="number" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off" placeholder=" 请输入服务包总价"/>
+			</li>	
+			
+			<li style="display: none">
+				<label>服务包/月单价(成本):<b>*</b></label>
+				<input type="number" id="munitPrice" class="dfinput fl" name="munitPrice" th:value="${merchant.munitPrice==null ? 0 : merchant.munitPrice}" autocomplete="off" placeholder=" 请输入服务包单价" />
 			</li>
 			
-
 			<li>
-				<label>签约数量(练习册用):<b>*</b></label>
-				<input type="text" id="signService" class="dfinput fl" name="signService" th:value="${merchant.signService!=null ? merchant.signService : 0}" autocomplete="off"/>
+				<label>加油包/月包单价:<b>*</b></label>
+				<input type="number" id="plusAmountPrice" class="dfinput fl" name="plusAmountPrice" th:value="${merchant.plusAmountPrice==null ? 0 : merchant.plusAmountPrice}" autocomplete="off" placeholder=" 请输入服务包单价" />
 			</li>
 			
 			<li>
-				<label>合同硬件采购数量:<b>*</b></label>
-				<input type="text" id="hardwareService" class="dfinput fl" name="hardwareService" th:value="${merchant.hardwareService!=null ? merchant.hardwareService : 0}" autocomplete="off"/>
+				<label>加油包/量包单价:<b>*</b></label>
+				<input type="number" id="plusMonthPrice" class="dfinput fl" name="plusMonthPrice" th:value="${merchant.plusMonthPrice==null ? 0 : merchant.plusMonthPrice}" autocomplete="off" placeholder=" 请输入服务包单价" />
 			</li>
-			
-			<li >
-				<label>上级渠道<b >*</b></label>
+
+
+			<li style="display: none">
+				<label>上级渠道:<b >*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select 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>
+						<option th:each="item:${poslist}" th:selected="${merchant.id==null ?  (item.posCode  eq 'ssj001' ? 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'}" >
+			<li style="display: none">
 				<label>商户级别:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="level" id="level" class="select1"> 
@@ -205,118 +203,112 @@ dtext{
 					</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"> 
-						<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 th:if="${curMerchant.orgCode eq 'SSJ-FX' && curMerchant.posCode ne 'sishujia' }" >
-				<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="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
-						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
-					</select>
-				</div>
-			</li>
-			
-			<li th:if="${curMerchant.orgCode eq 'SSJ-FX-aijia001-ssj001' || curMerchant.posCode eq 'sishujia'}" >
+
+			<li>
 				<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="5" th:selected="${merchant.type==5 ? 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="6" th:selected="${merchant.type==6 ? true : false}">旧转新(新不结算)</option>
-						<option value="7" th:selected="${merchant.type==7 ? true : false}">旧转新(新旧不结算)</option>
-					</select>
-				</div>
-			</li>
-			
-			<li th:if="${curMerchant.orgCode ne 'SSJ-FX' && curMerchant.orgCode ne 'SSJ-FX-aijia001-ssj001' && curMerchant.posCode ne 'sishujia' }" >
-				<label>商户类型:<b>*</b></label>
-				<div class="vocation" style="margin-right: 5px; width: 345px">
-					<select name="type" id="type" class="select1"> 
 						<option value="3" th:selected="${merchant.type==3 ? true : false}">外部签约</option>
+						<option value="4" th:selected="${merchant.type==4 ? true : false}">内部不结算(财务)</option>
 					</select>
 				</div>
 			</li>
 			
-			 <li style="display: none;">
+			<li style="display: none;">
 				<label>签约状态:<b>*</b></label>
 				<div class="vocation" style="margin-right: 5px; width: 345px">
 					<select name="status" id="status" class="select1"> 
 						<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 type="text" id="price" class="dfinput fl" name="price" th:value="${merchant.price==null ? 0 : merchant.price}" autocomplete="off"/>
+		  
+			<li>
+				<label>签约数量(练习册用):<b>*</b></label>
+				<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}" autocomplete="off"/>
+			</li>
+			
+			<li>
+				<label>硬件:签约单价:<b>*</b></label>
+				<input type="number" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice==null ? 0 : merchant.hardwarePrice }" autocomplete="off" placeholder=" 请输入硬件:签约单价" />
+			</li>
+			
+			<li >
+				<label>合同日期:<b >*</b></label>
+				<input type="hidden"  id="minDate" value="2020-01-01" >
+				<input 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" 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"  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></label>
-				<input type="text" id="outPrice" class="dfinput fl" name="outPrice" th:value="${merchant.outPrice==null ? 0 : merchant.outPrice}" autocomplete="off"/>
+				<label>试用结束时间:<b >*</b></label>
+				<input type="text"  class="dfinput fl"  id="endActiveTime" name="endActiveTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.endActiveTime, 'yyyy-MM-dd')}" placeholder="试用结束时间日期">
+			</li>
+			
+			<li>
+				<label>甲方签约人 :<b></b></label>
+				<input type="text" id="signerPerson" class="dfinput fl" name="signerPerson" th:value="${merchant.signerPerson}" autocomplete="off" placeholder=" 请输入甲方签约人"/>
+			</li>
+			
+			<li>
+				<label>合同编号 :<b></b></label>
+				<input type="text" id="contractNo" class="dfinput fl" name="contractNo" th:value="${merchant.contractNo}" autocomplete="off" placeholder=" 请输入合同编号" />
 			</li>
 			
 			<li>
-				<label>硬件:签约单价<b></b></label>
-				<input type="text" id="hardwarePrice" class="dfinput fl" name="hardwarePrice" th:value="${merchant.hardwarePrice}" autocomplete="off"/>
+				<label>合同签约时间 :<b></b></label>
+				<input type="text" id="contractTime" class="dfinput fl" name="contractTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${#dates.format(merchant.contractTime, 'yyyy-MM-dd')}"  autocomplete="off" placeholder=" 请输入合同签约时间"/>
+			</li>
+			
+			<li>
+				<label>地址:<b></b></label>
+				<input type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off" placeholder=" 请输入地址" />
 			</li>
 			
 			<li>
 				<label>法人姓名 :<b></b></label>
-				<input type="text" id="legalperson" class="dfinput fl" name="legalperson" th:value="${merchant.legalPerson}" autocomplete="off"/>
+				<input type="text" id="legalPerson" class="dfinput fl" name="legalPerson" th:value="${merchant.legalPerson}" autocomplete="off" placeholder=" 请输入法人姓名" />
 			</li>
 			<li>
 				<label>法人电话:<b></b></label>
-				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off"/>
+				<input type="text" id="phone" class="dfinput fl" name="phone" th:value="${merchant.phone}" autocomplete="off" placeholder=" 请输入法人电话" />
 			</li>
 			<li>
 				<label>代表姓名:<b></b></label>
-				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off"/>
+				<input type="text" id="deputyname" class="dfinput fl" name="deputyname"  th:value="${merchant.deputyName}" autocomplete="off" placeholder=" 请输入代表姓名" />
 			</li>
 			<li>
 				<label>代表电话:<b></b></label>
-				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off"/>
+				<input type="text" id="deputyphone" class="dfinput fl" name=deputyphone th:value="${merchant.deputyPhone}" autocomplete="off" placeholder=" 请输入代表电话"/>
 			</li>
 		
 			<li>
 				<label>商户备注:<b></b></label>
-				<input type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off"/>
+				<input type="text" id="remarks" class="dfinput fl" name="remarks"  th:value="${merchant.remarks}" autocomplete="off" placeholder=" 请输入商户备注" />
 			</li>
 
-			<li>
-				<label>地址:<b></b></label>
-				<input type="text" id="address" class="dfinput fl" name="address"  th:value="${merchant.address}" autocomplete="off"/>
-			</li>
-
-			<li>
+		
+			
+			<li style="padding-top: 10px">
 				<label>&nbsp;</label>
-				<button type="submit" onclick="push_user();" class="btn">提交</button>
-				<button type="button" class="btn" onclick="closeWin();">取消</button>
+				<button type="button" class="btn" onclick="javascript:location.reload();" style="background: #ccc;">清空</button>
+				<button type="submit" onclick="push_user();" class="btn" style="width: 137px;margin-left: 20px;">保存</button>
 			</li>
 		</ul>
 		<br/><br/><br/>
@@ -422,9 +414,24 @@ $(function (){
 	    alert("");
 	});
 	
+	if(id==''){
+		var val=$("#signType").find("option:selected").data("val");
+		$("#libService").val(val);
+		var upval=$("#signType").find("option:selected").data("upval");
+    	$("#munitPrice").val(upval);
+    	
+    	if($("#signType").val()<=4){
+	    	$("#libServiceTips").hide();
+	    }else{
+	    	$("#libServiceTips").show();
+	    }
+	}
+	
 	$("#signType").on("change",function(){
 	    var val=$(this).find("option:selected").data("val");
 	    $("#libService").val(val);
+	    var upval=$(this).find("option:selected").data("upval");
+    	$("#munitPrice").val(upval);
 	    if($(this).val()<=4){
 	    	$("#libServiceTips").hide();
 	    }else{
@@ -783,7 +790,7 @@ function save(){
             'type' : $("#type").val(),
             'level' : $("#level").val(),
             'unitName' : $("#unitname").val(),
-            'legalPerson' : $("#legalperson").val(),
+            'legalPerson' : $("#legalPerson").val(),
             'phone' : $("#phone").val(),
             'deputyName' : $("#deputyname").val(),
             'deputyPhone' : $("#deputyphone").val(),
@@ -795,6 +802,7 @@ function save(){
             'password':$("#password").val(),
             'signService':$("#signService").val(),
             'hardwareService':$("#hardwareService").val(),
+            'hardwarePrice':$("#hardwarePrice").val(),
             
             'signType':$("#signType").val(),
             'mealType':$("#mealType").val(),
@@ -806,6 +814,14 @@ function save(){
             'activeTimeStr':$("#activeTime").val(),
             'endActiveTimeStr':$("#endActiveTime").val(),
             
+            'munitPrice':$("#munitPrice").val(),
+            'signerPerson':$("#signerPerson").val(),
+            'contractNo':$("#contractNo").val(),
+            'contractTimeStr':$("#contractTime").val(),
+            'posType':3,
+            'plusAmountPrice':$("#plusAmountPrice").val(),
+            'plusMonthPrice':$("#plusMonthPrice").val(),
+            
             'province':$("#province").val(),
             'city':$("#city").val(),
 			'address':$("#address").val(),

+ 209 - 5
src/main/resources/templates/sys/fx/merchantAllList.html

@@ -118,6 +118,109 @@
 	    border: 1px solid #169ed8;
 	}
 	
+	
+	
+	
+	
+	
+	#libServiceAdd .zwfb_shop_table {
+		margin-top: 10px
+	}
+	#libServiceAdd tbody {
+	    display: table-row-group;
+	    vertical-align: middle;
+    	border-color: inherit;
+	}
+	#libServiceAdd .fwmc_xxk {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#libServiceAdd .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;
+	}
+	#libServiceAdd .fwmc_xxk li p {
+	    line-height: 18px;
+	    font-size: 12px;
+	    color: #999;
+	    margin-top: 5px;
+	}
+	#libServiceAdd .zwsl_num {
+	    margin-left: 20px;
+	    font-size: 16px;
+	    color: #333;
+	}
+	#libServiceAdd .zwsl_num span {
+	    color: #999;
+	    font-size: 12px;
+	    padding-left: 10px;
+	}
+	#libServiceAdd .nmb_jj {
+	    overflow: hidden;
+	    margin-left: 20px;
+	}
+	#libServiceAdd .nmb_jj li.jian {
+	    border-right: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#libServiceAdd .nmb_jj li {
+	    float: left;
+	    text-align: center;
+	    line-height: 30px;
+	    border: 1px solid #ddd;
+	    font-size: 20px;
+	    padding: 0 8px;
+	}
+	#libServiceAdd .nmb_jj li .srkk {
+	    width: 30px;
+	    font-size: 16px;
+	    border: none;
+	    line-height: 30px;
+	    text-align: center;
+	    outline: 0;
+	    background: #FFF;
+	}
+	#libServiceAdd .nmb_jj li.jia {
+	    border-left: none;
+	    cursor: pointer;
+	    color: #999;
+	    width: 30px;
+	    padding: 0;
+	}
+	#libServiceAdd 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;
+	}
+	#libServiceAdd a.ty_but:hover {
+	    background: #1187ba;
+	}
+	#libServiceAdd .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>
 
@@ -186,6 +289,7 @@
 		    	<th >单位名称 </th>
 <!-- 		    	<th style="width: 60px;">商户级别</th> -->
 		    	<th >关联机构 </th>
+		    	<th >商户类型 </th>
 		    	<th >商户套餐 </th>
 		    	<th >商户模式 </th>
 		    	<th style="width: 60px;">签约端口数量</th>
@@ -219,6 +323,12 @@
 						<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.posType}">
+					   <span th:case="1" >塾币商户</span>
+					   <span th:case="2" >端口商户</span>
+					   <span th:case="3" >学校商户</span>
+					</td>
+					
 					<td  th:switch="${item.mealType}">
 					   <span th:case="0" style="color:red">旧兼容模式</span>
 					   <span th:case="1" >优选套餐</span>
@@ -263,19 +373,20 @@
 							#lists.contains(#httpSession.getAttribute('admin').authorities,'超级管理员角色')  
 						)  }
 						">
-							<a href="javascript:;" th:if="${item.signType==0 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'joinServiceEdit(\''+${item.id}+'\')'" class="tablelink">塾币</a>
+							<a href="javascript:;" th:if="${item.signType==0 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'joinServiceEdit(\''+${item.id}+'\')'" class="tablelink">塾&nbsp;&nbsp;&nbsp;币</a>
+<!-- 							<a href="javascript:;" th:if="${item.signType!=0 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'libServiceAdd(\''+${item.id}+'\')'" class="tablelink">服务包</a> -->
 							<a href="javascript:;" th:if="${item.signType!=0 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'mealServiceAdd(\''+${item.id}+'\')'" class="tablelink">加油包</a>
 						
 							<a href="javascript:;" th:if="${item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'updatemerchant(\''+${item.id}+'\',\'4\')'"   class="tablelink">删除</a>
 							
-							<a href="javascript:;" th:if="${item.endActiveTime==null && item.mealType==0 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchantold(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
-							<a href="javascript:;" th:if="${item.endActiveTime==null && item.mealType>0 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchant(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
-							<a href="javascript:;" th:if="${item.endActiveTime!=null && item.mealType>0 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchantsc(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
+							<a href="javascript:;" th:if="${item.posType==1 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchantold(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
+							<a href="javascript:;" th:if="${item.posType==2 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchant(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
+							<a href="javascript:;" th:if="${item.posType==3 && item.status!=4 && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'savemerchantsc(\''+${item.id}+'\')'"  	class="tablelink">修改</a>
 						
 						</di>
 										
 						<a href="javascript:;" th:if="${item.status!=4 && item.libId!='' && item.libId!=null && (curMerchant.orgCode eq 'SSJ-FX' || #strings.contains(item.orgCode,curMerchant.orgCode) ) }"  th:onclick="'untyingmerchant(\''+${item.id}+'\')'"  	class="tablelink">解绑</a>
-						<a href="javascript:;" th:onclick="'infomerchant(\''+${item.id}+'\')'"  	class="tablelink">查看</a>
+<!-- 						<a href="javascript:;" th:onclick="'infomerchant(\''+${item.id}+'\')'"  	class="tablelink">查看</a> -->
 						
 					 </td>  
 					
@@ -316,6 +427,46 @@
 </div>
 
 
+<div class="formbody" id="libServiceAdd" style="display: none;">
+	<input type="hidden" id="lib_merchant_id" value="" >
+	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="zwfb_shop_table">
+	      <tbody>
+	      	
+	      <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	      <tr valign="top">
+  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">续费月数量:</td>
+  	        <td>
+	        	<ul class="nmb_jj">
+		            <li class="jian" id="lib_reduce_num">-</li>
+		            <li>
+		              <input name="" id="lib_add_service_num" type="text" value="1" class="srkk">
+		            </li>
+		            <li class="jia" id="lib_add_num">+</li>  
+	          </ul>
+	        </td>
+	      </tr>
+	      <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	   	 <tr>
+	        <td height="20"></td>
+	        <td></td>
+	      </tr>
+	      <tr>
+	        <td></td>
+	        <td><a class="ty_but ml20" href="javascript:#" onclick="saveLib();">添 加</a></td>
+	      </tr>
+	    </tbody>
+   	</table>
+    
+</div>
+
+
+
 <div class="formbody" id="mealServiceAdd" style="display: none;">
 	<input type="hidden" id="meal_merchant_id" value="" >
 	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="zwfb_shop_table">
@@ -546,6 +697,59 @@ function joinServiceAdd(type){
 }
 
 
+
+function libServiceAdd(id){
+	  $.ajax({
+		  url: "[[${sysUrl}]]/sys/fx/getMerchant/"+id,
+	      type: 'POST',
+	      data: {},
+	      processData: false,
+	      contentType: false, 
+	      beforeSend: function () {
+	      },
+	      success: function (responseStr) {
+	    	  if(responseStr.meta.success){
+	    		  $("#lib_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;
+					case 4:
+						meal_merchant_li1="校园服务";
+						break;
+					default:
+						break;
+					}
+	    		  $("#lib_merchant_li1").html("["+responseStr.data.merchant.unitName+"] 商户当前套餐模式:"+meal_merchant_li1);
+	    		  $("#lib_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: $("#libServiceAdd")
+	  			 });
+	    	  }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,

+ 1 - 1
src/main/resources/templates/sys/imlibuser/schoolList.html

@@ -96,7 +96,7 @@
 	    </li>
 	    
 	     <li>
-		  <a th:href="@{/static/sys/excel/student_lib.xlsx?1}"><input type="button" style="background: #ccc no-repeat center;width: 100px;height: 30px"  class="scbtn" value="学生模板" /></a>
+		  <a th:href="@{/static/sys/excel/student_lib.xlsx?2}"><input type="button" style="background: #ccc no-repeat center;width: 100px;height: 30px"  class="scbtn" value="学生模板" /></a>
 	    </li>
 	    
 <!-- 	     <li> -->