代码提交

This commit is contained in:
liang.chao 2025-11-13 16:44:37 +08:00
parent 1b17a81eeb
commit 099f9af785
13 changed files with 58 additions and 32 deletions

View File

@ -26,6 +26,7 @@ public class DeviceController extends BaseController {
@Autowired
private DeviceService deviceService;
@PreAuthorize("@ss.hasPermi('device:list')")
@GetMapping("/list")
public TableDataInfo list(DeviceDto dto) {
@ -33,11 +34,13 @@ public class DeviceController extends BaseController {
List<DeviceDto> list = deviceService.list(dto);
return getDataTable(list);
}
@GetMapping("/getDeviceType")
public AjaxResult getDeviceType() {
List<SelectDto> list = deviceService.getDeviceType();
return AjaxResult.success(list);
}
@GetMapping("/getDeviceKeepUser")
public AjaxResult getDeviceKeepUser() {
List<SelectDto> list = deviceService.getDeviceKeepUser();
@ -49,16 +52,19 @@ public class DeviceController extends BaseController {
public AjaxResult add(@RequestBody DeviceDto dto) {
return deviceService.add(dto);
}
@PreAuthorize("@ss.hasPermi('device:update')")
@PostMapping("/update")
public AjaxResult update(@RequestBody DeviceDto dto) {
return deviceService.update(dto);
}
@PreAuthorize("@ss.hasPermi('device:del')")
@PostMapping("/del")
public AjaxResult del(@RequestBody DeviceDto dto) {
return deviceService.delete(dto);
}
@PreAuthorize("@ss.hasPermi('device:detail')")
@GetMapping("/getById")
public AjaxResult getById(String id) {
@ -73,6 +79,7 @@ public class DeviceController extends BaseController {
public AjaxResult use(@RequestBody DeviceRecord dto) {
return deviceService.use(dto);
}
/**
* 归还
*/
@ -85,12 +92,20 @@ public class DeviceController extends BaseController {
// 领用状态下 查询最后一次领用人和领用日期
@GetMapping("/getLastUse")
public AjaxResult getLastUse(DeviceRecord dto) {
return AjaxResult.success(deviceService.getLastUse(dto));
DeviceRecord lastUse = deviceService.getLastUse(dto);
if (lastUse == null) {
return AjaxResult.success(new DeviceRecord());
} else {
return AjaxResult.success(lastUse);
}
}
// 领用记录
@GetMapping("/getRecordList")
public AjaxResult getRecordList() {
return AjaxResult.success(deviceService.getRecordList());
@PreAuthorize("@ss.hasPermi('device:details')")
public TableDataInfo getRecordList(DeviceRecord dto) {
startPage();
List<DeviceRecord> recordList = deviceService.getRecordList(dto);
return getDataTable(recordList);
}
}

View File

@ -36,11 +36,15 @@ public class ProjectController extends BaseController {
// @PreAuthorize("@ss.hasPermi('project:list')")
@GetMapping("/list")
public TableDataInfo list(Project project) {
startPage();
project.setCreateBy(getUserId().toString());
List<Project> list = projectService.selectProjectList(project);
return getDataTable(list);
}
// 首页
@GetMapping("/listMain")
public AjaxResult listMain(Project project) {
List<Project> list = projectService.selectProjectList(project);
return AjaxResult.success(list);
}
@GetMapping("/listApp")
public AjaxResult listApp(Project project) {
// project.setCreateBy(getUserId().toString());

View File

@ -12,6 +12,7 @@ public class DeviceRecord {
private String deviceId;
private String deviceType;
private String deviceTypeName;
private String deviceCode;
private String userId;
private String userName;
private String startTime;

View File

@ -44,7 +44,7 @@ public class Model {
/**
* 设计人员
*/
private int designer;
private String designer;
/**
* 设计人员姓名

View File

@ -38,6 +38,7 @@ public class Project extends BaseEntity
/** 所属单位 */
// @Excel(name = "所属单位")
private String unit;
private Integer unitId;
/** 负责人 */
@Excel(name = "负责人")

View File

@ -16,6 +16,8 @@ public class ProjectVo {
private String proLocation;
private String lon;
private String lat;
private String version;
private String designer;
private String remark;
private String level ="1"; // 设置默认值;
private String levelName;

View File

@ -23,7 +23,7 @@ public interface DeviceMapper {
DeviceRecord getLastUse(DeviceRecord dto);
List<DeviceRecord> getRecordList();
List<DeviceRecord> getRecordList(DeviceRecord dto);
int getCount(DeviceDto model);

View File

@ -26,7 +26,7 @@ public interface DeviceService {
DeviceRecord getLastUse(DeviceRecord dto);
List<DeviceRecord> getRecordList();
List<DeviceRecord> getRecordList(DeviceRecord dto);
List<SelectDto> getDeviceKeepUser();
}

View File

@ -103,8 +103,8 @@ public class DeviceServiceImpl implements DeviceService {
}
@Override
public List<DeviceRecord> getRecordList() {
return deviceMapper.getRecordList();
public List<DeviceRecord> getRecordList(DeviceRecord dto) {
return deviceMapper.getRecordList(dto);
}
@Override

View File

@ -105,9 +105,10 @@
su.nick_name as userName,
tdr.start_time as startTime,
tdr.end_time as endTime,
tdr.status as status,
td.status as status,
td.device_code as deviceCode,
td.device_type as deviceType,
sd.dict_label as deviceTypeName
sd.type_name as deviceTypeName
from tb_device_record tdr
left join tb_device td on tdr.device_id = td.id

View File

@ -83,6 +83,9 @@
<result property="nodeCountDetail" column="node_count_detail"/>
<result property="nodeCount" column="node_count"/>
<result property="nodeName" column="node_name"/>
<result property="version" column="version"/>
<result property="designer" column="designer"/>
<result property="remark" column="remark"/>
<result property="nodeId" column="node_id"/>
<result property="modelUrl" column="model_url"/>
<!-- 子表节点信息 -->
@ -118,7 +121,10 @@
n.node_name,
n.level AS node_level,
n.node_count AS node_count_detail,
m.model_url
m.model_url,
m.version,
m.designer,
m.remark
FROM project_node n
LEFT JOIN tb_project p ON p.id = n.project_id AND n.del_flag = '0'
@ -137,6 +143,9 @@
<if test="projectId != null and projectId != ''">
AND p.id = #{projectId}
</if>
<if test="designer != null and designer != ''">
AND m.designer like concat('%',#{designer},'%')
</if>
order by n.create_time
</select>
<select id="openView" resultType="com.bonus.waterdesign.domain.CadData">

View File

@ -8,25 +8,13 @@
</insert>
<update id="update">
UPDATE tb_owner
<set>
<if test="unitName != null and unitName != ''">
unit_name = #{unitName},
</if>
<if test="unitMan != null and unitMan != ''">
unit_man = #{unitMan},
</if>
<if test="phone != null and phone != ''">
phone = #{phone},
</if>
<if test="address != null and address != ''">
address = #{address},
</if>
<if test="remark != null and remark != ''">
remark = #{remark},
</if>
</set>
WHERE id = #{id}
update tb_owner
set unit_name = #{unitName},
unit_man = #{unitMan},
phone = #{phone},
address = #{address},
remark = #{remark}
where id = #{id}
</update>
<delete id="deleteById">

View File

@ -8,6 +8,7 @@
<id property="proId" column="id" />
<result property="proName" column="pro_name" />
<result property="proType" column="pro_type" />
<result property="unitId" column="unit_id" />
<result property="unit" column="unit_name" />
<result property="chargePerson" column="user_name" />
<result property="location" column="pro_location" />
@ -27,6 +28,7 @@
tp.id,
tp.pro_name,
sdd.type_name as pro_type,
oo.id as unit_id,
oo.unit_name,
tp.user_name,
tp.pro_location,
@ -52,6 +54,9 @@
<if test="proName != null and proName != ''">
AND pro_name like concat('%', #{proName}, '%')
</if>
<if test="proId != null">
AND tp.id = #{proId}
</if>
<if test="unit != null and unit != ''">
AND unit_id = #{unit}
</if>