BusinessServiceImpl.java
1.38 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
package com.bsth.service.impl;
import com.bsth.common.ResponseCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bsth.entity.Business;
import com.bsth.repository.BusinessRepository;
import com.bsth.service.BusinessService;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
/**
*
* @ClassName: BusinessServiceImpl(公司service业务层实现类)
*
* @Extends : BaseService
*
* @Description: TODO(公司service业务层)
*
* @Author bsth@lq
*
* @Date 2016-4-28 9:21:17
*
* @Version 公交调度系统BS版 0.1
*
*/
@Service
public class BusinessServiceImpl extends BaseServiceImpl<Business, Integer> implements BusinessService{
@Autowired
private BusinessRepository businessRepository;
@Override
public long getCompCode() {
// TODO Auto-generated method stub
return businessRepository.getMaxId();
}
@Transactional
@Override
public Map<String, Object> update(Business b) {
Map<String, Object> map = new HashMap<>();
int status = businessRepository.update(b.getBusinessName(), b.getUpCode(), b.getUpdateDate(),
b.getBusinessCode());
if (status==1) {
map.put("status", ResponseCode.SUCCESS);
} else {
map.put("status", ResponseCode.ERROR);
}
return map;
}
}