|
@@ -6,6 +6,7 @@ import com.xlht.xlhtproject.mapper.*;
|
|
|
import com.xlht.xlhtproject.service.ITXlhtMedicineParamService;
|
|
|
import com.xlht.xlhtproject.utils.CalculateUtils;
|
|
|
import com.xlht.xlhtproject.utils.DateUtils;
|
|
|
+import com.xlht.xlhtproject.utils.DecimalUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -14,7 +15,7 @@ import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
-import static com.xlht.xlhtproject.enums.MyConstants.LONG_1;
|
|
|
+import static com.xlht.xlhtproject.enums.MyConstants.*;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -324,10 +325,10 @@ public class TXlhtMedicineParamServiceImpl implements ITXlhtMedicineParamService
|
|
|
BigDecimal twoAmount = xlhtAddRecord.getTwoAmount();
|
|
|
BigDecimal realTwoAmount = xlhtAddRecord.getRealTwoAmount();
|
|
|
if(!Objects.isNull(oneAmount) && !Objects.isNull(realOneAmount)){
|
|
|
- latestRecord.setAddDifferenceOne(oneAmount.subtract(realOneAmount).abs());
|
|
|
+ latestRecord.setAddDifferenceOne(DecimalUtils.getNLengthHalfUp(oneAmount.subtract(realOneAmount).abs(), INT_2));
|
|
|
}
|
|
|
if(!Objects.isNull(twoAmount) && !Objects.isNull(realTwoAmount)){
|
|
|
- latestRecord.setAddDifferenceTwo(twoAmount.subtract(realTwoAmount).abs());
|
|
|
+ latestRecord.setAddDifferenceTwo(DecimalUtils.getNLengthHalfUp(twoAmount.subtract(realTwoAmount).abs(), INT_2));
|
|
|
}
|
|
|
}
|
|
|
}
|