diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java index 051d365..38bc931 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java @@ -208,4 +208,10 @@ public class MaType extends BaseEntity { */ @ApiModelProperty(value = "厂家规格型号") private String facModel; + + /* + * 推送智慧工程定义的门类分类机具编码 + * */ + @ApiModelProperty(value = "推送智慧工程定义的门类分类机具编码") + private String intelligentCode; } 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; /** * 用户名长度限制 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/base/service/impl/MaTypeServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java index 45142d0..b8382cc 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/base/service/impl/MaTypeServiceImpl.java @@ -61,6 +61,7 @@ public class MaTypeServiceImpl implements ITypeService { String level = maType1.getLevel(); maType.setLevel(String.valueOf(Integer.parseInt(level) + 1)); maType.setCreateTime(DateUtils.getNowDate()); + System.out.println(maType); int i = maTypeMapper.insertType(maType); Long typeId = maType.getTypeId(); // 图片路径保存 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/bootstrap.yml b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml index 34dca85..887ac88 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml +++ b/sgzb-modules/sgzb-material/src/main/resources/bootstrap.yml @@ -1,8 +1,8 @@ # Spring -spring: +spring: application: # 应用名称 name: sgzb-material profiles: # 环境配置 - active: sgzb_cq_local \ No newline at end of file + active: sgzb_cq_local 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/base/MaMachineTypeMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineTypeMapper.xml index 70f5220..a40302b 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineTypeMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/base/MaMachineTypeMapper.xml @@ -33,10 +33,11 @@ + - select type_id, type_name, parent_id, status, num, company_id, code, unit_id, unit_name, manage_type, lease_price, eff_time, rent_price, buy_price, pay_price, level, rated_load, test_load, holding_time, warn_num, del_flag, create_by, create_time, update_by, update_time, is_plan, is_ancuo, remark from ma_type + select type_id, type_name, parent_id, status, num, company_id, code, unit_id, unit_name, manage_type, lease_price, eff_time, rent_price, buy_price, pay_price, level, rated_load, test_load, holding_time, warn_num, del_flag, create_by, create_time, update_by, update_time, is_plan, is_ancuo, remark,intelligent_code ,fac_model, child_photo from ma_type @@ -70,6 +71,7 @@ is_ancuo, remark, fac_model, + intelligent_code, #{typeName}, @@ -100,6 +102,7 @@ #{isAncuo}, #{remark}, #{facModel}, + #{intelligentCode}, @@ -157,6 +160,7 @@ remark = #{remark}, company_id = #{companyId}, fac_model = #{facModel}, + intelligent_code = #{intelligentCode}, where type_id = #{typeId} @@ -283,7 +287,7 @@ mtf2.file_name documentName, mtf2.file_url documentUrl, mtk.user_id keeperUserId, su.nick_name keeperUserName, mtr.user_id repairUserId, su1.nick_name repairUserName,mpi.prop_id as propId, mpi.prop_name as propName, m.del_flag, m.create_by, m.create_time, - m.remark, m.company_id,m.fac_model as facModel + m.remark, m.company_id,m.fac_model as facModel,m.intelligent_code from ma_type m left join ma_prop_set mps on m.type_id = mps.type_id left join ma_prop_info mpi on mps.prop_id = mpi.prop_id @@ -338,7 +342,7 @@ m.holding_time, m.warn_num, mtf.file_name photoName, mtf.file_url photoUrl, mtf2.file_name documentName, mtf2.file_url documentUrl, mtk.user_id keeperUserId, su.nick_name keeperUserName, mpi.prop_name, m.del_flag, m.create_by, m.create_time, - m.remark, m.company_id,m.fac_model as facModel + m.remark, m.company_id,m.fac_model as facModel,m.intelligent_code from ma_type m left join ma_prop_set mps on m.type_id = mps.type_id left join ma_prop_info mpi on mps.prop_id = mpi.prop_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} +