Browse Source

[feat]:新增:报销财务字典,新增状态待打款,已打款字典字段。

新增:报销单列表新增导出按钮,新增总经理审核通过,财务状态为待打款时是新增确认打款按钮。
新增:报销单新增报销打款对象,包含关联报销单号,打款时间,报销金额,报销人信息

。
dev
zhangsiqi 3 months ago
parent
commit
d27c764583
  1. 99
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java
  2. 151
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseConfirmAmountController.java
  3. 117
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseConfirmAmount.java
  4. 18
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountChildMapper.java
  5. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountMapper.java
  6. 81
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseConfirmAmountMapper.java
  7. 33
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountChildServiceImpl.java
  8. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java
  9. 126
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseConfirmAmountServiceImpl.java
  10. 9
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml
  11. 53
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml
  12. 111
      ruoyi-admin/src/main/resources/mapper/system/BaseExpenseConfirmAmountMapper.xml
  13. BIN
      ruoyi-admin/src/main/resources/static/attachments/报销单.xlsx
  14. 40
      ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html
  15. 81
      ruoyi-admin/src/main/resources/templates/system/baseExpense/confirmPayment.html
  16. 20
      ruoyi-admin/src/main/resources/templates/system/baseExpense/edit.html

99
ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseAccountController.java

@ -1,22 +1,27 @@
package com.ruoyi.system.controller; package com.ruoyi.system.controller;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON; import com.alibaba.excel.EasyExcel;
import com.ruoyi.common.core.domain.entity.SysUser; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileDownloadUtils;
import com.ruoyi.financial.service.IFinacialExpenseService;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.remind.service.RemindService; import com.ruoyi.remind.service.RemindService;
import com.ruoyi.system.domain.BaseExpenseAccountChild; import com.ruoyi.system.domain.BaseExpenseAccountChild;
import com.ruoyi.system.domain.BaseExpenseConfirmAmount;
import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo; import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo;
import com.ruoyi.system.mapper.BaseExpenseAccountChildMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.*; import com.ruoyi.system.service.*;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService; import org.activiti.engine.TaskService;
@ -37,6 +42,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
/** /**
@ -79,6 +85,11 @@ public class BaseExpenseAccountController extends BaseController
@Autowired @Autowired
private IProcessService processService; private IProcessService processService;
@Autowired @Autowired
private IBaseExpenseConfirmAmountService baseExpenseConfirmAmountService;
@Autowired
private IFinacialExpenseService finacialExpenseService;
@Autowired
@RequiresPermissions("system:baseExpense:view") @RequiresPermissions("system:baseExpense:view")
@GetMapping() @GetMapping()
@ -136,8 +147,60 @@ public class BaseExpenseAccountController extends BaseController
List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount); List<BaseExpenseAccountVo> list = baseExpenseAccountService.selectBaseExpenseAccountList(baseExpenseAccount);
ExcelUtil<BaseExpenseAccountVo> util = new ExcelUtil<BaseExpenseAccountVo>(BaseExpenseAccountVo.class); ExcelUtil<BaseExpenseAccountVo> util = new ExcelUtil<BaseExpenseAccountVo>(BaseExpenseAccountVo.class);
return util.exportExcel(list, "报销单数据"); return util.exportExcel(list, "报销单数据");
} }
@RequiresPermissions("system:baseExpense:export")
@Log(title = "报销单", businessType = BusinessType.EXPORT)
@GetMapping("/excelExpenseVoucher/{id}")
public void excelExpense(@PathVariable("id") Long id, HttpServletResponse response) throws IOException {
BaseExpenseAccountVo baseExpenseAccount = baseExpenseAccountService.selectBaseExpenseAccountById(id);
List<BaseExpenseAccountChild> financialReceivablesRecordsList = baseExpenseAccountChildService.selectBaseExpenseAccountChildByExpenseCode(baseExpenseAccount.getExpenseCode());
// 模版位置
String fileName = "报销单.xlsx";
FileDownloadUtils fileDownloadUtils = new FileDownloadUtils();
String fileRelativePath = fileDownloadUtils.getFileRelativePath(fileName);
String realFileName = baseExpenseAccount.getExpenseCode() +"-" +fileRelativePath.substring(0,fileName.lastIndexOf(".")) + ".xlsx";
// 设置响应头,指定文件名和文件类型
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
response.setContentType("application/octet-stream");
// 获取模板文件的输入流,引用绝对路径上的模版
// 创建一个ExcelWriterBuilder对象,并指定输出流和输入流
// 每页最多显示的行数
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).withTemplate(fileRelativePath).build();
final int maxRowsPerPage = 6;
// 计算需要多少页
int totalPages = (int) Math.ceil((double) financialReceivablesRecordsList.size() / maxRowsPerPage);
for (int i = 0; i < totalPages - 1; i++) {
Map<String, Object> map = new HashMap<>();
List<BaseExpenseAccountChild> list = baseExpenseAccountChildService.selectBaseExpenseChildListByCodePage(baseExpenseAccount.getExpenseCode(), i * maxRowsPerPage, maxRowsPerPage);
Map<String, Object> map1 = new HashMap<>();
map.put("list", list);
map1.put("deptName",baseExpenseAccount.getDeptName());
String date = DateUtils.getDate();
String[] dateArray = date.split("-");
map1.put("year", dateArray[0]);
map1.put("month", dateArray[1]);
map1.put("day", dateArray[2]);
map1.put("fullName", baseExpenseAccount.getFullName());
double sum = 0.0;
for (BaseExpenseAccountChild baseExpenseAccountChild : list) {
Double baseExpenseAccountChildAmounts = Double.valueOf(baseExpenseAccountChild.getAmounts());
sum += baseExpenseAccountChildAmounts;
}
Double amounts = sum;
map.put("amountSum",sum);
// 创建一个WriteSheet对象,并指定模板中的Sheet编号
WriteSheet writeSheet = EasyExcel.writerSheet("sheet" + (i + 1)).build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(false).build();
excelWriter.fill(map1,fillConfig, writeSheet);
excelWriter.fill(map.get("list"), fillConfig, writeSheet);
//合计金额
excelWriter.fill(map.get("amountSum"), fillConfig, writeSheet);
}
excelWriter.finish();
}
/** /**
* 新增报销单 * 新增报销单
*/ */
@ -255,6 +318,11 @@ public class BaseExpenseAccountController extends BaseController
if("submit".equals(instanceType)){ if("submit".equals(instanceType)){
// 使用状态-是 // 使用状态-是
baseExpenseAccountVo.setUseStatus("1"); baseExpenseAccountVo.setUseStatus("1");
//总经理审核完毕为转入财务审核,如果是总经理审核的话,财务审核状态为0
if(baseExpenseAccountVo.getTaskName().contains("总经理")){
baseExpenseAccountVo.setManagerAuditStatus("1");
// finacialExpenseService.submitApply(baseExpenseAccountVo);
}
} }
// 作废 // 作废
else if("cancel".equals(instanceType)){ else if("cancel".equals(instanceType)){
@ -308,4 +376,21 @@ public class BaseExpenseAccountController extends BaseController
public AjaxResult getExpenseCode() throws Exception { public AjaxResult getExpenseCode() throws Exception {
return AjaxResult.success(sysUserService.selectUserAll()); return AjaxResult.success(sysUserService.selectUserAll());
} }
@RequestMapping("/confirmExpense/{id}")
public String confirmExpense(@PathVariable("id") Long id,ModelMap mmap) throws Exception {
BaseExpenseAccount baseExpenseAccount = baseExpenseAccountService.selectBaseExpenseAccountById(id);
BaseExpenseConfirmAmount baseExpenseConfirmAmount = new BaseExpenseConfirmAmount();
baseExpenseConfirmAmount.setExpenseCode(baseExpenseAccount.getExpenseCode());
baseExpenseConfirmAmount.setExpenseMethod(baseExpenseAccount.getExpenseMethod());
baseExpenseConfirmAmount.setFullName(baseExpenseAccount.getFullName());
mmap.put("baseExpenseAccount", baseExpenseConfirmAmount);
return prefix + "/confirmPayment";
}
@RequestMapping("/saveComfrimPayment")
@ResponseBody
public AjaxResult confirmExpense(BaseExpenseConfirmAmount baseExpenseConfirmAmount) throws Exception {
return toAjax(baseExpenseConfirmAmountService.insertBaseExpenseConfirmAmount(baseExpenseConfirmAmount));
}
} }

151
ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseExpenseConfirmAmountController.java

@ -0,0 +1,151 @@
package com.ruoyi.system.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.BaseExpenseConfirmAmount;
import com.ruoyi.system.service.IBaseExpenseConfirmAmountService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 报销打款记录Controller
*
* @author zhang
* @date 2024-09-06
*/
@Controller
@RequestMapping("/system/BaseExpenseConfirmAmount")
public class BaseExpenseConfirmAmountController extends BaseController
{
private String prefix = "system/BaseExpenseConfirmAmount";
@Autowired
private IBaseExpenseConfirmAmountService baseExpenseConfirmAmountService;
@RequiresPermissions("system:BaseExpenseConfirmAmount:view")
@GetMapping()
public String BaseExpenseConfirmAmount()
{
return prefix + "/BaseExpenseConfirmAmount";
}
/**
* 查询报销打款记录列表
*/
@RequiresPermissions("system:BaseExpenseConfirmAmount:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(BaseExpenseConfirmAmount baseExpenseConfirmAmount)
{
startPage();
List<BaseExpenseConfirmAmount> list = baseExpenseConfirmAmountService.selectBaseExpenseConfirmAmountList(baseExpenseConfirmAmount);
return getDataTable(list);
}
/**
* 导出报销打款记录列表
*/
@RequiresPermissions("system:BaseExpenseConfirmAmount:export")
@Log(title = "报销打款记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(BaseExpenseConfirmAmount baseExpenseConfirmAmount)
{
List<BaseExpenseConfirmAmount> list = baseExpenseConfirmAmountService.selectBaseExpenseConfirmAmountList(baseExpenseConfirmAmount);
ExcelUtil<BaseExpenseConfirmAmount> util = new ExcelUtil<BaseExpenseConfirmAmount>(BaseExpenseConfirmAmount.class);
return util.exportExcel(list, "报销打款记录数据");
}
/**
* 新增报销打款记录
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存报销打款记录
*/
@RequiresPermissions("system:BaseExpenseConfirmAmount:add")
@Log(title = "报销打款记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(BaseExpenseConfirmAmount baseExpenseConfirmAmount)
{
return toAjax(baseExpenseConfirmAmountService.insertBaseExpenseConfirmAmount(baseExpenseConfirmAmount));
}
/**
* 修改报销打款记录
*/
@GetMapping("/edit/{expenseAmountId}")
public String edit(@PathVariable("expenseAmountId") Long expenseAmountId, ModelMap mmap)
{
BaseExpenseConfirmAmount baseExpenseConfirmAmount = baseExpenseConfirmAmountService.selectBaseExpenseConfirmAmountById(expenseAmountId);
mmap.put("baseExpenseConfirmAmount", baseExpenseConfirmAmount);
return prefix + "/edit";
}
/**
* 修改保存报销打款记录
*/
@RequiresPermissions("system:BaseExpenseConfirmAmount:edit")
@Log(title = "报销打款记录", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(BaseExpenseConfirmAmount baseExpenseConfirmAmount)
{
return toAjax(baseExpenseConfirmAmountService.updateBaseExpenseConfirmAmount(baseExpenseConfirmAmount));
}
/**
* 删除报销打款记录
*/
@RequiresPermissions("system:BaseExpenseConfirmAmount:remove")
@Log(title = "报销打款记录", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(baseExpenseConfirmAmountService.deleteBaseExpenseConfirmAmountByIds(ids));
}
/**
* 作废报销打款记录
*/
@RequiresPermissions("system:BaseExpenseConfirmAmount:cancel")
@Log(title = "报销打款记录", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(baseExpenseConfirmAmountService.cancelBaseExpenseConfirmAmountById(id));
}
/**
* 恢复报销打款记录
*/
@RequiresPermissions("system:BaseExpenseConfirmAmount:restore")
@Log(title = "报销打款记录", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(baseExpenseConfirmAmountService.restoreBaseExpenseConfirmAmountById(id));
}
}

117
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseExpenseConfirmAmount.java

@ -0,0 +1,117 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 报销打款记录对象 base_expense_confirm_amount
*
* @author zhang
* @date 2024-09-06
*/
public class BaseExpenseConfirmAmount extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 打款记录id */
private Long expenseAmountId;
/** 关联打款记录报销单号 */
@Excel(name = "关联打款记录报销单号")
private String expenseCode;
/** 打款记录时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "打款记录时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date expenseDate;
/** 报销类型 */
@Excel(name = "报销类型")
private String expenseMethod;
/** 报销人 */
@Excel(name = "报销人")
private String fullName;
/** 打款金额 */
@Excel(name = "打款金额")
private BigDecimal amount;
public void setExpenseAmountId(Long expenseAmountId)
{
this.expenseAmountId = expenseAmountId;
}
public Long getExpenseAmountId()
{
return expenseAmountId;
}
public void setExpenseCode(String expenseCode)
{
this.expenseCode = expenseCode;
}
public String getExpenseCode()
{
return expenseCode;
}
public void setExpenseDate(Date expenseDate)
{
this.expenseDate = expenseDate;
}
public Date getExpenseDate()
{
return expenseDate;
}
public String getExpenseMethod() {
return expenseMethod;
}
public void setExpenseMethod(String expenseMethod) {
this.expenseMethod = expenseMethod;
}
public void setFullName(String fullName)
{
this.fullName = fullName;
}
public String getFullName()
{
return fullName;
}
public void setAmount(BigDecimal amount)
{
this.amount = amount;
}
public BigDecimal getAmount()
{
return amount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("expenseAmountId", getExpenseAmountId())
.append("expenseCode", getExpenseCode())
.append("expenseDate", getExpenseDate())
.append("expenseMethod", getExpenseMethod())
.append("fullName", getFullName())
.append("amount", getAmount())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("remark", getRemark())
.toString();
}
}

18
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountChildMapper.java

@ -1,6 +1,8 @@
package com.ruoyi.system.mapper; package com.ruoyi.system.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.system.domain.BaseExpenseAccountChild; import com.ruoyi.system.domain.BaseExpenseAccountChild;
/** /**
@ -19,6 +21,21 @@ public interface BaseExpenseAccountChildMapper
*/ */
public BaseExpenseAccountChild selectBaseExpenseAccountChildById(Long expenseChildId); public BaseExpenseAccountChild selectBaseExpenseAccountChildById(Long expenseChildId);
/**
* 查询报销单分类子
*
* @param expenseCode 报销单分类编号
* @return 报销单分类子
*/
public List<BaseExpenseAccountChild> selectBaseExpenseAccountChildByExpenseCode(String expenseCode);
/**
* 根据报销单分类编号查询报销单分类子
* @param map
* @return
*/
public List<BaseExpenseAccountChild> selectBaseExpenseChildListByCodePage(Map<String, Object> map);
/** /**
* 查询报销单分类子列表 * 查询报销单分类子列表
* *
@ -107,5 +124,4 @@ public interface BaseExpenseAccountChildMapper
*/ */
public int deleteBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes); public int deleteBaseExpenseAccountChildByExpenseCodes(String[] expenseCodes);
} }

2
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseAccountMapper.java

@ -105,4 +105,6 @@ public interface BaseExpenseAccountMapper
*/ */
public Integer deleteBaseExpenseAccountByExpenseCode(String expenseCode); public Integer deleteBaseExpenseAccountByExpenseCode(String expenseCode);
BaseExpenseAccount selectBaseExpenseAccountByCode(String expenseCode);
} }

81
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/BaseExpenseConfirmAmountMapper.java

@ -0,0 +1,81 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.BaseExpenseConfirmAmount;
/**
* 报销打款记录Mapper接口
*
* @author zhang
* @date 2024-09-06
*/
public interface BaseExpenseConfirmAmountMapper
{
/**
* 查询报销打款记录
*
* @param expenseAmountId 报销打款记录ID
* @return 报销打款记录
*/
public BaseExpenseConfirmAmount selectBaseExpenseConfirmAmountById(Long expenseAmountId);
public List<BaseExpenseConfirmAmount> selectBaseExpenseConfirmAmountByExpenseCode(String expenseCode);
/**
* 查询报销打款记录列表
*
* @param baseExpenseConfirmAmount 报销打款记录
* @return 报销打款记录集合
*/
public List<BaseExpenseConfirmAmount> selectBaseExpenseConfirmAmountList(BaseExpenseConfirmAmount baseExpenseConfirmAmount);
/**
* 新增报销打款记录
*
* @param baseExpenseConfirmAmount 报销打款记录
* @return 结果
*/
public int insertBaseExpenseConfirmAmount(BaseExpenseConfirmAmount baseExpenseConfirmAmount);
/**
* 修改报销打款记录
*
* @param baseExpenseConfirmAmount 报销打款记录
* @return 结果
*/
public int updateBaseExpenseConfirmAmount(BaseExpenseConfirmAmount baseExpenseConfirmAmount);
/**
* 删除报销打款记录
*
* @param expenseAmountId 报销打款记录ID
* @return 结果
*/
public int deleteBaseExpenseConfirmAmountById(Long expenseAmountId);
public int deleteBaseExpenseConfirmAmountByCode(String expenseCode);
/**
* 批量删除报销打款记录
*
* @param expenseAmountIds 需要删除的数据ID
* @return 结果
*/
public int deleteBaseExpenseConfirmAmountByIds(String[] expenseAmountIds);
/**
* 作废报销打款记录
*
* @param expenseAmountId 报销打款记录ID
* @return 结果
*/
public int cancelBaseExpenseConfirmAmountById(Long expenseAmountId);
/**
* 恢复报销打款记录
*
* @param expenseAmountId 报销打款记录ID
* @return 结果
*/
public int restoreBaseExpenseConfirmAmountById(Long expenseAmountId);
}

33
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountChildServiceImpl.java

@ -1,12 +1,17 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import java.io.IOException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.*;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseExpenseAccountChildMapper; import com.ruoyi.system.mapper.BaseExpenseAccountChildMapper;
import com.ruoyi.system.domain.BaseExpenseAccountChild;
import com.ruoyi.system.service.IBaseExpenseAccountChildService; import com.ruoyi.system.service.IBaseExpenseAccountChildService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
@ -143,4 +148,30 @@ public class BaseExpenseAccountChildServiceImpl implements IBaseExpenseAccountCh
{ {
return baseExpenseAccountChildMapper.restoreBaseExpenseAccountChildById(expenseChildId); return baseExpenseAccountChildMapper.restoreBaseExpenseAccountChildById(expenseChildId);
} }
@Override
public List<BaseExpenseAccountChild> selectBaseExpenseAccountChildByExpenseCode(String expenseCode) {
return baseExpenseAccountChildMapper.selectBaseExpenseAccountChildByExpenseCode(expenseCode);
}
@Override
public Map<String, Object> exportTemplate(List<BaseExpenseAccountChild> baseExpenseAccountChildList) throws NoSuchBeanDefinitionException, IOException {
Map<String, Object> map = new HashMap<>();
//需要传输导出的值有:借方科目,开户银行,
//现在时间截取后 年,月,日, 格式为转换 yyyy MM dd,
//凭证信息批量:包含收款摘要,金额字符串截取,位数从百万开始,百万,十万,万,千,百,十,元,角,分。小数点后俩位为角,分,小数点不需要显示,
//将以上信息通过map传输出去
//接收拆分的数字
return map;
}
@Override
public List<BaseExpenseAccountChild> selectBaseExpenseChildListByCodePage(String expenseCode, int pageNum, int pageSize){
Map<String, Object> params = new HashMap<>();
params.put("code",expenseCode);
params.put("pageNum",pageNum);
params.put("pageSize",pageSize);
return baseExpenseAccountChildMapper.selectBaseExpenseChildListByCodePage(params);
}
} }

6
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseAccountServiceImpl.java

@ -317,7 +317,6 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
SysUser user = ShiroUtils.getSysUser(); SysUser user = ShiroUtils.getSysUser();
baseExpenseAccount.setApplyUser(user.getLoginName()); baseExpenseAccount.setApplyUser(user.getLoginName());
baseExpenseAccount.setApplyTime(DateUtils.getNowDate()); baseExpenseAccount.setApplyTime(DateUtils.getNowDate());
// insertBaseExpenseAccount(baseExpenseAccount);
if (baseExpenseAccount.getExpenseId() == null || baseExpenseAccount.getExpenseId() == 0){ if (baseExpenseAccount.getExpenseId() == null || baseExpenseAccount.getExpenseId() == 0){
insertBaseExpenseAccount(baseExpenseAccount); insertBaseExpenseAccount(baseExpenseAccount);
} }
@ -414,4 +413,9 @@ public class BaseExpenseAccountServiceImpl implements IBaseExpenseAccountService
public Object getId() { public Object getId() {
return redisCache.generateBillNo("BX"); return redisCache.generateBillNo("BX");
} }
@Override
public BaseExpenseAccount selectBaseExpenseAccountByCode(String expenseCode) {
return baseExpenseAccountMapper.selectBaseExpenseAccountByCode(expenseCode);
}
} }

126
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseConfirmAmountServiceImpl.java

@ -0,0 +1,126 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseExpenseConfirmAmountMapper;
import com.ruoyi.system.domain.BaseExpenseConfirmAmount;
import com.ruoyi.system.service.IBaseExpenseConfirmAmountService;
import com.ruoyi.common.core.text.Convert;
/**
* 报销打款记录Service业务层处理
*
* @author zhang
* @date 2024-09-06
*/
@Service
public class BaseExpenseConfirmAmountServiceImpl implements IBaseExpenseConfirmAmountService
{
@Autowired
private BaseExpenseConfirmAmountMapper baseExpenseConfirmAmountMapper;
/**
* 查询报销打款记录
*
* @param expenseAmountId 报销打款记录ID
* @return 报销打款记录
*/
@Override
public BaseExpenseConfirmAmount selectBaseExpenseConfirmAmountById(Long expenseAmountId)
{
return baseExpenseConfirmAmountMapper.selectBaseExpenseConfirmAmountById(expenseAmountId);
}
/**
* 查询报销打款记录列表
*
* @param baseExpenseConfirmAmount 报销打款记录
* @return 报销打款记录
*/
@Override
public List<BaseExpenseConfirmAmount> selectBaseExpenseConfirmAmountList(BaseExpenseConfirmAmount baseExpenseConfirmAmount)
{
return baseExpenseConfirmAmountMapper.selectBaseExpenseConfirmAmountList(baseExpenseConfirmAmount);
}
/**
* 新增报销打款记录
*
* @param baseExpenseConfirmAmount 报销打款记录
* @return 结果
*/
@Override
public int insertBaseExpenseConfirmAmount(BaseExpenseConfirmAmount baseExpenseConfirmAmount)
{
baseExpenseConfirmAmount.setCreateTime(DateUtils.getNowDate());
String loginName = ShiroUtils.getLoginName();
baseExpenseConfirmAmount.setCreateBy(loginName);
return baseExpenseConfirmAmountMapper.insertBaseExpenseConfirmAmount(baseExpenseConfirmAmount);
}
/**
* 修改报销打款记录
*
* @param baseExpenseConfirmAmount 报销打款记录
* @return 结果
*/
@Override
public int updateBaseExpenseConfirmAmount(BaseExpenseConfirmAmount baseExpenseConfirmAmount)
{
baseExpenseConfirmAmount.setUpdateTime(DateUtils.getNowDate());
String loginName = ShiroUtils.getLoginName();
baseExpenseConfirmAmount.setUpdateBy(loginName);
return baseExpenseConfirmAmountMapper.updateBaseExpenseConfirmAmount(baseExpenseConfirmAmount);
}
/**
* 删除报销打款记录对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteBaseExpenseConfirmAmountByIds(String ids)
{
return baseExpenseConfirmAmountMapper.deleteBaseExpenseConfirmAmountByIds(Convert.toStrArray(ids));
}
/**
* 删除报销打款记录信息
*
* @param expenseAmountId 报销打款记录ID
* @return 结果
*/
@Override
public int deleteBaseExpenseConfirmAmountById(Long expenseAmountId)
{
return baseExpenseConfirmAmountMapper.deleteBaseExpenseConfirmAmountById(expenseAmountId);
}
/**
* 作废报销打款记录
*
* @param expenseAmountId 报销打款记录ID
* @return 结果
*/
@Override
public int cancelBaseExpenseConfirmAmountById(Long expenseAmountId)
{
return baseExpenseConfirmAmountMapper.cancelBaseExpenseConfirmAmountById(expenseAmountId);
}
/**
* 恢复报销打款记录信息
*
* @param expenseAmountId 报销打款记录ID
* @return 结果
*/
@Override
public int restoreBaseExpenseConfirmAmountById(Long expenseAmountId)
{
return baseExpenseConfirmAmountMapper.restoreBaseExpenseConfirmAmountById(expenseAmountId);
}
}

9
ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountChildMapper.xml

@ -50,7 +50,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectBaseExpenseAccountChildVo"/> <include refid="selectBaseExpenseAccountChildVo"/>
where expense_child_id = #{expenseChildId} where expense_child_id = #{expenseChildId}
</select> </select>
<select id="selectBaseExpenseAccountChildByExpenseCode" parameterType="String" resultMap="BaseExpenseAccountChildResult">
<include refid="selectBaseExpenseAccountChildVo"/>
where expense_code = #{expenseCode}
</select>
<select id="selectBaseExpenseChildListByCodePage" parameterType="map" resultMap="BaseExpenseAccountChildResult">
<include refid="selectBaseExpenseAccountChildVo"/>
where expense_code = #{code} limit #{start} offset #{pageSize}
</select>
<insert id="insertBaseExpenseAccountChild" parameterType="BaseExpenseAccountChild" useGeneratedKeys="true" keyProperty="expenseChildId"> <insert id="insertBaseExpenseAccountChild" parameterType="BaseExpenseAccountChild" useGeneratedKeys="true" keyProperty="expenseChildId">
insert into base_expense_account_child insert into base_expense_account_child
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

53
ruoyi-admin/src/main/resources/mapper/system/BaseExpenseAccountMapper.xml

@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="applyTitle" column="apply_title" /> <result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" /> <result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" /> <result property="applyTime" column="apply_time" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
</resultMap> </resultMap>
@ -51,15 +51,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccountVo" resultMap="BaseExpenseAccountResult"> <select id="selectBaseExpenseAccountList" parameterType="BaseExpenseAccountVo" resultMap="BaseExpenseAccountResult">
select b.expense_id, b.audit_status, b.manager_audit_status, b.finance_audit_status, select b.expense_id, b.audit_status, b.manager_audit_status, b.finance_audit_status,
b.expense_code, b.deptName, b.postName, b.fullName, b.expense_method, b.is_purchase_outsource, b.expense_code, b.deptName, b.postName, b.fullName, b.expense_method, b.is_purchase_outsource,
b.supplier_code, b.corporate_payee, b.corporate_receiving_account, b.public_account_banks, b.supplier_code, b.corporate_payee, b.corporate_receiving_account, b.public_account_banks,
b.apply_user, b.create_by, b.create_time, b.update_by, b.update_time, b.remark, b.use_status,b.del_flag, b.apply_user, b.create_by, b.create_time, b.update_by, b.update_time, b.remark, b.use_status, b.del_flag,
b.instance_id, b.instance_type, p.dict_value as instance_type_name, b.submit_instance_id, b.cancel_instance_id, b.restore_instance_id, b.instance_id, b.instance_type, p.dict_value as instance_type_name, b.submit_instance_id, b.cancel_instance_id, b.restore_instance_id,
b.apply_title, b.apply_user, b.apply_time b.apply_title, b.apply_user, b.apply_time
from base_expense_account as b from base_expense_account as b
left join( left join (
select dict_value,dict_label from sys_dict_data select dict_value, dict_label from sys_dict_data where dict_type = 'processType'
where dict_type = 'processType'
) as p ) as p
on b.instance_type = p.dict_value on b.instance_type = p.dict_value
<where> <where>
@ -69,7 +68,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="expenseCode != null and expenseCode != ''"> and b.expense_code = #{expenseCode}</if> <if test="expenseCode != null and expenseCode != ''"> and b.expense_code = #{expenseCode}</if>
<if test="expenseMethod != null and expenseMethod != ''"> and b.expense_method = #{expenseMethod}</if> <if test="expenseMethod != null and expenseMethod != ''"> and b.expense_method = #{expenseMethod}</if>
<if test="useStatus != null and useStatus != ''"> and b.use_status = #{useStatus}</if> <if test="useStatus != null and useStatus != ''"> and b.use_status = #{useStatus}</if>
<if test="auditStatus != null and auditStatus != ''"> and b.audit_status = #{auditStatus}</if>
<if test="instanceId != null and instanceId != ''"> and b.instance_id = #{instanceId}</if> <if test="instanceId != null and instanceId != ''"> and b.instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and b.instance_type = #{instanceType}</if> <if test="instanceType != null and instanceType != ''"> and b.instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and b.submit_instance_id = #{submitInstanceId}</if> <if test="submitInstanceId != null and submitInstanceId != ''"> and b.submit_instance_id = #{submitInstanceId}</if>
@ -79,29 +77,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyUser != null and applyUser != ''"> and b.apply_user = #{applyUser}</if> <if test="applyUser != null and applyUser != ''"> and b.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and b.apply_time = #{applyTime}</if> <if test="applyTime != null "> and b.apply_time = #{applyTime}</if>
<if test="keyword != null and keyword != ''"> and b.expense_code like concat('%',#{keyword},'%')</if> <if test="keyword != null and keyword != ''"> and b.expense_code like concat('%',#{keyword},'%')</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> <if test="params.beginCreateTime != null and params.endCreateTime != null and params.endCreateTime != ''">
and b.create_time between #{params.beginCreateTime} and #{params.endCreateTime} and b.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if> </if>
<if test="params.costType != null"> <if test="(params.costType != null and params.costType != '')
and expense_code in ( or (params.evectionCode != null and params.evectionCode != '')
select expense_code or (params.costSmallType != null and params.costSmallType != '')
from ck_equipCodeChild or (params.outsourceCode != null and params.outsourceCode != '')
<where> or (params.purchaseCode != null and params.purchaseCode != '')">
<if test="params.costType != null">and cost_type = #{params.costType}</if> and b.expense_code in (
<if test="params.costSmallType != null">and cost_small_type = #{params.costTypeName}</if> select expense_code from base_expense_account_child
<if test="params.evectionCode != null">and evection_code like concat('%',#{params.evectionCode},'%') </if> <where>
<if test="params.outsourceCode != null">and outsource_code like concat('%',#{params.outsourceCode},'%') </if> <if test="params.costType != null and params.costType != ''">and cost_type = #{params.costType}</if>
<if test="params.purchaseCode != null">and purchase_code like concat('%',#{params.purchaseCode},'%') </if> <if test="params.costSmallType != null and params.costSmallType != ''">and cost_small_type = #{params.costSmallType}</if>
</where> <if test="params.evectionCode != null and params.evectionCode != ''">and evection_code like concat('%',#{params.evectionCode},'%')</if>
<if test="params.outsourceCode != null and params.outsourceCode != ''">and outsource_code like concat('%',#{params.outsourceCode},'%')</if>
<if test="params.purchaseCode != null and params.purchaseCode != ''">and purchase_code like concat('%',#{params.purchaseCode},'%')</if>
</where>
) )
</if> </if>
</where> </where>
order by b.audit_status desc, b.create_time asc
</select> </select>
<select id="selectBaseExpenseAccountById" parameterType="Long" resultMap="BaseExpenseAccountResult"> <select id="selectBaseExpenseAccountById" parameterType="Long" resultMap="BaseExpenseAccountResult">
<include refid="selectBaseExpenseAccountVo"/> <include refid="selectBaseExpenseAccountVo"/>
where expense_id = #{expenseId} where expense_id = #{expenseId}
</select> </select>
<select id="selectBaseExpenseAccountByCode" parameterType="String" resultMap="BaseExpenseAccountResult">
<include refid="selectBaseExpenseAccountVo"/>
where expense_code = #{expenseCode}
</select>
<insert id="insertBaseExpenseAccount" parameterType="BaseExpenseAccount" useGeneratedKeys="true" keyProperty="expenseId"> <insert id="insertBaseExpenseAccount" parameterType="BaseExpenseAccount" useGeneratedKeys="true" keyProperty="expenseId">
insert into base_expense_account insert into base_expense_account
@ -237,5 +243,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{expenseCode} #{expenseCode}
</foreach> </foreach>
</delete> </delete>
</mapper> </mapper>

111
ruoyi-admin/src/main/resources/mapper/system/BaseExpenseConfirmAmountMapper.xml

@ -0,0 +1,111 @@
<?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.system.mapper.BaseExpenseConfirmAmountMapper">
<resultMap type="BaseExpenseConfirmAmount" id="BaseExpenseConfirmAmountResult">
<result property="expenseAmountId" column="expense_amount_id" />
<result property="expenseCode" column="expense_code" />
<result property="expenseDate" column="expense_date" />
<result property="expenseMethod" column="expense_method" />
<result property="fullName" column="full_name" />
<result property="amount" column="amount" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectBaseExpenseConfirmAmountVo">
select expense_amount_id, expense_code, expense_date, expense_method,
full_name, amount, create_time, create_by, update_time, update_by,
remark from base_expense_confirm_amount
</sql>
<select id="selectBaseExpenseConfirmAmountList" parameterType="BaseExpenseConfirmAmount" resultMap="BaseExpenseConfirmAmountResult">
<include refid="selectBaseExpenseConfirmAmountVo"/>
<where>
<if test="expenseCode != null and expenseCode != ''"> and expense_code = #{expenseCode}</if>
<if test="expenseDate != null "> and expense_date = #{expenseDate}</if>
<if test="expenseMethod != null and expenseMethod != ''"> and expense_method = #{expenseMethod}</if>
<if test="fullName != null and fullName != ''"> and full_name like concat('%', #{fullName}, '%')</if>
<if test="amount != null "> and amount = #{amount}</if>
</where>
</select>
<select id="selectBaseExpenseConfirmAmountById" parameterType="Long" resultMap="BaseExpenseConfirmAmountResult">
<include refid="selectBaseExpenseConfirmAmountVo"/>
where expense_amount_id = #{expenseAmountId}
</select>
<select id="selectBaseExpenseConfirmAmountByExpenseCode" parameterType="String" resultMap="BaseExpenseConfirmAmountResult">
<include refid="selectBaseExpenseConfirmAmountVo"/>
where expense_code = #{expenseCode}
</select>
<insert id="insertBaseExpenseConfirmAmount" parameterType="BaseExpenseConfirmAmount" useGeneratedKeys="true" keyProperty="expenseAmountId">
insert into base_expense_confirm_amount
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="expenseCode != null">expense_code,</if>
<if test="expenseDate != null">expense_date,</if>
<if test="expenseMethod != null">expense_method,</if>
<if test="fullName != null">full_name,</if>
<if test="amount != null">amount,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="expenseCode != null">#{expenseCode},</if>
<if test="expenseDate != null">#{expenseDate},</if>
<if test="expenseMethod != null">#{expenseMethod},</if>
<if test="fullName != null">#{fullName},</if>
<if test="amount != null">#{amount},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateBaseExpenseConfirmAmount" parameterType="BaseExpenseConfirmAmount">
update base_expense_confirm_amount
<trim prefix="SET" suffixOverrides=",">
<if test="expenseCode != null">expense_code = #{expenseCode},</if>
<if test="expenseDate != null">expense_date = #{expenseDate},</if>
<if test="expenseMethod != null">expense_method = #{expenseMethod},</if>
<if test="fullName != null">full_name = #{fullName},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where expense_amount_id = #{expenseAmountId}
</update>
<delete id="deleteBaseExpenseConfirmAmountById" parameterType="Long">
delete from base_expense_confirm_amount where expense_amount_id = #{expenseAmountId}
</delete>
<delete id="deleteBaseExpenseConfirmAmountByCode" parameterType="String">
delete from base_expense_confirm_amount where expense_code = #{expensecode}
</delete>
<delete id="deleteBaseExpenseConfirmAmountByIds" parameterType="String">
delete from base_expense_confirm_amount where expense_amount_id in
<foreach item="expenseAmountId" collection="array" open="(" separator="," close=")">
#{expenseAmountId}
</foreach>
</delete>
<update id="cancelBaseExpenseConfirmAmountById" parameterType="Long">
update base_expense_confirm_amount set del_flag = '1' where expense_amount_id = #{expenseAmountId}
</update>
<update id="restoreBaseExpenseConfirmAmountById" parameterType="Long">
update base_expense_confirm_amount set del_flag = '0' where expense_amount_id = #{expenseAmountId}
</update>
</mapper>

BIN
ruoyi-admin/src/main/resources/static/attachments/报销单.xlsx

Binary file not shown.

40
ruoyi-admin/src/main/resources/templates/system/baseExpense/baseExpense.html

@ -39,7 +39,7 @@
</select> </select>
</li> </li>
<li> <li>
<label>总经理审核状态:</label> <label>总经理状态:</label>
<select name="managerAuditStatus" th:with="type=${@dict.getType('auditStatus')}"> <select name="managerAuditStatus" th:with="type=${@dict.getType('auditStatus')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
@ -47,7 +47,7 @@
</select> </select>
</li> </li>
<li> <li>
<label>财务审核状态:</label> <label>财务状态:</label>
<select name="financeAuditStatus" th:with="type=${@dict.getType('auditStatus')}"> <select name="financeAuditStatus" th:with="type=${@dict.getType('auditStatus')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
@ -56,14 +56,14 @@
</li> </li>
<li> <li>
<label>成本类型:</label> <label>成本类型:</label>
<select id="costType" name="params.costType" th:with="childList=${@category.getChildByCode('costType')}" onchange="onCostTypeChange(this)"> <select id="costType" name="params[costType]" th:with="childList=${@category.getChildByCode('costType')}" onchange="onCostTypeChange(this)">
<option value="">所有</option> <option value="">所有</option>
<option th:each="chilld: ${childList}" th:value="${chilld.code}" th:text="${chilld.name}"></option> <option th:each="chilld: ${childList}" th:value="${chilld.code}" th:text="${chilld.name}"></option>
</select> </select>
</li> </li>
<li> <li>
<label>成本小类:</label> <label>成本小类:</label>
<select id="costSmallType" name="params.costSamllType"> <select id="costSmallType" name="params[costSamllType]">
<option value="">所有</option> <option value="">所有</option>
</select> </select>
</li> </li>
@ -112,6 +112,7 @@
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var loginName = [[${@permission.getPrincipalProperty('loginName')}]];
var auditStatusData = [[${@dict.getType('auditStatus')}]]; var auditStatusData = [[${@dict.getType('auditStatus')}]];
var expenseMethodData = [[${@dict.getType('sys_base_expense_method')}]]; var expenseMethodData = [[${@dict.getType('sys_base_expense_method')}]];
var finacialExpenseStatusDatas = [[${@dict.getType('finacialExpenseStatus')}]];
var prefix = ctx + "system/baseExpense"; var prefix = ctx + "system/baseExpense";
$(function() { $(function() {
@ -140,8 +141,10 @@
{title:'流程作废实例ID',field: 'cancelInstanceId',visible: false,align: 'center',}, {title:'流程作废实例ID',field: 'cancelInstanceId',visible: false,align: 'center',},
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false,align: 'center',}, {title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false,align: 'center',},
{title: '流程实例类型', field: 'instanceTypeName',visible: false,align: 'center',}, {title: '流程实例类型', field: 'instanceTypeName',visible: false,align: 'center',},
{field: 'applyUserName', title: '申请人',align: 'center',}, {title: '<span style="color: red;">申请人</span>',field: 'applyUserName', align: 'center',
{field: 'applyTime',title: '申请时间',align: 'center',}, formatter: function(value, row, index) {return '<span style="color: red;">' + (value ? value : "-") + '</span>';}
},
{title: '申请时间',field: 'applyTime',align: 'center',},
{title: '当前任务ID',field: 'taskId',visible: false,align: 'center',}, {title: '当前任务ID',field: 'taskId',visible: false,align: 'center',},
{title: '待办用户ID',field: 'todoUserId', visible: false,align: 'center',}, {title: '待办用户ID',field: 'todoUserId', visible: false,align: 'center',},
{title: '当前任务名称',field: 'taskName', {title: '当前任务名称',field: 'taskName',
@ -155,14 +158,14 @@
return $.table.selectDictLabel(auditStatusData, value); return $.table.selectDictLabel(auditStatusData, value);
} }
}, },
{title: '总经理审核状态',field: 'managerAuditStatus',align: 'center', {title: '总经理状态',field: 'managerAuditStatus',align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusData, value); return $.table.selectDictLabel(auditStatusData, value);
} }
}, },
{title: '财务审核状态',field: 'financeAuditStatus',align: 'center', {title: '财务状态',field: 'financeAuditStatus',align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusData, value); return $.table.selectDictLabel(finacialExpenseStatusDatas, value);
} }
}, },
{title: '报销单编号',field: 'expenseCode',align: 'center',}, {title: '报销单编号',field: 'expenseCode',align: 'center',},
@ -178,8 +181,8 @@
{title: '对公收款账户',field: 'corporateReceivingAccount',visible: false,align: 'center',}, {title: '对公收款账户',field: 'corporateReceivingAccount',visible: false,align: 'center',},
{title: '对公开户行',field: 'publicAccountBanks',visible: false,align: 'center',}, {title: '对公开户行',field: 'publicAccountBanks',visible: false,align: 'center',},
{title: '录入时间',field: 'createTime',align: 'center',}, {title: '录入时间',field: 'createTime',align: 'center',},
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',},
{title: '上次更新时间',field: 'updateTime',visible: false,align: 'center',}, {title: '上次更新时间',field: 'updateTime',align: 'center',},
{title: '备注',field: 'remark',visible: false,align: 'center',}, {title: '备注',field: 'remark',visible: false,align: 'center',},
{title: '使用状态',field: 'useStatus',visible: false,align: 'center',}, {title: '使用状态',field: 'useStatus',visible: false,align: 'center',},
{title: '操作',align: 'center', formatter: function (value, row, index) { {title: '操作',align: 'center', formatter: function (value, row, index) {
@ -205,6 +208,12 @@
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> '); actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> '); actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
} }
if(row.auditStatus=="1" && row.managerAuditStatus=="1") {
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="exportExpense(\'' + row.expenseId + '\')"><i class="fa fa-print"></i> 导出</a> ');
}
if(row.auditStatus=="1" && row.financeAuditStatus=="3" && row.managerAuditStatus=="1") {
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="financialExpenseAmount(\'' + row.expenseId + '\')"><i class="fa fa-print"></i> 确认打款</a>');
}
// 详情 // 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.expenseId + '\')"><i class="fa fa-eye"></i> 详情</a> '); actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.expenseId + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join(''); return actions.join('');
@ -257,6 +266,15 @@
} }
}); });
} }
//确认打款
function financialExpenseAmount(expenseId){
$.modal.open("确认打款",prefix + "/confirmExpense/" + expenseId);
}
/*导出报销单*/
function exportExpense(expenseId){
window.location.href = prefix + "/excelExpenseVoucher/" + expenseId;
}
</script> </script>
</body> </body>
</html> </html>

81
ruoyi-admin/src/main/resources/templates/system/baseExpense/confirmPayment.html

@ -0,0 +1,81 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('确认打款')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-baseExpense-confirmPayment" th:object="${baseExpenseAccount}">
<div class="form-group">
<label class="col-sm-3 control-label">报销单号:</label>
<div class="col-sm-8">
<input name="expenseCode" th:field="*{expenseCode}" type="text" readonly />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">报销人:</label>
<div class="col-sm-8">
<input name="fullName" th:field="*{fullName}" class="form-control" readonly/>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销方式:</label>
<div class="col-sm-6">
<select id="expenseMethod" name="expenseMethod" th:field="*{expenseMethod}"
class="form-control"
th:with="dictList=${@dict.getType('sys_base_expense_method')}" readonly >
<option th:each="dict : ${dictList}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">报销金额:</label>
<div class="col-sm-6">
<input name="amount" class="form-control" type="number" />
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">打款时间:</label>
<div class="input-group date">
<input id="expenseDate" name="expenseDate" class="form-control" />
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label">图片:</label>
<div class="input-group date">
<input id="photoUrl" name="photoUrl" class="form-control" />
</div>
</div>
</form>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var prefix = ctx + "system/baseExpense";
var baseExpense = [[${baseExpenseAccount}]];
$("#form-baseExpense-edit").validate({
focusCleanup: true,
});
$("input[name='expenseDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
function submitHandler() {
if ($.validate.form()) {
var formData = $("#form-baseExpense-confirmPayment").serialize();
$.operate.save(prefix + "/saveComfrimPayment", formData);
}
}
</script>
</body>
</html>

20
ruoyi-admin/src/main/resources/templates/system/baseExpense/edit.html

@ -97,7 +97,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-expense-edit"></table> <table id="bootstrap-sub-table-expense-edit" style="white-space:nowrap;"></table>
</div> </div>
</div> </div>
</div> </div>
@ -160,6 +160,22 @@
handleExpenseMethod(this); handleExpenseMethod(this);
loadSupplierCodes(); loadSupplierCodes();
}); });
function insertRow() {
$table.bootstrapTable('insertRow', {
index:0,
row: {
expenseChildId:'',
costType: "",
costSmallType:"",
purpose:'' ,
amounts: '',
expenseTime: '',
evectionCode:'' ,
purchaseCode:'',
outsourceCode: '',
}
})
}
function removeRow(index) { function removeRow(index) {
// 使用索引值移除行 // 使用索引值移除行
$('#bootstrap-sub-table-expense-edit').bootstrapTable('remove', { $('#bootstrap-sub-table-expense-edit').bootstrapTable('remove', {
@ -250,7 +266,7 @@
function submitHandler() { function submitHandler() {
if ($.validate.form()) { if ($.validate.form()) {
var tableData = $("#bootstrap-sub-table-expense-edit").bootstrapTable('getData'); var tableData = $("#bootstrap-sub-table-expense-edit").bootstrapTable('getData');
var formData = $("#form-baseExpense-add").serializeArray(); var formData = $("#form-baseExpense-edit").serializeArray();
var rows = tableData.length; var rows = tableData.length;
if(rows==0){ if(rows==0){
$.modal.alertWarning("子表数据不能为空!"); $.modal.alertWarning("子表数据不能为空!");

Loading…
Cancel
Save