From 87b655ce8f25bc7ead0f328c359a85532a5f1fa8 Mon Sep 17 00:00:00 2001 From: Limy <1353020654@qq.com> Date: Tue, 2 Feb 2021 18:00:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E6=AE=B5=E7=BB=9F=E8=AE=A1=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2-over=20=E4=BA=A7=E5=93=81=E7=A0=81=E6=9F=A5=E8=AF=A2-?= =?UTF-8?q?doing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nanjing/SelectParaAllController.java | 68 ++++++ .../nanjing/SelectProRpListController.java | 119 +++++++++ .../nanjing/TBdProducttypeController.java | 64 ++--- .../TRpWorktrayhistoryinfoController.java | 85 ++++++- .../nanjing/ParaAllShow/ParaAllShow.html | 145 +++++++++++ .../nanjing/ProRpList/SelectProRpList.html | 119 +++++++++ .../WorkTrayHistoryInfo.html | 68 ++++-- .../com/ruoyi/nanjing/domain/ParaAllShow.java | 230 ++++++++++++++++++ .../com/ruoyi/nanjing/domain/ProParaInfo.java | 114 +++++++++ .../com/ruoyi/nanjing/domain/ProRpList.java | 160 ++++++++++++ .../domain/TRpWorktrayhistoryinfo.java | 88 ++++++- .../nanjing/mapper/TBdProducttypeMapper.java | 44 +--- .../nanjing/mapper/TSyTracestateMapper.java | 5 + .../service/ITBdProducttypeService.java | 44 +--- .../service/ITSyTracestateService.java | 5 + .../impl/TBdProducttypeServiceImpl.java | 66 +---- .../impl/TSyTracestateServiceImpl.java | 10 + .../mapper/nanjing/TBdProducttypeMapper.xml | 116 ++++++--- .../nanjing/TRpWorktrayhistoryinfoMapper.xml | 17 +- .../mapper/nanjing/TSyTracestateMapper.xml | 33 +++ 20 files changed, 1348 insertions(+), 252 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectParaAllController.java create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectProRpListController.java create mode 100644 ruoyi-admin/src/main/resources/templates/nanjing/ParaAllShow/ParaAllShow.html create mode 100644 ruoyi-admin/src/main/resources/templates/nanjing/ProRpList/SelectProRpList.html create mode 100644 ruoyi-system/src/main/java/com/ruoyi/nanjing/domain/ParaAllShow.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/nanjing/domain/ProParaInfo.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/nanjing/domain/ProRpList.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectParaAllController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectParaAllController.java new file mode 100644 index 00000000..3217152c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectParaAllController.java @@ -0,0 +1,68 @@ +package com.ruoyi.web.controller.nanjing; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.nanjing.domain.ParaAllShow; +import com.ruoyi.nanjing.domain.ProRpList; +import com.ruoyi.nanjing.domain.TBdProductinfo; +import com.ruoyi.nanjing.service.ITSyTracestateService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +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.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping("/nanjing/selectParaAll") +public class SelectParaAllController extends BaseController { + private String prefix = "nanjing/ParaAllShow"; + @Autowired + private ITSyTracestateService tracestateService; + + @RequiresPermissions("nanjing:ParaAllShow:view") + @GetMapping() + public String ProRpList(ModelMap map) + { + return prefix + "/ParaAllShow"; + } + @RequiresPermissions("nanjing:ProRpList:list") + @PostMapping("/paraAllShow") + @ResponseBody + public TableDataInfo list(HttpServletRequest request) + { + String semiBarcode = request.getParameter("semiBarcode"); + Map map = new HashMap(); + map.put("beginTime",null); + map.put("endTime",null); + map.put("semiBarcode",semiBarcode); + List list = tracestateService.selectAllPara(map); + return getDataTable(list); + } + + @RequiresPermissions("nanjing:ProRpList:export") + @Log(title = "机种切换管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(ParaAllShow paraAllShow) + { + Map map = new HashMap(); + map.put("beginTime",null); + map.put("endTime",null); + map.put("semiBarcode",paraAllShow.getSemiBarcode()); + List list = tracestateService.selectAllPara(map); + ExcelUtil util = new ExcelUtil(ProRpList.class); + return util.exportExcel(list, "ParaAllShow"); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectProRpListController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectProRpListController.java new file mode 100644 index 00000000..67356e44 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/SelectProRpListController.java @@ -0,0 +1,119 @@ +package com.ruoyi.web.controller.nanjing; + +import java.util.*; + +import com.ruoyi.common.core.text.Convert; +import com.ruoyi.framework.util.ShiroUtils; +import com.ruoyi.nanjing.domain.ProRpList; +import com.ruoyi.nanjing.domain.TBdProductinfo; +import com.ruoyi.nanjing.service.ITBdProductinfoService; +import com.ruoyi.nanjing.service.ITBdProducttypeService; +import com.ruoyi.nanjing.service.ITSyTracestateService; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.nanjing.domain.TRpProductchangeinfo; +import com.ruoyi.nanjing.service.ITRpProductchangeinfoService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +import javax.servlet.http.HttpServletRequest; + +/** + * 时段统计 + * + * @author limy + * @date 2021-02-2 + */ +@Controller +@RequestMapping("/nanjing/selectProRpList") +public class SelectProRpListController extends BaseController +{ + private String prefix = "nanjing/ProRpList"; + + @Autowired + private ITBdProductinfoService tBdProductinfoService; + @Autowired + private ITBdProducttypeService itBdProducttypeService; + + @RequiresPermissions("nanjing:ProRpList:view") + @GetMapping() + public String ProRpList(ModelMap map) + { + List tBdProductinfoList = tBdProductinfoService.selectTBdProductinfoList(new TBdProductinfo()); + map.addAttribute("list",tBdProductinfoList); + return prefix + "/SelectProRpList"; + } + + /** + * 查询机种切换管理列表 + */ + @RequiresPermissions("nanjing:ProRpList:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(ProRpList proRpList) + { +// startPage(); + Map map = new HashMap(); + map.put("beginTime",proRpList.getBeginTime()); + map.put("endTime",proRpList.getEndTime()); + map.put("productId",proRpList.getProductID()); + map.put("productType",proRpList.getProductType()); + map.put("state",proRpList.getState()); + map.put("semiBarcode",proRpList.getSemiBarcode()); + List list = null; + return getDataTable(list); + } + + @PostMapping("/getData") + @ResponseBody + public TableDataInfo getData(ProRpList proRpList) + { +// startPage(); + List list = new ArrayList(); + if(proRpList.getBeginTime()==null||proRpList.getEndTime()==null) + { + return getDataTable(list); + } + Map map = new HashMap(); + map.put("beginTime",proRpList.getBeginTime()); + map.put("endTime",proRpList.getEndTime()); + map.put("productId",proRpList.getProductID()); + map.put("productType",proRpList.getProductType()); + map.put("state",proRpList.getState()); + map.put("semiBarcode",proRpList.getSemiBarcode()); + list = itBdProducttypeService.selectProLists(map); + return getDataTable(list); + } + /** + * 导出机种切换管理列表 + */ + @RequiresPermissions("nanjing:ProRpList:export") + @Log(title = "机种切换管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(ProRpList proRpList) + { + Map map = new HashMap(); + map.put("beginTime",proRpList.getBeginTime()); + map.put("endTime",proRpList.getEndTime()); + map.put("productId",proRpList.getProductID()); + map.put("productType",proRpList.getProductType()); + map.put("state",proRpList.getState()); + map.put("semiBarcode",proRpList.getSemiBarcode()); + List list = itBdProducttypeService.selectProLists(map); + ExcelUtil util = new ExcelUtil(ProRpList.class); + return util.exportExcel(list, "ProRpList"); + } + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java index 638aef37..abd3a622 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TBdProducttypeController.java @@ -87,47 +87,47 @@ public class TBdProducttypeController extends BaseController /** * 新增保存机种类型 */ - @RequiresPermissions("nanjing:ProductType:add") - @Log(title = "机种类型", businessType = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(TBdProducttype tBdProducttype) - { - return toAjax(tBdProducttypeService.insertTBdProducttype(tBdProducttype)); - } - +// @RequiresPermissions("nanjing:ProductType:add") +// @Log(title = "机种类型", businessType = BusinessType.INSERT) +// @PostMapping("/add") +// @ResponseBody +// public AjaxResult addSave(TBdProducttype tBdProducttype) +// { +// return toAjax(tBdProducttypeService.insertTBdProducttype(tBdProducttype)); +// } +// /** * 修改机种类型 */ - @GetMapping("/edit/{ID}") - public String edit(@PathVariable("ID") Long ID, ModelMap mmap) - { - TBdProducttype tBdProducttype = tBdProducttypeService.selectTBdProducttypeById(ID); - mmap.put("tBdProducttype", tBdProducttype); - return prefix + "/edit"; - } +// @GetMapping("/edit/{ID}") +// public String edit(@PathVariable("ID") Long ID, ModelMap mmap) +// { +// TBdProducttype tBdProducttype = tBdProducttypeService.selectTBdProducttypeById(ID); +// mmap.put("tBdProducttype", tBdProducttype); +// return prefix + "/edit"; +// } /** * 修改保存机种类型 */ - @RequiresPermissions("nanjing:ProductType:edit") - @Log(title = "机种类型", businessType = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(TBdProducttype tBdProducttype) - { - return toAjax(tBdProducttypeService.updateTBdProducttype(tBdProducttype)); - } +// @RequiresPermissions("nanjing:ProductType:edit") +// @Log(title = "机种类型", businessType = BusinessType.UPDATE) +// @PostMapping("/edit") +// @ResponseBody +// public AjaxResult editSave(TBdProducttype tBdProducttype) +// { +// return toAjax(tBdProducttypeService.updateTBdProducttype(tBdProducttype)); +// } /** * 删除机种类型 */ - @RequiresPermissions("nanjing:ProductType:remove") - @Log(title = "机种类型", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) - { - return toAjax(tBdProducttypeService.deleteTBdProducttypeByIds(ids)); - } +// @RequiresPermissions("nanjing:ProductType:remove") +// @Log(title = "机种类型", businessType = BusinessType.DELETE) +// @PostMapping( "/remove") +// @ResponseBody +// public AjaxResult remove(String ids) +// { +// return toAjax(tBdProducttypeService.deleteTBdProducttypeByIds(ids)); +// } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TRpWorktrayhistoryinfoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TRpWorktrayhistoryinfoController.java index f37062c4..0cb65b9a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TRpWorktrayhistoryinfoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/TRpWorktrayhistoryinfoController.java @@ -1,5 +1,9 @@ package com.ruoyi.web.controller.nanjing; +import java.text.DecimalFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import com.ruoyi.nanjing.domain.TBdSubstation; @@ -22,6 +26,9 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + /** * 工位历史生产信息Controller * @@ -34,9 +41,10 @@ public class TRpWorktrayhistoryinfoController extends BaseController { private String prefix = "nanjing/WorkTrayHistoryInfo"; + TRpWorktrayhistoryinfo thi = new TRpWorktrayhistoryinfo(); @Autowired private ITRpWorktrayhistoryinfoService tRpWorktrayhistoryinfoService; - + @Autowired private ITBdSubstationService substationService; @RequiresPermissions("nanjing:WorkTrayHistoryInfo:view") @GetMapping() @@ -53,13 +61,46 @@ public class TRpWorktrayhistoryinfoController extends BaseController @RequiresPermissions("nanjing:WorkTrayHistoryInfo:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(TRpWorktrayhistoryinfo tRpWorktrayhistoryinfo) - { + public TableDataInfo list(TRpWorktrayhistoryinfo t1) throws Exception { startPage(); - List list = tRpWorktrayhistoryinfoService.selectTRpWorktrayhistoryinfoList(tRpWorktrayhistoryinfo); + List list = tRpWorktrayhistoryinfoService.selectTRpWorktrayhistoryinfoList(t1); return getDataTable(list); } + + /** + * 查询数据,动态表及参数 + * @param t1 + * @param request + * @return + * @throws ParseException + */ + @PostMapping("/searchPara") + @ResponseBody + public TableDataInfo searchPara(TRpWorktrayhistoryinfo t1, HttpServletRequest request ) throws ParseException { + startPage(); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//注意月份是MM + TRpWorktrayhistoryinfo tRpWorktrayhistoryinfo = new TRpWorktrayhistoryinfo(); + String bt = request.getParameter("beginTime"); + String et = request.getParameter("endTime"); + if(!(bt.equals(""))&&bt!=null){ + tRpWorktrayhistoryinfo.setBeginTime(bt); + }else if (!(et.equals(""))&&et!=null){ + tRpWorktrayhistoryinfo.setEndTime(et); + } + else + { + String dt = simpleDateFormat.format(new Date()); + tRpWorktrayhistoryinfo.setBeginTime("1975-01-01 00:00:000"); + tRpWorktrayhistoryinfo.setEndTime(dt); + } + TBdSubstation substation = new TBdSubstation(); + substation.setTableName(t1.getSubstation().getTableName()); + tRpWorktrayhistoryinfo.setSubstation(substation); + tRpWorktrayhistoryinfo.setRfidNO(request.getParameter("rfidNO")); + List list = tRpWorktrayhistoryinfoService.selectTRpWorktrayhistoryinfoList(tRpWorktrayhistoryinfo); + return getDataTable(list); + } /** * 导出工位历史生产信息列表 */ @@ -67,9 +108,43 @@ public class TRpWorktrayhistoryinfoController extends BaseController @Log(title = "工位历史生产信息", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(TRpWorktrayhistoryinfo tRpWorktrayhistoryinfo) + public AjaxResult export(TRpWorktrayhistoryinfo t1,HttpServletRequest request) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//注意月份是MM + TRpWorktrayhistoryinfo tRpWorktrayhistoryinfo = new TRpWorktrayhistoryinfo(); + String bt = request.getParameter("beginTime"); + String et = request.getParameter("endTime"); + if(!(bt.equals(""))&&bt!=null){ + tRpWorktrayhistoryinfo.setBeginTime(bt); + }else if (!(et.equals(""))&&et!=null){ + tRpWorktrayhistoryinfo.setEndTime(et); + } + else + { + String dt = simpleDateFormat.format(new Date()); + tRpWorktrayhistoryinfo.setBeginTime("1975-01-01 00:00:000"); + tRpWorktrayhistoryinfo.setEndTime(dt); + } + TBdSubstation substation = new TBdSubstation(); + substation.setTableName(t1.getSubstation().getTableName()); + tRpWorktrayhistoryinfo.setSubstation(substation); + tRpWorktrayhistoryinfo.setRfidNO(request.getParameter("rfidNO")); List list = tRpWorktrayhistoryinfoService.selectTRpWorktrayhistoryinfoList(tRpWorktrayhistoryinfo); + for (TRpWorktrayhistoryinfo th: list) { + if(th.getSubstation()!=null&&th.getSubstation().getStationCode()!=null){ + th.setStationCode(th.getSubstation().getStationCode()); + }if(th.getStationpara()!=null&&th.getStationpara().getRfidNO()!=null){ + th.setRfidNO(th.getStationpara().getRfidNO()); + }if( th.getStationpara()!=null&&th.getStationpara().getBarcode()!=null){ + th.setBarCode(th.getStationpara().getBarcode()); + }if(th.getBarcoderelationship()!=null&&th.getBarcoderelationship().getProductBarcode()!=null){ + th.setProductBarcode(th.getBarcoderelationship().getProductBarcode()); + }if( th.getStationpara()!=null&&th.getStationpara().getState()!=null){ + th.setState(th.getStationpara().getState()); + }if( th.getStationpara()!=null&& th.getStationpara().getInsertTime()!=null){ + th.setInsertTime(th.getStationpara().getInsertTime()); + } + } ExcelUtil util = new ExcelUtil(TRpWorktrayhistoryinfo.class); return util.exportExcel(list, "WorkTrayHistoryInfo"); } diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/ParaAllShow/ParaAllShow.html b/ruoyi-admin/src/main/resources/templates/nanjing/ParaAllShow/ParaAllShow.html new file mode 100644 index 00000000..fff85bf9 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/nanjing/ParaAllShow/ParaAllShow.html @@ -0,0 +1,145 @@ + + + + + + +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/ProRpList/SelectProRpList.html b/ruoyi-admin/src/main/resources/templates/nanjing/ProRpList/SelectProRpList.html new file mode 100644 index 00000000..ae69114d --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/nanjing/ProRpList/SelectProRpList.html @@ -0,0 +1,119 @@ + + + + + + +
+
+
+
+
+
    +
  • + + + - + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • +  搜索 +  查询全部 + 导出 +
  • +
+
+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/WorkTrayHistoryInfo/WorkTrayHistoryInfo.html b/ruoyi-admin/src/main/resources/templates/nanjing/WorkTrayHistoryInfo/WorkTrayHistoryInfo.html index e463b7d6..e46ff3b9 100644 --- a/ruoyi-admin/src/main/resources/templates/nanjing/WorkTrayHistoryInfo/WorkTrayHistoryInfo.html +++ b/ruoyi-admin/src/main/resources/templates/nanjing/WorkTrayHistoryInfo/WorkTrayHistoryInfo.html @@ -12,20 +12,19 @@
  • - + - - +
  • -
  • - - + 托盘RFID码: +
  •  搜索 @@ -36,20 +35,20 @@ -
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • - + + + + + + + + + + + + + +
    @@ -59,17 +58,17 @@