anderx 4 anni fa
parent
commit
289320554a

+ 8 - 1
src/main/java/com/goafanti/common/dao/TOrderPaymentMapper.java

@@ -49,7 +49,14 @@ public interface TOrderPaymentMapper {
 
 	int insertSelectiveGetId(TOrderPayment p);
 
-	List<outOrderPayment> selectByTid(@Param("tid")Integer tid, @Param("chooseType")Integer chooseType);
+	/**
+	 * 
+	 * @param tid	项目编号
+	 * @param chooseType 支付种类 0第三方 1催款 2官费
+	 * @param type 0所有 1不含取消
+	 * @return
+	 */
+	List<outOrderPayment> selectByTid(@Param("tid")Integer tid, @Param("chooseType")Integer chooseType, @Param("type")Integer type);
 
 	List<outOrderPayment> selectList(@Param("tpcId")Integer tpcId, @Param("nodeId")Integer nodeId, @Param("chooseType")Integer chooseType);
 

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

@@ -399,10 +399,13 @@ select a.id,a.tid,a.node_id nodeId,a.payment_type paymentType,a.company_name com
 	  a.payment_status paymentStatus, a.status,a.payment_amount paymentAmount,a.remarks ,tpc.company_name tpcName,d.finance_name financeName ,
 	  c.order_no orderNo,date_format(a.create_time,'%Y-%m-%d %H:%i:%s')createTimes,a.application_amount applicationAmount 
 	 from t_order_payment a	 left join t_order_task c on a.tid=c.id left join t_order_mid d on c.order_no=d.order_no 
-	 left join third_party_company tpc on tpc.id=a.tpc_id where  a.tid= #{tid} and a.status in(0,1,2,3)
+	 left join third_party_company tpc on tpc.id=a.tpc_id where  a.tid= #{tid} 
 	 <if test="chooseType != null">
 	 and a.choose_type = #{chooseType}
 	 </if>
+	 <if test="type==1">
+	 and a.status in(0,1,2,3)
+	 </if>
   </select>
   
   <select id="selectList" resultType="com.goafanti.organization.bo.outOrderPayment">

+ 8 - 1
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -30,6 +30,7 @@ import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.PatentNew;
 import com.goafanti.common.model.PatentNewLog;
+import com.goafanti.common.model.User;
 import com.goafanti.common.utils.AsyncUtils;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
@@ -84,8 +85,14 @@ public class PatentTask {
 			for (PatentNew p : l) {
 				//因为改成数据关联字段修改
 				String userName ="";
+				
 				if (p.getUid()!=null) {
-					userName=userMapper.selectByPrimaryKey(p.getUid()).getNickname();
+					User u =userMapper.selectByPrimaryKey(p.getUid());
+					if (u!=null) {
+						userName=u.getNickname();
+					}else {
+						userName=p.getApplicant();
+					}
 				}else {
 					userName=p.getApplicant();
 				}

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

@@ -473,7 +473,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 	@Override
 	public List<outOrderPayment> selectOrderPayment(Integer id) {
-		List<outOrderPayment> list=tOrderPaymentMapper.selectByTid(id,null);
+		List<outOrderPayment> list=tOrderPaymentMapper.selectByTid(id,null,0);
 //		if (!TokenManager.hasRole(AFTConstants.FINANCE)&&
 //				!TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)&&
 //				!TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)&&
@@ -544,7 +544,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				checkGetAmount(p);
 		if (p.getChooseType()==2) {
 			TOrderTask tot=tOrderTaskMapper.selectByPrimaryKey(p.getTid());
-			List<outOrderPayment> list2=tOrderPaymentMapper.selectByTid(p.getTid(),p.getChooseType());
+			List<outOrderPayment> list2=tOrderPaymentMapper.selectByTid(p.getTid(),p.getChooseType(),1);
 			int x=p.getQuantity();
 			for (outOrderPayment out : list2) {
 				x+=out.getQuantity();
@@ -1054,7 +1054,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	public boolean checkQuantity(TOrderPayment p) {
 		TOrderPayment tp=tOrderPaymentMapper.selectByPrimaryKey(p.getId());
 		TOrderTask tt=tOrderTaskMapper.selectByPrimaryKey(tp.getTid());
-		List<outOrderPayment> list =tOrderPaymentMapper.selectByTid(tt.getId(), 2);
+		List<outOrderPayment> list =tOrderPaymentMapper.selectByTid(tt.getId(), 2,1);
 		Integer q=0;
 		for (outOrderPayment o : list) {
 			if (p.getId().equals(o.getId())) {
@@ -1112,7 +1112,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 			StringBuffer src=new StringBuffer();
 			List<OutThirdPartyCompany> list=thirdPartyCompanyMapper.selectByTid(id);
 			List<OutPaymentNode> list2=paymentNodeMapper.selectByTid(id, null);
-			List<outOrderPayment> list3=tOrderPaymentMapper.selectByTid(id, null);
+			List<outOrderPayment> list3=tOrderPaymentMapper.selectByTid(id, null,1);
 			if (!list.isEmpty()) {
 				src.append("第三方").append("、");
 				i++;
@@ -1134,7 +1134,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 		}else if(type==1) {
 			thirdPartyCompanyMapper.deleteByTid(id);
 			paymentNodeMapper.deleteByParam(null,id);
-			List<outOrderPayment> list=tOrderPaymentMapper.selectByTid(id,null);
+			List<outOrderPayment> list=tOrderPaymentMapper.selectByTid(id,null,0);
 			for (outOrderPayment o : list) {
 					TOrderPayment t=new TOrderPayment();
 					t.setId(o.getId());