增加 看板接口

master
wanghao 9 months ago
parent d020b61f86
commit 6dfea314d7

@ -9,7 +9,7 @@ ruoyi:
# 实例演示开关
demoEnabled: false
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/lundang/uploadPath
profile: F:/lundang/uploadPath
# 获取ip地址开关
addressEnabled: false

@ -1,25 +1,50 @@
package com.ruoyi.api.controller;
import com.ruoyi.api.domain.BroadCountNumber;
import com.ruoyi.api.service.impl.BroadApiService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.manage.domain.BaseStore;
import com.ruoyi.manage.domain.LedgerRfid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author wanghao
* @date 2024/3/1 13:29
*/
@RestController
@Controller
@RequestMapping("/api")
public class BroadApiController {
@Autowired
private BroadApiService service;
@PostMapping("/selectCountNumber")
private String selectCountNumber(){
return service.selectCountNumber();
//获取区域
@PostMapping("/getArea")
@ResponseBody
public AjaxResult getArea() {
List<BaseStore> list = service.getArea();
return AjaxResult.success(list);
}
//获取统计
@PostMapping("/getCountNumberById")
@ResponseBody
public AjaxResult getCountNumberById(int id) {
List<BroadCountNumber> list = service.getCountNumberById(id);
return AjaxResult.success(list);
}
//获取详细轮挡
@PostMapping("/getLedgerByCode")
@ResponseBody
public AjaxResult getLedgerByCode(String locationCode){
List<LedgerRfid> list=service.getLedgerByCode(locationCode);
return AjaxResult.success(list);
}
}

@ -0,0 +1,33 @@
package com.ruoyi.api.domain;
public class BroadCountNumber {
private String areaName;
private String locationCode;
private int countNumber;
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getLocationCode() {
return locationCode;
}
public void setLocationCode(String locationCode) {
this.locationCode = locationCode;
}
public int getCountNumber() {
return countNumber;
}
public void setCountNumber(int countNumber) {
this.countNumber = countNumber;
}
}

@ -1,12 +1,23 @@
package com.ruoyi.api.mapper;
import com.ruoyi.api.domain.BroadCountNumber;
import com.ruoyi.manage.domain.BaseStore;
import com.ruoyi.manage.domain.LedgerRfid;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author wanghao
* @date 2024/3/1 13:30
*/
@Repository
public interface BroadApiMapper {
String selectCountNumber();
List<BaseStore> getArea();
List<BroadCountNumber> getCountNumberById(int id);
List<LedgerRfid> getLedgerByCode(String locationCode);
}

@ -1,9 +1,14 @@
package com.ruoyi.api.service.impl;
import com.ruoyi.api.domain.BroadCountNumber;
import com.ruoyi.api.mapper.BroadApiMapper;
import com.ruoyi.manage.domain.BaseStore;
import com.ruoyi.manage.domain.LedgerRfid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author wanghao
* @date 2024/3/1 13:30
@ -13,7 +18,17 @@ public class BroadApiService {
@Autowired
private BroadApiMapper mapper;
public String selectCountNumber() {
return mapper.selectCountNumber();
public List<BaseStore> getArea() {
return mapper.getArea();
}
public List<BroadCountNumber> getCountNumberById(int id) {
return mapper.getCountNumberById(id);
}
public List<LedgerRfid> getLedgerByCode(String locationCode) {
return mapper.getLedgerByCode(locationCode);
}
}

@ -3,19 +3,32 @@
<mapper namespace="com.ruoyi.api.mapper.BroadApiMapper">
<select id="selectCountNumber" resultType="com.ruoyi.manage.domain.ResultBeen">
select count(inspection_id) as t, '巡检次数' as name
from record_inspection
where DATE(inspection_time) = CURDATE()
union
select count(DISTINCT location_code) as t, '巡检机位' as name
from record_inspection_info
where DATE(create_time) = CURDATE()
union
select count(inspection_state) as t, '巡检结果' as name
from record_inspection_info
where DATE(create_time) = CURDATE() and inspection_state !='正常'
<select id="getArea" resultMap="com.ruoyi.manage.mapper.BaseStoreMapper.BaseStoreResult">
select store_name,store_id from base_store where store_tag=2
</select>
<resultMap id="BroadCountNumberMap" type="com.ruoyi.api.domain.BroadCountNumber">
<result property="areaName" column="store_name"/>
<result property="locationCode" column="location_code"/>
<result property="countNumber" column="conum"/>
</resultMap>
<select id="getCountNumberById" resultMap="BroadCountNumberMap">
select bs.store_name, bl.location_code, count(lr.objid) as conum
from base_location bl
left join base_store bs on bs.store_id = bl.store_id
left join ledger_rfid lr on bl.location_code = lr.location_code
where stote_tag = 2
and bl.store_id = #{id}
group by bl.location_code
</select>
<select id="getLedgerByCode" resultMap="com.ruoyi.manage.mapper.LedgerRfidMapper.LedgerRfidResult">
select manufacturer_name, rifd_code, batch_code, create_time
from ledger_rfid lr
left join base_manufacturer bm on lr.manufacturer_id = bm.manufacturer_id
where is_scrap = 1
and location_code = #{locationCode}
</select>
</mapper>

@ -35,6 +35,7 @@ public class LedgerRfid extends BaseEntity {
*/
@Excel(name = "RFID编码")
private String rifdCode;
private String manufacturerName;
/**
*
@ -93,6 +94,14 @@ public class LedgerRfid extends BaseEntity {
return rifdCode;
}
public String getManufacturerName() {
return manufacturerName;
}
public void setManufacturerName(String manufacturerName) {
this.manufacturerName = manufacturerName;
}
public void setBatchCode(String batchCode) {
this.batchCode = batchCode;
}

@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="dictLabel" column="dict_label" />
<result property="manufacturerName" column="manufacturer_name" />
<association property="baseManufacturer" javaType="BaseManufacturer" resultMap="com.ruoyi.manage.mapper.BaseManufacturerMapper.BaseManufacturerResult"/>
</resultMap>

Loading…
Cancel
Save