提交相关代码
This commit is contained in:
parent
446a28ba71
commit
8741259196
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.zlpt.equip.api.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.zlpt.common.core.annotation.Excel;
|
||||
import com.bonus.zlpt.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
|
@ -113,4 +115,6 @@ public class DevInfo extends BaseEntity
|
|||
/** 是否删除 */
|
||||
@Excel(name = "是否删除")
|
||||
private String isActive;
|
||||
/**文件附件*/
|
||||
private List<SysFileInfo> fileList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,9 @@ public enum FileDictEnum {
|
|||
//检验信息
|
||||
INSPECT_IMAGE_URL(28),
|
||||
//保险信息
|
||||
INSURE_IMAGE_URL(29);
|
||||
INSURE_IMAGE_URL(29),
|
||||
|
||||
IMAGE_URL(20);
|
||||
|
||||
private final Integer value;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class DevInfoController extends BaseController
|
|||
/**
|
||||
* 查询设备信息列表
|
||||
*/
|
||||
@RequiresPermissions("equip:info:list")
|
||||
//@RequiresPermissions("equip:info:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody DevInfoVo devInfo)
|
||||
{
|
||||
|
|
@ -78,7 +78,7 @@ public class DevInfoController extends BaseController
|
|||
/**
|
||||
* 新增设备信息
|
||||
*/
|
||||
@RequiresPermissions("equip:info:add")
|
||||
//@RequiresPermissions("equip:info:add")
|
||||
@Log(title = "设备信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DevInfo devInfo)
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ public class TypeInfoController extends BaseController
|
|||
/**
|
||||
* 查询设备类型列表
|
||||
*/
|
||||
@RequiresPermissions("equip:info:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(TypeInfo typeInfo) {
|
||||
//@RequiresPermissions("equip:info:list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody TypeInfo typeInfo) {
|
||||
startPage();
|
||||
List<TypeInfo> list = typeInfoService.selectTypeInfoList(typeInfo);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.zlpt.equip.mapper;
|
|||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
import com.bonus.zlpt.common.core.domain.system.SysFile;
|
||||
import com.bonus.zlpt.equip.api.domain.DevInfo;
|
||||
import com.bonus.zlpt.equip.api.domain.dto.InforMationDto;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.bonus.zlpt.equip.mapper;
|
||||
|
||||
|
||||
|
||||
import com.bonus.zlpt.equip.api.domain.SysFileInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
@ -11,4 +13,6 @@ public interface SysFileInfoMapper {
|
|||
|
||||
//根据设备id查询
|
||||
List<SysFileInfo> selectByMaId(Long maId);
|
||||
|
||||
void insertFileInfo(SysFileInfo fileInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,5 +64,5 @@ public interface TypeInfoMapper
|
|||
int selectCountByTypeId(Long typeId);
|
||||
|
||||
|
||||
|
||||
List<TypeInfo> selectTypeList(TypeInfo typeInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,15 @@ import java.util.stream.Collectors;
|
|||
|
||||
|
||||
import com.bonus.zlpt.equip.api.domain.DevInfo;
|
||||
import com.bonus.zlpt.equip.api.domain.SysFileInfo;
|
||||
import com.bonus.zlpt.equip.api.domain.dto.InforMationDto;
|
||||
import com.bonus.zlpt.equip.api.domain.vo.DevInfoVo;
|
||||
|
||||
import com.bonus.zlpt.common.core.domain.system.SysFile;
|
||||
import com.bonus.zlpt.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import com.bonus.zlpt.equip.mapper.SysFileInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.zlpt.equip.mapper.DevInfoMapper;
|
||||
import com.bonus.zlpt.equip.service.IDevInfoService;
|
||||
|
|
@ -34,6 +37,10 @@ public class DevInfoServiceImpl implements IDevInfoService
|
|||
@Resource
|
||||
private DevInfoMapper devInfoMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private SysFileInfoMapper sysFileInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询设备信息
|
||||
*
|
||||
|
|
@ -97,6 +104,13 @@ public class DevInfoServiceImpl implements IDevInfoService
|
|||
public int insertDevInfo(DevInfo devInfo)
|
||||
{
|
||||
devInfo.setCreateTime(DateUtils.getNowDate());
|
||||
//把文件保存到附件中
|
||||
List<SysFileInfo> fileInfoList = devInfo.getFileList();
|
||||
if (fileInfoList.size()>0){
|
||||
for (SysFileInfo sysFileInfo: fileInfoList) {
|
||||
sysFileInfoMapper.insertFileInfo(sysFileInfo);
|
||||
}
|
||||
}
|
||||
return devInfoMapper.insertDevInfo(devInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import org.springframework.stereotype.Service;
|
|||
import com.bonus.zlpt.equip.mapper.TypeInfoRecordMapper;
|
||||
import com.bonus.zlpt.equip.service.ITypeInfoRecordService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 设备类型Service业务层处理
|
||||
*
|
||||
|
|
@ -18,7 +20,7 @@ import com.bonus.zlpt.equip.service.ITypeInfoRecordService;
|
|||
@Service
|
||||
public class TypeInfoRecordServiceImpl implements ITypeInfoRecordService
|
||||
{
|
||||
@Autowired
|
||||
@Resource
|
||||
private TypeInfoRecordMapper typeInfoRecordMapper;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
|
|||
import com.bonus.zlpt.equip.mapper.TypeInfoMapper;
|
||||
import com.bonus.zlpt.equip.service.ITypeInfoService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
|
|
@ -24,7 +25,7 @@ import javax.validation.constraints.NotNull;
|
|||
@Service
|
||||
public class TypeInfoServiceImpl implements ITypeInfoService
|
||||
{
|
||||
@Autowired
|
||||
@Resource
|
||||
private TypeInfoMapper typeInfoMapper;
|
||||
|
||||
/**
|
||||
|
|
@ -48,7 +49,11 @@ public class TypeInfoServiceImpl implements ITypeInfoService
|
|||
@Override
|
||||
public List<TypeInfo> selectTypeInfoList(TypeInfo typeInfo)
|
||||
{
|
||||
return typeInfoMapper.selectTypeInfoList(typeInfo);
|
||||
if (typeInfo == null || typeInfo.getTypeId()==null){
|
||||
typeInfo = new TypeInfo();
|
||||
typeInfo.setTypeId(0L);
|
||||
}
|
||||
return typeInfoMapper.selectTypeList(typeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,4 +8,22 @@
|
|||
<select id="selectByMaId" resultType="com.bonus.zlpt.equip.api.domain.SysFileInfo">
|
||||
select * from sys_file_info where model_id = #{maId}
|
||||
</select>
|
||||
<insert id="insertFileInfo" parameterType="com.bonus.zlpt.equip.api.domain.SysFileInfo">
|
||||
insert into sys_file_info (
|
||||
<if test="modelId != null">model_id,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="fileUrl != null">file_url,</if>
|
||||
<if test="dicId != null">dic_id,</if>
|
||||
<if test="creator != null">creator,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="modelId != null">#{modelId},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="fileUrl != null">#{fileUrl},</if>
|
||||
<if test="dicId != null">#{dicId},</if>
|
||||
<if test="creator != null">#{creator},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -96,4 +96,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{typeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectTypeList" resultType="com.bonus.zlpt.equip.api.domain.TypeInfo">
|
||||
select * from ma_type_info where parent_id = #{typeId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package com.bonus.zlpt.home.mapper;
|
||||
|
||||
import com.bonus.zlpt.common.core.domain.equip.TypeInfo;
|
||||
|
||||
import com.bonus.zlpt.equip.api.domain.TypeInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface MaTypeInfoMapper {
|
||||
public List<TypeInfo> getMaTypeInfoList() ;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.zlpt.home.service;
|
||||
|
||||
import cn.hutool.core.lang.tree.Tree;
|
||||
import com.bonus.zlpt.common.core.domain.equip.TypeInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.bonus.zlpt.home.service.impl;
|
|||
import cn.hutool.core.lang.tree.Tree;
|
||||
import cn.hutool.core.lang.tree.TreeNode;
|
||||
import cn.hutool.core.lang.tree.TreeUtil;
|
||||
import com.bonus.zlpt.common.core.domain.equip.TypeInfo;
|
||||
import com.bonus.zlpt.equip.api.domain.TypeInfo;
|
||||
import com.bonus.zlpt.home.mapper.MaTypeInfoMapper;
|
||||
import com.bonus.zlpt.home.service.MaTypeInfoSevice;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
|||
Loading…
Reference in New Issue