| | |
| | | ## 补贴é
ç½® |
| | | drop table if exists subsidy_configuration; |
| | | create table subsidy_configuration |
| | | ( |
| | |
| | | add night_days decimal(16, 4) default 0 not null comment 'å¤ç天æ°', |
| | | add meal_amount decimal(16, 4) default 0 not null comment 'é¤è¡¥', |
| | | add night_amount decimal(16, 4) default 0 not null comment 'å¤ç补贴'; |
| | | |
| | | ## ç产åå |
| | | drop table if exists manufacturer; |
| | | create table manufacturer |
| | | ( |
| | | id bigint auto_increment |
| | | primary key, |
| | | name varchar(255) not null default '' comment 'åååç§°', |
| | | taxpayer_identification_num varchar(128) not null default '' comment '纳ç¨äººè¯å«å·', |
| | | company_address varchar(255) not null default '' comment 'ååå°å', |
| | | type varchar(25) not null default '' comment 'ååç±»å', |
| | | company_phone varchar(64) not null default '' comment 'ååçµè¯', |
| | | bank_account_name varchar(128) not null default '' comment 'é¶è¡è´¦æ·åç§°', |
| | | bank_account_num varchar(128) not null default '' comment 'é¶è¡è´¦æ·å·ç ', |
| | | contact_user_name varchar(255) not null default '' comment 'è系人å§å', |
| | | contact_user_phone varchar(128) not null default '' comment 'è系人çµè¯', |
| | | maintain_user_id bigint not null default 0 comment 'ç»´æ¤äººID', |
| | | maintain_time datetime null comment 'ç»´æ¤æ¶é´', |
| | | create_time datetime null comment 'å建æ¶é´', |
| | | create_user bigint not null default 0 comment 'å建人ID', |
| | | update_time datetime null comment 'æ´æ°æ¶é´', |
| | | update_user bigint not null default 0 comment 'æ´æ°äººID', |
| | | tenant_id bigint not null default 0 comment 'ç§æ·ID', |
| | | is_white bigint not null default 0 comment 'æ¯å¦ç½åå' |
| | | ); |
| | | |
| | | alter table stock_inventory |
| | | add manufacturer_id bigint not null default 0 comment 'ååid'; |
| | |
| | | STOCK_UNINVENTORY("stock_uninventory"), |
| | | STOCK_INVENTORY("stock_inventory"), |
| | | STOCK_IN_RECORD("stock_in_record"), |
| | | MANUFACTURER("manufacturer"), |
| | | // Staff |
| | | STAFF_WORK_EXPERIENCE("staff_work_experience"), |
| | | STAFF_SALARY_MAIN("staff_salary_main"), |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.stock.dto.ManufacturerDto; |
| | | import com.ruoyi.stock.pojo.Manufacturer; |
| | | import com.ruoyi.stock.service.ManufacturerService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå®¶å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-28 09:52:35 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/stock/manufacturer") |
| | | @AllArgsConstructor |
| | | @Tag(name = "å家管ç") |
| | | public class ManufacturerController { |
| | | |
| | | private ManufacturerService manufacturerService; |
| | | |
| | | /** |
| | | * åå®¶æ°å¢ |
| | | * @param manufacturer |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @Log(title = "åå®¶-æ°å¢", businessType = BusinessType.INSERT) |
| | | @Operation(summary = "æ°å¢åå®¶") |
| | | public AjaxResult add(@RequestBody Manufacturer manufacturer) { |
| | | manufacturerService.saveManufacturer(manufacturer); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * åå®¶å é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @Log(title = "åå®¶-å é¤", businessType = BusinessType.DELETE) |
| | | @Operation(summary = "å é¤åå®¶") |
| | | public AjaxResult delManufacturer(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | manufacturerService.delManufacturer(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å家详æ
|
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @Log(title = "åå®¶-详æ
", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "å家详æ
") |
| | | public AjaxResult manufacturerDetail(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(manufacturerService.manufacturerDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * åå®¶ä¿®æ¹ |
| | | * @param manufacturer |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | @Log(title = "åå®¶-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @Operation(summary = "ä¿®æ¹åå®¶") |
| | | public AjaxResult update(@RequestBody Manufacturer manufacturer) { |
| | | manufacturerService.manufacturerUpdate(manufacturer); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å家管çå页æ¥è¯¢ |
| | | * @param page |
| | | * @param manufacturerDto |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @Log(title = "åå®¶-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "åå®¶å页æ¥è¯¢") |
| | | public AjaxResult manufacturerListPage(Page page, ManufacturerDto manufacturerDto) { |
| | | return AjaxResult.success(manufacturerService.manufacturerListPage(page, manufacturerDto)); |
| | | } |
| | | |
| | | /** |
| | | * åå®¶å¯¼åº |
| | | * @param response |
| | | * @param manufacturerDto |
| | | */ |
| | | @PostMapping("/export") |
| | | @Log(title = "åå®¶-导åº", businessType = BusinessType.EXPORT) |
| | | @Operation(summary = "å家导åº") |
| | | public void manufacturerExport(HttpServletResponse response, ManufacturerDto manufacturerDto) { |
| | | manufacturerService.manufacturerExport(response, manufacturerDto); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½æ¨¡æ¿ |
| | | * @param response |
| | | */ |
| | | @PostMapping("/downloadTemplate") |
| | | @Log(title = "åå®¶-ä¸è½½æ¨¡æ¿", businessType = BusinessType.EXPORT) |
| | | @Operation(summary = "ä¸è½½å家模æ¿") |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<Manufacturer> util = new ExcelUtil<>(Manufacturer.class); |
| | | util.importTemplateExcel(response, "åå®¶æ¡£æ¡æ¨¡æ¿"); |
| | | } |
| | | |
| | | /** |
| | | * å家导å
¥ |
| | | */ |
| | | @PostMapping("/import") |
| | | @Log(title = "åå®¶-导å
¥", businessType = BusinessType.IMPORT) |
| | | @Operation(summary = "导å
¥åå®¶") |
| | | public AjaxResult importData(MultipartFile file) { |
| | | Boolean b = manufacturerService.importData(file); |
| | | if (b) { |
| | | return AjaxResult.success("导å
¥æå"); |
| | | } |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * åå®¶é项æ¥å£ |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOptions") |
| | | @Log(title = "åå®¶-é项æ¥å£", businessType = BusinessType.OTHER) |
| | | @Operation(summary = "è·ååå®¶é项") |
| | | public AjaxResult getOptions() { |
| | | return AjaxResult.success(manufacturerService.list()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.dto; |
| | | |
| | | import com.ruoyi.stock.pojo.Manufacturer; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ManufacturerDto extends Manufacturer { |
| | | |
| | | @Schema(description = "ç»´æ¤äººååç§°") |
| | | private String maintainUserName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.execl; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ManufacturerExcelDto { |
| | | |
| | | @Excel(name = "åå®¶åç§°") |
| | | private String name; |
| | | |
| | | @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 = "ç»´æ¤äºº") |
| | | private String maintainUserName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.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.basic.dto.SupplierManageDto; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.stock.dto.ManufacturerDto; |
| | | import com.ruoyi.stock.execl.ManufacturerExcelDto; |
| | | import com.ruoyi.stock.pojo.Manufacturer; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-28 09:52:35 |
| | | */ |
| | | @Mapper |
| | | public interface ManufacturerMapper extends BaseMapper<Manufacturer> { |
| | | IPage<Manufacturer> manufacturerListPage(Page page, @Param("manufacturerDto") ManufacturerDto manufacturerDto); |
| | | |
| | | List<ManufacturerExcelDto> manufacturerExportList(@Param("manufacturerDto") ManufacturerDto manufacturerDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.ToString; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-28 09:52:35 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @ToString |
| | | @TableName("manufacturer") |
| | | @ApiModel(value = "Manufacturer对象", description = "") |
| | | public class Manufacturer implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * åååç§° |
| | | */ |
| | | @ApiModelProperty("åååç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * 纳ç¨äººè¯å«å· |
| | | */ |
| | | @ApiModelProperty("纳ç¨äººè¯å«å·") |
| | | private String taxpayerIdentificationNum; |
| | | |
| | | /** |
| | | * ååå°å |
| | | */ |
| | | @ApiModelProperty("ååå°å") |
| | | private String companyAddress; |
| | | |
| | | /** |
| | | * ååç±»å |
| | | */ |
| | | @ApiModelProperty("ååç±»å") |
| | | private String type; |
| | | |
| | | /** |
| | | * ååçµè¯ |
| | | */ |
| | | @ApiModelProperty("ååçµè¯") |
| | | private String companyPhone; |
| | | |
| | | /** |
| | | * é¶è¡è´¦æ·åç§° |
| | | */ |
| | | @ApiModelProperty("é¶è¡è´¦æ·åç§°") |
| | | private String bankAccountName; |
| | | |
| | | /** |
| | | * é¶è¡è´¦æ·å·ç |
| | | */ |
| | | @ApiModelProperty("é¶è¡è´¦æ·å·ç ") |
| | | private String bankAccountNum; |
| | | |
| | | /** |
| | | * è系人å§å |
| | | */ |
| | | @ApiModelProperty("è系人å§å") |
| | | private String contactUserName; |
| | | |
| | | /** |
| | | * è系人çµè¯ |
| | | */ |
| | | @ApiModelProperty("è系人çµè¯") |
| | | private String contactUserPhone; |
| | | |
| | | /** |
| | | * ç»´æ¤äººID |
| | | */ |
| | | @ApiModelProperty("ç»´æ¤äººID") |
| | | private Long maintainUserId; |
| | | |
| | | /** |
| | | * ç»´æ¤æ¶é´ |
| | | */ |
| | | @ApiModelProperty("ç»´æ¤æ¶é´") |
| | | private LocalDateTime maintainTime; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * å建人ID |
| | | */ |
| | | @ApiModelProperty("å建人ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * æ´æ°äººID |
| | | */ |
| | | @ApiModelProperty("æ´æ°äººID") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @ApiModelProperty("ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * æ¯å¦ç½åå |
| | | */ |
| | | @ApiModelProperty("æ¯å¦ç½åå") |
| | | private Long isWhite; |
| | | } |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long deptId; |
| | | |
| | | @Schema(description = "ååid") |
| | | private Long manufacturerId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.stock.dto.ManufacturerDto; |
| | | import com.ruoyi.stock.pojo.Manufacturer; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * ååæå¡æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-28 09:52:35 |
| | | */ |
| | | public interface ManufacturerService extends IService<Manufacturer> { |
| | | |
| | | /** |
| | | * ååæ°å¢ |
| | | * @param manufacturer |
| | | */ |
| | | void saveManufacturer(Manufacturer manufacturer); |
| | | |
| | | /** |
| | | * ååå é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | int delManufacturer(List<Long> ids); |
| | | |
| | | /** |
| | | * åå详æ
|
| | | * @param id |
| | | * @return |
| | | */ |
| | | Manufacturer manufacturerDetail(Long id); |
| | | |
| | | /** |
| | | * ååä¿®æ¹ |
| | | * @param manufacturer |
| | | * @return |
| | | */ |
| | | int manufacturerUpdate(Manufacturer manufacturer); |
| | | |
| | | /** |
| | | * ååå页æ¥è¯¢ |
| | | * @param page |
| | | * @param manufacturerDto |
| | | * @return |
| | | */ |
| | | IPage<Manufacturer> manufacturerListPage(Page page, ManufacturerDto manufacturerDto); |
| | | |
| | | /** |
| | | * ååå¯¼åº |
| | | * @param response |
| | | * @param manufacturerDto |
| | | */ |
| | | void manufacturerExport(HttpServletResponse response, ManufacturerDto manufacturerDto); |
| | | |
| | | /** |
| | | * åå导å
¥ |
| | | * @param file |
| | | * @return |
| | | */ |
| | | Boolean importData(MultipartFile file); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.stock.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.excel.SupplierManageExcelDto; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.stock.dto.ManufacturerDto; |
| | | import com.ruoyi.stock.execl.ManufacturerExcelDto; |
| | | import com.ruoyi.stock.mapper.ManufacturerMapper; |
| | | import com.ruoyi.stock.mapper.StockInventoryMapper; |
| | | import com.ruoyi.stock.pojo.Manufacturer; |
| | | import com.ruoyi.stock.pojo.StockInventory; |
| | | import com.ruoyi.stock.service.ManufacturerService; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * ååæå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-05-28 09:52:35 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ManufacturerServiceImpl extends ServiceImpl<ManufacturerMapper, Manufacturer> implements ManufacturerService { |
| | | |
| | | private final StockInventoryMapper stockInventoryMapper; |
| | | private final ManufacturerMapper manufacturerMapper; |
| | | |
| | | /** |
| | | * ååæ°å¢ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public void saveManufacturer(Manufacturer manufacturer) { |
| | | LambdaQueryWrapper<Manufacturer> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Manufacturer::getName,manufacturer.getName()); |
| | | if (baseMapper.selectCount(queryWrapper) > 0) { |
| | | throw new RuntimeException("ä¾åºåå·²åå¨"); |
| | | } |
| | | |
| | | baseMapper.insert(manufacturer); |
| | | } |
| | | |
| | | /** |
| | | * ååå é¤ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int delManufacturer(List<Long> ids) { |
| | | // æ¹éæ£æ¥æ¯å¦å
³èåºå |
| | | LambdaQueryWrapper<StockInventory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(StockInventory::getManufacturerId, ids); |
| | | List<StockInventory> inventoryList = stockInventoryMapper.selectList(queryWrapper); |
| | | |
| | | if (!inventoryList.isEmpty()) { |
| | | throw new RuntimeException("ååå·²å
³èåºåï¼æ æ³å é¤"); |
| | | } |
| | | |
| | | return baseMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * åå详æ
|
| | | */ |
| | | @Override |
| | | public Manufacturer manufacturerDetail(Long id) { |
| | | return baseMapper.selectById(id); |
| | | } |
| | | |
| | | /** |
| | | * ååä¿®æ¹ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public int manufacturerUpdate(Manufacturer manufacturer) { |
| | | return baseMapper.updateById(manufacturer); |
| | | } |
| | | |
| | | /** |
| | | * ååå页æ¥è¯¢ |
| | | */ |
| | | @Override |
| | | public IPage<Manufacturer> manufacturerListPage(Page page, ManufacturerDto manufacturerDto) { |
| | | return manufacturerMapper.manufacturerListPage(page,manufacturerDto); |
| | | } |
| | | |
| | | /** |
| | | * ååå¯¼åº |
| | | */ |
| | | @Override |
| | | public void manufacturerExport(HttpServletResponse response, ManufacturerDto manufacturerDto) { |
| | | List<ManufacturerExcelDto> list = manufacturerMapper.manufacturerExportList(manufacturerDto); |
| | | ExcelUtil<ManufacturerExcelDto> util = new ExcelUtil<>(ManufacturerExcelDto.class); |
| | | util.exportExcel(response, list, "ååæ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * åå导å
¥ |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public Boolean importData(MultipartFile file) { |
| | | try { |
| | | ExcelUtil<Manufacturer> util = new ExcelUtil<>(Manufacturer.class); |
| | | List<Manufacturer> list = util.importExcel(file.getInputStream()); |
| | | if (list != null && !list.isEmpty()) { |
| | | this.saveBatch(list); |
| | | } |
| | | return true; |
| | | } catch (Exception e) { |
| | | log.error("导å
¥å¤±è´¥", e); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.stock.mapper.ManufacturerMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.stock.pojo.Manufacturer"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="taxpayer_identification_num" property="taxpayerIdentificationNum" /> |
| | | <result column="company_address" property="companyAddress" /> |
| | | <result column="type" property="type" /> |
| | | <result column="company_phone" property="companyPhone" /> |
| | | <result column="bank_account_name" property="bankAccountName" /> |
| | | <result column="bank_account_num" property="bankAccountNum" /> |
| | | <result column="contact_user_name" property="contactUserName" /> |
| | | <result column="contact_user_phone" property="contactUserPhone" /> |
| | | <result column="maintain_user_id" property="maintainUserId" /> |
| | | <result column="maintain_time" property="maintainTime" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | <result column="tenant_id" property="tenantId" /> |
| | | <result column="is_white" property="isWhite" /> |
| | | </resultMap> |
| | | |
| | | <select id="manufacturerListPage" resultType="com.ruoyi.stock.dto.ManufacturerDto"> |
| | | SELECT |
| | | T1.id, |
| | | T1.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, |
| | | T1.is_white, |
| | | T2.nick_name AS maintainUserName, |
| | | T1.type |
| | | FROM manufacturer T1 |
| | | LEFT JOIN sys_user T2 ON T1.maintain_user_id = T2.user_id |
| | | <where> |
| | | <if test="manufacturerDto.name != null and manufacturerDto.name != '' "> |
| | | AND T1.name LIKE CONCAT('%',#{manufacturerDto.name},'%') |
| | | </if> |
| | | <if test="manufacturerDto.isWhite != null"> |
| | | AND T1.is_white = #{manufacturerDto.isWhite} |
| | | </if> |
| | | </where> |
| | | order by T1.create_time desc |
| | | </select> |
| | | |
| | | <select id="manufacturerExportList" resultType="com.ruoyi.stock.execl.ManufacturerExcelDto"> |
| | | SELECT |
| | | T1.id, |
| | | T1.name, |
| | | T1.type, |
| | | 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, |
| | | T1.is_white, |
| | | T2.nick_name AS maintainUserName |
| | | FROM manufacturer T1 |
| | | LEFT JOIN sys_user T2 ON T1.maintain_user_id = T2.user_id |
| | | <where> |
| | | <if test="manufacturerDto.name != null and manufacturerDto.name != '' "> |
| | | AND T1.name LIKE CONCAT('%',#{manufacturerDto.name},'%') |
| | | </if> |
| | | <if test="manufacturerDto.isWhite != null"> |
| | | AND T1.is_white = #{manufacturerDto.isWhite} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |