Parcourir la source

付款节点限制提示开发

Signed-off-by: anderx <312518615@qq.com>
anderx il y a 5 ans
Parent
commit
5812f15dd8

+ 1 - 1
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -1557,7 +1557,7 @@ select
 	a.task_status as taskStatus,e.contacts,a.attachment_url as attachmentUrl,a.outsource_name outsourceName, f.nickname as userName,a.set_up_amount as setUpAmount,
 	g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent, a.arrival_money as arrivalMoney,
 	a.certificate_number as certificateNumber, a.status,a.form_retrieve as formRetrieve, a.task_refund as taskRefund,a.task_receiver taskReceiver,
-	a.refund_content as refundContent, a.declare_user as  declareUser, a.declare_pwd as declarePwd,e.contract_no as contractNo,e.contacts ,
+	a.refund_content as refundContent, a.declare_user as  declareUser, a.declare_pwd as declarePwd,e.contract_no as contractNo,e.contacts ,b.`type` bpType,
 	date_format(a.task_end_time,'%Y-%m-%d') as endDate,date_format(a.accept_time,'%Y-%m-%d') as acceptDate,h.name as depName,e.contact_mobile as contactMobile ,
 	date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,
 	date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,e.legal_person as legalPerson,

+ 0 - 2
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -44,12 +44,10 @@ import com.goafanti.order.bo.InputNewOrderDunBo;
 import com.goafanti.order.bo.OrderDunTaskBo;
 import com.goafanti.order.bo.OutNewOrderDunBo;
 import com.goafanti.order.bo.TOrderNewBo;
-import com.goafanti.order.enums.NewOrderDunType;
 import com.goafanti.order.enums.OrderDunProjectType;
 import com.goafanti.order.service.NewOrderDunService;
 import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OrderProjectService;
-import com.goafanti.order.service.impl.OrderProjectServiceImpl;
 import com.goafanti.organization.bo.OutPaymentNode;
 
 @Component

+ 11 - 2
src/main/java/com/goafanti/order/bo/TOrderTaskDetailBo.java

@@ -36,6 +36,7 @@ public class TOrderTaskDetailBo {
 	private Integer locationArea;
 	private String postalAddress;
 	private Integer declarationBatch;
+	
 	/**
 	 * 任务状态
 	 */
@@ -77,8 +78,10 @@ public class TOrderTaskDetailBo {
 	private Integer splitStatus;
 	private String splitSuper;
 	private Integer splitId;
-	
-	
+	/**
+	 * 项目分类
+	 */
+	private Integer bpType;
 	
 	
 	public Integer getSplitStatus() {
@@ -352,6 +355,12 @@ public class TOrderTaskDetailBo {
 	public void setDeclarationBatch(Integer declarationBatch) {
 		this.declarationBatch = declarationBatch;
 	}
+	public Integer getBpType() {
+		return bpType;
+	}
+	public void setBpType(Integer bpType) {
+		this.bpType = bpType;
+	}
 	
 	
 }

+ 5 - 0
src/main/java/com/goafanti/organization/controller/ThirdPartyCompanyApiController.java

@@ -192,6 +192,11 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 			res.getError().add(buildError("金额超出限制,请核对可输入余额。","金额超出限制,请核对可输入余额。"));
 			return res;
 		}
+		
+		if (p.getPaymentType()==1&&thirdPartyCompanyService.checkprojectDun(p)) {
+			res.getError().add(buildError("项目节点未达到可付款状态。","项目节点未达到可付款状态。"));
+			return res;
+		}
 		res.data(thirdPartyCompanyService.addOrderPayment(p));
 		return res;
 	}

+ 2 - 0
src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java

@@ -50,5 +50,7 @@ public interface ThirdPartyCompanyService {
 
 	boolean checkPayment(TOrderPayment p);
 
+	boolean checkprojectDun(TOrderPayment p);
+
 
 }

+ 56 - 1
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -3,6 +3,7 @@ package com.goafanti.organization.service.impl;
 import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
@@ -22,6 +23,7 @@ import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.PaymentLogMapper;
 import com.goafanti.common.dao.PaymentNodeMapper;
 import com.goafanti.common.dao.TOrderPaymentMapper;
+import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.ThirdPartyCompanyMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.model.CompanyLibrary;
@@ -29,11 +31,14 @@ import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.PaymentLog;
 import com.goafanti.common.model.PaymentNode;
 import com.goafanti.common.model.TOrderPayment;
+import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.ThirdPartyCompany;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.SendEmailUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.TOrderTaskDetailBo;
+import com.goafanti.order.enums.NewOrderDunType;
 import com.goafanti.organization.bo.InputPaymentNode;
 import com.goafanti.organization.bo.InuptFinancialPayment;
 import com.goafanti.organization.bo.NoticeInformationBo;
@@ -63,6 +68,9 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	private NoticeMapper	noticeMapper;
 	@Autowired
 	private FinancialPaymentMapper	financialPaymentMapper;
+	@Autowired
+	private TOrderTaskMapper	tOrderTaskMapper;
+	
 	
 
 
@@ -252,7 +260,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			list=tOrderPaymentMapper.selectList(null,p.getNodeId());
 		}
 		for (outOrderPayment o : list) {
-			a=a.add(o.getNodeTotalAmount());
+			a=a.add(o.getPaymentAmount());
 		}
 		if (p.getPaymentType()==0) {
 			ThirdPartyCompany t=thirdPartyCompanyMapper.selectByPrimaryKey(p.getTpcId());
@@ -268,5 +276,52 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	}
 
 
+	@Override
+	public boolean checkprojectDun(TOrderPayment p) {
+		PaymentNode pn=paymentNodeMapper.selectByPrimaryKey(p.getNodeId());
+		TOrderTaskDetailBo tt=tOrderTaskMapper.getOrderTaskDetail(p.getTid().toString());
+//		项目状态 0-项目待提交 1-项目已提交,2-项目评审,3-项目立项,4-项目公示,5-项目抽查,6-项目备案,7-项目下证,8-项目验收,
+//		9-项目拨款 10- 项目进度10% 11- 项目进度30% 12- 项目进度70%
+		if (pn.getDunType()==0&&pn.getPartyTime().getTime()<new Date().getTime()) {//如果自定义则看触发时间
+				return false;
+		}else if (NewOrderDunType.CGZH_WC.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>7&&tt.getProjectStatus()<10)) {
+			return false;
+		}else if (NewOrderDunType.COMMON_NGS.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>3&&tt.getProjectStatus()<10)) {
+			return false;
+		}else if (NewOrderDunType.COMMON_XZ.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>6&&tt.getProjectStatus()<10)) {
+			return false;
+		} else if (NewOrderDunType.KJXM_LX.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>2&&tt.getProjectStatus()<10)) {
+			return false;
+		} else if (NewOrderDunType.KJXM_BK.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>8&&tt.getProjectStatus()<10)) {
+			return false;
+		} else if (NewOrderDunType.KJJR_BK.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>8&&tt.getProjectStatus()<10)) {
+			return false;
+		} else if (NewOrderDunType.RJKF_LX.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>2&&tt.getProjectStatus()<10)) {
+			return false;
+		} else if (NewOrderDunType.RJKF_WZ.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>7&&tt.getProjectStatus()<10)) {
+			return false;
+		}  else if (NewOrderDunType.ZSCQ_GS_SL_XZ.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())) {
+			if (tt.getBpType()==1&&(tt.getProjectStatus()>7&&tt.getProjectStatus()<10)) {
+				return false;
+			}else if (tt.getBpType()!=1&&(tt.getProjectStatus()>3&&tt.getProjectStatus()<10)){
+				return false;
+			}
+		}  else if (NewOrderDunType.ZSCQ_XZ.getCode()==Integer.valueOf(""+pn.getProjectType()+pn.getDunType())
+				&&(tt.getProjectStatus()>6&&tt.getProjectStatus()<10)) {
+			return false;
+		}  
+			
+		return true;
+	}
+
+
 	
 }