From 735c99bbbcba0fc0a68e60bec4d6e8c64b9d729d Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期二, 08 十月 2024 09:39:28 +0800
Subject: [PATCH] --
---
src/main/java/com/zy/asrs/service/FlowLogService.java | 8
src/main/webapp/static/js/flowLog/flowLog.js | 273 +++++++++++++++++
src/main/java/com/zy/asrs/entity/FlowLog.java | 262 ++++++++++++++++
src/main/java/com/zy/asrs/mapper/FlowLogMapper.java | 12
src/main/webapp/views/flowLog/flowLog.html | 230 ++++++++++++++
src/main/java/com/zy/asrs/service/impl/FlowLogServiceImpl.java | 12
src/main/java/com/zy/asrs/controller/FlowLogController.java | 125 +++++++
src/main/java/com/zy/common/CodeBuilder.java | 2
src/main/resources/mapper/FlowLogMapper.xml | 34 ++
9 files changed, 957 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/FlowLogController.java b/src/main/java/com/zy/asrs/controller/FlowLogController.java
new file mode 100644
index 0000000..62d41c6
--- /dev/null
+++ b/src/main/java/com/zy/asrs/controller/FlowLogController.java
@@ -0,0 +1,125 @@
+package com.zy.asrs.controller;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.core.common.DateUtils;
+import com.zy.asrs.entity.FlowLog;
+import com.zy.asrs.service.FlowLogService;
+import com.core.annotations.ManagerAuth;
+import com.core.common.BaseRes;
+import com.core.common.Cools;
+import com.core.common.R;
+import com.zy.common.web.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.*;
+
+@RestController
+public class FlowLogController extends BaseController {
+
+ @Autowired
+ private FlowLogService flowLogService;
+
+ @RequestMapping(value = "/flowLog/{id}/auth")
+ @ManagerAuth
+ public R get(@PathVariable("id") String id) {
+ return R.ok(flowLogService.selectById(String.valueOf(id)));
+ }
+
+ @RequestMapping(value = "/flowLog/list/auth")
+ @ManagerAuth
+ public R list(@RequestParam(defaultValue = "1")Integer curr,
+ @RequestParam(defaultValue = "10")Integer limit,
+ @RequestParam(required = false)String orderByField,
+ @RequestParam(required = false)String orderByType,
+ @RequestParam(required = false)String condition,
+ @RequestParam Map<String, Object> param){
+ EntityWrapper<FlowLog> wrapper = new EntityWrapper<>();
+ excludeTrash(param);
+ convert(param, wrapper);
+ allLike(FlowLog.class, param.keySet(), wrapper, condition);
+ if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+ return R.ok(flowLogService.selectPage(new Page<>(curr, limit), wrapper));
+ }
+
+ private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
+ for (Map.Entry<String, Object> entry : map.entrySet()){
+ String val = String.valueOf(entry.getValue());
+ if (val.contains(RANGE_TIME_LINK)){
+ String[] dates = val.split(RANGE_TIME_LINK);
+ wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
+ wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+ } else {
+ wrapper.like(entry.getKey(), val);
+ }
+ }
+ }
+
+ @RequestMapping(value = "/flowLog/add/auth")
+ @ManagerAuth
+ public R add(FlowLog flowLog) {
+ flowLogService.insert(flowLog);
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/flowLog/update/auth")
+ @ManagerAuth
+ public R update(FlowLog flowLog){
+ if (Cools.isEmpty(flowLog) || null==flowLog.getId()){
+ return R.error();
+ }
+ flowLogService.updateById(flowLog);
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/flowLog/delete/auth")
+ @ManagerAuth
+ public R delete(@RequestParam(value="ids[]") Long[] ids){
+ for (Long id : ids){
+ flowLogService.deleteById(id);
+ }
+ return R.ok();
+ }
+
+ @RequestMapping(value = "/flowLog/export/auth")
+ @ManagerAuth
+ public R export(@RequestBody JSONObject param){
+ EntityWrapper<FlowLog> wrapper = new EntityWrapper<>();
+ List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
+ Map<String, Object> map = excludeTrash(param.getJSONObject("flowLog"));
+ convert(map, wrapper);
+ List<FlowLog> list = flowLogService.selectList(wrapper);
+ return R.ok(exportSupport(list, fields));
+ }
+
+ @RequestMapping(value = "/flowLogQuery/auth")
+ @ManagerAuth
+ public R query(String condition) {
+ EntityWrapper<FlowLog> wrapper = new EntityWrapper<>();
+ wrapper.like("id", condition);
+ Page<FlowLog> page = flowLogService.selectPage(new Page<>(0, 10), wrapper);
+ List<Map<String, Object>> result = new ArrayList<>();
+ for (FlowLog flowLog : page.getRecords()){
+ Map<String, Object> map = new HashMap<>();
+ map.put("id", flowLog.getId());
+ map.put("value", flowLog.getId());
+ result.add(map);
+ }
+ return R.ok(result);
+ }
+
+ @RequestMapping(value = "/flowLog/check/column/auth")
+ @ManagerAuth
+ public R query(@RequestBody JSONObject param) {
+ Wrapper<FlowLog> wrapper = new EntityWrapper<FlowLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
+ if (null != flowLogService.selectOne(wrapper)){
+ return R.parse(BaseRes.REPEAT).add(getComment(FlowLog.class, String.valueOf(param.get("key"))));
+ }
+ return R.ok();
+ }
+
+}
diff --git a/src/main/java/com/zy/asrs/entity/FlowLog.java b/src/main/java/com/zy/asrs/entity/FlowLog.java
new file mode 100644
index 0000000..18c4dcd
--- /dev/null
+++ b/src/main/java/com/zy/asrs/entity/FlowLog.java
@@ -0,0 +1,262 @@
+package com.zy.asrs.entity;
+
+import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.baomidou.mybatisplus.annotations.TableField;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotations.TableName;
+import java.io.Serializable;
+
+@Data
+@TableName("man_flow_log")
+public class FlowLog implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 鏁版嵁缂栧彿
+ */
+ @ApiModelProperty(value= "鏁版嵁缂栧彿")
+ @TableId(value = "id", type = IdType.INPUT)
+ private Long id;
+
+ /**
+ * 娴佹按鍙�
+ */
+ @ApiModelProperty(value= "娴佹按鍙�")
+ private String fid;
+
+ /**
+ * 鎿嶄綔绫诲瀷
+ */
+ @ApiModelProperty(value= "鎿嶄綔绫诲瀷")
+ @TableField("op_type")
+ private Long opType;
+
+ /**
+ * 璁㈠崟鍙�
+ */
+ @ApiModelProperty(value= "璁㈠崟鍙�")
+ @TableField("order_no")
+ private String orderNo;
+
+ /**
+ * 閿�鍞崟鍙�
+ */
+ @ApiModelProperty(value= "閿�鍞崟鍙�")
+ @TableField("three_code")
+ private String threeCode;
+
+ /**
+ * 搴撲綅鍙�
+ */
+ @ApiModelProperty(value= "搴撲綅鍙�")
+ @TableField("loc_no")
+ private String locNo;
+
+ /**
+ * 鐗╂枡鍙�
+ */
+ @ApiModelProperty(value= "鐗╂枡鍙�")
+ private String matnr;
+
+ /**
+ * 鐗╂枡鍚嶇О
+ */
+ @ApiModelProperty(value= "鐗╂枡鍚嶇О")
+ private String maktx;
+
+ /**
+ * 璁㈠崟鏁伴噺鍙樻洿鍓�
+ */
+ @ApiModelProperty(value= "璁㈠崟鏁伴噺鍙樻洿鍓�")
+ @TableField("order_previous")
+ private Double orderPrevious;
+
+ /**
+ * 璁㈠崟鏁伴噺鍙樻洿鍚�
+ */
+ @ApiModelProperty(value= "璁㈠崟鏁伴噺鍙樻洿鍚�")
+ @TableField("order_current")
+ private Double orderCurrent;
+
+ /**
+ * 璁㈠崟鏁伴噺鍙樻洿
+ */
+ @ApiModelProperty(value= "璁㈠崟鏁伴噺鍙樻洿")
+ @TableField("order_changed")
+ private Double orderChanged;
+
+ /**
+ * 浣滀笟鏁伴噺鍙樻洿鍓�
+ */
+ @ApiModelProperty(value= "浣滀笟鏁伴噺鍙樻洿鍓�")
+ @TableField("qty_previous")
+ private Double qtyPrevious;
+
+ /**
+ * 浣滀笟鏁伴噺鍙樻洿鍚�
+ */
+ @ApiModelProperty(value= "浣滀笟鏁伴噺鍙樻洿鍚�")
+ @TableField("qty_current")
+ private Double qtyCurrent;
+
+ /**
+ * 浣滀笟鏁伴噺鍙樻洿
+ */
+ @ApiModelProperty(value= "浣滀笟鏁伴噺鍙樻洿")
+ @TableField("qty_changed")
+ private Double qtyChanged;
+
+ /**
+ * 鍙樻洿鍓嶆暟閲�
+ */
+ @ApiModelProperty(value= "鍙樻洿鍓嶆暟閲�")
+ @TableField("loc_previous")
+ private Double locPrevious;
+
+ /**
+ * 鍙樻洿鍚庢暟閲�
+ */
+ @ApiModelProperty(value= "鍙樻洿鍚庢暟閲�")
+ @TableField("loc_current")
+ private Double locCurrent;
+
+ /**
+ * 鍙樻洿鍊�
+ */
+ @ApiModelProperty(value= "鍙樻洿鍊�")
+ @TableField("loc_changed")
+ private Double locChanged;
+
+ /**
+ * 澶囩敤1
+ */
+ @ApiModelProperty(value= "澶囩敤1")
+ private String spare1;
+
+ /**
+ * 澶囩敤2
+ */
+ @ApiModelProperty(value= "澶囩敤2")
+ private String spare2;
+
+ /**
+ * 澶囩敤3
+ */
+ @ApiModelProperty(value= "澶囩敤3")
+ private String spare3;
+
+ /**
+ * 澶囩敤4
+ */
+ @ApiModelProperty(value= "澶囩敤4")
+ private String spare4;
+
+ /**
+ * 澶囩敤5
+ */
+ @ApiModelProperty(value= "澶囩敤5")
+ private String spare5;
+
+ /**
+ * 鎿嶄綔鍛�
+ */
+ @ApiModelProperty(value= "鎿嶄綔鍛�")
+ @TableField("user_id")
+ private Long userId;
+
+ /**
+ * 鏇存柊鏃堕棿
+ */
+ @ApiModelProperty(value= "鏇存柊鏃堕棿")
+ @TableField("appe_time")
+ @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+ private Date appeTime;
+
+ public FlowLog() {}
+
+ public FlowLog(Long id,String fid,Long opType,String orderNo,String threeCode,String locNo,String matnr,String maktx,Double orderPrevious,Double orderCurrent,Double orderChanged,Double qtyPrevious,Double qtyCurrent,Double qtyChanged,Double locPrevious,Double locCurrent,Double locChanged,String spare1,String spare2,String spare3,String spare4,String spare5,Long userId,Date appeTime) {
+ this.id = id;
+ this.fid = fid;
+ this.opType = opType;
+ this.orderNo = orderNo;
+ this.threeCode = threeCode;
+ this.locNo = locNo;
+ this.matnr = matnr;
+ this.maktx = maktx;
+ this.orderPrevious = orderPrevious;
+ this.orderCurrent = orderCurrent;
+ this.orderChanged = orderChanged;
+ this.qtyPrevious = qtyPrevious;
+ this.qtyCurrent = qtyCurrent;
+ this.qtyChanged = qtyChanged;
+ this.locPrevious = locPrevious;
+ this.locCurrent = locCurrent;
+ this.locChanged = locChanged;
+ this.spare1 = spare1;
+ this.spare2 = spare2;
+ this.spare3 = spare3;
+ this.spare4 = spare4;
+ this.spare5 = spare5;
+ this.userId = userId;
+ this.appeTime = appeTime;
+ }
+
+// FlowLog flowLog = new FlowLog(
+// null, // 鏁版嵁缂栧彿[闈炵┖]
+// null, // 娴佹按鍙�
+// null, // 鎿嶄綔绫诲瀷
+// null, // 璁㈠崟鍙�
+// null, // 閿�鍞崟鍙�
+// null, // 搴撲綅鍙�
+// null, // 鐗╂枡鍙�
+// null, // 鐗╂枡鍚嶇О
+// null, // 璁㈠崟鏁伴噺鍙樻洿鍓�
+// null, // 璁㈠崟鏁伴噺鍙樻洿鍚�
+// null, // 璁㈠崟鏁伴噺鍙樻洿
+// null, // 浣滀笟鏁伴噺鍙樻洿鍓�
+// null, // 浣滀笟鏁伴噺鍙樻洿鍚�
+// null, // 浣滀笟鏁伴噺鍙樻洿
+// null, // 鍙樻洿鍓嶆暟閲�
+// null, // 鍙樻洿鍚庢暟閲�
+// null, // 鍙樻洿鍊�
+// null, // 澶囩敤1
+// null, // 澶囩敤2
+// null, // 澶囩敤3
+// null, // 澶囩敤4
+// null, // 澶囩敤5
+// null, // 鎿嶄綔鍛�
+// null // 鏇存柊鏃堕棿
+// );
+
+ public String getAppeTime$(){
+ if (Cools.isEmpty(this.appeTime)){
+ return "";
+ }
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime);
+ }
+
+ public String getOpType$() {
+ String otp = "";
+ if (this.opType == 1L) {
+ otp = "1";
+ } else if (this.opType == 2L) {
+ otp = "2";
+ } else if (this.opType == 3L) {
+ otp = "3";
+ } else if (this.opType == 3L) {
+ otp = "3";
+ } else if (this.opType == 3L) {
+ otp = "3";
+ }
+ return "";
+ }
+
+
+}
diff --git a/src/main/java/com/zy/asrs/mapper/FlowLogMapper.java b/src/main/java/com/zy/asrs/mapper/FlowLogMapper.java
new file mode 100644
index 0000000..6d70ecf
--- /dev/null
+++ b/src/main/java/com/zy/asrs/mapper/FlowLogMapper.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.mapper;
+
+import com.zy.asrs.entity.FlowLog;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface FlowLogMapper extends BaseMapper<FlowLog> {
+
+}
diff --git a/src/main/java/com/zy/asrs/service/FlowLogService.java b/src/main/java/com/zy/asrs/service/FlowLogService.java
new file mode 100644
index 0000000..021c881
--- /dev/null
+++ b/src/main/java/com/zy/asrs/service/FlowLogService.java
@@ -0,0 +1,8 @@
+package com.zy.asrs.service;
+
+import com.zy.asrs.entity.FlowLog;
+import com.baomidou.mybatisplus.service.IService;
+
+public interface FlowLogService extends IService<FlowLog> {
+
+}
diff --git a/src/main/java/com/zy/asrs/service/impl/FlowLogServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/FlowLogServiceImpl.java
new file mode 100644
index 0000000..c162c5b
--- /dev/null
+++ b/src/main/java/com/zy/asrs/service/impl/FlowLogServiceImpl.java
@@ -0,0 +1,12 @@
+package com.zy.asrs.service.impl;
+
+import com.zy.asrs.mapper.FlowLogMapper;
+import com.zy.asrs.entity.FlowLog;
+import com.zy.asrs.service.FlowLogService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+@Service("flowLogService")
+public class FlowLogServiceImpl extends ServiceImpl<FlowLogMapper, FlowLog> implements FlowLogService {
+
+}
diff --git a/src/main/java/com/zy/common/CodeBuilder.java b/src/main/java/com/zy/common/CodeBuilder.java
index 7cb5735..5aed57d 100644
--- a/src/main/java/com/zy/common/CodeBuilder.java
+++ b/src/main/java/com/zy/common/CodeBuilder.java
@@ -20,7 +20,7 @@
generator.url="127.0.0.1:1433;databasename=phyzasrs";
generator.username="sa";
generator.password="sa@123";
- generator.table="agv_wrk_log";
+ generator.table="man_flow_log";
generator.packagePath="com.zy.asrs";
generator.sql = false;
generator.build();
diff --git a/src/main/resources/mapper/FlowLogMapper.xml b/src/main/resources/mapper/FlowLogMapper.xml
new file mode 100644
index 0000000..e9246cd
--- /dev/null
+++ b/src/main/resources/mapper/FlowLogMapper.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zy.asrs.mapper.FlowLogMapper">
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="com.zy.asrs.entity.FlowLog">
+ <result column="id" property="id" />
+ <result column="fid" property="fid" />
+ <result column="op_type" property="opType" />
+ <result column="order_no" property="orderNo" />
+ <result column="three_code" property="threeCode" />
+ <result column="loc_no" property="locNo" />
+ <result column="matnr" property="matnr" />
+ <result column="maktx" property="maktx" />
+ <result column="order_previous" property="orderPrevious" />
+ <result column="order_current" property="orderCurrent" />
+ <result column="order_changed" property="orderChanged" />
+ <result column="qty_previous" property="qtyPrevious" />
+ <result column="qty_current" property="qtyCurrent" />
+ <result column="qty_changed" property="qtyChanged" />
+ <result column="loc_previous" property="locPrevious" />
+ <result column="loc_current" property="locCurrent" />
+ <result column="loc_changed" property="locChanged" />
+ <result column="spare1" property="spare1" />
+ <result column="spare2" property="spare2" />
+ <result column="spare3" property="spare3" />
+ <result column="spare4" property="spare4" />
+ <result column="spare5" property="spare5" />
+ <result column="user_id" property="userId" />
+ <result column="appe_time" property="appeTime" />
+
+ </resultMap>
+
+</mapper>
diff --git a/src/main/webapp/static/js/flowLog/flowLog.js b/src/main/webapp/static/js/flowLog/flowLog.js
new file mode 100644
index 0000000..c16df4a
--- /dev/null
+++ b/src/main/webapp/static/js/flowLog/flowLog.js
@@ -0,0 +1,273 @@
+var pageCurr;
+layui.config({
+ base: baseUrl + "/static/layui/lay/modules/"
+}).use(['table','laydate', 'form', 'admin'], function(){
+ var table = layui.table;
+ var $ = layui.jquery;
+ var layer = layui.layer;
+ var layDate = layui.laydate;
+ var form = layui.form;
+ var admin = layui.admin;
+
+ // 鏁版嵁娓叉煋
+ tableIns = table.render({
+ elem: '#flowLog',
+ headers: {token: localStorage.getItem('token')},
+ url: baseUrl+'/flowLog/list/auth',
+ page: true,
+ limit: 15,
+ limits: [15, 30, 50, 100, 200, 500],
+ toolbar: '#toolbar',
+ cellMinWidth: 50,
+ height: 'full-120',
+ cols: [[
+ {type: 'checkbox'}
+ ,{field: 'id', align: 'center',title: '鏁版嵁缂栧彿',hide: true}
+ ,{field: 'fid', align: 'center',title: '娴佹按鍙�'}
+ ,{field: 'opType', align: 'center',title: '鎿嶄綔绫诲瀷'}
+ ,{field: 'orderNo', align: 'center',title: '璁㈠崟鍙�'}
+ ,{field: 'threeCode', align: 'center',title: '閿�鍞崟鍙�'}
+ ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�'}
+ ,{field: 'matnr', align: 'center',title: '鐗╂枡鍙�'}
+ ,{field: 'maktx', align: 'center',title: '鐗╂枡鍚嶇О'}
+ ,{field: 'orderPrevious', align: 'center',title: '璁㈠崟鏁伴噺鍙樻洿鍓�'}
+ ,{field: 'orderCurrent', align: 'center',title: '璁㈠崟鏁伴噺鍙樻洿鍚�'}
+ ,{field: 'orderChanged', align: 'center',title: '璁㈠崟鏁伴噺鍙樻洿'}
+ ,{field: 'qtyPrevious', align: 'center',title: '浣滀笟鏁伴噺鍙樻洿鍓�'}
+ ,{field: 'qtyCurrent', align: 'center',title: '浣滀笟鏁伴噺鍙樻洿鍚�'}
+ ,{field: 'qtyChanged', align: 'center',title: '浣滀笟鏁伴噺鍙樻洿'}
+ ,{field: 'locPrevious', align: 'center',title: '鍙樻洿鍓嶆暟閲�'}
+ ,{field: 'locCurrent', align: 'center',title: '鍙樻洿鍚庢暟閲�'}
+ ,{field: 'locChanged', align: 'center',title: '鍙樻洿鍊�'}
+ ,{field: 'spare1', align: 'center',title: '澶囩敤1',hide: true}
+ ,{field: 'spare2', align: 'center',title: '澶囩敤2',hide: true}
+ ,{field: 'spare3', align: 'center',title: '澶囩敤3',hide: true}
+ ,{field: 'spare4', align: 'center',title: '澶囩敤4',hide: true}
+ ,{field: 'spare5', align: 'center',title: '澶囩敤5',hide: true}
+ ,{field: 'userId', align: 'center',title: '鎿嶄綔鍛�'}
+ ,{field: 'appeTime$', align: 'center',title: '鏇存柊鏃堕棿'}
+
+ ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120,hide: true}
+ ]],
+ request: {
+ pageName: 'curr',
+ pageSize: 'limit'
+ },
+ parseData: function (res) {
+ return {
+ 'code': res.code,
+ 'msg': res.msg,
+ 'count': res.data.total,
+ 'data': res.data.records
+ }
+ },
+ response: {
+ statusCode: 200
+ },
+ done: function(res, curr, count) {
+ if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ }
+ pageCurr=curr;
+ limit();
+ }
+ });
+
+ // 鐩戝惉鎺掑簭浜嬩欢
+ table.on('sort(flowLog)', function (obj) {
+ var searchData = {};
+ $.each($('#search-box [name]').serializeArray(), function() {
+ searchData[this.name] = this.value;
+ });
+ searchData['orderByField'] = obj.field;
+ searchData['orderByType'] = obj.type;
+ tableIns.reload({
+ where: searchData,
+ page: {curr: 1}
+ });
+ });
+
+ // 鐩戝惉澶村伐鍏锋爮浜嬩欢
+ table.on('toolbar(flowLog)', function (obj) {
+ var checkStatus = table.checkStatus(obj.config.id).data;
+ switch(obj.event) {
+ case 'addData':
+ showEditModel();
+ break;
+ case 'deleteData':
+ if (checkStatus.length === 0) {
+ layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+ return;
+ }
+ del(checkStatus.map(function (d) {
+ return d.id;
+ }));
+ break;
+ case 'exportData':
+ admin.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+ var titles=[];
+ var fields=[];
+ obj.config.cols[0].map(function (col) {
+ if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
+ titles.push(col.title);
+ fields.push(col.field);
+ }
+ });
+ var exportData = {};
+ $.each($('#search-box [name]').serializeArray(), function() {
+ exportData[this.name] = this.value;
+ });
+ var param = {
+ 'flowLog': exportData,
+ 'fields': fields
+ };
+ $.ajax({
+ url: baseUrl+"/flowLog/export/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: JSON.stringify(param),
+ dataType:'json',
+ contentType:'application/json;charset=UTF-8',
+ method: 'POST',
+ success: function (res) {
+ layer.closeAll();
+ if (res.code === 200) {
+ table.exportFile(titles,res.data,'xls');
+ } else if (res.code === 403) {
+ top.location.href = baseUrl+"/";
+ } else {
+ layer.msg(res.msg, {icon: 2})
+ }
+ }
+ });
+ });
+ break;
+ }
+ });
+
+ // 鐩戝惉琛屽伐鍏蜂簨浠�
+ table.on('tool(flowLog)', function(obj){
+ var data = obj.data;
+ switch (obj.event) {
+ case 'edit':
+ showEditModel(data);
+ break;
+ case "del":
+ del([data.id]);
+ break;
+ }
+ });
+
+ /* 寮圭獥 - 鏂板銆佷慨鏀� */
+ function showEditModel(mData) {
+ admin.open({
+ type: 1,
+ area: '600px',
+ title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+ content: $('#editDialog').html(),
+ success: function (layero, dIndex) {
+ layDateRender(mData);
+ form.val('detail', mData);
+ form.on('submit(editSubmit)', function (data) {
+ var loadIndex = layer.load(2);
+ $.ajax({
+ url: baseUrl+"/flowLog/"+(mData?'update':'add')+"/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: data.field,
+ method: 'POST',
+ success: function (res) {
+ layer.close(loadIndex);
+ if (res.code === 200){
+ layer.close(dIndex);
+ layer.msg(res.msg, {icon: 1});
+ tableReload();
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ return false;
+ });
+ $(layero).children('.layui-layer-content').css('overflow', 'visible');
+ layui.form.render('select');
+ }
+ });
+ }
+
+ /* 鍒犻櫎 */
+ function del(ids) {
+ layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
+ skin: 'layui-layer-admin',
+ shade: .1
+ }, function (i) {
+ layer.close(i);
+ var loadIndex = layer.load(2);
+ $.ajax({
+ url: baseUrl+"/flowLog/delete/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {ids: ids},
+ method: 'POST',
+ success: function (res) {
+ layer.close(loadIndex);
+ if (res.code === 200){
+ layer.msg(res.msg, {icon: 1});
+ tableReload();
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ } else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ });
+ }
+
+ // 鎼滅储
+ form.on('submit(search)', function (data) {
+ pageCurr = 1;
+ tableReload(false);
+ });
+
+ // 閲嶇疆
+ form.on('submit(reset)', function (data) {
+ pageCurr = 1;
+ clearFormVal($('#search-box'));
+ tableReload(false);
+ });
+
+ // 鏃堕棿閫夋嫨鍣�
+ function layDateRender(data) {
+ setTimeout(function () {
+ layDate.render({
+ elem: '.layui-laydate-range'
+ ,type: 'datetime'
+ ,range: true
+ });
+ layDate.render({
+ elem: '#appeTime\\$',
+ type: 'datetime',
+ value: data!==undefined?data['appeTime\\$']:null
+ });
+
+ }, 300);
+ }
+ layDateRender();
+
+});
+
+// 鍏抽棴鍔ㄤ綔
+$(document).on('click','#data-detail-close', function () {
+ parent.layer.closeAll();
+});
+
+function tableReload(child) {
+ var searchData = {};
+ $.each($('#search-box [name]').serializeArray(), function() {
+ searchData[this.name] = this.value;
+ });
+ tableIns.reload({
+ where: searchData,
+ page: {curr: pageCurr}
+ });
+}
diff --git a/src/main/webapp/views/flowLog/flowLog.html b/src/main/webapp/views/flowLog/flowLog.html
new file mode 100644
index 0000000..c02584b
--- /dev/null
+++ b/src/main/webapp/views/flowLog/flowLog.html
@@ -0,0 +1,230 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title></title>
+ <meta name="renderer" content="webkit">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+ <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+ <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
+ <link rel="stylesheet" href="../../static/css/cool.css" media="all">
+</head>
+<body>
+
+<div class="layui-fluid">
+ <div class="layui-card">
+ <div class="layui-card-body">
+ <div class="layui-form toolbar" id="search-box">
+ <div class="layui-form-item">
+ <div class="layui-inline">
+ <div class="layui-input-inline">
+ <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">
+ </div>
+ </div>
+ <div class="layui-inline" style="width: 300px">
+ <div class="layui-input-inline">
+ <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="璧峰鏃堕棿 - 缁堟鏃堕棿" autocomplete="off" style="width: 300px">
+ </div>
+ </div>
+ <div class="layui-inline">
+ <div class="layui-input-inline">
+ <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
+ </div>
+ </div>
+ <div class="layui-inline"> 
+ <button class="layui-btn icon-btn" lay-filter="search" lay-submit>
+ <i class="layui-icon"></i>鎼滅储
+ </button>
+ <button class="layui-btn icon-btn" lay-filter="reset" lay-submit>
+ <i class="layui-icon"></i>閲嶇疆
+ </button>
+ </div>
+ </div>
+ </div>
+ <table class="layui-hide" id="flowLog" lay-filter="flowLog"></table>
+ </div>
+ </div>
+</div>
+
+<script type="text/html" id="toolbar">
+ <div class="layui-btn-container">
+<!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>-->
+<!-- <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>-->
+<!-- <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">瀵煎嚭</button>-->
+ </div>
+</script>
+
+<script type="text/html" id="operate">
+ <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a>
+ <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
+</script>
+
+<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/flowLog/flowLog.js" charset="utf-8"></script>
+</body>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="editDialog">
+ <form id="detail" lay-filter="detail" class="layui-form admin-form model-form">
+ <input name="id" type="hidden">
+ <div class="layui-row">
+ <div class="layui-col-md12">
+ <div class="layui-form-item">
+ <label class="layui-form-label layui-form-required">鏁版嵁缂栧彿: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="id" placeholder="璇疯緭鍏ユ暟鎹紪鍙�" lay-vertype="tips" lay-verify="required">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">娴佹按鍙�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="fid" placeholder="璇疯緭鍏ユ祦姘村彿">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鎿嶄綔绫诲瀷: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="opType" placeholder="璇疯緭鍏ユ搷浣滅被鍨�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">璁㈠崟鍙�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="orderNo" placeholder="璇疯緭鍏ヨ鍗曞彿">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">閿�鍞崟鍙�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="threeCode" placeholder="璇疯緭鍏ラ攢鍞崟鍙�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">搴撲綅鍙�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="locNo" placeholder="璇疯緭鍏ュ簱浣嶅彿">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鐗╂枡鍙�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="matnr" placeholder="璇疯緭鍏ョ墿鏂欏彿">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鐗╂枡鍚嶇О: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="maktx" placeholder="璇疯緭鍏ョ墿鏂欏悕绉�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">璁㈠崟鏁伴噺鍙樻洿鍓�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="orderPrevious" placeholder="璇疯緭鍏ヨ鍗曟暟閲忓彉鏇村墠">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">璁㈠崟鏁伴噺鍙樻洿鍚�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="orderCurrent" placeholder="璇疯緭鍏ヨ鍗曟暟閲忓彉鏇村悗">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">璁㈠崟鏁伴噺鍙樻洿: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="orderChanged" placeholder="璇疯緭鍏ヨ鍗曟暟閲忓彉鏇�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">浣滀笟鏁伴噺鍙樻洿鍓�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="qtyPrevious" placeholder="璇疯緭鍏ヤ綔涓氭暟閲忓彉鏇村墠">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">浣滀笟鏁伴噺鍙樻洿鍚�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="qtyCurrent" placeholder="璇疯緭鍏ヤ綔涓氭暟閲忓彉鏇村悗">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">浣滀笟鏁伴噺鍙樻洿: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="qtyChanged" placeholder="璇疯緭鍏ヤ綔涓氭暟閲忓彉鏇�">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鍙樻洿鍓嶆暟閲�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="locPrevious" placeholder="璇疯緭鍏ュ彉鏇村墠鏁伴噺">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鍙樻洿鍚庢暟閲�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="locCurrent" placeholder="璇疯緭鍏ュ彉鏇村悗鏁伴噺">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鍙樻洿鍊�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="locChanged" placeholder="璇疯緭鍏ュ彉鏇村��">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">澶囩敤1: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="spare1" placeholder="璇疯緭鍏ュ鐢�1">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">澶囩敤2: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="spare2" placeholder="璇疯緭鍏ュ鐢�2">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">澶囩敤3: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="spare3" placeholder="璇疯緭鍏ュ鐢�3">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">澶囩敤4: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="spare4" placeholder="璇疯緭鍏ュ鐢�4">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">澶囩敤5: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="spare5" placeholder="璇疯緭鍏ュ鐢�5">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鎿嶄綔鍛�: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="userId" placeholder="璇疯緭鍏ユ搷浣滃憳">
+ </div>
+ </div>
+ <div class="layui-form-item">
+ <label class="layui-form-label">鏇存柊鏃堕棿: </label>
+ <div class="layui-input-block">
+ <input class="layui-input" name="appeTime" id="appeTime$" placeholder="璇疯緭鍏ユ洿鏂版椂闂�">
+ </div>
+ </div>
+
+ </div>
+ </div>
+ <hr class="layui-bg-gray">
+ <div class="layui-form-item text-right">
+ <button class="layui-btn" lay-filter="editSubmit" lay-submit="">淇濆瓨</button>
+ <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+ </div>
+ </form>
+</script>
+</html>
+
--
Gitblit v1.9.1