diff --git a/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java b/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java index f03dd01..fd6953e 100644 --- a/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java +++ b/crm-admin/src/main/java/com/yb/lb/webapp/stock/StockReportController.java @@ -4,6 +4,7 @@ import com.yb.lb.common.core.AjaxResult; import com.yb.lb.common.core.BaseController; import com.yb.lb.common.utils.ErrorUtils; import com.yb.lb.webapp.redis.service.RedisService; +import com.yb.lb.webapp.stock.service.ClientStockReportService; import com.yb.lb.webapp.stock.service.InventoryInfoService; import com.yb.lb.webapp.utils.RoleDateUtils; import io.swagger.annotations.Api; @@ -20,14 +21,14 @@ import java.util.HashMap; import java.util.Map; /** - * 客户库存查询 + * 客户库存查询报表 * * @author mzr * @date 2023/11/04 **/ @RestController @RequestMapping("/adminx/stockReport") -@Api(tags = "pc:客户库存查询") +@Api(tags = "pc:客户库存查询报表") public class StockReportController extends BaseController { @Autowired RedisService redisService; @@ -35,6 +36,8 @@ public class StockReportController extends BaseController { InventoryInfoService inventoryInfoService; @Autowired RoleDateUtils roleDateUtils; + @Autowired + ClientStockReportService clientStockReportService; /** * @description 库存查询 @@ -121,4 +124,34 @@ public class StockReportController extends BaseController { return toAjax(inventoryInfoService.findDetailList(params, id)); } + /** + * @description 客户库存盘点明细 + * @author mzr + * @date 2024/10/30 + **/ + @ApiOperation("客户库存盘点明细") + @PostMapping(value = "/getClientStockReport") + public Map getClientStockReport( + @ApiParam(required = true, value = "开始日期") @RequestParam(required = true) String startDate, + @ApiParam(required = true, value = "结束日期") @RequestParam(required = true) String endDate, + @ApiParam(required = false, value = "客户id") @RequestParam(required = false) String clientId, + @ApiParam(required = true, value = "页码", defaultValue = "1") @RequestParam(value = "page") Integer pageNum, + @ApiParam(required = true, value = "每页条数", defaultValue = "10") @RequestParam(value = "pageSize") Integer pageSize, + HttpServletRequest request) { + Map result = new HashMap<>(); + Map params = new HashMap<>(); + // String token = request.getHeader("token"); + // if (!redisService.isKey(token)) { + // return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); + // } + // Map tokenMap = redisService.hmget(token); + // params.put("companyId", tokenMap.get("companyId")); + params.put("startDate", startDate); + params.put("endDate", endDate); + params.put("clientId", clientId); + params.put("page", pageNum); + params.put("pageSize", pageSize); + return toPage(clientStockReportService.pageList(params, ".getClientStockReportSql")); + } + } diff --git a/crm-common/src/main/resources/mapper/mapper_oracle/stock/ClientStockReportMapper.xml b/crm-common/src/main/resources/mapper/mapper_oracle/stock/ClientStockReportMapper.xml new file mode 100644 index 0000000..4ad2764 --- /dev/null +++ b/crm-common/src/main/resources/mapper/mapper_oracle/stock/ClientStockReportMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + a.id, a.bill_id, a.bill_no, a.bill_date, a.client_id, a.confirm_status, a.create_time, a.goods_id, + a.goods_no, a.last_num, a.count_num, a.diff_num, a.company_id, a.remark, a.prod_date,a.join_fhd_num, + + + + + + + + + \ No newline at end of file diff --git a/crm-webapp/src/main/java/com/yb/lb/webapp/stock/entity/ClientStockReport.java b/crm-webapp/src/main/java/com/yb/lb/webapp/stock/entity/ClientStockReport.java new file mode 100644 index 0000000..0c997c9 --- /dev/null +++ b/crm-webapp/src/main/java/com/yb/lb/webapp/stock/entity/ClientStockReport.java @@ -0,0 +1,16 @@ +package com.yb.lb.webapp.stock.entity; + +import lombok.Data; + +/** + * 客户库存盘点报表 + * + * @author mzr + * @version 1.0.0 2024-10-29 + */ +@Data +public class ClientStockReport implements java.io.Serializable { + /** 版本号 */ + private static final long serialVersionUID = -1267096003093637603L; + +} \ No newline at end of file diff --git a/crm-webapp/src/main/java/com/yb/lb/webapp/stock/service/ClientStockReportService.java b/crm-webapp/src/main/java/com/yb/lb/webapp/stock/service/ClientStockReportService.java new file mode 100644 index 0000000..c14aaf0 --- /dev/null +++ b/crm-webapp/src/main/java/com/yb/lb/webapp/stock/service/ClientStockReportService.java @@ -0,0 +1,42 @@ +package com.yb.lb.webapp.stock.service; + +import com.github.pagehelper.PageInfo; +import com.yb.lb.common.base.oracle.BaseOracleDao; +import com.yb.lb.webapp.stock.entity.ClientStockReport; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * 盘点单 + * + * @author mzr + * @date 2024/10/30 + **/ +@Service +public class ClientStockReportService { + + @Autowired + BaseOracleDao dao; + + /** + * @description 分页查询 + * @author mzr + * @date 2024/10/30 + **/ + public PageInfo pageList(Map params, String id) { + return dao.pageList(ClientStockReport.class.getName() + id, params); + } + + /** + * @description 查询所有 + * @author mzr + * @date 2024/10/30 + **/ + public List findList(Map params, String id) { + return dao.list(ClientStockReport.class.getName() + id, params); + } + +}