hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/embedment/controller/SysInsetRecordsController.java
@@ -100,12 +100,12 @@ /** * 导出模板 * @param embedmentRecordDto * @param * @param response */ @PostMapping(value = "recordExportTemplate") void recordExportTemplate(@RequestBody EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response){ this.sysEmbedmentRecordService.recordExportTemplate(embedmentRecordDto,response); void recordExportTemplate(HttpServletResponse response){ this.sysEmbedmentRecordService.recordExportTemplate(null,response); } /** hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/embedment/service/SysEmbedmentRecordService.java
@@ -1,6 +1,7 @@ package com.thhy.materials.modules.biz.embedment.service; import com.thhy.general.common.BasicResult; import com.thhy.materials.modules.biz.embedment.dto.EmbedmentGoodsDto; import com.thhy.materials.modules.biz.embedment.dto.EmbedmentRecordDto; import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity; import org.springframework.web.multipart.MultipartFile; @@ -43,7 +44,7 @@ void export(EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response); void recordExportTemplate(EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response); void recordExportTemplate(EmbedmentGoodsDto embedmentGoodsDto, HttpServletResponse response); BasicResult variateExcel(MultipartFile file, HttpServletRequest request); } hd/pipe/materialsManage/src/main/java/com/thhy/materials/modules/biz/embedment/service/impl/SysEmbedmentRecordServiceImpl.java
@@ -9,6 +9,7 @@ import com.thhy.general.exception.BasicException; import com.thhy.general.utils.ExcelUtils; import com.thhy.general.utils.UserInfoUtils; import com.thhy.materials.modules.biz.embedment.dto.EmbedmentGoodsDto; import com.thhy.materials.modules.biz.embedment.dto.EmbedmentRecordDto; import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentGoodsEntity; import com.thhy.materials.modules.biz.embedment.entity.SysEmbedmentRecordEntity; @@ -142,7 +143,8 @@ } @Override public void recordExportTemplate(EmbedmentRecordDto embedmentRecordDto, HttpServletResponse response) { public void recordExportTemplate(EmbedmentGoodsDto embedmentGoodsDto, HttpServletResponse response) { embedmentGoodsDto = new EmbedmentGoodsDto(); SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo(); String companyId = sysUserInfo.getCompanyId(); XSSFWorkbook book = new XSSFWorkbook(); @@ -153,8 +155,8 @@ row.createCell(2).setCellValue("单价"); row.createCell(3).setCellValue("金额"); row.createCell(4).setCellValue("备注"); embedmentRecordDto.setCompanyId(companyId); List<String> lx = sysEmbedmentRecordMapper.embedmentRecordList(embedmentRecordDto).stream().map(s -> s.getEmbedmentNameAndModel()).collect(Collectors.toList()); embedmentGoodsDto.setCompanyId(companyId); List<String> lx = sysEmbedmentGoodsMapper.findAll(embedmentGoodsDto).stream().map(s -> s.getEmbedmentName()+"-"+s.getEmbedmentModel()).collect(Collectors.toList()); String[] gjlx = lx.toArray(new String[lx.size()]); //物品名称-规格型号 hd/pipe/materialsManage/src/main/resources/mapping/SysEmbedmentRecordMapper.xml
@@ -171,8 +171,8 @@ <if test="companyId!=null and companyId!='' "> and ser.company_id=#{companyId} </if> <if test="supplierId!=null and supplierId!='' "> and ser.supplier_id=#{supplierId} <if test="embedmentModel!=null and embedmentModel!='' "> and seg.embedment_model=#{embedmentModel} </if> <if test="getDepart!=null and getDepart!='' "> and sd.depart_name like concat('%',#{getDepart},'%')