Compare commits
	
		
			12 Commits
		
	
	
		
			cicd
			...
			dd9cff155e
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| dd9cff155e | |||
| 101bc8359e | |||
| e405dcb06a | |||
| 458cedb42f | |||
| b0c884d210 | |||
| 3f38072356 | |||
| 3167ad09c4 | |||
| df44cf308f | |||
| 57b79b4f0e | |||
| 
						 | 
					a8d3147ac9 | ||
| 
						 | 
					550a2f796b | ||
| 25d21ef884 | 
@@ -43,6 +43,11 @@
 | 
				
			|||||||
            <artifactId>ym-common</artifactId>
 | 
					            <artifactId>ym-common</artifactId>
 | 
				
			||||||
            <version>1.0-SNAPSHOT</version>
 | 
					            <version>1.0-SNAPSHOT</version>
 | 
				
			||||||
        </dependency>
 | 
					        </dependency>
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>com.alibaba</groupId>
 | 
				
			||||||
 | 
					            <artifactId>fastjson</artifactId>
 | 
				
			||||||
 | 
					            <version>1.2.75</version>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    </dependencies>
 | 
					    </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										168
									
								
								ym-admin/src/main/java/com/cnbm/admin/base/BaseSupport.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								ym-admin/src/main/java/com/cnbm/admin/base/BaseSupport.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,168 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Copyright (c) 2018.
 | 
				
			||||||
 | 
					 * http://www.ulabcare.com
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package com.cnbm.admin.base;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.alibaba.fastjson.JSON;
 | 
				
			||||||
 | 
					import com.cnbm.admin.dto.LoginUserDTO;
 | 
				
			||||||
 | 
					import com.cnbm.admin.entity.LoginUser;
 | 
				
			||||||
 | 
					import com.cnbm.admin.enums.WhetherEnum;
 | 
				
			||||||
 | 
					import lombok.Builder;
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					import org.apache.commons.lang3.StringUtils;
 | 
				
			||||||
 | 
					import org.springframework.beans.BeanUtils;
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					import org.springframework.web.context.request.RequestContextHolder;
 | 
				
			||||||
 | 
					import org.springframework.web.context.request.ServletRequestAttributes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import javax.servlet.http.HttpServletRequest;
 | 
				
			||||||
 | 
					import javax.servlet.http.HttpServletResponse;
 | 
				
			||||||
 | 
					import javax.servlet.http.HttpSession;
 | 
				
			||||||
 | 
					import java.io.Serializable;
 | 
				
			||||||
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 接口支持基类
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author jiff
 | 
				
			||||||
 | 
					 * @date 2018/11/1
 | 
				
			||||||
 | 
					 * @since 1.0
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					public class BaseSupport {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    protected LoginUser getLoginUser() {
 | 
				
			||||||
 | 
					        // 后续完善拦截器再使用该方式
 | 
				
			||||||
 | 
					//        LoginUser loginUser = loginUserHolder.get();
 | 
				
			||||||
 | 
					//        if (loginUser != null) {
 | 
				
			||||||
 | 
					//            return loginUser;
 | 
				
			||||||
 | 
					//        }
 | 
				
			||||||
 | 
					        HttpSession session = getHttpServletRequest().getSession(false);
 | 
				
			||||||
 | 
					        LoginUser loginUser = null;
 | 
				
			||||||
 | 
					        if (session != null) {
 | 
				
			||||||
 | 
					            String loginUserJson = (String) session.getAttribute(LoginUser.HTTP_HEADER_NAME);
 | 
				
			||||||
 | 
					            if (StringUtils.isNotBlank(loginUserJson)) {
 | 
				
			||||||
 | 
					                loginUser = JSON.parseObject(loginUserJson, LoginUser.class);
 | 
				
			||||||
 | 
					                return loginUser;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return null;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 获取当前http请求对象
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected HttpServletRequest getHttpServletRequest() {
 | 
				
			||||||
 | 
					        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 获取当前http响应对象
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected HttpServletResponse getHttpServletResponse() {
 | 
				
			||||||
 | 
					        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 设置公共字段值,一般用于创建新记录,包含以下字段:
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * <p>
 | 
				
			||||||
 | 
					     * {@link CommonField#enabled}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#valid}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#creatorId}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#creatorName}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#createTime}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#updaterId}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#updaterName}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#updateTime}<br>
 | 
				
			||||||
 | 
					     * </p>
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param t                需要设置的对象
 | 
				
			||||||
 | 
					     * @param ignoreProperties 忽略的字段
 | 
				
			||||||
 | 
					     * @param <T>
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public <T extends Serializable> T setCommonField(T t, String... ignoreProperties) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CommonField commonField = CommonField.builder()
 | 
				
			||||||
 | 
					                .enabled(WhetherEnum.YES.getValue())
 | 
				
			||||||
 | 
					                .valid(WhetherEnum.YES.getValue())
 | 
				
			||||||
 | 
					                .createTime(LocalDateTime.now())
 | 
				
			||||||
 | 
					                .creatorId(getLoginUser().getSysUserEntity().getId())
 | 
				
			||||||
 | 
					                .creatorName(getLoginUser().getUsername())
 | 
				
			||||||
 | 
					                .updateTime(LocalDateTime.now())
 | 
				
			||||||
 | 
					                .updaterId(getLoginUser().getSysUserEntity().getId())
 | 
				
			||||||
 | 
					                .updaterName(getLoginUser().getUsername())
 | 
				
			||||||
 | 
					                .build();
 | 
				
			||||||
 | 
					        BeanUtils.copyProperties(commonField, t, ignoreProperties);
 | 
				
			||||||
 | 
					        return t;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 设置更新的公共字段值,一般用于更新记录,包含以下字段:
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * <p>
 | 
				
			||||||
 | 
					     * {@link CommonField#updaterId}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#updaterName}<br>
 | 
				
			||||||
 | 
					     * {@link CommonField#updateTime}<br>
 | 
				
			||||||
 | 
					     * </p>
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param t   需要设置的对象
 | 
				
			||||||
 | 
					     * @param <T>
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public <T extends Serializable> T setUpdateCommonField(T t) {
 | 
				
			||||||
 | 
					        CommonField commonField = CommonField.builder()
 | 
				
			||||||
 | 
					                .updaterId(getLoginUser().getSysUserEntity().getId())
 | 
				
			||||||
 | 
					                .updaterName(getLoginUser().getUsername())
 | 
				
			||||||
 | 
					                .updateTime(LocalDateTime.now())
 | 
				
			||||||
 | 
					                .build();
 | 
				
			||||||
 | 
					        BeanUtils.copyProperties(commonField, t, "enabled", "valid");
 | 
				
			||||||
 | 
					        return t;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Data
 | 
				
			||||||
 | 
					    @Builder
 | 
				
			||||||
 | 
					    private static class CommonField implements Serializable {
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 启用状态:0 、停用,1、启用
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private Integer enabled;
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 删除标志,是否有效:1 可用 0不可用
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private Integer valid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 创建人
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private Long creatorId;
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 创建人
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private String creatorName;
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 创建时间
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private LocalDateTime createTime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 更新人
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private Long updaterId;
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 更新人
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private String updaterName;
 | 
				
			||||||
 | 
					        /**
 | 
				
			||||||
 | 
					         * 更新时间
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        private LocalDateTime updateTime;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										65
									
								
								ym-admin/src/main/java/com/cnbm/admin/dto/LoginUserDTO.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								ym-admin/src/main/java/com/cnbm/admin/dto/LoginUserDTO.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Copyright (c) 2018.
 | 
				
			||||||
 | 
					 * http://www.ulabcare.com
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package com.cnbm.admin.dto;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import lombok.Builder;
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					import lombok.EqualsAndHashCode;
 | 
				
			||||||
 | 
					import lombok.experimental.Accessors;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.io.Serializable;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @author jiff
 | 
				
			||||||
 | 
					 * @date 2018/11/1
 | 
				
			||||||
 | 
					 * @since 1.0
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@EqualsAndHashCode(callSuper = false)
 | 
				
			||||||
 | 
					@Builder
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					@Accessors(chain = true)
 | 
				
			||||||
 | 
					public class LoginUserDTO implements Serializable {
 | 
				
			||||||
 | 
					    public static final String HTTP_HEADER_NAME = "loginUser";
 | 
				
			||||||
 | 
					    public static final int USER_TYPE_PLATFORM = 1;
 | 
				
			||||||
 | 
					    public static final int USER_TYPE_PARTNER = 2;
 | 
				
			||||||
 | 
					    public static final int USER_TYPE_HOSPITAL = 3;
 | 
				
			||||||
 | 
					    public static final int USER_TYPE_PATIENT = 4;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 会话ID
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private String sessionId;
 | 
				
			||||||
 | 
					    private Long passportUserId;
 | 
				
			||||||
 | 
					    private Long userId;
 | 
				
			||||||
 | 
					    private Long partnerId;
 | 
				
			||||||
 | 
					    private Long hospitalId;
 | 
				
			||||||
 | 
					    private Long orgId;
 | 
				
			||||||
 | 
					    private String mobile;
 | 
				
			||||||
 | 
					    private String userName;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 用户类型
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private int userType;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 应用类型
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private int appType;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 应用代码
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private int appCode;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 登录类型:1、自主登录,2、漫游登录
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private int loginType;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 微信appId
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private String wechatAppId;
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 微信openId
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    private String openId;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -24,6 +24,8 @@ public class LoginUser implements UserDetails{
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private static final long serialVersionUID = 1L;
 | 
					    private static final long serialVersionUID = 1L;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static final String HTTP_HEADER_NAME = "loginUser";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private SysUserEntity sysUserEntity;
 | 
					    private SysUserEntity sysUserEntity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private List<String> permissions;
 | 
					    private List<String> permissions;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,7 @@
 | 
				
			|||||||
package com.cnbm.admin.service.impl;
 | 
					package com.cnbm.admin.service.impl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.alibaba.fastjson.JSON;
 | 
				
			||||||
 | 
					import com.cnbm.admin.dto.LoginUserDTO;
 | 
				
			||||||
import com.cnbm.admin.entity.LoginUser;
 | 
					import com.cnbm.admin.entity.LoginUser;
 | 
				
			||||||
import com.cnbm.admin.entity.SysLogLoginEntity;
 | 
					import com.cnbm.admin.entity.SysLogLoginEntity;
 | 
				
			||||||
import com.cnbm.admin.enums.LoginOperationEnum;
 | 
					import com.cnbm.admin.enums.LoginOperationEnum;
 | 
				
			||||||
@@ -22,8 +24,11 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
 | 
				
			|||||||
import org.springframework.security.core.Authentication;
 | 
					import org.springframework.security.core.Authentication;
 | 
				
			||||||
import org.springframework.security.core.context.SecurityContextHolder;
 | 
					import org.springframework.security.core.context.SecurityContextHolder;
 | 
				
			||||||
import org.springframework.stereotype.Service;
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					import org.springframework.web.context.request.RequestContextHolder;
 | 
				
			||||||
 | 
					import org.springframework.web.context.request.ServletRequestAttributes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.servlet.http.HttpServletRequest;
 | 
					import javax.servlet.http.HttpServletRequest;
 | 
				
			||||||
 | 
					import javax.servlet.http.HttpSession;
 | 
				
			||||||
import java.util.Date;
 | 
					import java.util.Date;
 | 
				
			||||||
import java.util.HashMap;
 | 
					import java.util.HashMap;
 | 
				
			||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
@@ -81,6 +86,11 @@ public class LoginServiceImpl implements LoginService {
 | 
				
			|||||||
        map.put("token",jwt);
 | 
					        map.put("token",jwt);
 | 
				
			||||||
        //把完整的用户信息存入redis  userid作为key
 | 
					        //把完整的用户信息存入redis  userid作为key
 | 
				
			||||||
        redisTemplate.opsForValue().set("login:"+userid,loginUser,1, TimeUnit.DAYS);
 | 
					        redisTemplate.opsForValue().set("login:"+userid,loginUser,1, TimeUnit.DAYS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        //当前登录用户信息存入session中
 | 
				
			||||||
 | 
					        HttpSession session = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getSession();
 | 
				
			||||||
 | 
					        session.setAttribute(loginUser.HTTP_HEADER_NAME, JSON.toJSONString(loginUser));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //登录成功
 | 
					        //登录成功
 | 
				
			||||||
        log.setStatus(LoginStatusEnum.SUCCESS.value());
 | 
					        log.setStatus(LoginStatusEnum.SUCCESS.value());
 | 
				
			||||||
        log.setCreator(loginUser.getSysUserEntity().getId());
 | 
					        log.setCreator(loginUser.getSysUserEntity().getId());
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,6 +7,10 @@ import com.cnbm.dispatch.enums.kuka.step2.Step2Mes2PlcVar;
 | 
				
			|||||||
import com.cnbm.dispatch.enums.kuka.step2.Step2Plc2MesVar;
 | 
					import com.cnbm.dispatch.enums.kuka.step2.Step2Plc2MesVar;
 | 
				
			||||||
import com.cnbm.dispatch.enums.kuka.step3.Step3Mes2PlcVar;
 | 
					import com.cnbm.dispatch.enums.kuka.step3.Step3Mes2PlcVar;
 | 
				
			||||||
import com.cnbm.dispatch.enums.kuka.step3.Step3Plc2MesVar;
 | 
					import com.cnbm.dispatch.enums.kuka.step3.Step3Plc2MesVar;
 | 
				
			||||||
 | 
					import com.cnbm.packing.dto.CamlineExtendArgDTO;
 | 
				
			||||||
 | 
					import com.cnbm.packing.entity.WoPackagingBox;
 | 
				
			||||||
 | 
					import com.cnbm.packing.entity.WoPackagingBoxSubstrate;
 | 
				
			||||||
 | 
					import com.cnbm.packing.entity.WoPowerLevel;
 | 
				
			||||||
import com.cnbm.packing.service.*;
 | 
					import com.cnbm.packing.service.*;
 | 
				
			||||||
import com.cnbm.s7.s7connector.enmuc.S7Client;
 | 
					import com.cnbm.s7.s7connector.enmuc.S7Client;
 | 
				
			||||||
import com.cnbm.s7.s7connector.type.PlcVar;
 | 
					import com.cnbm.s7.s7connector.type.PlcVar;
 | 
				
			||||||
@@ -18,6 +22,8 @@ import org.springframework.boot.ApplicationRunner;
 | 
				
			|||||||
import org.springframework.core.annotation.Order;
 | 
					import org.springframework.core.annotation.Order;
 | 
				
			||||||
import org.springframework.stereotype.Component;
 | 
					import org.springframework.stereotype.Component;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					import java.util.Arrays;
 | 
				
			||||||
import java.util.Date;
 | 
					import java.util.Date;
 | 
				
			||||||
import java.util.concurrent.Executors;
 | 
					import java.util.concurrent.Executors;
 | 
				
			||||||
import java.util.concurrent.ScheduledExecutorService;
 | 
					import java.util.concurrent.ScheduledExecutorService;
 | 
				
			||||||
@@ -150,199 +156,191 @@ public class KukaJoinThread implements ApplicationRunner {
 | 
				
			|||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void run(ApplicationArguments args) throws Exception {
 | 
					    public void run(ApplicationArguments args) throws Exception {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//        kukaStep1.scheduleAtFixedRate(new Runnable() {
 | 
					        kukaStep1.scheduleAtFixedRate(new Runnable() {
 | 
				
			||||||
//            @Override
 | 
					            @Override
 | 
				
			||||||
//            public void run() {
 | 
					            public void run() {
 | 
				
			||||||
 | 
					                //调度开始
 | 
				
			||||||
 | 
					//                logger.info("");
 | 
				
			||||||
//                logger.info("=================  现在开始执行 过程一 任务   ==================");
 | 
					//                logger.info("=================  现在开始执行 过程一 任务   ==================");
 | 
				
			||||||
//            }
 | 
					                Integer subArrived = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, true);
 | 
				
			||||||
//        },1,1, TimeUnit.SECONDS);
 | 
					                if(subArrived != 1){
 | 
				
			||||||
 | 
					                    logger.info("失败"+" --- "+" MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                //一. 从plc 中获取 subId 和 lineNum
 | 
				
			||||||
 | 
					                String subId = (String) read(S7Client.S7_KUKA,Step1Plc2MesVar.SubIdToMes);
 | 
				
			||||||
 | 
					                Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step1Plc2MesVar.LineNum);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                //二. MES 业务
 | 
				
			||||||
 | 
					                //===============           MES 业务 开始         =================
 | 
				
			||||||
 | 
					                //1. 从comline数据库中获取 实际pmpp
 | 
				
			||||||
 | 
					                float pmppBySubId = service.getPMPPBySubId(subId);
 | 
				
			||||||
 | 
					                //2. 匹配和计算补偿功率
 | 
				
			||||||
 | 
					                float actualPMPP = compensationPowerServiceBiz.calculCompensationPMPP(pmppBySubId,lineNum);
 | 
				
			||||||
 | 
					                //3. 依据补偿功率,获取工艺参数,并且把这些工艺参数传给kuka
 | 
				
			||||||
 | 
					                WoPowerLevel argByPMPP = levelServiceBiz.getArgByPMPP(actualPMPP, lineNum);
 | 
				
			||||||
 | 
					                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,Integer.valueOf(argByPMPP.getPowerClass()));
 | 
				
			||||||
 | 
					                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,argByPMPP.getLableVoc());
 | 
				
			||||||
 | 
					                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,argByPMPP.getLableIsc());
 | 
				
			||||||
 | 
					                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,argByPMPP.getLableVmpp());
 | 
				
			||||||
 | 
					                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,argByPMPP.getLableImpp());
 | 
				
			||||||
 | 
					                logger.info("采集到 基板ID: "+subId+", 线边号:"+lineNum+",dLable_Pnom: "+argByPMPP.getPowerClass() +",dLable_Voc: "+argByPMPP.getLableVoc()+",dLable_Isc: "+argByPMPP.getLableIsc()+",dLable_Vmpp: "+argByPMPP.getLableVmpp()+",dLable_Impp: "+argByPMPP.getLableImpp());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//        kukaStep1.scheduleAtFixedRate(new Runnable() {
 | 
					
 | 
				
			||||||
//            @Override
 | 
					                //4. 把基板录到数据库
 | 
				
			||||||
//            public void run() {
 | 
					                WoPackagingBoxSubstrate woPackagingBoxSubstrate = new WoPackagingBoxSubstrate();
 | 
				
			||||||
//                //调度开始
 | 
					                woPackagingBoxSubstrate.setLineBody(lineNum);
 | 
				
			||||||
////                logger.info("");
 | 
					                woPackagingBoxSubstrate.setPowerLevel(argByPMPP.getPowerClass());
 | 
				
			||||||
////                logger.info("=================  现在开始执行 过程一 任务   ==================");
 | 
					                woPackagingBoxSubstrate.setSapMaterial(argByPMPP.getSapMaterialNum());
 | 
				
			||||||
//                Integer subArrived = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, true);
 | 
					                woPackagingBoxSubstrate.setWoSubstrateId(subId);
 | 
				
			||||||
//                if(subArrived != 1){
 | 
					
 | 
				
			||||||
//                    logger.info("失败"+" --- "+" MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
 | 
					                //5. 从camline那里获取可变字段
 | 
				
			||||||
//                }
 | 
					                CamlineExtendArgDTO extendArgFromCamline = service.getExtendArgFromCamline(subId);
 | 
				
			||||||
//
 | 
					                woPackagingBoxSubstrate.setLastUpdateTime(extendArgFromCamline.getLastUpdateTime());
 | 
				
			||||||
//                //一. 从plc 中获取 subId 和 lineNum
 | 
					                woPackagingBoxSubstrate.setPmpp(actualPMPP);
 | 
				
			||||||
//                String subId = (String) read(S7Client.S7_KUKA,Step1Plc2MesVar.SubIdToMes);
 | 
					                woPackagingBoxSubstrate.setOrderName(extendArgFromCamline.getOrderName());
 | 
				
			||||||
//                Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step1Plc2MesVar.LineNum);
 | 
					                woPackagingBoxSubstrate.setBinclassFl1(extendArgFromCamline.getBinclassFl1());
 | 
				
			||||||
//                logger.info("采集到 基板ID: "+subId+", 线边号:"+lineNum);
 | 
					                woPackagingBoxSubstrate.setBinclassFl2(extendArgFromCamline.getBinclassFl2());
 | 
				
			||||||
//
 | 
					                woPackagingBoxSubstrate.setEtaFl1(extendArgFromCamline.getEtaFl1());
 | 
				
			||||||
//                //二. MES 业务
 | 
					                woPackagingBoxSubstrate.setEtaFl2(extendArgFromCamline.getEtaFl2());
 | 
				
			||||||
//                //===============           MES 业务 开始         =================
 | 
					                woPackagingBoxSubstrate.setFfFl1(extendArgFromCamline.getFfFl1());
 | 
				
			||||||
//                //1. 从comline数据库中获取 实际pmpp
 | 
					                woPackagingBoxSubstrate.setFfFl2(extendArgFromCamline.getFfFl2());
 | 
				
			||||||
//                float pmppBySubId = service.getPMPPBySubId(subId);
 | 
					                woPackagingBoxSubstrate.setImppFl1(extendArgFromCamline.getImppFl1());
 | 
				
			||||||
//                //2. 匹配和计算补偿功率
 | 
					                woPackagingBoxSubstrate.setImppFl2(extendArgFromCamline.getImppFl2());
 | 
				
			||||||
//                float actualPMPP = compensationPowerServiceBiz.calculCompensationPMPP(pmppBySubId,lineNum);
 | 
					                woPackagingBoxSubstrate.setInsolflashcontrolFl1(extendArgFromCamline.getInsolflashcontrolFl1());
 | 
				
			||||||
//                //3. 依据补偿功率,获取工艺参数,并且把这些工艺参数传给kuka
 | 
					                woPackagingBoxSubstrate.setInsolflashcontrolFl2(extendArgFromCamline.getInsolflashcontrolFl2());
 | 
				
			||||||
//                WoPowerLevel argByPMPP = levelServiceBiz.getArgByPMPP(actualPMPP, lineNum);
 | 
					                woPackagingBoxSubstrate.setInsolmppFl1(extendArgFromCamline.getInsolmppFl1());
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,Integer.valueOf(argByPMPP.getPowerClass()));
 | 
					                woPackagingBoxSubstrate.setInsolmppFl2(extendArgFromCamline.getInsolmppFl2());
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,argByPMPP.getLableVoc());
 | 
					                woPackagingBoxSubstrate.setInsolvocFl1(extendArgFromCamline.getInsolvocFl1());
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,argByPMPP.getLableIsc());
 | 
					                woPackagingBoxSubstrate.setInsolvocFl2(extendArgFromCamline.getInsolvocFl2());
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,argByPMPP.getLableVmpp());
 | 
					                woPackagingBoxSubstrate.setInsolFl1(extendArgFromCamline.getInsolFl1());
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,argByPMPP.getLableImpp());
 | 
					                woPackagingBoxSubstrate.setInsolFl2(extendArgFromCamline.getInsolFl2());
 | 
				
			||||||
//
 | 
					                woPackagingBoxSubstrate.setIscFl1(extendArgFromCamline.getIscFl1());
 | 
				
			||||||
//
 | 
					                woPackagingBoxSubstrate.setIscFl2(extendArgFromCamline.getIscFl2());
 | 
				
			||||||
//
 | 
					                woPackagingBoxSubstrate.setMeasTimeFl1(extendArgFromCamline.getMeasTimeFl1());
 | 
				
			||||||
//                //4. 把基板录到数据库
 | 
					                woPackagingBoxSubstrate.setMeasTimeFl2(extendArgFromCamline.getMeasTimeFl2());
 | 
				
			||||||
//                WoPackagingBoxSubstrate woPackagingBoxSubstrate = new WoPackagingBoxSubstrate();
 | 
					                woPackagingBoxSubstrate.setPmppFl1(extendArgFromCamline.getPmppFl1());
 | 
				
			||||||
//                woPackagingBoxSubstrate.setLineBody(lineNum);
 | 
					                woPackagingBoxSubstrate.setPmppFl2(extendArgFromCamline.getPmppFl2());
 | 
				
			||||||
//                woPackagingBoxSubstrate.setPowerLevel(argByPMPP.getPowerClass());
 | 
					                woPackagingBoxSubstrate.setTcellFl1(extendArgFromCamline.getTcellFl1());
 | 
				
			||||||
//                woPackagingBoxSubstrate.setSapMaterial(argByPMPP.getSapMaterialNum());
 | 
					                woPackagingBoxSubstrate.setTcellFl2(extendArgFromCamline.getTcellFl2());
 | 
				
			||||||
//                woPackagingBoxSubstrate.setWoSubstrateId(subId);
 | 
					                woPackagingBoxSubstrate.setTmonicellFl1(extendArgFromCamline.getTmonicellFl1());
 | 
				
			||||||
//
 | 
					                woPackagingBoxSubstrate.setTmonicellFl2(extendArgFromCamline.getTmonicellFl2());
 | 
				
			||||||
//                //5. 从camline那里获取可变字段
 | 
					                woPackagingBoxSubstrate.setUmppFl1(extendArgFromCamline.getUmppFl1());
 | 
				
			||||||
//                CamlineExtendArgDTO extendArgFromCamline = service.getExtendArgFromCamline(subId);
 | 
					                woPackagingBoxSubstrate.setUmppFl2(extendArgFromCamline.getUmppFl2());
 | 
				
			||||||
//                woPackagingBoxSubstrate.setLastUpdateTime(extendArgFromCamline.getLastUpdateTime());
 | 
					                woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl1());
 | 
				
			||||||
//                woPackagingBoxSubstrate.setPmpp(actualPMPP);
 | 
					                woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl2());
 | 
				
			||||||
//                woPackagingBoxSubstrate.setOrderName(extendArgFromCamline.getOrderName());
 | 
					
 | 
				
			||||||
//                woPackagingBoxSubstrate.setBinclassFl1(extendArgFromCamline.getBinclassFl1());
 | 
					                substrateServiceBiz.insert(woPackagingBoxSubstrate);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setBinclassFl2(extendArgFromCamline.getBinclassFl2());
 | 
					                //===============           MES 业务 结束         =================
 | 
				
			||||||
//                woPackagingBoxSubstrate.setEtaFl1(extendArgFromCamline.getEtaFl1());
 | 
					
 | 
				
			||||||
//                woPackagingBoxSubstrate.setEtaFl2(extendArgFromCamline.getEtaFl2());
 | 
					                //三. 当MES完成任务后,把MesToPlc.SubArrivedFinish变量置为true,告诉plc,我操作完成了
 | 
				
			||||||
//                woPackagingBoxSubstrate.setFfFl1(extendArgFromCamline.getFfFl1());
 | 
					                write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setFfFl2(extendArgFromCamline.getFfFl2());
 | 
					
 | 
				
			||||||
//                woPackagingBoxSubstrate.setImppFl1(extendArgFromCamline.getImppFl1());
 | 
					                //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
 | 
				
			||||||
//                woPackagingBoxSubstrate.setImppFl2(extendArgFromCamline.getImppFl2());
 | 
					                Integer subArrived2 = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, false);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolflashcontrolFl1(extendArgFromCamline.getInsolflashcontrolFl1());
 | 
					                if(subArrived2 != 1){
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolflashcontrolFl2(extendArgFromCamline.getInsolflashcontrolFl2());
 | 
					                    logger.info("失败"+" --- "+"MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolmppFl1(extendArgFromCamline.getInsolmppFl1());
 | 
					                }
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolmppFl2(extendArgFromCamline.getInsolmppFl2());
 | 
					                write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,false);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolvocFl1(extendArgFromCamline.getInsolvocFl1());
 | 
					            }
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolvocFl2(extendArgFromCamline.getInsolvocFl2());
 | 
					        },1,1, TimeUnit.SECONDS);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolFl1(extendArgFromCamline.getInsolFl1());
 | 
					
 | 
				
			||||||
//                woPackagingBoxSubstrate.setInsolFl2(extendArgFromCamline.getInsolFl2());
 | 
					
 | 
				
			||||||
//                woPackagingBoxSubstrate.setIscFl1(extendArgFromCamline.getIscFl1());
 | 
					        kukaStep2.scheduleAtFixedRate(new Runnable() {
 | 
				
			||||||
//                woPackagingBoxSubstrate.setIscFl2(extendArgFromCamline.getIscFl2());
 | 
					            @Override
 | 
				
			||||||
//                woPackagingBoxSubstrate.setMeasTimeFl1(extendArgFromCamline.getMeasTimeFl1());
 | 
					            public void run() {
 | 
				
			||||||
//                woPackagingBoxSubstrate.setMeasTimeFl2(extendArgFromCamline.getMeasTimeFl2());
 | 
					                //调度开始
 | 
				
			||||||
//                woPackagingBoxSubstrate.setPmppFl1(extendArgFromCamline.getPmppFl1());
 | 
					
 | 
				
			||||||
//                woPackagingBoxSubstrate.setPmppFl2(extendArgFromCamline.getPmppFl2());
 | 
					                Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setTcellFl1(extendArgFromCamline.getTcellFl1());
 | 
					                if(shelfIsFull != 1){
 | 
				
			||||||
//                woPackagingBoxSubstrate.setTcellFl2(extendArgFromCamline.getTcellFl2());
 | 
					                    logger.info("失败"+" --- "+"MES监听 Step2Plc2MesVar.ShelfIsFull 是否 等于 1 失败");
 | 
				
			||||||
//                woPackagingBoxSubstrate.setTmonicellFl1(extendArgFromCamline.getTmonicellFl1());
 | 
					                }
 | 
				
			||||||
//                woPackagingBoxSubstrate.setTmonicellFl2(extendArgFromCamline.getTmonicellFl2());
 | 
					
 | 
				
			||||||
//                woPackagingBoxSubstrate.setUmppFl1(extendArgFromCamline.getUmppFl1());
 | 
					                //一. 从plc 中获取 subIdList 和 lineNum
 | 
				
			||||||
//                woPackagingBoxSubstrate.setUmppFl2(extendArgFromCamline.getUmppFl2());
 | 
					                String[] subIdList = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl1());
 | 
					//                Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step2Plc2MesVar.LineNum);
 | 
				
			||||||
//                woPackagingBoxSubstrate.setUocFl1(extendArgFromCamline.getUocFl2());
 | 
					                logger.info("获取到基板列表:"+ Arrays.toString(subIdList));
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//                substrateServiceBiz.insert(woPackagingBoxSubstrate);
 | 
					                //二. MES 业务
 | 
				
			||||||
//                //===============           MES 业务 结束         =================
 | 
					                //===============           MES 业务 开始         =================
 | 
				
			||||||
//
 | 
					                //1.MES 生成BoxId
 | 
				
			||||||
//                //三. 当MES完成任务后,把MesToPlc.SubArrivedFinish变量置为true,告诉plc,我操作完成了
 | 
					                if(subIdList.length<=0){
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true);
 | 
					                    logger.info("失败"+" --- "+"从plc里面获取到的基板列表 为空");
 | 
				
			||||||
//
 | 
					                }
 | 
				
			||||||
//                //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
 | 
					                WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(subIdList[0]);
 | 
				
			||||||
//                Integer subArrived2 = waitingForTarget(Step1Plc2MesVar.SubArrivedToMes, false);
 | 
					                String boxId = getBoxId(bySubId.getSapMaterial());
 | 
				
			||||||
//                if(subArrived2 != 1){
 | 
					                logger.info("mes 生成的boxId :"+ boxId);
 | 
				
			||||||
//                    logger.info("失败"+" --- "+"MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
 | 
					                //2. 依次update 基板表,把boxId 赋予这些基板
 | 
				
			||||||
//                }
 | 
					                for(int i=0;i<subIdList.length;i++){
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,false);
 | 
					                    substrateServiceBiz.updatePackagingBoxIdByWoSubstrateId(boxId,subIdList[i]);
 | 
				
			||||||
//            }
 | 
					                }
 | 
				
			||||||
//        },1,1, TimeUnit.SECONDS);
 | 
					                //3.去camline数据库 查询此基板ID 对应的订单
 | 
				
			||||||
//
 | 
					                String orderNameBySubId = service.getOrderNameBySubId(subIdList[0]);
 | 
				
			||||||
//
 | 
					                //4. box信息录入到box表
 | 
				
			||||||
//        kukaStep2.scheduleAtFixedRate(new Runnable() {
 | 
					                WoPackagingBox woPackagingBox = new WoPackagingBox();
 | 
				
			||||||
//            @Override
 | 
					                woPackagingBox.setBoxNo(boxId);
 | 
				
			||||||
//            public void run() {
 | 
					                woPackagingBox.setPackagingTime(LocalDateTime.now());
 | 
				
			||||||
//                //调度开始
 | 
					                woPackagingBox.setPowerLevel(bySubId.getPowerLevel());
 | 
				
			||||||
//
 | 
					                woPackagingBox.setLineBody(bySubId.getLineBody());
 | 
				
			||||||
//                Integer shelfIsFull = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, true);
 | 
					                woPackagingBox.setSapMaterial(bySubId.getSapMaterial());
 | 
				
			||||||
//                if(shelfIsFull != 1){
 | 
					                woPackagingBox.setOrderNum(orderNameBySubId);
 | 
				
			||||||
//                    logger.info("失败"+" --- "+"MES监听 Step2Plc2MesVar.ShelfIsFull 是否 等于 1 失败");
 | 
					                //1-手动模式,2-自动模式
 | 
				
			||||||
//                }
 | 
					                woPackagingBox.setModel(2);
 | 
				
			||||||
//
 | 
					                woPackagingBox.setCreateTime(LocalDateTime.now());
 | 
				
			||||||
//                //一. 从plc 中获取 subIdList 和 lineNum
 | 
					                boxServiceBiz.insert(woPackagingBox);
 | 
				
			||||||
//                String[] subIdList = (String[])read(S7Client.S7_KUKA,Step2Plc2MesVar.SubIdList);
 | 
					                //===============           MES 业务 结束         =================
 | 
				
			||||||
////                Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step2Plc2MesVar.LineNum);
 | 
					
 | 
				
			||||||
//                logger.info("获取到基板列表:"+ Arrays.toString(subIdList));
 | 
					                //三. 把生成的BoxId 告诉kuka
 | 
				
			||||||
//
 | 
					                write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,boxId);
 | 
				
			||||||
//                //二. MES 业务
 | 
					
 | 
				
			||||||
//                //===============           MES 业务 开始         =================
 | 
					                //四. 当MES完成任务后,把MesToPlc.ShelfIsFullFinish变量置为true,告诉plc,我操作完成了
 | 
				
			||||||
//                //1.MES 生成BoxId
 | 
					                write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,true);
 | 
				
			||||||
//                if(subIdList.length<=0){
 | 
					
 | 
				
			||||||
//                    logger.info("失败"+" --- "+"从plc里面获取到的基板列表 为空");
 | 
					                //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
 | 
				
			||||||
//                }
 | 
					                Integer subArrived2 = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, false);
 | 
				
			||||||
//                WoPackagingBoxSubstrate bySubId = substrateServiceBiz.getBySubId(subIdList[0]);
 | 
					                if(subArrived2 != 1){
 | 
				
			||||||
//                String boxId = getBoxId(bySubId.getSapMaterial());
 | 
					                    logger.info("失败"+" --- "+"步骤1.  MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
 | 
				
			||||||
//                logger.info("mes 生成的boxId :"+ boxId);
 | 
					                }
 | 
				
			||||||
//                //2. 依次update 基板表,把boxId 赋予这些基板
 | 
					                write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false);
 | 
				
			||||||
//                for(int i=0;i<subIdList.length;i++){
 | 
					            }
 | 
				
			||||||
//                    substrateServiceBiz.updatePackagingBoxIdByWoSubstrateId(boxId,subIdList[i]);
 | 
					        },1,1, TimeUnit.SECONDS);
 | 
				
			||||||
//                }
 | 
					
 | 
				
			||||||
//                //3.去camline数据库 查询此基板ID 对应的订单
 | 
					
 | 
				
			||||||
//                String orderNameBySubId = service.getOrderNameBySubId(subIdList[0]);
 | 
					        kukaStep3.scheduleAtFixedRate(new Runnable() {
 | 
				
			||||||
//                //4. box信息录入到box表
 | 
					            @Override
 | 
				
			||||||
//                WoPackagingBox woPackagingBox = new WoPackagingBox();
 | 
					            public void run() {
 | 
				
			||||||
//                woPackagingBox.setBoxNo(boxId);
 | 
					                //调度开始
 | 
				
			||||||
//                woPackagingBox.setPackagingTime(LocalDateTime.now());
 | 
					                Integer shelfIsFull = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, true);
 | 
				
			||||||
//                woPackagingBox.setPowerLevel(bySubId.getPowerLevel());
 | 
					                if(shelfIsFull != 1){
 | 
				
			||||||
//                woPackagingBox.setLineBody(bySubId.getLineBody());
 | 
					                    logger.info("失败"+" --- "+"MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
 | 
				
			||||||
//                woPackagingBox.setSapMaterial(bySubId.getSapMaterial());
 | 
					                }
 | 
				
			||||||
//                woPackagingBox.setOrderNum(orderNameBySubId);
 | 
					
 | 
				
			||||||
//                //1-手动模式,2-自动模式
 | 
					                //一. 从plc 中获取 subIdList 和 lineNum
 | 
				
			||||||
//                woPackagingBox.setModel(2);
 | 
					                String boxId = (String)read(S7Client.S7_KUKA,Step3Plc2MesVar.BoxId);
 | 
				
			||||||
//                boxServiceBiz.insert(woPackagingBox);
 | 
					                Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step3Plc2MesVar.LineNum);
 | 
				
			||||||
//                //===============           MES 业务 结束         =================
 | 
					                logger.info("到达站台的boxId :"+boxId);
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//                //三. 把生成的BoxId 告诉kuka
 | 
					                //二. MES 业务
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,boxId);
 | 
					                //===============           MES 业务 开始         =================
 | 
				
			||||||
//
 | 
					                //1. box信息录入到box表
 | 
				
			||||||
//                //四. 当MES完成任务后,把MesToPlc.ShelfIsFullFinish变量置为true,告诉plc,我操作完成了
 | 
					                boxServiceBiz.updateIsArrivedByBoxNo(1,boxId);
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,true);
 | 
					                //===============           MES 业务 结束         =================
 | 
				
			||||||
//
 | 
					
 | 
				
			||||||
//                //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
 | 
					
 | 
				
			||||||
//                Integer subArrived2 = waitingForTarget(Step2Plc2MesVar.ShelfIsFull, false);
 | 
					                //四. 当MES完成任务后,把MesToPlc.ShelfIsFullArrivedFinish变量置为true,告诉plc,我操作完成了
 | 
				
			||||||
//                if(subArrived2 != 1){
 | 
					                write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true);
 | 
				
			||||||
//                    logger.info("失败"+" --- "+"步骤1.  MES监听 Step1Plc2MesVar.SubArrivedToMes 是否 等于 1 失败");
 | 
					
 | 
				
			||||||
//                }
 | 
					                //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false);
 | 
					                Integer subArrived2 = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, false);
 | 
				
			||||||
//            }
 | 
					                if(subArrived2 != 1){
 | 
				
			||||||
//        },1,1, TimeUnit.SECONDS);
 | 
					                    logger.info("失败"+" --- "+"步骤1.  MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
 | 
				
			||||||
//
 | 
					                }
 | 
				
			||||||
//
 | 
					                write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,false);
 | 
				
			||||||
//        kukaStep3.scheduleAtFixedRate(new Runnable() {
 | 
					
 | 
				
			||||||
//            @Override
 | 
					
 | 
				
			||||||
//            public void run() {
 | 
					            }
 | 
				
			||||||
//                //调度开始
 | 
					        },1,1, TimeUnit.SECONDS);
 | 
				
			||||||
//                Integer shelfIsFull = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, true);
 | 
					 | 
				
			||||||
//                if(shelfIsFull != 1){
 | 
					 | 
				
			||||||
//                    logger.info("失败"+" --- "+"MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
 | 
					 | 
				
			||||||
//                }
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//                //一. 从plc 中获取 subIdList 和 lineNum
 | 
					 | 
				
			||||||
//                String boxId = (String)read(S7Client.S7_KUKA,Step3Plc2MesVar.BoxId);
 | 
					 | 
				
			||||||
//                Integer lineNum = (Integer) read(S7Client.S7_KUKA,Step3Plc2MesVar.LineNum);
 | 
					 | 
				
			||||||
//                logger.info("到达站台的boxId :"+boxId);
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//                //二. MES 业务
 | 
					 | 
				
			||||||
//                //===============           MES 业务 开始         =================
 | 
					 | 
				
			||||||
//                //1. box信息录入到box表
 | 
					 | 
				
			||||||
//                boxServiceBiz.updateIsArrivedByBoxNo(1,boxId);
 | 
					 | 
				
			||||||
//                //===============           MES 业务 结束         =================
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//                //四. 当MES完成任务后,把MesToPlc.ShelfIsFullArrivedFinish变量置为true,告诉plc,我操作完成了
 | 
					 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true);
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//                //四. mes 监控 到PlcToMes.SubArrived==false,就把MesToPlc.SubArrivedFinish置为false
 | 
					 | 
				
			||||||
//                Integer subArrived2 = waitingForTarget(Step3Plc2MesVar.ShelfIsFullArrived, false);
 | 
					 | 
				
			||||||
//                if(subArrived2 != 1){
 | 
					 | 
				
			||||||
//                    logger.info("失败"+" --- "+"步骤1.  MES监听 Step3Plc2MesVar.ShelfIsFullArrived 是否 等于 1 失败");
 | 
					 | 
				
			||||||
//                }
 | 
					 | 
				
			||||||
//                write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,false);
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//
 | 
					 | 
				
			||||||
//            }
 | 
					 | 
				
			||||||
//        },1,1, TimeUnit.SECONDS);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@ import com.cnbm.dispatch.enums.kuka.step3.Step3Plc2MesVar;
 | 
				
			|||||||
import com.cnbm.packing.service.DynamicDataSourceService;
 | 
					import com.cnbm.packing.service.DynamicDataSourceService;
 | 
				
			||||||
import com.cnbm.s7.entity.R;
 | 
					import com.cnbm.s7.entity.R;
 | 
				
			||||||
import com.cnbm.s7.s7connector.enmuc.S7Client;
 | 
					import com.cnbm.s7.s7connector.enmuc.S7Client;
 | 
				
			||||||
 | 
					import com.cnbm.s7.s7connector.type.PlcVar;
 | 
				
			||||||
import io.swagger.annotations.Api;
 | 
					import io.swagger.annotations.Api;
 | 
				
			||||||
import io.swagger.annotations.ApiImplicitParam;
 | 
					import io.swagger.annotations.ApiImplicitParam;
 | 
				
			||||||
import io.swagger.annotations.ApiImplicitParams;
 | 
					import io.swagger.annotations.ApiImplicitParams;
 | 
				
			||||||
@@ -20,6 +21,7 @@ import com.cnbm.common.utils.Result;
 | 
				
			|||||||
import springfox.documentation.annotations.ApiIgnore;
 | 
					import springfox.documentation.annotations.ApiIgnore;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.io.UnsupportedEncodingException;
 | 
					import java.io.UnsupportedEncodingException;
 | 
				
			||||||
 | 
					import java.math.BigDecimal;
 | 
				
			||||||
import java.text.ParseException;
 | 
					import java.text.ParseException;
 | 
				
			||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -124,6 +126,34 @@ public class TestController {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return R.ok();
 | 
					        return R.ok();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static void main(String[] args) {
 | 
				
			||||||
 | 
					        BigDecimal voc = new BigDecimal(59.799);
 | 
				
			||||||
 | 
					        System.out.println(Float.valueOf(voc.toString()));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @PostMapping("/testWrite")
 | 
				
			||||||
 | 
					    public R testWrite() {
 | 
				
			||||||
 | 
					        BigDecimal voc = new BigDecimal(59.799);
 | 
				
			||||||
 | 
					        BigDecimal isc = new BigDecimal(3.799);
 | 
				
			||||||
 | 
					        BigDecimal vmpp = new BigDecimal(46.799);
 | 
				
			||||||
 | 
					        BigDecimal impp = new BigDecimal(3.0799);
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Pnom,new Integer(1));
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Voc,voc);
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Isc,isc);
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Vmpp,vmpp);
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step1Mes2PlcVar.dLable_Impp,impp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step2Mes2PlcVar.BoxId,"12345678901111111111");
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step1Mes2PlcVar.SubArrivedFinish,true);
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step2Mes2PlcVar.ShelfIsFullFinish,false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        write(S7Client.S7_KUKA,Step3Mes2PlcVar.ShelfIsFullArrivedFinish,true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return R.ok();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    @PostMapping("/testlogger")
 | 
					    @PostMapping("/testlogger")
 | 
				
			||||||
    public R testlogger() {
 | 
					    public R testlogger() {
 | 
				
			||||||
        logger.info("test logger");
 | 
					        logger.info("test logger");
 | 
				
			||||||
@@ -159,4 +189,51 @@ public class TestController {
 | 
				
			|||||||
        return new Result<String>().ok(service.getExtendArgFromCamline(subId.toString()).toString());
 | 
					        return new Result<String>().ok(service.getExtendArgFromCamline(subId.toString()).toString());
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private void write(S7Client s7Client, Step1Mes2PlcVar var, Object newValue) {
 | 
				
			||||||
 | 
					        if(var.getType().equals(PlcVar.STRING_Array)){
 | 
				
			||||||
 | 
					            String[] s = (String[])newValue;
 | 
				
			||||||
 | 
					            String[] ss = (String[])newValue;
 | 
				
			||||||
 | 
					            if(s.length > var.getLength() ){
 | 
				
			||||||
 | 
					                ss = new String[var.getLength()];
 | 
				
			||||||
 | 
					                for(int i=0;i< var.getLength();i++){
 | 
				
			||||||
 | 
					                    ss[i] = s[i];
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            s7Client.write(var.getArea(), var.getAreaNumber(), var.getByteOffset(), var.getBitOffset(), var.getStrSize(), var.getType(),ss);
 | 
				
			||||||
 | 
					        }else {
 | 
				
			||||||
 | 
					            s7Client.write(var.getArea(), var.getAreaNumber(), var.getByteOffset(), var.getBitOffset(), var.getStrSize(), var.getType(),newValue);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    private void write(S7Client s7Client, Step2Mes2PlcVar var, Object newValue) {
 | 
				
			||||||
 | 
					        if(var.getType().equals(PlcVar.STRING_Array)){
 | 
				
			||||||
 | 
					            String[] s = (String[])newValue;
 | 
				
			||||||
 | 
					            String[] ss = (String[])newValue;
 | 
				
			||||||
 | 
					            if(s.length > var.getLength() ){
 | 
				
			||||||
 | 
					                ss = new String[var.getLength()];
 | 
				
			||||||
 | 
					                for(int i=0;i< var.getLength();i++){
 | 
				
			||||||
 | 
					                    ss[i] = s[i];
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            s7Client.write(var.getArea(), var.getAreaNumber(), var.getByteOffset(), var.getBitOffset(), var.getStrSize(), var.getType(),ss);
 | 
				
			||||||
 | 
					        }else {
 | 
				
			||||||
 | 
					            s7Client.write(var.getArea(), var.getAreaNumber(), var.getByteOffset(), var.getBitOffset(), var.getStrSize(), var.getType(),newValue);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private void write(S7Client s7Client, Step3Mes2PlcVar var, Object newValue) {
 | 
				
			||||||
 | 
					        if(var.getType().equals(PlcVar.STRING_Array)){
 | 
				
			||||||
 | 
					            String[] s = (String[])newValue;
 | 
				
			||||||
 | 
					            String[] ss = (String[])newValue;
 | 
				
			||||||
 | 
					            if(s.length > var.getLength() ){
 | 
				
			||||||
 | 
					                ss = new String[var.getLength()];
 | 
				
			||||||
 | 
					                for(int i=0;i< var.getLength();i++){
 | 
				
			||||||
 | 
					                    ss[i] = s[i];
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            s7Client.write(var.getArea(), var.getAreaNumber(), var.getByteOffset(), var.getBitOffset(), var.getStrSize(), var.getType(),ss);
 | 
				
			||||||
 | 
					        }else {
 | 
				
			||||||
 | 
					            s7Client.write(var.getArea(), var.getAreaNumber(), var.getByteOffset(), var.getBitOffset(), var.getStrSize(), var.getType(),newValue);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -210,9 +210,9 @@ public class WoPackagingBoxSubstrateController {
 | 
				
			|||||||
    @PostMapping("insertSubstrateManual")
 | 
					    @PostMapping("insertSubstrateManual")
 | 
				
			||||||
    @ApiOperation("手动装箱")
 | 
					    @ApiOperation("手动装箱")
 | 
				
			||||||
    @LogOperation("手动装箱")
 | 
					    @LogOperation("手动装箱")
 | 
				
			||||||
    public Result insertSubstrateManual(@RequestBody ChangePackingBoxDTO dto){
 | 
					    public Result insertSubstrateManual(@RequestBody ChangePackingBoxDTO[] dtos){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        woPackagingBoxSubstrateService.insertSubstrateManual(dto);
 | 
					        woPackagingBoxSubstrateService.insertSubstrateManual(dtos);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return new Result();
 | 
					        return new Result();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,7 +32,7 @@ public interface WoPackagingBoxSubstrateServiceBiz extends CrudService<WoPackagi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    void replaceSubstrate(ChangePackingBoxDTO[] dtos);
 | 
					    void replaceSubstrate(ChangePackingBoxDTO[] dtos);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void insertSubstrateManual(ChangePackingBoxDTO dto);
 | 
					    void insertSubstrateManual(ChangePackingBoxDTO[] dtos);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    WoPackagingBoxSubstrate getBySubId(String subId);
 | 
					    WoPackagingBoxSubstrate getBySubId(String subId);
 | 
				
			||||||
    int updatePackagingBoxIdByWoSubstrateId(String packagingBoxId,String woSubstrateId);
 | 
					    int updatePackagingBoxIdByWoSubstrateId(String packagingBoxId,String woSubstrateId);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,8 @@ package com.cnbm.packing.service.impl;
 | 
				
			|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
					import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
					import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
import com.cnbm.common.page.PageData;
 | 
					import com.cnbm.common.page.PageData;
 | 
				
			||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
					import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
				
			||||||
import com.cnbm.common.utils.ConvertUtils;
 | 
					import com.cnbm.common.utils.ConvertUtils;
 | 
				
			||||||
@@ -14,6 +16,7 @@ import com.cnbm.packing.entity.WoPowerLevel;
 | 
				
			|||||||
import com.cnbm.packing.mapper.ChangePackagingBoxHistoryMapper;
 | 
					import com.cnbm.packing.mapper.ChangePackagingBoxHistoryMapper;
 | 
				
			||||||
import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz;
 | 
					import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz;
 | 
				
			||||||
import org.apache.commons.lang3.StringUtils;
 | 
					import org.apache.commons.lang3.StringUtils;
 | 
				
			||||||
 | 
					import org.springframework.beans.factory.annotation.Autowired;
 | 
				
			||||||
import org.springframework.stereotype.Service;
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
import org.springframework.transaction.annotation.Transactional;
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -30,6 +33,9 @@ import java.util.Map;
 | 
				
			|||||||
@Service
 | 
					@Service
 | 
				
			||||||
public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<ChangePackagingBoxHistoryMapper, ChangePackagingBoxHistory, ChangePackagingBoxHistoryDTO> implements ChangePackagingBoxHistoryServiceBiz {
 | 
					public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<ChangePackagingBoxHistoryMapper, ChangePackagingBoxHistory, ChangePackagingBoxHistoryDTO> implements ChangePackagingBoxHistoryServiceBiz {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private BaseSupport baseSupport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){
 | 
					    public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){
 | 
				
			||||||
        LocalDateTime startTime = (LocalDateTime) params.get("startTime");
 | 
					        LocalDateTime startTime = (LocalDateTime) params.get("startTime");
 | 
				
			||||||
@@ -65,6 +71,7 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void save(ChangePackagingBoxHistoryDTO dto) {
 | 
					    public void save(ChangePackagingBoxHistoryDTO dto) {
 | 
				
			||||||
        ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
 | 
					        ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(entity);
 | 
				
			||||||
        insert(entity);
 | 
					        insert(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -72,6 +79,7 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl<Cha
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void update(ChangePackagingBoxHistoryDTO dto) {
 | 
					    public void update(ChangePackagingBoxHistoryDTO dto) {
 | 
				
			||||||
        ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
 | 
					        ChangePackagingBoxHistory entity = ConvertUtils.sourceToTarget(dto, ChangePackagingBoxHistory.class);
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl;
 | 
				
			|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
					import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
					import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
import com.cnbm.admin.utils.CodeGeneratorHelper;
 | 
					import com.cnbm.admin.utils.CodeGeneratorHelper;
 | 
				
			||||||
import com.cnbm.common.page.PageData;
 | 
					import com.cnbm.common.page.PageData;
 | 
				
			||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
					import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
				
			||||||
@@ -31,6 +32,8 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private PrintModelMapper mapper;
 | 
					    private PrintModelMapper mapper;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private BaseSupport baseSupport;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public QueryWrapper<PrintModel> getWrapper(Map<String, Object> params){
 | 
					    public QueryWrapper<PrintModel> getWrapper(Map<String, Object> params){
 | 
				
			||||||
@@ -69,6 +72,7 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void save(PrintModelDTO dto) {
 | 
					    public void save(PrintModelDTO dto) {
 | 
				
			||||||
        PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
 | 
					        PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(entity);
 | 
				
			||||||
        insert(entity);
 | 
					        insert(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -76,6 +80,7 @@ public class PrintModelServiceBizImpl extends CrudServiceImpl<PrintModelMapper,
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void update(PrintModelDTO dto) {
 | 
					    public void update(PrintModelDTO dto) {
 | 
				
			||||||
        PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
 | 
					        PrintModel entity = ConvertUtils.sourceToTarget(dto, PrintModel.class);
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl;
 | 
				
			|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
					import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
					import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
import com.cnbm.common.page.PageData;
 | 
					import com.cnbm.common.page.PageData;
 | 
				
			||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
					import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
				
			||||||
import com.cnbm.common.utils.ConvertUtils;
 | 
					import com.cnbm.common.utils.ConvertUtils;
 | 
				
			||||||
@@ -34,6 +35,8 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private WoCompensationPowerMapper mapper;
 | 
					    private WoCompensationPowerMapper mapper;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private BaseSupport baseSupport;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public QueryWrapper<WoCompensationPower> getWrapper(Map<String, Object> params){
 | 
					    public QueryWrapper<WoCompensationPower> getWrapper(Map<String, Object> params){
 | 
				
			||||||
@@ -66,6 +69,7 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void save(WoCompensationPowerDTO dto) {
 | 
					    public void save(WoCompensationPowerDTO dto) {
 | 
				
			||||||
        WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
 | 
					        WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(entity);
 | 
				
			||||||
        insert(entity);
 | 
					        insert(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -73,6 +77,7 @@ public class WoCompensationPowerServiceBizImpl extends CrudServiceImpl<WoCompens
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void update(WoCompensationPowerDTO dto) {
 | 
					    public void update(WoCompensationPowerDTO dto) {
 | 
				
			||||||
        WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
 | 
					        WoCompensationPower entity = ConvertUtils.sourceToTarget(dto, WoCompensationPower.class);
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl;
 | 
				
			|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
					import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
					import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
import com.cnbm.common.page.PageData;
 | 
					import com.cnbm.common.page.PageData;
 | 
				
			||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
					import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
				
			||||||
import com.cnbm.common.utils.ConvertUtils;
 | 
					import com.cnbm.common.utils.ConvertUtils;
 | 
				
			||||||
@@ -36,6 +37,9 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
 | 
				
			|||||||
    private WoPackagingBoxMapper mapper;
 | 
					    private WoPackagingBoxMapper mapper;
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private WoPackagingBoxSubstrateMapper substrateMapper;
 | 
					    private WoPackagingBoxSubstrateMapper substrateMapper;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private BaseSupport baseSupport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
 | 
					    public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -83,6 +87,7 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
 | 
				
			|||||||
    public IdVo add(WoPackagingBoxDTO dto) {
 | 
					    public IdVo add(WoPackagingBoxDTO dto) {
 | 
				
			||||||
        WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
 | 
					        WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
 | 
				
			||||||
        insert(entity);
 | 
					        insert(entity);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(entity);
 | 
				
			||||||
        return IdVo.builder().id(entity.getId()).build();
 | 
					        return IdVo.builder().id(entity.getId()).build();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -90,6 +95,7 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl<WoPackagingBox
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void update(WoPackagingBoxDTO dto) {
 | 
					    public void update(WoPackagingBoxDTO dto) {
 | 
				
			||||||
        WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
 | 
					        WoPackagingBox entity = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class);
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl;
 | 
				
			|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
					import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
import com.cnbm.common.page.PageData;
 | 
					import com.cnbm.common.page.PageData;
 | 
				
			||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
					import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
				
			||||||
import com.cnbm.common.utils.ConvertUtils;
 | 
					import com.cnbm.common.utils.ConvertUtils;
 | 
				
			||||||
@@ -41,6 +42,8 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
    private ChangePackagingBoxHistoryServiceBiz changePackagingBoxHistoryService;
 | 
					    private ChangePackagingBoxHistoryServiceBiz changePackagingBoxHistoryService;
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private WoPackagingBoxSubstrateMapper mapper;
 | 
					    private WoPackagingBoxSubstrateMapper mapper;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private BaseSupport baseSupport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public QueryWrapper<WoPackagingBoxSubstrate> getWrapper(Map<String, Object> params){
 | 
					    public QueryWrapper<WoPackagingBoxSubstrate> getWrapper(Map<String, Object> params){
 | 
				
			||||||
@@ -75,6 +78,7 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void save(WoPackagingBoxSubstrateDTO dto) {
 | 
					    public void save(WoPackagingBoxSubstrateDTO dto) {
 | 
				
			||||||
        WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
 | 
					        WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(entity);
 | 
				
			||||||
        insert(entity);
 | 
					        insert(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -82,6 +86,7 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void update(WoPackagingBoxSubstrateDTO dto) {
 | 
					    public void update(WoPackagingBoxSubstrateDTO dto) {
 | 
				
			||||||
        WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
 | 
					        WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -103,6 +108,7 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
        changePackagingBoxHistory.setSourceSlot(entity.getSlot());
 | 
					        changePackagingBoxHistory.setSourceSlot(entity.getSlot());
 | 
				
			||||||
        changePackagingBoxHistory.setLeaveTime(LocalDateTime.now());
 | 
					        changePackagingBoxHistory.setLeaveTime(LocalDateTime.now());
 | 
				
			||||||
        changePackagingBoxHistory.setType(2);
 | 
					        changePackagingBoxHistory.setType(2);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(changePackagingBoxHistory);
 | 
				
			||||||
        changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
 | 
					        changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
 | 
				
			||||||
        //模组从该包装箱中移出,该模组变为未绑定BoxID的模组
 | 
					        //模组从该包装箱中移出,该模组变为未绑定BoxID的模组
 | 
				
			||||||
        UpdateWrapper<WoPackagingBoxSubstrate> wrapper = new UpdateWrapper<>();
 | 
					        UpdateWrapper<WoPackagingBoxSubstrate> wrapper = new UpdateWrapper<>();
 | 
				
			||||||
@@ -126,10 +132,12 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
        changePackagingBoxHistory.setTargetSlot(dto.getSlot());
 | 
					        changePackagingBoxHistory.setTargetSlot(dto.getSlot());
 | 
				
			||||||
        changePackagingBoxHistory.setInputTime(LocalDateTime.now());
 | 
					        changePackagingBoxHistory.setInputTime(LocalDateTime.now());
 | 
				
			||||||
        changePackagingBoxHistory.setType(1);
 | 
					        changePackagingBoxHistory.setType(1);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(changePackagingBoxHistory);
 | 
				
			||||||
        changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
 | 
					        changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
 | 
				
			||||||
        //更新
 | 
					        //更新
 | 
				
			||||||
        entity.setPackagingBoxId(dto.getPackagingBoxId());
 | 
					        entity.setPackagingBoxId(dto.getPackagingBoxId());
 | 
				
			||||||
        entity.setSlot(dto.getSlot());
 | 
					        entity.setSlot(dto.getSlot());
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -146,34 +154,38 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
            changePackagingBoxHistory.setTargetBoxNo(dto.getPackagingBoxId());
 | 
					            changePackagingBoxHistory.setTargetBoxNo(dto.getPackagingBoxId());
 | 
				
			||||||
            changePackagingBoxHistory.setTargetSlot(dto.getSlot());
 | 
					            changePackagingBoxHistory.setTargetSlot(dto.getSlot());
 | 
				
			||||||
            changePackagingBoxHistory.setType(3);
 | 
					            changePackagingBoxHistory.setType(3);
 | 
				
			||||||
 | 
					            baseSupport.setCommonField(changePackagingBoxHistory);
 | 
				
			||||||
            changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
 | 
					            changePackagingBoxHistoryService.insert(changePackagingBoxHistory);
 | 
				
			||||||
            //更新
 | 
					            //更新
 | 
				
			||||||
            entity.setPackagingBoxId(dto.getPackagingBoxId());
 | 
					            entity.setPackagingBoxId(dto.getPackagingBoxId());
 | 
				
			||||||
            entity.setSlot(dto.getSlot());
 | 
					            entity.setSlot(dto.getSlot());
 | 
				
			||||||
 | 
					            baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
            updateById(entity);
 | 
					            updateById(entity);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void insertSubstrateManual(ChangePackingBoxDTO dto) {
 | 
					    public void insertSubstrateManual(ChangePackingBoxDTO[] dtos) {
 | 
				
			||||||
 | 
					        for(ChangePackingBoxDTO dto : dtos) {
 | 
				
			||||||
        QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
 | 
					            QueryWrapper<WoPackagingBoxSubstrate> wrapper = new QueryWrapper<>();
 | 
				
			||||||
        wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()),WoPackagingBoxSubstrate.WO_SUBSTRATE_ID,dto.getWoSubstrateId());
 | 
					            wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId());
 | 
				
			||||||
        if(mapper.selectCount(wrapper)>0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) {
 | 
					            if (mapper.selectCount(wrapper) > 0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) {
 | 
				
			||||||
            WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0);
 | 
					                WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0);
 | 
				
			||||||
            substrate.setPackagingBoxId(dto.getPackagingBoxId());
 | 
					                substrate.setPackagingBoxId(dto.getPackagingBoxId());
 | 
				
			||||||
            updateById(substrate);
 | 
					                baseSupport.setUpdateCommonField(substrate);
 | 
				
			||||||
        }
 | 
					                updateById(substrate);
 | 
				
			||||||
        else{
 | 
					            } else {
 | 
				
			||||||
            //模组ID有时为空,用户会输入”无码“
 | 
					                //模组ID有时为空,用户会输入”无码“
 | 
				
			||||||
            if(dto.getWoSubstrateId()==null) {
 | 
					                if (dto.getWoSubstrateId() == null) {
 | 
				
			||||||
                dto.setWoSubstrateId("无码");
 | 
					                    dto.setWoSubstrateId("无码");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                //效验数据
 | 
				
			||||||
 | 
					                ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
 | 
				
			||||||
 | 
					                WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
 | 
				
			||||||
 | 
					                baseSupport.setCommonField(entity);
 | 
				
			||||||
 | 
					                insert(entity);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            //效验数据
 | 
					 | 
				
			||||||
            ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
 | 
					 | 
				
			||||||
            WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class);
 | 
					 | 
				
			||||||
            insert(entity);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl;
 | 
				
			|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
					import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
					import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
import com.cnbm.admin.enums.WhetherEnum;
 | 
					import com.cnbm.admin.enums.WhetherEnum;
 | 
				
			||||||
import com.cnbm.common.page.PageData;
 | 
					import com.cnbm.common.page.PageData;
 | 
				
			||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
					import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
				
			||||||
@@ -42,6 +43,8 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private WoPackagingPrintHistoryMapper mapper;
 | 
					    private WoPackagingPrintHistoryMapper mapper;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private BaseSupport baseSupport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private WoPackagingBoxServiceBiz woPackagingBoxServiceBiz;
 | 
					    private WoPackagingBoxServiceBiz woPackagingBoxServiceBiz;
 | 
				
			||||||
@@ -78,6 +81,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void save(WoPackagingPrintHistoryDTO dto) {
 | 
					    public void save(WoPackagingPrintHistoryDTO dto) {
 | 
				
			||||||
        WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
 | 
					        WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(entity);
 | 
				
			||||||
        insert(entity);
 | 
					        insert(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -85,6 +89,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void update(WoPackagingPrintHistoryDTO dto) {
 | 
					    public void update(WoPackagingPrintHistoryDTO dto) {
 | 
				
			||||||
        WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
 | 
					        WoPackagingPrintHistory entity = ConvertUtils.sourceToTarget(dto, WoPackagingPrintHistory.class);
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -112,6 +117,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
        BeanUtils.copyProperties(woPackagingBox, woPackagingPrintHistory);
 | 
					        BeanUtils.copyProperties(woPackagingBox, woPackagingPrintHistory);
 | 
				
			||||||
        woPackagingPrintHistory.setId(null);
 | 
					        woPackagingPrintHistory.setId(null);
 | 
				
			||||||
        woPackagingPrintHistory.setPrintTime(LocalDateTime.now());
 | 
					        woPackagingPrintHistory.setPrintTime(LocalDateTime.now());
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(woPackagingPrintHistory);
 | 
				
			||||||
        insert(woPackagingPrintHistory);
 | 
					        insert(woPackagingPrintHistory);
 | 
				
			||||||
        //更新包装箱表中打印状态和时间
 | 
					        //更新包装箱表中打印状态和时间
 | 
				
			||||||
        woPackagingBox.setPrintTime(woPackagingPrintHistory.getPrintTime());
 | 
					        woPackagingBox.setPrintTime(woPackagingPrintHistory.getPrintTime());
 | 
				
			||||||
@@ -122,6 +128,7 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl<WoPac
 | 
				
			|||||||
        else{
 | 
					        else{
 | 
				
			||||||
            woPackagingBox.setPrintCount(woPackagingBox.getPrintCount()+1);
 | 
					            woPackagingBox.setPrintCount(woPackagingBox.getPrintCount()+1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(woPackagingBox);
 | 
				
			||||||
        woPackagingBoxServiceBiz.update(woPackagingBox);
 | 
					        woPackagingBoxServiceBiz.update(woPackagingBox);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package com.cnbm.packing.service.impl;
 | 
				
			|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
					import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
					import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
				
			||||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
					import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 | 
				
			||||||
 | 
					import com.cnbm.admin.base.BaseSupport;
 | 
				
			||||||
import com.cnbm.common.page.PageData;
 | 
					import com.cnbm.common.page.PageData;
 | 
				
			||||||
import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
					import com.cnbm.common.service.impl.CrudServiceImpl;
 | 
				
			||||||
import com.cnbm.common.utils.ConvertUtils;
 | 
					import com.cnbm.common.utils.ConvertUtils;
 | 
				
			||||||
@@ -31,6 +32,8 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Autowired
 | 
					    @Autowired
 | 
				
			||||||
    private WoPowerLevelMapper mapper;
 | 
					    private WoPowerLevelMapper mapper;
 | 
				
			||||||
 | 
					    @Autowired
 | 
				
			||||||
 | 
					    private BaseSupport baseSupport;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public QueryWrapper<WoPowerLevel> getWrapper(Map<String, Object> params){
 | 
					    public QueryWrapper<WoPowerLevel> getWrapper(Map<String, Object> params){
 | 
				
			||||||
@@ -64,6 +67,7 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void save(WoPowerLevelDTO dto) {
 | 
					    public void save(WoPowerLevelDTO dto) {
 | 
				
			||||||
        WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
 | 
					        WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
 | 
				
			||||||
 | 
					        baseSupport.setCommonField(entity);
 | 
				
			||||||
        insert(entity);
 | 
					        insert(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -71,6 +75,7 @@ public class WoPowerLevelServiceBizImpl extends CrudServiceImpl<WoPowerLevelMapp
 | 
				
			|||||||
    @Transactional(rollbackFor = Exception.class)
 | 
					    @Transactional(rollbackFor = Exception.class)
 | 
				
			||||||
    public void update(WoPowerLevelDTO dto) {
 | 
					    public void update(WoPowerLevelDTO dto) {
 | 
				
			||||||
        WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
 | 
					        WoPowerLevel entity = ConvertUtils.sourceToTarget(dto, WoPowerLevel.class);
 | 
				
			||||||
 | 
					        baseSupport.setUpdateCommonField(entity);
 | 
				
			||||||
        updateById(entity);
 | 
					        updateById(entity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -178,7 +178,7 @@ public enum S7Client {
 | 
				
			|||||||
                            );
 | 
					                            );
 | 
				
			||||||
                            return type.toObject(read);
 | 
					                            return type.toObject(read);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                    }catch (Exception e) {
 | 
					                    }catch (Throwable e) {
 | 
				
			||||||
                        throw new S7CheckResultException("read errMsg : "+e.getMessage());
 | 
					                        throw new S7CheckResultException("read errMsg : "+e.getMessage());
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -293,7 +293,7 @@ public enum S7Client {
 | 
				
			|||||||
                           );
 | 
					                           );
 | 
				
			||||||
                       }
 | 
					                       }
 | 
				
			||||||
                       return null;
 | 
					                       return null;
 | 
				
			||||||
                   }catch (Exception e) {
 | 
					                   }catch (Throwable e) {
 | 
				
			||||||
                       throw new S7CheckResultException("write errMsg : "+e.getMessage());
 | 
					                       throw new S7CheckResultException("write errMsg : "+e.getMessage());
 | 
				
			||||||
                   }
 | 
					                   }
 | 
				
			||||||
               },
 | 
					               },
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user