From 51269282f6724448db81cd3f8d52e57b2c1ee321 Mon Sep 17 00:00:00 2001 From: zpl Date: Thu, 12 Aug 2021 11:27:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=89=93=E5=8D=B0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/PrintLogController.java | 27 ++++++++++++ .../mesnac/common/mapper/PrintLogMapper.java | 9 ++++ .../mesnac/common/model/PrintLog.java | 41 +++++++++++++++++++ .../common/service/PrintLogService.java | 7 ++++ .../service/impl/PrintLogServiceImpl.java | 5 +++ 5 files changed, 89 insertions(+) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java index 7f124c70..465137ed 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java @@ -1,5 +1,6 @@ package com.foreverwin.mesnac.common.controller; +import cn.hutool.core.date.DateUtil; import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.R; import com.foreverwin.modular.core.util.FrontPage; @@ -49,6 +50,32 @@ public class PrintLogController { return R.ok(result); } + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @PostMapping("/getPrintLogListByCondition") + public R getPrintLogListByCondition(@RequestBody PrintLog printLog){ + List result; + try { + String site = CommonMethods.getSite(); + printLog.setSite(site); + if (printLog.getStartFromDate_S() != null) { + printLog.setStartFromDate(DateUtil.parse(printLog.getStartFromDate_S())); + } + if (printLog.getStartToDate_S() != null) { + printLog.setStartToDate(DateUtil.parse(printLog.getStartToDate_S())); + } + result = printLogService.getPrintLogListByCondition(printLog); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + + return R.ok(result); + } + @ResponseBody @PostMapping("/labelPrint") public R labelPrint(@RequestBody List requestList) { diff --git a/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java b/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java index 731257ce..9e527a85 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java @@ -4,6 +4,8 @@ import com.foreverwin.mesnac.common.model.PrintLog; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* Mapper 接口 @@ -15,4 +17,11 @@ import org.springframework.stereotype.Repository; @Repository public interface PrintLogMapper extends BaseMapper { + /** + * 条件查询标签打印所有数据 + * @param printLog + * @return + */ + List getPrintLogListByCondition(PrintLog printLog); + } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java b/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java index d2dd6de1..463c8fba 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; +import java.util.Date; + import com.baomidou.mybatisplus.annotation.IdType; /** @@ -124,6 +126,45 @@ public class PrintLog extends Model { @TableField(value = "ITEM_DESCRIPTION", exist = false) private String itemDescription; + private String startFromDate_S; + @TableField(exist = false) + private String startToDate_S; + @TableField(exist = false) + private Date startFromDate; + @TableField(exist = false) + private Date startToDate; + + public String getStartFromDate_S() { + return startFromDate_S; + } + + public void setStartFromDate_S(String startFromDate_S) { + this.startFromDate_S = startFromDate_S; + } + + public String getStartToDate_S() { + return startToDate_S; + } + + public void setStartToDate_S(String startToDate_S) { + this.startToDate_S = startToDate_S; + } + + public Date getStartFromDate() { + return startFromDate; + } + + public void setStartFromDate(Date startFromDate) { + this.startFromDate = startFromDate; + } + + public Date getStartToDate() { + return startToDate; + } + + public void setStartToDate(Date startToDate) { + this.startToDate = startToDate; + } public String getHandle() { return handle; diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java b/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java index 01c5b584..6a773739 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java @@ -30,4 +30,11 @@ public interface PrintLogService extends IService { * @param printList */ void labelPrint(String site, String user, List printList); + + /** + * 查询标签打印所有数据 + * @param printLog + * @return + */ + List getPrintLogListByCondition(PrintLog printLog); } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java index b49c4d50..904b3532 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java @@ -101,4 +101,9 @@ public class PrintLogServiceImpl extends ServiceImpl i printLogService.updateBatchById(printLogList); } + + @Override + public List getPrintLogListByCondition(PrintLog printLog) { + return printLogMapper.getPrintLogListByCondition(printLog); + } } \ No newline at end of file