MawbDetailService.java
1.54 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.erry.iclear.dateInterface.service;
import com.erry.iclear.dateInterface.api.request.Mawb;
import com.erry.iclear.dateInterface.api.request.MawbDetail;
import com.erry.iclear.dateInterface.api.response.ResultRS;
import com.erry.iclear.dateInterface.repository.MawbDetailRepository;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
/**
* @author Administrator
*/
@Service
@Slf4j
public class MawbDetailService {
@Autowired
private MawbDetailRepository mawbDetailRepository;
public void saveMawbDetail(List<MawbDetail> mawbDetailList){
log.info("");
log.info("");
}
public ResultRS checkMawbDetail(Mawb mawb){
ResultRS result = new ResultRS(Boolean.FALSE,null,null);
try{
for (MawbDetail detail : mawb.getMawbDetailList()) {
String secondUnit = detail.getSecondUnit();
if (StringUtils.isNotEmpty(secondUnit)) {
Integer secondQty = detail.getSecondQty();
if (Objects.isNull(secondQty)) {
result.setMsg("参数secondQty不能为空");
return result;
}
}
}
result.setSuccess(Boolean.TRUE);
}catch (Exception e){
log.error("checkMawbDetail() error:"+e.getMessage());
}
return result;
}
}