|
@@ -49,6 +49,7 @@ import java.io.File;
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -659,7 +660,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
BigDecimal durationCount = BigDecimal.ZERO;
|
|
BigDecimal durationCount = BigDecimal.ZERO;
|
|
|
int count=0;
|
|
int count=0;
|
|
|
List<String> peopleList = new ArrayList<>();
|
|
List<String> peopleList = new ArrayList<>();
|
|
|
-
|
|
|
|
|
for (PublicRelease e : list) {
|
|
for (PublicRelease e : list) {
|
|
|
durationCount=durationCount.add(BigDecimal.valueOf(e.getDuration()));
|
|
durationCount=durationCount.add(BigDecimal.valueOf(e.getDuration()));
|
|
|
if (!peopleList.contains(e.getAid())){
|
|
if (!peopleList.contains(e.getAid())){
|
|
@@ -667,7 +667,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
}
|
|
|
count++;
|
|
count++;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
TOrderPublicReleaseCount out = tOrderPublicReleaseCountMapper.selectByOrderNo(orderNo);
|
|
TOrderPublicReleaseCount out = tOrderPublicReleaseCountMapper.selectByOrderNo(orderNo);
|
|
|
if (out==null){
|
|
if (out==null){
|
|
|
out=new TOrderPublicReleaseCount();
|
|
out=new TOrderPublicReleaseCount();
|
|
@@ -693,19 +692,32 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
|
|
private void pushMaxDuration(TOrderNewBo t,TOrderPublicReleaseCount out ) {
|
|
private void pushMaxDuration(TOrderNewBo t,TOrderPublicReleaseCount out ) {
|
|
|
BigDecimal res=BigDecimal.ZERO;
|
|
BigDecimal res=BigDecimal.ZERO;
|
|
|
|
|
+ //新增如果有会员年份,计算金额改为总金额除以年份
|
|
|
|
|
+ List<TTaskMember> tTaskMembers = tTaskMemberMapper.selectByOrderNo(t.getOrderNo());
|
|
|
|
|
+ int yearSum=1;
|
|
|
|
|
+ for (TTaskMember e : tTaskMembers) {
|
|
|
|
|
+ if(e.getYearSum()!=null&&e.getYearSum()>1){
|
|
|
|
|
+ yearSum=e.getYearSum();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ BigDecimal totalAmount=t.getTotalAmount();
|
|
|
|
|
+ if (yearSum>1){
|
|
|
|
|
+ totalAmount=totalAmount.divide(BigDecimal.valueOf(yearSum),2, RoundingMode.HALF_UP);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
int status=1;
|
|
int status=1;
|
|
|
- if (t.getTotalAmount().compareTo(BigDecimal.valueOf(1)) < 0) {
|
|
|
|
|
|
|
+ if (totalAmount.compareTo(BigDecimal.valueOf(1)) < 0) {
|
|
|
res=BigDecimal.ZERO;
|
|
res=BigDecimal.ZERO;
|
|
|
- } else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(3))<0) {
|
|
|
|
|
|
|
+ } else if (totalAmount.compareTo(BigDecimal.valueOf(3))<0) {
|
|
|
res=BigDecimal.valueOf(15);
|
|
res=BigDecimal.valueOf(15);
|
|
|
|
|
|
|
|
- } else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(5))<0) {
|
|
|
|
|
|
|
+ } else if (totalAmount.compareTo(BigDecimal.valueOf(5))<0) {
|
|
|
res=BigDecimal.valueOf(45);
|
|
res=BigDecimal.valueOf(45);
|
|
|
|
|
|
|
|
- } else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(10))<0) {
|
|
|
|
|
|
|
+ } else if (totalAmount.compareTo(BigDecimal.valueOf(10))<0) {
|
|
|
res=BigDecimal.valueOf(120);
|
|
res=BigDecimal.valueOf(120);
|
|
|
|
|
|
|
|
- } else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(10))>=0) {
|
|
|
|
|
|
|
+ } else if (totalAmount.compareTo(BigDecimal.valueOf(10))>=0) {
|
|
|
res=BigDecimal.valueOf(-1);
|
|
res=BigDecimal.valueOf(-1);
|
|
|
status=0;
|
|
status=0;
|
|
|
}
|
|
}
|