保洁订单详情
This commit is contained in:
parent
3ff380ab50
commit
147c67b5ad
7
pom.xml
7
pom.xml
@ -108,12 +108,15 @@
|
|||||||
<id>prod</id>
|
<id>prod</id>
|
||||||
<properties>
|
<properties>
|
||||||
<profiles.active>prod</profiles.active>
|
<profiles.active>prod</profiles.active>
|
||||||
<nacos.server>127.0.0.1:8848</nacos.server>
|
<!-- <nacos.server>127.0.0.1:8848</nacos.server>-->
|
||||||
|
<!-- <logstash.address>127.0.0.1:4560</logstash.address>-->
|
||||||
|
<nacos.server>47.109.37.87:8848</nacos.server>
|
||||||
|
<logstash.address>47.109.37.87:4560</logstash.address>
|
||||||
<nacos.discovery.group>DEFAULT_GROUP</nacos.discovery.group>
|
<nacos.discovery.group>DEFAULT_GROUP</nacos.discovery.group>
|
||||||
<nacos.config.group>DEFAULT_GROUP</nacos.config.group>
|
<nacos.config.group>DEFAULT_GROUP</nacos.config.group>
|
||||||
<nacos.username>nacos</nacos.username>
|
<nacos.username>nacos</nacos.username>
|
||||||
<nacos.password>nacos</nacos.password>
|
<nacos.password>nacos</nacos.password>
|
||||||
<logstash.address>127.0.0.1:4560</logstash.address>
|
<!-- <logstash.address>127.0.0.1:4560</logstash.address>-->
|
||||||
|
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
@ -2,6 +2,7 @@ package org.dromara.property.controller;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
@ -71,14 +71,14 @@ public class CleanOrder extends TenantEntity {
|
|||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime starTime;
|
private String starTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
|
||||||
private LocalDateTime endTime;
|
private String endTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位id
|
* 单位id
|
||||||
@ -120,7 +120,6 @@ public class CleanOrder extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private String searchValue;
|
private String searchValue;
|
||||||
|
|
||||||
// private List<Clean> cleanList;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -77,14 +77,14 @@ public class CleanOrderBo extends BaseEntity {
|
|||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "开始时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
@NotBlank(message = "开始时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private String starTime;
|
private String starTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "结束时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
@NotBlank(message = "结束时间不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package org.dromara.property.domain.vo;
|
package org.dromara.property.domain.vo;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import kotlin.text.UStringsKt;
|
import kotlin.text.UStringsKt;
|
||||||
|
import org.dromara.property.domain.Clean;
|
||||||
import org.dromara.property.domain.CleanOrder;
|
import org.dromara.property.domain.CleanOrder;
|
||||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
@ -49,11 +51,11 @@ public class CleanOrderVo implements Serializable {
|
|||||||
@ExcelProperty(value = "面积")
|
@ExcelProperty(value = "面积")
|
||||||
private Long area;
|
private Long area;
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 保洁id
|
// * 保洁id
|
||||||
*/
|
// */
|
||||||
@ExcelProperty(value = "保洁")
|
// @ExcelProperty(value = "保洁")
|
||||||
private List<String> clean;
|
// private List<String> clean;
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 名称
|
// * 名称
|
||||||
@ -84,13 +86,13 @@ public class CleanOrderVo implements Serializable {
|
|||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "开始时间")
|
@ExcelProperty(value = "开始时间")
|
||||||
private Date starTime;
|
private String starTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* 结束时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "结束时间")
|
@ExcelProperty(value = "结束时间")
|
||||||
private Date endTime;
|
private String endTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单位id
|
* 单位id
|
||||||
@ -122,5 +124,7 @@ public class CleanOrderVo implements Serializable {
|
|||||||
@ExcelProperty(value = "状态")
|
@ExcelProperty(value = "状态")
|
||||||
private int state;
|
private int state;
|
||||||
|
|
||||||
|
private List<Clean> cleanList;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package org.dromara.property.mapper;
|
package org.dromara.property.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
import org.dromara.property.domain.Clean;
|
import org.dromara.property.domain.Clean;
|
||||||
import org.dromara.property.domain.vo.CleanVo;
|
import org.dromara.property.domain.vo.CleanVo;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保洁管理Mapper接口
|
* 保洁管理Mapper接口
|
||||||
*
|
*
|
||||||
|
@ -16,5 +16,6 @@ public interface CleanOrderMapper extends BaseMapperPlus<CleanOrder, CleanOrderV
|
|||||||
|
|
||||||
Page<CleanOrderVo> selectForPage(Page<Object> build, LambdaQueryWrapper<CleanOrder> lqw);
|
Page<CleanOrderVo> selectForPage(Page<Object> build, LambdaQueryWrapper<CleanOrder> lqw);
|
||||||
|
|
||||||
// int insertCleanOrder(CleanOrder add);
|
// CleanOrderVo selectforDetail(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.property.service.impl;
|
package org.dromara.property.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.idev.excel.event.Order;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.Mapper;
|
import com.baomidou.mybatisplus.core.mapper.Mapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
@ -16,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.property.domain.Clean;
|
import org.dromara.property.domain.Clean;
|
||||||
import org.dromara.property.domain.CleanRelation;
|
import org.dromara.property.domain.CleanRelation;
|
||||||
import org.dromara.property.domain.CleanserverOrder;
|
import org.dromara.property.domain.CleanserverOrder;
|
||||||
|
import org.dromara.property.domain.vo.CleanserverOrderVo;
|
||||||
import org.dromara.property.mapper.CleanMapper;
|
import org.dromara.property.mapper.CleanMapper;
|
||||||
import org.dromara.property.mapper.CleanRelationMapper;
|
import org.dromara.property.mapper.CleanRelationMapper;
|
||||||
import org.dromara.property.mapper.CleanserverOrderMapper;
|
import org.dromara.property.mapper.CleanserverOrderMapper;
|
||||||
@ -61,7 +63,20 @@ public class CleanOrderServiceImpl implements ICleanOrderService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CleanOrderVo queryById(Long id) {
|
public CleanOrderVo queryById(Long id) {
|
||||||
return baseMapper.selectVoById(id);
|
//根据id查询出cleanserver_order表中的所有记录
|
||||||
|
LambdaQueryWrapper<CleanserverOrder> queryWrapper = Wrappers.<CleanserverOrder>lambdaQuery().eq(CleanserverOrder::getOrderId, id);
|
||||||
|
List<CleanserverOrder> cleanserverOrderList = cleanserverOrderMapper.selectList(queryWrapper);
|
||||||
|
//根据cleanserver_order表中的所有记录取出所有的cleanId查询出clean表中的所有记录
|
||||||
|
List<Long> cleanIds = cleanserverOrderList.stream().map(CleanserverOrder::getCleanServerId).collect(Collectors.toList());
|
||||||
|
List<Clean> cleanList = cleanMapper.selectBatchIds(cleanIds);
|
||||||
|
//根据cleanserver_order表中的所有记录取出所有的orderId查询出clean_order表中的所有记录
|
||||||
|
CleanOrder cleanOrder = baseMapper.selectById(id);
|
||||||
|
//将cleanserver_order表中的所有记录和clean表中的所有记录和clean_order表中的所有记录合并
|
||||||
|
CleanOrderVo cleanOrderVo = MapstructUtils.convert(cleanOrder, CleanOrderVo.class);
|
||||||
|
cleanOrderVo.setCleanList(cleanList);
|
||||||
|
return cleanOrderVo;
|
||||||
|
|
||||||
|
// return baseMapper.selectforDetail(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -73,6 +88,7 @@ public class CleanOrderServiceImpl implements ICleanOrderService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<CleanOrderVo> queryPageList(CleanOrderBo bo, PageQuery pageQuery) {
|
public TableDataInfo<CleanOrderVo> queryPageList(CleanOrderBo bo, PageQuery pageQuery) {
|
||||||
|
// 构造条件查询器,返回的是一个集合
|
||||||
LambdaQueryWrapper<CleanOrder> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<CleanOrder> lqw = buildQueryWrapper(bo);
|
||||||
Page<CleanOrderVo> result = baseMapper.selectForPage(pageQuery.build(), lqw);
|
Page<CleanOrderVo> result = baseMapper.selectForPage(pageQuery.build(), lqw);
|
||||||
return TableDataInfo.build(result);
|
return TableDataInfo.build(result);
|
||||||
@ -127,8 +143,8 @@ public class CleanOrderServiceImpl implements ICleanOrderService {
|
|||||||
CleanOrder add = new CleanOrder();
|
CleanOrder add = new CleanOrder();
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
BeanUtils.copyProperties(bo, add);
|
BeanUtils.copyProperties(bo, add);
|
||||||
add.setStarTime(new DateTime(bo.getStarTime()).toLocalDateTime());
|
add.setStarTime(String.valueOf(new DateTime(bo.getStarTime()).toLocalDateTime()));
|
||||||
add.setEndTime(new DateTime(bo.getEndTime()).toLocalDateTime());
|
add.setEndTime(String.valueOf(new DateTime(bo.getEndTime()).toLocalDateTime()));
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
|
||||||
//向clean表中插入数据
|
//向clean表中插入数据
|
||||||
|
@ -8,10 +8,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
SELECT
|
SELECT
|
||||||
co.*,
|
co.*,
|
||||||
c.*,
|
c.*,
|
||||||
ru.name name,ru.id
|
ru.name name,ru.id unitId
|
||||||
FROM
|
FROM
|
||||||
clean_order co
|
clean_order co
|
||||||
LEFT JOIN clean c ON co.clean_id = c.id
|
LEFT JOIN clean c ON co.clean_id = c.id
|
||||||
LEFT JOIN resident_unit ru ON co.unit_id = ru.id;
|
LEFT JOIN resident_unit ru ON co.unit_id = ru.id;
|
||||||
</select>
|
</select>
|
||||||
|
<!-- <select id="selectforDetail" resultType="org.dromara.property.domain.vo.CleanOrderVo"-->
|
||||||
|
<!-- parameterType="java.lang.Long">-->
|
||||||
|
<!-- SELECT co.*,cso.* from clean_order co-->
|
||||||
|
<!-- LEFT JOIN cleanserver_order cso on cso.clean_server_id = co.id-->
|
||||||
|
<!-- LEFT JOIN clean c on cso.id where co.id = #{id};-->
|
||||||
|
<!-- </select>-->
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user