DeclaredInfoService.java
1.67 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
package com.erry.iclear.dateInterface.service;
import com.erry.iclear.dateInterface.common.Constant;
import com.erry.iclear.dateInterface.entity.DeclaredInfo;
import com.erry.iclear.dateInterface.entity.DictionaryEntries;
import com.erry.iclear.dateInterface.repository.DeclaredInfoRepository;
import com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* xjq 2021年11月5日
*/
@Service
@Slf4j
@Transactional(rollbackOn = Exception.class)
public class DeclaredInfoService {
@Autowired
private DeclaredInfoRepository declaredInfoRepository;
@Autowired
private DictionaryEntriesRepository dictionaryEntriesRepository;
public List<DeclaredInfo> selectDeclaredInfo(String[] consignmentCode){
List<DeclaredInfo> DeclaredInfo = new ArrayList<>();
DictionaryEntries consTypeC = dictionaryEntriesRepository.findDictionaryEntriesByCode(Constant.consType_C);
List<String> consignmentCodeList = stringList(consignmentCode);
DeclaredInfo = declaredInfoRepository.getDeclaredInfoByAll(consignmentCodeList,consTypeC.getId());
return DeclaredInfo;
}
public List<String> stringList(String[] consignmentCode){
List consignmentCodeList = new ArrayList();
if(consignmentCode.length>0){
for(int i = 0; i < consignmentCode.length; i++){
consignmentCodeList.add(consignmentCode[i]);
}
}
return consignmentCodeList;
}
}