anderx 4 anni fa
parent
commit
462aa51481

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

@@ -116,6 +116,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 	@Override
 	public int addCompany(ThirdPartyCompany t,Integer calculation,Integer type) {
+		
 			CompanyLibrary c=new CompanyLibrary();
 			String aid=TokenManager.getAdminId();
 			if(calculation==0) {
@@ -131,7 +132,7 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 				}
 				t.setTotalAmount(t.getUnitPrice().multiply(new BigDecimal(t.getQuantity())));
 			}
-			if (type==1) {
+			if (type!=null&&type==1) {
 				tOrderTaskMapper.updateAddCostAmount(t.getTid(), t.getTotalAmount());
 				tOrderMidMapper.updateAddCostAmount(t.getTid(), t.getTotalAmount());
 			}