diff --git a/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp b/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp
index 2cee6949e..5111d6297 100644
--- a/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp
+++ b/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp
@@ -3,6 +3,7 @@
String rightType = CurPage.getParameter("rightType");
if(rightType ==null)rightType="";
String group_no = CurPage.getParameter("group_no");
+ String id = CurPage.getParameter("id");
if(group_no ==null)group_no="";
String group_name = CurPage.getParameter("group_name");
if(group_name ==null)group_name="";
@@ -13,10 +14,10 @@
if(rightType.equals("ReadOnly")){
dwTemp.ReadOnly = "1";//只读模式
}
- dwTemp.genHTMLObjectWindow(CurPage.getParameter("group_no"));
+ dwTemp.genHTMLObjectWindow(id);
CurPage.getCurComp().setAttribute("RightType", rightType);
String compClientID = request.getParameter("CompClientID");
- dwTemp.replaceColumn("groupList", "", CurPage.getObjectWindowOutput());
+ dwTemp.replaceColumn("groupList", "", CurPage.getObjectWindowOutput());
String sButtons[][] = {
{"true","All","Button","保存","保存","saveRecord()","","","","btn_icon_save"},
{"true","","Button","返回","返回列表","goBack()","","","","btn_icon_return"}
diff --git a/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompanyRegister.jsp b/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompanyRegister.jsp
index 40527f4eb..3f13f27e3 100644
--- a/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompanyRegister.jsp
+++ b/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompanyRegister.jsp
@@ -22,6 +22,7 @@
var group_no = getItemValue(0,getRow(0),'group_no');
setItemValue(0, 0, "productid", "<%=typeno%>");
var group_name = getItemValue(0,getRow(0),'group_name');
+ var id=getItemValue(0,getRow(0),'id');
for(var i = 0;i < group_name.length;i++){
if(group_name.charAt(i) == "'" || group_name.charAt(i) == "<" || group_name.charAt(i) == ">"){
alert("集团名称含有非法字符");
diff --git a/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorGroupCompanyList.jsp b/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorGroupCompanyList.jsp
index ce49ad8a6..46fe9dcba 100644
--- a/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorGroupCompanyList.jsp
+++ b/WebContent/Tenwa/Customer/Group/GroupCompany/DistributorGroupCompanyList.jsp
@@ -25,8 +25,9 @@
if(typeof(sReturnValue)!=undefined && sReturnValue!=''){
var result = sReturnValue.split('&');
var group_no = result[0];
+ var sId=RunJavaMethodTrans("com.tenwa.customer.controller.group.CustomerGroupCompanyController","getNewId","group_no="+group_no);
var group_name = result[1];
- AsControl.OpenView("/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp","group_no="+group_no+'&group_name='+group_name,"_self","");
+ AsControl.OpenView("/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp","id="+sId+"&group_no="+group_no+'&group_name='+group_name,"_self","");
}
},"新增集团");
}
@@ -34,21 +35,23 @@
function view(){
var sUrl = "/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp";
var group_no = getItemValue(0,getRow(0),'group_no');
+ var id = getItemValue(0,getRow(0),'id');
if(typeof(group_no)=="undefined" || group_no.length==0 ){
alert("请选择一条信息!");
return ;
}
- AsControl.OpenView(sUrl,"group_no="+group_no+'&rightType=ReadOnly',"_self","");
+ AsControl.OpenView(sUrl,"group_no="+group_no+"&id="+id+'&rightType=ReadOnly',"_self","");
}
//修改
function edit(){
var sUrl = "/Tenwa/Customer/Group/GroupCompany/DistributorCustomerGroupCompany.jsp";
var group_no = getItemValue(0,getRow(0),'group_no');
+ var id = getItemValue(0,getRow(0),'id');
if(typeof(group_no)=="undefined" || group_no.length==0 ){
alert("请选择一条信息!");
return ;
}
- AsControl.OpenView(sUrl,"group_no="+group_no,"_self","");
+ AsControl.OpenView(sUrl,"group_no="+group_no+"&id="+id,"_self","");
}
//废弃
function del(){
diff --git a/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelation.jsp b/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelation.jsp
index d6abdb6f2..b3d36ff3c 100644
--- a/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelation.jsp
+++ b/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelation.jsp
@@ -3,6 +3,7 @@
String rightType = CurPage.getParameter("rightType");
if(rightType == null) rightType = "";
String group_id = CurPage.getParameter("group_id");
+ String id = CurPage.getParameter("id");
if(group_id == null) group_id = "";
String sTempletNo = "DistributorGroupRelation";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
@@ -40,7 +41,7 @@ function selectCustomerName(){
setItemValue(0,0,"distributor_id",sReturn[0]);
setItemValue(0,0,"DISTRIBUTOR_NO",sReturn[1]);
setItemValue(0,0,"DISTRIBUTOR_NAME",sReturn[2]);
- setItemValue(0,0,"group_id",'<%=group_id%>');
+ setItemValue(0,0,"group_id",'<%=id%>');
},"请选择集团客户成员",'');
}
diff --git a/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelationList.jsp b/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelationList.jsp
index 997e87b7e..fc5669495 100644
--- a/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelationList.jsp
+++ b/WebContent/Tenwa/Customer/Group/Subcompany/DistributorCustomerGroupRelationList.jsp
@@ -4,11 +4,12 @@
ASObjectModel doTemp = new ASObjectModel("DistributorGroupRelationList");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
String group_id = CurPage.getParameter("group_no");
+ String id = CurPage.getParameter("id");
if(group_id == null)group_id ="";
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
- dwTemp.genHTMLObjectWindow(group_id);
+ dwTemp.genHTMLObjectWindow(id);
String sButtons[][] = {
{"true","All","Button","新增成员","新增成员","newRecord()","","","","btn_icon_add",""},
{"true","All","Button","修改","查看/修改详情","viewAndEdit()","","","","btn_icon_edit"},
@@ -42,8 +43,8 @@ function viewAndEdit(){
}
AsDialog.PopView(sUrl,"id="+id+"&flag="+flag+"&group_id="+'<%=group_id%>',"resizable=yes;dialogWidth=600px;dialogHeight=250px;center:yes;status:no;statusbar:no",function(){
// reloadSelf();
- },"修改集团下属公司信息");
window.location.reload();
+ },"修改集团下属公司信息");
}
//详情
function view(){
@@ -55,8 +56,8 @@ function view(){
}
AsDialog.PopView(sUrl,'id=' +id+'&rightType=ReadOnly',"resizable=yes;dialogWidth=600px;dialogHeight=250px;center:yes;status:no;statusbar:no",function(){
// reloadSelf();
- },"集团下属公司详细信息");
window.location.reload();
+ },"集团下属公司详细信息");
}
// 删除
function deleteRecord(){
@@ -67,10 +68,13 @@ function deleteRecord(){
}else {
if(confirm("确定要删除?"))
{
- as_delete('myiframe0');
+ var sReturnInfo = RunJavaMethodTrans("com.tenwa.customer.controller.group.CustomerGroupCompanyController","deleterelation","id="+id);
+ if(sReturnInfo=="false") {alert("删除失败"); return;}
+ //as_delete(0,'');
}
}
- parent.reloadSelf();
+ //parent.reloadSelf();
+ window.location.reload();
}
function detail(){
var customerId=getItemValue(0, getRow(), "customer_id");
diff --git a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/LDistributorAccountList.jsp b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/LDistributorAccountList.jsp
index 374810d82..59d591f15 100644
--- a/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/LDistributorAccountList.jsp
+++ b/WebContent/Tenwa/Lease/DistributorManage/DistributorApproval/LDistributorAccountList.jsp
@@ -12,7 +12,7 @@
String ishistory=CurPage.getParameter("IsHistory");
String RightType=CurPage.getParameter("RightType");
String disno="";
- List nolist=JBOFactory.getBizObjectManager("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT").createQuery("select di.distributor_no from O ,jbo.app.tenwa.customer.DISTRIBUTOR_INFO di where flow_unid=:flowunid")
+ List nolist=JBOFactory.getBizObjectManager("jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT").createQuery("select di.distributor_no from O ,jbo.app.tenwa.customer.DISTRIBUTOR_INFO di where di.id=O.flow_key and flow_unid=:flowunid")
.setParameter("flowunid",sFlowUnid).getResultList(false);
if(nolist.size()>0){
disno=nolist.get(0).getAttribute("distributor_no").getString();
diff --git a/src_tenwa/com/tenwa/customer/controller/group/CustomerGroupCompanyController.java b/src_tenwa/com/tenwa/customer/controller/group/CustomerGroupCompanyController.java
index 0b089dc81..fbdd73183 100644
--- a/src_tenwa/com/tenwa/customer/controller/group/CustomerGroupCompanyController.java
+++ b/src_tenwa/com/tenwa/customer/controller/group/CustomerGroupCompanyController.java
@@ -2,6 +2,7 @@ package com.tenwa.customer.controller.group;
import jbo.app.tenwa.customer.CUSTOMER_GROUP_COMPANY;
import jbo.app.tenwa.customer.DISTRIBUTOR_GROUP_COMPANY;
+import jbo.app.tenwa.customer.DISTRIBUTOR_GROUP_RELATION;
import jbo.com.tenwa.entity.comm.own.COUNTRY_DISTRICT_INFO;
import com.amarsoft.are.jbo.BizObject;
@@ -71,6 +72,18 @@ public class CustomerGroupCompanyController {
}
return "false";
}
+ public String deleterelation(JBOTransaction tx)throws Exception{
+ BizObjectManager bom = JBOFactory.getBizObjectManager(DISTRIBUTOR_GROUP_RELATION.CLASS_NAME);
+ tx.join(bom);
+ //将此集团信息设置为废弃状态
+ BizObjectQuery boq = bom.createQuery("delete from O where id=:id ");
+ boq.setParameter("id",id);
+ int i = boq.executeUpdate();
+ if(i == 1){
+ return "true";
+ }
+ return "false";
+ }
/**
* 集团名称不可重复
@@ -123,4 +136,14 @@ public class CustomerGroupCompanyController {
return "false";
}
}
+
+ public String getNewId(JBOTransaction tx) throws Exception{
+ String id="";
+ BizObjectManager dgcm = JBOFactory.getBizObjectManager(DISTRIBUTOR_GROUP_COMPANY.CLASS_NAME);
+ BizObject dgc = dgcm.createQuery("group_no=:group_no").setParameter("group_no", group_no).getSingleResult(false);
+ if(dgc != null){
+ id= dgc.getAttribute("ID").getString();
+ }
+ return id;
+ }
}
\ No newline at end of file