update - 质检优化

master
yinq 5 days ago
parent 51dec5f9b3
commit e9364fbfe8

@ -95,7 +95,10 @@ public class SysLoginController
ajax.put("factoryName", "河南民权工厂"); ajax.put("factoryName", "河南民权工厂");
List<Long> postList = postService.selectPostListByUserId(user.getUserId()); List<Long> postList = postService.selectPostListByUserId(user.getUserId());
ajax.put("postList", postList); ajax.put("postList", postList);
if (postList.contains(9L)){ if (postList.contains(121L)){
//操作工返修措施权限
ajax.put("userPermission", 0);
} else if (postList.contains(9L)) {
//超级返修措施权限 //超级返修措施权限
ajax.put("userPermission", 2); ajax.put("userPermission", 2);
} else { } else {

@ -39,7 +39,7 @@ spring:
enabled: true enabled: true
# redis 配置 # redis 配置
redis: redis:
host: 175.27.215.92 host: 1.13.177.47
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
@ -65,7 +65,7 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:oracle:thin:@10.100.72.20:1521/ORCLCDB url: jdbc:oracle:thin:@28.tcp.cpolar.top:10884/ORCLCDB
username: c##aucma_mes username: c##aucma_mes
password: aucma password: aucma
# 从库数据源 # 从库数据源

@ -1,7 +1,7 @@
# 开发环境配置 # 开发环境配置
server: server:
# 服务器的HTTP端口默认为8080 # 服务器的HTTP端口默认为8080
port: 8080 port: 6061
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /
@ -19,8 +19,8 @@ server:
# SAP接口 # SAP接口
sap: sap:
# URL前缀 # URL前缀
prefix: 10.11.43.111:81 # prefix: 10.11.43.111:81
# prefix: http://soaqas.aucma.com:8011 prefix: http://soaqas.aucma.com:8011
username: mes05 username: mes05
password: Abcd1234 password: Abcd1234
@ -41,7 +41,7 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 175.27.215.92 host: 1.13.177.47
# 端口默认为6379 # 端口默认为6379
port: 6379 port: 6379
# 数据库索引 # 数据库索引
@ -66,16 +66,16 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:oracle:thin:@175.27.215.92:1521/helowin url: jdbc:oracle:thin:@1.13.177.47:1521/helowin
# url: jdbc:oracle:thin:@192.168.80.10:1521/orcl # url: jdbc:oracle:thin:@192.168.80.10:1521/orcl
username: aucma_mes username: c##aucma_mes
password: aucma password: aucma
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: true enabled: true
url: jdbc:oracle:thin:@175.27.215.92:1521/helowin url: jdbc:oracle:thin:@1.13.177.47:1521/helowin
username: aucma_scada username: c##aucma_scada
password: aucma password: aucma
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5

@ -13,7 +13,7 @@ ruoyi:
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证 # 验证码类型 math 数字计算 char 字符验证
captchaType: math captchaType: char
# Spring配置 # Spring配置
spring: spring:
@ -24,8 +24,8 @@ spring:
# 运行环境 # 运行环境
profiles: profiles:
# active: local # active: local
active: dev # active: dev
# active: prod active: prod
# 日志配置 # 日志配置

@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.concurrent.CompletableFuture;
import static com.aucma.common.core.domain.AjaxResult.error; import static com.aucma.common.core.domain.AjaxResult.error;
import static com.aucma.common.core.domain.AjaxResult.success; import static com.aucma.common.core.domain.AjaxResult.success;
@ -98,32 +99,33 @@ public class PdaApiController {
@PostMapping("/check/query") @PostMapping("/check/query")
public AjaxResult checkQuery(String code, String station) { public AjaxResult checkQuery(String code, String station) {
long begin = System.currentTimeMillis(); long begin = System.currentTimeMillis();
logger.info("质量检测checkQuery1:" + code + "工位: " + station);
String boxName = service.selectBoxNameByCode(code); String boxName = service.selectBoxNameByCode(code);
if (boxName == null) { if (boxName == null) {
// boxName = "固定数据";
return error("条码信息扫描错误!"); return error("条码信息扫描错误!");
} }
long one = System.currentTimeMillis();
//检验前一工位是否已完成质检 //检验前一工位是否已完成质检
logger.info("质量检测checkQuery2:" + code + "工位:"+ station); long two = 0;
long three = 0;
if (StringUtils.isNotEmpty(station)) { if (StringUtils.isNotEmpty(station)) {
//箱体发泡检验01工位、二线箱体预装检验工位 对 壳胆绑定进行验证 //箱体发泡检验01工位、二线箱体预装检验工位 对 壳胆绑定进行验证
two = System.currentTimeMillis();
if (station.equals("2003") || station.equals("2018") || station.equals("2103") || station.equals("2104")) { if (station.equals("2003") || station.equals("2018") || station.equals("2103") || station.equals("2104")) {
String result = service.checkShellBinding(code, station); String result = service.checkShellBinding(code, station);
logger.info("质量检测checkQuery3:" + code + "工位:" + station);
if (StringUtils.isNotNull(result)) { if (StringUtils.isNotNull(result)) {
return error(result); return error(result);
} }
} }
String result = qualityService.checkBeforeStationInspection(code, station); String result = qualityService.checkBeforeStationInspection(code, station);
logger.info("质量检测checkQuery4:" + code + "工位:" + station); three = System.currentTimeMillis();
if (StringUtils.isNotNull(result)) { if (StringUtils.isNotNull(result)) {
return error(result); return error(result);
} }
} }
List<ReportQualityInspection> list = service.checkSelectRepairInfo(code); List<ReportQualityInspection> list = service.checkSelectRepairInfo(code);
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
logger.info("质量检测checkQuery5:" + code + "运行时间:" + (end - begin) + "工位:" + station); logger.info("质量检测checkQuery:" + code + "|总运行时间:" + (end - begin) + "|工位:" + station
+ "|one:" + (one - begin) + "|two:" + (two - one) + "|three:" + (three - two) + "|three:" + (end - three));
return success(boxName, list); return success(boxName, list);
} }
@ -134,13 +136,13 @@ public class PdaApiController {
long begin = System.currentTimeMillis(); long begin = System.currentTimeMillis();
List<CheckInfoDto.DefectBeen> list = checkInfo.getList(); List<CheckInfoDto.DefectBeen> list = checkInfo.getList();
int size = (list == null || list.isEmpty()) ? 1 : list.size(); int size = (list == null || list.isEmpty()) ? 1 : list.size();
logger.info("质检提交checkSubmit1:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); // logger.info("质检提交checkSubmit1:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
ReportQualityInspection inspection = new ReportQualityInspection(); ReportQualityInspection inspection = new ReportQualityInspection();
inspection.setBarCode(checkInfo.getCode()); inspection.setBarCode(checkInfo.getCode());
String boxName = service.selectBoxNameBarCode(checkInfo.getCode()); String boxName = service.selectBoxNameBarCode(checkInfo.getCode());
logger.info("质检提交checkSubmit2:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); // logger.info("质检提交checkSubmit2:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
inspection.setMaterialName(boxName); inspection.setMaterialName(boxName);
String measure = checkInfo.getMeasure(); String measure = checkInfo.getMeasure();
@ -149,7 +151,6 @@ public class PdaApiController {
inspection.setIsFlag(1L); inspection.setIsFlag(1L);
} }
//检测人 //检测人
// inspection.setInspectorCode(checkInfo.getUserName());
inspection.setInspectorCode(SecurityUtils.getUsername()); inspection.setInspectorCode(SecurityUtils.getUsername());
inspection.setInspectorTime(new Date()); inspection.setInspectorTime(new Date());
inspection.setStationCode(checkInfo.getStationCode()); inspection.setStationCode(checkInfo.getStationCode());
@ -160,35 +161,41 @@ public class PdaApiController {
BaseProcessStation processStation = new BaseProcessStation(); BaseProcessStation processStation = new BaseProcessStation();
processStation.setParentId(checkInfo.getStationCode()); processStation.setParentId(checkInfo.getStationCode());
List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation); List<BaseProcessStation> processStations = baseProcessStationService.selectBaseProcessStationList(processStation);
logger.info("质检提交checkSubmit3:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); // logger.info("质检提交checkSubmit3:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
inspection.setProcessCode(processStations.get(0).getProcessCode()); inspection.setProcessCode(processStations.get(0).getProcessCode());
inspection.setProductLineName(processStations.get(0).getProductLineCode()); inspection.setProductLineName(processStations.get(0).getProductLineCode());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("质检提交查质检工序checkSubmitException:{}|工位:{}|{}", checkInfo.getCode(), checkInfo.getStationCode(), e.getMessage());
} }
int finalI = i;
CompletableFuture.runAsync(() -> {
assert list != null; assert list != null;
if (!list.isEmpty()) { if (!list.isEmpty()) {
CheckInfoDto.DefectBeen defectBeen = list.get(i); CheckInfoDto.DefectBeen defectBeen = list.get(finalI);
inspection.setSubmitQualtyId(defectBeen.getObjId()); inspection.setSubmitQualtyId(defectBeen.getObjId());
inspection.setTestItemCode(list.get(i).getStationCode()); inspection.setTestItemCode(list.get(finalI).getStationCode());
inspection.setQualityDefectCode(list.get(i).getQualityDefectCode()); inspection.setQualityDefectCode(list.get(finalI).getQualityDefectCode());
inspection.setQualityDefectName(list.get(i).getQualityDefectName()); inspection.setQualityDefectName(list.get(finalI).getQualityDefectName());
} }
qualityService.insertReportQualityInspection(inspection); qualityService.insertReportQualityInspection(inspection);
logger.info("质检提交checkSubmit4:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); // logger.info("质检提交checkSubmit4:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
//质检处理措施3=合格,1=返修) //质检处理措施3=合格,1=返修)
if (inspection.getTreatmentMeasure().equals("3")) { if (inspection.getTreatmentMeasure().equals("3")) {
try { try {
completionService.inspectionProcessing(inspection); completionService.inspectionProcessing(inspection);
logger.info("质检提交checkSubmit5:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode()); // logger.info("质检提交checkSubmit5:" + checkInfo.getCode() + "工位:" + checkInfo.getStationCode());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); logger.info("质检提交checkSubmitException:{}|工位:{}|{}", checkInfo.getCode(), checkInfo.getStationCode(), e.getMessage());
} }
} }
});
} }
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
logger.info("质量检测checkQuery6:" + checkInfo.getCode() + "运行时间:"+ (end - begin) + "工位:" + checkInfo.getStationCode()); CompletableFuture.runAsync(() -> {
logger.info("质检提交checkSubmit:" + checkInfo.getCode() +
"|运行时间:" + (end - begin) + "|工位:" + checkInfo.getStationCode());
});
return success(); return success();
} }

@ -177,8 +177,8 @@ public class QualityReportServiceImpl implements IQualityReportService {
} }
} }
} else { } else {
String[] stationCodeLists = {"null"}; // String[] stationCodeLists = {"null"};
hashMap.put("stationCodeList", stationCodeLists); // hashMap.put("stationCodeList", stationCodeLists);
} }
//日 //日

@ -92,7 +92,7 @@
<if test="updatedBy != null and updatedBy != ''">and rqi.updated_by = #{updatedBy}</if> <if test="updatedBy != null and updatedBy != ''">and rqi.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and rqi.updated_time = #{updatedTime}</if> <if test="updatedTime != null ">and rqi.updated_time = #{updatedTime}</if>
<if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''"> <if test="beginBeginTime != null and beginBeginTime != '' and endBeginTime != null and endBeginTime != ''">
AND TO_CHAR(rqi.inspector_time, 'YYYY-MM-DD HH24:MI:SS') BETWEEN #{beginBeginTime} AND #{endBeginTime} AND rqi.inspector_time BETWEEN TO_DATE(#{beginBeginTime}, 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(#{endBeginTime}, 'YYYY-MM-DD HH24:MI:SS')
</if> </if>
</where> </where>
order by rqi.inspector_time desc order by rqi.inspector_time desc

Loading…
Cancel
Save