Merge remote-tracking branch 'origin/master'
已重命名3个文件
已添加34个文件
已修改87个文件
已删除1个文件
| | |
| | | .groupName("eam"); |
| | | } |
| | | |
| | | @Bean(value = "defaultApiBoard") |
| | | public Docket activitiApiBoard() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | //æ¤å
è·¯å¾ä¸çç±»ï¼æçææ¥å£ææ¡£ |
| | | .apis(RequestHandlerSelectors.basePackage("org.jeecg.modules.board")) |
| | | //å äºApiOperation注解çç±»ï¼æçææ¥å£ææ¡£ |
| | | .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)) |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) |
| | | .paths(PathSelectors.any()) |
| | | .build() |
| | | .securitySchemes(Collections.singletonList(securityScheme())) |
| | | .securityContexts(securityContexts()) |
| | | .globalOperationParameters(setHeaderToken()) |
| | | .groupName("æ°ååªççæ¿"); |
| | | } |
| | | |
| | | /*** |
| | | * oauth2é
ç½® |
| | | * éè¦å¢å swaggerææåè°å°å |
| | |
| | | <artifactId>fastutil</artifactId> |
| | | <version>8.5.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.jeecgframework.boot</groupId> |
| | | <artifactId>lxzn-module-tms</artifactId> |
| | | <version>3.4.3</version> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.constant; |
| | | |
| | | public enum DncPassLogPassType { |
| | | //NCæä»¶ |
| | | DOCUMENT("01", "ncæä»¶"), |
| | | //ncæä»¶ |
| | | NCFILE("02", "NCæä»¶"), |
| | | //产åç»ææ |
| | | PRODUCTSTRUCTURE("03", "产åç»ææ "), |
| | | //ç¨åºå 工确认表 |
| | | PROGRAMPROCESSING("04", "ç¨åºå 工确认表"); |
| | | |
| | | private String code; |
| | | private String name; |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | DncPassLogPassType() { |
| | | } |
| | | |
| | | DncPassLogPassType(String code, String name) { |
| | | this.code = code; |
| | | this.name = name; |
| | | } |
| | | } |
| | |
| | | return service.extractAndSaveFromContent(docId,attributionId,attributionType); |
| | | } |
| | | |
| | | /** |
| | | * åéåå
·ç³»ç» |
| | | * @param docId ææ¡£Id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "åå
·ä¿¡æ¯-åéåå
·ç³»ç»") |
| | | @ApiOperation(value = "åå
·ä¿¡æ¯-åéåå
·ç³»ç»", notes = "åå
·ä¿¡æ¯-åéåå
·ç³»ç»") |
| | | @GetMapping("/sendCutterInfo/{docId}/{attributionType}/{attributionId}") |
| | | public Result<?> sendCutterInfo(@PathVariable("docId") String docId |
| | | ,@PathVariable("attributionType") Integer attributionType |
| | | ,@PathVariable("attributionId") String attributionId) { |
| | | return service.sendToCutterSystem(docId,attributionId,attributionType); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | import lombok.Data; |
| | | import org.jeecg.modules.dnc.entity.ComponentInfo; |
| | | import org.jeecg.modules.dnc.entity.ProductInfo; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | | public class ComponentHierarchy { |
| | | private ProductInfo rootProduct; |
| | | private final List<ComponentInfo> components = new ArrayList<>(); // 仿 ¹é¨ä»¶å°åºå±é¨ä»¶çé¡ºåº |
| | | |
| | | public void addComponentToTop(ComponentInfo component) { |
| | | components.add(0, component); |
| | | } |
| | | |
| | | public List<ComponentInfo> getComponentsFromTop() { |
| | | return new ArrayList<>(components); |
| | | } |
| | | |
| | | public ComponentInfo getLeafComponent() { |
| | | return components.isEmpty() ? null : components.get(components.size() - 1); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonCreator; |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | |
| | | import java.util.List; |
| | | /** |
| | | * @Description: æ¶å¯ç½åæ¥å·¥æ§ç½éè¦çæ°æ® |
| | | * @Author: lyh |
| | | * @Date: 2025-06-13 |
| | | * @Version: V1.0 |
| | | * @remark: åç»éè¦å¢å ï¼æ·»å 对åºåæ°ä¸ç»ææ°æ®ï¼éç¨JSONåºååä¸ååºååè¿è¡ä¼ è¾ï¼æ¹ä¾¿ä¼ è¾ï¼å 坿ä½ï¼é¿å
æ°æ®æ±¡æï¼ |
| | | */ |
| | | @Data |
| | | @Builder |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | | public class ProcessTraceChain { |
| | | /**ç¨åºå 工确认表*/ |
| | | private GuideCardBatch guideCardBatch; |
| | | /**åå
·å表*/ |
| | | private List<Cutter> cutterList; |
| | | /**æä»¶*/ |
| | | private DocFile docFile; |
| | | /**è®¾å¤ææ¡£å¯¹åºå
³ç³»*/ |
| | | private DocRelative docRelative; |
| | | /**ææ¡£*/ |
| | | private DocInfo docInfo; |
| | | /**设å¤ç±»*/ |
| | | private DeviceType deviceType; |
| | | /**设å¤ç±»å¯¹åºå
³ç³»*/ |
| | | private DeviceManagement deviceManagement; |
| | | /**å·¥æ¥*/ |
| | | private WorkStep workStep; |
| | | /**å·¥åº*/ |
| | | private ProcessStream process; |
| | | /**å·¥èºè§ç¨çæ¬*/ |
| | | private ProcessSpecVersion processSpec; |
| | | /**é¶ä»¶*/ |
| | | private PartsInfo parts; |
| | | /**é¨ä»¶*/ |
| | | private ComponentHierarchy componentHierarchy; |
| | | /**产å*/ |
| | | private ProductInfo product; |
| | | /**äº§åæ è·¯å¾*/ |
| | | private List<ProductMix> treePath; |
| | | /**æé表*/ |
| | | private List<PermissionStreamNew> permissionStreamNewList; |
| | | @JsonCreator |
| | | public ProcessTraceChain( |
| | | @JsonProperty("guideCardBatch") GuideCardBatch guideCardBatch, |
| | | @JsonProperty("cutterList") List<Cutter> cutterList, |
| | | @JsonProperty("docFile") DocFile docFile, |
| | | @JsonProperty("docRelative") DocRelative docRelative, |
| | | @JsonProperty("docInfo") DocInfo docInfo, |
| | | @JsonProperty("deviceType") DeviceType deviceType, |
| | | @JsonProperty("deviceManagement") DeviceManagement deviceManagement, |
| | | @JsonProperty("workStep") WorkStep workStep, |
| | | @JsonProperty("process") ProcessStream process, |
| | | @JsonProperty("processSpec") ProcessSpecVersion processSpec, |
| | | @JsonProperty("parts") PartsInfo parts, |
| | | @JsonProperty("componentHierarchy") ComponentHierarchy componentHierarchy, |
| | | @JsonProperty("product") ProductInfo product, |
| | | @JsonProperty("treePath") List<ProductMix> treePath, |
| | | @JsonProperty("permissionStreamNewList") List<PermissionStreamNew> permissionStreamNewList |
| | | ) { |
| | | this.guideCardBatch = guideCardBatch; |
| | | this.cutterList = cutterList; |
| | | this.docFile = docFile; |
| | | this.docRelative = docRelative; |
| | | this.docInfo = docInfo; |
| | | this.deviceType = deviceType; |
| | | this.deviceManagement = deviceManagement; |
| | | this.workStep = workStep; |
| | | this.process = process; |
| | | this.processSpec = processSpec; |
| | | this.parts = parts; |
| | | this.componentHierarchy = componentHierarchy; |
| | | this.product = product; |
| | | this.treePath = treePath; |
| | | this.permissionStreamNewList = permissionStreamNewList; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonCreator; |
| | | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import org.jeecg.modules.dnc.entity.DocRelative; |
| | | |
| | | @Data |
| | | @Builder |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | @JsonIgnoreProperties(ignoreUnknown = true) |
| | | public class TransferPackage { |
| | | public enum DataType { PROCESS, WORKSTEP } |
| | | |
| | | private final DataType dataType; |
| | | private final DocRelative docRelative; |
| | | private final ProcessTraceChain traceChain; |
| | | |
| | | @JsonCreator |
| | | public TransferPackage( |
| | | @JsonProperty("dataType") DataType dataType, |
| | | @JsonProperty("docRelative") DocRelative docRelative, |
| | | @JsonProperty("traceChain") ProcessTraceChain traceChain |
| | | ) { |
| | | this.dataType = dataType; |
| | | this.docRelative = docRelative; |
| | | this.traceChain = traceChain; |
| | | } |
| | | } |
| | |
| | | //æå±èç¹ä»£å· |
| | | @TableField(exist = false) |
| | | private String nodeCode; |
| | | //æå±èç¹id |
| | | @TableField(exist = false) |
| | | private String nodeId; |
| | | //设å¤ç±»åç§° |
| | | @TableField(exist = false) |
| | | private String deviceName; |
| | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Getter |
| | | @Data |
| | | @NoArgsConstructor |
| | | @TableName(value = "nc_product_mix") |
| | |
| | | private Long parentId; |
| | | // åç§° |
| | | @TableField(value = "tree_name") |
| | | private String name; |
| | | private String treeName; |
| | | // code |
| | | @TableField(value = "tree_code") |
| | | private String code; |
| | | private String treeCode; |
| | | // ç±»å |
| | | @TableField(value = "tree_type") |
| | | private Integer type; |
| | | private Integer treeType; |
| | | @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
| | | @TableField(value = "create_time") |
| | | private Date createTime; |
| | |
| | | //å±ç¤ºåç§° |
| | | private transient String label; |
| | | |
| | | //ç±»åæ¹ä¾¿å端å±ç¤º |
| | | private transient Integer type; |
| | | |
| | | |
| | | private transient List<ProductMix> children = new ArrayList<>(); |
| | | |
| | | public ProductMix(Long id, Long parentId, String name, String code, Integer type, Date createTime) { |
| | | public ProductMix(Long id, Long parentId, String treeName, String treeCode, Integer type, Date createTime) { |
| | | this.id = id; |
| | | this.parentId = parentId; |
| | | this.name = name; |
| | | this.code = code; |
| | | this.treeName = treeName; |
| | | this.treeCode = treeCode; |
| | | this.type = type; |
| | | this.children = new ArrayList<>(); |
| | | this.label="["+code+"]"+name; |
| | | this.label="["+treeCode+"]"+treeName; |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | |
| | | private Integer fileAddOrDelete; |
| | | /*æä»¶å¤§å°*/ |
| | | private String fileSize; |
| | | /*äº§åæ·»å æ§è¡è¯å¥*/ |
| | | private String productAddSql; |
| | | /*é¨ä»¶æ·»å æ§è¡è¯å¥*/ |
| | | private String componentAddSql; |
| | | /*é¶ä»¶æ·»å æ§è¡è¯å¥*/ |
| | | private String partAddSql; |
| | | /*å·¥èºè§ç¨çæ¬æ·»å æ§è¡è¯å¥*/ |
| | | private String processVersionAddSql; |
| | | /*å·¥åºçæ¬æ·»å æ§è¡è¯å¥*/ |
| | | private String processAddSql; |
| | | /*å·¥æ¥çæ¬æ·»å æ§è¡è¯å¥*/ |
| | | private String processStepAddSql; |
| | | |
| | | @Override |
| | | public String toString() { |
| | |
| | | package org.jeecg.modules.dnc.listener; |
| | | |
| | | import org.apache.commons.io.monitor.FileAlterationListener; |
| | | import org.apache.commons.io.monitor.FileAlterationObserver; |
| | | import org.jeecg.common.util.FileUtil; |
| | | import org.jeecg.modules.dnc.service.IDocInfoService; |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | import org.jeecg.modules.message.enums.DeployEnum; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | |
| | | @Component |
| | | public class FileListener implements FileAlterationListener { |
| | | private static final Logger log = LoggerFactory.getLogger(FileListener.class); |
| | | |
| | | @Value("${deploy.deployType}") |
| | | private String deployType; //å·¥æ§ç½/æ¶å¯ç½é¨ç½² 0为工æ§ç½ 1为æ¶å¯ç½ |
| | | |
| | | @Autowired |
| | | private IDocInfoService docInfoService; // ææ¡£æå¡ |
| | | |
| | | @Override |
| | | public void onStart(FileAlterationObserver observer) { |
| | | log.info("å¼å§çå¬ç®å½: {}", observer.getDirectory().getAbsolutePath()); |
| | | // log.info("å¼å§çå¬ç®å½: {}", observer.getDirectory().getAbsolutePath()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public void onFileCreate(File file) { |
| | | String filePath = file.getAbsolutePath(); |
| | | log.info("[æ°å»º]: {}", filePath); |
| | | if (DeployEnum.GW.getCode().equals(deployType)) { |
| | | //å·¥æ§ç½è§£ææ¶å¯ç½ä¼ è¿æ¥çNCæä»¶ä¸ncæä»¶è¿è¡è§£æ |
| | | if (filePath.startsWith("D:\\hy_test\\ncFile")) { |
| | | handleIndustrialDocFile(file); |
| | | } |
| | | }else { |
| | | //æ¶å¯ç½è§£æå·¥æ§ç½ä¼ è¿æ¥çNCæä»¶ä¸ncæä»¶è¿è¡è§£æï¼ç¨åºåä¼ ï¼ |
| | | if (filePath.startsWith("D:\\hy_test\\ncFile")) { |
| | | handleSecretDocFile(file); |
| | | } |
| | | } |
| | | } |
| | | @Override |
| | | public void onFileChange(File file) { |
| | |
| | | |
| | | @Override |
| | | public void onStop(FileAlterationObserver observer) { |
| | | log.info("ç»æçå¬ç®å½: {}", observer.getDirectory().getAbsolutePath()); |
| | | // log.info("ç»æçå¬ç®å½: {}", observer.getDirectory().getAbsolutePath()); |
| | | } |
| | | |
| | | /** |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import org.jeecg.modules.dnc.dto.ComponentExt; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.dnc.dto.ComponentExt; |
| | | import org.jeecg.modules.dnc.entity.ComponentInfo; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<ComponentExt> getByParentIdAndUserPerms(@Param("parentId") String parentId, @Param("userId") String userId); |
| | | |
| | | @Select("SELECT * FROM nc_component_info WHERE component_id = #{componentId}") |
| | | ComponentInfo selectById(@Param("componentId") String componentId); |
| | | |
| | | // é彿¥è¯¢é¨ä»¶å±çº§ç»æ |
| | | List<ComponentInfo> findComponentHierarchy(@Param("componentId") String componentId); |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.PartsInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.dnc.entity.PartsInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<PartsInfo> getByUserPerms(@Param("userId") String userId); |
| | | |
| | | @Select("SELECT * FROM nc_parts_info WHERE parts_id = #{partsId}") |
| | | PartsInfo selectById(@Param("partsId") String partsId); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.dnc.entity.ProcessSpecVersion; |
| | | import org.jeecg.modules.dnc.entity.WorkStep; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<ProcessSpecVersion> getByUserPerms(String userId); |
| | | |
| | | @Select("SELECT * FROM nc_process_spec_version WHERE id = #{id}") |
| | | ProcessSpecVersion selectById(@Param("id") String id); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.dnc.entity.ProcessStream; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<ProcessStream> findByPartsAndComponents(String productId, List<String> componentIds, List<String> partsIds); |
| | | |
| | | @Select("SELECT * FROM nc_process_stream WHERE process_id = #{processId}") |
| | | ProcessStream selectById(@Param("processId") String processId); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.ProductInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.dnc.entity.ProductInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | List<ProductInfo> getByUserPerms(@Param("userId") String userId); |
| | | |
| | | @Select("SELECT * FROM nc_product_info WHERE product_id = #{productId}") |
| | | ProductInfo selectById(@Param("productId") String productId); |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | |
| | | public interface ProductMixMapper extends BaseMapper<ProductMix> { |
| | | |
| | | @Select("SELECT * FROM nc_product_mix WHERE id = #{productId} AND tree_type = 1") |
| | | ProductMix findByProductId(@Param("productId") String productId); |
| | | |
| | | @Select("SELECT * FROM nc_product_mix WHERE id = #{componentId} AND tree_type = 2") |
| | | ProductMix findByComponentId(@Param("componentId") String componentId); |
| | | |
| | | @Select("SELECT * FROM nc_product_mix WHERE id = #{partsId} AND tree_type = 3") |
| | | ProductMix findByPartsId(@Param("partsId") String partsId); |
| | | |
| | | @Select("SELECT * FROM nc_product_mix WHERE id = #{operationId} AND tree_type = 4") |
| | | ProductMix findByOperationId(@Param("operationId") String operationId); |
| | | |
| | | @Select("SELECT * FROM nc_product_mix WHERE id = #{processId} AND tree_type = 5") |
| | | ProductMix findByProcessId(@Param("operationId") String processId); |
| | | |
| | | @Select("SELECT * FROM nc_product_mix WHERE id = #{worksiteId} AND tree_type = 6") |
| | | ProductMix findByWorksiteId(@Param("operationId") String worksiteId); |
| | | |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.dnc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.dnc.entity.SynchronizedFlag; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.dnc.entity.WorkStep; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | List<WorkStep> getByUserPerms(String userId); |
| | | |
| | | @Select("SELECT * FROM nc_work_step WHERE id = #{workStepId}") |
| | | WorkStep selectById(@Param("workStepId") String workStepId); |
| | | |
| | | @Select("SELECT * FROM nc_work_step WHERE process_id = #{processId}") |
| | | List<WorkStep> selectByProcessId(@Param("processId") String processId); |
| | | } |
| | |
| | | on comp.component_id=s.component_id |
| | | where delete_flag = 0 and parent_id=#{parentId} |
| | | </select> |
| | | <select id="findComponentHierarchy" resultType="org.jeecg.modules.dnc.entity.ComponentInfo"> |
| | | WITH component_tree AS ( |
| | | SELECT |
| | | *, |
| | | 0 AS LEVEL |
| | | FROM |
| | | nc_component_info |
| | | WHERE |
| | | component_id = #{componentId} UNION ALL |
| | | SELECT |
| | | c.*, |
| | | ct.level + 1 |
| | | FROM |
| | | nc_component_info c |
| | | INNER JOIN component_tree ct ON c.component_id = ct.parent_id |
| | | ) SELECT |
| | | * |
| | | FROM |
| | | component_tree |
| | | ORDER BY |
| | | LEVEL ASC |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="loadProductMix" resultType="org.jeecg.modules.dnc.entity.ProductMix"> |
| | | SELECT DISTINCT |
| | | mix.id, |
| | | mix.tree_code 'code', |
| | | mix.tree_name 'name', |
| | | mix.tree_code, |
| | | mix.tree_name, |
| | | mix.parent_id, |
| | | mix.tree_type AS 'type', |
| | | mix.extend, |
| | |
| | | </select> |
| | | <select id="loadProductMixAll" resultType="org.jeecg.modules.dnc.entity.ProductMix"> |
| | | SELECT DISTINCT mix.id, |
| | | mix.tree_code 'code', |
| | | mix.tree_name 'name', |
| | | mix.tree_code, |
| | | mix.tree_name , |
| | | mix.parent_id, |
| | | mix.tree_type AS 'type', |
| | | mix.extend, |
| | |
| | | ) |
| | | SELECT DISTINCT |
| | | mix.id, |
| | | mix.tree_code 'code', |
| | | mix.tree_name 'name', |
| | | mix.tree_code, |
| | | mix.tree_name, |
| | | mix.parent_id, |
| | | mix.tree_type AS 'type', |
| | | mix.extend, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | |
| | | // æ°æ®å°è£
çç¥æ¥å£ |
| | | public interface DataPackageStrategy { |
| | | /** |
| | | * å°è£
ä¸å¡æ°æ®ä¸ºä¼ è¾å
|
| | | * @param id ä¸å¡å®ä½IDï¼å·¥åºIDæå·¥æ¥IDï¼ |
| | | * @return å°è£
好çä¼ è¾å
|
| | | */ |
| | | TransferPackage packageData(String id); |
| | | } |
| | |
| | | */ |
| | | Result<?> extractAndSaveFromContent(String docId,String attributionId,Integer attributionType); |
| | | |
| | | |
| | | /** |
| | | * åéåå
·å表å°åå
·ç³»ç» |
| | | * @param docId |
| | | */ |
| | | Result<?> sendToCutterSystem(String docId,String attributionId,Integer attributionType); |
| | | } |
| | |
| | | |
| | | /** |
| | | * è·åå
·ä½å±çº§å®ä½ |
| | | * @param id,type |
| | | * @param id,treeType |
| | | * @return |
| | | */ |
| | | Result<?> getTreeById(String id, Integer type); |
| | |
| | | package org.jeecg.modules.dnc.service; |
| | | |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.ProductMix; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface IProductMixService extends IService<ProductMix> { |
| | | |
| | | //è·åå°è£
产åç»ææ |
| | | public List<ProductMix> getTree(); |
| | | List<ProductMix> getTree(); |
| | | |
| | | //模æçæäº§åç»ææ |
| | | /** |
| | | * æ¥è¯¢å¯¹åºidçææç¶çº§(æéåé
使ç¨) |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<ProductMix> getParentList(String id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å¯¹åºidçææåèç¹(æéåé
使ç¨) |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<ProductMix> getChildrenList(String id); |
| | | |
| | | } |
| | |
| | | boolean b = super.updateById(componentInfo); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(componentInfo.getComponentName()); |
| | | productMix.setCode(componentInfo.getComponentCode()); |
| | | productMix.setTreeName(componentInfo.getComponentName()); |
| | | productMix.setTreeCode(componentInfo.getComponentCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | return false; |
| | |
| | | import org.jeecg.modules.dnc.entity.Cutter; |
| | | import org.jeecg.modules.dnc.entity.DocFile; |
| | | import org.jeecg.modules.dnc.entity.DocInfo; |
| | | import org.jeecg.modules.dnc.entity.GuideCardBatch; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.mapper.CutterMapper; |
| | | import org.jeecg.modules.dnc.response.CommonCode; |
| | | import org.jeecg.modules.dnc.service.ICutterService; |
| | | import org.jeecg.modules.dnc.service.IDocFileService; |
| | | import org.jeecg.modules.dnc.service.IDocInfoService; |
| | | import org.jeecg.modules.dnc.service.IGuideCardBatchService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.jeecg.modules.tms.entity.PreparationOrderDetail; |
| | | import org.jeecg.modules.tms.entity.dto.PreparationOrderAndDetailDto; |
| | | import org.jeecg.modules.tms.service.IPreparationOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private IDocFileService docFileService; |
| | | |
| | | @Autowired |
| | | private ISysDictService sysDictService; |
| | | private IGuideCardBatchService guideCardBatchService; |
| | | |
| | | @Autowired |
| | | private IPreparationOrderService preparationOrderService; |
| | | /** |
| | | * æ°å¢åå
·ä¿¡æ¯ |
| | | * @param cutter |
| | |
| | | return Result.error("æªåç°åå
·çåæ°ä¿¡æ¯æ³¨éï¼æ æ³æååå
·ä¿¡æ¯"); |
| | | } |
| | | this.saveBatch(newCutterList); |
| | | //TODOåéåå
·ç®¡çæ°æ® |
| | | return Result.OK("æååå
·ä¿¡æ¯æå"); |
| | | }else { |
| | | return Result.error("æªåç°åå
·çåæ°ä¿¡æ¯æ³¨éï¼æ æ³æååå
·ä¿¡æ¯"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Result<?> sendToCutterSystem(String docId,String attributionId,Integer attributionType){ |
| | | List<Cutter> cutterList = this.list(new QueryWrapper<Cutter>() |
| | | .eq("doc_id", docId) |
| | | .eq(StrUtil.isNotEmpty(attributionId),"attribution_id",attributionId) |
| | | .eq("attribution_type",attributionType)); |
| | | if (cutterList == null || cutterList.isEmpty()) { |
| | | return Result.error("æªåç°åå
·ä¿¡æ¯ï¼æ æ³åéå°åå
·ç³»ç»"); |
| | | } |
| | | if (cutterList.stream().anyMatch(item -> item.getCutterCode() == null)) { |
| | | return Result.error("æªåç°åå
·ç¼å·ä¿¡æ¯ï¼æ æ³åéå°åå
·ç³»ç»"); |
| | | } |
| | | //è·åææ°æ°æ§ç¨åºå 工确认表 |
| | | List<GuideCardBatch> guideCardBatchList = guideCardBatchService.list(new QueryWrapper<GuideCardBatch>() |
| | | .eq("doc_id", docId) |
| | | .isNotNull("serial_number") |
| | | .orderByDesc("SUBSTRING(serial_number, LEN(serial_number)-3, 4)")); |
| | | if (guideCardBatchList == null || guideCardBatchList.isEmpty()) { |
| | | return Result.error("æªåç°ç¨åºå 工确认表信æ¯ï¼æ æ³åéå°åå
·ç³»ç»"); |
| | | } |
| | | GuideCardBatch guideCardBatch = guideCardBatchList.get(0); |
| | | PreparationOrderAndDetailDto dto = new PreparationOrderAndDetailDto(); |
| | | dto.setPartDrawingNo(guideCardBatch.getPartsCode()); |
| | | dto.setPartName(guideCardBatch.getPartsName()); |
| | | dto.setPartMaterial(guideCardBatch.getMaterielDesp()); |
| | | dto.setProductionProcessesNo(guideCardBatch.getProcessWorkCode()); |
| | | dto.setBatchCode(guideCardBatch.getProcessingBatch()); |
| | | dto.setMachiningCount(guideCardBatch.getProcessingQuantity()); |
| | | dto.setEquipmentCode(guideCardBatch.getProcessingEquipment()); |
| | | dto.setNcName(guideCardBatch.getDocName()); |
| | | List<PreparationOrderDetail> detailList = new ArrayList<>(); |
| | | cutterList.forEach(item -> { |
| | | PreparationOrderDetail detail = new PreparationOrderDetail(); |
| | | detail.setToolCode(item.getCutterCode()); |
| | | detail.setToolId(item.getToolsId()); |
| | | detailList.add(detail); |
| | | }); |
| | | dto.setPreparationOrderDetailList(detailList); |
| | | preparationOrderService.addPreparationOrderFromDnc(dto); |
| | | return Result.OK("åéå°åå
·ç³»ç»æå"); |
| | | } |
| | | |
| | | public List<Cutter> extractToolAfterM6(DocInfo docInfo, List<String> ncLines) { |
| | | List<Cutter> cutterList = new ArrayList<>(); |
| | | String currentToolCode = null; // ç¨äºè¿½è¸ªå½åæ¢åæä»¤çåå
·å· |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.jeecg.weibo.exception.BusinessException; |
| | | import org.jeecg.modules.dnc.dto.ComponentHierarchy; |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.mapper.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.dao.DataIntegrityViolationException; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class DataImportService { |
| | | private static final Logger logger = LoggerFactory.getLogger(DataImportService.class); |
| | | |
| | | @Autowired |
| | | private ProductInfoMapper productMapper; |
| | | |
| | | @Autowired |
| | | private ComponentInfoMapper componentMapper; |
| | | |
| | | @Autowired |
| | | private PartsInfoMapper partsMapper; |
| | | |
| | | @Autowired |
| | | private ProcessSpecVersionMapper psvMapper; |
| | | |
| | | @Autowired |
| | | private ProcessStreamMapper processMapper; |
| | | |
| | | @Autowired |
| | | private WorkStepMapper workStepMapper; |
| | | |
| | | @Autowired |
| | | private ProductMixMapper productMixMapper; |
| | | |
| | | @Autowired |
| | | private PermissionStreamNewMapper permissionStreamNewMapper; |
| | | |
| | | @Autowired |
| | | private DeviceManagementMapper deviceManagementMapper; |
| | | |
| | | @Autowired |
| | | private DeviceTypeMapper deviceTypeMapper; |
| | | |
| | | @Autowired |
| | | private DocInfoMapper docInfoMapper; |
| | | |
| | | @Autowired |
| | | private DocFileMapper docFileMapper; |
| | | |
| | | @Autowired |
| | | private DocRelativeMapper docRelativeMapper; |
| | | |
| | | @Autowired |
| | | private CutterMapper cutterMapper; |
| | | |
| | | @Autowired |
| | | private GuideCardBatchMapper guideCardBatchMapper; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | private IMdcProductionService mdcProductionService; |
| | | |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | |
| | | @Autowired |
| | | private IProductDepartmentService productDepartmentService; |
| | | |
| | | @Autowired |
| | | private IComponentPermissionService componentPermissionService; |
| | | |
| | | @Autowired |
| | | private IComponentDepartmentService componentDepartmentService; |
| | | |
| | | @Autowired |
| | | private IPartsPermissionService partsPermissionService; |
| | | |
| | | @Autowired |
| | | private IPartsDepartmentService partsDepartmentService; |
| | | |
| | | @Autowired |
| | | private IProcessSpecVersionPermissionService processSpecVersionPermissionService; |
| | | |
| | | @Autowired |
| | | private IProcessSpecVersionDepartmentService processSpecVersionDepartmentService; |
| | | |
| | | @Autowired |
| | | private IProcessStreamPermissionService processStreamPermissionService; |
| | | |
| | | @Autowired |
| | | private IProcessionDepartmentService processionDepartmentService; |
| | | |
| | | @Autowired |
| | | private IWorkStepPermissionService workStepPermissionService; |
| | | |
| | | @Autowired |
| | | private IWorkStepDepartmentService workStepDepartmentService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void importTransferPackage(TransferPackage transferPackage) { |
| | | try { |
| | | logger.info("å¼å§å¯¼å
¥ä¼ è¾å
æ°æ®, ç±»å: {}", transferPackage.getDataType()); |
| | | |
| | | // ä¿å产å |
| | | if (transferPackage.getTraceChain() != null && |
| | | transferPackage.getTraceChain().getProduct() != null) { |
| | | saveProduct(transferPackage.getTraceChain().getProduct()); |
| | | } |
| | | |
| | | // ä¿åé¨ä»¶å±çº§ |
| | | if (transferPackage.getTraceChain() != null && |
| | | transferPackage.getTraceChain().getComponentHierarchy() != null) { |
| | | saveComponentHierarchy(transferPackage.getTraceChain().getComponentHierarchy()); |
| | | } |
| | | |
| | | // ä¿åé¶ä»¶ |
| | | if (transferPackage.getTraceChain() != null && |
| | | transferPackage.getTraceChain().getParts() != null) { |
| | | saveParts(transferPackage.getTraceChain().getParts()); |
| | | } |
| | | |
| | | // ä¿åå·¥èºè§ç¨ |
| | | if (transferPackage.getTraceChain() != null && |
| | | transferPackage.getTraceChain().getProcessSpec() != null) { |
| | | saveProcessSpec(transferPackage.getTraceChain().getProcessSpec()); |
| | | } |
| | | |
| | | // ä¿åå·¥åº |
| | | if (transferPackage.getTraceChain() != null&& |
| | | transferPackage.getTraceChain().getProcess() != null) { |
| | | saveProcess(transferPackage.getTraceChain().getProcess()); |
| | | } |
| | | |
| | | // ä¿åå·¥æ¥ |
| | | if (transferPackage.getTraceChain() != null&& |
| | | transferPackage.getTraceChain().getWorkStep() != null) { |
| | | saveWorkSteps(transferPackage.getTraceChain().getWorkStep()); |
| | | } |
| | | |
| | | // ä¿åç»ææ |
| | | if (transferPackage.getTraceChain() != null&& |
| | | transferPackage.getTraceChain().getTreePath() != null) { |
| | | saveTreePath(transferPackage.getTraceChain().getTreePath()); |
| | | } |
| | | |
| | | //ä¿åæé |
| | | if (transferPackage.getTraceChain() != null&& |
| | | transferPackage.getTraceChain().getPermissionStreamNewList() != null) { |
| | | savePermissionStreamNewList(transferPackage.getTraceChain().getPermissionStreamNewList()); |
| | | } |
| | | |
| | | // ä¿å设å¤ç±» |
| | | if (transferPackage.getTraceChain() != null&& |
| | | transferPackage.getTraceChain().getDeviceManagement() != null) { |
| | | saveDeviceManagement(transferPackage.getTraceChain().getDeviceManagement()); |
| | | } |
| | | |
| | | // ä¿å设å¤ç±»å¯¹åºä¿¡æ¯ |
| | | if (transferPackage.getTraceChain() != null&& |
| | | transferPackage.getTraceChain().getDeviceType() != null) { |
| | | saveDeviceType(transferPackage.getTraceChain().getDeviceType()); |
| | | } |
| | | |
| | | // ä¿åææ¡£ |
| | | if (transferPackage.getTraceChain() != null&& |
| | | transferPackage.getTraceChain().getDocInfo() != null) { |
| | | saveDocInfo(transferPackage.getTraceChain().getDocInfo()); |
| | | } |
| | | |
| | | // ä¿åæä»¶ |
| | | if (transferPackage.getTraceChain() !=null&& |
| | | transferPackage.getTraceChain().getDocFile() != null) { |
| | | saveDocFile(transferPackage.getTraceChain().getDocFile()); |
| | | } |
| | | |
| | | // ä¿åææ¡£æä»¶å¯¹åºå
³ç³» |
| | | if (transferPackage.getDocRelative() !=null){ |
| | | saveDocRelative(transferPackage.getDocRelative()); |
| | | } |
| | | |
| | | // ä¿ååå
·ç³»ç» |
| | | if (transferPackage.getTraceChain() !=null&& |
| | | transferPackage.getTraceChain().getCutterList() != null) { |
| | | saveCutterList(transferPackage.getTraceChain().getCutterList()); |
| | | } |
| | | |
| | | //ä¿åæ°æ§ç¨åºå 工确认表 |
| | | if (transferPackage.getTraceChain() !=null&& |
| | | transferPackage.getTraceChain().getGuideCardBatch() != null) { |
| | | saveGuideCardBatch(transferPackage.getTraceChain().getGuideCardBatch()); |
| | | } |
| | | |
| | | logger.info("æ°æ®å¯¼å
¥æå"); |
| | | } catch (DuplicateKeyException e) { |
| | | logger.warn("主é®å²çª: {}", e.getMessage()); |
| | | throw new BusinessException("æ°æ®å·²åå¨ï¼æ æ³éå¤å¯¼å
¥"); |
| | | } catch (DataIntegrityViolationException e) { |
| | | logger.error("æ°æ®å®æ´æ§è¿å: {}", e.getMessage()); |
| | | throw new BusinessException("æ°æ®ä¸å®æ´ï¼è¯·æ£æ¥å¿
å¡«åæ®µ"); |
| | | } catch (Exception e) { |
| | | logger.error("æ°æ®å¯¼å
¥å¤±è´¥: {}", e.getMessage(), e); |
| | | throw new BusinessException("æ°æ®å¯¼å
¥å¤±è´¥: " + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | private void saveProduct(ProductInfo product) { |
| | | if (productMapper.selectById(product.getProductId()) == null) { |
| | | productMapper.insert(product); |
| | | logger.debug("产åå·²ä¿å: {}", product.getProductId()); |
| | | } else { |
| | | logger.debug("产åå·²åå¨: {}", product.getProductId()); |
| | | } |
| | | } |
| | | |
| | | private void saveComponentHierarchy(ComponentHierarchy hierarchy) { |
| | | for (ComponentInfo component : hierarchy.getComponents()) { |
| | | if (componentMapper.selectById(component.getComponentId()) == null) { |
| | | componentMapper.insert(component); |
| | | logger.debug("é¨ä»¶å·²ä¿å: {}", component.getComponentId()); |
| | | } else { |
| | | logger.debug("é¨ä»¶å·²åå¨: {}", component.getComponentId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void saveParts(PartsInfo parts) { |
| | | if (partsMapper.selectById(parts.getPartsId()) == null) { |
| | | partsMapper.insert(parts); |
| | | logger.debug("é¶ä»¶å·²ä¿å: {}", parts.getPartsId()); |
| | | } else { |
| | | logger.debug("é¶ä»¶å·²åå¨: {}", parts.getPartsId()); |
| | | } |
| | | } |
| | | |
| | | private void saveProcessSpec(ProcessSpecVersion processSpec) { |
| | | if (psvMapper.selectById(processSpec.getId()) == null) { |
| | | psvMapper.insert(processSpec); |
| | | logger.debug("å·¥èºè§ç¨å·²ä¿å: {}", processSpec.getId()); |
| | | } else { |
| | | logger.debug("å·¥èºè§ç¨å·²åå¨: {}", processSpec.getId()); |
| | | } |
| | | } |
| | | |
| | | private void saveProcess(ProcessStream process) { |
| | | if (processMapper.selectById(process.getProcessId()) == null) { |
| | | processMapper.insert(process); |
| | | logger.debug("å·¥åºå·²ä¿å: {}", process.getProcessId()); |
| | | } else { |
| | | logger.debug("å·¥åºå·²åå¨: {}", process.getProcessId()); |
| | | } |
| | | } |
| | | |
| | | private void saveWorkSteps(WorkStep workStep) { |
| | | if (workStepMapper.selectById(workStep.getId()) == null) { |
| | | workStepMapper.insert(workStep); |
| | | logger.debug("å·¥æ¥å·²ä¿å: {}", workStep.getId()); |
| | | } else { |
| | | logger.debug("å·¥æ¥å·²åå¨: {}", workStep.getId()); |
| | | } |
| | | } |
| | | |
| | | private void saveTreePath(List<ProductMix> productMixList){ |
| | | for (ProductMix productMix : productMixList) { |
| | | if (productMixMapper.selectById(productMix.getId()) == null) { |
| | | productMixMapper.insert(productMix); |
| | | logger.debug("产åç»åå·²ä¿å: {}", productMix.getId()); |
| | | } else { |
| | | logger.debug("产åç»åå·²åå¨: {}", productMix.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void savePermissionStreamNewList(List<PermissionStreamNew> permissionStreamNewList) { |
| | | for (PermissionStreamNew permissionStreamNew : permissionStreamNewList) { |
| | | if (permissionStreamNew.getUserId() != null) { |
| | | String id=sysUserService.getUserByName(permissionStreamNew.getUserId()).getId(); |
| | | if (id!=null){ |
| | | permissionStreamNew.setUserId(id); |
| | | } |
| | | } |
| | | if (permissionStreamNew.getDepartId() != null) { |
| | | String id=mdcProductionService.findByOrgCode(permissionStreamNew.getDepartId()).getId(); |
| | | if (id!=null){ |
| | | permissionStreamNew.setDepartId(id); |
| | | } |
| | | } |
| | | permissionStreamNewMapper.insert(permissionStreamNew); |
| | | logger.debug("æéå·²ä¿å: {}", permissionStreamNew.getId()); |
| | | } |
| | | //åæ¹æ·»å 产åãé¨ä»¶ãé¶ä»¶ãå·¥èºè§ç¨ãå·¥åºãå·¥æ¥æé |
| | | permissionStreamNewList.forEach(item -> { |
| | | switch (item.getBusinessType()){ |
| | | case "1": |
| | | if (StrUtil.isNotEmpty(item.getUserId())){ |
| | | ProductPermission productPermission = new ProductPermission(); |
| | | productPermission.setProductId(item.getBusinessId()); |
| | | productPermission.setUserId(item.getUserId()); |
| | | productPermissionService.save(productPermission); |
| | | }else { |
| | | ProductDepartment productDepartment = new ProductDepartment(); |
| | | productDepartment.setProductId(item.getBusinessId()); |
| | | productDepartment.setDepartId(item.getDepartId()); |
| | | productDepartmentService.save(productDepartment); |
| | | } |
| | | break; |
| | | case "2": |
| | | |
| | | if (StrUtil.isNotEmpty(item.getUserId())){ |
| | | ComponentPermission componentPermission = new ComponentPermission(); |
| | | componentPermission.setComponentId(item.getBusinessId()); |
| | | componentPermission.setUserId(item.getUserId()); |
| | | componentPermissionService.save(componentPermission); |
| | | }else { |
| | | ComponentDepartment componentDepartment = new ComponentDepartment(); |
| | | componentDepartment.setComponentId(item.getBusinessId()); |
| | | componentDepartment.setDepartId(item.getDepartId()); |
| | | componentDepartmentService.save(componentDepartment); |
| | | } |
| | | break; |
| | | case "3": |
| | | if (StrUtil.isNotEmpty(item.getUserId())){ |
| | | PartsPermission partsPermission = new PartsPermission(); |
| | | partsPermission.setPartsId(item.getBusinessId()); |
| | | partsPermission.setUserId(item.getUserId()); |
| | | partsPermissionService.save(partsPermission); |
| | | }else { |
| | | PartsDepartment partsDepartment = new PartsDepartment(); |
| | | partsDepartment.setPartsId(item.getBusinessId()); |
| | | partsDepartment.setDepartId(item.getDepartId()); |
| | | partsDepartmentService.save(partsDepartment); |
| | | } |
| | | break; |
| | | case "4": |
| | | if (StrUtil.isNotEmpty(item.getUserId())){ |
| | | ProcessSpecVersionPermission processSpecVersionPermission = new ProcessSpecVersionPermission(); |
| | | processSpecVersionPermission.setPsvId(item.getBusinessId()); |
| | | processSpecVersionPermission.setUserId(item.getUserId()); |
| | | processSpecVersionPermissionService.save(processSpecVersionPermission); |
| | | }else { |
| | | ProcessSpecVersionDepartment processSpecVersionDepartment = new ProcessSpecVersionDepartment(); |
| | | processSpecVersionDepartment.setPsvId(item.getBusinessId()); |
| | | processSpecVersionDepartment.setDepartId(item.getDepartId()); |
| | | processSpecVersionDepartmentService.save(processSpecVersionDepartment); |
| | | } |
| | | break; |
| | | case "5": |
| | | if (StrUtil.isNotEmpty(item.getUserId())){ |
| | | ProcessionPermission processionPermission = new ProcessionPermission(); |
| | | processionPermission.setProcessId(item.getBusinessId()); |
| | | processionPermission.setUserId(item.getUserId()); |
| | | processStreamPermissionService.save(processionPermission); |
| | | }else { |
| | | ProcessionDepartment processionDepartment = new ProcessionDepartment(); |
| | | processionDepartment.setProcessId(item.getBusinessId()); |
| | | processionDepartment.setDepartId(item.getDepartId()); |
| | | processionDepartmentService.save(processionDepartment); |
| | | } |
| | | break; |
| | | case "6": |
| | | if (StrUtil.isNotEmpty(item.getUserId())){ |
| | | WorkStepPermission workStepPermission = new WorkStepPermission(); |
| | | workStepPermission.setStepId(item.getBusinessId()); |
| | | workStepPermission.setUserId(item.getUserId()); |
| | | workStepPermissionService.save(workStepPermission); |
| | | }else { |
| | | WorkStepDepartment workStepDepartment = new WorkStepDepartment(); |
| | | workStepDepartment.setStepId(item.getBusinessId()); |
| | | workStepDepartment.setDepartId(item.getDepartId()); |
| | | workStepDepartmentService.save(workStepDepartment); |
| | | } |
| | | break; |
| | | default: |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void saveDeviceManagement(DeviceManagement deviceManagement) { |
| | | if (deviceManagementMapper.selectById(deviceManagement.getId()) == null) { |
| | | deviceManagementMapper.insert(deviceManagement); |
| | | logger.debug("设å¤ç±»ä¿¡æ¯å·²ä¿å: {}", deviceManagement.getId()); |
| | | } else { |
| | | logger.debug("设å¤ç±»ä¿¡æ¯å·²åå¨: {}", deviceManagement.getId()); |
| | | } |
| | | } |
| | | |
| | | private void saveDeviceType(DeviceType deviceType) { |
| | | if (deviceTypeMapper.selectById(deviceType.getId()) == null) { |
| | | deviceTypeMapper.insert(deviceType); |
| | | logger.debug("设å¤ç±»å·²ä¿å: {}", deviceType.getId()); |
| | | } else { |
| | | logger.debug("设å¤ç±»å·²åå¨: {}", deviceType.getId()); |
| | | } |
| | | } |
| | | |
| | | private void saveDocInfo(DocInfo docInfo) { |
| | | if (docInfoMapper.selectById(docInfo.getDocId()) == null) { |
| | | docInfoMapper.insert(docInfo); |
| | | logger.debug("ææ¡£å·²ä¿å: {}", docInfo.getDocId()); |
| | | } else { |
| | | logger.debug("ææ¡£å·²åå¨: {}", docInfo.getDocId()); |
| | | } |
| | | } |
| | | |
| | | private void saveDocFile(DocFile docFile) { |
| | | if (docFileMapper.selectById(docFile.getFileId()) == null) { |
| | | docFileMapper.insert(docFile); |
| | | logger.debug("ææ¡£æä»¶å·²ä¿å: {}", docFile.getFileId()); |
| | | } else { |
| | | logger.debug("ææ¡£æä»¶å·²åå¨: {}", docFile.getFileId()); |
| | | } |
| | | } |
| | | |
| | | private void saveDocRelative(DocRelative docRelative) { |
| | | if (docRelativeMapper.selectById(docRelative.getId()) == null) { |
| | | docRelativeMapper.insert(docRelative); |
| | | logger.debug("ææ¡£å¯¹åºå
³ç³»å·²ä¿å: {}", docRelative.getId()); |
| | | } else { |
| | | logger.debug("ææ¡£å¯¹åºå
³ç³»å·²åå¨: {}", docRelative.getId()); |
| | | } |
| | | } |
| | | |
| | | private void saveCutterList(List<Cutter> cutterList) { |
| | | for (Cutter cutter : cutterList) { |
| | | if (cutterMapper.selectById(cutter.getId()) == null) { |
| | | cutterMapper.insert(cutter); |
| | | logger.debug("åå
·å·²ä¿å: {}", cutter.getId()); |
| | | } else { |
| | | cutterMapper.updateById(cutter); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void saveGuideCardBatch(GuideCardBatch guideCardBatch) { |
| | | if (guideCardBatchMapper.selectById(guideCardBatch.getId()) == null) { |
| | | guideCardBatchMapper.insert(guideCardBatch); |
| | | logger.debug("åçæ¹æ¬¡å·²ä¿å: {}", guideCardBatch.getId()); |
| | | } else { |
| | | logger.debug("åçæ¹æ¬¡å·²åå¨: {}", guideCardBatch.getId()); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | import org.jeecg.modules.dnc.service.DataPackageStrategy; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.EnumMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class DataPackageService { |
| | | |
| | | private final Map<TransferPackage.DataType, DataPackageStrategy> strategies; |
| | | |
| | | @Autowired |
| | | public DataPackageService(List<DataPackageStrategy> strategyList) { |
| | | strategies = new EnumMap<>(TransferPackage.DataType.class); |
| | | strategyList.forEach(strategy -> { |
| | | if (strategy instanceof ProcessPackageStrategy) { |
| | | strategies.put(TransferPackage.DataType.PROCESS, strategy); |
| | | } else if (strategy instanceof WorkStepPackageStrategy) { |
| | | strategies.put(TransferPackage.DataType.WORKSTEP, strategy); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public TransferPackage packageData(TransferPackage.DataType type, String id) { |
| | | DataPackageStrategy strategy = strategies.get(type); |
| | | if (strategy == null) { |
| | | throw new IllegalArgumentException("䏿¯æçæ°æ®ç±»å: " + type); |
| | | } |
| | | return strategy.packageData(id); |
| | | } |
| | | } |
| | |
| | | populateEquipmentNodes(treeList, equipmentMap, userRealNameMap); |
| | | } |
| | | |
| | | /** |
| | | * è·åææè®¾å¤IDéå |
| | | */ |
| | | /** |
| | | * è·åææè®¾å¤IDéå |
| | | */ |
| | | private Set<String> getAuthorizedDeviceIds(String userId) { |
| | | return super.list(new QueryWrapper<DevicePermission>().select("device_id").eq("user_id", userId)) |
| | | .stream() |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addDocInfoAnalysisSmwNcService(String pathFile,File fileRec){ |
| | | //todo ç¨åºåä¼ |
| | | //确认解æç®å½ |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * ææ¡£è§£æ |
| | | * todo ä¿®æ¹å建æä»¶å
³èå
³ç³»ï¼æ¹æåºå®docIdï¼å»é¤å建DocInfo |
| | | * @param equipmentId |
| | | * @param fileRec |
| | | * @param fileNameSuffix |
| | | * @param fileNameNew |
| | | * @param filePath |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addDocInfoRecService(String equipmentId,File fileRec,String fileNameSuffix,String fileNameNew,String filePath ) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.modules.dnc.dto.ComponentHierarchy; |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.response.ActivitiCode; |
| | | import org.jeecg.modules.dnc.response.DocumentCode; |
| | | import org.jeecg.modules.dnc.service.IDocClassificationService; |
| | | import org.jeecg.modules.dnc.service.IDocInfoService; |
| | | import org.jeecg.modules.dnc.service.IDocRelativeService; |
| | | import org.jeecg.modules.dnc.utils.JsonUtils; |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.mapper.MdcEquipmentMapper; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.nio.file.StandardCopyOption; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class FileFerryService { |
| | | |
| | | private final DataPackageService dataPackageService; |
| | | private final SecurityService securityService; |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(FileFerryService.class); |
| | | |
| | | @Value("${deploy.secretFolder}") |
| | | private String ferryPath; |
| | | |
| | | @Value("${fileHomePath}") |
| | | private String fileHomePath; |
| | | |
| | | @Autowired |
| | | private MdcEquipmentMapper mdcEquipmentMapper; |
| | | |
| | | @Autowired |
| | | private IMdcProductionService mdcProductionService; |
| | | |
| | | @Autowired |
| | | private IDocClassificationService classificationService; |
| | | |
| | | @Autowired |
| | | private IDocRelativeService docRelativeService; |
| | | |
| | | @Autowired |
| | | private IDocInfoService docInfoService; |
| | | |
| | | @Autowired |
| | | public FileFerryService(DataPackageService dataPackageService, SecurityService securityService) { |
| | | this.dataPackageService = dataPackageService; |
| | | this.securityService = securityService; |
| | | } |
| | | |
| | | public String exportData(TransferPackage.DataType type, String id,String fileName) { |
| | | // 1. è·åå°è£
æ°æ® |
| | | TransferPackage transferPackage = dataPackageService.packageData(type, id); |
| | | |
| | | // 2. å缩å±çº§ç»æ |
| | | compressHierarchy(transferPackage); |
| | | |
| | | // 3. JSONåºåå |
| | | String json = JsonUtils.toJson(transferPackage); |
| | | |
| | | // // 4. å缩å å¯ |
| | | // byte[] compressed = CompressionUtils.gzipCompress(json.getBytes(StandardCharsets.UTF_8)); |
| | | // byte[] encrypted = securityService.encrypt(compressed); |
| | | //ææ¶ä¸å å¯ |
| | | byte[] compressed = json.getBytes(StandardCharsets.UTF_8); |
| | | |
| | | // 5. çææä»¶ |
| | | Path filePath = Paths.get(ferryPath,fileName); |
| | | try { |
| | | Files.createDirectories(filePath.getParent()); |
| | | Files.write(filePath, compressed); |
| | | return filePath.toString(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("æä»¶åå
¥å¤±è´¥", e); |
| | | } |
| | | } |
| | | |
| | | public TransferPackage importData(String filePath) { |
| | | try { |
| | | // 1. 读åæä»¶ |
| | | Path path = Paths.get(filePath); |
| | | String fileName = path.getFileName().toString(); |
| | | byte[] encrypted = Files.readAllBytes(path); |
| | | logger.debug("读åæä»¶å®æ, 大å°: {} åè", encrypted.length); |
| | | |
| | | // 2. è§£å¯ (å½å已注é) |
| | | // byte[] compressed = securityService.decrypt(encrypted); |
| | | |
| | | // 3. è§£å缩 |
| | | // byte[] jsonBytes = CompressionUtils.gzipDecompress(encrypted); |
| | | String json = new String(encrypted, StandardCharsets.UTF_8); |
| | | logger.debug("è§£åç¼©å®æ, JSONé¿åº¦: {} å符", json.length()); |
| | | |
| | | // è®°å½JSONå
容ç¨äºè°è¯ |
| | | logger.trace("åå§JSONå
容:\n{}", json); |
| | | |
| | | // 4. JSONååºåå |
| | | logger.debug("å¼å§ååºåå..."); |
| | | TransferPackage pkg = JsonUtils.fromJson(json, TransferPackage.class); |
| | | |
| | | // 5. å¤çæä»¶å - 示ä¾: 10A20250614000026_3102038 |
| | | String[] split = fileName.split("_"); |
| | | if (split.length < 2) { |
| | | throw new IllegalArgumentException("æ æçæä»¶åæ ¼å¼: " + fileName); |
| | | } |
| | | |
| | | String id = split[0]; |
| | | String equipmentId = split[1].split("\\.")[0]; |
| | | |
| | | // æååç¼åæ°åé¨å |
| | | int aIndex = id.indexOf("A"); |
| | | if (aIndex == -1 || aIndex == id.length() - 1) { |
| | | throw new IllegalArgumentException("æ æçIDæ ¼å¼: " + id); |
| | | } |
| | | |
| | | String prefix = id.substring(0, aIndex + 1); |
| | | String numericPart = id.substring(aIndex + 1); |
| | | |
| | | // 计ç®åä¸ä¸ªæä»¶å |
| | | long number = Long.parseLong(numericPart); |
| | | number--; // è·ååä¸ä¸ªåºåå· |
| | | |
| | | // ä¿æç¸å使°æ ¼å¼ |
| | | String newNumeric = String.format("%0" + numericPart.length() + "d", number); |
| | | String ncFileName = prefix + newNumeric + "_" + equipmentId+".NC"; |
| | | String ncFilePath = path.getParent().resolve(ncFileName).toString(); |
| | | |
| | | // 6. è·åæä»¶å¤å¶ç®æ è·¯å¾ |
| | | DocFile docFile = pkg.getTraceChain().getDocFile(); |
| | | DocInfo docInfo = pkg.getTraceChain().getDocInfo(); |
| | | if (docFile == null) { |
| | | throw new IllegalStateException("ä¼ è¾å
ä¸ç¼ºå°ææ¡£æä»¶ä¿¡æ¯"); |
| | | } |
| | | |
| | | // æå»ºç®æ è·¯å¾ |
| | | String targetDirectory = fileHomePath + docFile.getFilePath(); |
| | | String targetPath = Paths.get(targetDirectory, docFile.getFileEncodeName()).toString(); |
| | | |
| | | // ç¡®ä¿ç®æ ç®å½åå¨ |
| | | File targetDir = new File(targetDirectory); |
| | | if (!targetDir.exists() && !targetDir.mkdirs()) { |
| | | throw new IOException("æ æ³åå»ºç®æ ç®å½: " + targetDirectory); |
| | | } |
| | | |
| | | // 7. å¤å¶æä»¶å¹¶éå½å |
| | | logger.info("å¤å¶æä»¶: {} â {}", ncFilePath, targetPath); |
| | | Path source = Paths.get(ncFilePath); |
| | | Files.copy(source, Paths.get(targetPath), StandardCopyOption.REPLACE_EXISTING); |
| | | |
| | | // 8. æ¥è¯¢è®¾å¤id |
| | | MdcEquipment mdcEquipment=mdcEquipmentMapper.selectOne(new QueryWrapper<MdcEquipment>().eq("equipment_id",equipmentId)); |
| | | if (mdcEquipment == null) { |
| | | throw new IllegalArgumentException("æ æç设å¤ID: " + equipmentId); |
| | | } |
| | | |
| | | // 9.ä¼ è¾æä»¶å°è®¾å¤ä¸ |
| | | List<String> strings = mdcProductionService.findListParentTreeAll(mdcEquipment.getId()); |
| | | if (strings != null && !strings.isEmpty()) { |
| | | DocInfo deviceDoc = docInfoService.getByDocAttrAndDocId(docInfo.getDocId(), 7, mdcEquipment.getId()); |
| | | if (deviceDoc == null) { |
| | | DocClassification classification = classificationService.getByCode("send"); |
| | | if(classification == null) |
| | | ExceptionCast.cast(DocumentCode.DOC_CLASS_ERROR); |
| | | DocRelative docRelative = new DocRelative(); |
| | | docRelative.setDocId(docInfo.getDocId()); |
| | | docRelative.setClassificationId(classification.getClassificationId()); |
| | | docRelative.setAttributionType(7); |
| | | docRelative.setAttributionId(mdcEquipment.getId()); |
| | | docRelativeService.save(docRelative); |
| | | } |
| | | String sendPath = StringUtils.join(strings.toArray(), "/"); |
| | | boolean copyFileNc = FileUtilS.copyFileNc(docFile.getFilePath(), sendPath + "/" + mdcEquipment.getEquipmentId(), |
| | | docFile.getFileEncodeName(), |
| | | docFile.getFileName(), docFile.getFileSuffix()); |
| | | if (!copyFileNc) { |
| | | ExceptionCast.cast(ActivitiCode.ACT_FILE_ERROR); |
| | | } else { |
| | | FileUtilS.deleteZipFromToSend(sendPath + "/" + mdcEquipment.getEquipmentId(), |
| | | docFile.getFileName(), docFile.getFileSuffix()); |
| | | } |
| | | } else { |
| | | throw new RuntimeException("æä»¶ä¼ è¾è·¯å¾è·å失败"); |
| | | } |
| | | |
| | | // 10.å é¤ä¸´æ¶NCæä»¶ä¸jsonæä»¶ |
| | | logger.info("å é¤ä¸´æ¶æä»¶: {}", ncFilePath); |
| | | Files.delete(source); |
| | | Files.delete(path); |
| | | |
| | | return JsonUtils.fromJson(json, TransferPackage.class); |
| | | |
| | | } catch (NumberFormatException e) { |
| | | throw new RuntimeException("æä»¶åä¸çæ°åæ ¼å¼æ æ: " + e.getMessage(), e); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("æä»¶æä½å¤±è´¥: " + e.getMessage(), e); |
| | | } catch (Exception e) { |
| | | logger.error("æä»¶å¯¼å
¥å¤±è´¥ [è·¯å¾: {}]", filePath, e); |
| | | throw new RuntimeException("æä»¶å¯¼å
¥å¤±è´¥: " + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | private void compressHierarchy(TransferPackage pkg) { |
| | | if (pkg.getTraceChain() == null || |
| | | pkg.getTraceChain().getComponentHierarchy() == null || |
| | | pkg.getTraceChain().getComponentHierarchy().getComponents().size() < 4) { |
| | | return; |
| | | } |
| | | |
| | | ComponentHierarchy hierarchy = pkg.getTraceChain().getComponentHierarchy(); |
| | | List<ComponentInfo> compressed = new ArrayList<>(); |
| | | |
| | | // ä¿çæ ¹é¨ä»¶ |
| | | compressed.add(hierarchy.getComponents().get(0)); |
| | | |
| | | // ä¿çå
³é®ä¸é´èç¹ |
| | | int step = Math.max(1, hierarchy.getComponents().size() / 3); |
| | | for (int i = step; i < hierarchy.getComponents().size() - 1; i += step) { |
| | | compressed.add(hierarchy.getComponents().get(i)); |
| | | } |
| | | |
| | | // ä¿çå¶åé¨ä»¶ |
| | | compressed.add(hierarchy.getLeafComponent()); |
| | | |
| | | // æ´æ°å±çº§ |
| | | hierarchy.getComponents().clear(); |
| | | hierarchy.getComponents().addAll(compressed); |
| | | } |
| | | |
| | | private String generateFilename(TransferPackage.DataType type, String id) { |
| | | return String.format("%s_%s_%d.ferry", |
| | | type.name().toLowerCase(), |
| | | id, |
| | | System.currentTimeMillis()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.dto.ComponentHierarchy; |
| | | import org.jeecg.modules.dnc.dto.ProcessTraceChain; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.mapper.*; |
| | | import org.jeecg.modules.dnc.service.IPermissionStreamNewService; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class FullHierarchyTraceService { |
| | | @Autowired |
| | | private ProductMixMapper productMixMapper; |
| | | @Autowired |
| | | private ProductInfoMapper productMapper; |
| | | @Autowired |
| | | private ComponentInfoMapper componentMapper; |
| | | @Autowired |
| | | private PartsInfoMapper partsMapper; |
| | | @Autowired |
| | | private ProcessSpecVersionMapper psvMapper; |
| | | @Autowired |
| | | private ProcessStreamMapper processMapper; |
| | | @Autowired |
| | | private WorkStepMapper workStepMapper; |
| | | @Autowired |
| | | private DeviceTypeMapper deviceTypeMapper; |
| | | @Autowired |
| | | private DeviceManagementMapper deviceManagementMapper; |
| | | @Autowired |
| | | private DocInfoMapper docInfoMapper; |
| | | @Autowired |
| | | private DocFileMapper docFileMapper; |
| | | @Autowired |
| | | private CutterMapper cutterMapper; |
| | | @Autowired |
| | | private GuideCardBatchMapper guideCardBatchMapper; |
| | | @Autowired |
| | | private IPermissionStreamNewService permissionStreamNewService; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | @Autowired |
| | | private IMdcProductionService mdcProductionService; |
| | | |
| | | public ProcessTraceChain traceFromProcess(DocRelative docRelative) { |
| | | ProcessTraceChain chain = initChainWithDocInfo(docRelative); |
| | | DeviceType deviceType = deviceTypeMapper.selectById(docRelative.getAttributionId()); |
| | | chain.setDeviceType(deviceType); |
| | | |
| | | if (isProcessType(deviceType)) { |
| | | chain.setDeviceManagement(deviceManagementMapper.selectById(deviceType.getDeviceManagementId())); |
| | | traceProcessChain(chain, deviceType.getAttributionId()); |
| | | } |
| | | |
| | | completeChainWithProductInfo(chain); |
| | | List<ProductMix> productMixList=buildFullTreePath(chain); |
| | | chain.setTreePath(productMixList); |
| | | chain.setPermissionStreamNewList(buildFullTreePathPermission(productMixList)); |
| | | return chain; |
| | | } |
| | | |
| | | public ProcessTraceChain traceFromWorkStep(DocRelative docRelative) { |
| | | ProcessTraceChain chain = initChainWithDocInfo(docRelative); |
| | | DeviceType deviceType = deviceTypeMapper.selectById(docRelative.getAttributionId()); |
| | | chain.setDeviceType(deviceType); |
| | | |
| | | if (isWorkSiteType(deviceType)) { |
| | | chain.setDeviceManagement(deviceManagementMapper.selectById(deviceType.getDeviceManagementId())); |
| | | traceWorkStepChain(chain, deviceType.getAttributionId()); |
| | | } |
| | | |
| | | completeChainWithProductInfo(chain); |
| | | List<ProductMix> productMixList=buildFullTreePath(chain); |
| | | chain.setTreePath(productMixList); |
| | | chain.setPermissionStreamNewList(buildFullTreePathPermission(productMixList)); |
| | | return chain; |
| | | } |
| | | |
| | | private ProcessTraceChain initChainWithDocInfo(DocRelative docRelative) { |
| | | ProcessTraceChain chain = ProcessTraceChain.builder().docRelative(docRelative).build(); |
| | | Optional.ofNullable(docInfoMapper.selectById(docRelative.getDocId())) |
| | | .ifPresent(doc -> { |
| | | chain.setDocInfo(doc); |
| | | chain.setDocFile(docFileMapper.selectById(doc.getPublishFileId())); |
| | | chain.setCutterList(getCuttersByDocId(doc.getDocId())); |
| | | getLatestGuideCardBatch(doc.getDocId()).ifPresent(chain::setGuideCardBatch); |
| | | }); |
| | | return chain; |
| | | } |
| | | |
| | | private List<Cutter> getCuttersByDocId(String docId) { |
| | | return cutterMapper.selectList(new QueryWrapper<Cutter>().eq("doc_id", docId)); |
| | | } |
| | | |
| | | private Optional<GuideCardBatch> getLatestGuideCardBatch(String docId) { |
| | | List<GuideCardBatch> batches = guideCardBatchMapper.selectList( |
| | | new QueryWrapper<GuideCardBatch>() |
| | | .eq("doc_id", docId) |
| | | .orderByDesc("SUBSTRING(serial_number, LEN(serial_number)-3, 4)")); |
| | | return CollectionUtils.isEmpty(batches) ? Optional.empty() : Optional.of(batches.get(0)); |
| | | } |
| | | |
| | | private boolean isProcessType(DeviceType deviceType) { |
| | | return deviceType != null && |
| | | Objects.equals(deviceType.getAttributionType(), DocAttributionTypeEnum.PROCESS.getCode()); |
| | | } |
| | | |
| | | private boolean isWorkSiteType(DeviceType deviceType) { |
| | | return deviceType != null && |
| | | Objects.equals(deviceType.getAttributionType(), DocAttributionTypeEnum.WORKSITE.getCode()); |
| | | } |
| | | |
| | | private void traceProcessChain(ProcessTraceChain chain, String processId) { |
| | | ProcessStream process = processMapper.selectById(processId); |
| | | if (process == null) return; |
| | | |
| | | chain.setProcess(process); |
| | | if (process.getPsvId() != null) { |
| | | ProcessSpecVersion psv = psvMapper.selectById(process.getPsvId()); |
| | | chain.setProcessSpec(psv); |
| | | if (psv != null && psv.getPartsId() != null) { |
| | | PartsInfo parts = partsMapper.selectById(psv.getPartsId()); |
| | | chain.setParts(parts); |
| | | if (parts != null && parts.getComponentId() != null) { |
| | | chain.setComponentHierarchy(traceComponentHierarchy(parts.getComponentId())); |
| | | } |
| | | } |
| | | } else if (process.getComponentId() != null) { |
| | | chain.setComponentHierarchy(traceComponentHierarchy(process.getComponentId())); |
| | | } |
| | | } |
| | | |
| | | private void traceWorkStepChain(ProcessTraceChain chain, String workStepId) { |
| | | WorkStep workStep = workStepMapper.selectById(workStepId); |
| | | if (workStep == null) return; |
| | | |
| | | chain.setWorkStep(workStep); |
| | | traceProcessChain(chain, workStep.getProcessId()); |
| | | } |
| | | |
| | | private ComponentHierarchy traceComponentHierarchy(String componentId) { |
| | | ComponentHierarchy hierarchy = new ComponentHierarchy(); |
| | | ComponentInfo current = componentMapper.selectById(componentId); |
| | | |
| | | while (current != null) { |
| | | hierarchy.addComponentToTop(current); |
| | | |
| | | if (current.getParentId() == null || current.getParentId().isEmpty()) { |
| | | Optional.ofNullable(current.getProductId()) |
| | | .map(productMapper::selectById) |
| | | .ifPresent(hierarchy::setRootProduct); |
| | | break; |
| | | } |
| | | |
| | | current = componentMapper.selectById(current.getParentId()); |
| | | } |
| | | |
| | | return hierarchy; |
| | | } |
| | | |
| | | private void completeChainWithProductInfo(ProcessTraceChain chain) { |
| | | Optional.ofNullable(chain.getComponentHierarchy()) |
| | | .map(ComponentHierarchy::getComponents) |
| | | .filter(components -> !components.isEmpty()) |
| | | .map(components -> components.get(0)) |
| | | .map(ComponentInfo::getProductId) |
| | | .map(productMapper::selectById) |
| | | .ifPresent(chain::setProduct); |
| | | } |
| | | |
| | | private List<ProductMix> buildFullTreePath(ProcessTraceChain chain) { |
| | | List<ProductMix> path = new ArrayList<>(); |
| | | |
| | | Optional.ofNullable(chain.getProduct()) |
| | | .map(ProductInfo::getProductId) |
| | | .map(productMixMapper::findByProductId) |
| | | .ifPresent(path::add); |
| | | |
| | | Optional.ofNullable(chain.getComponentHierarchy()) |
| | | .map(ComponentHierarchy::getComponentsFromTop) |
| | | .ifPresent(components -> components.stream() |
| | | .map(ComponentInfo::getComponentId) |
| | | .map(productMixMapper::findByComponentId) |
| | | .filter(Objects::nonNull) |
| | | .forEach(path::add)); |
| | | |
| | | Optional.ofNullable(chain.getParts()) |
| | | .map(PartsInfo::getPartsId) |
| | | .map(productMixMapper::findByPartsId) |
| | | .ifPresent(path::add); |
| | | |
| | | Optional.ofNullable(chain.getProcessSpec()) |
| | | .map(ProcessSpecVersion::getId) |
| | | .map(productMixMapper::findByOperationId) |
| | | .ifPresent(path::add); |
| | | |
| | | Optional.ofNullable(chain.getProcess()) |
| | | .map(ProcessStream::getProcessId) |
| | | .map(productMixMapper::findByProcessId) |
| | | .ifPresent(path::add); |
| | | |
| | | Optional.ofNullable(chain.getWorkStep()) |
| | | .map(WorkStep::getId) |
| | | .map(productMixMapper::findByWorksiteId) |
| | | .ifPresent(path::add); |
| | | |
| | | return path; |
| | | } |
| | | |
| | | private List<PermissionStreamNew> buildFullTreePathPermission(List<ProductMix> productMixList) { |
| | | List<Long> ids=productMixList.stream().map(ProductMix::getId).collect(Collectors.toList()); |
| | | List<PermissionStreamNew> path = permissionStreamNewService |
| | | .list(new QueryWrapper<PermissionStreamNew>().in("business_id",ids) |
| | | .eq("delete_flag",0)); |
| | | path.forEach(item->{ |
| | | if (item.getDepartId()!=null){ |
| | | item.setDepartId(mdcProductionService.getById(item.getDepartId()).getOrgCode()); |
| | | } |
| | | if (item.getUserId()!=null){ |
| | | item.setUserId(sysUserService.getById(item.getUserId()).getUsername()); |
| | | } |
| | | }); |
| | | return path; |
| | | } |
| | | } |
| | |
| | | boolean b = super.updateById(partsInfo); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(partsInfo.getPartsName()); |
| | | productMix.setCode(partsInfo.getPartsCode()); |
| | | productMix.setTreeName(partsInfo.getPartsName()); |
| | | productMix.setTreeCode(partsInfo.getPartsCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | return false; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | import org.jeecg.modules.dnc.entity.DocRelative; |
| | | import org.jeecg.modules.dnc.entity.ProcessStream; |
| | | import org.jeecg.modules.dnc.mapper.DeviceTypeMapper; |
| | | import org.jeecg.modules.dnc.mapper.DocRelativeMapper; |
| | | import org.jeecg.modules.dnc.mapper.ProcessStreamMapper; |
| | | import org.jeecg.modules.dnc.service.DataPackageStrategy; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class ProcessPackageStrategy implements DataPackageStrategy { |
| | | @Autowired |
| | | private ProcessStreamMapper processMapper; |
| | | @Autowired |
| | | private DeviceTypeMapper deviceTypeMapper; |
| | | @Autowired |
| | | private FullHierarchyTraceService traceService; |
| | | @Autowired |
| | | private DocRelativeMapper docRelativeMapper; |
| | | |
| | | @Override |
| | | public TransferPackage packageData(String relativeId) { |
| | | DocRelative docRelative=docRelativeMapper.selectById(relativeId); |
| | | DeviceType deviceType=deviceTypeMapper.selectById(docRelative.getAttributionId()); |
| | | if (deviceType!=null&&deviceType.getAttributionType().equals(DocAttributionTypeEnum.PROCESS.getCode())) { |
| | | ProcessStream process = processMapper.selectById(deviceType.getAttributionId()); |
| | | if (process == null) { |
| | | throw new IllegalArgumentException("设å¤ç±»å¯¹åºçå·¥åºä¸åå¨: " + deviceType.getDeviceManagementId()); |
| | | } |
| | | } |
| | | return TransferPackage.builder() |
| | | .dataType(TransferPackage.DataType.PROCESS) |
| | | .docRelative(docRelative) |
| | | .traceChain(traceService.traceFromProcess(docRelative)) |
| | | .build(); |
| | | } |
| | | } |
| | |
| | | boolean b = super.updateById(processSpecVersion); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(processSpecVersion.getProcessSpecVersionName()); |
| | | productMix.setCode(processSpecVersion.getProcessSpecVersionCode()); |
| | | productMix.setTreeName(processSpecVersion.getProcessSpecVersionName()); |
| | | productMix.setTreeCode(processSpecVersion.getProcessSpecVersionCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | return false; |
| | |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addProcessStream(ProcessStream stream) { |
| | |
| | | boolean b = super.updateById(stream); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(stream.getProcessName()); |
| | | productMix.setCode(stream.getProcessCode()); |
| | | productMix.setTreeName(stream.getProcessName()); |
| | | productMix.setTreeCode(stream.getProcessCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
ÎļþÃû´Ó lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/ProcessionDepartmentService.java ÐÞ¸Ä |
| | |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ProcessionDepartmentService extends ServiceImpl<ProcessionDepartmentMapper, ProcessionDepartment> implements IProcessionDepartmentService { |
| | | public class ProcessionDepartmentServiceImpl extends ServiceImpl<ProcessionDepartmentMapper, ProcessionDepartment> implements IProcessionDepartmentService { |
| | | |
| | | @Override |
| | | public boolean deleteByProcessId(String processId) { |
| | |
| | | boolean b = super.updateById(productInfo); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(productInfo.getProductName()); |
| | | productMix.setCode(productInfo.getProductNo()); |
| | | productMix.setTreeName(productInfo.getProductName()); |
| | | productMix.setTreeCode(productInfo.getProductNo()); |
| | | productMixService.updateById(productMix); |
| | | if (!b) |
| | | return false; |
| | |
| | | * @param paramId äº§åæ èç¹id |
| | | * @param relativeFlag 1 æ¯ 2 å¦ |
| | | * @param userIds æ·»å ç¨æ·ids |
| | | * todoä¼åç»æï¼éç¨mix表è¿è¡ç¶åé彿¥è¯¢ï¼åç±»è¿è¡æéåé
ï¼å表æ¥è¯¢ï¼ |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | * @param paramId äº§åæ èç¹id |
| | | * @param relativeFlag 1 æ¯ 2 å¦ |
| | | * @param departmentIds æ·»å é¨é¨ids |
| | | * todoä¼åç»æï¼éç¨mix表è¿è¡ç¶åé彿¥è¯¢ï¼åç±»è¿è¡æéåé
ï¼å表æ¥è¯¢ï¼ |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | * @param paramId äº§åæ èç¹id |
| | | * @param relativeFlag 1 æ¯ 2 å¦ |
| | | * @param userIds ç§»é¤ç¨æ·ids |
| | | * todoä¼åç»æï¼éç¨mix表è¿è¡ç¶åé彿¥è¯¢ï¼åç±»è¿è¡æéåé
ï¼å表æ¥è¯¢ï¼ |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | * @param paramId äº§åæ èç¹id |
| | | * @param relativeFlag 1 æ¯ 2 å¦ |
| | | * @param departmentIds ç§»é¤é¨é¨ids |
| | | * todoä¼åç»æï¼éç¨mix表è¿è¡ç¶åé彿¥è¯¢ï¼åç±»è¿è¡æéåé
ï¼å表æ¥è¯¢ï¼ |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | ProductInfo productInfo=this.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(productInfo.getProductName()); |
| | | docInfo.setNodeCode(productInfo.getProductNo()); |
| | | docInfo.setNodeId(productInfo.getProductId()); |
| | | break; |
| | | case 2: |
| | | ComponentInfo componentInfo=componentInfoService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(componentInfo.getComponentName()); |
| | | docInfo.setNodeCode(componentInfo.getComponentCode()); |
| | | docInfo.setNodeId(componentInfo.getComponentId()); |
| | | break; |
| | | case 3: |
| | | PartsInfo partsInfo=partsInfoService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeCode(partsInfo.getPartsCode()); |
| | | docInfo.setNodeName(partsInfo.getPartsName()); |
| | | docInfo.setNodeId(partsInfo.getPartsId()); |
| | | break; |
| | | case 4: |
| | | ProcessSpecVersion processSpecVersion=processSpecVersionService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(processSpecVersion.getProcessSpecVersionName()); |
| | | docInfo.setNodeCode(processSpecVersion.getProcessSpecVersionCode()); |
| | | docInfo.setNodeId(processSpecVersion.getId()); |
| | | break; |
| | | case 5: |
| | | ProcessStream processStream=processStreamService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(processStream.getProcessName()); |
| | | docInfo.setNodeCode(processStream.getProcessCode()); |
| | | docInfo.setNodeId(processStream.getProcessId()); |
| | | break; |
| | | case 6: |
| | | WorkStep workStep=workStepService.getById(docInfo.getAttributionId()); |
| | | docInfo.setNodeName(workStep.getStepName()); |
| | | docInfo.setNodeCode(workStep.getStepName()); |
| | | docInfo.setNodeId(workStep.getId()); |
| | | break; |
| | | } |
| | | }); |
| | |
| | | ProcessStream processStream=processStreamService.getById(deviceType.getAttributionId()); |
| | | docInfo.setNodeName(processStream.getProcessName()); |
| | | docInfo.setNodeCode(processStream.getProcessCode()); |
| | | docInfo.setNodeId(processStream.getProcessId()); |
| | | }else { |
| | | //å·¥æ¥ä¸ç设å¤ç±» |
| | | WorkStep workStep=workStepService.getById(deviceType.getAttributionId()); |
| | | docInfo.setNodeName(workStep.getStepName()); |
| | | docInfo.setNodeCode(workStep.getStepName()); |
| | | docInfo.setNodeId(workStep.getId()); |
| | | } |
| | | }); |
| | | } |
| | |
| | | result.sort(Comparator.comparing(ProductMix::getCreateTime, Comparator.nullsLast(Date::compareTo))); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductMix> getParentList(String id) { |
| | | List<ProductMix> parentList = new ArrayList<>(); |
| | | // 1. æ ¹æ®IDæ¥è¯¢å½åèç¹ |
| | | ProductMix current = this.getById(id); |
| | | if (current == null) { |
| | | return parentList; // èç¹ä¸å卿¶è¿å空å表 |
| | | } |
| | | // 2. ä»å½åèç¹å¼å§å䏿¥æ¾ç¶èç¹ |
| | | Long parentId = current.getParentId(); |
| | | while ( parentId != 0L) { |
| | | ProductMix parent = this.getById(parentId.toString()); |
| | | if (parent == null) { |
| | | break; |
| | | } |
| | | parentList.add(parent); |
| | | parentId = parent.getParentId(); |
| | | } |
| | | |
| | | return parentList; |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductMix> getChildrenList(String id) { |
| | | List<ProductMix> childrenList = new ArrayList<>(); |
| | | ProductMix current = this.getById(id); |
| | | if (current == null) { |
| | | return childrenList; |
| | | } |
| | | |
| | | // 使ç¨éåè¿è¡BFS |
| | | Queue<ProductMix> queue = new LinkedList<>(); |
| | | queue.add(current); // å å
¥å½åèç¹ä½ä¸ºèµ·ç¹ |
| | | |
| | | // è®°å½å·²è®¿é®èç¹çIDï¼é¿å
循ç¯å¼ç¨ |
| | | Set<String> visited = new HashSet<>(); |
| | | visited.add(id); // èµ·å§èç¹å·²è®¿é® |
| | | |
| | | while (!queue.isEmpty()) { |
| | | ProductMix node = queue.poll(); |
| | | // è·³è¿èµ·å§èç¹ï¼å³ä¼ å
¥çèç¹ï¼ï¼ä¸å å
¥ç»æå表 |
| | | if (!node.getId().toString().equals(id)) { |
| | | childrenList.add(node); |
| | | } |
| | | |
| | | // æ¥è¯¢å½åèç¹çç´æ¥åèç¹ |
| | | List<ProductMix> directChildren = this.lambdaQuery().eq(ProductMix::getParentId, node.getId()).list(); |
| | | if (directChildren != null && !directChildren.isEmpty()) { |
| | | for (ProductMix child : directChildren) { |
| | | String childId = child.getId().toString(); |
| | | // å¦æè¯¥åèç¹è¿æªè®¿é®è¿ |
| | | if (!visited.contains(childId)) { |
| | | visited.add(childId); |
| | | queue.add(child); |
| | | } |
| | | // å¦å忽ç¥ï¼é¿å
循ç¯å¼ç¨å¯¼è´çæ»å¾ªç¯ |
| | | } |
| | | } |
| | | } |
| | | return childrenList; |
| | | } |
| | | |
| | | } |
| | |
| | | break; |
| | | default: |
| | | // å¤çæªç¥ç±»å |
| | | throw new IllegalArgumentException("Unknown permission type: " + type); |
| | | throw new IllegalArgumentException("Unknown permission treeType: " + type); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.Security; |
| | | |
| | | @Service |
| | | public class SecurityService { |
| | | private static final String ALGORITHM = "SM4/ECB/PKCS5Padding"; |
| | | private final String secretKey; |
| | | |
| | | static { |
| | | Security.addProvider(new BouncyCastleProvider()); |
| | | } |
| | | |
| | | @Autowired |
| | | public SecurityService(@Value("${security.encryption-key}") String secretKey) { |
| | | this.secretKey = secretKey; |
| | | } |
| | | |
| | | public byte[] encrypt(byte[] data) { |
| | | try { |
| | | Cipher cipher = Cipher.getInstance(ALGORITHM, "BC"); |
| | | SecretKeySpec keySpec = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), "SM4"); |
| | | cipher.init(Cipher.ENCRYPT_MODE, keySpec); |
| | | return cipher.doFinal(data); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("å å¯å¤±è´¥", e); |
| | | } |
| | | } |
| | | |
| | | public byte[] decrypt(byte[] encryptedData) { |
| | | try { |
| | | Cipher cipher = Cipher.getInstance(ALGORITHM, "BC"); |
| | | SecretKeySpec keySpec = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), "SM4"); |
| | | cipher.init(Cipher.DECRYPT_MODE, keySpec); |
| | | return cipher.doFinal(encryptedData); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("è§£å¯å¤±è´¥", e); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.service.impl; |
| | | |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | import org.jeecg.modules.dnc.entity.DeviceType; |
| | | import org.jeecg.modules.dnc.entity.DocRelative; |
| | | import org.jeecg.modules.dnc.entity.WorkStep; |
| | | import org.jeecg.modules.dnc.mapper.DeviceTypeMapper; |
| | | import org.jeecg.modules.dnc.mapper.DocRelativeMapper; |
| | | import org.jeecg.modules.dnc.mapper.WorkStepMapper; |
| | | import org.jeecg.modules.dnc.service.DataPackageStrategy; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class WorkStepPackageStrategy implements DataPackageStrategy { |
| | | @Autowired |
| | | private WorkStepMapper workStepMapper; |
| | | @Autowired |
| | | private FullHierarchyTraceService traceService; |
| | | @Autowired |
| | | private DeviceTypeMapper deviceTypeMapper; |
| | | @Autowired |
| | | private DocRelativeMapper docRelativeMapper; |
| | | |
| | | @Override |
| | | public TransferPackage packageData(String relativeId) { |
| | | DocRelative docRelative=docRelativeMapper.selectById(relativeId); |
| | | DeviceType deviceType=deviceTypeMapper.selectById(docRelative.getAttributionId()); |
| | | if (deviceType!=null&&deviceType.getAttributionType().equals(DocAttributionTypeEnum.WORKSITE.getCode())) { |
| | | WorkStep workStep = workStepMapper.selectById(deviceType.getAttributionId()); |
| | | if (workStep == null) { |
| | | throw new IllegalArgumentException("设å¤ç±»å¯¹åºçå·¥æ¥ä¸åå¨: " + deviceType.getDeviceManagementId()); |
| | | } |
| | | } |
| | | return TransferPackage.builder() |
| | | .dataType(TransferPackage.DataType.WORKSTEP) |
| | | .docRelative(docRelative) |
| | | .traceChain(traceService.traceFromWorkStep(docRelative)) |
| | | .build(); |
| | | } |
| | | } |
| | | |
| | |
| | | ExceptionCast.cast(ProcessInfoCode.WORKSTEP_NOT_EXIST); |
| | | //åæ¥ä¿®æ¹ç»ææ |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(workStep.getStepName()); |
| | | productMix.setCode(workStep.getStepCode()); |
| | | productMix.setTreeName(workStep.getStepName()); |
| | | productMix.setTreeCode(workStep.getStepCode()); |
| | | productMixService.updateById(productMix); |
| | | return super.updateById(workStep); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.utils; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.util.zip.GZIPInputStream; |
| | | import java.util.zip.GZIPOutputStream; |
| | | |
| | | public class CompressionUtils { |
| | | public static byte[] gzipCompress(byte[] data) { |
| | | try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
| | | GZIPOutputStream gzip = new GZIPOutputStream(bos)) { |
| | | gzip.write(data); |
| | | gzip.finish(); |
| | | return bos.toByteArray(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("GZIPå缩失败", e); |
| | | } |
| | | } |
| | | |
| | | public static byte[] gzipDecompress(byte[] compressed) { |
| | | try (ByteArrayInputStream bis = new ByteArrayInputStream(compressed); |
| | | GZIPInputStream gzip = new GZIPInputStream(bis); |
| | | ByteArrayOutputStream bos = new ByteArrayOutputStream()) { |
| | | byte[] buffer = new byte[1024]; |
| | | int len; |
| | | while ((len = gzip.read(buffer)) > 0) { |
| | | bos.write(buffer, 0, len); |
| | | } |
| | | return bos.toByteArray(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("GZIPè§£å失败", e); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.dnc.utils; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.fasterxml.jackson.databind.DeserializationFeature; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.SerializationFeature; |
| | | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | public class JsonUtils { |
| | | private static final ObjectMapper objectMapper = createObjectMapper(); |
| | | |
| | | private static ObjectMapper createObjectMapper() { |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | |
| | | // é
ç½®æ¥ææ ¼å¼ |
| | | mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); |
| | | mapper.registerModule(new JavaTimeModule()); |
| | | mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); |
| | | |
| | | // é
ç½®åºååé项 |
| | | mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); |
| | | |
| | | // é
ç½®ååºååé项 |
| | | mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
| | | mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true); |
| | | mapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true); |
| | | |
| | | return mapper; |
| | | } |
| | | |
| | | public static String toJson(Object object) { |
| | | try { |
| | | return objectMapper.writeValueAsString(object); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("JSONåºåå失败: " + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | public static <T> T fromJson(String json, Class<T> valueType) { |
| | | try { |
| | | return objectMapper.readValue(json, valueType); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("JSONååºåå失败: " + e.getMessage() + "\nJSONå
容: " + json, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | ProductMix newNode = new ProductMix( |
| | | node.getId(), |
| | | node.getParentId(), |
| | | node.getName(), |
| | | node.getCode(), |
| | | node.getTreeName(), |
| | | node.getTreeCode(), |
| | | node.getType(), |
| | | node.getCreateTime() |
| | | ); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.dnc.entity.DocFile; |
| | | import org.jeecg.modules.dnc.response.QueryPageResponseResult; |
| | | import org.jeecg.modules.dncFlow.entity.AssignFileStream; |
| | | import org.jeecg.modules.dncFlow.ext.AssignFileStreamExt; |
| | |
| | | import org.jeecg.modules.dncFlow.request.AssignFileRequest; |
| | | import org.jeecg.modules.dncFlow.request.AssignFileStreamQueryRequest; |
| | | import org.jeecg.modules.dncFlow.vo.AssignFlowTaskVo; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | |
| | | public interface IAssignFileStreamService extends IService<AssignFileStream> { |
| | | /** |
| | |
| | | |
| | | /** |
| | | * å®¡æ¹æå¡ |
| | | * @param taskId |
| | | * @param streamId |
| | | * @param stream |
| | | * @param assignFlowTaskVo |
| | | * @return |
| | | */ |
| | | boolean approveAssignFile(AssignFlowTaskVo assignFlowTaskVo); |
| | |
| | | * @return |
| | | */ |
| | | Boolean getFlowableEnable(); |
| | | |
| | | void handleFileTransfer(MdcEquipment mdcEquipment, DocFile docFile); |
| | | } |
| | |
| | | import org.flowable.task.api.Task; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.dnc.constant.DncPassLogPassType; |
| | | import org.jeecg.modules.dnc.constant.DocAttributionTypeEnum; |
| | | import org.jeecg.modules.dnc.dto.TransferPackage; |
| | | import org.jeecg.modules.dnc.entity.*; |
| | | import org.jeecg.modules.dnc.exception.ExceptionCast; |
| | | import org.jeecg.modules.dnc.ext.NcTxtFilePathInfo; |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.service.impl.FileFerryService; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.dnc.utils.date.DateUtil; |
| | | import org.jeecg.modules.dnc.utils.file.FileUtilS; |
| | |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.message.enums.DeployEnum; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service("IAssignFileStreamService") |
| | | public class AssignFileStreamServiceImpl extends ServiceImpl<AssignFileStreamMapper, AssignFileStream> implements IAssignFileStreamService , FlowCallBackServiceI { |
| | | private static final String PROCESS_KEY = "assign_nc_to_device"; |
| | | private static final String APPLY_VARIABLE = "apply_user"; |
| | | private static final String APPROVE_VARIABLE = "approve_users"; |
| | | private static final String SEND_CODE = "SEND"; |
| | | |
| | | @Value("${flowable.enable}") |
| | | private Boolean flowableEnable; |
| | | |
| | | @Value("${fileHomePath}") |
| | | private String fileHomePath; |
| | | @Autowired |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | |
| | | private PermissionService permissionService; |
| | | @Autowired |
| | | private IDncPassLogService dncPassLogService; |
| | | @Value("${deploy.deployType}") |
| | | private String deployType; //å·¥æ§ç½/æ¶å¯ç½é¨ç½² 0为工æ§ç½ 1为æ¶å¯ç½ |
| | | @Value("${deploy.secretFolder}") |
| | | private String secretFolder; //æ¶å¯ç½ä¼ è¾ncæä»¶å¤¹ |
| | | |
| | | @Autowired |
| | | private FileFerryService ferryService; |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result applyAssignFile(AssignFileStream stream) { |
| | |
| | | } |
| | | |
| | | } |
| | | handleFileTransfer(mdcEquipment, docFile); |
| | | //注æ----åºåå·¥æ§ç½ä¸æ¶å¯ç½ï¼ï¼ï¼ æ¶å¯ç½è¿è¡NCæä»¶çæ·è´ï¼å·¥æ§ç½è´è´£è¿è¡è§£æNCæä»¶ |
| | | if (deployType.equals(DeployEnum.SMW.getCode())) { |
| | | handleFileProcessing(docFile, mdcEquipment, secretFolder); |
| | | List<DocRelative> docRelativeList=docRelativeService. |
| | | list(new QueryWrapper<DocRelative>() |
| | | .eq("attribution_type",stream.getAttributionType()) |
| | | .eq("attribution_id",stream.getAttributionId()) |
| | | .eq("doc_id",stream.getDocId())); |
| | | if (docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ActivitiCode.ACT_APPROVE_ERROR); |
| | | } |
| | | handleFileTransfer(mdcEquipment, docFile); |
| | | //NCæä»¶çæ·è´ |
| | | handleFileProcessing(docFile, mdcEquipment, secretFolder); |
| | | //对åºäº§åç»ææ æ·è´ |
| | | handleProductTree(docInfo,docRelativeList.get(0),mdcEquipment.getEquipmentId()); |
| | | synchronizedFlagService.updateFlag(2); |
| | | return Result.OK("æä½æå"); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | //注æ----åºåå·¥æ§ç½ä¸æ¶å¯ç½ï¼ï¼ï¼ æ¶å¯ç½è¿è¡NCæä»¶çæ·è´ï¼å·¥æ§ç½è´è´£è¿è¡è§£æNCæä»¶ |
| | | if (deployType.equals(DeployEnum.SMW.getCode())) { |
| | | handleFileProcessing(docFile, mdcEquipment, secretFolder); |
| | | List<DocRelative> docRelativeList=docRelativeService. |
| | | list(new QueryWrapper<DocRelative>() |
| | | .eq("attribution_type",en.getAttributionType()) |
| | | .eq("attribution_id",en.getAttributionId()) |
| | | .eq("doc_id",en.getDocId())); |
| | | if (docRelativeList.isEmpty()){ |
| | | ExceptionCast.cast(ActivitiCode.ACT_APPROVE_ERROR); |
| | | } |
| | | //æ¶å¯ç½è¿è¡NCæä»¶çæ·è´ |
| | | handleFileTransfer(mdcEquipment, docFile); |
| | | //NCæä»¶çæ·è´ |
| | | handleFileProcessing(docFile, mdcEquipment, secretFolder); |
| | | //对åºäº§åç»ææ æ·è´ |
| | | handleProductTree(docInfo,docRelativeList.get(0),mdcEquipment.getEquipmentId()); |
| | | return synchronizedFlagService.updateFlag(1); |
| | | }else if(up.getStatus() == 3) { |
| | | //æç»æä½ ä»ä¹ä¹ä¸å |
| | |
| | | } |
| | | |
| | | //æå
¥æä»¶ä¼ è¾ä»»å¡è¡¨ |
| | | private void handleFileTransfer(MdcEquipment mdcEquipment, DocFile docFile) { |
| | | @Override |
| | | public void handleFileTransfer(MdcEquipment mdcEquipment, DocFile docFile) { |
| | | List<String> strings = iMdcProductionService.findListParentTreeAll(mdcEquipment.getId()); |
| | | if (strings != null && !strings.isEmpty()) { |
| | | String path = StringUtils.join(strings.toArray(), "/"); |
| | |
| | | //å°è£
å¤çæä»¶ |
| | | private void handleFileProcessing(DocFile docFile, MdcEquipment mdcEquipment, String secretFolder) { |
| | | if (!docFile.getFileSuffix().equals("zip") && !docFile.getFileSuffix().equals("rar")) { |
| | | String size = FileUtilS.fileSizeNC(docFile.getFilePath(), docFile.getFileEncodeName()); |
| | | List<String> strings = iMdcProductionService.findListParentTreeAll(mdcEquipment.getId()); |
| | | if (strings != null && !strings.isEmpty()) { |
| | | DncPassLog passInfoTxt = new DncPassLog(); |
| | |
| | | /*æ¥è¯¢æå䏿¡è®°å½*/ |
| | | //ä¼ç 500æ¯«ç§ |
| | | DncPassLog dncPassLog = dncPassLogService.findDayTime(DateUtil.format(dateFirst,DateUtil.STR_YEARMONTHDAY)); |
| | | int fileTxt = 0, fileNc =0; |
| | | int fileNc =0; |
| | | if (dncPassLog !=null) { |
| | | fileTxt = dncPassLog.getSequenceNumber() + 1; |
| | | fileNc = dncPassLog.getSequenceNumber() + 1; |
| | | } else { |
| | | fileTxt = 1; |
| | | fileNc = 1; |
| | | } |
| | | fileNc = fileTxt + 1; |
| | | //å¤çæä»¶åç§° æä»¶è·¯å¾ |
| | | String sequence = String.format("%06d",fileTxt); |
| | | String sequenceNc = String.format("%06d",fileNc); |
| | | passInfoTxt.setSequenceNumber(fileTxt); |
| | | passInfoTxt.setSequenceOrder(sequence); |
| | | passInfoTxt.setCreateTime(dateFirst); |
| | | System.out.println(DateUtil.format(dateFirst,DateUtil.STR_DATE_TIME)); |
| | | passInfoTxt.setPassType("02"); |
| | | dncPassLogService.save(passInfoTxt); |
| | | |
| | | DncPassLog passInfoNc = new DncPassLog(); |
| | | passInfoNc.setSequenceNumber(fileNc); |
| | | passInfoNc.setSequenceOrder(sequenceNc); |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | dncPassLogService.save(passInfoNc); |
| | | NcTxtFilePathInfo ncTxt = new NcTxtFilePathInfo(); |
| | | ncTxt.setEquipmentId(mdcEquipment.getEquipmentId()); |
| | | ncTxt.setFileNcName("10A"+DateUtil.format(dateFirst,DateUtil.STR_YEARMONTHDAY)+sequenceNc); |
| | | ncTxt.setFileTxtName("10A"+DateUtil.format(dateFirst,DateUtil.STR_YEARMONTHDAY)+sequence); |
| | | ncTxt.setFilePath(path + "/" + mdcEquipment.getEquipmentId() + "/"); |
| | | ncTxt.setOrigFileName(docFile.getFileName()); |
| | | ncTxt.setOrigFileSuffix(docFile.getFileSuffix()); |
| | | ncTxt.setFileAddOrDelete(1); |
| | | String loFilePath = secretFolder +"/"+ ncTxt.getFileTxtName() + ".nc"; |
| | | try { |
| | | String allList = ncTxt.getFileTxtName() + "\n" |
| | | + ncTxt.getFileNcName() + "\n" |
| | | + ncTxt.getOrigFileName() + "\n" |
| | | + ncTxt.getOrigFileSuffix() + "\n" |
| | | + ncTxt.getFilePath() + "\n" |
| | | + ncTxt.getEquipmentId() + "\n" |
| | | + ncTxt.getFileAddOrDelete().toString() + "\n" |
| | | + size + "\n"; |
| | | FileUtilS.fileWriterSql(loFilePath, allList); |
| | | boolean copyFileNc = FileUtilS.copyFileUpName(path + "/" + mdcEquipment.getEquipmentId() + "/send/" + |
| | | docFile.getFileName(), |
| | | secretFolder +"/"+ncTxt.getFileNcName(), |
| | | docFile.getFileSuffix(), "NC"); |
| | | if (!copyFileNc) { |
| | | FileUtilS.deleteNcFile(loFilePath); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("æä»¶å¤ç失败", e); |
| | | } |
| | | FileUtilS.copyFileUpName(path + "/" + mdcEquipment.getEquipmentId() + "/send/" + |
| | | docFile.getFileName(), |
| | | secretFolder +"/"+"10A"+DateUtil.format(dateFirst,DateUtil.STR_YEARMONTHDAY)+sequenceNc+"_"+mdcEquipment.getEquipmentId(), |
| | | docFile.getFileSuffix(), "NC"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¤ç对åºäº§åç»ææ ãncæä»¶ãåå
·å表ãç¨åºå 工确认表å°è£
|
| | | * @param docInfo |
| | | */ |
| | | private void handleProductTree(DocInfo docInfo,DocRelative docRelative,String equipmentId) { |
| | | /*æ¥è¯¢æå䏿¡è®°å½*/ |
| | | //ä¼ç 500æ¯«ç§ |
| | | DncPassLog passInfoTxt = new DncPassLog(); |
| | | Date dateFirst = DateUtil.getNow(); |
| | | passInfoTxt.setDayTime(DateUtil.format(dateFirst,DateUtil.STR_YEARMONTHDAY)); |
| | | DncPassLog dncPassLog = dncPassLogService.findDayTime(DateUtil.format(dateFirst,DateUtil.STR_YEARMONTHDAY)); |
| | | int fileTxt = 0, fileNc =0; |
| | | if (dncPassLog !=null) { |
| | | fileTxt = dncPassLog.getSequenceNumber() + 1; |
| | | } else { |
| | | fileTxt = 1; |
| | | } |
| | | String sequence = String.format("%06d",fileTxt); |
| | | passInfoTxt.setSequenceNumber(fileTxt); |
| | | passInfoTxt.setCreateTime(dateFirst); |
| | | passInfoTxt.setSequenceOrder(sequence); |
| | | System.out.println(DateUtil.format(dateFirst,DateUtil.STR_DATE_TIME)); |
| | | passInfoTxt.setPassType(DncPassLogPassType.PRODUCTSTRUCTURE.getCode()); |
| | | dncPassLogService.save(passInfoTxt); |
| | | String fileName="10A"+DateUtil.format(dateFirst,DateUtil.STR_YEARMONTHDAY); |
| | | if (Objects.equals(docInfo.getAttributionType(), DocAttributionTypeEnum.PROCESS.getCode())){ |
| | | //å·¥åºå¯¹åºè®¾å¤ç±» |
| | | String filePath = ferryService.exportData(TransferPackage.DataType.PROCESS, docRelative.getId(),fileName+sequence+"_"+equipmentId+".ferry"); |
| | | System.out.println("å·¥åºæ°æ®å·²å¯¼åº: " + filePath); |
| | | }else { |
| | | //å·¥æ¥å¯¹åºè®¾å¤ç±» |
| | | String filePath = ferryService.exportData(TransferPackage.DataType.WORKSTEP, docRelative.getId(),fileName+sequence+"_"+equipmentId+".ferry"); |
| | | System.out.println("å·¥æ¥æ°æ®å·²å¯¼åº: " + filePath); |
| | | } |
| | | } |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | business.getTaskNameId();//æ¥ä¸æ¥å®¡æ¹çèç¹ |
| | |
| | | } |
| | | break; |
| | | case SECOND_MAINTENANCE: |
| | | if (result instanceof EamSecondMaintenanceOrder) { |
| | | EamSecondMaintenanceOrder order = (EamSecondMaintenanceOrder) result; |
| | | if (SecondMaintenanceStatusEnum.COMPLETE.name().equals(order.getMaintenanceStatus())) { |
| | | log.setEquipmentId(order.getEquipmentId()); |
| | | log.setBusinessId(order.getId()); |
| | | log.setOperator(order.getOperator()); |
| | | log.setDescription(order.getConfirmComment()); |
| | | log.setCreateTime(order.getActualEndTime()); |
| | | } |
| | | } |
| | | break; |
| | | case THIRD_MAINTENANCE: |
| | | if (result instanceof EamThirdMaintenanceOrder) { |
| | | EamThirdMaintenanceOrder order = (EamThirdMaintenanceOrder) result; |
| | | if (ThirdMaintenanceStatusEnum.COMPLETE.name().equals(order.getMaintenanceStatus())) { |
| | | log.setEquipmentId(order.getEquipmentId()); |
| | | log.setBusinessId(order.getId()); |
| | | log.setOperator(order.getOperator()); |
| | | log.setDescription(order.getLeaderConfirmComment()); |
| | | log.setCreateTime(order.getActualEndTime()); |
| | | } |
| | | } |
| | | break; |
| | | case REPORT_REPAIR: |
| | | if (result instanceof EamReportRepair) { |
| | |
| | | @ApiModelProperty(value = "æ¯å¦MDC设å¤") |
| | | private String deviceTypeMdc; |
| | | |
| | | /** |
| | | * 设å¤å¾ç |
| | | */ |
| | | @ApiModelProperty(value = "设å¤å¾ç") |
| | | private String equipmentImage; |
| | | |
| | | /**é¨é¨åç§°*/ |
| | | @Excel(name = "é¨é¨åç§°", width = 15) |
| | | private transient String orgCodeTxt; |
| | |
| | | <!--æ¥è¯¢è®¾å¤çæ§ä¿¡æ¯--> |
| | | <select id="checkStatusFromEquipmentIds" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentMonitor"> |
| | | SELECT |
| | | t1.equipment_id, |
| | | t2.CollectTime, |
| | | t1.equipment_name, |
| | | t2.Oporation, |
| | | t1.id, |
| | | t1.equipment_status, |
| | | t1.equipment_type equipmentType, |
| | | t3.equipment_type_pictures |
| | | t1.equipment_id, |
| | | t2.CollectTime, |
| | | t1.equipment_name, |
| | | CASE |
| | | |
| | | WHEN repair.count > 0 THEN |
| | | '5' ELSE t2.Oporation |
| | | END AS Oporation, |
| | | t1.id, |
| | | t1.equipment_status, |
| | | t1.equipment_type equipmentType, |
| | | t1.equipment_image equipmentTypePictures |
| | | |
| | | FROM |
| | | mdc_equipment t1 |
| | | LEFT JOIN Equipment t2 ON t1.equipment_id = t2.EquipmentID |
| | | LEFT JOIN mdc_equipment_type t3 ON t1.equipment_type = t3.equipment_type_name |
| | | WHERE equipment_id IN |
| | | mdc_equipment t1 |
| | | LEFT JOIN Equipment t2 ON t1.equipment_id = t2.EquipmentID |
| | | LEFT JOIN ( |
| | | SELECT |
| | | e1.equipment_code, |
| | | COUNT(1) COUNT |
| | | FROM |
| | | eam_report_repair r1 |
| | | INNER JOIN eam_equipment e1 ON e1.id = r1.equipment_id |
| | | WHERE |
| | | r1.report_status NOT IN ('COMPLETE', 'ABOLISH') |
| | | GROUP BY |
| | | e1.equipment_code) repair ON repair.equipment_code = t1.equipment_id |
| | | WHERE t1.equipment_id IN |
| | | <foreach collection="equipmentIds" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | |
| | | case 22: |
| | | mdcEquipmentMonitor.setOporationDict("æ¥è¦"); |
| | | break; |
| | | case 5: |
| | | mdcEquipmentMonitor.setOporationDict("æ
é"); |
| | | break; |
| | | default: |
| | | mdcEquipmentMonitor.setOporationDict("å
³æº"); |
| | | break; |
| | |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | if (StringUtils.isNotEmpty(user.getEquipmentIds())) { |
| | | return this.baseMapper.selectList(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, Arrays.asList(user.getEquipmentIds().split(StringPool.COMMA)))); |
| | | return this.baseMapper.selectList(new LambdaQueryWrapper<MdcEquipment>().in(MdcEquipment::getEquipmentId, Arrays.asList(user.getEquipmentIds().split(StringPool.COMMA)))); |
| | | } |
| | | //è·åææäº§çº¿æ°æ® |
| | | List<MdcProduction> productionList = mdcProductionService.list(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()).orderByAsc(MdcProduction::getProductionOrder)); |
| | |
| | | return Result.OK(result); |
| | | } |
| | | |
| | | // @ApiOperation(value = "æ°ååªççæ¿-è®¾å¤æ
é", notes = "æ°ååªççæ¿-è®¾å¤æ
é") |
| | | // @GetMapping("/equAlarmList") |
| | | // public Result<?> equAlarmList(@ApiParam(value = "productionId", required = true) String productionId) { |
| | | // dtBoardService. |
| | | // } |
| | | @ApiOperation(value = "æ°ååªççæ¿-è®¾å¤æ
é", notes = "æ°ååªççæ¿-è®¾å¤æ
é") |
| | | @GetMapping("/equRepairList") |
| | | public Result<?> equRepairList(@ApiParam(value = "productionId", required = true) String productionId) { |
| | | List<EquRepair> result = dtBoardService.equRepairList(productionId); |
| | | return Result.OK(result); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°ååªççæ¿-设å¤å®ç¯ä¿¡æ¯", notes = "æ°ååªççæ¿-设å¤å®ç¯ä¿¡æ¯") |
| | | @GetMapping("/equAndonList") |
| | | public Result<?> equAndonList(@ApiParam(value = "productionId", required = true) String productionId) { |
| | | List<EquAndon> result = dtBoardService.equAndonList(productionId); |
| | | return Result.OK(result); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.board.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.board.vo.EquRepair; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-06-11 |
| | | * @Description: |
| | | */ |
| | | @Mapper |
| | | public interface DtBoardMapper { |
| | | List<EquRepair> equRepairList(@Param("equipmentIdList") List<String> equipmentIdList, @Param("date") String date); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.board.mapper.DtBoardMapper"> |
| | | |
| | | <select id="equRepairList" resultType="org.jeecg.modules.board.vo.EquRepair"> |
| | | SELECT |
| | | t3.equipment_code equipmentId, |
| | | COUNT(*) faultNum, |
| | | ROUND( |
| | | SUM(DATEDIFF(MINUTE, t2.fault_start_time, t1.actual_end_time)) / 60.0, |
| | | 2 |
| | | ) faultTime |
| | | FROM |
| | | eam_repair_order t1 |
| | | LEFT JOIN eam_report_repair t2 ON t1.report_id = t2.id |
| | | LEFT JOIN eam_equipment t3 ON t1.equipment_id = t3.id |
| | | WHERE |
| | | t1.repair_status = 'COMPLETE' |
| | | AND t2.fault_start_time > #{date} |
| | | AND t3.equipment_code IN |
| | | <foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=","> |
| | | #{ id } |
| | | </foreach> |
| | | GROUP BY |
| | | t3.equipment_code |
| | | </select> |
| | | </mapper> |
| | |
| | | List<EquDowntimeInfo> equDowntimeStatistics(String productionId); |
| | | |
| | | List<EquAlarm> equAlarmList(String productionId); |
| | | |
| | | List<EquRepair> equRepairList(String productionId); |
| | | |
| | | List<EquAndon> equAndonList(String productionId); |
| | | |
| | | } |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.modules.board.mapper.DtBoardMapper; |
| | | import org.jeecg.modules.board.service.IDtBoardService; |
| | | import org.jeecg.modules.board.vo.*; |
| | | import org.jeecg.modules.eam.service.IEamRepairOrderService; |
| | | import org.jeecg.modules.mdc.constant.MdcConstant; |
| | | import org.jeecg.modules.mdc.entity.*; |
| | | import org.jeecg.modules.mdc.service.*; |
| | |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private IMdcAlarmInfoService mdcAlarmInfoService; |
| | | |
| | | @Resource |
| | | private DtBoardMapper dtBoardMapper; |
| | | |
| | | @Resource |
| | | private IAndonOrderService andonOrderService; |
| | | |
| | | /** |
| | | * 车é´ä¿¡æ¯ |
| | |
| | | if (equipmentIdList == null || equipmentIdList.isEmpty()) { |
| | | return null; |
| | | } |
| | | List<EquipmentAlarm> equipmentAlarmList = equipmentAlarmService.list(new LambdaQueryWrapper<EquipmentAlarm>().in(EquipmentAlarm::getEquipmentid, equipmentIdList).orderByDesc(EquipmentAlarm::getCollecttime).isNotNull(EquipmentAlarm::getAlarmNo).last("TOP 15")); |
| | | List<EquipmentAlarm> equipmentAlarmList = equipmentAlarmService.equAlarmList(equipmentIdList); |
| | | if (equipmentAlarmList == null || equipmentAlarmList.isEmpty()) { |
| | | return null; |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * è®¾å¤æ
é |
| | | */ |
| | | @Override |
| | | public List<EquRepair> equRepairList(String productionId) { |
| | | List<String> proIds = mdcProductionService.findChildByProId(productionId); |
| | | if (proIds == null || proIds.isEmpty()) { |
| | | return null; |
| | | } |
| | | List<String> equipmentIdList = mdcEquipmentService.getEquIdsByProIds(proIds); |
| | | if (equipmentIdList == null || equipmentIdList.isEmpty()) { |
| | | return null; |
| | | } |
| | | LocalDateTime currentDate = LocalDate.now().minusMonths(1).atStartOfDay(); |
| | | String format = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | | List<EquRepair> result = dtBoardMapper.equRepairList(equipmentIdList, format); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 设å¤å®ç¯é®é¢ |
| | | */ |
| | | @Override |
| | | public List<EquAndon> equAndonList(String productionId) { |
| | | List<String> proIds = mdcProductionService.findChildByProId(productionId); |
| | | if (proIds == null || proIds.isEmpty()) { |
| | | return null; |
| | | } |
| | | List<String> equipmentIdList = mdcEquipmentService.getEquIdsByProIds(proIds); |
| | | if (equipmentIdList == null || equipmentIdList.isEmpty()) { |
| | | return null; |
| | | } |
| | | List<EquAndon> result = andonOrderService.equAndonList(equipmentIdList); |
| | | return result; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.board.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-06-12 |
| | | * @Description: å®ç¯ä¿¡æ¯ |
| | | */ |
| | | @Data |
| | | public class EquAndon { |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentId; |
| | | /** |
| | | * å®ç¯é®é¢ |
| | | */ |
| | | private String andonInfo; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.board.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-06-10 |
| | | * @Description: è®¾å¤æ
é |
| | | */ |
| | | @Data |
| | | public class EquRepair { |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentId; |
| | | /** |
| | | * æ
鿬¡æ° |
| | | */ |
| | | private BigDecimal faultNum; |
| | | /** |
| | | * æ
éæ¶é¿ |
| | | */ |
| | | private BigDecimal faultTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.modules.mdc.entity.AndonOrder; |
| | | import org.jeecg.modules.mdc.service.IAndonOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Description: andon_order |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-11 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="andon_order") |
| | | @RestController |
| | | @RequestMapping("/AndonOrder/andonOrder") |
| | | @Slf4j |
| | | public class AndonOrderController extends JeecgController<AndonOrder, IAndonOrderService> { |
| | | @Autowired |
| | | private IAndonOrderService andonOrderService; |
| | | |
| | | /** |
| | | * ç¨åºå¼å« |
| | | * |
| | | * @param andonOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å®ç¯å·¥å-ç¨åºå¼å«") |
| | | @ApiOperation(value = "å®ç¯å·¥å-ç¨åºå¼å«", notes = "å®ç¯å·¥å-ç¨åºå¼å«") |
| | | @PostMapping(value = "/procedureCall") |
| | | public Result<?> procedureCall(@RequestBody AndonOrder andonOrder) { |
| | | andonOrderService.procedureCall(andonOrder); |
| | | return Result.OK("å¼å«æåï¼"); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @Description: mdc_equipment_punch |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-09 |
| | | * @Date: 2025-06-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="ä¸ä¸çæå¡è®°å½è¡¨") |
| | | @Api(tags = "ä¸ä¸çæå¡è®°å½è¡¨") |
| | | @RestController |
| | | @RequestMapping("/mdcEquipmentPunch") |
| | | @Slf4j |
| | | public class MdcEquipmentPunchController extends JeecgController<MdcEquipmentPunch, IMdcEquipmentPunchService> { |
| | | @Autowired |
| | | private IMdcEquipmentPunchService mdcEquipmentPunchService; |
| | | @Autowired |
| | | private IMdcEquipmentPunchService mdcEquipmentPunchService; |
| | | |
| | | private static final String msg = "æå¡æåï¼"; |
| | | |
| | | /** |
| | | * æ¥è¯¢å½åç»å½äººæè´è´£è®¾å¤æå¡æ
åµ |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value="æ¥è¯¢å½åç»å½äººæè´è´£è®¾å¤æå¡æ
åµ", notes="æ¥è¯¢å½åç»å½äººæè´è´£è®¾å¤æå¡æ
åµ") |
| | | @GetMapping(value = "/list") |
| | | public Result<List<MdcEquipmentPunch>> queryList() { |
| | | return Result.OK(mdcEquipmentPunchService.queryList()); |
| | | } |
| | | private static final String msg = "æå¡æåï¼"; |
| | | |
| | | /** |
| | | * ä¸çæå¡ |
| | | * |
| | | * @param mdcEquipmentPunch |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ä¸çæå¡") |
| | | @ApiOperation(value="ä¸çæå¡", notes="ä¸çæå¡") |
| | | @PostMapping(value = "/workUp") |
| | | public Result<String> workUp(@RequestBody MdcEquipmentPunch mdcEquipmentPunch) { |
| | | mdcEquipmentPunchService.workUp(mdcEquipmentPunch); |
| | | return Result.OK(msg); |
| | | } |
| | | /** |
| | | * æ¥è¯¢å½åç»å½äººæè´è´£è®¾å¤æå¡æ
åµ |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "æ¥è¯¢å½åç»å½äººæè´è´£è®¾å¤æå¡æ
åµ", notes = "æ¥è¯¢å½åç»å½äººæè´è´£è®¾å¤æå¡æ
åµ") |
| | | @GetMapping(value = "/list") |
| | | public Result<List<MdcEquipmentPunch>> queryList() { |
| | | return Result.OK(mdcEquipmentPunchService.queryList()); |
| | | } |
| | | |
| | | /** |
| | | * ä¸çæå¡ |
| | | * |
| | | * @param mdcEquipmentPunch |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ä¸çæå¡") |
| | | @ApiOperation(value="ä¸çæå¡", notes="ä¸çæå¡") |
| | | @PostMapping(value = "/workDown") |
| | | public Result<String> workDown(@RequestBody MdcEquipmentPunch mdcEquipmentPunch) { |
| | | mdcEquipmentPunchService.workDown(mdcEquipmentPunch); |
| | | return Result.OK(msg); |
| | | } |
| | | /** |
| | | * ä¸çæå¡ |
| | | * |
| | | * @param mdcEquipmentPunch |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ä¸çæå¡") |
| | | @ApiOperation(value = "ä¸çæå¡", notes = "ä¸çæå¡") |
| | | @PostMapping(value = "/workUp") |
| | | public Result<String> workUp(@RequestBody MdcEquipmentPunch mdcEquipmentPunch) { |
| | | mdcEquipmentPunchService.workUp(mdcEquipmentPunch); |
| | | return Result.OK(msg); |
| | | } |
| | | |
| | | /** |
| | | * ä¸çæå¡ |
| | | * |
| | | * @param mdcEquipmentPunch |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "ä¸çæå¡") |
| | | @ApiOperation(value = "ä¸çæå¡", notes = "ä¸çæå¡") |
| | | @PostMapping(value = "/workDown") |
| | | public Result<String> workDown(@RequestBody MdcEquipmentPunch mdcEquipmentPunch) { |
| | | mdcEquipmentPunchService.workDown(mdcEquipmentPunch); |
| | | return Result.OK(msg); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentPunchRate; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentPunchRateService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @Description: mdc_equipment_punch_rate |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags = "è®¾å¤æå¡çæ¥è¡¨") |
| | | @RestController |
| | | @RequestMapping("/mdcEquipmentPunchRate") |
| | | @Slf4j |
| | | public class MdcEquipmentPunchRateController extends JeecgController<MdcEquipmentPunchRate, IMdcEquipmentPunchRateService> { |
| | | @Autowired |
| | | private IMdcEquipmentPunchRateService mdcEquipmentPunchService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param mdEquipmentPunch æ¥è¯¢åæ° |
| | | * @param pageNo å½å页ç |
| | | * @param pageSize æ¯é¡µæ¡æ° |
| | | * @param req 请æ±å¯¹è±¡ |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "è®¾å¤æå¡ç-å页å表æ¥è¯¢", notes = "è®¾å¤æå¡ç-å页å表æ¥è¯¢") |
| | | @AutoLog(value = "è®¾å¤æå¡ç-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/queryPageList") |
| | | public Result<IPage<MdcEquipmentPunchRate>> queryPageList(MdcEquipmentPunchRate mdEquipmentPunch, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | |
| | | QueryWrapper<MdcEquipmentPunchRate> queryWrapper = QueryGenerator.initQueryWrapper(mdEquipmentPunch, req.getParameterMap()); |
| | | Page<MdcEquipmentPunchRate> page = new Page<MdcEquipmentPunchRate>(pageNo, pageSize); |
| | | IPage<MdcEquipmentPunchRate> pageList = mdcEquipmentPunchService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param mdcEquipmentPunchRate |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MdcEquipmentPunchRate mdcEquipmentPunchRate) { |
| | | return super.exportXls(request, mdcEquipmentPunchRate, MdcEquipmentPunchRate.class, "è®¾å¤æå¡çæ¥è¡¨"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.dto; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | @Data |
| | | public class MdcEquipmentPunchExportDTO { |
| | | |
| | | |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æå¡ç¨æ·") |
| | | @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname") |
| | | private String punchUser; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ä¸çæ¶é´") |
| | | private Date checkInTime; |
| | | /** |
| | | * ä¸çæ¶é´ |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "ä¸çæ¶é´") |
| | | private Date checkOutTime; |
| | | /** |
| | | * è®°å½æ¥æ |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "è®°å½æ¥æ") |
| | | private String recordDate; |
| | | |
| | | |
| | | @ApiModelProperty(value = "çæ¬¡") |
| | | @Dict(dicCode = "shift_schedule") |
| | | private Integer shiftSchedule; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦ç¼ºå¡") |
| | | private Integer isAbsent; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦è¿å°") |
| | | private Integer isLate; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ©é") |
| | | private Integer isEarly; |
| | | |
| | | |
| | | /** |
| | | * æ©çä¸çæå¡ç |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ©çä¸çæå¡ç") |
| | | private BigDecimal morningShiftInRate; |
| | | |
| | | /** |
| | | * æçä¸çæå¡ç |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "æçä¸çæå¡ç") |
| | | private BigDecimal eveningShiftInRate; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æ©çä¸çæå¡ç") |
| | | private BigDecimal morningShiftOutRate; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æçä¸çæå¡ç") |
| | | private BigDecimal eveningShiftOutRate; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç½çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer morningShiftInDeviceNum; |
| | | |
| | | |
| | | @ApiModelProperty(value = "ç½çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer morningShiftOutDeviceNum; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å¤çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer eveningShiftInDeviceNum; |
| | | |
| | | @ApiModelProperty(value = "å¤çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer eveningShiftOutDeviceNum; |
| | | |
| | | @ApiModelProperty(value = "è®¾å¤æ»æ°") |
| | | private Integer deviceCountNum; |
| | | |
| | | private String punchUserRealName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @Description: andon_order |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-11 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("andon_order") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "andon_order对象", description = "andon_order") |
| | | public class AndonOrder implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentId; |
| | | /** |
| | | * æå±åæ¿ |
| | | */ |
| | | @Excel(name = "æå±åæ¿", width = 15) |
| | | @ApiModelProperty(value = "æå±åæ¿") |
| | | private String plantName; |
| | | /** |
| | | * å®ç¯ç±»å |
| | | */ |
| | | @Excel(name = "å®ç¯ç±»å", width = 15) |
| | | @ApiModelProperty(value = "å®ç¯ç±»å") |
| | | @Dict(dicCode = "andon_type") |
| | | private String andonType; |
| | | /** |
| | | * å®ç¯äºº(å¼å«äºº) |
| | | */ |
| | | @Excel(name = "å®ç¯äºº", width = 15) |
| | | @ApiModelProperty(value = "å®ç¯äºº") |
| | | private String operator; |
| | | /** |
| | | * å¼å«åå |
| | | */ |
| | | @Excel(name = "å¼å«åå ", width = 15) |
| | | @ApiModelProperty(value = "å¼å«åå ") |
| | | private String callReason; |
| | | /** |
| | | * å®ç¯æ¶é´ |
| | | */ |
| | | @Excel(name = "å®ç¯æ¶é´", width = 15, format = DatePattern.NORM_DATETIME_PATTERN) |
| | | @JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @ApiModelProperty(value = "å®ç¯æ¶é´") |
| | | private Date operateTime; |
| | | /** |
| | | * ååºäºº(责任人) |
| | | */ |
| | | @Excel(name = "ååºäºº", width = 15) |
| | | @ApiModelProperty(value = "ååºäºº") |
| | | private String responder; |
| | | /** |
| | | * ååºæ¶é´ |
| | | */ |
| | | @Excel(name = "ååºæ¶é´", width = 15, format = DatePattern.NORM_DATETIME_PATTERN) |
| | | @JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @ApiModelProperty(value = "ååºæ¶é´") |
| | | private Date responseTime; |
| | | /** |
| | | * å¤ç人 |
| | | */ |
| | | @Excel(name = "å¤ç人", width = 15) |
| | | @ApiModelProperty(value = "å¤ç人") |
| | | private String processor; |
| | | /** |
| | | * å¤ç宿æ¶é´ |
| | | */ |
| | | @Excel(name = "å¤ç宿æ¶é´", width = 15, format = DatePattern.NORM_DATETIME_PATTERN) |
| | | @JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @ApiModelProperty(value = "å¤ç宿æ¶é´") |
| | | private Date processTime; |
| | | /** |
| | | * å®ç¯ç¶æ;å¾
ååºãå¾
å¤çã已宿 |
| | | */ |
| | | @Excel(name = "å®ç¯ç¶æ;å¾
ååºãå¾
å¤çã已宿", width = 15) |
| | | @ApiModelProperty(value = "å®ç¯ç¶æ;å¾
ååºãå¾
å¤çã已宿") |
| | | @Dict(dicCode = "order_status") |
| | | private String orderStatus; |
| | | /** |
| | | * é®é¢æè¿° |
| | | */ |
| | | @Excel(name = "é®é¢æè¿°", width = 15) |
| | | @ApiModelProperty(value = "é®é¢æè¿°") |
| | | private String problemDescreption; |
| | | /** |
| | | * å¤çç»ææè¿° |
| | | */ |
| | | @Excel(name = "å¤çç»ææè¿°", width = 15) |
| | | @ApiModelProperty(value = "å¤çç»ææè¿°") |
| | | private String resolutionDescreption; |
| | | /** |
| | | * å¤çç»æå¾ç |
| | | */ |
| | | @Excel(name = "å¤çç»æå¾ç", width = 15) |
| | | @ApiModelProperty(value = "å¤çç»æå¾ç") |
| | | private String imageFiles; |
| | | /** |
| | | * å 餿 è®° |
| | | */ |
| | | @Excel(name = "å 餿 è®°", width = 15) |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | @TableLogic |
| | | private Integer delFlag = CommonConstant.DEL_FLAG_0; |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | } |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @Description: mdc_equipment_punch |
| | |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "mdc_equipment_punch对象", description = "mdc_equipment_punch") |
| | | public class MdcEquipmentPunch implements Serializable { |
| | | public class MdcEquipmentPunch extends JeecgEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Excel(name = "æå¡ç¨æ·", width = 15) |
| | | @ApiModelProperty(value = "æå¡ç¨æ·") |
| | | @Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname") |
| | | private String punchUser; |
| | | /** |
| | | * æå¡ç¨æ·è´¦å· |
| | | */ |
| | | @Excel(name = "æå¡ç¨æ·è´¦å·", width = 15) |
| | | |
| | | @ApiModelProperty(value = "æå¡ç¨æ·è´¦å·") |
| | | @TableField(exist = false) |
| | | private String punchUserRealName; |
| | | /** |
| | | * æå¡ç¨æ·åç§° |
| | | */ |
| | | @Excel(name = "æå¡ç¨æ·åç§°", width = 15) |
| | | @ApiModelProperty(value = "æå¡ç¨æ·åç§°") |
| | | @TableField(exist = false) |
| | | private String punchUserUserName; |
| | |
| | | @ApiModelProperty(value = "è®°å½æ¥æ") |
| | | private String recordDate; |
| | | /** |
| | | * çæ¬¡ |
| | | * çæ¬¡ |
| | | */ |
| | | @Excel(name = "çæ¬¡", width = 15) |
| | | @ApiModelProperty(value = "çæ¬¡") |
| | |
| | | @ApiModelProperty(value = "æ¯å¦ç¼ºå¡") |
| | | private Integer isAbsent; |
| | | /** |
| | | * æ¯å¦è¿å° |
| | | * æ¯å¦è¿å°ï¼0æªæ©éï¼1æ©éï¼ |
| | | */ |
| | | @Excel(name = "æ¯å¦è¿å°", width = 15) |
| | | @ApiModelProperty(value = "æ¯å¦è¿å°") |
| | |
| | | @Excel(name = "æ¯å¦æ©é", width = 15) |
| | | @ApiModelProperty(value = "æ¯å¦æ©é") |
| | | private Integer isEarly; |
| | | |
| | | /** |
| | | * å建人 |
| | | * æ©çä¸çæå¡ç |
| | | */ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | @TableField(exist = false) |
| | | @Excel(name = "æ©çä¸çæå¡ç", width = 15) |
| | | @ApiModelProperty(value = "æ©çä¸çæå¡ç") |
| | | private BigDecimal morningShiftInRate; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | * æçä¸çæå¡ç |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | @TableField(exist = false) |
| | | @Excel(name = "æçä¸çæå¡ç", width = 15) |
| | | @ApiModelProperty(value = "æçä¸çæå¡ç") |
| | | private BigDecimal eveningShiftInRate; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | * æ©çä¸çæå¡ç |
| | | */ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | @TableField(exist = false) |
| | | @Excel(name = "æ©çä¸çæå¡ç", width = 15) |
| | | @ApiModelProperty(value = "æ©çä¸çæå¡ç") |
| | | private BigDecimal morningShiftOutRate; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | * æçä¸çæå¡ç |
| | | */ |
| | | @JsonFormat(timezone = "GMT+8", pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | @TableField(exist = false) |
| | | @Excel(name = "æçä¸çæå¡ç", width = 15) |
| | | @ApiModelProperty(value = "æçä¸çæå¡ç") |
| | | private BigDecimal eveningShiftOutRate; |
| | | |
| | | /** |
| | | * ç½çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | @TableField(exist = false) |
| | | @Excel(name = "ç½çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "ç½çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer morningShiftInDeviceNum; |
| | | |
| | | /** |
| | | * ç½çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | @TableField(exist = false) |
| | | @Excel(name = "ç½çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "ç½çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer morningShiftOutDeviceNum; |
| | | /** |
| | | * å¤çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | @TableField(exist = false) |
| | | @Excel(name = "å¤çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "å¤çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer eveningShiftInDeviceNum; |
| | | /** |
| | | * å¤çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | @TableField(exist = false) |
| | | @Excel(name = "å¤çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "å¤çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer eveningShiftOutDeviceNum; |
| | | /** |
| | | * è®¾å¤æ»æ° |
| | | */ |
| | | @TableField(exist = false) |
| | | @Excel(name = "è®¾å¤æ»æ°", width = 15) |
| | | @ApiModelProperty(value = "è®¾å¤æ»æ°") |
| | | private Integer deviceCountNum; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.jeecg.common.system.base.entity.JeecgEntity; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @Description: mdc_equipment_punch_rate |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("mdc_equipment_punch_rate") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value = "mdc_equipment_punch_rate对象", description = "mdc_equipment_punch_rate") |
| | | public class MdcEquipmentPunchRate extends JeecgEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "id") |
| | | private String id; |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private String equipmentId; |
| | | |
| | | |
| | | /** |
| | | * è®°å½æ¥æ |
| | | */ |
| | | @Excel(name = "è®°å½æ¥æ", width = 15) |
| | | @ApiModelProperty(value = "è®°å½æ¥æ") |
| | | private String theDate; |
| | | /** |
| | | * çæ¬¡ |
| | | */ |
| | | @Excel(name = "çæ¬¡", width = 15) |
| | | @ApiModelProperty(value = "çæ¬¡") |
| | | @Dict(dicCode = "shift_schedule") |
| | | private Integer shiftSchedule; |
| | | |
| | | /** |
| | | * æ©çä¸çæå¡ç |
| | | */ |
| | | |
| | | @Excel(name = "æ©çä¸çæå¡ç(%)", width = 15) |
| | | @ApiModelProperty(value = "æ©çä¸çæå¡ç") |
| | | private BigDecimal mornShiftInRate; |
| | | |
| | | /** |
| | | * æçä¸çæå¡ç |
| | | */ |
| | | |
| | | @Excel(name = "æçä¸çæå¡ç(%)", width = 15) |
| | | @ApiModelProperty(value = "æçä¸çæå¡ç") |
| | | private BigDecimal evenShiftInRate; |
| | | |
| | | /** |
| | | * æ©çä¸çæå¡ç |
| | | */ |
| | | |
| | | @Excel(name = "æ©çä¸çæå¡ç(%)", width = 15) |
| | | @ApiModelProperty(value = "æ©çä¸çæå¡ç") |
| | | private BigDecimal mornShiftOutRate; |
| | | |
| | | /** |
| | | * æçä¸çæå¡ç |
| | | */ |
| | | |
| | | @Excel(name = "æçä¸çæå¡ç(%)", width = 15) |
| | | @ApiModelProperty(value = "æçä¸çæå¡ç") |
| | | private BigDecimal evenShiftOutRate; |
| | | |
| | | /** |
| | | * ç½çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | |
| | | @Excel(name = "ç½çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "ç½çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer mornShiftInNum; |
| | | |
| | | /** |
| | | * ç½çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | |
| | | @Excel(name = "ç½çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "ç½çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer mornShiftOutNum; |
| | | /** |
| | | * å¤çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | |
| | | @Excel(name = "å¤çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "å¤çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer evenShiftInNum; |
| | | /** |
| | | * å¤çä¸çæå¡è®¾å¤æ°é |
| | | */ |
| | | |
| | | @Excel(name = "å¤çä¸çæå¡è®¾å¤æ°é", width = 15) |
| | | @ApiModelProperty(value = "å¤çä¸çæå¡è®¾å¤æ°é") |
| | | private Integer evenShiftOutNum; |
| | | /** |
| | | * è®¾å¤æ»æ° |
| | | */ |
| | | |
| | | @Excel(name = "è®¾å¤æ»æ°", width = 15) |
| | | @ApiModelProperty(value = "è®¾å¤æ»æ°") |
| | | private Integer deviceCountNum; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | package org.jeecg.modules.mdc.job; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentPunch; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentPunchRateService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentPunchService; |
| | | import org.jeecg.modules.quartz.entity.QuartzJob; |
| | | import org.jeecg.modules.quartz.entity.SysQuartzLog; |
| | | import org.jeecg.modules.quartz.service.IQuartzJobService; |
| | | import org.jeecg.modules.quartz.service.ISysQuartzLogService; |
| | | import org.jeecg.modules.system.service.ISysAnnouncementService; |
| | | import org.quartz.Job; |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: æ¯æ¥åæ¨å®æ¶è®¡ç®åä¸å¤©çè®¾å¤æå¡çï¼å¹¶å
¥åº |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-06-12 |
| | | */ |
| | | @Slf4j |
| | | public class DailyPunchRateJob implements Job { |
| | | |
| | | private String parameter; // å¯éåæ°ï¼æå®æ¥æï¼å¦ "2025-06-11"ï¼ |
| | | |
| | | public void setParameter(String parameter) { |
| | | this.parameter = parameter; |
| | | } |
| | | |
| | | @Resource |
| | | private IQuartzJobService quartzJobService; |
| | | |
| | | @Resource |
| | | private ISysQuartzLogService sysQuartzLogService; |
| | | |
| | | @Resource |
| | | private ISysAnnouncementService sysAnnouncementService; |
| | | |
| | | @Resource |
| | | private IMdcEquipmentPunchService mdcEquipmentPunchService; |
| | | |
| | | |
| | | @Resource |
| | | private IMdcEquipmentPunchRateService mdcEquipmentPunchRateService; |
| | | |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | SysQuartzLog quartzLog = new SysQuartzLog(); |
| | | quartzLog.setCreateTime(new Date()); |
| | | |
| | | List<QuartzJob> jobList = this.quartzJobService.findByJobClassName(this.getClass().getName()); |
| | | if (jobList != null && !jobList.isEmpty()) { |
| | | quartzLog.setJobId(jobList.get(0).getId()); |
| | | } |
| | | |
| | | log.info("ãå¼å§æ§è¡æ¯æ¥è®¾å¤æå¡çç»è®¡ä»»å¡ã"); |
| | | |
| | | long startTime = System.currentTimeMillis(); |
| | | |
| | | try { |
| | | String yesterdayStr; |
| | | |
| | | |
| | | |
| | | if (parameter != null && !parameter.isEmpty()) { |
| | | yesterdayStr = parameter; // æ¯ææå¨ä¼ å |
| | | } else { |
| | | LocalDate yesterday = LocalDate.now().minusDays(1); |
| | | yesterdayStr = yesterday.format(DateTimeFormatter.ofPattern(DatePattern.PURE_DATE_PATTERN)); // æ ¼å¼å为 "yyyy-MM-dd" |
| | | } |
| | | log.info("â
æåå®ææ¯æ¥è®¾å¤æå¡çç»è®¡æ°æ®", yesterdayStr); |
| | | // Step 1ï¼è·åæ¨æ¥æå¡æ°æ® |
| | | List<MdcEquipmentPunch> punchRecords = mdcEquipmentPunchService.getYesterdayRecords(yesterdayStr); |
| | | log.info("â
æåå®ææ¯æ¥è®¾å¤æå¡çç»è®¡æ°æ®", punchRecords); |
| | | if (punchRecords == null || punchRecords.isEmpty()) { |
| | | log.warn("â ï¸ æ²¡ææ¾å°æ¨æ¥è®¾å¤æå¡æ°æ®"); |
| | | quartzLog.setIsSuccess(0); |
| | | return; |
| | | } |
| | | |
| | | // Step 2ï¼ä¿åå°æå¡ç表 |
| | | mdcEquipmentPunchRateService.savePunchRates(yesterdayStr, punchRecords); |
| | | |
| | | quartzLog.setIsSuccess(0); |
| | | log.info("â
æåå®ææ¯æ¥è®¾å¤æå¡çç»è®¡ï¼å
±å¤ç {} æ¡è®°å½ï¼æ¥æï¼{}", punchRecords.size(), yesterdayStr); |
| | | } catch (Exception e) { |
| | | quartzLog.setIsSuccess(-1); |
| | | quartzLog.setExceptionDetail(e.getMessage()); |
| | | log.error("â è®¾å¤æå¡çç»è®¡ä»»å¡æ§è¡å¤±è´¥", e); |
| | | sysAnnouncementService.jobSendMessage("è®¾å¤æå¡çç»è®¡ä»»å¡", e.getMessage()); |
| | | } |
| | | |
| | | // è®°å½æ§è¡æ¶é´ |
| | | long endTime = System.currentTimeMillis(); |
| | | quartzLog.setExecutionTime((int)(endTime - startTime)); |
| | | sysQuartzLogService.save(quartzLog); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.entity.AndonOrder; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: andon_order |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-11 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface AndonOrderMapper extends BaseMapper<AndonOrder> { |
| | | |
| | | List<AndonOrder> equAndonList(@Param("equipmentIdList") List<String> equipmentIdList); |
| | | } |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.mdc.entity.EquipmentAlarm; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author: LiuS |
| | | * @create: 2023-04-12 16:39 |
| | | */ |
| | | public interface EquipmentAlarmMapper extends BaseMapper<EquipmentAlarm> { |
| | | List<EquipmentAlarm> equAlarmList(@Param("equipmentIdList") List<String> equipmentIdList); |
| | | } |
| | |
| | | public interface MdcEquipmentPunchMapper extends BaseMapper<MdcEquipmentPunch> { |
| | | |
| | | List<MdcEquipmentPunch> list(@Param("equipmentIds") List<String> equipmentIds, @Param("date") String date); |
| | | |
| | | |
| | | // æ¥è¯¢æ©çä¸çæå¡è®¾å¤æ° |
| | | int countMorningShiftIn(@Param("date") String date); |
| | | |
| | | // æ¥è¯¢æçä¸çæå¡è®¾å¤æ° |
| | | int countEveningShiftIn(@Param("date") String date); |
| | | |
| | | // æ¥è¯¢æ©çä¸çæå¡è®¾å¤æ° |
| | | int countMorningShiftOut(@Param("date") String date); |
| | | |
| | | // æ¥è¯¢æçä¸çæå¡è®¾å¤æ° |
| | | int countEveningShiftOut(@Param("date") String date); |
| | | /** |
| | | * è·åææè®¾å¤æ° |
| | | */ |
| | | int getTotalDeviceCount(); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentPunchRate; |
| | | |
| | | /** |
| | | * @Description: mdc_equipment_punch_rate |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface MdcEquipmentPunchRateMapper extends BaseMapper<MdcEquipmentPunchRate> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.mdc.mapper.AndonOrderMapper"> |
| | | |
| | | <select id="equAndonList" resultType="org.jeecg.modules.mdc.entity.AndonOrder"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | andon_order |
| | | WHERE |
| | | CONVERT ( DATE, create_time ) = CONVERT ( DATE, GETDATE( ) ) |
| | | AND equipment_id IN |
| | | <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | ORDER BY |
| | | create_time |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.mdc.mapper.EquipmentAlarmMapper"> |
| | | |
| | | <select id="equAlarmList" resultType="org.jeecg.modules.mdc.entity.EquipmentAlarm"> |
| | | SELECT TOP 15 * |
| | | FROM |
| | | EquipmentAlarm |
| | | WHERE EquipmentID IN |
| | | <foreach collection="equipmentIdList" index="index" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | AND alarmNo != '' |
| | | ORDER BY collecttime DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | <select id="equDowntimeStatistics" resultType="org.jeecg.modules.board.vo.EquDowntimeInfo"> |
| | | SELECT |
| | | t2.downtime_description AS shutdown_info, |
| | | SUM ( DATEDIFF( SECOND, t1.start_date, t1.end_date ) ) / 3600.0 AS duration_hours |
| | | SUM ( DATEDIFF( SECOND, t1.start_date, t1.end_date ) ) / 3600.0 AS duration |
| | | FROM |
| | | mdc_downtime t1 |
| | | LEFT JOIN mdc_downtime_reason t2 ON t1.reason_id = t2.id |
| | |
| | | </foreach> |
| | | GROUP BY |
| | | t2.downtime_description |
| | | ORDER BY |
| | | duration_hours DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | t2.downtime_description downtimeDescription |
| | | FROM mdc_downtime t1 LEFT JOIN mdc_downtime_reason t2 ON t1.reason_id = t2.id |
| | | ${ew.customSqlSegment} |
| | | ORDER BY t1.create_time DESC |
| | | ORDER BY t1.equipment_id DESC, t1.start_date ASC |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | <select id="list" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentPunch"> |
| | | SELECT |
| | | p.id, |
| | | p.equipment_id, |
| | | p.punch_user, |
| | | p.check_in_time, |
| | | p.check_out_time, |
| | | p.record_date, |
| | | p.is_absent, |
| | | p.is_late, |
| | | p.is_early, |
| | | p.create_by, |
| | | p.create_time, |
| | | p.update_by, |
| | | p.update_time, |
| | | p.shift_schedule, |
| | | u.realname punchUserRealName, |
| | | u.username punchUserUserName, |
| | | d1.item_text shiftScheduleName |
| | | p.id, |
| | | p.equipment_id, |
| | | p.punch_user, |
| | | p.check_in_time, |
| | | p.check_out_time, |
| | | p.record_date, |
| | | p.is_absent, |
| | | p.is_late, |
| | | p.is_early, |
| | | p.create_by, |
| | | p.create_time, |
| | | p.update_by, |
| | | p.update_time, |
| | | p.shift_schedule, |
| | | u.realname punchUserRealName, |
| | | u.username punchUserUserName, |
| | | d1.item_text shiftScheduleName |
| | | FROM |
| | | mdc_equipment_punch p |
| | | INNER JOIN sys_user u ON u.id = p.punch_user |
| | | INNER JOIN (SELECT i1.item_text, i1.item_value |
| | | FROM sys_dict_item i1 |
| | | LEFT JOIN sys_dict i2 ON i2.id = i1.dict_id |
| | | WHERE i2.dict_code = 'shift_schedule') d1 |
| | | ON d1.item_value = CAST (p.shift_schedule AS nvarchar) |
| | | mdc_equipment_punch p |
| | | INNER JOIN sys_user u ON u.id = p.punch_user |
| | | INNER JOIN (SELECT i1.item_text, i1.item_value |
| | | FROM sys_dict_item i1 |
| | | LEFT JOIN sys_dict i2 ON i2.id = i1.dict_id |
| | | WHERE i2.dict_code = 'shift_schedule') d1 |
| | | ON d1.item_value = CAST (p.shift_schedule AS nvarchar) |
| | | where 1=1 |
| | | AND p.equipment_id IN |
| | | <foreach collection="equipmentIds" item="equipmentId" open="(" close=")" separator=","> |
| | |
| | | </if> |
| | | order by p.equipment_id desc, p.shift_schedule asc |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢ææè®¾å¤æ°é--> |
| | | <select id="getTotalDeviceCount" resultType="int"> |
| | | SELECT COUNT(*) |
| | | FROM mdc_equipment |
| | | </select> |
| | | |
| | | <!-- æ©ç ä¸çæå¡ --> |
| | | <select id="countMorningShiftIn" resultType="int"> |
| | | SELECT COUNT(DISTINCT equipment_id) |
| | | FROM mdc_equipment_punch |
| | | WHERE record_date = #{date, jdbcType=VARCHAR} |
| | | AND shift_schedule = '1' |
| | | AND check_in_time IS NOT NULL |
| | | </select> |
| | | |
| | | <!-- æç ä¸çæå¡ --> |
| | | <select id="countEveningShiftIn" resultType="int"> |
| | | SELECT COUNT(DISTINCT equipment_id) |
| | | FROM mdc_equipment_punch |
| | | WHERE record_date = #{date, jdbcType=VARCHAR} |
| | | AND shift_schedule = '2' |
| | | AND check_in_time IS NOT NULL |
| | | </select> |
| | | |
| | | <!-- æ©ç ä¸çæå¡ --> |
| | | <select id="countMorningShiftOut" resultType="int"> |
| | | SELECT COUNT(DISTINCT equipment_id) |
| | | FROM mdc_equipment_punch |
| | | WHERE record_date = #{date, jdbcType=VARCHAR} |
| | | AND shift_schedule = '1' |
| | | AND check_out_time IS NOT NULL |
| | | </select> |
| | | |
| | | <!-- æç ä¸çæå¡ --> |
| | | <select id="countEveningShiftOut" resultType="int"> |
| | | SELECT COUNT(DISTINCT equipment_id) |
| | | FROM mdc_equipment_punch |
| | | WHERE record_date = #{date, jdbcType=VARCHAR} |
| | | AND shift_schedule = '2' |
| | | AND check_out_time IS NOT NULL |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.mdc.mapper.MdcEquipmentPunchRateMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | a.EquipmentID equipmentId, |
| | | me.equipment_name equipmentName, |
| | | me.equipment_type equipmentType, |
| | | met.equipment_type_pictures equipmentImage, |
| | | a.Oporation equipmentStatus, |
| | | me.equipment_image equipmentImage, |
| | | CASE |
| | | |
| | | WHEN repair.count > 0 THEN |
| | | '5' ELSE a.Oporation |
| | | END AS equipmentStatus, |
| | | mew.coordinate_left coordinateLeft, |
| | | mew.coordinate_top coordinateTop, |
| | | mew.vw vw, |
| | |
| | | INNER JOIN mdc_equipment_type met ON me.equipment_type = met.equipment_type_name |
| | | AND a.CollectTime= b.maxgdtime |
| | | AND mew.workshop_id = #{ workshopId } |
| | | LEFT JOIN ( |
| | | SELECT |
| | | e1.equipment_code, |
| | | COUNT(1) COUNT |
| | | FROM |
| | | eam_report_repair r1 |
| | | INNER JOIN eam_equipment e1 ON e1.id = r1.equipment_id |
| | | WHERE |
| | | r1.report_status NOT IN ('COMPLETE', 'ABOLISH') |
| | | GROUP BY |
| | | e1.equipment_code) repair ON repair.equipment_code = me.equipment_id |
| | | </select> |
| | | |
| | | <select id="listByUser" resultType="org.jeecg.modules.mdc.entity.MdcWorkshopInfo"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.board.vo.EquAndon; |
| | | import org.jeecg.modules.mdc.entity.AndonOrder; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: andon_order |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-11 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IAndonOrderService extends IService<AndonOrder> { |
| | | |
| | | void procedureCall(AndonOrder andonOrder); |
| | | |
| | | List<EquAndon> equAndonList(List<String> equipmentIdList); |
| | | } |
| | |
| | | */ |
| | | public interface IEquipmentAlarmService extends IService<EquipmentAlarm> { |
| | | List<EquipmentAlarm> findEquipmentAlarmByDate(String equipmentId, Date startTime, Date endTime); |
| | | |
| | | List<EquipmentAlarm> equAlarmList(List<String> equipmentIdList); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentPunch; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentPunchRate; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: mdc_equipment_punch |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IMdcEquipmentPunchRateService extends IService<MdcEquipmentPunchRate> { |
| | | |
| | | |
| | | void savePunchRates(String targetDate, List<MdcEquipmentPunch> punchRecords); |
| | | } |
| | |
| | | void workUp(MdcEquipmentPunch mdcEquipmentPunch); |
| | | |
| | | void workDown(MdcEquipmentPunch mdcEquipmentPunch); |
| | | void fillPunchRates(List<MdcEquipmentPunch> punchList); |
| | | |
| | | /** |
| | | * æ¥è¯¢æå®æ¥æçè®¾å¤æå¡æ°æ®ï¼éå¸¸æ¯æ¨å¤©ï¼ |
| | | */ |
| | | List<MdcEquipmentPunch> getYesterdayRecords(String targetDate); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.parser.Feature; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringPool; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.WebsocketConst; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.modules.board.vo.EquAndon; |
| | | import org.jeecg.modules.mdc.dto.MdcEquProDto; |
| | | import org.jeecg.modules.mdc.entity.AndonOrder; |
| | | import org.jeecg.modules.mdc.mapper.AndonOrderMapper; |
| | | import org.jeecg.modules.mdc.service.IAndonOrderService; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.mdc.util.DateUtils; |
| | | import org.jeecg.modules.mdc.vo.AndonOrderWebSocketVo; |
| | | import org.jeecg.modules.message.websocket.WebSocket; |
| | | import org.jeecg.modules.system.service.ISysDictService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: andon_order |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-11 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class AndonOrderServiceImpl extends ServiceImpl<AndonOrderMapper, AndonOrder> implements IAndonOrderService { |
| | | |
| | | @Resource |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | @Resource |
| | | private WebSocket webSocket; |
| | | @Resource |
| | | private ISysUserService userService; |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | |
| | | @Override |
| | | public void procedureCall(AndonOrder andonOrder) { |
| | | if (StringUtils.isBlank(andonOrder.getEquipmentId())) { |
| | | throw new JeecgBootException("è¯·éæ©è®¾å¤ï¼"); |
| | | } |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | List<String> equipmentIds = Arrays.asList(andonOrder.getEquipmentId().split(StringPool.COMMA)); |
| | | |
| | | List<MdcEquProDto> equipmentList = mdcEquipmentService.findEquProList(equipmentIds); |
| | | Map<String, MdcEquProDto> equipmentIdToProductionIdMap = equipmentList.stream().collect(Collectors.toMap(MdcEquProDto::getEquipmentId, comRateDto -> comRateDto)); |
| | | List<AndonOrder> list = Lists.newArrayList(); |
| | | for (String equipmentId : equipmentIds) { |
| | | AndonOrder andonOrderInfo = new AndonOrder(); |
| | | andonOrderInfo.setEquipmentId(equipmentId); |
| | | andonOrderInfo.setPlantName(equipmentIdToProductionIdMap != null && equipmentIdToProductionIdMap.containsKey(equipmentId) ? equipmentIdToProductionIdMap.get(equipmentId).getId() : null); |
| | | andonOrderInfo.setAndonType(StringPool.ONE); |
| | | andonOrderInfo.setOrderStatus(StringPool.ONE); |
| | | andonOrderInfo.setOperator(andonOrder.getOperator()); |
| | | andonOrderInfo.setOperateTime(new Date()); |
| | | andonOrderInfo.setResponder(userId); |
| | | andonOrderInfo.setCallReason(andonOrder.getCallReason()); |
| | | list.add(andonOrderInfo); |
| | | } |
| | | |
| | | if (this.saveBatch(list)) { |
| | | List<AndonOrderWebSocketVo> andonOrderWebSocketVoList = Lists.newArrayList(); |
| | | //设置websocketè¯·æ±æ¶æ¯æ°æ® |
| | | for (AndonOrder order : list) { |
| | | AndonOrderWebSocketVo andonOrderWebSocketVo = new AndonOrderWebSocketVo(); |
| | | andonOrderWebSocketVo.setEquipmentId(order.getEquipmentId()); |
| | | andonOrderWebSocketVo.setCallPersonnel(userService.getById(order.getOperator()).getRealname()); |
| | | andonOrderWebSocketVo.setCallTime(DateUtils.format(order.getOperateTime(), DatePattern.NORM_DATE_PATTERN)); |
| | | andonOrderWebSocketVo.setCallReason(order.getCallReason()); |
| | | andonOrderWebSocketVo.setAndonType("ç¨åºå¼å«"); |
| | | andonOrderWebSocketVo.setPersonResponsible(user.getRealname()); |
| | | andonOrderWebSocketVo.setRepairTime(StringPool.EMPTY); |
| | | andonOrderWebSocketVo.setFaultInfo(StringPool.EMPTY); |
| | | andonOrderWebSocketVo.setPlantName(equipmentIdToProductionIdMap != null && equipmentIdToProductionIdMap.containsKey(order.getEquipmentId()) ? equipmentIdToProductionIdMap.get(order.getEquipmentId()).getProductionName() : null); |
| | | andonOrderWebSocketVoList.add(andonOrderWebSocketVo); |
| | | } |
| | | |
| | | //åéwebsocketè¯·æ± |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put(WebsocketConst.MSG_CMD, "andon"); |
| | | jsonObject.put("data", andonOrderWebSocketVoList); |
| | | webSocket.sendMessage(jsonObject.toJSONString()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å®ç¯é®é¢å表 |
| | | */ |
| | | @Override |
| | | public List<EquAndon> equAndonList(List<String> equipmentIdList) { |
| | | List<EquAndon> result = new ArrayList<>(); |
| | | List<AndonOrder> andonOrderList = this.baseMapper.equAndonList(equipmentIdList); |
| | | if (andonOrderList != null && !andonOrderList.isEmpty()) { |
| | | andonOrderList.forEach(andonOrder -> { |
| | | EquAndon equAndon = new EquAndon(); |
| | | equAndon.setEquipmentId(andonOrder.getEquipmentId()); |
| | | StringBuilder infoBuilder = new StringBuilder(); |
| | | infoBuilder.append("å®ç¯ç±»å: ").append(sysDictService.queryDictTextByKey("andon_type",andonOrder.getAndonType())).append("\n"); |
| | | infoBuilder.append("å®ç¯äºº: ").append(sysDictService.queryTableDictTextByKey("sys_user", "realname", "id", andonOrder.getOperator())).append("\n"); |
| | | infoBuilder.append("å®ç¯æ¶é´: ").append(DateUtils.format(andonOrder.getOperateTime(), DateUtils.STR_DATE_TIME_SMALL)).append("\n"); |
| | | infoBuilder.append("å®ç¯ç¶æ: ").append(sysDictService.queryDictTextByKey("order_status",andonOrder.getOrderStatus())).append("\n"); |
| | | equAndon.setAndonInfo(infoBuilder.toString()); |
| | | result.add(equAndon); |
| | | }); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | |
| | | import org.jeecg.modules.mdc.service.IEquipmentAlarmService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | .ge(EquipmentAlarm::getCollecttime, startTime).le(EquipmentAlarm::getCollecttime, endTime) |
| | | .eq(EquipmentAlarm::getEquipmentid, equipmentId).orderByDesc(EquipmentAlarm::getCollecttime)); |
| | | } |
| | | |
| | | @Override |
| | | public List<EquipmentAlarm> equAlarmList(List<String> equipmentIdList) { |
| | | return this.baseMapper.equAlarmList(equipmentIdList); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentPunch; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentPunchRate; |
| | | import org.jeecg.modules.mdc.mapper.MdcEquipmentPunchMapper; |
| | | import org.jeecg.modules.mdc.mapper.MdcEquipmentPunchRateMapper; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentPunchRateService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @Description: mdc_equipment_punch |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-06-09 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class MdcEquipmentPunchRateServiceImpl extends ServiceImpl<MdcEquipmentPunchRateMapper, MdcEquipmentPunchRate> implements IMdcEquipmentPunchRateService { |
| | | @Resource |
| | | private MdcEquipmentPunchRateMapper mdcEquipmentPunchRateMapper; |
| | | |
| | | @Resource |
| | | private MdcEquipmentPunchMapper mdcEquipmentPunchMapper; |
| | | @Override |
| | | public void savePunchRates(String targetDate, List<MdcEquipmentPunch> punchRecords) { |
| | | |
| | | int morningIn = mdcEquipmentPunchMapper.countMorningShiftIn(targetDate); |
| | | int eveningIn = mdcEquipmentPunchMapper.countEveningShiftIn(targetDate); |
| | | int morningOut = mdcEquipmentPunchMapper.countMorningShiftOut(targetDate); |
| | | int eveningOut = mdcEquipmentPunchMapper.countEveningShiftOut(targetDate); |
| | | for (MdcEquipmentPunch punch : punchRecords) { |
| | | MdcEquipmentPunchRate rate = new MdcEquipmentPunchRate(); |
| | | |
| | | rate.setId(UUID.randomUUID().toString()); // çæå¯ä¸ID |
| | | rate.setEquipmentId(punch.getEquipmentId()); |
| | | rate.setTheDate(targetDate); |
| | | rate.setShiftSchedule(punch.getShiftSchedule()); |
| | | |
| | | |
| | | |
| | | |
| | | // è®¾ç½®è®¾å¤æ°é |
| | | rate.setMornShiftInNum(morningIn); |
| | | rate.setMornShiftOutNum(eveningIn); |
| | | rate.setEvenShiftInNum(morningOut); |
| | | rate.setEvenShiftOutNum(eveningOut); |
| | | |
| | | |
| | | |
| | | // è·åæ»è®¾å¤æ° |
| | | int totalDevices = mdcEquipmentPunchMapper.getTotalDeviceCount(); |
| | | if (totalDevices == 0) return; |
| | | |
| | | |
| | | rate.setDeviceCountNum(totalDevices); |
| | | |
| | | // è®¡ç®æå¡çï¼ä¿ç两ä½å°æ°ï¼ |
| | | rate.setMornShiftInRate(calculateRate(morningIn, totalDevices)); |
| | | rate.setMornShiftOutRate(calculateRate(eveningIn, totalDevices)); |
| | | rate.setEvenShiftInRate(calculateRate(morningOut, totalDevices)); |
| | | rate.setEvenShiftOutRate(calculateRate(eveningOut, totalDevices)); |
| | | |
| | | this.save(rate); |
| | | } |
| | | } |
| | | private BigDecimal calculateRate(int actual, int total) { |
| | | if (total == 0) return BigDecimal.ZERO; |
| | | return new BigDecimal(actual) |
| | | .divide(new BigDecimal(total), 4, RoundingMode.DOWN) |
| | | .multiply(BigDecimal.valueOf(100)) |
| | | .setScale(2, RoundingMode.DOWN); // ä¿ç两ä½å°æ°ï¼ä¸è¿è¡åèäºå
¥ |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.date.DatePattern; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringPool; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | public class MdcEquipmentPunchServiceImpl extends ServiceImpl<MdcEquipmentPunchMapper, MdcEquipmentPunch> implements IMdcEquipmentPunchService { |
| | | |
| | | @Resource |
| | | private MdcEquipmentPunchMapper mdcEquipmentPunchMapper; |
| | | @Resource |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | |
| | |
| | | MdcEquipmentPunch equipmentPunch = new MdcEquipmentPunch(); |
| | | if (first.isPresent()) { |
| | | equipmentPunch = first.get(); |
| | | //å·²åå¨è®°å½è¯´æå·²æä¸çå¡ï¼æ
å°æ¯å¦ç¼ºå¡ç½®ä¸ºå¦ |
| | | equipmentPunch.setIsAbsent(0); |
| | | }else { |
| | | equipmentPunch.setEquipmentId(equipment); |
| | | equipmentPunch.setPunchUser(userId); |
| | | equipmentPunch.setRecordDate(currentDate); |
| | | equipmentPunch.setShiftSchedule(mdcEquipmentPunch.getShiftSchedule()); |
| | | equipmentPunch.setIsAbsent(0); |
| | | equipmentPunch.setIsEarly(0); |
| | | //æ£å¸¸æå¡æ¶å
å°æ¯å¦ç¼ºå¡ç½®ä¸ºâæ¯âï¼é²æ¢æªæä¸ç塿¶æ æ³è°æ´ç¶æ |
| | | equipmentPunch.setIsAbsent(1); |
| | | } |
| | | equipmentPunch.setCheckInTime(mdcEquipmentPunch.getCheckInTime()); |
| | | //æå¡æ¶é´å¤§äº8ï¼30/17:00æ¶ä¸ºè¿å°æå¡ |
| | |
| | | MdcEquipmentPunch equipmentPunch = new MdcEquipmentPunch(); |
| | | if (mdcEquipmentPunchOptional.isPresent()) { |
| | | equipmentPunch = mdcEquipmentPunchOptional.get(); |
| | | equipmentPunch.setIsAbsent(0); |
| | | }else { |
| | | equipmentPunch.setIsAbsent(1); |
| | | equipmentPunch.setIsLate(0); |
| | |
| | | |
| | | this.saveOrUpdateBatch(list); |
| | | } |
| | | |
| | | @Override |
| | | public void fillPunchRates(List<MdcEquipmentPunch> punchList) { |
| | | |
| | | // è·åæ¨å¤©æ¥æ |
| | | LocalDate yesterday = LocalDate.now().minusDays(1); |
| | | String yesterdayStr = yesterday.format(DateTimeFormatter.ofPattern(DatePattern.PURE_DATE_PATTERN)); // æ ¼å¼å为 "yyyy-MM-dd" |
| | | |
| | | |
| | | // è·åæ»è®¾å¤æ° |
| | | int totalDevices = mdcEquipmentPunchMapper.getTotalDeviceCount(); |
| | | if (totalDevices == 0) return; |
| | | |
| | | // ç»è®¡åç±»åæå¡äººæ° |
| | | int morningIn = mdcEquipmentPunchMapper.countMorningShiftIn(yesterdayStr); |
| | | int eveningIn = mdcEquipmentPunchMapper.countEveningShiftIn(yesterdayStr); |
| | | int morningOut = mdcEquipmentPunchMapper.countMorningShiftOut(yesterdayStr); |
| | | int eveningOut = mdcEquipmentPunchMapper.countEveningShiftOut(yesterdayStr); |
| | | |
| | | |
| | | // 设置æå¡çå°æ¯ä¸ª DTO |
| | | for (MdcEquipmentPunch dto : punchList) { |
| | | dto.setMorningShiftInRate(calculateRate(morningIn, totalDevices)); |
| | | dto.setEveningShiftInRate(calculateRate(eveningIn, totalDevices)); |
| | | dto.setMorningShiftOutRate(calculateRate(morningOut, totalDevices)); |
| | | dto.setEveningShiftOutRate(calculateRate(eveningOut, totalDevices)); |
| | | |
| | | // 设置æå¡è®¾å¤æ°éåæ®µ |
| | | dto.setMorningShiftInDeviceNum(morningIn); |
| | | dto.setMorningShiftOutDeviceNum(morningOut); |
| | | dto.setEveningShiftInDeviceNum(eveningIn); |
| | | dto.setEveningShiftOutDeviceNum(eveningOut); |
| | | dto.setDeviceCountNum(totalDevices); |
| | | } |
| | | } |
| | | |
| | | // 计ç®ç¾åæ¯å¹¶ä¿ç两ä½å°æ° |
| | | private BigDecimal calculateRate(int actual, int total) { |
| | | if (total == 0) return BigDecimal.ZERO; |
| | | return new BigDecimal(actual) |
| | | .divide(new BigDecimal(total), 4, RoundingMode.HALF_UP) |
| | | .multiply(BigDecimal.valueOf(100)) |
| | | .setScale(2, RoundingMode.HALF_UP); // ä¿ç两ä½å°æ° |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcEquipmentPunch> getYesterdayRecords(String targetDate) { |
| | | // æé æ¥è¯¢æ¡ä»¶ï¼record_date = targetDate.toString() |
| | | QueryWrapper<MdcEquipmentPunch> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("record_date", targetDate); |
| | | |
| | | // æ§è¡æ¥è¯¢å¹¶è¿åç»æ |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.mdc.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AndonOrderWebSocketVo { |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | private String equipmentId; |
| | | |
| | | /** |
| | | * å¼å«äººå |
| | | */ |
| | | private String callPersonnel; |
| | | |
| | | /** |
| | | * å®ç¯ç±»å |
| | | */ |
| | | private String andonType; |
| | | |
| | | /** |
| | | * å¼å«æ¶é´ |
| | | */ |
| | | private String callTime; |
| | | |
| | | /** |
| | | * å¼å«åå |
| | | */ |
| | | private String callReason; |
| | | |
| | | /** |
| | | * 责任人 |
| | | */ |
| | | private String personResponsible; |
| | | |
| | | /** |
| | | * æ¥ä¿®æ¶é´ |
| | | */ |
| | | private String repairTime; |
| | | |
| | | /** |
| | | * æ
éæè¿° |
| | | */ |
| | | private String faultInfo; |
| | | |
| | | /** |
| | | * æå±åæ¿ |
| | | */ |
| | | private String plantName; |
| | | } |
| | |
| | | |
| | | |
| | | String findProName(String equipmentId); |
| | | |
| | | /** |
| | | * æ ¹æ®äº§çº¿orgCodeæ¥è¯¢äº§çº¿ |
| | | * @param orgCode |
| | | * @return |
| | | */ |
| | | MdcProduction findByOrgCode(String orgCode); |
| | | } |
| | |
| | | public String findProName(String equipmentId) { |
| | | return this.baseMapper.findProName(equipmentId); |
| | | } |
| | | |
| | | @Override |
| | | public MdcProduction findByOrgCode(String orgCode){ |
| | | return this.baseMapper.selectOne(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getOrgCode, orgCode)); |
| | | } |
| | | } |
| | |
| | | #staticAccessPath: /api/ffile/** # å½å项ç®çéæèµæºè®¿é®é
ç½®å¨nginxä¸ |
| | | #å·¥æ§ç½/æ¶å¯ç½é¨ç½²ç¸å
³é
ç½®------------éè¿å
çææ¸¡ |
| | | deploy: |
| | | #å·¥æ§ç½/æ¶å¯ç½é¨ç½² 0为æ¶å¯ç½ 1为工æ§ç½ |
| | | deployType: 0 |
| | | #æ¶å¯ç½ä¼ è¾å·¥æ§ç½ncæä»¶å¤¹(ææ´¾è®¾å¤ncæä»¶) å·¥æ§ç½ä¼ è¾æ¶å¯ç½ncæä»¶å¤¹(è§£æåä¼ åçncæä»¶) |
| | | #æ¶å¯ç½ä¼ è¾å·¥æ§ç½ncæä»¶å¤¹(ææ´¾è®¾å¤ncæä»¶) |
| | | secretFolder: D:\\test\\a |
| | | file: |
| | | monitor: |
| | |
| | | - D:\\hy_test\\b |
| | | - D:\\hy_test\\c |
| | | interval: 10000 # çæ§é´é(ms) |
| | | security: |
| | | encryption-key: 1234567890abcdef # å è§£å¯ç§é¥ |
| | |
| | | client-id: ?? |
| | | # appSecret |
| | | client-secret: ?? |
| | | agent-id: ?? |
| | | agent-id: ?? |
| | |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | @AutoLog(value = "åå
·åå¤å-ä»DNCç³»ç»åå
¥åå
·åå¤ååæç»") |
| | | @ApiOperation(value="åå
·åå¤å-ä»DNCç³»ç»åå
¥åå
·åå¤ååæç»", notes="åå
·åå¤å-ä»DNCç³»ç»åå
¥åå
·åå¤ååæç»") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_preparation_order:add") |
| | | @PostMapping(value = "/addPreparationOrderFromDnc") |
| | | public Result<String> addPreparationOrderFromDnc(@RequestBody PreparationOrderAndDetailDto preparationOrderAndDetailDto) { |
| | | preparationOrderService.addPreparationOrderFromDnc(preparationOrderAndDetailDto); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * @param preparationOrder |
| | |
| | | @Autowired |
| | | private IToolsSharpeningService toolSharpeningService; |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | */ |
| | | // @GetMapping("/list") |
| | | // @ApiOperation(value = "å页æ¥è¯¢", notes = "å页æ¥è¯¢") |
| | | // public Result<IPage<ToolSharpening>> queryPageList(ToolSharpening toolSharpening, |
| | | // @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | // @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { |
| | | // Page<ToolSharpening> page = new Page<>(pageNo, pageSize); |
| | | // QueryWrapper<ToolSharpening> queryWrapper = new QueryWrapper<>(toolSharpening); |
| | | // IPage<ToolSharpening> iPage = toolSharpeningService.page(page, queryWrapper); |
| | | // return Result.OK(iPage); |
| | | // } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value="æ¥æç³è¯·åæç»-éè¿ä¸»è¡¨IDæ¥è¯¢", notes="æ¥æç³è¯·åæç»-éè¿ä¸»è¡¨IDæ¥è¯¢") |
| | |
| | | toolSharpeningService.save(toolSharpening); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | // /** |
| | | // * ä¿®æ¹ |
| | | // */ |
| | | // @PutMapping |
| | | // @ApiOperation(value = "ä¿®æ¹", notes = "ä¿®æ¹") |
| | | // public Result<ToolSharpening> edit(@RequestBody ToolSharpening toolSharpening) { |
| | | // toolSharpeningService.updateById(toolSharpening); |
| | | // return Result.OK(toolSharpening); |
| | | // } |
| | | |
| | | /** |
| | | * ä¿®æ¹ |
| | | * ç¼è¾ |
| | | * |
| | | * @param toolSharpening |
| | | * @return |
| | | */ |
| | | @PutMapping |
| | | @ApiOperation(value = "ä¿®æ¹", notes = "ä¿®æ¹") |
| | | public Result<ToolSharpening> edit(@RequestBody ToolSharpening toolSharpening) { |
| | | @AutoLog(value = "tms_tool_sharpening-ç¼è¾") |
| | | @ApiOperation(value="tms_tool_sharpening-ç¼è¾", notes="tms_tool_sharpening-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody ToolSharpening toolSharpening) { |
| | | toolSharpeningService.updateById(toolSharpening); |
| | | return Result.OK(toolSharpening); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | package org.jeecg.modules.tms.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.modules.system.service.ISysBusinessCodeRuleService; |
| | | import org.jeecg.modules.tms.entity.BaseTools; |
| | | import org.jeecg.modules.tms.entity.ToolSharpening; |
| | | import org.jeecg.modules.tms.entity.ToolsStocktakingBound; |
| | | import org.jeecg.modules.tms.entity.ToolsStocktakingBoundDetail; |
| | | import org.jeecg.modules.tms.entity.*; |
| | | import org.jeecg.modules.tms.entity.dto.LossBoundFlowDto; |
| | | import org.jeecg.modules.tms.entity.dto.StocktakingBoundFlowDto; |
| | | import org.jeecg.modules.tms.entity.vo.ToolsStocktakingVo; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public Result<String> edit(@RequestBody ToolsStocktakingBound toolsStocktakingBound) { |
| | | if (toolsStocktakingBound == null || StringUtils.isBlank(toolsStocktakingBound.getId())) { |
| | | return Result.error("åæ°é误"); |
| | | } |
| | | |
| | | toolsStocktakingBoundDetailService.remove(new LambdaQueryWrapper<ToolsStocktakingBoundDetail>() |
| | | toolsStocktakingBoundService.updateById(toolsStocktakingBound); |
| | | // å é¤ç³è¯·åæç»æ°æ® |
| | | toolsStocktakingBoundDetailService.remove(new LambdaQueryWrapper<ToolsStocktakingBoundDetail>() |
| | | .eq(ToolsStocktakingBoundDetail::getStocktakingBoundId, toolsStocktakingBound.getId())); |
| | | |
| | | ToolsStocktakingBound stocktakingBound = new ToolsStocktakingBound(); |
| | | BeanUtils.copyProperties(stocktakingBound, toolsStocktakingBound); |
| | | toolsStocktakingBoundMapper.updateById(stocktakingBound); |
| | | |
| | | |
| | | List<ToolsStocktakingBoundDetail> detailList = toolsStocktakingBound.getToolsStocktakingBoundDetailList(); |
| | | if (CollectionUtils.isEmpty(detailList)) { |
| | | return Result.error("æç»ä¸è½ä¸ºç©º"); |
| | | } |
| | | for (ToolsStocktakingBoundDetail item : detailList) { |
| | | item.setStocktakingBoundId(toolsStocktakingBound.getId()); |
| | | item.setToolId(item.getToolId()); |
| | | item.setToolCode(item.getToolCode()); |
| | | item.setRemark(item.getRemark()); |
| | | item.setStocktakingDate(item.getStocktakingDate()); |
| | | item.setBookQuantity(item.getBookQuantity()); |
| | | item.setAvailableQuantity(item.getAvailableQuantity()); |
| | | item.setPracticalQuantity(item.getPracticalQuantity()); |
| | | item.setSurplusDeficit(item.getSurplusDeficit()); |
| | | item.setDifferenceValue(item.getDifferenceValue()); |
| | | item.setParamaTableName(item.getParamaTableName()); |
| | | item.setForeignLanguageName(item.getForeignLanguageName()); |
| | | item.setChineseName(item.getChineseName()); |
| | | item.setSupplierId(item.getSupplierId()); |
| | | item.setStorageLocation(item.getStorageLocation()); |
| | | item.setToolMaterial(item.getToolMaterial()); |
| | | item.setToolModel(item.getToolModel()); |
| | | item.setPositionCode(item.getPositionCode()); |
| | | item.setClassifyId(item.getClassifyId()); |
| | | item.setApplicationType(item.getApplicationType()); |
| | | toolsStocktakingBoundDetailService.saveOrUpdate(item); |
| | | } |
| | | toolsStocktakingBoundDetailService.saveOrUpdateBatch(detailList); |
| | | return Result.OK("æä½æå!"); |
| | | |
| | | detailList.forEach(item -> item.setStocktakingBoundId(stocktakingBound.getId())); |
| | | toolsStocktakingBoundDetailService.saveBatch(detailList); |
| | | |
| | | return Result.OK("ç¼è¾æå"); |
| | | } |
| | | |
| | | |
| | |
| | | package org.jeecg.modules.tms.controller; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.modules.tms.entity.ToolsClassify; |
| | | import org.jeecg.modules.tms.entity.dto.ToolQueryParamDto; |
| | | import org.jeecg.modules.tms.entity.vo.ParaHolesToolsVo; |
| | | import org.jeecg.modules.tms.entity.vo.ParaMillToolVo; |
| | | import org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo; |
| | | import org.jeecg.modules.tms.entity.vo.*; |
| | | import org.jeecg.modules.tms.enums.ToolParaType; |
| | | import org.jeecg.modules.tms.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/tms/toolsToDnc") |
| | |
| | | private IParaMillToolService paraMillToolService; |
| | | @Autowired |
| | | private IParaTurningToolsService paraTurningToolsService; |
| | | @Autowired |
| | | private IParaThreadingToolService paraThreadingToolService; |
| | | @Autowired |
| | | private IParaBladeService paraBladeService; |
| | | |
| | | @ApiOperation(value = "éè¿å·¥å
·ç®ç§°æ¥è¯¢å·¥å
·å类信æ¯ï¼éå页é¢å·¥å
·ç±»å䏿æ¡ç¨", notes = "éè¿å·¥å
·ç®ç§°æ¥è¯¢å·¥å
·å类信æ¯ï¼éå页é¢å·¥å
·ç±»å䏿æ¡ç¨") |
| | | @GetMapping("/queryToolClassifyByParam") |
| | | public Result<?> queryToolClassifyByParam(@RequestParam("aliasLabel") String aliasLabel) { |
| | | List<ToolsClassify> classifyList = toolsClassifyService.list(new LambdaQueryWrapper<ToolsClassify>() |
| | | .eq(ToolsClassify::getAliasLabel, aliasLabel) |
| | | .eq(ToolsClassify::getStatus, CommonConstant.STATUS_1)); |
| | | List<Map<String, String>> list = classifyList.stream() |
| | | .map(classify -> new HashMap<String, String>() {{ |
| | | put("value", classify.getId()); |
| | | put("label", classify.getTypeName()); |
| | | }}) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok(list); |
| | | } |
| | | /** |
| | | * éè¿å·¥å
·ç®ç§°/ç´å¾åæ°æ¥è¯¢å
·ä½å·¥å
·åæ°ä¿¡æ¯(ç»DNCæä¾æ¥å£)ï¼åæ°ç¤ºä¾ï¼3Eï¼3为工å
·ç´å¾åæ°ãE为å å·¥ä¸å¿åå
·ç®ç§°ï¼ |
| | | * |
| | | * @param queryParam |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "éè¿å·¥å
·ç®ç§°/ç´å¾åæ°æ¥è¯¢å
·ä½å·¥å
·åæ°ä¿¡æ¯(ç»DNCæä¾æ¥å£)", notes = "éè¿å·¥å
·ç®ç§°/ç´å¾åæ°æ¥è¯¢å
·ä½å·¥å
·åæ°ä¿¡æ¯(ç»DNCæä¾æ¥å£)") |
| | | @GetMapping("/queryToolByParam") |
| | | public Result<?> queryToolByParam(@RequestParam("param") ToolQueryParamDto queryParam){ |
| | | String param = queryParam.getParam(); |
| | | // æ£å表达å¼ï¼ååé¨å为æ°åï¼æ¯æå°æ°ï¼ï¼ååé¨å为大åæå°å忝 |
| | | String regex = "^([\\d.]+)([A-Za-z]+)$"; |
| | | Pattern pattern = Pattern.compile(regex); |
| | | Matcher matcher = pattern.matcher(param); |
| | | if (matcher.find()) { |
| | | String diameter = matcher.group(1); |
| | | String toolAliasName = matcher.group(2); |
| | | public Result<?> queryToolByParam(ToolQueryParamDto queryParam) { |
| | | String aliasLabel = queryParam.getAliasLabel(); |
| | | String diameter = queryParam.getDiameter(); |
| | | if (StrUtil.isBlank(aliasLabel)) { |
| | | return Result.error("缺å°å¿
è¦åæ°"); |
| | | } |
| | | |
| | | Result<Object> res = Result.OK(); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | int pageNo = Objects.isNull(queryParam.getPageNo()) || queryParam.getPageNo() < 1 ? 1 : queryParam.getPageNo(); |
| | | int pageSize = Objects.isNull(queryParam.getPageSize()) || queryParam.getPageSize() < 1 ? 10 : queryParam.getPageSize(); |
| | | |
| | | List<Object> toolList = CollectionUtil.newArrayList(); |
| | | String classifyId = queryParam.getClassifyId(); |
| | | if (StrUtil.isNotBlank(classifyId)) { |
| | | //å·²ç»è¿å
¥äºéå页é¢ï¼å·¥å
·å类已ç»ç¡®å® |
| | | ToolsClassify toolsClassify = toolsClassifyService.getById(classifyId); |
| | | ToolParaType toolParaType = ToolParaType.fromValue(toolsClassify.getParaTypeFlag()); |
| | | matchTypeSelectTools(queryParam, toolList, toolParaType); |
| | | } else { |
| | | //ç¬¬ä¸æ¬¡è¿å
¥éå页é¢ï¼æ ¹æ®åå
·ç®ç§°åç´å¾åæ°æ¥è¯¢å·¥å
·åç±» |
| | | List<ToolsClassify> classifyList = toolsClassifyService.list(new LambdaQueryWrapper<ToolsClassify>() |
| | | .eq(ToolsClassify::getAliasLabel, toolAliasName) |
| | | .eq(ToolsClassify::getAliasLabel, aliasLabel) |
| | | .eq(ToolsClassify::getStatus, CommonConstant.STATUS_1)); |
| | | if (CollectionUtil.isEmpty(classifyList)) { |
| | | return Result.error("æªæ¾å°å¹é
çå·¥å
·åç±»"); |
| | | result.put("records", CollectionUtil.newArrayList()); |
| | | result.put("total", 0); |
| | | result.put("current", pageNo); |
| | | result.put("size", pageSize); |
| | | res.setResult(result); |
| | | return res; |
| | | } |
| | | List<Object> toolList = CollectionUtil.newArrayList(); |
| | | for (ToolsClassify classify : classifyList) { |
| | | String paraTypeFlag = classify.getParaTypeFlag(); |
| | | queryParam.setClassifyId(classify.getId()); |
| | | queryParam.setDiameter(diameter); |
| | | ToolParaType toolParaType = ToolParaType.fromValue(paraTypeFlag); |
| | | if (toolParaType != null) { |
| | | switch (toolParaType) { |
| | | case HOLE: |
| | | List<ParaHolesToolsVo> paraHoleToolsList = paraHoleToolsService.selectByClassifyAndDiameter(queryParam); |
| | | toolList.addAll(paraHoleToolsList); |
| | | break; |
| | | case MILL: |
| | | List<ParaMillToolVo> paraMillToolList = paraMillToolService.selectByClassifyAndDiameter(queryParam); |
| | | toolList.addAll(paraMillToolList); |
| | | break; |
| | | case TURNING: |
| | | List<ParaTurningToolsVo> paraTurningToolsList = paraTurningToolsService.selectByClassifyAndDiameter(queryParam); |
| | | toolList.addAll(paraTurningToolsList); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | matchTypeSelectTools(queryParam, toolList, toolParaType); |
| | | } |
| | | return Result.OK(toolList); |
| | | } |
| | | |
| | | // ====== å页é»è¾ start ====== |
| | | int total = toolList.size(); |
| | | int fromIndex = (pageNo - 1) * pageSize; |
| | | int toIndex = Math.min(fromIndex + pageSize, total); |
| | | |
| | | List<Object> pagedList; |
| | | if (fromIndex > total) { |
| | | pagedList = Collections.emptyList(); |
| | | } else { |
| | | return Result.error("åæ°æ ¼å¼ä¸æ£ç¡®"); |
| | | pagedList = toolList.subList(fromIndex, toIndex); |
| | | } |
| | | |
| | | result.put("records", pagedList); |
| | | result.put("total", total); |
| | | result.put("current", pageNo); |
| | | result.put("size", pageSize); |
| | | res.setResult(result); |
| | | return res; |
| | | // ====== å页é»è¾ end ====== |
| | | } |
| | | |
| | | private void matchTypeSelectTools(ToolQueryParamDto queryParam, List<Object> toolList, ToolParaType toolParaType) { |
| | | if (toolParaType != null) { |
| | | String diameter = queryParam.getDiameter(); |
| | | switch (toolParaType) { |
| | | case HOLE: |
| | | List<ParaHolesToolsVo> paraHoleToolsList = paraHoleToolsService.selectByClassifyAndDiameter(queryParam); |
| | | toolList.addAll(paraHoleToolsList); |
| | | break; |
| | | case THREADING://èºçº¹åå
·æ²¡æç´å¾åæ°ï¼å¦æä¼ å
¥ç´å¾ï¼ç´æ¥ç¥è¿ |
| | | if (StrUtil.isBlank(diameter)) { |
| | | List<ParaThreadingToolVo> paraThreadingToolList = paraThreadingToolService.selectByClassifyAndParam(queryParam); |
| | | toolList.addAll(paraThreadingToolList); |
| | | } |
| | | break; |
| | | case MILL: |
| | | List<ParaMillToolVo> paraMillToolList = paraMillToolService.selectByClassifyAndDiameter(queryParam); |
| | | toolList.addAll(paraMillToolList); |
| | | break; |
| | | case TURNING: |
| | | List<ParaTurningToolsVo> paraTurningToolsList = paraTurningToolsService.selectByClassifyAndDiameter(queryParam); |
| | | toolList.addAll(paraTurningToolsList); |
| | | break; |
| | | case BLADE://åçæ²¡æç´å¾åæ°ï¼å¦æä¼ å
¥ç´å¾ï¼ç´æ¥ç¥è¿ |
| | | if (StrUtil.isBlank(diameter)) { |
| | | List<ParaBladeVo> paraBladeToolsList = paraBladeService.selectByClassifyAndParam(queryParam); |
| | | toolList.addAll(paraBladeToolsList); |
| | | } |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import org.jeecg.modules.tms.entity.OutboundOrder; |
| | | import org.jeecg.modules.tms.entity.dto.OutboundOrderAndDetailDto; |
| | | import org.mapstruct.BeanMapping; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.NullValuePropertyMappingStrategy; |
| | | import org.mapstruct.ReportingPolicy; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | /** |
| | | * ä½¿ç¨ MapStruct æ¹å¼è¿è¡å±æ§å¤å¶ |
| | | * 注æä¸è½æ¾å¨ mybatisæ«æçmapperå
ä¸é¢ï¼å¦å伿¥é |
| | | */ |
| | | @Mapper |
| | | @Mapper( |
| | | unmappedTargetPolicy = ReportingPolicy.IGNORE, // 忽ç¥ç®æ 䏿ªè¢«æ å°çåæ®µ |
| | | componentModel = "spring" // å¦æä½¿ç¨ Springï¼å¯çæ Spring 管çç Bean |
| | | ) |
| | | public interface OutboundOrderConvert { |
| | | |
| | | |
| | | OutboundOrderConvert INSTANCE = Mappers.getMapper(OutboundOrderConvert.class); |
| | | |
| | | @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)// å¿½ç¥ null åæ®µ |
| | | OutboundOrder convert(OutboundOrderAndDetailDto dto); |
| | | } |
| | |
| | | |
| | | import org.jeecg.modules.tms.entity.PreparationOrder; |
| | | import org.jeecg.modules.tms.entity.dto.PreparationOrderAndDetailDto; |
| | | import org.mapstruct.BeanMapping; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.NullValuePropertyMappingStrategy; |
| | | import org.mapstruct.ReportingPolicy; |
| | | import org.mapstruct.factory.Mappers; |
| | | |
| | | /** |
| | | * ä½¿ç¨ MapStruct æ¹å¼è¿è¡å±æ§å¤å¶ |
| | | * 注æä¸è½æ¾å¨ mybatisæ«æçmapperå
ä¸é¢ï¼å¦å伿¥é |
| | | */ |
| | | @Mapper |
| | | @Mapper( |
| | | unmappedTargetPolicy = ReportingPolicy.IGNORE, // 忽ç¥ç®æ 䏿ªè¢«æ å°çåæ®µ |
| | | componentModel = "spring" // å¦æä½¿ç¨ Springï¼å¯çæ Spring 管çç Bean |
| | | ) |
| | | public interface PreparationOrderConvert { |
| | | |
| | | PreparationOrderConvert INSTANCE = Mappers.getMapper(PreparationOrderConvert.class); |
| | | |
| | | @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)// å¿½ç¥ null åæ®µ |
| | | PreparationOrder convert(PreparationOrderAndDetailDto dto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.experimental.Accessors; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("tms_preparation_order_detail") |
| | | @ApiModel(value="tms_preparation_order_detail对象", description="åå
·åå¤åæç»") |
| | | public class PreparationOrderDetail implements Serializable { |
| | |
| | | @TableField(exist = false) |
| | | private String classifyId; |
| | | |
| | | @Dict(dicCode = "application_type") |
| | | @TableField(exist = false) |
| | | private String applicationType; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @Data |
| | | public class ToolQueryParamDto { |
| | | /**å¤ååæ°(å·¥å
·ç®ç§°/ç´å¾åæ°)ï¼ä¾å¦ï¼3E*/ |
| | | @ApiModelProperty(value = "å¤ååæ°(å·¥å
·ç®ç§°/ç´å¾åæ°)ï¼ä¾å¦ï¼3E") |
| | | private String param; |
| | | /**å·¥å
·ç®ç§°*/ |
| | | @ApiModelProperty(value = "å·¥å
·ç®ç§°") |
| | | private String aliasLabel; |
| | | /**åå
·ç´å¾*/ |
| | | @ApiModelProperty(value = "åå
·ç´å¾") |
| | | private String diameter; |
| | | /**åå
·åç±»ID(ä¸ç¨åç«¯ä¼ ï¼åå°è®°å½åæ°ç¨)*/ |
| | | private String classifyId; |
| | | /**åå
·ç´å¾(ä¸ç¨åç«¯ä¼ ï¼åå°è®°å½åæ°ç¨)*/ |
| | | private String diameter; |
| | | /**å·¥å
·ç¼ç */ |
| | | @ApiModelProperty(value = "å·¥å
·ç¼ç (tms_base_tool表tool_codeåæ®µ)") |
| | | private String toolCode; |
| | | /**åå·/å¾å·*/ |
| | | @ApiModelProperty(value = "åå·/å¾å·") |
| | | private String toolModel; |
| | | /**䏿åç§°*/ |
| | | @ApiModelProperty(value = "䏿åç§°") |
| | | private String chineseName; |
| | | /**åå
·æ»é¿*/ |
| | | @ApiModelProperty(value = "åå
·æ»é¿") |
| | | private String totalLength; |
| | |
| | | @ApiModelProperty(value = "åå
·ææ") |
| | | private String toolMaterial; |
| | | /**åååé¿*/ |
| | | @ApiModelProperty(value = "åååé¿(åå å·¥åå
·ãé£ååå
·)") |
| | | @ApiModelProperty(value = "åååé¿(åå å·¥åå
·ãé£ååå
·ãèºçº¹åå
·)") |
| | | private String edgeLength; |
| | | /**åæ°(åå å·¥åå
·)*/ |
| | | @ApiModelProperty(value = "åæ°(åå å·¥åå
·)") |
| | |
| | | @ApiModelProperty(value = "æ¬ä¼¸é¿åº¦(é£ååå
·)") |
| | | private String overhangingLength; |
| | | /**èºè·*/ |
| | | @ApiModelProperty(value = "èºè·(é£ååå
·)") |
| | | @ApiModelProperty(value = "èºè·(é£ååå
·ãèºçº¹åå
·ãåç)") |
| | | private String pitch; |
| | | /**æå°å å·¥ç´å¾*/ |
| | | @ApiModelProperty(value = "æå°å å·¥ç´å¾(é£ååå
·)") |
| | |
| | | @ApiModelProperty(value = "é
å¥åçå·(车ååå
·)") |
| | | private String matchingNumber; |
| | | /**ååæ¹å*/ |
| | | @ApiModelProperty(value = "ååæ¹å(车ååå
·)") |
| | | @ApiModelProperty(value = "ååæ¹å(车ååå
·ãåç)") |
| | | private String cuttingDirection; |
| | | /**åç尺寸*/ |
| | | @ApiModelProperty(value = "åç尺寸(车ååå
·)") |
| | |
| | | @ApiModelProperty(value = "éæç´å¾(车ååå
·)") |
| | | private String boringBarDiameter; |
| | | /**åæé¿åº¦*/ |
| | | @ApiModelProperty(value = "åæé¿åº¦(车ååå
·)") |
| | | @ApiModelProperty(value = "åæé¿åº¦(车ååå
·ãåç)") |
| | | private String bladeLength; |
| | | /**åææ¹å*/ |
| | | @ApiModelProperty(value = "åææ¹å(车ååå
·)") |
| | |
| | | @ApiModelProperty(value = "åæé«åº¦(车ååå
·)") |
| | | private String bladeHeight; |
| | | /**åæå®½åº¦*/ |
| | | @ApiModelProperty(value = "åæå®½åº¦(车ååå
·)") |
| | | @ApiModelProperty(value = "åæå®½åº¦(车ååå
·ãåç)") |
| | | private String bladeWide; |
| | | /**åçæ§½å®½*/ |
| | | @ApiModelProperty(value = "åçæ§½å®½(车ååå
·)") |
| | |
| | | @ApiModelProperty(value = "æå¤§å槽深度(车ååå
·)") |
| | | private String maxDepth; |
| | | /**åæ¿å度*/ |
| | | @ApiModelProperty(value = "åæ¿å度(车ååå
·)") |
| | | @ApiModelProperty(value = "åæ¿å度(车ååå
·ãåçå度)") |
| | | private String bladeThickness; |
| | | /**æå°å å·¥ç´å¾*/ |
| | | @ApiModelProperty(value = "æå°å å·¥ç´å¾(车ååå
·)") |
| | | private String minDiameter; |
| | | /**èºçº¹ä»£å·*/ |
| | | @ApiModelProperty(value = "èºçº¹ä»£å·(èºçº¹åå
·)") |
| | | private String threadCode; |
| | | /**èºçº¹æå*/ |
| | | @ApiModelProperty(value = "èºçº¹æå(èºçº¹åå
·)") |
| | | private String rotationDirection; |
| | | /**èºçº¹å
¬å·®å¸¦ä»£å·/精度ç级*/ |
| | | @ApiModelProperty(value = "èºçº¹å
¬å·®å¸¦ä»£å·/精度ç级(èºçº¹åå
·)") |
| | | private String tolerancezoneLevel; |
| | | /**å¤å尺寸*/ |
| | | @ApiModelProperty(value = "å¤å尺寸(èºçº¹åå
·)") |
| | | private String externalDimensions; |
| | | /**æé¨è§æ ¼*/ |
| | | @ApiModelProperty(value = "æé¨è§æ ¼(èºçº¹åå
·)") |
| | | private String handleSpecifications; |
| | | /**èºåç±»å*/ |
| | | @ApiModelProperty(value = "èºåç±»å(èºçº¹åå
·)") |
| | | private String screwHoleType; |
| | | /**èºçº¹æ å*/ |
| | | @ApiModelProperty(value = "èºçº¹æ å(èºçº¹åå
·ãåç)") |
| | | private String threadStandard; |
| | | /**æå±æ§½å*/ |
| | | @ApiModelProperty(value = "æå±æ§½å(èºçº¹åå
·)") |
| | | private String fluteSoltType; |
| | | /**èºçº¹ç±»å*/ |
| | | @ApiModelProperty(value = "èºçº¹ç±»å(èºçº¹åå
·)") |
| | | private String threadType; |
| | | /**导å尺寸*/ |
| | | @ApiModelProperty(value = "导å尺寸(èºçº¹åå
·)") |
| | | private String guidingSize; |
| | | /**è¿æ¥åå¾*/ |
| | | @ApiModelProperty(value = "è¿æ¥åå¾(èºçº¹åå
·)") |
| | | private String connectionAperture; |
| | | /**è¿æ¥é®æ§½*/ |
| | | @ApiModelProperty(value = "è¿æ¥é®æ§½(èºçº¹åå
·)") |
| | | private String connectingKeyway; |
| | | /**åçå½¢ç¶*/ |
| | | @ApiModelProperty(value = "åçå½¢ç¶(åç)") |
| | | private String bladeShape; |
| | | /**åååæ°*/ |
| | | @ApiModelProperty(value = "åååæ°(åç)") |
| | | private String cuttingEdgeCount; |
| | | /**夹åºåå¼*/ |
| | | @ApiModelProperty(value = "夹åºåå¼(åç)") |
| | | private String clampingType; |
| | | /**åå°R*/ |
| | | @ApiModelProperty(value = "åå°R(åç)") |
| | | private String noseAngleR; |
| | | /**å å·¥åç±»*/ |
| | | @ApiModelProperty(value = "å å·¥åç±»(åç)") |
| | | private String processingClassify; |
| | | /**åçåè§*/ |
| | | @ApiModelProperty(value = "åçåè§(åç)") |
| | | private String bladePosterior; |
| | | /**åç尺寸*/ |
| | | @ApiModelProperty(value = "åç尺寸(åç)") |
| | | private String bladeSize; |
| | | /**å
å¤èºçº¹*/ |
| | | @ApiModelProperty(value = "å
å¤èºçº¹(åç)") |
| | | private String inOutThread; |
| | | /**çåè§åº¦*/ |
| | | @ApiModelProperty(value = "çåè§åº¦(åç)") |
| | | private String dentalAngle; |
| | | /**æå°å å·¥å
èºçº¹å
¬ç§°ç´å¾*/ |
| | | @ApiModelProperty(value = "æå°å å·¥å
èºçº¹å
¬ç§°ç´å¾(åç)") |
| | | private String minInternalThread; |
| | | |
| | | //å页忰 |
| | | @ApiModelProperty(value = "页ç ") |
| | | private Integer pageNo = 1; // å½å页ç ï¼é»è®¤ç¬¬ä¸é¡µ |
| | | @ApiModelProperty(value = "æ¯é¡µæ°é") |
| | | private Integer pageSize = 10; // æ¯é¡µæ°éï¼é»è®¤10æ¡ |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.commons.math3.analysis.function.Constant; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ParaBlade; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.tms.entity.vo.ParaBladeVo; |
| | | |
| | | /** |
| | | * @Description: tms_para_blade |
| | |
| | | */ |
| | | public interface ParaBladeMapper extends BaseMapper<ParaBlade> { |
| | | |
| | | List<ParaBladeVo> selectByClassifyAndParam(@Param(Constants.WRAPPER) Wrapper<ParaBlade> queryWrapper); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | public interface ParaHoleToolsMapper extends BaseMapper<ParaHoleTools> { |
| | | |
| | | List<ParaHolesToolsVo> selectByClassifyAndDiameter(@Param(Constants.WRAPPER) |
| | | LambdaQueryWrapper<ParaHolesToolsVo> queryWrapper); |
| | | Wrapper<ParaHoleTools> queryWrapper); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ParaMillTool; |
| | |
| | | public interface ParaMillToolMapper extends BaseMapper<ParaMillTool> { |
| | | |
| | | List<ParaMillToolVo> selectByClassifyAndDiameter(@Param(Constants.WRAPPER) |
| | | LambdaQueryWrapper<ParaMillTool> queryWrapper); |
| | | Wrapper<ParaMillTool> queryWrapper); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ParaThreadingTool; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.jeecg.modules.tms.entity.vo.ParaThreadingToolVo; |
| | | |
| | | /** |
| | | * @Description: tms_para_threading_tool |
| | |
| | | */ |
| | | public interface ParaThreadingToolMapper extends BaseMapper<ParaThreadingTool> { |
| | | |
| | | List<ParaThreadingToolVo> selectByClassifyAndParam(@Param(Constants.WRAPPER) Wrapper<ParaThreadingTool> queryWrapper); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.ParaTurningTools; |
| | |
| | | public interface ParaTurningToolsMapper extends BaseMapper<ParaTurningTools> { |
| | | |
| | | List<ParaTurningToolsVo> selectByClassifyAndDiameter(@Param(Constants.WRAPPER) |
| | | LambdaQueryWrapper<ParaTurningTools> queryWrapper); |
| | | Wrapper<ParaTurningTools> queryWrapper); |
| | | } |
| | |
| | | <select id="pageWithLedgerAndConfig" resultType="org.jeecg.modules.tms.entity.vo.StocktakingPoundVo"> |
| | | SELECT |
| | | t.id, |
| | | t.tool_id AS toolId, |
| | | t1.classify_id AS classifyId, |
| | | t.create_time AS createTime, |
| | | t.tool_code AS toolCode, |
| | | t2.tool_model AS toolModel, |
| | | t2.parama_table_name AS paramaTableName, |
| | | t1.total_count AS totalCount, |
| | | t1.available_count AS availableCount, |
| | | t.tool_id AS toolId, |
| | | t3.position_code AS positionCode, |
| | | t3.application_type AS applicationType, |
| | | t2.chinese_name AS chineseName, |
| | | t3.chinese_name AS chineseName, |
| | | t3.supplier_id AS supplierId, |
| | | t3.storage_location AS storageLocation, |
| | | t3.main_unit AS mainUnit, |
| | | |
| | | t1.available_count AS availableCount, |
| | | t1.total_count AS totalCount, |
| | | t3.warehouse_id AS warehouseId, |
| | | t4.classify_id AS classifyId, |
| | | t3.province_city AS provinceCity, |
| | | <!-- 卿忮µéæ©ï¼ä½¿ç¨è¡¨å«åï¼éç¡®ä¿è¡¨å·²å
³èï¼ --> |
| | | <choose> |
| | | <when test="ew.paramNameValuePairs.paramaTableName == '1'"> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.ParaBladeMapper"> |
| | | |
| | | <select id="selectByClassifyAndParam" resultType="org.jeecg.modules.tms.entity.vo.ParaBladeVo"> |
| | | SELECT |
| | | t.id, |
| | | t.classify_id AS classifyId, |
| | | t2.classify_id AS classifyNum, |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t1.tool_code AS toolCode, |
| | | t1.parama_table_name AS paramaTableName, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | | t.standard_level AS standardLevel, |
| | | t.standard_code AS standardCode, |
| | | t.position_code AS positionCode, |
| | | t.tool_model AS toolModel, |
| | | t.tool_material AS toolMaterial, |
| | | t.part_material AS partMaterial, |
| | | t.technical_conditions AS technicalConditions, |
| | | t.conditions_info AS conditionsInfo, |
| | | t.brand, |
| | | t.types, |
| | | <!-- åçç¹æåæ®µ --> |
| | | t.blade_shape AS bladeShape, |
| | | t.cutting_edge_count AS cuttingEdgeCount, |
| | | t.clamping_type AS clampingType, |
| | | t.nose_angle_r AS noseAngleR, |
| | | t.processing_classify AS processingClassify, |
| | | t.blade_posterior AS bladePosterior, |
| | | t.blade_size AS bladeSize, |
| | | t.in_out_thread AS inOutThread, |
| | | t.dental_angle AS dentalAngle, |
| | | t.min_internal_thread AS minInternalThread, |
| | | t.thread_standard AS threadStandard |
| | | FROM tms_para_blade t |
| | | LEFT JOIN tms_base_tools t1 ON t.tool_code = t1.id |
| | | LEFT JOIN tms_tools_classify t2 ON t.classify_id = t2.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t1.tool_code AS toolCode, |
| | | t1.parama_table_name AS paramaTableName, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | |
| | | t2.classify_id AS classifyNum, |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t.tool_code AS toolCode, |
| | | t1.tool_code AS toolCode, |
| | | t1.parama_table_name AS paramaTableName, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.ParaThreadingToolMapper"> |
| | | |
| | | <select id="selectByClassifyAndParam" resultType="org.jeecg.modules.tms.entity.vo.ParaThreadingToolVo"> |
| | | SELECT |
| | | t.id, |
| | | t.classify_id AS classifyId, |
| | | t2.classify_id AS classifyNum, |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t1.tool_code AS toolCode, |
| | | t1.parama_table_name AS paramaTableName, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | | t.standard_level AS standardLevel, |
| | | t.standard_code AS standardCode, |
| | | t.position_code AS positionCode, |
| | | t.tool_model AS toolModel, |
| | | t.edge_length AS edgeLength, |
| | | t.total_length AS totalLength, |
| | | t.tool_material AS toolMaterial, |
| | | t.part_material AS partMaterial, |
| | | t.paintcoat_flag AS paintcoatFlag, |
| | | t.handle_specifications AS handleSpecifications, |
| | | t.cooling_method AS coolingMethod, |
| | | t.technical_conditions AS technicalConditions, |
| | | t.conditions_info AS conditionsInfo, |
| | | t.brand, |
| | | t.types, |
| | | <!-- èºçº¹åå
·ç¹æå段 --> |
| | | t.thread_code AS threadCode, |
| | | t.rotation_direction AS rotationDirection, |
| | | t.tolerancezone_level AS tolerancezoneLevel, |
| | | t.external_dimensions AS externalDimensions, |
| | | t.handle_specifications AS handleSpecifications, |
| | | t.screw_hole_type AS screwHoleType, |
| | | t.thread_standard AS threadStandard, |
| | | t.flute_solt_type AS fluteSoltType, |
| | | t.thread_type AS threadType, |
| | | t.guiding_size AS guidingSize, |
| | | t.connection_aperture AS connectionAperture, |
| | | t.connecting_keyway AS connectingKeyway |
| | | FROM tms_para_threading_tool t |
| | | LEFT JOIN tms_base_tools t1 ON t.tool_code = t1.id |
| | | LEFT JOIN tms_tools_classify t2 ON t.classify_id = t2.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | t2.type_name AS classifyName, |
| | | t1.id AS toolId, |
| | | t1.tool_code AS toolCode, |
| | | t1.parama_table_name AS paramaTableName, |
| | | t.sign_code AS signCode, |
| | | t.chinese_name AS chineseName, |
| | | t.foreign_language_name AS foreignLanguageName, |
| | |
| | | <select id="selectByMainId" resultType="org.jeecg.modules.tms.entity.ToolsStocktakingBoundDetail"> |
| | | SELECT |
| | | t.*, |
| | | t2.tool_code AS toolCode, <!-- ä¿®æ£ï¼å°t1æ¹ä¸ºt2 --> |
| | | t2.parama_table_name paramaTableName, |
| | | t2.classify_id AS classifyId, |
| | | t4.classify_id AS classifyId, |
| | | t3.storage_location AS storageLocation, |
| | | t3.chinese_name AS chineseName, |
| | | t2.tool_model AS toolModel, |
| | | t3.application_type AS applicationType, |
| | | t3.supplier_id AS supplierId, |
| | | |
| | | <choose> |
| | |
| | | c.part_material AS partMaterial |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | FROM tms_stocktaking_bound_detail t |
| | | LEFT JOIN tms_base_tools t2 on t.tool_id = t2.id |
| | | LEFT JOIN tms_tools_config_property t3 on t3.tool_code = t2.id |
| | | left join tms_tool_ledger t1 ON t1.tool_id= t.tool_Code |
| | | left join tms_tool_ledger_detail t5 ON t5.tool_Code= t.tool_id |
| | | left join tms_tools_classify t4 on t4.id = t1.classify_id |
| | | left join tms_base_tools t2 on t2.id = t.tool_code |
| | | left join tms_tools_config_property t3 on t3.tool_code = t.tool_code |
| | | |
| | | |
| | | <choose> |
| | | <when test="ew.paramNameValuePairs.paramaTableName == '1'"> |
| | |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaBlade; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.tms.entity.dto.ToolQueryParamDto; |
| | | import org.jeecg.modules.tms.entity.vo.ParaBladeVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_blade |
| | |
| | | */ |
| | | public interface IParaBladeService extends IService<ParaBlade> { |
| | | |
| | | List<ParaBladeVo> selectByClassifyAndParam(ToolQueryParamDto queryParam); |
| | | } |
| | |
| | | |
| | | import org.jeecg.modules.tms.entity.ParaThreadingTool; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.tms.entity.dto.ToolQueryParamDto; |
| | | import org.jeecg.modules.tms.entity.vo.ParaThreadingToolVo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_threading_tool |
| | |
| | | */ |
| | | public interface IParaThreadingToolService extends IService<ParaThreadingTool> { |
| | | |
| | | List<ParaThreadingToolVo> selectByClassifyAndParam(ToolQueryParamDto queryParam); |
| | | } |
| | |
| | | List<String> convertToOutboundOrder(List<String> preparationOrderIds); |
| | | |
| | | IPage<PreparationOrder> queryPageList(Page<PreparationOrder> page, Map<String, String[]> parameterMap); |
| | | |
| | | void addPreparationOrderFromDnc(PreparationOrderAndDetailDto preparationOrderAndDetailDto); |
| | | } |
| | |
| | | private OutboundOrderMapper outboundOrderMapper; |
| | | @Autowired |
| | | private OutboundDetailMapper outboundDetailMapper; |
| | | @Autowired |
| | | private OutboundOrderConvert outboundOrderConvert; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addTotal(OutboundOrderAndDetailDto outboundOrder) { |
| | | OutboundOrder order = OutboundOrderConvert.INSTANCE.convert(outboundOrder); |
| | | OutboundOrder order = outboundOrderConvert.convert(outboundOrder); |
| | | order.setHandler(Objects.requireNonNull(getCurrentUser()).getId()); |
| | | order.setOutNum(businessCodeRuleService.generateBusinessCodeSeq("outBoundOrder")); |
| | | order.setOrderStatus(OutBillStatus.DRAFT.getValue()); |
| | |
| | | //å 餿ææç» |
| | | outboundDetailService.remove(new LambdaQueryWrapper<OutboundDetail>() |
| | | .eq(OutboundDetail::getOutStorehouseId, outboundOrder.getId())); |
| | | OutboundOrder outboundOrderUpdate = OutboundOrderConvert.INSTANCE.convert(outboundOrder); |
| | | OutboundOrder outboundOrderUpdate = outboundOrderConvert.convert(outboundOrder); |
| | | outboundOrderMapper.updateById(outboundOrderUpdate); |
| | | List<OutboundDetail> detailList = CollectionUtil.newArrayList(); |
| | | outboundOrder.getOutboundDetailList().forEach(item->{ |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.jeecg.modules.tms.entity.ParaBlade; |
| | | import org.jeecg.modules.tms.entity.dto.ToolQueryParamDto; |
| | | import org.jeecg.modules.tms.entity.vo.ParaBladeVo; |
| | | import org.jeecg.modules.tms.mapper.ParaBladeMapper; |
| | | import org.jeecg.modules.tms.service.IParaBladeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_blade |
| | |
| | | @Service |
| | | public class ParaBladeServiceImpl extends ServiceImpl<ParaBladeMapper, ParaBlade> implements IParaBladeService { |
| | | |
| | | @Override |
| | | public List<ParaBladeVo> selectByClassifyAndParam(ToolQueryParamDto paramDto) { |
| | | QueryWrapper<ParaBlade> queryWrapper = Wrappers.query(); |
| | | if (paramDto != null) { |
| | | // åçç¸å
³åæ°å段 |
| | | queryWrapper |
| | | .like(StrUtil.isNotBlank(paramDto.getToolCode()), "t1.tool_code", paramDto.getToolCode()) |
| | | .like(StrUtil.isNotBlank(paramDto.getToolModel()), "t.tool_model", paramDto.getToolModel()) |
| | | .like(StrUtil.isNotBlank(paramDto.getChineseName()), "t.chinese_name", paramDto.getChineseName()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), "t.classify_id", paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getPitch()), "t.pitch", paramDto.getPitch()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getCuttingDirection()), "t.cutting_direction", paramDto.getCuttingDirection()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeLength()), "t.blade_length", paramDto.getBladeLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeWide()), "t.blade_wide", paramDto.getBladeWide()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeShape()), "t.blade_shape", paramDto.getBladeShape()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getCuttingEdgeCount()), "t.cutting_edge_count", paramDto.getCuttingEdgeCount()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getClampingType()), "t.clamping_type", paramDto.getClampingType()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getNoseAngleR()), "t.nose_angle_r", paramDto.getNoseAngleR()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getProcessingClassify()), "t.processing_classify", paramDto.getProcessingClassify()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladePosterior()), "t.blade_posterior", paramDto.getBladePosterior()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeSize()), "t.blade_size", paramDto.getBladeSize()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getInOutThread()), "t.in_out_thread", paramDto.getInOutThread()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDentalAngle()), "t.dental_angle", paramDto.getDentalAngle()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMinInternalThread()), "t.min_internal_thread", paramDto.getMinInternalThread()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getThreadStandard()), "t.thread_standard", paramDto.getThreadStandard()); |
| | | } |
| | | return this.baseMapper.selectByClassifyAndParam(queryWrapper); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<ParaHolesToolsVo> selectByClassifyAndDiameter(ToolQueryParamDto paramDto) { |
| | | LambdaQueryWrapper<ParaHolesToolsVo> queryWrapper = new LambdaQueryWrapper<>(); |
| | | QueryWrapper<ParaHoleTools> queryWrapper = Wrappers.query(); |
| | | if (paramDto != null) { |
| | | // åå å·¥åå
·ç¸å
³åæ°å段 |
| | | queryWrapper |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), ParaHolesToolsVo::getClassifyId, paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDiameter()), ParaHolesToolsVo::getDiameter, paramDto.getDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getTotalLength()), ParaHolesToolsVo::getTotalLength, paramDto.getTotalLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getToolMaterial()), ParaHolesToolsVo::getToolMaterial, paramDto.getToolMaterial()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getEdgeLength()), ParaHolesToolsVo::getEdgeLength, paramDto.getEdgeLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeCount()), ParaHolesToolsVo::getBladeCount, paramDto.getBladeCount()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getEffectiveLength()), ParaHolesToolsVo::getEffectiveLength, paramDto.getEffectiveLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getLatestBoringDiameter()), ParaHolesToolsVo::getLatestBoringDiameter, paramDto.getLatestBoringDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMaxBoringDiameter()), ParaHolesToolsVo::getMaxBoringDiameter, paramDto.getMaxBoringDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getKnifeDiameter()), ParaHolesToolsVo::getKnifeDiameter, paramDto.getKnifeDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBoreDiameter()), ParaHolesToolsVo::getBoreDiameter, paramDto.getBoreDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getHeadsNumber()), ParaHolesToolsVo::getHeadsNumber, paramDto.getHeadsNumber()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSmallDiameter()), ParaHolesToolsVo::getSmallDiameter, paramDto.getSmallDiameter()); |
| | | .like(StrUtil.isNotBlank(paramDto.getToolCode()), "t1.tool_code", paramDto.getToolCode()) |
| | | .like(StrUtil.isNotBlank(paramDto.getToolModel()), "t.tool_model", paramDto.getToolModel()) |
| | | .like(StrUtil.isNotBlank(paramDto.getChineseName()), "t.chinese_name", paramDto.getChineseName()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), "t.classify_id", paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDiameter()), "t.diameter", paramDto.getDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getTotalLength()), "t.total_length", paramDto.getTotalLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getToolMaterial()), "t.tool_material", paramDto.getToolMaterial()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getEdgeLength()), "t.edge_length", paramDto.getEdgeLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeCount()), "t.blade_count", paramDto.getBladeCount()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getEffectiveLength()), "t.effective_length", paramDto.getEffectiveLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getLatestBoringDiameter()), "t.latest_boring_diameter", paramDto.getLatestBoringDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMaxBoringDiameter()), "t.max_boring_diameter", paramDto.getMaxBoringDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getKnifeDiameter()), "t.knife_diameter", paramDto.getKnifeDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBoreDiameter()), "t.bore_diameter", paramDto.getBoreDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getHeadsNumber()), "t.heads_number", paramDto.getHeadsNumber()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSmallDiameter()), "t.small_diameter", paramDto.getSmallDiameter()); |
| | | } |
| | | return this.baseMapper.selectByClassifyAndDiameter(queryWrapper); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.jeecg.modules.tms.entity.ParaMillTool; |
| | | import org.jeecg.modules.tms.entity.dto.ToolQueryParamDto; |
| | | import org.jeecg.modules.tms.entity.vo.ParaMillToolVo; |
| | |
| | | |
| | | @Override |
| | | public List<ParaMillToolVo> selectByClassifyAndDiameter(ToolQueryParamDto paramDto) { |
| | | LambdaQueryWrapper<ParaMillTool> queryWrapper = new LambdaQueryWrapper<>(); |
| | | QueryWrapper<ParaMillTool> queryWrapper = Wrappers.query(); |
| | | if (paramDto != null) { |
| | | //é£ååå
·ç¸å
³åæ°å段 |
| | | queryWrapper |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), ParaMillTool::getClassifyId, paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDiameter()), ParaMillTool::getDiameter, paramDto.getDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getTotalLength()), ParaMillTool::getTotalLength, paramDto.getTotalLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getToolMaterial()), ParaMillTool::getToolMaterial, paramDto.getToolMaterial()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getEdgeLength()), ParaMillTool::getEdgeLength, paramDto.getEdgeLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getNumberOfTeeth()), ParaMillTool::getNumberOfTeeth, paramDto.getNumberOfTeeth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getNeckDiameter()), ParaMillTool::getNeckDiameter, paramDto.getNeckDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSmallDiameter()), ParaMillTool::getSmallDiameter, paramDto.getSmallDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getHandleLength()), ParaMillTool::getHandleLength, paramDto.getHandleLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDeepestDepth()), ParaMillTool::getDeepestDepth, paramDto.getDeepestDepth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getHandleNeckLength()), ParaMillTool::getHandleNeckLength, paramDto.getHandleNeckLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getOverhangingLength()), ParaMillTool::getOverhangingLength, paramDto.getOverhangingLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getPitch()), ParaMillTool::getPitch, paramDto.getPitch()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getRecentlyDiameter()), ParaMillTool::getRecentlyDiameter, paramDto.getRecentlyDiameter()); |
| | | .like(StrUtil.isNotBlank(paramDto.getToolCode()), "t1.tool_code", paramDto.getToolCode()) |
| | | .like(StrUtil.isNotBlank(paramDto.getToolModel()), "t.tool_model", paramDto.getToolModel()) |
| | | .like(StrUtil.isNotBlank(paramDto.getChineseName()), "t.chinese_name", paramDto.getChineseName()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), "t.classify_id", paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDiameter()), "t.diameter", paramDto.getDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getTotalLength()), "t.total_length", paramDto.getTotalLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getToolMaterial()), "t.tool_material", paramDto.getToolMaterial()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getEdgeLength()), "t.edge_length", paramDto.getEdgeLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getNumberOfTeeth()), "t.number_of_teeth", paramDto.getNumberOfTeeth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getNeckDiameter()), "t.neck_diameter", paramDto.getNeckDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSmallDiameter()), "t.small_diameter", paramDto.getSmallDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getHandleLength()), "t.handle_length", paramDto.getHandleLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDeepestDepth()), "t.deepest_depth", paramDto.getDeepestDepth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getHandleNeckLength()), "t.handle_neck_length", paramDto.getHandleNeckLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getOverhangingLength()), "t.overhanging_length", paramDto.getOverhangingLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getPitch()), "t.pitch", paramDto.getPitch()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getRecentlyDiameter()), "t.recently_diameter", paramDto.getRecentlyDiameter()); |
| | | } |
| | | return this.baseMapper.selectByClassifyAndDiameter(queryWrapper); |
| | | } |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.jeecg.modules.tms.entity.ParaThreadingTool; |
| | | import org.jeecg.modules.tms.entity.dto.ToolQueryParamDto; |
| | | import org.jeecg.modules.tms.entity.vo.ParaThreadingToolVo; |
| | | import org.jeecg.modules.tms.mapper.ParaThreadingToolMapper; |
| | | import org.jeecg.modules.tms.service.IParaThreadingToolService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @Description: tms_para_threading_tool |
| | |
| | | @Service |
| | | public class ParaThreadingToolServiceImpl extends ServiceImpl<ParaThreadingToolMapper, ParaThreadingTool> implements IParaThreadingToolService { |
| | | |
| | | @Override |
| | | public List<ParaThreadingToolVo> selectByClassifyAndParam(ToolQueryParamDto paramDto) { |
| | | QueryWrapper<ParaThreadingTool> queryWrapper = Wrappers.query(); |
| | | if (paramDto != null) { |
| | | // èºçº¹åå
·ç¸å
³åæ°å段 |
| | | queryWrapper |
| | | .like(StrUtil.isNotBlank(paramDto.getToolCode()), "t1.tool_code", paramDto.getToolCode()) |
| | | .like(StrUtil.isNotBlank(paramDto.getToolModel()), "t.tool_model", paramDto.getToolModel()) |
| | | .like(StrUtil.isNotBlank(paramDto.getChineseName()), "t.chinese_name", paramDto.getChineseName()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), "t.classify_id", paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getThreadCode()), "t.thread_code", paramDto.getThreadCode()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getPitch()), "t.pitch", paramDto.getPitch()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getRotationDirection()), "t.rotation_direction", paramDto.getRotationDirection()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getTolerancezoneLevel()), "t.tolerancezone_level", paramDto.getTolerancezoneLevel()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getExternalDimensions()), "t.external_dimensions", paramDto.getExternalDimensions()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getHandleSpecifications()), "t.handle_specifications", paramDto.getHandleSpecifications()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getScrewHoleType()), "t.screw_hole_type", paramDto.getScrewHoleType()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getThreadStandard()), "t.thread_standard", paramDto.getThreadStandard()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getFluteSoltType()), "t.flute_solt_type", paramDto.getFluteSoltType()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getThreadType()), "t.thread_type", paramDto.getThreadType()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getGuidingSize()), "t.guiding_size", paramDto.getGuidingSize()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getConnectionAperture()), "t.connection_aperture", paramDto.getConnectionAperture()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getConnectingKeyway()), "t.connecting_keyway", paramDto.getConnectingKeyway()); |
| | | } |
| | | return this.baseMapper.selectByClassifyAndParam(queryWrapper); |
| | | } |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.jeecg.modules.tms.entity.ParaTurningTools; |
| | | import org.jeecg.modules.tms.entity.dto.ToolQueryParamDto; |
| | | import org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo; |
| | |
| | | |
| | | @Override |
| | | public List<ParaTurningToolsVo> selectByClassifyAndDiameter(ToolQueryParamDto paramDto) { |
| | | LambdaQueryWrapper<ParaTurningTools> queryWrapper = new LambdaQueryWrapper<>(); |
| | | QueryWrapper<ParaTurningTools> queryWrapper = Wrappers.query(); |
| | | if (paramDto != null) { |
| | | //车ååå
·ç¸å
³åæ°å段 |
| | | queryWrapper |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), ParaTurningTools::getClassifyId, paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDiameter()), ParaTurningTools::getToolDiameter, paramDto.getDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getTotalLength()), ParaTurningTools::getTotalLength, paramDto.getTotalLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getToolMaterial()), ParaTurningTools::getToolMaterial, paramDto.getToolMaterial()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSmallDiameter()), ParaTurningTools::getSmallDiameter, paramDto.getSmallDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getCuttingDirection()), ParaTurningTools::getCuttingDirection, paramDto.getCuttingDirection()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getKnifeSize()), ParaTurningTools::getKnifeSize, paramDto.getKnifeSize()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBoringBarDiameter()), ParaTurningTools::getBoringBarDiameter, paramDto.getBoringBarDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeLength()), ParaTurningTools::getBladeLength, paramDto.getBladeLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBarDirection()), ParaTurningTools::getBarDirection, paramDto.getBarDirection()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeHeight()), ParaTurningTools::getBladeHeight, paramDto.getBladeHeight()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeWide()), ParaTurningTools::getBladeWide, paramDto.getBladeWide()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSlotWidth()), ParaTurningTools::getSlotWidth, paramDto.getSlotWidth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMaxDiameter()), ParaTurningTools::getMaxDiameter, paramDto.getMaxDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMaxDepth()), ParaTurningTools::getMaxDepth, paramDto.getMaxDepth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeThickness()), ParaTurningTools::getBladeThickness, paramDto.getBladeThickness()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMinDiameter()), ParaTurningTools::getMinDiameter, paramDto.getMinDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMatchingNumber()), ParaTurningTools::getMatchingNumber, paramDto.getMatchingNumber()); |
| | | .like(StrUtil.isNotBlank(paramDto.getToolCode()), "t1.tool_code", paramDto.getToolCode()) |
| | | .like(StrUtil.isNotBlank(paramDto.getToolModel()), "t.tool_model", paramDto.getToolModel()) |
| | | .like(StrUtil.isNotBlank(paramDto.getChineseName()), "t.chinese_name", paramDto.getChineseName()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getClassifyId()), "t.classify_id", paramDto.getClassifyId()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getDiameter()), "t.tool_diameter", paramDto.getDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getTotalLength()), "t.total_length", paramDto.getTotalLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getToolMaterial()), "t.tool_material", paramDto.getToolMaterial()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSmallDiameter()), "t.small_diameter", paramDto.getSmallDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getCuttingDirection()), "t.cutting_direction", paramDto.getCuttingDirection()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getKnifeSize()), "t.knife_size", paramDto.getKnifeSize()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBoringBarDiameter()), "t.boring_bar_diameter", paramDto.getBoringBarDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeLength()), "t.blade_length", paramDto.getBladeLength()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBarDirection()), "t.bar_direction", paramDto.getBarDirection()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeHeight()), "t.blade_height", paramDto.getBladeHeight()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeWide()), "t.blade_wide", paramDto.getBladeWide()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getSlotWidth()), "t.slot_width", paramDto.getSlotWidth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMaxDiameter()), "t.max_diameter", paramDto.getMaxDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMaxDepth()), "t.max_depth", paramDto.getMaxDepth()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getBladeThickness()), "t.blade_thickness", paramDto.getBladeThickness()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMinDiameter()), "t.min_diameter", paramDto.getMinDiameter()) |
| | | .eq(StrUtil.isNotBlank(paramDto.getMatchingNumber()), "t.matching_number", paramDto.getMatchingNumber()); |
| | | } |
| | | return this.baseMapper.selectByClassifyAndDiameter(queryWrapper); |
| | | } |
| | |
| | | private ISysBusinessCodeRuleService businessCodeRuleService; |
| | | @Autowired |
| | | private IBaseToolsService baseToolsService; |
| | | @Autowired |
| | | private PreparationOrderConvert preparationOrderConvert; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | //å
å 餿ææç» |
| | | preparationOrderDetailMapper.delete(new LambdaQueryWrapper<PreparationOrderDetail>() |
| | | .eq(PreparationOrderDetail::getPreparationOrderId, preparationOrderAndDetailDto.getId())); |
| | | PreparationOrder preparationOrder = PreparationOrderConvert.INSTANCE.convert(preparationOrderAndDetailDto); |
| | | PreparationOrder preparationOrder = preparationOrderConvert.convert(preparationOrderAndDetailDto); |
| | | updateById(preparationOrder); |
| | | List<PreparationOrderDetail> detailUpdateList = CollectionUtil.newArrayList(); |
| | | preparationOrderAndDetailDto.getPreparationOrderDetailList().forEach(item->{ |
| | |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | |
| | | private LoginUser getCurrentUser() { |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addPreparationOrderFromDnc(PreparationOrderAndDetailDto preparationOrderAndDetailDto) { |
| | | PreparationOrder preparationOrder = preparationOrderConvert.convert(preparationOrderAndDetailDto); |
| | | preparationOrder |
| | | .setId(null) |
| | | .setPreparationOrderNum(businessCodeRuleService.generateBusinessCodeSeq("ToolPreparationOrder")) |
| | | .setOrderStatus(PreparationOrderStatus.PENDING_AUDIT.getValue()); |
| | | save(preparationOrder); |
| | | List<PreparationOrderDetail> preparationOrderDetailList = preparationOrderAndDetailDto.getPreparationOrderDetailList(); |
| | | preparationOrderDetailList.forEach(item -> { |
| | | item.setId(null).setPreparationOrderId(preparationOrder.getId()); |
| | | }); |
| | | preparationOrderDetailService.saveBatch(preparationOrderDetailList); |
| | | } |
| | | |
| | | private LoginUser getCurrentUser() { |
| | | // è·åå½å认è¯çç»å½ç¨æ·ä¿¡æ¯ |
| | | Subject currentUser = SecurityUtils.getSubject(); |
| | | if (currentUser != null && currentUser.isAuthenticated()) { |