Merge remote-tracking branch 'origin/master'

This commit is contained in:
liang.chao 2024-09-11 15:58:28 +08:00
commit 76fd0dd25a
11 changed files with 84 additions and 17 deletions

View File

@ -208,4 +208,10 @@ public class MaType extends BaseEntity {
*/
@ApiModelProperty(value = "厂家规格型号")
private String facModel;
/*
* 推送智慧工程定义的门类分类机具编码
* */
@ApiModelProperty(value = "推送智慧工程定义的门类分类机具编码")
private String intelligentCode;
}

View File

@ -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;
/**
* 用户名长度限制

View File

@ -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("请求成功!");

View File

@ -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();
// 图片路径保存

View File

@ -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 = "是否推送到智慧工程01:是")
private Integer pushNotifications;
}

View File

@ -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);
}

View File

@ -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<LeaseRecord> getLeaseRecordList(LeaseRecord bean) {
return leaseRecordMapper.getLeaseRecordList(bean);
List<LeaseRecord> listMaMachine =leaseRecordMapper.getLeaseRecordList(bean);
if (listMaMachine.size() > 0){
for (LeaseRecord leaseRecord : listMaMachine) {
//根据机具编码查询iot设备
List<IotRecordVo> 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;
}
}

View File

@ -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}
</select>
</mapper>

View File

@ -33,10 +33,11 @@
<result property="isAncuo" column="is_ancuo" />
<result property="remark" column="remark" />
<result property="childPhoto" column="childPhoto" />
<result property="intelligentCode" column="intelligent_code" />
</resultMap>
<sql id="selectMaTypeVo">
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
</sql>
<insert id="insertType" parameterType="com.bonus.sgzb.base.api.domain.MaType" useGeneratedKeys="true" keyProperty="typeId">
@ -70,6 +71,7 @@
<if test="isAncuo != null">is_ancuo,</if>
<if test="remark != null">remark,</if>
<if test="facModel != null">fac_model,</if>
<if test="intelligentCode != null">intelligent_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeName != null and typeName != ''">#{typeName},</if>
@ -100,6 +102,7 @@
<if test="isAncuo != null">#{isAncuo},</if>
<if test="remark != null">#{remark},</if>
<if test="facModel != null">#{facModel},</if>
<if test="intelligentCode != null">#{intelligentCode},</if>
</trim>
</insert>
@ -157,6 +160,7 @@
<if test="remark != null">remark = #{remark},</if>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="facModel != null">fac_model = #{facModel},</if>
<if test="intelligentCode != null">intelligent_code = #{intelligentCode},</if>
</trim>
where type_id = #{typeId}
</update>
@ -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

View File

@ -12,18 +12,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
set num = #{num}
where id = #{id}
</update>
<update id="updateLeaseRecord">
update lease_out_details
set push_notifications = 1
where id = #{id}
</update>
<select id="getLeaseRecordList" resultType="com.bonus.sgzb.material.domain.LeaseRecord">
SELECT mt2.type_name as typeName,
SELECT lod.id as id,
mt2.type_name as typeName,
mt.type_name as typeModelName,
bai.agreement_code as agreementCode,
mm.ma_code as maCode,
mt.unit_name as unit,
mt.manage_type as manageType,
lod.out_num as preNum,
lai.lease_person as leasePerson,
lod.create_time as createTime,
bpl.lot_name as proName,
bui.unit_name as unitName
bui.unit_name as unitName,
lod.push_notifications as pushNotifications
FROM lease_out_details lod
LEFT JOIN lease_apply_info lai on lai.id = lod.parent_id
LEFT JOIN tm_task_agreement tta on tta.task_id = lai.task_id