Browse Source

Merge remote-tracking branch 'origin/master'

hejiahui 2 years ago
parent
commit
aa2b8c5562

+ 3 - 1
src/main/java/com/steerinfo/dil/controller/BmsshipContractPriceController.java

@@ -110,7 +110,9 @@ public class BmsshipContractPriceController extends BaseRESTfulController {
         if (con != null && con.length() != 0) {
             mapValue.put("con","%" + con + "%");
         }
-        PageHelper.startPage(pageNum, pageSize);
+        if(pageNum!=null && pageSize!=null){
+            PageHelper.startPage(pageNum, pageSize);
+        }
         //初始化过滤
         List<Map<String, Object>> columnList = bmsshipContractPriceService.bmsshipContractPriceList(mapValue);
         PageListAdd data = columnDataUtil.tableColumnData(apiId, null, columnList);

+ 8 - 4
src/main/java/com/steerinfo/dil/service/impl/BmsshipContractPriceServiceImpl.java

@@ -10,6 +10,7 @@ import com.steerinfo.framework.service.impl.BaseServiceImpl;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import java.util.ArrayList;
 import java.util.Date;
 import java.math.BigDecimal;
 import java.util.List;
@@ -39,11 +40,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){
@@ -54,13 +56,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);
@@ -68,7 +68,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;
     }