commit | author | age
|
a18bfa
|
1 |
package com.changhong.epc.admin.service.cost.impl; |
Z |
2 |
|
|
3 |
import com.changhong.epc.admin.mapper.centen.cost.CostTypeTemplateMapper; |
|
4 |
import com.changhong.epc.admin.service.cost.SuppStanderTemplateService; |
|
5 |
import com.changhong.epc.bean.admin.SuppStanderTemplate; |
|
6 |
import com.changhong.epc.bean.admin.extend.SuppStanderTemplateDto; |
|
7 |
import com.changhong.epc.bean.admin.extend.SuppStanderTemplateExtend; |
|
8 |
import com.changhong.epc.bean.tenant.norm.extend.AppStanderExtend; |
|
9 |
import com.changhong.epc.bean.tenant.norm.extend.SuppStanderExtend; |
|
10 |
import lombok.extern.slf4j.Slf4j; |
|
11 |
import org.springframework.stereotype.Service; |
|
12 |
import sun.misc.Regexp; |
|
13 |
|
|
14 |
import javax.annotation.Resource; |
|
15 |
import java.util.List; |
|
16 |
|
|
17 |
@Service |
|
18 |
@Slf4j |
|
19 |
public class SuppStanderTemplateServiceImpl implements SuppStanderTemplateService { |
|
20 |
|
|
21 |
@Resource |
|
22 |
private CostTypeTemplateMapper costTypeTemplateMapper; |
|
23 |
|
|
24 |
@Override |
|
25 |
public List<SuppStanderTemplateExtend> selectByid(SuppStanderTemplate suppStander) { |
|
26 |
return costTypeTemplateMapper.selectByid(suppStander); |
|
27 |
} |
|
28 |
|
|
29 |
@Override |
|
30 |
public int saveSupp(SuppStanderTemplateDto suppStander) { |
|
31 |
int count = 0; |
|
32 |
List<SuppStanderTemplateExtend> suppStanderExtend = suppStander.getSuppStanderExtend(); |
|
33 |
costTypeTemplateMapper.suppStanderUpdate(suppStanderExtend); |
|
34 |
costTypeTemplateMapper.appStanderDefUpdate(suppStanderExtend); |
|
35 |
|
|
36 |
for(SuppStanderTemplateExtend sse : suppStanderExtend){ |
|
37 |
sse.initParam(); |
|
38 |
count += costTypeTemplateMapper.suppStanderSave(sse); |
|
39 |
for(AppStanderExtend appStanderExtend: sse.getAppStanderDefs()) { |
|
40 |
count += costTypeTemplateMapper.appStanderDefSaveOne(appStanderExtend, sse); |
|
41 |
} |
|
42 |
} |
|
43 |
|
|
44 |
return count; |
|
45 |
} |
|
46 |
} |