diff --git a/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/RemoteDmsService.java b/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/RemoteDmsService.java index 4999b398..375de063 100644 --- a/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/RemoteDmsService.java +++ b/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/RemoteDmsService.java @@ -27,5 +27,9 @@ public interface RemoteDmsService { @PostMapping("/dmsBillsMaintInstance/autoAdd") R getDmsBillsMaintInstance(@RequestHeader(SecurityConstants.FROM_SOURCE) String source,String planMaintCode); + + @PostMapping("/dmsRecordAlarmInfo/alarmNotification") + R getDmsAlarmNotificationScheduledTask(@RequestHeader(SecurityConstants.FROM_SOURCE) String source); + } diff --git a/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/factory/RemoteDmsFallbackFactory.java b/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/factory/RemoteDmsFallbackFactory.java index 690aa181..abf8e4ce 100644 --- a/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/factory/RemoteDmsFallbackFactory.java +++ b/hw-api/hw-api-dms/src/main/java/com/hw/dms/api/factory/RemoteDmsFallbackFactory.java @@ -34,6 +34,11 @@ public class RemoteDmsFallbackFactory implements FallbackFactory getDmsBillsMaintInstance(String source, String planMaintCode) { return null; } + + @Override + public R getDmsAlarmNotificationScheduledTask(String source) { + return R.fail("设备报警通知定时任务失败:" + throwable.getMessage()); + } }; } } diff --git a/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java b/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java index b3e328bb..55ad5f1e 100644 --- a/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java +++ b/hw-api/hw-api-system/src/main/java/com/hw/system/api/RemoteSysCommonService.java @@ -3,6 +3,7 @@ package com.hw.system.api; import com.hw.common.core.constant.SecurityConstants; import com.hw.common.core.constant.ServiceNameConstants; import com.hw.common.core.domain.R; +import com.hw.system.api.domain.common.SysPointRouter; import com.hw.system.api.domain.common.WfProcessActivity; import com.hw.system.api.domain.common.vo.WfProcessActivityVo; import com.hw.system.api.factory.RemoteSysCommonFallbackFactory; @@ -12,6 +13,8 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; +import java.util.List; + /** * @ClassName : RemoteSysCommon * @Description : zhouhy @@ -28,4 +31,7 @@ public interface RemoteSysCommonService { @PostMapping("/wfprocessactivity/getWfProcessActivityByUI") R getWfProcessActivityByUI(@RequestBody WfProcessActivityVo wfProcessActivityVo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); + + @PostMapping("/pointRouter/insertPointRouterInfo") + R insertSysPointRouterPort(@RequestBody List sysPointRouterList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source); } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/SysPointRouter.java b/hw-api/hw-api-system/src/main/java/com/hw/system/api/domain/common/SysPointRouter.java similarity index 98% rename from hw-modules/hw-system/src/main/java/com/hw/system/common/domain/SysPointRouter.java rename to hw-api/hw-api-system/src/main/java/com/hw/system/api/domain/common/SysPointRouter.java index 9be2afc9..28e8f6cf 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/domain/SysPointRouter.java +++ b/hw-api/hw-api-system/src/main/java/com/hw/system/api/domain/common/SysPointRouter.java @@ -1,4 +1,4 @@ -package com.hw.system.common.domain; +package com.hw.system.api.domain.common; import java.util.Date; diff --git a/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java b/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java index 8858bd24..3ac1a99f 100644 --- a/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java +++ b/hw-api/hw-api-system/src/main/java/com/hw/system/api/factory/RemoteSysCommonFallbackFactory.java @@ -4,6 +4,7 @@ import com.hw.common.core.domain.R; import com.hw.system.api.RemoteSysCommonService; import com.hw.system.api.RemoteUserService; import com.hw.system.api.domain.SysUser; +import com.hw.system.api.domain.common.SysPointRouter; import com.hw.system.api.domain.common.WfProcessActivity; import com.hw.system.api.domain.common.vo.WfProcessActivityVo; import com.hw.system.api.model.LoginUser; @@ -13,6 +14,7 @@ import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import java.rmi.Remote; +import java.util.List; /** * 日志服务降级处理 @@ -45,6 +47,10 @@ public class RemoteSysCommonFallbackFactory implements FallbackFactory insertSysPointRouterPort(List sysPointRouterList, String source) { + return R.fail("调用提示路由信息失败:" + throwable.getMessage()); + } }; } diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/SystemConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/SystemConstants.java new file mode 100644 index 00000000..b6edc6f8 --- /dev/null +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/SystemConstants.java @@ -0,0 +1,41 @@ +package com.hw.common.core.constant; + +/** + * 通用常量信息 + * + * @author ruoyi + */ +public class SystemConstants { + //系统模块 + public static final String MES = "MES"; + public static final String WMS = "WMS"; + public static final String EMS = "EMS"; + public static final String DMS = "DMS"; + public static final String QMS = "QMS"; + + /** + * 通知状态(0未通知 1已通知) + */ + public static final String DMS_NOTICE_STATUS_FALSE = "0";//0未通知 + public static final String DMS_NOTICE_STATUS_TRUE = "1";//1已通知 + + /** + * 通知方式(1WEB 2公众号 3PLC) + */ + public static final String DMS_NOTICE_TYPE_WEB = "1";//1WEB + public static final String DMS_NOTICE_TYPE_CHAT = "2";//2公众号 + public static final String DMS_NOTICE_TYPE_PLC = "3";//3PLC + + /** + * 提示类型(1=报警;2=审核) + */ + public static final String SYS_ROUTER_POINT_TYPE_ALARM = "1";//报警 + public static final String SYS_ROUTER_POINT_TYPE_AUDIT = "2";//审核 + + /** + * 设备报警记录路由 + */ + public static final String SYS_ROUTER_DMS_ALARM_URL = "/dms/deviceAlarm/dmsRecordAlarmInfo"; + + +} diff --git a/hw-modules/hw-dms/pom.xml b/hw-modules/hw-dms/pom.xml index f370a17e..21388208 100644 --- a/hw-modules/hw-dms/pom.xml +++ b/hw-modules/hw-dms/pom.xml @@ -77,6 +77,16 @@ com.hw hw-common-swagger + + + com.hw + hw-api-job + + + + com.hw + hw-api-system + diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java index 6ffeb091..53376afd 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsRecordAlarmInfoController.java @@ -4,6 +4,7 @@ import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import com.hw.common.security.annotation.InnerAuth; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -106,4 +107,14 @@ public class DmsRecordAlarmInfoController extends BaseController { public AjaxResult handleDmsRecordAlarmInfo(@RequestBody DmsRecordAlarmInfo dmsRecordAlarmInfo) { return toAjax(dmsRecordAlarmInfoService.handleDmsRecordAlarmInfo(dmsRecordAlarmInfo)); } + + /** + * 设备报警消息通知 + * @return + */ + @PostMapping("/alarmNotification") + @InnerAuth + public AjaxResult alarmNotification() { + return AjaxResult.success(dmsRecordAlarmInfoService.alarmNotification()); + } } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java index cdf2b57c..52d2b80f 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsRecordAlarmInfoService.java @@ -66,4 +66,10 @@ public interface IDmsRecordAlarmInfoService { */ public int handleDmsRecordAlarmInfo(DmsRecordAlarmInfo dmsRecordAlarmInfo); + /** + * 设备报警消息通知 + * @return + */ + public int alarmNotification(); + } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java index c0ab7b4f..8081ec8d 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordAlarmInfoServiceImpl.java @@ -1,15 +1,24 @@ package com.hw.dms.service.impl; +import java.rmi.ServerException; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import com.alibaba.nacos.shaded.com.google.gson.Gson; import com.hw.common.core.constant.DmsConstants; +import com.hw.common.core.constant.SecurityConstants; +import com.hw.common.core.constant.SystemConstants; import com.hw.common.core.utils.DateUtils; import com.hw.common.security.utils.SecurityUtils; +import com.hw.system.api.RemoteSysCommonService; +import com.hw.system.api.domain.common.SysPointRouter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.dms.mapper.DmsRecordAlarmInfoMapper; import com.hw.dms.domain.DmsRecordAlarmInfo; import com.hw.dms.service.IDmsRecordAlarmInfoService; +import org.springframework.transaction.annotation.Transactional; /** * 设备报警记录Service业务层处理 @@ -22,6 +31,9 @@ public class DmsRecordAlarmInfoServiceImpl implements IDmsRecordAlarmInfoService @Autowired private DmsRecordAlarmInfoMapper dmsRecordAlarmInfoMapper; + @Autowired + private RemoteSysCommonService remoteSysCommonService; + /** * 查询设备报警记录 * @@ -92,6 +104,7 @@ public class DmsRecordAlarmInfoServiceImpl implements IDmsRecordAlarmInfoService /** * 设备报警人工处理 + * * @param dmsRecordAlarmInfo * @return */ @@ -104,4 +117,47 @@ public class DmsRecordAlarmInfoServiceImpl implements IDmsRecordAlarmInfoService dmsRecordAlarmInfo.setUpdateTime(DateUtils.getNowDate()); return dmsRecordAlarmInfoMapper.updateDmsRecordAlarmInfo(dmsRecordAlarmInfo); } + + /** + * 设备报警消息通知 + * + * @return + */ + @Override + @Transactional(rollbackFor = ServerException.class) + public int alarmNotification() { + DmsRecordAlarmInfo selectAlarmInfo = new DmsRecordAlarmInfo(); + selectAlarmInfo.setNoticeType(SystemConstants.DMS_NOTICE_TYPE_WEB); + selectAlarmInfo.setNoticeStatus(SystemConstants.DMS_NOTICE_STATUS_FALSE); + List alarmInfoList = dmsRecordAlarmInfoMapper.selectDmsRecordAlarmInfoList(selectAlarmInfo); + if (alarmInfoList.size() == 0) { + return 1; + } + List webRouterList = new ArrayList<>(); + Gson gson = new Gson(); + HashMap map = new HashMap<>(); + for (DmsRecordAlarmInfo alarmInfo : alarmInfoList) { + SysPointRouter pointRouter = new SysPointRouter(); + pointRouter.setModuleCode(SystemConstants.DMS); + pointRouter.setPointType(SystemConstants.SYS_ROUTER_POINT_TYPE_ALARM); + pointRouter.setRouterAddress(SystemConstants.SYS_ROUTER_DMS_ALARM_URL); + map.put("alarmId", alarmInfo.getAlarmId()); + String json = gson.toJson(map); + pointRouter.setRouterAddressDetail(json); + pointRouter.setRemark(alarmInfo.getAlarmReason()); + webRouterList.add(pointRouter); + } + //WEB通知 + remoteSysCommonService.insertSysPointRouterPort(webRouterList, SecurityConstants.INNER); + for (DmsRecordAlarmInfo alarmInfo : alarmInfoList) { + DmsRecordAlarmInfo recordAlarmInfo = new DmsRecordAlarmInfo(); + recordAlarmInfo.setAlarmId(alarmInfo.getAlarmId()); + recordAlarmInfo.setNoticeStatus(SystemConstants.DMS_NOTICE_STATUS_TRUE); + this.updateDmsRecordAlarmInfo(recordAlarmInfo); + } + + //公众号通知 + return 1; + } + } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordShutDownServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordShutDownServiceImpl.java index cd1a648b..19a8375a 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordShutDownServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsRecordShutDownServiceImpl.java @@ -55,9 +55,7 @@ public class DmsRecordShutDownServiceImpl implements IDmsRecordShutDownService @Override public int insertDmsRecordShutDown(DmsRecordShutDown dmsRecordShutDown) { - LoginUser user = SecurityUtils.getLoginUser(); - dmsRecordShutDown.setIsFlag(1l); - dmsRecordShutDown.setCreateBy(user.getUsername()); + dmsRecordShutDown.setCreateBy(SecurityUtils.getUsername()); dmsRecordShutDown.setCreateTime(DateUtils.getNowDate()); return dmsRecordShutDownMapper.insertDmsRecordShutDown(dmsRecordShutDown); } @@ -71,8 +69,7 @@ public class DmsRecordShutDownServiceImpl implements IDmsRecordShutDownService @Override public int updateDmsRecordShutDown(DmsRecordShutDown dmsRecordShutDown) { - LoginUser user = SecurityUtils.getLoginUser(); - dmsRecordShutDown.setUpdateBy(user.getUsername()); + dmsRecordShutDown.setUpdateBy(SecurityUtils.getUsername()); dmsRecordShutDown.setUpdateTime(DateUtils.getNowDate()); return dmsRecordShutDownMapper.updateDmsRecordShutDown(dmsRecordShutDown); } diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml index d8f1edf2..b69970db 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsRecordAlarmInfoMapper.xml @@ -67,6 +67,7 @@ - and device_id = #{deviceId} - and shut_type = #{shutType} - and shut_reason = #{shutReason} - and shut_begin_time >= #{shutBeginTime} - and #{shutEndTime}>=shut_end_time - and shut_time = #{shutTime} - and is_flag = #{isFlag} + and device_id = #{deviceId} + and shut_type = #{shutType} + and shut_reason = #{shutReason} + and shut_begin_time >= #{shutBeginTime} + and #{shutEndTime}>=shut_end_time + and shut_time = #{shutTime} + and is_flag = #{isFlag} @@ -42,7 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where record_shut_down_id = #{recordShutDownId} - + insert into dms_record_shut_down device_id, @@ -57,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time, update_by, update_time, - + #{deviceId}, #{shutType}, @@ -71,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{createTime}, #{updateBy}, #{updateTime}, - + @@ -94,7 +108,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from dms_record_shut_down where record_shut_down_id = #{recordShutDownId} + delete + from dms_record_shut_down + where record_shut_down_id = #{recordShutDownId} diff --git a/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java b/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java index 878be2c4..87c5d762 100644 --- a/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java +++ b/hw-modules/hw-job/src/main/java/com/hw/job/task/RyTask.java @@ -127,4 +127,10 @@ public class RyTask System.out.println("++定时同步成品出库信息给ERP++synchronizeProductOutstockInformationToERP"); remoteWmsService.synchronizeProductOutstockInformationToERP(days, SecurityConstants.INNER); } + + public void getDmsAlarmNotificationScheduledTask(){ + System.out.println("++设备报警通知定时任务++getDmsAlarmNotificationScheduledTask"); + remoteDmsService.getDmsAlarmNotificationScheduledTask(SecurityConstants.INNER); + } + } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/SysPointRouterController.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/SysPointRouterController.java index 86bb3053..13bd58a4 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/SysPointRouterController.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/controller/SysPointRouterController.java @@ -1,9 +1,9 @@ package com.hw.system.common.controller; import java.util.List; -import java.io.IOException; import javax.servlet.http.HttpServletResponse; +import com.hw.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController; import com.hw.common.log.annotation.Log; import com.hw.common.log.enums.BusinessType; import com.hw.common.security.annotation.RequiresPermissions; -import com.hw.system.common.domain.SysPointRouter; +import com.hw.system.api.domain.common.SysPointRouter; import com.hw.system.common.service.ISysPointRouterService; import com.hw.common.core.web.controller.BaseController; import com.hw.common.core.web.domain.AjaxResult; @@ -74,6 +74,7 @@ public class SysPointRouterController extends BaseController { @Log(title = "提示路由信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody SysPointRouter sysPointRouter) { + sysPointRouter.setCreateBy(SecurityUtils.getUsername()); return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter)); } @@ -84,6 +85,7 @@ public class SysPointRouterController extends BaseController { @Log(title = "提示路由信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysPointRouter sysPointRouter) { + sysPointRouter.setUpdateBy(SecurityUtils.getUsername()); return toAjax(sysPointRouterService.updateSysPointRouter(sysPointRouter)); } @@ -98,12 +100,13 @@ public class SysPointRouterController extends BaseController { } /** - * 通用存入提示路由信息 - * @param sysPointRouter + * 通用存入提示路由信息List + * @param sysPointRouterList * @return */ + @Log(title = "提示路由信息", businessType = BusinessType.INSERT) @PostMapping("/insertPointRouterInfo") - public AjaxResult insertPointRouterInfo(@RequestBody SysPointRouter sysPointRouter) { - return toAjax(sysPointRouterService.insertSysPointRouter(sysPointRouter)); + public AjaxResult insertPointRouterInfo(@RequestBody List sysPointRouterList) { + return toAjax(sysPointRouterService.insertSysPointRouterList(sysPointRouterList)); } } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/SysPointRouterMapper.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/SysPointRouterMapper.java index 3fe8f35d..1eb93f18 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/SysPointRouterMapper.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/mapper/SysPointRouterMapper.java @@ -1,7 +1,7 @@ package com.hw.system.common.mapper; import java.util.List; -import com.hw.system.common.domain.SysPointRouter; +import com.hw.system.api.domain.common.SysPointRouter; /** * 提示路由信息Mapper接口 diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/ISysPointRouterService.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/ISysPointRouterService.java index 5e162176..a7f70326 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/ISysPointRouterService.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/ISysPointRouterService.java @@ -1,7 +1,7 @@ package com.hw.system.common.service; import java.util.List; -import com.hw.system.common.domain.SysPointRouter; +import com.hw.system.api.domain.common.SysPointRouter; /** * 提示路由信息Service接口 @@ -58,4 +58,11 @@ public interface ISysPointRouterService * @return 结果 */ public int deleteSysPointRouterByPointRouterId(Long pointRouterId); + + /** + * 通用存入提示路由信息List + * @param sysPointRouterList + * @return + */ + public int insertSysPointRouterList(List sysPointRouterList); } diff --git a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/SysPointRouterServiceImpl.java b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/SysPointRouterServiceImpl.java index 9ff6e1df..31462a71 100644 --- a/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/SysPointRouterServiceImpl.java +++ b/hw-modules/hw-system/src/main/java/com/hw/system/common/service/impl/SysPointRouterServiceImpl.java @@ -1,16 +1,15 @@ package com.hw.system.common.service.impl; -import java.io.IOException; -import java.io.OutputStream; +import java.rmi.ServerException; import java.util.List; import com.hw.common.core.utils.DateUtils; -import com.hw.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.system.common.mapper.SysPointRouterMapper; -import com.hw.system.common.domain.SysPointRouter; +import com.hw.system.api.domain.common.SysPointRouter; import com.hw.system.common.service.ISysPointRouterService; +import org.springframework.transaction.annotation.Transactional; /** * 提示路由信息Service业务层处理 @@ -53,7 +52,6 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService { */ @Override public int insertSysPointRouter(SysPointRouter sysPointRouter) { - sysPointRouter.setCreateBy(SecurityUtils.getUsername()); sysPointRouter.setCreateTime(DateUtils.getNowDate()); return sysPointRouterMapper.insertSysPointRouter(sysPointRouter); } @@ -66,7 +64,6 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService { */ @Override public int updateSysPointRouter(SysPointRouter sysPointRouter) { - sysPointRouter.setUpdateBy(SecurityUtils.getUsername()); sysPointRouter.setUpdateTime(DateUtils.getNowDate()); return sysPointRouterMapper.updateSysPointRouter(sysPointRouter); } @@ -92,4 +89,19 @@ public class SysPointRouterServiceImpl implements ISysPointRouterService { public int deleteSysPointRouterByPointRouterId(Long pointRouterId) { return sysPointRouterMapper.deleteSysPointRouterByPointRouterId(pointRouterId); } + + /** + * 通用存入提示路由信息List + * @param sysPointRouterList + * @return + */ + @Override + @Transactional(rollbackFor = ServerException.class) + public int insertSysPointRouterList(List sysPointRouterList) { + for (SysPointRouter router : sysPointRouterList) { + this.insertSysPointRouter(router); + } + return 1; + } + } diff --git a/hw-modules/hw-system/src/main/resources/mapper/system/common/SysPointRouterMapper.xml b/hw-modules/hw-system/src/main/resources/mapper/system/common/SysPointRouterMapper.xml index 63091878..b2c52863 100644 --- a/hw-modules/hw-system/src/main/resources/mapper/system/common/SysPointRouterMapper.xml +++ b/hw-modules/hw-system/src/main/resources/mapper/system/common/SysPointRouterMapper.xml @@ -50,6 +50,7 @@ and update_time between #{params.beginupdateTime} and #{params.endupdateTime} + order by create_time desc