Browse Source

备料添加列表接口

yzc 1 year ago
parent
commit
cfb79bc6d7

+ 2 - 2
hx-admin/src/main/resources/application-dev.yml

@@ -44,8 +44,8 @@ mail:
     abroadUrlPrefix:
     abroadUrlPrefix:
 
 
 hx:
 hx:
-  httpUrl: http://36.134.91.96:10006/test-api/
-    fileServiceUrl: http://127.0.0.1:8090
+    httpUrl: http://36.134.91.96:10006/test-api/
+  fileServiceUrl: http://127.0.0.1:8090
 
 
 # token配置
 # token配置
 token:
 token:

+ 10 - 0
hx-mes/src/main/java/com/fjhx/mes/controller/material/MaterialPreparationController.java

@@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.List;
+
 
 
 /**
 /**
  * <p>
  * <p>
@@ -34,4 +36,12 @@ public class MaterialPreparationController {
         return materialPreparationService.getPage(dto);
         return materialPreparationService.getPage(dto);
     }
     }
 
 
+    /**
+     * 生产备料分页
+     */
+    @PostMapping("/list")
+    public List<MaterialPreparationVo> list(@RequestBody MaterialPreparationSelectDto dto) {
+        return materialPreparationService.getList(dto);
+    }
+
 }
 }

+ 4 - 0
hx-mes/src/main/java/com/fjhx/mes/entity/material/dto/MaterialPreparationSelectDto.java

@@ -4,6 +4,8 @@ import com.ruoyi.common.core.domain.BaseSelectDto;
 import lombok.Getter;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 
 
+import java.util.List;
+
 /**
 /**
  * 生产备料列表查询入参实体
  * 生产备料列表查询入参实体
  *
  *
@@ -24,4 +26,6 @@ public class MaterialPreparationSelectDto extends BaseSelectDto {
      */
      */
     private Long companyId;
     private Long companyId;
 
 
+    private List<Long> preparationIdList;
+
 }
 }

+ 5 - 0
hx-mes/src/main/java/com/fjhx/mes/mapper/material/MaterialPreparationMapper.java

@@ -7,6 +7,8 @@ import com.fjhx.mes.entity.material.vo.MaterialPreparationVo;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
+import java.util.List;
+
 
 
 /**
 /**
  * <p>
  * <p>
@@ -23,4 +25,7 @@ public interface MaterialPreparationMapper extends BaseMapper<MaterialPreparatio
      */
      */
     Page<MaterialPreparationVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<MaterialPreparation> wrapper);
     Page<MaterialPreparationVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<MaterialPreparation> wrapper);
 
 
+    List<MaterialPreparationVo> getList(@Param("ew") IWrapper<MaterialPreparation> wrapper);
+
+
 }
 }

+ 3 - 0
hx-mes/src/main/java/com/fjhx/mes/service/material/MaterialPreparationService.java

@@ -6,6 +6,8 @@ import com.fjhx.mes.entity.material.po.MaterialPreparation;
 import com.fjhx.mes.entity.material.vo.MaterialPreparationVo;
 import com.fjhx.mes.entity.material.vo.MaterialPreparationVo;
 import com.ruoyi.common.core.service.BaseService;
 import com.ruoyi.common.core.service.BaseService;
 
 
+import java.util.List;
+
 
 
 /**
 /**
  * <p>
  * <p>
@@ -22,4 +24,5 @@ public interface MaterialPreparationService extends BaseService<MaterialPreparat
      */
      */
     Page<MaterialPreparationVo> getPage(MaterialPreparationSelectDto dto);
     Page<MaterialPreparationVo> getPage(MaterialPreparationSelectDto dto);
 
 
+    List<MaterialPreparationVo> getList(MaterialPreparationSelectDto dto);
 }
 }

+ 18 - 2
hx-mes/src/main/java/com/fjhx/mes/service/material/impl/MaterialPreparationServiceImpl.java

@@ -14,6 +14,7 @@ import com.ruoyi.common.utils.wrapper.SqlField;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.util.List;
 import java.util.Objects;
 import java.util.Objects;
 
 
 
 
@@ -31,8 +32,7 @@ public class MaterialPreparationServiceImpl extends ServiceImpl<MaterialPreparat
     @Autowired
     @Autowired
     private ProductInfoService productInfoService;
     private ProductInfoService productInfoService;
 
 
-    @Override
-    public Page<MaterialPreparationVo> getPage(MaterialPreparationSelectDto dto) {
+    private IWrapper<MaterialPreparation> getPageWrapper(MaterialPreparationSelectDto dto) {
         IWrapper<MaterialPreparation> wrapper = getWrapper();
         IWrapper<MaterialPreparation> wrapper = getWrapper();
 
 
         wrapper.eq(MaterialPreparation::getStatus, dto.getStatus());
         wrapper.eq(MaterialPreparation::getStatus, dto.getStatus());
@@ -54,10 +54,26 @@ public class MaterialPreparationServiceImpl extends ServiceImpl<MaterialPreparat
 
 
         wrapper.orderByDesc("mp", MaterialPreparation::getCreateTime);
         wrapper.orderByDesc("mp", MaterialPreparation::getCreateTime);
         wrapper.orderByDesc("mp", MaterialPreparation::getId);
         wrapper.orderByDesc("mp", MaterialPreparation::getId);
+        return wrapper;
+    }
+
+    @Override
+    public Page<MaterialPreparationVo> getPage(MaterialPreparationSelectDto dto) {
+        IWrapper<MaterialPreparation> wrapper = getPageWrapper(dto);
 
 
         Page<MaterialPreparationVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         Page<MaterialPreparationVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
 
 
         return page;
         return page;
     }
     }
 
 
+    @Override
+    public List<MaterialPreparationVo> getList(MaterialPreparationSelectDto dto) {
+        IWrapper<MaterialPreparation> wrapper = getPageWrapper(dto);
+
+        wrapper.in("mp", MaterialPreparation::getId, dto.getPreparationIdList());
+
+        return this.baseMapper.getList(wrapper);
+
+    }
+
 }
 }

+ 8 - 1
hx-mes/src/main/resources/mapper/material/MaterialPreparationMapper.xml

@@ -2,6 +2,13 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fjhx.mes.mapper.material.MaterialPreparationMapper">
 <mapper namespace="com.fjhx.mes.mapper.material.MaterialPreparationMapper">
     <select id="getPage" resultType="com.fjhx.mes.entity.material.vo.MaterialPreparationVo">
     <select id="getPage" resultType="com.fjhx.mes.entity.material.vo.MaterialPreparationVo">
+        <include refid="pageOrList"/>
+    </select>
+    <select id="getList" resultType="com.fjhx.mes.entity.material.vo.MaterialPreparationVo">
+        <include refid="pageOrList"/>
+    </select>
+
+    <sql id="pageOrList">
         select mp.id,
         select mp.id,
                mp.contract_id,
                mp.contract_id,
                mp.contract_detail_id,
                mp.contract_detail_id,
@@ -21,6 +28,6 @@
         from material_preparation mp
         from material_preparation mp
                  left join product_info pi on mp.material_id = pi.id
                  left join product_info pi on mp.material_id = pi.id
             ${ew.customSqlSegment}
             ${ew.customSqlSegment}
-    </select>
+    </sql>
 
 
 </mapper>
 </mapper>