懒羊羊
2023-12-12 b26949b3738a7eb34f8550a073d8d3b03c2fbf3e
大屏
已修改1个文件
已添加18个文件
1751 ■■■■■ 文件已修改
guns-base-support/guns-sys/src/main/java/cn/stylefeng/guns/sys/core/auth/filter/NoneAuthedResources.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/controller/GreaseManageController.java 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/entity/GreaseManage.java 191 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/mapper/GreaseManageMapper.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/mapper/mapping/GreaseManageMapper.xml 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/model/params/GreaseManageParam.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/model/result/GreaseManageResult.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/service/GreaseManageService.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/service/impl/GreaseManageServiceImpl.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/kb/greaseBoard/GreaseBoardController.java 278 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/sqls/greaseManage_menus.sql 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/gm/greaseManage/greaseManage.js 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/gm/greaseManage/greaseManage_add.js 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/gm/greaseManage/greaseManage_edit.js 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/assets/modular/kb/greaseBoard/greaseBoard.js 269 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/pages/modular/gm/greaseManage/greaseManage.html 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/pages/modular/gm/greaseManage/greaseManage_add.html 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/pages/modular/gm/greaseManage/greaseManage_edit.html 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-vip-main/src/main/webapp/pages/modular/kb/greaseBoard/greaseBoard.html 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-base-support/guns-sys/src/main/java/cn/stylefeng/guns/sys/core/auth/filter/NoneAuthedResources.java
@@ -73,6 +73,7 @@
            "/websocket/**",
            "/equipmentStatus/**",
            "/equipmentAlarm/**",
            "/greaseBoard/**",
    };
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/controller/GreaseManageController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,129 @@
package cn.stylefeng.guns.modular.gm.greaseManage.controller;
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.gm.greaseManage.entity.GreaseManage;
import cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam;
import cn.stylefeng.guns.modular.gm.greaseManage.service.GreaseManageService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.kernel.model.response.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * æ²¹è„‚管理控制器
 *
 * @author ruimin
 * @Date 2023-12-11 14:28:02
 */
@Controller
@RequestMapping("/greaseManage")
public class GreaseManageController extends BaseController {
    private String PREFIX = "/modular/gm/greaseManage";
    @Autowired
    private GreaseManageService greaseManageService;
    /**
     * è·³è½¬åˆ°ä¸»é¡µé¢
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/greaseManage.html";
    }
    /**
     * æ–°å¢žé¡µé¢
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @RequestMapping("/add")
    public String add() {
        return PREFIX + "/greaseManage_add.html";
    }
    /**
     * ç¼–辑页面
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @RequestMapping("/edit")
    public String edit() {
        return PREFIX + "/greaseManage_edit.html";
    }
    /**
     * æ–°å¢žæŽ¥å£
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @RequestMapping("/addItem")
    @ResponseBody
    public ResponseData addItem(GreaseManageParam greaseManageParam) {
        this.greaseManageService.add(greaseManageParam);
        return ResponseData.success();
    }
    /**
     * ç¼–辑接口
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @RequestMapping("/editItem")
    @ResponseBody
    public ResponseData editItem(GreaseManageParam greaseManageParam) {
        this.greaseManageService.update(greaseManageParam);
        return ResponseData.success();
    }
    /**
     * åˆ é™¤æŽ¥å£
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @RequestMapping("/delete")
    @ResponseBody
    public ResponseData delete(GreaseManageParam greaseManageParam) {
        this.greaseManageService.delete(greaseManageParam);
        return ResponseData.success();
    }
    /**
     * æŸ¥çœ‹è¯¦æƒ…接口
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @RequestMapping("/detail")
    @ResponseBody
    public ResponseData detail(GreaseManageParam greaseManageParam) {
        GreaseManage detail = this.greaseManageService.getById(greaseManageParam.getId());
        return ResponseData.success(detail);
    }
    /**
     * æŸ¥è¯¢åˆ—表
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    @ResponseBody
    @RequestMapping("/list")
    public LayuiPageInfo list(GreaseManageParam greaseManageParam) {
        return this.greaseManageService.findPageBySpec(greaseManageParam);
    }
}
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/entity/GreaseManage.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,191 @@
package cn.stylefeng.guns.modular.gm.greaseManage.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
/**
 * <p>
 * æ²¹è„‚管理
 * </p>
 *
 * @author ruimin
 * @since 2023-12-11
 */
@TableName("gm_grease_manage")
public class GreaseManage implements Serializable {
    private static final long serialVersionUID=1L;
    /**
     * ä¸»é”®id
     */
      @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;
    /**
     * æ‰«ç æ¡ç 
     */
    @TableField("barcode")
    private String barcode;
    /**
     * å·¥ä½
     */
    @TableField("location_code")
    private String locationCode;
    /**
     * åˆ°æœŸæ—¶é—´
     */
    @TableField("dua_date")
    private String duaDate;
    /**
     * çŠ¶æ€
     */
    @TableField("state")
    private String state;
    @TableField(exist = false)
    private String daysRemaining;
    /**
     * æ›´æ–°ç”¨æˆ·
     */
      @TableField(value = "create_user", fill = FieldFill.INSERT)
    private String createUser;
    /**
     * æ›´æ–°æ—¶é—´
     */
      @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * å¤‡æ³¨
     */
    @TableField("remarks")
    private String remarks;
    /**
     * é¢„留字段1
     */
    @TableField("spare_field_1")
    private String spareField1;
    /**
     * é¢„留字段2
     */
    @TableField("spare_field_2")
    private String spareField2;
    public String getDaysRemaining() {
        return daysRemaining;
    }
    public void setDaysRemaining(String daysRemaining) {
        this.daysRemaining = daysRemaining;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getBarcode() {
        return barcode;
    }
    public void setBarcode(String barcode) {
        this.barcode = barcode;
    }
    public String getLocationCode() {
        return locationCode;
    }
    public void setLocationCode(String locationCode) {
        this.locationCode = locationCode;
    }
    public String getDuaDate() {
        return duaDate;
    }
    public void setDuaDate(String duaDate) {
        this.duaDate = duaDate;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public String getRemarks() {
        return remarks;
    }
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    public String getSpareField1() {
        return spareField1;
    }
    public void setSpareField1(String spareField1) {
        this.spareField1 = spareField1;
    }
    public String getSpareField2() {
        return spareField2;
    }
    public void setSpareField2(String spareField2) {
        this.spareField2 = spareField2;
    }
    @Override
    public String toString() {
        return "GreaseManage{" +
        "id=" + id +
        ", barcode=" + barcode +
        ", locationCode=" + locationCode +
        ", duaDate=" + duaDate +
        ", state=" + state +
        ", createUser=" + createUser +
        ", createTime=" + createTime +
        ", remarks=" + remarks +
        ", spareField1=" + spareField1 +
        ", spareField2=" + spareField2 +
        "}";
    }
}
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/mapper/GreaseManageMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
package cn.stylefeng.guns.modular.gm.greaseManage.mapper;
import cn.stylefeng.guns.modular.gm.greaseManage.entity.GreaseManage;
import cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam;
import cn.stylefeng.guns.modular.gm.greaseManage.model.result.GreaseManageResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * <p>
 * æ²¹è„‚管理 Mapper æŽ¥å£
 * </p>
 *
 * @author ruimin
 * @since 2023-12-11
 */
public interface GreaseManageMapper extends BaseMapper<GreaseManage> {
    /**
     * èŽ·å–列表
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    List<GreaseManageResult> customList(@Param("paramCondition") GreaseManageParam paramCondition);
    /**
     * èŽ·å–map列表
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") GreaseManageParam paramCondition);
    /**
     * èŽ·å–分页实体列表
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    Page<GreaseManageResult> customPageList(@Param("page") Page page, @Param("paramCondition") GreaseManageParam paramCondition);
    /**
     * èŽ·å–分页map列表
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") GreaseManageParam paramCondition);
}
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/mapper/mapping/GreaseManageMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,49 @@
<?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="cn.stylefeng.guns.modular.gm.greaseManage.mapper.GreaseManageMapper">
    <!-- é€šç”¨æŸ¥è¯¢æ˜ å°„结果 -->
    <resultMap id="BaseResultMap" type="cn.stylefeng.guns.modular.gm.greaseManage.entity.GreaseManage">
        <id column="id" property="id" />
        <result column="barcode" property="barcode" />
        <result column="location_code" property="locationCode" />
        <result column="dua_date" property="duaDate" />
        <result column="state" property="state" />
        <result column="create_user" property="createUser" />
        <result column="create_time" property="createTime" />
        <result column="remarks" property="remarks" />
        <result column="spare_field_1" property="spareField1" />
        <result column="spare_field_2" property="spareField2" />
    </resultMap>
    <!-- é€šç”¨æŸ¥è¯¢ç»“果列 -->
    <sql id="Base_Column_List">
        id AS "id", barcode AS "barcode", location_code AS "locationCode", dua_date AS "duaDate", state AS "state", create_user AS "createUser", create_time AS "createTime", remarks AS "remarks", spare_field_1 AS "spareField1", spare_field_2 AS "spareField2"
    </sql>
    <select id="customList" resultType="cn.stylefeng.guns.modular.gm.greaseManage.model.result.GreaseManageResult" parameterType="cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam">
        select
        <include refid="Base_Column_List"/>
        from gm_grease_manage where 1 = 1
    </select>
    <select id="customMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam">
        select
        <include refid="Base_Column_List"/>
        from gm_grease_manage where 1 = 1
    </select>
    <select id="customPageList" resultType="cn.stylefeng.guns.modular.gm.greaseManage.model.result.GreaseManageResult" parameterType="cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam">
        select
        <include refid="Base_Column_List"/>
        from gm_grease_manage where 1 = 1
    </select>
    <select id="customPageMapList" resultType="map" parameterType="cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam">
        select
        <include refid="Base_Column_List"/>
        from gm_grease_manage where 1 = 1
    </select>
</mapper>
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/model/params/GreaseManageParam.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
package cn.stylefeng.guns.modular.gm.greaseManage.model.params;
import lombok.Data;
import cn.stylefeng.roses.kernel.model.validator.BaseValidatingParam;
import java.util.Date;
import java.io.Serializable;
import java.math.BigDecimal;
/**
 * <p>
 * æ²¹è„‚管理
 * </p>
 *
 * @author ruimin
 * @since 2023-12-11
 */
@Data
public class GreaseManageParam implements Serializable, BaseValidatingParam {
    private static final long serialVersionUID = 1L;
    /**
     * ä¸»é”®id
     */
    private Long id;
    /**
     * æ‰«ç æ¡ç 
     */
    private String barcode;
    /**
     * å·¥ä½
     */
    private String locationCode;
    /**
     * åˆ°æœŸæ—¶é—´
     */
    private String duaDate;
    /**
     * çŠ¶æ€
     */
    private String state;
    /**
     * æ›´æ–°ç”¨æˆ·
     */
    private String createUser;
    /**
     * æ›´æ–°æ—¶é—´
     */
    private Date createTime;
    /**
     * å¤‡æ³¨
     */
    private String remarks;
    /**
     * é¢„留字段1
     */
    private String spareField1;
    /**
     * é¢„留字段2
     */
    private String spareField2;
    @Override
    public String checkParam() {
        return null;
    }
}
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/model/result/GreaseManageResult.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,72 @@
package cn.stylefeng.guns.modular.gm.greaseManage.model.result;
import lombok.Data;
import java.util.Date;
import java.io.Serializable;
import java.math.BigDecimal;
/**
 * <p>
 * æ²¹è„‚管理
 * </p>
 *
 * @author ruimin
 * @since 2023-12-11
 */
@Data
public class GreaseManageResult implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ä¸»é”®id
     */
    private Long id;
    /**
     * æ‰«ç æ¡ç 
     */
    private String barcode;
    /**
     * å·¥ä½
     */
    private String locationCode;
    /**
     * åˆ°æœŸæ—¶é—´
     */
    private String duaDate;
    /**
     * çŠ¶æ€
     */
    private String state;
    /**
     * æ›´æ–°ç”¨æˆ·
     */
    private String createUser;
    /**
     * æ›´æ–°æ—¶é—´
     */
    private Date createTime;
    /**
     * å¤‡æ³¨
     */
    private String remarks;
    /**
     * é¢„留字段1
     */
    private String spareField1;
    /**
     * é¢„留字段2
     */
    private String spareField2;
}
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/service/GreaseManageService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package cn.stylefeng.guns.modular.gm.greaseManage.service;
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.gm.greaseManage.entity.GreaseManage;
import cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam;
import cn.stylefeng.guns.modular.gm.greaseManage.model.result.GreaseManageResult;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
 * <p>
 * æ²¹è„‚管理 æœåŠ¡ç±»
 * </p>
 *
 * @author ruimin
 * @since 2023-12-11
 */
public interface GreaseManageService extends IService<GreaseManage> {
    /**
     * æ–°å¢ž
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    void add(GreaseManageParam param);
    /**
     * åˆ é™¤
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    void delete(GreaseManageParam param);
    /**
     * æ›´æ–°
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    void update(GreaseManageParam param);
    /**
     * æŸ¥è¯¢å•æ¡æ•°æ®ï¼ŒSpecification模式
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    GreaseManageResult findBySpec(GreaseManageParam param);
    /**
     * æŸ¥è¯¢åˆ—表,Specification模式
     *
     * @author ruimin
     * @Date 2023-12-11
     */
    List<GreaseManageResult> findListBySpec(GreaseManageParam param);
    /**
     * æŸ¥è¯¢åˆ†é¡µæ•°æ®ï¼ŒSpecification模式
     *
     * @author ruimin
     * @Date 2023-12-11
     */
     LayuiPageInfo findPageBySpec(GreaseManageParam param);
}
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/gm/greaseManage/service/impl/GreaseManageServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,84 @@
package cn.stylefeng.guns.modular.gm.greaseManage.service.impl;
import cn.stylefeng.guns.base.pojo.page.LayuiPageFactory;
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.gm.greaseManage.entity.GreaseManage;
import cn.stylefeng.guns.modular.gm.greaseManage.mapper.GreaseManageMapper;
import cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam;
import cn.stylefeng.guns.modular.gm.greaseManage.model.result.GreaseManageResult;
import  cn.stylefeng.guns.modular.gm.greaseManage.service.GreaseManageService;
import cn.stylefeng.roses.core.util.ToolUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.util.List;
/**
 * <p>
 * æ²¹è„‚管理 æœåŠ¡å®žçŽ°ç±»
 * </p>
 *
 * @author ruimin
 * @since 2023-12-11
 */
@Service
public class GreaseManageServiceImpl extends ServiceImpl<GreaseManageMapper, GreaseManage> implements GreaseManageService {
    @Override
    public void add(GreaseManageParam param){
        GreaseManage entity = getEntity(param);
        this.save(entity);
    }
    @Override
    public void delete(GreaseManageParam param){
        this.removeById(getKey(param));
    }
    @Override
    public void update(GreaseManageParam param){
        GreaseManage oldEntity = getOldEntity(param);
        GreaseManage newEntity = getEntity(param);
        ToolUtil.copyProperties(newEntity, oldEntity);
        this.updateById(newEntity);
    }
    @Override
    public GreaseManageResult findBySpec(GreaseManageParam param){
        return null;
    }
    @Override
    public List<GreaseManageResult> findListBySpec(GreaseManageParam param){
        return null;
    }
    @Override
    public LayuiPageInfo findPageBySpec(GreaseManageParam param){
        Page pageContext = getPageContext();
        IPage page = this.baseMapper.customPageList(pageContext, param);
        return LayuiPageFactory.createPageInfo(page);
    }
    private Serializable getKey(GreaseManageParam param){
        return param.getId();
    }
    private Page getPageContext() {
        return LayuiPageFactory.defaultPage();
    }
    private GreaseManage getOldEntity(GreaseManageParam param) {
        return this.getById(getKey(param));
    }
    private GreaseManage getEntity(GreaseManageParam param) {
        GreaseManage entity = new GreaseManage();
        ToolUtil.copyProperties(param, entity);
        return entity;
    }
}
guns-vip-main/src/main/java/cn/stylefeng/guns/modular/kb/greaseBoard/GreaseBoardController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,278 @@
package cn.stylefeng.guns.modular.kb.greaseBoard;
import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.gm.greaseManage.entity.GreaseManage;
import cn.stylefeng.guns.modular.gm.greaseManage.model.params.GreaseManageParam;
import cn.stylefeng.guns.modular.gm.greaseManage.service.GreaseManageService;
import cn.stylefeng.guns.modular.kb.utils.IPUtil;
import cn.stylefeng.guns.modular.om.productionOrdeInfo.model.result.ProductionOrdeInfoResult;
import cn.stylefeng.guns.modular.sc.kanbanConf.model.params.KanbanConfParam;
import cn.stylefeng.guns.modular.sc.kanbanConf.service.KanbanConfService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.kernel.model.response.ResponseData;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import javafx.stage.Stage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
/**
 * è¿”修上线看板
 *
 * @author cl
 * @Date 2022-10-27 15:50:56
 */
@Controller
@RequestMapping("/greaseBoard")
public class GreaseBoardController extends BaseController {
    private String PREFIX = "modular/kb/greaseBoard";
    @Autowired
    private KanbanConfService kanbanConfService;
    @Autowired
    private GreaseManageService greaseManageService;
    /**
     * è·³è½¬åˆ°ä¸»é¡µé¢
     *
     * @author cl
     * @Date 2022-10-27
     */
    @RequestMapping("")
    public String index() {
        return PREFIX + "/greaseBoard.html";
    }
    /**
     * æ–°å¢žçœ‹æ¿é…ç½®é¡µé¢
     *
     * @author cl
     * @Date 2022-10-31
     */
    @RequestMapping("/add")
    public String add() {
        return PREFIX + "/kanbanConf_add.html";
    }
    /**
     * ç¼–辑页面
     *
     * @author cl
     * @Date 2022-10-31
     */
    @RequestMapping("/edit")
    public String edit() {
        return PREFIX + "/kanbanConf_edit.html";
    }
    @RequestMapping("/orderEdit")
    public String orderEdit() {
        return PREFIX + "/kanbanConf_orderEdit.html";
    }
    /**
     * æ–°å¢žæŽ¥å£
     *
     * @author cl
     * @Date 2022-10-31
     */
    @RequestMapping("/addKanBanConfItem")
    @ResponseBody
    public ResponseData addItem(KanbanConfParam kanbanConfParam, HttpServletRequest request) {
        String realIp = IPUtil.getRealIp(request);
        kanbanConfParam.setIpAddress(realIp);
        kanbanConfParam.setWarehouseCode(kanbanConfParam.getScrapReason());
        kanbanConfParam.setWarehouseName(kanbanConfParam.getScrapCategory());
        this.kanbanConfService.add(kanbanConfParam);
        return ResponseData.success();
    }
    /**
     * æ–°å¢žæŽ¥å£
     * MIGICC17500E00136V250WX23K03A0003B
     * @author cl
     * @Date 2022-10-31
     */
    @RequestMapping("/updategreaseManage")
    @ResponseBody
    public ResponseData updategreaseManage(GreaseManageParam greaseManageParam) {
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
        String currentDate = format.format(new Date());
        String barCode = greaseManageParam.getBarcode();
        String lastTwelveChars = barCode.substring(barCode.length() - 12);
        String locationCode = getLocationCode(lastTwelveChars);
        String DuaDate = getDuaDate(lastTwelveChars);
        GreaseManage greaseManage = new GreaseManage();
        greaseManage.setBarcode(barCode);
        greaseManage.setLocationCode(locationCode);
        greaseManage.setDuaDate(DuaDate);
        greaseManage.setDaysRemaining(getRemainder(currentDate,DuaDate));
        greaseManage.setCreateTime(new Date());
        greaseManage.setCreateUser("admin");
//        greaseManageService.save(greaseManage);
        greaseManageService.update(greaseManage,new LambdaQueryWrapper<GreaseManage>().eq(GreaseManage::getLocationCode, locationCode));
        return ResponseData.success();
    }
    @ResponseBody
    @CrossOrigin
    @RequestMapping("/bigListGreaseBoard")
    public ResponseData orderDescListFive() {
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
        String currentDate = format.format(new Date());
        List list = new ArrayList();
        List<GreaseManage> results = greaseManageService.list();
        for (GreaseManage result : results) {
            String DuaDate = result.getDuaDate();
            String remainder = getRemainder(currentDate, DuaDate);
            if(Integer.valueOf(remainder)<=90){
                List itemList = new ArrayList();
                itemList.add(boldText(result.getLocationCode()));
                itemList.add(boldText(DuaDate));
                itemList.add(boldText(remainder));
                list.add(itemList);
            }else {
                List itemList = new ArrayList();
                itemList.add(whiteBoldText(result.getLocationCode()));
                itemList.add(whiteBoldText(DuaDate));
                itemList.add(whiteBoldText(remainder));
                list.add(itemList);
            }
        }
        return ResponseData.success(list);
    }
    public static String boldText(String param){
        return "<span style='font-size: 20px' class='colorRed'>"+param+"</span>";
    }
    public static String whiteBoldText(String param){
        return "<span style='font-size: 20px'>"+param+"</span>";
    }
    public static void main(String[] args) {
        DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
        SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
        String format1 = format.format(new Date());
        System.out.println("Difference in days: " + getRemainder("20231215",format1));
    }
    public static String getRemainder(String currentDate,String tableDate){
        DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
        LocalDate localDate1 = LocalDate.parse(currentDate, dateFormatter);
        LocalDate localDate2 = LocalDate.parse(tableDate, dateFormatter);
        long days = ChronoUnit.DAYS.between(localDate2, localDate1);
        return String.valueOf(days);
    }
    public static String getDuaDate(String str){
        String year = str.substring(1,3);
        String month = getMonth(str.substring(3,4));
        String day = str.substring(4,6);
        return "20"+year+month+day;
    }
    public static String getLocationCode(String str){
        String locationCode = "";
        switch (str.substring(0,1)) {
            case "X":
                locationCode = "DOP020";
                break;
            case "Y":
                locationCode = "OP050";
                break;
            case "Z":
                locationCode = "BOP30/40";
                break;
            default:
                break;
        }
        return locationCode;
    }
    public static String getMonth(String str){
        String Month = "";
        switch (str) {
            case "A":
                Month = "1";
                break;
            case "B":
                Month = "2";
                break;
            case "C":
                Month = "3";
                break;
            case "D":
                Month = "4";
                break;
            case "E":
                Month = "5";
                break;
            case "F":
                Month = "6";
                break;
            case "G":
                Month = "7";
                break;
            case "H":
                Month = "8";
                break;
            case "I":
                Month = "9";
                break;
            case "J":
                Month = "10";
                break;
            case "K":
                Month = "11";
                break;
            case "L":
                Month = "12";
                break;
            default:
                break;
        }
        return Month;
    }
    /**
     * ç¼–辑接口
     *
     * @author cl
     * @Date 2022-10-31
     */
    @RequestMapping("/editKanBanConfItem")
    @ResponseBody
    public ResponseData editItem(KanbanConfParam kanbanConfParam) {
        this.kanbanConfService.update(kanbanConfParam);
        return ResponseData.success();
    }
    /**
     * æŸ¥è¯¢åˆ—表
     *
     * @author cl
     * @Date 2022-10-31
     */
    @ResponseBody
    @RequestMapping("/qryKBConflist")
    public LayuiPageInfo list(KanbanConfParam kanbanConfParam, HttpServletRequest request) {
        String realIp = IPUtil.getRealIp(request);
        kanbanConfParam.setIpAddress(realIp);
        return this.kanbanConfService.findPageBySpec(kanbanConfParam);
    }
}
guns-vip-main/src/main/sqls/greaseManage_menus.sql
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,4 @@
INSERT INTO `sys_menu`(`MENU_ID`, `CODE`, `PCODE`, `PCODES`, `NAME`, `ICON`, `URL`, `SORT`, `LEVELS`, `MENU_FLAG`, `DESCRIPTION`, `STATUS`, `NEW_PAGE_FLAG`, `OPEN_FLAG`, `SYSTEM_TYPE`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`) VALUES (1734097692785868801, 'GREASE_MANAGE', '0', '[0],', '油脂管理', 'fa-star', '/greaseManage', 999, 1, 'Y', '', 'ENABLE', '', '', 'BASE_SYSTEM', '2023-12-11 14:28:02', '2023-12-11 14:28:02', 1, 1);
INSERT INTO `sys_menu`(`MENU_ID`, `CODE`, `PCODE`, `PCODES`, `NAME`, `ICON`, `URL`, `SORT`, `LEVELS`, `MENU_FLAG`, `DESCRIPTION`, `STATUS`, `NEW_PAGE_FLAG`, `OPEN_FLAG`, `SYSTEM_TYPE`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`) VALUES (1734097692785868802, 'GREASE_MANAGE_ADD', 'GREASE_MANAGE', '[0],[GREASE_MANAGE],', '油脂管理添加', 'fa-star', '', 999, 2, 'N', '', 'ENABLE', '', '', 'BASE_SYSTEM', '2023-12-11 14:28:02', '2023-12-11 14:28:02', 1, 1);
INSERT INTO `sys_menu`(`MENU_ID`, `CODE`, `PCODE`, `PCODES`, `NAME`, `ICON`, `URL`, `SORT`, `LEVELS`, `MENU_FLAG`, `DESCRIPTION`, `STATUS`, `NEW_PAGE_FLAG`, `OPEN_FLAG`, `SYSTEM_TYPE`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`) VALUES (1734097692785868803, 'GREASE_MANAGE_EDIT', 'GREASE_MANAGE', '[0],[GREASE_MANAGE],', '油脂管理修改', 'fa-star', '', 999, 2, 'N', '', 'ENABLE', '', '', 'BASE_SYSTEM', '2023-12-11 14:28:02', '2023-12-11 14:28:02', 1, 1);
INSERT INTO `sys_menu`(`MENU_ID`, `CODE`, `PCODE`, `PCODES`, `NAME`, `ICON`, `URL`, `SORT`, `LEVELS`, `MENU_FLAG`, `DESCRIPTION`, `STATUS`, `NEW_PAGE_FLAG`, `OPEN_FLAG`, `SYSTEM_TYPE`, `CREATE_TIME`, `UPDATE_TIME`, `CREATE_USER`, `UPDATE_USER`) VALUES (1734097692785868804, 'GREASE_MANAGE_DELETE', 'GREASE_MANAGE', '[0],[GREASE_MANAGE],', '油脂管理删除', 'fa-star', '', 999, 2, 'N', '', 'ENABLE', '', '', 'BASE_SYSTEM', '2023-12-11 14:28:02', '2023-12-11 14:28:02', 1, 1);
guns-vip-main/src/main/webapp/assets/modular/gm/greaseManage/greaseManage.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,132 @@
layui.use(['table', 'admin', 'ax', 'func'], function () {
    var $ = layui.$;
    var table = layui.table;
    var $ax = layui.ax;
    var admin = layui.admin;
    var func = layui.func;
    /**
     * æ²¹è„‚管理管理
     */
    var GreaseManage = {
        tableId: "greaseManageTable"
    };
    /**
     * åˆå§‹åŒ–表格的列
     */
    GreaseManage.initColumn = function () {
        return [[
            {type: 'checkbox'},
            {field: 'id', hide: true, title: '主键id'},
            {field: 'barcode', sort: true, title: '扫码条码'},
            {field: 'locationCode', sort: true, title: '工位'},
            {field: 'duaDate', sort: true, title: '到期时间'},
            {field: 'state', sort: true, title: '状态'},
            {field: 'createUser', sort: true, title: '更新用户'},
            {field: 'createTime', sort: true, title: '更新时间'},
            {field: 'remarks', sort: true, title: '备注'},
            {field: 'spareField1', sort: true, title: '预留字段1'},
            {field: 'spareField2', sort: true, title: '预留字段2'},
            {align: 'center', toolbar: '#tableBar', title: '操作'}
        ]];
    };
    /**
     * ç‚¹å‡»æŸ¥è¯¢æŒ‰é’®
     */
    GreaseManage.search = function () {
        var queryData = {};
        table.reload(GreaseManage.tableId, {
            where: queryData, page: {curr: 1}
        });
    };
    /**
     * è·³è½¬åˆ°æ·»åŠ é¡µé¢
     */
    GreaseManage.jumpAddPage = function () {
        window.location.href = Feng.ctxPath + '/greaseManage/add'
    };
    /**
    * è·³è½¬åˆ°ç¼–辑页面
    *
    * @param data ç‚¹å‡»æŒ‰é’®æ—¶å€™çš„行数据
    */
    GreaseManage.jumpEditPage = function (data) {
        window.location.href = Feng.ctxPath + '/greaseManage/edit?id=' + data.id
    };
    /**
     * å¯¼å‡ºexcel按钮
     */
    GreaseManage.exportExcel = function () {
        var checkRows = table.checkStatus(GreaseManage.tableId);
        if (checkRows.data.length === 0) {
            Feng.error("请选择要导出的数据");
        } else {
            table.exportFile(tableResult.config.id, checkRows.data, 'xls');
        }
    };
    /**
     * ç‚¹å‡»åˆ é™¤
     *
     * @param data ç‚¹å‡»æŒ‰é’®æ—¶å€™çš„行数据
     */
    GreaseManage.onDeleteItem = function (data) {
        var operation = function () {
            var ajax = new $ax(Feng.ctxPath + "/greaseManage/delete", function (data) {
                Feng.success("删除成功!");
                table.reload(GreaseManage.tableId);
            }, function (data) {
                Feng.error("删除失败!" + data.responseJSON.message + "!");
            });
            ajax.set("id", data.id);
            ajax.start();
        };
        Feng.confirm("是否删除?", operation);
    };
    // æ¸²æŸ“表格
    var tableResult = table.render({
        elem: '#' + GreaseManage.tableId,
        url: Feng.ctxPath + '/greaseManage/list',
        page: true,
        height: "full-158",
        cellMinWidth: 100,
        cols: GreaseManage.initColumn()
    });
    // æœç´¢æŒ‰é’®ç‚¹å‡»äº‹ä»¶
    $('#btnSearch').click(function () {
        GreaseManage.search();
    });
    // æ·»åŠ æŒ‰é’®ç‚¹å‡»äº‹ä»¶
    $('#btnAdd').click(function () {
    GreaseManage.jumpAddPage();
    });
    // å¯¼å‡ºexcel
    $('#btnExp').click(function () {
        GreaseManage.exportExcel();
    });
    // å·¥å…·æ¡ç‚¹å‡»äº‹ä»¶
    table.on('tool(' + GreaseManage.tableId + ')', function (obj) {
        var data = obj.data;
        var layEvent = obj.event;
        if (layEvent === 'edit') {
            GreaseManage.jumpEditPage(data);
        } else if (layEvent === 'delete') {
            GreaseManage.onDeleteItem(data);
        }
    });
});
guns-vip-main/src/main/webapp/assets/modular/gm/greaseManage/greaseManage_add.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
/**
 * æ·»åŠ æˆ–者修改页面
 */
var GreaseManageInfoDlg = {
    data: {
        id: "",
        barcode: "",
        locationCode: "",
        duaDate: "",
        state: "",
        createUser: "",
        createTime: "",
        remarks: "",
        spareField1: "",
        spareField2: ""
    }
};
layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;
    //表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/greaseManage/addItem", function (data) {
            Feng.success("添加成功!");
            window.location.href = Feng.ctxPath + '/greaseManage'
        }, function (data) {
            Feng.error("添加失败!" + data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();
        return false;
    });
    $('#cancel').click(function(){
        window.location.href = Feng.ctxPath + '/greaseManage'
    });
});
guns-vip-main/src/main/webapp/assets/modular/gm/greaseManage/greaseManage_edit.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
/**
 * è¯¦æƒ…对话框
 */
var GreaseManageInfoDlg = {
    data: {
        id: "",
        barcode: "",
        locationCode: "",
        duaDate: "",
        state: "",
        createUser: "",
        createTime: "",
        remarks: "",
        spareField1: "",
        spareField2: ""
    }
};
layui.use(['form', 'admin', 'ax','laydate','upload','formSelects'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;
    //获取详情信息,填充表单
    var ajax = new $ax(Feng.ctxPath + "/greaseManage/detail?id=" + Feng.getUrlParam("id"));
    var result = ajax.start();
    form.val('greaseManageForm', result.data);
    //表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/greaseManage/editItem", function (data) {
            Feng.success("更新成功!");
            window.location.href = Feng.ctxPath + '/greaseManage'
        }, function (data) {
            Feng.error("更新失败!" + data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();
        return false;
    });
    $('#cancel').click(function(){
        window.location.href = Feng.ctxPath + '/greaseManage'
    });
});
guns-vip-main/src/main/webapp/assets/modular/kb/greaseBoard/greaseBoard.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,269 @@
layui.use(['form','table', 'admin', 'ax', 'func'], function () {
    var $ = layui.$;
    var table = layui.table;
    var $ax = layui.ax;
    var admin = layui.admin;
    var func = layui.func;
    /**
     * çœ‹æ¿é…ç½®ç®¡ç†
     */
    var KanbanConf = {
        tableId: "kanbanConfTable"
    };
    /**
     * bom信息管理
     */
    var BomInfo = {
        tableId: "bomInfoTable"
    };
    /**
     * bom信息管理
     */
    var MaterialShortage = {
        tableId: "materialShortageTable"
    };
    initPageInfo();
    async function initPageInfo() {
        await initKanBanConfInfo();//初始化配置信息
        await initPoorLine();
        await initOrderInfo();
        initBomTable();
        initMaterialShortage();
     /*   xR();
        xa();*/
    }
    function initPoorLine(){
        $.ajax({
            type: "POST",
            contentType: "application/json;charset=UTF-8",
            url: Feng.ctxPath + '/locationInfo/list?productionLineCode='+ $('#lineCode').val(),
            success: function (result) {
                $('#poorLocationCode').empty();
                $('#poorLocationCode').append(new Option("请选择工位", ""));// ä¸‹æ‹‰èœå•é‡Œæ·»åŠ å…ƒç´ 
                $.each(result.data, function (index, value) {
                    $('#poorLocationCode').append(new Option(value.locationCode, value.locationCode));// ä¸‹æ‹‰èœå•é‡Œæ·»åŠ å…ƒç´ 
                });
                layui.form.render("select");//重新渲染 å›ºå®šå†™æ³•
            },
        });
    }
    function initKanBanConfInfo() {
        // æ ¹æ®ip查询配置信息
        var ajax = new $ax(Feng.ctxPath + "/scrapBoard/qryKBConflist?pageCode=" + 'KB_WLDJ_006');
        var result = ajax.start();
        if (result.data.length > 0) {
            let msg = result.data[0];
            $('#id').val(msg.id);
            $('#ipAddress').val(msg.ipAddress);
            $('#pageCode').val(msg.pageCode);
            $('#workshopCode').val(msg.workshopCode);
            $('#lineCode').val(msg.lineCode);
            $('#locationCode').val(msg.locationCode);
            $('#scrapCategory').val(msg.warehouseCode);
            $('#scrapReason').val(msg.warehouseName);
            console.log(msg)
        }
    }
    function initOrderInfo(sfc) {
        // æ ¹æ®ip查询配置信息
        var ajax = new $ax(Feng.ctxPath + "/repairManageInfo/list?sfc=" + sfc);
        // var ajax = new $ax(Feng.ctxPath + "/repairManageInfo/list?sfc=222222222");
        var result = ajax.start();
        if (result.data.length > 0) {
            let msg = result.data[0];
            $('#orderId').val(msg.id);
            $('#workOrderNo').val(msg.workOrderNo);
            $('#productName').val(msg.productName);
            $('#productCode').val(msg.productCode);
            $('#sfc1').val(msg.sfc);
            $('#locationCode1').val(msg.locationCode);
            $('#productionLine1').val(msg.productionLine);
            $('#poorLocationCode1').val(msg.poorLocationCode);
            $('#poorContent1').val(msg.poorContent);
        }
    }
    function initBomTable(){
        var queryData = {};
        queryData['loadingCode'] = $("#locationCode").val();
        // queryData['workOrderNo'] = $("#workOrderNo").val();
        // æ¸²æŸ“表格
        var tableResult = table.render({
            elem: '#' + BomInfo.tableId,
            url: Feng.ctxPath + '/bomInfo/kbListTable',
            // page: true,
            // height: 475,
            height: 435,
            cellMinWidth: 100,
            where:queryData,
            cols: BomInfo.initColumn()
        });
    }
    /**
     * ç‰©æ–™Bom初始化表格的列
     */
    BomInfo.initColumn = function () {
        return [[
            // {type: 'checkbox'},
            /*  {type:"numbers" ,title:'序号',width:40,fixed:'left'},*/
            {field: 'id', hide: true, title: 'ID'},
            {field: 'materialCode', sort: true, title: '物料编号'},
            {field: 'materialName', sort: true, title: '物料名称'},
            // {field: 'workorderNo', sort: true, title: '工单编号'},
            // {field: 'productCode', sort: true, title: '产品编号'},
            {field: 'locationCode', sort: true, title: '工位编号'},
            {field: 'loadingCode', sort: true, title: '上料工位编号'},
            // {field: 'state', sort: true, title: '是否扫码'},
            // {field: 'batchCode', sort: true, title: '批次码'},
        ]];
    };
    /**
     * ç¼ºæ–™æŠ¥è­¦åˆå§‹åŒ–表格的列
     */
    MaterialShortage.initColumn = function () {
        return [[
            {field: 'id', hide: true, title: '主键id'},
            {field: 'barcode', sort: true, title: '扫码条码',width:330},
            {field: 'locationCode', sort: true, title: '工位'},
            {field: 'duaDate', sort: true, title: '到期时间'},
            // {field: 'state', sort: true, title: '状态'},
            {field: 'createUser', sort: true, title: '更新用户'},
            {field: 'createTime', sort: true, title: '更新时间'},
        ]];
    };
    function initMaterialShortage(){
        var queryData = {};
        queryData['manageType'] = "2";
        // æ¸²æŸ“表格
        var tableResult = table.render({
            elem: '#' + MaterialShortage.tableId,
            url: Feng.ctxPath + '/greaseManage/list',
            // page: true,
            height: 360,
            cellMinWidth: 80,
            where:queryData,
            cols: MaterialShortage.initColumn()
        });
    }
    // ç”Ÿäº§å·¥å•è®¾ç½®æŒ‰é’®ç‚¹å‡»äº‹ä»¶
    $('#orderBtnSet').click(function () {
        KanbanConf.openOrderEditPage();
    });
    // è®¾ç½®æŒ‰é’®ç‚¹å‡»äº‹ä»¶
    $('#btnSet').click(function () {
        var id = $("#id").val();
        if(id == "" || id == undefined){
            KanbanConf.openAddDlg();
        }else{
            KanbanConf.openEditPage(id);
        }
    });
    $('#enter').click(function (){
        if($('#barcode').val().length===0) {
            Feng.error("请输入总成编码!")
            return;
        }
        let ajaxEnter = new $ax(Feng.ctxPath + "/greaseBoard/updategreaseManage", function (data) {
            Feng.success("添加成功!")
        }, function (data) {
            Feng.error("添加失败!" + data.responseJSON.message)
        });
        ajaxEnter.set("barcode", $('#barcode').val());
        ajaxEnter.start();
        initMaterialShortage();
    });
    /**
     * å¼¹å‡ºæ·»åŠ é¡µé¢è®¾ç½®å¯¹è¯æ¡†
     */
    KanbanConf.openAddDlg = function () {
        console.log("弹出添加页面设置对话框");
        layer.open({
            type: 2,
            area: ['1000px', '600px'],
            title: '添加看板配置',
            content: Feng.ctxPath + '/reworkAndLaunch/add',
            success: function (layero, index) {
                let body = layer.getChildFrame('body', index);
                body.find('form').find('#testlineCode').val($('#lineCode').val());
                body.find('form').find('#testlocationCode').val($('#locationCode').val());
            },
            end: function () {
                console.log("end")
                let lineCode = JSON.parse(window.localStorage.getItem('lineCode'));
                let locationCode = JSON.parse(window.localStorage.getItem('locationCode'));
                $('#lineCode').val(lineCode);
                $('#locationCode').val(locationCode);
                initKanBanConfInfo()
            }
        });
    };
    /**
     * å¼¹å‡ºç¼–辑页面设置对话框
     *
     * @param data ç‚¹å‡»æŒ‰é’®æ—¶å€™çš„行数据
     */
    KanbanConf.openEditPage = function (data) {
        func.open({
            title: '添加看板配置',
            content: Feng.ctxPath + '/materialRegistration/edit?id=' + data,
            //tableId: KanbanConf.tableId
        });
    };
    $('#revert').click(function () {
        window.location.href = Feng.ctxPath + '/badBoard/boardHome'
    });
    var websocket = null;
    //判断当前浏览器是否支持WebSocket
    if('WebSocket' in window) {
        //改成你的地址
        websocket = new WebSocket('ws://127.0.0.1:8083/websocket/greaseBoard');
    } else {
        alert('当前浏览器 Not support websocket')
    }
    //接收到消息的回调方法
    websocket.onmessage = function(event) {
        $('#barcode').val(event.data);
        // initOrderInfo(event.data);
    }
    //连接成功建立的回调方法
    websocket.onopen = function() {
        Feng.info("扫码枪连接建立成功")
    }
    //连接关闭的回调方法
    websocket.onclose = function() {
        Feng.info("扫码枪连接已关闭")
    }
    window.onunload = function(){
        websocket.close();
    }
});
guns-vip-main/src/main/webapp/pages/modular/gm/greaseManage/greaseManage.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,32 @@
@layout("/common/_container.html",{js:["/assets/modular/gm/greaseManage/greaseManage.js"]}){
<div class="layui-body-header">
    <span class="layui-body-header-title">油脂管理管理</span>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form toolbar">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>
                                <button id="btnAdd" class="layui-btn icon-btn"><i class="layui-icon">&#xe654;</i>添加</button>
                                <button id="btnExp" class="layui-btn icon-btn"><i class="layui-icon">&#xe67d;</i>导出</button>
                            </div>
                        </div>
                    </div>
                    <table class="layui-table" id="greaseManageTable" lay-filter="greaseManageTable"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="tableBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
</script>
@}
guns-vip-main/src/main/webapp/pages/modular/gm/greaseManage/greaseManage_add.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
@layout("/common/_form.html",{js:["/assets/modular/gm/greaseManage/greaseManage_add.js"],css:["/assets/expand/module/formSelects/formSelects-v4.css"]}){
<form class="layui-form" id="greaseManageForm" lay-filter="greaseManageForm">
    <div class="layui-fluid" style="padding-bottom: 75px;">
        <div class="layui-card">
            <div class="layui-card-header">基本信息</div>
            <div class="layui-card-body">
                <div class="layui-form-item layui-row">
                    <input name="id" type="hidden"/>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">扫码条码<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="barcode" name="barcode" placeholder="请输入扫码条码" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">工位<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="locationCode" name="locationCode" placeholder="请输入工位" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">到期时间<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="duaDate" name="duaDate" placeholder="请输入到期时间" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">状态<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="state" name="state" placeholder="请输入状态" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">备注<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="remarks" name="remarks" placeholder="请输入备注" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">预留字段1<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="spareField1" name="spareField1" placeholder="请输入预留字段1" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">预留字段2<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="spareField2" name="spareField2" placeholder="请输入预留字段2" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group-bottom text-center">
        <button class="layui-btn" lay-filter="btnSubmit" lay-submit>&emsp;提交&emsp;</button>
        <button type="reset" class="layui-btn layui-btn-primary" id="cancel">&emsp;取消&emsp;</button>
    </div>
</form>
@}
guns-vip-main/src/main/webapp/pages/modular/gm/greaseManage/greaseManage_edit.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
@layout("/common/_form.html",{js:["/assets/modular/gm/greaseManage/greaseManage_edit.js"]}){
<form class="layui-form" id="greaseManageForm" lay-filter="greaseManageForm">
    <div class="layui-fluid" style="padding-bottom: 75px;">
        <div class="layui-card">
            <div class="layui-card-header">基本信息</div>
            <div class="layui-card-body">
                <div class="layui-form-item layui-row">
                    <input name="id" type="hidden"/>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">扫码条码<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="barcode" name="barcode" placeholder="请输入扫码条码" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">工位<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="locationCode" name="locationCode" placeholder="请输入工位" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">到期时间<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="duaDate" name="duaDate" placeholder="请输入到期时间" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">状态<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="state" name="state" placeholder="请输入状态" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">备注<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="remarks" name="remarks" placeholder="请输入备注" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">预留字段1<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="spareField1" name="spareField1" placeholder="请输入预留字段1" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                    <div class="layui-inline layui-col-md12">
                        <label class="layui-form-label">预留字段2<span style="color: red;">*</span></label>
                        <div class="layui-input-block">
                            <input id="spareField2" name="spareField2" placeholder="请输入预留字段2" type="text" class="layui-input" lay-verify="required" required/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group-bottom text-center">
        <button class="layui-btn" lay-filter="btnSubmit" lay-submit>&emsp;提交&emsp;</button>
        <button type="reset" class="layui-btn layui-btn-primary" id="cancel">&emsp;取消&emsp;</button>
    </div>
</form>
@}
guns-vip-main/src/main/webapp/pages/modular/kb/greaseBoard/greaseBoard.html
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
@layout("/common/_container.html",{js:["/assets/modular/kb/greaseBoard/greaseBoard.js"]}){
<div class="layui-body-header">
    <span class="layui-body-header-title">油脂看板</span>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space12">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="layui-card">
                <div class="layui-card-header" style="font-weight: bold"><i class="layui-icon layui-icon-rate-solid"></i> åŸºç¡€é…ç½®</div>
                <div class="layui-card-body" style="height: 106px">
                    <div class="layui-form toolbar">
                        <div class="layui-form-item layui-row">
                            <div class="layui-col-md6" style="margin-top: 30px">
                                <div class="layui-inline">
                                    æ‰« æ æ¡ ç :
                                </div>
                                <div class="layui-inline">
                                    <input id="barcode" name="barcode" placeholder="请输入总成编码" type="text" style="width: 310px" class="layui-input"/>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-col-md1" style="margin-top: 30px">
                                <div class="layui-inline">
                                    <button id="enter"  class="layui-btn layui-btn-radius layui-btn-lg">录 å…¥</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="layui-card">
                <div class="layui-card-header" style="font-weight: bold"><i class="layui-icon layui-icon-rate-solid"></i>油脂列表</div>
                <div class="layui-card-body" style="height: 350px">
                    <table class="layui-table" id="materialShortageTable" lay-filter="materialShortageTable"></table>
                </div>
            </div>
        </div>
        <button id="revert" class="layui-btn layui-btn-radius layui-btn-lg" style="float: right">返回首页</button>
    </div>
</div>
@}