更新更新流量活动
This commit is contained in:
parent
7614ecc4f5
commit
1be13586d6
@ -52,8 +52,28 @@ public class XhpcActivityInternetServiceImpl implements XhpcActivityInternetServ
|
|||||||
public boolean insertDomain(XhpcActivityInternetDomain domain) {
|
public boolean insertDomain(XhpcActivityInternetDomain domain) {
|
||||||
internetMapper.insert(domain);
|
internetMapper.insert(domain);
|
||||||
|
|
||||||
|
List<XhpcActivityFormulaDomain> formulaDomainList = getFormulaFullList(domain);
|
||||||
|
formulaMapper.insertBatch(formulaDomainList);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateDomain(XhpcActivityInternetDomain domain) {
|
||||||
|
internetMapper.updateByPrimaryKey(domain);
|
||||||
|
formulaMapper.deleteByActivityId(domain.getActivityId());
|
||||||
|
|
||||||
|
List<XhpcActivityFormulaDomain> formulaDomainList = getFormulaFullList(domain);
|
||||||
|
formulaMapper.insertBatch(formulaDomainList);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private List<XhpcActivityFormulaDomain> getFormulaFullList(XhpcActivityInternetDomain domain){
|
||||||
|
|
||||||
boolean isFullDay = false;
|
boolean isFullDay = false;
|
||||||
Integer index = 0;
|
int index = 0;
|
||||||
List<XhpcActivityFormulaDomain> formulaDomainList = domain.getFormulaList();
|
List<XhpcActivityFormulaDomain> formulaDomainList = domain.getFormulaList();
|
||||||
List<XhpcActivityFormulaDomain> formulaDomains = new ArrayList<>();
|
List<XhpcActivityFormulaDomain> formulaDomains = new ArrayList<>();
|
||||||
String startTime = "00:00:00", endTime="24:00:00";
|
String startTime = "00:00:00", endTime="24:00:00";
|
||||||
@ -102,26 +122,8 @@ public class XhpcActivityInternetServiceImpl implements XhpcActivityInternetServ
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return formulaDomains;
|
||||||
|
|
||||||
formulaMapper.insertBatch(formulaDomains);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean updateDomain(XhpcActivityInternetDomain domain) {
|
|
||||||
internetMapper.updateByPrimaryKey(domain);
|
|
||||||
formulaMapper.deleteByActivityId(domain.getActivityId());
|
|
||||||
|
|
||||||
for (XhpcActivityFormulaDomain formulaDomain : domain.getFormulaList()) {
|
|
||||||
formulaDomain.setActivityId(domain.getActivityId());
|
|
||||||
formulaDomain.setCreateBy(domain.getCreateBy());
|
|
||||||
formulaDomain.setUpdateBy(domain.getUpdateBy());
|
|
||||||
formulaMapper.insert(formulaDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user