|
@@ -2,10 +2,13 @@ package com.njyunzhi.pet_identity.service.impl;
|
2
|
2
|
|
3
|
3
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
4
|
import com.njyunzhi.pet_identity.common.Constants;
|
|
5
|
+import com.njyunzhi.pet_identity.entity.SysSetting;
|
5
|
6
|
import com.njyunzhi.pet_identity.entity.TaApplication;
|
|
7
|
+import com.njyunzhi.pet_identity.mapper.SysSettingMapper;
|
6
|
8
|
import com.njyunzhi.pet_identity.mapper.TaApplicationMapper;
|
7
|
9
|
import com.njyunzhi.pet_identity.service.ITaApplicationService;
|
8
|
10
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
11
|
+import org.springframework.beans.factory.annotation.Autowired;
|
9
|
12
|
import org.springframework.stereotype.Service;
|
10
|
13
|
|
11
|
14
|
import java.time.LocalDateTime;
|
|
@@ -21,6 +24,9 @@ import java.time.LocalDateTime;
|
21
|
24
|
@Service
|
22
|
25
|
public class TaApplicationServiceImpl extends BaseServiceImpl<TaApplicationMapper, TaApplication> implements ITaApplicationService {
|
23
|
26
|
|
|
27
|
+ @Autowired
|
|
28
|
+ SysSettingMapper sysSettingMapper;
|
|
29
|
+
|
24
|
30
|
@Override
|
25
|
31
|
public int countBetween(LocalDateTime dayStart, LocalDateTime dayEnd) {
|
26
|
32
|
QueryWrapper<TaApplication> queryWrapper = new QueryWrapper<>();
|
|
@@ -30,4 +36,23 @@ public class TaApplicationServiceImpl extends BaseServiceImpl<TaApplicationMappe
|
30
|
36
|
|
31
|
37
|
return count(queryWrapper);
|
32
|
38
|
}
|
|
39
|
+
|
|
40
|
+ @Override
|
|
41
|
+ public Integer getTotalCharge(TaApplication taApplication) {
|
|
42
|
+
|
|
43
|
+ // 申领方式
|
|
44
|
+ Integer applyMethod = taApplication.getApplyMethod();
|
|
45
|
+
|
|
46
|
+ // 获取工本费
|
|
47
|
+ SysSetting setting1 = sysSettingMapper.selectById(Constants.SYSSETTING_PRODUCTION_COST);
|
|
48
|
+ int fee1 = (int) (Float.parseFloat(setting1.getContent().trim()) * 100);
|
|
49
|
+
|
|
50
|
+ if (Constants.APPLY_METHOD_AUTO == taApplication.getApplyMethod()) return fee1;
|
|
51
|
+
|
|
52
|
+ // 获取快递费
|
|
53
|
+ SysSetting setting2 = sysSettingMapper.selectById(Constants.SYSSETTING_EXPRESS_FEE);
|
|
54
|
+ int fee2 = (int) (Float.parseFloat(setting2.getContent().trim()) * 100);
|
|
55
|
+
|
|
56
|
+ return fee1 + fee2;
|
|
57
|
+ }
|
33
|
58
|
}
|