已修改17个文件
已删除4个文件
已添加18个文件
| | |
| | | <jwt.version>0.9.1</jwt.version>
|
| | | <kaptcha.version>2.3.3</kaptcha.version>
|
| | | <swagger.version>3.0.0</swagger.version>
|
| | | <poi.version>4.1.2</poi.version>
|
| | | <poi.version>5.2.3</poi.version>
|
| | | <oshi.version>6.6.5</oshi.version>
|
| | | <velocity.version>2.3</velocity.version>
|
| | | <!-- override dependency version -->
|
| | |
| | | |
| | | /** |
| | | * å®¢æ·æ¡£æ¡Controller |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-07 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/customer") |
| | | @RequestMapping("/basic/customer") |
| | | @AllArgsConstructor |
| | | public class CustomerController extends BaseController |
| | | { |
| | | public class CustomerController extends BaseController { |
| | | private ICustomerService customerService; |
| | | |
| | | /** |
| | | * æ¥è¯¢å®¢æ·æ¡£æ¡å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(Customer customer) |
| | | { |
| | | public TableDataInfo list(Customer customer) { |
| | | startPage(); |
| | | List<Customer> list = customerService.selectCustomerList(customer); |
| | | return getDataTable(list); |
| | |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, Customer customer) |
| | | { |
| | | List<Customer> list = customerService.selectCustomerList(customer); |
| | | public void export(HttpServletResponse response, Customer customer) { |
| | | Long[] ids = customer.getIds(); |
| | | List<Customer> list; |
| | | if (ids != null && ids.length > 0) { |
| | | list = customerService.selectCustomerListByIds(ids); |
| | | } else { |
| | | |
| | | list = customerService.selectCustomerList(customer); |
| | | } |
| | | ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class); |
| | | util.exportExcel(response, list, "å®¢æ·æ¡£æ¡æ°æ®"); |
| | | } |
| | |
| | | * è·åå®¢æ·æ¡£æ¡è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(customerService.selectCustomerById(id)); |
| | | } |
| | | |
| | |
| | | * æ°å¢å®¢æ·æ¡£æ¡ |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.INSERT) |
| | | @PostMapping ("/addCustomer") |
| | | public AjaxResult add(@RequestBody Customer customer) |
| | | { |
| | | @PostMapping("/addCustomer") |
| | | public AjaxResult add(@RequestBody Customer customer) { |
| | | return toAjax(customerService.insertCustomer(customer)); |
| | | } |
| | | |
| | |
| | | * ä¿®æ¹å®¢æ·æ¡£æ¡ |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody Customer customer) |
| | | { |
| | | @PostMapping("/updateCustomer") |
| | | public AjaxResult edit(@RequestBody Customer customer) { |
| | | return toAjax(customerService.updateCustomer(customer)); |
| | | } |
| | | |
| | |
| | | * å é¤å®¢æ·æ¡£æ¡ |
| | | */ |
| | | @Log(title = "å®¢æ·æ¡£æ¡", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | return toAjax(customerService.deleteCustomerByIds(ids)); |
| | | } |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | @RestController |
| | | @RequestMapping("/system/supplier") |
| | | public class SupplierManageController { |
| | |
| | | public AjaxResult supplierListPage(Page page, SupplierManageDto supplierManageDto) { |
| | | return AjaxResult.success(supplierService.supplierListPage(page, supplierManageDto)); |
| | | } |
| | | |
| | | /** |
| | | * ä¾åºåå¯¼åº |
| | | * @param response |
| | | * @param supplierManageDto |
| | | */ |
| | | @GetMapping("/export") |
| | | public void supplierExport(HttpServletResponse response, SupplierManageDto supplierManageDto) { |
| | | supplierService.supplierExport(response, supplierManageDto); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SupplierManageDto extends SupplierManage { |
| | | |
| | | @ApiModelProperty(value = "ç»´æ¤äººååç§°") |
| | | private String maintainUserName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.excel; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class SupplierManageExcelDto { |
| | | |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @Excel(name = "纳ç¨äººè¯å«å·") |
| | | private String taxpayerIdentificationNum; |
| | | |
| | | @Excel(name = "å
¬å¸å°å") |
| | | private String companyAddress; |
| | | |
| | | @Excel(name = "å
¬å¸çµè¯") |
| | | private String companyPhone; |
| | | |
| | | @Excel(name = "弿·è¡") |
| | | private String bankAccountName; |
| | | |
| | | @Excel(name = "è´¦å·") |
| | | private String bankAccountNum; |
| | | |
| | | @Excel(name = "è系人") |
| | | private String contactUserName; |
| | | |
| | | @Excel(name = "èç³»çµè¯") |
| | | private String contactUserPhone; |
| | | |
| | | @Excel(name = "ç»´æ¤äººID") |
| | | private Integer maintainUserId; |
| | | |
| | | @Excel(name = "ç»´æ¤æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime maintainTime; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.basic.excel.SupplierManageExcelDto; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface SupplierManageMapper extends BaseMapper<SupplierManage> { |
| | | |
| | | IPage<SupplierManage> supplierListPage(Page page, @Param("supplierManageDto") SupplierManageDto supplierManageDto); |
| | | |
| | | List<SupplierManageExcelDto> supplierExportList(@Param("supplierManageDto") SupplierManageDto supplierManageDto); |
| | | } |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.framework.web.domain.BaseEntity; |
| | | |
| | | /** |
| | | * å®¢æ·æ¡£æ¡å¯¹è±¡ customer |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-07 |
| | | */ |
| | | @TableName(value = "customer") |
| | | @Data |
| | | public class Customer extends BaseEntity |
| | | { |
| | | public class Customer implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** $column.columnComment */ |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** 客æ·åç§° */ |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | /** 纳ç¨äººè¯å«å· */ |
| | | /** |
| | | * 纳ç¨äººè¯å«å· |
| | | */ |
| | | @Excel(name = "纳ç¨äººè¯å«å·") |
| | | private String taxpayerIdentificationNumber; |
| | | |
| | | /** å
¬å¸å°å */ |
| | | /** |
| | | * å
¬å¸å°å |
| | | */ |
| | | @Excel(name = "å
¬å¸å°å") |
| | | private String companyAddress; |
| | | |
| | | /** å
¬å¸çµè¯ */ |
| | | /** |
| | | * å
¬å¸çµè¯ |
| | | */ |
| | | @Excel(name = "å
¬å¸çµè¯") |
| | | private String companyPhone; |
| | | |
| | | /** è系人 */ |
| | | /** |
| | | * è系人 |
| | | */ |
| | | @Excel(name = "è系人") |
| | | private String contactPerson; |
| | | |
| | | /** èç³»çµè¯ */ |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | @Excel(name = "èç³»çµè¯") |
| | | private String contactPhone; |
| | | |
| | | /** ç»´æ¤äºº */ |
| | | /** |
| | | * ç»´æ¤äºº |
| | | */ |
| | | @Excel(name = "ç»´æ¤äºº") |
| | | private String maintainer; |
| | | |
| | | /** ç»´æ¤æ¶é´ */ |
| | | /** |
| | | * ç»´æ¤æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç»´æ¤æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @Excel(name = "ç»´æ¤æ¶é´" , width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date maintenanceTime; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | |
| | | public void setCustomerName(String customerName) |
| | | { |
| | | this.customerName = customerName; |
| | | } |
| | | |
| | | public String getCustomerName() |
| | | { |
| | | return customerName; |
| | | } |
| | | |
| | | public void setTaxpayerIdentificationNumber(String taxpayerIdentificationNumber) |
| | | { |
| | | this.taxpayerIdentificationNumber = taxpayerIdentificationNumber; |
| | | } |
| | | |
| | | public String getTaxpayerIdentificationNumber() |
| | | { |
| | | return taxpayerIdentificationNumber; |
| | | } |
| | | |
| | | public void setCompanyAddress(String companyAddress) |
| | | { |
| | | this.companyAddress = companyAddress; |
| | | } |
| | | |
| | | public String getCompanyAddress() |
| | | { |
| | | return companyAddress; |
| | | } |
| | | |
| | | public void setCompanyPhone(String companyPhone) |
| | | { |
| | | this.companyPhone = companyPhone; |
| | | } |
| | | |
| | | public String getCompanyPhone() |
| | | { |
| | | return companyPhone; |
| | | } |
| | | |
| | | public void setContactPerson(String contactPerson) |
| | | { |
| | | this.contactPerson = contactPerson; |
| | | } |
| | | |
| | | public String getContactPerson() |
| | | { |
| | | return contactPerson; |
| | | } |
| | | |
| | | public void setContactPhone(String contactPhone) |
| | | { |
| | | this.contactPhone = contactPhone; |
| | | } |
| | | |
| | | public String getContactPhone() |
| | | { |
| | | return contactPhone; |
| | | } |
| | | |
| | | public void setMaintainer(String maintainer) |
| | | { |
| | | this.maintainer = maintainer; |
| | | } |
| | | |
| | | public String getMaintainer() |
| | | { |
| | | return maintainer; |
| | | } |
| | | |
| | | public void setMaintenanceTime(Date maintenanceTime) |
| | | { |
| | | this.maintenanceTime = maintenanceTime; |
| | | } |
| | | |
| | | public Date getMaintenanceTime() |
| | | { |
| | | return maintenanceTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("customerName", getCustomerName()) |
| | | .append("taxpayerIdentificationNumber", getTaxpayerIdentificationNumber()) |
| | | .append("companyAddress", getCompanyAddress()) |
| | | .append("companyPhone", getCompanyPhone()) |
| | | .append("contactPerson", getContactPerson()) |
| | | .append("contactPhone", getContactPhone()) |
| | | .append("maintainer", getMaintainer()) |
| | | .append("maintenanceTime", getMaintenanceTime()) |
| | | .toString(); |
| | | } |
| | | @TableField(exist = false) |
| | | private Long[] ids; |
| | | } |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | private Integer maintainUserId; |
| | | |
| | | @ApiModelProperty(value = "ç»´æ¤æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime maintainTime; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | |
| | | */ |
| | | int deleteCustomerByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤å®¢æ·æ¡£æ¡ä¿¡æ¯ |
| | | * |
| | | * @param id å®¢æ·æ¡£æ¡ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | int deleteCustomerById(Long id); |
| | | List<Customer> selectCustomerListByIds(Long[] ids); |
| | | } |
| | |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | public interface ISupplierService { |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | IPage<SupplierManage> supplierListPage(Page page, SupplierManageDto supplierManageDto); |
| | | |
| | | /** |
| | | * ä¾åºåå¯¼åº |
| | | * @param response |
| | | * @param supplierManageDto |
| | | */ |
| | | void supplierExport(HttpServletResponse response, SupplierManageDto supplierManageDto); |
| | | } |
| | |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.service.ICustomerService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | |
| | |
| | | */ |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | | public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements ICustomerService { |
| | | private CustomerMapper customerMapper; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<Customer> selectCustomerList(Customer customer) { |
| | | return customerMapper.selectList(new LambdaQueryWrapper<>()); |
| | | LambdaQueryWrapper<Customer> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (customer.getCustomerName() != null && !customer.getCustomerName().isEmpty()) { |
| | | queryWrapper.eq(Customer::getCustomerName, customer.getCustomerName()); |
| | | } |
| | | List<Customer> customerList = customerMapper.selectList(queryWrapper); |
| | | return customerList; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public int insertCustomer(Customer customer) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Integer tenantId = loginUser.getTenantId(); |
| | | customer.setTenantId(Long.valueOf(tenantId)); |
| | | return customerMapper.insert(customer); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public int updateCustomer(Customer customer) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Integer tenantId = loginUser.getTenantId(); |
| | | customer.setTenantId(Long.valueOf(tenantId)); |
| | | return customerMapper.updateById(customer); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public int deleteCustomerByIds(Long[] ids) { |
| | | return customerMapper.deleteCustomerByIds(ids); |
| | | List<Long> idList = Arrays.asList(ids); |
| | | return customerMapper.deleteBatchIds(idList); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å®¢æ·æ¡£æ¡ä¿¡æ¯ |
| | | * |
| | | * @param id å®¢æ·æ¡£æ¡ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteCustomerById(Long id) { |
| | | return customerMapper.deleteById(id); |
| | | public List<Customer> selectCustomerListByIds(Long[] ids) { |
| | | LambdaQueryWrapper<Customer> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(Customer::getId, Arrays.asList(ids)); |
| | | return customerMapper.selectList(queryWrapper); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.basic.excel.SupplierManageExcelDto; |
| | | import com.ruoyi.basic.mapper.SupplierManageMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.basic.service.ISupplierService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SupplierServiceImpl extends ServiceImpl<SupplierManageMapper,SupplierManage> implements ISupplierService { |
| | |
| | | public IPage<SupplierManage> supplierListPage(Page page, SupplierManageDto supplierManageDto) { |
| | | return supplierMapper.supplierListPage(page,supplierManageDto); |
| | | } |
| | | |
| | | /** |
| | | * ä¾åºåå¯¼åº |
| | | * @param response |
| | | * @param supplierManageDto |
| | | */ |
| | | @Override |
| | | public void supplierExport(HttpServletResponse response, SupplierManageDto supplierManageDto) { |
| | | List<SupplierManageExcelDto> supplierManageList = supplierMapper.supplierExportList(supplierManageDto); |
| | | ExcelUtil<SupplierManageExcelDto> util = new ExcelUtil<SupplierManageExcelDto>(SupplierManageExcelDto.class); |
| | | util.exportExcel(response, supplierManageList, "ä¾åºå导åº"); |
| | | } |
| | | } |
| | |
| | | IGNORE_TABLES.add("sys_role_menu"); |
| | | IGNORE_TABLES.add("sys_menu"); |
| | | IGNORE_TABLES.add("sys_role_dept"); |
| | | IGNORE_TABLES.add("sys_logininfor"); |
| | | |
| | | } |
| | | } |
| | |
| | | {
|
| | | return success(deptService.selectDeptTreeList(dept));
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¸åé¡µç¨æ·æ¥è¯¢
|
| | | * @param user
|
| | | * @return
|
| | | */
|
| | | @GetMapping("/userListNoPage")
|
| | | public AjaxResult userListNoPage(SysUser user){
|
| | | List<SysUser> sysUserList = userService.userListNoPage(user);
|
| | | return AjaxResult.success(sysUserList);
|
| | | }
|
| | | }
|
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
| | |
|
| | | /**
|
| | | * ä¸åé¡µç¨æ·æ¥è¯¢
|
| | | * @param user
|
| | | * @return
|
| | | */
|
| | | List<SysUser> userListNoPage(SysUser user);
|
| | | }
|
| | |
| | | package com.ruoyi.project.system.service.impl;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.List;
|
| | | import java.util.stream.Collectors;
|
| | | import javax.validation.Validator;
|
| | |
| | | }
|
| | | return successMsg.toString();
|
| | | }
|
| | |
|
| | | /**
|
| | | * ä¸åé¡µç¨æ·æ¥è¯¢
|
| | | * @param user
|
| | | * @return
|
| | | */
|
| | | @Override
|
| | | public List<SysUser> userListNoPage(SysUser user) {
|
| | | return userMapper.selectUserList(user);
|
| | | }
|
| | | }
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.service.InvoiceRegistrationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/invoiceRegistration") |
| | | public class InvoiceRegistrationController { |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationService invoiceRegistrationService; |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°æ°å¢ |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult invoiceRegistrationAdd(@RequestBody InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | invoiceRegistrationService.invoiceRegistrationAdd(invoiceRegistrationDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°å é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult invoiceRegistrationDel(List<Integer> ids) { |
| | | invoiceRegistrationService.invoiceRegistrationDel(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨è®°å½ä¿®æ¹ |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult invoiceRegistrationUpdate(@RequestBody InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | invoiceRegistrationService.invoiceRegistrationUpdate(invoiceRegistrationDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°å页æ¥è¯¢ |
| | | * @param page |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult invoiceRegistrationListPage(Page page, InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | return AjaxResult.success(invoiceRegistrationService.invoiceRegistrationListPage(page, invoiceRegistrationDto)); |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°äº§åæ¥è¯¢ |
| | | * @param invoiceRegistrationProductDto |
| | | * @return |
| | | */ |
| | | @GetMapping("/productList") |
| | | public AjaxResult invoiceRegistrationProductList(InvoiceRegistrationProductDto invoiceRegistrationProductDto) { |
| | | return AjaxResult.success(invoiceRegistrationService.invoiceRegistrationProductList(invoiceRegistrationProductDto)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | |
| | | /** |
| | | * éå®å°è´¦Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-08 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/sales/ledger") |
| | | public class SalesLedgerController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISalesLedgerService salesLedgerService; |
| | | |
| | | /** |
| | | * æ¥è¯¢éå®å°è´¦å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SalesLedger salesLedger) |
| | | { |
| | | startPage(); |
| | | List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedger); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºéå®å°è´¦å表 |
| | | */ |
| | | @Log(title = "éå®å°è´¦", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SalesLedger salesLedger) |
| | | { |
| | | List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedger); |
| | | ExcelUtil<SalesLedger> util = new ExcelUtil<SalesLedger>(SalesLedger.class); |
| | | util.exportExcel(response, list, "éå®å°è´¦æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åéå®å°è´¦è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(salesLedgerService.selectSalesLedgerById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢éå®å°è´¦ |
| | | */ |
| | | @Log(title = "éå®å°è´¦", businessType = BusinessType.INSERT) |
| | | @PostMapping ("/insertSalesLedger") |
| | | public AjaxResult add(@RequestBody SalesLedger salesLedger) |
| | | { |
| | | return toAjax(salesLedgerService.insertSalesLedger(salesLedger)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹éå®å°è´¦ |
| | | */ |
| | | @Log(title = "éå®å°è´¦", businessType = BusinessType.UPDATE) |
| | | @PostMapping ("/updateSalesLedger") |
| | | public AjaxResult edit(@RequestBody SalesLedger salesLedger) |
| | | { |
| | | return toAjax(salesLedgerService.updateSalesLedger(salesLedger)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤éå®å°è´¦ |
| | | */ |
| | | @Log(title = "éå®å°è´¦", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(salesLedgerService.deleteSalesLedgerByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.ruoyi.sales.pojo.InvoiceRegistration; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class InvoiceRegistrationDto extends InvoiceRegistration { |
| | | |
| | | @ApiModelProperty(name = "å¼ç¥¨ç»è®°äº§åéå") |
| | | private List<InvoiceRegistrationProductDto> productDtoList; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class InvoiceRegistrationProductDto extends InvoiceRegistrationProduct { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | public class SalesLedgerDto { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationDto; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistration; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface InvoiceRegistrationMapper extends BaseMapper<InvoiceRegistration> { |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°å页æ¥è¯¢ |
| | | * @param page |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | IPage<InvoiceRegistrationDto> invoiceRegistrationListPage(Page page, @Param("invoiceRegistrationDto") InvoiceRegistrationDto invoiceRegistrationDto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface InvoiceRegistrationProductMapper extends BaseMapper<InvoiceRegistrationProduct> { |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°äº§åæ¥è¯¢ |
| | | * @param invoiceRegistrationProductDto |
| | | * @return |
| | | */ |
| | | List<InvoiceRegistrationProductDto> invoiceRegistrationProductList(@Param("invoiceRegistrationProductDto") InvoiceRegistrationProductDto invoiceRegistrationProductDto); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | |
| | | |
| | | /** |
| | | * éå®å°è´¦Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface SalesLedgerMapper extends BaseMapper<SalesLedger> { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("invoice_registration") |
| | | public class InvoiceRegistration { |
| | | |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "éå®å°è´¦sales_ledger主é®") |
| | | private Integer salesLedgerId; |
| | | |
| | | @ApiModelProperty(value = "éå®ååå·") |
| | | private String salesContractNo; |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°ID") |
| | | private Integer customerId; |
| | | |
| | | @ApiModelProperty(value = "ä¸å¡å") |
| | | private String salesman; |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @TableName("invoice_registration_product") |
| | | @Data |
| | | public class InvoiceRegistrationProduct { |
| | | |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "å
³èéå®å°è´¦ä¸»è¡¨ä¸»é®") |
| | | private Integer salesLedgerId; |
| | | |
| | | @ApiModelProperty(value = "sales_ledger_product主é®") |
| | | private Integer salesLedgerProductId; |
| | | |
| | | @ApiModelProperty(value = "å¼ç¥¨ç»è®°è¡¨invoice_registration主é®") |
| | | private Integer invoiceRegistrationId; |
| | | |
| | | @ApiModelProperty(value = "产å大类") |
| | | private String productCategory; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | private String specificationModel; |
| | | |
| | | @ApiModelProperty(value = "åä½") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "æ°é") |
| | | private BigDecimal quantity; |
| | | |
| | | @ApiModelProperty(value = "ç¨ç") |
| | | private BigDecimal taxRate; |
| | | |
| | | @ApiModelProperty(value = "å«ç¨åä»·") |
| | | private BigDecimal taxInclusiveUnitPrice; |
| | | |
| | | @ApiModelProperty(value = "å«ç¨æ»ä»·") |
| | | private BigDecimal taxInclusiveTotalPrice; |
| | | |
| | | @ApiModelProperty(value = "ä¸å«ç¨æ»ä»·") |
| | | private BigDecimal taxExclusiveTotalPrice; |
| | | |
| | | @ApiModelProperty(value = "å票类å") |
| | | private String invoiceType; |
| | | |
| | | @ApiModelProperty(value = "å¼ç¥¨æ°") |
| | | private Integer invoiceNum; |
| | | |
| | | @ApiModelProperty(value = "æªå¼ç¥¨æ°") |
| | | private Integer noInvoiceNum; |
| | | |
| | | @ApiModelProperty(value = "å¼ç¥¨éé¢") |
| | | private BigDecimal invoiceAmount; |
| | | |
| | | @ApiModelProperty(value = "æªå¼ç¥¨éé¢") |
| | | private BigDecimal noInvoiceAmount; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer tenantId; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * éå®å°è´¦å¯¹è±¡ sales_ledger |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-08 |
| | | */ |
| | | @TableName(value = "sales_ledger") |
| | | @Data |
| | | public class SalesLedger { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * éå®å°è´¦ä¸»é® |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * éå®ååå· |
| | | */ |
| | | @Excel(name = "éå®ååå·") |
| | | private String salesContractNo; |
| | | |
| | | /** |
| | | * 客æ·ååå· |
| | | */ |
| | | @Excel(name = "客æ·ååå·") |
| | | private String customerContractNo; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | /** |
| | | * å½å
¥æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å½å
¥æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date entryDate; |
| | | |
| | | /** |
| | | * ä¸å¡å |
| | | */ |
| | | @Excel(name = "ä¸å¡å") |
| | | private String salesman; |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | /** |
| | | * å½å
¥äºº |
| | | */ |
| | | @Excel(name = "å½å
¥äºº") |
| | | private String entryPerson; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨") |
| | | private String remarks; |
| | | |
| | | /** |
| | | * éä»¶ææï¼å卿件åçç¸å
³ä¿¡æ¯ |
| | | */ |
| | | @Excel(name = "éä»¶ææï¼å卿件åçç¸å
³ä¿¡æ¯") |
| | | private String attachmentMaterials; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | |
| | | /** |
| | | * éå®å°è´¦Serviceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-08 |
| | | */ |
| | | public interface ISalesLedgerService extends IService<SalesLedger> { |
| | | |
| | | List<SalesLedger> selectSalesLedgerList(SalesLedger salesLedger); |
| | | |
| | | SalesLedger selectSalesLedgerById(Long id); |
| | | |
| | | int deleteSalesLedgerByIds(Long[] ids); |
| | | |
| | | int insertSalesLedger(SalesLedger salesLedger); |
| | | |
| | | int updateSalesLedger(SalesLedger salesLedger); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface InvoiceRegistrationService { |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°æ°å¢ |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | void invoiceRegistrationAdd(InvoiceRegistrationDto invoiceRegistrationDto); |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°å é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | int invoiceRegistrationDel(List<Integer> ids); |
| | | |
| | | |
| | | /** |
| | | * å¼ç¥¨è®°å½ä¿®æ¹ |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | void invoiceRegistrationUpdate(InvoiceRegistrationDto invoiceRegistrationDto); |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°å页æ¥è¯¢ |
| | | * @param page |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | IPage<InvoiceRegistrationDto> invoiceRegistrationListPage(Page page, InvoiceRegistrationDto invoiceRegistrationDto); |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°äº§åæ¥è¯¢ |
| | | * @param invoiceRegistrationProductDto |
| | | * @return |
| | | */ |
| | | List<InvoiceRegistrationProductDto> invoiceRegistrationProductList(InvoiceRegistrationProductDto invoiceRegistrationProductDto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationDto; |
| | | import com.ruoyi.sales.dto.InvoiceRegistrationProductDto; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistration; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import com.ruoyi.sales.service.InvoiceRegistrationService; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class InvoiceRegistrationServiceImpl extends ServiceImpl<InvoiceRegistrationMapper, InvoiceRegistration> implements InvoiceRegistrationService { |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationMapper invoiceRegistrationMapper; |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°æ°å¢ |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void invoiceRegistrationAdd(InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | InvoiceRegistration invoiceRegistration = new InvoiceRegistration(); |
| | | BeanUtils.copyProperties(invoiceRegistrationDto, invoiceRegistration); |
| | | // æ°å¢å¼ç¥¨ç»è®° |
| | | invoiceRegistrationMapper.insert(invoiceRegistration); |
| | | List<InvoiceRegistrationProductDto> productDtoList = invoiceRegistrationDto.getProductDtoList(); |
| | | // æ°å¢å¼ç¥¨äº§åç»è®° |
| | | if(CollectionUtils.isNotEmpty(productDtoList)){ |
| | | for (InvoiceRegistrationProductDto invoiceRegistrationProductDto : productDtoList) { |
| | | InvoiceRegistrationProduct invoiceRegistrationProduct = new InvoiceRegistrationProduct(); |
| | | BeanUtils.copyProperties(invoiceRegistrationProductDto, invoiceRegistrationProduct); |
| | | invoiceRegistrationProduct.setInvoiceRegistrationId(invoiceRegistration.getId()); |
| | | invoiceRegistrationProductMapper.insert(invoiceRegistrationProduct); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°å é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int invoiceRegistrationDel(List<Integer> ids) { |
| | | int excuteNum = invoiceRegistrationMapper.deleteBatchIds(ids); |
| | | LambdaQueryWrapper<InvoiceRegistrationProduct> delWrapper = new LambdaQueryWrapper<>(); |
| | | delWrapper.in(InvoiceRegistrationProduct::getInvoiceRegistrationId, ids); |
| | | invoiceRegistrationProductMapper.delete(delWrapper); |
| | | return excuteNum; |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨è®°å½ä¿®æ¹ |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public void invoiceRegistrationUpdate(InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | InvoiceRegistration invoiceRegistration = new InvoiceRegistration(); |
| | | BeanUtils.copyProperties(invoiceRegistrationDto, invoiceRegistration); |
| | | // å¼ç¥¨ç»è®°ä¿®æ¹ |
| | | invoiceRegistrationMapper.updateById(invoiceRegistration); |
| | | List<InvoiceRegistrationProductDto> productDtoList = invoiceRegistrationDto.getProductDtoList(); |
| | | // å¼ç¥¨äº§åç»è®°ä¿®æ¹ |
| | | if(CollectionUtils.isNotEmpty(productDtoList)){ |
| | | for (InvoiceRegistrationProductDto invoiceRegistrationProductDto : productDtoList) { |
| | | InvoiceRegistrationProduct invoiceRegistrationProduct = new InvoiceRegistrationProduct(); |
| | | BeanUtils.copyProperties(invoiceRegistrationProductDto, invoiceRegistrationProduct); |
| | | invoiceRegistrationProductMapper.updateById(invoiceRegistrationProduct); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°å页æ¥è¯¢ |
| | | * @param page |
| | | * @param invoiceRegistrationDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<InvoiceRegistrationDto> invoiceRegistrationListPage(Page page, InvoiceRegistrationDto invoiceRegistrationDto) { |
| | | return invoiceRegistrationMapper.invoiceRegistrationListPage(page, invoiceRegistrationDto); |
| | | } |
| | | |
| | | /** |
| | | * å¼ç¥¨ç»è®°äº§åæ¥è¯¢ |
| | | * @param invoiceRegistrationProductDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<InvoiceRegistrationProductDto> invoiceRegistrationProductList(InvoiceRegistrationProductDto invoiceRegistrationProductDto) { |
| | | return invoiceRegistrationProductMapper.invoiceRegistrationProductList(invoiceRegistrationProductDto); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éå®å°è´¦Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-05-08 |
| | | */ |
| | | @Service |
| | | public class SalesLedgerServiceImpl extends ServiceImpl<SalesLedgerMapper, SalesLedger> implements ISalesLedgerService { |
| | | @Autowired |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | |
| | | @Override |
| | | public List<SalesLedger> selectSalesLedgerList(SalesLedger salesLedger) { |
| | | return salesLedgerMapper.selectList(new LambdaQueryWrapper<>()); |
| | | } |
| | | |
| | | @Override |
| | | public SalesLedger selectSalesLedgerById(Long id) { |
| | | return salesLedgerMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteSalesLedgerByIds(Long[] ids) { |
| | | return salesLedgerMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | @Override |
| | | public int insertSalesLedger(SalesLedger salesLedger) { |
| | | return salesLedgerMapper.insert(salesLedger); |
| | | } |
| | | |
| | | @Override |
| | | public int updateSalesLedger(SalesLedger salesLedger) { |
| | | return salesLedgerMapper.updateById(salesLedger); |
| | | } |
| | | } |
| | |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 30 |
| | | expireTime: 450 |
| | | |
| | | # MyBatis Plusé
ç½® |
| | | # MyBatis Plusé
ç½® |
| | | mybatis-plus: |
| | | # æç´¢æå®å
å«å æ ¹æ®èªå·±çé¡¹ç®æ¥ |
| | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | # æ¯å¦å¼å¯swagger |
| | | enabled: true |
| | | enabled: false |
| | | # 请æ±åç¼ |
| | | pathMapping: /dev-api |
| | | |
| | |
| | | T1.create_user, |
| | | T1.update_time, |
| | | T1.update_user, |
| | | T1.tenant_id |
| | | T1.tenant_id, |
| | | T2.user_name AS maintainUserName |
| | | FROM supplier_manage T1 |
| | | LEFT JOIN sys_user T2 ON T1.maintain_user_id = T2.user_id |
| | | <where> |
| | | <if test="supplierManageDto.supplierName != null and supplierManageDto.supplierName != '' "> |
| | | AND supplier_name = #{supplierManageDto.supplierName} |
| | | AND T1.supplier_name LIKE CONCAT('%',#{supplierManageDto.supplierName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="supplierExportList" resultType="com.ruoyi.basic.excel.SupplierManageExcelDto"> |
| | | SELECT |
| | | T1.id, |
| | | T1.supplier_name, |
| | | T1.taxpayer_identification_num, |
| | | T1.company_address, |
| | | T1.company_phone, |
| | | T1.bank_account_name, |
| | | T1.bank_account_num, |
| | | T1.contact_user_name, |
| | | T1.contact_user_phone, |
| | | T1.maintain_user_id, |
| | | T1.maintain_time, |
| | | T1.create_time, |
| | | T1.create_user, |
| | | T1.update_time, |
| | | T1.update_user, |
| | | T1.tenant_id, |
| | | T2.user_name AS maintainUserName |
| | | FROM supplier_manage T1 |
| | | LEFT JOIN sys_user T2 ON T1.maintain_user_id = T2.user_id |
| | | <where> |
| | | <if test="supplierManageDto.supplierName != null and supplierManageDto.supplierName != '' "> |
| | | AND T1.supplier_name LIKE CONCAT('%',#{supplierManageDto.supplierName},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.sales.mapper.InvoiceRegistrationMapper"> |
| | | <select id="invoiceRegistrationListPage" resultType="com.ruoyi.sales.dto.InvoiceRegistrationDto"> |
| | | SELECT |
| | | id , |
| | | sales_ledger_id , |
| | | sales_contract_no , |
| | | customer_id , |
| | | salesman , |
| | | project_name , |
| | | create_time , |
| | | create_user , |
| | | update_time , |
| | | update_user , |
| | | tenant_id |
| | | FROM invoice_registration |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.sales.mapper.InvoiceRegistrationProductMapper"> |
| | | |
| | | <select id="invoiceRegistrationProductList" resultType="com.ruoyi.sales.dto.InvoiceRegistrationProductDto"> |
| | | SELECT |
| | | id , |
| | | sales_ledger_id , |
| | | sales_ledger_product_id , |
| | | invoice_registration_id , |
| | | product_category , |
| | | specification_model , |
| | | unit , |
| | | quantity , |
| | | tax_rate , |
| | | tax_inclusive_unit_price , |
| | | tax_inclusive_total_price , |
| | | tax_exclusive_total_price , |
| | | invoice_type , |
| | | invoice_num , |
| | | invoice_amount , |
| | | no_invoice_num , |
| | | no_invoice_amount , |
| | | create_time , |
| | | create_user , |
| | | update_time , |
| | | update_user , |
| | | tenant_id |
| | | FROM invoice_registration_product |
| | | <where> |
| | | <if test="invoiceRegistrationProductDto.invoiceRegistrationId != null"> |
| | | invoice_registration_id = #{invoiceRegistrationProductDto.invoiceRegistrationId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |