consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java
@@ -13,13 +13,16 @@ import com.walker.infrastructure.utils.StringUtils; import com.walker.web.ResponseValue; import io.swagger.annotations.Api; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import java.util.List; import java.util.Map; import java.util.TreeMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description ç©ååç±» consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java
@@ -9,7 +9,11 @@ import com.consum.base.service.BaseGoodsTemplateServiceImpl; import com.consum.base.service.BaseWarehouseServiceImpl; import com.consum.base.service.LWhGoodsService; import com.consum.model.po.*; import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.BaseGoodsTemplate; import com.consum.model.po.BaseWarehouse; import com.consum.model.po.FinSysTenantUser; import com.consum.model.po.SDictData; import com.consum.model.vo.BaseGoodsTemplateVo; import com.walker.db.page.GenericPager; import com.walker.infrastructure.utils.StringUtils; @@ -17,14 +21,17 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description ç©åæ¨¡æ¿ consum-base/src/main/java/com/consum/base/controller/BaseWarehouseController.java
@@ -14,10 +14,14 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description ä»åºç®¡ç @@ -162,10 +166,9 @@ */ @GetMapping("/select/tenant_warehouse") public ResponseValue getByAgencyId(Long agencyId) { // TODO ææ æºæ // if (agencyId == null) { // return ResponseValue.error("æºæid为空"); // } if (agencyId == null) { return ResponseValue.success(new ArrayList<>()); } List<BaseWarehouse> list = this.baseWarehouseService.getByAgencyId(agencyId, null, null); if (list == null) { return ResponseValue.error("æ¥è¯¢å¤±è´¥ï¼"); consum-base/src/main/java/com/consum/base/controller/BaseWarehouseManagerController.java
@@ -3,12 +3,13 @@ import com.consum.base.BaseController; import com.consum.base.core.utils.CommonUtil; import com.consum.base.pojo.request.WarehouseManagerParam; import com.consum.base.service.BaseWarehouseManagerServiceImpl; import com.consum.base.service.BaseWarehouseManagerService; import com.consum.model.po.BaseWarehouseManager; import com.consum.model.po.FinSysTenantUser; import com.walker.web.ResponseValue; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; @@ -29,7 +30,7 @@ public class BaseWarehouseManagerController extends BaseController { @Autowired private BaseWarehouseManagerServiceImpl baseWarehouseManagerService; private BaseWarehouseManagerService baseWarehouseManagerService; /** * @Description æ°å¢ @@ -49,20 +50,28 @@ if (sysInfo == null) { return ResponseValue.error("请å ç»å½"); } this.baseWarehouseManagerService.add(param); baseWarehouseManagerService.add(param); return ResponseValue.success(); } @ApiOperation(value = "æ¥è¯¢", notes = "æ¥è¯¢") @ApiOperation(value = "æ ¹æ®ä»åºidæ¥è¯¢åºç®¡å", notes = "æ ¹æ®ä»åºidæ¥è¯¢åºç®¡å") @ApiImplicitParam(name = "warehouseId", value = "ä»åºid", required = true, dataType = "Long") @GetMapping("/list") public ResponseValue select(Long warehouseId) { BaseWarehouseManager baseWarehouseManager = new BaseWarehouseManager(); baseWarehouseManager.setBaseWarehouseId(warehouseId); List<BaseWarehouseManager> select = this.baseWarehouseManagerService.select(baseWarehouseManager); return ResponseValue.success(select); List<BaseWarehouseManager> baseWarehouseManagerList = baseWarehouseManagerService.selectWarehouseManager(warehouseId); return ResponseValue.success(baseWarehouseManagerList); } @ApiOperation(value = "æ ¹æ®ä»åº,æºæidæ¥è¯¢åºç®¡å", notes = "æ ¹æ®ä»åº,æºæidæ¥è¯¢åºç®¡å") @ApiImplicitParams({ @ApiImplicitParam(name = "warehouseId", value = "ä»åºid", required = true, dataType = "Long"), @ApiImplicitParam(name = "agencyId", value = "æºæid", required = true, dataType = "Long") }) @GetMapping("/query") public ResponseValue selectManagerList(Long warehouseId, Long agencyId) { List<BaseWarehouseManager> baseWarehouseManagerList = baseWarehouseManagerService.selectManagerList(warehouseId, agencyId); return ResponseValue.success(baseWarehouseManagerList); } } consum-base/src/main/java/com/consum/base/controller/LWhFormInventoryController.java
@@ -1,8 +1,11 @@ package com.consum.base.controller; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.consum.base.BaseController; import com.consum.base.core.utils.CommonUtil; import com.consum.base.core.utils.PageUtil; import com.consum.base.pojo.excel.InventoryExcelTemplate; import com.consum.base.pojo.query.LWhFormInventoryQry; import com.consum.base.pojo.request.FormInventoryParam; import com.consum.base.pojo.request.LWhFormInventoryParam; @@ -15,14 +18,25 @@ import com.consum.model.po.LWhFormInventory; import com.iplatform.model.po.S_user_core; import com.walker.db.page.GenericPager; import com.walker.infrastructure.utils.CollectionUtils; import com.walker.infrastructure.utils.DateUtils; import com.walker.web.ResponseValue; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.net.URLEncoder; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import javax.servlet.http.HttpServletResponse; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; @@ -302,6 +316,49 @@ return ResponseValue.success(formInventoryVO); } @ApiOperation(value = "çç¹å导åº", notes = "çç¹å导åº") @GetMapping("/list/export") public void export(Long id, HttpServletResponse response) throws IOException { List<InventoryExcelTemplate> exportList = lWhFormInventoryService.getExportList(id); if (CollectionUtils.isEmpty(exportList)) { throw new RuntimeException("æ°æ®ä¸ºç©º"); } TemplateExportParams params = new TemplateExportParams("import/ä½å¼æèåçç¹è¡¨.xls"); params.setHeadingStartRow(2); Optional<InventoryExcelTemplate> first = exportList.stream().findFirst(); InventoryExcelTemplate inventoryExcelTemplate = first.get(); Long createTime = inventoryExcelTemplate.getCreateTime(); String operatorName = inventoryExcelTemplate.getOperatorName(); String monitorName = inventoryExcelTemplate.getMonitorName(); Long endTime = inventoryExcelTemplate.getEndTime(); Map<String, Object> map = new HashMap<>(); map.put("date", DateUtils.toShowDate(createTime)); map.put("endDate", DateUtils.toShowDate(endTime)); map.put("monitorName", monitorName); map.put("name", operatorName); Workbook workbook = ExcelExportUtil.exportExcel(params, InventoryExcelTemplate.class, exportList, map); downLoadExcel("ä½å¼æèåçç¹è¡¨", response, workbook); } private void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) { try (OutputStream out = response.getOutputStream()) { response.setCharacterEncoding("UTF-8"); response.setHeader("content-Type", "application/vnd.ms-excel"); response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xls", "UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); workbook.write(baos); response.setHeader("Content-Length", String.valueOf(baos.size())); out.write(baos.toByteArray()); } catch (Exception e) { logger.error("å¯¼åºæä»¶å¤±è´¥", e); } } } consum-base/src/main/java/com/consum/base/controller/LWhFormOutputController.java
@@ -161,6 +161,7 @@ LWhFormOutput lWhFormOutput = lWhFormOutputService.get(new LWhFormOutput(id)); LWhFormOutputExtendVO lWhFormOutputExtendVO = new LWhFormOutputExtendVO(); BeanUtils.copyProperties(lWhFormOutput, lWhFormOutputExtendVO); lWhFormOutputExtendVO.setDoc(lWhFormOutput.getOutputDoc()); String sql = "SELECT bgt.id, CATEGORY_ID, CATEGORY_NAME, GOODS_NAME " + "FROM l_wh_procure_model pm LEFT JOIN base_goods_models bgm ON bgm.id = pm.BASE_GOODS_MODELS_ID " consum-base/src/main/java/com/consum/base/controller/LWhFormScrappedController.java
@@ -1,14 +1,14 @@ package com.consum.base.controller; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.ExportParams; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.consum.base.BaseController; import com.consum.base.core.utils.CommonUtil; import com.consum.base.core.utils.MapUtils; import com.consum.base.core.utils.MapperUtil; import com.consum.base.core.utils.PageUtil; import com.consum.base.pojo.LWhFormScrappedParam; import com.consum.base.pojo.excel.ScrappedInfoExport; import com.consum.base.pojo.excel.ScrappedInfoExcelTemplate; import com.consum.base.pojo.query.LWhFormScrappedQry; import com.consum.base.pojo.response.FromTransferTemplateInfoVO; import com.consum.base.pojo.response.LWhFormScrappedExtendVO; @@ -17,25 +17,28 @@ import com.consum.model.po.FinSysTenantUser; import com.consum.model.po.LWhFormScrapped; import com.walker.infrastructure.utils.CollectionUtils; import com.walker.infrastructure.utils.DateUtils; import com.walker.web.ResponseValue; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.commons.compress.utils.Lists; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; import java.net.URLEncoder; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import javax.servlet.http.HttpServletResponse; import org.apache.commons.compress.utils.Lists; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description æ¥åºå @@ -58,7 +61,7 @@ */ @ApiOperation(value = "æ°å¢æ¥åºå", notes = "æ°å¢æ¥åºå") @ApiImplicitParams({ @ApiImplicitParam(name = "param") @ApiImplicitParam(name = "param") }) @PostMapping("/add") public ResponseValue add() { @@ -67,7 +70,7 @@ CommonUtil.copyProperties(param, query); param = query; FinSysTenantUser sysInfo = this.getSysInfo(); int result = this.lWhFormScrappedService.add(param,0, this.getCurrentUser(), sysInfo); int result = this.lWhFormScrappedService.add(param, 0, this.getCurrentUser(), sysInfo); if (result > 0) { return ResponseValue.success(1); } @@ -76,7 +79,7 @@ @ApiOperation(value = "æ°å¢æ¥åºå", notes = "æ°å¢æ¥åºå") @ApiImplicitParams({ @ApiImplicitParam(name = "param") @ApiImplicitParam(name = "param") }) @PostMapping("/deprAdd") public ResponseValue deprAdd() { @@ -86,7 +89,7 @@ param = query; FinSysTenantUser sysInfo = this.getSysInfo(); int result = this.lWhFormScrappedService.add(param,1, this.getCurrentUser(), sysInfo); int result = this.lWhFormScrappedService.add(param, 1, this.getCurrentUser(), sysInfo); if (result > 0) { return ResponseValue.success(1); } @@ -100,7 +103,7 @@ */ @ApiOperation(value = "å表æ¥è¯¢", notes = "å表æ¥è¯¢") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "æ¥è¯¢æ¡ä»¶", dataType = "LWhFormScrappedQry", paramType = "query") @ApiImplicitParam(name = "param", value = "æ¥è¯¢æ¡ä»¶", dataType = "LWhFormScrappedQry", paramType = "query") }) @GetMapping("/list") public ResponseValue queryList() { @@ -123,8 +126,8 @@ List<FromTransferTemplateInfoVO> list = Lists.newArrayList(); // æ¥è¯¢åå·æ°é String sql = "SELECT fsg.id,fsg.BASE_GOODS_TEMPLATE_ID goodsTemplatesId,fsg.GOODS_TEMPLATE_NAME goodsName,sum(counts) count FROM l_wh_form_scrapped fs left join l_wh_form_scrapped_goods fsg on fs.id = fsg.FORM_SCRAPPED_ID " + "where fsg.FORM_SCRAPPED_ID =:id group by fsg.BASE_GOODS_TEMPLATE_ID"; "SELECT fsg.id,fsg.BASE_GOODS_TEMPLATE_ID goodsTemplatesId,fsg.GOODS_TEMPLATE_NAME goodsName,sum(counts) count FROM l_wh_form_scrapped fs left join l_wh_form_scrapped_goods fsg on fs.id = fsg.FORM_SCRAPPED_ID " + "where fsg.FORM_SCRAPPED_ID =:id group by fsg.BASE_GOODS_TEMPLATE_ID"; Map<String, Object> paramMap = new HashMap<>(); paramMap.put("id", item.getId()); List<Map<String, Object>> procureModelList = lWhFormScrappedService.select(sql, paramMap, new MapperUtil()); @@ -147,7 +150,7 @@ */ @ApiOperation(value = "æ ¹æ®idæ¥è¯¢è¯¦æ ", notes = "æ ¹æ®idæ¥è¯¢è¯¦æ ") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "æ¥åºåid", dataType = "Long", paramType = "query") @ApiImplicitParam(name = "id", value = "æ¥åºåid", dataType = "Long", paramType = "query") }) @GetMapping("/detail") public ResponseValue getById(Long id) { @@ -166,10 +169,10 @@ */ @ApiOperation(value = "æ¥åºæç»", notes = "æ¥åºæç»") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "æ¥è¯¢æ¡ä»¶", dataType = "LWhFormScrappedQry", paramType = "query") @ApiImplicitParam(name = "param", value = "æ¥è¯¢æ¡ä»¶", dataType = "LWhFormScrappedQry", paramType = "query") }) @GetMapping("/list/detailList") public ResponseValue queryDetailList( ) { public ResponseValue queryDetailList() { LWhFormScrappedQry param = CommonUtil.getObjFromReq(LWhFormScrappedQry.class); LWhFormScrappedQry query = new LWhFormScrappedQry(); CommonUtil.copyProperties(param, query); @@ -188,16 +191,37 @@ * @Author å¢åºé³ * @Date 2023/11/2 */ @GetMapping("/export") public ResponseValue export(Long id, HttpServletRequest request, HttpServletResponse response) { @GetMapping("/list/export") public void export(Long id, HttpServletResponse response) { if (id == null) { return ResponseValue.error("æ¥åºåid为空"); throw new RuntimeException("æ¥åºåid为空"); } try { OutputStream outputStream = response.getOutputStream(); List<Map<String, Object>> export = lWhFormScrappedService.export(id); ExportParams exportParams = new ExportParams("æ¥åºåç»è®°", "æ¥åºåç»è®°"); Workbook sheets = ExcelExportUtil.exportExcel(exportParams, ScrappedInfoExport.class, export); List<ScrappedInfoExcelTemplate> export = lWhFormScrappedService.export(id); if (CollectionUtils.isEmpty(export)) { throw new RuntimeException("æ°æ®ä¸ºç©º"); } TemplateExportParams exportParams = new TemplateExportParams("import/æ¥åºç»è®°å.xlsx"); exportParams.setHeadingStartRow(2); Optional<ScrappedInfoExcelTemplate> first = export.stream().findFirst(); ScrappedInfoExcelTemplate scrappedInfoExcelTemplate = first.get(); Long dealTime = scrappedInfoExcelTemplate.getDealTime(); String operatorName = scrappedInfoExcelTemplate.getOperatorName(); String businessFormCode = scrappedInfoExcelTemplate.getBusinessFormCode(); int countNum = export.stream().filter(item -> item.getNum() != null).mapToInt(ScrappedInfoExcelTemplate::getNum).sum(); int totalAmount = export.stream().filter(item -> item.getTotalAmount() != null).mapToInt(ScrappedInfoExcelTemplate::getTotalAmount).sum(); Map<String, Object> map = new HashMap<>(); map.put("code", businessFormCode); map.put("date", DateUtils.toShowDate(dealTime)); map.put("name", operatorName); map.put("countNum", countNum); map.put("totalAmount", totalAmount); Workbook sheets = ExcelExportUtil.exportExcel(exportParams, ScrappedInfoExcelTemplate.class, export, map); // 设置ååºå¤´ response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"); response.setHeader("Content-disposition", "attachment;filename=" + URLEncoder.encode("æ¥åºåç»è®°.xlsx", "utf-8")); @@ -206,7 +230,8 @@ } catch (IOException e) { throw new RuntimeException(e); } return ResponseValue.success(); } consum-base/src/main/java/com/consum/base/pojo/excel/InventoryExcelTemplate.java
New file @@ -0,0 +1,48 @@ package com.consum.base.pojo.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; import java.io.Serializable; import lombok.Data; /** * @author asus * @version 1.0 * @description: çç¹å导åºexcel * @date 2023/11/30 16:41 */ @Data public class InventoryExcelTemplate implements Serializable { @Excel(name = "åä½") private String tenantName; @Excel(name = "ç©ååç§°") private String templateName; @Excel(name = "ç©ååå·/è§æ ¼") private String baseModelName; @Excel(name = "åºåæ°é") private Integer stockNum; @Excel(name = "çç¹æ°é") private Integer num; @Excel(name = "éé¢") private Integer totalAmount; @Excel(name = "çç¹æ¯å¦ä¸è´(æ¯/å¦)") private String inventoryDeception; @Excel(name = "çç¹å·®å¼æè¿°") private String deception; @Excel(name = "夿³¨") private String remark; @ExcelIgnore private String operatorName; @ExcelIgnore private Long createTime; @ExcelIgnore private Long endTime; @ExcelIgnore private String monitorName; @ExcelIgnore private Integer inventoryResult; } consum-base/src/main/java/com/consum/base/pojo/excel/ScrappedInfoExcelTemplate.java
New file @@ -0,0 +1,44 @@ package com.consum.base.pojo.excel; import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.ExcelIgnore; import java.io.Serializable; import lombok.Data; /** * @author asus * @version 1.0 * @description: æ¥åºå导åºexcel * @date 2023/11/30 16:41 */ @Data public class ScrappedInfoExcelTemplate implements Serializable { @Excel(name = "åä½") private String tenantName; @Excel(name = "ç©ååç§°") private String templateName; @Excel(name = "ç©ååå·/è§æ ¼") private String baseModelName; @Excel(name = "æ°é") private Integer num; @Excel(name = "éé¢") private Integer totalAmount; @Excel(name = "æ¥åºåå ") private String deception; @Excel(name = "夿³¨") private String remark; @ExcelIgnore private String businessFormCode; @ExcelIgnore private Long dealTime; @ExcelIgnore private String operatorName; } consum-base/src/main/java/com/consum/base/pojo/excel/ScrappedInfoExport.java
File was deleted consum-base/src/main/java/com/consum/base/pojo/excel/TemplateExcelExport1.java
File was deleted consum-base/src/main/java/com/consum/base/pojo/response/LWhFormOutputExtendVO.java
@@ -44,7 +44,7 @@ private Long dealTime; // åºåºæç» private Long doc; private String doc; private List<FormOutputGoodsVO> fromOutputGoods; } consum-base/src/main/java/com/consum/base/service/BaseWarehouseManagerService.java
New file @@ -0,0 +1,15 @@ package com.consum.base.service; import com.consum.base.pojo.request.WarehouseManagerParam; import com.consum.model.po.BaseWarehouseManager; import com.walker.jdbc.service.BaseService; import java.util.List; public interface BaseWarehouseManagerService extends BaseService { void add(WarehouseManagerParam list) throws Exception; List<BaseWarehouseManager> selectWarehouseManager(Long warehouseId); List<BaseWarehouseManager> selectManagerList(Long warehouseId, Long agencyId); } consum-base/src/main/java/com/consum/base/service/LWhFormInventoryServiceImpl.java
@@ -6,6 +6,7 @@ import com.consum.base.core.utils.MapUtils; import com.consum.base.core.utils.MapperUtil; import com.consum.base.core.utils.PageUtil; import com.consum.base.pojo.excel.InventoryExcelTemplate; import com.consum.base.pojo.query.LWhFormInventoryQry; import com.consum.base.pojo.request.FormInventoryParam; import com.consum.base.pojo.request.LWhFormInventoryParam; @@ -352,4 +353,37 @@ formInventoryVO.setFormInventoryGoodsList(goodsVOList); return formInventoryVO; } public List<InventoryExcelTemplate> getExportList(Long id) { String sql = "SELECT\n" + "\tfi.INVENTORY_DATE createTime,\n" + "\tfi.STOP_TIME endTime,\n" + "\tfi.OPERATOR_NAME,\n" + "\tfi.OPERATOR_NAME2 monitorName,\n" + "\tfi.AGENCY_NAME tenantName,\n" + "\tfig.GOODS_TEMPLATE_NAME templateName,\n" + "\tfig.BASE_GOODS_MODELS_NAME baseModelName,\n" + "\tfig.INVENTORY_COUNTS num,\n" + "\tfig.INIT_COUNTS stockNum,\n" + "\tfig.INVENTORY_RESULT,\n" + "\tBEIZ1 remark\n" + "FROM\n" + "\tl_wh_form_inventory fi\n" + "\tLEFT JOIN l_wh_form_inventory_goods fig ON fi.ID = fig.WH_FORM_INVENTORY_ID\n" + "WHERE\n" + "\tfi.ID = :id"; HashMap<String, Object> param = new HashMap<>(); param.put("id", id); List<Map<String, Object>> select = this.select(sql, param, new MapperUtil()); if (CollectionUtils.isEmpty(select)) { return null; } List<InventoryExcelTemplate> list = Lists.newArrayList(); select.forEach(item -> { InventoryExcelTemplate inventoryExcelTemplate = MapUtils.convertMapToObj(item, InventoryExcelTemplate.class); list.add(inventoryExcelTemplate); }); return list; } } consum-base/src/main/java/com/consum/base/service/LWhFormScrappedServiceImpl.java
@@ -9,25 +9,36 @@ import com.consum.base.pojo.LWhFormScrappedGoodsInfoParam; import com.consum.base.pojo.LWhFormScrappedGoodsModelParams; import com.consum.base.pojo.LWhFormScrappedParam; import com.consum.base.pojo.excel.ScrappedInfoExcelTemplate; import com.consum.base.pojo.query.LWhFormScrappedQry; import com.consum.base.pojo.response.FormScrappedGoodsDetailVO; import com.consum.base.pojo.response.FormScrappedGoodsVO; import com.consum.base.pojo.response.GoodsModelVO; import com.consum.base.pojo.response.LWhFormScrappedExtendVO; import com.consum.model.po.*; import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.BaseGoodsTemplate; import com.consum.model.po.BaseWarehouse; import com.consum.model.po.FinSysTenantDepartment; import com.consum.model.po.FinSysTenantUser; import com.consum.model.po.LWhFormScrapped; import com.consum.model.po.LWhFormScrappedGoods; import com.consum.model.po.SDictData; import com.iplatform.model.po.S_user_core; import com.walker.db.page.GenericPager; import com.walker.infrastructure.utils.StringUtils; import com.walker.jdbc.service.BaseServiceImpl; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.stream.Collectors; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; /** * @Description æ¥åºå @@ -353,38 +364,37 @@ return pageUtil; } public List<Map<String, Object>> export(Long id) { public List<ScrappedInfoExcelTemplate> export(Long id) { String sql = "SELECT BUSINESS_FORM_CODE, fs.DEAL_TIME, OPERATOR_NAME, AGENCY_NAME, GOODS_TEMPLATE_NAME, BASE_GOODS_MODELS_NAME, DEPARTMENT_NAME, COUNTS, SCRAPPED_NAME, BEIZ " + "FROM l_wh_form_scrapped_goods fsg LEFT JOIN l_wh_form_scrapped fs ON fs.id = fsg.FORM_SCRAPPED_ID WHERE " + "fs.ID = :id and STATES = 1"; "SELECT\n" + "\tBUSINESS_FORM_CODE,\n" + "\tfs.DEAL_TIME,\n" + "\tOPERATOR_NAME,\n" + "\tAGENCY_NAME tenantName,\n" + "\tGOODS_TEMPLATE_NAME templateName,\n" + "\tBASE_GOODS_MODELS_NAME baseModelName,\n" + "\tCOUNTS num,\n" + "\tSCRAPPED_NAME deception,\n" + "\tBEIZ remark\n" + "FROM\n" + "\tl_wh_form_scrapped_goods fsg\n" + "\tLEFT JOIN l_wh_form_scrapped fs ON fs.id = fsg.FORM_SCRAPPED_ID\n" + "WHERE\n" + "\tfs.ID = :id\n" + "\tAND STATES = 1"; Map<String, Object> param = new HashMap<>(); param.put("id", id); List<Map<String, Object>> select = this.select(sql, param, new MapperUtil()); return select; if (CollectionUtils.isEmpty(select)) { return null; } List<ScrappedInfoExcelTemplate> list = Lists.newArrayList(); select.forEach(item -> { ScrappedInfoExcelTemplate inventoryExcelTemplate = MapUtils.convertMapToObj(item, ScrappedInfoExcelTemplate.class); list.add(inventoryExcelTemplate); }); return list; } /** * @Description å¯¼åºæ¥åºç»è®°å * @Author å¢åºé³ * @Date 2023/11/2 */ // public LWhFormScrappedExtendVO export(Long id, FinSysTenantUser sysInfo) { // LWhFormScrappedExtendVO scrappedExtend = new LWhFormScrappedExtendVO(); // //1.æ¥è¯¢æ¥åºå // LWhFormScrapped lWhFormScrapped = this.get(new LWhFormScrapped(id)); // if (lWhFormScrapped != null) { // lWhFormScrapped.setDealTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); // lWhFormScrapped.setOperatorName(sysInfo.getUserName()); // BeanUtils.copyProperties(lWhFormScrapped, scrappedExtend); // } // //2.æ¥è¯¢æ¥åºåç©å // List<LWhFormScrappedGoods> scrappedGoodsList = this.scrappedGoodsService.getByFormScrappedId(id); // if (!CollectionUtils.isEmpty(scrappedGoodsList)) { // scrappedExtend.setScrappedGoodsList(scrappedGoodsList); // } // return scrappedExtend; // } } consum-base/src/main/java/com/consum/base/service/LWhFormTransferServiceImpl.java
@@ -70,7 +70,7 @@ @Autowired private LWhProcureModelUserRecordServiceImpl lWhProcureModelUserRecordService; @Autowired private BaseWarehouseManagerServiceImpl baseWarehouseManagerService; private BaseWarehouseManagerService baseWarehouseManagerService; @Autowired private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; @@ -132,7 +132,7 @@ Long id = sysInfo.getId(); BaseWarehouseManager manager = new BaseWarehouseManager(); manager.setManagerId(id); List<BaseWarehouseManager> managerList = baseWarehouseManagerService.select(manager); List<BaseWarehouseManager> managerList = baseWarehouseManagerService.selectAll(manager); if (CollectionUtils.isEmpty(managerList)) { log.error("è¯¥ç¨æ·ä¸æ¯åºç®¡å"); throw new Exception("è¯¥ç¨æ·ä¸æ¯åºç®¡å"); consum-base/src/main/java/com/consum/base/service/impl/BaseWarehouseManagerServiceImpl.java
File was renamed from consum-base/src/main/java/com/consum/base/service/BaseWarehouseManagerServiceImpl.java @@ -1,8 +1,10 @@ package com.consum.base.service; package com.consum.base.service.impl; import com.consum.base.core.utils.IdUtil; import com.consum.base.pojo.WarehouseManagerInfo; import com.consum.base.pojo.request.WarehouseManagerParam; import com.consum.base.service.BaseWarehouseManagerService; import com.consum.base.service.FinSysTenantUserServiceImpl; import com.consum.model.po.BaseWarehouseManager; import com.consum.model.po.FinSysTenantUser; import com.iplatform.model.po.S_role; @@ -21,16 +23,18 @@ * @Date 2023/10/23 */ @Service public class BaseWarehouseManagerServiceImpl extends BaseServiceImpl { public class BaseWarehouseManagerServiceImpl extends BaseServiceImpl implements BaseWarehouseManagerService { @Autowired private FinSysTenantUserServiceImpl finSysTenantUserService; /** * @Description æ°å¢ * @Author å¢åºé³ * @Date 2023/10/26 */ @Override @Transactional(rollbackFor = Exception.class) public void add(WarehouseManagerParam list) throws Exception { @@ -97,5 +101,30 @@ } @Override public List<BaseWarehouseManager> selectWarehouseManager(Long warehouseId) { BaseWarehouseManager baseWarehouseManager = new BaseWarehouseManager(); baseWarehouseManager.setBaseWarehouseId(warehouseId); List<BaseWarehouseManager> select = this.select(baseWarehouseManager); return select; } @Override public List<BaseWarehouseManager> selectManagerList(Long warehouseId, Long agencyId) { StringBuilder sql = new StringBuilder("select * from base_warehouse_manager bwm left join base_warehouse bw on bwm.base_warehouse_id = bw.id " + "where 1=1 "); Map<String, Object> param = new HashMap<>(); if (warehouseId != null) { param.put("warehouseId", warehouseId); sql.append("and bwm.BASE_WAREHOUSE_ID =:warehouseId "); } if (agencyId != null) { param.put("agencyId", agencyId); sql.append("and bw.agency_id =:agencyId "); } List<BaseWarehouseManager> select = this.select(sql.toString(), param, new BaseWarehouseManager()); return select; } } deploy-jar-single/src/main/resources/import/µÍÖµÒ×ºÄÆ·Å̵ã±í.xlsBinary files differ
deploy-jar-single/src/main/resources/import/±¨·ÏµÇ¼Çµ¥.xlsxBinary files differ
deploy-jar-single/src/main/resources/import/µ÷²¦Èë¿âµ¥.xlsBinary files differ