Commit 66b8c680 authored by 胡斌's avatar 胡斌

Merge remote-tracking branch 'origin/moly'

parents 618b4b67 e3191b72
...@@ -39,8 +39,6 @@ public class AssociateDiagosisConfigurationService { ...@@ -39,8 +39,6 @@ public class AssociateDiagosisConfigurationService {
DimKpiAssociationRelInfo d = dimKpiAssociationRelInfoDao.findOne(1L); DimKpiAssociationRelInfo d = dimKpiAssociationRelInfoDao.findOne(1L);
System.out.println(d.getDimAssociationAnaInfo().getAssociationType()); System.out.println(d.getDimAssociationAnaInfo().getAssociationType());
DimAssociationAnaInfo info = dimAssociationAnaInfoDao.findOne(1l); DimAssociationAnaInfo info = dimAssociationAnaInfoDao.findOne(1l);
System.out.println(d.toString());
System.out.println(info.toString());
} }
...@@ -131,22 +129,30 @@ public class AssociateDiagosisConfigurationService { ...@@ -131,22 +129,30 @@ public class AssociateDiagosisConfigurationService {
List<Object> objList = businessDao.findBusinessIdListBychannelDataSourceMapId(channelDataSourceMapId); List<Object> objList = businessDao.findBusinessIdListBychannelDataSourceMapId(channelDataSourceMapId);
List<Long> longList = new ArrayList<Long>(); List<Long> longList = new ArrayList<Long>();
System.out.println(objList == null ? "null" : "size " + objList.size()); if (objList == null || objList.size() < 1) {
return longList;
} else {
for (Object o : objList) { for (Object o : objList) {
longList.add((Long) o); longList.add((Long) o);
} }
return longList; return longList;
} }
}
public List<Long> findBusinessIdListBychannelDataSourceMapIdList(List<Long> channelDataSourceMapIdList) { public List<Long> findBusinessIdListBychannelDataSourceMapIdList(List<Long> channelDataSourceMapIdList) {
List<Object> objList = businessDao.findBusinessIdListBychannelDataSourceMapIdList(channelDataSourceMapIdList); List<Object> objList = businessDao.findBusinessIdListBychannelDataSourceMapIdList(channelDataSourceMapIdList);
List<Long> longList = new ArrayList<Long>(); List<Long> longList = new ArrayList<Long>();
if (objList == null || objList.size() < 1) {
return longList;
} else {
for (Object o : objList) { for (Object o : objList) {
longList.add((Long) o); longList.add((Long) o);
} }
return longList; return longList;
} }
}
// //
public List<DimKpi> findDimKpiListBybusnameIdList(List<Long> busnameIdList) { public List<DimKpi> findDimKpiListBybusnameIdList(List<Long> busnameIdList) {
return dimKpiDao.findDimKpiListBybusnameIdList(busnameIdList); return dimKpiDao.findDimKpiListBybusnameIdList(busnameIdList);
...@@ -162,10 +168,8 @@ public class AssociateDiagosisConfigurationService { ...@@ -162,10 +168,8 @@ public class AssociateDiagosisConfigurationService {
//1 删除 指标表 数据 //1 删除 指标表 数据
int n = dimKpiAssociationRelInfoDao.deleteByAssociationId(associationIdL); int n = dimKpiAssociationRelInfoDao.deleteByAssociationId(associationIdL);
System.out.println("n==" + n);
//更新 指标表和 配置表 //更新 指标表和 配置表
List<DimKpiAssociationRelInfo> relInfos = (List<DimKpiAssociationRelInfo>) dimKpiAssociationRelInfoDao.save(dimKpiAssociationRelInfoList); List<DimKpiAssociationRelInfo> relInfos = (List<DimKpiAssociationRelInfo>) dimKpiAssociationRelInfoDao.save(dimKpiAssociationRelInfoList);
System.out.println("*** " + relInfos.size());
} }
...@@ -177,13 +181,11 @@ public class AssociateDiagosisConfigurationService { ...@@ -177,13 +181,11 @@ public class AssociateDiagosisConfigurationService {
// System.out.println("n===="+n); // System.out.println("n===="+n);
//更新 指标表和 配置表 //更新 指标表和 配置表
DimAssociationAnaInfo info = dimAssociationAnaInfoDao.save(dimAssociationAnaInfo); DimAssociationAnaInfo info = dimAssociationAnaInfoDao.save(dimAssociationAnaInfo);
System.out.println("_-_ " + info.getAssociationId());
} }
public void deleteAssociDigConfig(Long associationId) { public void deleteAssociDigConfig(Long associationId) {
dimAssociationAnaInfoDao.delete(associationId); dimAssociationAnaInfoDao.delete(associationId);
System.out.println("delete---");
} }
......
...@@ -149,12 +149,11 @@ public class AssociateDiagosisConfigurationController { ...@@ -149,12 +149,11 @@ public class AssociateDiagosisConfigurationController {
model.put("proviceList", listProvice); model.put("proviceList", listProvice);
model.put("dimensionList", dimensionList); model.put("dimensionList", dimensionList);
//数据源 //数据源
List<DataSource> dataSourceList = new ArrayList<DataSource>(); List<DataSource> dataSourceList = associateDiagosisConfigurationService.findAllDataSource();
dataSourceList = associateDiagosisConfigurationService.findAllDataSource();
model.put("dataSourceList", dataSourceList); model.put("dataSourceList", dataSourceList);
//频道 //频道
List<Channel> channelList = new ArrayList<Channel>(); List<Channel> channelList = associateDiagosisConfigurationService.findAllChannel();
channelList = associateDiagosisConfigurationService.findAllChannel();
model.put("channelList", channelList); model.put("channelList", channelList);
return PageURLController.CreateDiagosis; return PageURLController.CreateDiagosis;
...@@ -168,15 +167,15 @@ public class AssociateDiagosisConfigurationController { ...@@ -168,15 +167,15 @@ public class AssociateDiagosisConfigurationController {
anaInfo = dimAssociationAnaInfoDao.findDimassociationAnaInfoByAssociationId(associationIdL); anaInfo = dimAssociationAnaInfoDao.findDimassociationAnaInfoByAssociationId(associationIdL);
} }
List<Province> listProvice = new ArrayList<Province>(); List<Province> listProvice = new ArrayList<Province>();
List<Map<String,String>> dimensionList = new ArrayList<Map<String,String>>(); List<Map<String, String>> dimensionList = new ArrayList<Map<String, String>>();
listProvice = (List<Province>) provinceDao.findProvince(); listProvice = (List<Province>) provinceDao.findProvince();
Map<String,String>mapC=new HashMap<String, String>(); Map<String, String> mapC = new HashMap<String, String>();
mapC.put("name","渠道"); mapC.put("name", "渠道");
mapC.put("value","c"); mapC.put("value", "c");
Map<String,String>mapY=new HashMap<String, String>(); Map<String, String> mapY = new HashMap<String, String>();
mapY.put("name","业务"); mapY.put("name", "业务");
mapY.put("value","y"); mapY.put("value", "y");
dimensionList.add(mapC); dimensionList.add(mapC);
dimensionList.add(mapY); dimensionList.add(mapY);
/*dimensionList.add("c"); /*dimensionList.add("c");
...@@ -195,12 +194,11 @@ public class AssociateDiagosisConfigurationController { ...@@ -195,12 +194,11 @@ public class AssociateDiagosisConfigurationController {
for (DimKpiAssociationRelInfo relInfo : anaInfo.getItems()) { for (DimKpiAssociationRelInfo relInfo : anaInfo.getItems()) {
kpiIdList.add(relInfo.getKpiId()); kpiIdList.add(relInfo.getKpiId());
} }
if(kpiIdList.size()>0){ if (kpiIdList.size() > 0) {
dimKpiSelectedList = dimKpiDao.findDimKpiListBykpiIdList(kpiIdList); dimKpiSelectedList = dimKpiDao.findDimKpiListBykpiIdList(kpiIdList);
} }
model.put("proviceList", listProvice); model.put("proviceList", listProvice);
model.put("dimensionList", dimensionList); model.put("dimensionList", dimensionList);
model.put("channelList", channelList); model.put("channelList", channelList);
...@@ -321,7 +319,7 @@ public class AssociateDiagosisConfigurationController { ...@@ -321,7 +319,7 @@ public class AssociateDiagosisConfigurationController {
return str; return str;
} }
List<Long> businessIdList = associateDiagosisConfigurationService.findBusinessIdListBychannelDataSourceMapIdList(channelDataSourceMapIdList); List<Long> businessIdList = associateDiagosisConfigurationService.findBusinessIdListBychannelDataSourceMapIdList(channelDataSourceMapIdList);
if (businessIdList == null || businessIdList.size() == 0) { if (businessIdList == null || businessIdList.size() < 0) {
return str; return str;
} }
List<DimKpi> dimKpiList = associateDiagosisConfigurationService.findDimKpiListBybusnameIdList(businessIdList); List<DimKpi> dimKpiList = associateDiagosisConfigurationService.findDimKpiListBybusnameIdList(businessIdList);
...@@ -440,7 +438,7 @@ public class AssociateDiagosisConfigurationController { ...@@ -440,7 +438,7 @@ public class AssociateDiagosisConfigurationController {
dimKpiSelSelectedList.add(Long.parseLong(s)); dimKpiSelSelectedList.add(Long.parseLong(s));
}*/ }*/
Long associationIdL=Long.parseLong(associationId);//associationId Long associationIdL = Long.parseLong(associationId);//associationId
Long proviceTdSelectedL = Long.valueOf(proviceTdSelected);//省份ID Long proviceTdSelectedL = Long.valueOf(proviceTdSelected);//省份ID
// Double kpiWeightTdVL = Double.parseDouble(kpiWeightTdV);//权重 // Double kpiWeightTdVL = Double.parseDouble(kpiWeightTdV);//权重
...@@ -453,13 +451,13 @@ public class AssociateDiagosisConfigurationController { ...@@ -453,13 +451,13 @@ public class AssociateDiagosisConfigurationController {
dimAssociationAnaInfo.setAssociationId(associationIdL); dimAssociationAnaInfo.setAssociationId(associationIdL);
// 指标表对象 // 指标表对象
List<DimKpiAssociationRelInfo> dimKpiAssociationRelInfoList = new ArrayList<DimKpiAssociationRelInfo>(); List<DimKpiAssociationRelInfo> dimKpiAssociationRelInfoList = new ArrayList<DimKpiAssociationRelInfo>();
String[] strIdAndWeightDimKpiChecked=kpiId_weight.split(","); String[] strIdAndWeightDimKpiChecked = kpiId_weight.split(",");
List<Map<String,String>> idAndWeight=new ArrayList<Map<String,String>>(); List<Map<String, String>> idAndWeight = new ArrayList<Map<String, String>>();
for (String s : strIdAndWeightDimKpiChecked) { for (String s : strIdAndWeightDimKpiChecked) {
Map<String,String> map=new HashMap<String,String>(); Map<String, String> map = new HashMap<String, String>();
map.put("kpiId",s.split("_")[0]); map.put("kpiId", s.split("_")[0]);
map.put("weight",s.split("_")[1]); map.put("weight", s.split("_")[1]);
idAndWeight.add(map); idAndWeight.add(map);
} }
for (Map<String, String> stringLongMap : idAndWeight) { for (Map<String, String> stringLongMap : idAndWeight) {
...@@ -481,11 +479,12 @@ public class AssociateDiagosisConfigurationController { ...@@ -481,11 +479,12 @@ public class AssociateDiagosisConfigurationController {
}*/ }*/
// dimAssociationAnaInfo.setItems(dimKpiAssociationRelInfoList); // dimAssociationAnaInfo.setItems(dimKpiAssociationRelInfoList);
associateDiagosisConfigurationService.updateAssociDigConfig(associationIdL,dimKpiAssociationRelInfoList); associateDiagosisConfigurationService.updateAssociDigConfig(associationIdL, dimKpiAssociationRelInfoList);
strR = "更新成功"; strR = "更新成功";
} catch (Exception e) { } catch (Exception e) {
strR = "更新失败";
e.printStackTrace(); e.printStackTrace();
} }
...@@ -517,9 +516,8 @@ public class AssociateDiagosisConfigurationController { ...@@ -517,9 +516,8 @@ public class AssociateDiagosisConfigurationController {
String strR = "创建失败"; String strR = "创建失败";
if (/*"".equalsIgnoreCase(proviceTdSelected) */"".equalsIgnoreCase(proviceSelectedarr) || ("".equalsIgnoreCase(dimensionTdSelected))
if (/*"".equalsIgnoreCase(proviceTdSelected) */"".equalsIgnoreCase(proviceSelectedarr)|| ("".equalsIgnoreCase(dimensionTdSelected)) || ("".equalsIgnoreCase(anainfoShallSaveArr)) || ("".equalsIgnoreCase(descTdV))) {
|| ("".equalsIgnoreCase(anainfoShallSaveArr)) || ("".equalsIgnoreCase(descTdV)) ) {
return strR; return strR;
} else { } else {
try { try {
...@@ -527,19 +525,19 @@ public class AssociateDiagosisConfigurationController { ...@@ -527,19 +525,19 @@ public class AssociateDiagosisConfigurationController {
String[] anainfoShallSavearr = anainfoShallSaveArr.split(",");//指标 参数 数组 String[] anainfoShallSavearr = anainfoShallSaveArr.split(",");//指标 参数 数组
List<Map<String,String>> kpiIdAndKpiWeight=new ArrayList<Map<String,String>>(); List<Map<String, String>> kpiIdAndKpiWeight = new ArrayList<Map<String, String>>();
for(String str : anainfoShallSavearr){ for (String str : anainfoShallSavearr) {
Map<String,String> map=new HashMap<String, String>(); Map<String, String> map = new HashMap<String, String>();
String[]id_weight=str.split("_"); String[] id_weight = str.split("_");
/*map.put("id",Double.valueOf(id_weight[0]).longValue()); /*map.put("id",Double.valueOf(id_weight[0]).longValue());
map.put("weight",Double.valueOf(id_weight[1]).longValue());*/ map.put("weight",Double.valueOf(id_weight[1]).longValue());*/
map.put("id",id_weight[0]); map.put("id", id_weight[0]);
map.put("weight",id_weight[1]); map.put("weight", id_weight[1]);
kpiIdAndKpiWeight.add(map); kpiIdAndKpiWeight.add(map);
} }
long ll=1l; long ll = 1l;
// 指标表对象 指标对象 多对一 配置对象 // 指标表对象 指标对象 多对一 配置对象
List<DimKpiAssociationRelInfo> dimKpiAssociationRelInfoList = new ArrayList<DimKpiAssociationRelInfo>(); List<DimKpiAssociationRelInfo> dimKpiAssociationRelInfoList = new ArrayList<DimKpiAssociationRelInfo>();
for (Map<String, String> stringLongMap : kpiIdAndKpiWeight) { for (Map<String, String> stringLongMap : kpiIdAndKpiWeight) {
...@@ -553,15 +551,14 @@ public class AssociateDiagosisConfigurationController { ...@@ -553,15 +551,14 @@ public class AssociateDiagosisConfigurationController {
} }
List<Long> proviceSelectedList = new ArrayList<Long>();//省份 参数 列表
List<Long> proviceSelectedList=new ArrayList<Long>();//省份 参数 列表 String[] proviceSelectedArr = proviceSelectedarr.split(",");
String[]proviceSelectedArr=proviceSelectedarr.split(",");
for (String s : proviceSelectedArr) { for (String s : proviceSelectedArr) {
proviceSelectedList.add(Long.parseLong(s)); proviceSelectedList.add(Long.parseLong(s));
} }
//配置表对象 //配置表对象
List<DimAssociationAnaInfo> anaInfoList=new ArrayList<DimAssociationAnaInfo>(); List<DimAssociationAnaInfo> anaInfoList = new ArrayList<DimAssociationAnaInfo>();
for (Long aLong : proviceSelectedList) { for (Long aLong : proviceSelectedList) {
DimAssociationAnaInfo dimAssociationAnaInfo = new DimAssociationAnaInfo(); DimAssociationAnaInfo dimAssociationAnaInfo = new DimAssociationAnaInfo();
dimAssociationAnaInfo.setProvinceId(aLong); dimAssociationAnaInfo.setProvinceId(aLong);
...@@ -570,10 +567,11 @@ public class AssociateDiagosisConfigurationController { ...@@ -570,10 +567,11 @@ public class AssociateDiagosisConfigurationController {
anaInfoList.add(dimAssociationAnaInfo); anaInfoList.add(dimAssociationAnaInfo);
} }
associateDiagosisConfigurationService.pathSave( anaInfoList, dimKpiAssociationRelInfoList); associateDiagosisConfigurationService.pathSave(anaInfoList, dimKpiAssociationRelInfoList);
strR = "创建成功"; strR = "创建成功";
} catch (Exception e) { } catch (Exception e) {
strR = "创建失败";
e.printStackTrace(); e.printStackTrace();
} }
...@@ -581,19 +579,22 @@ public class AssociateDiagosisConfigurationController { ...@@ -581,19 +579,22 @@ public class AssociateDiagosisConfigurationController {
return strR; return strR;
} }
@RequestMapping(value = "/deleteAssociDigConfig",method = RequestMethod.GET)
@RequestMapping(value = "/deleteAssociDigConfig", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public String deleteAssociDigConfig( @RequestParam(value = "associationId", defaultValue = "") String associationId){ public String deleteAssociDigConfig(@RequestParam(value = "associationId", defaultValue = "") String associationId) {
String strR="删除失败"; String strR = "删除失败";
try { try {
Long associationIdL=Long.parseLong(associationId);//associationId Long associationIdL = Long.parseLong(associationId);//associationId
associateDiagosisConfigurationService.deleteAssociDigConfig(associationIdL); associateDiagosisConfigurationService.deleteAssociDigConfig(associationIdL);
strR="删除成功"; strR = "删除成功";
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return strR; return strR;
} }
} }
...@@ -374,6 +374,8 @@ ...@@ -374,6 +374,8 @@
return; return;
} }
$("#updateAnaInfo").attr("disabled","disabled");
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
async: true, async: true,
...@@ -396,6 +398,7 @@ ...@@ -396,6 +398,7 @@
} }
}); });
//$("#updateAnaInfo").removeAttr("disabled");
/*$.ajax({ /*$.ajax({
type: 'GET', type: 'GET',
......
...@@ -25,7 +25,6 @@ function failureDelete(){ ...@@ -25,7 +25,6 @@ function failureDelete(){
function radioChoose(e){ function radioChoose(e){
$("#updateIndicatorsBtn").removeAttr("disabled"); $("#updateIndicatorsBtn").removeAttr("disabled");
$("#anaInfoSelected").val(e.id); $("#anaInfoSelected").val(e.id);
console.log(e.id);
} }
...@@ -205,7 +204,6 @@ table_pagging.prototype={ ...@@ -205,7 +204,6 @@ table_pagging.prototype={
tdContext = context; tdContext = context;
} else { } else {
console.log(this.objectlist);
if(k==1){ if(k==1){
tdContext = this.getProviceData(this.objectlist[i],this.header[k][1]); tdContext = this.getProviceData(this.objectlist[i],this.header[k][1]);
...@@ -227,7 +225,6 @@ table_pagging.prototype={ ...@@ -227,7 +225,6 @@ table_pagging.prototype={
} }
if(k==0) { if(k==0) {
tdContext="<input type='radio' name='update'id='"+this.getData(this.objectlist[i],this.header[0][1])+"' onclick='radioChoose(this);'/>"; tdContext="<input type='radio' name='update'id='"+this.getData(this.objectlist[i],this.header[0][1])+"' onclick='radioChoose(this);'/>";
console.log(tdContext)
} }
if(k==4){ if(k==4){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment