diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/CompanyCost.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/CompanyCost.java index f03f25a2..6bb3f6ee 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/CompanyCost.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/CompanyCost.java @@ -1,6 +1,8 @@ package com.ruoyi.financial.domain; import java.math.BigDecimal; + +import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -31,9 +33,7 @@ public class CompanyCost extends BaseEntity @Excel(name = "月份") private Long costMonth; - /** 经营成本 */ - @Excel(name = "经营成本") - private Long operatingCosts; + /** 工资费用 */ @Excel(name = "工资费用") @@ -55,9 +55,9 @@ public class CompanyCost extends BaseEntity @Excel(name = "其他费用") private BigDecimal ohterExpenses; - /** 业务成本 */ - @Excel(name = "业务成本") - private BigDecimal businessCost; + /** 经营成本 */ + @Excel(name = "经营成本合计") + private Long operatingCosts; /** 运输费用 */ @Excel(name = "运输费用") @@ -83,6 +83,10 @@ public class CompanyCost extends BaseEntity @Excel(name = "业务提成") private BigDecimal businessCommission; + /** 业务成本 */ + @Excel(name = "业务成本合计") + private BigDecimal businessCost; + public void setId(Long id) { this.id = id; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java index 14e14bd9..ac8e9a8d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoice.java @@ -130,8 +130,12 @@ public class FinancialTaxInvoice extends BaseEntity @Excel(name = "开票额度比例") private BigDecimal invoiceQuotaRatio; - /** 开票金额 */ - private BigDecimal invoiceAmount; + /** 开票金额(RMB) */ + private BigDecimal invoiceAmountRmb; + + /** 开票金额(美元) */ + private BigDecimal invoiceAmountUsd; + /** 实际开票金额 */ @Excel(name = "实际开票金额") @@ -455,16 +459,16 @@ public class FinancialTaxInvoice extends BaseEntity { return invoiceQuotaRatio; } - public void setInvoiceAmount(BigDecimal invoiceAmount) - { - this.invoiceAmount = invoiceAmount; + + public BigDecimal getInvoiceAmountRmb() { + return invoiceAmountRmb; } - public BigDecimal getInvoiceAmount() - { - return invoiceAmount; + public void setInvoiceAmountRmb(BigDecimal invoiceAmountRmb) { + this.invoiceAmountRmb = invoiceAmountRmb; } - public void setActualInvoiceAmount(BigDecimal actualInvoiceAmount) + + public void setActualInvoiceAmount(BigDecimal actualInvoiceAmount) { this.actualInvoiceAmount = actualInvoiceAmount; } @@ -473,7 +477,17 @@ public class FinancialTaxInvoice extends BaseEntity { return actualInvoiceAmount; } - public void setActualInvoiceAmountRmb(BigDecimal actualInvoiceAmountRmb) + + + public BigDecimal getInvoiceAmountUsd() { + return invoiceAmountUsd; + } + + public void setInvoiceAmountUsd(BigDecimal invoiceAmountUsd) { + this.invoiceAmountUsd = invoiceAmountUsd; + } + + public void setActualInvoiceAmountRmb(BigDecimal actualInvoiceAmountRmb) { this.actualInvoiceAmountRmb = actualInvoiceAmountRmb; } @@ -597,7 +611,8 @@ public class FinancialTaxInvoice extends BaseEntity .append("usdTaxSum", getUsdTaxSum()) .append("invoiceEmail", getInvoiceEmail()) .append("invoiceQuotaRatio", getInvoiceQuotaRatio()) - .append("invoiceAmount", getInvoiceAmount()) + .append("invoiceAmountRmb", getInvoiceAmountRmb()) + .append("invoiceAmountUsd", getInvoiceAmountUsd()) .append("actualInvoiceAmount", getActualInvoiceAmount()) .append("actualInvoiceAmountRmb", getActualInvoiceAmountRmb()) .append("actualInvoiceAmountUsd", getActualInvoiceAmountUsd()) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java new file mode 100644 index 00000000..60208ce2 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/domain/FinancialTaxInvoiceHistory.java @@ -0,0 +1,197 @@ +package com.ruoyi.financial.domain; + +import java.math.BigDecimal; +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; + +/** + * 国税发票历史记录对象 financial_tax_invoice_history + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +public class FinancialTaxInvoiceHistory extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 国税发票历史id */ + private Long invoiceHistoryId; + + /** 国税发票单号 */ + @Excel(name = "国税发票单号") + private String taxInvoiceCode; + + /** 销售订单编号 */ + private String salesOrderCode; + + /** 发票状态(0待审核、1待开具、2已开具、3审核拒绝) */ + @Excel(name = "发票状态(0待审核、1待开具、2已开具、3审核拒绝)") + private String taxInvoiceStatus; + + /** 申请时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date applyTime; + + /** 财务员 */ + @Excel(name = "财务员") + private String financeMembers; + + /** 开票额度比例 */ + @Excel(name = "开票额度比例") + private BigDecimal invoiceQuotaRatio; + + /** 开票金额(RMB) */ + @Excel(name = "开票金额(RMB)") + private BigDecimal invoiceAmountRmb; + + /** 开票金额(美元) */ + @Excel(name = "开票金额(美元)") + private BigDecimal invoiceAmountUsd; + + /** 开票用途 */ + @Excel(name = "开票用途") + private String invoicePurpose; + + /** 使用状态(1是、0否、2已作废) */ + private String useStatus; + + /** 删除标志 0正常 1删除 */ + private String delFlag; + + public void setInvoiceHistoryId(Long invoiceHistoryId) + { + this.invoiceHistoryId = invoiceHistoryId; + } + + public Long getInvoiceHistoryId() + { + return invoiceHistoryId; + } + public void setTaxInvoiceCode(String taxInvoiceCode) + { + this.taxInvoiceCode = taxInvoiceCode; + } + + public String getTaxInvoiceCode() + { + return taxInvoiceCode; + } + public void setSalesOrderCode(String salesOrderCode) + { + this.salesOrderCode = salesOrderCode; + } + + public String getSalesOrderCode() + { + return salesOrderCode; + } + public void setTaxInvoiceStatus(String taxInvoiceStatus) + { + this.taxInvoiceStatus = taxInvoiceStatus; + } + + public String getTaxInvoiceStatus() + { + return taxInvoiceStatus; + } + public void setApplyTime(Date applyTime) + { + this.applyTime = applyTime; + } + + public Date getApplyTime() + { + return applyTime; + } + public void setFinanceMembers(String financeMembers) + { + this.financeMembers = financeMembers; + } + + public String getFinanceMembers() + { + return financeMembers; + } + public void setInvoiceQuotaRatio(BigDecimal invoiceQuotaRatio) + { + this.invoiceQuotaRatio = invoiceQuotaRatio; + } + + public BigDecimal getInvoiceQuotaRatio() + { + return invoiceQuotaRatio; + } + public void setInvoiceAmountRmb(BigDecimal invoiceAmountRmb) + { + this.invoiceAmountRmb = invoiceAmountRmb; + } + + public BigDecimal getInvoiceAmountRmb() + { + return invoiceAmountRmb; + } + public void setInvoiceAmountUsd(BigDecimal invoiceAmountUsd) + { + this.invoiceAmountUsd = invoiceAmountUsd; + } + + public BigDecimal getInvoiceAmountUsd() + { + return invoiceAmountUsd; + } + public void setInvoicePurpose(String invoicePurpose) + { + this.invoicePurpose = invoicePurpose; + } + + public String getInvoicePurpose() + { + return invoicePurpose; + } + public void setUseStatus(String useStatus) + { + this.useStatus = useStatus; + } + + public String getUseStatus() + { + return useStatus; + } + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; + } + + public String getDelFlag() + { + return delFlag; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("invoiceHistoryId", getInvoiceHistoryId()) + .append("taxInvoiceCode", getTaxInvoiceCode()) + .append("salesOrderCode", getSalesOrderCode()) + .append("taxInvoiceStatus", getTaxInvoiceStatus()) + .append("applyTime", getApplyTime()) + .append("financeMembers", getFinanceMembers()) + .append("invoiceQuotaRatio", getInvoiceQuotaRatio()) + .append("invoiceAmountRmb", getInvoiceAmountRmb()) + .append("invoiceAmountUsd", getInvoiceAmountUsd()) + .append("invoicePurpose", getInvoicePurpose()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("remark", getRemark()) + .append("useStatus", getUseStatus()) + .append("delFlag", getDelFlag()) + .toString(); + } +} 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 new file mode 100644 index 00000000..5dd24a68 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/mapper/FinancialTaxInvoiceHistoryMapper.java @@ -0,0 +1,85 @@ +package com.ruoyi.financial.mapper; + +import java.util.List; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; + +/** + * 国税发票历史记录Mapper接口 + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +public interface FinancialTaxInvoiceHistoryMapper +{ + /** + * 查询国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 国税发票历史记录 + */ + public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 查询国税发票历史记录列表 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 国税发票历史记录集合 + */ + public List selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 新增国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 修改国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 删除国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 批量删除国税发票历史记录 + * + * @param invoiceHistoryIds 需要删除的数据ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryByIds(String[] invoiceHistoryIds); + + /** + * 作废国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 恢复国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 根据销售订单编号查询发票历史记录集合 + * + * @param salesOrderCode 销售订单编号 + * @return 结果 + */ + List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java new file mode 100644 index 00000000..59c8ccbe --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/IFinancialTaxInvoiceHistoryService.java @@ -0,0 +1,82 @@ +package com.ruoyi.financial.service; + +import java.util.List; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; + +/** + * 国税发票历史记录Service接口 + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +public interface IFinancialTaxInvoiceHistoryService +{ + /** + * 查询国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 国税发票历史记录 + */ + public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 查询国税发票历史记录列表 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 国税发票历史记录集合 + */ + public List selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 新增国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 修改国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory); + + /** + * 批量删除国税发票历史记录 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryByIds(String ids); + + /** + * 删除国税发票历史记录信息 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 作废国税发票历史记录 + * @param invoiceHistoryId 国税发票历史记录ID + * @return + */ + int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 恢复国税发票历史记录 + * @param invoiceHistoryId 国税发票历史记录ID + * @return + */ + int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId); + + /** + * 根据销售订单编号查询发票历史记录集合 + * @param salesOrderCode 销售订单编号 + * @return + */ + List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode); +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java new file mode 100644 index 00000000..46e4e3f9 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/financial/service/impl/FinancialTaxInvoiceHistoryServiceImpl.java @@ -0,0 +1,140 @@ +package com.ruoyi.financial.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.financial.mapper.FinancialTaxInvoiceHistoryMapper; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; +import com.ruoyi.financial.service.IFinancialTaxInvoiceHistoryService; +import com.ruoyi.common.core.text.Convert; + +/** + * 国税发票历史记录Service业务层处理 + * + * @author 刘晓旭 + * @date 2024-08-14 + */ +@Service +public class FinancialTaxInvoiceHistoryServiceImpl implements IFinancialTaxInvoiceHistoryService +{ + @Autowired + private FinancialTaxInvoiceHistoryMapper financialTaxInvoiceHistoryMapper; + + /** + * 查询国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 国税发票历史记录 + */ + @Override + public FinancialTaxInvoiceHistory selectFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.selectFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } + + /** + * 查询国税发票历史记录列表 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 国税发票历史记录 + */ + @Override + public List selectFinancialTaxInvoiceHistoryList(FinancialTaxInvoiceHistory financialTaxInvoiceHistory) + { + return financialTaxInvoiceHistoryMapper.selectFinancialTaxInvoiceHistoryList(financialTaxInvoiceHistory); + } + + /** + * 新增国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + @Override + public int insertFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory) + { + String loginName = ShiroUtils.getLoginName(); + financialTaxInvoiceHistory.setCreateBy(loginName); + financialTaxInvoiceHistory.setCreateTime(DateUtils.getNowDate()); + return financialTaxInvoiceHistoryMapper.insertFinancialTaxInvoiceHistory(financialTaxInvoiceHistory); + } + + /** + * 修改国税发票历史记录 + * + * @param financialTaxInvoiceHistory 国税发票历史记录 + * @return 结果 + */ + @Override + public int updateFinancialTaxInvoiceHistory(FinancialTaxInvoiceHistory financialTaxInvoiceHistory) + { + String loginName = ShiroUtils.getLoginName(); + financialTaxInvoiceHistory.setUpdateBy(loginName); + financialTaxInvoiceHistory.setUpdateTime(DateUtils.getNowDate()); + return financialTaxInvoiceHistoryMapper.updateFinancialTaxInvoiceHistory(financialTaxInvoiceHistory); + } + + /** + * 删除国税发票历史记录对象 + * + * @param ids 需要删除的数据ID + * @return 结果 + */ + @Override + public int deleteFinancialTaxInvoiceHistoryByIds(String ids) + { + return financialTaxInvoiceHistoryMapper.deleteFinancialTaxInvoiceHistoryByIds(Convert.toStrArray(ids)); + } + + /** + * 删除国税发票历史记录信息 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + @Override + public int deleteFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.deleteFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } + + /** + * 作废国税发票历史记录 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + @Override + public int cancelFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.cancelFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } + + /** + * 恢复国税发票历史记录信息 + * + * @param invoiceHistoryId 国税发票历史记录ID + * @return 结果 + */ + @Override + public int restoreFinancialTaxInvoiceHistoryById(Long invoiceHistoryId) + { + return financialTaxInvoiceHistoryMapper.restoreFinancialTaxInvoiceHistoryById(invoiceHistoryId); + } + + + /** + * 根据销售订单编号查询历史记录集合 + * + * @param salesOrderCode 销售订单编号 + * @return 结果 + */ + @Override + public List selectInvoiceHistoryListBySalesOrderCode(String salesOrderCode) { + + List list = financialTaxInvoiceHistoryMapper.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode); + return list; + } +} 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 5927ea30..12abd152 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 @@ -10,7 +10,9 @@ import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.financial.domain.FinancialTaxInvoiceMaterial; import com.ruoyi.financial.mapper.FinancialTaxInvoiceMaterialMapper; import com.ruoyi.financial.service.IFinancialTaxInvoiceMaterialService; +import com.ruoyi.system.domain.SysCustomerVo; import com.ruoyi.system.domain.SysSalesOrder; +import com.ruoyi.system.mapper.SysCustomerMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.financial.mapper.FinancialTaxInvoiceMapper; @@ -37,6 +39,9 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi @Autowired private IFinancialTaxInvoiceMaterialService invoiceMaterialService; + @Autowired + private SysCustomerMapper sysCustomerMapper; + @Autowired private RedisCache redisCache; @@ -164,6 +169,15 @@ public class FinancialTaxInvoiceServiceImpl implements IFinancialTaxInvoiceServi financialTaxInvoice.setNoRmbSum(BigDecimal.valueOf(sysSalesOrder.getNoRmbSum())); financialTaxInvoice.setUsdTaxSum(BigDecimal.valueOf(sysSalesOrder.getUsdTaxSum())); financialTaxInvoice.setNoUsdSum(BigDecimal.valueOf(sysSalesOrder.getNoUsdSum())); + SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(sysSalesOrder.getEnterpriseCode()); + financialTaxInvoice.setInvoiceCompanyCode(sysCustomerVo.getInvoicingCustomerName()); + financialTaxInvoice.setInvoiceCompanyName(sysCustomerVo.getInvoicingCompanyName()); + financialTaxInvoice.setBankAccount(sysCustomerVo.getBankAccount()); + financialTaxInvoice.setDepositBank(sysCustomerVo.getDepositBank()); + + + + return financialTaxInvoice; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java index e4c250aa..728b4184 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerController.java @@ -581,4 +581,31 @@ public class SysCustomerController extends BaseController SysCustomer sysCustomer = sysCustomerService.selectSysCustomerByCustomerId(enterpriseCode); return AjaxResult.success(sysCustomer); } + + + /** + * 通过客户id查询开票公司信息 + * */ + @ResponseBody + @GetMapping("/getAllInvoiceCompanyNameByCode") + public List getAllInvoiceCompanyNameByCode(@RequestParam("enterpriseCode") String enterpriseCode ) { + List invoiceList = sysCustomerService.getInvoiceCompanyListByCode(enterpriseCode); + return invoiceList; + } + + + /** + * 通过开票公司名称查询开票公司信息 + * */ + @ResponseBody + @PostMapping("/getSysInvoiceInfoByName") + public AjaxResult getSysInvoiceInfoByName(String invoiceCompanyName) { + + SysInvoice result = sysCustomerService.getSysInvoiceInfoByName(invoiceCompanyName); + if (result != null) { + return AjaxResult.success(result); + } else { + return AjaxResult.error("未找到对应的开票信息"); + } + } } 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 ba3d6190..167a7301 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 @@ -22,7 +22,9 @@ import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.financial.domain.FinancialTaxInvoice; +import com.ruoyi.financial.domain.FinancialTaxInvoiceHistory; import com.ruoyi.financial.service.IFinancialReceivablesService; +import com.ruoyi.financial.service.IFinancialTaxInvoiceHistoryService; import com.ruoyi.financial.service.IFinancialTaxInvoiceService; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.system.domain.*; @@ -101,6 +103,10 @@ public class SysSalesOrderController extends BaseController @Autowired private IFinancialTaxInvoiceService taxInvoiceService; + @Autowired + private IFinancialTaxInvoiceHistoryService invoiceHistoryService; + + @RequiresPermissions("system:salesOrder:view") @GetMapping() public String salesOrder(ModelMap mmap) @@ -623,11 +629,27 @@ public class SysSalesOrderController extends BaseController */ @ResponseBody - @PostMapping("/getSalesOrderCodeChildListByCode") - public TableDataInfo getSalesOrderCodeChildListByCode(@RequestParam("salesOrderCode") String salesOrderCode) + @PostMapping("/getSalesOrderChildListByCode") + public TableDataInfo getSalesOrderChildListByCode(@RequestParam("salesOrderCode") String salesOrderCode) { startPage(); List list = sysSalesOrderChildService.selectOrderChildListBySalesOrderCode(salesOrderCode); return getDataTable(list); } + + + /** + * 查询开票历史记录列表 + */ + + @ResponseBody + @PostMapping("/getInvoiceHistoryListBySalesOrderCode") + public TableDataInfo getInvoiceHistoryListBySalesOrderCode(@RequestParam("salesOrderCode") String salesOrderCode) + { + startPage(); + List list = invoiceHistoryService.selectInvoiceHistoryListBySalesOrderCode(salesOrderCode); + return getDataTable(list); + } + + } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java index 4cc51e90..d5ea2448 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysCustomerMapper.java @@ -89,4 +89,14 @@ public interface SysCustomerMapper int cancelSysCustomerById(Long id); SysCustomerVo selectSysCustomerByCustomer(SysCustomerVo sysCustomerVo); + + /* + * 通过客户名称查询客户详情 + * */ + SysCustomerVo selectSysCustomerByEnterpriseName(String enterpriseName); + + /* + * 通过开票公司名称名称查询客户详情 + * */ + SysCustomerVo selectSysCustomerByInvoiceCompanyName(String invoicingCompanyName); } 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 index 2329ab7b..b68a3b73 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysInvoiceMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysInvoiceMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.system.mapper; import java.util.List; import com.ruoyi.system.domain.SysInvoice; +import org.apache.ibatis.annotations.Param; /** * 其他开票信息Mapper接口 @@ -80,4 +81,12 @@ public interface SysInvoiceMapper * @return 结果 */ public int restoreSysInvoiceById(Long id); + + /** + * 根据客户名称查询客户信息 + * + * @param invoiceCompanyName 客户名称 + * @return 结果 + */ + SysInvoice selectSysInvoiceByName(String invoiceCompanyName); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java index c6c52d2c..11073831 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerService.java @@ -3,6 +3,7 @@ package com.ruoyi.system.service; import com.ruoyi.aftersales.domain.dto.CustomerDto; import com.ruoyi.system.domain.SysCustomer; import com.ruoyi.system.domain.SysCustomerVo; +import com.ruoyi.system.domain.SysInvoice; import org.activiti.engine.runtime.ProcessInstance; import org.springframework.transaction.annotation.Transactional; @@ -99,4 +100,14 @@ public interface ISysCustomerService List selectSysCustomerWithComplaintNotice(); List getMatchCustomerList(String customerCode); + + /** + * 通过客户id查询开票公司信息 + * */ + List getInvoiceCompanyListByCode(String enterpriseCode); + + /** + * 通过开票公司名称查询开票公司信息 + * */ + SysInvoice getSysInvoiceInfoByName(String invoiceCompanyName); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java index 62af3f76..14fc4b51 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java @@ -14,6 +14,7 @@ import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.system.domain.*; import com.ruoyi.system.mapper.SysCustomerMapper; +import com.ruoyi.system.mapper.SysInvoiceMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.service.ISysCustomerService; import com.ruoyi.system.service.ISysInvoiceService; @@ -43,6 +44,9 @@ public class SysCustomerServiceImpl implements ISysCustomerService @Autowired private SysCustomerMapper sysCustomerMapper; + @Autowired + private SysInvoiceMapper sysInvoiceMapper; + @Autowired private RedisCache redisCache; @@ -319,6 +323,59 @@ public class SysCustomerServiceImpl implements ISysCustomerService return sysCustomerMapper.selectSysCustomerByCustomerId(enterpriseCode); } + + /** + * 通过客户id查询开票公司信息 + * */ + @Override + public List getInvoiceCompanyListByCode(String enterpriseCode) { + List sysInvoices = new ArrayList<>(); + //SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByEnterpriseCode(enterpriseCode); + List invoiceList = sysInvoiceService.selectSysInvoiceByCode(enterpriseCode); +// SysInvoice sysInvoice = new SysInvoice(); +// sysInvoice.setBankAccount(sysCustomerVo.getBankAccount()); +// sysInvoice.setDepositBank(sysCustomerVo.getDepositBank()); +// sysInvoice.setEnterpriseCode(sysCustomerVo.getEnterpriseCode()); +// sysInvoice.setEnterpriseName(sysCustomerVo.getEnterpriseName()); +// sysInvoice.setInvoiceCompanyCode(sysCustomerVo.getInvoicingCustomerName()); +// sysInvoice.setInvoiceCompanyName(sysCustomerVo.getInvoicingCompanyName()); +// +// if (sysInvoice != null){ +// sysInvoices.add(sysInvoice); +// } + sysInvoices.addAll(invoiceList); + return sysInvoices; + } + + /** + * 通过开票公司名称查询开票公司信息 + * */ + @Override + public SysInvoice getSysInvoiceInfoByName(String invoiceCompanyName) { + + + SysInvoice sysInvoice = sysInvoiceMapper.selectSysInvoiceByName(invoiceCompanyName); + if (sysInvoice != null){ + + return sysInvoice; + + }else { + + SysInvoice tempSysInvoice = new SysInvoice(); + SysCustomerVo sysCustomerVo = sysCustomerMapper.selectSysCustomerByInvoiceCompanyName(invoiceCompanyName); + tempSysInvoice.setBankAccount(sysCustomerVo.getBankAccount()); + tempSysInvoice.setDepositBank(sysCustomerVo.getDepositBank()); + tempSysInvoice.setEnterpriseCode(sysCustomerVo.getEnterpriseCode()); + tempSysInvoice.setEnterpriseName(sysCustomerVo.getEnterpriseName()); + tempSysInvoice.setInvoiceCompanyCode(sysCustomerVo.getInvoicingCustomerName()); + tempSysInvoice.setInvoiceCompanyName(sysCustomerVo.getInvoicingCompanyName()); + return tempSysInvoice; + } + + } + + + @Override public int add(SysCustomer sysCustomer) { return sysCustomerMapper.insertSysCustomer(sysCustomer); diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml new file mode 100644 index 00000000..5edd1493 --- /dev/null +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceHistoryMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select invoice_history_id, tax_invoice_code, sales_order_code, tax_invoice_status, apply_time, finance_members, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, invoice_purpose, create_by, create_time, update_by, update_time, remark, use_status, del_flag from financial_tax_invoice_history + + + + + + + + + + insert into financial_tax_invoice_history + + tax_invoice_code, + sales_order_code, + tax_invoice_status, + apply_time, + finance_members, + invoice_quota_ratio, + invoice_amount_rmb, + invoice_amount_usd, + invoice_purpose, + create_by, + create_time, + update_by, + update_time, + remark, + use_status, + del_flag, + + + #{taxInvoiceCode}, + #{salesOrderCode}, + #{taxInvoiceStatus}, + #{applyTime}, + #{financeMembers}, + #{invoiceQuotaRatio}, + #{invoiceAmountRmb}, + #{invoiceAmountUsd}, + #{invoicePurpose}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + #{useStatus}, + #{delFlag}, + + + + + update financial_tax_invoice_history + + tax_invoice_code = #{taxInvoiceCode}, + sales_order_code = #{salesOrderCode}, + tax_invoice_status = #{taxInvoiceStatus}, + apply_time = #{applyTime}, + finance_members = #{financeMembers}, + invoice_quota_ratio = #{invoiceQuotaRatio}, + invoice_amount_rmb = #{invoiceAmountRmb}, + invoice_amount_usd = #{invoiceAmountUsd}, + invoice_purpose = #{invoicePurpose}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + use_status = #{useStatus}, + del_flag = #{delFlag}, + + where invoice_history_id = #{invoiceHistoryId} + + + + delete from financial_tax_invoice_history where invoice_history_id = #{invoiceHistoryId} + + + + delete from financial_tax_invoice_history where invoice_history_id in + + #{invoiceHistoryId} + + + + + update financial_tax_invoice_history set del_flag = '1' where invoice_history_id = #{invoiceHistoryId} + + + + update financial_tax_invoice_history set del_flag = '0' where invoice_history_id = #{invoiceHistoryId} + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml index f6f096d5..3545cd82 100644 --- a/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/financial/FinancialTaxInvoiceMapper.xml @@ -36,7 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + @@ -55,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice + select tax_invoice_id, tax_invoice_code, tax_invoice_status, use_status, sales_order_code, sales_order_number, sales_order_type, tax_invoice_type, tax_invoice_class, tax_invoice_title, business_members, apply_user, enterprise_code, enterprise_name, contact_number, enterprise_address, common_currency, invoice_company_name, invoice_company_code, deposit_bank, bank_account, tax_rate, usd_tax, material_sum, enterprise_sum, noRmbSum, rmbTaxSum, noUsdSum, usdTaxSum, invoice_email, invoice_quota_ratio, invoice_amount_rmb, invoice_amount_usd, actual_invoice_amount, actual_invoice_amount_rmb, actual_invoice_amount_usd, invoice_purpose, business_remark, invoice_remark, invoice_data, invoice_code, invoice_phone, create_by, create_time, update_by, update_time, remark, del_flag from financial_tax_invoice + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysInvoiceMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysInvoiceMapper.xml index 645bac18..20ffa128 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysInvoiceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysInvoiceMapper.xml @@ -44,6 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where enterprise_code = #{enterpriseCode} + + insert into sys_invoice diff --git a/ruoyi-admin/src/main/resources/templates/erp/material/select.html b/ruoyi-admin/src/main/resources/templates/erp/material/select.html index 46b8c0cc..618abfa3 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/material/select.html +++ b/ruoyi-admin/src/main/resources/templates/erp/material/select.html @@ -51,7 +51,7 @@ var options = { id: 'bootstrap-select-table', clickToSelect: true, // 点击选中行 - singleSelect: true, // 单选 + singleSelect: false, // 单选 url: prefix + "/selectList", modalName: "物料信息", columns: [ diff --git a/ruoyi-admin/src/main/resources/templates/financial/companyCost/companyCost.html b/ruoyi-admin/src/main/resources/templates/financial/companyCost/companyCost.html index 67c2305d..10240f2a 100644 --- a/ruoyi-admin/src/main/resources/templates/financial/companyCost/companyCost.html +++ b/ruoyi-admin/src/main/resources/templates/financial/companyCost/companyCost.html @@ -44,6 +44,9 @@ 添加 + + 导出 +
diff --git a/ruoyi-admin/src/main/resources/templates/index.html b/ruoyi-admin/src/main/resources/templates/index.html index 6620ae30..08894987 100644 --- a/ruoyi-admin/src/main/resources/templates/index.html +++ b/ruoyi-admin/src/main/resources/templates/index.html @@ -9,6 +9,7 @@ + @@ -126,62 +127,57 @@
@@ -242,7 +236,7 @@
-
@@ -264,14 +258,12 @@ - + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/remind/view.html b/ruoyi-admin/src/main/resources/templates/remind/view.html new file mode 100644 index 00000000..b429199b --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/remind/view.html @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + +
+ +
+
+
+
+
+ 我的提醒 +
+ +
+
+
+
+ +
+
+

我的提醒

+
+
+ + +
+
提醒人
+
+ +
+ +
提醒人部门
+
+ +
+ +
提醒时间
+
+ +
+
+ +
+
表单
+
+ +
+
+ +
+
提醒内容
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html index 6fd31a9a..34a57450 100644 --- a/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html +++ b/ruoyi-admin/src/main/resources/templates/system/salesOrder/makeInvoiceRMB.html @@ -61,31 +61,35 @@
- +
+ +
- +
- +
- +
- +
@@ -120,19 +124,6 @@
-
- -
- -
-
-
- -
- -
-
-
@@ -210,9 +201,9 @@
- +
- +
@@ -233,6 +224,9 @@ var materialProcessMethodDatas = [[${@dict.getType('processMethod')}]]; var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; + var taxInvoiceStatusDatas = [[${@dict.getType('tax_invoice_status')}]]; + + var taxInvoice = [[${taxInvoice}]]; var prefix = ctx + "system/salesOrder" $("#form-taxInvoice-RMBAdd").validate({ @@ -280,11 +274,11 @@ } - + //开票物料 $(function() { var options = { id: 'bootstrap-table-material', - url: prefix + "/getSalesOrderCodeChildListByCode", + url: prefix + "/getSalesOrderChildListByCode", queryParams: function(params) { return { salesOrderCode: $("#salesOrderCode").val(), @@ -371,6 +365,169 @@ }); + //开票历史 + $(function() { + var options = { + id: 'bootstrap-table-history', + url: prefix + "/getInvoiceHistoryListBySalesOrderCode", + queryParams: function(params) { + return { + salesOrderCode: $("#salesOrderCode").val(), + } + }, + showSearch: false, + showRefresh: false, + showToggle: false, + showColumns: false, + pagination: false, // 设置不分页 + modalName: "国税发票历史记录", + columns: [{ + checkbox: true + }, + { + title: '国税发票历史id', + field: 'invoiceHistoryId', + visible: false + }, + { + title: '国税发票单号', + field: 'taxInvoiceCode', + }, + { + title: '发票状态', //(0待审核、1待开具、2已开具、3审核拒绝) + field: 'taxInvoiceStatus', + formatter: function(value, row, index) { + return $.table.selectDictLabel(taxInvoiceStatusDatas, value); + } + }, + { + title: '申请时间', + field: 'applyTime', + }, + { + title: '财务员', + field: 'financeMembers', + }, + { + title: '开票额度比例', + field: 'invoiceQuotaRatio', + }, + { + title: '开票金额(RMB)', + field: 'invoiceAmountRmb', + }, + { + title: '开票用途', + field: 'invoicePurpose', + }, + { + title: '操作', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('编辑 '); + return actions.join(''); + } + }] + }; + $.table.init(options); + }); + + + + + //获取客户发票信息 + $(document).ready(function() { + // 初始化时默认加载客户编号列表 + loadInvoiceCompanyNames(); + + // 监听开票公司名称下拉框的变化 + $('#invoiceCompanyName').on('change', function() { + var selectedInvoiceCompanyName = $(this).val(); // 获取选中的开票公司名称 + if (selectedInvoiceCompanyName) { + // 发起Ajax请求获取客户名称 + $.ajax({ + type: 'POST', + url: ctx + 'system/customer/getSysInvoiceInfoByName', + dataType: 'json', // 假设返回的数据格式是JSON + data: { invoiceCompanyName: selectedInvoiceCompanyName }, // 数据放在这里 + success: function(data) { + console.log(data); + // 将获取到的客户名称填充到输入框 + if (!data || !data.data) { + // 如果返回的数据有问题,可以给出提示或处理 + $.modal.alertWarning('未能获取到开票公司信息!'); + } else { + fillInvoiceDetails(data.data); + } + }, + error: function(jqXHR, textStatus, errorThrown) { + console.error('Error:', textStatus, errorThrown); + $.modal.alertWarning('查询开票公司名称时发生错误!'); + } + }); + } else { + // 如果没有选择开票公司名称,清开票信息输入框 + clearInvoiceDetails(); + } + }); + }); + + // 封装填充发票详情的函数 + function fillInvoiceDetails(details) { + $('input[name="invoiceCompanyCode"]').val(details.invoiceCompanyCode); + $('input[name="depositBank"]').val(details.depositBank); + $('input[name="bankAccount"]').val(details.bankAccount); + } + + // 封装清空发票详情的函数 + function clearInvoiceDetails() { + $('input[name="invoiceCompanyCode"]').val(''); + $('input[name="depositBank"]').val(''); + $('input[name="bankAccount"]').val(''); + } + + + + // 假设的加载客户编号列表函数 + function loadInvoiceCompanyNames() { + var enterpriseCode = $("#enterpriseCode").val(); + var url = ctx + 'system/customer/getAllInvoiceCompanyNameByCode' + '?enterpriseCode=' + enterpriseCode; + var tempInvoiceCompanyName = taxInvoice.invoiceCompanyName; + + $.ajax({ + type: 'GET', // 请求类型 + url: url, // 后端接口URL + dataType: 'json', // 预期服务器返回的数据类型 + success: function(data) { + if (data && Array.isArray(data)) { + var selectElement = $('#invoiceCompanyName'); // 获取开票公司名称下拉框元素 + // 清空下拉框现有选项 + selectElement.empty(); + + // 添加默认选项 + if (tempInvoiceCompanyName) { + selectElement.append(''); + } + + // 遍历返回的数据,添加为下拉框的选项 + $.each(data, function(index, item) { + // 假设item有invoiceCompanyName属性,代表客户名称 + selectElement.append(''); + }); + + // 设置默认值 + if (tempInvoiceCompanyName) { + selectElement.val(tempInvoiceCompanyName); + } + } else { + $.modal.errMsg("开票公司信息为空"); + } + }, + }); + } + + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index 8f744b40..39fbd81b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -2,6 +2,8 @@ package com.ruoyi.system.mapper; import com.ruoyi.common.core.domain.entity.SysUser; import org.apache.ibatis.annotations.MapKey; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import java.util.List; import java.util.Map; @@ -137,4 +139,29 @@ public interface SysUserMapper List> selectUserSelList(String userName); List selectRoleToUserList(String[] roleKeys); + + /** + * 根据角色名称查找用户 + * @param roleKey + * @return + */ + @Select("select a.login_name from sys_user a,sys_role b,sys_user_role c\r\n" + + "where a.del_flag = 0 and a.status = 0\r\n" + + "and b.del_flag = 0 and b.status = 0\r\n" + + "and b.role_id = c.role_id\r\n" + + "and a.user_id = c.user_id\r\n" + + "and b.role_key = #{roleKey} order by a.login_name ") + public String selectUserByUniqueRolekey(String roleKey); + + @Select("select a.user_name as userName,a.login_name as loginName from sys_user a,sys_dept b where a.dept_id = b.dept_id and b.dept_name=#{deptName} and a.status = 0 and a.del_flag = 0") + public List selectUserByDeptName(String deptName); + + /** + * 查询部门领导 + * @param roleKey + * @param deptId + * @return + */ + @Select("select login_name from sys_user a,sys_user_role b,sys_role c where a.user_id = b.user_id and b.role_id = c.role_id and a.dept_id=#{deptId} and c.role_key= #{roleKey} and a.del_flag = 0 and a.status = 0") + public String selectDeptLeaderId(@Param(value = "roleKey") String roleKey, @Param(value = "deptId") Long deptId); }