Commit df154cc1 authored by ‘老张’'s avatar ‘老张’

Merge remote-tracking branch 'origin/master'

parents 136d263a 96780c2c
......@@ -47,16 +47,16 @@ public class EmployeeBalanceController extends BaseController
}
/**
* 导出员工余额列表
* 导出员工年假列表
*/
@PreAuthorize("@ss.hasPermi('system:balance:export')")
@Log(title = "员工余额", businessType = BusinessType.EXPORT)
@Log(title = "员工年假", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EmployeeBalance employeeBalance)
{
List<EmployeeBalance> list = employeeBalanceService.selectEmployeeBalanceList(employeeBalance);
ExcelUtil<EmployeeBalance> util = new ExcelUtil<EmployeeBalance>(EmployeeBalance.class);
util.exportExcel(response, list, "员工余额数据");
util.exportExcel(response, list, "员工年假数据");
}
/**
......
......@@ -13,7 +13,12 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 差旅Controller
*
* @author ruoyi
* @date 2025-02-28
*/
@RestController
@RequestMapping("/FyglTravelOnBusiness")
public class FyglTravelOnBusinessController extends BaseController {
......@@ -27,7 +32,7 @@ public class FyglTravelOnBusinessController extends BaseController {
startPage();
return getDataTable(travelOnBusinessService.getFyglTravelOnBusinessList(fyglProjectCostDTO));
}
/**
* 获取差旅报销详细信息
*/
......@@ -36,7 +41,7 @@ public class FyglTravelOnBusinessController extends BaseController {
{
return success(travelOnBusinessService.selectFyglTravelOnBusinessListById(id));
}
//导出列表
@PostMapping("/getList/export")
public void export(HttpServletResponse response, Long [] ids)
......@@ -45,21 +50,21 @@ public class FyglTravelOnBusinessController extends BaseController {
ExcelUtil<FyglTravelOnBusinessDTO> util = new ExcelUtil<FyglTravelOnBusinessDTO>(FyglTravelOnBusinessDTO.class);
util.exportExcel(response, travelOnBusinessByIds, "差旅报销数据");
}
//新增差旅报销
@PostMapping("/getList/insert")
public AjaxResult insertFyglTravelOnBusiness(@RequestBody FyglTravelOnBusinessDTO fyglTravelOnBusinessDTO)
{
return AjaxResult.success(travelOnBusinessService.insertFyglTravelOnBusiness(fyglTravelOnBusinessDTO));
}
//修改差旅报销
@PutMapping("/getList/update")
public AjaxResult updateFyglTravelOnBusiness(@RequestBody FyglTravelOnBusinessDTO fyglTravelOnBusinessDTO)
{
return AjaxResult.success(travelOnBusinessService.updateFyglTravelOnBusiness(fyglTravelOnBusinessDTO));
}
//删除差旅报销
@DeleteMapping("/getList/{id}")
public AjaxResult deleteFyglTravelOnBusinessById(@PathVariable Long id)
......
......@@ -26,6 +26,13 @@ public class FyglDailyReimbursementDTO {
//总数量
private Integer totalMoney;
//项目的每个月的报销数组
private List<FyglDailyReimbursementTableItemDTO> tableItemList;
// 页码
private Integer pageNum;
// 每页条数
private Integer pageSize;
// 总条数
private Integer total;
}
......@@ -4,6 +4,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Map;
@EqualsAndHashCode(callSuper = true)
@Data
public class FyglDailyReimbursementVo extends BaseEntity {
......@@ -52,6 +55,6 @@ public class FyglDailyReimbursementVo extends BaseEntity {
//审批状态0保存1未通过2审批中3已通过
private Integer reimbursmentApproveStatus;
// 分页参数
private String projectPageParams;
}
package com.ruoyi.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
......@@ -15,15 +20,16 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* 日常报销Service业务层处理
*
*
* @author ruoyi
* @date 2025-02-28
*/
@Service
public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursementService
public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursementService
{
@Autowired
private FyglDailyReimbursementMapper fyglDailyReimbursementMapper;
......@@ -36,7 +42,7 @@ public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursemen
/**
* 查询日常报销
*
*
* @param id 日常报销主键
* @return 日常报销
*/
......@@ -87,7 +93,7 @@ public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursemen
/**
* 新增日常报销
*
*
* @param fyglDailyReimbursement 日常报销
* @return 结果
*/
......@@ -128,7 +134,7 @@ public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursemen
/**
* 修改日常报销
*
*
* @param fyglDailyReimbursement 日常报销
* @return 结果
*/
......@@ -157,7 +163,7 @@ public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursemen
/**
* 批量删除日常报销
*
*
* @param ids 需要删除的日常报销主键
* @return 结果
*/
......@@ -169,7 +175,7 @@ public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursemen
/**
* 删除日常报销信息
*
*
* @param id 日常报销主键
* @return 结果
*/
......@@ -187,12 +193,38 @@ public class FyglDailyReimbursementServiceImpl implements IFyglDailyReimbursemen
//获取每个人关联的项目
fyglDailyReimbursementVO.setCurrentUserId(SecurityUtils.getUserId());
List<FyglDailyReimbursementDTO> projectListByUserId = fyglDailyReimbursementMapper.getProjectListByUserId(fyglDailyReimbursementVO);
for(FyglDailyReimbursementDTO item:projectListByUserId){
fyglDailyReimbursementVO.setCardItemProjectId(item.getProjectId());
List<FyglDailyReimbursementTableItemDTO> itemList = fyglDailyReimbursementMapper.getItemList(fyglDailyReimbursementVO);
item.setTableItemList(itemList);
// 将projectPageParams转成map集合
String projectPageParams = fyglDailyReimbursementVO.getProjectPageParams();
if (projectPageParams != null){
Map<String, Object> projectPageMap = JSON.parseObject(projectPageParams);
for(FyglDailyReimbursementDTO item:projectListByUserId){
Object obj = projectPageMap.get(item.getProjectId());
// 将obj转成map
Map<String, Integer> map = (Map<String, Integer>) obj;
Integer pageNum = map.get("pageNum");
Integer pageSize = map.get("pageSize");
PageHelper.startPage(pageNum,pageSize);
fyglDailyReimbursementVO.setCardItemProjectId(item.getProjectId());
List<FyglDailyReimbursementTableItemDTO> itemList = fyglDailyReimbursementMapper.getItemList(fyglDailyReimbursementVO);
PageInfo<FyglDailyReimbursementTableItemDTO> tbUserPageInfo = new PageInfo<>(itemList);
item.setTableItemList(tbUserPageInfo.getList());
item.setPageNum(pageNum);
item.setPageSize(pageSize);
item.setTotal(Math.toIntExact(tbUserPageInfo.getTotal()));
}
} else {
// 初始化执行 默认每页3条数据
PageHelper.startPage(1,3);
for(FyglDailyReimbursementDTO item:projectListByUserId){
// 将obj转成map
fyglDailyReimbursementVO.setCardItemProjectId(item.getProjectId());
List<FyglDailyReimbursementTableItemDTO> itemList = fyglDailyReimbursementMapper.getItemList(fyglDailyReimbursementVO);
PageInfo<FyglDailyReimbursementTableItemDTO> tbUserPageInfo = new PageInfo<>(itemList);
item.setTableItemList(tbUserPageInfo.getList());
item.setPageNum(1);
item.setPageSize(3);
item.setTotal(Math.toIntExact(tbUserPageInfo.getTotal()));
}
}
System.out.println("参数 = " + fyglDailyReimbursementVO);
return projectListByUserId;
......
......@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.FyglDailyReimbursementMapper">
<resultMap type="com.ruoyi.domain.FyglDailyReimbursement" id="FyglDailyReimbursementResult">
<result property="id" column="id" />
<result property="projectId" column="project_id" />
......@@ -87,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
GROUP BY fd.id
</select>
<select id="selectFyglDailyReimbursementById" parameterType="Long" resultMap="FyglDailyReimbursementDetailDTOResult">
SELECT
r1.id,
......@@ -130,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY
r.id,
r.registration_time,
r.`status`;
r.`status`
</select>
<select id="selectFyglDailyReimbursementItemListById"
resultMap="FyglDailyReimbursementDetailItemResult">
......@@ -283,4 +283,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="delDataByRid">
delete from fygl_daily_reimbursement_relevancy r where r.rid = #{rid}
</delete>
</mapper>
\ No newline at end of file
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment