zhangsiqi
7 months ago
10 changed files with 1052 additions and 172 deletions
@ -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 |
|||
* |
|||
* @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<SysInvoice> 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<SysInvoice> list = sysInvoiceService.selectSysInvoiceList(sysInvoice); |
|||
ExcelUtil<SysInvoice> util = new ExcelUtil<SysInvoice>(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()); |
|||
} |
|||
} |
|||
|
@ -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(); |
|||
} |
|||
} |
@ -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<SysInvoice> 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); |
|||
} |
@ -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<SysInvoice> 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(); |
|||
} |
@ -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<SysInvoice> 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"); |
|||
} |
|||
} |
@ -0,0 +1,111 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper |
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.ruoyi.system.mapper.SysInvoiceMapper"> |
|||
|
|||
<resultMap type="SysInvoice" id="SysInvoiceResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="invoiceId" column="invoice_id" /> |
|||
<result property="enterpriseCode" column="enterprise_code" /> |
|||
<result property="enterpriseName" column="enterprise_name" /> |
|||
<result property="invoiceCompanyName" column="invoice_company_name" /> |
|||
<result property="invoiceCompanyCode" column="invoice_company_code" /> |
|||
<result property="depositBank" column="deposit_bank" /> |
|||
<result property="bankAccount" column="bank_account" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="createTime" column="createTime" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
<result property="remark" column="remark" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectSysInvoiceVo"> |
|||
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 |
|||
</sql> |
|||
|
|||
<select id="selectSysInvoiceList" parameterType="SysInvoice" resultMap="SysInvoiceResult"> |
|||
<include refid="selectSysInvoiceVo"/> |
|||
<where> |
|||
<if test="enterpriseCode != null and enterpriseCode != ''"> and enterprise_code = #{enterpriseCode}</if> |
|||
<if test="enterpriseName != null and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectSysInvoiceById" parameterType="Long" resultMap="SysInvoiceResult"> |
|||
<include refid="selectSysInvoiceVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertSysInvoice" parameterType="SysInvoice" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into sys_invoice |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="invoiceId != null">invoice_id,</if> |
|||
<if test="enterpriseCode != null">enterprise_code,</if> |
|||
<if test="enterpriseName != null">enterprise_name,</if> |
|||
<if test="invoiceCompanyName != null">invoice_company_name,</if> |
|||
<if test="invoiceCompanyCode != null">invoice_company_code,</if> |
|||
<if test="depositBank != null">deposit_bank,</if> |
|||
<if test="bankAccount != null">bank_account,</if> |
|||
<if test="createBy != null">create_by,</if> |
|||
<if test="createTime != null">createTime,</if> |
|||
<if test="updateBy != null">update_by,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
<if test="remark != null">remark,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="invoiceId != null">#{invoiceId},</if> |
|||
<if test="enterpriseCode != null">#{enterpriseCode},</if> |
|||
<if test="enterpriseName != null">#{enterpriseName},</if> |
|||
<if test="invoiceCompanyName != null">#{invoiceCompanyName},</if> |
|||
<if test="invoiceCompanyCode != null">#{invoiceCompanyCode},</if> |
|||
<if test="depositBank != null">#{depositBank},</if> |
|||
<if test="bankAccount != null">#{bankAccount},</if> |
|||
<if test="createBy != null">#{createBy},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="updateBy != null">#{updateBy},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateSysInvoice" parameterType="SysInvoice"> |
|||
update sys_invoice |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="enterpriseCode != null">enterprise_code = #{enterpriseCode},</if> |
|||
<if test="enterpriseName != null">enterprise_name = #{enterpriseName},</if> |
|||
<if test="invoiceCompanyName != null">invoice_company_name = #{invoiceCompanyName},</if> |
|||
<if test="invoiceCompanyCode != null">invoice_company_code = #{invoiceCompanyCode},</if> |
|||
<if test="depositBank != null">deposit_bank = #{depositBank},</if> |
|||
<if test="bankAccount != null">bank_account = #{bankAccount},</if> |
|||
<if test="createBy != null">create_by = #{createBy},</if> |
|||
<if test="createTime != null">createTime = #{createTime},</if> |
|||
<if test="updateBy != null">update_by = #{updateBy},</if> |
|||
<if test="updateTime != null">update_time = #{updateTime},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteSysInvoiceById" parameterType="Long"> |
|||
delete from sys_invoice where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteSysInvoiceByIds" parameterType="String"> |
|||
delete from sys_invoice where id in |
|||
<foreach item="id" collection="array" open="(" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
</delete> |
|||
|
|||
<update id="cancelSysInvoiceById" parameterType="Long"> |
|||
update sys_invoice set del_flag = '1' where id = #{id} |
|||
</update> |
|||
|
|||
<update id="restoreSysInvoiceById" parameterType="Long"> |
|||
update sys_invoice set del_flag = '0' where id = #{id} |
|||
</update> |
|||
|
|||
</mapper> |
@ -0,0 +1,116 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增其他开票信息')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-invoice-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceId" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">企业代码:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="enterpriseCode" class="form-control"> |
|||
<option value=""></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">企业名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseName" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票公司名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceCompanyName" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票公司税号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceCompanyCode" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">公司开户行:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="depositBank" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">公司开户账号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="bankAccount" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">备注:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="remark" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/invoice" |
|||
$("#form-invoice-add").validate({focusCleanup: true}); |
|||
/*获取生成的开票ID*/ |
|||
$(function(){ |
|||
$.ajax({ |
|||
url: prefix + "/getId", |
|||
type: "post", |
|||
success: function (resp) { |
|||
if (resp.code === 0) { |
|||
$("input[name='invoiceId']").val(resp.data); |
|||
} else { |
|||
$.modal.msgError("失败啦"); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}) |
|||
}) |
|||
/*获取要添加开票信息的客户对象*/ |
|||
var customerodata = [] |
|||
$.ajax({ |
|||
url: ctx + "system/customer/customerList", |
|||
type: "POST", |
|||
success: function (res) { |
|||
if (res.rows.length > 0) { |
|||
customerodata = res.rows; |
|||
console.log(res.rows) |
|||
for (let i in customerodata) { |
|||
$("select[name='enterpriseCode']").append("<option value='" + |
|||
customerodata[i].enterpriseCode + "'>" + customerodata[i].enterpriseCode + "</option>"); |
|||
} |
|||
} else { |
|||
$.modal.msgError(res.msg); |
|||
} |
|||
} |
|||
}) |
|||
|
|||
$("select[name='enterpriseCode']").change(function () { |
|||
var enterpriseCode = $(this).val(); |
|||
for (i = 0; i < customerodata.length; i++) { |
|||
if (customerodata[i].enterpriseCode === enterpriseCode) { |
|||
$("input[name='enterpriseName']").val(customerodata[i].enterpriseName) |
|||
} |
|||
} |
|||
}) |
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-invoice-add').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,61 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改其他开票信息')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-invoice-detail" th:object="${sysInvoice}"> |
|||
<input name="id" th:field="*{id}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceId" th:field="*{invoiceId}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">企业代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">企业名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票公司名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceCompanyName" th:field="*{invoiceCompanyName}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票公司税号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceCompanyCode" th:field="*{invoiceCompanyCode}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">公司开户行:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="depositBank" th:field="*{depositBank}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">公司开户账号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/invoice"; |
|||
$("#form-invoice-edit").validate({focusCleanup: true}); |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,88 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改其他开票信息')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-invoice-edit" th:object="${sysInvoice}"> |
|||
<input name="id" th:field="*{id}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">企业代码:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">企业名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票公司名称:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceCompanyName" th:field="*{invoiceCompanyName}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">开票公司税号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="invoiceCompanyCode" th:field="*{invoiceCompanyCode}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">公司开户行:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="depositBank" th:field="*{depositBank}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">公司开户账号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="bankAccount" th:field="*{bankAccount}" class="form-control" type="text"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "system/invoice"; |
|||
$("#form-invoice-edit").validate({focusCleanup: true}); |
|||
$.ajax({ |
|||
url: ctx + "system/customer/customerList", |
|||
type: "POST", |
|||
success: function (res) { |
|||
// console.log(res) |
|||
if (res.rows.length > 0) { |
|||
customerodata = res.rows; |
|||
//alert(JSON.stringify(data)); |
|||
console.log(res.rows) |
|||
for (let i in customerodata) { |
|||
$("select[name='enterpriseCode']").append("<option value='" + customerodata[i].enterpriseCode + "'>" + customerodata[i].enterpriseCode + "</option>"); |
|||
} |
|||
} else { |
|||
$.modal.msgError(res.msg); |
|||
} |
|||
}, |
|||
error: function () { |
|||
$.modal.msgError("后台出错啦!"); |
|||
} |
|||
}) |
|||
|
|||
$("select[name='enterpriseCode']").change(function () { |
|||
var enterpriseCode = $(this).val(); |
|||
for (i = 0; i < customerodata.length; i++) { |
|||
if (customerodata[i].enterpriseCode === enterpriseCode) { |
|||
$("input[name='enterpriseName']").val(customerodata[i].enterpriseName) |
|||
} |
|||
} |
|||
}) |
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-invoice-edit').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue