瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/steerinfo/dil/controller/RmsOilPriceController.java
zyf 2 年之前
父節點
當前提交
2bb72c45cf

+ 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);

+ 3 - 0
src/main/java/com/steerinfo/dil/controller/RmsOilPriceController.java

@@ -103,6 +103,9 @@ public class RmsOilPriceController extends BaseRESTfulController {
     public RESTfulResult updateOilPrice(@RequestBody(required = false) Map<String, Object> map){
         Integer priceId = (Integer) map.get("priceId");
         int result = rmsOilPriceService.updateOilPrice(priceId);
+    @PostMapping(value = "/updateOilPrice")
+    public RESTfulResult updateOilPrice(@RequestBody(required = false) Map<String, Object> mapValue){
+        int result = rmsOilPriceService.updateOilPrice(mapValue);
         return success(result);
     }
 

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/RmsPersonnelMapper.java

@@ -38,4 +38,6 @@ public interface RmsPersonnelMapper extends IBaseMapper<RmsPersonnel, BigDecimal
 
    //根据用户ssoId查找用户名
     String getPersonnelNameByUserId(String userId);
+
+    int updateByPersonnelId(BigDecimal id);
 }

+ 1 - 1
src/main/java/com/steerinfo/dil/service/IRmsOilPriceService.java

@@ -27,7 +27,7 @@ public interface IRmsOilPriceService{
 
     int insertOilPrice(Map<String,Object> map);
 
-    int updateOilPrice(Integer id);
+    int updateOilPrice(Map<String, Object> mapValue);
 
     int deleteOilPrice(BigDecimal id);
 

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

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

+ 3 - 4
src/main/java/com/steerinfo/dil/service/impl/RmsOilPriceServiceImpl.java

@@ -59,22 +59,21 @@ public class RmsOilPriceServiceImpl implements IRmsOilPriceService {
      * 启用油价
      * @Author TXF
      * @Date 2022/1/21 9:08
-     * @param id
      * @return
      **/
     @Transactional
     @Override
-    public int updateOilPrice(Integer id) {
+    public int updateOilPrice(Map<String, Object> mapValue) {
         RmsOilPrice rmsOilPrice = new RmsOilPrice();
         //查询该启用油价的信息
-        Map<String, Object> mesMap = rmsOilPriceMapper.getOilPriceById(new BigDecimal(id));
+        Map<String, Object> mesMap = rmsOilPriceMapper.getOilPriceById(new BigDecimal(mapValue.get("priceId").toString()));
         if(DataChange.dataToBigDecimal(mesMap.get("priceStatus")).intValue() == 0){
             return 0;
         }else{
             //通过油品信息关闭该油品所有正在启用的油价
             rmsOilPriceMapper.closeLastOilPrice(mesMap);
         }
-        rmsOilPrice.setId(new BigDecimal(id));
+        rmsOilPrice.setId(new BigDecimal(mapValue.get("priceId").toString()));
         rmsOilPrice.setUpdateTime(new Date());
         rmsOilPrice.setPriceStatus(new BigDecimal(0));
         //加入正数条件

+ 1 - 3
src/main/java/com/steerinfo/dil/service/impl/RmsPersonnelServiceImpl.java

@@ -157,9 +157,7 @@ public class RmsPersonnelServiceImpl implements IRmsPersonnelService {
      */
     @Override
     public int deletePersonnel(BigDecimal id) {
-        RmsPersonnel rmsPersonnel=rmsPersonnelMapper.selectByPrimaryKey(id);
-        rmsPersonnel.setDeleted(new BigDecimal(1));
-        return rmsPersonnelMapper.updateByPrimaryKeySelective(rmsPersonnel);
+        return rmsPersonnelMapper.updateByPersonnelId(id);
     }
 
     /**

+ 1 - 1
src/main/java/com/steerinfo/dil/service/impl/RmsPierServiceImpl.java

@@ -57,7 +57,7 @@ public class RmsPierServiceImpl implements IRmsPierService {
         RmsPier rmsPier = rmsPierMapper.selectByPrimaryKey(pierId);
         rmsPier.setUpdateTime(new Date());
         rmsPier.setUpdateUsername("admin");
-//        rmsPier.setDeleted(new BigDecimal(1));
+        rmsPier.setDeleted(new BigDecimal(1));
         return rmsPierMapper.updateByPrimaryKeySelective(rmsPier);
     }
 

+ 4 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsPersonnelMapper.xml

@@ -728,4 +728,8 @@
    WHERE  RP.PERSONNEL_SSO_ID =#{userId}
   </select>
 
+  <update id="updateByPersonnelId" parameterType="java.math.BigDecimal">
+       update  Rms_Personnel set deleted =1 where personnel_id =#{id}
+  </update>
+
 </mapper>

+ 1 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsWarehouseMapper.xml

@@ -519,6 +519,7 @@
            RP.PORT_ID AS "value",
            RP.PORT_NAME AS "label"
     FROM RMS_PORT RP
+    where RP.DELETED=0
     </select>
 
   <select id="getYardList" resultType="java.util.Map">