diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysInvoiceController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysInvoiceController.java index f3057807..05ba4a26 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysInvoiceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysInvoiceController.java @@ -1,37 +1,162 @@ package com.ruoyi.system.controller; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.domain.SysContacts; -import com.ruoyi.system.service.ISysContactsService; +import java.util.List; + +import com.ruoyi.ck.utils.Result; 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.*; - -import java.util.List; +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.SysInvoice; +import com.ruoyi.system.service.ISysInvoiceService; +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 + * 其他开票信息Controller * - * @author ruoyi - * @date 2022-11-16 + * @author zhangsiqi + * @date 2024-04-22 */ @Controller @RequestMapping("/system/invoice") public class SysInvoiceController extends BaseController { - private final String prefix = "system/invoice"; + private String prefix = "system/invoice"; + + @Autowired + private ISysInvoiceService sysInvoiceService; @RequiresPermissions("system:invoice:view") @GetMapping() - public String contacts() + public String invoice() { return prefix + "/invoice"; } + + /** + * 查询其他开票信息列表 + */ + @RequiresPermissions("system:invoice:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(SysInvoice sysInvoice) + { + startPage(); + List list = sysInvoiceService.selectSysInvoiceList(sysInvoice); + return getDataTable(list); + } + + /** + * 导出其他开票信息列表 + */ + @RequiresPermissions("system:invoice:export") + @Log(title = "其他开票信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(SysInvoice sysInvoice) + { + List list = sysInvoiceService.selectSysInvoiceList(sysInvoice); + ExcelUtil util = new ExcelUtil(SysInvoice.class); + return util.exportExcel(list, "其他开票信息数据"); + } + + /** + * 新增其他开票信息 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增保存其他开票信息 + */ + @RequiresPermissions("system:invoice:add") + @Log(title = "其他开票信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(SysInvoice sysInvoice) + { + return toAjax(sysInvoiceService.insertSysInvoice(sysInvoice)); + } + + /** + * 修改其他开票信息 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + SysInvoice sysInvoice = sysInvoiceService.selectSysInvoiceById(id); + mmap.put("sysInvoice", sysInvoice); + return prefix + "/edit"; + } + @GetMapping("/detail/{id}") + public String detail(@PathVariable("id") Long id, ModelMap mmap) + { + SysInvoice sysInvoice = sysInvoiceService.selectSysInvoiceById(id); + mmap.put("sysInvoice", sysInvoice); + return prefix + "/detail"; + } + /** + * 修改保存其他开票信息 + */ + @RequiresPermissions("system:invoice:edit") + @Log(title = "其他开票信息", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(SysInvoice sysInvoice) + { + return toAjax(sysInvoiceService.updateSysInvoice(sysInvoice)); + } + + /** + * 删除其他开票信息 + */ + @RequiresPermissions("system:invoice:remove") + @Log(title = "其他开票信息", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(sysInvoiceService.deleteSysInvoiceByIds(ids)); + } + + /** + * 作废其他开票信息 + */ + @RequiresPermissions("system:invoice:cancel") + @Log(title = "其他开票信息", businessType = BusinessType.CANCEL) + @GetMapping( "/cancel/{id}") + @ResponseBody + public AjaxResult cancel(@PathVariable("id") Long id){ + return toAjax(sysInvoiceService.cancelSysInvoiceById(id)); + } + + /** + * 恢复其他开票信息 + */ + @RequiresPermissions("system:invoice:restore") + @Log(title = "其他开票信息", businessType = BusinessType.RESTORE) + @GetMapping( "/restore/{id}") + @ResponseBody + public AjaxResult restore(@PathVariable("id")Long id) + { + return toAjax(sysInvoiceService.restoreSysInvoiceById(id)); + } + @PostMapping("/getId") + @ResponseBody + public Result getId() throws Exception { + return Result.getSuccessResult(sysInvoiceService.getId()); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysInvoice.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysInvoice.java new file mode 100644 index 00000000..263da3dc --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysInvoice.java @@ -0,0 +1,141 @@ +package com.ruoyi.system.domain; + +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; + +/** + * 其他开票信息对象 sys_invoice + * + * @author zhangsiqi + * @date 2024-04-22 + */ +public class SysInvoice extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 开票索引编号 */ + @Excel(name = "开票索引编号") + private Long id; + + /** 开票ID编号 */ + @Excel(name = "开票ID编号") + private String invoiceId; + + /** 企业代码 */ + @Excel(name = "企业代码") + private String enterpriseCode; + + /** 企业名称 */ + @Excel(name = "企业名称") + private String enterpriseName; + + /** 开票公司名称 */ + @Excel(name = "开票公司名称") + private String invoiceCompanyName; + + /** 开票公司税号 */ + @Excel(name = "开票公司税号") + private String invoiceCompanyCode; + + /** 公司开户行 */ + @Excel(name = "公司开户行") + private String depositBank; + + /** 公司开户账号 */ + @Excel(name = "公司开户账号") + private String bankAccount; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setInvoiceId(String invoiceId) + { + this.invoiceId = invoiceId; + } + + public String getInvoiceId() + { + return invoiceId; + } + public void setEnterpriseCode(String enterpriseCode) + { + this.enterpriseCode = enterpriseCode; + } + + public String getEnterpriseCode() + { + return enterpriseCode; + } + public void setEnterpriseName(String enterpriseName) + { + this.enterpriseName = enterpriseName; + } + + public String getEnterpriseName() + { + return enterpriseName; + } + public void setInvoiceCompanyName(String invoiceCompanyName) + { + this.invoiceCompanyName = invoiceCompanyName; + } + + public String getInvoiceCompanyName() + { + return invoiceCompanyName; + } + public void setInvoiceCompanyCode(String invoiceCompanyCode) + { + this.invoiceCompanyCode = invoiceCompanyCode; + } + + public String getInvoiceCompanyCode() + { + return invoiceCompanyCode; + } + public void setDepositBank(String depositBank) + { + this.depositBank = depositBank; + } + + public String getDepositBank() + { + return depositBank; + } + public void setBankAccount(String bankAccount) + { + this.bankAccount = bankAccount; + } + + public String getBankAccount() + { + return bankAccount; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("invoiceId", getInvoiceId()) + .append("enterpriseCode", getEnterpriseCode()) + .append("enterpriseName", getEnterpriseName()) + .append("invoiceCompanyName", getInvoiceCompanyName()) + .append("invoiceCompanyCode", getInvoiceCompanyCode()) + .append("depositBank", getDepositBank()) + .append("bankAccount", getBankAccount()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .toString(); + } +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysInvoiceMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysInvoiceMapper.java new file mode 100644 index 00000000..3aac3bed --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysInvoiceMapper.java @@ -0,0 +1,77 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.SysInvoice; + +/** + * 其他开票信息Mapper接口 + * + * @author zhangsiqi + * @date 2024-04-22 + */ +public interface SysInvoiceMapper +{ + /** + * 查询其他开票信息 + * + * @param id 其他开票信息ID + * @return 其他开票信息 + */ + public SysInvoice selectSysInvoiceById(Long id); + + /** + * 查询其他开票信息列表 + * + * @param sysInvoice 其他开票信息 + * @return 其他开票信息集合 + */ + public List selectSysInvoiceList(SysInvoice sysInvoice); + + /** + * 新增其他开票信息 + * + * @param sysInvoice 其他开票信息 + * @return 结果 + */ + public int insertSysInvoice(SysInvoice sysInvoice); + + /** + * 修改其他开票信息 + * + * @param sysInvoice 其他开票信息 + * @return 结果 + */ + public int updateSysInvoice(SysInvoice sysInvoice); + + /** + * 删除其他开票信息 + * + * @param id 其他开票信息ID + * @return 结果 + */ + public int deleteSysInvoiceById(Long id); + + /** + * 批量删除其他开票信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysInvoiceByIds(String[] ids); + + /** + * 作废其他开票信息 + * + * @param id 其他开票信息ID + * @return 结果 + */ + public int cancelSysInvoiceById(Long id); + + /** + * 恢复其他开票信息 + * + * @param id 其他开票信息ID + * @return 结果 + */ + public int restoreSysInvoiceById(Long id); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysInvoiceService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysInvoiceService.java new file mode 100644 index 00000000..6c1bc1fd --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysInvoiceService.java @@ -0,0 +1,77 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.SysInvoice; + +/** + * 其他开票信息Service接口 + * + * @author zhangsiqi + * @date 2024-04-22 + */ +public interface ISysInvoiceService +{ + /** + * 查询其他开票信息 + * + * @param id 其他开票信息ID + * @return 其他开票信息 + */ + public SysInvoice selectSysInvoiceById(Long id); + + /** + * 查询其他开票信息列表 + * + * @param sysInvoice 其他开票信息 + * @return 其他开票信息集合 + */ + public List selectSysInvoiceList(SysInvoice sysInvoice); + + /** + * 新增其他开票信息 + * + * @param sysInvoice 其他开票信息 + * @return 结果 + */ + public int insertSysInvoice(SysInvoice sysInvoice); + + /** + * 修改其他开票信息 + * + * @param sysInvoice 其他开票信息 + * @return 结果 + */ + public int updateSysInvoice(SysInvoice sysInvoice); + + /** + * 批量删除其他开票信息 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteSysInvoiceByIds(String ids); + + /** + * 删除其他开票信息信息 + * + * @param id 其他开票信息ID + * @return 结果 + */ + public int deleteSysInvoiceById(Long id); + + /** + * 作废其他开票信息 + * @param id 其他开票信息ID + * @return + */ + int cancelSysInvoiceById(Long id); + + /** + * 恢复其他开票信息 + * @param id 其他开票信息ID + * @return + */ + int restoreSysInvoiceById(Long id); + + public String getId(); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysInvoiceServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysInvoiceServiceImpl.java new file mode 100644 index 00000000..4ea93805 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysInvoiceServiceImpl.java @@ -0,0 +1,136 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; + +import com.ruoyi.common.core.redis.RedisCache; +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.SysInvoiceMapper; +import com.ruoyi.system.domain.SysInvoice; +import com.ruoyi.system.service.ISysInvoiceService; +import com.ruoyi.common.core.text.Convert; + +/** + * 其他开票信息Service业务层处理 + * + * @author zhangsiqi + * @date 2024-04-22 + */ +@Service +public class SysInvoiceServiceImpl implements ISysInvoiceService +{ + @Autowired + private SysInvoiceMapper sysInvoiceMapper; + + @Autowired + private RedisCache redisCache; + + /** + * 查询其他开票信息 + * + * @param id 其他开票信息ID + * @return 其他开票信息 + */ + @Override + public SysInvoice selectSysInvoiceById(Long id) + { + return sysInvoiceMapper.selectSysInvoiceById(id); + } + + /** + * 查询其他开票信息列表 + * + * @param sysInvoice 其他开票信息 + * @return 其他开票信息 + */ + @Override + public List selectSysInvoiceList(SysInvoice sysInvoice) + { + return sysInvoiceMapper.selectSysInvoiceList(sysInvoice); + } + + /** + * 新增其他开票信息 + * + * @param sysInvoice 其他开票信息 + * @return 结果 + */ + @Override + public int insertSysInvoice(SysInvoice sysInvoice) + { + String loginName = ShiroUtils.getLoginName(); + sysInvoice.setCreateBy(loginName); + sysInvoice.setCreateTime(DateUtils.getNowDate()); + return sysInvoiceMapper.insertSysInvoice(sysInvoice); + } + + /** + * 修改其他开票信息 + * + * @param sysInvoice 其他开票信息 + * @return 结果 + */ + @Override + public int updateSysInvoice(SysInvoice sysInvoice) + { + String loginName = ShiroUtils.getLoginName(); + sysInvoice.setUpdateBy(loginName); + sysInvoice.setUpdateTime(DateUtils.getNowDate()); + return sysInvoiceMapper.updateSysInvoice(sysInvoice); + } + + /** + * 删除其他开票信息对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteSysInvoiceByIds(String ids) + { + return sysInvoiceMapper.deleteSysInvoiceByIds(Convert.toStrArray(ids)); + } + + /** + * 删除其他开票信息信息 + * + * @param id 其他开票信息ID + * @return 结果 + */ + @Override + public int deleteSysInvoiceById(Long id) + { + return sysInvoiceMapper.deleteSysInvoiceById(id); + } + + /** + * 作废其他开票信息 + * + * @param id 其他开票信息ID + * @return 结果 + */ + @Override + public int cancelSysInvoiceById(Long id) + { + return sysInvoiceMapper.cancelSysInvoiceById(id); + } + + /** + * 恢复其他开票信息信息 + * + * @param id 其他开票信息ID + * @return 结果 + */ + @Override + public int restoreSysInvoiceById(Long id) + { + return sysInvoiceMapper.restoreSysInvoiceById(id); + } + /*生成开票ID*/ + @Override + public String getId() { + return redisCache.generateBillNo("KHKP"); + } +} diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysInvoiceMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysInvoiceMapper.xml new file mode 100644 index 00000000..61a8296c --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/system/SysInvoiceMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + select id, invoice_id, enterprise_code, enterprise_name, invoice_company_name, + invoice_company_code, deposit_bank, bank_account, create_by, createTime, + update_by, update_time, remark from sys_invoice + + + + + + + + insert into sys_invoice + + invoice_id, + enterprise_code, + enterprise_name, + invoice_company_name, + invoice_company_code, + deposit_bank, + bank_account, + create_by, + createTime, + update_by, + update_time, + remark, + + + #{invoiceId}, + #{enterpriseCode}, + #{enterpriseName}, + #{invoiceCompanyName}, + #{invoiceCompanyCode}, + #{depositBank}, + #{bankAccount}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update sys_invoice + + enterprise_code = #{enterpriseCode}, + enterprise_name = #{enterpriseName}, + invoice_company_name = #{invoiceCompanyName}, + invoice_company_code = #{invoiceCompanyCode}, + deposit_bank = #{depositBank}, + bank_account = #{bankAccount}, + create_by = #{createBy}, + createTime = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where id = #{id} + + + + delete from sys_invoice where id = #{id} + + + + delete from sys_invoice where id in + + #{id} + + + + + update sys_invoice set del_flag = '1' where id = #{id} + + + + update sys_invoice set del_flag = '0' where id = #{id} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/invoice/add.html b/ruoyi-admin/src/main/resources/templates/system/invoice/add.html new file mode 100644 index 00000000..cb01f33a --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/invoice/add.html @@ -0,0 +1,116 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/invoice/detail.html b/ruoyi-admin/src/main/resources/templates/system/invoice/detail.html new file mode 100644 index 00000000..faa251a6 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/invoice/detail.html @@ -0,0 +1,61 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/invoice/edit.html b/ruoyi-admin/src/main/resources/templates/system/invoice/edit.html new file mode 100644 index 00000000..3c8851a0 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/system/invoice/edit.html @@ -0,0 +1,88 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/invoice/invoice.html b/ruoyi-admin/src/main/resources/templates/system/invoice/invoice.html index 22581452..46e78989 100644 --- a/ruoyi-admin/src/main/resources/templates/system/invoice/invoice.html +++ b/ruoyi-admin/src/main/resources/templates/system/invoice/invoice.html @@ -1,162 +1,110 @@ - - - - - -
-
-
-
-
-
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - - - - - -
  • -
  • -  搜索 -  重置 -
  • -
-
-
-
+ + + + + +
+
+
+
+
+ +
+
+
- -
-
-
+ +
+
+
+
-
- - \ No newline at end of file