Merge remote-tracking branch 'origin/master'
| | |
| | | * ç¼å-å
¥åºID |
| | | */ |
| | | public static final String CACHE_RECORD_ID = "RECORD_ID"; |
| | | |
| | | //-粮温å¤ç¨ç¹ |
| | | public static final double ERROR_TEMP = -100; |
| | | //-粮温æ
éç¹ |
| | | public static final double FAULT_TEMP = -101; |
| | | //-粮温补å¿ç¹-é对é¥å½¢ä»è¡¥ç¹ä½¿ç¨ |
| | | public static final double ADD_TEMP = -102; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.constant; |
| | | |
| | | /** |
| | | * æä½ååºç |
| | | * |
| | | * @author Andy |
| | | * |
| | | */ |
| | | public enum OrderRespEnum { |
| | | |
| | | ORDER_SUCCESS("ORDER_SUCCESS", "å½ä»¤åéæå"), |
| | | ORDER_ERROR("ORDER_ERROR", "å½ä»¤åéåºç°å¼å¸¸"), |
| | | ORDER_INORDER("ORDER_INORDER","å½ä»¤æ§è¡æéä¸"), |
| | | |
| | | ORDER_INPROGRESS("ORDER_INPROGRESS","å½ä»¤ç»§ç»æ§è¡ä¸"), |
| | | |
| | | NO_PROTOCOL("NO_PROTOCOL", "å½ååè®®æªå®ç°"), |
| | | NO_SIGN("NO_SIGN", "è¿æ¥å¼å¸¸ï¼æ²¡æè·åå°è¿æ¥"), |
| | | NO_FUNCTION("NO_FUNCTION", "ç»ç«¯æä¸æ¯æè¯¥åè½"), |
| | | |
| | | MSG_SUCCESS("MSG_SUCCESS", "ä¿¡æ¯è§£ææå"), |
| | | MSG_ERROR("MSG_ERROR", "ä¿¡æ¯è§£æå¼å¸¸"), |
| | | MSG_TIMEOUT("MSG_TIMEOUT", "è§£æè¶
æ¶"), |
| | | LOGOUT("LOGOUT", "离线") |
| | | ; |
| | | |
| | | private String code; |
| | | private String msg; |
| | | |
| | | OrderRespEnum(String code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.Grain; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:47 |
| | | */ |
| | | @Data |
| | | public class GrainData extends Grain implements Serializable { |
| | | |
| | | private List<GrainPoint> listPoints; |
| | | |
| | | @PropertyDef(label = "åå±ç²®æ¸©", description = "å
³ç³»å段") |
| | | private List<GrainLay> listLays; |
| | | |
| | | @PropertyDef(label = "åè¡æ¸©åº¦", description = "å
³ç³»å段") |
| | | private List<GrainRow> listRows; |
| | | |
| | | @PropertyDef(label = "仿¿ä¿¡æ¯", description = "å
³ç³»å段") |
| | | private Depot depotData; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ç²®æ
æ°æ®è§£æå¯¹è±¡-å±ä¿¡æ¯ |
| | | */ |
| | | |
| | | @Data |
| | | public class GrainLay { |
| | | |
| | | private int fz; //æå¨å± |
| | | |
| | | private int z; //æå¨å± |
| | | |
| | | private Double tempMin; //屿使¸© |
| | | |
| | | private Double tempMax; //屿髿¸© |
| | | |
| | | private Double tempAve = 0.0; //å±å¹³å温 |
| | | |
| | | private Double tempAveIn = 0.0; //å
å平忏©åº¦ |
| | | |
| | | private Double tempAveOut = 0.0; //å¤å平忏©åº¦ |
| | | |
| | | private int sumNum;//å½å屿»æ° |
| | | |
| | | private int sumInNum;//å
åä¸ªæ° |
| | | |
| | | private int sumOutNum;//å¤åä¸ªæ° |
| | | |
| | | private double sumTemp;//屿»æ¸©åº¦ |
| | | |
| | | private double sumInTemp; |
| | | |
| | | private double sumOutTemp; |
| | | |
| | | public GrainLay() { |
| | | super(); |
| | | } |
| | | |
| | | public GrainLay(int fz, int z) { |
| | | super(); |
| | | this.fz = fz; |
| | | this.z = z; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description ç²®æ
ä¸å¡åæ°åæ°å®ä¹ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class GrainParam extends IgdsBaseParam { |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date checkDate;// æ£æµæ¥æ yyyy-MM-dd |
| | | |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM", timezone = "GMT+8") |
| | | private Date checkMonth;// æ£æµæ¥æ |
| | | |
| | | private int checkHour;//æ£æµæ¶é´å°æ¶ï¼0ä¸ç® |
| | | |
| | | private String batchId;// æ¹æ¬¡å· |
| | | |
| | | private String extBatchId;// éè¦è¢«æé¤æ¹æ¬¡å· |
| | | |
| | | private String depotIds;// 以éå·éå¼çä»åºç¼ç ï¼å¤ä¸ªä»åºç¼ç |
| | | |
| | | private boolean tagUpdate = true;// æ¯å¦æ´æ°å±æ°æ®åè¡æ°æ® |
| | | |
| | | private String cableRule;//å¸çº¿è§å |
| | | |
| | | private String cableCir;//çä»å±å¸çº¿è§å |
| | | |
| | | private String depotType;//ä»åºç±»å |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ç²®æ
æ°æ®è§£æå¯¹è±¡-ééç¹å¯¹è±¡ä¿¡æ¯ï¼XYZ表示çåè¡å±ï¼æ°å¼ä»1å¼å§ã |
| | | * |
| | | */ |
| | | @Data |
| | | public class GrainPoint { |
| | | |
| | | private int z; // æå¨å± |
| | | |
| | | private int fz; // æå¨å± |
| | | |
| | | private int x; //æå¨åï¼ç仿å¨åæ° |
| | | |
| | | private int y; //æå¨è¡ï¼ç仿 ¹å·ï¼æ»æ ¹å· |
| | | |
| | | private Double temp = 0.0; //ééç¹æ¸©åº¦ |
| | | |
| | | public GrainPoint() { |
| | | super(); |
| | | } |
| | | |
| | | public GrainPoint(Double temp, int x, int y, int z, int fz) { |
| | | super(); |
| | | this.z = z; |
| | | this.x = x; |
| | | this.y = y; |
| | | this.fz = fz; |
| | | this.temp = temp; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ç²®æ
æ°æ®è§£æå¯¹è±¡-åä¿¡æ¯ |
| | | */ |
| | | @Data |
| | | public class GrainRow { |
| | | |
| | | private int y; //æå¨è¡,æ°æ®ä»0å¼å§ï¼å¦ææ¯çä»çè¯ï¼ç¨äºè®°å½çä»çæ ¹æ° |
| | | |
| | | private Double tempMin; //屿使¸© |
| | | |
| | | private Double tempMax; //屿髿¸© |
| | | |
| | | private Double tempAve = 0.0; //å±å¹³å温 |
| | | |
| | | private int sumNum;// å½å屿»æ° |
| | | |
| | | private double sumTemp;// 屿»æ¸©åº¦ |
| | | |
| | | public GrainRow() { |
| | | super(); |
| | | } |
| | | |
| | | public GrainRow(int y) { |
| | | super(); |
| | | this.y = y; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import java.io.Serializable; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description 对Page<E>ç»æè¿è¡å
è£
乿以è¿è¡å°è£
æ¯å 为LayUIä¸ä¸ç®¡å页ä¸å¦è·åæ°æ®ï¼é½éè¦ä¸ä¸ªå®æ´çæ ¼å¼è¿åã LAYUIä¸è¦æ±æ¥è¯¢æ°æ®å¿
é¡»å°è£
为ï¼{code:0,msg:"",count:1000,data:[] } |
| | | * @Author CZT |
| | | * @Date 2025/11/29 10:56 |
| | | */ |
| | | public class LayPage<T> implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | // å½å页 |
| | | private long curr; |
| | | // æ¯é¡µçæ°é |
| | | private long limit; |
| | | // æ»è®°å½æ° |
| | | private long count; |
| | | // æ»é¡µæ° |
| | | private int pages; |
| | | // ç»æé |
| | | private List<T> data; |
| | | // æ¯å¦ä¸ºç¬¬ä¸é¡µ |
| | | private boolean isFirstPage = false; |
| | | // æ¯å¦ä¸ºæåä¸é¡µ |
| | | private boolean isLastPage = false; |
| | | |
| | | // LayUIä¸çå¿
é¡»è¿åçç»æç¼ç 0表示æåã |
| | | private int code = 0; |
| | | // LayUIä¸å¼å¸¸ä¿¡æ¯ã |
| | | private String msg; |
| | | |
| | | public LayPage() { |
| | | super(); |
| | | this.count = 0; |
| | | this.curr = 1; |
| | | this.code = 0; |
| | | this.msg ="æ æ°æ®"; |
| | | } |
| | | |
| | | /** |
| | | * å
è£
Page对象 |
| | | * |
| | | * @param list |
| | | */ |
| | | public LayPage(List<T> list) { |
| | | super(); |
| | | if (null == list || list.isEmpty()) { |
| | | this.count = 0; |
| | | this.curr = 1; |
| | | this.code = 0; |
| | | this.msg ="æ æ°æ®"; |
| | | } |
| | | if (list instanceof Collection) { |
| | | this.curr = 1; |
| | | this.limit = list.size(); |
| | | |
| | | this.pages = 1; |
| | | this.data = list; |
| | | this.count = list.size(); |
| | | } |
| | | if (list instanceof Collection) { |
| | | // 夿页é¢è¾¹ç |
| | | judgePageBoudary(); |
| | | } |
| | | } |
| | | |
| | | public LayPage(Page<T> page) { |
| | | this.curr = page.getCurrent(); |
| | | this.limit = page.getSize(); |
| | | |
| | | this.pages = (int)page.getPages(); |
| | | this.data = (List<T>) page.getRecords(); |
| | | this.count = page.getTotal(); |
| | | } |
| | | |
| | | /** |
| | | * å¤å®é¡µé¢è¾¹ç |
| | | */ |
| | | private void judgePageBoudary() { |
| | | isFirstPage = curr == 1; |
| | | isLastPage = curr == pages; |
| | | } |
| | | |
| | | public long getPageNum() { |
| | | return curr; |
| | | } |
| | | |
| | | public void setPageNum(int pageNum) { |
| | | this.curr = pageNum; |
| | | } |
| | | |
| | | public long getLimit() { |
| | | return limit; |
| | | } |
| | | |
| | | public void setLimit(int limit) { |
| | | this.limit = limit; |
| | | } |
| | | |
| | | public long getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(long count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public int getPages() { |
| | | return pages; |
| | | } |
| | | |
| | | public void setPages(int pages) { |
| | | this.pages = pages; |
| | | } |
| | | |
| | | public List<T> getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(List<T> data) { |
| | | this.data = data; |
| | | } |
| | | |
| | | public boolean isIsFirstPage() { |
| | | return isFirstPage; |
| | | } |
| | | |
| | | public void setIsFirstPage(boolean isFirstPage) { |
| | | this.isFirstPage = isFirstPage; |
| | | } |
| | | |
| | | public boolean isIsLastPage() { |
| | | return isLastPage; |
| | | } |
| | | |
| | | public void setIsLastPage(boolean isLastPage) { |
| | | this.isLastPage = isLastPage; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | final StringBuffer sb = new StringBuffer("PageInfo{"); |
| | | sb.append("curr=").append(curr); |
| | | sb.append(", limit=").append(limit); |
| | | sb.append(", count=").append(count); |
| | | sb.append(", pages=").append(pages); |
| | | sb.append(", data=").append(data); |
| | | sb.append(", isFirstPage=").append(isFirstPage); |
| | | sb.append(", isLastPage=").append(isLastPage); |
| | | sb.append(", navigatepageNums="); |
| | | sb.append('}'); |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.data; |
| | | |
| | | import lombok.Data; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description ç¨äºå°è£
模æ¿ç²®æ
模æ¿ä¿¡æ¯ |
| | | * @Author CZT |
| | | * @Date 2025/11/29 11:02 |
| | | */ |
| | | @Data |
| | | public class PrintModeData implements Serializable { |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 5679268829597439794L; |
| | | |
| | | private String companyId; //ç»ç»ç¼ç |
| | | |
| | | private String depotType; //ä»åºç±»å |
| | | |
| | | private String model; //模æ¿å
容 |
| | | |
| | | private String modelType = "COMMON"; //模æ¿ç±»å,éç¨æ¨¡æ¿=COMMONï¼è¡è§å模æ¿=ROW |
| | | |
| | | private String msg; //å¼å¸¸ä¿¡æ¯ |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.bstek.dorado.annotation.PropertyDef; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Id; |
| | | import javax.persistence.Table; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description æä½æ¥å¿ï¼ä»
ä»
表示ä¸å¡ä¸çæä½æ¥å¿ã |
| | | * @Author CZT |
| | | * @Date 2025/11/25 17:20 |
| | | */ |
| | | @Data |
| | | @Entity |
| | | @Table(name = "d_log_operation") |
| | | @TableName("d_log_operation") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class LogOperation extends BizBaseEntity implements Serializable { |
| | | |
| | | @Id |
| | | @Column(name = "id", unique = true, length = 40) |
| | | @PropertyDef(label = "id") |
| | | private String id; |
| | | |
| | | @Column(name = "dept_id", columnDefinition = "varchar(40) COMMENT 'æå±åºåº'") |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | @Column(name = "biz_type", columnDefinition = "varchar(40) COMMENT 'ä¸å¡ç±»å'") |
| | | @TableField("biz_type") |
| | | private String bizType = "sys"; |
| | | |
| | | @Column(name = "operate_time", columnDefinition = "datetime COMMENT 'æ§è¡æ¶é´'") |
| | | @TableField("operate_time") |
| | | private Date operateTime; |
| | | |
| | | @Column(name = "operate_user", columnDefinition = "varchar(40) COMMENT 'æ§è¡äºº'") |
| | | @TableField("operate_user") |
| | | private String operateUser; |
| | | |
| | | @Column(name = "operate_info", columnDefinition = "varchar(1000) COMMENT 'æ§è¡å
容'") |
| | | @TableField("operate_info") |
| | | private String operateInfo; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.Grain; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:00 |
| | | */ |
| | | public interface GrainMapper extends BaseMapper<Grain> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.fzzy.igds.domain.LogOperation; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface LogOperationMapper extends BaseMapper<LogOperation> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.request; |
| | | |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | @Data |
| | | public class ExeBaseRequest<T> { |
| | | |
| | | private String requestId;//èªå®ä¹å½ä»¤ID |
| | | |
| | | private String companyId;//ç»ç»ç¼ç |
| | | |
| | | private String deptId;//ååºç¼ç |
| | | |
| | | private String depotId;//ä»åºç¼å· |
| | | |
| | | private String depotName;//ä»åºåç§° |
| | | |
| | | private String bizType;//ä¸å¡ç±»å |
| | | |
| | | private String serId = "0";//åæºç¼å· |
| | | |
| | | private String serName = "æ ";//åæºåç§° |
| | | |
| | | private String sn = "0";//åæºåºåå· |
| | | |
| | | private String ip; //åæºIP |
| | | |
| | | private Integer port;//åæºç«¯å£å· |
| | | |
| | | private String protocol;//å½åå½ä»¤çåè®® |
| | | |
| | | private Date exeTime = new Date();//æ§è¡æ¶é´ |
| | | |
| | | private String exeUser;// å起人 |
| | | |
| | | private boolean repeatTag = false;//æ¯å¦æ¯æé夿§è¡ï¼å³å¨ä¸ä¸ªå½ä»¤æªååºçæ¶åï¼å
许æ§è¡ç¬¬äºé |
| | | |
| | | private boolean addLogTag = true;//æ¯å¦æ·»å æ¥å¿ |
| | | |
| | | private boolean addCacheTag = true;//æ¯å¦æ·»å åè½ç¼å |
| | | |
| | | private String exeMsg = null;//æ§è¡ä¿¡æ¯ |
| | | |
| | | private String errorMsg = null;//å¼å¸¸ä¿¡æ¯ |
| | | |
| | | private boolean isSave = true;//æ¯å¦ä¿åå°æ°æ®åº |
| | | |
| | | private String status = ReqStatus.IN_PROGRESS.getCode(); |
| | | |
| | | private T reqData = null;//å½ä»¤æ§è¡æ°æ®å°è£
|
| | | |
| | | public ExeBaseRequest() { |
| | | super(); |
| | | this.requestId = ContextUtil.getTimeId(1000, 9999); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.request; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description ç²®æ
æ£æµè¯·æ± |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class GrainReqData implements Serializable { |
| | | |
| | | private int cableStart;//çµç¼å¼å§ |
| | | |
| | | private int cableEnd;//çµç¼æªè³ |
| | | |
| | | private String cableRule; |
| | | |
| | | private String thSerId;//仿¸©ä»æ¹¿ä½¿ç¨çåæº |
| | | |
| | | private String thConf;//仿¸©æ¹¿éé |
| | | |
| | | private String isMoreDepot;//å¤ä»å¹¶åï¼é对FZZY-TCP-V6åè®®ä½¿ç¨ |
| | | |
| | | public GrainReqData() { |
| | | super(); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.request; |
| | | |
| | | /** |
| | | * @Description æ§è¡å½ä»¤çç¶æï¼å¦æç¶ææ§è¡ä¸ï¼é£ä¹ä¸å
许é夿§è¡åä¸ä¸ªç±»åçå½ä»¤ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | public enum ReqStatus { |
| | | INIT("INIT", "åå§åç¶æ"), |
| | | IN_PROGRESS("IN_PROGRESS", "æ§è¡ä¸"), |
| | | SEND_ERROR("SEND_ERROR", "åéå¼å¸¸"), |
| | | ANALYSIS_ERROR("ANALYSIS_ERROR", "è§£æå¼å¸¸"), |
| | | TIMEOUT_ERROR("TIMEOUT_ERROR", "å¤çè¶
æ¶"), |
| | | COMPLETE("COMPLETE", "宿"); |
| | | |
| | | private String code; |
| | | private String msg; |
| | | |
| | | ReqStatus(String code, String msg) { |
| | | this.code = code; |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @Description 仿¸©ä»æ¹¿è¯·æ± |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | @Data |
| | | public class ThReqData implements Serializable { |
| | | |
| | | private String thConf;//仿¸©æ¹¿éé |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.response; |
| | | |
| | | import com.fzzy.igds.constant.OrderRespEnum; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Description ååºæ°æ®å°è£
ï¼å½ä»¤ç请æ±åä¸ºä¸¤ä¸ªé¶æ®µï¼åéåååº |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Data |
| | | public class BaseResponse { |
| | | |
| | | //æ§è¡éªè¯æå |
| | | public static final String CHECK_SUCCESS ="0000"; |
| | | //æ§è¡éªè¯å¤±è´¥ï¼å
·ä½å¤±è´¥åå æèªå®ä¹ |
| | | public static final String CHECK_ERROR ="1111"; |
| | | |
| | | |
| | | private String code;//请æ±ä»£ç |
| | | |
| | | private String msg;//请æ±è¿ä¿¡æ¯ |
| | | |
| | | private String orderId; |
| | | |
| | | public BaseResponse() { |
| | | } |
| | | |
| | | public BaseResponse(String code, String msg) { |
| | | this.msg = msg; |
| | | this.code = code; |
| | | } |
| | | |
| | | public BaseResponse(OrderRespEnum orderRespEnum) { |
| | | this.msg = orderRespEnum.getMsg(); |
| | | this.code = orderRespEnum.getCode(); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.response; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @Description ç²®æ
æ£æµååºç»æä¿¡æ¯ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class GrainResponse extends BaseResponse { |
| | | |
| | | public GrainResponse(String code, String msg) { |
| | | super(code,msg); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * è·å临æ¶è·¯å¾ |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | public String getTempFilePath(String companyId) { |
| | | |
| | | String basePath = FrameworkConfig.getProfile() + "TEMP/"; |
| | | if (org.apache.commons.lang3.StringUtils.isNotEmpty(companyId)) { |
| | | basePath += companyId + "/"; |
| | | } |
| | | File file = new File(basePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | return basePath; |
| | | } |
| | | |
| | | /** |
| | | * è·å模æ¿è·¯å¾ |
| | | * @return |
| | | */ |
| | | public String getConfPath() { |
| | | |
| | | String basePath = FrameworkConfig.getProfile() + "CONF/"; |
| | | File file = new File(basePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | return basePath; |
| | | } |
| | | |
| | | /** |
| | | * å缩å¾ç |
| | | * |
| | | * @param filePath å缩åè·¯å¾ |
| | |
| | | ImageIO.write(compressedImage, "jpg", new File(outputPath)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.domain.Grain; |
| | | import com.fzzy.igds.mapper.GrainMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:00 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class GrainService { |
| | | |
| | | @Resource |
| | | private GrainMapper grainMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ°æ® |
| | | * @param param |
| | | */ |
| | | public List<Grain> listData(GrainParam param) { |
| | | if(StringUtils.isBlank(param.getCompanyId())){ |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if(StringUtils.isBlank(param.getDeptId())){ |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | QueryWrapper<Grain> queryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isNotBlank(param.getCompanyId())) { |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getDeptId())) { |
| | | queryWrapper.eq("dept_id", param.getDeptId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getDepotId())) { |
| | | queryWrapper.eq("depot_id", param.getDepotId()); |
| | | } |
| | | if (StringUtils.isNotBlank(param.getBatchId())) { |
| | | queryWrapper.eq("batch_id", param.getBatchId()); |
| | | } |
| | | if (null != param.getStart()) { |
| | | queryWrapper.ge("receive_date", DateUtil.getCurZero(param.getStart())); |
| | | } |
| | | if (null != param.getEnd()) { |
| | | queryWrapper.le("receive_date", DateUtil.getNextZero(param.getEnd())); |
| | | } |
| | | queryWrapper.orderByDesc("batch_id"); |
| | | return grainMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.service; |
| | | |
| | | import com.fzzy.igds.domain.LogOperation; |
| | | import com.fzzy.igds.mapper.LogOperationMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description æ¥å¿ |
| | | * @Author CZT |
| | | * @Date 2025/11/26 17:48 |
| | | */ |
| | | @Service |
| | | public class LogOperationService { |
| | | |
| | | @Resource |
| | | private LogOperationMapper logOperationMapper; |
| | | |
| | | /** |
| | | * |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public void addLog(LogOperation data) { |
| | | if (StringUtils.isBlank(data.getId())) { |
| | | data.setId(ContextUtil.generateId()); |
| | | } |
| | | data.setCreateBy(ContextUtil.getLoginUserName()); |
| | | data.setCreateTime(new Date()); |
| | | data.setUpdateBy(ContextUtil.getLoginUserName()); |
| | | data.setUpdateTime(new Date()); |
| | | logOperationMapper.insert(data); |
| | | } |
| | | |
| | | } |
| | |
| | | public static String getCompanyIdBySn(String sn) { |
| | | return contextSnCompanyIdMap.get(sn); |
| | | } |
| | | |
| | | public static String getTimeId() { |
| | | return DateFormatUtils.format(new Date(), "yyyyMMddHHmmss"); |
| | | } |
| | | |
| | | public static String getTimeId(int start, int end) { |
| | | return DateFormatUtils.format(new Date(), "yyyyMMddHHmmss") + RandomUtils.nextInt(start, end); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.utils; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.DepotType; |
| | | import com.fzzy.igds.data.GrainData; |
| | | import com.fzzy.igds.data.GrainLay; |
| | | import com.fzzy.igds.data.GrainPoint; |
| | | import com.fzzy.igds.data.GrainRow; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description ç²®æ
æ°æ®å个类åçè½¬æ¢æ§å¶ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | @Slf4j |
| | | public class GrainDataBuilder { |
| | | |
| | | /** |
| | | * æ ¹æ®å个粮æ
çæ°æ®ä¿¡æ¯ï¼å
æ¬ééç¹åå±ä¿¡æ¯ |
| | | * |
| | | * @param result |
| | | * @param depotConf |
| | | * @param depotType |
| | | */ |
| | | public static void updateGrainData(GrainData result, DepotConf depotConf, String depotType) { |
| | | |
| | | if (null == depotType || null == depotConf) { |
| | | return; |
| | | } |
| | | |
| | | List<GrainPoint> listPoints = new ArrayList<>(); |
| | | List<GrainLay> listLays = new ArrayList<>(); |
| | | List<GrainRow> listRows = new ArrayList<>(); |
| | | |
| | | // æ ¹æ®ä»åºç±»åä¸åè¿è¡ä¸åè°æ´ |
| | | if (DepotType.TYPE_02.getCode().equals(depotType)) {// æµ
åä» |
| | | result = buildLLaysAndRows2(listPoints, listLays, listRows, result, depotConf); |
| | | |
| | | } else if (DepotType.TYPE_03.getCode().equals(depotType)) { |
| | | |
| | | result = buildLLaysAndRows3(listPoints, listLays, listRows, result, depotConf); |
| | | |
| | | } else if (DepotType.TYPE_04.getCode().equals(depotType)) { |
| | | result = buildLLaysAndRows2(listPoints, listLays, listRows, result, depotConf); |
| | | |
| | | } else { |
| | | result = buildLLaysAndRows1(listPoints, listLays, listRows, result, depotConf); |
| | | } |
| | | |
| | | result.setListLays(listLays); |
| | | result.setListRows(listRows); |
| | | result.setListPoints(listPoints); |
| | | |
| | | log.debug("---------{}", JSONObject.toJSONString(result)); |
| | | } |
| | | |
| | | /** |
| | | * å¹³æ¹ä» è·æ°å±æ°æ®åè¡æ°æ® |
| | | * |
| | | * @param listPoints |
| | | * @param listLays |
| | | * @param listRows |
| | | * @param result |
| | | * @param depotConf |
| | | * @return |
| | | */ |
| | | public static GrainData buildLLaysAndRows1(List<GrainPoint> listPoints, |
| | | List<GrainLay> listLays, List<GrainRow> listRows, |
| | | GrainData result, DepotConf depotConf) { |
| | | |
| | | String points = result.getPoints(); |
| | | String cable = result.getCable(); |
| | | // è·åå¸çº¿è§å |
| | | if (StringUtils.isEmpty(cable)) { |
| | | return result; |
| | | } |
| | | if (StringUtils.isEmpty(points)) { |
| | | return result; |
| | | } |
| | | |
| | | String[] attr = cable.split("-"); |
| | | int cableZ = Integer.valueOf(attr[0]); |
| | | int cableY = Integer.valueOf(attr[1]); |
| | | int cableX = Integer.valueOf(attr[2]); |
| | | |
| | | // æ ¹æ®å±æ´æ°å±åè¡¨ä¿¡æ¯ |
| | | updateListLays(listLays, cableX, cableY, cableZ); |
| | | |
| | | // æ´æ°è¡æ°æ®çå表 |
| | | updateListRows(listRows, cableX, cableY, cableZ); |
| | | |
| | | attr = points.split(","); |
| | | |
| | | GrainPoint point; |
| | | Double tempT; |
| | | GrainLay lay; |
| | | GrainRow row; |
| | | List<Integer> listErrorTag = new ArrayList<>();// æ
éæè
é误çç¹ |
| | | Double sumAll = 0.0; |
| | | |
| | | Double sumAllTemp = 0.0; |
| | | |
| | | int sumAllNum = 0; |
| | | int tempT2; |
| | | int x = 0, y = 0, z = 0, fz = 0; |
| | | for (int i = 0; i < attr.length; i++) { |
| | | z = i % cableZ; |
| | | fz = z + 1; |
| | | x = i / (cableZ * cableY); |
| | | y = x * (cableZ * cableY); |
| | | y = (i - y) / cableZ; |
| | | |
| | | // å转Xè½´ |
| | | x = cableX - 1 - x; |
| | | |
| | | tempT = Double.valueOf(attr[i]); |
| | | point = new GrainPoint(tempT, x, y, z, fz); |
| | | |
| | | // ç»è®¡æ¯å±æ°æ® --åå§åæ°æ® |
| | | lay = listLays.get(z); |
| | | |
| | | // å¼å§å°è£
è¡æ°æ®ä¿¡æ¯ |
| | | row = listRows.get(y); |
| | | |
| | | if (tempT <= Constant.ERROR_TEMP) { |
| | | listErrorTag.add(i); |
| | | |
| | | lay.setSumNum(lay.getSumNum() - 1); |
| | | |
| | | row.setSumNum(row.getSumNum() - 1); |
| | | |
| | | if (x == (cableX - 1) || y == (cableY - 1) || x == 0 || y == 0) { |
| | | lay.setSumOutNum(lay.getSumOutNum() - 1); |
| | | } else { |
| | | lay.setSumInNum(lay.getSumInNum() - 1); |
| | | } |
| | | } else { |
| | | sumAllTemp += tempT; |
| | | // 髿¸©ä¼åçå¯ç¨è¦æ±1-å¤çåä¸ªé«æ¸©ç¹ |
| | | if (null != depotConf |
| | | && null != depotConf.getTempMax() |
| | | && Constant.YN_Y.equals(depotConf.getGrainAuto())) { |
| | | |
| | | if (tempT > depotConf.getTempMax()) { |
| | | tempT2 = (int) (tempT - depotConf.getTempMax()) + 1; |
| | | tempT = NumberUtil.keepPrecision(tempT - tempT2, 1); |
| | | result.setRemark("ç²®æ¸©æ£æµæ£å¸¸"); |
| | | log.debug("--åå¼={},--å·®å¼={},--ç»æ={}", point.getTemp(), |
| | | tempT2, tempT); |
| | | } |
| | | if (result.getTempMax() > depotConf.getTempMax()) { |
| | | tempT2 = (int) (result.getTempMax() - depotConf |
| | | .getTempMax()) + 1; |
| | | result.setTempMax(NumberUtil.keepPrecision( |
| | | result.getTempMax() - tempT2, 1)); |
| | | } |
| | | if (tempT > result.getTempMax()) { |
| | | result.setTempMax(tempT); |
| | | } |
| | | } |
| | | |
| | | // å±è¡åè¡¥å
|
| | | lay.setSumTemp(lay.getSumTemp() + tempT); |
| | | lay.setSumTemp(NumberUtil.keepPrecision(lay.getSumTemp(), 1)); |
| | | |
| | | row.setSumTemp(row.getSumTemp() + tempT); |
| | | row.setSumTemp(NumberUtil.keepPrecision(row.getSumTemp(), 1)); |
| | | |
| | | if (x == (cableX - 1) || y == (cableY - 1) || x == 0 || y == 0) { |
| | | lay.setSumOutTemp(lay.getSumOutTemp() + tempT); |
| | | } else { |
| | | lay.setSumInTemp(lay.getSumInTemp() + tempT); |
| | | } |
| | | |
| | | // å±æé«æä½ |
| | | if (tempT > lay.getTempMax()) { |
| | | lay.setTempMax(tempT); |
| | | } |
| | | if (tempT < lay.getTempMin()) { |
| | | lay.setTempMin(tempT); |
| | | } |
| | | |
| | | // è¡æé«æä½ |
| | | if (tempT > row.getTempMax()) { |
| | | row.setTempMax(tempT); |
| | | } |
| | | if (tempT < row.getTempMin()) { |
| | | row.setTempMin(tempT); |
| | | } |
| | | |
| | | // log.info("----温度ç¹={}",tempT); |
| | | sumAll += tempT; |
| | | sumAllNum = sumAllNum + 1; |
| | | point.setTemp(tempT); |
| | | } |
| | | point.setTemp(NumberUtil.keepPrecision(point.getTemp(), 1)); |
| | | listPoints.add(point); |
| | | } |
| | | |
| | | // è°æ´å±ä¿¡æ¯ |
| | | for (GrainLay detail : listLays) { |
| | | if (0 != detail.getSumNum()) { |
| | | detail.setTempAve(detail.getSumTemp() / detail.getSumNum()); |
| | | detail.setTempAve(NumberUtil.keepPrecision(detail.getTempAve(), |
| | | 1)); |
| | | } |
| | | |
| | | if (0 != detail.getSumInNum()) { |
| | | detail.setTempAveIn(detail.getSumInTemp() |
| | | / detail.getSumInNum()); |
| | | detail.setTempAveIn(NumberUtil.keepPrecision( |
| | | detail.getTempAveIn(), 1)); |
| | | } |
| | | |
| | | if (0 != detail.getSumOutNum()) { |
| | | detail.setTempAveOut(detail.getSumOutTemp() |
| | | / detail.getSumOutNum()); |
| | | detail.setTempAveOut(NumberUtil.keepPrecision( |
| | | detail.getTempAveOut(), 1)); |
| | | } |
| | | //è¿æ»¤ææ¯è¾çæå¤§æå°çå¼50å-50 |
| | | if (detail.getTempMax() == -50) { |
| | | detail.setTempMax(0.0); |
| | | } |
| | | if (detail.getTempMin() == 50) { |
| | | detail.setTempMin(0.0); |
| | | } |
| | | } |
| | | |
| | | // è°æ´è¡ä¿¡æ¯ |
| | | for (GrainRow detail : listRows) { |
| | | if (0 != detail.getSumNum()) { |
| | | detail.setTempAve(detail.getSumTemp() / detail.getSumNum()); |
| | | detail.setTempAve(NumberUtil.keepPrecision(detail.getTempAve(), |
| | | 1)); |
| | | } |
| | | //è¿æ»¤ææ¯è¾çæå¤§æå°çå¼50å-50 |
| | | if (detail.getTempMax() == -50) { |
| | | detail.setTempMax(0.0); |
| | | } |
| | | if (detail.getTempMin() == 50) { |
| | | detail.setTempMin(0.0); |
| | | } |
| | | } |
| | | Random random = new Random(); |
| | | Double randomValue; |
| | | if (null != depotConf && Constant.YN_Y.equals(depotConf.getGrainAuto())) { |
| | | if (listErrorTag.size() > 0) { |
| | | for (Integer integer : listErrorTag) { |
| | | point = listPoints.get(integer); |
| | | // è·åå½åå±çä¿¡æ¯ |
| | | lay = listLays.get(point.getZ()); |
| | | randomValue = lay.getTempMin() + (lay.getTempMax() - lay.getTempMin()) * random.nextDouble(); |
| | | point.setTemp(NumberUtil.keepPrecision(randomValue, 1)); |
| | | attr[integer] = NumberUtil.keepPrecision(randomValue, 1) + ""; |
| | | listPoints.set(integer, point); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (null != depotConf && Constant.YN_Y.equals(depotConf.getGrainAuto())) { |
| | | { |
| | | log.debug("---åå¹³å={},åæ»æ¸©={},--åæ»ä¸ªæ°={},åå¹³å={},åæ»æ¸©={}", |
| | | result.getTempAve(), sumAll, sumAllNum, sumAll / sumAllNum, |
| | | sumAllTemp); |
| | | result.setTempAve(NumberUtil.keepPrecision((sumAll / sumAllNum), 1)); |
| | | } |
| | | } |
| | | |
| | | result.setPoints(StringUtils.join(attr, ",")); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * åçä» æ´æ°å±ç¤ºæææ°æ® |
| | | * |
| | | * @param listPoints |
| | | * @param listLays |
| | | * @param listRows |
| | | * @param result |
| | | * @param depotConf |
| | | * @return |
| | | */ |
| | | private static GrainData buildLLaysAndRows2(List<GrainPoint> listPoints, |
| | | List<GrainLay> listLays, List<GrainRow> listRows, |
| | | GrainData result, DepotConf depotConf) { |
| | | |
| | | String points = result.getPoints(); |
| | | String cableRule = result.getCable(); |
| | | String cableCir = result.getCableCir(); |
| | | |
| | | if (StringUtils.isEmpty(points)) { |
| | | return result; |
| | | } |
| | | |
| | | // è·åå¸çº¿è§å |
| | | if (StringUtils.isEmpty(cableRule) || StringUtils.isEmpty(cableCir)) { |
| | | return result; |
| | | } |
| | | // æ¯ä¸ååæ° |
| | | String[] cableRuleAtt = result.getCable().split("-"); |
| | | // æ¯ä¸å屿° |
| | | String[] cableCirAtt = result.getCableCir().split("-"); |
| | | |
| | | if (cableRuleAtt.length != cableCirAtt.length) { |
| | | log.error("å½åä»åºï¼{}ï¼å¸çº¿è§å䏿£ç¡®ï¼æ æ³è§£æç²®æ
ä¿¡æ¯â¦â¦", depotConf.getDepotId()); |
| | | return result; |
| | | } |
| | | |
| | | // è·åæå¤§çå±é
ç½®--é»è®¤æ¯ä¸åé½ä¸æ · |
| | | int layMax = Integer.valueOf(cableCirAtt[0]); |
| | | for (int i = 0; i < cableCirAtt.length; i++) { |
| | | if (Integer.valueOf(cableCirAtt[i]) >= layMax) layMax = Integer.valueOf(cableCirAtt[i]); |
| | | } |
| | | if (null == depotConf.getCableCone() || depotConf.getCableCone().isEmpty()) { |
| | | depotConf.setCableCone(Constant.CABLE_CONE_0); |
| | | } |
| | | |
| | | // æ ¹æ®å±æ´æ°å±åè¡¨ä¿¡æ¯ |
| | | updateListLaysCir(listLays, cableRuleAtt, cableCirAtt, layMax, depotConf.getCableCone()); |
| | | |
| | | String[] attr = points.split(","); |
| | | |
| | | GrainPoint point; |
| | | Double tempT; |
| | | GrainLay lay; |
| | | int x = 0, y = 0, z = 1, fz = 0;// x=æå¨åï¼ä»0å¼å§ï¼y代表çµç¼æ ¹å·ä»0å¼å§ï¼z=代表æå¨å±ä»1å¼å§ |
| | | List<Integer> listErrorTag = new ArrayList<>();// æ
éæè
é误çç¹ |
| | | List<Integer> listHighTag = new ArrayList<>();// 髿¸©ç¹ |
| | | |
| | | int layNum = layMax;// å½ååç屿° |
| | | int rowNum = 1;// å½ååçæ ¹æ° |
| | | int index = 0;// å½å温度ç¹çä½ç½® |
| | | int startRow = 0;//å½åç²®æ
çµç¼æ ¹å· |
| | | for (int i = 0; i < cableRuleAtt.length; i++) { |
| | | x = i; |
| | | rowNum = Integer.valueOf(cableRuleAtt[i]);// æ ¹æ° |
| | | for (int k = 0; k < rowNum; k++) { |
| | | y = k; |
| | | for (int j = 0; j < layNum; j++) { |
| | | z = j; |
| | | fz = j + 1; |
| | | tempT = Double.valueOf(attr[index]); |
| | | index++; |
| | | |
| | | point = new GrainPoint(tempT, x, startRow, z, fz); |
| | | |
| | | // ç»è®¡æ¯å±æ°æ® --åå§åæ°æ® |
| | | lay = listLays.get(z); |
| | | point.setTemp(tempT); |
| | | listPoints.add(point); |
| | | |
| | | if (tempT <= Constant.ERROR_TEMP) { |
| | | if (tempT != Constant.ADD_TEMP) { |
| | | lay.setSumNum(lay.getSumNum() - 1); |
| | | } |
| | | } else { |
| | | |
| | | //夿æ¯å¦é«æ¸©ä¼å |
| | | if (null != depotConf |
| | | && null != depotConf.getTempMax() |
| | | && Constant.YN_Y.equals(depotConf.getGrainAuto())) { |
| | | if (tempT > depotConf.getTempMax()) { |
| | | //è®°å½é«æ¸©ç¹çä½ç½® |
| | | listHighTag.add(listPoints.size() - 1); |
| | | } else { |
| | | lay.setSumTemp(lay.getSumTemp() + tempT); |
| | | // å±æé«æä½ |
| | | if (tempT > lay.getTempMax()) { |
| | | lay.setTempMax(tempT); |
| | | } |
| | | if (tempT < lay.getTempMin()) { |
| | | lay.setTempMin(tempT); |
| | | } |
| | | } |
| | | } else { |
| | | lay.setSumTemp(lay.getSumTemp() + tempT); |
| | | // å±æé«æä½ |
| | | if (tempT > lay.getTempMax()) { |
| | | lay.setTempMax(tempT); |
| | | } |
| | | if (tempT < lay.getTempMin()) { |
| | | lay.setTempMin(tempT); |
| | | } |
| | | } |
| | | } |
| | | if (tempT == Constant.ERROR_TEMP || tempT == Constant.FAULT_TEMP) { |
| | | listErrorTag.add(listPoints.size() - 1); |
| | | } |
| | | } |
| | | |
| | | startRow++; |
| | | } |
| | | |
| | | } |
| | | |
| | | Double maxTemp = -50.0; //æ¯è¾æé«æ¸© |
| | | // è°æ´å±ä¿¡æ¯ |
| | | for (GrainLay detail : listLays) { |
| | | if (0 != detail.getSumNum()) { |
| | | detail.setTempAve(detail.getSumTemp() / detail.getSumNum()); |
| | | detail.setTempAve(NumberUtil.keepPrecision(detail.getTempAve(), |
| | | 1)); |
| | | } |
| | | |
| | | if (0 != detail.getSumInNum()) { |
| | | detail.setTempAveIn(detail.getSumInTemp() |
| | | / detail.getSumInNum()); |
| | | detail.setTempAveIn(NumberUtil.keepPrecision( |
| | | detail.getTempAveIn(), 1)); |
| | | } |
| | | |
| | | if (0 != detail.getSumOutNum()) { |
| | | detail.setTempAveOut(detail.getSumOutTemp() |
| | | / detail.getSumOutNum()); |
| | | detail.setTempAveOut(NumberUtil.keepPrecision( |
| | | detail.getTempAveOut(), 1)); |
| | | } |
| | | //è¿æ»¤ææ¯è¾çæå¤§æå°çå¼50å-50 |
| | | if (detail.getTempMax() == -50) { |
| | | detail.setTempMax(0.0); |
| | | } |
| | | if (detail.getTempMin() == 50) { |
| | | detail.setTempMin(0.0); |
| | | } |
| | | if (listHighTag.size() > 0) { |
| | | if (detail.getTempMax() > maxTemp) { |
| | | maxTemp = detail.getTempMax(); |
| | | } |
| | | } |
| | | } |
| | | Random random = new Random(); |
| | | Double randomValue; |
| | | //髿¸©ç¹æ¿æ¢ä¸ºå±å¹³åå¼ |
| | | if (null != depotConf && Constant.YN_Y.equals(depotConf.getGrainAuto())) { |
| | | if (listHighTag.size() > 0) { |
| | | for (Integer integer : listHighTag) { |
| | | point = listPoints.get(integer); |
| | | // è·åå½åå±çä¿¡æ¯ |
| | | lay = listLays.get(point.getZ()); |
| | | randomValue = lay.getTempMin() + (lay.getTempMax() - lay.getTempMin()) * random.nextDouble(); |
| | | point.setTemp(NumberUtil.keepPrecision(randomValue, 1)); |
| | | attr[integer] = NumberUtil.keepPrecision(randomValue, 1) + ""; |
| | | listPoints.set(integer, point); |
| | | } |
| | | //设置æé«æ¸© |
| | | result.setTempMax(maxTemp); |
| | | } |
| | | } |
| | | // æåæ ¹æ®å
¨å±åæ°å¤ææ¯å¦éè¦è°æ´å¼å¸¸ç¹æ°æ®è¿è¡è°æ´ |
| | | if (null != depotConf && Constant.YN_Y.equals(depotConf.getGrainAuto())) { |
| | | if (listErrorTag.size() > 0) { |
| | | for (Integer integer : listErrorTag) { |
| | | point = listPoints.get(integer); |
| | | // è·åå½åå±çä¿¡æ¯ |
| | | lay = listLays.get(point.getZ()); |
| | | point.setTemp(lay.getTempAve()); |
| | | |
| | | listPoints.set(integer, point); |
| | | } |
| | | } |
| | | } |
| | | |
| | | result.setListPoints(listPoints); |
| | | result.setListLays(listLays); |
| | | result.setPoints(StringUtils.join(attr, ",")); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ²¹çä»è§£æï¼æ´æ°å±ç¤ºæææ°æ®ï¼è§£ææ¹å¼åæ®éçä»ä¿¡æ¯ |
| | | * |
| | | * @param listPoints |
| | | * @param listLays |
| | | * @param listRows |
| | | * @param result |
| | | * @param depotConf |
| | | * @return |
| | | */ |
| | | private static GrainData buildLLaysAndRows3(List<GrainPoint> listPoints, |
| | | List<GrainLay> listLays, List<GrainRow> listRows, |
| | | GrainData result, DepotConf depotConf) { |
| | | if (StringUtils.isEmpty(result.getOilHeight())) { |
| | | result.setOilHeight("0.0-0.0"); |
| | | log.warn("油桶ä»={} è§£æè¿ç¨ä¸æ²¡æè·åå°æ²¹é¢é«åº¦ä¿¡æ¯ï¼é»è®¤æ¾ç¤ºä¸º0", depotConf.getDepotId()); |
| | | } else { |
| | | if (result.getOilHeight().indexOf("-") == -1) { |
| | | result.setOilHeight(result.getOilHeight() + "-" |
| | | + result.getOilHeight()); |
| | | log.warn("油桶ä»={} è§£æä¸æ²¡æè·å建çç©çé«åº¦ä¿¡æ¯ï¼é»è®¤å»ºçç©é«åº¦çäºæ¶²ä½é«åº¦", |
| | | depotConf.getDepotId()); |
| | | } |
| | | } |
| | | |
| | | return buildLLaysAndRows2(listPoints, listLays, listRows, result, depotConf); |
| | | } |
| | | |
| | | /** |
| | | * @param listLays |
| | | * @param cableX |
| | | * @param cableY |
| | | * @param cableZ |
| | | */ |
| | | private static void updateListLays(List<GrainLay> listLays, int cableX, |
| | | int cableY, int cableZ) {// å±ä»1å¼å§ |
| | | GrainLay lay; |
| | | for (int i = 1; i <= cableZ; i++) { |
| | | lay = new GrainLay(i, i - 1); |
| | | lay.setSumNum(cableY * cableX); |
| | | lay.setSumInNum((cableY - 2) * (cableX - 2)); |
| | | lay.setSumOutNum(2 * cableY + 2 * cableX - 4); |
| | | lay.setTempMin(50.0); |
| | | lay.setTempMax(-50.0); |
| | | listLays.add(lay); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @param listRows |
| | | * @param cableX |
| | | * @param cableY |
| | | * @param cableZ |
| | | */ |
| | | private static void updateListRows(List<GrainRow> listRows, int cableX, |
| | | int cableY, int cableZ) {// ä»0å¼å§ |
| | | GrainRow row; |
| | | for (int i = 0; i < cableY; i++) { |
| | | row = new GrainRow(i); |
| | | row.setSumNum(cableZ * cableX); |
| | | row.setTempMin(50.0); |
| | | row.setTempMax(-50.0); |
| | | listRows.add(row); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åçä»--仿¸©åº¦è§£æ |
| | | * |
| | | * @param listLays |
| | | * @param cableRuleAtt |
| | | * @param cableCirAtt |
| | | * @param layMax |
| | | * @param cableCone |
| | | */ |
| | | private static void updateListLaysCir(List<GrainLay> listLays, |
| | | String[] cableRuleAtt, String[] cableCirAtt, int layMax, String cableCone) { |
| | | GrainLay lay; |
| | | |
| | | Map<String, GrainLay> layMap = new HashMap<>(); |
| | | for (int j = 0; j < cableRuleAtt.length; j++) { |
| | | |
| | | for (int i = 1; i <= layMax; i++) { |
| | | if (layMap.containsKey(i + "")) { |
| | | lay = layMap.get(i + ""); |
| | | } else { |
| | | lay = new GrainLay(i, i); |
| | | } |
| | | int sumNum = lay.getSumNum(); |
| | | |
| | | if (cableCone.equals(Constant.CABLE_CONE_2)) { |
| | | if (Integer.parseInt(cableCirAtt[j]) >= i) { |
| | | sumNum += Integer.parseInt(cableRuleAtt[j]); |
| | | } |
| | | } else { |
| | | if (layMax - Integer.parseInt(cableCirAtt[j]) < i) { |
| | | sumNum += Integer.parseInt(cableRuleAtt[j]); |
| | | } |
| | | } |
| | | lay.setSumNum(sumNum); |
| | | lay.setSumInNum(1); |
| | | lay.setSumOutNum(1); |
| | | lay.setTempMin(50.0); |
| | | lay.setTempMax(-50.0); |
| | | layMap.put(i + "", lay); |
| | | } |
| | | } |
| | | for (int i = 1; i <= layMax; i++) { |
| | | listLays.add(layMap.get(i + "")); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åçä»--仿¸©åº¦è§£æ |
| | | * |
| | | * @param listLays |
| | | * @param cableRuleAtt |
| | | * @param cableCirAtt |
| | | * @param layMax |
| | | */ |
| | | private static void updateListLaysCir(List<GrainLay> listLays, |
| | | String[] cableRuleAtt, String[] cableCirAtt, int layMax) { |
| | | GrainLay lay; |
| | | for (int i = 1; i <= layMax; i++) { |
| | | lay = new GrainLay(i, i); |
| | | int sumNum = 0; |
| | | |
| | | for (int j = 0; j < cableRuleAtt.length; j++) { |
| | | if (Integer.valueOf(cableCirAtt[j]) >= i) { |
| | | sumNum += Integer.valueOf(cableRuleAtt[j]); |
| | | } |
| | | } |
| | | |
| | | lay.setSumNum(sumNum); |
| | | lay.setSumInNum(1); |
| | | lay.setSumOutNum(1); |
| | | lay.setTempMin(50.0); |
| | | lay.setTempMax(-50.0); |
| | | listLays.add(lay); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç²®æ
温度ï¼å¤ææ¯å¦è¦åå¼ï¼ç¶å转æ¢ä¸ºé¡µé¢éè¦æ¸²æçå¼ï¼ä¸»è¦å¤ç¨åæ
éçå¼çè°æ´ |
| | | * |
| | | * @param temp |
| | | * @return |
| | | */ |
| | | public static String renderTempValue(Double temp) { |
| | | |
| | | |
| | | if (temp > 45) return "æ
é"; |
| | | |
| | | if (temp == Constant.ERROR_TEMP) return "å¤ç¨"; |
| | | if (temp == Constant.FAULT_TEMP) return "æ
é"; |
| | | if (temp == Constant.ADD_TEMP) return "--"; |
| | | |
| | | return temp + ""; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.utils; |
| | | |
| | | import com.fzzy.igds.constant.DepotType; |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.data.PrintModeData; |
| | | |
| | | /** |
| | | * @Description ç²®æ
æå°æ¨¡æ¿åå°è®¾è®¡ï¼å½å为模æ¿è®¾è®¡å
¥å£ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | public class GrainPrintBuilder { |
| | | |
| | | /** |
| | | * è·åæå°æ¨¡æ¿ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public static PrintModeData buildPrintModel(GrainParam param) { |
| | | String depotType = param.getDepotType(); |
| | | //å¹³æ¹ä» |
| | | if (DepotType.TYPE_01.getCode().equals(depotType)) { |
| | | return GrainPrintBuilder01.buildModel(param); |
| | | } |
| | | //çä» |
| | | if (DepotType.TYPE_02.getCode().equals(depotType)) { |
| | | return GrainPrintBuilder04.buildModel(param); |
| | | } |
| | | |
| | | //æ²¹ç½ä» |
| | | if (DepotType.TYPE_03.getCode().equals(depotType)) { |
| | | return GrainPrintBuilder03.buildModel(param); |
| | | } |
| | | |
| | | //ç«åä» |
| | | if (DepotType.TYPE_04.getCode().equals(depotType)) { |
| | | return GrainPrintBuilder04.buildModel(param); |
| | | } |
| | | //å¹³æ¹ä» |
| | | return GrainPrintBuilder01.buildModel(param); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.utils; |
| | | |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.data.PrintModeData; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * @Description å¹³æ¹ä»æå°æ¨¡æ¿-éç¨ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Slf4j |
| | | public class GrainPrintBuilder01 { |
| | | |
| | | /** |
| | | * å¹³ä»ä»æå°æ¨¡æ¿ |
| | | **/ |
| | | public static PrintModeData buildModel(GrainParam param) { |
| | | PrintModeData result = new PrintModeData(); |
| | | result.setCompanyId(param.getCompanyId()); |
| | | result.setDepotType(param.getDepotType()); |
| | | |
| | | if (StringUtils.isEmpty(param.getCableRule())) { |
| | | result.setMsg("å½åç²®æ
没æè·åå°ç²®æ
å¸çº¿è§åé
ç½®ï¼æ æ³çææ¥è¡¨ï¼"); |
| | | return result; |
| | | } |
| | | |
| | | String[] attr = param.getCableRule().split("-"); |
| | | int cableZ = Integer.valueOf(attr[0]); |
| | | int cableY = Integer.valueOf(attr[1]); |
| | | int cableX = Integer.valueOf(attr[2]); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | //模æ¿å¤´ |
| | | sb.append("<!DOCTYPE html><html lang=\"zh-cn\"><head><meta http-equiv=\"Content-Type\"content=\"text/html; charset=UTF-8\"><title>å¹³æ¹ä»æ¥è¡¨</title></head><body>"); |
| | | |
| | | sb.append("<div id=\"print_main\" style=\"margin: 20px;\">"); |
| | | |
| | | //æ ·å¼è¡¨ï¼ä¸è½ç¼©è¿ |
| | | sb.append("<style>"); |
| | | sb.append("table,table tr th,table tr td {border:1px solid #0d1021}"); |
| | | sb.append("table {width:100%;line-height:23px;text-align:center;font-size:14px}"); |
| | | sb.append(".table-2 {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 tr {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 td {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".row-tr {border-left:0px !important;border-right:0px!important;border-top:0px !important}"); |
| | | sb.append(".row-tr1 {border-left:0px !important;border-right:0px !important;border-top:0px !important;font-size:12px}"); |
| | | sb.append(".row-fz {border:0px !important}"); |
| | | sb.append(".row-fz1 {border:0px !important;font-size:12px}"); |
| | | sb.append(".row-li1 {font-size:12px}"); |
| | | sb.append(".link-top {width:100%;border-top:solid #0d1021 1px}"); |
| | | sb.append("</style>"); |
| | | |
| | | sb.append("<div style=\"text-align: center\"><span style=\"font-size: 26px; font-weight: bold;\">companyNameç²®æ
æ¥è¡¨</span>"); |
| | | sb.append("<div class=\"link-top\"></div><div class=\"link-top\"></div>"); |
| | | sb.append("<span style=\"font-size: 16px;\">depotName ç²®æ
æ¥è¡¨</span></div>"); |
| | | |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">天æ°ï¼weather æ¹åï¼</span><span style=\"float: right;\">æ£æµæ¶é´ï¼checkDate</span></div>"); |
| | | |
| | | //<!--å¨æåæ --> |
| | | sb.append("<table cellspacing=\"0\" cellpadding=\"0\">"); |
| | | sb.append("<tr>"); |
| | | |
| | | if (cableX > 18) { |
| | | sb.append("<td colspan=\"2\" class='row-li1'></td>"); |
| | | } else { |
| | | sb.append("<td colspan=\"2\"></td>"); |
| | | } |
| | | |
| | | for (int i = 1; i <= cableX; i++) { |
| | | if (cableX > 18) { |
| | | sb.append("<td class='row-li1'>"); |
| | | } else { |
| | | sb.append("<td>"); |
| | | } |
| | | |
| | | sb.append("第" + i + "å"); |
| | | sb.append("</td>"); |
| | | } |
| | | sb.append("</tr>"); |
| | | |
| | | // <!-- 卿å--> |
| | | for (int y = 1; y <= cableY; y++) { |
| | | String className = "row-fz"; |
| | | if (cableX > 18) className = "row-fz1"; |
| | | for (int z = 1; z <= cableZ; z++) { |
| | | sb.append("<tr>"); |
| | | if (z == cableZ) { |
| | | className = "row-tr"; |
| | | if (cableX > 18) className = "row-tr1"; |
| | | } |
| | | //è¡ |
| | | if (z == 1) { |
| | | sb.append("<td rowspan='"); |
| | | sb.append(cableZ); |
| | | sb.append("' class='"); |
| | | if (cableX > 18) { |
| | | sb.append("row-tr1"); |
| | | } else { |
| | | sb.append("row-tr"); |
| | | } |
| | | sb.append("'>"); |
| | | sb.append(y); |
| | | sb.append("è¡</td>"); |
| | | } |
| | | //å± |
| | | sb.append("<td class='"); |
| | | sb.append(className); |
| | | sb.append("'>" + z + "å±</td>"); |
| | | |
| | | //æ·»å æ°æ® |
| | | for (int x = cableX; x >= 1; x--) { |
| | | sb.append("<td class='"); |
| | | sb.append(className); |
| | | sb.append("'>"); |
| | | sb.append(z + "_" + y + "_" + x); |
| | | sb.append("</td>"); |
| | | } |
| | | } |
| | | |
| | | sb.append("<tr>"); |
| | | } |
| | | sb.append("</table>"); |
| | | |
| | | // <!--卿å±è¡¨æ ¼--> |
| | | sb.append("<table cellspacing=\"0\" cellpadding=\"0\" class=\"table-2\"><tr><td width=\"200px\">ç²®æ
åæï¼</td><td colspan=\"5\">"); |
| | | sb.append("remark</td></tr><tr><td></td><td width=\"16.6%\">æé«</td><td width=\"16.6%\">æä½</td><td width=\"16.6%\">å¹³å</td><td width=\"16.6%\">å¨å</td><td width=\"16.6%\">å
å</td></tr>"); |
| | | //å±ä¿¡æ¯ |
| | | for (int k = 1; k <= cableZ; k++) { |
| | | sb.append("<tr>\n<td>第"); |
| | | sb.append(k); |
| | | sb.append("å±</td>"); |
| | | sb.append("<td>c_max_" + k + "</td>"); |
| | | sb.append("<td>c_min_" + k + "</td>"); |
| | | sb.append("<td>c_ave_" + k + "</td>"); |
| | | sb.append("<td>c_out_ave_" + k + "</td>"); |
| | | sb.append("<td>c_in_ave_" + k + "</td>"); |
| | | sb.append("</tr>"); |
| | | } |
| | | |
| | | //æ´ä» |
| | | sb.append("<tr><td>æ´ ä»</td>"); |
| | | sb.append("<td>c_max_all</td>"); |
| | | sb.append("<td>c_min_all</td>"); |
| | | sb.append("<td>c_ave_all</td>"); |
| | | sb.append("<td>c_out_ave_all</td>"); |
| | | sb.append("<td>c_in_ave_all</td>"); |
| | | |
| | | //<!-- åºå®æ°æ®--> |
| | | sb.append("<tr><td >仿¸©ï¼c_tIn</td><td >仿¹¿ï¼c_hIn</td><td colspan=\"2\">æ°æ¸©ï¼c_tOut</td><td colspan=\"2\">æ°æ¹¿ï¼c_hOut</td></tr>"); |
| | | sb.append("<tr><td>仿¿ç±»å</td><td >c_depotType</td><td colspan=\"2\">å
¥ä»æ¥æ</td><td colspan=\"2\">c_storeDate</td></tr>"); |
| | | sb.append("<tr><td>æè´¨ï¼%ï¼</td><td>c_perImpurity</td><td colspan=\"2\">ç²®é£äº§å°</td><td colspan=\"2\">c_foodLocation</td></tr>"); |
| | | sb.append("<tr><td>æ£æµäºº</td><td>c_checkUser</td><td colspan=\"2\">ä¿ç®¡å</td><td colspan=\"2\">c_storeKeeperName</td></tr>"); |
| | | sb.append("</table>"); |
| | | |
| | | // <!--å°¾é¨ä¿¡æ¯ --> |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">注ï¼#è¡¨ç¤ºå±æä½æ¸© *è¡¨ç¤ºå±æé«æ¸©</span><span style=\"float: right;\">å¶è¡¨æ¶é´ï¼createBillDate</span></div>"); |
| | | sb.append("</div></body></html>"); |
| | | |
| | | log.debug("è·åå°çç²®æ
模æ¿={}", sb.toString()); |
| | | |
| | | |
| | | result.setModel(sb.toString()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.utils; |
| | | |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.data.PrintModeData; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * @Description æ²¹æ¡¶ä»æå°æ¨¡æ¿ -éç¨ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Slf4j |
| | | public class GrainPrintBuilder03 { |
| | | |
| | | /** |
| | | * æ²¹ç½ä» |
| | | **/ |
| | | public static PrintModeData buildModel(GrainParam param) { |
| | | PrintModeData result = new PrintModeData(); |
| | | result.setCompanyId(param.getCompanyId()); |
| | | result.setDepotType(param.getDepotType()); |
| | | |
| | | if (StringUtils.isEmpty(param.getCableRule()) || StringUtils.isEmpty(param.getCableCir())) { |
| | | result.setMsg("å½åç²®æ
没æè·åå°ç²®æ
å¸çº¿è§åé
ç½®ï¼æ æ³çææ¥è¡¨ï¼"); |
| | | return result; |
| | | } |
| | | |
| | | //è·åå±çæé«å¼ |
| | | int layMax = 1; |
| | | String[] arrLay = param.getCableCir().split("-"); |
| | | for (String lay : arrLay) { |
| | | if (Integer.valueOf(lay) > layMax) layMax = Integer.valueOf(lay); |
| | | } |
| | | |
| | | String[] arrRule = param.getCableRule().split("-"); |
| | | int cirNum = arrRule.length; |
| | | |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | //模æ¿å¤´ |
| | | sb.append("<!DOCTYPE html><html lang=\"zh-cn\"><head><meta http-equiv=\"Content-Type\"content=\"text/html; charset=UTF-8\"><title>ç仿¥è¡¨</title></head><body>"); |
| | | |
| | | sb.append("<div id=\"print_main\" style=\"margin: 20px;\">"); |
| | | |
| | | //æ ·å¼è¡¨ï¼ä¸è½ç¼©è¿ |
| | | sb.append("<style>"); |
| | | sb.append("table,table tr th,table tr td {border:1px solid #0d1021}"); |
| | | sb.append("table {width:100%;line-height:23px;text-align:center;font-size:14px}"); |
| | | sb.append(".table-2 {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 tr {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 td {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".row-tr {border-left:0px !important;border-right:0px!important;border-top:0px !important}"); |
| | | sb.append(".row-tr1 {border-left:0px !important;border-right:0px !important;border-top:0px !important;font-size:12px}"); |
| | | sb.append(".row-fz {border:0px !important}"); |
| | | sb.append(".row-fz1 {border:0px !important;font-size:12px}"); |
| | | sb.append(".row-li1 {font-size:12px}"); |
| | | sb.append(".link-top {width:100%;border-top:solid #0d1021 1px}"); |
| | | sb.append("</style>"); |
| | | |
| | | sb.append("<div style=\"text-align: center\"><span style=\"font-size: 26px; font-weight: bold;\">companyNameç²®æ
æ¥è¡¨</span>"); |
| | | sb.append("<div class=\"link-top\"></div><div class=\"link-top\"></div>"); |
| | | sb.append("<span style=\"font-size: 16px;\">depotName ç²®æ
æ¥è¡¨</span></div>"); |
| | | |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">天æ°ï¼weather æ¹åï¼</span><span style=\"float: right;\">æ£æµæ¶é´ï¼checkDate</span></div>"); |
| | | |
| | | //<!--å¨æåæ --> |
| | | sb.append("<table cellspacing=\"0\" cellpadding=\"0\">"); |
| | | sb.append("<tr>"); |
| | | sb.append("<td colspan=\"2\"></td>"); |
| | | for (int i = 1; i <= layMax; i++) { |
| | | sb.append("<td>"); |
| | | sb.append("第" + i + "å±"); |
| | | sb.append("</td>"); |
| | | } |
| | | sb.append("</tr>"); |
| | | |
| | | // <!-- 卿å--> |
| | | for (int i = 1; i <= cirNum; i++) { |
| | | //æ¯åçæ ¹æ° |
| | | int rootNum = Integer.valueOf(arrRule[i - 1]); |
| | | //æ¯å屿° |
| | | int curLayNum = Integer.valueOf(arrLay[i - 1]); |
| | | |
| | | String className = "row-fz"; |
| | | for (int j = 1; j <= rootNum; j++) { |
| | | if (j == rootNum) { |
| | | className = "row-tr"; |
| | | } |
| | | sb.append("<tr>"); |
| | | if (j == 1) { |
| | | sb.append("<td rowspan=\""); |
| | | sb.append(rootNum); |
| | | sb.append("\" class=\""); |
| | | sb.append("row-tr");//åºå® |
| | | sb.append("\">"); |
| | | sb.append(i); |
| | | sb.append("å</td>"); |
| | | } |
| | | //æ·»å æ ¹æ° |
| | | sb.append("<td class=\""); |
| | | sb.append(className); |
| | | sb.append("\">"); |
| | | sb.append(j); |
| | | sb.append("æ ¹</td>"); |
| | | |
| | | //æ·»å æ¯æ ¹çå¼ï¼å¦æå½åæ ¹æ²¡æé£ä¹å¤å±ï¼å䏿·»å å¼ä¿ç空 |
| | | for (int k = 1; k <= layMax; k++) { |
| | | if (curLayNum < layMax) { |
| | | sb.append("<td class=\""); |
| | | sb.append(className); |
| | | sb.append("\"></td>"); |
| | | } else { |
| | | sb.append("<td class=\""); |
| | | sb.append(className); |
| | | sb.append("\">"); |
| | | sb.append(i + "_" + j + "_" + k); |
| | | sb.append("</td>"); |
| | | } |
| | | } |
| | | sb.append("</tr>"); |
| | | } |
| | | |
| | | } |
| | | sb.append("</table>"); |
| | | |
| | | // <!--卿å±è¡¨æ ¼--> |
| | | sb.append("<table cellspacing=\"0\" cellpadding=\"0\" class=\"table-2\"><tr><td width=\"200px\">ç²®æ
åæï¼</td><td colspan=\"5\">"); |
| | | sb.append("remark</td></tr><tr><td></td><td width=\"16.6%\">æé«</td><td width=\"16.6%\">æä½</td><td width=\"16.6%\">å¹³å</td><td width=\"16.6%\">å¨å</td><td width=\"16.6%\">å
å</td></tr>"); |
| | | //å±ä¿¡æ¯ |
| | | for (int k = 1; k <= layMax; k++) { |
| | | sb.append("<tr>\n<td>第"); |
| | | sb.append(k); |
| | | sb.append("å±</td>"); |
| | | sb.append("<td>c_max_" + k + "</td>"); |
| | | sb.append("<td>c_min_" + k + "</td>"); |
| | | sb.append("<td>c_ave_" + k + "</td>"); |
| | | sb.append("<td>c_out_ave_" + k + "</td>"); |
| | | sb.append("<td>c_in_ave_" + k + "</td>"); |
| | | sb.append("</tr>"); |
| | | } |
| | | |
| | | //æ´ä» |
| | | sb.append("<tr><td>æ´ ä»</td>"); |
| | | sb.append("<td>c_max_all</td>"); |
| | | sb.append("<td>c_min_all</td>"); |
| | | sb.append("<td>c_ave_all</td>"); |
| | | sb.append("<td>c_out_ave_all</td>"); |
| | | sb.append("<td>c_in_ave_all</td>"); |
| | | |
| | | //<!-- åºå®æ°æ®--> |
| | | sb.append("<tr><td >仿¸©ï¼c_tIn</td><td >仿¹¿ï¼c_hIn</td><td colspan=\"2\">æ°æ¸©ï¼c_tOut</td><td colspan=\"2\">æ°æ¹¿ï¼c_hOut</td></tr>"); |
| | | sb.append("<tr><td>æ²¹ç½é«åº¦</td><td >c_depotHeight ç±³</td><td colspan=\"2\">æ¶²ä½é«åº¦</td><td colspan=\"2\">c_oilHeight ç±³</td></tr>"); |
| | | sb.append("<tr><td>仿¿ç±»å</td><td >c_depotType</td><td colspan=\"2\">å
¥ä»æ¥æ</td><td colspan=\"2\">c_storeDate</td></tr>"); |
| | | sb.append("<tr><td>æè´¨ï¼%ï¼</td><td>c_perImpurity</td><td colspan=\"2\">ç²®é£äº§å°</td><td colspan=\"2\">c_foodLocation</td></tr>"); |
| | | sb.append("<tr><td>æ£æµäºº</td><td>c_checkUser</td><td colspan=\"2\">ä¿ç®¡å</td><td colspan=\"2\">c_storeKeeperName</td></tr>"); |
| | | sb.append("</table>"); |
| | | |
| | | // <!--å°¾é¨ä¿¡æ¯ --> |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">注ï¼#è¡¨ç¤ºå±æä½æ¸© *è¡¨ç¤ºå±æé«æ¸©</span><span style=\"float: right;\">å¶è¡¨æ¶é´ï¼createBillDate</span></div>"); |
| | | sb.append("</div></body></html>"); |
| | | |
| | | log.debug("è·åå°çç²®æ
模æ¿={}", sb.toString()); |
| | | |
| | | result.setModel(sb.toString()); |
| | | return result; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.utils; |
| | | |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.data.PrintModeData; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * @Description ç仿尿¨¡æ¿-å
æ¬åçä»åæµ
åä» -éç¨ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Slf4j |
| | | public class GrainPrintBuilder04 { |
| | | |
| | | public static PrintModeData buildModel(GrainParam param) { |
| | | PrintModeData result = new PrintModeData(); |
| | | result.setCompanyId(param.getCompanyId()); |
| | | result.setDepotType(param.getDepotType()); |
| | | |
| | | if (StringUtils.isEmpty(param.getCableRule()) || StringUtils.isEmpty(param.getCableCir())) { |
| | | result.setMsg("å½åç²®æ
没æè·åå°ç²®æ
å¸çº¿è§åé
ç½®ï¼æ æ³çææ¥è¡¨ï¼"); |
| | | return result; |
| | | } |
| | | |
| | | //è·åå±çæé«å¼ |
| | | int layMax = 1; |
| | | String[] arrLay = param.getCableCir().split("-"); |
| | | for (String lay : arrLay) { |
| | | if (Integer.valueOf(lay) > layMax) layMax = Integer.valueOf(lay); |
| | | } |
| | | |
| | | String[] arrRule = param.getCableRule().split("-"); |
| | | int cirNum = arrRule.length; |
| | | |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | //模æ¿å¤´ |
| | | sb.append("<!DOCTYPE html><html lang=\"zh-cn\"><head><meta http-equiv=\"Content-Type\"content=\"text/html; charset=UTF-8\"><title>ç仿¥è¡¨</title></head><body>"); |
| | | |
| | | sb.append("<div id=\"print_main\" style=\"margin: 20px;\">"); |
| | | |
| | | //æ ·å¼è¡¨ï¼ä¸è½ç¼©è¿ |
| | | sb.append("<style>"); |
| | | sb.append("table,table tr th,table tr td {border:1px solid #0d1021}"); |
| | | sb.append("table {width:100%;line-height:23px;text-align:center;font-size:14px}"); |
| | | sb.append(".table-2 {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 tr {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 td {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".row-tr {border-left:0px !important;border-right:0px!important;border-top:0px !important}"); |
| | | sb.append(".row-tr1 {border-left:0px !important;border-right:0px !important;border-top:0px !important;font-size:12px}"); |
| | | sb.append(".row-fz {border:0px !important}"); |
| | | sb.append(".row-fz1 {border:0px !important;font-size:12px}"); |
| | | sb.append(".row-li1 {font-size:12px}"); |
| | | sb.append(".link-top {width:100%;border-top:solid #0d1021 1px}"); |
| | | sb.append("</style>"); |
| | | |
| | | sb.append("<div style=\"text-align: center\"><span style=\"font-size: 26px; font-weight: bold;\">companyNameç²®æ
æ¥è¡¨</span>"); |
| | | sb.append("<div class=\"link-top\"></div><div class=\"link-top\"></div>"); |
| | | sb.append("<span style=\"font-size: 16px;\">depotName ç²®æ
æ¥è¡¨</span></div>"); |
| | | |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">天æ°ï¼weather æ¹åï¼</span><span style=\"float: right;\">æ£æµæ¶é´ï¼checkDate</span></div>"); |
| | | |
| | | //<!--å¨æåæ --> |
| | | sb.append("<table cellspacing=\"0\" cellpadding=\"0\">"); |
| | | //-----屿°----- |
| | | sb.append("<tr>"); |
| | | sb.append("<td colspan=\"2\"></td>"); |
| | | for (int i = 1; i <= layMax; i++) { |
| | | sb.append("<td>"); |
| | | sb.append(i + "å±"); |
| | | sb.append("</td>"); |
| | | } |
| | | sb.append("</tr>"); |
| | | //-----æ¯ååæ ¹å
·ä½æ°æ®----- |
| | | int startGen = 0; |
| | | int endGen = 0; |
| | | int curGen = 0; |
| | | for (int i = 1; i <= cirNum; i++) { |
| | | //æ¯åçæ ¹æ° |
| | | if(i==1){ |
| | | startGen = 1; |
| | | }else { |
| | | startGen = endGen + 1; |
| | | } |
| | | curGen = Integer.valueOf(arrRule[i - 1]); |
| | | endGen += curGen; |
| | | |
| | | //æ¯å屿° |
| | | int curLayNum = Integer.valueOf(arrLay[i - 1]); |
| | | |
| | | String className = "row-fz"; |
| | | for (int j = startGen; j <= endGen; j++) { |
| | | if (j == endGen) { |
| | | className = "row-tr"; |
| | | } |
| | | sb.append("<tr>"); |
| | | if (j == startGen) { |
| | | sb.append("<td rowspan=\""); |
| | | sb.append(curGen); |
| | | sb.append("\" class=\""); |
| | | sb.append("row-tr"); |
| | | sb.append("\">"); |
| | | sb.append(i); |
| | | sb.append("å</td>"); |
| | | } |
| | | //æ·»å æ ¹æ° |
| | | sb.append("<td class=\""); |
| | | sb.append(className); |
| | | sb.append("\">"); |
| | | sb.append(j); |
| | | sb.append("æ ¹</td>"); |
| | | //æ·»å æ¯æ ¹çå¼ï¼å¦æå½åæ ¹æ²¡æé£ä¹å¤å±ï¼å䏿·»å å¼ä¿ç空 |
| | | for (int k = 1; k <= layMax; k++) { |
| | | sb.append("<td class=\""); |
| | | sb.append(className); |
| | | sb.append("\">"); |
| | | sb.append(i + "_" + j + "_" + k); |
| | | sb.append("</td>"); |
| | | } |
| | | sb.append("</tr>"); |
| | | } |
| | | } |
| | | |
| | | //-----åå±åæ(æé«ãå¹³åãæä½)----- |
| | | String classNme1 = "row-fz"; |
| | | String valueName = ""; |
| | | for (int i = 1; i <= 3; i++) { |
| | | sb.append("<tr>"); |
| | | if(i == 1){ |
| | | valueName = "c_max_"; |
| | | sb.append("<td rowspan=\"3\" class=\"row-tr\">å屿±æ»</td>"); |
| | | sb.append("<td class=\"row-fz\">æé«</td>"); |
| | | }else if(i == 2){ |
| | | valueName = "c_ave_"; |
| | | sb.append("<td class=\""); |
| | | sb.append("classNme1"); |
| | | sb.append("\">å¹³å</td>"); |
| | | }else { |
| | | classNme1 = "row-tr"; |
| | | valueName = "c_min_"; |
| | | sb.append("<td class=\""); |
| | | sb.append("classNme1"); |
| | | sb.append("\">æä½</td>"); |
| | | } |
| | | for (int k = 1; k <= layMax; k++) { |
| | | sb.append("<td "); |
| | | sb.append("class=\""); |
| | | sb.append(classNme1); |
| | | sb.append("\">"); |
| | | sb.append(valueName); |
| | | sb.append(k); |
| | | sb.append("</td>"); |
| | | } |
| | | sb.append("</tr>"); |
| | | } |
| | | sb.append("</table>"); |
| | | |
| | | //ä»åºåºæ¬ä¿¡æ¯ |
| | | sb.append("<table cellspacing=\"0\"cellpadding=\"0\"class=\"table-2\">"); |
| | | sb.append("<tr><td colspan=\"8\">æ´ä»åæ</td></tr><tr><td>仿¸©</td><td>c_tIn</td><td>仿¹¿</td><td>c_hIn</td><td>æ°æ¸©</td><td>c_tOut</td><td>æ°æ¹¿</td><td>c_hOut</td></tr>"); |
| | | sb.append("<tr><td>屿é«</td><td>c_max_all</td><td>å±å¹³å</td><td>c_ave_all</td><td>屿ä½</td><td>c_min_all</td><td></td><td></td></tr>"); |
| | | sb.append("<tr><td>仿¿ç±»å</td><td>c_depotType</td><td>å
¥ä»æ¥æ</td><td>c_storeDate</td><td>æ°´å(%)</td><td>c_perWet</td><td>æè´¨(%)</td><td>c_perImpurity</td></tr>"); |
| | | sb.append("<tr><td>ç²®é£åç§</td><td>c_foodVariety</td><td>ç²®é£äº§å°</td><td>c_foodLocation</td><td>容é(kg/m3)</td><td>c_bulkWeight</td><td>å®é
å¨é(å¨)</td><td>c_storageReal</td></tr>"); |
| | | sb.append("<tr><td colspan=\"2\">ä¿ç®¡å</td><td colspan=\"2\">c_storeKeeperName</td><td colspan=\"2\">æ£æµäºº</td><td colspan=\"2\">c_checkUser</td></tr>"); |
| | | sb.append("</table>"); |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">注ï¼#è¡¨ç¤ºå±æä½æ¸© *è¡¨ç¤ºå±æé«æ¸©</span><span style=\"float: right;\">å¶è¡¨æ¶é´ï¼createBillDate</span></div>"); |
| | | sb.append("</div></body></html>"); |
| | | |
| | | log.debug("è·åå°çç²®æ
模æ¿={}", sb.toString()); |
| | | |
| | | result.setModel(sb.toString()); |
| | | return result; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.utils; |
| | | |
| | | import com.fzzy.igds.data.GrainParam; |
| | | import com.fzzy.igds.data.PrintModeData; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | /** |
| | | * @Description å¹³æ¹ä»æå°æ¨¡æ¿-横åé飿¨¡æ¿ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Slf4j |
| | | public class GrainPrintBuilderLay01 { |
| | | |
| | | /** |
| | | * å¹³ä»ä»æå°æ¨¡æ¿ |
| | | **/ |
| | | public static PrintModeData buildModel(GrainParam param) { |
| | | PrintModeData result = new PrintModeData(); |
| | | result.setCompanyId(param.getCompanyId()); |
| | | result.setDepotType(param.getDepotType()); |
| | | |
| | | if (StringUtils.isEmpty(param.getCableRule())) { |
| | | result.setMsg("å½åç²®æ
没æè·åå°ç²®æ
å¸çº¿è§åé
ç½®ï¼æ æ³çææ¥è¡¨ï¼"); |
| | | return result; |
| | | } |
| | | |
| | | String cableRule = param.getCableRule(); |
| | | String[] attr = cableRule.split("-"); |
| | | int cableZ = Integer.valueOf(attr[0]); |
| | | int cableY = Integer.valueOf(attr[1]); |
| | | int cableX = Integer.valueOf(attr[2]); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | //模æ¿å¤´ |
| | | sb.append("<!DOCTYPE html><html lang=\"zh-cn\"><head><meta http-equiv=\"Content-Type\"content=\"text/html; charset=UTF-8\"><title>å¹³æ¹ä»æ¥è¡¨</title></head><body>"); |
| | | |
| | | sb.append("<div id=\"print_main\" style=\"margin: 20px;\">"); |
| | | |
| | | //æ ·å¼è¡¨ï¼ä¸è½ç¼©è¿ |
| | | sb.append("<style>"); |
| | | sb.append("table,table tr th,table tr td {border:1px solid #0d1021}"); |
| | | sb.append("table {width:100%;line-height:23px;text-align:center;font-size:14px}"); |
| | | sb.append(".table-2 {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 tr {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".table-2 td {border-top:0px solid #0d1021 !important}"); |
| | | sb.append(".row-tr {border-left:0px !important;border-right:0px!important;border-top:0px !important}"); |
| | | sb.append(".row-tr1 {border-left:0px !important;border-right:0px !important;border-top:0px !important;font-size:12px}"); |
| | | sb.append(".row-fz {border:0px !important}"); |
| | | sb.append(".row-fz1 {border:0px !important;font-size:12px}"); |
| | | sb.append(".row-li1 {font-size:12px}"); |
| | | sb.append(".link-top {width:100%;border-top:solid #0d1021 1px}"); |
| | | sb.append("</style>"); |
| | | |
| | | sb.append("<div style=\"text-align: center\"><span style=\"font-size: 26px; font-weight: bold;\">companyNameç²®æ
æ¥è¡¨</span>"); |
| | | sb.append("<div class=\"link-top\"></div><div class=\"link-top\"></div>"); |
| | | sb.append("<span style=\"font-size: 16px;\">depotName ç²®æ
æ¥è¡¨</span></div>"); |
| | | |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">天æ°ï¼weather æ¹åï¼</span><span style=\"float: right;\">æ£æµæ¶é´ï¼checkDate</span></div>"); |
| | | |
| | | //<!--å¨æåæ --> |
| | | sb.append("<table cellspacing=\"0\" cellpadding=\"0\">"); |
| | | sb.append("<tr>"); |
| | | |
| | | if (cableX > 18) { |
| | | sb.append("<td colspan=\"2\" class='row-li1'></td>"); |
| | | } else { |
| | | sb.append("<td colspan=\"2\"></td>"); |
| | | } |
| | | |
| | | for (int i = 1; i <= cableX; i++) { |
| | | if (cableX > 18) { |
| | | sb.append("<td class='row-li1'>"); |
| | | } else { |
| | | sb.append("<td>"); |
| | | } |
| | | |
| | | sb.append("第" + i + "å"); |
| | | sb.append("</td>"); |
| | | } |
| | | sb.append("</tr>"); |
| | | |
| | | // <!-- 卿å--> |
| | | for (int y = 1; y <= cableY; y++) { |
| | | String className = "row-fz"; |
| | | if (cableX > 18) className = "row-fz1"; |
| | | for (int z = 1; z <= cableZ; z++) { |
| | | sb.append("<tr>"); |
| | | if (z == cableZ) { |
| | | className = "row-tr"; |
| | | if (cableX > 18) className = "row-tr1"; |
| | | } |
| | | //è¡ |
| | | if (z == 1) { |
| | | sb.append("<td rowspan='"); |
| | | sb.append(cableZ); |
| | | sb.append("' class='"); |
| | | if (cableX > 18) { |
| | | sb.append("row-tr1"); |
| | | } else { |
| | | sb.append("row-tr"); |
| | | } |
| | | sb.append("'>"); |
| | | sb.append(y); |
| | | sb.append("è¡</td>"); |
| | | } |
| | | //å± |
| | | sb.append("<td class='"); |
| | | sb.append(className); |
| | | sb.append("'>" + z + "å±</td>"); |
| | | |
| | | //æ·»å æ°æ® |
| | | for (int x = cableX; x >= 1; x--) { |
| | | sb.append("<td class='"); |
| | | sb.append(className); |
| | | sb.append("'>"); |
| | | sb.append(z + "_" + y + "_" + x); |
| | | sb.append("</td>"); |
| | | } |
| | | } |
| | | |
| | | sb.append("<tr>"); |
| | | } |
| | | sb.append("</table>"); |
| | | |
| | | // <!--卿å±è¡¨æ ¼--> |
| | | sb.append("<table cellspacing=\"0\" cellpadding=\"0\" class=\"table-2\"><tr><td width=\"200px\">ç²®æ
åæï¼</td><td colspan=\"5\">"); |
| | | sb.append("remark</td></tr><tr><td></td><td width=\"16.6%\">æé«</td><td width=\"16.6%\">æä½</td><td width=\"16.6%\">å¹³å</td><td width=\"16.6%\">å¨å</td><td width=\"16.6%\">å
å</td></tr>"); |
| | | //è¡è§åï¼æ²¡æå¨è®¡ç® |
| | | for (int k = 1; k <= cableY; k++) { |
| | | sb.append("<tr>\n<td>第"); |
| | | sb.append(k); |
| | | sb.append("è¡</td>"); |
| | | sb.append("<td>c_max_" + k + "</td>"); |
| | | sb.append("<td>c_min_" + k + "</td>"); |
| | | sb.append("<td>c_ave_" + k + "</td>"); |
| | | sb.append("<td></td>"); |
| | | sb.append("<td></td>"); |
| | | sb.append("</tr>"); |
| | | } |
| | | |
| | | //æ´ä» |
| | | sb.append("<tr><td>æ´ ä»</td>"); |
| | | sb.append("<td>c_max_all</td>"); |
| | | sb.append("<td>c_min_all</td>"); |
| | | sb.append("<td>c_ave_all</td>"); |
| | | sb.append("<td>c_out_ave_all</td>"); |
| | | sb.append("<td>c_in_ave_all</td>"); |
| | | |
| | | //<!-- åºå®æ°æ®--> |
| | | sb.append("<tr><td >仿¸©ï¼c_tIn</td><td >仿¹¿ï¼c_hIn</td><td colspan=\"2\">æ°æ¸©ï¼c_tOut</td><td colspan=\"2\">æ°æ¹¿ï¼c_hOut</td></tr>"); |
| | | sb.append("<tr><td>仿¿ç±»å</td><td >c_depotType</td><td colspan=\"2\">å
¥ä»æ¥æ</td><td colspan=\"2\">c_storeDate</td></tr>"); |
| | | sb.append("<tr><td>æè´¨ï¼%ï¼</td><td>c_perImpurity</td><td colspan=\"2\">ç²®é£äº§å°</td><td colspan=\"2\">c_foodLocation</td></tr>"); |
| | | sb.append("<tr><td>æ£æµäºº</td><td>c_checkUser</td><td colspan=\"2\">ä¿ç®¡å</td><td colspan=\"2\">c_storeKeeperName</td></tr>"); |
| | | sb.append("</table>"); |
| | | |
| | | // <!--å°¾é¨ä¿¡æ¯ --> |
| | | sb.append("<div style=\"margin-top: 5px;\"><span style=\"float: left;\">注ï¼#è¡¨ç¤ºå±æä½æ¸© *è¡¨ç¤ºå±æé«æ¸©</span><span style=\"float: right;\">å¶è¡¨æ¶é´ï¼createBillDate</span></div>"); |
| | | sb.append("</div></body></html>"); |
| | | |
| | | log.debug("è·åå°çç²®æ
模æ¿={}", sb.toString()); |
| | | |
| | | |
| | | result.setModelType("ROW"); |
| | | result.setModel(sb.toString()); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <groupId>com.fzzy</groupId> |
| | | <artifactId>fzzy-igdss-io</artifactId> |
| | | <version>${fzzy.igdss.version}</version> |
| | | |
| | | <parent> |
| | | <artifactId>fzzy-igdss-parent</artifactId> |
| | | <groupId>com.fzzy</groupId> |
| | | <version>2.0.0</version> |
| | | <relativePath>../fzzy-igdss-parent/pom.xml</relativePath> |
| | | </parent> |
| | | |
| | | <description> |
| | | io模å |
| | | </description> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>com.fzzy</groupId> |
| | | <artifactId>fzzy-igdss-core</artifactId> |
| | | <version>${fzzy.igdss.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- å¼å
¥IOå
--> |
| | | <dependency> |
| | | <groupId>com.ld.base.io</groupId> |
| | | <artifactId>base-io-netty</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | <!-- <scope>system</scope>--> |
| | | <!-- <systemPath>${project.basedir}/src/main/resources/lib/base-io-netty-1.0.0-SNAPSHOT.jar</systemPath>--> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ld.base.io</groupId> |
| | | <artifactId>base-io-api</artifactId> |
| | | <version>1.0.0-SNAPSHOT</version> |
| | | <!-- <scope>system</scope>--> |
| | | <!-- <systemPath>${project.basedir}/src/main/resources/lib/base-io-api-1.0.0-SNAPSHOT.jar</systemPath>--> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <source>1.8</source> |
| | | <target>1.8</target> |
| | | <compilerArguments> |
| | | <extdirs>src\main\webapp\WEB-INF\lib</extdirs> |
| | | </compilerArguments> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | <resources> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | <include>**/*.js</include> |
| | | </includes> |
| | | <filtering>true</filtering> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | </resource> |
| | | </resources> |
| | | </build> |
| | | </project> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.io.manager; |
| | | |
| | | import com.fzzy.igds.io.service.RemoteGrainService; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description æ¥å£Apiææåè®®çåè®®ç±»ï¼æ ¹æ®ä¸åçåè®®é
ç½®è°ç¨ä¸åçåè®®å®ç° |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Component(RemoteManager.BEAN_ID) |
| | | public class RemoteManager implements ApplicationContextAware { |
| | | |
| | | public static final String BEAN_ID = "core.remoteManager"; |
| | | |
| | | /** |
| | | * ç¨äºåæ¾ææRemoteGrainService æ¥å£çå®ç°ç±» |
| | | */ |
| | | public static Map<String, RemoteGrainService> remoteGrainMap = new HashMap<>(); |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) |
| | | throws BeansException { |
| | | Map<String, RemoteGrainService> grainMap = applicationContext |
| | | .getBeansOfType(RemoteGrainService.class); |
| | | |
| | | for (String key : grainMap.keySet()) { |
| | | remoteGrainMap.put(grainMap.get(key).getProtocol(), |
| | | grainMap.get(key)); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åè®®è·ååè®®å®ç°æ¥å£ |
| | | * |
| | | * @param protocol |
| | | * @return |
| | | */ |
| | | public RemoteGrainService getRemoteGrainService(String protocol) { |
| | | return remoteGrainMap.get(protocol); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.io.order; |
| | | |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.LogOperation; |
| | | import com.fzzy.igds.request.ExeBaseRequest; |
| | | import com.fzzy.igds.request.ReqStatus; |
| | | import com.fzzy.igds.request.ThReqData; |
| | | import com.fzzy.igds.service.LogOperationService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * @Description å½ä»¤æ§è¡æ ¡éªçä¿¡æ¯æ¥å£ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | @Service |
| | | public class ExeOrderService { |
| | | |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | @Resource |
| | | private LogOperationService logService; |
| | | |
| | | /** |
| | | * |
| | | * @param baseRequest |
| | | */ |
| | | public void addCache(ExeBaseRequest baseRequest) { |
| | | // æ·»å ç¼å |
| | | this.addReqCache(baseRequest); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param request |
| | | */ |
| | | public void addLog(ExeBaseRequest request) { |
| | | // æ·»å æ¥å¿ |
| | | this.addLogByExeReq(request); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param baseRequest |
| | | */ |
| | | public void addLogAndCache(ExeBaseRequest baseRequest) { |
| | | |
| | | // æ·»å ç¼å |
| | | this.addReqCache(baseRequest); |
| | | |
| | | // æ·»å æ¥å¿ |
| | | this.addLogByExeReq(baseRequest); |
| | | } |
| | | |
| | | /** |
| | | * åæ¾æ¸©æ¹¿åº¦å½ä»¤ç¼å |
| | | * @param request |
| | | */ |
| | | public void addThCache(ExeBaseRequest request) { |
| | | |
| | | ThReqData reqData = (ThReqData) request.getReqData(); |
| | | |
| | | if (null == reqData) return; |
| | | |
| | | String key = this.buildExeOrderKey(request.getBizType(), |
| | | request.getDeptId(), request.getSerId() + "_" + reqData.getThConf(), request.getRequestId()); |
| | | |
| | | redisCache.setCacheObject(key, request, 8 * 60, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param companyId |
| | | * @param serId |
| | | * @return |
| | | */ |
| | | public ExeBaseRequest getControlCache(String companyId, String serId) { |
| | | String key = Constant.APP_NAME + ":" + companyId + ":DEVICE_CTRL:" + serId; |
| | | return (ExeBaseRequest) redisCache.getCacheObject(key); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param bizType |
| | | * @param type |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public List<ExeBaseRequest> getInProgressOrderById(String bizType, String type, String id) { |
| | | if (StringUtils.isEmpty(bizType)){ |
| | | return null; |
| | | } |
| | | if (StringUtils.isEmpty(type)){ |
| | | return null; |
| | | } |
| | | if (StringUtils.isEmpty(id)){ |
| | | return null; |
| | | } |
| | | |
| | | bizType = ":" + bizType; |
| | | type = ":" + type + ":"; |
| | | id = ":" + id + ":"; |
| | | |
| | | String pattern = Constant.APP_NAME + ":" + RedisConst.KEY_ORDER_PRE + bizType + type + "*"; |
| | | |
| | | Collection<String> keys = redisCache.keys(pattern); |
| | | |
| | | if (null == keys || keys.isEmpty()) |
| | | return null; |
| | | |
| | | List<ExeBaseRequest> result = new ArrayList<>(); |
| | | ExeBaseRequest exeRequest; |
| | | for (String key : keys) { |
| | | if (key.indexOf(id) > 0) { |
| | | exeRequest = (ExeBaseRequest) redisCache.getCacheObject(key); |
| | | if (null == exeRequest){ |
| | | continue; |
| | | } |
| | | result.add(exeRequest); |
| | | // if (ReqStatus.IN_PROGRESS.getCode().equals( |
| | | // exeRequest.getStatus())) { |
| | | // result.add(exeRequest); |
| | | // } |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param bizType |
| | | * @param type |
| | | * @param deptId |
| | | * @param timout |
| | | * @return |
| | | */ |
| | | public List<ExeBaseRequest> getAllOrderByDeptId(String bizType,String type, String deptId, int timout) { |
| | | if (StringUtils.isEmpty(bizType)) |
| | | return null; |
| | | if (StringUtils.isEmpty(deptId)) |
| | | return null; |
| | | bizType = ":" + bizType; |
| | | type = ":" + type; |
| | | |
| | | String pattern = Constant.APP_NAME + ":" + RedisConst.KEY_ORDER_PRE + bizType + type + "*"; |
| | | |
| | | Collection<String> keys = redisCache.keys(pattern); |
| | | |
| | | if (null == keys || keys.isEmpty()) |
| | | return null; |
| | | |
| | | List<ExeBaseRequest> result = new ArrayList<>(); |
| | | ExeBaseRequest exeRequest; |
| | | for (String key : keys) { |
| | | exeRequest = redisCache.getCacheObject(key); |
| | | if (null == exeRequest){ |
| | | continue; |
| | | } |
| | | if(exeRequest.getDeptId().equals(deptId)){ |
| | | if (ReqStatus.IN_PROGRESS.getCode().equals(exeRequest.getStatus()) && timout > 0) { |
| | | if (System.currentTimeMillis() - exeRequest.getExeTime().getTime() > (timout * 1000)) { |
| | | exeRequest.setExeMsg("çå¾
è¶
è¿" + timout + "ç§åç»ç«¯æ²¡æåé¦"); |
| | | exeRequest.setStatus(ReqStatus.TIMEOUT_ERROR.getCode()); |
| | | } |
| | | } |
| | | |
| | | result.add(exeRequest); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param request |
| | | * @param isDel |
| | | */ |
| | | public void completeCache(ExeBaseRequest request, boolean isDel) { |
| | | request.setStatus(ReqStatus.COMPLETE.getCode()); |
| | | |
| | | if (StringUtils.isNotEmpty(request.getErrorMsg())) { |
| | | request.setStatus(ReqStatus.ANALYSIS_ERROR.getCode()); |
| | | } |
| | | |
| | | if (isDel) { |
| | | delReqCache(request); |
| | | } else { |
| | | addCache(request); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param companyId |
| | | * @param bizType |
| | | * @param deptId |
| | | */ |
| | | public void clean(String companyId, String bizType, String deptId) { |
| | | if (StringUtils.isEmpty(bizType)) |
| | | return; |
| | | if (StringUtils.isEmpty(deptId)) |
| | | return; |
| | | |
| | | String pattern = Constant.APP_NAME + ":" + RedisConst.KEY_ORDER_PRE |
| | | + ":" + bizType + ":" + "*"; |
| | | |
| | | Collection<String> keys = redisCache.keys(pattern); |
| | | |
| | | if (null == keys || keys.isEmpty()) |
| | | return; |
| | | |
| | | for (String key : keys) { |
| | | redisCache.deleteObject(key); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @param request |
| | | */ |
| | | public void addLogByExeReq(ExeBaseRequest request) { |
| | | LogOperation log = new LogOperation(); |
| | | log.setCompanyId(request.getCompanyId()); |
| | | log.setOperateUser(ContextUtil.getLoginUserName()); |
| | | log.setOperateTime(new Date()); |
| | | log.setBizType(request.getBizType()); |
| | | log.setDeptId(request.getDeptId()); |
| | | log.setOperateInfo(request.getExeMsg()); |
| | | if (StringUtils.isNotEmpty(request.getErrorMsg())) { |
| | | log.setOperateInfo(request.getExeMsg() + "ã" + request.getErrorMsg()); |
| | | } |
| | | |
| | | logService.addLog(log); |
| | | } |
| | | |
| | | /** |
| | | * 注æï¼å½ååæ¾çæ¯ä¸å¡æ§è¡çå½ä»¤ä¿¡æ¯,夿æ¯å¦åæ¾åè½ç¼åï¼é»è®¤åæ¾ |
| | | * |
| | | * @param request |
| | | */ |
| | | public void addReqCache(ExeBaseRequest request) { |
| | | |
| | | //æ·»å ä¸å¡ç¼å |
| | | String key = this.buildReqKeyByBiz(request.getBizType(),request.getDepotId(), request.getRequestId()); |
| | | redisCache.setCacheObject(key, request, 60, TimeUnit.MINUTES); |
| | | |
| | | //æ·»å åè½ç¼å |
| | | if(request.isAddCacheTag()){ |
| | | key = this.buildReqKeyByFun(request.getBizType(),request.getSerId(), request.getRequestId()); |
| | | redisCache.setCacheObject(key, request, 60, TimeUnit.MINUTES); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 注æï¼å½ååæ¾çæ¯ä¸å¡æ§è¡çå½ä»¤ä¿¡æ¯ |
| | | * |
| | | * @param request |
| | | */ |
| | | public void delReqCache(ExeBaseRequest request) { |
| | | |
| | | //å é¤ä¸å¡ç¼å |
| | | String key = this.buildReqKeyByBiz(request.getBizType(), request.getDepotId(), request.getRequestId()); |
| | | redisCache.deleteObject(key); |
| | | |
| | | //å é¤åè½ç¼å |
| | | if(request.isAddCacheTag()){ |
| | | key = this.buildReqKeyByFun(request.getBizType(),request.getSerId(), request.getRequestId()); |
| | | redisCache.deleteObject(key); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¸å¡ç¼åkey,çæè§åï¼igds:ORDER:bizType:BIZ:serId:orderId |
| | | * |
| | | * @param bizType |
| | | * @param depotId |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | private String buildReqKeyByBiz(String bizType, String depotId, String orderId) { |
| | | if (StringUtils.isEmpty(bizType)) |
| | | bizType = "sys"; |
| | | |
| | | if (StringUtils.isEmpty(orderId)) |
| | | orderId = ContextUtil.getTimeId(10000, 99999); |
| | | |
| | | return Constant.APP_NAME + ":" +RedisConst.KEY_ORDER_PRE + ":" + bizType + ":BIZ:" + depotId + ":" + orderId; |
| | | } |
| | | |
| | | /** |
| | | * åè½ç¼åkey,çæè§åï¼igds:ORDER:bizType:FUN:serId:orderId |
| | | * |
| | | * @param bizType |
| | | * @param serId |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | private String buildReqKeyByFun(String bizType, String serId, String orderId) { |
| | | if (StringUtils.isEmpty(bizType)) |
| | | bizType = "sys"; |
| | | |
| | | if (StringUtils.isEmpty(orderId)) |
| | | orderId = ContextUtil.getTimeId(10000, 99999); |
| | | |
| | | return Constant.APP_NAME + ":" +RedisConst.KEY_ORDER_PRE + ":" + bizType + ":FUN:" + serId + ":" + orderId; |
| | | } |
| | | |
| | | /** |
| | | * å½ä»¤ç¼åçæè§åï¼appName:KEY_KEY_ORDER:bizType:deptId:serId:orderId |
| | | * |
| | | * @param bizType ä¸å¡ç±»å |
| | | * @param deptId åºåºç¼ç |
| | | * @param serId åæºç¼ç |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | private String buildExeOrderKey(String bizType, String deptId, |
| | | String serId, String orderId) { |
| | | if (StringUtils.isEmpty(bizType)) |
| | | bizType = "sys"; |
| | | if (StringUtils.isEmpty(deptId)) |
| | | deptId = "01"; |
| | | if (StringUtils.isEmpty(serId)) |
| | | serId = "0001"; |
| | | if (StringUtils.isEmpty(orderId)) |
| | | orderId = "5000"; |
| | | |
| | | return Constant.APP_NAME + ":" + RedisConst.KEY_ORDER_PRE + ":" |
| | | + bizType + ":" + deptId + ":" + serId + ":" + orderId; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.igds.io.service; |
| | | |
| | | import com.fzzy.igds.request.ExeBaseRequest; |
| | | import com.fzzy.igds.request.GrainReqData; |
| | | import com.fzzy.igds.response.GrainResponse; |
| | | |
| | | /** |
| | | * @Description è¿ç¨æ§è¡ç²®æ
æ¥å£ï¼éè¦å¨æ¯ä¸ªåè®®å
ä¸å®ç° ç³»ç»é»è®¤å®ç°ä¸ä¸ªDefault |
| | | * @Author CZT |
| | | * @Date 2025/12/9 10:19 |
| | | */ |
| | | public interface RemoteGrainService { |
| | | |
| | | /** |
| | | * å½ååè®®åç§°ï¼ç³»ç»æ ¹æ®åè®®åç§°èªå¨è°ç¨åæºå¹é
çåè®®å®ç° |
| | | * |
| | | * |
| | | */ |
| | | String getProtocol(); |
| | | |
| | | |
| | | /** |
| | | * ç²®æ
æ£æµæ¥å£ |
| | | * |
| | | * @param request 请æ±åæ° |
| | | */ |
| | | GrainResponse checkGrain(ExeBaseRequest<GrainReqData> request); |
| | | |
| | | } |
| | |
| | | <artifactId>fzzy-igdss-view</artifactId> |
| | | <version>${fzzy.igdss.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- io模å--> |
| | | <dependency> |
| | | <groupId>com.fzzy</groupId> |
| | | <artifactId>fzzy-igdss-io</artifactId> |
| | | <version>${fzzy.igdss.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- d7ç®è¤å
--> |
| | | <dependency> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.sys.controller.grain; |
| | | |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.DepotType; |
| | | import com.fzzy.igds.data.*; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.request.ExeBaseRequest; |
| | | import com.fzzy.igds.response.GrainResponse; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.sys.manager.common.CommonManager; |
| | | import com.fzzy.sys.manager.grain.GrainManager; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description ç²®æ
æ§å¶å¨ |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:04 |
| | | */ |
| | | @Slf4j |
| | | @Controller |
| | | @RequestMapping("grain") |
| | | public class GrainController { |
| | | |
| | | private static final String prefix = "grain"; |
| | | |
| | | @Resource |
| | | private CommonManager commonManager; |
| | | @Resource |
| | | private GrainManager grainManager; |
| | | |
| | | /** |
| | | * 页颿§å¶--æ ¹æ®ä»åºç±»åè°æ´ä¸åé¡µé¢ |
| | | * |
| | | * @param depotId |
| | | * @param deptId |
| | | * @return |
| | | */ |
| | | @RequestMapping("/gateway") |
| | | public String gateway( |
| | | @RequestParam(value = "depotId", required = true) String depotId, |
| | | @RequestParam(value = "deptId", required = false) String deptId, |
| | | ModelMap view) { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | view.put(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | if(StringUtils.isBlank(deptId)){ |
| | | deptId = ContextUtil.subDeptId(user); |
| | | } |
| | | view.put("deptId", deptId); |
| | | |
| | | // ä»åºå表å䏿æ¡ä½¿ç¨ |
| | | List<Depot> listDepot = commonManager.listDepotByDeptId(deptId); |
| | | view.put(Constant.MODEL_KEY_DEPOT_LIST, listDepot); |
| | | |
| | | String depotType = commonManager.getDepotTypeById(depotId); |
| | | view.put("depotType", depotType); |
| | | view.put("depotId", depotId); |
| | | |
| | | //页é¢ï¼é»è®¤å¹³æ¿ä» |
| | | String viewUrl = prefix + "grain-check1"; |
| | | if (depotType.equals(DepotType.TYPE_01.getCode()) || depotType.equals(DepotType.TYPE_05.getCode())) { |
| | | viewUrl = prefix + "/grain-check1"; |
| | | } |
| | | if (DepotType.TYPE_02.getCode().equals(depotType) || DepotType.TYPE_04.getCode().equals(depotType)) { |
| | | viewUrl = prefix + "/grain-check4"; |
| | | } |
| | | if (DepotType.TYPE_03.getCode().equals(depotType)) { |
| | | viewUrl = prefix + "/grain-check3"; |
| | | } |
| | | |
| | | return viewUrl; |
| | | } |
| | | |
| | | /** |
| | | * 页颿§å¶--ç²®æ
æ£æµé¡µé¢ - å¹³æ¿ä» |
| | | * |
| | | * @param depotId |
| | | * @return |
| | | */ |
| | | @RequestMapping("/view-check1") |
| | | public String viewCheck( |
| | | @RequestParam(value = "depotId", required = false) String depotId, |
| | | @RequestParam(value = "deptId", required = false) String deptId, |
| | | ModelMap view) { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | view.put(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | // è·åå½åç¨æ·æå¨çååºåç§° |
| | | if(StringUtils.isBlank(deptId)){ |
| | | deptId = ContextUtil.subDeptId(user); |
| | | } |
| | | view.put("deptId", deptId); |
| | | |
| | | // è·åå½åé¨é¨ï¼ææä»åºå表 |
| | | List<Depot> listDepot = commonManager.listDepotByDeptId(deptId); |
| | | view.put(Constant.MODEL_KEY_DEPOT_LIST, listDepot); |
| | | |
| | | view.put("depotType", DepotType.TYPE_01.getCode()); |
| | | view.put("depotId", depotId); |
| | | |
| | | return prefix + "/grain-check1"; |
| | | } |
| | | |
| | | /** |
| | | * 页颿§å¶--ç²®æ
æ£æµé¡µé¢ - çä»ãæµ
åä» |
| | | * |
| | | * @param depotId |
| | | * @param deptId |
| | | * @return |
| | | */ |
| | | @RequestMapping("/view-check4") |
| | | public String viewCheck4( |
| | | @RequestParam(value = "depotId", required = false) String depotId, |
| | | @RequestParam(value = "deptId", required = false) String deptId, |
| | | ModelMap view) { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | view.put(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | // è·åå½åç¨æ·æå¨çååºåç§° |
| | | if(StringUtils.isBlank(deptId)){ |
| | | deptId = ContextUtil.subDeptId(user); |
| | | } |
| | | view.put("deptId", deptId); |
| | | |
| | | // è·åå½åé¨é¨ï¼ææä»åºå表 |
| | | List<Depot> listDepot = commonManager.listDepotByDeptId(deptId); |
| | | view.put(Constant.MODEL_KEY_DEPOT_LIST, listDepot); |
| | | |
| | | view.put("depotType", DepotType.TYPE_04.getCode()); |
| | | view.put("depotId", depotId); |
| | | |
| | | return prefix + "/grain-check4"; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ§è¡å½ä»¤è®°å½ |
| | | * |
| | | * @param depotId |
| | | * @param deptId |
| | | * @return |
| | | */ |
| | | @RequestMapping("/order-list") |
| | | public String orderList( |
| | | @RequestParam(value = "depotId", required = false) String depotId, |
| | | @RequestParam(value = "deptId", required = false) String deptId, |
| | | ModelMap view) { |
| | | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | view.put(Constant.MODEL_KEY_LOGIN_USER, user); |
| | | |
| | | // è·åå½åç¨æ·æå¨çååºåç§° |
| | | if (org.apache.commons.lang3.StringUtils.isEmpty(deptId)) { |
| | | deptId = ContextUtil.subDeptId(user); |
| | | } |
| | | view.put("deptId", deptId); |
| | | |
| | | view.put("bizType", "grain"); |
| | | view.put("depotId", depotId); |
| | | |
| | | return prefix + "/order-list"; |
| | | } |
| | | |
| | | /** |
| | | * ç²®æ
é¡µé¢ - æ ¹æ®æ¡ä»¶è·åéåï¼é»è®¤æ¥è¯¢å½å¤©çæ°æ® |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/query-list-data") |
| | | @ResponseBody |
| | | public PageResponse<List<GrainData>> queryListGrainData(@RequestBody GrainParam param) { |
| | | if (null == param.getCheckMonth()) { |
| | | param.setLimit(5); |
| | | } else { |
| | | param.setLimit(80); |
| | | } |
| | | return grainManager.queryListGrainData(param); |
| | | } |
| | | |
| | | /** |
| | | * ç²®æ
æ£æµ-å仿£æµ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/check-single") |
| | | @ResponseBody |
| | | public GrainResponse checkSingle(@RequestBody GrainParam param) { |
| | | return grainManager.checkSingle(param); |
| | | } |
| | | |
| | | /** |
| | | * ç²®æ
æ£æµ-æ¹éæ£æµ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/check-batch") |
| | | @ResponseBody |
| | | public GrainResponse checkBatch(@RequestBody GrainParam param) { |
| | | return grainManager.checkBatch(param); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å½åä»åºè·åæ£æµè®°å½ï¼é»è®¤10æ¡ï¼å¦ææ£æµå½åæï¼é»è®¤æ¾ç¤º80æ¡ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/page-list") |
| | | @ResponseBody |
| | | public PageResponse<List<GrainData>> pageList(@RequestBody GrainParam param) { |
| | | if (null == param.getCheckMonth()) { |
| | | param.setLimit(10); |
| | | } else { |
| | | param.setLimit(80); |
| | | } |
| | | return grainManager.pageListGrainData(param); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°è·åæå°çæ¨¡æ¿ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/build-print-model") |
| | | public PageResponse<PrintModeData> buildPrintModel( |
| | | @RequestBody GrainParam param) { |
| | | return grainManager.buildPrintModel(param); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°è·åæå°ç模æ¿-ALL |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/build-print-model-all") |
| | | public PageResponse<Map<String, PrintModeData>> buildPrintModelAll( |
| | | @RequestBody GrainParam param) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | return grainManager.buildPrintModelAll(param); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ç²®æ
æ£æµ-æ¹é导åºEXCEL |
| | | * |
| | | * @param param å
æ¬æ£æµæ¶é´åéè¦å¯¼åºçIDS |
| | | * @return |
| | | */ |
| | | @RequestMapping("/export-batch") |
| | | @ResponseBody |
| | | public GrainResponse exportBatch(@RequestBody GrainParam param) { |
| | | return grainManager.exportBatch(param); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°è·åæå°ç模æ¿-ALL |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/query-order-list") |
| | | public LayPage<List<ExeBaseRequest>> queryOrderList(@RequestParam(value = "depotId", required = false) String depotId, |
| | | @RequestParam(value = "deptId", required = false) String deptId) { |
| | | // è·åå½åç¨æ·æå¨çååºåç§° |
| | | if(StringUtils.isBlank(deptId)){ |
| | | deptId = ContextUtil.subDeptId(null); |
| | | } |
| | | |
| | | List<ExeBaseRequest> result = grainManager.orderList(deptId); |
| | | |
| | | return new LayPage(result); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¸
餿§è¡æ¥å¿ |
| | | * |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/clean-order-list") |
| | | public PageResponse<String> cleanOrderList(@RequestBody IgdsBaseParam param) { |
| | | |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | return grainManager.cleanOrderList(param); |
| | | } |
| | | } |
| | |
| | | package com.fzzy.sys.manager.common; |
| | | |
| | | import com.fzzy.igds.constant.DepotType; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.DicService; |
| | |
| | | public List<SysDictData> getInoutType() { |
| | | return dicService.getInoutType(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®ä»åºç¼ç è·åä»åºç±»å |
| | | * @param depotId |
| | | * @return |
| | | */ |
| | | public String getDepotTypeById(String depotId) { |
| | | String depotType = DepotType.TYPE_01.getCode(); |
| | | |
| | | Depot depot = depotService.getCacheDepot(ContextUtil.getCompanyId(), depotId); |
| | | if (null != depot && StringUtils.isNotEmpty(depot.getDepotType())) { |
| | | depotType = depot.getDepotType(); |
| | | } |
| | | |
| | | return depotType; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.sys.manager.grain; |
| | | |
| | | import com.fzzy.igds.constant.DepotType; |
| | | import com.fzzy.igds.constant.FoodVariety; |
| | | import com.fzzy.igds.data.GrainData; |
| | | import com.fzzy.igds.data.GrainLay; |
| | | import com.fzzy.igds.data.GrainPoint; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.service.FileService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.GrainDataBuilder; |
| | | import com.fzzy.igds.utils.NumberUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.commons.lang3.time.DateFormatUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFRow; |
| | | import org.apache.poi.hssf.usermodel.HSSFSheet; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Desc: ç²®æ
页颿¹é导åºEXCEL |
| | | * @author: Andy |
| | | * @update-time: 2022/12/8 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class GrainExportBuilder { |
| | | |
| | | @Autowired |
| | | private FileService fileService; |
| | | |
| | | /** |
| | | * çæçæ |
| | | * |
| | | * @param dataMap |
| | | * @return 妿è¿åä¿¡æ¯ä»¥ï¼ERROR:å¼å¤´è¡¨ç¤ºæ§è¡åºéï¼æ£å¸¸è¿åæä»¶åç§° |
| | | */ |
| | | public String exportByMapData(Map<String, GrainData> dataMap, List<Depot> listDepot) { |
| | | |
| | | String result; |
| | | try { |
| | | //å建ä¸ä¸ªæ°çEXCEL |
| | | HSSFWorkbook toWorkbook = createWorkBook(); |
| | | HSSFWorkbook fromWorkBook; |
| | | |
| | | Map<String, HSSFWorkbook> mapWorkBook = new HashMap<>(); |
| | | |
| | | HSSFSheet newSheet, oldSheet; |
| | | |
| | | Depot depot = null; |
| | | String cableKey = ""; |
| | | for (GrainData data : dataMap.values()) { |
| | | depot = this.getDepot(data.getDepotId(), listDepot); |
| | | |
| | | if (null == depot) { |
| | | log.info("--------ç²®æ
导åºEXCEL没æè·åå°ä»åºä¿¡æ¯ï¼åæ¶å¯¼åº----{}", data.getDepotId()); |
| | | continue; |
| | | } |
| | | if (StringUtils.isEmpty(data.getCableCir())) { |
| | | cableKey = data.getCable(); |
| | | } else { |
| | | cableKey = data.getCable() + "_" + data.getCableCir(); |
| | | } |
| | | |
| | | fromWorkBook = mapWorkBook.get(cableKey); |
| | | if (null == fromWorkBook) { |
| | | fromWorkBook = this.getFromWorkBook(data, depot); |
| | | mapWorkBook.put(cableKey, fromWorkBook); |
| | | } |
| | | |
| | | newSheet = toWorkbook.createSheet(depot.getName()); |
| | | |
| | | oldSheet = fromWorkBook.getSheetAt(0); |
| | | |
| | | this.copySheet(newSheet, oldSheet, toWorkbook, data, depot); |
| | | |
| | | Thread.sleep(300); |
| | | } |
| | | |
| | | result = ContextUtil.getTimeId() + ".xls"; |
| | | String tempPath = fileService.getTempFilePath(depot == null ? ContextUtil.getCompanyId() : depot.getCompanyId()); |
| | | FileOutputStream fos = new FileOutputStream(tempPath + "/" + result); |
| | | toWorkbook.write(fos); |
| | | if (null != fos) fos.close(); |
| | | |
| | | } catch (Exception e) { |
| | | log.info("---------------导åºå¼å¸¸ä¿¡æ¯----{}", e); |
| | | result = "ERROR:导åºé误ï¼" + e.getMessage(); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private HSSFWorkbook getFromWorkBook(GrainData data, Depot depot) throws Exception { |
| | | FileInputStream fis = null; |
| | | |
| | | String filePath = fileService.getConfPath(); |
| | | try { |
| | | //è·å模ççåç§°ï¼æ³¨æçä»åç§°é
ç½®è§å |
| | | if (StringUtils.isEmpty(data.getCableCir())) { |
| | | filePath = filePath + data.getCable() + ".xls"; |
| | | } else { |
| | | filePath = filePath + data.getCable() + "_" + data.getCableCir() + ".xls"; |
| | | } |
| | | |
| | | fis = new FileInputStream(filePath); |
| | | HSSFWorkbook wb = new HSSFWorkbook(fis); |
| | | |
| | | return wb; |
| | | } catch (Exception e) { |
| | | log.error("------æ ¹æ®ç²®æ
导åºEXCELæ§è¡å¼å¸¸ï¼{}", e); |
| | | return null; |
| | | } finally { |
| | | if (null != fis) fis.close(); |
| | | } |
| | | } |
| | | |
| | | private Depot getDepot(String depotId, List<Depot> listDepot) { |
| | | if (listDepot == null || listDepot.isEmpty()) return null; |
| | | |
| | | for (Depot depot : listDepot) { |
| | | if (depot.getId().equals(depotId)) return depot; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private HSSFWorkbook createWorkBook() { |
| | | return new HSSFWorkbook(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¤å¶sheet |
| | | * |
| | | * @param newSheet |
| | | * @param oldSheet |
| | | * @return |
| | | */ |
| | | public Sheet copySheet(HSSFSheet newSheet, HSSFSheet oldSheet, Workbook workbook, GrainData data, Depot depot) { |
| | | |
| | | //åå¹¶åå
æ ¼ |
| | | int numMergedRegions = oldSheet.getNumMergedRegions(); |
| | | for (int i = 0; i < numMergedRegions; i++) { |
| | | CellRangeAddress mergedRegion = oldSheet.getMergedRegion(i); |
| | | newSheet.addMergedRegion(mergedRegion); |
| | | } |
| | | |
| | | |
| | | // 设置å宽 |
| | | int physicalNumberOfCells = oldSheet.getRow(0).getPhysicalNumberOfCells(); |
| | | for (int i = 0; i < physicalNumberOfCells; i++) { |
| | | HSSFRow fromRow = oldSheet.getRow(i); |
| | | if (null == fromRow) continue; |
| | | for (int j = fromRow.getLastCellNum(); j >= fromRow.getFirstCellNum(); j--) { |
| | | newSheet.setColumnWidth(j, oldSheet.getColumnWidth(j)); |
| | | newSheet.setColumnHidden(j, false); |
| | | } |
| | | } |
| | | |
| | | |
| | | //æ¤å¤éè¦å° cellStyle å®ä¹å¨éåè¡çå°æ¹,å®ä¹å¨å¤é¢å¯è½åºç°æ ·å¼æ¸²æé误 |
| | | CellStyle cellStyle = workbook.createCellStyle(); |
| | | cellStyle.setWrapText(true); |
| | | |
| | | |
| | | //æ¯æ¬¡å®æä¸ä¸ªå é¤ä¸ä¸ª |
| | | List<GrainPoint> listPoints = data.getListPoints(); |
| | | |
| | | //æå¤§è·åè¡æ° |
| | | int maxRowSize = oldSheet.getPhysicalNumberOfRows() - 1; |
| | | for (int i = 0; i < maxRowSize; i++) { |
| | | Row newRow = newSheet.createRow(i); |
| | | Row oldRow = oldSheet.getRow(i); |
| | | newRow.setHeight((short) (20 * 20)); |
| | | |
| | | int maxColSize = oldRow.getPhysicalNumberOfCells(); |
| | | |
| | | String oldCellValue; |
| | | for (int j = 0; j < maxColSize; j++) { |
| | | Cell newCell = newRow.createCell(j); |
| | | Cell oldCell = oldRow.getCell(j); |
| | | if (oldCell == null) { |
| | | continue; |
| | | } |
| | | oldCellValue = oldCell.getStringCellValue(); |
| | | |
| | | newCell.setCellValue(getNewCellValue(oldCellValue, listPoints, data, depot)); |
| | | |
| | | newCell.setCellStyle(cellStyle); |
| | | } |
| | | } |
| | | return newSheet; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ ¹æ®åå
æ ¼æ ç¾æ¿æ¢å¼ï¼éè¦æ¿æ¢çæ 记为c_ |
| | | * |
| | | * @param oldCellValue |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public String getNewCellValue(String oldCellValue, List<GrainPoint> listPoints, GrainData data, Depot depot) { |
| | | |
| | | try { |
| | | |
| | | if (null == oldCellValue) return null; |
| | | |
| | | if (!oldCellValue.startsWith("c_")) return oldCellValue; |
| | | |
| | | if ("c_title".equals(oldCellValue)) return "ç²®æ
æ¥è¡¨"; |
| | | if ("c_depot".equals(oldCellValue)) return depot.getName() + "ç²®æ
æ¥è¡¨"; |
| | | if ("c_depot_name".equals(oldCellValue)) return depot.getName(); |
| | | if ("c_weather".equals(oldCellValue)) return data.getWeather(); |
| | | if ("c_checkDate".equals(oldCellValue)) |
| | | return DateFormatUtils.format(data.getReceiveDate(), "yyyy-MM-dd HH:mm"); |
| | | if ("c_checkDateYMD".equals(oldCellValue)) |
| | | return DateFormatUtils.format(data.getReceiveDate(), "yyyy-MM-dd HH:mm:ss"); |
| | | if ("c_ori".equals(oldCellValue)) return ""; |
| | | if ("c_tIn".equals(oldCellValue)) return getStrValue(data.getTempIn()); |
| | | if ("c_tOut".equals(oldCellValue)) return getStrValue(data.getTempOut()); |
| | | if ("c_hIn".equals(oldCellValue)) return getStrValue(data.getHumidityIn()); |
| | | if ("c_hOut".equals(oldCellValue)) return getStrValue(data.getHumidityOut()); |
| | | |
| | | if ("c_tempMax".equals(oldCellValue)) return getStrValue(data.getTempMax()); |
| | | if ("c_tempMin".equals(oldCellValue)) return getStrValue(data.getTempMin()); |
| | | if ("c_tempAve".equals(oldCellValue)) return getStrValue(data.getTempAve()); |
| | | if ("c_depotType".equals(oldCellValue)) return DepotType.getMsg(depot.getDepotType()); |
| | | if ("c_storeDate".equals(oldCellValue)) |
| | | return null == depot.getStoreDate() ? null : DateFormatUtils.format(depot.getStoreDate(), "yyyy-MM-dd"); |
| | | if ("c_foodVariety".equals(oldCellValue)) return FoodVariety.getMsg(depot.getFoodVariety()); |
| | | if ("c_storageReal".equals(oldCellValue)) return getStrValue(NumberUtil.keepPrecision(depot.getStorageReal()/1000, 2)); |
| | | if ("c_foodLocation".equals(oldCellValue)) return depot.getFoodLocation(); |
| | | if ("c_bulkWeight".equals(oldCellValue)) return getStrValue(depot.getBulkWeight()); |
| | | if ("c_checkUser".equals(oldCellValue)) return data.getCheckUser(); |
| | | if ("c_storeKeeper".equals(oldCellValue)) return depot.getStoreKeeperName(); |
| | | if ("c_createDate".equals(oldCellValue)) return DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm"); |
| | | |
| | | if (oldCellValue.startsWith("c_lay_")) { |
| | | String[] tempAttr = oldCellValue.split("_"); |
| | | int layNum = Integer.valueOf(tempAttr[3]); |
| | | for (GrainLay lay : data.getListLays()) { |
| | | if (lay.getFz() == layNum) { |
| | | if (oldCellValue.indexOf("max") > 0) return getStrValue(lay.getTempMax()); |
| | | if (oldCellValue.indexOf("min") > 0) return getStrValue(lay.getTempMin()); |
| | | if (oldCellValue.indexOf("ave") > 0) return getStrValue(lay.getTempAve()); |
| | | } |
| | | } |
| | | return oldCellValue; |
| | | } |
| | | |
| | | |
| | | //å¹³æ¿ä»çè·åæ¹å¼ |
| | | |
| | | if (DepotType.TYPE_01.getCode().equals(depot.getDepotType()) || DepotType.TYPE_05.getCode().equals(depot.getDepotType())) { |
| | | return getNewCellValue01(data, oldCellValue, listPoints); |
| | | } |
| | | |
| | | if (DepotType.TYPE_02.getCode().equals(depot.getDepotType())) { |
| | | return getNewCellValue02(data, oldCellValue, listPoints); |
| | | } |
| | | |
| | | if (DepotType.TYPE_03.getCode().equals(depot.getDepotType())) { |
| | | return getNewCellValue02(data, oldCellValue, listPoints); |
| | | } |
| | | |
| | | if (DepotType.TYPE_04.getCode().equals(depot.getDepotType())) { |
| | | return getNewCellValue02(data, oldCellValue, listPoints); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("---------æ¹é导åºç²®æ
EXCEL---èµå¼åºé---{}", e); |
| | | return oldCellValue; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Desc: çä»ç粮温ç¹è§åc_x_y_z å
¶ä¸x = è¡¨ç¤ºåæ°ï¼y=æ»æ ¹æ°ï¼z= å½åå± |
| | | * @author: Andy |
| | | * @update-time: 2022/12/12 |
| | | */ |
| | | private String getNewCellValue02(GrainData data, String oldCellValue, List<GrainPoint> listPoints) { |
| | | //åå
æ ¼èµå¼ c_x_y_z å
¶ä¸x = è¡¨ç¤ºåæ°ï¼y=æ»æ ¹æ°ï¼z= å½åå± |
| | | String[] attr = oldCellValue.split("_"); |
| | | int x = Integer.valueOf(attr[1]), y = Integer.valueOf(attr[2]), z = Integer.valueOf(attr[3]); |
| | | |
| | | x = x - 1; |
| | | y = y - 1; |
| | | GrainPoint point; |
| | | for (int i = 0; i < listPoints.size(); i++) { |
| | | point = listPoints.get(i); |
| | | |
| | | if (point.getX() == x && point.getY() == y && point.getFz() == z) { |
| | | listPoints.remove(i); |
| | | return GrainDataBuilder.renderTempValue(point.getTemp()); |
| | | } |
| | | } |
| | | |
| | | return "--"; |
| | | } |
| | | |
| | | |
| | | private String getNewCellValue01(GrainData data, String oldCellValue, List<GrainPoint> listPoints) { |
| | | String cable = data.getCable(); |
| | | String[] attrCable = cable.split("-"); |
| | | int numX = Integer.valueOf(attrCable[2]); |
| | | |
| | | |
| | | //åå
æ ¼èµå¼ c_å±_è¡_å |
| | | String[] attr = oldCellValue.split("_"); |
| | | int lay = Integer.valueOf(attr[1]), row = Integer.valueOf(attr[2]), col = Integer.valueOf(attr[3]); |
| | | |
| | | row = row - 1; |
| | | col = numX - col; |
| | | |
| | | GrainPoint point; |
| | | for (int i = 0; i < listPoints.size(); i++) { |
| | | point = listPoints.get(i); |
| | | if (point.getFz() == lay && point.getY() == row && point.getX() == col) { |
| | | listPoints.remove(i); |
| | | return GrainDataBuilder.renderTempValue(point.getTemp()); |
| | | } |
| | | } |
| | | |
| | | return "--"; |
| | | } |
| | | |
| | | private static String getStrValue(Double tempIn) { |
| | | if (null == tempIn) return null; |
| | | return tempIn + ""; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.fzzy.sys.manager.grain; |
| | | |
| | | import com.fzzy.igds.constant.OrderRespEnum; |
| | | import com.fzzy.igds.constant.RespCodeEnum; |
| | | import com.fzzy.igds.data.*; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import com.fzzy.igds.domain.DeviceSer; |
| | | import com.fzzy.igds.domain.Grain; |
| | | import com.fzzy.igds.io.manager.RemoteManager; |
| | | import com.fzzy.igds.io.order.ExeOrderService; |
| | | import com.fzzy.igds.io.service.RemoteGrainService; |
| | | import com.fzzy.igds.request.ExeBaseRequest; |
| | | import com.fzzy.igds.request.GrainReqData; |
| | | import com.fzzy.igds.request.ReqStatus; |
| | | import com.fzzy.igds.response.GrainResponse; |
| | | import com.fzzy.igds.service.DepotConfService; |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.DeviceSerService; |
| | | import com.fzzy.igds.service.GrainService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.igds.utils.DateUtil; |
| | | import com.fzzy.igds.utils.GrainDataBuilder; |
| | | import com.fzzy.igds.utils.GrainPrintBuilder; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Component; |
| | | import javax.annotation.Resource; |
| | | import java.text.Collator; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author CZT |
| | | * @Date 2025/12/9 9:56 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class GrainManager { |
| | | |
| | | @Resource |
| | | private DepotService depotService; |
| | | @Resource |
| | | private DepotConfService depotConfService; |
| | | @Resource |
| | | private GrainService grainService; |
| | | @Resource |
| | | private DeviceSerService deviceSerService; |
| | | @Resource |
| | | private RemoteManager remoteManager; |
| | | @Resource |
| | | private ExeOrderService exeOrderService; |
| | | @Resource |
| | | private GrainExportBuilder grainExportBuilder; |
| | | |
| | | public PageResponse<List<GrainData>> queryListGrainData(GrainParam param) { |
| | | if (StringUtils.isEmpty(param.getDepotId())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), |
| | | "没æè·åå°ä»åºåæ°ã"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | if (null != param.getCheckDate()) { |
| | | param.setStart(DateUtil.getCurZero(param.getCheckDate())); |
| | | param.setEnd(DateUtil.getNextZero(param.getCheckDate())); |
| | | param.setCheckDate(null); |
| | | } |
| | | |
| | | if (null != param.getCheckMonth()) { |
| | | param.setStart(DateUtil.getMonthFirst(param.getCheckMonth())); |
| | | param.setEnd(DateUtil.getNextMonthFirst(param.getCheckMonth())); |
| | | param.setCheckMonth(null); |
| | | } |
| | | |
| | | List<Grain> list = grainService.listData(param); |
| | | if (null == list || list.isEmpty()) { |
| | | return null; |
| | | } |
| | | |
| | | // æ·»å ä»åºä¿¡æ¯ |
| | | Depot depotData = depotService.getCacheDepot(param.getCompanyId(), param.getDepotId()); |
| | | if (null == depotData) { |
| | | log.error("æªè·åå°ä»åºä¿¡æ¯"); |
| | | } |
| | | |
| | | List<GrainData> result = new ArrayList<>(); |
| | | DepotConf depotConf; |
| | | GrainData data; |
| | | for (Grain grain : list) { |
| | | depotConf = depotConfService.getCacheDepotConfByDepotId(grain.getCompanyId(), grain.getDepotId()); |
| | | data = new GrainData(); |
| | | BeanUtils.copyProperties(grain, data); |
| | | GrainDataBuilder.updateGrainData(data, depotConf, depotData.getDepotType()); |
| | | data.setDepotData(depotData); |
| | | result.add(data); |
| | | } |
| | | |
| | | |
| | | for (GrainData grainData : result) { |
| | | grainData.setDepotData(depotData); |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, result); |
| | | } |
| | | |
| | | /** |
| | | * åä»éé |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public GrainResponse checkSingle(GrainParam param) { |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(param.getDepotId())) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "没æè·åå°ä»åºåæ°ï¼è¯·éæ°éæ©ä»åºå¹¶æ§è¡ï¼"); |
| | | } |
| | | |
| | | try { |
| | | // ç¼åè·ä»åºé
ç½®ä¿¡æ¯ |
| | | DepotConf depotConf = depotConfService.getCacheDepotConfByDepotId(param.getCompanyId(), param.getDepotId()); |
| | | |
| | | if (null == depotConf) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "å½åä»åºæ²¡æé
置粮æ
åæ°ï¼æ§è¡è¢«æç»ï¼"); |
| | | } |
| | | |
| | | // è·ååæºä¿¡æ¯ |
| | | DeviceSer deviceSer = deviceSerService.getCacheSer(param.getCompanyId(), depotConf.getGrainSer()); |
| | | |
| | | if (null == deviceSer) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "å½åä»åºæ²¡æé
置粮æ
åæºï¼æ§è¡è¢«æç»ï¼"); |
| | | } |
| | | |
| | | Depot depot = depotService.getCacheDepot(depotConf.getCompanyId(), depotConf.getDepotId()); |
| | | |
| | | //æ°æ®å°è£
|
| | | ExeBaseRequest request = new ExeBaseRequest<GrainReqData>(); |
| | | request.setDepotId(param.getDepotId()); |
| | | request.setCompanyId(param.getCompanyId()); |
| | | request.setBizType("grain"); |
| | | request.setExeUser(ContextUtil.getLoginUserName()); |
| | | request.setDepotName(depot.getName()); |
| | | request.setDeptId(ContextUtil.subDeptId(null)); |
| | | request.setProtocol(deviceSer.getProtocol()); |
| | | request.setAddLogTag(true); |
| | | request.setIp(deviceSer.getIp()); |
| | | request.setPort(deviceSer.getPort()); |
| | | request.setSerId(deviceSer.getId()); |
| | | request.setSerName(deviceSer.getName()); |
| | | request.setSn(deviceSer.getSn()); |
| | | |
| | | request.setExeMsg("ç²®æ
ééï¼ä»åº=" + request.getDepotName()); |
| | | |
| | | GrainReqData reqData = new GrainReqData(); |
| | | reqData.setCableStart(depotConf.getCableStart()); |
| | | reqData.setCableEnd(depotConf.getCableEnd()); |
| | | reqData.setCableRule(depotConf.getCableRule()); |
| | | // æ°å¢æ¸©æ¹¿åº¦ä¿¡æ¯ |
| | | reqData.setThSerId(depotConf.getThSer()); |
| | | reqData.setThConf(depotConf.getThConf()); |
| | | //å¤ä»å¹¶åæ å¿ |
| | | reqData.setIsMoreDepot(deviceSer.getIsMoreDepot()); |
| | | |
| | | request.setReqData(reqData); |
| | | |
| | | RemoteGrainService remoteGrainService = remoteManager.getRemoteGrainService(deviceSer.getProtocol()); |
| | | |
| | | if (null == remoteGrainService) { |
| | | String msg = "ç³»ç»æ²¡æ" + request.getProtocol() + "çåè®®å®ç°ï¼æ§è¡è¢«æç»ï¼"; |
| | | request.setErrorMsg(msg); |
| | | request.setStatus(ReqStatus.SEND_ERROR.getCode()); |
| | | exeOrderService.addLogAndCache(request); |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), msg); |
| | | } |
| | | |
| | | GrainResponse result = remoteGrainService.checkGrain(request); |
| | | |
| | | if (!OrderRespEnum.ORDER_SUCCESS.getCode().equals(result.getCode())) { |
| | | String msg = request.getDepotName() + "请æ±å¤±è´¥:" + result.getMsg(); |
| | | request.setErrorMsg(msg); |
| | | request.setStatus(ReqStatus.SEND_ERROR.getCode()); |
| | | } |
| | | |
| | | exeOrderService.addLogAndCache(request); |
| | | return result; |
| | | |
| | | } catch (Exception e) { |
| | | log.error("ç²®æ
æ§è¡å¼å¸¸ï¼{}", e.getLocalizedMessage()); |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "ç³»ç»å¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹ééé |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public GrainResponse checkBatch(GrainParam param) { |
| | | if (null == param.getDepotIds()) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "没æè·åå°ä»åºåæ°ï¼è¯·éæ°éæ©ä»åºå¹¶æ§è¡ï¼"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(param.getDeptId())) { |
| | | param.setDeptId(ContextUtil.subDeptId(null)); |
| | | } |
| | | |
| | | try { |
| | | String[] attr = param.getDepotIds().split(","); |
| | | |
| | | // ç¼åè·ä»åºé
ç½®ä¿¡æ¯ |
| | | DepotConf depotConf; |
| | | // è·ååæºä¿¡æ¯ |
| | | DeviceSer deviceSer; |
| | | ExeBaseRequest request; |
| | | GrainReqData reqData; |
| | | //æ§è¡åéå½ä»¤ |
| | | RemoteGrainService remoteGrainService; |
| | | GrainResponse result; |
| | | Depot depot; |
| | | for (String depotId : attr) { |
| | | param.setDepotId(depotId); |
| | | |
| | | //æ°æ®å°è£
|
| | | request = new ExeBaseRequest<GrainReqData>(); |
| | | request.setDepotId(param.getDepotId()); |
| | | request.setCompanyId(param.getCompanyId()); |
| | | request.setBizType("grain"); |
| | | request.setExeUser(ContextUtil.getLoginUserName()); |
| | | |
| | | request.setDeptId(ContextUtil.subDeptId(null)); |
| | | request.setAddLogTag(true); |
| | | |
| | | reqData = new GrainReqData(); |
| | | |
| | | depotConf = depotConfService.getCacheDepotConfByDepotId(param.getCompanyId(), param.getDepotId()); |
| | | |
| | | depot = depotService.getCacheDepot(depotConf.getCompanyId(), depotConf.getDepotId()); |
| | | |
| | | if (null == depotConf) { |
| | | request.setErrorMsg("æ§è¡å¤±è´¥ï¼æ²¡æè·åç²®æ
åæ°é
ç½®"); |
| | | request.setReqData(reqData); |
| | | request.setStatus(ReqStatus.SEND_ERROR.getCode()); |
| | | exeOrderService.addLogAndCache(request); |
| | | continue; |
| | | } |
| | | request.setDepotName(depot.getName()); |
| | | |
| | | deviceSer = deviceSerService.getCacheSer(param.getCompanyId(), depotConf.getGrainSer()); |
| | | |
| | | if (null == deviceSer) { |
| | | request.setErrorMsg("æ§è¡å¤±è´¥ï¼æ²¡æè·åå°åæºä¿¡æ¯"); |
| | | request.setReqData(reqData); |
| | | request.setStatus(ReqStatus.SEND_ERROR.getCode()); |
| | | exeOrderService.addLogAndCache(request); |
| | | continue; |
| | | } |
| | | |
| | | request.setProtocol(deviceSer.getProtocol()); |
| | | request.setIp(deviceSer.getIp()); |
| | | request.setPort(deviceSer.getPort()); |
| | | request.setSerId(deviceSer.getId()); |
| | | request.setSerName(deviceSer.getName()); |
| | | request.setSn(deviceSer.getSn()); |
| | | |
| | | request.setExeMsg("ç²®æ
ééï¼ä»åº=" + request.getDepotName()); |
| | | |
| | | reqData.setCableStart(depotConf.getCableStart()); |
| | | reqData.setCableEnd(depotConf.getCableEnd()); |
| | | reqData.setCableRule(depotConf.getCableRule()); |
| | | |
| | | // æ°å¢æ¸©æ¹¿åº¦ä¿¡æ¯ |
| | | reqData.setThSerId(depotConf.getThSer()); |
| | | reqData.setThConf(depotConf.getThConf()); |
| | | //å¤ä»å¹¶å |
| | | reqData.setIsMoreDepot(deviceSer.getIsMoreDepot()); |
| | | request.setReqData(reqData); |
| | | |
| | | //æ§è¡å½ä»¤ |
| | | remoteGrainService = remoteManager.getRemoteGrainService(deviceSer.getProtocol()); |
| | | if (null == remoteGrainService) { |
| | | //åéå¼å¸¸ |
| | | request.setErrorMsg("ç³»ç»æ²¡æ" + request.getProtocol() + "çåè®®å®ç°ï¼æ§è¡è¢«æç»ï¼"); |
| | | request.setStatus(ReqStatus.SEND_ERROR.getCode()); |
| | | exeOrderService.addLogAndCache(request); |
| | | continue; |
| | | } |
| | | |
| | | result = remoteGrainService.checkGrain(request); |
| | | if (!OrderRespEnum.ORDER_SUCCESS.getCode().equals(result.getCode())) { |
| | | request.setErrorMsg(request.getDepotName() + "请æ±å¤±è´¥:" + result.getMsg()); |
| | | request.setStatus(ReqStatus.SEND_ERROR.getCode()); |
| | | } |
| | | |
| | | exeOrderService.addLogAndCache(request); |
| | | |
| | | Thread.sleep(200); |
| | | } |
| | | } catch (Exception e) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "åå°æ§è¡å¼å¸¸ï¼" + e.getMessage()); |
| | | } |
| | | return new GrainResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | "æ¹éæ§è¡ç²®æ
æ£æµå½ä»¤åéæåï¼è¯·çå¾
ç»ç«¯ååºâ¦â¦"); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<List<GrainData>> pageListGrainData(GrainParam param) { |
| | | if (StringUtils.isEmpty(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(param.getDepotId())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_1007.getCode(), |
| | | "没æè·åå°ä»åºåæ°ï¼æ§è¡å¤±è´¥ï¼"); |
| | | } |
| | | |
| | | param.setTagUpdate(false); |
| | | List<Grain> list = grainService.listData(param); |
| | | |
| | | DepotConf depotConf; |
| | | GrainData data; |
| | | Depot depotData; |
| | | List<GrainData> result = new ArrayList<>(); |
| | | for (Grain grain : list) { |
| | | depotConf = depotConfService.getCacheDepotConfByDepotId(grain.getCompanyId(), grain.getDepotId()); |
| | | data = new GrainData(); |
| | | BeanUtils.copyProperties(grain, data); |
| | | // æ·»å ä»åºä¿¡æ¯ |
| | | depotData = depotService.getCacheDepot(param.getCompanyId(), param.getDepotId()); |
| | | GrainDataBuilder.updateGrainData(data, depotConf, depotData.getDepotType()); |
| | | result.add(data); |
| | | } |
| | | |
| | | if (null == result) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), "å½åæ¡ä»¶ä¸æ²¡æè·åå°ç²®æ
ä¿¡æ¯ï¼ï¼"); |
| | | } |
| | | |
| | | return new PageResponse<List<GrainData>>(RespCodeEnum.CODE_0000, result); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°è·åå½åæå°éè¦çæ¨¡æ¿ |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<PrintModeData> buildPrintModel(GrainParam param) { |
| | | if (null == param.getCompanyId()) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | if (StringUtils.isEmpty(param.getDepotType())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), |
| | | "没æè·åå°å½åä»åºçä»åºç±»å"); |
| | | } |
| | | if (StringUtils.isEmpty(param.getCableRule()) && StringUtils.isEmpty(param.getCableCir())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), |
| | | "没æè·åå½åä»åºçå¸çº¿è§å"); |
| | | } |
| | | PrintModeData result = GrainPrintBuilder.buildPrintModel(param); |
| | | |
| | | if (null == result) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), |
| | | "ç³»ç»æ²¡æè·åå½åä»åºçè¡¨åæ¨¡æ¿"); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(result.getMsg())) { |
| | | return new PageResponse<>(RespCodeEnum.CODE_2000.getCode(), |
| | | result.getMsg()); |
| | | } |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, result); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<Map<String, PrintModeData>> buildPrintModelAll(GrainParam param) { |
| | | |
| | | Map<String, PrintModeData> result = new HashMap<>(); |
| | | |
| | | List<DepotConf> depotConfList = depotConfService.getCacheDepotConfList(param.getCompanyId()); |
| | | PrintModeData modeData; |
| | | String key; |
| | | Depot cacheDepot; |
| | | for (DepotConf conf : depotConfList) { |
| | | cacheDepot = depotService.getCacheDepot(param.getCompanyId(), conf.getDepotId()); |
| | | param.setCableRule(conf.getCableRule()); |
| | | param.setDepotId(conf.getDepotId()); |
| | | param.setCableCir(conf.getCableCir()); |
| | | param.setDepotType(cacheDepot.getDepotType()); |
| | | |
| | | if (StringUtils.isNotEmpty(param.getCableCir())) { |
| | | key = param.getDepotType() + "_" + param.getCableRule() + "_" + param.getCableCir(); |
| | | } else { |
| | | key = param.getDepotType() + "_" + param.getCableRule(); |
| | | } |
| | | if (null == result.get(key)) { |
| | | modeData = GrainPrintBuilder.buildPrintModel(param); |
| | | result.put(key, modeData); |
| | | } |
| | | } |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, result); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public GrainResponse exportBatch(GrainParam param) { |
| | | |
| | | //æ ¹æ®æ¡ä»¶è·åéè¦æå°çç²®æ
ä¿¡æ¯ |
| | | |
| | | if (null != param.getCheckDate()) { |
| | | param.setStart(DateUtil.getCurZero(param.getCheckDate())); |
| | | param.setEnd(DateUtil.getNextZero(param.getCheckDate())); |
| | | param.setCheckDate(null); |
| | | } |
| | | |
| | | //è·åå·²ç»ç²®æ
æ ¼å¼å宿çç²®æ
æ°æ® |
| | | param.setTagUpdate(true); |
| | | PageResponse<List<GrainData>> listPageResponse = this.pageListGrainData(param); |
| | | List<GrainData> list = listPageResponse.getData(); |
| | | |
| | | if (null == list || list.isEmpty()) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "å½åæ¡ä»¶ä¸æ²¡ææ¥è¯¢å°ç²®æ
æ£æµè®°å½ï¼åæ¶å¯¼åº"); |
| | | } |
| | | |
| | | //æç
§ä»åºç¼ç 仿°æåº |
| | | Collator sortChina = Collator.getInstance(Locale.CHINA); |
| | | Collections.sort(list, (a, b) -> sortChina.compare(a.getDepotId(), b.getDepotId())); |
| | | |
| | | //è·åç¼åçä»åºå表ï¼ç¨äºè·åä»åºåç§° |
| | | List<Depot> listDepot = depotService.getCacheDepotList(param.getCompanyId(), param.getDeptId()); |
| | | |
| | | //å»é¤éå¤çç²®æ
æ°æ® |
| | | LinkedHashMap<String, GrainData> dataMap = new LinkedHashMap<>(); |
| | | for (GrainData data : list) { |
| | | if (null != dataMap.get(data.getDepotId())) continue; |
| | | |
| | | dataMap.put(data.getDepotId(), data); |
| | | } |
| | | |
| | | |
| | | String fileName = grainExportBuilder.exportByMapData(dataMap, listDepot); |
| | | |
| | | if (fileName.startsWith("ERROR")) { |
| | | return new GrainResponse(OrderRespEnum.ORDER_ERROR.getCode(), |
| | | "æ§è¡å¯¼åºåºç°é误ï¼" + fileName); |
| | | } |
| | | |
| | | return new GrainResponse(OrderRespEnum.ORDER_SUCCESS.getCode(), |
| | | fileName); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param deptId |
| | | * @return |
| | | */ |
| | | public List<ExeBaseRequest> orderList(String deptId) { |
| | | return exeOrderService.getAllOrderByDeptId("grain","BIZ", deptId, 2 * 60 * 8); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | public PageResponse<String> cleanOrderList(IgdsBaseParam param) { |
| | | exeOrderService.clean(param.getCompanyId(), "grain", param.getDeptId()); |
| | | |
| | | return new PageResponse<>(RespCodeEnum.CODE_0000, "æ§è¡æå"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | //åå§åæ¨¡æ¿ |
| | | initModel = function () { |
| | | if (CACHE_PRINT_MODEL.size > 0) { |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/build-print-model-all", |
| | | data: JSON.stringify({ |
| | | depotId: depotId |
| | | }), |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.msg(result.msg); |
| | | return null; |
| | | } else { |
| | | //åæ¾å¨ç¼åä¸ |
| | | CACHE_PRINT_MODEL = result.data; |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.msg("åå§å模æ¿å¤±è´¥ï¼ï¼"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å仿å°ï¼å¦æç´æ¥è¿åçæ¨¡æ¿ä¿¡æ¯ä¸ºNULLï¼éæ°è·å䏿¨¡æ¿ |
| | | * @param grainData |
| | | */ |
| | | toPrintSingle = function (grainData) { |
| | | var html = null; |
| | | |
| | | var depotData = grainData.depotData; |
| | | if (!depotData.depotType) { |
| | | depotData.depotType = DepotType.T_01; |
| | | } |
| | | var key = builderModelKey(depotData.depotType, grainData.cable, grainData.cableCir); |
| | | |
| | | //å
ä»å个模æ¿ä¸è·å |
| | | var modelData = CACHE_PRINT_MODEL[key]; |
| | | if (modelData) { |
| | | html = builderModelByType(modelData, grainData); |
| | | previewA4(html); |
| | | return; |
| | | } |
| | | |
| | | console.log("---------éæ°è·å模æ¿--------"); |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/build-print-model", |
| | | data: JSON.stringify({ |
| | | depotId: depotId, |
| | | depotType: depotData.depotType, |
| | | cableRule: grainData.cable, |
| | | cableCir: grainData.cableCir |
| | | }), |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.alert("æå¡å¨è·åæå°æ¨¡æ¿å¤±è´¥ï¼è¯·éæ°æä½-" + result.msg); |
| | | return; |
| | | } else { |
| | | html = builderModelByType(result.data, grainData); |
| | | previewA4(html); |
| | | return; |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("æå¡å¨è·åæå°æ¨¡æ¿å¤±è´¥ï¼ï¼ï¼"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * è·åæ¨¡æ¿ |
| | | * @param grainData |
| | | */ |
| | | builderModel = function (grainData) { |
| | | var depotData = grainData.depotData; |
| | | if (!depotData.depotType) { |
| | | depotData.depotType = DepotType.T_01; |
| | | } |
| | | var key = builderModelKey(depotData.depotType, grainData.cable, grainData.cableCir); |
| | | |
| | | //å
ä»å个模æ¿ä¸è·å |
| | | var modelData = CACHE_PRINT_MODEL[key]; |
| | | if (modelData) { |
| | | // return builderModelStep2(modelData, grainData); |
| | | return builderModelByType(modelData, grainData); |
| | | } else { |
| | | return null; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * è·å模æ¿åæ·»å æ°æ® |
| | | * @param grainData |
| | | */ |
| | | builderModelByType = function (modelData, grainData) { |
| | | var depotData = grainData.depotData; |
| | | //å¨ææ°æ®ä¿¡æ¯--å¹³æ¹ä» |
| | | if (DepotType.T_01 == depotData.depotType || DepotType.T_05 == depotData.depotType) { |
| | | return builderModelLay(grainData); |
| | | } else if (DepotType.T_02 == depotData.depotType) { |
| | | return builderModelCir(modelData, grainData); |
| | | } else if (DepotType.T_03 == depotData.depotType) { |
| | | return builderModelCir(modelData, grainData); |
| | | } else if (DepotType.T_04 == depotData.depotType) { |
| | | return builderModelCir(modelData, grainData); |
| | | } else { |
| | | return builderModelLay(modelData, grainData); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * è·å模æ¿åæ·»å æ°æ®--çä» |
| | | * @param grainData |
| | | */ |
| | | builderModelCir = function (modelData, grainData) { |
| | | var attCable = grainData.cable.split("-"); |
| | | numZ = attCable[0]; |
| | | numY = attCable[1]; |
| | | numX = attCable[2]; |
| | | |
| | | var model = modelData.model; |
| | | var depotData = grainData.depotData; |
| | | //æ¿æ¢åºç¡æ°æ® |
| | | if (dept) { |
| | | model = model.replace("companyName", dept.deptName); |
| | | } else { |
| | | model = model.replace("companyName", "æºæ
§ç²®åº"); |
| | | } |
| | | model = model.replace("depotName", depotData.name) |
| | | .replace("weather", grainData.weather == null ? "" : grainData.weather) |
| | | .replace("orientation", depotData.orientation == null ? "" : depotData.orientation) |
| | | .replace("checkDate", grainData.receiveDate) |
| | | .replace("remark", grainData.remark == null ? "æ£å¸¸" : grainData.remark) |
| | | .replace("c_max_all", grainData.tempMax) |
| | | .replace("c_min_all", grainData.tempMin) |
| | | .replace("c_ave_all", grainData.tempAve); |
| | | |
| | | model = model.replace("c_out_ave_all", "");//ææ¶ä¸ç¨ |
| | | model = model.replace("c_in_ave_all", "");//ææ¶ä¸ç¨ |
| | | |
| | | model = model.replace("c_tIn", grainData.tempIn <= -100.0 ? "å¤ç¨" : grainData.tempIn) |
| | | .replace("c_hIn", grainData.humidityIn <= -100.0 ? "å¤ç¨" : grainData.humidityIn) |
| | | .replace("c_tOut", grainData.tempOut <= -100.0 ? "å¤ç¨" : grainData.tempOut) |
| | | .replace("c_hOut", grainData.humidityOut <= -100.0 ? "å¤ç¨" : grainData.humidityOut) |
| | | .replace("c_depotType", depotData.depotTypeName == null ? "/" : depotData.depotTypeName) |
| | | .replace("c_storeDate", depotData.storeDate == null ? "/" : depotData.storeDate.substring(0, 10)) |
| | | .replace("c_foodLocation", depotData.foodLocation == null ? "/" : depotData.foodLocation) |
| | | .replace("c_foodVariety", depotData.foodVarietyName == null ? "/" : depotData.foodVarietyName) |
| | | .replace("c_perWet", depotData.perWet == null ? "/" : depotData.perWet) |
| | | .replace("c_perImpurity", depotData.perImpurity == null ? "/" : depotData.perImpurity) |
| | | .replace("c_bulkWeight", depotData.bulkWeight == null ? "/" : depotData.bulkWeight) |
| | | .replace("c_storeDate", depotData.storeDate == null ? "/" : depotData.storeDate) |
| | | .replace("c_storageReal", depotData.storageReal == null ? "/" : (Number(depotData.storageReal) / 1000).toFixed(2)) |
| | | .replace("c_checkUser", grainData.checkUser == null ? "/" : grainData.checkUser) |
| | | .replace("c_storeKeeperName", depotData.storeKeeperName == null ? "/" : depotData.storeKeeperName) |
| | | .replace("createBillDate", grainData.sysDate); |
| | | |
| | | //å¨ææ°æ®ä¿¡æ¯--å¹³æ¹ä» |
| | | if (DepotType.T_01 == depotData.depotType) { |
| | | if ("ROW" == modelData.modelType) { |
| | | model = addPointsRow1(model, grainData, numX); |
| | | } else { |
| | | model = addPoints1(model, grainData, numX); |
| | | } |
| | | } |
| | | //å¨ææ°æ®ä¿¡æ¯--æµ
åä» |
| | | if (DepotType.T_02 == depotData.depotType) { |
| | | model = addPoints4(model, grainData); |
| | | } |
| | | //å¨ææ°æ®ä¿¡æ¯--æ²¹ç½ |
| | | if (DepotType.T_03 == depotData.depotType) { |
| | | var oilHeight = grainData.oilHeight; |
| | | if (oilHeight) { |
| | | var att = oilHeight.split("-"); |
| | | model = model.replace("c_depotHeight", att[1]) |
| | | .replace("c_oilHeight", att[0]); |
| | | } else { |
| | | model = model.replace("c_depotHeight", "#") |
| | | .replace("c_oilHeight", "#"); |
| | | } |
| | | model = addPoints4(model, grainData); |
| | | } |
| | | //å¨ææ°æ®ä¿¡æ¯--ç«çä» |
| | | if (DepotType.T_04 == depotData.depotType) { |
| | | model = addPoints4(model, grainData); |
| | | } |
| | | return model; |
| | | }; |
| | | |
| | | /** |
| | | * å¹³æ¹ä»æå°æ¥è¡¨ |
| | | */ |
| | | builderModelLay = function (grainData) { |
| | | |
| | | var companyId = grainData.companyId; |
| | | var depotData = grainData.depotData; |
| | | var quality = grainData.mquality; |
| | | var qualityItemMap = {}; |
| | | if (quality) { |
| | | var item = quality.checkItems; |
| | | if (item) { |
| | | for (var i = 0; i < item.length; i++) { |
| | | qualityItemMap[item[i].standardId] = item[i]; |
| | | } |
| | | } |
| | | } |
| | | var cable = grainData.cable; |
| | | var attr = cable.split("-"); |
| | | var numZ = attr[0];//å±é
ç½® |
| | | var numY = attr[1];//è¡é
ç½® |
| | | var numX = attr[2];//åé
ç½® |
| | | var listLays = grainData.listLays; |
| | | |
| | | var model = "<!DOCTYPE html><html lang=\"zh-cn\">\n" |
| | | + "<head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\"><title>ç²®æ
æ¥è¡¨æ¨¡ç</title>" |
| | | + " <style>\n" |
| | | + " table,table tr th,table tr td{border:1px solid #0d1021}table{width:100%;line-height:23px;text-align:center;font-size:14px}.table-2{border-top:0px solid #0d1021 !important}.table-2 tr{border-top:0px solid #0d1021 !important}.table-2 td{border-top:0px solid #0d1021 !important}.table-row-tr{border-left:0px !important;border-right:0px !important;border-top:0px !important}.table-row-fz{border:0px !important}.link-top{width:100%;border-top:solid #0d1021 1px}</style>\n" |
| | | + "</head>\n" + "<body>"; |
| | | |
| | | model += "<div style=\"text-align: center\">\n" |
| | | + "<span style=\"font-size: 26px; font-weight: bold;\">\n"; |
| | | if (dept) { |
| | | model += dept.deptName; |
| | | } else { |
| | | model += "--XXX--ç²®åº" |
| | | } |
| | | model += "</span><div class=\"link-top\"></div><div class=\"link-top\"></div>\n"; |
| | | model += "<span style=\"font-size: 18px; \">"; |
| | | model += depotData.name; |
| | | if (compareData) { |
| | | model += " ç²®æ
æ¥è¡¨(å±åºå) å¯¹æ¯ " + compareData.batchId + "</span>\n"; |
| | | } else { |
| | | model += " ç²®æ
æ¥è¡¨(å±åºå)</span>\n"; |
| | | } |
| | | model += "</div><div style=\"margin-top: 5px;\"><span style=\"float: left;\">天æ°ï¼"; |
| | | model += grainData.weather == null ? "" : grainData.weather; |
| | | model += " æ¹åï¼"; |
| | | model += depotData.orientation == null ? "" : depotData.orientation |
| | | model += "</span><span style=\"float: right;\">æ£æµæ¶é´ï¼"; |
| | | model += grainData.receiveDate; |
| | | model += "</span></div>"; |
| | | |
| | | //卿é
ç½® |
| | | model += "<table cellspacing=\"0\" cellpadding=\"0\"><tr><td colspan=\"2\"></td>"; |
| | | //å¨ææ·»å åé
ç½® |
| | | for (var x = 1; x <= numX; x++) { |
| | | model += "<td>第" + x + "å</td>"; |
| | | } |
| | | model += "</tr>"; |
| | | //å¨ææ·»å ééç¹ä¿¡æ¯ Y |
| | | for (var y = 1; y <= numY; y++) { |
| | | for (var z = 1; z <= numZ; z++) { |
| | | model += "<tr>"; |
| | | if (1 == z) { |
| | | model += "<td rowspan=" + numZ + " class=\"table-row-tr\">" |
| | | + y + "è¡</td>"; |
| | | } |
| | | if (z == numZ) { |
| | | model += "<td class=\"table-row-tr\">" + z + "å±</td>"; |
| | | } else { |
| | | model += "<td class=\"table-row-fz\">" + z + "å±</td>"; |
| | | } |
| | | for (var x = numX; x >= 1; x--) { //å¼çæ ¼å¼ï¼cell+å±+è¡+å |
| | | if (z == numZ) { |
| | | model += "<td class=\"table-row-tr\">c_" + z + y + x |
| | | + "</td>"; |
| | | } else { |
| | | model += "<td class=\"table-row-fz\">c_" + z + y + x |
| | | + "</td>"; |
| | | } |
| | | } |
| | | model += "</tr>"; |
| | | } |
| | | } |
| | | model += "</table>"; |
| | | //å¼å§æ·»å ç²®æ
æ´ä½æ°æ® |
| | | model += "<table cellspacing=\"0\" cellpadding=\"0\" class=\"table-2\">"; |
| | | model += "<tr><td width=\"200px\">ç²®æ
åæï¼</td>"; |
| | | model += "<td colspan=5>" + grainData.remark + "</td></tr>"; |
| | | model += "</tr><tr><td></td><td>æé«</td><td>æä½</td><td>å¹³å</td><td>å¨å</td><td>å
å</td></tr>"; |
| | | //é忝å±çä¿¡æ¯ |
| | | var layData; |
| | | for (var i = 0; i < listLays.length; i++) { |
| | | layData = listLays[i]; |
| | | model += "<tr><td>"; |
| | | model += layData.fz + "å±"; |
| | | model += "</td><td>"; |
| | | model += layData.tempMax; |
| | | model += "</td><td>"; |
| | | model += layData.tempMin; |
| | | model += "</td><td>"; |
| | | model += layData.tempAve; |
| | | model += "</td><td>"; |
| | | model += layData.tempAveOut; |
| | | model += "</td><td>"; |
| | | model += layData.tempAveIn; |
| | | model += "</td></tr>"; |
| | | } |
| | | //æ´ä» |
| | | model += "<tr><td>æ´ä»</td><td>"; |
| | | model += grainData.tempMax; |
| | | model += "</td><td>"; |
| | | model += grainData.tempMin; |
| | | model += "</td><td>"; |
| | | model += grainData.tempAve; |
| | | model += "</td><td>"; |
| | | model += "</td><td>"; |
| | | model += "</td></tr>"; |
| | | |
| | | //åºå®æ ä½å¼ |
| | | model += "<tr><td>仿¸©ï¼" + (grainData.tempIn <= -100.0 ? "å¤ç¨" : grainData.tempIn) + "</td>"; |
| | | model += "<td>仿¹¿ï¼" + (grainData.humidityIn <= -100.0 ? "å¤ç¨" : grainData.humidityIn) + "</td>"; |
| | | model += "<td colspan=\"2\">æ°æ¸©ï¼" + (grainData.tempOut <= -100.0 ? "å¤ç¨" : grainData.tempOut) + "</td>"; |
| | | model += "<td colspan=\"2\">æ°æ¹¿ï¼" + (grainData.humidityOut <= -100.0 ? "å¤ç¨" : grainData.humidityOut) + "</td></tr>"; |
| | | |
| | | model += "<tr><td>仿¿ç±»å</td><td>" + (depotData.depotTypeName == null ? '/' : depotData.depotTypeName) + "</td>"; |
| | | model += "<td colspan=\"2\">å
¥ä»æ¥æ</td><td colspan=\"2\">" |
| | | + (depotData.storeDate == null ? '/' : depotData.storeDate.substring(0, 10)) + "</td></tr>"; |
| | | |
| | | model += "<tr><td>ç²®é£åç§</td><td>" + (depotData.foodVarietyName == null ? '/' : depotData.foodVarietyName) + "</td>"; |
| | | model += "<td colspan=\"2\">å®é
å¨éï¼å¨ï¼</td><td colspan=\"2\">" |
| | | + (depotData.storageReal == null ? '/' : (Number(depotData.storageReal) / 1000).toFixed(2)) + "</td></tr>"; |
| | | |
| | | model += "<tr><td>æ°´å(å
¥ä»% ~ å½å%)</td><td>" + (depotData.perWet == null ? '/' : depotData.perWet) + " ~ " + getCheckValue(qualityItemMap, "C01") + "</td>"; |
| | | model += "<td colspan=\"2\">åºç³ç(%)</td><td colspan=\"2\">" |
| | | + getCheckValue(qualityItemMap, "C09") + "</td></tr>"; |
| | | |
| | | model += "<tr><td>åè½çï¼%ï¼</td><td>" + getCheckValue(qualityItemMap, "C32") + "</td>";//åè½ç |
| | | model += "<td colspan=\"2\">ç²®é£äº§å°</td><td colspan=\"2\">" |
| | | + (depotData.foodLocation == null ? '/' : depotData.foodLocation) + "</td></tr>"; |
| | | if ('5336' == companyId) { |
| | | model += "<tr><td>容éï¼g/Lï¼</td><td>" + getCheckValue(qualityItemMap, "C03") + "</td>"; |
| | | } else { |
| | | model += "<tr><td>容éï¼kg/m3ï¼</td><td>" + getCheckValue(qualityItemMap, "C03") + "</td>"; |
| | | } |
| | | |
| | | model += "<td colspan=\"2\">é¢çææ°´çï¼%ï¼</td><td colspan=\"2\">" + getCheckValue(qualityItemMap, "C08") + "</td></tr>";//没æå¡«å |
| | | |
| | | model += "<tr><td>æè´¨ï¼%ï¼</td><td>" + getCheckValue(qualityItemMap, "C02") + "</td>"; |
| | | model += "<td colspan=\"2\">ä¸å®åç²ï¼%ï¼</td><td colspan=\"2\">"; |
| | | model += getCheckValue(qualityItemMap, "C04"); |
| | | model += "</td></tr>"; |
| | | |
| | | model += "<tr><td>æ£æµäºº</td><td>" + (grainData.checkUser == null ? '/' : grainData.checkUser) + "</td>"; |
| | | model += "<td colspan=\"2\">ä¿ç®¡å</td><td colspan=\"2\">" |
| | | + (depotData.storeKeeperName == null ? '/' : depotData.storeKeeperName) + "</td></tr>"; |
| | | model += "</table>"; |
| | | |
| | | //æ·»å å°¾é¨ä¿¡æ¯ |
| | | model += "<div style=\"margin-top: 5px;\">"; |
| | | model += "<span style=\"float: left;\">注ï¼#è¡¨ç¤ºå±æä½æ¸© *è¡¨ç¤ºå±æé«æ¸© \<表示çµç¼å¼å§ä½ç½®\></span>"; |
| | | model += "<span style=\"float: right;\">å¶è¡¨æ¶é´ï¼" + grainData.sysDate |
| | | + "</span></div>"; |
| | | model += "</div></body></html>"; |
| | | //ç¹ä½ä¿¡æ¯èµå¼ |
| | | model = attrPointsLay(model, grainData.listPoints, listLays, numX); |
| | | return model; |
| | | }; |
| | | |
| | | //æ ¹æ®ééç¹èµå¼ï¼æ³¨ææ°æ®åºçæçåæ æ¯ä»0å¼å§ç |
| | | attrPointsLay = function (model, listPoints, listLays, numX) { |
| | | var point; |
| | | var key; |
| | | var lay; |
| | | var temp; |
| | | for (var i = 0; i < listPoints.length; i++) { |
| | | point = listPoints[i]; |
| | | temp = point.temp; |
| | | key = "c_" + (point.z + 1) + (point.y + 1) + (point.x + 1); |
| | | //夿å±é«ä½æ¸© |
| | | lay = listLays[point.z]; |
| | | if (-100.0 == temp) { |
| | | temp = "å¤ç¨"; |
| | | } |
| | | if (-101.0 == temp) { |
| | | temp = "æ
é"; |
| | | } |
| | | if (temp == lay.tempMax) { |
| | | temp = temp + "*"; |
| | | } |
| | | if (temp == lay.tempMin) { |
| | | temp = temp + "#"; |
| | | } |
| | | //key = c_z+1 + 1 + numX表示第ä¸å |
| | | if (key == ("c_" + (point.z + 1) + "1" + numX)) { |
| | | temp = "<" + temp + ">"; |
| | | } |
| | | model = model.replace(key, temp); |
| | | } |
| | | return model; |
| | | }; |
| | | |
| | | /** |
| | | * 模æ¿ç¼åKEYççæ |
| | | * @param depotType |
| | | * @param cable |
| | | * @param cableCir |
| | | */ |
| | | builderModelKey = function (depotType, cable, cableCir) { |
| | | if (cableCir) { |
| | | return depotType + "_" + cable + "_" + cableCir; |
| | | } |
| | | return depotType + "_" + cable; |
| | | }; |
| | | |
| | | //æ ¹æ®ééç¹èµå¼ï¼æ³¨ææ°æ®åºçæçåæ æ¯ä»0å¼å§ç |
| | | addPoints1 = function (model, numX) { |
| | | var listPoints = grainData.listPoints; |
| | | var listLays = grainData.listLays; |
| | | var point; |
| | | var key; |
| | | var lay; |
| | | var temp; |
| | | for (var i = 0; i < listPoints.length; i++) { |
| | | point = listPoints[i]; |
| | | temp = point.temp; |
| | | lay = listLays[point.z]; |
| | | //屿 |
| | | if (lay.z <= listLays.length) { |
| | | key = "c_max_" + (lay.z + 1); |
| | | model = model.replace(key, lay.tempMax); |
| | | key = "c_min_" + (lay.z + 1); |
| | | model = model.replace(key, lay.tempMin); |
| | | key = "c_ave_" + (lay.z + 1); |
| | | model = model.replace(key, lay.tempAve); |
| | | key = "c_out_ave_" + (lay.z + 1); |
| | | model = model.replace(key, lay.tempAveOut); |
| | | key = "c_in_ave_" + (lay.z + 1); |
| | | model = model.replace(key, lay.tempAveIn); |
| | | } |
| | | |
| | | key = (point.z + 1) + '_' + (point.y + 1) + '_' + (point.x + 1); |
| | | if (-100.0 == temp) { |
| | | temp = "å¤ç¨"; |
| | | } |
| | | if (-101.0 == temp) { |
| | | temp = "æ
é"; |
| | | } |
| | | if (temp == lay.tempMax) { |
| | | temp = temp + "*"; |
| | | } |
| | | if (temp == lay.tempMin) { |
| | | temp = temp + "#"; |
| | | } |
| | | //key = c_z+1 + 1 + numX表示第ä¸å |
| | | // if (key == ((point.z + 1) + "1" + numX) + "_c") { |
| | | // temp = "<" + temp + ">"; |
| | | // } |
| | | model = model.replace(key, temp); |
| | | } |
| | | return model; |
| | | }; |
| | | |
| | | //横åéé£èµå¼ |
| | | addPointsRow1 = function (model, grainData, numX) { |
| | | var listPoints = grainData.listPoints; |
| | | var listRows = grainData.listRows; |
| | | var point; |
| | | var key; |
| | | var temp; |
| | | for (var i = 0; i < listPoints.length; i++) { |
| | | point = listPoints[i]; |
| | | temp = point.temp; |
| | | row = listRows[point.y]; |
| | | //è¡æå¤§ |
| | | if (row.y <= listRows.length) { |
| | | key = "c_max_" + (row.y + 1); |
| | | model = model.replace(key, row.tempMax); |
| | | key = "c_min_" + (row.y + 1); |
| | | model = model.replace(key, row.tempMin); |
| | | key = "c_ave_" + (row.y + 1); |
| | | model = model.replace(key, row.tempAve); |
| | | } |
| | | |
| | | key = (point.z + 1) + '_' + (point.y + 1) + '_' + (point.x + 1); |
| | | if (-100.0 == temp) { |
| | | temp = "å¤ç¨"; |
| | | } |
| | | if (-101.0 == temp) { |
| | | temp = "æ
é"; |
| | | } |
| | | if (temp == row.tempMax) { |
| | | temp = temp + "*"; |
| | | } |
| | | if (temp == row.tempMin) { |
| | | temp = temp + "#"; |
| | | } |
| | | //key = c_z+1 + 1 + numX表示第ä¸å |
| | | // if (key == ("c_" + (point.z + 1) + "1" + numX)) { |
| | | // temp = "<" + temp + ">"; |
| | | // } |
| | | model = model.replace(key, temp); |
| | | } |
| | | return model; |
| | | }; |
| | | |
| | | //ç仿·»å ééç¹å屿¸©åº¦ä¿¡æ¯ |
| | | addPoints4 = function (model, grainData) { |
| | | // console.log(grainData); |
| | | var listPoints = grainData.listPoints; |
| | | var listLays = grainData.listLays; |
| | | var point; |
| | | var key; |
| | | var lay; |
| | | var temp; |
| | | for (var i = 0; i < listPoints.length; i++) { |
| | | point = listPoints[i]; |
| | | lay = listLays[point.z]; |
| | | temp = point.temp; |
| | | //屿 |
| | | if (lay.z <= listLays.length) { |
| | | key = "c_max_" + lay.z; |
| | | model = model.replace(key, lay.tempMax); |
| | | key = "c_min_" + lay.z; |
| | | model = model.replace(key, lay.tempMin); |
| | | key = "c_ave_" + lay.z; |
| | | model = model.replace(key, lay.tempAve); |
| | | key = "c_out_ave_" + lay.z; |
| | | model = model.replace(key, lay.tempAveOut); |
| | | key = "c_in_ave_" + lay.z; |
| | | model = model.replace(key, lay.tempAveIn); |
| | | } |
| | | |
| | | key = (point.x + 1) + "_" + (point.y + 1) + "_" + (point.z + 1); |
| | | //夿å±é«ä½æ¸© |
| | | if (-100.0 == temp) { |
| | | temp = "å¤ç¨"; |
| | | } |
| | | if (-101.0 == temp) { |
| | | temp = "æ
é"; |
| | | } |
| | | if (-102.0 == temp) { |
| | | temp = "--"; |
| | | } |
| | | if (temp == lay.tempMax) { |
| | | temp = temp + "*"; |
| | | } |
| | | if (temp == lay.tempMin) { |
| | | temp = temp + "#"; |
| | | } |
| | | model = model.replace(key, temp); |
| | | } |
| | | return model; |
| | | }; |
| | | /** |
| | | * æ ¹æ®HTML模çæå°ä¸ºA4 |
| | | * @param strHtml |
| | | */ |
| | | previewA4 = function (strHtml) { |
| | | var LODOP = CLODOP; |
| | | LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4"); |
| | | LODOP.PRINT_INIT("ç²®æ
æ¥è¡¨"); |
| | | LODOP.ADD_PRINT_HTM(30, 40, "180mm", "100%", strHtml); |
| | | //设置é»è®¤æ»¡å¼ æå° |
| | | LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Full-Page"); |
| | | LODOP.PREVIEW(); |
| | | }; |
| | | |
| | | getCheckValue = function (qualityItemMap, key) { |
| | | try { |
| | | return (qualityItemMap[key].value ? qualityItemMap[key].value : "/"); |
| | | } catch (e) { |
| | | console.log(e); |
| | | return "/"; |
| | | } |
| | | return "/"; |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | var layer; |
| | | var grainData;// å½åä»ç²®æ
æ°æ® |
| | | var form; |
| | | var table; |
| | | var element; |
| | | var compareData = null;// å¯¹æ¯æ°æ® |
| | | var listGrainData;// é»è®¤é¡µé¢ä¸çç²®æ
å表 |
| | | var mapGrainData;// æ¹éæå°ä¸çæ¹éç²®æ
ä¿¡æ¯ |
| | | |
| | | $(function () { |
| | | layui.use(['layer', 'laydate', 'form', 'table', 'element'], function () { |
| | | element = layui.element; |
| | | form = layui.form; |
| | | layer = layui.layer; |
| | | var laydate = layui.laydate; |
| | | table = layui.table; |
| | | |
| | | // æ¥æ |
| | | laydate.render({ |
| | | elem: '#checkDateMore', |
| | | type: 'month', |
| | | theme: '#7b8e9f', |
| | | position: 'static', |
| | | done: function (value, date, endDate) { |
| | | flushGrain(value); |
| | | } |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#compareCheckDate', |
| | | type: 'month', |
| | | theme: '#7b8e9f', |
| | | done: function (value, date, endDate) { |
| | | compareStep2(value); |
| | | } |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#printCheckDate', |
| | | theme: '#7b8e9f' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#printCheckDate2', |
| | | theme: '#7b8e9f' |
| | | }); |
| | | form.render(); |
| | | |
| | | // çå¬ä»åºéæ© |
| | | form.on('select(select_depotId)', function (obj) { |
| | | return changeView(); |
| | | }); |
| | | |
| | | // çå¬éæ©æ¹æ¬¡ |
| | | form.on('select(select_batchId)', function (obj) { |
| | | var value = obj.value; |
| | | if (value == "0") {// è¡¨ç¤ºå¼¹åºæ´å¤æ¹æ¬¡ |
| | | showMore(); |
| | | } else { |
| | | flushGrainByBatchId(value); |
| | | } |
| | | }); |
| | | |
| | | // ç嬿¾ç¤ºç±»å |
| | | form.on('switch(filter_switch)', function (obj) { |
| | | var value = obj.value; |
| | | var checked = obj.elem.checked; |
| | | if (checked) { |
| | | if ("lay" == value) {// å± |
| | | $("#switch_row").prop("checked", false); |
| | | $("#switch_col").prop("checked", false); |
| | | lay(); |
| | | } |
| | | if ("row" == value) { |
| | | $("#switch_lay").prop("checked", false); |
| | | $("#switch_col").prop("checked", false); |
| | | row(); |
| | | } |
| | | if ("col" == value) { |
| | | $("#switch_lay").prop("checked", false); |
| | | $("#switch_row").prop("checked", false); |
| | | col(); |
| | | } |
| | | form.render(); |
| | | } |
| | | }); |
| | | |
| | | form.on('switch(filter_switch2)', function (obj) { |
| | | var value = obj.value; |
| | | var checked = obj.elem.checked; |
| | | console.log(value); |
| | | |
| | | if (checked) { |
| | | if ("outer" == value) { |
| | | $("#switch_all").prop("checked", false); |
| | | $("#switch_inner").prop("checked", false); |
| | | display_outside(); |
| | | } |
| | | if ("all" == value) { |
| | | $("#switch_inner").prop("checked", false); |
| | | $("#switch_outer").prop("checked", false); |
| | | display_all(); |
| | | } |
| | | if ("inner" == value) { |
| | | $("#switch_all").prop("checked", false); |
| | | $("#switch_outer").prop("checked", false); |
| | | display_inside(); |
| | | } |
| | | form.render(); |
| | | } |
| | | }); |
| | | |
| | | // çå¬å¯¹æ¯æ°æ® |
| | | table.on('radio(filterTable)', function (obj) { |
| | | compareData = obj.data; |
| | | }); |
| | | |
| | | //åå§åå·æ°æ°æ® |
| | | initData(); |
| | | }); |
| | | |
| | | // åå§ååæ ç³» |
| | | initGrainChar3d(); |
| | | |
| | | }); |
| | | |
| | | function initData() { |
| | | if (depotId) { |
| | | $("#depotId").val(depotId); |
| | | flushGrain(null); |
| | | form.render(); |
| | | } |
| | | } |
| | | |
| | | function changeView() { |
| | | depotId = $("#depotId").val(); |
| | | window.location.href = "/grain/gateway?depotId=" + depotId; |
| | | return true; |
| | | } |
| | | |
| | | // åä»æå° |
| | | function printSingle() { |
| | | layer.msg("å¼å§è°ç¨åå°æå°æ¨¡æ¿â¦â¦"); |
| | | toPrintSingle(grainData); |
| | | } |
| | | |
| | | // æ¹éæå° |
| | | function printBatch() { |
| | | // é¦å
å»é¤ä¹åçéæ© |
| | | $('#batchPrintSelect input').each(function () { |
| | | var name = $(this).prop("name"); |
| | | if (name == "printCheckDate") {// è·³è¿ |
| | | return true; |
| | | } |
| | | $(this).prop("disabled", false); |
| | | $(this).prop("checked", false); |
| | | }); |
| | | form.render(); |
| | | |
| | | //åå§åæ¹éæ¨¡æ¿ |
| | | initModel(); |
| | | |
| | | // å¼¹åºéæ©æ¡ |
| | | layer.open({ |
| | | type: 1, |
| | | title: 'æ¹éç²®æ
æå°ï¼çº¢è²è¡¨ç¤ºæ²¡æç²®æ
è®°å½ï¼é»è®¤ä¸ºå½å¤©ï¼', |
| | | area: ['750px', '450px'], |
| | | shade: 0, |
| | | content: $('#batchPrintSelect'), |
| | | btn: ['å
¨é', 'åé', 'éé', 'æ§è¡æå°', 'åæ¶æå°'], |
| | | yes: function () { |
| | | var name; |
| | | $('#batchPrintSelect input').each(function () { |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate" || $(this).prop("disabled")) { |
| | | // doNothing |
| | | } else { |
| | | $(this).prop("checked", true); |
| | | } |
| | | }); |
| | | form.render(); |
| | | }, |
| | | btn2: function () { |
| | | var name; |
| | | $('#batchPrintSelect input').each(function () { |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate" || $(this).prop("disabled")) { |
| | | // doNothing |
| | | } else { |
| | | if ($(this).prop("checked")) { |
| | | $(this).prop("checked", false); |
| | | } else { |
| | | $(this).prop("checked", false); |
| | | } |
| | | } |
| | | }); |
| | | form.render(); |
| | | return false; |
| | | }, |
| | | btn3: function () { |
| | | var name; |
| | | $('#batchPrintSelect input').each(function () { |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate" || $(this).prop("disabled")) { |
| | | // doNothing |
| | | } else { |
| | | $(this).prop("checked", false); |
| | | } |
| | | }); |
| | | form.render(); |
| | | return false; |
| | | }, |
| | | btn4: function () { |
| | | printBatchTodo(); |
| | | }, |
| | | btn5: function () { |
| | | layer.close(0); |
| | | }, |
| | | closeBtn: 0 |
| | | }); |
| | | // é»è®¤è°ç¨è·åæ°æ®æ´æ° |
| | | $("#printCheckDate").prop("value", dateFtt("yyyy-MM-dd", new Date())); |
| | | getPrintBatchDepot(); |
| | | }; |
| | | |
| | | // è·åæ¹éæå°çä¿¡æ¯ |
| | | function getPrintBatchDepot() { |
| | | layer.msg("éªè¯ç²®æ
æ£æµè®°å½â¦â¦"); |
| | | var checkDate = $("#printCheckDate").val(); |
| | | var checkHour = $("#printCheckHour").val(); |
| | | |
| | | //console.log(checkTime); |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/query-checkDate-map", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify({ |
| | | checkDate: checkDate, |
| | | checkHour: checkHour |
| | | }), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.msg(result.msg); |
| | | disabledAllSelectDepot(); |
| | | } else { |
| | | mapGrainData = result.data; |
| | | updateSelectDepot(); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.msg("æ¹éæå°è·åç²®æ
ä¿¡æ¯å¤±è´¥ï¼"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // æ ¹æ®æ¥è¯¢çæ°æ®æ¹éæå°é¢è§ |
| | | function printBatchTodo() { |
| | | layer.msg("å¼å§æ¹éçææå°æ¨¡çâ¦â¦"); |
| | | var strHtml; |
| | | var value; |
| | | var checked; |
| | | var printGrainData; |
| | | // å°ä»åºæ°æ®å表转æ¢ä¸ºMAP |
| | | var mapDepot = {}; |
| | | $.each(listDepot, function (index, data) { |
| | | mapDepot[data.id] = data; |
| | | }); |
| | | var LODOP = CLODOP; |
| | | // 设置é»è®¤æ»¡å¼ æå° |
| | | LODOP.PRINT_INIT("ç²®æ
æ¥è¡¨");// åå§åå¨å¾ªç¯å¤ |
| | | LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4"); |
| | | $('#batchPrintSelect input').each(function () { |
| | | if ($(this).prop("name") == "printCheckDate") {// è·³è¿ |
| | | return true; |
| | | } |
| | | checked = $(this).prop("checked"); |
| | | if (checked) { |
| | | value = $(this).val(); |
| | | printGrainData = mapGrainData[value]; |
| | | if (!printGrainData) {// å¦ææ²¡æç²®æ
æ°æ®è·³è¿æ§è¡ä¸ä¸ä¸ª |
| | | return true; |
| | | } |
| | | LODOP.NewPage(); |
| | | printGrainData.depotData = mapDepot[value]; |
| | | strHtml = builderModel(printGrainData); |
| | | LODOP.ADD_PRINT_HTM(30, 40, "180mm", "100%", strHtml); |
| | | } |
| | | }); |
| | | layer.msg("å¼å§è°ç¨æå°ç¨åºé¢è§â¦â¦"); |
| | | LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Full-Page"); |
| | | LODOP.PREVIEW(); |
| | | }; |
| | | |
| | | // 设置æ¹éæå°ä¸ææä»åºä¸å¯éæ© |
| | | function disabledAllSelectDepot() { |
| | | var name; |
| | | $('#batchPrintSelect input').each(function () { |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate") {// è·³è¿ |
| | | return true; |
| | | } |
| | | $(this).prop("disabled", true); |
| | | }); |
| | | form.render(); |
| | | }; |
| | | |
| | | function updateSelectDepot() { |
| | | var value, name; |
| | | $('#batchPrintSelect input').each(function () { |
| | | value = $(this).val(); |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate") {// è·³è¿ |
| | | return true; |
| | | } |
| | | if (mapGrainData[value]) { |
| | | $(this).prop("disabled", false); |
| | | } else { |
| | | $(this).prop("disabled", true); |
| | | } |
| | | }); |
| | | form.render(); |
| | | }; |
| | | |
| | | // ç²®æ
å¯¹æ¯ |
| | | function compare() { |
| | | if (!depotId) { |
| | | layer.msg("请å
éæ©ä»åºâ¦â¦"); |
| | | return; |
| | | } |
| | | var batchId = $("#batchId").val(); |
| | | if (!batchId) { |
| | | layer.msg("å½å没æå¯ä»¥æ¯è¾çæ°æ®â¦â¦"); |
| | | return; |
| | | } |
| | | // 为äºé¿å
é夿¯è¾åºç°çé®é¢ï¼å¦æå·²ç»æ¯è¾è¿æ°æ®ï¼å卿¯è¾åå·æ°ä¸æ°æ® |
| | | if (compareData) { |
| | | flushGrainByBatchId(batchId); |
| | | } |
| | | // é¦å
å¼¹åºå± |
| | | layer.open({ |
| | | type: 1, |
| | | title: 'ç²®æ
对æ¯éæ©', |
| | | area: ['330px', '640px'], |
| | | shade: 0, |
| | | content: $('#compareSelect'), |
| | | btn: ['确认对æ¯', '忶坹æ¯'], |
| | | yes: function () { |
| | | if (compareData) { |
| | | layer.msg("å¼å§æ§è¡æ¹æ¬¡å¯¹æ¯â¦â¦"); |
| | | compareStep3(grainData, compareData); |
| | | } else { |
| | | layer.msg("没æè·åå°å¯¹æ¯æ°æ®ï¼ï¼"); |
| | | } |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | closeBtn: 1 |
| | | }); |
| | | |
| | | $("#compareCheckDate").prop("value", null); |
| | | compareStep2(null); |
| | | form.render(); |
| | | }; |
| | | |
| | | function compareStep2(compareDate) { |
| | | depotId = $("#depotId").val(); |
| | | if (!depotId) { |
| | | layer.msg("请å
éæ©ä»åºï¼"); |
| | | return; |
| | | } |
| | | if (!compareDate) { |
| | | compareDate = $("#compareCheckDate").val(); |
| | | } |
| | | var data = { |
| | | depotId: depotId, |
| | | checkMonth: compareDate, |
| | | extBatchId: grainData.batchId |
| | | }; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/page-list", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.msg(result.msg); |
| | | } else { |
| | | table.render({ |
| | | elem: '#tableSelect', |
| | | height: 450, |
| | | data: result.data, |
| | | page: false, |
| | | limit: 100, |
| | | skin: "nob", |
| | | even: true, |
| | | size: "sm", |
| | | cols: [[{ |
| | | type: 'radio', |
| | | fixed: 'left', |
| | | title: 'éæ©' |
| | | }, { |
| | | field: 'receiveDate', |
| | | title: 'æ£æµæ¶é´', |
| | | align: 'center', |
| | | }]] |
| | | }); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.msg("è·åå½åä»åºæ£æµè®°å½å¤±è´¥ï¼è¯·éæ°å°è¯ï¼ï¼"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å¼å§æ¹æ¬¡å¯¹æ¯ |
| | | function compareStep3(dataA, dataB) { |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/data-compare", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify({ |
| | | dataA: dataA, |
| | | dataB: dataB |
| | | }), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.msg(result.msg); |
| | | } else { |
| | | // è¦ç页é¢ä¸çç²®æ
æ°æ® |
| | | grainData = result.data; |
| | | // æ¾ç¤ºééç¹ä¿¡æ¯ |
| | | resetGrainChart3d(); |
| | | // ç²®æ
ä¿¡æ¯èµå¼ |
| | | renderGrainInfo(); |
| | | |
| | | layer.closeAll(); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.msg("æ¹æ¬¡å¯¹æ¯åºç°å¼å¸¸ï¼è¯·éæ°éæ©"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // ç¹å»å·æ°æä½ |
| | | function flushGrain(checkMonth) { |
| | | compareData = null; |
| | | depotId = $("#depotId").val(); |
| | | |
| | | if (!depotId) { |
| | | layer.alert("请å
éæ©ä»åºï¼"); |
| | | return; |
| | | } |
| | | var data = { |
| | | depotId: depotId, |
| | | checkMonth: checkMonth |
| | | }; |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/query-list-data", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.msg(result.msg); |
| | | clearGrainChart3d(); |
| | | } |
| | | listGrainData = result.data; |
| | | if (!listGrainData) { |
| | | return; |
| | | } |
| | | grainData = listGrainData[0]; |
| | | // æ¾ç¤ºééç¹ä¿¡æ¯ |
| | | resetGrainChart3d(); |
| | | // ç²®æ
ä¿¡æ¯èµå¼ |
| | | renderGrainInfo(); |
| | | // 卿¹æ¬¡éæ©ä¸æ·»å ä¸ææ°æ® |
| | | resetSelectBatchId(); |
| | | // è°ç¨å
¨é¨å
³é |
| | | layer.closeAll(); |
| | | layer.msg("æ´æ°æåâ¦â¦"); |
| | | }, |
| | | error: function () { |
| | | layer.msg("æ ¹æ®å½åæ¡ä»¶è·åç²®æ
æ°æ®æ¸²æå¾æ 失败ï¼ï¼"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // å¡«åç²®æ
ä¿¡æ¯ |
| | | function renderGrainInfo() { |
| | | // é
ç½®ä»åºå¡çä¿¡æ¯ |
| | | var depotData = grainData.depotData; |
| | | $("#depotTypeName").text(depotData.depotTypeName); |
| | | $("#storeDate").text(depotData.storeDate); |
| | | $("#storageReal").text(depotData.storageReal); |
| | | $("#foodVarietyName").text(depotData.foodVarietyName); |
| | | $("#perWet").text(depotData.perWet); |
| | | $("#depotStatus").text(DEPOT_STATUS_MSG(depotData.depotStatus)); |
| | | $("#foodLocation").text(depotData.foodLocation); |
| | | $("#perImpurity").text(depotData.perImpurity); |
| | | $("#storeKeeperName").text(depotData.storeKeeperName); |
| | | $("#storeKeeperLevel").text(depotData.storeKeeperLevel); |
| | | $("#storeKeeperPhone").text(depotData.storeKeeperPhone); |
| | | |
| | | // ç²®æ
æ£æµä¿¡æ¯èµå¼ |
| | | $("#checkUser").text(grainData.checkUser); |
| | | $("#tempMax").text(grainData.tempMax); |
| | | $("#tempAve").text(grainData.tempAve); |
| | | $("#tempMin").text(grainData.tempMin); |
| | | |
| | | |
| | | //console.log("------------"+grainData.humidityIn); |
| | | //å¦ææ¹¿åº¦==0表示没æè·åå° |
| | | if(grainData.humidityIn != 0){ |
| | | $("#tempIn").text(grainData.tempIn <= -100.0 ? "--" : grainData.tempIn); |
| | | $("#humidityIn").text( |
| | | grainData.humidityIn <= -100.0 ? "--" : grainData.humidityIn); |
| | | } |
| | | if(grainData.humidityOut != 0){ |
| | | $("#tempOut").text(grainData.tempOut <= -100.0 ? "--" : grainData.tempOut); |
| | | $("#humidityOut").text( |
| | | grainData.humidityOut <= -100.0 ? "--" : grainData.humidityOut); |
| | | } |
| | | }; |
| | | |
| | | // æ ¹æ®æ¹æ¬¡æ´æ°çå¼è°æ´ |
| | | function flushGrainByBatchId(batchId) { |
| | | var temp; |
| | | $.each(listGrainData, function (index, item) { |
| | | if (item.batchId == batchId) { |
| | | temp = item; |
| | | return false; |
| | | } |
| | | }); |
| | | if (temp) { |
| | | grainData = temp; |
| | | // æ¾ç¤ºééç¹ä¿¡æ¯ |
| | | resetGrainChart3d(); |
| | | // ç²®æ
ä¿¡æ¯èµå¼ |
| | | renderGrainInfo(); |
| | | layer.msg("æ´æ°æåâ¦â¦"); |
| | | } |
| | | }; |
| | | |
| | | // éç½®æ¹æ¬¡ä¸ææ¡ |
| | | function resetSelectBatchId() { |
| | | // é¦å
æ¸
ç©ºåæ¥çå¼ |
| | | $("#batchId").empty(); |
| | | // æªä¸ææ¡èµå¼ |
| | | $.each(listGrainData, function (index, item) { |
| | | $('#batchId').append(new Option(item.receiveDate, item.batchId));// 䏿èåéæ·»å å
ç´ |
| | | }); |
| | | $('#batchId').append(new Option("éæ©æ¶é´â¦â¦", "0")); |
| | | form.render(); |
| | | }; |
| | | |
| | | // æ´å¤æ¹æ¬¡éæ© |
| | | function showMore() { |
| | | layer.open({ |
| | | type: 1, |
| | | title: 'éæ©æ£æµæ¶é´', |
| | | area: ['300px', '400px'], |
| | | shade: 0, |
| | | content: $('#dialogMoreSelect'), |
| | | btn: 0, |
| | | closeBtn: 1 |
| | | }); |
| | | }; |
| | | |
| | | // å个粮æ
æ£æµ |
| | | function checkGrain() { |
| | | if (!depotId) { |
| | | layer.msg("请å
éæ©ä»åºï¼"); |
| | | return; |
| | | } |
| | | var data = { |
| | | depotId: depotId |
| | | }; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/check-single", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | showOrderProgress(); |
| | | if (result.code != "ORDER_SUCCESS") { |
| | | layer.msg(result.msg); |
| | | } else { |
| | | layer.msg("å½ä»¤å·²ç»æååéï¼å¾
ç»ç«¯ååºâ¦â¦"); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("ç²®æ
æ£æµåºç°å¼å¸¸ï¼æ§è¡å¤±è´¥ï¼"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // æ¹éç²®æ
éé |
| | | function checkGrainBatch() { |
| | | $('#batchCheckSelect input').each(function () { |
| | | $(this).prop("checked", false); |
| | | }); |
| | | form.render(); |
| | | // å¼¹åºéæ©æ¡ |
| | | layer.open({ |
| | | type: 1, |
| | | title: 'æ¹éæ£æµéæ©ä»åº', |
| | | area: ['730px', '450px'], |
| | | shade: 0, |
| | | content: $('#batchCheckSelect'), |
| | | btn: ['å
¨é', 'åé', 'éé', 'ç¡®å®æ£æµ', 'åæ¶æ£æµ'], |
| | | yes: function () { |
| | | $('#batchCheckSelect input').each(function () { |
| | | $(this).prop("checked", true); |
| | | }); |
| | | form.render(); |
| | | }, |
| | | btn2: function () { |
| | | $('#batchCheckSelect input').each(function () { |
| | | if ($(this).prop("checked")) { |
| | | $(this).prop("checked", false); |
| | | } else { |
| | | $(this).prop("checked", true); |
| | | } |
| | | }); |
| | | form.render(); |
| | | return false; |
| | | }, |
| | | btn3: function () { |
| | | $('#batchCheckSelect input').each(function () { |
| | | $(this).prop("checked", false); |
| | | }); |
| | | form.render(); |
| | | return false; |
| | | }, |
| | | btn4: function () { |
| | | showOrderProgress(); |
| | | return checkBatchTodo(); |
| | | }, |
| | | btn5: function () { |
| | | layer.close(0); |
| | | }, |
| | | closeBtn: 0 |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * å¼å§æ§è¡æ¹éæ£æµ |
| | | */ |
| | | function checkBatchTodo() { |
| | | var depotIds = ""; |
| | | $('#batchCheckSelect input').each(function () { |
| | | if ($(this).prop("checked")) { |
| | | depotIds += $(this).val() + ","; |
| | | } |
| | | }); |
| | | |
| | | if (depotIds == "") { |
| | | layer.msg("请å
éæ©éè¦æ£æµçä»åºâ¦â¦"); |
| | | return false; |
| | | } |
| | | layer.msg("å¼å§æ§è¡æ¹éæ£æµâ¦â¦"); |
| | | // è°ç¨åå°æ¹éæ£æµ |
| | | var data = { |
| | | depotIds: depotIds |
| | | }; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/check-batch", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | if (result.code != "ORDER_SUCCESS") { |
| | | layer.alert("æ§è¡å¤±è´¥ï¼" + result.msg); |
| | | return false; |
| | | } else { |
| | | layer.msg("å½ä»¤å·²ç»æååéï¼å¾
ç»ç«¯ååºâ¦â¦"); |
| | | return true; |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("ç²®æ
æ£æµåºç°å¼å¸¸ï¼æ§è¡å¤±è´¥ï¼"); |
| | | return false; |
| | | } |
| | | }); |
| | | return true; |
| | | }; |
| | | |
| | | /** |
| | | * å¼¹åºå½ä»¤æ§è¡è¿åº¦æ¡ |
| | | */ |
| | | var iframeOrderIndex = 0; |
| | | |
| | | function showOrderProgress() { |
| | | var domId = "#layui-layer-iframe" + iframeOrderIndex; |
| | | if ($(domId).length == 0) { |
| | | iframeOrderIndex = layer.open({ |
| | | type: 2, |
| | | title: "æ§è¡è¿åº¦åè®°å½", |
| | | icon: 1, |
| | | shadeClose: true, |
| | | shade: 0.3, |
| | | closeBtn: 1, |
| | | anim: 2, |
| | | area: ['1000px', '600px'], |
| | | content: '/grain/order-list?depotId=' + depotId + "&t=" + Math.random() |
| | | }); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // ç²®æ
æ¹é导åºEXCEL |
| | | function exportBatch() { |
| | | // å¼¹åºéæ©æ¡ |
| | | layer.open({ |
| | | type: 1, |
| | | title: 'æ¹éå¯¼åºæ¥è¡¨', |
| | | area: ['730px', '450px'], |
| | | shade: 0, |
| | | content: $('#batchExportSelect'), |
| | | btn: ['å
¨é', 'åé', 'éé', 'æ§è¡å¯¼åº', '忶坼åº'], |
| | | yes: function () { |
| | | var name; |
| | | $('#batchExportSelect input').each(function () { |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate2" || $(this).prop("disabled")) { |
| | | |
| | | } else { |
| | | $(this).prop("checked", true); |
| | | } |
| | | }); |
| | | form.render(); |
| | | }, |
| | | btn2: function () { |
| | | var name; |
| | | $('#batchExportSelect input').each(function () { |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate2" || $(this).prop("disabled")) { |
| | | // doNothing |
| | | } else { |
| | | if ($(this).prop("checked")) { |
| | | $(this).prop("checked", false); |
| | | } else { |
| | | $(this).prop("checked", false); |
| | | } |
| | | } |
| | | }); |
| | | form.render(); |
| | | return false; |
| | | }, |
| | | btn3: function () { |
| | | var name; |
| | | $('#batchExportSelect input').each(function () { |
| | | name = $(this).prop("name"); |
| | | if (name == "printCheckDate2" || $(this).prop("disabled")) { |
| | | // doNothing |
| | | } else { |
| | | $(this).prop("checked", false); |
| | | } |
| | | }); |
| | | form.render(); |
| | | return false; |
| | | }, |
| | | btn4: function () { |
| | | exportBatchTodo(); |
| | | }, |
| | | btn5: function () { |
| | | layer.close(0); |
| | | }, |
| | | closeBtn: 0 |
| | | }); |
| | | |
| | | // é»è®¤è°ç¨è·åæ°æ®æ´æ° |
| | | if (grainData) { |
| | | $("#printCheckDate2").prop("value", grainData.receiveDate.substr(0, 10)); |
| | | } else { |
| | | $("#printCheckDate2").prop("value", dateFtt("yyyy-MM-dd", new Date())); |
| | | } |
| | | }; |
| | | |
| | | function exportBatchTodo() { |
| | | var depotIds = ""; |
| | | $('#batchExportSelect input').each(function () { |
| | | if ($(this).prop("checked")) { |
| | | depotIds += $(this).val() + ","; |
| | | } |
| | | }); |
| | | |
| | | if (depotIds == "") { |
| | | layer.alert("è¯·éæ©éè¦å¯¼åºçä»åºâ¦â¦"); |
| | | return false; |
| | | } |
| | | |
| | | layer.load(); |
| | | // è°ç¨åå°æ¹éæ£æµ |
| | | var checkDate = $("#printCheckDate2").val(); |
| | | var data = { |
| | | companyId: companyId, |
| | | deptId: deptId, |
| | | depotIds: depotIds, |
| | | checkDate: checkDate |
| | | }; |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/export-batch", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | layer.closeAll('loading'); |
| | | if (result.code != "ORDER_SUCCESS") { |
| | | layer.alert("å¯¼åºæ¨¡ç失败ï¼" + result.msg); |
| | | return false; |
| | | } else { |
| | | layer.closeAll('loading'); |
| | | downLoadExcel(result.msg); |
| | | return true; |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.closeAll('loading'); |
| | | layer.alert("ç²®æ
导åºEXCElæ§è¡åºéï¼è¯·ä»æ°æ§è¡"); |
| | | return false; |
| | | } |
| | | }); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * å建ä¸ä¸ªAæ ç¾æ§è¡ä¸è½½ |
| | | * @param fileName |
| | | */ |
| | | function downLoadExcel(fileName) { |
| | | var url = "../../basic/file/download-temp?companyId=" + companyId + "&fileName=" + fileName; |
| | | var link = document.createElement('a'); |
| | | link.style.display = 'none'; |
| | | link.href = url; |
| | | document.body.appendChild(link) |
| | | link.click(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | @charset "utf-8"; |
| | | |
| | | /*----------------- |
| | | Author:xq |
| | | update:2019 |
| | | -------------------*/ |
| | | body { |
| | | font-family: "微软é
é»", Arial, sans-serif; |
| | | font-size: 14px; |
| | | background: #f3f5f8; |
| | | } |
| | | |
| | | i,em{ |
| | | font-style: normal; |
| | | } |
| | | |
| | | |
| | | .radius-3{ |
| | | -webkit-border-radius: 3px; |
| | | -moz-border-radius: 3px; |
| | | -ms-border-radius: 3px; |
| | | -o-border-radius: 3px; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .radius-4{ |
| | | -webkit-border-radius: 4px; |
| | | -moz-border-radius: 4px; |
| | | -ms-border-radius: 4px; |
| | | -o-border-radius: 4px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .radius-6, |
| | | .lq-rMenu li{ |
| | | -webkit-border-radius: 6px; |
| | | -moz-border-radius: 6px; |
| | | -ms-border-radius: 6px; |
| | | -o-border-radius: 6px; |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | .box-shadow{ |
| | | -webkit-box-shadow: 0px 0px 9px 3px rgba(230,230,230,0.6); |
| | | -moz-box-shadow: 0px 0px 9px 3px rgba(230,230,230,0.6); |
| | | box-shadow: 0px 0px 9px 3px rgba(230,230,230,0.6); |
| | | } |
| | | |
| | | |
| | | .lq-userbox{ |
| | | min-height: 85px; |
| | | padding: 6px 6px; |
| | | } |
| | | |
| | | .lq-user{ |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | |
| | | .lq-user img{ |
| | | width: 85px; |
| | | /*height: 85px;*/ |
| | | -webkit-border-radius: 50%; |
| | | border-radius: 50%; |
| | | } |
| | | |
| | | .lq-user p{ |
| | | line-height: 30px; |
| | | font-size: 16px; |
| | | color: #000; |
| | | font-weight: bold; |
| | | margin-top: 5px; |
| | | } |
| | | |
| | | .lq-userItem{ |
| | | height: 34px; |
| | | background: #eff4f6; |
| | | overflow: hidden; |
| | | margin-top: 12px; |
| | | } |
| | | |
| | | .lq-userItem dt, |
| | | .lq-userItem dd{ |
| | | float: left; |
| | | height: 34px; |
| | | line-height: 34px; |
| | | |
| | | } |
| | | |
| | | .lq-userItem dt{ |
| | | width: 40%; |
| | | text-align: center; |
| | | color: #6c7781; |
| | | font-size: 16px; |
| | | font-style: italic; |
| | | } |
| | | |
| | | .lq-userItem dd{ |
| | | font-size: 16px; |
| | | color: #000; |
| | | } |
| | | |
| | | .lq-userItem dd span{ |
| | | font-family: arial; |
| | | } |
| | | /*lqjc*/ |
| | | |
| | | .l-container{ |
| | | width: 100%; |
| | | /*max-width: 1680px;*/ |
| | | min-width: 1340px; |
| | | margin-left: auto; |
| | | margin-right: auto; |
| | | } |
| | | |
| | | .l-main{ |
| | | margin: 10px; |
| | | position: relative; |
| | | padding-right: 110px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .l-icon{ |
| | | width: 24px; |
| | | height: 24px; |
| | | display: inline-block; |
| | | position: relative; |
| | | } |
| | | |
| | | .l-icon img{ |
| | | width: 100%; |
| | | height: 100%; |
| | | vertical-align: top; |
| | | } |
| | | |
| | | .fl { |
| | | float: left; |
| | | } |
| | | .fr { |
| | | float: right; |
| | | } |
| | | |
| | | .lq-left{ |
| | | /*width: 20%;*/ |
| | | min-width: 260px; |
| | | } |
| | | |
| | | |
| | | .lq-left1{ |
| | | padding: 6% 5%; |
| | | background: #7b8e9f; |
| | | } |
| | | |
| | | .lq-left1-from{ |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .lq-left1 .lq-left1-from:last-child{ |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .lq-left1 .lq-left1-from .layui-form-label{ |
| | | color: #fff; |
| | | padding: 9px 0; |
| | | text-align: left; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | .lq-left1 .lq-left1-from .layui-input-block{ |
| | | margin-left: 80px; |
| | | } |
| | | |
| | | .lq-left1 .layui-form-select .layui-edge{ |
| | | border-top-color: #666; |
| | | } |
| | | |
| | | .lq-left1 .layui-input-block .layui-input{ |
| | | font-size: 16px; |
| | | color: #000; |
| | | } |
| | | |
| | | .lq-left1 .layui-form-select dl dd.layui-this{ |
| | | background: #7b8e9f; |
| | | } |
| | | .lq-left2{ |
| | | background: #fff; |
| | | overflow: hidden; |
| | | /*margin-top: 20px;*/ |
| | | margin-top: 10px; |
| | | } |
| | | .lq-left2-list{ |
| | | width: 100%; |
| | | } |
| | | |
| | | .lq-left2-list li{ |
| | | height: 20px; |
| | | line-height: 20px; |
| | | overflow: hidden; |
| | | position: relative; |
| | | padding: 3.5% 6%; |
| | | } |
| | | |
| | | .lq-left2-list li h3{ |
| | | float: left; |
| | | color: #6c7781; |
| | | font-size: 16px; |
| | | font-style: italic; |
| | | } |
| | | .lq-left2-list li>em{ |
| | | float: right; |
| | | color: #000; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | .lq-left2-list li h3 span{ |
| | | background: #6c7781; |
| | | width: 4px; |
| | | height: 4px; |
| | | margin-right: 10px; |
| | | position: relative; |
| | | top: -2px; |
| | | } |
| | | |
| | | .lq-left2-list li:nth-child(2n){ |
| | | background: #f8f9fa; |
| | | } |
| | | |
| | | .lq-center{ |
| | | width: 77%; |
| | | position: relative; |
| | | padding-bottom: 50px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .lq-cTop{ |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .lq-cTop-1, |
| | | .lq-cTop-2, |
| | | .lq-cTop-3, |
| | | .lq-cTop-3-2, |
| | | .lq-cTop-4-2, |
| | | .lq-cTop-4{ |
| | | padding: 10px 0; |
| | | overflow: hidden; |
| | | height: 80px; |
| | | text-align: center; |
| | | color: #fff; |
| | | } |
| | | |
| | | .lq-cTop-1{ |
| | | background: url(../img/web/grain/lq-c-bg1.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | width: 29%; |
| | | } |
| | | |
| | | .lq-cTop-2{ |
| | | background: url(../img/web/grain/lq-c-bg2.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | width: 29%; |
| | | } |
| | | |
| | | .lq-cTop-3{ |
| | | background: url(../img/web/grain/lq-c-bg3.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | width: 19.5%; |
| | | } |
| | | |
| | | .lq-cTop-3-2{ |
| | | background: url(../img/web/grain/lq-c-bg3.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | } |
| | | |
| | | .lq-cTop-4{ |
| | | background: url(../img/web/grain/lq-c-bg4.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | width: 19.5%; |
| | | } |
| | | |
| | | .lq-cTop-4-2{ |
| | | background: url(../img/web/grain/lq-c-bg4.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | } |
| | | |
| | | .ml4{ |
| | | margin-left: 1%; |
| | | } |
| | | |
| | | .lq-cTop-item{ |
| | | background: url(../img/web/grain/lq-li-bg.png) right center no-repeat; |
| | | } |
| | | |
| | | .lq-cTop-item:last-child{ |
| | | background: none; |
| | | } |
| | | |
| | | .lq-cTop-item p{ |
| | | height: 40px; |
| | | line-height: 40px; |
| | | font-size: 16px; |
| | | margin-top: 5px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .lq-cTop-item h4{ |
| | | font-size: 14px; |
| | | line-height: 20px; |
| | | margin-top: 5px; |
| | | height: 25px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .lq-cTop-item p span{ |
| | | font-size: 28px; |
| | | } |
| | | |
| | | .lq-wendu{ |
| | | width: 90px; |
| | | height: 200px; |
| | | position: absolute; |
| | | bottom: 0; |
| | | z-index: 99; |
| | | left: 0; |
| | | } |
| | | |
| | | .lq-wendu-color, |
| | | .lq-wendu-color img{ |
| | | width: 10px; |
| | | height: 200px; |
| | | } |
| | | |
| | | .lq-wendu-num{ |
| | | width: 75px; |
| | | } |
| | | |
| | | .lq-wendu-num p{ |
| | | line-height: 20px; |
| | | color: #000; |
| | | font-size: 14px; |
| | | margin-bottom: 70px; |
| | | } |
| | | |
| | | .lq-cPic-box{ |
| | | width: 80%; |
| | | |
| | | margin: 3% auto 0 auto; |
| | | text-align: center; |
| | | } |
| | | |
| | | .lq-cPic{ |
| | | width: 100%; |
| | | margin: 0 auto; |
| | | } |
| | | |
| | | .lq-right{ |
| | | width: 90px; |
| | | position: absolute; |
| | | right: 0; |
| | | top: 0; |
| | | z-index: 99; |
| | | height: 100%; |
| | | } |
| | | |
| | | .lq-r-fx{ |
| | | width: 80px; |
| | | margin-left: 10px; |
| | | margin-top: 25px; |
| | | height: 80px; |
| | | background: url(../img/web/grain/img-dnxb.png) center no-repeat; |
| | | overflow: hidden; |
| | | position: relative; |
| | | } |
| | | |
| | | .lq-r-fx p{ |
| | | line-height: 15px; |
| | | font-size: 12px; |
| | | height: 15px; |
| | | overflow: hidden; |
| | | color: #000; |
| | | text-align: center; |
| | | margin-bottom: 17px; |
| | | width: 100%; |
| | | } |
| | | |
| | | .lq-rMenu{ |
| | | position: absolute; |
| | | bottom: 0; |
| | | width: 90px; |
| | | z-index: 99; |
| | | } |
| | | .lq-rMenu li{ |
| | | width: 90px; |
| | | height: 90px; |
| | | margin-top: 10px; |
| | | text-align: center; |
| | | background: #fff; |
| | | } |
| | | .lq-rMenu li a{ |
| | | display: block; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | .lq-rMenu li a span{ |
| | | width: 48px; |
| | | height: 48px; |
| | | margin-top: 5px; |
| | | |
| | | } |
| | | |
| | | .lq-rMenu li a p{ |
| | | line-height: 20px; |
| | | color: #FFF; |
| | | font-size: 14px; |
| | | height: 20px; |
| | | overflow: hidden; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .lq-rMenu li .lq-rMenu-icon1{ |
| | | background: url(../img/web/grain/lq-r-icon1.png); |
| | | } |
| | | |
| | | .lq-rMenu li .lq-rMenu-icon2{ |
| | | background: url(../img/web/grain/lq-r-icon2.png); |
| | | } |
| | | .lq-rMenu li .lq-rMenu-icon3{ |
| | | background: url(../img/web/grain/lq-r-icon3.png); |
| | | } |
| | | .lq-rMenu li .lq-rMenu-icon4{ |
| | | background: url(../img/web/grain/lq-r-icon4.png); |
| | | } |
| | | .lq-rMenu li .lq-rMenu-icon5{ |
| | | background: url(../img/web/grain/lq-r-icon5.png); |
| | | } |
| | | |
| | | .lq-rMenu li .lq-rMenu-icon6{ |
| | | background: url(../img/web/grain/lq-r-icon6.png); |
| | | } |
| | | |
| | | .lq-a1{ |
| | | background: url(../img/web/grain/lq-c-bg1.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | .lq-a2{ |
| | | background: url(../img/web/grain/lq-c-bg2.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | .lq-a3{ |
| | | background: url(../img/web/grain/lq-c-bg3.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | .lq-a4{ |
| | | background: url(../img/web/grain/lq-c-bg4.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | border-radius: 6px; |
| | | } |
| | | .lq-a5{ |
| | | background: url(../img/web/grain/lq-c-bg5.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | .lq-a6{ |
| | | background: url(../img/web/grain/lq-c-bg6.png) no-repeat; |
| | | background-size: 100% 100%; |
| | | border-radius: 6px; |
| | | } |
| | | |
| | | .lq-rMenu li:hover, |
| | | .lq-rMenu li.active{ |
| | | background: #53adce; |
| | | } |
| | | |
| | | |
| | | .lq-rMenu li:hover a p, |
| | | .lq-rMenu li.active a p{ |
| | | color: #fff; |
| | | } |
| | | |
| | | .lq-rMenu li:hover .lq-rMenu-icon1, |
| | | .lq-rMenu li.active .lq-rMenu-icon1{ |
| | | background: url(../img/web/grain/lq-r-icon1-h.png); |
| | | } |
| | | |
| | | .lq-rMenu li:hover .lq-rMenu-icon2, |
| | | .lq-rMenu li.active .lq-rMenu-icon2{ |
| | | background: url(../img/web/grain/lq-r-icon2-h.png); |
| | | } |
| | | .lq-rMenu li:hover .lq-rMenu-icon3, |
| | | .lq-rMenu li.active .lq-rMenu-icon3{ |
| | | background: url(../img/web/grain/lq-r-icon3-h.png); |
| | | } |
| | | .lq-rMenu li:hover .lq-rMenu-icon4, |
| | | .lq-rMenu li.active .lq-rMenu-icon4{ |
| | | background: url(../img/web/grain/lq-r-icon4-h.png); |
| | | } |
| | | .lq-rMenu li:hover .lq-rMenu-icon5, |
| | | .lq-rMenu li.active .lq-rMenu-icon5{ |
| | | background: url(../img/web/grain/lq-r-icon5-h.png); |
| | | } |
| | | |
| | | .lq-rMenu li:hover .lq-rMenu-icon6, |
| | | .lq-rMenu li.active .lq-rMenu-icon6{ |
| | | background: url(../img/web/grain/lq-r-icon6-h.png); |
| | | } |
| | | |
| | | .lq-cLow{ |
| | | background: #fff; |
| | | height: 30px; |
| | | padding: 8px 15px; |
| | | overflow: hidden; |
| | | width: 740px; |
| | | left: 140px; |
| | | bottom: 0px; |
| | | position: absolute; |
| | | } |
| | | |
| | | .lq-cLow-left{ |
| | | line-height: 24px; |
| | | } |
| | | |
| | | .top5{ |
| | | margin-top: 5px; |
| | | } |
| | | |
| | | .lq-cLow-1{ |
| | | width: 90px; |
| | | color: #000; |
| | | font-size: 14px; |
| | | border-right: 1px solid #eceef0; |
| | | } |
| | | |
| | | .lq-cLow-1 span{ |
| | | color: #37bd34; |
| | | } |
| | | |
| | | .lq-cLow-2{ |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | |
| | | .lq-cLow-left .layui-form-item{ |
| | | margin-bottom: 0; |
| | | clear: initial; |
| | | } |
| | | |
| | | .lq-cLow-left .layui-form-label{ |
| | | padding: 2px 0; |
| | | text-align: left; |
| | | width: auto; |
| | | } |
| | | |
| | | .lq-cLow-left .layui-input-block{ |
| | | min-height: 24px; |
| | | margin-left: 5px; |
| | | float: left; |
| | | } |
| | | |
| | | |
| | | .lq-cLow-left .layui-form-switch{ |
| | | margin-top: 0; |
| | | } |
| | | |
| | | .lq-cLow-left .layui-form-switch{ |
| | | padding: 0; |
| | | } |
| | | |
| | | .lq-cLow-left .layui-form-onswitch { |
| | | border-color: #53adce; |
| | | background-color: #53adce; |
| | | } |
| | | |
| | | |
| | | .lq-cLow-right .layui-btn{ |
| | | height: 30px; |
| | | line-height: 30px; |
| | | /*color: #324251;*/ |
| | | font-size: 14px; |
| | | /*padding: 0 8px;*/ |
| | | /*background-color: #53adce;*/ |
| | | } |
| | | |
| | | .lq-cLow-right .layui-btn:hover{ |
| | | border-color: #7b8e9f; |
| | | background: #7b8e9f; |
| | | color: #fff; |
| | | } |
| | | |
| | | |
| | | |
| | | @media all and (max-width: 1650px) { |
| | | .lq-cPic-box { |
| | | margin: 5% auto 0 auto; |
| | | } |
| | | .lq-center{ |
| | | padding-bottom: 80px; |
| | | |
| | | } |
| | | .lq-left2-list li { |
| | | padding: 3% 6%; |
| | | } |
| | | |
| | | .lq-cTop-item p span{ |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /**å®ä¹åé**/ |
| | | var listPoints = []; |
| | | var listLays = []; |
| | | var listRows = []; |
| | | /**å**/ |
| | | var cols = 9; |
| | | /**å±**/ |
| | | var lays = 4; |
| | | /**è¡**/ |
| | | var rows = 5; |
| | | |
| | | var oneWidth; |
| | | var oneHeight; |
| | | //ç©å½¢é« |
| | | var back_height; |
| | | //ç©å½¢é¿ |
| | | var back_width; |
| | | //æå¤§å®½ |
| | | var rect_max_width; |
| | | var width; |
| | | var height; |
| | | var x; |
| | | var y; |
| | | var display_mode = "all"; |
| | | |
| | | var edge_distance = 0;//è®¾ç½®è¾¹è· |
| | | |
| | | var blockWidth = 30;//è²å宽度 |
| | | var blockHeight = 15;//è²åé«åº¦ |
| | | var curType = "z";//æ¾ç¤ºç±»å |
| | | var curVal = 1; //æ¾ç¤ºç±»åçåå±è¡ |
| | | var shift; |
| | | var out_window_top; |
| | | var out_window_left; |
| | | var out_window_width; |
| | | |
| | | //åå§ååæ°ï¼å¦æè¡æ°å¤§äº12åï¼éè左侧å¡çä¿¡æ¯ï¼è°æ´åºå宽度 |
| | | function initCanvasParam() { |
| | | if (cols > 12) { |
| | | $("#lq-left2").css("display", "none"); |
| | | $("#lq-center").css("width", "100%"); |
| | | $("#lq-center").css("overflow-x", "auto"); |
| | | var wWidth = window.innerWidth; |
| | | var wHeight = window.innerHeight; |
| | | $("#lq-center").css("height", wHeight - 180); |
| | | if (wWidth < 1600) { |
| | | $("#canvas").attr("width", 1600); |
| | | } else { |
| | | $("#canvas").attr("width", wWidth - 100); |
| | | } |
| | | } else { |
| | | $("#lq-left2").css("display", "block"); |
| | | $("#lq-center").css("width", "80%"); |
| | | $("#canvas").attr("width", "1200"); |
| | | } |
| | | |
| | | oneWidth = 9 * blockWidth * getRatio();//ä¸ä¸ªåå²å¿«ç宽度 |
| | | oneHeight = 6 * blockHeight * getRatio();//ä¸ä¸ªåå²å¿«çé«åº¦ |
| | | |
| | | back_height = oneHeight * 2.1 * (2 - rows / 30); |
| | | back_width = 3 * blockWidth * cols * (2 - cols / 30) / 2; |
| | | rect_max_width = back_width + 0.5 * oneWidth; |
| | | width = oneWidth * 4; |
| | | height = oneHeight * 5; |
| | | x = back_width / 2 - rect_max_width / 2; |
| | | y = back_width / 2 - oneHeight * 2.8; |
| | | |
| | | var canvasParent = $("#canvas_parent"); |
| | | out_window_top = canvasParent.offset().top; |
| | | out_window_left = canvasParent.offset().left; |
| | | out_window_width = canvasParent.width(); |
| | | }; |
| | | |
| | | initCanvasParam(); |
| | | |
| | | //è²åé¢è²å¸¸é |
| | | var color = null; |
| | | var R = 0; |
| | | var G = 0; |
| | | var B = 0; |
| | | |
| | | //è¡ãåãå±è¦æ¾ç¤ºç¹çéå |
| | | var x_points = []; |
| | | var y_points = []; |
| | | var z_points = []; |
| | | |
| | | //äºä»¶(æ¾ç¤ºæ¹å¼åæ¢ãå¼¹åºç¹çä¿¡æ¯)å¤å®åºå对象çéå |
| | | var arr = []; |
| | | |
| | | //è®¾ç½®å®æ¶å¨ |
| | | var timer; |
| | | var t = -2; |
| | | |
| | | function sleep() { |
| | | if (timer) { |
| | | clearInterval(timer); |
| | | } |
| | | t++; |
| | | if (t >= 0) { |
| | | flash(); |
| | | } |
| | | timer = setTimeout("sleep()", 400); |
| | | } |
| | | |
| | | //宿¶è§¦å彿°--忢æå¼ç¹é¢è² |
| | | function flash() { |
| | | var canvas = document.getElementById('canvas'); |
| | | var ctx = canvas.getContext('2d'); |
| | | canvas.height = canvas.height; |
| | | ctx.strokeStyle = "black"; |
| | | ctx.lineWidth = 1; |
| | | arr = []; |
| | | x_points = []; |
| | | y_points = []; |
| | | z_points = []; |
| | | |
| | | //æ¸
空å¾å½¢ç»å¸ |
| | | canvas.height = canvas.height; |
| | | //éæ°ç»å¶å¾å½¢ç»å¸ |
| | | |
| | | createBack(ctx); |
| | | createLeft(ctx); |
| | | createBottom(ctx, back_height); |
| | | |
| | | gainData(listPoints, curType, curVal); |
| | | |
| | | split(ctx); |
| | | |
| | | entityBlock(ctx, curType, curVal); |
| | | |
| | | title(ctx); |
| | | border(ctx) |
| | | } |
| | | |
| | | //ç»å¶ä¸»ç¨åº |
| | | function draw() { |
| | | var canvas = document.getElementById('canvas'); |
| | | var ctx = canvas.getContext('2d'); |
| | | |
| | | shift = out_window_left; |
| | | if ((out_window_width - canvas.width) > 0) { |
| | | shift = out_window_left + (out_window_width - canvas.width) / 2; |
| | | } |
| | | edge_distance = (canvas.width - (oneWidth / 2 + back_width + 78)) / 2 + 35;//è®¾ç½®è¾¹è· |
| | | |
| | | ctx.strokeStyle = "black"; |
| | | ctx.lineWidth = 1; |
| | | |
| | | createBack(ctx); |
| | | createLeft(ctx); |
| | | createBottom(ctx, back_height); |
| | | gainData(listPoints, curType, curVal); |
| | | split(ctx); |
| | | entityBlock(ctx, curType, curVal); |
| | | |
| | | title(ctx); |
| | | showIndex(canvas, ctx); |
| | | border(ctx); |
| | | |
| | | }; |
| | | |
| | | //ç»å¶ç©å½¢å¤è¾¹æ¡ |
| | | function border(ctx) { |
| | | ctx.beginPath(); |
| | | ctx.lineWidth = 0.5; |
| | | ctx.strokeStyle = 'black'; |
| | | ctx.moveTo(oneWidth / 2 + back_width + edge_distance, 0 * oneHeight); |
| | | ctx.lineTo(back_width + edge_distance, 2 * oneHeight); |
| | | ctx.lineTo(edge_distance, 2 * oneHeight); |
| | | ctx.moveTo(back_width + edge_distance, 2 * oneHeight + 0.5 * back_height); |
| | | ctx.lineTo(back_width + edge_distance, 2 * oneHeight); |
| | | ctx.stroke(); |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | //å¶é èå½± |
| | | function split(context) { |
| | | //设置åååèå½± |
| | | for (i = 0; i <= cols; i++) { |
| | | var start_x = back_width / cols * i + edge_distance; |
| | | var start_y = 2 * oneHeight; |
| | | //设置éæåº¦ |
| | | context.fillStyle = "rgba(255,255,255,0.1)"; |
| | | context.beginPath(); |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x, start_y + 0.5 * back_height); |
| | | context.lineTo(start_x + oneWidth / 2, 0.5 * back_height); |
| | | context.lineTo(start_x + oneWidth / 2, 0); |
| | | context.lineTo(start_x, start_y); |
| | | context.fill(); |
| | | context.closePath(); |
| | | } |
| | | |
| | | //设置è¡ååèå½± |
| | | for (i = 0; i <= rows; i++) { |
| | | |
| | | var start_x = oneWidth / 2 / rows * i + edge_distance; |
| | | var start_y = (2 * oneHeight) / rows * (rows - i); |
| | | //设置éæåº¦ |
| | | context.fillStyle = "rgba(255,255,255,0.1)"; |
| | | // context.fillStyle = "rgba(150,150,150,1)"; |
| | | context.beginPath(); |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x + back_width, start_y); |
| | | context.lineTo(start_x + back_width, start_y + 0.5 * back_height); |
| | | context.lineTo(start_x, start_y + 0.5 * back_height); |
| | | context.lineTo(start_x, start_y); |
| | | context.fill(); |
| | | context.closePath(); |
| | | } |
| | | |
| | | //设置å±ååèå½± |
| | | for (i = 0; i <= lays; i++) { |
| | | var start_x = oneWidth / 2 + edge_distance; |
| | | var y = (lays - i) * 0.5 * back_height / lays; |
| | | //设置éæåº¦ |
| | | context.fillStyle = "rgba(255,255,255,0.2)"; |
| | | context.beginPath(); |
| | | context.moveTo(start_x, y); |
| | | context.lineTo(start_x + back_width, y); |
| | | context.lineTo(back_width + edge_distance, 2 * oneHeight + y); |
| | | context.lineTo(edge_distance, 2 * oneHeight + y); |
| | | context.lineTo(start_x, y); |
| | | context.fill(); |
| | | context.closePath(); |
| | | } |
| | | |
| | | } |
| | | |
| | | function textbox(context, x, y, val, obj) { |
| | | if (val === null || val == -100 || val == -101) { |
| | | //è®¾ç½®ç©ºå¼æ¶å¡«å
é¢è² |
| | | context.fillStyle = "rgba(125,146,159,1)"; |
| | | } else { |
| | | //设置æå¼æ¶å¡«å
é¢è² |
| | | context.fillStyle = "rgba(50,66,81,1)"; |
| | | //å°ç¹å»äºä»¶è§¦ååºå对象åå
¥arréå |
| | | // alert(pointX) |
| | | arr.push({ |
| | | 'x': x + shift - 10, |
| | | 'y': y + out_window_top - 10, |
| | | 'width': 40, |
| | | 'height': 25, |
| | | 'type': 'val', |
| | | 'pointX': obj['x'] + 1, |
| | | 'pointY': obj['y'] + 1, |
| | | 'pointZ': obj['z'] + 1, |
| | | 'val': val, |
| | | }) |
| | | } |
| | | context.beginPath(); |
| | | context.lineWidth = 1; |
| | | context.moveTo(x, y + 12); |
| | | context.lineTo(x + 5, y + 7); |
| | | context.arcTo(x + 15, y + 7, x + 15, y + 2, 5); |
| | | context.lineTo(x + 15, y - 3); |
| | | context.arcTo(x + 15, y - 8, x + 5, y - 8, 5); |
| | | context.lineTo(x - 10, y - 8); |
| | | context.arcTo(x - 15, y - 8, x - 15, y - 3, 5); |
| | | context.lineTo(x - 15, y + 2); |
| | | context.arcTo(x - 15, y + 7, x - 10, y + 7, 5); |
| | | context.lineTo(x - 5, y + 7) |
| | | context.lineTo(x, y + 12) |
| | | context.stroke(); |
| | | context.fill(); |
| | | context.textAlign = 'center'; |
| | | context.fillStyle = "rgba(226,228,229,1)"; |
| | | |
| | | if (val === null || val <= -100) { |
| | | context.fillText("å¤ç¨", x, y + 2); |
| | | } else if (val == -101) { |
| | | context.fillText("æ
é", x, y + 2); |
| | | } else { |
| | | context.fillText(val, x, y + 2); |
| | | } |
| | | context.textAlign = 'left'; |
| | | context.closePath(); |
| | | } |
| | | |
| | | //æ°æ®çé |
| | | function gainData(listPoints, curType, curVal) { |
| | | z_peak = [0, lays - 1]; |
| | | x_peak = [0, cols - 1]; |
| | | y_peak = [0, rows - 1]; |
| | | |
| | | //å½å±æ¾ç¤ºæ¶ï¼æè¦æ¾ç¤ºçç¹æ·»å å°z_points |
| | | if (curType === 'z') { |
| | | for (var i = 0; i < listPoints.length; i++) { |
| | | //设置å
¨æ¾ç¤º |
| | | if (display_mode === "all") { |
| | | if (listPoints[i]['z'] + 1 === curVal) { |
| | | z_points.push(listPoints[i]) |
| | | } |
| | | // 设置å¤é¨æ¾ç¤º |
| | | } else if (display_mode === "outside") { |
| | | if ((listPoints[i]['z'] + 1 === curVal) |
| | | && ((x_peak.includes(listPoints[i]['x'])) || (y_peak |
| | | .includes(listPoints[i]['y'])))) { |
| | | z_points.push(listPoints[i]); |
| | | } |
| | | //设置å
鍿¾ç¤º |
| | | } else { |
| | | if ((listPoints[i]['z'] + 1 === curVal) |
| | | && (!(x_peak.includes(listPoints[i]['x'])) && !(y_peak |
| | | .includes(listPoints[i]['y'])))) { |
| | | z_points.push(listPoints[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //å½åæ¾ç¤ºæ¶ï¼æè¦æ¾ç¤ºçç¹æ·»å å°x_points aaaa |
| | | if (curType === 'x') { |
| | | for (i = 0; i < listPoints.length; i++) { |
| | | //设置å
¨æ¾ç¤º |
| | | if (display_mode === "all") { |
| | | if (listPoints[i]['x'] === (cols - curVal)) { |
| | | x_points.push(listPoints[i]) |
| | | } |
| | | } else if (display_mode === "outside") {// 设置å¤é¨æ¾ç¤º |
| | | if ((listPoints[i]['x'] === (cols - curVal)) |
| | | && ((z_peak.includes(listPoints[i]['z'])) || (y_peak |
| | | .includes(listPoints[i]['y'])))) { |
| | | x_points.push(listPoints[i]); |
| | | } |
| | | |
| | | } else {//设置å
鍿¾ç¤º |
| | | if ((listPoints[i]['x'] === (cols - curVal)) |
| | | && (!(z_peak.includes(listPoints[i]['z'])) && !(y_peak |
| | | .includes(listPoints[i]['y'])))) { |
| | | x_points.push(listPoints[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //å½è¡æ¾ç¤ºæ¶ï¼æè¦æ¾ç¤ºçç¹æ·»å å°y_points |
| | | if (curType === 'y') { |
| | | for (i = 0; i < listPoints.length; i++) { |
| | | |
| | | //设置å
¨æ¾ç¤º |
| | | if (display_mode === "all") { |
| | | if (listPoints[i]['y'] + 1 === curVal) { |
| | | y_points.push(listPoints[i]) |
| | | } |
| | | // 设置å¤é¨æ¾ç¤º |
| | | } else if (display_mode === "outside") { |
| | | if ((listPoints[i]['y'] + 1 === curVal) |
| | | && ((z_peak.includes(listPoints[i]['z'])) || (x_peak |
| | | .includes(listPoints[i]['x'])))) { |
| | | y_points.push(listPoints[i]); |
| | | } |
| | | //设置å
鍿¾ç¤º |
| | | } else { |
| | | if ((listPoints[i]['y'] + 1 === curVal) |
| | | && (!(z_peak.includes(listPoints[i]['z'])) && !(x_peak |
| | | .includes(listPoints[i]['x'])))) { |
| | | y_points.push(listPoints[i]); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //çæè²å |
| | | function entityBlock(context, curType, curVal) { |
| | | |
| | | //å®ä¹è¡å±åé´é |
| | | var y_interval = 2 * oneHeight / rows; |
| | | var x_interval = back_width / cols; |
| | | var z_interval = 0.5 * back_height / lays; |
| | | |
| | | //æ¾ç¤ºæ¹å¼ä¸ºå± |
| | | if (curType === 'z') { |
| | | //çæè¡ |
| | | for (i = 1; i <= rows; i++) { |
| | | var start_x = (oneWidth / 2 / rows) * (i - 1) + edge_distance; |
| | | var start_y = (2 * oneHeight / rows) * (rows - i + 1) + curVal |
| | | * z_interval; |
| | | |
| | | //çæå |
| | | for (j = 1; j <= cols; j++) { |
| | | |
| | | //å¤é¨æ¾ç¤º |
| | | if ((display_mode === "outside") && !y_peak.includes(i - 1) |
| | | && !x_peak.includes(j - 1)) { |
| | | start_x += x_interval; |
| | | continue; |
| | | //å
鍿¾ç¤º |
| | | } else if ((display_mode === "inner") |
| | | && (y_peak.includes(i - 1) || x_peak.includes(j - 1))) { |
| | | start_x += x_interval; |
| | | continue; |
| | | } |
| | | |
| | | //声æè²åæ°å¼ |
| | | var val = null; |
| | | //声æç¹çåºåå¼ |
| | | var index = null; |
| | | |
| | | //循ç¯éåæ¾å°å¯¹åºè²å |
| | | for (k = 0; k < z_points.length; k++) { |
| | | if ((z_points[k]['y'] + 1 === i) |
| | | && (z_points[k]['x'] + 1 === j)) { |
| | | val = z_points[k]['temp'] |
| | | index = k; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //ç»å¶è²å |
| | | context.beginPath(); |
| | | context.lineWidth = 1; |
| | | context.strokeStyle = 'rgba(224,235,242,1)' |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x + x_interval, start_y); |
| | | context.lineTo(start_x + x_interval + (oneWidth / 2 / rows), |
| | | start_y - y_interval); |
| | | context.lineTo(start_x + (oneWidth / 2 / rows), start_y |
| | | - y_interval); |
| | | context.lineTo(start_x, start_y); |
| | | |
| | | //设置对åºé¢è² |
| | | if (val === null || val == -100 || val == -101) { |
| | | context.fillStyle = "rgba(155,171,182,1)"; |
| | | // val = "å¤ç¨"; |
| | | } else { |
| | | if (t % 2 === 1) { |
| | | if (listLays[curVal - 1]['tempMax'] && val == listLays[curVal - 1]['tempMax']) { //æ¤ç¹ä¸ºæé«æ¸© |
| | | context.fillStyle = "rgba(229,29,29,1)"; |
| | | } else if (listLays[curVal - 1]['tempMin'] && val == listLays[curVal - 1]['tempMin']) { //æ¤ç¹ä¸ºæä½æ¸© |
| | | context.fillStyle = "rgba(0,255,28,1)"; |
| | | } else { |
| | | context.fillStyle = getColor(val); |
| | | } |
| | | } else { |
| | | context.fillStyle = getColor(val); |
| | | } |
| | | } |
| | | context.fill(); |
| | | context.stroke(); |
| | | context.closePath(); |
| | | |
| | | //ç»å¶ç¹ææ¬æ¡ |
| | | textbox(context, start_x + 0.5 * x_interval + 0.5 |
| | | * (oneWidth / 2 / rows), start_y - 0.5 * y_interval, |
| | | val, z_points[index]); |
| | | //ä¿®æ¹è²åèµ·å§å¼ |
| | | start_x += x_interval; |
| | | } |
| | | } |
| | | //æ¾ç¤ºæ¹å¼ä¸ºè¡ |
| | | } else if (curType === 'y') { |
| | | //çæå± |
| | | for (var i = 1; i <= lays; i++) { |
| | | var start_x = (oneWidth / 2 / rows) * (curVal - 1) + edge_distance; |
| | | var start_y = (2 * oneHeight / rows) * (rows - curVal + 1) + i |
| | | * z_interval; |
| | | |
| | | //çæå |
| | | for (var j = 1; j <= cols; j++) { |
| | | |
| | | //å¤é¨æ¾ç¤º |
| | | if ((display_mode === "outside") && !z_peak.includes(i - 1) |
| | | && !x_peak.includes(j - 1)) { |
| | | start_x += x_interval; |
| | | continue; |
| | | //å
鍿¾ç¤º |
| | | } else if ((display_mode === "inner") |
| | | && (z_peak.includes(i - 1) || x_peak.includes(j - 1))) { |
| | | start_x += x_interval; |
| | | continue; |
| | | } |
| | | |
| | | //声æè²åæ°å¼ |
| | | var val = null; |
| | | //声æç¹çåºåå¼ |
| | | var index = null; |
| | | |
| | | //循ç¯éåæ¾å°å¯¹åºè²å |
| | | for (k = 0; k < y_points.length; k++) { |
| | | if ((y_points[k]['z'] + 1 === i) |
| | | && (y_points[k]['x'] + 1 === j)) { |
| | | val = y_points[k]['temp'] |
| | | index = k; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | ////ç»å¶ä¸ä¸ªè²å,æ¾ç¤ºæ¹å¼ä¸ºæ£è§å¾ |
| | | context.fillStyle = "rgba(155,171,182,1)"; |
| | | context.beginPath(); |
| | | context.lineWidth = 1.5; |
| | | context.strokeStyle = 'rgba(224,235,242,1)' |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x + x_interval, start_y); |
| | | context.lineTo(start_x + x_interval, start_y - z_interval); |
| | | context.lineTo(start_x, start_y - z_interval); |
| | | context.lineTo(start_x, start_y); |
| | | |
| | | //设置对åºé¢è² |
| | | if (val === null || val == -100) { |
| | | context.fillStyle = "rgba(155,171,182,1)"; |
| | | } else { |
| | | if (t % 2 === 1) { |
| | | if (val == listRows[curVal - 1]['tempMax']) { //æ¤ç¹ä¸ºæé«æ¸© |
| | | context.fillStyle = "rgba(229,29,29,1)"; |
| | | } else if (val == listRows[curVal - 1]['tempMin']) { //æ¤ç¹ä¸ºæä½æ¸© |
| | | context.fillStyle = "rgba(0,255,28,1)"; |
| | | } else { |
| | | context.fillStyle = getColor(val); |
| | | } |
| | | } else { |
| | | context.fillStyle = getColor(val); |
| | | |
| | | } |
| | | } |
| | | |
| | | context.fill(); |
| | | context.stroke(); |
| | | context.closePath(); |
| | | |
| | | //ç»å¶ç¹ææ¬æ¡ |
| | | textbox(context, start_x + 0.4 * x_interval, start_y - 0.5 |
| | | * z_interval, val, y_points[index]); |
| | | |
| | | //ä¿®æ¹è²åèµ·å§å¼ |
| | | start_x += x_interval; |
| | | } |
| | | } |
| | | |
| | | //æ¾ç¤ºæ¹å¼ä¸ºå |
| | | } else if (curType === 'x') { |
| | | |
| | | //çæä¸å± |
| | | for (var i = lays; i > 0; i--) { |
| | | var start_x = (cols - curVal) * x_interval + edge_distance; |
| | | var start_y = (2 * oneHeight / rows) * (rows) + i * z_interval; |
| | | |
| | | //çæä¸è¡ |
| | | for (var j = 1; j <= rows; j++) { |
| | | |
| | | //å¤é¨æ¾ç¤º |
| | | if ((display_mode === "outside") && !z_peak.includes(i - 1) |
| | | && !y_peak.includes(j - 1)) { |
| | | start_x += (oneWidth / 2 / rows); |
| | | start_y -= (2 * oneHeight / rows); |
| | | continue; |
| | | //å
鍿¾ç¤º |
| | | } else if ((display_mode === "inner") |
| | | && (z_peak.includes(i - 1) || y_peak.includes(j - 1))) { |
| | | start_x += (oneWidth / 2 / rows); |
| | | start_y -= (2 * oneHeight / rows); |
| | | continue; |
| | | } |
| | | |
| | | //声æè²åæ°å¼ |
| | | var val = null; |
| | | //声æç¹çåºåå¼ |
| | | var index = null; |
| | | |
| | | //循ç¯éåæ¾å°å¯¹åºè²å |
| | | for (var k = 0; k < x_points.length; k++) { |
| | | if ((x_points[k]['y'] + 1 === j) |
| | | && (x_points[k]['z'] === (i - 1))) { |
| | | val = x_points[k]['temp']; |
| | | index = k; |
| | | break; |
| | | } |
| | | } |
| | | ; |
| | | |
| | | //ç»å¶ä¸ä¸ªè²å,æ¾ç¤ºæ¹å¼ä¸ºä¾§è§å¾ |
| | | context.fillStyle = "rgba(155,171,182,1)"; |
| | | context.beginPath(); |
| | | context.lineWidth = 1.5; |
| | | context.strokeStyle = 'rgba(224,235,242,1)' |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x + (oneWidth / 2 / rows), start_y |
| | | - y_interval); |
| | | context.lineTo(start_x + (oneWidth / 2 / rows), start_y |
| | | - y_interval - z_interval); |
| | | context.lineTo(start_x, start_y - z_interval); |
| | | context.lineTo(start_x, start_y); |
| | | |
| | | //设置对åºé¢è² |
| | | if (val === null || val == -100) { |
| | | context.fillStyle = "rgba(155,171,182,1)"; |
| | | } else { |
| | | context.fillStyle = getColor(val); |
| | | } |
| | | |
| | | context.fill(); |
| | | context.stroke(); |
| | | context.closePath(); |
| | | |
| | | //ç»å¶ç¹ææ¬æ¡ |
| | | textbox(context, start_x + 0.5 * (oneWidth / 2 / rows), start_y |
| | | - 0.5 * y_interval - 0.5 * z_interval, val, |
| | | x_points[index]); |
| | | |
| | | //ä¿®æ¹è²åèµ·å§å¼ |
| | | start_x += (oneWidth / 2 / rows); |
| | | start_y -= (2 * oneHeight / rows); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //ç»å®è§¦åçäºä»¶ |
| | | function draws(x, y, canvas, ctx) { |
| | | //å建ç¹å»äºä»¶çç»å¸ï¼ç»å¸2ï¼éè¦èèç¶æ¡çä½ç½® |
| | | ctx.rect(0, 0, canvas.width, canvas.height); |
| | | //ç»arréåä¸çæ¯ä¸ä¸ªå¯¹è±¡æ·»å ç¹å»äºä»¶ |
| | | arr.forEach(function (v, i) { |
| | | ctx.beginPath(); |
| | | //ç»å¶æ¯ä¸ä¸ªå¯¹è±¡çåºå |
| | | ctx.rect(v.x, v.y, v.width, v.height); |
| | | ctx.closePath(); |
| | | |
| | | //夿ç¹å»ç¹æ¯å¦å¨åºåä¸ |
| | | if (ctx.isPointInPath(x, y)) { |
| | | //夿ç¹å»åºåç±»å |
| | | if (v.type === 'val') { |
| | | //ç±»å为valï¼åå¼¹åºç¹ä¿¡æ¯ |
| | | // showData = "x=" + v.pointX + "\ny=" + v.pointY + "\nz=" + v.pointZ; |
| | | // alert(showData) |
| | | layer.msg("å±=" + (v.pointZ) + "\nè¡=" + (v.pointY) + "\nå=" + (cols - v.pointX + 1) + "\n温度=" |
| | | + v.val); |
| | | } else { //å
¶ä»ç±»åå忢æ¾ç¤ºè²å |
| | | //æ¸
ç©ºæ°æ® |
| | | curType = v['type']; |
| | | curVal = v['num']; |
| | | if (curType === 'x') { |
| | | curVal = cols - v['num'] + 1; |
| | | } |
| | | arr = []; |
| | | x_points = []; |
| | | y_points = []; |
| | | z_points = []; |
| | | |
| | | //æ¸
空å¾å½¢ç»å¸ |
| | | canvas.height = canvas.height; |
| | | //éæ°ç»å¶ |
| | | createBack(ctx); |
| | | createLeft(ctx); |
| | | createBottom(ctx, back_height); |
| | | gainData(listPoints, curType, curVal); |
| | | split(ctx); |
| | | entityBlock(ctx, curType, curVal); |
| | | title(ctx); |
| | | border(ctx); |
| | | |
| | | //æ´æ¹Btnåç§°ï¼åæ¶æ´æ°å±è¡åçéæ© |
| | | updateGrainBtn(true); |
| | | |
| | | //åæ¢ä¸ºå±æ¾ç¤º |
| | | if (v['type'] === 'z') { |
| | | //èµ·å§ç¹ |
| | | start_x = v['start_x']; |
| | | start_y = v['start_y']; |
| | | |
| | | //设计ç¹å»æ¶çæ¸å |
| | | var grad = ctx.createLinearGradient(start_x, start_y, |
| | | start_x + 120, start_y); |
| | | grad.addColorStop(0, "#2f2fff"); |
| | | grad.addColorStop(0.3, "#5858ff"); |
| | | grad.addColorStop(0.7, "#b3b3ff"); |
| | | grad.addColorStop(1, "#ffffff"); |
| | | ctx.fillStyle = grad; |
| | | |
| | | //å¼å§ç»å¶ |
| | | ctx.beginPath(); |
| | | ctx.lineWidth = 5; |
| | | ctx.strokeStyle = 'rgba(214,223,232,1)'; |
| | | ctx.moveTo(start_x, start_y); |
| | | ctx.lineTo(start_x + 75, start_y); |
| | | ctx.lineTo(start_x + 75, start_y - 0.5 |
| | | * (back_height / lays)); |
| | | ctx.lineTo(start_x, start_y - 0.5 * (back_height / lays)); |
| | | |
| | | ctx.lineTo(start_x, start_y); |
| | | ctx.stroke(); |
| | | ctx.fill(); |
| | | |
| | | //æ 颿 ææ¬ |
| | | ctx.fillStyle = 'rgba(255,14,0,1)'; |
| | | val = "第" + v['num'] + "å±"; |
| | | ctx.font = "15px Arial"; |
| | | ctx.fillText(val, start_x + 10, start_y + 5 - 0.5 |
| | | * (back_height / lays) / 2); |
| | | |
| | | //åæ¢ä¸ºè¡æ¾ç¤º |
| | | } else if (v['type'] === 'y') { |
| | | //èµ·å§ç¹ |
| | | start_x = v['start_x']; |
| | | start_y = v['start_y']; |
| | | |
| | | //设计ç¹å»æ¶çæ¸å |
| | | var grad = ctx.createLinearGradient(start_x, start_y, |
| | | start_x + 120, start_y); |
| | | grad.addColorStop(0, "#2f2fff"); |
| | | grad.addColorStop(0.3, "#5858ff"); |
| | | grad.addColorStop(0.7, "#b3b3ff"); |
| | | grad.addColorStop(1, "#ffffff"); |
| | | ctx.fillStyle = grad; |
| | | |
| | | //å¼å§ç»å¶ |
| | | ctx.beginPath(); |
| | | ctx.lineWidth = 5; |
| | | ctx.strokeStyle = 'rgba(214,223,232,1)'; |
| | | ctx.moveTo(start_x, start_y); |
| | | ctx.lineTo(start_x + 75, start_y); |
| | | ctx.lineTo(start_x + 75 + (oneWidth / 2 / rows), start_y |
| | | - (2 * oneHeight / rows)); |
| | | ctx.lineTo(start_x + (oneWidth / 2 / rows), start_y |
| | | - (2 * oneHeight / rows)); |
| | | ctx.lineTo(start_x, start_y); |
| | | ctx.stroke(); |
| | | ctx.fill(); |
| | | |
| | | //æ 颿 ææ¬ |
| | | ctx.fillStyle = 'rgba(255,14,0,1)'; |
| | | val = "第" + v['num'] + "è¡"; |
| | | |
| | | if (rows > 10) { |
| | | ctx.font = "12px Arial"; |
| | | ctx.fillText(val, start_x + 25, start_y - 5); |
| | | } else { |
| | | ctx.font = "15px Arial"; |
| | | ctx.fillText(val, start_x + 25, start_y - 9); |
| | | } |
| | | |
| | | //åæ¢ä¸ºåæ¾ç¤º |
| | | } else if (v['type'] === 'x') { |
| | | //èµ·å§ç¹ |
| | | start_x = v['start_x']; |
| | | start_y = v['start_y']; |
| | | |
| | | //设计ç¹å»æ¶çæ¸å |
| | | var grad = ctx.createLinearGradient(start_x, start_y, |
| | | start_x + 120, start_y); |
| | | grad.addColorStop(0, "#2f2fff"); |
| | | grad.addColorStop(0.3, "#5858ff"); |
| | | grad.addColorStop(0.7, "#b3b3ff"); |
| | | grad.addColorStop(1, "#ffffff"); |
| | | ctx.fillStyle = grad; |
| | | |
| | | //å¼å§ç»å¶ |
| | | ctx.beginPath(); |
| | | ctx.lineWidth = 5; |
| | | ctx.strokeStyle = 'rgba(214,223,232,1)'; |
| | | ctx.moveTo(start_x, start_y); |
| | | ctx.lineTo(start_x - (oneWidth / 2 / rows), start_y |
| | | + (2 * oneHeight / rows)); |
| | | ctx.lineTo(start_x + (back_width / cols) |
| | | - (oneWidth / 2 / rows), start_y |
| | | + (2 * oneHeight / rows)); |
| | | ctx.lineTo(start_x + (back_width / cols), start_y); |
| | | ctx.lineTo(start_x, start_y); |
| | | ctx.stroke(); |
| | | ctx.fill(); |
| | | |
| | | //æ 颿 ææ¬ |
| | | ctx.fillStyle = 'rgba(255,14,0,1)'; |
| | | val = "第" + (cols - v['num'] + 1) + "å"; |
| | | ctx.font = "15px Arial"; |
| | | ctx.fillText(val, start_x - 0.5 * (oneWidth / 2 / rows), |
| | | start_y + 0.7 * (2 * oneHeight / rows)); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //ç»å®äºä»¶ |
| | | function showIndex(canvas, ctx) { |
| | | |
| | | //æ´ä¸ªç»å¸å¯¹è±¡æ·»å ç¹å»äºä»¶ |
| | | canvas.addEventListener('click', function location(e) { |
| | | x = e.clientX; |
| | | y = e.clientY; |
| | | draws(x, y, canvas, ctx); |
| | | }, false); |
| | | } |
| | | |
| | | //è¡ãåã屿 颿 |
| | | function title(context) { |
| | | |
| | | //屿 颿 |
| | | for (i = 1; i <= lays; i++) { |
| | | //设置起å§ç¹ |
| | | start_x = (oneWidth / 2) + back_width + edge_distance + 3; |
| | | start_y = 0.5 * (back_height / lays) * i; |
| | | |
| | | //è®¾ç½®ä¸ºéæ©æ¶çæ¸åå¡«å
|
| | | if ((curType === "z") && (curVal === i)) { |
| | | var grad = context.createLinearGradient(start_x, start_y, |
| | | start_x + 120, start_y); |
| | | grad.addColorStop(0, "#2f2fff"); |
| | | grad.addColorStop(0.3, "#5858ff"); |
| | | grad.addColorStop(0.7, "#b3b3ff"); |
| | | grad.addColorStop(1, "#ffffff"); |
| | | //设置为æªéæ©æ¶çæ¸åå¡«å
|
| | | } else { |
| | | var grad = context.createLinearGradient(start_x, start_y, |
| | | start_x + 200, start_y); |
| | | grad.addColorStop(0, "#ffffff"); |
| | | grad.addColorStop(0.8, "#a2baef"); |
| | | } |
| | | context.fillStyle = grad; |
| | | |
| | | //ç»å¶ |
| | | context.beginPath(); |
| | | context.lineWidth = 5; |
| | | context.strokeStyle = 'rgba(214,223,232,1)'; |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x + 75, start_y); |
| | | context.lineTo(start_x + 75, start_y - 0.5 * (back_height / lays)); |
| | | context.lineTo(start_x, start_y - 0.5 * (back_height / lays)); |
| | | context.lineTo(start_x, start_y); |
| | | context.stroke(); |
| | | context.fill(); |
| | | |
| | | //è®¾ç½®ä¸ºéæ©æ¶çåä½å¡«å
|
| | | if ((curType === "z") && (curVal === i)) { |
| | | context.fillStyle = 'rgba(255,14,0,1)'; |
| | | //设置为æªéæ©æ¶çåä½å¡«å
|
| | | } else { |
| | | context.fillStyle = 'rgba(30,30,30,1)'; |
| | | } |
| | | |
| | | //设置æ é¢ææ¬ |
| | | val = "第" + i + "å±"; |
| | | context.font = "15px Arial"; |
| | | context.fillText(val, start_x + 10, start_y + 5 - 0.5 |
| | | * (back_height / lays) / 2); |
| | | |
| | | //å°æ¾ç¤ºæ¹å¼åæ¢äºä»¶å å
¥arræ°ç» |
| | | arr.push({ |
| | | 'x': start_x + 10 + shift, |
| | | 'y': start_y - 0.5 * (back_height / lays) / 2 - 22 |
| | | + out_window_top, |
| | | 'width': 60, |
| | | 'height': 40, |
| | | 'type': 'z', |
| | | 'num': i, |
| | | 'start_x': start_x, |
| | | 'start_y': start_y |
| | | }) |
| | | context.closePath(); |
| | | } |
| | | |
| | | //è¡æ 颿 |
| | | for (i = 1; i <= rows; i++) { |
| | | //设置起å§ç¹ |
| | | start_x = back_width + (oneWidth / 2 / rows) * (i - 1) + edge_distance; |
| | | start_y = (2 * oneHeight + 0.5 * back_height) - (2 * oneHeight / rows) |
| | | * (i - 1) + 5; |
| | | |
| | | //è®¾ç½®ä¸ºéæ©æ¶çæ¸åå¡«å
|
| | | if ((curType === "y") && (curVal === i)) { |
| | | var grad = context.createLinearGradient(start_x, start_y, |
| | | start_x + 120, start_y); |
| | | grad.addColorStop(0, "#2f2fff"); |
| | | grad.addColorStop(0.3, "#5858ff"); |
| | | grad.addColorStop(0.7, "#b3b3ff"); |
| | | grad.addColorStop(1, "#ffffff"); |
| | | //设置为æªéæ©æ¶çæ¸åå¡«å
|
| | | } else { |
| | | var grad = context.createLinearGradient(start_x, start_y, |
| | | start_x + 200, start_y); |
| | | grad.addColorStop(0, "#ffffff"); |
| | | grad.addColorStop(0.8, "#a2baef"); |
| | | } |
| | | context.fillStyle = grad; |
| | | |
| | | //ç»å¶ |
| | | context.beginPath(); |
| | | context.lineWidth = 5; |
| | | context.strokeStyle = 'rgba(215,224,230,1)'; |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x + 75, start_y); |
| | | context.lineTo(start_x + 75 + (oneWidth / 2 / rows), start_y |
| | | - (2 * oneHeight / rows)); |
| | | context.lineTo(start_x + (oneWidth / 2 / rows), start_y |
| | | - (2 * oneHeight / rows)); |
| | | context.lineTo(start_x, start_y); |
| | | context.stroke(); |
| | | context.fill(); |
| | | |
| | | //è®¾ç½®ä¸ºéæ©æ¶çåä½å¡«å
|
| | | if ((curType === "y") && (curVal === i)) { |
| | | context.fillStyle = 'rgba(255,14,0,1)'; |
| | | //设置为æªéæ©æ¶çåä½å¡«å
|
| | | } else { |
| | | context.fillStyle = 'rgba(30,30,30,1)'; |
| | | } |
| | | |
| | | //设置æ é¢ææ¬ |
| | | val = "第" + i + "è¡"; |
| | | if (rows > 10) { |
| | | context.font = "12px Arial"; |
| | | context.fillText(val, start_x + 25, start_y - 5); |
| | | } else { |
| | | context.font = "15px Arial"; |
| | | context.fillText(val, start_x + 25, start_y - 9); |
| | | } |
| | | |
| | | //å°æ¾ç¤ºæ¹å¼åæ¢äºä»¶å å
¥arræ°ç» |
| | | arr.push({ |
| | | 'x': start_x + blockWidth + shift, |
| | | 'y': start_y - blockHeight + out_window_top, |
| | | 'width': 50, |
| | | 'height': 20, |
| | | 'type': 'y', |
| | | 'num': i, |
| | | 'start_x': start_x, |
| | | 'start_y': start_y |
| | | }) |
| | | context.closePath(); |
| | | } |
| | | |
| | | //åæ é¢æ |
| | | for (i = 1; i <= cols; i++) { |
| | | //设置起å§ç¹ |
| | | start_x = (back_width / cols) * (i - 1) + edge_distance; |
| | | start_y = (2 * oneHeight + 0.5 * back_height) + 5; |
| | | |
| | | //è®¾ç½®ä¸ºéæ©æ¶çæ¸åå¡«å
|
| | | if ((curType === "x") && (curVal === (cols - i + 1))) { |
| | | var grad = context.createLinearGradient(start_x, start_y, |
| | | start_x + 120, start_y); |
| | | grad.addColorStop(0, "#2f2fff"); |
| | | grad.addColorStop(0.3, "#5858ff"); |
| | | grad.addColorStop(0.7, "#b3b3ff"); |
| | | grad.addColorStop(1, "#ffffff"); |
| | | context.strokeStyle = 'rgba(100,100,255,1)'; |
| | | //设置为æªéæ©æ¶çæ¸åå¡«å
|
| | | } else { |
| | | context.strokeStyle = 'rgba(215,224,230,1)'; |
| | | var grad = context.createLinearGradient(start_x, start_y, |
| | | start_x + 120, start_y); |
| | | grad.addColorStop(0, "#ffffff"); |
| | | grad.addColorStop(0.8, "#a2baef"); |
| | | } |
| | | context.fillStyle = grad; |
| | | |
| | | //ç»å¶ |
| | | context.beginPath(); |
| | | context.lineWidth = 5; |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x - (oneWidth / 2 / rows), start_y |
| | | + (2 * oneHeight / rows)); |
| | | context.lineTo(start_x + (back_width / cols) - (oneWidth / 2 / rows), |
| | | start_y + (2 * oneHeight / rows)); |
| | | context.lineTo(start_x + (back_width / cols), start_y); |
| | | context.lineTo(start_x, start_y); |
| | | context.stroke(); |
| | | context.fill(); |
| | | |
| | | //è®¾ç½®ä¸ºéæ©æ¶çåä½å¡«å
|
| | | if ((curType === "x") && (curVal === (cols - i + 1))) { |
| | | context.fillStyle = 'rgba(255,14,0,1)'; |
| | | //设置为æªéæ©æ¶çåä½å¡«å
|
| | | } else { |
| | | context.fillStyle = 'rgba(30,30,30,1)'; |
| | | } |
| | | val = "第" + (cols - i + 1) + "å"; |
| | | context.font = "15px Arial"; |
| | | context.fillText(val, start_x - 0.5 * (oneWidth / 2 / rows), start_y |
| | | + 0.7 * (2 * oneHeight / rows)); |
| | | //å°æ¾ç¤ºæ¹å¼åæ¢äºä»¶å å
¥arræ°ç» |
| | | arr.push({ |
| | | 'x': start_x - 0.3 * (oneWidth / 2 / rows) + shift, |
| | | 'y': start_y + 0.5 * (2 * oneHeight / rows) + out_window_top, |
| | | 'width': 55, |
| | | 'height': 25, |
| | | 'type': 'x', |
| | | 'num': i, |
| | | 'start_x': start_x, |
| | | 'start_y': start_y |
| | | }) |
| | | context.closePath(); |
| | | } |
| | | |
| | | } |
| | | |
| | | //å¶é åºç©å½¢ |
| | | function createBottom(context, y) { |
| | | //设置填å
æ ·å¼ |
| | | var gra = context.createRadialGradient(oneWidth, oneHeight, 0, |
| | | oneWidth / 2, oneHeight / 2, width * 100); |
| | | gra.addColorStop(0, "#c9dde8"); |
| | | // gra.addColorStop(0.8, "white"); |
| | | gra.addColorStop(1, "#c0deea"); |
| | | var start_x = oneWidth / 2 + edge_distance; |
| | | |
| | | //ç»å¶ç©å½¢ |
| | | context.fillStyle = "rgba(168,208,225,1)"; |
| | | context.fillStyle = gra; |
| | | context.beginPath(); |
| | | context.moveTo(start_x, 0.5 * back_height); |
| | | context.lineTo(edge_distance, 2 * oneHeight + 0.5 * back_height); |
| | | context.lineTo(edge_distance + back_width, 2 * oneHeight + 0.5 |
| | | * back_height); |
| | | context.lineTo(start_x + back_width, 0.5 * back_height); |
| | | context.lineWidth = 1.5; |
| | | context.fill(); |
| | | context.stroke(); |
| | | context.closePath(); |
| | | } |
| | | |
| | | //å¶é èç©å½¢ |
| | | function createBack(context) { |
| | | |
| | | //设置填å
æ ·å¼ |
| | | var gra = context.createRadialGradient(oneWidth, oneHeight, 0, |
| | | oneWidth / 2, oneHeight / 2, width * 100); |
| | | gra.addColorStop(0, "#a8d0e1"); |
| | | gra.addColorStop(1, "white"); |
| | | |
| | | //ç»å¶ |
| | | var start_x = oneWidth / 2 + edge_distance |
| | | var start_y = 0 |
| | | context.fillStyle = "rgba(168,208,225,1)"; |
| | | context.fillStyle = gra; |
| | | context.beginPath(); |
| | | context.moveTo(start_x, start_y); |
| | | |
| | | context.lineTo(start_x + back_width, start_y); |
| | | context.lineTo(start_x + back_width, 0.5 * back_height); |
| | | |
| | | context.lineTo(start_x, 0.5 * back_height); |
| | | context.lineTo(start_x, start_y); |
| | | context.lineWidth = 1.5; |
| | | context.fill(); |
| | | context.stroke(); |
| | | context.closePath(); |
| | | } |
| | | |
| | | //å¶é å·¦ç©å½¢ |
| | | function createLeft(context) { |
| | | //ç»å¶ |
| | | var start_x = edge_distance; |
| | | var start_y = 2 * oneHeight; |
| | | context.fillStyle = "rgba(168,208,225,1)"; |
| | | context.beginPath(); |
| | | context.moveTo(start_x, start_y); |
| | | context.lineTo(start_x, start_y + 0.5 * back_height); |
| | | context.lineTo(oneWidth / 2 + start_x, 0.5 * back_height); |
| | | context.lineTo(oneWidth / 2 + start_x, 0); |
| | | context.lineTo(start_x, start_y); |
| | | context.lineWidth = 1.5; |
| | | context.stroke(); |
| | | context.fill(); |
| | | context.closePath(); |
| | | } |
| | | |
| | | //è·åçºµæ¨ªæ¯ |
| | | function getRatio() { |
| | | var tmp = 1.3; |
| | | if (Screen.height > 1050) { |
| | | tmp = 1.05 |
| | | if (rows <= 5) |
| | | tmp = 1.3 |
| | | else if ((rows >= 6) && (rows <= 7)) |
| | | tmp = 1.2 |
| | | else if ((rows >= 8) && (rows <= 9)) |
| | | tmp = 1.1 |
| | | } else if ((Screen.height <= 1050) && (Screen.height > 960)) { |
| | | tmp = 1; |
| | | if (rows <= 5) |
| | | tmp = 1.3 |
| | | else if ((rows >= 6) && (rows <= 7)) |
| | | tmp = 1.2 |
| | | else if ((rows >= 8) && (rows <= 9)) |
| | | tmp = 1.1 |
| | | } else if ((Screen.height <= 960) && (Screen.height > 900)) { |
| | | tmp = 0.9; |
| | | if (rows <= 7) |
| | | tmp = 1.2 |
| | | else if (rows === 8) |
| | | tmp = 1.1 |
| | | else if (rows === 9) |
| | | tmp = 1 |
| | | } else if ((Screen.height <= 900) && (Screen.height > 800)) { |
| | | tmp = 0.8; |
| | | if (rows <= 6) |
| | | tmp = 1.2 |
| | | else if (rows === 7) |
| | | tmp = 1.1 |
| | | else if (rows === 8) |
| | | tmp = 1 |
| | | else if (rows === 9) |
| | | tmp = 0.9 |
| | | } else if ((Screen.height <= 800) && (Screen.height > 768)) { |
| | | tmp = 0.75; |
| | | if (rows <= 6) |
| | | tmp = 1.2 |
| | | else if (rows === 7) |
| | | tmp = 1 |
| | | else if (rows === 8) |
| | | tmp = 0.9 |
| | | else if (rows === 9) |
| | | tmp = 0.8 |
| | | } else if ((Screen.height <= 768) && (Screen.height > 720)) { |
| | | tmp = 0.75; |
| | | if (rows <= 6) |
| | | tmp = 1.1 |
| | | else if (rows === 7) |
| | | tmp = 1 |
| | | else if (rows === 8) |
| | | tmp = 0.9 |
| | | else if (rows === 9) |
| | | tmp = 0.8 |
| | | back_height = oneHeight * 2.1 * (2 - rows / 10) * 0.7 |
| | | } else if (Screen.height <= 720) { |
| | | tmp = 0.66; |
| | | if (rows <= 6) |
| | | tmp = 1 |
| | | else if (rows === 7) |
| | | tmp = 0.9 |
| | | else if (rows === 8) |
| | | tmp = 0.8 |
| | | else if (rows === 9) |
| | | tmp = 0.7 |
| | | } |
| | | |
| | | return tmp; |
| | | } |
| | | |
| | | //æ ¹æ®æ¸©åº¦è·åRGB |
| | | function getColor(val) { |
| | | if (val >= 50) { |
| | | color = "rgba(255,0,0,1)"; |
| | | return color; |
| | | } else if (val >= 20) { |
| | | G = Math.round(255 - 255 * ((val - 20) / 30)); |
| | | color = "rgba(255," + G + ",0,1)"; |
| | | return color; |
| | | } else if (val >= 0) { |
| | | R = Math.round(100 + (155 / 20) * val); |
| | | B = Math.round(30 - 1.5 * val); |
| | | color = "rgba(" + R + ",255," + B + ",1)"; |
| | | return color; |
| | | } else if (val >= -10) { |
| | | R = Math.round(100 - 6.6 * (val * (-1))); |
| | | G = Math.round(255 - 2.2 * (val * (-1))); |
| | | B = Math.round(30 + 1.2 * (val * (-1))); |
| | | color = "rgba(" + R + "," + G + "," + B + ",1)"; |
| | | return color; |
| | | } else { |
| | | color = "rgba(34,233,42,1)"; |
| | | return color; |
| | | } |
| | | } |
| | | |
| | | //ä¸ä¸ä¸ªç¹å»äºä»¶ |
| | | function next() { |
| | | if (curType === "x") { |
| | | if (curVal === Number(cols)) { |
| | | curVal = 1; |
| | | } else { |
| | | curVal += 1; |
| | | } |
| | | } else if (curType === "y") { |
| | | if (curVal === Number(rows)) { |
| | | curVal = 1; |
| | | } else { |
| | | curVal += 1; |
| | | } |
| | | } else { |
| | | if (curVal === Number(lays)) { |
| | | curVal = 1; |
| | | } else { |
| | | curVal += 1; |
| | | } |
| | | } |
| | | flash(); |
| | | updateTemp(); |
| | | } |
| | | |
| | | //ä¸ä¸ä¸ªç¹å»äºä»¶ |
| | | function last() { |
| | | if (curType === "x") { |
| | | if (curVal === 1) { |
| | | curVal = Number(cols); |
| | | } else { |
| | | curVal -= 1; |
| | | } |
| | | } else if (curType === "y") { |
| | | if (curVal === 1) { |
| | | curVal = Number(rows); |
| | | } else { |
| | | curVal -= 1; |
| | | } |
| | | } else { |
| | | if (curVal === 1) { |
| | | curVal = Number(lays); |
| | | } else { |
| | | curVal -= 1; |
| | | } |
| | | } |
| | | flash(); |
| | | updateTemp(); |
| | | } |
| | | |
| | | //屿¾ç¤ºç¹å»äºä»¶ |
| | | function lay() { |
| | | curType = "z";//æ¾ç¤ºç±»å |
| | | curVal = 1; |
| | | flash(); |
| | | updateGrainBtn(false); |
| | | |
| | | }; |
| | | |
| | | //åæ¾ç¤ºç¹å»äºä»¶ |
| | | function col() { |
| | | curType = "x";//æ¾ç¤ºç±»å |
| | | curVal = 1; |
| | | flash(); |
| | | updateGrainBtn(false); |
| | | }; |
| | | |
| | | //è¡æ¾ç¤ºç¹å»äºä»¶ |
| | | function row() { |
| | | curType = "y";//æ¾ç¤ºç±»å |
| | | curVal = 1; |
| | | flash(); |
| | | updateGrainBtn(false); |
| | | }; |
| | | |
| | | //å
¨é¨æ¾ç¤ºç¹å»äºä»¶ |
| | | function display_all() { |
| | | display_mode = "all"; |
| | | flash(); |
| | | } |
| | | |
| | | //å¤é¨æ¾ç¤ºç¹å»äºä»¶ |
| | | function display_outside() { |
| | | display_mode = "outside"; |
| | | flash(); |
| | | } |
| | | |
| | | //å
鍿¾ç¤ºç¹å»äºä»¶ |
| | | function display_inside() { |
| | | display_mode = "inner"; |
| | | flash(); |
| | | } |
| | | |
| | | // åå§åä¸ç»´ç²®æ
|
| | | function initGrainChar3d() { |
| | | draw(); |
| | | }; |
| | | |
| | | function clearGrainChart3d() { |
| | | listPoints = []; |
| | | listLays = []; |
| | | listRows = []; |
| | | lays = 4; |
| | | rows = 5; |
| | | cols = 8; |
| | | curType = "z"; |
| | | curVal = 1; |
| | | initCanvasParam(); |
| | | draw(); |
| | | }; |
| | | |
| | | //éæ°æ¸²æ |
| | | function resetGrainChart3d() { |
| | | listPoints = grainData.listPoints; |
| | | listLays = grainData.listLays; |
| | | listRows = grainData.listRows; |
| | | var attr = grainData.cable.split("-"); |
| | | lays = attr[0]; |
| | | rows = attr[1]; |
| | | cols = attr[2]; |
| | | |
| | | initCanvasParam(); |
| | | |
| | | draw(); |
| | | sleep();//å¼å§éªç |
| | | curType = "z"; |
| | | curVal = 1; |
| | | |
| | | updateTemp(); |
| | | } |
| | | |
| | | //æ´æ°Btnåç§° |
| | | function updateGrainBtn(isUpdateSelect) { |
| | | var btnNext = $("#btn_next"); |
| | | var btnPre = $("#btn_pre"); |
| | | if ("z" === curType) { |
| | | btnNext.text("ä¸ä¸å±"); |
| | | btnPre.text("ä¸ä¸å±"); |
| | | } |
| | | if ("y" === curType) {// è¡æ¥ç |
| | | btnNext.text("ä¸ä¸è¡"); |
| | | btnPre.text("ä¸ä¸è¡"); |
| | | } |
| | | if ("x" === curType) {// 忥ç |
| | | btnNext.text("ä¸ä¸å"); |
| | | btnPre.text("ä¸ä¸å"); |
| | | } |
| | | |
| | | //éæ¹æ¸©åº¦ |
| | | updateTemp(); |
| | | |
| | | }; |
| | | |
| | | function updateTemp() { |
| | | //æ´æ°å±æ¸©ï¼è¡æ¸©åº¦ä¿¡æ¯ |
| | | if ("z" === curType) { |
| | | $.each(listLays, function (index, item) { |
| | | if (item.z === (curVal - 1)) { |
| | | // æ´æ°å±ä¿¡æ¯ |
| | | $("#dynamicAve").text(item.tempAve); |
| | | $("#dynamicMax").text(item.tempMax); |
| | | $("#dynamicMin").text(item.tempMin); |
| | | $("#dynamicAveName").text("å±å温"); |
| | | $("#dynamicMaxName").text("å±é«æ¸©"); |
| | | $("#dynamicMinName").text("å±ä½æ¸©"); |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | if ("y" === curType) { |
| | | $.each(listRows, function (index, item) { |
| | | if (item.y === (curVal - 1)) { |
| | | $("#dynamicAve").text(item.tempAve); |
| | | $("#dynamicMax").text(item.tempMax); |
| | | $("#dynamicMin").text(item.tempMin); |
| | | $("#dynamicAveName").text("è¡å温"); |
| | | $("#dynamicMaxName").text("è¡é«æ¸©"); |
| | | $("#dynamicMinName").text("è¡ä½æ¸©"); |
| | | } |
| | | }); |
| | | } |
| | | if ("x" === curType) { |
| | | $("#dynamicAve").text("--"); |
| | | $("#dynamicMax").text("--"); |
| | | $("#dynamicMin").text("--"); |
| | | $("#dynamicAveName").text("å忏©"); |
| | | $("#dynamicMaxName").text("å髿¸©"); |
| | | $("#dynamicMinName").text("å使¸©"); |
| | | } |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | /*==========ä»åºç±»å为åçä»==========*/ |
| | | //å®ä¹æ°æ® |
| | | var listPoints = [ |
| | | {'z': 0, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 1, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 2, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 3, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 4, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 5, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 6, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 7, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 8, 'x': 0, 'y': 0, 'temp': 0.0}, |
| | | {'z': 9, 'x': 0, 'y': 0, 'temp': 0.0}]; |
| | | var listLays = [{z: 1, tempMin: 0.0, tempMax: 0.0, tempAve: 0.0}, { |
| | | z: 2, |
| | | tempMin: 0.0, |
| | | tempMax: 0.0, |
| | | tempAve: 0.0 |
| | | }, {z: 3, tempMin: 0.0, tempMax: 0.0, tempAve: 0.0}, {z: 4, tempMin: 0.0, tempMax: 0.0, tempAve: 0.0}, { |
| | | z: 5, |
| | | tempMin: 0.0, |
| | | tempMax: 0.0, |
| | | tempAve: 0.0 |
| | | }, {z: 6, tempMin: 0.0, tempMax: 0.0, tempAve: 0.0}, {z: 7, tempMin: 0.0, tempMax: 0.0, tempAve: 0.0}, { |
| | | z: 8, |
| | | tempMin: 0.0, |
| | | tempMax: 0.0, |
| | | tempAve: 0.0 |
| | | }, {z: 9, tempMin: 0.0, tempMax: 0.0, tempAve: 0.0}, {z: 10, tempMin: 0.0, tempMax: 0.0, tempAve: 0.0}]; |
| | | |
| | | var distrList = [1]; |
| | | var bottomList = [10]; |
| | | //å®ä¹æ°æ®æ¾ç¤ºå®¹å¨ |
| | | var layPoints = []; |
| | | var colPoints = []; |
| | | var cirNum = distrList.length; //åæ° |
| | | var layNum = getLayNum(); //屿° |
| | | var longAxis = 100; //第ä¸å
ååé¿è½´ |
| | | var shortAxis = 10; //第ä¸å
ååçè½´ |
| | | var spaceCir = 35; //两åé´è· |
| | | var intervalTop = 20; //è·ç¦»é¡¶ç«¯è·ç¦» |
| | | var spaceLay = 55; //å±é´è· |
| | | var maxSpace = cirNum * spaceCir; //å
å¤åæå¤§å·®å¼ |
| | | var curVal = 1; //屿°æ§å¶åé |
| | | var curCol = 0;//å½åæ ¹ï¼å¤§äº0表示æç
§æ ¹æ§è¡ |
| | | var initAngle = 0; //è§åº¦æ§å¶ |
| | | var clockwise = true; //æ¶éæ§å¶ |
| | | var displayMode = 'all'; //å
夿¾ç¤º |
| | | var textSize = 16;//ææ¬æ¡å¤§å° |
| | | |
| | | var center_x;//ä»å¿Xåæ |
| | | var center_y;//ä»å¿yåæ |
| | | |
| | | var arr = [];//å®ä¹ç»å®äºä»¶æ°ç» |
| | | |
| | | //è²åé¢è²å¸¸é |
| | | var color = null; |
| | | var R = 0; |
| | | var G = 0; |
| | | var B = 0; |
| | | var ctx; |
| | | var timer; |
| | | var t = -2; |
| | | var caseHeight, sum_long; |
| | | |
| | | var isSleep = true; |
| | | |
| | | // åå§ååæ° |
| | | function initCanvasParam() { |
| | | isSleep = true; |
| | | cirNum = distrList.length; // åæ° |
| | | layNum = getLayNum(); // 屿° |
| | | maxSpace = cirNum * spaceCir; // å
å¤åæå¤§å·®å¼ |
| | | curVal = 1; // 屿°æ§å¶åé |
| | | curCol = 0; |
| | | displayMode = 'all'; // å
夿¾ç¤º |
| | | arr = [];// å®ä¹ç»å®äºä»¶æ°ç» |
| | | }; |
| | | //è·åå±é
ç½®ä¸çæé«å±å¼ |
| | | function getLayNum() { |
| | | var i = 1; |
| | | bottomList.forEach(function (value, index, array) { |
| | | if (value > i) i = value; |
| | | }); |
| | | return i; |
| | | }; |
| | | |
| | | |
| | | //ç»å¶ä¸»ç¨åº |
| | | function draw() { |
| | | var canvas = document.getElementById('canvas'); |
| | | ctx = canvas.getContext('2d'); |
| | | center_x = canvas.width / 3; //ä»å¿Xåæ |
| | | center_y = shortAxis / 3 + maxSpace + intervalTop; //ä»å¿yåæ |
| | | ctx.strokeStyle = "black"; |
| | | ctx.lineWidth = 1; |
| | | autoAdjust(); |
| | | make_ellipse(ctx); |
| | | gainData(ctx); |
| | | entityBlock(ctx); |
| | | make_top_ellipse(ctx); |
| | | title(ctx); |
| | | showIndex(canvas, ctx); |
| | | } |
| | | |
| | | //ç»å¶é¡¶é¨æ¤å |
| | | function make_top_ellipse() { |
| | | //ç»å¶é¡¶é¨æ¤å |
| | | ctx.beginPath(); |
| | | ctx.strokeStyle = "rgba(0,0,0,0.5)"; |
| | | ctx.ellipse(center_x, center_y, longAxis + maxSpace, shortAxis + maxSpace, 0, 0, Math.PI * 2); |
| | | ctx.stroke(); |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | //é«åº¦èªè°æ´ |
| | | function autoAdjust() { |
| | | //设置ä»é« |
| | | caseHeight = spaceLay * (layNum - 1); |
| | | //计ç®ä»åºå ç»å¸æ»é« |
| | | sum_long = caseHeight + 2 * (maxSpace + shortAxis + intervalTop); |
| | | //æ»é«è¶çè¿è¡è°æ´å±é´è· |
| | | if (eval(canvas.height) < eval(sum_long)) { |
| | | //ä»ç®¡è®¾ç½®ä¸ºæé« |
| | | caseHeight = canvas.height - 2 * (maxSpace + shortAxis + intervalTop); |
| | | //è°æ´å±é´è· |
| | | spaceLay = caseHeight / (layNum-1); |
| | | } |
| | | }; |
| | | |
| | | //ç»å¶ä»ä½ |
| | | function make_ellipse(ctx) { |
| | | |
| | | //ç»å¶ä»å·¦å³è¾¹ç |
| | | ctx.beginPath(); |
| | | ctx.moveTo(center_x + (longAxis + maxSpace), center_y); |
| | | ctx.lineTo(center_x + (longAxis + maxSpace), center_y + caseHeight) |
| | | ctx.moveTo(center_x - (longAxis + maxSpace), center_y); |
| | | ctx.lineTo(center_x - (longAxis + maxSpace), center_y + caseHeight) |
| | | ctx.stroke(); |
| | | ctx.closePath(); |
| | | |
| | | //å¡«å
èé¨ |
| | | var grd = ctx.createRadialGradient(center_x, center_y + caseHeight - longAxis, shortAxis, center_x, center_y + caseHeight - 2 * longAxis, 5 * longAxis); |
| | | //grd.addColorStop(0, "white"); |
| | | // grd.addColorStop(1, "rgba(115,200,231,1)"); |
| | | grd.addColorStop(0, "rgba(245,222,179)"); |
| | | grd.addColorStop(1, "rgba(240 255 255)"); |
| | | |
| | | ctx.beginPath(); |
| | | ctx.fillStyle = grd; |
| | | ctx.moveTo(center_x + (longAxis + maxSpace), center_y + caseHeight); |
| | | ctx.lineTo(center_x + (longAxis + maxSpace), center_y); |
| | | ctx.ellipse(center_x, center_y, longAxis + maxSpace, shortAxis + maxSpace, 0, 0, Math.PI, true); |
| | | ctx.lineTo(center_x - (longAxis + maxSpace), center_y + caseHeight); |
| | | |
| | | ctx.fill(); |
| | | ctx.closePath(); |
| | | |
| | | //ç»å¶åºé¨æ¤å |
| | | var grd = ctx.createRadialGradient(center_x, center_y + caseHeight - longAxis, shortAxis, center_x, center_y + caseHeight - 2 * longAxis, 5 * longAxis); |
| | | // grd.addColorStop(0, "white"); |
| | | // grd.addColorStop(1, "rgba(115,200,231,1)"); |
| | | grd.addColorStop(0, "rgba(245,222,179)"); |
| | | grd.addColorStop(1, "rgba(240 255 255)"); |
| | | |
| | | ctx.beginPath(); |
| | | ctx.fillStyle = grd; |
| | | ctx.ellipse(center_x, center_y + caseHeight, longAxis + maxSpace, shortAxis + maxSpace, 0, 0, Math.PI * 2); |
| | | ctx.stroke(); |
| | | ctx.fill(); |
| | | ctx.closePath(); |
| | | } |
| | | |
| | | //è¿æ»¤æ°æ® |
| | | function gainData() { |
| | | for (i = 0; i < listPoints.length; i++) { |
| | | if (listPoints[i]['z'] + 1 === curVal) { |
| | | layPoints.push(listPoints[i]) |
| | | } |
| | | } |
| | | } |
| | | |
| | | //è¿æ»¤æ°æ® |
| | | function gainData2() { |
| | | for (i = 0; i < listPoints.length; i++) { |
| | | if ((listPoints[i]['y'] + 1) == curCol) { |
| | | colPoints.push(listPoints[i]) |
| | | } |
| | | } |
| | | } |
| | | |
| | | //è¿è¡æçº¿ï¼ç»å¶è²å |
| | | function entityBlock(ctx) { |
| | | var z_peak = [1, cirNum]; |
| | | var color_list = ["e9e9e9", "bbe5cc", "f8dabc", "f4c8d5", "958a9b", "9f9aa0"]; |
| | | |
| | | var turns = cirNum; |
| | | // for (i = 0; i < bottomList.length; i++) { |
| | | // if(curVal > bottomList[i]){ |
| | | // turns = turns - 1; |
| | | // } |
| | | // } |
| | | |
| | | var showMax = turns; |
| | | //循ç¯çææ¯å |
| | | for (i = turns; i >= 1; i--) { |
| | | //å
夿¾ç¤ºé»è¾å¤æ |
| | | if ((displayMode === 'outside') && !(i === cirNum)) { |
| | | continue; |
| | | } else if ((displayMode === 'inner') && i === cirNum) { |
| | | showMax -= 1; |
| | | continue; |
| | | } |
| | | |
| | | var splNum = distrList[i - 1]; |
| | | //åªæä¸åæ°æ®æ¶åæ§å¶ä¸å¿ä½ç½® |
| | | if(splNum === 1){ |
| | | point = null; |
| | | //å¾ªç¯æ¾å°å¯¹åºç¹å¼ |
| | | for(z = 0;z < layPoints.length; z++){ |
| | | if((layPoints[z]['x'] +1 === i )&&(layPoints[z]['y'] === 0)){ |
| | | point = layPoints[z]; |
| | | break; |
| | | } |
| | | } |
| | | point_x = center_x ; |
| | | point_y = center_y + (curVal -1) * spaceLay ; |
| | | textBox(ctx,point,point_x,point_y); |
| | | continue; |
| | | } |
| | | |
| | | ctx.beginPath(); |
| | | ctx.strokeStyle = 'rgba(0,0,0,1)'; |
| | | ctx.ellipse(center_x, center_y + (curVal-1) * spaceLay, longAxis + i * spaceCir, shortAxis + i * spaceCir, 0, 0, Math.PI * 2); |
| | | |
| | | if (i === 1) { |
| | | var grd = ctx.createRadialGradient(center_x, center_y + caseHeight - longAxis, shortAxis, center_x, center_y + caseHeight - 2 * longAxis, 5 * longAxis); |
| | | grd.addColorStop(0, "rgba(245,222,179)"); |
| | | grd.addColorStop(1, "rgba(240 255 255)"); |
| | | ctx.fillStyle = grd; |
| | | ctx.fill(); |
| | | } else { |
| | | var grd = ctx.createRadialGradient(center_x, center_y + caseHeight - longAxis, shortAxis, center_x, center_y + caseHeight - 2 * longAxis, 2 * longAxis); |
| | | grd.addColorStop(0, "white"); |
| | | grd.addColorStop(1, "#" + color_list[i]); |
| | | ctx.fillStyle = grd; |
| | | ctx.fill(); |
| | | } |
| | | |
| | | ctx.stroke(); |
| | | ctx.closePath(); |
| | | |
| | | //设置ç¹å¼ä¸ºnull; |
| | | var point = null; |
| | | |
| | | //æ¯åçèµ·å§ä¸æªæ¢æ ¹,splNum为æå¨åçæ ¹æ° |
| | | var startGen = 0, endGen = 0; |
| | | for(t = 0; t < distrList.length; t++){ |
| | | if(t <= i - 1){ |
| | | endGen += distrList[t]; |
| | | } |
| | | } |
| | | startGen = endGen - splNum; |
| | | //循ç¯çæåå
ç¹ |
| | | for (j = startGen; j < endGen; j++) { |
| | | //å¾ªç¯æ¾å°å¯¹åºç¹å¼ |
| | | for (z = 0; z < layPoints.length; z++) { |
| | | if ((layPoints[z]['x'] === (i - 1)) && (layPoints[z]['y'] === j)) { |
| | | point = layPoints[z]; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var angle; |
| | | //夿æ¾ç¤ºæ¶é |
| | | if (clockwise) { |
| | | angle = (2 * Math.PI / splNum) * j + initAngle; |
| | | } else { |
| | | angle = (2 * Math.PI / splNum) * (splNum - j) + initAngle; |
| | | } |
| | | |
| | | point_x = center_x + (longAxis + i * spaceCir) * Math.cos(angle); |
| | | point_y = center_y + (curVal-1) * spaceLay + (shortAxis + i * spaceCir) * Math.sin(angle); |
| | | if(point){ |
| | | textBox(ctx, point, point_x, point_y) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //è¿è¡æçº¿ï¼ç»å¶è²å |
| | | function entityBlock2(ctx) { |
| | | //设置ç¹å¼ä¸ºnull; |
| | | var point = null; |
| | | //循ç¯çæåå
ç¹ |
| | | for (j = 0; j < colPoints.length; j++) { |
| | | point = colPoints[j]; |
| | | point_x = center_x; |
| | | point_y = center_y + (j + 1) * spaceLay; |
| | | textBox(ctx, point, point_x, point_y) |
| | | } |
| | | } |
| | | |
| | | //ç»å¶ä¸ä¸ªåå½¢ææ¬æ¡ |
| | | function textBox(ctx, point, x, y) { |
| | | val = point.temp; |
| | | |
| | | if ((t % 2 === 1)) { |
| | | if (val == listLays[curVal - 1]['tempMax']) { //æ¤ç¹ä¸ºæé«æ¸© |
| | | ctx.fillStyle = "rgba(229,29,29,1)"; |
| | | } else if (val == listLays[curVal - 1]['tempMin']) { //æ¤ç¹ä¸ºæä½æ¸© |
| | | ctx.fillStyle = "rgba(0,255,28,1)"; |
| | | } else { |
| | | ctx.fillStyle = getColor(val); |
| | | } |
| | | } else { |
| | | ctx.fillStyle = getColor(val); |
| | | } |
| | | |
| | | //妿æ¯è¡¥ç¹ï¼ä¸åç¹ä½æ¸²æ |
| | | if (val == -102) { |
| | | return; |
| | | } |
| | | if ("å¤ç¨" != val) { |
| | | val = val.toFixed(1); |
| | | } |
| | | |
| | | if(val <= -100){ |
| | | val = "å¤ç¨"; |
| | | } |
| | | |
| | | ctx.beginPath(); |
| | | ctx.lineWidth = 0.75; |
| | | |
| | | ctx.arc(x, y, textSize, 0, 2 * Math.PI); |
| | | ctx.stroke(); |
| | | ctx.fill(); |
| | | ctx.fillStyle = "rgba(0,0,0,1)"; |
| | | ctx.textAlign = 'center'; |
| | | |
| | | |
| | | ctx.font = "600 14px Arial"; |
| | | ctx.fillText(val, x, y + 3); |
| | | ctx.closePath(); |
| | | |
| | | arr.push({ |
| | | 'x': x - 0.6 * textSize, |
| | | 'y': y - 0.7 * textSize, |
| | | 'width': 2.1 * textSize, |
| | | 'height': 2.2 * textSize, |
| | | 'type': 'val', |
| | | 'lay': point['z'], |
| | | 'val': point['temp'], |
| | | 'cir': point['x'], |
| | | 'rows': point['y'] |
| | | }) |
| | | } |
| | | |
| | | //æ ¹æ®æ¸©åº¦è·åRGB |
| | | function getColor(val) { |
| | | if (val >= 50) { |
| | | color = "rgba(255,0,0,1)"; |
| | | return color; |
| | | } else if (val >= 20) { |
| | | G = Math.round(255 - 255 * ((val - 20) / 30)); |
| | | color = "rgba(255," + G + ",0,1)"; |
| | | return color; |
| | | } else if (val >= 0) { |
| | | R = Math.round(100 + (155 / 20) * val); |
| | | B = Math.round(30 - 1.5 * val); |
| | | color = "rgba(" + R + ",255," + B + ",1)"; |
| | | return color; |
| | | } else if (val >= -10) { |
| | | R = Math.round(100 - 6.6 * (val * (-1))); |
| | | G = Math.round(255 - 2.2 * (val * (-1))); |
| | | B = Math.round(30 + 1.2 * (val * (-1))); |
| | | color = "rgba(" + R + "," + G + "," + B + ",1)"; |
| | | return color; |
| | | } else { |
| | | color = "rgba(34,233,42,1)"; |
| | | return color; |
| | | } |
| | | } |
| | | |
| | | //ç¡ç |
| | | function sleep() { |
| | | if(isSleep){ |
| | | t++; |
| | | if (t >= 0) { |
| | | flash(); |
| | | } |
| | | timer = setTimeout("sleep()", 400); |
| | | } |
| | | } |
| | | |
| | | //éªçç¨åº |
| | | function flash() { |
| | | var canvas = document.getElementById('canvas'); |
| | | var ctx = canvas.getContext('2d'); |
| | | canvas.height = canvas.height; |
| | | layPoints = []; |
| | | arr = []; |
| | | make_ellipse(ctx); |
| | | gainData(ctx); |
| | | entityBlock(ctx); |
| | | make_top_ellipse(ctx); |
| | | title(ctx) |
| | | } |
| | | |
| | | //éªçç¨åº |
| | | function flash2() { |
| | | var canvas = document.getElementById('canvas'); |
| | | var ctx = canvas.getContext('2d'); |
| | | canvas.height = canvas.height; |
| | | colPoints = []; |
| | | arr = []; |
| | | |
| | | make_ellipse(ctx); |
| | | |
| | | gainData2(ctx); |
| | | |
| | | entityBlock2(ctx); |
| | | |
| | | make_top_ellipse(ctx); |
| | | title(ctx) |
| | | } |
| | | |
| | | //æ 颿 |
| | | function title(ctx) { |
| | | |
| | | for (i = 1; i <= layNum; i++) { |
| | | |
| | | start_x = center_x + (longAxis + maxSpace) + 20; |
| | | start_y = center_y + spaceLay * (i - 1); |
| | | |
| | | if (curVal === i) { |
| | | var grad = ctx.createLinearGradient(start_x, start_y, start_x + 2 * spaceLay, start_y); |
| | | grad.addColorStop(0, "#2f2fff"); |
| | | grad.addColorStop(0.7, "#b3b3ff"); |
| | | grad.addColorStop(1, "#ffffff"); |
| | | //设置为æªéæ©æ¶çæ¸åå¡«å
|
| | | } else { |
| | | var grad = ctx.createLinearGradient(start_x, start_y, start_x + 2 * spaceLay, start_y); |
| | | // grad.addColorStop(0, "#a2baef"); |
| | | // grad.addColorStop(0.8, "#ffffff"); |
| | | grad.addColorStop(0, "rgba(245,222,179)"); |
| | | grad.addColorStop(1, "rgba(240 255 255)"); |
| | | } |
| | | |
| | | ctx.fillStyle = grad; |
| | | ctx.lineWidth = 1; |
| | | ctx.strokeStyle = 'rgba(214,223,232,1)'; |
| | | ctx.beginPath(); |
| | | ctx.moveTo(start_x, start_y + 1); //åç¹ |
| | | ctx.lineTo(start_x + 1.8 * spaceLay, start_y + 1); //å³ç§» |
| | | ctx.lineTo(start_x + 1.8 * spaceLay, start_y + spaceLay - 1); //ä¸ç§» |
| | | ctx.lineTo(start_x, start_y + spaceLay - 1); //左移 |
| | | ctx.lineTo(start_x, start_y + 1); //ä¸ç§» |
| | | ctx.stroke(); |
| | | ctx.fill(); |
| | | ctx.closePath(); |
| | | //è®¾ç½®ä¸ºéæ©æ¶çåä½å¡«å
|
| | | if (curVal === i) { |
| | | ctx.fillStyle = 'rgba(255,14,0,1)'; |
| | | ctx.font = "600 14px Arial"; |
| | | } else { |
| | | ctx.fillStyle = 'rgba(30,30,30,1)'; |
| | | ctx.font = "14px Arial"; |
| | | } |
| | | val = "第" + i + "å±"; |
| | | ctx.textAlign = 'center'; |
| | | ctx.fillText(val, start_x + 0.9 * spaceLay, start_y + 0.7 * spaceLay); |
| | | arr.push({ |
| | | 'x': start_x, |
| | | 'y': start_y + 1, |
| | | 'width': 1.8 * spaceLay, |
| | | 'height': spaceLay, |
| | | 'num': i, |
| | | 'type': 'title' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | //ç»å®è§¦åçäºä»¶ |
| | | function draws(x, y, canvas, ctx) { |
| | | //å建ç¹å»äºä»¶çç»å¸ï¼ç»å¸2ï¼ |
| | | ctx.rect(0, 0, canvas.width, canvas.height); |
| | | arr.forEach(function (v, i) { |
| | | ctx.beginPath(); |
| | | //ç»å¶æ¯ä¸ä¸ªå¯¹è±¡çåºå |
| | | ctx.rect(v.x, v.y, v.width, v.height); |
| | | ctx.closePath(); |
| | | |
| | | console.log(v); |
| | | |
| | | //å¤æç¹æ¯å¦å¨åºåå
|
| | | var showData; |
| | | if (ctx.isPointInPath(x, y)) { |
| | | //ç¹çç±»åä¸ºå¼ |
| | | if (v.type === 'val') { |
| | | //ç±»å为valï¼åå¼¹åºç¹ä¿¡æ¯ |
| | | showData = "å½åå±ï¼" + (v.lay + 1) + "\n å½åçµç¼ï¼ç¬¬" + (v.rows + 1) + "æ ¹"; |
| | | alert(showData); |
| | | } else { //å
¶ä»ç±»åå忢æ¾ç¤ºè²å |
| | | curVal = v['num']; |
| | | flash(); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //ç»å®äºä»¶ |
| | | function showIndex(canvas, ctx) { |
| | | //æ´ä¸ªç»å¸å¯¹è±¡æ·»å ç¹å»äºä»¶ |
| | | canvas.addEventListener('click', function location(e) { |
| | | x = e.clientX; |
| | | y = e.clientY; |
| | | draws(x, y, canvas, ctx); |
| | | }, false); |
| | | } |
| | | |
| | | // --------------- æé®ç¹å»äºä»¶--------------------- |
| | | //ä¸ä¸è¡ |
| | | function last() { |
| | | if (curVal === 1) { |
| | | curVal = Number(layNum); |
| | | } else { |
| | | curVal -= 1; |
| | | } |
| | | flash(); |
| | | renderGrainByLay(curVal); |
| | | } |
| | | |
| | | //ä¸ä¸è¡ |
| | | function next() { |
| | | if (curVal === Number(layNum)) { |
| | | curVal = 1; |
| | | } else { |
| | | curVal += 1; |
| | | } |
| | | flash(); |
| | | |
| | | renderGrainByLay(curVal); |
| | | } |
| | | |
| | | //æ ¹æ¥ç |
| | | function showCol() { |
| | | isSleep = false; |
| | | |
| | | curCol = $("#value_col").val(); |
| | | listPoints = grainData.listPoints; |
| | | listLays = grainData.listLays; |
| | | distrList = grainData.cable.split("-").map(Number); |
| | | bottomList = grainData.cableCir.split("-").map(Number); |
| | | |
| | | flash2(); |
| | | |
| | | $("#switch_all").prop("checked", false); |
| | | form.render(); |
| | | } |
| | | |
| | | //è§åº¦æè½¬ |
| | | function rotate() { |
| | | initAngle += (document.getElementById("rotate").value) * 2 * Math.PI / 360; |
| | | flash(); |
| | | } |
| | | |
| | | //å
¨é¨æ¾ç¤ºç¹å»äºä»¶ |
| | | function display_all() { |
| | | isSleep = true; |
| | | displayMode = 'all'; |
| | | flash(); |
| | | } |
| | | |
| | | //å¤é¨æ¾ç¤ºç¹å»äºä»¶ |
| | | function display_outside() { |
| | | isSleep = true; |
| | | displayMode = 'outside'; |
| | | flash(); |
| | | } |
| | | |
| | | //å
鍿¾ç¤ºç¹å»äºä»¶ |
| | | function display_inside() { |
| | | isSleep = true; |
| | | displayMode = 'inner'; |
| | | flash(); |
| | | } |
| | | |
| | | // åå§åä¸ç»´ç²®æ
|
| | | function initGrainChar3d() { |
| | | isSleep = true; |
| | | draw(); |
| | | }; |
| | | |
| | | function clearGrainChart3d() { |
| | | initCanvasParam(); |
| | | draw(); |
| | | }; |
| | | |
| | | //éæ°æ¸²æ |
| | | function resetGrainChart3d() { |
| | | listPoints = grainData.listPoints; |
| | | listLays = grainData.listLays; |
| | | distrList = grainData.cable.split("-").map(Number); |
| | | bottomList = grainData.cableCir.split("-").map(Number); |
| | | |
| | | initCanvasParam(); |
| | | draw(); |
| | | sleep();//å¼å§éªç |
| | | curType = "z"; |
| | | curVal = 1; |
| | | renderGrainByLay(curVal); |
| | | } |
| | | |
| | | // æ ¹æ®ç¨æ·éæ©çå±ï¼æ¸²ææ°æ®ï¼ä»1å¼å§ |
| | | function renderGrainByLay(num) { |
| | | var lay; |
| | | $.each(listLays, function (index, data) { |
| | | if (num == data.z) { |
| | | lay = data; |
| | | // æ´æ°å±ä¿¡æ¯ |
| | | $("#dynamicAve").text(lay.tempAve); |
| | | $("#dynamicMax").text(lay.tempMax); |
| | | $("#dynamicMin").text(lay.tempMin); |
| | | $("#dynamicAveName").text("å±å温"); |
| | | $("#dynamicMaxName").text("å±é«æ¸©"); |
| | | $("#dynamicMinName").text("å±ä½æ¸©"); |
| | | return; |
| | | } |
| | | }); |
| | | }; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh-cn" xmlns:th=http://www.thymeleaf.org> |
| | | <head> |
| | | <head> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="renderer" content="webkit"> |
| | | <title>æºæ
§ç²®åºç®¡çå¹³å°-ç²®æ
æ£æµ</title> |
| | | |
| | | <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/layui/css/layui.css}"/> |
| | | <link rel="stylesheet" type="text/css" th:href="@{/grain/grain-style.css}"> |
| | | |
| | | <!--ä½¿ç¨æå°æä»¶ éèå½åæä»¶ --> |
| | | <script th:src="@{/js/plugins/lodop/LodopFuncs.js}"></script> |
| | | |
| | | <style> |
| | | .layui-checkbox-disbaled span { |
| | | background-color: #ed5565 !important; |
| | | } |
| | | |
| | | #lq-left2 { |
| | | min-width: 295px; |
| | | } |
| | | |
| | | .lq-left2-list li h3 { |
| | | float: left; |
| | | /*color: rgb(108, 119, 129);*/ |
| | | color: #000; |
| | | font-size: 16px; |
| | | font-style: italic; |
| | | } |
| | | |
| | | @media all and (max-width: 1650px) { |
| | | .lq-cPic-box { |
| | | margin: 5% auto 0 auto; |
| | | } |
| | | |
| | | .lq-center { |
| | | /*padding-bottom: 50px;*/ |
| | | padding-bottom: 5px; |
| | | } |
| | | |
| | | .lq-left2-list li { |
| | | padding: 3% 6%; |
| | | } |
| | | |
| | | .lq-cTop-item p span { |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | |
| | | .lq-wendu { |
| | | width: 90px; |
| | | height: 200px; |
| | | position: absolute; |
| | | bottom: 0; |
| | | z-index: 99; |
| | | left: 5px; |
| | | margin-bottom: 55px; |
| | | } |
| | | |
| | | .lq-center { |
| | | width: 80%; |
| | | position: relative; |
| | | padding-bottom: 5px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .lq-center2 { |
| | | position: relative; |
| | | padding-bottom: 5px; |
| | | overflow-y: hidden; |
| | | } |
| | | |
| | | .lq-cLow-1 { |
| | | width: 50px; |
| | | border-right: 1px solid #333; |
| | | } |
| | | |
| | | .lq-cLow { |
| | | width: 850px; |
| | | } |
| | | |
| | | .lq-cLow-3 { |
| | | width: 15px; |
| | | border-right: 1px solid #333; |
| | | } |
| | | |
| | | .lq-rMenu li { |
| | | height: 80px; |
| | | } |
| | | |
| | | .layui-form-checkbox { |
| | | min-width: 100px; |
| | | } |
| | | </style> |
| | | |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="l-container"> |
| | | <div class="l-main layui-clear"> |
| | | |
| | | <div class="layui-row"> |
| | | |
| | | <div class="lq-left fl"> |
| | | <div class="lq-left1 layui-clear radius-6 box-shadow"> |
| | | <form class="layui-form"> |
| | | |
| | | <div class="layui-form-item lq-left1-from"> |
| | | <label class="layui-form-label">ä»åºå表</label> |
| | | <div class="layui-input-block"> |
| | | <select name="depotId" id="depotId" lay-filter="select_depotId"> |
| | | <option value=""></option> |
| | | <option th:each="depot,depotSet:${listDepot}" |
| | | th:value="${depot.id}" th:text="${depot.name}" |
| | | th:type="${depot.depotType}"></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item lq-left1-from"> |
| | | <label class="layui-form-label">æ£æµæ¶é´</label> |
| | | <div class="layui-input-block"> |
| | | <select name="batchId" id="batchId" lay-filter="select_batchId"> |
| | | <option value=""></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- ä¸-å·¦ END--> |
| | | |
| | | <div id="lq-center1" class="lq-center fr"> |
| | | <div class="lq-cTop layui-clear" id="topInfo"> |
| | | <div class="lq-cTop-1 fl"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempAve">--</span>â |
| | | </p> |
| | | <h4>ç²®åæ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempMax">--</span>â |
| | | </p> |
| | | <h4>ç²®é«æ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempMin">--</span>â |
| | | </p> |
| | | <h4>ç²®ä½æ¸©</h4> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cTop-2 fl ml4"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="dynamicAve">--</span>â |
| | | </p> |
| | | <h4 id="dynamicAveName">å±å温</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="dynamicMax">--</span>â |
| | | </p> |
| | | <h4 id="dynamicMaxName">å±é«æ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="dynamicMin">--</span>â |
| | | </p> |
| | | <h4 id="dynamicMinName">å±ä½æ¸©</h4> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cTop-3 fl ml4"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempIn">--</span>â |
| | | </p> |
| | | <h4>ä»å
温</h4> |
| | | </div> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="humidityIn">--</span>% |
| | | </p> |
| | | <h4>ä»å
湿</h4> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="lq-cTop-4 fl ml4"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempOut">--</span>â |
| | | </p> |
| | | <h4>ä»å¤æ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="humidityOut">--</span>% |
| | | </p> |
| | | <h4>ä»å¤æ¹¿</h4> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | <!--ä¸-ä¸-END--> |
| | | |
| | | <div class="lq-right fr"> |
| | | <div class="lq-r-fx"> |
| | | <p>å</p> |
| | | <p> |
| | | <span class="fl">西</span><span class="fr">ä¸</span> |
| | | </p> |
| | | <p>å</p> |
| | | </div> |
| | | </div> |
| | | <!--ä¸-å³-EDN--> |
| | | |
| | | </div> |
| | | |
| | | <!-- ä¸é¨å END--> |
| | | |
| | | <div class="layui-row"> |
| | | |
| | | <div class="lq-left fl" id="lq-left2"> |
| | | |
| | | <!-- ä¿ç®¡åä¿¡æ¯ --> |
| | | <div class="lq-left2 radius-6 box-shadow"> |
| | | <div class="lq-userbox"> |
| | | <div class="lq-user"> |
| | | <img th:src="@{/img/web/grain/rkbk-photo_02.png}"/> |
| | | <p id="storeKeeperName">ä¿ç®¡å</p> |
| | | </div> |
| | | <dl class="lq-userItem radius-4"> |
| | | <dt>级å«</dt> |
| | | <dd><span id="storeKeeperLevel">é«çº§ä¿ç®¡å</span></dd> |
| | | </dl> |
| | | <dl class="lq-userItem radius-4"> |
| | | <dt>çµè¯</dt> |
| | | <dd> |
| | | <span id="storeKeeperPhone">###</span> |
| | | </dd> |
| | | </dl> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <!-- è´§ä½å¡çä¿¡æ¯ --> |
| | | <div class="lq-left2 radius-6 box-shadow"> |
| | | <ul class="lq-left2-list"> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>仿¿ç±»å : |
| | | </h3> <em id="depotTypeName"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>å
¥ä»æ¥æ : |
| | | </h3> <em id="storeDate"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>å¨é(KG) : |
| | | </h3> <em id="storageReal"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>ç²®é£åç§ : |
| | | </h3> <em id="foodVarietyName"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>ä»åºç¶æ : |
| | | </h3> <em id="depotStatus"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>ç²®é£äº§å° : |
| | | </h3> <em id="foodLocation"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>æ°´å(%) : |
| | | </h3> <em id="perWet"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>æè´¨(%) : |
| | | </h3> <em id="perImpurity"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>æ£æµäºº : |
| | | </h3> <em id="checkUser"></em> |
| | | </li> |
| | | </ul> |
| | | |
| | | </div> |
| | | </div> |
| | | <!--ä¸-å·¦- END--> |
| | | |
| | | <div id="lq-center" class="lq-center2 fr"> |
| | | |
| | | <div style="margin-top: 10px; text-align: center;" |
| | | id="canvas_parent"> |
| | | <canvas id="canvas" width="1200" height="600"></canvas> |
| | | </div> |
| | | |
| | | <div class="lq-cLow layui-clear radius-6"> |
| | | <form class="layui-form"> |
| | | <div class="lq-cLow-left fl top5"> |
| | | <div class="lq-cLow-1 fl"> |
| | | æä½ï¼ |
| | | <!--<span>å¨çº¿</span>--> |
| | | </div> |
| | | |
| | | <div class="lq-cLow-2 fl layui-form-item"> |
| | | <label class="layui-form-label">å
¨é¨</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" value="all" id="switch_all" |
| | | lay-skin="switch" lay-filter="filter_switch2" checked> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cLow-2 fl layui-form-item"> |
| | | <label class="layui-form-label">å¤å´</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" value="outer" id="switch_outer" |
| | | lay-skin="switch" lay-filter="filter_switch2"> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cLow-2 fl layui-form-item"> |
| | | <label class="layui-form-label">å å
</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" value="inner" id="switch_inner" |
| | | lay-skin="switch" lay-filter="filter_switch2"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="lq-cLow-3 fl"> </div> |
| | | |
| | | <div class="lq-cLow-2 fl layui-form-item"> |
| | | <label class="layui-form-label">屿¾ç¤º</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" value="lay" id="switch_lay" |
| | | lay-skin="switch" lay-filter="filter_switch" checked> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cLow-2 fl layui-form-item"> |
| | | <label class="layui-form-label">è¡æ¾ç¤º</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" value="row" id="switch_row" |
| | | lay-skin="switch" lay-filter="filter_switch"> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cLow-2 fl layui-form-item"> |
| | | <label class="layui-form-label">åæ¾ç¤º</label> |
| | | <div class="layui-input-block"> |
| | | <input type="checkbox" value="col" id="switch_col" |
| | | lay-skin="switch" lay-filter="filter_switch"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="lq-cLow-right fr"> |
| | | <button type="button" |
| | | class="layui-btn layui-btn-normal layui-btn-radius" |
| | | id="btn_pre" onClick="last()">ä¸ä¸å± |
| | | </button> |
| | | |
| | | <button type="button" |
| | | class="layui-btn layui-btn-warm layui-btn-radius" id="btn_next" |
| | | num="1" typeTag="lay" onClick="next()">ä¸ä¸å± |
| | | </button> |
| | | |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <!--ä¸-ä¸- END--> |
| | | |
| | | |
| | | <div class="lq-right fr"> |
| | | <div class="lq-rMenu"> |
| | | <ul> |
| | | <li><a href="javascript:;" onClick="checkGrain()" |
| | | class="lq-a1"> <span class="l-icon lq-rMenu-icon1"></span> |
| | | <p>åä»éé</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="checkGrainBatch()" |
| | | class="lq-a1"> <span class="l-icon lq-rMenu-icon2"></span> |
| | | <p>å¤ä»éé</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="compare()" class="lq-a3"> |
| | | <span class="l-icon lq-rMenu-icon3"></span> |
| | | <p>ç²®æ
对æ¯</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="printSingle()" |
| | | class="lq-a2"> <span class="l-icon lq-rMenu-icon4"></span> |
| | | <p>å仿å°</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="printBatch()" |
| | | class="lq-a2"> <span class="l-icon lq-rMenu-icon4"></span> |
| | | <p>å¤ä»æå°</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="exportBatch()" |
| | | class="lq-a4"> <span class="l-icon lq-rMenu-icon5"></span> |
| | | <p>导åºEXCEL</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="showOrderProgress()" |
| | | class="lq-a4"> <span class="l-icon lq-rMenu-icon6"></span> |
| | | <p>æ£æµè®°å½</p> |
| | | </a></li> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | <!--ä¸-å³- END--> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | <!--l-main end--> |
| | | </div> |
| | | <!--l-container end--> |
| | | |
| | | <script th:inline="javascript"> |
| | | //ä»åºå表 |
| | | var listDepot = [[${listDepot}]]; |
| | | //userId |
| | | var userId = [[${loginUser.loginName}]]; |
| | | var deptId = [[${deptId}]]; |
| | | var companyId = [[${loginUser.companyId}]]; |
| | | var dept = [[${dept}]]; |
| | | |
| | | var DEPOT_TYPE = [[${depotType}]]; //ä»åºç±»å |
| | | var depotId = [[${depotId}]];// å½åä»åºidï¼åå¨ç©ºæ
åµ |
| | | var socket; |
| | | </script> |
| | | <script th:src="@{/ajax/libs/layui/layui.js}"></script> |
| | | <script th:src="@{/js/jquery.min.js}"></script> |
| | | <script th:src="@{/common/constant.js}"></script> |
| | | <script th:src="@{/common/igds-common.js}"></script> |
| | | <script th:src="@{/grain/PrintBuilder-lay.js}"></script> |
| | | <script th:src="@{/grain/grainPoint1.js}"></script> |
| | | <script th:src="@{/grain/grain-export.js}"></script> |
| | | <script th:src="@{/grain/grain-check1.js}"></script> |
| | | </body> |
| | | |
| | | <!-- æ´å¤æ¹æ¬¡éæ© --> |
| | | <div class="layui-tab-content" id="dialogMoreSelect" |
| | | style="display: none;"> |
| | | <div class="layui-inline" id="checkDateMore"></div> |
| | | </div> |
| | | |
| | | |
| | | <!-- å®ä¹æ¹éæå°éæ©å
容 --> |
| | | <div class="layui-tab-content" id="batchPrintSelect" |
| | | style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éæ©æ¥æï¼</label> |
| | | <div class="layui-input-inline left-input"> |
| | | <input type="text" name="printCheckDate" id="printCheckDate" placeholder="å¹´-æ" autocomplete="off" |
| | | class="layui-input"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éæ©æ¶é´</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="printCheckHour"> |
| | | <option value="0">ä¸éæ©</option> |
| | | <option value="6">6ç¹</option> |
| | | <option value="7">7ç¹</option> |
| | | <option value="8">8ç¹</option> |
| | | <option value="9">9ç¹</option> |
| | | <option value="10">10ç¹</option> |
| | | <option value="11">11ç¹</option> |
| | | <option value="12">12ç¹</option> |
| | | <option value="13">13ç¹</option> |
| | | <option value="14">14ç¹</option> |
| | | <option value="15">15ç¹</option> |
| | | <option value="16">16ç¹</option> |
| | | <option value="17">17ç¹</option> |
| | | <option value="18">18ç¹</option> |
| | | <option value="19">19ç¹</option> |
| | | <option value="20">20ç¹</option> |
| | | <option value="21">21ç¹</option> |
| | | <option value="22">22ç¹</option> |
| | | </select> |
| | | </div> |
| | | <button type="button" onclick="getPrintBatchDepot()" |
| | | class="layui-btn layui-btn-sm"> |
| | | <i class="layui-icon layui-icon-search"></i>确认 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <input type="checkbox" lay-filter="select_print_depot" |
| | | th:each="depot,depotSet:${listDepot}" th:value="${depot.id}" |
| | | th:title="${depot.name}" th:disabled="false"> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <!-- å®ä¹æ¯è¾çéæ© --> |
| | | <div class="layui-tab-content" id="compareSelect" style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">对æ¯èå´ï¼</label> |
| | | <div class="layui-input-inline left-input"> |
| | | <input type="text" name="compareCheckDate" id="compareCheckDate" |
| | | placeholder="å¹´-æ" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table class="layui-table" id="tableSelect" lay-filter="filterTable"></table> |
| | | </div> |
| | | |
| | | <!-- å®ä¹æ¹é导åºéæ©å
容 --> |
| | | <div class="layui-tab-content" id="batchExportSelect" |
| | | style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éæ©æ¶é´ï¼</label> |
| | | <div class="layui-input-inline left-input"> |
| | | <input type="text" name="printCheckDate2" id="printCheckDate2" |
| | | placeholder="å¹´-æ" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <input type="checkbox" lay-filter="select_print_depot2" |
| | | th:each="depot,depotSet:${listDepot}" th:value="${depot.id}" |
| | | th:title="${depot.name}" th:disabled="false"> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <!-- æ¹éééå¼¹åºæ¡ --> |
| | | <div class="layui-tab-content" id="batchCheckSelect" |
| | | style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-inline"> |
| | | <input type="checkbox" lay-filter="select_check_depot" |
| | | th:each="depot,depotSet:${listDepot}" th:value="${depot.id}" |
| | | th:title="${depot.name}" th:disabled="false"> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <!-- ç²®æ
ééç¹èµ°å¿ --> |
| | | <div class="layui-tab-content" id="pointChart" style="display: none;"> |
| | | <div id="pointChartLine" style="width: 1300px; height: 500px;"></div> |
| | | </div> |
| | | |
| | | </html> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh-cn" xmlns:th=http://www.thymeleaf.org> |
| | | <head> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="renderer" content="webkit"> |
| | | <title>æºæ
§ç²®åºç®¡çå¹³å°-ç²®æ
æ£æµ-çä»</title> |
| | | |
| | | <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/layui/css/layui.css}"/> |
| | | <link rel="stylesheet" type="text/css" th:href="@{/grain/grain-style.css}"> |
| | | |
| | | <!--ä½¿ç¨æå°æä»¶ éèå½åæä»¶ --> |
| | | <script th:src="@{/js/plugins/lodop/LodopFuncs.js}"></script> |
| | | |
| | | <style> |
| | | .layui-checkbox-disbaled span { |
| | | background-color: #ed5565 !important; |
| | | } |
| | | |
| | | .lq-rMenu { |
| | | position: relative; |
| | | } |
| | | |
| | | .lq-left2-list li h3 { |
| | | float: left; |
| | | /*color: rgb(108, 119, 129);*/ |
| | | color: #000; |
| | | font-size: 16px; |
| | | font-style: italic; |
| | | } |
| | | |
| | | @media all and (max-width: 1650px) { |
| | | .lq-cPic-box { |
| | | margin: 5% auto 0 auto; |
| | | } |
| | | |
| | | .lq-center { |
| | | padding-bottom: 50px; |
| | | } |
| | | |
| | | .lq-left2-list li { |
| | | padding: 3% 6%; |
| | | } |
| | | |
| | | .lq-cTop-item p span { |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | |
| | | .lq-center { |
| | | width: 79%; |
| | | position: relative; |
| | | padding-bottom: 50px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .lq-cLow-1 { |
| | | width: 50px; |
| | | border-right: 1px solid #333; |
| | | } |
| | | |
| | | .lq-cLow { |
| | | width: 690px; |
| | | left: 320px; |
| | | height: 40px; |
| | | } |
| | | |
| | | .lq-cLow-right .layui-btn { |
| | | height: 38px; |
| | | line-height: 38px; |
| | | width: 100px; |
| | | } |
| | | |
| | | .lq-cLow-3 { |
| | | width: 15px; |
| | | border-right: 1px solid #333; |
| | | } |
| | | |
| | | .lq-cTop { |
| | | margin-top: 10px; |
| | | float: left; |
| | | width: 28%; |
| | | } |
| | | |
| | | .lq-cTop-1 { |
| | | width: 100%; |
| | | } |
| | | |
| | | .lq-cTop-2 { |
| | | width: 100%; |
| | | } |
| | | |
| | | .m-top-30 { |
| | | margin-top: 30px; |
| | | } |
| | | |
| | | .m-top-15 { |
| | | margin-top: 18px; |
| | | } |
| | | |
| | | .lq-right { |
| | | right: 10px; |
| | | } |
| | | |
| | | .lq-rMenu li a p { |
| | | color: #FFF; |
| | | } |
| | | |
| | | .lq-cLow-left { |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | .lq-rMenu li { |
| | | height: 80px; |
| | | } |
| | | |
| | | .layui-form-checkbox { |
| | | min-width: 100px; |
| | | } |
| | | |
| | | .layui-form-switch { |
| | | height: 30px; |
| | | line-height: 30px; |
| | | width: 50px; |
| | | margin-top: 13px; |
| | | } |
| | | |
| | | .layui-form-switch i { |
| | | margin-top: 3px; |
| | | } |
| | | |
| | | .input-root { |
| | | width: 40px; |
| | | margin-left: 20px; |
| | | margin-top: 10px; |
| | | height: 35px; |
| | | } |
| | | |
| | | .btn-next { |
| | | margin-top: 20px !important; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .kccz-data-dw { |
| | | position: absolute; |
| | | right: 10px; |
| | | top: 10px; |
| | | z-index: 9; |
| | | line-height: 34px; |
| | | display: block; |
| | | height: 32px; |
| | | text-align: center; |
| | | cursor: pointer; |
| | | } |
| | | </style> |
| | | |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="l-container"> |
| | | <div class="l-main layui-clear"> |
| | | <div class="lq-left fl"> |
| | | <div class="lq-left1 layui-clear radius-6 box-shadow"> |
| | | <form class="layui-form" action=""> |
| | | |
| | | <div class="layui-form-item lq-left1-from"> |
| | | <label class="layui-form-label">ä»åºå表</label> |
| | | <div class="layui-input-block"> |
| | | <select name="depotId" id="depotId" lay-filter="select_depotId"> |
| | | <option value=""></option> |
| | | <option th:each="depot,depotSet:${listDepot}" |
| | | th:value="${depot.id}" th:text="${depot.name}" |
| | | th:type="${depot.depotType}"></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item lq-left1-from"> |
| | | <label class="layui-form-label">æ£æµæ¶é´</label> |
| | | <div class="layui-input-block"> |
| | | <select name="batchId" id="batchId" lay-filter="select_batchId"> |
| | | <option value=""></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | </form> |
| | | </div> |
| | | |
| | | <!-- æ·»å ä¿ç®¡åä¿¡æ¯--> |
| | | <div class="lq-left2 radius-6 box-shadow"> |
| | | <div class="lq-userbox"> |
| | | <div class="lq-user"> |
| | | <img th:src="@{/img/web/grain/rkbk-photo_02.png}"/> |
| | | <p id="storeKeeperName">ä¿ç®¡å</p> |
| | | </div> |
| | | <dl class="lq-userItem radius-4"> |
| | | <dt>级å«</dt> |
| | | <dd>é«çº§ä¿ç®¡å</dd> |
| | | </dl> |
| | | <dl class="lq-userItem radius-4"> |
| | | <dt>çµè¯</dt> |
| | | <dd> |
| | | <span id="storeKeeperPhone">###</span> |
| | | </dd> |
| | | </dl> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="lq-left2 radius-6 box-shadow" id="mainLeft"> |
| | | <ul class="lq-left2-list"> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>仿¿ç±»å : |
| | | </h3> <em id="depotTypeName"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>å
¥ä»æ¥æ : |
| | | </h3> <em id="storeDate"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>å¨é(KG) : |
| | | </h3> <em id="storageReal"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>ç²®é£åç§ : |
| | | </h3> <em id="foodVarietyName"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>ä»åºç¶æ : |
| | | </h3> <em id="depotStatus"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>ç²®é£äº§å° : |
| | | </h3> <em id="foodLocation"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>æ°´å(%) : |
| | | </h3> <em id="perWet"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>æè´¨(%) : |
| | | </h3> <em id="perImpurity"></em> |
| | | </li> |
| | | <li> |
| | | <h3> |
| | | <span class="layui-badge-dot"></span>æ£æµäºº : |
| | | </h3> <em id="checkUser"></em> |
| | | </li> |
| | | </ul> |
| | | |
| | | </div> |
| | | <!--lq-left2 end--> |
| | | |
| | | </div> |
| | | <!--lq-left end--> |
| | | <div id="lq-center" class="lq-center fr"> |
| | | <div class="lq-cTop layui-clear" id="topInfo"> |
| | | <div class="lq-cTop-1"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempAve">--</span>â |
| | | </p> |
| | | <h4>ç²®åæ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempMax">--</span>â |
| | | </p> |
| | | <h4>ç²®é«æ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempMin">--</span>â |
| | | </p> |
| | | <h4>ç²®ä½æ¸©</h4> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cTop-2 m-top-15"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="dynamicAve">--</span>â |
| | | </p> |
| | | <h4 id="dynamicAveName">å±å温</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="dynamicMax">--</span>â |
| | | </p> |
| | | <h4 id="dynamicMaxName">å±é«æ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p> |
| | | <span id="dynamicMin">--</span>â |
| | | </p> |
| | | <h4 id="dynamicMinName">å±ä½æ¸©</h4> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="lq-cTop-3-2 m-top-15"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempIn">--</span>â |
| | | </p> |
| | | <h4>ä»å
温</h4> |
| | | </div> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="humidityIn">--</span>% |
| | | </p> |
| | | <h4>ä»å
湿</h4> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="lq-cTop-4-2 m-top-15"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="tempOut">--</span>â |
| | | </p> |
| | | <h4>ä»å¤æ¸©</h4> |
| | | </div> |
| | | <div class="layui-col-lg6 lq-cTop-item"> |
| | | <p> |
| | | <span id="humidityOut">--</span>% |
| | | </p> |
| | | <h4>ä»å¤æ¹¿</h4> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <form class="layui-form" action=""> |
| | | <div class="lq-cTop-1 m-top-15"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <div> |
| | | <input type="checkbox" checked="" id="switch_all" value="all" |
| | | lay-skin="switch" lay-filter="filter_switch2" lay-text="å¼|å
³"> |
| | | </div> |
| | | <h4>å
¨å±æ¥ç</h4> |
| | | </div> |
| | | |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <div> |
| | | <input type="checkbox" value="outer" id="switch_outer" |
| | | lay-skin="switch" lay-filter="filter_switch2" lay-text="å¼|å
³"> |
| | | </div> |
| | | <h4>æ¥çå¤å</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p class="btn-next" onClick="last()" id="btn_pre"> |
| | | <span>ä¸ä¸å±</span> |
| | | </p> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="lq-cTop-1 m-top-15"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <div> |
| | | <input type="checkbox" value="inner" id="switch_inner" |
| | | lay-skin="switch" lay-filter="filter_switch2" lay-text="å¼|å
³"> |
| | | </div> |
| | | <h4>æ¥çå
å</h4> |
| | | </div> |
| | | |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <div> |
| | | <input type="text" |
| | | class="layui-input input-root" id="value_col"> |
| | | <em class="kccz-data-dw" onclick="showCol()">ç¡®å®</em> |
| | | </div> |
| | | <h4>åæ ¹æ¥ç</h4> |
| | | </div> |
| | | <div class="layui-col-lg4 lq-cTop-item"> |
| | | <p class="btn-next" onClick="next()" id="btn_next" num="1" typeTag="lay"> |
| | | <span>ä¸ä¸å±</span> |
| | | </p> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </form> |
| | | |
| | | </div> |
| | | |
| | | <div style="margin-top: 10px; width: 70%; float: left;" id="canvas_parent"> |
| | | <canvas id="canvas" width="950" height="720"></canvas> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <!--lq-center end--> |
| | | |
| | | <div class="lq-right fr"> |
| | | <div class="lq-r-fx"> |
| | | <p>å</p> |
| | | <p> |
| | | <span class="fl">西</span><span class="fr">ä¸</span> |
| | | </p> |
| | | <p>å</p> |
| | | </div> |
| | | <div class="lq-rMenu"> |
| | | <ul> |
| | | <li><a href="javascript:;" onClick="checkGrain()" |
| | | class="lq-a1"> <span class="l-icon lq-rMenu-icon1"></span> |
| | | <p>åä»éé</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="checkGrainBatch()" |
| | | class="lq-a2"> <span class="l-icon lq-rMenu-icon2"></span> |
| | | <p>å¤ä»éé</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="compare()" class="lq-a3"> |
| | | <span class="l-icon lq-rMenu-icon3"></span> |
| | | <p>ç²®æ
对æ¯</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="printSingle()" |
| | | class="lq-a4"> <span class="l-icon lq-rMenu-icon4"></span> |
| | | <p>å仿å°</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="printBatch()" |
| | | class="lq-a5"> <span class="l-icon lq-rMenu-icon5"></span> |
| | | <p>å¤ä»æå°</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="exportBatch()" |
| | | class="lq-a4"> <span class="l-icon lq-rMenu-icon5"></span> |
| | | <p>导åºEXCEL</p> |
| | | </a></li> |
| | | <li><a href="javascript:;" onClick="showOrderProgress()" |
| | | class="lq-a6"> <span class="l-icon lq-rMenu-icon6"></span> |
| | | <p>æ£æµè®°å½</p> |
| | | </a></li> |
| | | </ul> |
| | | </div> |
| | | |
| | | </div> |
| | | <!--lq-right end--> |
| | | |
| | | </div> |
| | | <!--l-main end--> |
| | | </div> |
| | | <!--l-container end--> |
| | | |
| | | <script th:inline="javascript"> |
| | | //ä»åºå表 |
| | | var listDepot = [[${listDepot}]]; |
| | | //userId |
| | | var userId = [[${loginUser.loginName}]]; |
| | | var deptId = [[${deptId}]]; |
| | | var companyId = [[${loginUser.companyId}]]; |
| | | var dept = [[${dept}]]; |
| | | var DEPOT_TYPE = [[${depotType}]]; //ä»åºç±»å |
| | | var depotId = [[${depotId}]];// å½åä»åºidï¼åå¨ç©ºæ
åµ |
| | | var socket; |
| | | </script> |
| | | |
| | | <script th:src="@{/ajax/libs/layui/layui.js}"></script> |
| | | <script th:src="@{/js/jquery.min.js}"></script> |
| | | <script th:src="@{/common/constant.js}"></script> |
| | | <script th:src="@{/common/igds-common.js}"></script> |
| | | <script th:src="@{/grain/PrintBuilder-lay.js}"></script> |
| | | <script th:src="@{/grain/grainPoint4.js}"></script> |
| | | <script th:src="@{/grain/grain-export.js}"></script> |
| | | <script th:src="@{/grain/grain-check1.js}"></script> |
| | | </body> |
| | | |
| | | <!-- æ´å¤æ¹æ¬¡éæ© --> |
| | | <div class="layui-tab-content" id="dialogMoreSelect" |
| | | style="display: none;"> |
| | | <div class="layui-inline" id="checkDateMore"></div> |
| | | </div> |
| | | |
| | | |
| | | <!-- å®ä¹æ¹éæå°éæ©å
容 --> |
| | | <div class="layui-tab-content" id="batchPrintSelect" |
| | | style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éæ©æ¶é´ï¼</label> |
| | | <div class="layui-input-inline left-input"> |
| | | <input type="text" name="printCheckDate" id="printCheckDate" |
| | | placeholder="å¹´-æ" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | <button type="button" onclick="getPrintBatchDepot()" |
| | | class="layui-btn layui-btn-radius layui-btn-sm"> |
| | | <i class="layui-icon layui-icon-search"></i>确认æ¥è¯¢ |
| | | </button> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <input type="checkbox" lay-filter="select_print_depot" |
| | | th:each="depot,depotSet:${listDepot}" th:value="${depot.id}" |
| | | th:title="${depot.name}" th:disabled="false"> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <!-- å®ä¹æ¯è¾çéæ© --> |
| | | <div class="layui-tab-content" id="compareSelect" style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">对æ¯èå´ï¼</label> |
| | | <div class="layui-input-inline left-input"> |
| | | <input type="text" name="compareCheckDate" id="compareCheckDate" |
| | | placeholder="å¹´-æ" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </form> |
| | | <table class="layui-table" id="tableSelect" lay-filter="filterTable"></table> |
| | | </div> |
| | | |
| | | <!-- å®ä¹æ¹é导åºéæ©å
容 --> |
| | | <div class="layui-tab-content" id="batchExportSelect" |
| | | style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">éæ©æ¶é´ï¼</label> |
| | | <div class="layui-input-inline left-input"> |
| | | <input type="text" name="printCheckDate2" id="printCheckDate2" |
| | | placeholder="å¹´-æ" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <input type="checkbox" lay-filter="select_print_depot2" |
| | | th:each="depot,depotSet:${listDepot}" th:value="${depot.id}" |
| | | th:title="${depot.name}" th:disabled="false"> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | |
| | | <!-- æ¹éééå¼¹åºæ¡ --> |
| | | <div class="layui-tab-content" id="batchCheckSelect" |
| | | style="display: none;"> |
| | | <form class="layui-form layui-form-pane"> |
| | | <div class="layui-inline"> |
| | | <input type="checkbox" lay-filter="select_check_depot" |
| | | th:each="depot,depotSet:${listDepot}" th:value="${depot.id}" |
| | | th:title="${depot.name}" th:disabled="false"> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <!-- ç²®æ
ééç¹èµ°å¿ --> |
| | | <div class="layui-tab-content" id="pointChart" style="display: none;"> |
| | | <div id="pointChartLine" style="width: 1300px; height: 500px;"></div> |
| | | </div> |
| | | |
| | | </html> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="zh-cn" xmlns:th=http://www.thymeleaf.org> |
| | | <head> |
| | | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="renderer" content="webkit"> |
| | | <title>Layui</title> |
| | | |
| | | <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/layui/css/layui.css}"/> |
| | | |
| | | <style> |
| | | body { |
| | | font-family: "微软é
é»", Arial, sans-serif; |
| | | font-size: 14px; |
| | | background: #f3f5f8; |
| | | } |
| | | |
| | | table { |
| | | overflow-x: hidden; |
| | | } |
| | | |
| | | .progress { |
| | | padding: 15px; |
| | | } |
| | | |
| | | .progress-r { |
| | | padding-left: 15px; |
| | | } |
| | | |
| | | .progress-r span { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .layui-progress { |
| | | background-color: #666; |
| | | } |
| | | |
| | | .layui-table { |
| | | color: #0C0C0C; |
| | | } |
| | | |
| | | .layui-table thead tr { |
| | | border-bottom: 3px solid #53adce; |
| | | } |
| | | |
| | | .layui-table thead th { |
| | | font-weight: bold; |
| | | } |
| | | |
| | | .remark { |
| | | padding: 0px 15px 0px 15px; |
| | | height: 22px; |
| | | line-height: 22px; |
| | | color: #FF5722; |
| | | font-size: 12px; |
| | | font-weight: bold; |
| | | float: left; |
| | | } |
| | | |
| | | .btn-clean { |
| | | background-color: #FF5722; |
| | | color: #FFF; |
| | | } |
| | | |
| | | .s-error { |
| | | font-weight: bold; |
| | | color: #FF5722; |
| | | } |
| | | |
| | | .s-complete { |
| | | font-weight: bold; |
| | | color: #5FB878; |
| | | } |
| | | |
| | | .s-none { |
| | | font-weight: bold; |
| | | } |
| | | </style> |
| | | </head> |
| | | |
| | | <body> |
| | | <div class="layui-clear"> |
| | | |
| | | <div class="layui-row progress"> |
| | | |
| | | <div class="layui-col-md6"> |
| | | <div class="layui-progress layui-progress-big" |
| | | lay-filter="filter-progress" lay-showpercent="yes"> |
| | | <div class="layui-progress-bar" lay-percent="0%" |
| | | id="filter-progress"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-col-md6"> |
| | | <div class="progress-r"> |
| | | å
±æ§è¡å½ä»¤ï¼<span id="check_sumNum">0</span>个 |
| | | å·²æ§è¡ï¼<span id="check_completeNum">0</span>个 |
| | | 失败ï¼<span id="check_errorNum">0</span>个 |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="layui-row"> |
| | | <table class="layui-hide" id="tableOrder" |
| | | lay-data="{id: 'tableOrder'}"></table> |
| | | </div> |
| | | |
| | | <div class="layui-row"> |
| | | <span class="remark">æ³¨ï¼æ°æ®ä¸ºå½ååºåºè¿8ä¸ªå°æ¶å
æ§è¡è®°å½åç»è®¡ï¼å¯ä»¥æ¸
é¤ï¼ä¸å½±åæ§è¡æ¥å¿</span> |
| | | <button type="button" |
| | | class="layui-btn layui-btn-primary btn-clean layui-btn-xs" |
| | | onclick="clean()">ç¹å»æ¸
é¤ |
| | | </button> |
| | | |
| | | <button type="button" |
| | | class="layui-btn layui-btn-primary btn-clean layui-btn-xs" |
| | | id="btn-auto" onclick="autoFlush()">èªå¨å·æ°ä¸ |
| | | </button> |
| | | </div> |
| | | |
| | | </div> |
| | | <script th:src="@{/ajax/libs/layui/layui.js}"></script> |
| | | <script th:src="@{/js/jquery.min.js}"></script> |
| | | <script th:inline="javascript"> |
| | | //ä¸å¡ç±»å |
| | | var bizType = [[${bizType}]]; |
| | | //userId |
| | | var userId = [[${loginUser.loginName}]]; |
| | | var companyId = [[${loginUser.companyId}]]; |
| | | var deptId = [[${deptId}]];//å½å人æå¨é¨é¨ID |
| | | |
| | | var orderList; |
| | | |
| | | var autoTag = true; |
| | | |
| | | var table; |
| | | var element; |
| | | |
| | | layui.use(['table', 'element'], function () { |
| | | table = layui.table; |
| | | element = layui.element; |
| | | table.render({ |
| | | elem: '#tableOrder', |
| | | url: '/grain/query-order-list?deptId=' + deptId, |
| | | width: 980, |
| | | height: 460, |
| | | cols: [ |
| | | [ |
| | | {field: 'exeTime', width: 170, title: 'æ§è¡æ¶é´', sort: true, align: 'center'}, |
| | | {field: 'depotName', width: 150, title: 'æå±ä»åº', sort: true, align: 'center'}, |
| | | {field: 'exeUser', width: 130, title: 'æ£æµäºº', align: 'center'}, |
| | | { |
| | | field: 'status', width: 120, title: 'æ§è¡ç¶æ', align: 'center', templet: function (d) { |
| | | if ('IN_PROGRESS' == d.status) { |
| | | return "<span class='s-none'>æ§è¡ä¸</span>"; |
| | | } else if ('SEND_ERROR' == d.status) { |
| | | return "<span class='s-error'>åé失败</span>"; |
| | | } else if ('ANALYSIS_ERROR' == d.status) { |
| | | return "<span class='s-error'>è§£æå¤±è´¥</span>"; |
| | | } else if ("TIMEOUT_ERROR" == d.status) { |
| | | return "<span class='s-error'>å¤çè¶
æ¶</span>"; |
| | | } else { |
| | | return "<span class='s-complete'>æå宿</span>"; |
| | | } |
| | | } |
| | | }, |
| | | {field: 'errorMsg', title: 'æ§è¡è¯´æ', align: 'center'} |
| | | ] |
| | | ], |
| | | page: false, |
| | | done: function (res, cuur, count) { |
| | | orderList = res.data; |
| | | exeProgress(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | function exeProgress() { |
| | | //console.log("--------------exeProgress----------------"); |
| | | //console.log(orderList); |
| | | var sumNum = 0, completeNum = 0, errorNum = 0, per = 0; |
| | | if (orderList) { |
| | | $.each(orderList, function (index, data) { |
| | | sumNum = orderList.length; |
| | | if ("SEND_ERROR" == data.status || "ANALYSIS_ERROR" == data.status || "TIMEOUT_ERROR" == data.status) { |
| | | completeNum++; |
| | | errorNum++; |
| | | } |
| | | if ("COMPLETE" == data.status) { |
| | | completeNum++; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | if (sumNum > 0) { |
| | | per = (completeNum / sumNum * 100).toFixed(1); |
| | | } |
| | | // console.log("-------per------"+per); |
| | | element.progress('filter-progress', per + "%"); |
| | | //èµå¼ |
| | | $("#check_sumNum").text(sumNum); |
| | | $("#check_completeNum").text(completeNum); |
| | | $("#check_errorNum").text(errorNum); |
| | | } |
| | | |
| | | /** |
| | | *æ¸
餿¥å¿ |
| | | */ |
| | | function clean() { |
| | | var data = { |
| | | deptId: deptId, |
| | | companyId: companyId, |
| | | bizType: bizType |
| | | }; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/grain/clean-order-list", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(data), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.alert(result.data); |
| | | } else { |
| | | layer.msg("æ¥å¿æ¸
é¤å®æï¼"); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.alert("ç³»ç»åå°æ§è¡å¤±è´¥ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function autoFlush() { |
| | | if (autoTag) { |
| | | autoTag = false; |
| | | $("#btn-auto").text("已忢巿°"); |
| | | } else { |
| | | autoTag = true; |
| | | $("#btn-auto").text("èªå¨å·æ°ä¸"); |
| | | } |
| | | } |
| | | |
| | | //设置èªå¨å·æ° |
| | | var iframeTimer; |
| | | window.onload = function () { |
| | | if (iframeTimer) { |
| | | clearInterval(iframeTimer); |
| | | } |
| | | iframeTimer = setInterval(function () { |
| | | if (autoTag) { |
| | | table.reload("tableOrder", { |
| | | url: '/grain/query-order-list?deptId=' + deptId |
| | | }); |
| | | } |
| | | }, 6000); |
| | | }; |
| | | </script> |
| | | </body> |
| | | </html> |
| | |
| | | <module>fzzy-igdss-view</module> |
| | | <module>fzzy-igdss-web</module> |
| | | <module>fzzy-igdss-doc</module> |
| | | <module>fzzy-igdss-io</module> |
| | | </modules> |
| | | |
| | | |