From 572466e8ebaa67f1809a97ecf912d30e8802fd98 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期一, 28 四月 2025 14:18:39 +0800 Subject: [PATCH] update --- lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml | 12 ++ lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/LogTableServiceImpl.java | 50 +++++++----- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentUtilizationRate.java | 2 lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java | 27 ++---- lxzn-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java | 3 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceUtilizationRateJob.java | 10 +- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/webservice/impl/EquipmentWebServiceImpl.java | 35 ++++++-- /dev/null | 23 ----- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalShiftInfoServiceImpl.java | 2 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentStatus.java | 3 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceStatusJob.java | 10 +- lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml | 7 + lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml | 53 ++++++------- 13 files changed, 123 insertions(+), 114 deletions(-) diff --git a/lxzn-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/lxzn-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index 1b6cdba..2e3fb16 100644 --- a/lxzn-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/lxzn-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -95,12 +95,13 @@ filterChainDefinitionMap.put("/generic/**", "anon");//pdf棰勮闇�瑕佹枃浠� filterChainDefinitionMap.put("/sys/user/updatePassword", "anon");//棣栭〉鐢ㄦ埛淇敼瀵嗙爜 - filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //鐧诲綍浜岀淮鐮� + filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //鐧诲綍浜岀淮鐮丵 filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //鐩戝惉鎵爜 filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //鎺堟潈鎺ュ彛鎺掗櫎 filterChainDefinitionMap.put("/sys/api/appAuth", "anon"); //缃戦椄璁よ瘉鎺ュ彛鎺掗櫎 filterChainDefinitionMap.put("/sys/api/fileUpload", "anon"); //缃戦椄涓婁紶鏂囦欢鎺ュ彛鎺掗櫎 filterChainDefinitionMap.put("/services/**", "anon"); //webservice鎺ュ彛鎺掗櫎 + filterChainDefinitionMap.put("/mdc/largeScreen/**", "anon"); //鐪嬫澘鎺ュ彛鎺掗櫎 filterChainDefinitionMap.put("/", "anon"); diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ControlSystem.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ControlSystem.java deleted file mode 100644 index b1aa309..0000000 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/ControlSystem.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.jeecg.modules.mdc.entity; - -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModel; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -import java.io.Serializable; - -/** - * @author: LiuS - * @create: 2023-04-07 11:12 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@TableName("ControlSystem") -@ApiModel(value = "鎺у埗绯荤粺琛�") -public class ControlSystem implements Serializable { - private static final long serialVersionUID = 1529244980533421687L; - - /** - * 涓婚敭 - */ - @TableId - private String code; - /** - * 璁惧绫诲瀷 - */ - @TableField(value = "driveType") - private String driveType; - /** - * 鏄惁閲囬泦鐗瑰緛鍙傛暟 1:閲囬泦 2:涓嶉噰闆� - */ - @TableField(value = "dataFlag") - private Integer dataFlag; - //澶囨敞 - private String remark; -} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceStatusJob.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceStatusJob.java index f54d0bc..b0b73d4 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceStatusJob.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceStatusJob.java @@ -68,12 +68,10 @@ try { List<WsEquipmentStatus> equipmentStatusList = equipmentService.selectEquipmentStatus(); if (equipmentStatusList != null && !equipmentStatusList.isEmpty()) { - for (WsEquipmentStatus wsEquipmentStatus : equipmentStatusList) { - String s = JSONObject.toJSONString(wsEquipmentStatus); - log.info("涓婃姤鐘舵�佹暟鎹� ===== " + s); - String result = CxfClientUtil.invokeService(url, s, namespace, method); - log.info("涓婃姤鐘舵�佺粨鏋� ===== " + result); - } + String s = JSONObject.toJSONString(equipmentStatusList); + log.info("涓婃姤鐘舵�佹暟鎹� ===== " + s); + String result = CxfClientUtil.invokeService(url, s, namespace, method); + log.info("涓婃姤鐘舵�佺粨鏋� ===== " + result); } quartzLog.setIsSuccess(0); } catch (Exception e) { diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceUtilizationRateJob.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceUtilizationRateJob.java index 800ef9e..32cf7f7 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceUtilizationRateJob.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/WebServiceUtilizationRateJob.java @@ -67,12 +67,10 @@ try { List<WsEquipmentUtilizationRate> equipmentRateList = equipmentService.selectEquipmentRate(); if (equipmentRateList != null && !equipmentRateList.isEmpty()) { - for (WsEquipmentUtilizationRate wsEquipmentUtilizationRate : equipmentRateList) { - String s = JSONObject.toJSONString(wsEquipmentUtilizationRate); - log.info("涓婃姤鍒╃敤鐜囨暟鎹� ===== {}", s); - String result = CxfClientUtil.invokeService(url, s, namespace, method); - log.info("涓婃姤鍒╃敤鐜囩粨鏋� ===== {}", result); - } + String s = JSONObject.toJSONString(equipmentRateList); + log.info("涓婃姤鍒╃敤鐜囨暟鎹� ===== {}", s); + String result = CxfClientUtil.invokeService(url, s, namespace, method); + log.info("涓婃姤鍒╃敤鐜囩粨鏋� ===== {}", result); } quartzLog.setIsSuccess(0); } catch (Exception e) { diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ControlSystemMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ControlSystemMapper.java deleted file mode 100644 index 118e589..0000000 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/ControlSystemMapper.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.jeecg.modules.mdc.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.jeecg.modules.mdc.entity.ControlSystem; - -/** - * @author: LiuS - * @create: 2023-04-07 11:17 - */ -public interface ControlSystemMapper extends BaseMapper<ControlSystem> { -} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml index 2bec069..83bf431 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml @@ -4,37 +4,34 @@ <select id="getBigScreenInfo" resultType="org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto"> - WITH LatestEquipmentLog AS ( - SELECT - EquipmentID, - MAX(CollectTime) AS maxgdtime - FROM - EquipmentLog - GROUP BY - EquipmentID - ) SELECT - mew.id AS id, - a.EquipmentID AS equipmentId, - me.equipment_name AS equipmentName, - me.equipment_type AS equipmentType, - met.equipment_type_pictures AS equipmentImage, - a.Oporation AS oporation, - me.equipment_status AS equipmentStatus, - mew.coordinate_left AS coordinateLeft, - mew.coordinate_top AS coordinateTop, - mew.vw AS vw, - mew.vh AS vh, - me.id AS equId + t3.id AS id, + t2.EquipmentID AS equipmentId, + t1.equipment_name AS equipmentName, + t1.equipment_type AS equipmentType, + t5.equipment_type_pictures AS equipmentImage, + t2.oporation AS oporation, + t1.equipment_status AS equipmentStatus, + t3.coordinate_left AS coordinateLeft, + t3.coordinate_top AS coordinateTop, + t3.vw AS vw, + t3.vh AS vh, + t1.id AS equId FROM - EquipmentLog a - INNER JOIN LatestEquipmentLog b ON a.EquipmentID = b.EquipmentID AND a.CollectTime = b.maxgdtime - INNER JOIN mdc_workshop_equipment mew ON mew.equipment_id = a.EquipmentID - INNER JOIN mdc_equipment me ON me.equipment_id = a.EquipmentID - INNER JOIN mdc_equipment_type met ON me.equipment_type = met.equipment_type_name - INNER JOIN mdc_workshop_info mwi ON mew.workshop_id = mwi.id + mdc_equipment t1 + LEFT JOIN + equipment t2 ON t1.equipment_id = t2.EquipmentID + LEFT JOIN + mdc_workshop_equipment t3 ON t1.equipment_id = t3.equipment_id + LEFT JOIN + mdc_equipment_type t5 ON t1.equipment_type = t5.equipment_type_name WHERE - mwi.production_id = #{productionId} + EXISTS ( + SELECT 1 + FROM mdc_workshop_info t4 + WHERE t3.workshop_id = t4.id + AND t4.production_id = #{ productionId } + ); </select> <select id="listByUser" resultType="org.jeecg.modules.mdc.entity.MdcWorkshopInfo"> diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IControlSystemService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IControlSystemService.java deleted file mode 100644 index 2e73e41..0000000 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IControlSystemService.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.jeecg.modules.mdc.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import org.jeecg.modules.mdc.entity.ControlSystem; - -/** - * @author: LiuS - * @create: 2023-04-07 11:15 - */ -public interface IControlSystemService extends IService<ControlSystem> { - - ControlSystem getByDriveType(String driveType); -} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ControlSystemServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ControlSystemServiceImpl.java deleted file mode 100644 index 0de49de..0000000 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/ControlSystemServiceImpl.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.jeecg.modules.mdc.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.jeecg.common.constant.CommonConstant; -import org.jeecg.modules.mdc.entity.ControlSystem; -import org.jeecg.modules.mdc.mapper.ControlSystemMapper; -import org.jeecg.modules.mdc.service.IControlSystemService; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * @author: LiuS - * @create: 2023-04-07 11:16 - */ -@Service -public class ControlSystemServiceImpl extends ServiceImpl<ControlSystemMapper, ControlSystem> implements IControlSystemService { - @Override - public ControlSystem getByDriveType(String driveType) { - List<ControlSystem> list = lambdaQuery().eq(ControlSystem::getDriveType, driveType).eq(ControlSystem::getDataFlag, CommonConstant.STATUS_1).list(); - return !list.isEmpty() ? list.get(0) : null; - } -} diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/LogTableServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/LogTableServiceImpl.java index 87eac22..884c72c 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/LogTableServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/LogTableServiceImpl.java @@ -2,26 +2,23 @@ import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.file.FileReader; -import cn.hutool.core.io.file.FileWriter; -import cn.hutool.core.net.NetUtil; import cn.hutool.crypto.SmUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import me.zhyd.oauth.log.Log; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.jeecg.common.exception.JeecgBootException; -import org.jeecg.modules.mdc.util.SqlExecutor; -import org.jeecg.modules.system.vo.SysLogTypeObjectDto; import org.jeecg.modules.mdc.entity.LogTable; -import org.jeecg.modules.system.entity.MdcPassLog; import org.jeecg.modules.mdc.mapper.LogTableMapper; import org.jeecg.modules.mdc.service.ILogTableService; -import org.jeecg.modules.system.service.IMdcPassLogService; import org.jeecg.modules.mdc.util.DateUtils; import org.jeecg.modules.mdc.util.FileClient; -import org.jeecg.modules.system.util.FileUtils; +import org.jeecg.modules.mdc.util.SqlExecutor; import org.jeecg.modules.mdc.util.SyslogClient; -import org.springframework.beans.factory.annotation.Autowired; +import org.jeecg.modules.system.entity.MdcPassLog; +import org.jeecg.modules.system.service.IMdcPassLogService; +import org.jeecg.modules.system.util.FileUtils; +import org.jeecg.modules.system.vo.SysLogTypeObjectDto; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -29,20 +26,16 @@ import javax.annotation.Resource; import java.io.File; import java.net.InetAddress; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.sql.Connection; -import java.sql.SQLException; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * @author Lius * @date 2024/12/18 14:29 */ @Service +@Slf4j public class LogTableServiceImpl extends ServiceImpl<LogTableMapper, LogTable> implements ILogTableService { @Value("${fileService.localFilePath}") @@ -77,6 +70,9 @@ @Value("${fileService.newFilePath}") private String newFilePath; + + @Value("${fileService.failedLocFilePath}") + private String failedLocFilePath; @Resource private IMdcPassLogService mdcPassLogService; @@ -218,16 +214,30 @@ @Transactional(rollbackFor = Exception.class) public void importXmlToData() { File[] files = FileUtil.ls(localFilePath); + List<String> failedSqlList = new ArrayList<>(); // 鐢ㄤ簬瀛樺偍鎵ц澶辫触鐨� SQL for (File file : files) { if (file.isFile()) { String loFilePath = localFilePath + file.getName(); FileReader fileReader = new FileReader(loFilePath); - String sqlList = fileReader.readString(); - try { - sqlExecutor.execute(sqlList); - } catch (Exception e) { - throw new JeecgBootException("鎵цsql澶辫触锛�"); + List<String> sqlList = fileReader.readLines(); + log.info("鎴愬姛璇诲彇鍒皗}鏉ql,鎵ц鎿嶄綔", sqlList.size()); + for (String sql : sqlList) { + try { + sqlExecutor.execute(sql); + } catch (Exception e) { + failedSqlList.add(sql); +// throw new JeecgBootException("鎵цsql澶辫触锛�"); + } } + if (!failedSqlList.isEmpty()) { + try { + FileUtil.appendLines(failedSqlList, failedLocFilePath, "UTF-8"); + } catch (Exception e) { + throw new JeecgBootException("鏁版嵁鍐欏叆鏂囦欢澶辫触锛�"); + } + } +// String sqlList = fileReader.readString(); + if (Integer.parseInt(file.getName().substring(file.getName().length() - 10, file.getName().length() - 4)) == 1) { // 鍒犻櫎鍘嗗彶鏂囦欢 FileUtil.clean(newFilePath); diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalShiftInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalShiftInfoServiceImpl.java index 938b7a9..df25db4 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalShiftInfoServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalShiftInfoServiceImpl.java @@ -93,7 +93,7 @@ } } - @Transactional(readOnly = true) +// @Transactional(readOnly = true) List<MdcEquipmentStatisticalShiftInfo> equipmentShiftStatisticalProcess(Equipment equipment, String dateTime) { Date initDate = null; //鍙栨渶鍚庣殑缁熻鏁版嵁 diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentStatus.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentStatus.java index 8248ad5..110a5e1 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentStatus.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentStatus.java @@ -1,6 +1,8 @@ package org.jeecg.modules.mdc.vo; +import com.alibaba.fastjson.annotation.JSONField; import lombok.Data; + import java.util.Date; /** @@ -16,6 +18,7 @@ private String equipmentStatus; + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date creationDate; private String finr; diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentUtilizationRate.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentUtilizationRate.java index 2ac4232..e60d5ef 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentUtilizationRate.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/WsEquipmentUtilizationRate.java @@ -1,5 +1,6 @@ package org.jeecg.modules.mdc.vo; +import com.alibaba.fastjson.annotation.JSONField; import lombok.Data; import java.util.Date; @@ -46,5 +47,6 @@ /** * 缁熻鏃ユ湡 */ + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date statisDate; } diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/webservice/impl/EquipmentWebServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/webservice/impl/EquipmentWebServiceImpl.java index 21e1507..70d9563 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/webservice/impl/EquipmentWebServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/webservice/impl/EquipmentWebServiceImpl.java @@ -15,6 +15,8 @@ import javax.annotation.Resource; import javax.jws.WebService; +import java.util.ArrayList; +import java.util.List; /** @@ -38,10 +40,18 @@ @Override public String equipmentDaySchedule(String msg) { log.info("MES涓婃姤鏃ヨ鍒掑師濮嬫暟鎹� === {}", msg); - EquipmentDaySchedule equipmentDaySchedule = JSONObject.parseObject(msg, EquipmentDaySchedule.class); - MdcEquipmentDaySchedule mdcEquipmentDaySchedule = new MdcEquipmentDaySchedule(); - BeanUtils.copyProperties(equipmentDaySchedule, mdcEquipmentDaySchedule); - mdcEquipmentDayScheduleService.save(mdcEquipmentDaySchedule); + List<EquipmentDaySchedule> equipmentDayScheduleList = JSONObject.parseArray(msg, EquipmentDaySchedule.class); + if (equipmentDayScheduleList == null || equipmentDayScheduleList.isEmpty()) { + WsResult wsResult = new WsResult("0", "json瑙f瀽澶辫触"); + return JSONObject.toJSONString(wsResult); + } + List<MdcEquipmentDaySchedule> mdcEquipmentDayScheduleList = new ArrayList<>(); + for (EquipmentDaySchedule equipmentDaySchedule : equipmentDayScheduleList) { + MdcEquipmentDaySchedule mdcEquipmentDaySchedule = new MdcEquipmentDaySchedule(); + BeanUtils.copyProperties(equipmentDaySchedule, mdcEquipmentDaySchedule); + mdcEquipmentDayScheduleList.add(mdcEquipmentDaySchedule); + } + mdcEquipmentDayScheduleService.saveBatch(mdcEquipmentDayScheduleList); log.info("MES涓婃姤鏃ヨ鍒掓暟鎹垚鍔燂紒"); WsResult wsResult = new WsResult("1", "鎴愬姛"); @@ -51,11 +61,18 @@ @Override public String equipmentDaySummary(String msg) { log.info("MES涓婃姤鏃ユ眹鎬诲師濮嬫暟鎹� === {}", msg); - EquipmentDaySummary equipmentDaySummary = JSONObject.parseObject(msg, EquipmentDaySummary.class); - MdcEquipmentDaySummary mdcEquipmentDaySummary = new MdcEquipmentDaySummary(); - BeanUtils.copyProperties(equipmentDaySummary, mdcEquipmentDaySummary); - mdcEquipmentDaySummaryService.save(mdcEquipmentDaySummary); - + List<EquipmentDaySummary> equipmentDaySummaryList = JSONObject.parseArray(msg, EquipmentDaySummary.class); + if (equipmentDaySummaryList == null || equipmentDaySummaryList.isEmpty()) { + WsResult wsResult = new WsResult("0", "json瑙f瀽澶辫触"); + return JSONObject.toJSONString(wsResult); + } + List<MdcEquipmentDaySummary> mdcEquipmentDaySummaryList = new ArrayList<>(); + for (EquipmentDaySummary equipmentDaySummary : equipmentDaySummaryList) { + MdcEquipmentDaySummary mdcEquipmentDaySummary = new MdcEquipmentDaySummary(); + BeanUtils.copyProperties(equipmentDaySummary, mdcEquipmentDaySummary); + mdcEquipmentDaySummaryList.add(mdcEquipmentDaySummary); + } + mdcEquipmentDaySummaryService.saveBatch(mdcEquipmentDaySummaryList); log.info("MES涓婃姤鏃ユ眹鎬绘暟鎹垚鍔燂紒"); WsResult wsResult = new WsResult("1", "鎴愬姛"); return JSONObject.toJSONString(wsResult); diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java index 175df00..0930b96 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/screen/service/impl/MdcLargeScreenServiceImpl.java @@ -65,7 +65,7 @@ equipmentStatusOverview.setWaitCount(equipmentStatusOverview.getWaitCount() + 1); break; case 3: - equipmentStatusOverview.setRunCount(equipmentStatusOverview.getRunCount()); + equipmentStatusOverview.setRunCount(equipmentStatusOverview.getRunCount() + 1); break; case 22: equipmentStatusOverview.setErrorCount(equipmentStatusOverview.getErrorCount() + 1); @@ -141,9 +141,7 @@ Map<String, Object> result = new HashMap<>(); // 鑾峰彇瀛愮敓浜у垪琛� - List<MdcProduction> mdcProductionList = mdcProductionService.list( - new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getParentId, productionId) - ); + List<MdcProduction> mdcProductionList = mdcProductionService.list(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getParentId, productionId)); if (mdcProductionList == null || mdcProductionList.isEmpty()) { return result; @@ -152,8 +150,7 @@ List<String> dateList = DateUtils.getNearWeek(); result.put("dateList", dateList); // 璁$畻姣忎釜宸ユ鐨勫埄鐢ㄧ巼 - List<UtilizationRateDto> utilizationMonthDtoList = new ArrayList<>(); - for (MdcProduction mdcProduction : mdcProductionList) { + List<UtilizationRateDto> utilizationMonthDtoList = mdcProductionList.stream().map(mdcProduction -> { UtilizationRateDto utilizationRateDto = new UtilizationRateDto(); utilizationRateDto.setProductionId(mdcProduction.getId()); utilizationRateDto.setProductionName(mdcProduction.getProductionName()); @@ -161,14 +158,13 @@ .map(date -> { UtilizationRate utilizationMonth = new UtilizationRate(); utilizationMonth.setDate(date); - BigDecimal utilizationRate = mdcEquipmentStatisticalInfoService.computeUtilizationWeek(productionId, date.replaceAll("-", "")); + BigDecimal utilizationRate = mdcEquipmentStatisticalInfoService.computeUtilizationWeek(mdcProduction.getId(), date.replaceAll("-", "")); utilizationMonth.setUtilizationRate(utilizationRate); return utilizationMonth; - }) - .collect(Collectors.toList()); + }).collect(Collectors.toList()); utilizationRateDto.setUtilizationRateList(utilizationRates); - utilizationMonthDtoList.add(utilizationRateDto); - } + return utilizationRateDto; + }).collect(Collectors.toList()); //璁$畻鎬诲巶鐨勫埄鐢ㄧ巼 UtilizationRateDto utilizationRateDto = new UtilizationRateDto(); utilizationRateDto.setProductionName("鎬诲巶"); @@ -208,14 +204,13 @@ result.put("productionList", productionList); String date = LocalDate.now().minusDays(1).toString().replaceAll("-", ""); - List<UtilizationDayDto> utilizationDayDtos = new ArrayList<>(); - for (MdcProduction mdcProduction : mdcProductionList) { + List<UtilizationDayDto> utilizationDayDtos = mdcProductionList.stream().map(mdcProduction -> { UtilizationDayDto utilizationDayDto = new UtilizationDayDto(); utilizationDayDto.setProductionName(mdcProduction.getProductionName()); - BigDecimal utilizationRate = mdcEquipmentStatisticalInfoService.computeUtilizationWeekTotal(mdcProduction.getId(), date); + BigDecimal utilizationRate = mdcEquipmentStatisticalInfoService.computeUtilizationWeek(mdcProduction.getId(), date); utilizationDayDto.setUtilizationRate(utilizationRate); - utilizationDayDtos.add(utilizationDayDto); - } + return utilizationDayDto; + }).collect(Collectors.toList()); result.put("dataList", utilizationDayDtos); return result; } diff --git a/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml b/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml index e1d3ec0..d32f196 100644 --- a/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml +++ b/lxzn-module-system/lxzn-system-start/src/main/resources/application-dev.yml @@ -83,7 +83,7 @@ type: com.alibaba.druid.pool.DruidDataSource druid: driverClassName: dm.jdbc.driver.DmDriver - url: jdbc:dm://LOCALHOST:5236/?LXZN_MDC_420&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 + url: jdbc:dm://192.168.1.118:5236/?LXZN_MDC_420&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 username: LXZN_MDC_420 password: 123 #redis 閰嶇疆 @@ -226,8 +226,14 @@ pwd: 123 addressToken: /outer/appAuth addressUploadFile: /outer/fileUpload - localFilePath: D:/data/sql - servicePath: D:/data/sql + localFilePath: D:/data/sql #鏈湴鏂囦欢璺緞 + servicePath: D:/data/sql #鐩爣鏂囦欢璺緞 logIp: 127.0.0.1 logPort: 8888 newFilePath: D:/data/bak_sql/ #澶囦唤鍦板潃 + failedLocFilePath: #澶辫触sql鍦板潃 +webservice: + url: http://localhost:8081/services/EquipmentWebService?wsdl + namespace: http://service.server.webservice.example.com + statusMethod: equipmentStatus + rateMethod: equipmentRate diff --git a/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml b/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml index 6f9feb1..560d959 100644 --- a/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml +++ b/lxzn-module-system/lxzn-system-start/src/main/resources/application-prod.yml @@ -254,4 +254,9 @@ servicePath: D:/data/sql logIp: 127.0.0.1 logPort: 8888 - newFilePath: D:/data/bak_sql/ #澶囦唤鍦板潃 \ No newline at end of file + newFilePath: D:/data/bak_sql/ #澶囦唤鍦板潃 +webservice: + url: http://20.10.17.19:6099/services/EquipmentWebService?wsdl + namespace: http://service.server.webservice.example.com + statusMethod: equipmentStatus + rateMethod: equipmentRate \ No newline at end of file -- Gitblit v1.9.3