|
@@ -8,6 +8,7 @@ import com.steerinfo.dil.service.IBmsportHandlingFeeService;
|
|
|
import com.steerinfo.dil.util.DataChange;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.DecimalFormat;
|
|
@@ -141,15 +142,21 @@ public class BmsportHandlingFeeServiceImpl implements IBmsportHandlingFeeService
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public int addPortHandlingFeeSecond(Map<String, Object> map) {
|
|
|
+ @Transactional(rollbackFor = {Exception.class})
|
|
|
+ public int addPortHandlingFeeSecond(Map<String, Object> map) throws Exception {
|
|
|
//获取运输单价
|
|
|
BigDecimal Fee=null;
|
|
|
+ long makeTime = 0;
|
|
|
BigDecimal unitPrice = DataChange.dataToBigDecimal(map.get("unitPrice"));
|
|
|
//水运单总吨位
|
|
|
BigDecimal tonnage =DataChange.dataToBigDecimal(map.get("realTonnage"));
|
|
|
BigDecimal batchId =DataChange.dataToBigDecimal(map.get("batchId"));
|
|
|
BigDecimal purchaseOrderId =DataChange.dataToBigDecimal(map.get("purchaseOrderId"));
|
|
|
- long makeTime =(long) map.get("makeTime");
|
|
|
+ if(map.get("makeTime")!=null) {
|
|
|
+ makeTime = (long) map.get("makeTime");
|
|
|
+ }else {
|
|
|
+ throw new Exception("请填写制票日期");
|
|
|
+ }
|
|
|
//获取userId
|
|
|
String userId = (String) map.get("userId");
|
|
|
//根据userId查找姓名
|
|
@@ -179,7 +186,7 @@ public class BmsportHandlingFeeServiceImpl implements IBmsportHandlingFeeService
|
|
|
if (DataChange.dataToBigDecimal(map.get("fee")).compareTo(Fee) == 0) {
|
|
|
bmsshipFee.setFee(Fee);
|
|
|
} else {
|
|
|
- return -2;
|
|
|
+ throw new Exception("费用不一致");
|
|
|
}
|
|
|
}else {
|
|
|
bmsshipFee.setFee(DataChange.dataToBigDecimal(map.get("fee")));
|