移动端加入

This commit is contained in:
2025-02-15 10:45:23 +08:00
parent 324b01042f
commit 75acf69848
10 changed files with 216 additions and 85 deletions

View File

@@ -88,8 +88,6 @@ public class SysOaFinanceController extends BaseController {
BigDecimal finance0 = iSysOaFinanceService.findFinanceByTime(bo, params0);
Map<String, Object> ajax = new HashMap<>();
ajax.put("income", finance1);
ajax.put("out", finance0);
@@ -155,6 +153,7 @@ public class SysOaFinanceController extends BaseController {
outMap.put("beginTime", firstDay);
outMap.put("endTime", lastDay);
outMap.put("payType",bo.getPayType());
outMap.put("receiveAccountId",bo.getReceiveAccountId());
BigDecimal financeOutReduce = iSysOaFinanceService.findFinanceByTime(bo, outMap);
//收入
@@ -163,6 +162,7 @@ public class SysOaFinanceController extends BaseController {
comeMap.put("beginTime", firstDay);
comeMap.put("endTime", lastDay);
comeMap.put("payType",bo.getPayType());
comeMap.put("receiveAccountId",bo.getReceiveAccountId());
BigDecimal financeComeReduce = iSysOaFinanceService.findFinanceByTime(bo, comeMap);
//收入减支出
BigDecimal subtract = financeComeReduce.subtract(financeOutReduce);

View File

@@ -62,6 +62,7 @@ public interface SysOaFinanceMapper extends BaseMapperPlus<SysOaFinanceMapper, S
* @param params
* @return
*/
List<SysOaFinance> findFinanceByTime(Map params);
/**

View File

@@ -23,6 +23,7 @@ import com.ruoyi.oa.domain.SysOaAttendance;
import com.ruoyi.oa.mapper.SysOaAttendanceMapper;
import com.ruoyi.oa.service.ISysOaAttendanceService;
import javax.validation.constraints.NotNull;
import java.util.*;
import java.util.stream.Collectors;
@@ -97,16 +98,14 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
sysOaAttendanceBo.setProjectId(null);
// 如果这个时间为空,则默认查询当月记录
Date firstDay;
Date lastDay;
if (Objects.isNull(bo.getSelectTime())) {
firstDay = getFirstDay(new Date());
Date lastDay = getLastDay(bo.getSelectTime());
List<SysOaAttendanceVo> sysOaAttendanceVos;
} else {
firstDay = getFirstDay(bo.getSelectTime());
}
lastDay = getLastDay(firstDay);
List<SysOaAttendanceVo> sysOaAttendanceVos = baseMapper.queryListByTime(sysOaAttendanceBo.getUserId(), sysOaAttendanceBo.getAttendanceDay(), firstDay, lastDay);
Date day = getFirstDay(bo.getSelectTime());
firstDay = getFormatDay(bo.getSelectTime(), bo.getAttendanceDay());
sysOaAttendanceVos = baseMapper.queryListByTime(sysOaAttendanceBo.getUserId(), sysOaAttendanceBo.getAttendanceDay(), day, lastDay);
if (sysOaAttendanceVos.isEmpty()) {
bo.setCreateTime(firstDay);
@@ -120,7 +119,11 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
} else {
SysOaAttendanceVo sysOaAttendanceVo = sysOaAttendanceVos.get(0);
sysOaAttendanceVo.setProjectId(bo.getProjectId());
sysOaAttendanceVo.setCreateTime(firstDay);
sysOaAttendanceVo.setDelFlag(0L);
sysOaAttendanceVo.setDayLength(bo.getDayLength()!=null?bo.getDayLength():0);
sysOaAttendanceVo.setHour(bo.getHour()!=null?bo.getHour():0);
return baseMapper.updateDelAttendance(BeanUtil.toBean(sysOaAttendanceVo, SysOaAttendance.class)) > 0;
}
@@ -260,6 +263,11 @@ public class SysOaAttendanceServiceImpl implements ISysOaAttendanceService {
return DateUtils.parseDate(firstDay);
}
private Date getFormatDay(Date time, Long attendanceDay) {
String firstDay = DateUtils.parseDateToStr("yyyy-MM-" + attendanceDay, time);
return DateUtils.parseDate(firstDay);
}
private Date getLastDay(Date time) {
String format = "yyyy-MM-";
// 计算某月的天数

View File

@@ -92,6 +92,7 @@ public class SysOaFinanceServiceImpl implements ISysOaFinanceService {
paramsMap.put("beginTime", params.get("beginTime"));
paramsMap.put("endTime", params.get("endTime"));
paramsMap.put("payType", params.get("payType"));
paramsMap.put("receiveAccountId",params.get("receiveAccountId"));
List<SysOaFinance> financeByTime = baseMapper.findFinanceByTime(paramsMap);
//遍历子表将价格遍历为数组并用map方法求和该方法类型使用map比较妥当
ArrayList<BigDecimal> objects = new ArrayList<>();

View File

@@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateDelAttendance" parameterType="com.ruoyi.oa.domain.SysOaAttendance">
update fad_oa.sys_oa_attendance
<trim prefix="SET" suffixOverrides=",">
<if test="projectId != null and projectId!=''">project_id=#{projectId},</if>
<if test="projectId != null">project_id=#{projectId},</if>
<if test="userId != null and userId!=''">user_id = #{userId},</if>
<if test="attendanceDay != null and attendanceDay!=''">attendance_day = #{attendanceDay},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
@@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="dayLength != null and dayLength!=''">day_length = #{dayLength},</if>
<if test="hour != null and hour!=''">hour = #{hour},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>

View File

@@ -161,9 +161,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="findFinanceByTime" resultMap="SysOaFinanceResult">
<include refid="selectFinanceVo" />
where a.finance_type = #{financeType}
<if test=" payType!=NULL and payType!=null and payType !='0' ">
<if test=" payType!=NULL and payType!=null and payType !='0' and payType!=0 ">
and a.pay_type = #{payType}
</if>
<if test=" receiveAccountId!=NULL and receiveAccountId!=null and receiveAccountId!='-1' ">
and a.receive_account_id = #{receiveAccountId}
</if>
and a.project_id = 0
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{beginTime},'%Y-%m-%d %H:%i:%s')
and date_format(a.finance_time,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')

View File

@@ -1,7 +1,7 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.oa.mapper.SysOaProjectMapper">
<resultMap type="com.ruoyi.oa.domain.SysOaProject" id="SysOaProjectResult">
@@ -82,7 +82,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPageOutList" resultMap="SysOaOutWarehouseListVoResult">
select sop.project_id, project_name,soow.warehouse_id,soow.id as soow_id,soow.amount,soow.create_time as out_create_time,sow.name
select sop.project_id,
project_name,
soow.warehouse_id,
soow.id as soow_id,
soow.amount,
soow.create_time as out_create_time,
sow.name
from sys_oa_project sop
left join sys_oa_out_warehouse soow on soow.project_id = sop.project_id
left join sys_oa_warehouse sow on sow.id = soow.warehouse_id
@@ -90,21 +96,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getProjectDataByMonth" resultType="com.ruoyi.oa.domain.vo.SysOaProjectVo">
select sum(soa.day_length+soa.hour/8) as labor_cost ,color,sop.project_name from sys_oa_project sop
left join sys_oa_attendance soa on sop.project_id = soa.project_id
select sum(soa.day_length + soa.hour / 8) as labor_cost, color, sop.project_name
from sys_oa_project sop
left join sys_oa_attendance soa on sop.project_id = soa.project_id
where soa.create_time between #{firstDay} and #{lastDay}
and soa.del_flag = '0'
and soa.del_flag = '0'
group by sop.project_id
</select>
<select id="getProjectDataByMonthAndDate" resultType="com.ruoyi.oa.domain.vo.SysOaProjectVo">
select sum(soa.day_length+soa.hour/8) as labor_cost ,color,sop.project_name,date_format(soa.create_time,'%Y-%m-%d') as create_time from sys_oa_project sop
left join sys_oa_attendance soa on sop.project_id = soa.project_id
select sum(soa.day_length + soa.hour / 8) as labor_cost,
color,
sop.project_name,
date_format(soa.create_time, '%Y-%m-%d') as create_time
from sys_oa_project sop
left join sys_oa_attendance soa on sop.project_id = soa.project_id
where soa.create_time between #{firstDay} and #{lastDay}
and soa.del_flag = '0'
group by sop.project_id,create_time
</select>
</mapper>

View File

@@ -129,21 +129,30 @@ export default {
// 绘制项目活跃度堆叠条形图
drawActivityChart() {
const chart = echarts.init(document.getElementById('activity-chart'));
console.log(this.projects)
// 处理数据:转化为堆叠条形图所需的格式
const dates = [...new Set(this.projects.map(item => item.createTime.substring(0 ,10)))]; // 获取所有日期
const dates = [...new Set(this.projects.map(item => item.createTime.substring(0 ,10)))].sort(); // 获取所有日期
const projects = [...new Set(this.projects.map(item => item.projectName))]; // 获取所有项目
// 创建数据系列:每个项目一个系列
const series = projects.map(project => ({
name: project,
type: 'bar',
stack: 'total',
data: dates.map(date => {
const progress = this.projects.find(item => item.projectName === project && item.createTime.substring(0 ,10) === date.substring(0 ,10));
return progress ? progress.laborCost : 0;
})
}));
// 创建数据系列:每个项目一个系列,颜色使用项目的 color 属性
const series = projects.map(projectName => {
const projectColor = this.projects.find(item => item.projectName === projectName)?.color || '#000'; // 默认黑色
return {
name: projectName,
type: 'bar',
stack: 'total',
data: dates.map(date => {
const progress = this.projects.find(
item => item.projectName === projectName && item.createTime.substring(0, 10) === date
);
return progress ? progress.laborCost : 0;
}),
itemStyle: {
color: projectColor, // 使用项目的颜色
},
};
});
// 配置项
const option = {

View File

@@ -231,7 +231,7 @@
</div>
<!-- 月度工作情况表格 -->
<h2>{{ date.getMonth() }} 月度工作签到情况</h2>
<h2>{{ date.getMonth()+1 }} 月度工作签到情况</h2>
<el-descriptions class="margin-top" title="报告详情" :column="3" :size="size" border>
@@ -426,15 +426,6 @@ export default {
methods: {
// // tag切换方法
// handleClickTab(tag,event){
// if (tag.index===1){
// this.$nextTick(() => {
// console.log("1284u0")
// this.$refs.barChart && this.$refs.barChart.resize(); // 假设你的 BarChart 组件提供了 resize 方法
// });
// }
// },
// 获取单元格的样式
getCellStyle(user, dayIndex) {
@@ -484,7 +475,7 @@ export default {
addOaAttendance(this.form).then(res => {
this.getList()
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
this.selectArrayIndex++
})
} else {
this.form = {
@@ -510,7 +501,7 @@ export default {
addOaAttendance(this.form).then(res => {
this.getList()
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
this.selectArrayIndex++
})
} else {
this.form = {
@@ -623,7 +614,9 @@ export default {
}
addOaAttendance(this.form).then(res => {
this.selectUser = this.selectArrayIndex >= this.userList.length - 1 ? this.selectUser : this.userList[this.selectArrayIndex + 1]
this.selectArrayIndex++
this.getList()
})
} else {

View File

@@ -433,7 +433,6 @@
v-for="dict in dict.type.sys_pay_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
@@ -547,6 +546,52 @@
</el-tab-pane>
<!-- <el-tab-pane label="财务核算(综合)" name="fifth">-->
<!-- <div class="funding-page">-->
<!-- <header class="page-header">-->
<!-- <h1>资金出入账核算</h1>-->
<!-- </header>-->
<!-- <main class="content">-->
<!-- <el-row :gutter="20">-->
<!-- <el-col :span="8">-->
<!-- <el-card class="info-card">-->
<!-- <el-select v-model="selectedAccount" placeholder="选择账户">-->
<!-- <el-option v-for="item in accounts" :key="item.id" :label="item.name" :value="item.id" />-->
<!-- </el-select>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-card class="info-card">-->
<!-- <el-date-picker v-model="selectedDateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" />-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-card class="info-card">-->
<!-- <el-select v-model="selectedPaymentType" placeholder="选择付款类型">-->
<!-- <el-option v-for="item in paymentTypes" :key="item.value" :label="item.label" :value="item.value" />-->
<!-- </el-select>-->
<!-- </el-card>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <div class="calculate-btn">-->
<!-- <el-button type="primary" @click="calculateFunds">核算资金</el-button>-->
<!-- </div>-->
<!-- <div v-if="calculationResult" class="result">-->
<!-- <el-card class="result-card">-->
<!-- <p>收入: {{ calculationResult.income }}</p>-->
<!-- <p>支出: {{ calculationResult.expense }}</p>-->
<!-- <p>净收入: {{ calculationResult.netIncome }}</p>-->
<!-- </el-card>-->
<!-- </div>-->
<!-- </main>-->
<!-- </div>-->
<!-- </el-tab-pane>-->
</el-tabs>
</el-col>
</el-row>
@@ -788,6 +833,12 @@ export default {
dicts: ['sys_pay_type', 'oa_out_finance'],
data() {
return {
accounts: [{ id: 1, name: '账户A' }, { id: 2, name: '账户B' }],
paymentTypes: [{ label: '现金', value: 'cash' }, { label: '信用卡', value: 'credit' }],
selectedAccount: null,
selectedDateRange: null,
selectedPaymentType: null,
calculationResult: null,
// 支付类型
payType: 0,
// 按钮loading
@@ -829,6 +880,7 @@ export default {
projectId: undefined,
financeTitle: undefined,
financeType: undefined,
receiveAccountId:-1,
},
receiveAccountList: [],
// 表单参数
@@ -911,6 +963,15 @@ export default {
},
methods: {
calculateFunds() {
// 模拟核算资金逻辑
this.calculationResult = {
income: '10,000.00',
expense: '4,500.00',
netIncome: '5,500.00',
};
},
// 获取核算信息通过支付类型
getFinanceDateByPayType() {
this.getPayTypeBlur()
@@ -941,7 +1002,6 @@ export default {
newChild.receiveAccountName = newChild.label;
newChild.parentId = -1;
addOaReceiveAccount(newChild).then(res => {
console.log(res)
newChild.receiveAccountId = res.data.receiveAccountId
})
data.children.push(newChild);
@@ -967,11 +1027,10 @@ export default {
handleNodeClick(data) {
this.queryParams.receiveAccountId = data.receiveAccountId;
if (this.nowTab === "2") {
if (this.nowTab === "2" ||this.nowTab === "3" ) {
return;
}
let type = this.nowTab == "1" ? '0' : '1'
let type = this.nowTab === "1" ? '0' : '1'
this.handleQuery(type);
},
@@ -1006,7 +1065,6 @@ export default {
listFinance(this.queryParams).then(response => {
console.log(response)
//出账列表
if (type == '0') {
this.financeListPro(response.rows).then(res => {
@@ -1202,39 +1260,6 @@ export default {
}
}
// this.form.detailList = this.detailList;
/* if (this.detailList.length == 0) {
this.$modal.msgWarning("费用名称金额不能为空!");
} else {
// this.form.makeTime = this.getRealDate(this.form.makeTime)
if (this.form.financeId != null) {
updateFinance(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
// this.getListEnter();
// this.getListOut();
this.getListFinance('0');
this.getListFinance('1');
}).finally(() => {
this.buttonLoading = false;
});
} else {
addFinance(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
//定位到入账列表
/!*this.getListEnter();
this.getListOut();*!/
this.getListFinance('0');
this.getListFinance('1');
}).finally(() => {
this.buttonLoading = false;
});
}
}*/
}
});
},
@@ -1348,6 +1373,7 @@ export default {
beginTime: beginTime,
endTime: endTime,
payType: this.payType,
receiveAccountId:this.queryParams.receiveAccountId,
}
findFinance(dataCome).then(res => {
this.checkByTime = res.data;
@@ -1364,10 +1390,10 @@ export default {
beginTime: Vue.prototype.parseTime(nowMonth, '{y}-{m}-{d} {h}:{i}:{s}'),
endTime: Vue.prototype.parseTime(monthEnd, '{y}-{m}-{d} {h}:{i}:{s}'),
payType: this.payType,
receiveAccountId:this.queryParams.receiveAccountId,
}
findFinance(dataCome).then(res => {
this.checkByTime = res.data;
})
},
/**
@@ -1651,4 +1677,82 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
.funding-page {
background: #ffffff;
color: #333333;
font-family: 'Roboto', '微软雅黑', sans-serif;
padding: 20px 40px;
min-height: 100vh;
}
.page-header h1 {
font-size: 24px;
color: #1e3a8a; /* 深蓝色标题 */
text-align: left;
border-bottom: 2px solid #e4e8f7;
padding-bottom: 10px;
margin-bottom: 20px;
}
.form-section {
background: #f9fbff; /* 浅灰蓝背景 */
border: 1px solid #e4e8f7; /* 边框 */
padding: 20px;
border-radius: 8px;
margin-bottom: 20px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.form-item {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}
.form-item label {
font-size: 14px;
color: #555555;
margin-bottom: 8px;
}
.calculate-btn {
text-align: center;
margin: 20px 0;
}
.result-section {
background: #ffffff;
border: 1px solid #e4e8f7;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.result-section h2 {
font-size: 18px;
color: #1e3a8a;
margin-bottom: 10px;
}
.result-summary {
display: flex;
justify-content: space-around;
text-align: center;
}
.result-item {
font-size: 16px;
color: #333333;
}
.result-item label {
font-weight: bold;
color: #555555;
}
.result-item span {
color: #1e3a8a;
font-weight: bold;
}
</style>