DropPointInfoServiceImpl.java
3.72 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
124
125
126
127
128
129
130
131
132
133
134
135
136
package com.trash.dropPointInfo.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.trash.common.utils.DateUtils;
import com.trash.common.utils.SecurityUtils;
import com.trash.common.utils.spring.SpringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.stereotype.Service;
import com.trash.dropPointInfo.mapper.DropPointInfoMapper;
import com.trash.dropPointInfo.domain.DropPointInfo;
import com.trash.dropPointInfo.service.IDropPointInfoService;
import com.trash.office.mapper.UploadFileMapper;
import com.trash.workflow.service.IWorkflowService;
/**
* 投放点信息管理Service业务层处理
*
* @author trash
* @date 2024-11-14
*/
@Service
public class DropPointInfoServiceImpl implements IDropPointInfoService
{
@Autowired
private DropPointInfoMapper dropPointInfoMapper;
/**
* 查询投放点信息管理
*
* @param id 投放点信息管理ID
* @return 投放点信息管理
*/
@Override
public DropPointInfo selectDropPointInfoById(Long id)
{
return dropPointInfoMapper.selectDropPointInfoById(id);
}
/**
* 查询投放点信息管理列表
*
* @param dropPointInfo 投放点信息管理
* @return 投放点信息管理
*/
@Override
public List<DropPointInfo> selectDropPointInfoList(DropPointInfo dropPointInfo)
{
List<String> ids = SecurityUtils.getLoginUser().getUser().getStreetsList();
if(ids.size() > 0){
dropPointInfo.setSList(ids);
return dropPointInfoMapper.selectDropPointInfoList(dropPointInfo);
}
return new ArrayList<DropPointInfo>();
}
/**
* 新增投放点信息管理
*
* @param dropPointInfo 投放点信息管理
* @return 结果
*/
@Autowired
IWorkflowService workflow;
@Override
public int insertDropPointInfo(DropPointInfo dropPointInfo)
{
dropPointInfo.setCreateTime(DateUtils.getNowDate());
dropPointInfo.setCreateBy(SecurityUtils.getUsername());
dropPointInfo.setStatus(1);
int i = dropPointInfoMapper.insertDropPointInfo(dropPointInfo);
if(i == 0){
return i;
}
//先不提交流程
// Map<String, String> map = new HashMap<String, String>();
// map.put("name", dropPointInfo.getDropPointName());
// map.put("area", dropPointInfo.getDistrict());
// map.put("id", dropPointInfo.getId()+"");
//
// i = workflow.createDropPointWorkFlow(map);
// if (i == 0) {
// dropPointInfoMapper.deleteDropPointInfoById(dropPointInfo.getId());
// }
return i;
}
/**
* 修改投放点信息管理
*
* @param dropPointInfo 投放点信息管理
* @return 结果
*/
@Override
public int updateDropPointInfo(DropPointInfo dropPointInfo)
{
dropPointInfo.setUpdateTime(DateUtils.getNowDate());
dropPointInfo.setUpdateBy(SecurityUtils.getUsername());
return dropPointInfoMapper.updateDropPointInfo(dropPointInfo);
}
/**
* 批量删除投放点信息管理
*
* @param ids 需要删除的投放点信息管理ID
* @return 结果
*/
@Override
public int deleteDropPointInfoByIds(Long[] ids)
{
return dropPointInfoMapper.deleteDropPointInfoByIds(ids);
}
/**
* 删除投放点信息管理信息
*
* @param id 投放点信息管理ID
* @return 结果
*/
@Override
public int deleteDropPointInfoById(Long id)
{
return dropPointInfoMapper.deleteDropPointInfoById(id);
}
}