diff --git a/ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/controller/BizTodoItemController.java b/ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/controller/BizTodoItemController.java index 5c00932e..5a770dda 100644 --- a/ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/controller/BizTodoItemController.java +++ b/ruoyi-activiti/src/main/java/com/ruoyi/process/todoitem/controller/BizTodoItemController.java @@ -9,10 +9,14 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.process.leave.domain.BizLeaveVo; +import com.ruoyi.process.leave.service.IBizLeaveService; import com.ruoyi.process.todoitem.domain.BizTodoItem; import com.ruoyi.process.todoitem.service.IBizTodoItemService; import org.activiti.engine.RuntimeService; import org.activiti.engine.TaskService; +import org.activiti.engine.runtime.ProcessInstance; +import org.activiti.engine.task.Task; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -42,6 +46,9 @@ public class BizTodoItemController extends BaseController { // @Autowired // private IBizLeaveService bizLeaveService; + @Autowired + private IBizLeaveService bizLeaveService; + @Autowired private TaskService taskService; @@ -70,11 +77,11 @@ public class BizTodoItemController extends BaseController { // Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); // String processInstanceId = task.getProcessInstanceId(); // ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult(); -// BizLeaveVo bizLeave = bizLeaveService.selectBizLeaveById(new Long(processInstance.getBusinessKey())); -// mmap.put("bizLeave", bizLeave); +//// BizLeaveVo bizLeave = bizLeaveService.selectBizLeaveById(new Long(processInstance.getBusinessKey())); +//// mmap.put("bizLeave", bizLeave); // mmap.put("taskId", taskId); -//// String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); -// return "process/" + module + "/" + formPageName; +// String verifyName = task.getTaskDefinitionKey().substring(0, 1).toUpperCase() + task.getTaskDefinitionKey().substring(1); +// return prefix + "/task" + verifyName; // } @RequiresPermissions("process:todoitem:view") @@ -283,10 +290,4 @@ public class BizTodoItemController extends BaseController { result.put("total", total); return result; } - - - - - - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialReceivablesController.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialReceivablesController.java index 3b98ed89..301745be 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialReceivablesController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/controller/FinancialReceivablesController.java @@ -1,11 +1,24 @@ package com.ruoyi.financial.controller; +import java.io.*; +import java.net.URLEncoder; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.builder.ExcelWriterBuilder; +import com.alibaba.excel.write.metadata.WriteSheet; import com.ruoyi.financial.domain.FinancialReceivablesRecords; import com.ruoyi.financial.service.IFinancialReceivablesRecordsService; +import org.apache.avalon.framework.service.ServiceException; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; @@ -17,6 +30,12 @@ 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; +import javax.servlet.http.HttpServletResponse; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.write.builder.ExcelWriterBuilder; +import com.alibaba.excel.write.metadata.WriteSheet; + /** * 财务应收账款Controller @@ -28,6 +47,7 @@ import com.ruoyi.common.core.page.TableDataInfo; @RequestMapping("/financial/receivables") public class FinancialReceivablesController extends BaseController { + private static final String CHARSET_UTF8 = "utf-8"; private String prefix = "financial/receivables"; @Autowired @@ -127,6 +147,49 @@ public class FinancialReceivablesController extends BaseController } return prefix + "/addReceivablesVoucher"; } + /**导出收款凭证*/ + @RequiresPermissions("financial:receivables:export") + @Log(title = "财务应收账款凭证", businessType = BusinessType.EXPORT) + @GetMapping("/excelReceivablesVoucher/{financialReceivablesId}") + public void excelReceivablesVoucher(@PathVariable("financialReceivablesId") Long financialReceivablesId,HttpServletResponse response) throws IOException { + FinancialReceivables financialReceivables = financialReceivablesService.selectFinancialReceivablesById(financialReceivablesId); + + + // 模版位置 + String name = "FinancialReceiptVoucherTemplate.xlsx"; + + // 设置响应头,指定文件名和文件类型 + response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("FinancialReceiptVoucher.xlsx", "UTF-8")); + response.setContentType("application/octet-stream"); + + InputStream inputStream = null; + try { + // 获取模板文件的输入流 + inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(name); + + if (inputStream == null) { + throw new FileNotFoundException("模板文件未找到:" + name); + } + + // 创建一个ExcelWriterBuilder对象,并指定输出流和输入流 + ExcelWriterBuilder writerBuilder = EasyExcel.write(response.getOutputStream()); + + // 创建一个WriteSheet对象,并指定模板中的Sheet编号 + WriteSheet writeSheet = EasyExcel.writerSheet(0).build(); + + // 将数据写入Excel文件 + writerBuilder.withTemplate(inputStream).sheet("sheet1").doFill(financialReceivables); + + } finally { + // 关闭输入流 + if (inputStream != null) { + inputStream.close(); + } + } + + // 刷新输出流 + response.flushBuffer(); + } /** * 新增保存销售订单创建收款凭证 @@ -241,4 +304,7 @@ public class FinancialReceivablesController extends BaseController return getDataTable(financialReceivablesRecords); } + + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivables.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivables.java index 5282706e..dbb648b2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivables.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivables.java @@ -6,10 +6,12 @@ import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.financial.domain.VO.FinancialReceivablesRecordsVO; +import lombok.Data; 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; +import org.springframework.context.annotation.EnableAspectJAutoProxy; /** * 财务应收账款对象 financial_receivables @@ -17,6 +19,7 @@ import com.ruoyi.common.core.domain.BaseEntity; * @author 刘晓旭 * @date 2024-05-08 */ +@Data public class FinancialReceivables extends BaseEntity { private static final long serialVersionUID = 1L; @@ -35,6 +38,9 @@ public class FinancialReceivables extends BaseEntity /** 关联销售订单号 */ @Excel(name = "关联销售订单号") private String salesOrderCode; + /*借方科目*/ + @Excel(name = "借方科目", readConverterExp="0=银行存款,1=现金") + private String debitAccount; /** 贷方科目 */ @Excel(name = "贷方科目") @@ -45,7 +51,7 @@ public class FinancialReceivables extends BaseEntity private String creditDetail; /** 开户银行 */ - @Excel(name = "开户银行") + @Excel(name = "开户银行",readConverterExp="0=中行基本户,建行一般户") private String openBank; /** 开户账号 */ @@ -113,10 +119,41 @@ public class FinancialReceivables extends BaseEntity @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") private Date operatingTime; + /*年*/ + private String year; + /*月*/ + private String month; + /*日*/ + private String day; + /** 收款备注 */ @Excel(name = "收款备注") private String receivablesRemark; + public String getYear() { + return year; + } + + public void setYear(String year) { + this.year = year; + } + + public String getMonth() { + return month; + } + + public void setMonth(String month) { + this.month = month; + } + + public String getDay() { + return day; + } + + public void setDay(String day) { + this.day = day; + } + /** 收款记录集合 */ List receivablesRecordsList; @@ -354,7 +391,6 @@ public class FinancialReceivables extends BaseEntity public void setReceivablesRecordsVOList(List receivablesRecordsVOList) { this.receivablesRecordsVOList = receivablesRecordsVOList; } - @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivablesRecords.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivablesRecords.java index 8c61c23d..82fb4c20 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivablesRecords.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialReceivablesRecords.java @@ -51,8 +51,18 @@ public class FinancialReceivablesRecords extends BaseEntity /** 收款备注 */ @Excel(name = "收款备注") private String receivablesRemark; + /*获取当前登录的账号*/ + private String operatingPerson; - public void setReceivablesRecordsId(Long receivablesRecordsId) + public String getOperatingPerson() { + return operatingPerson; + } + + public void setOperatingPerson(String operatingPerson) { + this.operatingPerson = operatingPerson; + } + + public void setReceivablesRecordsId(Long receivablesRecordsId) { this.receivablesRecordsId = receivablesRecordsId; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/VO/FinancialReceivablesRecordsVO.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/VO/FinancialReceivablesRecordsVO.java index b2c600ce..a210c343 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/VO/FinancialReceivablesRecordsVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/VO/FinancialReceivablesRecordsVO.java @@ -47,3 +47,5 @@ public class FinancialReceivablesRecordsVO extends BaseEntity { @Excel(name = "收款备注") private String receivablesRemark; } + + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java index 5dd24a68..d0dffa28 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java @@ -82,4 +82,12 @@ public interface FinancialTaxInvoiceHistoryMapper * @return 结果 */ List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode); + + /** + * 根据发票编号查询发票历史记录 + * + * @param taxInvoiceCode 发票编号 + * @return 结果 + */ + FinancialTaxInvoiceHistory selectInvoiceHistoryByInvoiceCode(String taxInvoiceCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialReceivablesService.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialReceivablesService.java index 1e0a6295..e7a6051e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialReceivablesService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialReceivablesService.java @@ -1,6 +1,8 @@ package com.ruoyi.financial.service; import java.util.List; +import java.util.Map; + import com.ruoyi.financial.domain.FinancialReceivables; /** @@ -87,4 +89,9 @@ public interface IFinancialReceivablesService * 销售订单审批完成后根据销售单号生成财务应收账款 * */ int generateReceivablesBySalesOrderCode(String salesOrderCode); + + /** + * 查询导出收款凭证 + */ + Map exportReceivables(FinancialReceivables financialReceivables); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java index f3e75552..575d3a4e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialReceivablesServiceImpl.java @@ -4,7 +4,9 @@ import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.utils.DateUtils; @@ -198,6 +200,18 @@ public class FinancialReceivablesServiceImpl implements IFinancialReceivablesSer } + @Override + public Map exportReceivables(FinancialReceivables financialReceivables) { + //获取应收账款列表 + FinancialReceivables financialReceivablesList = financialReceivablesMapper.selectFinancialReceivablesById(financialReceivables.getFinancialReceivablesId()); + FinancialReceivablesRecords financialReceivablesRecords = new FinancialReceivablesRecords(); + financialReceivablesRecords.setFinancialReceivablesCode(financialReceivablesList.getFinancialReceivablesCode()); + //再获取对应应收账款的收款凭证列表 + List financialReceivablesRecordsList = receivablesRecordsMapper.selectFinancialReceivablesRecordsList(financialReceivablesRecords); + Map map = new HashMap<>(); + return map; + } + /** * 删除财务应收账款对象 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java index ae49d7ef..8d9c3494 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceServiceImpl.java @@ -53,6 +53,7 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi @Autowired private RedisCache redisCache; + /** * 查询国税发票 * @@ -263,15 +264,31 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi /** * 审核国税发票 */ + @Transactional(rollbackFor = Exception.class) @Override - public int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice,String taxInvoiceStatus) { - if ("1".equals(taxInvoiceStatus)){ - //审核通过 - financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus); - return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); - }else { - financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus); - return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); - } + public int auditInvoiceFinancialTaxInvoice(FinancialTaxInvoice financialTaxInvoice, String taxInvoiceStatus) { + String loginName = ShiroUtils.getLoginName(); + String taxInvoiceCode = financialTaxInvoice.getTaxInvoiceCode(); + FinancialTaxInvoiceHistory invoiceHistory = invoiceHistoryMapper.selectInvoiceHistoryByInvoiceCode(taxInvoiceCode); + invoiceHistory.setUpdateTime(new Date()); + invoiceHistory.setUpdateBy(loginName); + + financialTaxInvoice.setUpdateTime(new Date()); + financialTaxInvoice.setUpdateBy(loginName); + if ("1".equals(taxInvoiceStatus)) { + //审核通过 + invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus); + invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory); + + financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus); + return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); + } else { + //审核拒绝 + invoiceHistory.setTaxInvoiceStatus(taxInvoiceStatus); + invoiceHistoryMapper.updateFinancialTaxInvoiceHistory(invoiceHistory); + + financialTaxInvoice.setTaxInvoiceStatus(taxInvoiceStatus); + return financialTaxInvoiceMapper.updateFinancialTaxInvoice(financialTaxInvoice); + } } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/remind/controller/RemindController.java b/ruoyi-admin/src/main/java/com/ruoyi/remind/controller/RemindController.java index ffcac05d..a8101efb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/remind/controller/RemindController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/remind/controller/RemindController.java @@ -1,13 +1,27 @@ package com.ruoyi.remind.controller; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.remind.domain.Remind; +import com.ruoyi.remind.mapper.RemindMapper; import com.ruoyi.remind.service.RemindService; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.system.service.ISysUserService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; 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.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -16,23 +30,147 @@ import java.util.Map; * Created by sunzhenhu on 2021/5/28 10:52 */ @RequestMapping("/remind") -public class RemindController { +@Controller +public class RemindController extends BaseController { + Logger logger = LoggerFactory.getLogger(getClass()); private String prefix = "remind"; @Autowired private RemindService remindService; -// @Autowired -// private RemindMapper remindMapper; - - @RequestMapping("/getRemindListNoPaging") - @ResponseBody - public List getRemindListNoPaging(HttpServletRequest request) { - Map paraMap = new HashMap(); - paraMap.put("receiver", ShiroUtils.getLoginName()); - paraMap.put("isView", "0"); - List list = remindService.getRemindListNoPaging(paraMap); - return list; - } + @Autowired + private SysUserMapper userMapper; + @Autowired + private RemindMapper remindMapper; + @GetMapping() + public String remind(ModelMap mmap) { + mmap.put("currentUser", ShiroUtils.getSysUser()); + return prefix + "/remind"; + } + @GetMapping("/view/{id}") + public String edit(@PathVariable("id")String id, ModelMap mmap) { + System.out.println("id="+id); + mmap.put("id",id); + return prefix + "/view"; + } + // + @RequestMapping("/getRemindList") + @ResponseBody + public Map getRemindList(Integer pageIndex, Integer pageSize, HttpServletRequest request) { + try { + request.setCharacterEncoding("UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + Map paraMap = new HashMap(); + + // 分页参数 + paraMap.put("pageIndex", pageIndex); + paraMap.put("pageSize", pageSize); + // 查询参数 + String fromBegin = request.getParameter("fromBegin"); + String toEnd = request.getParameter("toEnd"); + String vague = request.getParameter("vague"); + paraMap.put("fromBegin", fromBegin); + paraMap.put("toEnd", toEnd); + paraMap.put("vague", vague); + if (!SysUser.isAdmin(ShiroUtils.getUserId())) { + paraMap.put("receiver",ShiroUtils.getLoginName()); + } + Map result = new HashMap(); + List list = remindService.getRemindList(paraMap); + for(Remind remind:list) { + SysUser remindUser = userMapper.selectUserByLoginName(remind.getRemind()); + remind.setRemindName(remindUser.getUserName()); + remind.setRemindDeptName(remindUser.getDept().getDeptName()); + SysUser receiver = userMapper.selectUserByLoginName(remind.getReceiver()); + remind.setReceiverName(receiver.getUserName()); + } + long total = remindService.getRemindTotal(paraMap); + result.put("rows", list); + result.put("total", total); + return result; + } + + @RequestMapping("/getRemindListNoPaging") + @ResponseBody + public List getRemindListNoPaging(HttpServletRequest request) { + startPage(); + Map paraMap = new HashMap(); + paraMap.put("receiver",ShiroUtils.getLoginName()); + paraMap.put("isView", "0"); + paraMap.put("pageIndex", 1); + paraMap.put("pageSize", 11); + List list = remindService.getRemindListNoPaging(paraMap); + return list; + } -} + + // 结账资料申请单(浦东)主表查询单个对象 + @RequestMapping("/getRemind") + @ResponseBody + public Remind getRemind(HttpServletRequest request) { + String id = request.getParameter("id"); + Remind mc = remindService.getRemind(id); + SysUser remindUser = userMapper.selectUserByLoginName(mc.getRemind()); + mc.setRemindName(remindUser.getUserName()); + mc.setRemindDeptName(remindUser.getDept().getDeptName()); + return mc; + } + + //添 + @RequestMapping("/edit") + @ResponseBody + public String edit(HttpServletRequest request) { + String id = request.getParameter("id"); + String loginName = ShiroUtils.getLoginName(); + Remind remind = remindService.getRemind(id); + if(remind.getReceiver().equals(loginName)) { + Remind remind2 = new Remind(); + remind2.setId(Long.parseLong(id)); + remind2.setIsView("1"); + remindService.edit(remind2); + } + return "success"; + } + /** + * 发票申请单 综合管理部节点推送消息给维保部负责人 + * @param request + * @return + */ + @RequestMapping("/sendInvoiceRemind") + @ResponseBody + public Map sendInvoiceRemind(HttpServletRequest request){ + Map result = new HashMap(); + String msg = ""; + String gmUserId = request.getParameter("gmUserId"); + String keyNo = request.getParameter("keyNo"); + String companyNames = request.getParameter("companyNames"); + String formName = "发票申请单"; + Integer remindCount = remindMapper.getRemindCountByCondi(formName, keyNo); + if(remindCount>0) { + msg = "这笔发票申请单的提醒已推送过维保部负责人,无法重复推送!"; + }else { + Remind remind = new Remind(); + remind.setRemind(gmUserId); + String wbDeptLeaderId = userMapper.selectUserByUniqueRolekey("wbDeptLeader"); + remind.setReceiver(wbDeptLeaderId); + SysUser finance = userMapper.selectUserByLoginName(gmUserId); + remind.setRemindDept(finance.getDeptId()+""); + remind.setRemindDate(DateUtils.getTime()); + remind.setFormUrl("invoiceForm/edit/" + keyNo); + remind.setFormName(formName); + remind.setRemindContent("公司名称为["+companyNames+"]的这些公司的发票到了,请来我这里拿发票!!!"); + remind.setIsView("0"); + int add = remindService.add(remind); + if(add<1) { + msg = "提醒推送失败,请联系系统管理员!"; + }else { + msg = "提醒推送成功!"; + } + } + result.put("msg", msg); + return result; + } + } + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java index 167a7301..f03e2828 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java @@ -123,41 +123,9 @@ public class SysSalesOrderController extends BaseController @ResponseBody public TableDataInfo list(SysSalesOrderVo sysSalesOrderVo) { - try { startPage(); List list = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo); - SysUser curUser = ShiroUtils.getSysUser(); - String loginName = ShiroUtils.getLoginName(); - Long userId = curUser.getUserId(); - Set roleKeys = roleService.selectRoleKeys(userId); - List sysUserlist = sysUserService.selectRoleToUserList("ywyRole"); - sysUserlist.add(curUser); - if (curUser.getUserName().contains("admin")) { - SysSalesOrderVo sysSalesOrderVo2 = new SysSalesOrderVo(); - startPage(); - List list2 = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo2); - return getDataTable(list2); - } - //如果主管审批,查看当前自己部门的审核 - //如果经理审计需要查询自己部门下所有业务员的提交的订单,以及自身的提交的订单 - if (roleKeys.contains("ywjlRole")) { - List findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList()); - Set user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toSet()); - startPage(); - List list2 = list.stream().filter(item -> user.contains(item.getApplyUser())).collect(Collectors.toList()); - return getDataTable(list2); - } - // 业务员角色只能看到自己创建的数据 - if (roleKeys.contains("ywyRole")) { - sysSalesOrderVo.setApplyUser(curUser.getLoginName()); - startPage(); - List list2 = sysSalesOrderService.selectSysSalesOrderList(sysSalesOrderVo); - return getDataTable(list2); - } return getDataTable(list); - }catch(NullPointerException e){ - throw new NullPointerException("当前用户没有申请客户资料"); - } } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderVo.java index 21e058c9..0c5dc539 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysSalesOrderVo.java @@ -1,6 +1,7 @@ package com.ruoyi.system.domain; import java.util.Date; +import java.util.List; public class SysSalesOrderVo extends SysSalesOrder{ /** 申请人姓名 */ @@ -19,8 +20,18 @@ public class SysSalesOrderVo extends SysSalesOrder{ private String todoUserId; /** 流程实例类型名称 */ private String instanceTypeName; + /*上级经理和所属业务员*/ + private List applyUsers; + public List getApplyUsers() { + return applyUsers; + } + + public void setApplyUsers(List applyUsers) { + this.applyUsers = applyUsers; + } + /** * 关键词 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java index 22c6af37..066ff4cd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysSalesOrderMapper.java @@ -30,6 +30,14 @@ public interface SysSalesOrderMapper */ public List selectSysSalesOrderList(SysSalesOrderVo sysSalesOrderVo); + /** + * 查询销售订单列表(根据经理的部门) + * + * @param sysSalesOrderVo 销售订单 + * @return 销售订单集合 + */ + public List selectSysSalesOrderByMange(SysSalesOrderVo sysSalesOrderVo); + /** * 新增销售订单 * diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java index 92936032..559ecac0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java @@ -30,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.stream.Collectors; /** * 销售订单Service业务层处理 @@ -81,6 +82,8 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService @Autowired private IWarehouseOutOrderService warehouseOutOrderService; + @Autowired + private ISysUserService sysUserService; /** * 查询销售订单 @@ -122,9 +125,28 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); + SysUser curUser = ShiroUtils.getSysUser(); + String loginName = ShiroUtils.getLoginName(); + Long userId = curUser.getUserId(); + List returnList = new ArrayList<>(); //PageHelper 仅对第一List分页有效 - Page list = (Page) sysSalesOrderMapper.selectSysSalesOrderList(sysSalesOrderVo1); - Page returnList = new Page<>(); + List list =sysSalesOrderMapper.selectSysSalesOrderList(sysSalesOrderVo1); + Set roleKeys = roleService.selectRoleKeys(userId); + List sysUserlist = sysUserService.selectRoleToUserList("ywyRole"); + sysUserlist.add(curUser); + //如果主管审批,查看当前自己部门的审核 + //如果经理审计需要查询自己部门下所有业务员的提交的订单,以及自身的提交的订单 + if (roleKeys.contains("ywjlRole")) { + List findUser = sysUserlist.stream().filter(item -> (item.getDeptId().equals(curUser.getDeptId()))).collect(Collectors.toList()); + List user = findUser.stream().map(SysUser::getLoginName).collect(Collectors.toList()); + String userStr = String.join(",", user); + sysSalesOrderVo1.setApplyUsers(user); + list = sysSalesOrderMapper.selectSysSalesOrderList(sysSalesOrderVo1); + } + if (roleKeys.contains("ywyRole")) { + sysSalesOrderVo1.setApplyUser(curUser.getLoginName()); + list = list.stream().filter(item -> item.getApplyUser().equals(curUser.getLoginName())).collect(Collectors.toList()); + } for(SysSalesOrderVo sysSalesOrderVo : list){ SysUser sysUser = userMapper.selectUserByLoginName(sysSalesOrderVo.getCreateBy()); if (sysUser != null) { @@ -166,9 +188,6 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService } returnList.add(sysSalesOrderVo); } - returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); - returnList.setPageNum(pageNum); - returnList.setPageSize(pageSize); return returnList; } diff --git a/ruoyi-admin/src/main/resources/FinancialReceiptVoucherTemplate.xlsx b/ruoyi-admin/src/main/resources/FinancialReceiptVoucherTemplate.xlsx new file mode 100644 index 00000000..306bb184 Binary files /dev/null and b/ruoyi-admin/src/main/resources/FinancialReceiptVoucherTemplate.xlsx differ diff --git a/ruoyi-admin/src/main/resources/attachments/test.docx b/ruoyi-admin/src/main/resources/attachments/test.docx new file mode 100644 index 00000000..e69de29b diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialReceivablesMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialReceivablesMapper.xml index a2aaeda8..fd713ec9 100644 --- a/ruoyi-admin/src/main/resources/mapper/financial/FinancialReceivablesMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialReceivablesMapper.xml @@ -5,34 +5,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" financial_receivables_code, receivables_closing_status, sales_order_code, + debit_account, credit_account, credit_detail, open_bank, @@ -99,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{financialReceivablesCode}, #{receivablesClosingStatus}, #{salesOrderCode}, + #{debitAccount}, #{creditAccount}, #{creditDetail}, #{openBank}, @@ -132,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" financial_receivables_code = #{financialReceivablesCode}, receivables_closing_status = #{receivablesClosingStatus}, sales_order_code = #{salesOrderCode}, + debit_account = #{debitAccount}, credit_account = #{creditAccount}, credit_detail = #{creditDetail}, open_bank = #{openBank}, diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml index 5edd1493..9e16e0de 100644 --- a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml @@ -44,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where sales_order_code = #{salesOrderCode} + + insert into financial_tax_invoice_history diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml index 09215bda..832eff5c 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml @@ -129,10 +129,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and s.apply_user = #{applyUser} and s.apply_time = #{applyTime} and s.apply_title = #{applyTitle} + and s.apply_user in + + #{user} + + - order by s.audit_status asc, s.create_time desc + order by s.create_time desc - -
+
+
+ +
+ +
+
@@ -44,7 +53,11 @@
- + +
@@ -53,13 +66,13 @@
-
+ -
+
+ +
+ +
+
+ -
+ @@ -168,16 +167,15 @@
你有提醒 -
-
@@ -199,11 +197,11 @@
@@ -259,9 +257,9 @@ + diff --git a/ruoyi-admin/src/main/resources/templates/process/todoitem/doneitem.html b/ruoyi-admin/src/main/resources/templates/process/todoitem/doneitem.html new file mode 100644 index 00000000..421efbea --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/process/todoitem/doneitem.html @@ -0,0 +1,170 @@ + + + + + + + +
+
+
+
+
+
    +
  • +

    事项标题:

    + +
  • +
  • +

    模块名称:

    + +
  • +
  • +

    任务 ID:

    + +
  • +
  • +

    任务名称:

    + +
  • +
  • +

    待办人 ID:

    + +
  • +
  • +

    待办人名称:

    + +
  • +
  • +

    处理人 ID:

    + +
  • +
  • +

    处理人名称:

    + +
  • +
  • +

    通知时间:

    + + - + +
  • +
  • +

    处理时间:

    + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/process/todoitem/todoList.html b/ruoyi-admin/src/main/resources/templates/process/todoitem/todoList.html new file mode 100644 index 00000000..d91320d4 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/process/todoitem/todoList.html @@ -0,0 +1,74 @@ + + + + + + +
+
暂无任务
+
+
+
+
+
+ +
+

【[[${ todoItem.nodeName }]]】[[${ todoItem.itemName }]]

+

[[${ todoItem.itemContent }]] +

+ 办理 + +
+ +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/process/todoitem/todoitem.html b/ruoyi-admin/src/main/resources/templates/process/todoitem/todoitem.html new file mode 100644 index 00000000..e594dd91 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/process/todoitem/todoitem.html @@ -0,0 +1,111 @@ + + + + + + + +
+
+
+
+
+
    +
  • 事项标题:

  • +
  • 模块名称:

  • +
  • 任务 ID:

  • +
  • 任务名称:

  • + +
  • 待办人名称:

  • +
  • 处理人 ID:

  • +
  • 处理人名称:

  • +
  • +

    通知时间:

    + + - + +
  • +
  • +

    处理时间:

    + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ + +
+
+
+
+
+ + + + + \ No newline at end of file