Browse Source

Merge remote-tracking branch 'origin/dev' into pre-production

pre-production
zhenghaoyu 1 month ago
parent
commit
82b7e4df2f
  1. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java
  2. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryExcel.java
  3. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.java
  4. 41
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.xml
  5. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFactoryCategoryService.java
  6. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFactoryCategoryServiceImpl.java

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFactoryCategoryController.java

@ -119,4 +119,16 @@ public class BasicdataFactoryCategoryController extends BladeController {
}
@ResponseBody
@PostMapping("/exportList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "工厂物料列表导出", notes = "传入basicdataFactoryCategoryDTO")
public void exportList(@RequestBody BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO, HttpServletResponse response) {
String method = "############exportList: ";
log.info(method + "请求参数{}", basicdataFactoryCategoryDTO);
basicdataFactoryCategoryService.exportList(basicdataFactoryCategoryDTO,response);
}
}

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryExcel.java

@ -17,6 +17,7 @@
package com.logpm.basicdata.excel;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
@ -40,6 +41,7 @@ public class BasicdataFactoryCategoryExcel implements Serializable {
private static final long serialVersionUID = 1L;
@ExcelIgnore
private Long factoryCategoryId;
@ColumnWidth(20)

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.java

@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.excel.BasicdataFactoryCategoryExcel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface BasicdataFactoryCategoryMapper extends BaseMapper<BasicdataFactoryCategoryEntity> {
@ -16,4 +19,6 @@ public interface BasicdataFactoryCategoryMapper extends BaseMapper<BasicdataFact
BasicdataFactoryCategoryEntity findEntityByParam(@Param("param") BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO);
List<BasicdataFactoryCategoryExcel> exportList(@Param("param") BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO);
}

41
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataFactoryCategoryMapper.xml

@ -71,4 +71,45 @@
</if>
</select>
<select id="exportList" resultType="com.logpm.basicdata.excel.BasicdataFactoryCategoryExcel">
select lbfc.brand brand,
lbfc.category category,
lbfc.type type,
lbfc.firsts firsts,
lbfc.seconds seconds,
lbfc.thirds thirds,
lbfc.materiel_name materielName,
lbmc.main_name mainName,
lbmc.category mainCategory
from logpm_basicdata_factory_category lbfc
left join logpm_basicdata_main_category lbmc on lbmc.factory_category_id = lbfc.id
where
lbfc.is_deleted = 0
<if test="param.type != null ">
and lbfc.type = #{param.type}
</if>
<if test="param.brand != null and param.brand != ''">
and lbfc.brand = #{param.brand}
</if>
<if test="param.category != null and param.category != ''">
and lbfc.category = #{param.category}
</if>
<if test="param.firsts != null and param.firsts != ''">
and lbfc.firsts = #{param.firsts}
</if>
<if test="param.seconds != null and param.seconds != ''">
and lbfc.seconds = #{param.seconds}
</if>
<if test="param.thirds != null and param.thirds != ''">
and lbfc.thirds = #{param.thirds}
</if>
<if test="param.materielName != null and param.materielName != ''">
and lbfc.materiel_name like concat('%',#{param.materielName},'%')
</if>
</select>
</mapper>

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFactoryCategoryService.java

@ -3,10 +3,11 @@ package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import javax.servlet.http.HttpServletResponse;
public interface IBasicdataFactoryCategoryService extends BaseService<BasicdataFactoryCategoryEntity> {
@ -14,4 +15,5 @@ public interface IBasicdataFactoryCategoryService extends BaseService<BasicdataF
R saveEntity(BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO);
void exportList(BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO, HttpServletResponse response);
}

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFactoryCategoryServiceImpl.java

@ -4,14 +4,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.dto.BasicdataFactoryCategoryDTO;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.excel.BasicdataFactoryCategoryExcel;
import com.logpm.basicdata.mapper.BasicdataFactoryCategoryMapper;
import com.logpm.basicdata.service.IBasicdataFactoryCategoryService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Objects;
@Slf4j
@ -46,4 +50,12 @@ public class BasicdataFactoryCategoryServiceImpl extends BaseServiceImpl<Basicda
return R.success("保存成功");
}
@Override
public void exportList(BasicdataFactoryCategoryDTO basicdataFactoryCategoryDTO, HttpServletResponse response) {
List<BasicdataFactoryCategoryExcel> list = baseMapper.exportList(basicdataFactoryCategoryDTO);
//导出ls
ExcelUtil.export(response, "工厂三方品类列表导出", "工厂三方品类列表导出", list, BasicdataFactoryCategoryExcel.class);
}
}

Loading…
Cancel
Save