Commit be44f3e7 by kangxiaoshan

tkio增加俩字段

parent 55363bff
...@@ -7,11 +7,8 @@ ...@@ -7,11 +7,8 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="fcaffbb7-50d8-4ab8-9bad-0a6fbd39f63b" name="Default Changelist" comment=""> <list default="true" id="fcaffbb7-50d8-4ab8-9bad-0a6fbd39f63b" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/main/java/common/model/QcloudAccount.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/common/repository/QcloudAccountRepository.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/common/service/impl/ContractServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/common/service/impl/ContractServiceImpl.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/main/java/common/service/impl/ContractServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/common/service/impl/ContractServiceImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/spring/applicationContext.xml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/spring/applicationContext.xml" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -174,7 +171,7 @@ ...@@ -174,7 +171,7 @@
<path> <path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" /> <item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="Tomcat Server" type="7427dc5b:ServiceModel$ServiceGroupNode" /> <item name="Tomcat Server" type="7427dc5b:ServiceModel$ServiceGroupNode" />
<item name="Running" type="7427dc5b:ServiceModel$ServiceGroupNode" /> <item name="Finished" type="7427dc5b:ServiceModel$ServiceGroupNode" />
</path> </path>
</expand> </expand>
<select /> <select />
...@@ -257,74 +254,74 @@ ...@@ -257,74 +254,74 @@
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state x="352" y="132" key="#xdebugger.evaluate/0.0.1366.728@0.0.1366.728" timestamp="1596003888437" /> <state x="352" y="132" key="#xdebugger.evaluate/0.0.1366.728@0.0.1366.728" timestamp="1596003888437" />
<state width="461" height="438" key="DebuggerActiveHint" timestamp="1596003841176"> <state width="461" height="438" key="DebuggerActiveHint" timestamp="1603882985971">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="461" height="438" key="DebuggerActiveHint/0.0.1366.728@0.0.1366.728" timestamp="1596003841176" /> <state width="461" height="438" key="DebuggerActiveHint/0.0.1366.728@0.0.1366.728" timestamp="1603882985971" />
<state width="1111" height="308" key="GridCell.Tab.0.bottom" timestamp="1597321228164"> <state width="1111" height="357" key="GridCell.Tab.0.bottom" timestamp="1603882987346">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1597321228164" /> <state width="1111" height="357" key="GridCell.Tab.0.bottom/0.0.1366.728@0.0.1366.728" timestamp="1603882987346" />
<state width="1111" height="308" key="GridCell.Tab.0.center" timestamp="1597321228164"> <state width="1111" height="357" key="GridCell.Tab.0.center" timestamp="1603882987346">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1597321228164" /> <state width="1111" height="357" key="GridCell.Tab.0.center/0.0.1366.728@0.0.1366.728" timestamp="1603882987346" />
<state width="1111" height="308" key="GridCell.Tab.0.left" timestamp="1597321228164"> <state width="1111" height="357" key="GridCell.Tab.0.left" timestamp="1603882987346">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1597321228164" /> <state width="1111" height="357" key="GridCell.Tab.0.left/0.0.1366.728@0.0.1366.728" timestamp="1603882987346" />
<state width="1111" height="308" key="GridCell.Tab.0.right" timestamp="1597321228164"> <state width="1111" height="357" key="GridCell.Tab.0.right" timestamp="1603882987346">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1597321228164" /> <state width="1111" height="357" key="GridCell.Tab.0.right/0.0.1366.728@0.0.1366.728" timestamp="1603882987346" />
<state width="1111" height="308" key="GridCell.Tab.1.bottom" timestamp="1597321228165"> <state width="1111" height="357" key="GridCell.Tab.1.bottom" timestamp="1603882973705">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1597321228165" /> <state width="1111" height="357" key="GridCell.Tab.1.bottom/0.0.1366.728@0.0.1366.728" timestamp="1603882973705" />
<state width="1111" height="308" key="GridCell.Tab.1.center" timestamp="1597321228164"> <state width="1111" height="357" key="GridCell.Tab.1.center" timestamp="1603882973705">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1597321228164" /> <state width="1111" height="357" key="GridCell.Tab.1.center/0.0.1366.728@0.0.1366.728" timestamp="1603882973705" />
<state width="1111" height="308" key="GridCell.Tab.1.left" timestamp="1597321228164"> <state width="1111" height="357" key="GridCell.Tab.1.left" timestamp="1603882973705">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1597321228164" /> <state width="1111" height="357" key="GridCell.Tab.1.left/0.0.1366.728@0.0.1366.728" timestamp="1603882973705" />
<state width="1111" height="308" key="GridCell.Tab.1.right" timestamp="1597321228165"> <state width="1111" height="357" key="GridCell.Tab.1.right" timestamp="1603882973705">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1597321228165" /> <state width="1111" height="357" key="GridCell.Tab.1.right/0.0.1366.728@0.0.1366.728" timestamp="1603882973705" />
<state width="1111" height="308" key="GridCell.Tab.2.bottom" timestamp="1597321227940"> <state width="1111" height="357" key="GridCell.Tab.2.bottom" timestamp="1603882838355">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1597321227940" /> <state width="1111" height="357" key="GridCell.Tab.2.bottom/0.0.1366.728@0.0.1366.728" timestamp="1603882838355" />
<state width="1111" height="308" key="GridCell.Tab.2.center" timestamp="1597321227939"> <state width="1111" height="357" key="GridCell.Tab.2.center" timestamp="1603882838355">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1597321227939" /> <state width="1111" height="357" key="GridCell.Tab.2.center/0.0.1366.728@0.0.1366.728" timestamp="1603882838355" />
<state width="1111" height="308" key="GridCell.Tab.2.left" timestamp="1597321227939"> <state width="1111" height="357" key="GridCell.Tab.2.left" timestamp="1603882838355">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1597321227939" /> <state width="1111" height="357" key="GridCell.Tab.2.left/0.0.1366.728@0.0.1366.728" timestamp="1603882838355" />
<state width="1111" height="308" key="GridCell.Tab.2.right" timestamp="1597321227939"> <state width="1111" height="357" key="GridCell.Tab.2.right" timestamp="1603882838355">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1597321227939" /> <state width="1111" height="357" key="GridCell.Tab.2.right/0.0.1366.728@0.0.1366.728" timestamp="1603882838355" />
<state width="1111" height="308" key="GridCell.Tab.3.bottom" timestamp="1597321227940"> <state width="1111" height="357" key="GridCell.Tab.3.bottom" timestamp="1603882838356">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.3.bottom/0.0.1366.728@0.0.1366.728" timestamp="1597321227940" /> <state width="1111" height="357" key="GridCell.Tab.3.bottom/0.0.1366.728@0.0.1366.728" timestamp="1603882838356" />
<state width="1111" height="308" key="GridCell.Tab.3.center" timestamp="1597321227940"> <state width="1111" height="357" key="GridCell.Tab.3.center" timestamp="1603882838356">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.3.center/0.0.1366.728@0.0.1366.728" timestamp="1597321227940" /> <state width="1111" height="357" key="GridCell.Tab.3.center/0.0.1366.728@0.0.1366.728" timestamp="1603882838356" />
<state width="1111" height="308" key="GridCell.Tab.3.left" timestamp="1597321227940"> <state width="1111" height="357" key="GridCell.Tab.3.left" timestamp="1603882838356">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.3.left/0.0.1366.728@0.0.1366.728" timestamp="1597321227940" /> <state width="1111" height="357" key="GridCell.Tab.3.left/0.0.1366.728@0.0.1366.728" timestamp="1603882838356" />
<state width="1111" height="308" key="GridCell.Tab.3.right" timestamp="1597321227940"> <state width="1111" height="357" key="GridCell.Tab.3.right" timestamp="1603882838356">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="1111" height="308" key="GridCell.Tab.3.right/0.0.1366.728@0.0.1366.728" timestamp="1597321227940" /> <state width="1111" height="357" key="GridCell.Tab.3.right/0.0.1366.728@0.0.1366.728" timestamp="1603882838356" />
<state width="1111" height="308" key="GridCell.Tab.6.bottom" timestamp="1595298613992"> <state width="1111" height="308" key="GridCell.Tab.6.bottom" timestamp="1595298613992">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
...@@ -361,13 +358,24 @@ ...@@ -361,13 +358,24 @@
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="498" height="446" key="SwitcherDM/0.0.1366.728@0.0.1366.728" timestamp="1595411365033" /> <state width="498" height="446" key="SwitcherDM/0.0.1366.728@0.0.1366.728" timestamp="1595411365033" />
<state width="691" height="364" key="XDebugger.FullValuePopup" timestamp="1595471656041"> <state width="691" height="364" key="XDebugger.FullValuePopup" timestamp="1603882985968">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state width="691" height="364" key="XDebugger.FullValuePopup/0.0.1366.728@0.0.1366.728" timestamp="1595471656041" /> <state width="691" height="364" key="XDebugger.FullValuePopup/0.0.1366.728@0.0.1366.728" timestamp="1603882985968" />
<state x="225" y="100" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2" timestamp="1595063525107"> <state x="359" y="97" width="647" height="534" key="find.popup" timestamp="1603878341475">
<screen x="0" y="0" width="1366" height="728" /> <screen x="0" y="0" width="1366" height="728" />
</state> </state>
<state x="225" y="100" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2/0.0.1366.728@0.0.1366.728" timestamp="1595063525107" /> <state x="359" y="97" width="647" height="534" key="find.popup/0.0.1366.728@0.0.1366.728" timestamp="1603878341475" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/main/java/common/service/impl/ContractServiceImpl.java</url>
<line>2611</line>
<option name="timeStamp" value="4" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -436,7 +436,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -436,7 +436,7 @@ public class ContractServiceImpl implements ContractService {
List list = new ArrayList(); List list = new ArrayList();
if ( "io".equals(platform)) { if ("io".equals(platform)) {
List<PackageType> packageTypeList = packageTypeRepository.findIsNewAll(); List<PackageType> packageTypeList = packageTypeRepository.findIsNewAll();
for (PackageType p : packageTypeList) { for (PackageType p : packageTypeList) {
p.setType("main"); p.setType("main");
...@@ -570,7 +570,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -570,7 +570,7 @@ public class ContractServiceImpl implements ContractService {
//this.calculateShareIncome(resource);//判断是否计算调整金 //this.calculateShareIncome(resource);//判断是否计算调整金
//判断库里是否已有合同的主账号 //判断库里是否已有合同的主账号
if("tkio".equals(resource.getPlatform())){ if ("tkio".equals(resource.getPlatform())) {
List<Contract> contracts = contractRepository.findByPlatformAndEmail(resource.getPlatform(), resource.getEmail()); List<Contract> contracts = contractRepository.findByPlatformAndEmail(resource.getPlatform(), resource.getEmail());
CalculationFlow calculationFlow = new CalculationFlow(); CalculationFlow calculationFlow = new CalculationFlow();
calculationFlow.setEmail(resource.getEmail()); calculationFlow.setEmail(resource.getEmail());
...@@ -579,9 +579,9 @@ public class ContractServiceImpl implements ContractService { ...@@ -579,9 +579,9 @@ public class ContractServiceImpl implements ContractService {
calculationFlow.setTriggerType("新建"); calculationFlow.setTriggerType("新建");
calculationFlow.setCreateTime(DateUtil.getCurrentDateStr()); calculationFlow.setCreateTime(DateUtil.getCurrentDateStr());
calculationFlow.setIsAll(false); calculationFlow.setIsAll(false);
if(contracts==null || contracts.size()>0){ if (contracts == null || contracts.size() > 0) {
for (Contract contract : contracts) { for (Contract contract : contracts) {
if(intersection(contract,resource)){//有交集 if (intersection(contract, resource)) {//有交集
calculationFlow.setIsAll(true); calculationFlow.setIsAll(true);
break; break;
} }
...@@ -642,7 +642,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -642,7 +642,7 @@ public class ContractServiceImpl implements ContractService {
IncrementFlow flow = new IncrementFlow(); IncrementFlow flow = new IncrementFlow();
Account account = accountRepository.findByEmail(resource.getEmail()); Account account = accountRepository.findByEmail(resource.getEmail());
flow.setAccount(account.getId()); flow.setAccount(account.getId());
flow.setFlow(extraFlow*10000); flow.setFlow(extraFlow * 10000);
flow.setEndDate(resource.getEndDate()); flow.setEndDate(resource.getEndDate());
flow.setStartDate(resource.getStartDate()); flow.setStartDate(resource.getStartDate());
flow.setContractCode(resource.getContractCode()); flow.setContractCode(resource.getContractCode());
...@@ -715,7 +715,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -715,7 +715,7 @@ public class ContractServiceImpl implements ContractService {
IncrementFlow flow = new IncrementFlow(); IncrementFlow flow = new IncrementFlow();
Account account = accountRepository.findByEmail(resource.getEmail()); Account account = accountRepository.findByEmail(resource.getEmail());
flow.setAccount(account.getId()); flow.setAccount(account.getId());
flow.setFlow(extraFlow*10000); flow.setFlow(extraFlow * 10000);
flow.setEndDate(resource.getEndDate()); flow.setEndDate(resource.getEndDate());
flow.setStartDate(resource.getStartDate()); flow.setStartDate(resource.getStartDate());
flow.setContractCode(resource.getContractCode()); flow.setContractCode(resource.getContractCode());
...@@ -894,7 +894,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -894,7 +894,7 @@ public class ContractServiceImpl implements ContractService {
resource.setId(contract.getId()); resource.setId(contract.getId());
//判断库里是否已有合同的主账号 //判断库里是否已有合同的主账号
if("tkio".equals(resource.getPlatform()) && (contract.getStartDate()!=resource.getStartDate()&&contract.getEndDate()!=resource.getEndDate())){ if ("tkio".equals(resource.getPlatform()) && (contract.getStartDate() != resource.getStartDate() && contract.getEndDate() != resource.getEndDate())) {
List<Contract> contracts = contractRepository.findByPlatformAndEmail(resource.getPlatform(), resource.getEmail()); List<Contract> contracts = contractRepository.findByPlatformAndEmail(resource.getPlatform(), resource.getEmail());
CalculationFlow calculationFlow = new CalculationFlow(); CalculationFlow calculationFlow = new CalculationFlow();
calculationFlow.setEmail(resource.getEmail()); calculationFlow.setEmail(resource.getEmail());
...@@ -903,10 +903,10 @@ public class ContractServiceImpl implements ContractService { ...@@ -903,10 +903,10 @@ public class ContractServiceImpl implements ContractService {
calculationFlow.setTriggerType("编辑"); calculationFlow.setTriggerType("编辑");
calculationFlow.setCreateTime(DateUtil.getCurrentDateStr(DateUtil.C_TIME_PATTON_DEFAULT)); calculationFlow.setCreateTime(DateUtil.getCurrentDateStr(DateUtil.C_TIME_PATTON_DEFAULT));
calculationFlow.setIsAll(false); calculationFlow.setIsAll(false);
if(contracts==null || contracts.size()>0){ if (contracts == null || contracts.size() > 0) {
for (Contract contract1 : contracts) { for (Contract contract1 : contracts) {
if(contract1.getId()!=contract.getId()){ if (contract1.getId() != contract.getId()) {
if(intersection(contract1,resource) || intersection(contract1,contract)){//有交集 if (intersection(contract1, resource) || intersection(contract1, contract)) {//有交集
calculationFlow.setIsAll(true); calculationFlow.setIsAll(true);
break; break;
} }
...@@ -919,13 +919,14 @@ public class ContractServiceImpl implements ContractService { ...@@ -919,13 +919,14 @@ public class ContractServiceImpl implements ContractService {
return contractRepository.save(resource); return contractRepository.save(resource);
} }
public Boolean intersection(Contract contract1 ,Contract contract2 ){
return (DateUtil.getDate(contract1.getStartDate()).getTime()<=DateUtil.getDate(contract2.getStartDate()).getTime()&& public Boolean intersection(Contract contract1, Contract contract2) {
DateUtil.getDate(contract1.getEndDate()).getTime()>=DateUtil.getDate(contract2.getStartDate()).getTime() )|| return (DateUtil.getDate(contract1.getStartDate()).getTime() <= DateUtil.getDate(contract2.getStartDate()).getTime() &&
(DateUtil.getDate(contract1.getStartDate()).getTime()<=DateUtil.getDate(contract2.getEndDate()).getTime()&& DateUtil.getDate(contract1.getEndDate()).getTime() >= DateUtil.getDate(contract2.getStartDate()).getTime()) ||
DateUtil.getDate(contract1.getEndDate()).getTime()>=DateUtil.getDate(contract2.getEndDate()).getTime()) || (DateUtil.getDate(contract1.getStartDate()).getTime() <= DateUtil.getDate(contract2.getEndDate()).getTime() &&
(DateUtil.getDate(contract2.getStartDate()).getTime()<=DateUtil.getDate(contract1.getStartDate()).getTime()&& DateUtil.getDate(contract1.getEndDate()).getTime() >= DateUtil.getDate(contract2.getEndDate()).getTime()) ||
DateUtil.getDate(contract2.getEndDate()).getTime()>=DateUtil.getDate(contract1.getEndDate()).getTime()); (DateUtil.getDate(contract2.getStartDate()).getTime() <= DateUtil.getDate(contract1.getStartDate()).getTime() &&
DateUtil.getDate(contract2.getEndDate()).getTime() >= DateUtil.getDate(contract1.getEndDate()).getTime());
} }
private List<ChangeDelDetail> changeDelInfoForContract(Contract byfind, Contract resource, Long pid, String ip) { private List<ChangeDelDetail> changeDelInfoForContract(Contract byfind, Contract resource, Long pid, String ip) {
...@@ -1423,7 +1424,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -1423,7 +1424,7 @@ public class ContractServiceImpl implements ContractService {
c.setMyBodyName(bodyMap.get(c.getMyBodyCode())); c.setMyBodyName(bodyMap.get(c.getMyBodyCode()));
c.setTradeName(tradeTypeMap.get(c.getTradeType() + "")); c.setTradeName(tradeTypeMap.get(c.getTradeType() + ""));
c.setDs(new DateTime(c.getCreateTime()).toString("yyyy-MM-dd")); c.setDs(new DateTime(c.getCreateTime()).toString("yyyy-MM-dd"));
if(c.getBarrioId()!=null) if (c.getBarrioId() != null)
c.setBarrioName(barrioCitiesNameMap.get(barrioCitiesNameMap.get(c.getBarrioId()).getParentId()).getName()); c.setBarrioName(barrioCitiesNameMap.get(barrioCitiesNameMap.get(c.getBarrioId()).getParentId()).getName());
if ((c.getExtraFlow() != null && c.getExtraFlow() > 0) || if ((c.getExtraFlow() != null && c.getExtraFlow() > 0) ||
(c.getDiscountTimeLong() != null && c.getDiscountTimeLong() > 0)) { (c.getDiscountTimeLong() != null && c.getDiscountTimeLong() > 0)) {
...@@ -1738,7 +1739,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -1738,7 +1739,7 @@ public class ContractServiceImpl implements ContractService {
contract.setStatus(ContractStatusEnum.SUSPEND.getKey()); contract.setStatus(ContractStatusEnum.SUSPEND.getKey());
showTip = true; showTip = true;
//判断库里是否已有合同的主账号 //判断库里是否已有合同的主账号
if("tkio".equals(resource.getPlatform())){ if ("tkio".equals(resource.getPlatform())) {
List<Contract> contracts = contractRepository.findByPlatformAndEmail(resource.getPlatform(), resource.getEmail()); List<Contract> contracts = contractRepository.findByPlatformAndEmail(resource.getPlatform(), resource.getEmail());
CalculationFlow calculationFlow = new CalculationFlow(); CalculationFlow calculationFlow = new CalculationFlow();
calculationFlow.setEmail(resource.getEmail()); calculationFlow.setEmail(resource.getEmail());
...@@ -1747,10 +1748,10 @@ public class ContractServiceImpl implements ContractService { ...@@ -1747,10 +1748,10 @@ public class ContractServiceImpl implements ContractService {
calculationFlow.setTriggerType("中止"); calculationFlow.setTriggerType("中止");
calculationFlow.setCreateTime(DateUtil.getCurrentDateStr()); calculationFlow.setCreateTime(DateUtil.getCurrentDateStr());
calculationFlow.setIsAll(false); calculationFlow.setIsAll(false);
if(contracts==null || contracts.size()>0){ if (contracts == null || contracts.size() > 0) {
for (Contract contract1 : contracts) { for (Contract contract1 : contracts) {
if(contract1.getId()!=contract.getId()){ if (contract1.getId() != contract.getId()) {
if(intersection(contract1,contract)){//有交集 if (intersection(contract1, contract)) {//有交集
calculationFlow.setIsAll(true); calculationFlow.setIsAll(true);
break; break;
} }
...@@ -2306,9 +2307,9 @@ public class ContractServiceImpl implements ContractService { ...@@ -2306,9 +2307,9 @@ public class ContractServiceImpl implements ContractService {
InputStream stream = null; InputStream stream = null;
try { try {
int row_length; int row_length;
if(platform.equals("tkio")){ if (platform.equals("tkio")) {
row_length = 15; row_length = 15;
}else{ } else {
row_length = 13; row_length = 13;
} }
stream = file.getInputStream(); stream = file.getInputStream();
...@@ -2384,7 +2385,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -2384,7 +2385,7 @@ public class ContractServiceImpl implements ContractService {
if (!parseRowData(row, row_length, null, titleKey)) { if (!parseRowData(row, row_length, null, titleKey)) {
return ResultModel.ERROR(ResultStatus.FORMAT_FILE_ERRO); return ResultModel.ERROR(ResultStatus.FORMAT_FILE_ERRO);
} }
if(!platform.equals("tkio")){ if (!platform.equals("tkio")) {
titleKey.remove("合同流量"); titleKey.remove("合同流量");
titleKey.remove("track_flow"); titleKey.remove("track_flow");
titleKey.remove("赠送流量"); titleKey.remove("赠送流量");
...@@ -2392,8 +2393,15 @@ public class ContractServiceImpl implements ContractService { ...@@ -2392,8 +2393,15 @@ public class ContractServiceImpl implements ContractService {
} }
int row_already = titleKey.size(); int row_already = titleKey.size();
String extend_row_sql = "platform,product,my_body_code,create_time,code_num,type,status,back_status,ds," + String extend_row_sql = null;
if ("tkio".equals(platform)) {
extend_row_sql = "platform,product,my_body_code,create_time,code_num,type,status,back_status,ds," +
"create_account,create_name,relation_contract,invoice_money,first_back_id";
} else {
extend_row_sql = "platform,product,my_body_code,create_time,code_num,type,status,back_status,ds," +
"create_account,create_name,extra_flow,relation_contract,invoice_money,first_back_id"; "create_account,create_name,extra_flow,relation_contract,invoice_money,first_back_id";
}
int extend_size = extend_row_sql.split(",").length; int extend_size = extend_row_sql.split(",").length;
...@@ -2469,9 +2477,9 @@ public class ContractServiceImpl implements ContractService { ...@@ -2469,9 +2477,9 @@ public class ContractServiceImpl implements ContractService {
if (packageMap != null && (!packageMap.containsKey(dataSTR) && !packageMap.containsValue(Long.parseLong(dataSTR)))) { if (packageMap != null && (!packageMap.containsKey(dataSTR) && !packageMap.containsValue(Long.parseLong(dataSTR)))) {
return ResultModel.ERROR("第" + line_num + "行【套餐】错误"); return ResultModel.ERROR("第" + line_num + "行【套餐】错误");
} else { } else {
if(platform.equals("tkio")){ if (platform.equals("tkio")) {
s_data[w] = dataSTR; s_data[w] = dataSTR;
}else{ } else {
s_data[w] = packageMap.get(dataSTR); s_data[w] = packageMap.get(dataSTR);
} }
} }
...@@ -2484,6 +2492,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -2484,6 +2492,7 @@ public class ContractServiceImpl implements ContractService {
&& !"mm/dd/yy".equals(dfmate) && !"mm/dd/yy".equals(dfmate)
&& !"dd-mmm-yy".equals(dfmate) && !"dd-mmm-yy".equals(dfmate)
&& !"yyyy/m/d".equals(dfmate) && !"yyyy/m/d".equals(dfmate)
&& !"yyyy/m/d;@".equals(dfmate)
) { ) {
return ResultModel.ERROR("第" + line_num + "行【日期单元格】错误"); return ResultModel.ERROR("第" + line_num + "行【日期单元格】错误");
} }
...@@ -2491,7 +2500,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -2491,7 +2500,7 @@ public class ContractServiceImpl implements ContractService {
if (org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(cell)) { if (org.apache.poi.ss.usermodel.DateUtil.isCellDateFormatted(cell)) {
// 用于转化为日期格式 // 用于转化为日期格式
Date d = cell.getDateCellValue(); Date d = cell.getDateCellValue();
if("start_date".equals(sheetTitle) ){ if ("start_date".equals(sheetTitle)) {
createTime = d; createTime = d;
} }
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
...@@ -2508,16 +2517,16 @@ public class ContractServiceImpl implements ContractService { ...@@ -2508,16 +2517,16 @@ public class ContractServiceImpl implements ContractService {
s_data[w] = dataSTR.replace(",", ""); s_data[w] = dataSTR.replace(",", "");
} else if ("barrio_id".equals(sheetTitle)) { } else if ("barrio_id".equals(sheetTitle)) {
if(barrioCityMap.containsKey(Long.parseLong(dataSTR))){ if (barrioCityMap.containsKey(Long.parseLong(dataSTR))) {
s_data[w] = dataSTR; s_data[w] = dataSTR;
}else{ } else {
return ResultModel.ERROR("第" + line_num + "行【行政区域】code错误"); return ResultModel.ERROR("第" + line_num + "行【行政区域】code错误");
} }
} else { } else {
s_data[w] = dataSTR; s_data[w] = dataSTR;
if ("email".equals(sheetTitle) && !StringUtils.isEmpty(dataSTR) && "tkio".equals(platformexcl)) { if ("email".equals(sheetTitle) && !StringUtils.isEmpty(dataSTR) && "tkio".equals(platformexcl)) {
if(!accountsEmail.contains(dataSTR.trim())){ if (!accountsEmail.contains(dataSTR.trim())) {
moreEmail.add(dataSTR.trim()); moreEmail.add(dataSTR.trim());
} }
accountsEmail.add(dataSTR.trim()); accountsEmail.add(dataSTR.trim());
...@@ -2567,10 +2576,17 @@ public class ContractServiceImpl implements ContractService { ...@@ -2567,10 +2576,17 @@ public class ContractServiceImpl implements ContractService {
// create_account,create_name,extra_flow,relation_contract,invoice_money,first_back_id // create_account,create_name,extra_flow,relation_contract,invoice_money,first_back_id
s_data[row_already + 9] = 0; s_data[row_already + 9] = 0;
s_data[row_already + 10] = "导入"; s_data[row_already + 10] = "导入";
if ("tkio".equals(platform)) {
s_data[row_already + 11] = -1;
s_data[row_already + 12] = 0;
s_data[row_already + 13] = 0;
} else {
s_data[row_already + 11] = 0; s_data[row_already + 11] = 0;
s_data[row_already + 12] = -1; s_data[row_already + 12] = -1;
s_data[row_already + 13] = 0; s_data[row_already + 13] = 0;
s_data[row_already + 14] = 0; s_data[row_already + 14] = 0;
}
//批量添加数据 //批量添加数据
args_data.add(s_data); args_data.add(s_data);
} }
...@@ -2595,7 +2611,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -2595,7 +2611,7 @@ public class ContractServiceImpl implements ContractService {
// TransactionStatus transactionStatus = transactionUtils.begin(); // TransactionStatus transactionStatus = transactionUtils.begin();
jdbcTemplate.batchUpdate(sql.toString(), args_data); jdbcTemplate.batchUpdate(sql.toString(), args_data);
// transactionUtils.commit(transactionStatus); // transactionUtils.commit(transactionStatus);
if("tkio".equals(platform)){ if ("tkio".equals(platform)) {
for (String email : moreEmail) { for (String email : moreEmail) {
CalculationFlow calculationFlow = new CalculationFlow(); CalculationFlow calculationFlow = new CalculationFlow();
calculationFlow.setEmail(email); calculationFlow.setEmail(email);
......
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