合同终止的经销商可以再次激活,添加经销商协议日大于当前系统时间校验
This commit is contained in:
parent
806b3260f7
commit
57237f7ddc
@ -42,13 +42,13 @@ function teaming(){
|
||||
alert("请选择一条数据!");
|
||||
return ;
|
||||
}
|
||||
if(distributor_status=='distributor_status06'){
|
||||
alert("提示:合同终止的经销商不能修改为激活状态,请重新登记经销商!");
|
||||
// if(distributor_status=='distributor_status06'){
|
||||
// alert("提示:合同终止的经销商不能修改为激活状态,请重新登记经销商!");
|
||||
//AsDebug.showMessage("提示:","合同终止的经销商不能修改为合同中,请重新登记经销商!", "", "", true);
|
||||
return;
|
||||
}
|
||||
// return;
|
||||
// }
|
||||
if(distributor_status=='distributor_status04'){
|
||||
alert("提示:改经销商已经是激活状态,请不要重复维护!");
|
||||
alert("提示:该经销商已经是激活状态,请不要重复维护!");
|
||||
//AsDebug.showMessage("提示:","改经销商已经是合同中,请不要重复维护!", "", "", true);
|
||||
return;
|
||||
}
|
||||
@ -67,6 +67,11 @@ function teaming(){
|
||||
alert("集团外的经销商需收取保证金后再进行激活!");
|
||||
return;
|
||||
}
|
||||
var resultDate = AsControl.RunJavaMethodTrans("com.tenwa.customer.distributor.DeleteDistributor","checkLimitEndDate","id="+id);
|
||||
if(resultDate!="true"){
|
||||
alert(resultDate);
|
||||
return;
|
||||
}
|
||||
if(confirm("确定激活?")){
|
||||
var result = AsControl.RunJavaMethodTrans("com.tenwa.customer.distributor.DeleteDistributor","setDistributorStatus","id="+id+",distributor_status="+distributor_status);
|
||||
alert("更改状态成功");
|
||||
|
||||
@ -4,6 +4,7 @@ import com.tenwa.comm.util.jboutil.DataOperatorUtil;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@ -39,7 +40,6 @@ public class DeleteDistributor {
|
||||
private String belongorg;
|
||||
private String orgid;
|
||||
|
||||
|
||||
public String getOrgid() {
|
||||
return orgid;
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class DeleteDistributor {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*public String deleteDistributor(JBOTransaction tx) throws Exception{
|
||||
Map<String, String> searchCondtion = new HashMap<String, String>();
|
||||
searchCondtion.put("distributor_id",this.getId());
|
||||
@ -142,6 +142,8 @@ public class DeleteDistributor {
|
||||
deleteDistributor(tx);
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
public String deleteDistributor(JBOTransaction tx) throws Exception{
|
||||
Map<String, String> searchCondtion = new HashMap<String, String>();
|
||||
searchCondtion.put("distributor_id",this.getId());
|
||||
@ -260,4 +262,28 @@ public class DeleteDistributor {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String checkLimitEndDate(JBOTransaction tx) throws Exception {
|
||||
try {
|
||||
BizObjectManager busObj = JBOFactory.getBizObjectManager(DISTRIBUTOR_INFO.CLASS_NAME, tx);
|
||||
BizObject buss = busObj.createQuery("ID=:id").setParameter("id", id).getSingleResult(true);
|
||||
if(buss != null){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String limitEndDate = buss.getAttribute("LIMIT_END_DATE").toString().replaceAll("/", "-") ;
|
||||
Date date = sdf.parse( limitEndDate );
|
||||
if( date.compareTo(new Date()) > 0 ) {
|
||||
return "true";
|
||||
}else {
|
||||
return "协议到期日小于当前系统时间,无法激活!";
|
||||
}
|
||||
|
||||
}else {
|
||||
return "未查询到对应的经销商,请联系管理员!";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "系统错误,请联系管理员!";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user