소스 검색

官费逻辑修改

Signed-off-by: anderx <312518615@qq.com>
anderx 5 년 전
부모
커밋
9d5c70a7b6
1개의 변경된 파일13개의 추가작업 그리고 2개의 파일을 삭제
  1. 13 2
      src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

+ 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);
 		}