0cb922df0ebedc98fc002a94fffd8adc8869f75b.svn-base
3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.ycsl.service;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.ycsl.entity.YcslJbxx;
import com.thinkgem.jeesite.modules.ycsl.entity.YcslSj;
import com.thinkgem.jeesite.modules.ycsl.entity.YcslSjcl;
import com.thinkgem.jeesite.modules.reg.web.httprest.httpRestService.HttpactivityService;
import com.thinkgem.jeesite.modules.ycsl.dao.YcslSjDao;
import com.thinkgem.jeesite.modules.ycsl.dao.YcslSjclDao;
/**
* 一窗受理-收件材料Service
* @author lzj
* @version 2020-12-26
*/
@Service
@Transactional(readOnly = true)
public class YcslSjService extends CrudService<YcslSjDao, YcslSj> {
@Autowired
private YcslSjclDao ycslSjclDao;
@Lazy
@Autowired
private YcslJbxxService ycslJbxxService;
@Autowired
private HttpactivityService httpactivityService;
public YcslSj get(String id) {
YcslSj ycslSj = super.get(id);
ycslSj.setYcslSjclList(ycslSjclDao.findList(new YcslSjcl(ycslSj)));
return super.get(id);
}
public List<YcslSj> findList(YcslSj ycslSj) {
return super.findList(ycslSj);
}
public Page<YcslSj> findPage(Page<YcslSj> page, YcslSj ycslSj) {
return super.findPage(page, ycslSj);
}
@Transactional(readOnly = false)
public void save(YcslSj ycslSj) {
super.save(ycslSj);
for (YcslSjcl ycslSjcl : ycslSj.getYcslSjclList()){
if (ycslSjcl.getId() == null){
continue;
}
if (ycslSjcl.DEL_FLAG_NORMAL.equals(ycslSjcl.getDelFlag())){
if (StringUtils.isBlank(ycslSjcl.getId())){
ycslSjcl.setSjId(ycslSj);
ycslSjcl.setProid(ycslSj.getProid());
ycslSjcl.preInsert();
ycslSjclDao.insert(ycslSjcl);
}else{
ycslSjcl.preUpdate();
ycslSjclDao.update(ycslSjcl);
}
}else{
ycslSjclDao.delete(ycslSjcl);
}
}
}
public void savesjmain(YcslSj ycslSj) {
super.save(ycslSj);
}
public void savesjchild(YcslSjcl ycslSjcl) {
if (StringUtils.isBlank(ycslSjcl.getId())){
ycslSjcl.preInsert();
ycslSjclDao.insertsjcl(ycslSjcl);
}else{
ycslSjcl.preUpdate();
ycslSjclDao.update(ycslSjcl);
}
}
@Transactional(readOnly = false)
public void delete(YcslSj ycslSj) {
super.delete(ycslSj);
ycslSjclDao.delete(new YcslSjcl(ycslSj));
}
public YcslSj getByProid(String proid) {
// TODO Auto-generated method stub
return dao.getByProid(proid);
}
@Transactional(readOnly = false)
public void saveSj(YcslSj ycslSj) {
YcslJbxx jbxx = ycslJbxxService.get(ycslSj.getProid());
Map map = Maps.newHashMap();
if(StringUtils.isNotBlank(jbxx.getZt())) {
map = ycslJbxxService.getMap(jbxx);
try {
Map json = httpactivityService.postRequest(map,"updateSL");
jbxx.setZt("true");
ycslJbxxService.save(jbxx);
} catch (Exception e) {
jbxx.setZt("false");
ycslJbxxService.save(jbxx);
e.printStackTrace();
}
}
save(ycslSj);
}
}