| | |
| | | "/websocket/**", |
| | | "/equipmentStatus/**", |
| | | "/equipmentAlarm/**", |
| | | "/greaseBoard/**", |
| | | |
| | | }; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 + |
| | | "}"; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | }); |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * æ·»å æè
ä¿®æ¹é¡µé¢ |
| | | */ |
| | | 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' |
| | | }); |
| | | |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * 详æ
对è¯æ¡ |
| | | */ |
| | | 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' |
| | | }); |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | 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(); |
| | | } |
| | | |
| | | }); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @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"></i>æç´¢</button> |
| | | <button id="btnAdd" class="layui-btn icon-btn"><i class="layui-icon"></i>æ·»å </button> |
| | | <button id="btnExp" class="layui-btn icon-btn"><i class="layui-icon"></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> |
| | | @} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @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> æ交 </button> |
| | | <button type="reset" class="layui-btn layui-btn-primary" id="cancel"> åæ¶ </button> |
| | | </div> |
| | | |
| | | </form> |
| | | |
| | | @} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @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> æ交 </button> |
| | | <button type="reset" class="layui-btn layui-btn-primary" id="cancel"> åæ¶ </button> |
| | | </div> |
| | | |
| | | </form> |
| | | |
| | | @} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | @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> |
| | | @} |