Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ruoyi-ui/src/lang/zh.js
This commit is contained in:
lsymicc
2025-06-11 17:47:39 +08:00
18 changed files with 280 additions and 11 deletions

View File

@@ -0,0 +1,36 @@
package com.ruoyi.api.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.api.service.IJobStatisticsService;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 作业统计 Controller
*/
@RestController
@RequestMapping("/api")
public class JobStatisticsController {
@Autowired
private IJobStatisticsService jobStatisticsService;
/**
* 获取统计数据,包含:
* 1. 当日入库和出库数量统计
* 2. 货位状态统计
* 3. 当前任务列表
*/
@GetMapping("/daily")
public AjaxResult getDailyStatistics() {
Map<String, Object> result = jobStatisticsService.getDailyStatistics();
return AjaxResult.success(result);
}
}

View File

@@ -0,0 +1,37 @@
package com.ruoyi.api.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 作业统计 Mapper 接口
*/
public interface JobStatisticsMapper {
/**
* 查询当日入库数量(inOrOut < 20)
*
* @param createTime 创建日期
* @return 入库数量
*/
public int selectDailyInCount(@Param("createTime") String createTime);
/**
* 查询当日出库数量(inOrOut >= 20)
*
* @param createTime 创建日期
* @return 出库数量
*/
public int selectDailyOutCount(@Param("createTime") String createTime);
/**
* 查询当月每日入库出库统计
*
* @param year 年份
* @param month 月份
* @return 每日入库出库统计列表
*/
public List<Map<String, Object>> selectMonthlyStatistics(@Param("year") int year, @Param("month") int month);
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.api.service;
import com.ruoyi.common.core.domain.AjaxResult;
import java.util.Map;
/**
* 作业统计 Service 接口
*/
public interface IJobStatisticsService {
/**
* 获取统计数据,包含:
* 1. 当日入库和出库数量统计
* 2. 货位状态统计
* 3. 当前任务列表
*
* @return 统计结果
*/
public Map<String, Object> getDailyStatistics();
}

View File

@@ -0,0 +1,91 @@
package com.ruoyi.api.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.api.service.IJobStatisticsService;
import com.ruoyi.api.mapper.JobStatisticsMapper;
import com.ruoyi.bas.cargoSpace.mapper.BasCargoSpaceMapper;
import com.ruoyi.job.mydojob.mapper.MydoJobMapper;
import com.ruoyi.job.mydojob.domain.MydoJob;
/**
* 作业统计 Service 实现
*/
@Service
public class JobStatisticsServiceImpl implements IJobStatisticsService {
@Autowired
private JobStatisticsMapper jobStatisticsMapper;
@Autowired
private BasCargoSpaceMapper basCargoSpaceMapper;
@Autowired
private MydoJobMapper mydoJobMapper;
/**
* 获取当日入库和出库数量统计
*/
@Override
public Map<String, Object> getDailyStatistics() {
// 获取当前日期
String today = DateUtils.getDate();
// 查询当日入库数量
int inCount = jobStatisticsMapper.selectDailyInCount(today);
// 查询当日出库数量
int outCount = jobStatisticsMapper.selectDailyOutCount(today);
// 获取货位状态统计
List<Map<String, Object>> statusCounts = basCargoSpaceMapper.selectStatusCount();
List<Map<String, Object>> cargoSpaceStatus = new ArrayList<>();
Map<String, String> statusNameMap = new HashMap<>();
statusNameMap.put("1", "空货位");
statusNameMap.put("2", "满货位");
statusNameMap.put("3", "入库已分配");
statusNameMap.put("4", "出库已分配");
statusNameMap.put("5", "入库需盘点");
statusNameMap.put("6", "出库需盘点");
for (Map.Entry<String, String> entry : statusNameMap.entrySet()) {
Map<String, Object> item = new HashMap<>();
String status = entry.getKey();
item.put("name", entry.getValue());
item.put("value", 0);
for (Map<String, Object> count : statusCounts) {
if (status.equals(String.valueOf(count.get("status")))) {
item.put("value", count.get("count"));
break;
}
}
cargoSpaceStatus.add(item);
}
// 获取当前任务列表
List<MydoJob> currentTasks = mydoJobMapper.selectCurrentTasks();
// 获取当前年月
int year = Integer.parseInt(DateUtils.dateTimeNow("yyyy"));
int month = Integer.parseInt(DateUtils.dateTimeNow("MM"));
// 获取当月每日统计数据
List<Map<String, Object>> dailyStats = jobStatisticsMapper.selectMonthlyStatistics(year, month);
// 返回统计结果
Map<String, Object> result = new HashMap<>();
result.put("drrk", String.valueOf(inCount));
result.put("drck", String.valueOf(outCount));
result.put("cargoSpaceStatus", cargoSpaceStatus);
result.put("currentTask", currentTasks);
result.put("statistic", dailyStats);
return result;
}
}

View File

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.bas.cargoSpace.domain.BasCargoSpace;
import java.util.List;
import java.util.Map;
/**
* 库存信息Mapper接口
@@ -61,5 +62,10 @@ public interface BasCargoSpaceMapper extends BaseMapper<BasCargoSpace>
*/
public int deleteBasCargoSpaceByCargoSpaceIds(String[] cargoSpaceIds);
/**
* 查询不同状态的货位数量统计
*
* @return 状态统计结果列表
*/
public List<Map<String, Object>> selectStatusCount();
}

View File

@@ -9,8 +9,14 @@ import com.ruoyi.job.mydojob.domain.MydoJob;
* @author ruoyi
* @date 2025-05-23
*/
public interface MydoJobMapper
public interface MydoJobMapper
{
/**
* 查询当前任务列表
*
* @return 当前任务列表
*/
public List<MydoJob> selectCurrentTasks();
/**
* 查询任务表
*

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.api.mapper.JobStatisticsMapper">
<!-- 查询当日入库数量 -->
<select id="selectDailyInCount" parameterType="String" resultType="Integer">
SELECT COUNT(1)
FROM mydo_job_finish
WHERE CONVERT(varchar(10), create_time, 120) = #{createTime}
AND in_or_out &lt; 20
</select>
<!-- 查询当日出库数量 -->
<select id="selectDailyOutCount" parameterType="String" resultType="Integer">
SELECT COUNT(1)
FROM mydo_job_finish
WHERE CONVERT(varchar(10), create_time, 120) = #{createTime}
AND in_or_out >= 20
</select>
<!-- 查询当月每日入库出库统计 -->
<select id="selectMonthlyStatistics" resultType="java.util.Map">
SELECT
CONVERT(varchar(10), create_time, 120) as date,
SUM(CASE WHEN in_or_out &lt; 20 THEN 1 ELSE 0 END) as '入库',
SUM(CASE WHEN in_or_out >= 20 THEN 1 ELSE 0 END) as '出库'
FROM mydo_job_finish
WHERE YEAR(create_time) = #{year}
AND MONTH(create_time) = #{month}
GROUP BY CONVERT(varchar(10), create_time, 120)
ORDER BY date
</select>
</mapper>

View File

@@ -141,4 +141,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="selectStatusCount" resultType="java.util.Map">
SELECT
status,
COUNT(*) as count
FROM bas_cargo_space
GROUP BY status
</select>
</mapper>

View File

@@ -196,4 +196,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{jobId}
</foreach>
</delete>
<select id="selectCurrentTasks" resultMap="MydoJobResult">
<include refid="selectMydoJobVo"/>
where mj.status = '3'
</select>
</mapper>

View File

@@ -115,6 +115,7 @@ public class SecurityConfig
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html","/changeLanguage", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/pda/**").permitAll()
.antMatchers("/api/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
})

View File

@@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = 若依管理系统
VUE_APP_TITLE = ForTucky WMS system
# 开发环境配置
ENV = 'development'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -1,12 +1,14 @@
// en.js
export default {
login: {
title: 'RuoYi Login Form',
title: 'FORTUCKY WMS SYSTEM',
logIn: 'Login in',
username: 'Username',
password: 'Password',
code: 'Code',
rememberMe: 'Remember Me'
rememberMe: 'Remember Me',
bottom:'Copyright © 2025 ForTucky All Rights Reserved.400-1882-319'
},
tagsView: {
refresh: 'Refresh',
@@ -627,6 +629,7 @@ export default {
},
viewsMain: {
systemTitle: 'RuoYi Admin',
title: 'homePage',
unfinishedInboundTask: 'Unfinished Inbound Task Overview',
taskKey: 'Task Key',

View File

@@ -5,12 +5,13 @@ import 'core-js/features/symbol'
export default {
login: {
title: '若依后台管理系统',
title: '福莱瑞达WMS系统',
logIn: '登录',
username: '账号',
password: '密码',
code: '验证码',
rememberMe: '记住密码'
rememberMe: '记住密码',
bottom:'Copyright © 2025 ForTucky All Rights Reserved.400-1882-319'
},
tagsView: {
refresh: '刷新',
@@ -633,6 +634,24 @@ export default {
},
viewsMain: {
systemTitle: '福莱瑞达管理系统',
title: '首页',
unfinishedInboundTask: '未完成入库任务概览',
taskKey: '任务键值',
unfinishedInboundTaskName: '未完成入库任务',
totalUnfinishedCount: '全部未完成数量',
todayUnfinishedCount: '今日未完成数量',
finishedInboundTask: '已完成入库任务概览',
finishedInboundTaskName: '已完成入库任务',
totalFinishedCount: '全部已完成数量',
todayFinishedCount: '今日已完成数量',
unfinishedOutboundTask: '未完成出库任务概览',
unfinishedOutboundTaskName: '未完成出库任务',
finishedOutboundTask: '已完成出库任务概览',
finishedOutboundTaskName: '已完成出库任务'
},
searchViewStockSecure: {
stockId: '库存ID',
cargoSpaceId: '货位ID',

View File

@@ -1,13 +1,14 @@
import store from '@/store'
import defaultSettings from '@/settings'
import i18n from '@/lang'
/**
* 动态修改标题
*/
export function useDynamicTitle() {
if (store.state.settings.dynamicTitle) {
document.title = store.state.settings.title + ' - ' + defaultSettings.title
document.title = store.state.settings.title + ' - ' + i18n.t(defaultSettings.title)
} else {
document.title = defaultSettings.title
document.title = i18n.t(defaultSettings.title)
}
}

View File

@@ -57,7 +57,7 @@
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>Copyright © 2018-2024 ruoyi.vip All Rights Reserved.</span>
<span>{{ $t('login.bottom') }}</span>
</div>
</div>
</template>

View File

@@ -147,7 +147,7 @@ import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/
import { makeUpJs } from '@/utils/generator/js'
import { makeUpCss } from '@/utils/generator/css'
import drawingDefault from '@/utils/generator/drawingDefault'
import logo from '@/assets/logo/logo.png'
import logo from '@/assets/logo/logo1.png'
import CodeTypeDialog from './CodeTypeDialog'
import DraggableItem from './DraggableItem'