已重命名29个文件
已添加6个文件
已修改23个文件
| | |
| | | /** |
| | | * å®ä¹åç¹Pointcut |
| | | */ |
| | | @Pointcut("execution(public * org.jeecg.modules..*.*Controller.*(..)) || @annotation(org.jeecg.common.aspect.annotation.AutoDict)") |
| | | @Pointcut("execution(public * org.jeecg.modules.base.*Controller.*(..)) || @annotation(org.jeecg.common.aspect.annotation.AutoDict)") |
| | | public void excudeService() { |
| | | } |
| | | |
| | | @Around("excudeService()") |
| | | public Object doAround(ProceedingJoinPoint pjp) throws Throwable { |
| | | long time1=System.currentTimeMillis(); |
| | | long time1=System.currentTimeMillis(); |
| | | Object result = pjp.proceed(); |
| | | long time2=System.currentTimeMillis(); |
| | | log.debug("è·åJSONæ°æ® èæ¶ï¼"+(time2-time1)+"ms"); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.common.aspect.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * åå
¸æ³¨è§£æ©å±ï¼æ¯æå¤å段å¹é
|
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface DictExt { |
| | | |
| | | /** |
| | | * æ°æ®åå
¸è¡¨ |
| | | * @return |
| | | */ |
| | | String dicTable() default ""; |
| | | |
| | | /** |
| | | * æ°æ®Text |
| | | * @return |
| | | */ |
| | | String dicText() default ""; |
| | | |
| | | /** |
| | | * æ°æ®codeæ°ç» |
| | | * @return |
| | | */ |
| | | String[] dicCode(); |
| | | |
| | | /** |
| | | * æ°æ®åæ°æ°ç»ï¼åæ°è·codeæ°ç»ä¸ä¸å¯¹åº |
| | | * @return |
| | | */ |
| | | String[] dicParams(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.common.aspect.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * ç±»æè¿°: 深度åå
¸ç¿»è¯æ³¨è§£ |
| | | * åªè½ç¨æ¥æ³¨è§£Listç±»åç屿§ |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface DictList { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.common.aspect.annotation; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * åå
¸æ³¨è§£ |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface FieldQuery{ |
| | | /** |
| | | * å
³èæ°æ®è¡¨ |
| | | * @return |
| | | */ |
| | | String dicTable() default ""; |
| | | |
| | | /** |
| | | * æ°æ®Text |
| | | * @return |
| | | */ |
| | | String dicText() default ""; |
| | | |
| | | /** |
| | | * æ°æ®codeæ°ç» |
| | | * @return |
| | | */ |
| | | String[] dicCode(); |
| | | |
| | | /** |
| | | * æ°æ®åæ°æ°ç»ï¼åæ°è·codeæ°ç»ä¸ä¸å¯¹åº |
| | | * @return |
| | | */ |
| | | String[] dicParams(); |
| | | } |
| | |
| | | * ç¶æ(1ï¼æ£å¸¸ 2ï¼å»ç» ï¼ |
| | | */ |
| | | private Integer status; |
| | | |
| | | |
| | | private Integer delFlag; |
| | | /** |
| | | * 忥工使µå¼æ1忥0ä¸åæ¥ |
| | |
| | | |
| | | private String equipmentIds; |
| | | |
| | | /** |
| | | * 设å¤ç®¡ç设å¤ç» |
| | | */ |
| | | private String eamEquipmentIds; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.aspect; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.system.aspect.DicAspectService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: Dncåå
¸aopç±» |
| | | * @Version: 1.0 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | @Slf4j |
| | | public class EamDictAspect { |
| | | @Autowired |
| | | private DicAspectService dicAspectService; |
| | | |
| | | // å®ä¹åç¹Pointcut |
| | | @Pointcut("execution(public * org.jeecg.modules.eam..*.*Controller.*(..))") |
| | | public void excudeService() { |
| | | } |
| | | |
| | | @Around("excudeService()") |
| | | public Object doAround(ProceedingJoinPoint pjp) throws Throwable { |
| | | long time1=System.currentTimeMillis(); |
| | | Object result = pjp.proceed(); |
| | | long time2=System.currentTimeMillis(); |
| | | log.debug("è·åJSONæ°æ® èæ¶ï¼"+(time2-time1)+"ms"); |
| | | long start=System.currentTimeMillis(); |
| | | this.parseDictText(result); |
| | | long end=System.currentTimeMillis(); |
| | | log.debug("è§£ææ³¨å
¥JSONæ°æ® èæ¶"+(end-start)+"ms"); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ¬æ¹æ³é对è¿å对象为Result çIPageçå页åè¡¨æ°æ®è¿è¡å¨æåå
¸æ³¨å
¥ |
| | | * åå
¸æ³¨å
¥å®ç° éè¿å¯¹å®ä½ç±»æ·»å 注解@dict æ¥æ è¯éè¦çåå
¸å
容,åå
¸å为ååå
¸codeå³å¯ ï¼tableåå
¸ code table texté
å使ç¨ä¸åæ¥jeecgçç¨æ³ç¸å |
| | | * 示ä¾ä¸ºSysUser åæ®µä¸ºsex æ·»å äºæ³¨è§£@Dict(dicCode = "sex") ä¼å¨åå
¸æå¡ç«é©¬æ¥åºæ¥å¯¹åºçtext ç¶åå¨è¯·æ±listçæ¶åå°è¿ä¸ªåå
¸textï¼å·²å段åç§°å _dictTextå½¢å¼è¿åå°å端 |
| | | * ä¾è¾å
¥å½åè¿åå¼çå°±ä¼å¤åºä¸ä¸ªsex_dictTextåæ®µ |
| | | * { |
| | | * sex:1, |
| | | * sex_dictText:"ç·" |
| | | * } |
| | | * åç«¯ç´æ¥åå¼sext_dictTextå¨tableé颿 éåè¿è¡å端çåå
¸è½¬æ¢äº |
| | | * customRender:function (text) { |
| | | * if(text==1){ |
| | | * return "ç·"; |
| | | * }else if(text==2){ |
| | | * return "女"; |
| | | * }else{ |
| | | * return text; |
| | | * } |
| | | * } |
| | | * ç®åvueæ¯è¿ä¹è¿è¡åå
¸æ¸²æå°tableä¸çå¤äºå°±å¾éº»ç¦äº è¿ä¸ªç´æ¥å¨æå¡ç«¯æ¸²æå®æå端å¯ä»¥ç´æ¥ç¨ |
| | | * @param result |
| | | */ |
| | | private void parseDictText(Object result) { |
| | | if (result instanceof Result) { |
| | | if (((Result) result).getResult() instanceof IPage) { |
| | | List<JSONObject> items = dicAspectService.detailDict(((IPage) ((Result) result).getResult()).getRecords()); |
| | | ((IPage) ((Result) result).getResult()).setRecords(items); |
| | | } |
| | | else if(((Result) result).getResult() instanceof List){ |
| | | List<JSONObject> items = dicAspectService.detailDict(((List) ((Result) result).getResult())); |
| | | ((Result) result).setResult(items); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
ÎļþÃû´Ó lxzn-module-eam/src/main/java/org/jeecg/modules/eam/base/model/EamBaseFactoryTreeModel.java ÐÞ¸Ä |
| | |
| | | package org.jeecg.modules.eam.base.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.modules.eam.base.entity.BaseFactory; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.awt.*; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private Integer delFlag; |
| | | /** |
| | | * 设å¤ç»ä¸ç¼å· |
| | | * å
³é®è®¾å¤æ è¯ |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15, orderNum = "1") |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | @Excel(name = "å
³é®è®¾å¤æ è¯", width = 15, orderNum = "1") |
| | | @ApiModelProperty(value = "å
³é®è®¾å¤æ è¯") |
| | | @Dict(dicCode = "equipment_importance") |
| | | private String equipmentImportance; |
| | | |
| | | /** |
| | | * ç»ä¸ç¼ç |
| | | */ |
| | | @Excel(name = "ç»ä¸ç¼ç ", width = 15, orderNum = "2") |
| | | @ApiModelProperty(value = "ç»ä¸ç¼ç ") |
| | | private String equipmentCode; |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @Excel(name = "设å¤åç§°", width = 15, orderNum = "2") |
| | | @Excel(name = "设å¤åç§°", width = 15, orderNum = "3") |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String equipmentName; |
| | | |
| | | /** |
| | | * 使ç¨é¨é¨ |
| | | * å
¬å¸ |
| | | */ |
| | | @Excel(name = "使ç¨è½¦é´", width = 25, dictTable = "mdc_production", dicText = "production_name", dicCode = "id", orderNum = "9") |
| | | @ApiModelProperty(value = "使ç¨é¨é¨") |
| | | @Dict(dicCode = "mdc_production, production_name, id") |
| | | private String orgId; |
| | | // @Excel(name = "å
¬å¸", width = 15, orderNum = "4") |
| | | @ApiModelProperty(value = "å
¬å¸") |
| | | @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code") |
| | | private transient String gsfactoryOrgCode; |
| | | |
| | | /** |
| | | * 设å¤ç®¡çå |
| | | * ä¸å¿ |
| | | */ |
| | | @Excel(name = "设å¤ç®¡çå", width = 35, dictTable = "sys_user", dicText = "realname", dicCode = "username", orderNum = "10") |
| | | @ApiModelProperty(value = "设å¤ç®¡çå") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | private String equipmentManager; |
| | | // @Excel(name = "ä¸å¿", width = 15, orderNum = "5") |
| | | @ApiModelProperty(value = "ä¸å¿") |
| | | @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code") |
| | | private transient String zxfactoryOrgCode; |
| | | |
| | | /** |
| | | * 设å¤ç±»å« |
| | | * å·¥åº |
| | | */ |
| | | @Excel(name = "设å¤ç±»å«", width = 15, dicCode = "equipment_category", orderNum = "5") |
| | | @ApiModelProperty(value = "设å¤ç±»å«") |
| | | // @Excel(name = "å·¥åº", width = 15, orderNum = "6") |
| | | @ApiModelProperty(value = "å·¥åº") |
| | | @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code") |
| | | private transient String gqfactoryOrgCode; |
| | | |
| | | /** |
| | | * 工段 |
| | | */ |
| | | @Excel(name = "ä¸å¿/å·¥åº/工段", width = 15, orderNum = "4") |
| | | @ApiModelProperty(value = "ä¸å¿/å·¥åº/工段") |
| | | @Dict(dictTable = "eam_base_factory",dicText = "factory_name",dicCode = "org_code") |
| | | private String factoryOrgCode; |
| | | |
| | | /** |
| | | * æå±åç±» |
| | | */ |
| | | @Excel(name = "æå±åç±»", width = 15, orderNum = "5") |
| | | @ApiModelProperty(value = "æå±åç±»") |
| | | @Dict(dicCode = "equipment_category") |
| | | private String equipmentCategory; |
| | | /** |
| | | * 设å¤åå· |
| | | */ |
| | | @Excel(name = "设å¤åå·", width = 15, orderNum = "3") |
| | | @ApiModelProperty(value = "设å¤åå·") |
| | | private String equipmentModel; |
| | | /** |
| | | * 设å¤è§æ ¼ |
| | | */ |
| | | @Excel(name = "设å¤è§æ ¼", width = 15, orderNum = "4") |
| | | @ApiModelProperty(value = "设å¤è§æ ¼") |
| | | private String equipmentSpecification; |
| | | |
| | | /** |
| | | * å®è£
ä½ç½® |
| | | */ |
| | | @Excel(name = "å®è£
ä½ç½®", width = 15, orderNum = "11") |
| | | @ApiModelProperty(value = "å®è£
ä½ç½®") |
| | | private String installationPosition; |
| | | /** |
| | | * èµäº§ä½¿ç¨ç¶æ |
| | | */ |
| | | @Excel(name = "èµäº§ä½¿ç¨ç¶æ", width = 15, dicCode = "asset_status", orderNum = "7") |
| | | @ApiModelProperty(value = "èµäº§ç¶æ") |
| | | @Dict(dicCode = "asset_status") |
| | | private String assetStatus; |
| | | /** |
| | | * åºåç¼å· |
| | | */ |
| | | @Excel(name = "åºåç¼å·", width = 15, orderNum = "12") |
| | | @ApiModelProperty(value = "åºåç¼å·") |
| | | private String factoryNumber; |
| | | /** |
| | | * æºåºåå®¶ |
| | | */ |
| | | @Excel(name = "æºåºåå®¶", width = 15, orderNum = "13") |
| | | @ApiModelProperty(value = "æºåºåå®¶") |
| | | private String manufacturingEnterprise; |
| | | /** |
| | | * æ¥æºå½å®¶ |
| | | */ |
| | | @Excel(name = "æ¥æºå½å®¶", width = 25, orderNum = "14") |
| | | @ApiModelProperty(value = "æ¥æºå½å®¶") |
| | | private String originCountry; |
| | | /** |
| | | * 设å¤ä¾åºå |
| | | */ |
| | | @Excel(name = "设å¤ä¾åºå", width = 25, orderNum = "15") |
| | | @ApiModelProperty(value = "设å¤ä¾åºå") |
| | | private String supplier; |
| | | /** |
| | | * åºåæ¥æ |
| | | */ |
| | | @Excel(name = "åºåæ¥æ", width = 25, format = "yyyy/MM/dd", orderNum = "16") |
| | | @ApiModelProperty(value = "åºåæ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date leaveFactoryDate; |
| | | /** |
| | | * éªæ¶æ¥æ |
| | | */ |
| | | @Excel(name = "æç¨æ¥æ", width = 25, format = "yyyy/MM/dd", orderNum = "17") |
| | | @ApiModelProperty(value = "éªæ¶æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date acceptanceCheckDate; |
| | | /** |
| | | * 设å¤å¾ç |
| | | */ |
| | | @ApiModelProperty(value = "设å¤å¾ç") |
| | | private String equipmentImage; |
| | | /** |
| | | * çµæºå°æ° |
| | | */ |
| | | @Excel(name = "çµæºå°æ°", width = 15, orderNum = "18") |
| | | @ApiModelProperty(value = "çµæºå°æ°") |
| | | private Integer motorsNumber; |
| | | /** |
| | | * æ»åç(KW) |
| | | */ |
| | | @Excel(name = "æ»åç(KW)", width = 15, orderNum = "19") |
| | | @ApiModelProperty(value = "æ»åç") |
| | | private String equipmentPower; |
| | | /** |
| | | * éé(å¨) |
| | | */ |
| | | @Excel(name = "éé(å¨)", width = 15, orderNum = "20") |
| | | @ApiModelProperty(value = "éé(å¨)") |
| | | private String equipmentWeight; |
| | | /** |
| | | * æ¯å¦æå·¥èºåæ° |
| | | */ |
| | | @Excel(name = "ææ å·¥èºåæ°", width = 15, dicCode = "has_no", orderNum = "21") |
| | | @ApiModelProperty(value = "æ¯å¦æå·¥èºåæ°") |
| | | private String processParametersFlag; |
| | | /** |
| | | * æ¯å¦æç²¾åº¦åæ° |
| | | */ |
| | | @Excel(name = "ææ ç²¾åº¦åæ°", width = 15, dicCode = "has_no", orderNum = "22") |
| | | @ApiModelProperty(value = "æ¯å¦æç²¾åº¦åæ°") |
| | | private String precisionParametersFlag; |
| | | @TableField(exist = false) |
| | | @Excel(name = "ä¿å
»ç¶æ", width = 15, orderNum = "6",dicCode = "equipment_maintenance_status") |
| | | @ApiModelProperty(value = "ä¿å
»ç¶æ") |
| | | @Dict(dicCode = "equipment_maintenance_status") |
| | | private String maintenanceStatus; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨", width = 50, orderNum = "99") |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | /** |
| | | * å¤å½¢å°ºå¯¸ |
| | | */ |
| | | @Excel(name = "å¤å½¢å°ºå¯¸", width = 15, orderNum = "24") |
| | | @ApiModelProperty(value = "å¤å½¢å°ºå¯¸") |
| | | private String overallDimensions; |
| | | /** |
| | | * 设å¤ç§ç±» |
| | | */ |
| | | @Excel(name = "设å¤ç§ç±»", width = 15, orderNum = "6", dictTable = "sys_category", dicCode = "code", dicText = "name") |
| | | @ApiModelProperty(value = "设å¤ç§ç±»") |
| | | @Dict(dictTable = "sys_category", dicCode = "code", dicText = "name") |
| | | private String equipmentType; |
| | | /** |
| | | * åå§ä»·å¼ |
| | | */ |
| | | @Excel(name = "åå¼(å
)", width = 15, orderNum = "25") |
| | | @ApiModelProperty(value = "åå§ä»·å¼") |
| | | private BigDecimal originalValue; |
| | | /** |
| | | * èµéæ¥æº |
| | | */ |
| | | @Excel(name = "èµéæ¥æº", width = 15, orderNum = "26") |
| | | @ApiModelProperty(value = "èµéæ¥æº") |
| | | private String fundingSource; |
| | | @TableField(exist = false) |
| | | @Excel(name = "ç»´ä¿®ç¶æ", width = 15, orderNum = "7",dicCode = "equipment_repair_status") |
| | | @ApiModelProperty(value = "ç»´ä¿®ç¶æ") |
| | | @Dict(dicCode = "equipment_repair_status") |
| | | private String repairStatus; |
| | | |
| | | /** |
| | | * åè½ç¨é |
| | | */ |
| | | @Excel(name = "åè½ç¨é", width = 15, orderNum = "27") |
| | | @ApiModelProperty(value = "åè½ç¨é") |
| | | private String functionUse; |
| | | /** |
| | | * æ§è½ææ |
| | | */ |
| | | @Excel(name = "æ§è½ææ ", width = 15, orderNum = "28") |
| | | @ApiModelProperty(value = "æ§è½ææ ") |
| | | private String performanceIndicators; |
| | | |
| | | /** |
| | | * å
¥å¸æ¶é´ |
| | | */ |
| | | @Excel(name = "å
¥å¸æ¶é´", width = 15, format = "yyyy/MM/dd", orderNum = "29") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å
¥å¸æ¶é´") |
| | | private Date bookingTime; |
| | | |
| | | /** |
| | | * 管çåç±»ï¼A\B\Cï¼ |
| | | */ |
| | | @Excel(name = "管çåç±»", width = 15, dicCode = "equipment_abc_flag", orderNum = "8") |
| | | @ApiModelProperty(value = "管çåç±»") |
| | | @Dict(dicCode = "equipment_abc_flag") |
| | | private String equipmentImportance; |
| | | |
| | | /** |
| | | * ææ¯ç¶æ |
| | | */ |
| | | @Excel(name = "ææ¯ç¶æ", width = 15, dicCode = "technology_status", orderNum = "7") |
| | | /**ææ¯ç¶æ*/ |
| | | @TableField(exist = false) |
| | | @Excel(name = "ææ¯ç¶æ", width = 15, orderNum = "8",dicCode = "equipment_technology_status") |
| | | @ApiModelProperty(value = "ææ¯ç¶æ") |
| | | @Dict(dicCode = "technology_status") |
| | | @Dict(dicCode = "equipment_technology_status") |
| | | private String technologyStatus; |
| | | |
| | | /** |
| | | * ABCæ è¯ |
| | | */ |
| | | @Excel(name = "ABCæ è¯", width = 15, orderNum = "9",dicCode = "abc_flag") |
| | | @ApiModelProperty(value = "ABCæ è¯") |
| | | @Dict(dicCode = "abc_flag") |
| | | private String abcFlag; |
| | | |
| | | /** |
| | | * ç»´ä¿®çç» |
| | | */ |
| | | @Excel(name = "ç»´ä¿®çç»", width = 15, orderNum = "10") |
| | | @ApiModelProperty(value = "ç»´ä¿®çç»") |
| | | private String repairDepartOrgCode; |
| | | |
| | | /** =================== èªå®æç æªç¨çåæ®µ å¼å§ ==========================**/ |
| | | /** |
| | | * å®å
¨é
ç½® |
| | | */ |
| | | @Excel(name = "å®å
¨é
ç½®", width = 15, orderNum = "11") |
| | | @ApiModelProperty(value = "å®å
¨é
ç½®") |
| | | private String securityConfiguration; |
| | | |
| | | /** |
| | | * å·å´ç³»ç» |
| | | */ |
| | | @Excel(name = "å·å´ç³»ç»", width = 15, orderNum = "15",dicCode = "cooling_system") |
| | | @ApiModelProperty(value = "å·å´ç³»ç»") |
| | | @Dict(dicCode = "cooling_system") |
| | | private String coolSystem; |
| | | |
| | | /** |
| | | * çç«å¨ |
| | | */ |
| | | @Excel(name = "çç«å¨", width = 15, orderNum = "16") |
| | | @ApiModelProperty(value = "çç«å¨") |
| | | private String fireExtinguisher; |
| | | |
| | | /** |
| | | * çç«å¨æææè³ |
| | | */ |
| | | @Excel(name = "çç«å¨æææè³", width = 15, orderNum = "17") |
| | | @ApiModelProperty(value = "çç«å¨æææè³") |
| | | private String fireExtinguisherExpirationDate; |
| | | |
| | | /** |
| | | * æä½ç³»ç» |
| | | */ |
| | | @Excel(name = "æä½ç³»ç»", width = 15, orderNum = "18",dicCode = "yn") |
| | | @ApiModelProperty(value = "æä½ç³»ç»") |
| | | @Dict(dicCode = "yn") |
| | | private String operationSystem; |
| | | /** |
| | | * ä¸»è½´è¿æ¥å°ºå¯¸ |
| | | */ |
| | | @ApiModelProperty(value = "ä¸»è½´è¿æ¥å°ºå¯¸") |
| | | private String spindleConnectDimension; |
| | | /** |
| | | * ç«é¡¹å¡å· |
| | | */ |
| | | @ApiModelProperty(value = "ç«é¡¹å¡å·") |
| | | private String cardNumber; |
| | | /** |
| | | * æ¯å¦å®æ½MDC |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦å®æ½MDC") |
| | | private String mdcFlag; |
| | | |
| | | @ApiModelProperty(value = "MDC设å¤ç±»å") |
| | | private String deviceType; |
| | | /** |
| | | * ç³»ç» |
| | | */ |
| | | @Excel(name = "ç³»ç»", width = 15, orderNum = "19") |
| | | @ApiModelProperty(value = "ç³»ç»") |
| | | private String system; |
| | | |
| | | /** |
| | | * 设å¤ç«¯å£ |
| | | */ |
| | | @Excel(name = "设å¤ç«¯å£", width = 15, orderNum = "20") |
| | | @ApiModelProperty(value = "设å¤ç«¯å£") |
| | | private String equipmentPort; |
| | | |
| | | /** |
| | | * åæ æ°é |
| | | */ |
| | | @Excel(name = "åæ æ°é", width = 15, orderNum = "21") |
| | | @ApiModelProperty(value = "åæ æ°é") |
| | | private Integer coordinateNum; |
| | | |
| | | /** |
| | | * ç¹ç§è®¾å¤;æ¯å¦ä¸ºç¹ç§è®¾å¤ |
| | | * éé(å¨) |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦ç¹ç§è®¾å¤") |
| | | private String specialEquipment; |
| | | @Excel(name = "éé(å¨)", width = 15, orderNum = "22") |
| | | @ApiModelProperty(value = "éé(å¨)") |
| | | private BigDecimal equipmentWeight; |
| | | |
| | | /** |
| | | * éé计éåä½ |
| | | */ |
| | | @Excel(name = "éé计éåä½", width = 15, orderNum = "23") |
| | | @ApiModelProperty(value = "éé计éåä½") |
| | | private String weightUnit; |
| | | |
| | | /** |
| | | * åè½ä½ç½® |
| | | */ |
| | | @Excel(name = "åè½ä½ç½®", width = 15, orderNum = "24") |
| | | @ApiModelProperty(value = "åè½ä½ç½®") |
| | | private String functionalLocation; |
| | | |
| | | /** |
| | | * å®è£
ä½ç½® |
| | | */ |
| | | @Excel(name = "å®è£
ä½ç½®", width = 15, orderNum = "25") |
| | | @ApiModelProperty(value = "å®è£
ä½ç½®") |
| | | private String installationPosition; |
| | | |
| | | /** |
| | | * åºåæ¥æ |
| | | */ |
| | | @Excel(name = "åºåæ¥æ", width = 25, format = "yyyy/MM/dd", orderNum = "26") |
| | | @ApiModelProperty(value = "åºåæ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date leaveFactoryDate; |
| | | |
| | | /** |
| | | * ç«é¡¹å¡å· |
| | | */ |
| | | @Excel(name = "ç«é¡¹å¡å·", width = 15, orderNum = "27") |
| | | @ApiModelProperty(value = "ç«é¡¹å¡å·") |
| | | private String cardNumber; |
| | | |
| | | /** |
| | | * èµéæ¥æº |
| | | */ |
| | | @Excel(name = "èµéæ¥æº", width = 15, orderNum = "28") |
| | | @ApiModelProperty(value = "èµéæ¥æº") |
| | | private String fundingSource; |
| | | |
| | | /** |
| | | * éªæ¶æ¥æ |
| | | */ |
| | | @Excel(name = "æç¨æ¥æ", width = 25, format = "yyyy/MM/dd", orderNum = "29") |
| | | @ApiModelProperty(value = "éªæ¶æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date acceptanceCheckDate; |
| | | |
| | | /** |
| | | * åºåç¼å· |
| | | */ |
| | | @Excel(name = "åºåç¼å·", width = 15, orderNum = "30") |
| | | @ApiModelProperty(value = "åºåç¼å·") |
| | | private String factoryNumber; |
| | | |
| | | /** |
| | | * èµäº§å¶é å |
| | | */ |
| | | @Excel(name = "èµäº§å¶é å", width = 25, orderNum = "31") |
| | | @ApiModelProperty(value = "èµäº§å¶é å") |
| | | private String manufacturingEnterprise; |
| | | |
| | | /** |
| | | * èµäº§æ¥æºå½å®¶ |
| | | */ |
| | | @Excel(name = "èµäº§æ¥æºå½å®¶", width = 25, orderNum = "32") |
| | | @ApiModelProperty(value = "èµäº§æ¥æºå½å®¶") |
| | | private String originCountry; |
| | | |
| | | /** |
| | | * åå· |
| | | */ |
| | | @Excel(name = "åå·", width = 15, orderNum = "33") |
| | | @ApiModelProperty(value = "åå·") |
| | | private String equipmentModel; |
| | | |
| | | /** |
| | | * 设å¤è§æ ¼ |
| | | */ |
| | | @Excel(name = "设å¤è§æ ¼", width = 15, orderNum = "34") |
| | | @ApiModelProperty(value = "设å¤è§æ ¼") |
| | | private String equipmentSpecification; |
| | | |
| | | /** |
| | | * æ»åç(KW) |
| | | */ |
| | | @Excel(name = "æ»åç(KW)", width = 15, orderNum = "35") |
| | | @ApiModelProperty(value = "æ»åç") |
| | | private String equipmentPower; |
| | | |
| | | /** |
| | | * è´¨ä¿å¼å§æ¥æ |
| | | */ |
| | | @Excel(name = "è´¨ä¿å¼å§æ¥æ", width = 15, orderNum = "36") |
| | | @ApiModelProperty(value = "è´¨ä¿å¼å§æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date warrantyStartDate; |
| | | |
| | | /** |
| | | * è´¨ä¿ç»ææ¥æ |
| | | */ |
| | | @Excel(name = "è´¨ä¿ç»ææ¥æ", width = 15, orderNum = "37") |
| | | @ApiModelProperty(value = "è´¨ä¿ç»ææ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date warrantyEndDate; |
| | | |
| | | /** =================== èªå®æç æªç¨çåæ®µ ç»æ ==========================**/ |
| | | /** |
| | | * èµäº§ç¶æ |
| | | */ |
| | | @Excel(name = "èµäº§ç¶æ", width = 15, orderNum = "38",dicCode = "asset_status") |
| | | @ApiModelProperty(value = "èµäº§ç¶æ") |
| | | @Dict(dicCode = "asset_status") |
| | | private String assetStatus; |
| | | |
| | | /**ææ°äºä¿æ¥æ*/ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "ç»´ä¿®ç¶æ") |
| | | @Dict(dicCode = "equipment_repair_status") |
| | | private String repairStatus; |
| | | @Excel(name = "ææ°äºä¿æ¥æ", width = 15, orderNum = "39") |
| | | @ApiModelProperty(value = "ææ°äºä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date latestSecondMaintenance; |
| | | |
| | | /**䏿¬¡äºä¿æ¥æ*/ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "ä¿å
»ç¶æ") |
| | | @Dict(dicCode = "equipment_maintenance_status") |
| | | private String maintenanceStatus; |
| | | @Excel(name = "䏿¬¡äºä¿æ¥æ", width = 15, orderNum = "40") |
| | | @ApiModelProperty(value = "䏿¬¡äºä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date nextSecondMaintenance; |
| | | |
| | | // 设å«ç®¡ç ææç«¯æ¥å£ä½¿ç¨ |
| | | |
| | | /**æ¬æ¬¡ä¸ä¿æ¥æ*/ |
| | | @TableField(exist = false) |
| | | private String value; |
| | | @Excel(name = "æ¬æ¬¡ä¸ä¿æ¥æ", width = 15, orderNum = "41") |
| | | @ApiModelProperty(value = "æ¬æ¬¡ä¸ä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date latestThirdMaintenance; |
| | | |
| | | /**䏿¬¡ä¸ä¿æ¥æ*/ |
| | | @TableField(exist = false) |
| | | private String text; |
| | | @Excel(name = "䏿¬¡ä¸ä¿æ¥æ", width = 15, orderNum = "42") |
| | | @ApiModelProperty(value = "䏿¬¡ä¸ä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date nextThirdMaintenance; |
| | | |
| | | /**ä¸ä¿å¨æ(å¹´)*/ |
| | | @TableField(exist = false) |
| | | @Excel(name = "ä¸ä¿å¨æ(å¹´)", width = 15, orderNum = "43") |
| | | @ApiModelProperty(value = "ä¸ä¿å¨æ(å¹´)") |
| | | private Integer thirdMaintenancePeriod; |
| | | |
| | | /**ææ°ææ¯ç¶æé´å®æ¥æ*/ |
| | | @TableField(exist = false) |
| | | @Excel(name = "ææ°ææ¯ç¶æé´å®æ¥æ", width = 15, orderNum = "44") |
| | | @ApiModelProperty(value = "ææ°ææ¯ç¶æé´å®æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date latestTechnologyCheck; |
| | | /**ææ¯ç¶æä¸æ¬¡é´å®æ¥æ*/ |
| | | @TableField(exist = false) |
| | | @Excel(name = "ææ¯ç¶æä¸æ¬¡é´å®æ¥æ", width = 15, orderNum = "45") |
| | | @ApiModelProperty(value = "ææ¯ç¶æä¸æ¬¡é´å®æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date nextTechnologyCheck; |
| | | /**ææ¯é´å®å¨æ(å¹´)*/ |
| | | @TableField(exist = false) |
| | | @Excel(name = "ææ¯é´å®å¨æ(å¹´)", width = 15, orderNum = "46") |
| | | @ApiModelProperty(value = "ææ¯é´å®å¨æ(å¹´)") |
| | | private Integer technologyCheckPeriod; |
| | | |
| | | /** |
| | | * æ¯å¦ä¸»è®¾å¤ |
| | | */ |
| | | @Excel(name = "æ¯å¦ä¸»è®¾å¤", width = 15, dicCode = "yn", orderNum = "47") |
| | | @ApiModelProperty(value = "æ¯å¦ä¸»è®¾å¤") |
| | | @Dict(dicCode = "yn") |
| | | private String masterFlag; |
| | | |
| | | |
| | | /** |
| | | * æ¯å¦æå·¥èºåæ° |
| | | */ |
| | | @Excel(name = "ææ å·¥èºåæ°", width = 15, dicCode = "yn", orderNum = "48") |
| | | @ApiModelProperty(value = "æ¯å¦æå·¥èºåæ°") |
| | | @Dict(dicCode = "yn") |
| | | private String processParametersFlag; |
| | | /** |
| | | * æ¯å¦æç²¾åº¦åæ° |
| | | */ |
| | | @Excel(name = "ææ ç²¾åº¦åæ°", width = 15, dicCode = "yn", orderNum = "49") |
| | | @ApiModelProperty(value = "æ¯å¦æç²¾åº¦åæ°") |
| | | @Dict(dicCode = "yn") |
| | | private String precisionParametersFlag; |
| | | |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨", width = 50, orderNum = "50") |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | public void setFactoryOrgCode(String factoryOrgCode){ |
| | | this.factoryOrgCode = factoryOrgCode; |
| | | if(StrUtil.isNotEmpty(factoryOrgCode)){ |
| | | if(factoryOrgCode.length()==12){ |
| | | this.gqfactoryOrgCode = factoryOrgCode.substring(0,9); |
| | | this.zxfactoryOrgCode = factoryOrgCode.substring(0,6); |
| | | this.gsfactoryOrgCode = factoryOrgCode.substring(0,3); |
| | | } |
| | | |
| | | if(factoryOrgCode.length()==9){ |
| | | this.zxfactoryOrgCode = factoryOrgCode.substring(0,6); |
| | | this.gsfactoryOrgCode = factoryOrgCode.substring(0,3); |
| | | } |
| | | |
| | | if(factoryOrgCode.length()==6){ |
| | | this.gsfactoryOrgCode = factoryOrgCode.substring(0,3); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public void setEquipmentWeight(BigDecimal equipmentWeight){ |
| | | //å»é¤å°æ°ç¹åå¤ä½ç0 |
| | | if(equipmentWeight!=null) { |
| | | this.equipmentWeight = equipmentWeight.stripTrailingZeros(); |
| | | } |
| | | } |
| | | |
| | | public String getValue() { |
| | | return this.id; |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="eam_equipment_extend对象", description="设å¤å°è´¦æ©å±è¡¨") |
| | | public class EamEquipmentExtend implements Serializable { |
| | | |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | |
| | | @Excel(name = "ç»´ä¿®ç¶æ", width = 15) |
| | | @ApiModelProperty(value = "ç»´ä¿®ç¶æ") |
| | | private String repairStatus; |
| | | /**ææ¯ç¶æ*/ |
| | | @Excel(name = "ææ¯ç¶æ", width = 15, orderNum = "4") |
| | | @ApiModelProperty(value = "ææ¯ç¶æ") |
| | | private String technologyStatus; |
| | | /**ææ°äºä¿æ¥æ*/ |
| | | @ApiModelProperty(value = "ææ°äºä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date latestSecondMaintenance; |
| | | /**䏿¬¡äºä¿æ¥æ*/ |
| | | @ApiModelProperty(value = "䏿¬¡äºä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date nextSecondMaintenance; |
| | | /**ææ°ä¸ä¿æ¥æ*/ |
| | | @ApiModelProperty(value = "ææ°ä¸ä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date latestThirdMaintenance; |
| | | /**䏿¬¡ä¸ä¿æ¥æ*/ |
| | | @ApiModelProperty(value = "䏿¬¡ä¸ä¿æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date nextThirdMaintenance; |
| | | /**ä¸ä¿å¨æ(å¹´)*/ |
| | | @ApiModelProperty(value = "ä¸ä¿å¨æ(å¹´)") |
| | | private Integer thirdMaintenancePeriod; |
| | | /**ææ°ææ¯ç¶æé´å®æ¥æ*/ |
| | | @ApiModelProperty(value = "ææ°ææ¯ç¶æé´å®æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date latestTechnologyCheck; |
| | | /**ææ¯ç¶æä¸æ¬¡é´å®æ¥æ*/ |
| | | @ApiModelProperty(value = "ææ¯ç¶æä¸æ¬¡é´å®æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date nextTechnologyCheck; |
| | | /**ææ¯é´å®å¨æ(å¹´)*/ |
| | | @ApiModelProperty(value = "ææ¯é´å®å¨æ(å¹´)") |
| | | private Integer technologyCheckPeriod; |
| | | } |
| | |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.EamEquipmentMapper"> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamEquipment"> |
| | | select e.*, ext.repair_status, ext.maintenance_status |
| | | select e.*, |
| | | ext.maintenance_status, |
| | | ext.repair_status, |
| | | ext.latest_second_maintenance, |
| | | ext.next_second_maintenance, |
| | | ext.latest_third_maintenance, |
| | | ext.next_third_maintenance, |
| | | ext.technology_status, |
| | | ext.third_maintenance_period, |
| | | ext.technology_check_period, |
| | | ext.latest_technology_check, |
| | | ext.next_technology_check |
| | | from eam_equipment e |
| | | left join eam_equipment_extend ext |
| | | on e.id = ext.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | | </mapper> |
| | |
| | | EamEquipment saveEquipment(EamEquipment eamEquipment); |
| | | |
| | | /** |
| | | * å°è´¦è®¾å¤ç¼è¾ |
| | | * @param eamEquipment |
| | | */ |
| | | EamEquipment updateEquipment(EamEquipment eamEquipment); |
| | | |
| | | /** |
| | | * è·å产线ä¸ç设å¤ä¿¡æ¯ |
| | | * @param ids 产线ids |
| | | * @return |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import io.micrometer.core.instrument.binder.BaseUnits; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | | import org.jeecg.modules.eam.base.entity.BaseFactory; |
| | | import org.jeecg.modules.eam.base.entity.BaseFactoryUser; |
| | | import org.jeecg.modules.eam.base.service.IBaseFactoryService; |
| | | import org.jeecg.modules.eam.base.service.IBaseFactoryUserService; |
| | | import org.jeecg.modules.eam.constant.AssetStatusEnum; |
| | | import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus; |
| | | import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum; |
| | |
| | | import org.jeecg.modules.eam.vo.EquipmentSearchResult; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private IEamEquipmentExtendService equipmentExtendService; |
| | | @Autowired |
| | | private IMdcProductionService mdcProductionService; |
| | | @Autowired |
| | | private IBaseFactoryUserService baseFactoryUserService; |
| | | @Autowired |
| | | private IBaseFactoryService baseFactoryService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | |
| | | //æ©å±è¡¨æ°æ®åæ¥æ·»å |
| | | EamEquipmentExtend eamEquipmentExtend = new EamEquipmentExtend(); |
| | | eamEquipmentExtend.setId(eamEquipment.getId()); |
| | | BeanUtils.copyProperties(eamEquipment, eamEquipmentExtend); |
| | | eamEquipmentExtend.setMaintenanceStatus(EquipmentMaintenanceStatus.NORMAL.name()); |
| | | eamEquipmentExtend.setRepairStatus(EquipmentRepairStatus.NORMAL.name()); |
| | | |
| | | equipmentExtendService.save(eamEquipmentExtend); |
| | | |
| | | //æå
¥è®¾å¤å±¥å @EquipmentHistoryLog |
| | | return eamEquipment; |
| | | } |
| | | |
| | | /** |
| | | * å°è´¦è®¾å¤ç¼è¾ |
| | | * @param eamEquipment |
| | | */ |
| | | @Override |
| | | public EamEquipment updateEquipment(EamEquipment eamEquipment){ |
| | | if (eamEquipment == null) { |
| | | return null; |
| | | } |
| | | eamEquipmentMapper.updateById(eamEquipment); |
| | | EamEquipmentExtend eamEquipmentExtend = new EamEquipmentExtend(); |
| | | BeanUtils.copyProperties(eamEquipment, eamEquipmentExtend); |
| | | equipmentExtendService.updateById(eamEquipmentExtend); |
| | | return eamEquipment; |
| | | } |
| | | |
| | |
| | | if (sysUser == null) { |
| | | return page; |
| | | } |
| | | if (StringUtils.isNotBlank(sysUser.getEquipmentIds())) { |
| | | if (StringUtils.isNotBlank(sysUser.getEamEquipmentIds())) { |
| | | //éæ©äºè®¾å¤ï¼æ ¹æ®è®¾å¤idè¿æ»¤è®¾å¤ |
| | | List<String> equipArr = Arrays.asList(sysUser.getEquipmentIds().split(",")); |
| | | List<String> equipArr = Arrays.asList(sysUser.getEamEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | } else { |
| | | //没æéæ©è®¾å¤ï¼æ ¹æ®è½¦é´è¿æ»¤è®¾å¤ |
| | | queryWrapper.exists("select 1 from mdc_user_production t where t.user_id={0} and t.pro_id=e.org_id", sysUser.getId()); |
| | | //没æéæ©è®¾å¤ï¼æ ¹æ®ä¸å¿è¿æ»¤è®¾å¤ |
| | | List<BaseFactoryUser> baseFactoryUserList=baseFactoryUserService. |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId())); |
| | | if(!CollectionUtils.isEmpty(baseFactoryUserList)){ |
| | | List<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toList()); |
| | | List<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getFactoryCode).collect(Collectors.toList()); |
| | | queryWrapper.in("e.factory_code", factoryCode); |
| | | } |
| | | |
| | | } |
| | | //æ¥è¯¢æ¡ä»¶è¿æ»¤ |
| | | if (eamEquipment != null) { |
| | |
| | | eamReportRepair.setReportStatus(ReportRepairEnum.UNDER_INTERNAL_REPAIR.name()); |
| | | }else { |
| | | //æäº¤æºå¨åç»´ä¿®ï¼è½¦é´ç®¡çå确认 |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0003); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | } |
| | | if(CommonConstant.STATUS_1.equals(request.getLeaderConfirm())) { |
| | | //éè¿ æäº¤æºå¨åç»´ä¿® |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0006); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0006); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»å
¬å¸ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | return Result.OK("æ·»å 失败ï¼"); |
| | | } |
| | | //è°ç¨mdcEquipmentæå
¥MDCè®¾å¤ |
| | | if (CommonConstant.DEFAULT_1.equals(eamEquipment.getMdcFlag())) { |
| | | // if (CommonConstant.DEFAULT_1.equals(eamEquipment.getMdcFlag())) { |
| | | //æå
¥MDCè®¾å¤ |
| | | // MdcEquipment mdcEquipment = new MdcEquipment(); |
| | | // mdcEquipment.setEquipmentId(entity.getEquipmentCode()); |
| | | // mdcEquipment.setEquipmentType(entity.getDeviceType()); |
| | | // mdcEquipment.setEquipmentName(entity.getEquipmentName()); |
| | | // mdcEquipmentService.addNewEquipmentFromEam(mdcEquipment, eamEquipment.getOrgId()); |
| | | } |
| | | // } |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "设å¤å°è´¦-ç¼è¾", notes = "设å¤å°è´¦-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamEquipment eamEquipment) { |
| | | eamEquipmentService.updateById(eamEquipment); |
| | | eamEquipmentService.updateEquipment(eamEquipment); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | |
| | | JSONObject item = JSONObject.parseObject(json, Feature.OrderedField); |
| | | translateDictTextUtils.translateField("createBy", eamEquipment.getCreateBy(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("updateBy", eamEquipment.getUpdateBy(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("technologyStatus", eamEquipment.getTechnologyStatus(), item, "technology_status"); |
| | | translateDictTextUtils.translateField("orgId", eamEquipment.getOrgId(), item, "mdc_production,production_name,id"); |
| | | translateDictTextUtils.translateField("equipmentManager", eamEquipment.getEquipmentManager(), item, "sys_user,realname,username"); |
| | | // translateDictTextUtils.translateField("technologyStatus", eamEquipment.getTechnologyStatus(), item, "technology_status"); |
| | | // translateDictTextUtils.translateField("orgId", eamEquipment.getOrgId(), item, "mdc_production,production_name,id"); |
| | | // translateDictTextUtils.translateField("equipmentManager", eamEquipment.getEquipmentManager(), item, "sys_user,realname,username"); |
| | | translateDictTextUtils.translateField("equipmentCategory", eamEquipment.getEquipmentCategory(), item, "equipment_category"); |
| | | translateDictTextUtils.translateField("assetStatus", eamEquipment.getAssetStatus(), item, "asset_status"); |
| | | translateDictTextUtils.translateField("repairStatus", eamEquipment.getRepairStatus(), item, "equipment_repair_status"); |
| | |
| | | // è·åä¸ä¼ æä»¶å¯¹è±¡ |
| | | MultipartFile file = entity.getValue(); |
| | | ImportParams params = new ImportParams(); |
| | | params.setTitleRows(0); |
| | | params.setTitleRows(2); |
| | | params.setHeadRows(1); |
| | | params.setNeedSave(true); |
| | | params.setStartSheetIndex(0); |
| | |
| | | sb.append(String.format("设å¤ç¼ç [%s]设å¤åç±»ä¸ºç©ºï¼æ æ³å¯¼å
¥\n\n", eamEquipment.getEquipmentCode())); |
| | | continue; |
| | | } |
| | | if (StringUtils.isBlank(eamEquipment.getOrgId()) || StringUtils.isBlank(eamEquipment.getEquipmentManager())) { |
| | | sb.append(String.format("设å¤ç¼ç [%s]使ç¨è½¦é´æè®¾å¤ç®¡çåä¸ºç©ºï¼æ æ³å¯¼å
¥\n\n", eamEquipment.getEquipmentCode())); |
| | | continue; |
| | | } |
| | | // if (eamEquipment.getAcceptanceCheckDate() == null) { |
| | | // sb.append(String.format("设å¤ç¼ç [%s]éªæ¶ä¸ºç©ºï¼æ æ³å¯¼å
¥\n\r", eamEquipment.getEquipmentCode())); |
| | | // continue; |
| | | // } |
| | | // if (StringUtils.isBlank(eamEquipment.getTechnologyStatus())) { |
| | | // sb.append(String.format("设å¤ç¼ç [%s]ææ¯ç¶æä¸ºç©ºï¼æ æ³å¯¼å
¥\n\r", eamEquipment.getEquipmentCode())); |
| | | // continue; |
| | | // } |
| | | EamEquipment one = eamEquipmentService.getOne(new LambdaQueryWrapper<EamEquipment>().eq(EamEquipment::getEquipmentCode, eamEquipment.getEquipmentCode()).eq(EamEquipment::getDelFlag, CommonConstant.DEL_FLAG_0)); |
| | | if (one != null) { |
| | | sb.append(String.format("设å¤ç¼ç [%s]å·²åå¨ï¼æ æ³éå¤å¯¼å
¥\n\r", eamEquipment.getEquipmentCode())); |
| | | continue; |
| | | } |
| | | if (!CommonConstant.DEFAULT_1.equals(eamEquipment.getMdcFlag())) { |
| | | eamEquipment.setMdcFlag(CommonConstant.DEFAULT_0); |
| | | } |
| | | EamEquipment equipment = eamEquipmentService.saveEquipment(eamEquipment); |
| | | if (equipment == null) { |
| | |
| | | sb.append(String.format("设å¤ç¼ç [%s]ä¿åå¤±è´¥ï¼æ æ³å¯¼å
¥\n\r", eamEquipment.getEquipmentCode())); |
| | | continue; |
| | | } |
| | | //è°ç¨mdcEquipmentæå
¥MDCè®¾å¤ |
| | | if (CommonConstant.DEFAULT_1.equals(eamEquipment.getMdcFlag())) { |
| | | //æå
¥MDCè®¾å¤ |
| | | // MdcEquipment mdcEquipment = new MdcEquipment(); |
| | | // mdcEquipment.setEquipmentId(eamEquipment.getEquipmentCode()); |
| | | // mdcEquipment.setEquipmentType(eamEquipment.getDeviceType()); |
| | | // mdcEquipment.setEquipmentName(eamEquipment.getEquipmentName()); |
| | | // mdcEquipmentService.addNewEquipmentFromEam(mdcEquipment, eamEquipment.getOrgId()); |
| | | } |
| | | } |
| | | //400æ¡ saveBatchæ¶èæ¶é´1592æ¯«ç§ å¾ªç¯æå
¥æ¶èæ¶é´1947æ¯«ç§ |
| | | //1200æ¡ saveBatchæ¶èæ¶é´3687æ¯«ç§ å¾ªç¯æå
¥æ¶èæ¶é´5212æ¯«ç§ |
| | | log.info("æ¶èæ¶é´" + (System.currentTimeMillis() - start) + "毫ç§"); |
| | | //update-end-author:taoyan date:20190528 for:æ¹éæå
¥æ°æ® |
| | | if (sb.length() > 0) { |
| | |
| | | if (StringUtils.isNotBlank(equipmentId)) { |
| | | EamEquipment equipment = eamEquipmentService.getById(equipmentId); |
| | | if(equipment != null) { |
| | | productionId = equipment.getOrgId(); |
| | | // productionId = equipment.getOrgId(); |
| | | equipmentCode = equipment.getEquipmentCode(); |
| | | } |
| | | } |
| | |
| | | if (StringUtils.isBlank(request.getLeanDepartId())) { |
| | | throw new JeecgBootException("åå
¥è½¦é´ä¸å
许为空ï¼"); |
| | | } |
| | | if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | throw new JeecgBootException("å½å设å¤å±äºæ¤è½¦é´ï¼ä¸éè¦åç¨ï¼"); |
| | | } |
| | | // if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | // throw new JeecgBootException("å½å设å¤å±äºæ¤è½¦é´ï¼ä¸éè¦åç¨ï¼"); |
| | | // } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | throw new JeecgBootException("å½åç¨æ·æ æ³æ·»å åç¨è®°å½ï¼"); |
| | |
| | | if (StringUtils.isBlank(request.getLeanDepartId())) { |
| | | throw new JeecgBootException("åå
¥è½¦é´ä¸å
许为空ï¼"); |
| | | } |
| | | if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | throw new JeecgBootException("å½å设å¤å±äºæ¤è½¦é´ï¼ä¸éè¦åç¨ï¼"); |
| | | } |
| | | // if (request.getLeanDepartId().equals(equipment.getOrgId())) { |
| | | // throw new JeecgBootException("å½å设å¤å±äºæ¤è½¦é´ï¼ä¸éè¦åç¨ï¼"); |
| | | // } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | throw new JeecgBootException("å½åç¨æ·æ æ³ç¼è¾åç¨è®°å½ï¼"); |
| | |
| | | } |
| | | variables.put("proofreading", true); |
| | | List<String> usernames = new ArrayList<>(); |
| | | usernames.add(equipment.getEquipmentManager()); |
| | | // usernames.add(equipment.getEquipmentManager()); |
| | | variables.put("NextAssignee", usernames); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("equipment_lean_out", variables); |
| | | if (result != null) { |
| | |
| | | break; |
| | | // å½è¿ |
| | | case WAIT_RETURN: |
| | | if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | List<String> userApprovalList = new ArrayList<>(Collections.singletonList(entity.getLeanPerson())); |
| | | userApprovalList.add(equipment.getEquipmentManager()); |
| | | // if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | // throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | // } |
| | | // List<String> userApprovalList = new ArrayList<>(Collections.singletonList(entity.getLeanPerson())); |
| | | // userApprovalList.add(equipment.getEquipmentManager()); |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization", request.getReturnComment()); |
| | | values.put("comment", request.getReturnComment()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | // values.put("NextAssignee", userApprovalList); |
| | | request.setComment(request.getReturnComment()); |
| | | entity.setLeanEndTime(new Date()); //å½è¿æ¶é´ |
| | | //设置entity |
| | |
| | | variables.put("comment", entity.getScrapReason()); |
| | | variables.put("proofreading", true); |
| | | // åé
ç»è®¾å¤ç®¡çå |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0004); |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0004); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è®¾å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | variables.put("comment", "æ°å¢å¯å°é»è®¤å¯å¨æµç¨"); |
| | | variables.put("proofreading", true); |
| | | // åé
ç»è®¾å¤ç®¡çå |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0004); |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0004); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è®¾å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | } |
| | | variables.put("proofreading", true); |
| | | // åé
ç»è®¾å¤ç®¡çå |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0004); |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(),null, BusinessCodeConst.PCR0004); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è®¾å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | if (sysUser == null) { |
| | | throw new JeecgBootException("å½åç¨æ·æ æ³æ·»å åç¨è®°å½ï¼"); |
| | | } |
| | | if (equipment.getOrgId().equals(request.getNewDepartId())) { |
| | | throw new JeecgBootException("å½å设å¤å±äºæ¤è½¦é´ï¼ä¸éè¦åå¨ï¼"); |
| | | } |
| | | request.setOldDepartId(equipment.getOrgId()); |
| | | // if (equipment.getOrgId().equals(request.getNewDepartId())) { |
| | | // throw new JeecgBootException("å½å设å¤å±äºæ¤è½¦é´ï¼ä¸éè¦åå¨ï¼"); |
| | | // } |
| | | // request.setOldDepartId(equipment.getOrgId()); |
| | | request.setReportUser(sysUser.getUsername()); |
| | | return equipmentTransferMapper.insert(request) > 0; |
| | | } |
| | |
| | | variables.put("comment", entity.getTransferReason()); |
| | | variables.put("proofreading", true); |
| | | // åé
ç»è®¾å¤ç®¡çå |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0004); |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(),null, BusinessCodeConst.PCR0004); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è®¾å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | updateWrapper.set("equipment_id", request.getEquipmentId()); |
| | | updateWrapper.set("remark", request.getRemark()); |
| | | updateWrapper.set("transfer_reason", request.getTransferReason()); |
| | | updateWrapper.set("old_depart_id", equipment.getOrgId()); |
| | | // updateWrapper.set("old_depart_id", equipment.getOrgId()); |
| | | updateWrapper.set("new_depart_id", request.getNewDepartId()); |
| | | updateWrapper.eq("id", request.getId()); |
| | | updateWrapper.eq("report_user", sysUser.getUsername()); |
| | |
| | | Map<String, Object> values = new HashMap<>(); |
| | | if (InspectionStatus.UNDER_INSPECTION.name().equals(order.getInspectionStatus()) && user.getUsername().equals(order.getOperator())) { |
| | | // ç¹æ£äººç¹æ£ç»æ |
| | | String manager = Optional.ofNullable(iEamEquipmentService.getById(order.getEquipmentId())) |
| | | .map(EamEquipment::getEquipmentManager) |
| | | .orElse(null); |
| | | if (manager == null) { |
| | | throw new IllegalArgumentException("设å¤ç®¡çåæªé
ç½®"); |
| | | } |
| | | List<String> usernameList = Collections.singletonList(manager); |
| | | // String manager = Optional.ofNullable(iEamEquipmentService.getById(order.getEquipmentId())) |
| | | // .map(EamEquipment::getEquipmentManager) |
| | | // .orElse(null); |
| | | // if (manager == null) { |
| | | // throw new IllegalArgumentException("设å¤ç®¡çåæªé
ç½®"); |
| | | // } |
| | | // List<String> usernameList = Collections.singletonList(manager); |
| | | values.put("dataId", order.getId()); |
| | | values.put("organization", "ç¹æ£äººç¹æ£ç»æ"); |
| | | values.put("comment", "ç¹æ£äººç¹æ£ç»æ"); |
| | | values.put("NextAssignee", usernameList); |
| | | // values.put("NextAssignee", usernameList); |
| | | request.setComment("ç¹æ£äººç¹æ£ç»æ"); |
| | | } else { |
| | | // çç»é¿ç¡®è®¤ |
| | |
| | | case UNDER_MAINTENANCE: |
| | | //æ§è¡å®æ |
| | | //设å¤ç®¡çå确认 |
| | | String equipmentManager = equipment.getEquipmentManager(); |
| | | if(StringUtils.isBlank(equipmentManager)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | userApprovalList = Collections.singletonList(equipmentManager); |
| | | // String equipmentManager = equipment.getEquipmentManager(); |
| | | // if(StringUtils.isBlank(equipmentManager)) { |
| | | // throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | // } |
| | | // userApprovalList = Collections.singletonList(equipmentManager); |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization", "äºä¿æ§è¡ç»æ"); |
| | | values.put("comment", "äºä¿æ§è¡ç»æ"); |
| | | values.put("NextAssignee", userApprovalList); |
| | | // values.put("NextAssignee", userApprovalList); |
| | | request.setComment("äºä¿æ§è¡ç»æ"); |
| | | //设置entity |
| | | entity.setMaintenanceStatus(SecondMaintenanceStatusEnum.WAIT_CONFIRM.name()); |
| | |
| | | eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.SECOND_MAINTENANCE_WAIT_CONFIRM.name()); |
| | | break; |
| | | case WAIT_CONFIRM: |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(),null, BusinessCodeConst.PCR0003); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è½¦é´çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | variables.put("proofreading", true); |
| | | //å¹¶è¡ä»»å¡ä¼ç¾ |
| | | variables.put("maintenance_execution", Collections.singletonList(request.getOperator())); |
| | | variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | // variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | if (result != null) { |
| | | //æ´æ°è®¾å¤ä¿å
»ç¶æ |
| | |
| | | variables.put("proofreading", true); |
| | | //å¹¶è¡ä»»å¡ä¼ç¾ |
| | | variables.put("maintenance_execution", Collections.singletonList(request.getOperator())); |
| | | variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | // variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | if (result != null) { |
| | | //æ´æ°è®¾å¤ä¿å
»ç¶æ |
| | |
| | | if (equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¸åå¨ï¼æ·»å 失败ï¼"); |
| | | } |
| | | if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | // if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | // throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | // } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null || !BusinessCodeConst.PCR0001.equals(sysUser.getPost())) { |
| | | throw new JeecgBootException("䏿¯æä½å·¥ï¼æ æ³é¢åæ¤å·¥åï¼"); |
| | |
| | | variables.put("proofreading", true); |
| | | //å¹¶è¡ä»»å¡ä¼ç¾ |
| | | variables.put("maintenance_execution", Collections.singletonList(sysUser.getUsername())); |
| | | variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | // variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | if (result != null) { |
| | | //æ´æ°è®¾å¤ä¿å
»ç¶æ |
| | |
| | | case UNDER_MAINTENANCE: |
| | | boolean parallelCompletion = flowTaskService.checkParallelCompletion(flowMyBusiness.getTaskId()); |
| | | //æ§è¡å®æ |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0006); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0006); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è½¦é´çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | } |
| | | break; |
| | | case WAIT_CONFIRM: |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(),null, BusinessCodeConst.PCR0003); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è½¦é´çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | switch (status) { |
| | | case UNDER_MAINTENANCE: |
| | | //æ§è¡å®æ |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0003); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | |
| | | eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.WEEK_MAINTENANCE_WAIT_CONFIRM.name()); |
| | | break; |
| | | case WAIT_CONFIRM: |
| | | if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | // if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | // throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | // } |
| | | //çç»é¿ç¡®è®¤ |
| | | userApprovalList = new ArrayList<>(); |
| | | userApprovalList.add(equipment.getEquipmentManager()); |
| | | // userApprovalList.add(equipment.getEquipmentManager()); |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization", request.getConfirmComment()); |
| | | values.put("comment", request.getConfirmComment()); |
| | |
| | | } |
| | | break; |
| | | case WAIT_INITIAL_ACCEPTANCE: |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0005); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), null, BusinessCodeConst.PCR0005); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è®¾è½é¨ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.system.aspect; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.aspect.annotation.DictExt; |
| | | import org.jeecg.common.aspect.annotation.DictList; |
| | | import org.jeecg.common.aspect.annotation.FieldQuery; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * åå
¸åæ®µç¿»è¯æå¡ |
| | | * æ¯æåµå¥ç¿»è¯ |
| | | * @since 2020/5/27 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class DicAspectService { |
| | | @Autowired |
| | | private ISysDictService dictService; |
| | | |
| | | /** |
| | | * æ¬æ¹æ³é对åè¡¨æ°æ®è¿è¡å¨æåå
¸æ³¨å
¥ |
| | | * åå
¸æ³¨å
¥å®ç° éè¿å¯¹å®ä½ç±»æ·»å 注解@dict æ¥æ è¯éè¦çåå
¸å
容,åå
¸å为ååå
¸codeå³å¯ ï¼tableåå
¸ code table texté
å使ç¨ä¸åæ¥jeecgçç¨æ³ç¸å |
| | | * 示ä¾ä¸ºSysUser åæ®µä¸ºsex æ·»å äºæ³¨è§£@Dict(dicCode = "sex") ä¼å¨åå
¸æå¡ç«é©¬æ¥åºæ¥å¯¹åºçtext ç¶åå¨è¯·æ±listçæ¶åå°è¿ä¸ªåå
¸textï¼å·²å段åç§°å _dictTextå½¢å¼è¿åå°å端 |
| | | * ä¾è¾å
¥å½åè¿åå¼çå°±ä¼å¤åºä¸ä¸ªsex_dictTextåæ®µ |
| | | * { |
| | | * sex:1, |
| | | * sex_dictText:"ç·" |
| | | * } |
| | | * åç«¯ç´æ¥åå¼sext_dictTextå¨tableé颿 éåè¿è¡å端çåå
¸è½¬æ¢äº |
| | | * customRender:function (text) { |
| | | * if(text==1){ |
| | | * return "ç·"; |
| | | * }else if(text==2){ |
| | | * return "女"; |
| | | * }else{ |
| | | * return text; |
| | | * } |
| | | * } |
| | | * ç®åvueæ¯è¿ä¹è¿è¡åå
¸æ¸²æå°tableä¸çå¤äºå°±å¾éº»ç¦äº è¿ä¸ªç´æ¥å¨æå¡ç«¯æ¸²æå®æå端å¯ä»¥ç´æ¥ç¨ |
| | | * @param records |
| | | * @return |
| | | */ |
| | | public List<JSONObject> detailDict(List<Object> records){ |
| | | List<JSONObject> items = new ArrayList<>(); |
| | | FieldBatchQuery batchQuery = new FieldBatchQuery(); |
| | | boolean hasDict = false; |
| | | |
| | | for (Object record : records) { |
| | | JSONObject item = parseDictItem(record); |
| | | |
| | | Field[] fieldsArray = oConvertUtils.getAllFields(record); |
| | | for (int i = 0; i < fieldsArray.length; i++) { |
| | | Field field = fieldsArray[i]; |
| | | if (field.getAnnotation(Dict.class) != null && records.size()<=500) { |
| | | hasDict = true; |
| | | String code = field.getAnnotation(Dict.class).dicCode(); |
| | | String text = field.getAnnotation(Dict.class).dicText(); |
| | | String table = field.getAnnotation(Dict.class).dictTable(); |
| | | String key = String.valueOf(item.get(field.getName())); |
| | | |
| | | //ç¿»è¯åå
¸å¼å¯¹åºçtxt |
| | | String textValue = translateDictValue(code, text, table, key); |
| | | item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue); |
| | | } |
| | | // åå
¸ç¿»è¯æ©å±åè½ï¼æ¯æåå
¸å¤å段å¹é
|
| | | else if(field.getAnnotation(DictExt.class) != null && records.size() <= 500){ |
| | | hasDict = true; |
| | | String[] code = field.getAnnotation(DictExt.class).dicCode(); |
| | | String text = field.getAnnotation(DictExt.class).dicText(); |
| | | String table = field.getAnnotation(DictExt.class).dicTable(); |
| | | String[] params = field.getAnnotation(DictExt.class).dicParams(); |
| | | String[] paramValues = this.getParamValues(item, params); |
| | | |
| | | String textValue = this.translateDictValue(code, text, table, paramValues); |
| | | item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue); |
| | | item.put(field.getName(), ArrayUtil.join(paramValues, ",")); |
| | | } |
| | | else if(field.getAnnotation(FieldQuery.class) != null && records.size() <= 500){ |
| | | FieldQuery ann = field.getAnnotation(FieldQuery.class); |
| | | batchQuery.put(ann.dicTable(), ann.dicText(), ann.dicCode(), |
| | | this.getParamValues(item, ann.dicParams())); |
| | | } |
| | | // 深度翻è¯listå
ç´ |
| | | else if(field.getAnnotation(DictList.class) != null){ |
| | | Object fieldValue = ReflectUtil.getFieldValue(record, field); |
| | | if(fieldValue == null){ |
| | | // no-op |
| | | } |
| | | else if(null != fieldValue && fieldValue instanceof List){ |
| | | try{ |
| | | List<JSONObject> listDetail = this.detailDict((List)fieldValue); |
| | | item.put(field.getName(), listDetail); |
| | | }catch (Exception e){ |
| | | log.error("åæ®µç¿»è¯é误ï¼index=" + i + ",fieldName=" + field.getName() + ",fieldValue=" + fieldValue + ",record=" + record); |
| | | } |
| | | |
| | | }else{ |
| | | log.error("深度åå
¸ç¿»è¯åªæ¯æListç±»åï¼å½åç±»å为" + fieldValue.getClass()); |
| | | } |
| | | } |
| | | |
| | | //dateç±»åé»è®¤è½¬æ¢stringæ ¼å¼åæ¥æ |
| | | if (field.getType().getName().equals("java.util.Date")&&field.getAnnotation(JsonFormat.class)==null&&item.get(field.getName())!=null){ |
| | | SimpleDateFormat aDate=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | item.put(field.getName(), aDate.format(new Date((Long) item.get(field.getName())))); |
| | | } |
| | | |
| | | } |
| | | |
| | | if(records.size()>500 && hasDict){ |
| | | log.error("ä½¿ç¨ @Dict注解è¶
è¿500æ¡è®°å½è¯·ä½¿ç¨å页æ¥è¯¢"); |
| | | } |
| | | items.add(item); |
| | | } |
| | | |
| | | // æ¹éæ¥è¯¢å
³èæ°æ® |
| | | if(batchQuery.size() > 0){ |
| | | Map<String, List<Map>> batchResult = new HashMap<>(); |
| | | batchQuery.forEach((queryKey, queryParam) -> { |
| | | // æ¹éæ¥è¯¢ |
| | | try { |
| | | queryParam.setQueryResult(this.batchQueryFieldValue(queryParam.getQueryTable(), |
| | | queryParam.getColumns(), |
| | | queryParam.getParamName(), |
| | | queryParam.getParamValues())); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }); |
| | | |
| | | for (int i = 0; i < records.size(); i++) { |
| | | Object record = records.get(i); |
| | | JSONObject item = items.get(i); |
| | | |
| | | try { |
| | | this.fillItemValue(record, item, batchQuery); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.info("æ¹éæ¥è¯¢æ°æ®å¡«å
åºé:{}", e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return items; |
| | | } |
| | | |
| | | /** |
| | | * å表æ¹éæ¥è¯¢ |
| | | * |
| | | * @param queryTable |
| | | * @param columns |
| | | * @param paramName |
| | | * @param paramValues |
| | | * @return |
| | | */ |
| | | private List<Map> batchQueryFieldValue(String queryTable, String[] columns, |
| | | String paramName, String[] paramValues) throws Exception { |
| | | try{ |
| | | return this.dictService.queryTableFieldByParams(queryTable, columns, paramName, paramValues); |
| | | }catch (Exception e){ |
| | | log.error("FieldQueryæ¥è¯¢é误", e); |
| | | throw new Exception("FieldQueryæ¥è¯¢é误"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¡«å
itemæ¹éæ¥è¯¢æ°æ® |
| | | * @param record |
| | | * @param item |
| | | * @param batchQuery |
| | | */ |
| | | private void fillItemValue(Object record, JSONObject item, FieldBatchQuery batchQuery) throws Exception{ |
| | | |
| | | for (Field field : oConvertUtils.getAllFields(record)) { |
| | | if(field.getAnnotation(FieldQuery.class) != null){ |
| | | FieldQuery fieldQuery = field.getAnnotation(FieldQuery.class); |
| | | |
| | | String[] paramValues = this.getParamValues(item, fieldQuery.dicParams()); |
| | | Object textValue = batchQuery.findResult(fieldQuery.dicTable(), |
| | | fieldQuery.dicCode(), paramValues, fieldQuery.dicText()); |
| | | |
| | | item.put(field.getName() + CommonConstant.DICT_TEXT_SUFFIX, textValue); |
| | | item.put(field.getName(), ArrayUtil.join(paramValues, ",")); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è§£æåå
¸Item |
| | | * @param record |
| | | * @return |
| | | */ |
| | | private JSONObject parseDictItem(Object record) { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | String json="{}"; |
| | | try { |
| | | //è§£å³@JsonFormat注解解æä¸äºçé®é¢è¯¦è§SysAnnouncementç±»ç@JsonFormat |
| | | json = mapper.writeValueAsString(record); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("jsonè§£æå¤±è´¥"+e.getMessage(),e); |
| | | } |
| | | return JSONObject.parseObject(json); |
| | | } |
| | | |
| | | /** |
| | | * è·ååæ°æ°å¼ |
| | | * @param item |
| | | * @param paramNames |
| | | * @return |
| | | */ |
| | | private String[] getParamValues(JSONObject item, String[] paramNames) { |
| | | |
| | | // è·åå®é
åæ° |
| | | String[] values = new String[paramNames.length]; |
| | | for (int i = 0; i < paramNames.length; i++) { |
| | | String param = paramNames[i]; |
| | | |
| | | if(param.startsWith("$")){ |
| | | values[i] = (String) item.get(param.substring(1)); |
| | | }else{ |
| | | values[i] = param; |
| | | } |
| | | |
| | | if(values[i] == null) return null; |
| | | if(values[i].indexOf("&&") > -1){ |
| | | log.error(">>>åæ°["+values[i]+"]å
å«éæ³å符','"); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | return values; |
| | | } |
| | | |
| | | /** |
| | | * ç¿»è¯åå
¸ææ¬ |
| | | * |
| | | * @param code |
| | | * @param text |
| | | * @param table |
| | | * @param paramValues |
| | | * @return |
| | | */ |
| | | private String translateDictValue(String[] code, String text, String table, String[] paramValues) { |
| | | if(paramValues == null || paramValues.length <=0 || oConvertUtils.isEmpty(table)){ |
| | | return null; |
| | | } |
| | | |
| | | try{ |
| | | return this.dictService.queryTableDictByParams(table,text, |
| | | ArrayUtil.join(code, "&&"), |
| | | ArrayUtil.join(paramValues, "&&")); |
| | | }catch (Exception e){ |
| | | log.error("åå
¸ç¿»è¯å¼å¸¸table={},text={},code={},paramValues={}", table, text, ArrayUtil.join(code, "&&"),ArrayUtil.join(paramValues, "&&") ); |
| | | throw e; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ç¿»è¯åå
¸ææ¬ |
| | | * @param code |
| | | * @param text |
| | | * @param table |
| | | * @param key |
| | | * @return |
| | | */ |
| | | private String translateDictValue(String code, String text, String table, String key) { |
| | | if(oConvertUtils.isEmpty(key)) { |
| | | return null; |
| | | } |
| | | StringBuffer textValue=new StringBuffer(); |
| | | String[] keys = key.split(","); |
| | | for (String k : keys) { |
| | | String tmpValue = null; |
| | | if (k.trim().length() == 0) { |
| | | continue; //è·³è¿å¾ªç¯ |
| | | } |
| | | if (!StringUtils.isEmpty(table)){ |
| | | tmpValue= dictService.queryTableDictTextByKey(table,text,code,k.trim()); |
| | | }else { |
| | | tmpValue = dictService.queryDictTextByKey(code, k.trim()); |
| | | } |
| | | |
| | | if (tmpValue != null) { |
| | | if (!"".equals(textValue.toString())) { |
| | | textValue.append(","); |
| | | } |
| | | textValue.append(tmpValue); |
| | | } |
| | | |
| | | } |
| | | return textValue.toString(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.system.aspect; |
| | | |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | |
| | | import java.util.*; |
| | | import java.util.function.BiConsumer; |
| | | |
| | | /** |
| | | * æ¹éæ¥è¯¢å¨ |
| | | */ |
| | | public class FieldBatchQuery { |
| | | |
| | | // key=æ¥è¯¢è¦ç´ =table+paramNameï¼ value=æ¥è¯¢æ¡ä»¶ |
| | | private Map<String, QueryParam> queryBatch = new HashMap<>(); |
| | | |
| | | /** |
| | | * ä¾¿å©æ¥è¯¢è¦ç´ |
| | | * @param action |
| | | */ |
| | | public void forEach(BiConsumer<? super String, ? super QueryParam> action) { |
| | | this.queryBatch.forEach(action); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è¡¨æ°é |
| | | * @return |
| | | */ |
| | | public int size() { |
| | | return queryBatch.size(); |
| | | } |
| | | |
| | | /** |
| | | * æ¥æ¾æ¥è¯¢ç»æ |
| | | * @param tableName |
| | | * @param paramName |
| | | * @param paramValue |
| | | * @param column |
| | | * @return |
| | | */ |
| | | public Object findResult(String tableName, String[] paramName, String[] paramValue, String column) { |
| | | String queryKey = tableName + "()" + ArrayUtil.join(paramName, ","); |
| | | if(!this.queryBatch.containsKey(queryKey)) return null; |
| | | |
| | | return this.queryBatch.get(queryKey).findResult(paramValue, column); |
| | | } |
| | | |
| | | /** |
| | | * ä¿åæ¥è¯¢æ¡ä»¶ |
| | | * @param tableName æ¥è¯¢è¡¨å |
| | | * @param textName æ¥è¯¢å段åç§° |
| | | * @param paramName æ¥è¯¢åæ°åç§° |
| | | * @param paramValue æ¥è¯¢åæ°å¼ |
| | | */ |
| | | public void put(String tableName, String textName, String[] paramName, String[] paramValue) { |
| | | String queryKey = tableName + "()" + ArrayUtil.join(paramName, ","); |
| | | |
| | | QueryParam queryParams; |
| | | if(this.queryBatch.containsKey(queryKey)){ |
| | | queryParams = this.queryBatch.get(queryKey); |
| | | }else{ |
| | | queryParams = new QueryParam(tableName, paramName); |
| | | this.queryBatch.put(queryKey, queryParams); |
| | | } |
| | | |
| | | // æ·»å æ¥è¯¢ç»æcolumnåç§° |
| | | queryParams.addTextName(textName); |
| | | // æ·»å æ¥è¯¢åæ° |
| | | queryParams.addParamValue(paramValue); |
| | | } |
| | | |
| | | public static class QueryParam { |
| | | private String queryTable; |
| | | private Set<String> columns = new HashSet<>(); |
| | | private Set<String> paramValueSet = new HashSet<>(); |
| | | private String[] paramName; |
| | | private List<Map> queryResult = new ArrayList<>(); |
| | | private Map<String, Integer> resultIndex = new HashMap<>(); |
| | | |
| | | public QueryParam(String tableName, String[] column) { |
| | | this.queryTable = tableName; |
| | | this.paramName = column; |
| | | } |
| | | |
| | | public void addTextName(String textName) { |
| | | this.columns.add(textName); |
| | | } |
| | | |
| | | public void addParamValue(String[] paramValue) { |
| | | paramValueSet.add(ArrayUtil.join(paramValue, ",")); |
| | | } |
| | | |
| | | public String getQueryTable() { |
| | | return queryTable; |
| | | } |
| | | |
| | | public String[] getColumns() { |
| | | String[] ret = new String[this.columns.size()]; |
| | | this.columns.toArray(ret); |
| | | return ret; |
| | | } |
| | | |
| | | public String getParamName() { |
| | | return "concat(" + ArrayUtil.join(this.paramName, ",',',") + ")"; |
| | | } |
| | | |
| | | public String[] getParamValues() { |
| | | String[] ret = new String[this.paramValueSet.size()]; |
| | | this.paramValueSet.toArray(ret); |
| | | return ret; |
| | | } |
| | | |
| | | public void setQueryResult(List<Map> queryResult) { |
| | | this.queryResult = queryResult; |
| | | } |
| | | |
| | | public Object findResult(String[] paramValue, String column) { |
| | | if(paramValue == null) return null; |
| | | String value = ArrayUtil.join(paramValue, ","); |
| | | |
| | | if(this.resultIndex.containsKey(value)){ |
| | | return this.queryResult.get(this.resultIndex.get(value)).get(column); |
| | | } |
| | | |
| | | for (int i = 0; i < this.queryResult.size(); i++) { |
| | | Map<String, Object> map = queryResult.get(i); |
| | | if(value.equals(map.get("paramValue"))){ |
| | | this.resultIndex.put(value, i); |
| | | return map.get(column); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | |
| | | private String productionIds; |
| | | |
| | | /** |
| | | * eamä¸å¿åé
|
| | | */ |
| | | @Excel(name="eamä¸å¿åé
",width = 15,dictTable ="eam_base_factory",dicText = "factory_name",dicCode = "id") |
| | | @Dict(dictTable ="eam_base_factory",dicText = "factory_name",dicCode = "id") |
| | | private transient String eamFactoryIds; |
| | | |
| | | /** |
| | | * eam设å¤ç» |
| | | */ |
| | | private String eamEquipmentIds; |
| | | |
| | | /** |
| | | * è´è´£ç»´ä¿®é¨é¨çç» |
| | | */ |
| | | @Excel(name="è´è´£ç»´ä¿®é¨é¨çç»",width = 15,dictTable ="eam_base_repair_depart",dicText = "depart_name",dicCode = "id") |
| | |
| | | private String homePath; |
| | | // @Dict(dicCode = "id",dictTable = "mom_base_team",dicText = "name") |
| | | private String teamId; |
| | | // @Dict(dicCode = "id",dictTable = "mom_base_area",dicText = "name") |
| | | private String areaId; |
| | | |
| | | /** |
| | | * å¯ç 馿¬¡ä½¿ç¨æ è¯ 1æ¯ 0å¦ |
| | |
| | | * @since 2018-12-28 |
| | | */ |
| | | public interface SysDictMapper extends BaseMapper<SysDict> { |
| | | |
| | | |
| | | /** |
| | | * é夿£æ¥SQL |
| | | * @param duplicateCheckVo |
| | |
| | | * @return |
| | | */ |
| | | public List<DictModel> queryAllDepartBackDictModel(); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ææç¨æ· ä½ä¸ºåå
¸ä¿¡æ¯ username -->value,realname -->text |
| | | * @return |
| | | */ |
| | | public List<DictModel> queryAllUserBackDictModel(); |
| | | |
| | | |
| | | // /** |
| | | // * éè¿å
³é®åæ¥è¯¢åºåå
¸è¡¨ |
| | | // * @param table |
| | |
| | | */ |
| | | @Deprecated |
| | | List<DictModel> queryTableDictByKeysAndFilterSql(@Param("table") String table, @Param("text") String text, @Param("code") String code, @Param("filterSql") String filterSql, @Param("codeValues") List<String> codeValues); |
| | | |
| | | /** |
| | | * 使ç¨åSqlæ¥è¯¢åå
¸æ°æ® |
| | | * @param table |
| | | * @param text |
| | | * @param subSql |
| | | * @return |
| | | */ |
| | | String queryTableDictTextBySubSql(@Param("table") String table, @Param("text") String text, @Param("subSql") String subSql); |
| | | |
| | | |
| | | /** |
| | | * å表æ¹éæ¥è¯¢ |
| | | * @param queryTable |
| | | * @param columns |
| | | * @param paramName |
| | | * @param paramValues |
| | | * @return |
| | | */ |
| | | List<Map> queryTableFieldByParams(@Param("table") String queryTable, @Param("columns") String columns, @Param("paramName") String paramName, @Param("paramValues") String[] paramValues); |
| | | |
| | | } |
| | |
| | | |
| | | <!-- éè¿åå
¸codeè·ååå
¸æ°æ® --> |
| | | <select id="queryDictTextByKey" parameterType="String" resultType="String"> |
| | | select s.item_text from sys_dict_item s |
| | | select s.item_text from sys_dict_item s |
| | | where s.dict_id = (select id from sys_dict where dict_code = #{code}) |
| | | and s.item_value = #{key} |
| | | </select> |
| | |
| | | <select id="queryTableDictItemsByCode" parameterType="String" resultType="org.jeecg.common.system.vo.DictModel"> |
| | | select ${text} as "text",${code} as "value" from ${table} |
| | | </select> |
| | | |
| | | |
| | | <!--éè¿æ¥è¯¢æå®tableç text code è·ååå
¸ï¼æå®æ¥è¯¢æ¡ä»¶ï¼--> |
| | | <select id="queryTableDictItemsByCodeAndFilter" parameterType="String" resultType="org.jeecg.common.system.vo.DictModel"> |
| | | select ${text} as "text",${code} as "value" from ${table} |
| | |
| | | where ${filterSql} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!--éè¿æ¥è¯¢æå®tableç text code key è·ååå
¸å¼--> |
| | | <select id="queryTableDictTextByKey" parameterType="String" resultType="String"> |
| | | select ${text} as "text" from ${table} where ${code}= #{key} |
| | |
| | | <select id="duplicateCheckCountSql" resultType="Long" parameterType="org.jeecg.modules.system.model.DuplicateCheckVo"> |
| | | SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal} and id <> #{dataId} |
| | | </select> |
| | | |
| | | |
| | | <!-- é夿 ¡éª sqlè¯å¥ --> |
| | | <select id="duplicateCheckCountSqlNoDataId" resultType="Long" parameterType="org.jeecg.modules.system.model.DuplicateCheckVo"> |
| | | SELECT COUNT(*) FROM ${tableName} WHERE ${fieldName} = #{fieldVal} |
| | | </select> |
| | | |
| | | |
| | | <!-- æ¥è¯¢é¨é¨ä¿¡æ¯ ä½ä¸ºåå
¸æ°æ® --> |
| | | <select id="queryAllDepartBackDictModel" resultType="org.jeecg.common.system.vo.DictModel"> |
| | | select id as "value",depart_name as "text" from sys_depart where del_flag = '0' |
| | | </select> |
| | | |
| | | |
| | | <!-- æ¥è¯¢ç¨æ·ä¿¡æ¯ ä½ä¸ºåå
¸æ°æ® --> |
| | | <select id="queryAllUserBackDictModel" resultType="org.jeecg.common.system.vo.DictModel"> |
| | | select username as "value",realname as "text" from sys_user where del_flag = '0' |
| | | </select> |
| | | |
| | | |
| | | <!--éè¿æ¥è¯¢æå®tableç text code è·ååå
¸æ°æ®ï¼ä¸æ¯æå
³é®åæ¥è¯¢ |
| | | <select id="queryTableDictItems" parameterType="String" resultType="org.jeecg.common.system.vo.DictModel"> |
| | | select ${text} as "text",${code} as "value" from ${table} where ${text} like #{keyword} |
| | | </select> --> |
| | | |
| | | |
| | | <!-- æ ¹æ®è¡¨åãæ¾ç¤ºåæ®µåãåå¨å段åãç¶IDæ¥è¯¢æ --> |
| | | <select id="queryTreeList" parameterType="Object" resultType="org.jeecg.modules.system.model.TreeSelectModel"> |
| | | select ${text} as "title", |
| | |
| | | and ${filterSql} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryTableFieldByParams" resultType="java.util.Map"> |
| | | select ${columns},${paramName} as paramValue |
| | | from ${table} where ${paramName} in |
| | | <foreach item="key" collection="paramValues" open="(" separator="," close=")"> |
| | | #{key} |
| | | </foreach> |
| | | </select> |
| | | <select id="queryTableDictTextBySubSql" resultType="java.lang.String"> |
| | | select ${text} as "text" from ${table} where ${subSql} |
| | | </select> |
| | | </mapper> |
| | |
| | | */ |
| | | List<DictModel> loadDict(String dictCode, String keyword, Integer pageSize); |
| | | |
| | | String queryTableDictByParams(String table, String text, String codes, String params); |
| | | |
| | | /** |
| | | * å表æ¹éæ¥è¯¢ |
| | | * @param queryTable |
| | | * @param columns |
| | | * @param paramName |
| | | * @param paramValues |
| | | * @return |
| | | */ |
| | | List<Map> queryTableFieldByParams(String queryTable, String[] columns, String paramName, String[] paramValues); |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.system.service.impl; |
| | | |
| | | import cn.hutool.core.lang.Validator; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | log.debug("æ ç¼ådictTableListçæ¶åè°ç¨è¿éï¼"); |
| | | return sysDictMapper.queryTableDictItemsByCodeAndFilter(table,text,code,filterSql); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * éè¿æ¥è¯¢æå®tableç text code è·ååå
¸å¼text |
| | | * dictTableCacheéç¨redisç¼åæææ10åé |
| | |
| | | public List<DictModel> queryAllUserBackDictModel() { |
| | | return baseMapper.queryAllUserBackDictModel(); |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public List<DictModel> queryTableDictItems(String table, String text, String code, String keyword) { |
| | | // return baseMapper.queryTableDictItems(table, text, code, "%"+keyword+"%"); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Cacheable(value = CacheConstant.SYS_DICT_TABLE_CACHE) |
| | | public String queryTableDictByParams(String table, String text, String codes, String params) { |
| | | log.info("æ ç¼ådictTable queryTableDictByKeysçæ¶åè°ç¨è¿éï¼"); |
| | | String[] codeArr = codes.split("&&"); |
| | | String[] paramArr = params.split("&&"); |
| | | |
| | | String subSql = ""; |
| | | for (int i = 0; i < codeArr.length; i++) { |
| | | String column = codeArr[i]; |
| | | // é»è®¤åæ°ä¸ºç©ºå符串 |
| | | String param = paramArr.length > i ? paramArr[i] : ""; |
| | | if(column == null || ! Validator.isGeneral(column)){ |
| | | log.error("<<<鿳忮µ:" + column); |
| | | return null; |
| | | } |
| | | if(null == param || (!"-1".equals(param) && ! Validator.isGeneralWithChinese(param.replaceAll(" ", "")))){ |
| | | log.error("<<<鿳忰:" + param); |
| | | return null; |
| | | } |
| | | |
| | | if(i != 0) subSql += " and "; |
| | | subSql += column+" = '"+param+"'"; |
| | | } |
| | | return sysDictMapper.queryTableDictTextBySubSql(table,text,subSql); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map> queryTableFieldByParams(String queryTable, String[] columns, String paramName, String[] paramValues) { |
| | | String column = ArrayUtil.join(columns, ","); |
| | | return this.baseMapper.queryTableFieldByParams(queryTable, column, paramName, paramValues); |
| | | } |
| | | } |