From 05bbfd02dc5da7873ec85b331933960ce9cf1daf Mon Sep 17 00:00:00 2001 From: zpl Date: Mon, 16 Aug 2021 14:44:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=94=9F=E4=BA=A7pda=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=88=80=E5=85=B7=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CutterLogController.java | 18 +++++++++++++++ .../mesnac/production/model/CutterLog.java | 22 +++++++++++++++++++ .../production/service/CutterLogService.java | 3 +++ .../service/impl/CutterLogServiceImpl.java | 21 ++++++++++++++++-- 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/CutterLogController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/CutterLogController.java index 4cbc63a5..160a892b 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/controller/CutterLogController.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/CutterLogController.java @@ -134,4 +134,22 @@ public class CutterLogController { public R removeByIds(List ids){ return R.ok(cutterLogService.removeByIds(ids)); } + + /** + * 根据sfc和stepId查询刀具使用信息 + * @return + */ + @ResponseBody + @PostMapping("/findToolInfoBySfc") + public R findToolInfoBySfc(@RequestBody CutterLog cutterLog){ + List result; + try{ + result = cutterLogService.findToolInfoBySfc(cutterLog); + return R.ok(result); + }catch (Exception e){ + return R.failed(e.getMessage()); + } + } + + } \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/model/CutterLog.java b/production/src/main/java/com/foreverwin/mesnac/production/model/CutterLog.java index 627e7c9c..fb6a51a8 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/model/CutterLog.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/model/CutterLog.java @@ -94,8 +94,30 @@ public class CutterLog extends Model { */ @TableField("CREATED_DATE_TIME") private LocalDateTime createdDateTime; + /**刀具描述**/ + @TableField(exist = false) + private String description; + /**规格**/ + @TableField(exist = false) + private String specification; + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getSpecification() { + return specification; + } + + public void setSpecification(String specification) { + this.specification = specification; + } + public String getHandle() { return handle; } diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/CutterLogService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/CutterLogService.java index c837bf87..be901868 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/CutterLogService.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/CutterLogService.java @@ -28,4 +28,7 @@ public interface CutterLogService extends IService { List selectList(CutterLog cutterLog); void doAdd(Map map); + + List findToolInfoBySfc(CutterLog cutterLog); + } \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/CutterLogServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/CutterLogServiceImpl.java index e6fe607c..7a5a8efa 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/CutterLogServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/CutterLogServiceImpl.java @@ -15,9 +15,7 @@ import com.foreverwin.mesnac.meapi.dto.SfcDto; import com.foreverwin.mesnac.production.mapper.CutterLogMapper; import com.foreverwin.mesnac.production.mapper.SfcCrossMapper; import com.foreverwin.mesnac.production.model.CutterLog; -import com.foreverwin.mesnac.common.model.Tool; import com.foreverwin.mesnac.production.service.CutterLogService; -import com.foreverwin.mesnac.common.service.ToolService; import com.foreverwin.modular.core.exception.BaseException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.FrontPage; @@ -52,6 +50,8 @@ public class CutterLogServiceImpl extends ServiceImpl selectPage(FrontPage frontPage, CutterLog cutterLog) { @@ -123,5 +123,22 @@ public class CutterLogServiceImpl extends ServiceImpl findToolInfoBySfc(CutterLog cutterLog) { + String site = CommonMethods.getSite(); + cutterLog.setSite(site); + List cutterLogList = cutterLogService.selectList(cutterLog); + if (cutterLogList != null && cutterLogList.size() > 0){ + for (CutterLog cutter:cutterLogList) { + Tool byId = toolService.getById(HandleEnum.TOOL.getHandle(site, cutter.getCutter())); + cutter.setDescription(byId.getDescription()); + cutter.setSpecification(byId.getSpecification()); + } + return cutterLogList; + }else { + return null; + } + } + } \ No newline at end of file From 54a07a32b490eeaf3e9a157014bfb74102f6333b Mon Sep 17 00:00:00 2001 From: zpl Date: Mon, 16 Aug 2021 14:57:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/main/resources/mapper/PrintLogMapper.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/resources/mapper/PrintLogMapper.xml b/common/src/main/resources/mapper/PrintLogMapper.xml index 644f0316..b1166863 100644 --- a/common/src/main/resources/mapper/PrintLogMapper.xml +++ b/common/src/main/resources/mapper/PrintLogMapper.xml @@ -547,16 +547,16 @@ AND PL.CREATED_DATE_TIME <= #{startToDate} - + AND PL.IS_PRINT = #{isPrint} - + AND PL.CATEGORY = #{category} - + AND PL.INVENTORY = #{inventory} - + AND PL.SFC = #{sfc} ORDER BY PL.CREATED_DATE_TIME DESC