大屏优化
This commit is contained in:
parent
252136cfeb
commit
6ed92f3bf9
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.bonus.material.device.domain;
|
||||||
|
|
||||||
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备信息对象 ma_dev_info
|
||||||
|
*
|
||||||
|
* @author syruan
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class DevInfoDt {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 429270031714225761L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "装备名称")
|
||||||
|
@Excel(name = "装备名称")
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "装备类目")
|
||||||
|
@Excel(name = "装备类目")
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "装备单位")
|
||||||
|
@Excel(name = "装备单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
/** 设备品牌 */
|
||||||
|
@Excel(name = "装备品牌")
|
||||||
|
@ApiModelProperty(value = "设备品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/** 出厂日期 */
|
||||||
|
@Excel(name = "出厂日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
@ApiModelProperty(value = "出厂日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date productionDate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "联系人")
|
||||||
|
@Excel(name = "联系人")
|
||||||
|
private String person;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "联系人电话")
|
||||||
|
@Excel(name = "联系人电话")
|
||||||
|
private String personPhone;
|
||||||
|
|
||||||
|
@Excel(name = "上架数量")
|
||||||
|
@ApiModelProperty(value = "设备数量")
|
||||||
|
private Integer deviceCount;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "录入人")
|
||||||
|
@Excel(name = "录入人")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "录入时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
@DateTimeFormat(pattern = "yyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "录入时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@Excel(name = "所属公司")
|
||||||
|
@ApiModelProperty(value = "所属公司")
|
||||||
|
private String comName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,9 +4,11 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.bonus.common.biz.domain.SysDept;
|
import com.bonus.common.biz.domain.SysDept;
|
||||||
import com.bonus.common.biz.utils.MathUtil;
|
import com.bonus.common.biz.utils.MathUtil;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.device.domain.DevInfo;
|
import com.bonus.material.device.domain.DevInfo;
|
||||||
|
import com.bonus.material.device.domain.DevInfoDt;
|
||||||
import com.bonus.material.device.domain.vo.DevInfoVo;
|
import com.bonus.material.device.domain.vo.DevInfoVo;
|
||||||
import com.bonus.material.device.mapper.DevInfoMapper;
|
import com.bonus.material.device.mapper.DevInfoMapper;
|
||||||
import com.bonus.material.device.service.DevInfoService;
|
import com.bonus.material.device.service.DevInfoService;
|
||||||
|
|
@ -22,11 +24,10 @@ import com.bonus.material.order.service.OrderService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
|
@ -580,4 +581,43 @@ public class LargeScreenController extends BaseController {
|
||||||
List<MaDevRateInfo> list = leaseInfoMapper.getReturnDev(dto);
|
List<MaDevRateInfo> list = leaseInfoMapper.getReturnDev(dto);
|
||||||
return AjaxResult.success(getDataTable(list));
|
return AjaxResult.success(getDataTable(list));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按公司纬度获取设备入驻数
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("按公司纬度获取设备入驻数")
|
||||||
|
@GetMapping("/getDevNumList")
|
||||||
|
public AjaxResult getDevNumList(DevInfo dto) {
|
||||||
|
startPage();
|
||||||
|
List<DevInfo> list = leaseInfoMapper.getDevNumList(dto);
|
||||||
|
return AjaxResult.success(getDataTable(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入驻设备明细
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("入驻设备明细")
|
||||||
|
@GetMapping("/getDevNumDetailsList")
|
||||||
|
public AjaxResult getDevNumDetailsList(DevInfo dto) {
|
||||||
|
startPage();
|
||||||
|
List<DevInfoDt> list = leaseInfoMapper.getDevNumDetailsList(dto);
|
||||||
|
return AjaxResult.success(getDataTable(list));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出入驻设备明细
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("导出入驻设备明细")
|
||||||
|
@PostMapping("/exportDevNumDetailsList")
|
||||||
|
public void exportDevNumDetailsList(HttpServletResponse response, @RequestBody DevInfo dto) {
|
||||||
|
List<DevInfoDt> list = leaseInfoMapper.getDevNumDetailsList(dto);
|
||||||
|
ExcelUtil<DevInfoDt> util = new ExcelUtil<>(DevInfoDt.class);
|
||||||
|
util.exportExcel(response, list, "入驻设备明细数据");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.bonus.material.lease.mapper;
|
package com.bonus.material.lease.mapper;
|
||||||
|
|
||||||
|
import com.bonus.material.device.domain.DevInfo;
|
||||||
|
import com.bonus.material.device.domain.DevInfoDt;
|
||||||
import com.bonus.material.largeScreen.entity.MaDevRateInfo;
|
import com.bonus.material.largeScreen.entity.MaDevRateInfo;
|
||||||
import com.bonus.material.largeScreen.entity.MaLeaseAnswerInfo;
|
import com.bonus.material.largeScreen.entity.MaLeaseAnswerInfo;
|
||||||
import com.bonus.material.largeScreen.entity.MaLeaseOnlyInfo;
|
import com.bonus.material.largeScreen.entity.MaLeaseOnlyInfo;
|
||||||
|
|
@ -185,4 +187,18 @@ public interface MaLeaseInfoMapper {
|
||||||
List<MaDevRateInfo> getReturnDev(MaDevRateInfo dto);
|
List<MaDevRateInfo> getReturnDev(MaDevRateInfo dto);
|
||||||
|
|
||||||
Integer getDemandUnit();
|
Integer getDemandUnit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取设备入驻数
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DevInfo> getDevNumList(DevInfo dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入驻设备明细
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DevInfoDt> getDevNumDetailsList( DevInfo dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -686,4 +686,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="getDemandUnit" resultType="java.lang.Integer">
|
<select id="getDemandUnit" resultType="java.lang.Integer">
|
||||||
SELECT COUNT(DISTINCT publish_company) FROM ma_lease_info
|
SELECT COUNT(DISTINCT publish_company) FROM ma_lease_info
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDevNumList" resultType="com.bonus.material.device.domain.DevInfo">
|
||||||
|
SELECT
|
||||||
|
mdi.own_co AS ownCo,
|
||||||
|
sd.dept_name AS comName,
|
||||||
|
count( mdi.device_count ) AS deviceCount
|
||||||
|
FROM
|
||||||
|
ma_dev_info mdi
|
||||||
|
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||||
|
WHERE
|
||||||
|
mdi.is_active = '1'
|
||||||
|
AND mdi.ma_status IN ( 1, 2, 3 )
|
||||||
|
GROUP BY
|
||||||
|
mdi.own_co
|
||||||
|
ORDER BY
|
||||||
|
deviceCount DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDevNumDetailsList" resultType="com.bonus.material.device.domain.DevInfoDt">
|
||||||
|
SELECT
|
||||||
|
mdi.device_name AS deviceName,
|
||||||
|
CONCAT( mt1.type_name, '/', mt2.type_name, '/', mt3.type_name ) AS categoryName,
|
||||||
|
mt4.unit_name AS unitName,
|
||||||
|
mdi.brand AS brand,
|
||||||
|
mdi.production_date AS productionDate,
|
||||||
|
mdi.person AS person,
|
||||||
|
mdi.person_phone AS personPhone,
|
||||||
|
mdi.device_count AS deviceCount,
|
||||||
|
su.nick_name AS creatorName,
|
||||||
|
mdi.create_time AS createTime,
|
||||||
|
sd.dept_name AS comName
|
||||||
|
FROM
|
||||||
|
ma_dev_info mdi
|
||||||
|
LEFT JOIN ma_type mt4 ON mt4.type_id = mdi.type_id
|
||||||
|
AND mt4.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt3 ON mt3.type_id = mt4.parent_id
|
||||||
|
AND mt3.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt3.parent_id
|
||||||
|
AND mt2.del_flag = '0'
|
||||||
|
LEFT JOIN ma_type mt1 ON mt1.type_id = mt2.parent_id
|
||||||
|
AND mt1.del_flag = '0'
|
||||||
|
LEFT JOIN sys_user su ON mdi.creator = su.user_id
|
||||||
|
LEFT JOIN sys_dept sd ON sd.dept_id = mdi.own_co
|
||||||
|
WHERE
|
||||||
|
mdi.is_active = '1'
|
||||||
|
AND mdi.ma_status IN ( 1, 2, 3 )
|
||||||
|
AND mdi.own_co = #{ownCo}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue