From be435a5b8fb4017b76a6211e0e456167a5439157 Mon Sep 17 00:00:00 2001 From: 15856 <15856818120@163.com> Date: Mon, 9 Sep 2024 09:25:17 +0800 Subject: [PATCH 01/10] =?UTF-8?q?sonaer=E5=BC=82=E5=91=B3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sgzb/common/core/constant/UserConstants.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/UserConstants.java b/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/UserConstants.java index e302651..3974e39 100644 --- a/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/UserConstants.java +++ b/sgzb-common/sgzb-common-core/src/main/java/com/bonus/sgzb/common/core/constant/UserConstants.java @@ -7,6 +7,10 @@ package com.bonus.sgzb.common.core.constant; */ public class UserConstants { + + private UserConstants() { + throw new IllegalStateException("UserConstants class"); + } /** * 平台内系统用户的唯一标志 */ @@ -52,17 +56,17 @@ public class UserConstants public static final String TYPE_BUTTON = "F"; /** Layout组件标识 */ - public final static String LAYOUT = "Layout"; + public static final String LAYOUT = "Layout"; /** ParentView组件标识 */ - public final static String PARENT_VIEW = "ParentView"; + public static final String PARENT_VIEW = "ParentView"; /** InnerLink组件标识 */ - public final static String INNER_LINK = "InnerLink"; + public static final String INNER_LINK = "InnerLink"; /** 校验是否唯一的返回标识 */ - public final static boolean UNIQUE = true; - public final static boolean NOT_UNIQUE = false; + public static final boolean UNIQUE = true; + public static final boolean NOT_UNIQUE = false; /** * 用户名长度限制 From 821254a944c009dbfd7474f6a244f30d72df41ed Mon Sep 17 00:00:00 2001 From: 15856 <15856818120@163.com> Date: Tue, 10 Sep 2024 10:17:35 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=99=BA=E6=85=A7?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E4=BB=A3=E7=A0=81=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/impl/TmTaskServiceImpl.java | 13 ++++++++- .../sgzb/material/domain/LeaseRecord.java | 8 +++++ .../material/mapper/LeaseRecordMapper.java | 2 ++ .../service/impl/LeaseRecordServiceImpl.java | 29 +++++++++++++++++-- .../resources/mapper/app/TmTaskMapper.xml | 2 +- .../mapper/material/LeaseRecordMapper.xml | 12 ++++++-- 6 files changed, 59 insertions(+), 7 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java index fddf7cd..0da6bf4 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java @@ -21,7 +21,9 @@ import com.bonus.sgzb.common.core.utils.StringUtils; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.security.utils.GetTokenByAppKey; import com.bonus.sgzb.common.security.utils.SecurityUtils; +import com.bonus.sgzb.material.domain.LeaseRecord; import com.bonus.sgzb.material.exception.ExceptionDict; +import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.system.api.model.LoginUser; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -86,6 +88,9 @@ public class TmTaskServiceImpl implements TmTaskService { private final static String STRING_ADMIN = "admin"; + @Resource + private LeaseRecordMapper leaseRecordMapper; + /** * 领料任务审核状态 * @@ -1390,7 +1395,13 @@ public class TmTaskServiceImpl implements TmTaskService { } catch (Exception e) { return AjaxResult.error("请求失败!{}", e.getMessage()); } - //TODO 更改pushStatus + log.info("推送成功!修改状态"); + //更改推送的状态 + for (TmTask tmTask:tmTasks) { + LeaseRecord leaseRecord = new LeaseRecord(); + leaseRecord.setId(Integer.valueOf(tmTask.getId())); + leaseRecordMapper.updateLeaseRecord(leaseRecord); + } return AjaxResult.success("请求成功!"); } return AjaxResult.success("请求成功!"); diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java index e04d14a..505b3f0 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/LeaseRecord.java @@ -179,4 +179,12 @@ public class LeaseRecord{ @ApiModelProperty(value = "实时库存") private Integer num; + @ApiModelProperty(value = "绑定IOT设备数量") + private Integer IotNum; + + @ApiModelProperty(value = "Iot定位设备编号") + private String iotCode; + + @ApiModelProperty(value = "是否推送到智慧工程0:否,1:是") + private Integer pushNotifications; } \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java index 6390fa9..1a29a1d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/LeaseRecordMapper.java @@ -35,4 +35,6 @@ public interface LeaseRecordMapper { MaType getMaType(Integer typeId); int insSltInfo(@Param("record") LeaseOutDetails record, @Param("agreementId")String agreementId,@Param("ma") MaType ma); + + void updateLeaseRecord(LeaseRecord leaseRecord); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java index 6cf8317..92c0650 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/LeaseRecordServiceImpl.java @@ -1,11 +1,16 @@ package com.bonus.sgzb.material.service.impl; +import com.bonus.sgzb.base.api.domain.MaMachine; +import com.bonus.sgzb.base.domain.vo.IotRecordVo; +import com.bonus.sgzb.base.mapper.BaseIotMachineMapper; import com.bonus.sgzb.material.domain.LeaseRecord; import com.bonus.sgzb.material.mapper.LeaseRecordMapper; import com.bonus.sgzb.material.service.LeaseRecordService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.List; /** @@ -15,12 +20,30 @@ import java.util.List; @Service public class LeaseRecordServiceImpl implements LeaseRecordService { - @Autowired + @Resource private LeaseRecordMapper leaseRecordMapper; - + @Resource + private BaseIotMachineMapper baseIotMachineMapper; @Override public List getLeaseRecordList(LeaseRecord bean) { - return leaseRecordMapper.getLeaseRecordList(bean); + List listMaMachine =leaseRecordMapper.getLeaseRecordList(bean); + if (listMaMachine.size() > 0){ + for (LeaseRecord leaseRecord : listMaMachine) { + //根据机具编码查询iot设备 + List iotRecordVoList = baseIotMachineMapper.selectList(leaseRecord.getMaCode()); + leaseRecord.setIotNum(iotRecordVoList.size()); + //判断是否绑定了iot设备 + if (iotRecordVoList.size()>0){ + for (int i = 0; i < iotRecordVoList.size(); i++) { + //保存定位iot设备编码 + if ("125".equals(iotRecordVoList.get(i).getIotType())){ + leaseRecord.setIotCode(iotRecordVoList.get(i).getIotCode()); + } + } + } + } + } + return listMaMachine; } } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml index e442ce3..9ba4a13 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/app/TmTaskMapper.xml @@ -1191,6 +1191,6 @@ left join ma_type mt1 on mt.parent_id = mt1.type_id left join ma_type mt2 on mt1.parent_id = mt2.type_id left join ma_type mt3 on mt2.parent_id = mt3.type_id - where lod.parent_id = #{id} + where lod.id = #{id} diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml index 35886d6..d4e47eb 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/LeaseRecordMapper.xml @@ -12,18 +12,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" set num = #{num} where id = #{id} + + update lease_out_details + set push_notifications = 1 + where id = #{id} +