Browse Source

官费逻辑修改

Signed-off-by: anderx <312518615@qq.com>
anderx 5 years ago
parent
commit
9d5c70a7b6

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

@@ -853,8 +853,19 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 	@Override
 	public void checkGetAmount(TOrderPayment p) {
 		if(p.getApplicationAmount()==null) {
-			ThirdPartyCompany tpc=thirdPartyCompanyMapper.selectByPrimaryKey(p.getTpcId());
-			BigDecimal count =tpc.getUnitPrice().multiply(new BigDecimal(p.getQuantity()));
+			BigDecimal count=new BigDecimal(0);
+			if(p.getChooseType()==0) {
+				ThirdPartyCompany tpc=thirdPartyCompanyMapper.selectByPrimaryKey(p.getTpcId());
+				count=tpc.getUnitPrice().multiply(new BigDecimal(p.getQuantity()));
+			}
+			if (p.getChooseType()==2) {
+				OutThirdPartyCompany ot=thirdPartyCompanyMapper.selectByIdPuls(p.getTpcId());
+				if (ot.getCostReduction()==0) {
+					count=new BigDecimal(ot.getOfficialUnitPrice()).multiply(new BigDecimal(ot.getQuantity()));
+				}else {
+					count=new BigDecimal(ot.getReductionAmount()).multiply(new BigDecimal(ot.getQuantity()));
+				}
+			}
 			p.setApplicationAmount(count);
 		}