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