|
@@ -11,6 +11,7 @@ import com.steerinfo.framework.service.impl.BaseServiceImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
@@ -40,11 +41,12 @@ public class BmsshipContractPriceServiceImpl implements IBmsshipContractPriceSe
|
|
|
|
|
|
@Override
|
|
|
public int insertBmsshipContractPrice(Map<String, Object> mapValue) {
|
|
|
+ int i=0;
|
|
|
String userId = (String) mapValue.get("userId");
|
|
|
String personnelName = rmsPersonnelMapper.getPersonnelNameByUserId(userId);
|
|
|
String remark =(String) mapValue.get("remark");
|
|
|
String contractNo =(String) mapValue.get("contractNo");
|
|
|
- BigDecimal portId=DataChange.dataToBigDecimal(mapValue.get("portId"));
|
|
|
+ ArrayList<Object> portIds= (ArrayList<Object>)(mapValue.get("portId"));
|
|
|
//判断是否存在相同的合同号
|
|
|
// BigDecimal conpareNo = bmsshipContractPriceMapper.contractNoCompare(contractNo);
|
|
|
// if (conpareNo!=null){
|
|
@@ -55,13 +57,11 @@ public class BmsshipContractPriceServiceImpl implements IBmsshipContractPriceSe
|
|
|
long endTime = (long) mapValue.get("endTime");
|
|
|
//新增实体类
|
|
|
BmsshipContractPrice bmsshipContractPrice=new BmsshipContractPrice();
|
|
|
- bmsshipContractPrice.setResultId(bmsshipContractPriceMapper.getMaxId());
|
|
|
bmsshipContractPrice.setContractNo(contractNo);
|
|
|
bmsshipContractPrice.setUnitPrice(unitPrice);
|
|
|
bmsshipContractPrice.setStartTime(new Date(startTime));
|
|
|
bmsshipContractPrice.setEndTime(new Date(endTime));
|
|
|
bmsshipContractPrice.setInsertTime(new Date());
|
|
|
- bmsshipContractPrice.setPortId(portId);
|
|
|
bmsshipContractPrice.setDeleted(new BigDecimal(0));
|
|
|
if (personnelName!=null){
|
|
|
bmsshipContractPrice.setInsertUsername(personnelName);
|
|
@@ -69,7 +69,11 @@ public class BmsshipContractPriceServiceImpl implements IBmsshipContractPriceSe
|
|
|
bmsshipContractPrice.setInsertUsername(userId);
|
|
|
}
|
|
|
bmsshipContractPrice.setInsertUpdateRemark(remark);
|
|
|
- int i = bmsshipContractPriceMapper.insertSelective(bmsshipContractPrice);
|
|
|
+ for(Object portId:portIds){
|
|
|
+ bmsshipContractPrice.setResultId(bmsshipContractPriceMapper.getMaxId());
|
|
|
+ bmsshipContractPrice.setPortId(DataChange.dataToBigDecimal(portId));
|
|
|
+ i+= bmsshipContractPriceMapper.insertSelective(bmsshipContractPrice);
|
|
|
+ }
|
|
|
return i;
|
|
|
}
|
|
|
|