Преглед изворни кода

新增技术公出判定接口

anderx пре 1 година
родитељ
комит
d263900ab8

+ 2 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -53,4 +53,6 @@ public interface PublicReleaseMapper {
 
     Integer selectCountByaidAndDate(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
     List<OutFinanceCount> selectByaidAndDate(@Param("aid") String aid, @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    List<PublicRelease> selectByOrderNo(String orderNo);
 }

+ 6 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -881,4 +881,10 @@
             and a.release_start between #{startTime} and #{endTime})x
     group by x.aid,x.dates
   </select>
+    <select id="selectByOrderNo" resultMap="BaseResultMap">
+      select
+      <include refid="Base_Column_List" />
+      from public_release
+      where order_no= #{orderNo}
+    </select>
 </mapper>

+ 81 - 0
src/main/java/com/goafanti/weChat/bo/CheckOrderNoOut.java

@@ -0,0 +1,81 @@
+package com.goafanti.weChat.bo;
+
+import java.math.BigDecimal;
+
+public class CheckOrderNoOut {
+        private String userName;
+        private String contractNo;
+
+        private Integer peopleCount;
+        private Integer timesCount;
+        private BigDecimal durationCount;
+        private BigDecimal durationMax;
+
+        private Integer amountType;
+
+        private String adminName;
+
+        public BigDecimal getDurationMax() {
+            return durationMax;
+        }
+
+        public void setDurationMax(BigDecimal durationMax) {
+            this.durationMax = durationMax;
+        }
+
+        public String getUserName() {
+            return userName;
+        }
+
+        public void setUserName(String userName) {
+            this.userName = userName;
+        }
+
+        public String getContractNo() {
+            return contractNo;
+        }
+
+        public void setContractNo(String contractNo) {
+            this.contractNo = contractNo;
+        }
+
+        public Integer getPeopleCount() {
+            return peopleCount;
+        }
+
+        public void setPeopleCount(Integer peopleCount) {
+            this.peopleCount = peopleCount;
+        }
+
+        public Integer getTimesCount() {
+            return timesCount;
+        }
+
+        public void setTimesCount(Integer timesCount) {
+            this.timesCount = timesCount;
+        }
+
+        public BigDecimal getDurationCount() {
+            return durationCount;
+        }
+
+        public void setDurationCount(BigDecimal durationCount) {
+            this.durationCount = durationCount;
+        }
+
+        public Integer getAmountType() {
+            return amountType;
+        }
+
+        public void setAmountType(Integer amountType) {
+            this.amountType = amountType;
+        }
+
+        public String getAdminName() {
+            return adminName;
+        }
+
+        public void setAdminName(String adminName) {
+            this.adminName = adminName;
+        }
+}

+ 7 - 0
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -418,5 +418,12 @@ public class AdminReleaseApiController extends CertifyApiController{
 	}
 
 
+	@RequestMapping(value = "/deleteAssistant",method = RequestMethod.GET)
+	public Result deleteAssistant (InputPublicRelease in){
+		Result res =new Result();
+		return res.data(publicReleaseService.checkOrderNoDuration(in));
+	}
+
+
 
 }

+ 2 - 0
src/main/java/com/goafanti/weChat/service/PublicReleaseService.java

@@ -64,4 +64,6 @@ public interface PublicReleaseService {
     int updateLocation(InputPublicRelease in);
 
 	Object publicReleaseAndCount(InputPublicDtails in);
+
+    Map checkOrderNoDuration( InputPublicRelease in);
 }

+ 62 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -19,6 +19,7 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.websocket.SystemWebSocketHandler;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.service.CustomerService;
+import com.goafanti.order.bo.TOrderNewBo;
 import com.goafanti.weChat.bo.*;
 import com.goafanti.weChat.service.PublicReleaseService;
 import org.springframework.beans.BeanUtils;
@@ -1494,5 +1495,66 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return map;
 	}
 
+	@Override
+	public Map checkOrderNoDuration( InputPublicRelease in) {
+		List<PublicRelease> list = publicReleaseMapper.selectByOrderNo(in.getOrderNo());
+		TOrderNewBo t = tOrderNewMapper.getOrderNewDetail(in.getOrderNo());
+		BigDecimal count = BigDecimal.ZERO;
+		count=count.add(BigDecimal.valueOf(in.getDuration()));
+		for (PublicRelease e : list) {
+			if (e.getDuration()!=null){
+				count=count.add(BigDecimal.valueOf(e.getDuration()));
+			}
+		}
+		Map map=new HashMap();
+		CheckOrderNoOut data= new CheckOrderNoOut();
+		data.setUserName(t.getUserName());
+		data.setContractNo(t.getContractNo());
+		data.setAdminName(t.getSalesmanName());
+		// 0=0-1 1=1-3 2=3-5 3=5-10 4=10以上
+        if (t.getTotalAmount().compareTo(BigDecimal.valueOf(1)) < 0) {
+			data.setAmountType(0);
+			data.setDurationMax(BigDecimal.ZERO);
+			map.put("code",false);
+			map.put("data",data);
+        } else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(3))<0) {
+			data.setAmountType(1);
+			data.setDurationMax(BigDecimal.valueOf(15));
+			if (count.compareTo(data.getDurationMax())<1){
+				map.put("code",true);
+				map.put("data",null);
+			}else {
+				map.put("code",false);
+				map.put("data",data);
+			}
+		} else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(5))<0) {
+			data.setAmountType(2);
+			data.setDurationMax(BigDecimal.valueOf(45));
+			if (count.compareTo(data.getDurationMax())<1){
+				map.put("code",true);
+				map.put("data",null);
+			}else {
+				map.put("code",false);
+				map.put("data",data);
+			}
+		} else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(10))<0) {
+			data.setAmountType(3);
+			data.setDurationMax(BigDecimal.valueOf(120));
+			if (count.compareTo(data.getDurationMax())<1){
+				map.put("code",true);
+				map.put("data",null);
+			}else {
+				map.put("code",false);
+				map.put("data",data);
+			}
+		} else if (t.getTotalAmount().compareTo(BigDecimal.valueOf(10))>0) {
+			data.setAmountType(4);
+			map.put("code",true);
+			map.put("data",null);
+		}
+	return map;
+
+	}
+
 
 }