laoyao 3 anni fa
parent
commit
b14cef9bbf

+ 8 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/dao/BBomMapper.java

@@ -1,8 +1,13 @@
 package com.github.zuihou.business.productionReadyCenter.dao;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.github.zuihou.base.mapper.SuperMapper;
+import com.github.zuihou.business.operationManagementCenter.entity.Order;
 import com.github.zuihou.business.productionReadyCenter.entity.BBom;
 
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 /**
@@ -17,4 +22,7 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface BBomMapper extends SuperMapper<BBom> {
 
+
+    IPage<BBom> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<BBom> queryWrapper);
+
 }

+ 5 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/BBomService.java

@@ -1,8 +1,9 @@
 package com.github.zuihou.business.productionReadyCenter.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.service.SuperService;
-import com.github.zuihou.business.productionReadyCenter.dto.BBomUpdateDTO;
 import com.github.zuihou.business.productionReadyCenter.entity.BBom;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 
 import java.util.Map;
 
@@ -17,6 +18,9 @@ import java.util.Map;
  */
 public interface BBomService extends SuperService<BBom> {
 
+
+    IPage<BBom> pageList(IPage page, LbqWrapper<BBom> wrapper);
+
     /**
      * 分页
      */

+ 8 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/BBomServiceImpl.java

@@ -1,6 +1,8 @@
 package com.github.zuihou.business.productionReadyCenter.service.impl;
 
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.business.operationManagementCenter.entity.Plan;
 import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
 import com.github.zuihou.business.productionReadyCenter.dto.BBomUpdateDTO;
 import com.github.zuihou.business.productionReadyCenter.entity.BBom;
@@ -15,6 +17,7 @@ import com.github.zuihou.business.util.CommonUtil;
 import com.github.zuihou.common.constant.BizConstant;
 import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.properties.DatabaseProperties;
 import com.github.zuihou.utils.BeanPlusUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -46,6 +49,11 @@ public class BBomServiceImpl extends SuperServiceImpl<BBomMapper, BBom> implemen
     @Autowired
     private CustMapper custMapper;
 
+    @Override
+    public IPage<BBom> pageList(IPage page, LbqWrapper<BBom> wrapper) {
+        return baseMapper.pageList(page, wrapper);
+    }
+
     @Override
     public Map<String, Object> pageList(Map<String, String> map) {
         int current = Integer.parseInt(map.get("current")==null?"1":map.get("current").toString());

+ 17 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/BBomMapper.xml

@@ -18,12 +18,28 @@
         <result column="brand" jdbcType="VARCHAR" property="brand"/>
         <result column="specification" jdbcType="VARCHAR" property="specification"/>
         <result column="module_id" jdbcType="BIGINT" property="moduleId"/>
+        <result column="parts_no" jdbcType="VARCHAR" property="partsNo"/>
+        <result column="parts_alias" jdbcType="VARCHAR" property="partsAlias"/>
+        <result column="bom_alias" jdbcType="VARCHAR" property="bomAlias"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,create_time,create_user,update_time,update_user,
+        id,create_time,create_user,update_time,update_user,parts_no,parts_alias,bom_alias,materialBrandName
         audit_status, parent_id, name, no, status, model, brand, specification, module_id
     </sql>
 
+
+    <!-- 分页 -->
+    <select id="pageList" parameterType="String" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from (select b.*,m.brand materialBrandName from imcs_b_bom b LEFT JOIN imcs_m_tool_meterial m on b.meterial_id = m.id
+        where 1=1
+
+
+        ) s ${ew.customSqlSegment}
+
+    </select>
+
 </mapper>

+ 18 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionReadyCenter/BBomController.java

@@ -1,14 +1,21 @@
 package com.github.zuihou.business.controller.productionReadyCenter;
 
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperController;
+import com.github.zuihou.base.request.PageParams;
 import com.github.zuihou.business.basics.service.CustService;
+import com.github.zuihou.business.productionReadyCenter.dto.AutoNodePageDTO;
 import com.github.zuihou.business.productionReadyCenter.dto.BBomPageDTO;
 import com.github.zuihou.business.productionReadyCenter.dto.BBomSaveDTO;
 import com.github.zuihou.business.productionReadyCenter.dto.BBomUpdateDTO;
+import com.github.zuihou.business.productionReadyCenter.entity.AutoNode;
 import com.github.zuihou.business.productionReadyCenter.entity.BBom;
 import com.github.zuihou.business.productionReadyCenter.service.BBomService;
 import com.github.zuihou.common.constant.BizConstant;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import com.github.zuihou.database.properties.DatabaseProperties;
 import com.github.zuihou.log.annotation.SysLog;
 import io.swagger.annotations.Api;
@@ -43,6 +50,17 @@ public class BBomController extends SuperController<BBomService, Long, BBom, BBo
     @Autowired
     private CustService custService;
 
+
+    @Override
+    public void query(PageParams<BBomPageDTO> params, IPage<BBom> page, Long defSize) {
+        BBomPageDTO data = params.getModel();
+        QueryWrap<BBom> wrap = handlerWrapper(null, params);
+        LbqWrapper<BBom> wrapper = wrap.lambda();
+        BBom bom = BeanUtil.toBean(data, BBom.class);
+        wrapper.eq(BBom::getName, bom.getName()).eq(BBom::getBomAlias, bom.getBomAlias()).eq(BBom::getStatus, bom.getStatus());
+        baseService.pageList(page, wrapper);
+    }
+
     @ApiOperation(value = "所有产品bom--分页列表", notes = "所有产品bom分页列表")
     @PostMapping("/pageList")
     public R<Map<String, Object>> pageList(@RequestBody Map<String, String> map) {

+ 4 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/BBom.java

@@ -208,6 +208,10 @@ public class BBom extends Entity<Long> {
 //    private Long materialId;
 
 
+    @ApiModelProperty(value = "材料牌号")
+    private Long materialBrandName;
+
+
     @Builder
     public BBom(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, 
                     String auditStatus, Long parentId, String name, String no, String status,