|
|
@@ -2580,84 +2580,40 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
|
|
|
data.setAdminName(t.getSalesmanName());
|
|
|
data.setDurationCount(actualDuration);
|
|
|
//获取年份
|
|
|
- List<OrderYearMaxDuration> yearMaxDurationList = orderYearMaxDurationMapper.selectByOrderNo(in.getOrderNo());
|
|
|
- int year = LocalDate.now().getYear();
|
|
|
- OrderYearMaxDuration useOyd = null;
|
|
|
- for (int i = 0; i < yearMaxDurationList.size(); i++) {
|
|
|
- OrderYearMaxDuration oyd = yearMaxDurationList.get(i);
|
|
|
- //年份为0不是会员直接获取跳出循环,否则获取当前年份,获取不到获取最后一年
|
|
|
- if (oyd.getYear()==0){
|
|
|
- useOyd=oyd;
|
|
|
- break;
|
|
|
- }else {
|
|
|
- if (oyd.getYear().equals(year)){
|
|
|
- useOyd = oyd;
|
|
|
- break;
|
|
|
- }
|
|
|
- if(i==yearMaxDurationList.size()-1&&useOyd==null){
|
|
|
- useOyd = yearMaxDurationList.get(i);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- data.setDurationMax(useOyd.getMaxDuration());
|
|
|
+ TOrderPublicReleaseCount releaseCount = tOrderPublicReleaseCountMapper.selectByOrderNo(in.getOrderNo());
|
|
|
+ data.setDurationMax(BigDecimal.valueOf(releaseCount.getMaxDuration()));
|
|
|
TOrderNew tOrderNew = tOrderNewMapper.selectByPrimaryKey(in.getOrderNo());
|
|
|
- List<TTaskMember> tTaskMembers = tTaskMemberMapper.selectByOrderNo(tOrderNew.getOrderNo());
|
|
|
String amountName=null;
|
|
|
String amountType=null;
|
|
|
- if (tTaskMembers.size()<1){
|
|
|
- if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(1))<0){
|
|
|
- amountName="本合同低于1万";
|
|
|
- amountType="原则上技术人员不可下户";
|
|
|
- }else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(3))<0){
|
|
|
- amountName="本合同在1~3万";
|
|
|
- amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
- }else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(5))<0){
|
|
|
- amountName="本合同在3~5万";
|
|
|
- amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
- }else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(10))<0){
|
|
|
- amountName="本合同在5~10万";
|
|
|
- amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
- }
|
|
|
- }else {
|
|
|
- int yearSum=1;
|
|
|
- for (TTaskMember tTaskMember : tTaskMembers) {
|
|
|
- if (tTaskMember.getYearSum()!=null&&tTaskMember.getYearSum()>yearSum){
|
|
|
- yearSum=tTaskMember.getYearSum();
|
|
|
- }
|
|
|
- }
|
|
|
- BigDecimal divide =BigDecimal.ZERO;
|
|
|
- if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(0))>0&&yearSum>0){
|
|
|
- divide=tOrderNew.getTotalAmount().divide(BigDecimal.valueOf(yearSum), BigDecimal.ROUND_HALF_UP);
|
|
|
- }else {
|
|
|
- divide=tOrderNew.getTotalAmount();
|
|
|
- }
|
|
|
- if (divide.compareTo(BigDecimal.valueOf(1))<0){
|
|
|
- amountName="此会员订单,本年度金额低于1万";
|
|
|
- amountType="原则上技术人员不可下户";
|
|
|
- }else if (divide.compareTo(BigDecimal.valueOf(3))<0){
|
|
|
- amountName="此会员订单,本年度金额1~3万";
|
|
|
- amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
- }else if (divide.compareTo(BigDecimal.valueOf(5))<0){
|
|
|
- amountName="此会员订单,本年度金额3~5万";
|
|
|
- amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
- }else if (divide.compareTo(BigDecimal.valueOf(10))<0){
|
|
|
- amountName="此会员订单,本年度金额5~10万";
|
|
|
- amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
- }
|
|
|
+ if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(1))<0){
|
|
|
+ amountName="本合同低于1万";
|
|
|
+ amountType="原则上技术人员不可下户";
|
|
|
+ }else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(3))<0){
|
|
|
+ amountName="本合同在1~3万";
|
|
|
+ amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
+ }else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(5))<0){
|
|
|
+ amountName="本合同在3~5万";
|
|
|
+ amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
+ }else if (tOrderNew.getTotalAmount().compareTo(BigDecimal.valueOf(10))<0){
|
|
|
+ amountName="本合同在5~10万";
|
|
|
+ amountType="已超出合同可公出标准"+data.getDurationMax()+"小时";
|
|
|
}
|
|
|
data.setAmountName(amountName);
|
|
|
data.setAmountType(amountType);
|
|
|
- //不需要限制
|
|
|
- if(useOyd.getStatus()==1){
|
|
|
- map.put("code",true);
|
|
|
+ //未设置公出
|
|
|
+ if(releaseCount.getMaxType()==2||releaseCount.getMaxType()==0){
|
|
|
+ map.put("code",releaseCount.getMaxType());
|
|
|
+ map.put("flag",false);
|
|
|
map.put("data",null);
|
|
|
}else {
|
|
|
//需要限制判定小时
|
|
|
if (actualDuration.compareTo(data.getDurationMax())<1){
|
|
|
- map.put("code",true);
|
|
|
+ map.put("code",releaseCount.getMaxType());
|
|
|
+ map.put("flag",true);
|
|
|
map.put("data",null);
|
|
|
}else {
|
|
|
- map.put("code",false);
|
|
|
+ map.put("code",releaseCount.getMaxType());
|
|
|
+ map.put("flag",false);
|
|
|
map.put("data",data);
|
|
|
}
|
|
|
}
|