Merge branch 'prod' into dev_tide
# Conflicts:
# src/main/resources/application.yml
| | |
| | | <version>1.12.2</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>com.alibaba</groupId>
|
| | | <artifactId>easyexcel</artifactId>
|
| | | <version>4.0.3</version>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
| | | <build>
|
| | |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/account/accountExpense") |
| | | @Api(tags = "è´¢å¡ç®¡ç--æ¯åºç®¡ç") |
| | | public class AccountExpenseController { |
| | | |
| | | @Resource |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody AccountExpense accountExpense) { |
| | | accountExpense.setInputTime(new Date()); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delQualityInspect(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody AccountExpense accountExpense) { |
| | | return AjaxResult.success(accountExpenseService.updateById(accountExpense)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult accountExpenseListPage(Page page, AccountExpense accountExpense) { |
| | | return AjaxResult.success(accountExpenseService.accountExpenseListPage(page, accountExpense)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("详æ
") |
| | | public AjaxResult accountExpenseDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(accountExpenseService.getById(id)); |
| | | } |
| | |
| | | * @param accountExpense |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åº") |
| | | public void accountExpenseExport(HttpServletResponse response,AccountExpense accountExpense) { |
| | | accountExpenseService.accountExpenseExport(response, accountExpense); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/report/forms") |
| | | @ApiOperation("è´¢å¡æ¥è¡¨å¾è¡¨æ¥è¯¢") |
| | | public AjaxResult report(DateQueryDto dateQueryDto) { |
| | | return AjaxResult.success(accountExpenseService.report(dateQueryDto)); |
| | | } |
| | | |
| | | /** |
| | | * è´¢å¡æ¥è¡¨-è´¢å¡åæ |
| | | * @return |
| | | */ |
| | | @GetMapping("/report/analysis") |
| | | @ApiOperation("è´¢å¡æ¥è¡¨-è´¢å¡åæ") |
| | | public AjaxResult analysis() { |
| | | return AjaxResult.success(accountExpenseService.analysis()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/report/income") |
| | | @ApiOperation("è´¢å¡æ¥è¡¨å¾è¡¨æ¶å
¥å¹´åº¦æ¥è¯¢") |
| | | public AjaxResult reportIncome() { |
| | | return AjaxResult.success(accountIncomeService.reportIncome()); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/report/expense") |
| | | @ApiOperation("è´¢å¡æ¥è¡¨å¾è¡¨æ¯åºå¹´åº¦æ¥è¯¢") |
| | | public AjaxResult reportExpense() { |
| | | return AjaxResult.success(accountExpenseService.reportExpense()); |
| | | } |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.quality.pojo.QualityInspectFile; |
| | | import com.ruoyi.quality.service.IQualityInspectFileService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/account/accountFile") |
| | | @Api(tags = "è´¢å¡éä»¶") |
| | | public class AccountFileController { |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody AccountFile accountFile) { |
| | | return AjaxResult.success(accountFileService.save(accountFile)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delAccountFile(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult accountFileListPage(Page page, AccountFile accountFile) { |
| | | return AjaxResult.success(accountFileService.accountFileListPage(page, accountFile)); |
| | | } |
| | |
| | | import com.ruoyi.quality.service.IQualityInspectFileService; |
| | | import com.ruoyi.quality.service.IQualityInspectParamService; |
| | | import com.ruoyi.quality.service.IQualityInspectService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/account/accountIncome") |
| | | @Api(tags = "è´¢å¡ç®¡ç--æ¶å
¥ç®¡ç") |
| | | public class AccountIncomeController { |
| | | |
| | | @Resource |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody AccountIncome accountIncome) { |
| | | accountIncome.setInputTime(new Date()); |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delQualityInspect(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody AccountIncome accountIncome) { |
| | | return AjaxResult.success(accountIncomeService.updateById(accountIncome)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult accountIncomeListPage(Page page, AccountIncome accountIncome) { |
| | | return AjaxResult.success(accountIncomeService.accountIncomeListPage(page, accountIncome)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("详æ
") |
| | | public AjaxResult accountIncomeDetail(@PathVariable("id") Integer id) { |
| | | return AjaxResult.success(accountIncomeService.getById(id)); |
| | | } |
| | |
| | | * @param accountIncome |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åº") |
| | | public void accountIncomeExport(HttpServletResponse response,AccountIncome accountIncome) { |
| | | accountIncomeService.accountIncomeExport(response, accountIncome); |
| | | } |
| | |
| | | import com.ruoyi.account.dto.AccountDto2; |
| | | import com.ruoyi.account.dto.AccountDto3; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.account.pojo.AccountIncome; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface AccountExpenseService extends IService<AccountExpense> { |
| | | |
| | |
| | | AccountDto report(DateQueryDto dateQueryDto); |
| | | |
| | | List<AccountDto3> reportExpense(); |
| | | |
| | | Map<String,List<String>> analysis(); |
| | | |
| | | AccountExpense getByInvoiceNumber(String purchaseContractNumber); |
| | | |
| | | List<AccountExpense> getByInvoiceNumberList(String purchaseContractNumber); |
| | | } |
| | |
| | | void accountIncomeExport(HttpServletResponse response, AccountIncome accountIncome); |
| | | |
| | | List<AccountDto3> reportIncome(); |
| | | |
| | | AccountIncome getByInvoiceNumber(String purchaseContractNumber); |
| | | |
| | | List<AccountIncome> getByInvoiceNumberList(String purchaseContractNumber); |
| | | } |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.DayOfWeek; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @AllArgsConstructor |
| | | @Service |
| | |
| | | return accountDto3s; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, List<String>> analysis() { |
| | | // è·åæ¬å¨çæ¶é´èå´ |
| | | LocalDate startOfWeek = LocalDate.now().with(DayOfWeek.MONDAY); |
| | | LocalDate endOfWeek = LocalDate.now().with(DayOfWeek.SUNDAY); |
| | | Map<String, List<String>> result = new HashMap<>(); |
| | | List<String> days = new ArrayList<>(); |
| | | List<String> totalIncomeList = new ArrayList<>(); |
| | | List<String> totalExpenseList = new ArrayList<>(); |
| | | List<String> netIncomeList = new ArrayList<>(); |
| | | // æ ¹æ®æ¶é´èå´å¾ªç¯æ¥è¯¢æ¯ä¸å¤©çæ»æ¶å
¥ï¼æ»æ¯åº,åæ¶å
¥ï¼æ»æ¶å
¥-æ»æ¯åºï¼ |
| | | for (LocalDate date = startOfWeek; date.isBefore(endOfWeek) || date.isEqual(endOfWeek); date = date.plusDays(1)) { |
| | | BigDecimal totalIncome = accountIncomeMapper.selectList(Wrappers.<AccountIncome>lambdaQuery() |
| | | .eq(AccountIncome::getInputTime, date.toString())) |
| | | .stream() |
| | | .map(AccountIncome::getIncomeMoney) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal totalExpense = accountExpenseMapper.selectList(Wrappers.<AccountExpense>lambdaQuery() |
| | | .eq(AccountExpense::getInputTime, date.toString())) |
| | | .stream() |
| | | .map(AccountExpense::getExpenseMoney) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | BigDecimal netIncome = totalIncome.subtract(totalExpense); |
| | | days.add(date.toString()); |
| | | totalIncomeList.add(totalIncome.toString()); |
| | | totalExpenseList.add(totalExpense.toString()); |
| | | netIncomeList.add(netIncome.toString()); |
| | | } |
| | | result.put("days", days); // 天 |
| | | result.put("totalIncome", totalIncomeList); // æ¶å
¥ |
| | | result.put("totalExpense", totalExpenseList); // æ¯åº |
| | | result.put("netIncome", netIncomeList); // åæ¶å
¥ |
| | | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public AccountExpense getByInvoiceNumber(String purchaseContractNumber) { |
| | | return accountExpenseMapper.selectOne(Wrappers.<AccountExpense>lambdaQuery() |
| | | .eq(AccountExpense::getInvoiceNumber, purchaseContractNumber)); |
| | | } |
| | | |
| | | @Override |
| | | public List<AccountExpense> getByInvoiceNumberList(String purchaseContractNumber) { |
| | | return accountExpenseMapper.selectList(Wrappers.<AccountExpense>lambdaQuery() |
| | | .eq(AccountExpense::getInvoiceNumber, purchaseContractNumber)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.account.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; |
| | |
| | | } |
| | | return accountDto3s; |
| | | } |
| | | |
| | | @Override |
| | | public AccountIncome getByInvoiceNumber(String purchaseContractNumber) { |
| | | AccountIncome accountIncome = accountIncomeMapper.selectOne(new LambdaQueryWrapper<AccountIncome>() |
| | | .eq(AccountIncome::getInvoiceNumber, purchaseContractNumber)); |
| | | return accountIncome; |
| | | } |
| | | |
| | | @Override |
| | | public List<AccountIncome> getByInvoiceNumberList(String purchaseContractNumber) { |
| | | return accountIncomeMapper.selectList(new LambdaQueryWrapper<AccountIncome>() |
| | | .eq(AccountIncome::getInvoiceNumber, purchaseContractNumber)); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.aftersalesservice.dto.AfterSalesServiceDto; |
| | | import com.ruoyi.aftersalesservice.pojo.AfterSalesService; |
| | | import com.ruoyi.aftersalesservice.service.AfterSalesServiceService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.EquipmentEnergyConsumption; |
| | | 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.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.purchase.dto.VatDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @Log(title = "å®åæå¡-åé¦ç»è®°", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("å®åæå¡-åé¦ç»è®°") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | AfterSalesService afterSalesService = new AfterSalesService(); |
| | | IPage<AfterSalesService> listPage = afterSalesServiceService.listPage(page, afterSalesService); |
| | | List<AfterSalesServiceDto> list = new ArrayList<>(); |
| | | listPage.getRecords().forEach(item -> { |
| | | AfterSalesServiceDto dto = new AfterSalesServiceDto(); |
| | | BeanUtils.copyProperties(item, dto); |
| | | dto.setStatusName(item.getStatus().toString()); |
| | | list.add(dto); |
| | | }); |
| | | ExcelUtil<AfterSalesServiceDto> util = new ExcelUtil<AfterSalesServiceDto>(AfterSalesServiceDto.class); |
| | | util.exportExcel(response, list , "åé¦ç»è®°"); |
| | | } |
| | | |
| | | @Log(title = "å®åæå¡-å®åå¤ç", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportTwo") |
| | | @ApiOperation("å®åæå¡-å®åå¤ç") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | AfterSalesService afterSalesService = new AfterSalesService(); |
| | | IPage<AfterSalesService> listPage = afterSalesServiceService.listPage(page, afterSalesService); |
| | | listPage.getRecords().forEach(item -> { |
| | | item.setStatusName(item.getStatus().toString()); |
| | | }); |
| | | ExcelUtil<AfterSalesService> util = new ExcelUtil<AfterSalesService>(AfterSalesService.class); |
| | | util.exportExcel(response, listPage.getRecords() , "å®åå¤ç"); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("å®åæå¡-æ°å¢") |
| | | @Log(title = "å®åæå¡-æ°å¢", businessType = BusinessType.INSERT) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.aftersalesservice.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/11/3 11:14 |
| | | */ |
| | | @Data |
| | | public class AfterSalesServiceDto { |
| | | |
| | | /** |
| | | * ç¶æ 1-å¾
å¤ç 2-å·²å¤ç |
| | | */ |
| | | @ApiModelProperty("ç¶æ 1-å¾
å¤ç 2-å·²å¤ç") |
| | | private Integer status; |
| | | |
| | | |
| | | @Excel(name = "ç¶æ", readConverterExp = "1=å¾
å¤ç,2=å·²å¤ç") |
| | | private String statusName; |
| | | |
| | | /** |
| | | * ç»è®°äººåç§° |
| | | */ |
| | | @ApiModelProperty("ç»è®°äººåç§°") |
| | | @Excel(name = "ç»è®°äººåç§°") |
| | | private String checkNickName; |
| | | |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | @ApiModelProperty("客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | /** |
| | | * é®é¢æè¿° |
| | | */ |
| | | @ApiModelProperty("é®é¢æè¿°") |
| | | @Excel(name = "é®é¢æè¿°") |
| | | private String proDesc; |
| | | |
| | | |
| | | /** |
| | | * å馿¥æ |
| | | */ |
| | | @ApiModelProperty("å馿¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å馿¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date feedbackDate; |
| | | |
| | | |
| | | @ApiModelProperty("å
³èé¨é¨") |
| | | @Excel(name = "å
³èé¨é¨") |
| | | private String deptName; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty("ç¶æ 1-å¾
å¤ç 2-å·²å¤ç") |
| | | private Integer status; |
| | | |
| | | |
| | | @Excel(name = "ç¶æ", readConverterExp = "1=å¾
å¤ç,2=å·²å¤ç") |
| | | private String statusName; |
| | | |
| | | /** |
| | | * ç»è®°äºº |
| | | */ |
| | |
| | | * ç»è®°äººåç§° |
| | | */ |
| | | @ApiModelProperty("ç»è®°äººåç§°") |
| | | @Excel(name = "ç»è®°äººåç§°") |
| | | private String checkNickName; |
| | | |
| | | /** |
| | |
| | | * å¤ç人åç§° |
| | | */ |
| | | @ApiModelProperty("å¤ç人åç§°") |
| | | @Excel(name = "å¤ç人åç§°") |
| | | private String disposeNickName; |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | @ApiModelProperty("客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | /** |
| | | * é®é¢æè¿° |
| | | */ |
| | | @ApiModelProperty("é®é¢æè¿°") |
| | | @Excel(name = "é®é¢æè¿°") |
| | | private String proDesc; |
| | | |
| | | /** |
| | | * å¤çç»æ |
| | | */ |
| | | @ApiModelProperty("å¤çç»æ") |
| | | @Excel(name = "å¤çç»æ") |
| | | private String disRes; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty("å馿¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å馿¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date feedbackDate; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty("å¤çæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å¤çæ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date disDate; |
| | | |
| | | |
| | |
| | | package com.ruoyi.approve.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.service.IApproveProcessService; |
| | | import com.ruoyi.approve.vo.ApproveGetAndUpdateVo; |
| | | import com.ruoyi.approve.vo.ApproveProcessVO; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/approveProcess") |
| | | @Api(tags = "审æ¹") |
| | | public class ApproveProcessController { |
| | | |
| | | @GetMapping("/test") |
| | |
| | | */ |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody ApproveProcessVO approveProcessVO) throws ParseException { |
| | | @ApiOperation(value = "æ·»å 审æ¹") |
| | | public AjaxResult add(@RequestBody ApproveProcessVO approveProcessVO) throws Exception { |
| | | if (approveProcessVO == null) { |
| | | return AjaxResult.warn("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/get") |
| | | @ApiOperation(value = "审æ¹è¯¦æ
") |
| | | public AjaxResult get(ApproveGetAndUpdateVo approveGetAndUpdateVo){ |
| | | if (approveGetAndUpdateVo.getId() == null || approveGetAndUpdateVo.getId().isEmpty()) { |
| | | return AjaxResult.warn("åæ°ä¸è½ä¸ºç©º"); |
| | |
| | | */ |
| | | @PostMapping("/update") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody ApproveGetAndUpdateVo approveGetAndUpdateVo) { |
| | | @ApiOperation(value = "æ´æ°å®¡æ¹") |
| | | public AjaxResult update(@RequestBody ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException { |
| | | if (approveGetAndUpdateVo == null) { |
| | | return AjaxResult.warn("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "è·å审æ¹å表") |
| | | public AjaxResult list(Page page, ApproveProcess approveProcess) { |
| | | return AjaxResult.success(approveProcessService.listAll(page, approveProcess)); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteIds") |
| | | @ApiOperation(value = "å é¤å®¡æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult deleteIds(@RequestBody Long[] ids) { |
| | | if (ids == null || ids.length == 0) { |
| | |
| | | approveProcessService.delApprove(ids); |
| | | return AjaxResult.success("æä½æå"); |
| | | } |
| | | |
| | | @ApiOperation(value = "å
¬åºç®¡ç导åº") |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveType, 1)); |
| | | ExcelUtil<ApproveProcess> util = new ExcelUtil<ApproveProcess>(ApproveProcess.class); |
| | | util.exportExcel(response, accountExpenses, "å
¬åºç®¡ç导åº"); |
| | | } |
| | | |
| | | @ApiOperation(value = "请å管ç导åº") |
| | | @PostMapping("/exportTwo") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveType, 2)); |
| | | ExcelUtil<ApproveProcess> util = new ExcelUtil<ApproveProcess>(ApproveProcess.class); |
| | | util.exportExcel(response, accountExpenses, "请å管ç导åº"); |
| | | } |
| | | |
| | | @ApiOperation(value = "åºå·®ç®¡ç导åº") |
| | | @PostMapping("/exportThree") |
| | | public void exportThree(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveType, 3)); |
| | | ExcelUtil<ApproveProcess> util = new ExcelUtil<ApproveProcess>(ApproveProcess.class); |
| | | util.exportExcel(response, accountExpenses, "åºå·®ç®¡ç导åº"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥é管ç导åº") |
| | | @PostMapping("/exportFour") |
| | | public void exportFour(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveType, 4)); |
| | | ExcelUtil<ApproveProcess> util = new ExcelUtil<ApproveProcess>(ApproveProcess.class); |
| | | util.exportExcel(response, accountExpenses, "æ¥é管ç导åº"); |
| | | } |
| | | |
| | | @ApiOperation(value = "éè´ç³è¯·å¯¼åº") |
| | | @PostMapping("/exportFive") |
| | | public void exportFive(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveType, 5)); |
| | | ExcelUtil<ApproveProcess> util = new ExcelUtil<ApproveProcess>(ApproveProcess.class); |
| | | util.exportExcel(response, accountExpenses, "éè´ç³è¯·å¯¼åº"); |
| | | } |
| | | |
| | | @ApiOperation(value = "åå审æ¹å¯¼åº") |
| | | @PostMapping("/exportZero") |
| | | public void exportZero(HttpServletResponse response) { |
| | | List<ApproveProcess> accountExpenses = approveProcessService.list(new LambdaQueryWrapper<ApproveProcess>() |
| | | .eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveType, 0)); |
| | | ExcelUtil<ApproveProcess> util = new ExcelUtil<ApproveProcess>(ApproveProcess.class); |
| | | util.exportExcel(response, accountExpenses, "åå审æ¹å¯¼åº"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.mapper.AnnualLeaveSettingMapper; |
| | | import com.ruoyi.approve.mapper.OvertimeSettingMapper; |
| | | import com.ruoyi.approve.mapper.WorkingHoursSettingMapper; |
| | | import com.ruoyi.approve.pojo.*; |
| | | import com.ruoyi.approve.service.HolidaySettingsService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/holidaySettings") |
| | | @AllArgsConstructor |
| | | public class HolidaySettingsController { |
| | | @Autowired |
| | | private HolidaySettingsService holidaySettingsService; |
| | | @Autowired |
| | | private AnnualLeaveSettingMapper annualLeaveSettingMapper; |
| | | @Autowired |
| | | private OvertimeSettingMapper overtimeSettingMapper; |
| | | @Autowired |
| | | private WorkingHoursSettingMapper workingHoursSettingMapper; |
| | | |
| | | /**ã |
| | | * è·ååæè®¾ç½®å表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, HolidaySettings holidaySettings) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(holidaySettingsService.listpage(page,holidaySettings)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody HolidaySettings holidaySettings){ |
| | | return AjaxResult.success(holidaySettingsService.save(holidaySettings)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody HolidaySettings holidaySettings){ |
| | | return AjaxResult.success(holidaySettingsService.updateById(holidaySettings)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(holidaySettingsService.removeByIds(ids)); |
| | | } |
| | | /**ã |
| | | * è·åå¹´åè§åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getAnnualLeaveSettingList") |
| | | public AjaxResult getAnnualLeaveSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, AnnualLeaveSetting annualLeaveSetting) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(annualLeaveSettingMapper.listPage(page,annualLeaveSetting)); |
| | | } |
| | | /**ã |
| | | * 墿·»å¹´åè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/addAnnualLeaveSetting") |
| | | public AjaxResult addAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return AjaxResult.success(annualLeaveSettingMapper.insert(annualLeaveSetting)); |
| | | } |
| | | /**ã |
| | | * æ´æ°å¹´åè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateAnnualLeaveSetting") |
| | | public AjaxResult updateAnnualLeaveSetting(@RequestBody AnnualLeaveSetting annualLeaveSetting){ |
| | | return AjaxResult.success(annualLeaveSettingMapper.updateById(annualLeaveSetting)); |
| | | } |
| | | /**ã |
| | | * å é¤å¹´åè§å |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteAnnualLeaveSetting") |
| | | public AjaxResult deleteAnnualLeaveSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(annualLeaveSettingMapper.deleteBatchIds(ids)); |
| | | } |
| | | |
| | | /**ã |
| | | * è·åå çè§åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getOvertimeSettingList") |
| | | public AjaxResult getOvertimeSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, OvertimeSetting overtimeSetting) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(overtimeSettingMapper.listPage(page,overtimeSetting)); |
| | | } |
| | | /**ã |
| | | * 墿·»å çè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/addOvertimeSetting") |
| | | public AjaxResult addOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return AjaxResult.success(overtimeSettingMapper.insert(overtimeSetting)); |
| | | } |
| | | /**ã |
| | | * æ´æ°å çè§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateOvertimeSetting") |
| | | public AjaxResult updateOvertimeSetting(@RequestBody OvertimeSetting overtimeSetting){ |
| | | return AjaxResult.success(overtimeSettingMapper.updateById(overtimeSetting)); |
| | | } |
| | | /**ã |
| | | * å é¤å çè§å |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteOvertimeSetting") |
| | | public AjaxResult deleteOvertimeSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(overtimeSettingMapper.deleteBatchIds(ids)); |
| | | } |
| | | /**ã |
| | | * è·åä¸çæ¶é´è®¾ç½®-çå¶è§åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getWorkingHoursSettingList") |
| | | public AjaxResult getWorkingHoursSettingList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, WorkingHoursSetting workingHoursSetting) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(workingHoursSettingMapper.listPage(page,workingHoursSetting)); |
| | | } |
| | | /**ã |
| | | * 墿·»çå¶è§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/addWorkingHoursSetting") |
| | | public AjaxResult addWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return AjaxResult.success(workingHoursSettingMapper.insert(workingHoursSetting)); |
| | | } |
| | | /**ã |
| | | * æ´æ°çå¶è§å |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateWorkingHoursSetting") |
| | | public AjaxResult updateWorkingHoursSetting(@RequestBody WorkingHoursSetting workingHoursSetting){ |
| | | return AjaxResult.success(workingHoursSettingMapper.updateById(workingHoursSetting)); |
| | | } |
| | | /**ã |
| | | * å é¤çå¶è§å |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/deleteWorkingHoursSetting") |
| | | public AjaxResult deleteWorkingHoursSetting(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(workingHoursSettingMapper.deleteBatchIds(ids)); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.mapper.KnowledgeBaseMapper; |
| | | import com.ruoyi.approve.pojo.KnowledgeBase; |
| | | import com.ruoyi.approve.pojo.RpaProcessAutomation; |
| | | import com.ruoyi.approve.service.KnowledgeBaseService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/knowledgeBase") |
| | | @AllArgsConstructor |
| | | @Api(tags = "ç¥è¯åºç®¡ç") |
| | | public class KnowledgeBaseController { |
| | | @Autowired |
| | | private KnowledgeBaseService knowledgeBaseService; |
| | | |
| | | /**ã |
| | | * è·åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "10") long size, KnowledgeBase knowledgeBase) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(knowledgeBaseService.listpage(page,knowledgeBase)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody KnowledgeBase knowledgeBase){ |
| | | return AjaxResult.success(knowledgeBaseService.save(knowledgeBase)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody KnowledgeBase knowledgeBase){ |
| | | return AjaxResult.success(knowledgeBaseService.updateById(knowledgeBase)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(knowledgeBaseService.removeByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¥è¯åºç®¡ç导åº") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | List<KnowledgeBase> accountExpenses = knowledgeBaseService.list(); |
| | | ExcelUtil<KnowledgeBase> util = new ExcelUtil<KnowledgeBase>(KnowledgeBase.class); |
| | | util.exportExcel(response, accountExpenses, "ç¥è¯åºç®¡ç导åº"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.mapper.FileSharingMapper; |
| | | import com.ruoyi.approve.mapper.OnlineMeetingMapper; |
| | | import com.ruoyi.approve.pojo.FileSharing; |
| | | import com.ruoyi.approve.pojo.NotificationManagement; |
| | | import com.ruoyi.approve.pojo.OnlineMeeting; |
| | | import com.ruoyi.approve.service.NotificationManagementService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/notificationManagement") |
| | | @AllArgsConstructor |
| | | public class NotificationManagementController { |
| | | @Autowired |
| | | private NotificationManagementService notificationManagementService ; |
| | | @Autowired |
| | | private OnlineMeetingMapper onlineMeetingMapper; |
| | | @Autowired |
| | | private FileSharingMapper fileSharingMapper; |
| | | /**ã |
| | | * è·åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "50") long size, NotificationManagement notificationManagement) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(notificationManagementService.listpage(page,notificationManagement)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody NotificationManagement notificationManagement){ |
| | | return AjaxResult.success(notificationManagementService.save(notificationManagement)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody NotificationManagement notificationManagement){ |
| | | return AjaxResult.success(notificationManagementService.updateById(notificationManagement)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(notificationManagementService.removeByIds(ids)); |
| | | } |
| | | /** |
| | | *æ°å¢ä¼è®® |
| | | * @param onlineMeeting |
| | | * @return |
| | | */ |
| | | @PostMapping("/addOnlineMeeting") |
| | | public AjaxResult addOnlineMeeting(@RequestBody OnlineMeeting onlineMeeting){ |
| | | return AjaxResult.success(onlineMeetingMapper.insert(onlineMeeting)); |
| | | } |
| | | /** |
| | | *æ°å¢æä»¶å
񄧮 |
| | | * |
| | | */ |
| | | @PostMapping("/addFileSharing") |
| | | public AjaxResult addFileSharing(@RequestBody FileSharing fileSharing){ |
| | | return AjaxResult.success(fileSharingMapper.insert(fileSharing)); |
| | | } |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.pojo.RpaProcessAutomation; |
| | | import com.ruoyi.approve.service.RpaProcessAutomationService; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/rpaProcessAutomation") |
| | | @AllArgsConstructor |
| | | @Api(tags = "RPAæµç¨èªå¨å") |
| | | public class RpaProcessAutomationController { |
| | | @Autowired |
| | | private RpaProcessAutomationService rpaProcessAutomationService; |
| | | /**ã |
| | | * è·åå表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(@RequestParam(defaultValue = "1") long current, |
| | | @RequestParam(defaultValue = "100") long size, RpaProcessAutomation rpaProcessAutomation) { |
| | | Page page = new Page(current, size); |
| | | return AjaxResult.success(rpaProcessAutomationService.listpage(page,rpaProcessAutomation)); |
| | | } |
| | | /**ã |
| | | * 墿·» |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody RpaProcessAutomation rpaProcessAutomation){ |
| | | return AjaxResult.success(rpaProcessAutomationService.save(rpaProcessAutomation)); |
| | | } |
| | | /** |
| | | * æ´æ° |
| | | * @return |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody RpaProcessAutomation rpaProcessAutomation){ |
| | | return AjaxResult.success(rpaProcessAutomationService.updateById(rpaProcessAutomation)); |
| | | } |
| | | /** |
| | | * å é¤ |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(rpaProcessAutomationService.removeByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "RPAæµç¨èªå¨å导åº") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | List<RpaProcessAutomation> accountExpenses = rpaProcessAutomationService.list(); |
| | | ExcelUtil<RpaProcessAutomation> util = new ExcelUtil<RpaProcessAutomation>(RpaProcessAutomation.class); |
| | | util.exportExcel(response, accountExpenses, "RPAæµç¨èªå¨å导åº"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.AnnualLeaveSetting; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface AnnualLeaveSettingMapper extends BaseMapper<AnnualLeaveSetting> { |
| | | IPage<AnnualLeaveSetting> listPage(Page page,@Param("annualLeaveSetting") AnnualLeaveSetting annualLeaveSetting); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.approve.pojo.FileSharing; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface FileSharingMapper extends BaseMapper<FileSharing> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.HolidaySettings; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface HolidaySettingsMapper extends BaseMapper<HolidaySettings> { |
| | | IPage<HolidaySettings> listpage(Page page,@Param("holidaySettings") HolidaySettings holidaySettings); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.KnowledgeBase; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface KnowledgeBaseMapper extends BaseMapper<KnowledgeBase> { |
| | | IPage<KnowledgeBase> listpage(Page page, KnowledgeBase knowledgeBase); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.NotificationManagement; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface NotificationManagementMapper extends BaseMapper<NotificationManagement> { |
| | | IPage<NotificationManagement> listpage(Page<NotificationManagement> page,@Param("notificationManagement") NotificationManagement notificationManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.approve.pojo.OnlineMeeting; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface OnlineMeetingMapper extends BaseMapper<OnlineMeeting> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.OvertimeSetting; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | @Mapper |
| | | public interface OvertimeSettingMapper extends BaseMapper<OvertimeSetting> { |
| | | IPage<OvertimeSetting> listPage(Page<OvertimeSetting> page,@Param("overtimeSetting") OvertimeSetting overtimeSetting); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.approve.pojo.RpaProcessAutomation; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface RpaProcessAutomationMapper extends BaseMapper<RpaProcessAutomation> { |
| | | |
| | | |
| | | IPage<RpaProcessAutomation> listpage(Page page,@Param("rpaProcessAutomation")RpaProcessAutomation rpaProcessAutomation); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.WorkingHoursSetting; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface WorkingHoursSettingMapper extends BaseMapper<WorkingHoursSetting> { |
| | | IPage<WorkingHoursSetting> listPage(Page page,@Param("workingHoursSetting") WorkingHoursSetting workingHoursSetting); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("annual_leave_setting") |
| | | public class AnnualLeaveSetting implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * å工类å |
| | | */ |
| | | private String employeeType; |
| | | /** |
| | | * å·¥ä½å¹´é |
| | | */ |
| | | private String workYears; |
| | | /** |
| | | * å¹´åå¤©æ° |
| | | */ |
| | | private Integer annualDays; |
| | | /** |
| | | * æå¤§å¯ç»è½¬å¤©æ° |
| | | */ |
| | | private Integer maxCarryOver; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @TableField(exist = false) |
| | | private List<CommonFile> commonFileList; |
| | | |
| | | /** |
| | | * æµç¨ç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "æµç¨ç¼å·") |
| | | @Excel(name = "æµç¨ç¼å·") |
| | | private String approveId; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * ç³è¯·äººåç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç³è¯·äººåç§°") |
| | | @Excel(name = "ç³è¯·äºº") |
| | | private String approveUserName; |
| | | |
| | | /** |
| | |
| | | * ç³è¯·é¨é¨åç§° |
| | | */ |
| | | @ApiModelProperty(value = "ç³è¯·é¨é¨åç§°") |
| | | @Excel(name = "ç³è¯·é¨é¨") |
| | | private String approveDeptName; |
| | | |
| | | /** |
| | |
| | | * ç³è¯·åå |
| | | */ |
| | | @ApiModelProperty(value = "ç³è¯·åå ") |
| | | @Excel(name = "审æ¹äºç±") |
| | | private String approveReason; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * å½å审æ¹ç¨æ·åç§° |
| | | */ |
| | | @ApiModelProperty(value = "å½å审æ¹äºº") |
| | | @Excel(name = "å½å审æ¹äºº") |
| | | private String approveUserCurrentName; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç³è¯·æ¥æ") |
| | | @Excel(name = "ç³è¯·æ¥æ" ,dateFormat = "yyyy-MM-dd") |
| | | private Date approveTime; |
| | | |
| | | /** |
| | | * 审æ¹å®ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "审æ¹å®ææ¶é´") |
| | | @Excel(name = "ç»ææ¥æ" ,dateFormat = "yyyy-MM-dd") |
| | | private Date approveOverTime; |
| | | |
| | | /** |
| | | * 审æ¹ç¶æï¼0å¾
å®¡æ ¸ï¼1å®¡æ ¸ä¸ï¼2å®¡æ ¸å®æ 3å®¡æ ¸æªéè¿ 4已鿰æäº¤ |
| | | */ |
| | | @ApiModelProperty(value = "审æ¹ç¶æï¼0å¾
å®¡æ ¸ï¼1å®¡æ ¸ä¸ï¼2å®¡æ ¸å®æ 3å®¡æ ¸æªéè¿ 4已鿰æäº¤") |
| | | @Excel(name = "审æ¹ç¶æ", readConverterExp = "0=å¾
å®¡æ ¸,1=å®¡æ ¸ä¸,2=å®¡æ ¸å®æ,3=å®¡æ ¸æªéè¿,4=已鿰æäº¤") |
| | | private Integer approveStatus; |
| | | |
| | | /** |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.approve.utils.ListToStringTypeHandler; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | @Data |
| | | @TableName("file_sharing") |
| | | public class FileSharing implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * å
±äº«æ é¢ |
| | | */ |
| | | private String title; |
| | | /** |
| | | * ä¸ä¼ æä»¶ |
| | | */ |
| | | // private String files; |
| | | @TableField(value = "files",typeHandler = ListToStringTypeHandler.class) |
| | | private List<String> files; |
| | | /** |
| | | * æ¥æ¶é¨é¨ |
| | | */ |
| | | @TableField(value = "departments",typeHandler = ListToStringTypeHandler.class) |
| | | private List<String> departments; |
| | | /** |
| | | * å
±äº«æè¿° |
| | | */ |
| | | private String description; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.approve.utils.ListToStringTypeHandler; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName("holiday_settings") |
| | | public class HolidaySettings implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * åæåç§° |
| | | */ |
| | | private String name; |
| | | /** |
| | | * åæç±»å |
| | | */ |
| | | private String type; |
| | | /** |
| | | * å¼å§æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | /** |
| | | * ç»ææ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | /** |
| | | * å¤©æ° |
| | | */ |
| | | private Integer days; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("knowledge_base") |
| | | public class KnowledgeBase implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * ç¥è¯æ é¢ |
| | | */ |
| | | @Excel(name = "ç¥è¯æ é¢") |
| | | private String title; |
| | | /** |
| | | * ç¥è¯ç±»å |
| | | */ |
| | | @Excel(name = "ç¥è¯ç±»å",readConverterExp = "contract=ååç¹æ¹,approval=å®¡æ¹æ¡ä¾,solution=è§£å³æ¹æ¡,experience=ç»éªæ»ç»,guide=æä½æå") |
| | | private String type; |
| | | /** |
| | | * éç¨åºæ¯ |
| | | */ |
| | | @Excel(name = "éç¨åºæ¯") |
| | | private String scenario; |
| | | /** |
| | | * è§£å³æç |
| | | */ |
| | | @Excel(name = "è§£å³æç",readConverterExp = "low=轻微æå,medium=ä¸è¬æå,high=æ¾èæå") |
| | | private String efficiency; |
| | | /** |
| | | * é®é¢æè¿° |
| | | */ |
| | | private String problem; |
| | | /** |
| | | * è§£å³æ¹æ¡ |
| | | */ |
| | | private String solution; |
| | | /** |
| | | * å
³é®è¦ç¹ |
| | | */ |
| | | private String keyPoints; |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @Excel(name = "å建人") |
| | | private String creator; |
| | | /** |
| | | * ä½¿ç¨æ¬¡æ° |
| | | */ |
| | | @Excel(name = "ä½¿ç¨æ¬¡æ°") |
| | | private Integer usageCount; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "å建æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.approve.utils.ListToStringTypeHandler; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName("notification_management") |
| | | public class NotificationManagement implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * éç¥æ é¢ |
| | | */ |
| | | private String title; |
| | | /** |
| | | * éç¥ç±»å |
| | | */ |
| | | private String type; |
| | | /** |
| | | * ä¼å
级 |
| | | */ |
| | | private String priority; |
| | | /** |
| | | * éç¥ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * ææææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate expireDate; |
| | | /** |
| | | * æ¥æ¶é¨é¨ |
| | | */ |
| | | @TableField(value = "departments",typeHandler = ListToStringTypeHandler.class) |
| | | private List<String> departments; |
| | | /** |
| | | * 忥æ¹å¼ |
| | | */ |
| | | @TableField(value = "sync_methods",typeHandler = ListToStringTypeHandler.class) |
| | | private List<String> syncMethods; |
| | | /** |
| | | * éç¥å
容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.approve.utils.ListToStringTypeHandler; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName("online_meeting") |
| | | public class OnlineMeeting implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * ä¼è®®æ é¢ |
| | | */ |
| | | private String title; |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | /** |
| | | * ä¼è®®æ¶é¿ |
| | | */ |
| | | private Integer duration; |
| | | /** |
| | | * ä¼è®®å¹³å° |
| | | */ |
| | | private String platform; |
| | | /** |
| | | * ä¼è®®æè¿° |
| | | */ |
| | | private String description; |
| | | /** |
| | | * åä¼äººå |
| | | */ |
| | | @TableField(value = "participants",typeHandler = ListToStringTypeHandler.class) |
| | | private List<String> participants; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | |
| | | @Data |
| | | @TableName("overtime_setting") |
| | | public class OvertimeSetting implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * å çè§ååç§° |
| | | */ |
| | | private String name; |
| | | /** |
| | | * å çç±»å |
| | | */ |
| | | private String type; |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime startTime; |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime endTime; |
| | | /** |
| | | * åç |
| | | */ |
| | | private Double rate; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("rpa_process_automation") |
| | | public class RpaProcessAutomation implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * ç¨åºå |
| | | */ |
| | | @Excel(name = "ç¨åºå") |
| | | private String programName; |
| | | /** |
| | | * ç¨åºæè¿° |
| | | */ |
| | | @Excel(name = "ç¨åºæè¿°") |
| | | private String description; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | |
| | | @Data |
| | | @TableName("working_hours_setting") |
| | | public class WorkingHoursSetting implements Serializable { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * æ¶é´æ®µåç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * ä¸çæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime startTime; |
| | | /** |
| | | * ä¸çæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime endTime; |
| | | /** |
| | | * å¼¹æ§ä¸ç |
| | | */ |
| | | private String flexibleStart; |
| | | /** |
| | | * å¼¹æ§æ¶é´(åé) |
| | | */ |
| | | private Integer flexibleMinutes; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.HolidaySettings; |
| | | |
| | | public interface HolidaySettingsService extends IService<HolidaySettings> { |
| | | IPage listpage(Page page, HolidaySettings holidaySettings); |
| | | } |
| | |
| | | import com.ruoyi.approve.vo.ApproveProcessVO; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | |
| | | * æ·»å å®¡æ¹æµç¨ |
| | | * @param approveProcessVO å®¡æ¹æµç¨VO对象 |
| | | */ |
| | | void addApprove(ApproveProcessVO approveProcessVO) throws ParseException; |
| | | void addApprove(ApproveProcessVO approveProcessVO) throws Exception; |
| | | /** |
| | | * æ ¹æ®é¨é¨idæ¥è¯¢é¨é¨ä¿¡æ¯ |
| | | * @param deptIds é¨é¨IDæ°ç» |
| | |
| | | |
| | | void delApprove(Long[] ids); |
| | | |
| | | void updateByApproveId(ApproveGetAndUpdateVo approveGetAndUpdateVo); |
| | | void updateByApproveId(ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException; |
| | | |
| | | ApproveProcess getApproveById(String id); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.KnowledgeBase; |
| | | |
| | | public interface KnowledgeBaseService extends IService<KnowledgeBase> { |
| | | IPage<KnowledgeBase> listpage(Page page, KnowledgeBase knowledgeBase); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.NotificationManagement; |
| | | |
| | | public interface NotificationManagementService extends IService<NotificationManagement> { |
| | | IPage listpage(Page page, NotificationManagement notificationManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.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.approve.pojo.RpaProcessAutomation; |
| | | |
| | | public interface RpaProcessAutomationService extends IService<RpaProcessAutomation> { |
| | | IPage<RpaProcessAutomation> listpage(Page page, RpaProcessAutomation rpaProcessAutomation); |
| | | } |
| | |
| | | ApproveNode approveNode1 = approveNodeMapper.selectOne(approveNodeLambdaQueryWrapper); |
| | | approveProcess.setApproveStatus(status); |
| | | if(approveNode1 != null){ |
| | | approveProcess.setApproveUserCurrentId(approveNode.getApproveNodeUserId()); |
| | | approveProcess.setApproveUserCurrentId(approveNode1.getApproveNodeUserId()); |
| | | approveProcess.setApproveUserCurrentName(approveNode1.getApproveNodeUser()); |
| | | } |
| | | approveProcessMapper.updateById(approveProcess); |
| | |
| | | import com.ruoyi.approve.utils.DailyRedisCounter; |
| | | import com.ruoyi.approve.vo.ApproveGetAndUpdateVo; |
| | | import com.ruoyi.approve.vo.ApproveProcessVO; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.other.service.impl.TempFileServiceImpl; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | |
| | | private final IApproveNodeService approveNodeService; |
| | | private final SysUserMapper sysUserMapper; |
| | | private final ApproveProcessMapper approveProcessMapper; |
| | | private final TempFileServiceImpl tempFileService; |
| | | private final CommonFileMapper commonFileMapper; |
| | | |
| | | @Override |
| | | public void addApprove(ApproveProcessVO approveProcessVO) throws ParseException { |
| | | public void addApprove(ApproveProcessVO approveProcessVO) throws Exception { |
| | | SysUser sysUser = sysUserMapper.selectUserById(approveProcessVO.getApproveUser()); |
| | | SysDept sysDept = sysDeptMapper.selectDeptById(approveProcessVO.getApproveDeptId()); |
| | | String[] split = approveProcessVO.getApproveUserIds().split(","); |
| | |
| | | approveProcess.setApproveOverTime(null); |
| | | approveProcess.setApproveStatus(0); |
| | | approveProcess.setApproveDelete(0); |
| | | approveProcess.setApproveType(approveProcessVO.getApproveType()); |
| | | approveProcess.setCreateTime(LocalDateTime.now()); |
| | | approveProcess.setTenantId(approveProcessVO.getApproveDeptId()); |
| | | approveProcess.setApproveUserIds(approveProcessVO.getApproveUserIds()); |
| | |
| | | save(approveProcess); |
| | | //åå§å审æ¹èç¹ |
| | | approveNodeService.initApproveNodes(approveProcessVO.getApproveUserIds(),approveID,approveProcessVO.getApproveDeptId()); |
| | | // éä»¶ç»å® |
| | | tempFileService.migrateTempFilesToFormal(approveProcess.getId(), approveProcessVO.getTempFileIds(), FileNameType.ApproveProcess.getValue()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public IPage<ApproveProcess> listAll(Page page,ApproveProcess approveProcess) { |
| | | IPage<ApproveProcess> approveProcessIPage = approveProcessMapper.listPage(page,approveProcess); |
| | | List<ApproveProcess> records = approveProcessIPage.getRecords(); |
| | | for (ApproveProcess record : records) { |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, record.getId()) |
| | | .eq(CommonFile::getType, FileNameType.ApproveProcess.getValue())); |
| | | record.setCommonFileList(commonFiles); |
| | | } |
| | | return approveProcessIPage; |
| | | } |
| | | |
| | |
| | | queryWrapper.eq(ApproveProcess::getTenantId, SecurityUtils.getLoginUser().getTenantId()); |
| | | queryWrapper.last("limit 1"); |
| | | ApproveProcess one = getOne(queryWrapper); |
| | | one.setCommonFileList(commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getCommonId, one.getId()) |
| | | .eq(CommonFile::getType, FileNameType.ApproveProcess.getValue()))); |
| | | return one; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public void updateByApproveId(ApproveGetAndUpdateVo approveGetAndUpdateVo) { |
| | | public void updateByApproveId(ApproveGetAndUpdateVo approveGetAndUpdateVo) throws IOException { |
| | | ApproveProcess approve = approveProcessMapper.selectById(approveGetAndUpdateVo.getId()); |
| | | approve.setApproveUserIds(approveGetAndUpdateVo.getApproveUserIds()); |
| | | approve.setApproveReason(approveGetAndUpdateVo.getApproveReason()); |
| | |
| | | } |
| | | updateById(approve); |
| | | //ä¿®æ¹å®¡æ¹äºº |
| | | // å
å é¤ åæ°å¢ |
| | | LambdaQueryWrapper<ApproveNode> approveNodeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveNodeLambdaQueryWrapper.eq(ApproveNode::getApproveProcessId, approve.getApproveId()) |
| | | .eq(ApproveNode::getDeleteFlag, 0) |
| | | .eq(ApproveNode::getTenantId, SecurityUtils.getLoginUser().getTenantId()) |
| | | .orderByAsc(ApproveNode::getApproveNodeOrder); |
| | | List<ApproveNode> list = approveNodeMapper.selectList(approveNodeLambdaQueryWrapper); |
| | | int i = 0; |
| | | for (ApproveNode approveNode : list) { |
| | | int finalI = i; |
| | | List<SysUser> collect = sysUsers.stream().filter(user -> user.getUserId().equals(Long.parseLong(split[finalI]))).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | | throw new RuntimeException("è¯·éæ©æ£ç¡®ç审æ¹äºº"); |
| | | } |
| | | approveNode.setApproveNodeUserId(collect.get(0).getUserId()); |
| | | approveNode.setApproveNodeUser(collect.get(0).getNickName()); |
| | | approveNodeMapper.updateById(approveNode); |
| | | i++; |
| | | } |
| | | approveNodeMapper.delete(approveNodeLambdaQueryWrapper); |
| | | approveNodeService.initApproveNodes(approveGetAndUpdateVo.getApproveUserIds(),approve.getApproveId(),approve.getTenantId()); |
| | | |
| | | // int i = 0; |
| | | // for (ApproveNode approveNode : list) { |
| | | // int finalI = i; |
| | | // if(i >= split.length){ |
| | | // approveNode.setDeleteFlag(1); |
| | | // }else{ |
| | | // List<SysUser> collect = sysUsers.stream().filter(user -> user.getUserId().equals(Long.parseLong(split[finalI]))).collect(Collectors.toList()); |
| | | // if(CollectionUtils.isEmpty(collect)){ |
| | | // throw new RuntimeException("è¯·éæ©æ£ç¡®ç审æ¹äºº"); |
| | | // } |
| | | // approveNode.setApproveNodeUserId(collect.get(0).getUserId()); |
| | | // approveNode.setApproveNodeUser(collect.get(0).getNickName()); |
| | | // } |
| | | // approveNodeMapper.updateById(approveNode); |
| | | // i++; |
| | | // } |
| | | tempFileService.migrateTempFilesToFormal(approve.getId(), approveGetAndUpdateVo.getTempFileIds(), FileNameType.ApproveProcess.getValue()); |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.service.impl; |
| | | |
| | | 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.approve.mapper.HolidaySettingsMapper; |
| | | import com.ruoyi.approve.pojo.HolidaySettings; |
| | | import com.ruoyi.approve.service.HolidaySettingsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class HolidaySettingsServiceImpl extends ServiceImpl<HolidaySettingsMapper, HolidaySettings> implements HolidaySettingsService { |
| | | @Autowired |
| | | private HolidaySettingsMapper holidaySettingsMapper; |
| | | |
| | | @Override |
| | | public IPage<HolidaySettings> listpage(Page page, HolidaySettings holidaySettings) { |
| | | return holidaySettingsMapper.listpage(page,holidaySettings); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.service.impl; |
| | | |
| | | 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.approve.mapper.KnowledgeBaseMapper; |
| | | import com.ruoyi.approve.pojo.KnowledgeBase; |
| | | import com.ruoyi.approve.service.KnowledgeBaseService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class KnowledgeBaseServiceImpl extends ServiceImpl<KnowledgeBaseMapper, KnowledgeBase> implements KnowledgeBaseService { |
| | | @Autowired |
| | | private KnowledgeBaseMapper knowledgeBaseMapper; |
| | | |
| | | @Override |
| | | public IPage<KnowledgeBase> listpage(Page page, KnowledgeBase knowledgeBase) { |
| | | return knowledgeBaseMapper.listpage(page,knowledgeBase); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.approve.mapper.NotificationManagementMapper; |
| | | import com.ruoyi.approve.pojo.NotificationManagement; |
| | | import com.ruoyi.approve.service.NotificationManagementService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class NotificationManagementServiceImpl extends ServiceImpl<NotificationManagementMapper, NotificationManagement> implements NotificationManagementService { |
| | | @Autowired |
| | | private NotificationManagementMapper notificationManagementMapper; |
| | | |
| | | @Override |
| | | public IPage<NotificationManagement> listpage(Page page, NotificationManagement notificationManagement) { |
| | | // // 1. å建 Page å®ä¾ï¼IPage å®ç°ç±»ï¼ï¼æå®é¡µç åæ¯é¡µæ¡æ° |
| | | // IPage<NotificationManagement> page1 = new Page<>(page.getCurrent(), page.getSize()); |
| | | return notificationManagementMapper.listpage(page,notificationManagement); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.approve.mapper.RpaProcessAutomationMapper; |
| | | import com.ruoyi.approve.pojo.RpaProcessAutomation; |
| | | import com.ruoyi.approve.service.RpaProcessAutomationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class RpaProcessAutomationServiceImpl extends ServiceImpl<RpaProcessAutomationMapper, RpaProcessAutomation> implements RpaProcessAutomationService { |
| | | @Autowired |
| | | private RpaProcessAutomationMapper rpaProcessAutomationMapper; |
| | | @Override |
| | | public IPage<RpaProcessAutomation> listpage(Page page, RpaProcessAutomation rpaProcessAutomation) { |
| | | return rpaProcessAutomationMapper.listpage(page,rpaProcessAutomation); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.approve.utils; |
| | | |
| | | import org.apache.ibatis.type.BaseTypeHandler; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | import org.apache.ibatis.type.MappedJdbcTypes; |
| | | import org.apache.ibatis.type.MappedTypes; |
| | | |
| | | import java.sql.CallableStatement; |
| | | import java.sql.PreparedStatement; |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | @MappedTypes(List.class) |
| | | @MappedJdbcTypes(JdbcType.VARCHAR) |
| | | public class ListToStringTypeHandler extends BaseTypeHandler<List<String>> { |
| | | private static final String SEPARATOR = ","; |
| | | |
| | | @Override |
| | | public void setNonNullParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType) throws SQLException { |
| | | // å卿¶ï¼List 转éå·åéå符串 |
| | | if (parameter == null) { |
| | | ps.setString(i, null); |
| | | } else { |
| | | ps.setString(i, String.join(SEPARATOR, parameter)); |
| | | } |
| | | // String value = parameter.stream().collect(Collectors.joining(",")); |
| | | // ps.setString(i, value); |
| | | } |
| | | @Override |
| | | public List<String> getNullableResult(ResultSet rs, String columnName) throws SQLException { |
| | | // æ¥è¯¢æ¶ï¼å符串转 List |
| | | String value = rs.getString(columnName); |
| | | return value != null && !value.isEmpty() ? Arrays.asList(value.split(SEPARATOR)) : new ArrayList<>(); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getNullableResult(ResultSet rs, int columnIndex) throws SQLException { |
| | | String value = rs.getString(columnIndex); |
| | | return value != null && !value.isEmpty() ? Arrays.asList(value.split(SEPARATOR)) : new ArrayList<>(); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { |
| | | String value = cs.getString(columnIndex); |
| | | return value != null && !value.isEmpty() ? Arrays.asList(value.split(SEPARATOR)) : new ArrayList<>(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.approve.utils; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | public class StartAndEndDateDto { |
| | | |
| | | @ApiModelProperty("å¼å§æ¶é´") |
| | | @TableField(exist = false) |
| | | private String startDate; |
| | | |
| | | @ApiModelProperty("ç»ææ¶é´") |
| | | @TableField(exist = false) |
| | | private String endDate; |
| | | |
| | | @ApiModelProperty("å¼å§æä»½") |
| | | @TableField(exist = false) |
| | | private Integer startMonth; |
| | | |
| | | @ApiModelProperty("ç»ææä»½") |
| | | @TableField(exist = false) |
| | | private Integer endMonth; |
| | | |
| | | @ApiModelProperty("年份") |
| | | @TableField(exist = false) |
| | | private Integer year; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.approve.vo; |
| | | |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ApproveGetAndUpdateVo { |
| | | |
| | | private List<String> tempFileIds; |
| | | //审æ¹id |
| | | @NotBlank(message = "æµç¨ç¼å·ä¸è½ä¸ºç©º") |
| | | private String id; |
| | |
| | | private String approveTime; |
| | | |
| | | private Integer approveStatus; |
| | | /** |
| | | * 审æ¹ç±»å |
| | | */ |
| | | private Integer approveType; |
| | | } |
| | |
| | | package com.ruoyi.approve.vo; |
| | | |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ApproveProcessVO { |
| | | |
| | | private List<String> tempFileIds; |
| | | |
| | | private Long id; |
| | | |
| | |
| | | private String approveUserIds; |
| | | |
| | | private String approveReason; |
| | | |
| | | /** |
| | | * 审æ¹ç±»å |
| | | */ |
| | | private Integer approveType; |
| | | } |
| | |
| | | util.exportExcel(response, list, "å®¢æ·æ¡£æ¡æ°æ®"); |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | | @Log(title = "å®¢æ·æ¡£æ¡-ä¸è½½æ¨¡æ¿", businessType = BusinessType.EXPORT) |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<Customer> util = new ExcelUtil<Customer>(Customer.class); |
| | | util.importTemplateExcel(response, "å®¢æ·æ¡£æ¡æ¨¡æ¿"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导å
¥å®¢æ·æ¡£æ¡ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.SupplierManageDto; |
| | | 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 com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | |
| | | supplierService.supplierExport(response, supplierManageDto); |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | | @Log(title = "ä¾åºå-ä¸è½½æ¨¡æ¿", businessType = BusinessType.EXPORT) |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<SupplierManage> util = new ExcelUtil<SupplierManage>(SupplierManage.class); |
| | | util.importTemplateExcel(response, "ä¾åºåæ¡£æ¡æ¨¡æ¿"); |
| | | } |
| | | |
| | | /** |
| | | * ä¾åºå导å
¥ |
| | | */ |
| | |
| | | @Data |
| | | public class StorageBlobDTO extends StorageBlob { |
| | | private String url; |
| | | |
| | | private String downloadUrl; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.basic.pojo.StorageAttachment; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author ruoyi |
| | | * @since 2025-05-29 |
| | | */ |
| | | @Mapper |
| | | public interface StorageAttachmentMapper extends BaseMapper<StorageAttachment> { |
| | | |
| | | } |
| | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * é»è¾å é¤ |
| | | */ |
| | |
| | | @TableField(value = "storage_blob_id") |
| | | private Long storageBlobId; |
| | | |
| | | @TableField(exist = false) |
| | | private StorageBlobDTO storageBlobDTO; |
| | | |
| | | public StorageAttachment(String fileType, Long recordType, Long recordId) { |
| | |
| | | package com.ruoyi.basic.pojo; |
| | | |
| | | 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 com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // @TableField(fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * èµæºid |
| | | */ |
| | | @TableField(value = "key") |
| | | private String key; |
| | | @TableField(value = "resource_key") |
| | | private String resourceKey; |
| | | /** |
| | | * èµæºç±»åï¼ä¾å¦JPGå¾ççèµæºç±»å为image/jpg |
| | | */ |
| | |
| | | */ |
| | | @TableField(value = "byte_size") |
| | | private Long byteSize; |
| | | |
| | | /** |
| | | * 0ç产å 1ç产å 2ç产é®é¢ |
| | | */ |
| | | @TableField(value = "type") |
| | | private Long type; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty(value = "å建该记å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½å建æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æåä¿®æ¹è¯¥è®°å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½æåæ´æ°æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | } |
| | |
| | | |
| | | 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; |
| | | |
| | |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºååç§°") |
| | | |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty(value = "纳ç¨äººè¯å«å·") |
| | | @Excel(name = "纳ç¨äººè¯å«å·") |
| | | private String taxpayerIdentificationNum; |
| | | |
| | | @ApiModelProperty(value = "å
¬å¸å°å") |
| | | @Excel(name = "å
¬å¸å°å") |
| | | private String companyAddress; |
| | | |
| | | @ApiModelProperty(value = "å
¬å¸çµè¯") |
| | | @Excel(name = "å
¬å¸çµè¯") |
| | | private String companyPhone; |
| | | |
| | | @ApiModelProperty(value = "弿·è¡") |
| | | @Excel(name = "弿·è¡") |
| | | private String bankAccountName; |
| | | |
| | | @ApiModelProperty(value = "è´¦å·") |
| | | @Excel(name = "è´¦å·") |
| | | private String bankAccountNum; |
| | | |
| | | @ApiModelProperty(value = "è系人") |
| | | @Excel(name = "è系人") |
| | | private String contactUserName; |
| | | |
| | | @ApiModelProperty(value = "èç³»çµè¯") |
| | | @Excel(name = "èç³»çµè¯") |
| | | private String contactUserPhone; |
| | | |
| | | @ApiModelProperty(value = "ç»´æ¤äººID") |
| | | @Excel(name = "ç»´æ¤äºº") |
| | | private Integer maintainUserId; |
| | | |
| | | @ApiModelProperty(value = "ç»´æ¤æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | // @Excel(name = "ç»´æ¤æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate maintainTime; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | |
| | | */ |
| | | public void saveStorageAttachment(List<StorageAttachment> attachments, Long recordId, StorageAttachmentRecordType recordType, StorageAttachmentConstants fileType); |
| | | |
| | | public void saveStorageAttachment(List<StorageAttachment> attachments, Long recordId, StorageAttachmentRecordType recordType, String fileType); |
| | | |
| | | |
| | | /** |
| | | * å é¤éç¨æä»¶ä¸ä¼ çéä»¶ä¿¡æ¯ |
| | | * @param storageAttachment æä»¶ä¿¡æ¯ |
| | |
| | | */ |
| | | List<StorageBlobDTO> updateStorageBlobs(List<MultipartFile> files, String bucketName); |
| | | |
| | | List<StorageBlobDTO> updateStorageBlobs(List<MultipartFile> files, String bucketName,Long type); |
| | | |
| | | |
| | | /** |
| | | * æ¹éå 餿件 |
| | | * @param attachment |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void saveStorageAttachment(List<StorageAttachment> attachments, Long recordId, StorageAttachmentRecordType recordType, String fileType) { |
| | | // å 餿§å¾ |
| | | deleteStorageAttachment(new StorageAttachment(fileType, (long) recordType.ordinal(), recordId)); |
| | | for (StorageAttachment attachment : attachments) { |
| | | // è·åå
³èè®°å½ |
| | | StorageBlob storageBlob = attachment.getStorageBlobDTO(); |
| | | attachment.setName(fileType); |
| | | attachment.setRecordType((long) recordType.ordinal()); |
| | | attachment.setRecordId(recordId); |
| | | attachment.setStorageBlobId(storageBlob.getId()); |
| | | storageAttachmentMapper.insert(attachment); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStorageAttachment(StorageAttachment storageAttachment) { |
| | | // å
å 餿ç»è¡¨ |
| | | storageBlobService.deleteStorageBlobs(storageAttachment); |
| | |
| | | import com.ruoyi.basic.pojo.StorageAttachment; |
| | | import com.ruoyi.basic.pojo.StorageBlob; |
| | | import com.ruoyi.basic.service.StorageBlobService; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.exception.file.InvalidExtensionException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.MinioUtils; |
| | |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.framework.web.domain.MinioResult; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | dto.setBucketFilename(res.getBucketFileName()); |
| | | dto.setOriginalFilename(res.getOriginalName()); |
| | | dto.setByteSize(file.getSize()); |
| | | dto.setKey(IdUtils.simpleUUID()); |
| | | dto.setResourceKey(IdUtils.simpleUUID()); |
| | | dto.setBucketName(bucketName); |
| | | dto.setCreateTime(DateUtils.getNowDate()); |
| | | dto.setUrl(minioUtils.getPreviewUrl(res.getBucketFileName(), bucketName, false)); |
| | | // æå
¥æ°æ®åº |
| | | storageBlobMapper.insert(dto); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<StorageBlobDTO> updateStorageBlobs(List<MultipartFile> files, String bucketName, Long type) { |
| | | |
| | | // è¥æ²¡ä¼ å
¥bucketNameï¼å使ç¨é»è®¤bucketName |
| | | if (StringUtils.isEmpty(bucketName)) { |
| | | bucketName = minioUtils.getDefaultBucket(); |
| | | } |
| | | List<StorageBlobDTO> storageBlobDTOs = new ArrayList<>(); |
| | | for (MultipartFile file : files) { |
| | | try { |
| | | validateFileExtension(file); |
| | | |
| | | MinioResult res = minioUtils.upload(bucketName, file, false); |
| | | |
| | | StorageBlobDTO dto = buildStorageBlobDTO(file, res, bucketName, type); |
| | | |
| | | storageBlobMapper.insert(dto); |
| | | storageBlobDTOs.add(dto); |
| | | |
| | | } catch (InvalidExtensionException e) { |
| | | throw new RuntimeException("䏿¯æçæä»¶ç±»åï¼" + file.getOriginalFilename(), e); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("ä¸ä¼ æä»¶å¤±è´¥ï¼" + file.getOriginalFilename(), e); |
| | | } |
| | | } |
| | | return storageBlobDTOs; |
| | | } |
| | | |
| | | private StorageBlobDTO buildStorageBlobDTO(MultipartFile file, MinioResult res, String bucketName, Long type) { |
| | | StorageBlobDTO dto = new StorageBlobDTO(); |
| | | dto.setContentType(file.getContentType()); |
| | | dto.setBucketFilename(res.getBucketFileName()); |
| | | dto.setOriginalFilename(res.getOriginalName()); |
| | | dto.setByteSize(file.getSize()); |
| | | dto.setResourceKey(IdUtils.simpleUUID()); |
| | | dto.setBucketName(bucketName); |
| | | dto.setUrl(minioUtils.getPreviewUrl(res.getBucketFileName(), bucketName, false)); |
| | | dto.setDownloadUrl(minioUtils.getDownloadUrl(res.getBucketFileName(), bucketName)); |
| | | |
| | | if (type != null) { |
| | | dto.setType(type); |
| | | } |
| | | |
| | | return dto; |
| | | } |
| | | |
| | | private void validateFileExtension(MultipartFile file) throws InvalidExtensionException { |
| | | String filename = file.getOriginalFilename(); |
| | | String extension = FilenameUtils.getExtension(filename).toLowerCase(); |
| | | List<String> allowedExtensions = Arrays.asList( |
| | | // å¾ç |
| | | "jpg", "jpeg", "png", "gif", "bmp", "webp", "tiff", "ico", "svg", |
| | | |
| | | // ææ¡£ |
| | | "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "rtf", "md", "csv", "odt", |
| | | |
| | | // è§é¢ |
| | | "mp4", "mov", "avi", "wmv", "flv", "mkv", "webm", "mpeg", "3gp", "MOV", |
| | | |
| | | // é³é¢ |
| | | "mp3", "wav", "ogg", "aac", "flac", "m4a", "wma", "amr", |
| | | |
| | | // å缩å
|
| | | "zip", "rar", "7z", "tar", "gz", "bz2", "xz", |
| | | |
| | | // ç¼ç¨ä»£ç æä»¶ |
| | | "java", "py", "js", "ts", "html", "css", "cpp", "c", "cs", "json", "xml", "sql", "yaml", "yml", "sh", "bat", |
| | | |
| | | // å®è£
ç¨åº & äºè¿å¶ |
| | | "exe", "apk", "dmg", "msi", "bin", "iso", |
| | | |
| | | // 设计类 |
| | | "psd", "ai", "xd", "sketch", "fig" |
| | | ); |
| | | |
| | | if (!allowedExtensions.contains(extension)) { |
| | | throw new BaseException("æä»¶ç±»åä¸è¢«å
许ï¼" + extension); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStorageBlobs(StorageAttachment attachment) { |
| | | List<StorageAttachment> attachments = storageAttachmentMapper.selectList(new LambdaQueryWrapper<StorageAttachment>() |
| | | .eq(StorageAttachment::getRecordId, attachment.getRecordId()) |
| | | .eq(StorageAttachment::getRecordType, attachment.getRecordType()) |
| | | .eq(StorageAttachment::getName, attachment.getName())); |
| | | List<Long> ids = attachments.stream().map(StorageAttachment::getStorageBlobId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return 0; |
| | | } |
| | | List<StorageBlob> storageBlobs = storageBlobMapper.selectList(new LambdaQueryWrapper<StorageBlob>() |
| | | .in(StorageBlob::getId, ids)); |
| | | if (!storageBlobs.isEmpty()) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.collaborativeApproval.dto.DutyPlanDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.DutyPlanMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.DutyPlan; |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; |
| | | import com.ruoyi.collaborativeApproval.service.DutyPlanService; |
| | | import com.ruoyi.common.utils.excel.ExcelUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/dutyPlan") |
| | | @AllArgsConstructor |
| | | public class DutyPlanController { |
| | | @Autowired |
| | | private DutyPlanService dutyPlanService; |
| | | |
| | | @GetMapping("/getList") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, DutyPlanDTO dutyPlanDTO){ |
| | | return AjaxResult.success(dutyPlanService.listPage(page, dutyPlanDTO)); |
| | | } |
| | | @GetMapping("/getNum") |
| | | @ApiOperation("è·åççº§æ°æ®") |
| | | public AjaxResult getNum(){ |
| | | return AjaxResult.success(dutyPlanService.getNum()); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody DutyPlan dutyPlan){ |
| | | return AjaxResult.success(dutyPlanService.save(dutyPlan)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody DutyPlan dutyPlan){ |
| | | return AjaxResult.success(dutyPlanService.updateById(dutyPlan)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(dutyPlanService.removeBatchByIds(ids)); |
| | | } |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åº") |
| | | public void exportData(HttpServletResponse response, DutyPlanDTO dutyPlanDTO){ |
| | | dutyPlanService.exportData(response, dutyPlanDTO); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.collaborativeApproval.mapper.MeetDraftMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetApplication; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetDraft; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingMinutes; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingRoom; |
| | | import com.ruoyi.collaborativeApproval.service.MeetingService; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingApplicationVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingDraftVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingRoomVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingUseVo; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å
³äºä¼è®®controller |
| | | * |
| | | * @author buhuazhen |
| | | * @date 2025/9/15 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/meeting") |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "ä¼è®®") |
| | | public class MeetingController { |
| | | private final MeetingService meetingService; |
| | | |
| | | @PostMapping("/roomList") |
| | | public R getMeetingRoomList(@RequestBody SearchMeetingRoomVo vo) { |
| | | |
| | | return R.ok(meetingService.getMeetingRoomList(vo)); |
| | | } |
| | | |
| | | @PostMapping("/saveRoom") |
| | | public R saveRoom(@RequestBody MeetingRoom meetingRoom) { |
| | | meetingService.saveMeetRoom(meetingRoom); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/room/{id}") |
| | | public R getRoomById(@PathVariable Long id) { |
| | | return R.ok(meetingService.findMeetRoomById(id)); |
| | | } |
| | | |
| | | @DeleteMapping("/delRoom/{id}") |
| | | public R deleteRoom(@PathVariable Long id) { |
| | | meetingService.deleteMeetingRoom(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/roomEnum") |
| | | public R getRoomEnum() { |
| | | return R.ok(meetingService.getRoomEnum()); |
| | | } |
| | | |
| | | @PostMapping("/draftList") |
| | | public R getMeetingDraftList(@RequestBody SearchMeetingDraftVo vo) { |
| | | return R.ok(meetingService.getMeetingDraftList(vo)); |
| | | } |
| | | |
| | | @PostMapping("/saveDraft") |
| | | public R saveMeetingDraft(@RequestBody MeetDraft meetDraft) { |
| | | meetingService.saveMeetDraft(meetDraft); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @DeleteMapping("/delDraft/{id}") |
| | | public R deleteMeetingDraft(@PathVariable Long id) { |
| | | meetingService.deleteMeetingDraft(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/saveMeetingApplication") |
| | | public R saveMeetApplication(@RequestBody MeetApplication meetApplication) { |
| | | meetingService.saveMeetApplication(meetApplication); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/applicationList") |
| | | public R getMeetingApplicationList(@RequestBody SearchMeetingApplicationVo vo) { |
| | | return R.ok(meetingService.getMeetingApplicationList(vo)); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/meetingUseList") |
| | | public R meetingUseList(@RequestBody SearchMeetingUseVo vo) { |
| | | return R.ok(meetingService.meetingUseList(vo)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/meetingPublishList") |
| | | public R meetingPublishList(@RequestBody SearchMeetingApplicationVo vo) { |
| | | return R.ok(meetingService.getMeetingPublishList(vo)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getMeetingMinutesByMeetingId/{id}") |
| | | public R getMeetingMinutes(@PathVariable Long id) { |
| | | return R.ok(meetingService.getMeetingMinutesById(id)); |
| | | } |
| | | |
| | | @PostMapping("/saveMeetingMinutes") |
| | | public R saveMeetingMinutes(@RequestBody MeetingMinutes meetingMinutes) { |
| | | meetingService.saveMeetingMinutes(meetingMinutes); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getMeetSummary") |
| | | public R getMeetSummary() { |
| | | return R.ok(meetingService.getMeetSummary()); |
| | | } |
| | | |
| | | @GetMapping("/getMeetSummaryItems") |
| | | public R getMeetSummaryItems() { |
| | | return R.ok(meetingService.getMeetSummaryItems()); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¼è®®å®¤è®¾ç½®å¯¼åº") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | List<MeetingRoom> accountExpenses = meetingService.list(); |
| | | ExcelUtil<MeetingRoom> util = new ExcelUtil<MeetingRoom>(MeetingRoom.class); |
| | | util.exportExcel(response, accountExpenses, "ä¼è®®å®¤è®¾ç½®å¯¼åº"); |
| | | } |
| | | |
| | | private final MeetDraftMapper meetDraftMapper; |
| | | |
| | | @ApiOperation(value = "ä¼è®®è稿导åº") |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response) { |
| | | List<MeetDraft> accountExpenses = meetDraftMapper.selectList(new LambdaQueryWrapper<MeetDraft>()); |
| | | ExcelUtil<MeetDraft> util = new ExcelUtil<MeetDraft>(MeetDraft.class); |
| | | util.exportExcel(response, accountExpenses, "ä¼è®®è稿导åº"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.collaborativeApproval.dto.NoticeDTO; |
| | | import com.ruoyi.collaborativeApproval.service.NoticeService; |
| | | 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 io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @Api(tags = "éç¥å
Œ") |
| | | @RequestMapping("/collaborativeApproval/notice") |
| | | public class NoticeController extends BaseController { |
| | | |
| | | private final NoticeService noticeService; |
| | | |
| | | @GetMapping("/page") |
| | | @Log(title = "å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, NoticeDTO noticeDTO){ |
| | | return AjaxResult.success(noticeService.listPage(page, noticeDTO)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "æ°å¢", businessType = BusinessType.INSERT) |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody NoticeDTO noticeDTO){ |
| | | return AjaxResult.success(noticeService.save(noticeDTO)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @Log(title = "ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody NoticeDTO noticeDTO){ |
| | | return AjaxResult.success(noticeService.updateById(noticeDTO)); |
| | | } |
| | | |
| | | @DeleteMapping("/{ids}") |
| | | @Log(title = "å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delete(@PathVariable("ids") List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(noticeService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | @GetMapping("/count") |
| | | @Log(title = "è·åå
¬åæ°é", businessType = BusinessType.OTHER) |
| | | @ApiOperation("è·åå
¬åæ°é") |
| | | public AjaxResult count(){ |
| | | return AjaxResult.success(noticeService.selectCount()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.collaborativeApproval.mapper.ReadingStatusMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.ReadingStatus; |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; |
| | | import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; |
| | | import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/rulesRegulationsManagement") |
| | | @AllArgsConstructor |
| | | @Api(tags = "å¶åº¦ç®¡ç") |
| | | public class RulesRegulationsManagementController { |
| | | @Autowired |
| | | private RulesRegulationsManagementService rulesRegulationsManagementService; |
| | | @Autowired |
| | | private ReadingStatusMapper readingStatusMapper; |
| | | |
| | | @GetMapping("/getList") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return AjaxResult.success(rulesRegulationsManagementService.listPage(page, rulesRegulationsManagement)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return AjaxResult.success(rulesRegulationsManagementService.save(rulesRegulationsManagement)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ |
| | | return AjaxResult.success(rulesRegulationsManagementService.updateById(rulesRegulationsManagement)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delete(@PathVariable("ids") List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(rulesRegulationsManagementService.removeBatchByIds(ids)); |
| | | } |
| | | //è§åæ¥çæ¶æ°å¢é
è¯»ç¶æ |
| | | @PostMapping("/addReadingStatus") |
| | | @ApiOperation("æ°å¢é
è¯»ç¶æ") |
| | | public AjaxResult addReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.insert(readingStatus)); |
| | | } |
| | | @PostMapping("/updateReadingStatus") |
| | | @ApiOperation("ä¿®æ¹é
è¯»ç¶æ") |
| | | public AjaxResult updateReadingStatus(@RequestBody ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.updateById(readingStatus)); |
| | | } |
| | | @GetMapping("/getReadingStatusList") |
| | | @ApiOperation("å页æ¥è¯¢é
è¯»ç¶æ") |
| | | public AjaxResult listPage(Page page, ReadingStatus readingStatus){ |
| | | return AjaxResult.success(readingStatusMapper.selectPage(page,new QueryWrapper<ReadingStatus>(readingStatus))); |
| | | } |
| | | @GetMapping("/getReadingStatusByRuleId/{ruleId}") |
| | | @ApiOperation("æ ¹æ®å¶åº¦idæ¥è¯¢é
è¯»ç¶æ") |
| | | public AjaxResult getReadingStatusByRuleId(@PathVariable Long ruleId){ |
| | | return AjaxResult.success(readingStatusMapper.selectList(new QueryWrapper<ReadingStatus>().eq("rule_id", ruleId))); |
| | | } |
| | | |
| | | @ApiOperation(value = "è§ç« å¶åº¦ç®¡ç导åº") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | List<RulesRegulationsManagement> accountExpenses = rulesRegulationsManagementService.list(); |
| | | ExcelUtil<RulesRegulationsManagement> util = new ExcelUtil<RulesRegulationsManagement>(RulesRegulationsManagement.class); |
| | | util.exportExcel(response, accountExpenses, "è§ç« å¶åº¦ç®¡ç导åº"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.approve.pojo.KnowledgeBase; |
| | | import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; |
| | | import com.ruoyi.collaborativeApproval.service.SealApplicationManagementService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/sealApplicationManagement") |
| | | @Api(tags = "ç¨å°ç³è¯·ç®¡ç") |
| | | public class SealApplicationManagementController { |
| | | @Autowired |
| | | private SealApplicationManagementService sealApplicationManagementService; |
| | | |
| | | @GetMapping("/getList") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SealApplicationManagement sealApplicationManagement){ |
| | | return AjaxResult.success(sealApplicationManagementService.listPage(page,sealApplicationManagement)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody SealApplicationManagement sealApplicationManagement){ |
| | | return AjaxResult.success(sealApplicationManagementService.save(sealApplicationManagement)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody SealApplicationManagement sealApplicationManagement){ |
| | | return AjaxResult.success(sealApplicationManagementService.updateById(sealApplicationManagement)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delete(@PathVariable("ids") List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(sealApplicationManagementService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¨å°ç³è¯·ç®¡ç导åº") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | List<SealApplicationManagement> accountExpenses = sealApplicationManagementService.list(); |
| | | ExcelUtil<SealApplicationManagement> util = new ExcelUtil<SealApplicationManagement>(SealApplicationManagement.class); |
| | | util.exportExcel(response, accountExpenses, "ç¨å°ç³è¯·ç®¡ç导åº"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.collaborativeApproval.dto.StaffContactsPersonalDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; |
| | | import com.ruoyi.collaborativeApproval.service.StaffContactsPersonalService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/staffContactsPersonal") |
| | | @AllArgsConstructor |
| | | public class StaffContactsPersonalController { |
| | | @Autowired |
| | | private StaffContactsPersonalService staffContactsPersonalService; |
| | | @GetMapping("/getList") |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO ){ |
| | | return AjaxResult.success(staffContactsPersonalService.listPage(page, staffContactsPersonalDTO)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢") |
| | | public AjaxResult add(@RequestBody StaffContactsPersonal staffContactsPersonal){ |
| | | return AjaxResult.success(staffContactsPersonalService.save(staffContactsPersonal)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete/{id}") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delete(@PathVariable("id") Long id){ |
| | | // if (CollectionUtils.isEmpty(id)) { |
| | | // throw new RuntimeException("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | // } |
| | | return AjaxResult.success(staffContactsPersonalService.removeById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.collaborativeApproval.pojo.DutyPlan; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DutyPlanDTO extends DutyPlan { |
| | | private List<String> tags; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate queryDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/17 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class MeetSummaryDto implements Serializable { |
| | | // æ»ä¼è®® |
| | | private Integer total; |
| | | // è¿è¡ä¸ |
| | | private Integer underWay; |
| | | // 已宿 |
| | | private Integer completed; |
| | | // å³å°å¼å§ |
| | | private Integer toStart; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/16 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class MeetUseDto implements Serializable { |
| | | |
| | | private Long id; |
| | | private String name; |
| | | private List<MeetingItem> meetings = new ArrayList<>(); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/16 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class MeetingItem { |
| | | private Long id; |
| | | private String title; |
| | | private String startTime; |
| | | private String endTime; |
| | | private String time; |
| | | private String host; |
| | | private Integer participants = 0; |
| | | private Integer status; |
| | | private String description; |
| | | private String room; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/17 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class MeetingSimpleDto { |
| | | private Long id; |
| | | private String title; |
| | | private Integer status; |
| | | private LocalDateTime startTime; |
| | | private LocalDateTime endTime; |
| | | private String location; |
| | | private String host; |
| | | private String participants; |
| | | private String content; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.Notice; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class NoticeDTO extends Notice { |
| | | private String CreateUserName; |
| | | |
| | | private Long count; |
| | | |
| | | private String statusName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class RulesRegulationsManagementDTO extends RulesRegulationsManagement { |
| | | /** |
| | | * åå¸äººå§å |
| | | */ |
| | | private String createUserName; |
| | | private List<String> scope; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SealApplicationManagementDTO extends SealApplicationManagement { |
| | | private String createUserName; |
| | | //æå±é¨é¨ |
| | | private String department; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.dto; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StaffContactsPersonalDTO extends StaffContactsPersonal { |
| | | private String staffNo; |
| | | private String staffName; |
| | | private String sex; |
| | | private String postJob; |
| | | private String adress; |
| | | private String profession; |
| | | private String identityCard; |
| | | private String phone; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.DutyPlanDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.DutyPlan; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface DutyPlanMapper extends BaseMapper<DutyPlan> { |
| | | IPage<DutyPlanDTO> listPage(Page page, @Param("dutyPlan") DutyPlanDTO dutyPlan); |
| | | |
| | | |
| | | List<Map<String, Object>> getNum(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.ruoyi.collaborativeApproval.dto.MeetSummaryDto; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetingSimpleDto; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetApplication; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãmeet_application(ä¼è®®ç³è¯·è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-15 15:54:20 |
| | | * @Entity com.ruoyi.collaborativeApproval.pojo.MeetApplication |
| | | */ |
| | | public interface MeetApplicationMapper extends BaseMapper<MeetApplication> { |
| | | |
| | | MeetSummaryDto getMeetSummary(); |
| | | |
| | | List<MeetingSimpleDto> getMeetSummaryItems(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetDraft; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãmeet_draft(ä¼è®®è稿表)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-15 14:10:49 |
| | | * @Entity com.ruoyi.collaborativeApproval.pojo.MeetDraft |
| | | */ |
| | | public interface MeetDraftMapper extends BaseMapper<MeetDraft> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingMinutes; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãmeeting_minutes(ä¼è®®çºªè¦è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-17 10:25:20 |
| | | * @Entity com.ruoyi.collaborativeApproval.pojo.MeetingMinutes |
| | | */ |
| | | public interface MeetingMinutesMapper extends BaseMapper<MeetingMinutes> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingRoom; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãmeeting_room(ä¼è®®å®¤è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-15 10:32:50 |
| | | * @Entity com.ruoyi.collaborativeApproval.pojo.MeetingRoom |
| | | */ |
| | | public interface MeetingRoomMapper extends BaseMapper<MeetingRoom> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.NoticeDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.Notice; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface NoticeMapper extends BaseMapper<Notice> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param noticeDTO |
| | | * @return |
| | | */ |
| | | IPage<NoticeDTO> listPage(Page page, @Param("ew") NoticeDTO noticeDTO); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.ReadingStatus; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface ReadingStatusMapper extends BaseMapper<ReadingStatus> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.RulesRegulationsManagementDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface RulesRegulationsManagementMapper extends BaseMapper<RulesRegulationsManagement> { |
| | | IPage<RulesRegulationsManagementDTO> listPage(Page page,@Param("ew") RulesRegulationsManagement rulesRegulationsManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.SealApplicationManagementDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface SealApplicationManagementMapper extends BaseMapper<SealApplicationManagement> { |
| | | IPage<SealApplicationManagementDTO> listPage(Page page, @Param("ew") SealApplicationManagement sealApplicationManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.StaffContactsPersonalDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface StaffContactsPersonalMapper extends BaseMapper<StaffContactsPersonal> { |
| | | IPage listPage(Page page,@Param("staffContactsPersonalDTO") StaffContactsPersonalDTO staffContactsPersonalDTO); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.approve.utils.ListToStringTypeHandler; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName("duty_plan") |
| | | public class DutyPlan{ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * è®¡åæ é¢ |
| | | */ |
| | | @Excel(name = "è®¡åæ é¢") |
| | | @ApiModelProperty("è®¡åæ é¢") |
| | | private String title; |
| | | /** |
| | | * 计åæè¿° |
| | | */ |
| | | @Excel(name = "计åæè¿°") |
| | | @ApiModelProperty("计åæè¿°") |
| | | private String description; |
| | | |
| | | |
| | | /** |
| | | * 计åçº§å« |
| | | */ |
| | | @Excel(name = "计å级å«") |
| | | @ApiModelProperty("计å级å«") |
| | | private String level; |
| | | /** |
| | | * æ¶é´å¨æ |
| | | */ |
| | | @Excel(name = "æ¶é´å¨æ") |
| | | @ApiModelProperty("æ¶é´å¨æ") |
| | | private String period; |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @Excel(name = "å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @Excel(name = "ç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | |
| | | /** |
| | | * è´è´£äºº |
| | | */ |
| | | @Excel(name = "è´è´£äºº") |
| | | @ApiModelProperty("è´è´£äºº") |
| | | private String assignee; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Excel(name = "ç¶æ") |
| | | @ApiModelProperty("ç¶æ") |
| | | private String status; |
| | | /** |
| | | * ä¼å
级 |
| | | */ |
| | | @Excel(name = "ä¼å
级") |
| | | @ApiModelProperty("ä¼å
级") |
| | | private String priority; |
| | | /** |
| | | * å®æåº¦ |
| | | */ |
| | | @Excel(name = "å®æåº¦") |
| | | @ApiModelProperty("å®æåº¦") |
| | | private Integer progress; |
| | | /** |
| | | * æ ç¾ |
| | | */ |
| | | @Excel(name = "æ ç¾") |
| | | @ApiModelProperty("æ ç¾") |
| | | @TableField(value = "tags",typeHandler = ListToStringTypeHandler.class,jdbcType = JdbcType.VARCHAR) |
| | | private List<String> tags; |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * ä¼è®®ç³è¯·è¡¨ |
| | | * @TableName meet_application |
| | | */ |
| | | @TableName(value ="meet_application") |
| | | @Data |
| | | public class MeetApplication implements Serializable { |
| | | /** |
| | | * ç³è¯·ID |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ä¼è®®ä¸»é¢ |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * ä¼è®®å®¤ID |
| | | */ |
| | | @TableField(value = "room_id") |
| | | private Long roomId; |
| | | |
| | | /** |
| | | * 主æäºº |
| | | */ |
| | | @TableField(value = "host") |
| | | private String host; |
| | | |
| | | /** |
| | | * ä¼è®®æ¥æ |
| | | */ |
| | | @TableField(value = "meeting_date") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate meetingDate; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @TableField(value = "start_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @TableField(value = "end_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | |
| | | /** |
| | | * åä¼äººåï¼JSONæ ¼å¼åå¨IDæ°ç»ï¼ |
| | | */ |
| | | @TableField(value = "participants") |
| | | private String participants; |
| | | |
| | | /** |
| | | * ä¼è®®è¯´æ |
| | | */ |
| | | @TableField(value = "description") |
| | | private String description; |
| | | |
| | | /** |
| | | * ç³è¯·ç±»åï¼approval:å®¡æ¹æµç¨, department:é¨é¨çº§, notification:éç¥åå¸ï¼ |
| | | */ |
| | | @TableField(value = "application_type") |
| | | private String applicationType; |
| | | |
| | | /** |
| | | * ç¶æï¼0:å¾
审æ¹, 1:å·²éè¿, 2:å·²æç», 3:å·²åæ¶ï¼ |
| | | */ |
| | | @TableField(value = "status") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * ç³è¯·äºº |
| | | */ |
| | | @TableField(value = "applicant") |
| | | private String applicant; |
| | | |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(value = "create_user" ,fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°è
|
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(value = "tenant_id",fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @TableField(value = "publish_status") |
| | | private Integer publishStatus; |
| | | |
| | | @TableField(value = "publish_comment") |
| | | private String publishComment; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * ä¼è®®è稿表 |
| | | * @TableName meet_draft |
| | | */ |
| | | @TableName(value ="meet_draft") |
| | | @Data |
| | | public class MeetDraft implements Serializable { |
| | | /** |
| | | * è稿ID |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ä¼è®®ç¼å· |
| | | */ |
| | | @TableField(value = "room_id") |
| | | private Long roomId; |
| | | |
| | | /** |
| | | * ä¼è®®ä¸»é¢ |
| | | */ |
| | | @TableField(value = "title") |
| | | @Excel(name = "ä¼è®®ä¸»é¢") |
| | | private String title; |
| | | |
| | | /** |
| | | * 主æäºº |
| | | */ |
| | | @TableField(value = "host") |
| | | @Excel(name = "主æäºº") |
| | | private String host; |
| | | |
| | | /** |
| | | * ä¼è®®æ¥æ |
| | | */ |
| | | @TableField(value = "meeting_date") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate meetingDate; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @TableField(value = "start_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @TableField(value = "end_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | |
| | | /** |
| | | * åä¼äººæ° |
| | | */ |
| | | @TableField(value = "participants") |
| | | @Excel(name = "åä¼äººæ°") |
| | | private Integer participants; |
| | | |
| | | /** |
| | | * åä¼äººåå表 |
| | | */ |
| | | @TableField(value = "participant_list") |
| | | private String participantList; |
| | | |
| | | /** |
| | | * ä¼è®®è¯´æ |
| | | */ |
| | | @TableField(value = "description") |
| | | private String description; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(value = "creator") |
| | | private String creator; |
| | | |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(value = "create_user" ,fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°è
|
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(value = "tenant_id",fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * ä¼è®®çºªè¦è¡¨ |
| | | * @TableName meeting_minutes |
| | | */ |
| | | @TableName(value ="meeting_minutes") |
| | | @Data |
| | | public class MeetingMinutes implements Serializable { |
| | | /** |
| | | * 纪è¦ID |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * å
³èçä¼è®®ID |
| | | */ |
| | | @TableField(value = "meeting_id") |
| | | private Long meetingId; |
| | | |
| | | /** |
| | | * çºªè¦æ é¢ |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 纪è¦å
容ï¼å¯ææ¬ï¼ |
| | | */ |
| | | @TableField(value = "content") |
| | | private String content; |
| | | |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(value = "create_user" ,fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°è
|
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(value = "tenant_id",fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ä¼è®®å®¤è¡¨ |
| | | * @TableName meeting_room |
| | | */ |
| | | @TableName(value ="meeting_room") |
| | | @Data |
| | | public class MeetingRoom implements Serializable { |
| | | /** |
| | | * ä¼è®®å®¤ID |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ä¼è®®å®¤åç§° |
| | | */ |
| | | @TableField(value = "name") |
| | | @Excel(name = "ä¼è®®å®¤åç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * ä½ç½® |
| | | */ |
| | | @TableField(value = "location") |
| | | @Excel(name = "ä½ç½®") |
| | | private String location; |
| | | |
| | | /** |
| | | * å®¹çº³äººæ° |
| | | */ |
| | | @TableField(value = "capacity") |
| | | @Excel(name = "容纳人æ°") |
| | | private Integer capacity; |
| | | |
| | | /** |
| | | * 设å¤é
ç½®ï¼éå·åéï¼ |
| | | */ |
| | | @TableField(value = "equipment") |
| | | @Excel(name = "设å¤é
ç½®") |
| | | private String equipment; |
| | | |
| | | /** |
| | | * ç¶æï¼1:å¯ç¨ 0:ç¦ç¨ï¼ |
| | | */ |
| | | @TableField(value = "status") |
| | | @Excel(name = "ç¶æ", readConverterExp = "1=å¯ç¨,0=ç¦ç¨") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @TableField(value = "remark") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(value = "create_user" ,fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°è
|
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(value = "tenant_id",fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å
¬å表 |
| | | * |
| | | */ |
| | | @Data |
| | | @TableName("notice") |
| | | @ApiModel |
| | | public class Notice { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * å
¬åæ é¢ |
| | | */ |
| | | @ApiModelProperty("å
¬åæ é¢") |
| | | private String title; |
| | | |
| | | /** |
| | | * å
¬åç±»åï¼1æ¾åéç¥ 2设å¤ç»´ä¿®éç¥ï¼ |
| | | */ |
| | | @ApiModelProperty("å
¬åç±»åï¼1æ¾åéç¥ 2设å¤ç»´ä¿®éç¥ï¼") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * ç¶æï¼0è稿 1åå¸ 2å·²ä¸çº¿ï¼ |
| | | */ |
| | | @ApiModelProperty("ç¶æï¼0è稿 1åå¸ 2å·²ä¸çº¿ï¼") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * å
¬åå
容 |
| | | */ |
| | | @ApiModelProperty("å
¬åå
容") |
| | | private String content; |
| | | |
| | | /** |
| | | * ä¼å
级(1æ®é 2éè¦ 3ç´§æ¥) |
| | | */ |
| | | @ApiModelProperty("ä¼å
级(1æ®é 2éè¦ 3ç´§æ¥)") |
| | | private Integer priority; |
| | | |
| | | /** |
| | | * è¿ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date expirationDate; |
| | | |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("reading_status") |
| | | public class ReadingStatus implements Serializable { |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * å¶åº¦id |
| | | */ |
| | | private Long ruleId; |
| | | /** |
| | | * åå·¥å§å |
| | | */ |
| | | private String employee; |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | private String department; |
| | | /** |
| | | * 确认æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime confirmTime; |
| | | /** |
| | | * é
è¯»ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.approve.utils.ListToStringTypeHandler; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.apache.ibatis.type.JdbcType; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @TableName(value = "rules_regulations_management") |
| | | public class RulesRegulationsManagement { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * å¶åº¦ç¼å· |
| | | */ |
| | | @ApiModelProperty("å¶åº¦ç¼å·") |
| | | @Excel(name = "å¶åº¦ç¼å·") |
| | | private String regulationNum; |
| | | |
| | | /** |
| | | * æ é¢ |
| | | */ |
| | | @ApiModelProperty("æ é¢") |
| | | @Excel(name = "æ é¢") |
| | | private String title; |
| | | /** |
| | | * å¶åº¦åç±» |
| | | */ |
| | | @ApiModelProperty("å¶åº¦åç±»") |
| | | @Excel(name = "å¶åº¦åç±»", readConverterExp = "finance=è´¢å¡å¶åº¦,hr=人äºå¶åº¦,safety=å®å
¨å¶åº¦,tech=ææ¯å¶åº¦") |
| | | private String category; |
| | | /** |
| | | * å¶åº¦å
容 |
| | | */ |
| | | @ApiModelProperty("å¶åº¦å
容") |
| | | private String content; |
| | | /** |
| | | * çææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime effectiveTime; |
| | | |
| | | /** |
| | | * éç¨èå´ |
| | | */ |
| | | @ApiModelProperty("éç¨èå´") |
| | | @TableField(value = "scope",typeHandler = ListToStringTypeHandler.class,jdbcType = JdbcType.VARCHAR) |
| | | private List<String> scope; |
| | | /** |
| | | * æ¯å¦éè¦ç¡®è®¤ |
| | | */ |
| | | @ApiModelProperty("æ¯å¦éè¦ç¡®è®¤") |
| | | private Boolean requireConfirm; |
| | | /** |
| | | * çæ¬ |
| | | */ |
| | | @ApiModelProperty("çæ¬") |
| | | @Excel(name = "çæ¬") |
| | | private String version; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @ApiModelProperty("ç¶æ") |
| | | @Excel(name = "ç¶æ", readConverterExp = "repealed=å·²åºæ¢,active=çæä¸") |
| | | private String status; |
| | | /** |
| | | * å·²è¯»äººæ° |
| | | */ |
| | | @ApiModelProperty("已读人æ°") |
| | | @Excel(name = "已读人æ°") |
| | | private Integer readCount; |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "å建æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * ä¿®æ¹äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("seal_application_management") |
| | | public class SealApplicationManagement { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * ç³è¯·ç¼å· |
| | | */ |
| | | @ApiModelProperty("ç³è¯·ç¼å·") |
| | | @Excel(name = "ç³è¯·ç¼å·") |
| | | private String applicationNum; |
| | | |
| | | /** |
| | | * å
¬åæ é¢ |
| | | */ |
| | | @ApiModelProperty("å
¬åæ é¢") |
| | | @Excel(name = "ç³è¯·æ é¢") |
| | | private String title; |
| | | /** |
| | | * ç¨å°ç±»å |
| | | */ |
| | | @ApiModelProperty("ç¨å°ç±»å") |
| | | @Excel(name = "ç¨å°ç±»å", readConverterExp = "official=å
¬ç« ,contract=ååä¸ç¨ç« ,finance=è´¢å¡ä¸ç¨ç« ,legal=æªç¥") |
| | | private String sealType; |
| | | /** |
| | | * ç³è¯·ç¨å°åå |
| | | */ |
| | | @ApiModelProperty("ç³è¯·ç¨å°åå ") |
| | | private String reason; |
| | | |
| | | /** |
| | | * ç´§æ¥ç¨åº¦ |
| | | */ |
| | | @ApiModelProperty("ç´§æ¥ç¨åº¦") |
| | | private String urgency; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @ApiModelProperty("ç¶æ") |
| | | @Excel(name = "ç¶æ", readConverterExp = "pending=å¾
审æ¹,approved=å·²éè¿,rejected=å·²æç»") |
| | | private String status; |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @TableName("staff_contacts_personal") |
| | | @Data |
| | | public class StaffContactsPersonal { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | // /** |
| | | // * ç¨æ·IDï¼æå±è
ï¼ |
| | | // */ |
| | | // @ApiModelProperty("ç¨æ·IDï¼æå±è
ï¼") |
| | | // private Integer userId; |
| | | |
| | | /** |
| | | * åå·¥ID |
| | | */ |
| | | @ApiModelProperty("åå·¥ID") |
| | | private Integer contactId; |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.DutyPlanDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.DutyPlan; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface DutyPlanService extends IService<DutyPlan> { |
| | | IPage listPage(Page page, DutyPlanDTO dutyPlanDTO); |
| | | |
| | | List<Map<String, Object>> getNum(); |
| | | |
| | | void exportData(HttpServletResponse response, DutyPlanDTO dutyPlan); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetSummaryDto; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetUseDto; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetingSimpleDto; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetApplication; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetDraft; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingMinutes; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingRoom; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingApplicationVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingDraftVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingRoomVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingUseVo; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MeetingService extends IService<MeetingRoom> { |
| | | //****************ä¼è®®å®¤******************************** |
| | | IPage<MeetingRoom> getMeetingRoomList(SearchMeetingRoomVo vo); |
| | | |
| | | void saveMeetRoom(MeetingRoom meetingRoom); |
| | | |
| | | MeetingRoom findMeetRoomById(Long id); |
| | | |
| | | void deleteMeetingRoom(Long id); |
| | | |
| | | List<MeetingRoom> getRoomEnum(); |
| | | |
| | | |
| | | |
| | | //***************è稿******************************** |
| | | |
| | | IPage<MeetDraft> getMeetingDraftList(SearchMeetingDraftVo vo); |
| | | |
| | | void saveMeetDraft(MeetDraft meetDraft); |
| | | |
| | | void deleteMeetingDraft(Long id); |
| | | |
| | | // ************ç³è¯·ä¼è®®************ |
| | | |
| | | void saveMeetApplication(MeetApplication meetApplication); |
| | | |
| | | // ************ç³è¯·å®¡æ¹************ |
| | | |
| | | IPage<MeetApplication> getMeetingApplicationList(SearchMeetingApplicationVo vo); |
| | | |
| | | |
| | | |
| | | // ****************ä¼è®®ä½¿ç¨æ¥è¯¢******************************** |
| | | |
| | | /** |
| | | * ä¼è®®ä½¿ç¨æ¸
å |
| | | */ |
| | | List<MeetUseDto> meetingUseList(SearchMeetingUseVo vo); |
| | | |
| | | // ****************ä¼è®®åå¸******************************** |
| | | IPage<MeetApplication> getMeetingPublishList(SearchMeetingApplicationVo vo); |
| | | |
| | | |
| | | // ****************ä¼è®®çºªè¦******************************** |
| | | MeetingMinutes getMeetingMinutesById(Long id); |
| | | |
| | | void saveMeetingMinutes(MeetingMinutes meetingMinutes); |
| | | |
| | | MeetSummaryDto getMeetSummary(); |
| | | |
| | | |
| | | List<MeetingSimpleDto> getMeetSummaryItems(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.NoticeDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.Notice; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface NoticeService extends IService<Notice> { |
| | | |
| | | IPage<NoticeDTO> listPage(Page page, NoticeDTO noticeDTO); |
| | | |
| | | List<NoticeDTO> selectCount(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.RulesRegulationsManagementDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; |
| | | |
| | | public interface RulesRegulationsManagementService extends IService<RulesRegulationsManagement> { |
| | | IPage<RulesRegulationsManagementDTO> listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.pojo.SealApplicationManagement; |
| | | |
| | | public interface SealApplicationManagementService extends IService<SealApplicationManagement> { |
| | | IPage listPage(Page page, SealApplicationManagement sealApplicationManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.StaffContactsPersonalDTO; |
| | | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; |
| | | |
| | | public interface StaffContactsPersonalService extends IService<StaffContactsPersonal> { |
| | | IPage listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | 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.collaborativeApproval.dto.DutyPlanDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.DutyPlanMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.DutyPlan; |
| | | import com.ruoyi.collaborativeApproval.service.DutyPlanService; |
| | | 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; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class DutyPlanServiceImpl extends ServiceImpl<DutyPlanMapper, DutyPlan> implements DutyPlanService { |
| | | @Autowired |
| | | private DutyPlanMapper dutyPlanMapper; |
| | | |
| | | @Override |
| | | public IPage listPage(Page page, DutyPlanDTO dutyPlanDTO) { |
| | | return dutyPlanMapper.listPage(page, dutyPlanDTO); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getNum() { |
| | | |
| | | return dutyPlanMapper.getNum(); |
| | | } |
| | | |
| | | @Override |
| | | public void exportData(HttpServletResponse response, DutyPlanDTO dutyPlanDTO) { |
| | | IPage<DutyPlanDTO> dutyPlans = dutyPlanMapper.listPage(new Page<>(-1, -1), dutyPlanDTO); |
| | | List<DutyPlanDTO> records = dutyPlans.getRecords(); |
| | | ExcelUtil<DutyPlanDTO> util = new ExcelUtil<>(DutyPlanDTO.class); |
| | | util.exportExcel(response, records, "计å导åº"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | 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.github.xiaoymin.knife4j.core.util.StrUtil; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetSummaryDto; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetUseDto; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetingItem; |
| | | import com.ruoyi.collaborativeApproval.dto.MeetingSimpleDto; |
| | | import com.ruoyi.collaborativeApproval.mapper.MeetApplicationMapper; |
| | | import com.ruoyi.collaborativeApproval.mapper.MeetDraftMapper; |
| | | import com.ruoyi.collaborativeApproval.mapper.MeetingMinutesMapper; |
| | | import com.ruoyi.collaborativeApproval.mapper.MeetingRoomMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetApplication; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetDraft; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingMinutes; |
| | | import com.ruoyi.collaborativeApproval.pojo.MeetingRoom; |
| | | import com.ruoyi.collaborativeApproval.service.MeetingService; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingApplicationVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingDraftVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingRoomVo; |
| | | import com.ruoyi.collaborativeApproval.vo.SearchMeetingUseVo; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MeetingServiceImpl extends ServiceImpl<MeetingRoomMapper, MeetingRoom> implements MeetingService { |
| | | private final MeetingRoomMapper meetingRoomMapper; |
| | | |
| | | private final MeetDraftMapper meetDraftMapper; |
| | | |
| | | private final MeetApplicationMapper meetApplicationMapper; |
| | | |
| | | private final MeetingMinutesMapper meetingMinutesMapper; |
| | | |
| | | @Override |
| | | public IPage<MeetingRoom> getMeetingRoomList(SearchMeetingRoomVo vo) { |
| | | LambdaQueryWrapper<MeetingRoom> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (StrUtil.isNotBlank(vo.getName())) { |
| | | queryWrapper.like(MeetingRoom::getName, vo.getName()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getLocation())) { |
| | | queryWrapper.like(MeetingRoom::getLocation, vo.getLocation()); |
| | | } |
| | | queryWrapper.orderByDesc(MeetingRoom::getId); |
| | | return meetingRoomMapper.selectPage(new Page<MeetingRoom>(vo.getCurrent(), vo.getSize()), queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void saveMeetRoom(MeetingRoom meetingRoom) { |
| | | if (meetingRoom.getId() != null) { |
| | | meetingRoomMapper.updateById(meetingRoom); |
| | | } else { |
| | | meetingRoomMapper.insert(meetingRoom); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public MeetingRoom findMeetRoomById(Long id) { |
| | | return meetingRoomMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteMeetingRoom(Long id) { |
| | | meetingRoomMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<MeetingRoom> getRoomEnum() { |
| | | LambdaQueryWrapper<MeetingRoom> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.select(MeetingRoom::getName, MeetingRoom::getId, MeetingRoom::getLocation); |
| | | queryWrapper.eq(MeetingRoom::getStatus, 1); |
| | | queryWrapper.orderByDesc(MeetingRoom::getId); |
| | | return meetingRoomMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MeetDraft> getMeetingDraftList(SearchMeetingDraftVo vo) { |
| | | |
| | | LambdaQueryWrapper<MeetDraft> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (StrUtil.isNotBlank(vo.getTitle())) { |
| | | queryWrapper.like(MeetDraft::getTitle, vo.getTitle()); |
| | | } |
| | | if (Objects.nonNull(vo.getMeetingDate())) { |
| | | queryWrapper.eq(MeetDraft::getMeetingDate, vo.getMeetingDate()); |
| | | } |
| | | |
| | | queryWrapper.orderByDesc(MeetDraft::getId); |
| | | |
| | | return meetDraftMapper.selectPage(new Page<>(vo.getCurrent(), vo.getSize()), queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void saveMeetDraft(MeetDraft meetDraft) { |
| | | if (meetDraft.getId() != null) { |
| | | meetDraftMapper.updateById(meetDraft); |
| | | } else { |
| | | meetDraftMapper.insert(meetDraft); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteMeetingDraft(Long id) { |
| | | meetDraftMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void saveMeetApplication(MeetApplication meetApplication) { |
| | | meetApplication.setApplicant(SecurityUtils.getUsername()); |
| | | if (meetApplication.getId() != null) { |
| | | meetApplicationMapper.updateById(meetApplication); |
| | | } else { |
| | | meetApplicationMapper.insert(meetApplication); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MeetApplication> getMeetingApplicationList(SearchMeetingApplicationVo vo) { |
| | | LambdaQueryWrapper<MeetApplication> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(MeetApplication::getApplicationType, "approval", "department"); |
| | | if (StrUtil.isNotBlank(vo.getTitle())) { |
| | | queryWrapper.like(MeetApplication::getTitle, vo.getTitle()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getApplicant())) { |
| | | queryWrapper.like(MeetApplication::getApplicant, vo.getApplicant()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getStatus())) { |
| | | queryWrapper.eq(MeetApplication::getStatus, vo.getStatus()); |
| | | } |
| | | queryWrapper.orderByDesc(MeetApplication::getId); |
| | | return meetApplicationMapper.selectPage(new Page<>(vo.getCurrent(), vo.getSize()), queryWrapper); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<MeetUseDto> meetingUseList(SearchMeetingUseVo vo) { |
| | | // æ¥è¯¢ä¼è®®å表 |
| | | LambdaQueryWrapper<MeetApplication> alWrapper = new LambdaQueryWrapper<>(); |
| | | alWrapper.and(wrapper -> { |
| | | wrapper.eq(MeetApplication::getStatus, 1) |
| | | .or() |
| | | .eq(MeetApplication::getApplicationType, "notification"); |
| | | }); |
| | | if (Objects.nonNull(vo.getMeetingDate())) { |
| | | alWrapper.and(wrapper -> { |
| | | wrapper.eq(MeetApplication::getMeetingDate, vo.getMeetingDate()); |
| | | }); |
| | | } |
| | | alWrapper.orderByAsc(MeetApplication::getStartTime); |
| | | List<MeetApplication> meetApplicationList = meetApplicationMapper.selectList(alWrapper); |
| | | |
| | | // æ ¹æ® roomId è¿è¡åç» |
| | | Map<Long, List<MeetApplication>> roomGroup = meetApplicationList.stream().collect(Collectors.groupingBy(MeetApplication::getRoomId)); |
| | | // æ¥è¯¢roomä¿¡æ¯ |
| | | List<MeetingRoom> roomList = meetingRoomMapper.selectList(new LambdaUpdateWrapper<MeetingRoom>().orderByAsc(MeetingRoom::getId)); |
| | | |
| | | List<MeetUseDto> meetUseDtoList = new ArrayList<>(); |
| | | |
| | | roomList.forEach(r -> { |
| | | MeetUseDto dto = new MeetUseDto(); |
| | | MeetingRoom meetingRoom = roomList.stream().filter(room -> room.getId().equals(r.getId())).findFirst().orElse(new MeetingRoom()); |
| | | dto.setId(meetingRoom.getId()); |
| | | dto.setName(meetingRoom.getName()); |
| | | List<MeetingItem> collect = roomGroup.getOrDefault(r.getId(), new ArrayList<>()).stream().map(it -> { |
| | | MeetingItem item = new MeetingItem(); |
| | | item.setId(it.getId()); |
| | | item.setHost(it.getHost()); |
| | | item.setStatus(1); |
| | | item.setTitle(it.getTitle()); |
| | | item.setStartTime(it.getStartTime().format(DateTimeFormatter.ofPattern("HH:mm"))); |
| | | item.setEndTime(it.getEndTime().format(DateTimeFormatter.ofPattern("HH:mm"))); |
| | | item.setTime(item.getStartTime() + "ï½" + item.getEndTime()); |
| | | item.setParticipants(it.getParticipants().split(",").length); |
| | | item.setDescription(it.getDescription()); |
| | | item.setRoom(meetingRoom.getName() + "(" + meetingRoom.getLocation() + ")"); |
| | | return item; |
| | | }).collect(Collectors.toList()); |
| | | dto.setMeetings(collect); |
| | | meetUseDtoList.add(dto); |
| | | }); |
| | | return meetUseDtoList; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MeetApplication> getMeetingPublishList(SearchMeetingApplicationVo vo) { |
| | | LambdaQueryWrapper<MeetApplication> queryWrapper = new LambdaQueryWrapper<>(); |
| | | if (StrUtil.isNotBlank(vo.getTitle())) { |
| | | queryWrapper.like(MeetApplication::getTitle, vo.getTitle()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getApplicant())) { |
| | | queryWrapper.like(MeetApplication::getApplicant, vo.getApplicant()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getStatus())) { |
| | | queryWrapper.eq(MeetApplication::getPublishStatus, vo.getStatus()); |
| | | } |
| | | queryWrapper.and(wrapper -> { |
| | | wrapper.eq(MeetApplication::getStatus, 1) |
| | | .or() |
| | | .eq(MeetApplication::getApplicationType, "notification"); |
| | | }); |
| | | queryWrapper.orderByDesc(MeetApplication::getId); |
| | | return meetApplicationMapper.selectPage(new Page<>(vo.getCurrent(), vo.getSize()), queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public MeetingMinutes getMeetingMinutesById(Long id) { |
| | | return meetingMinutesMapper.selectOne(new LambdaUpdateWrapper<MeetingMinutes>().eq(MeetingMinutes::getMeetingId,id)); |
| | | } |
| | | |
| | | @Override |
| | | public void saveMeetingMinutes(MeetingMinutes meetingMinutes) { |
| | | if (meetingMinutes.getId() != null){ |
| | | meetingMinutesMapper.updateById(meetingMinutes); |
| | | }else { |
| | | meetingMinutesMapper.insert(meetingMinutes); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public MeetSummaryDto getMeetSummary() { |
| | | return meetApplicationMapper.getMeetSummary(); |
| | | } |
| | | |
| | | @Override |
| | | public List<MeetingSimpleDto> getMeetSummaryItems() { |
| | | return meetApplicationMapper.getMeetSummaryItems(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.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.collaborativeApproval.dto.NoticeDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.NoticeMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.Notice; |
| | | import com.ruoyi.collaborativeApproval.service.NoticeService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | @AllArgsConstructor |
| | | public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService { |
| | | |
| | | private final NoticeMapper noticeMapper; |
| | | |
| | | @Override |
| | | public IPage<NoticeDTO> listPage(Page page, NoticeDTO noticeDTO) { |
| | | IPage<NoticeDTO> noticeDTOIPage = noticeMapper.listPage(page, noticeDTO); |
| | | noticeDTOIPage.getRecords().forEach(item -> { |
| | | // æ ¹æ®è¿ææ¶é´å¤æstatusName |
| | | if (item.getExpirationDate() == null) { |
| | | item.setStatusName("æªç¥"); |
| | | }else if(item.getExpirationDate().getTime() < System.currentTimeMillis()){ |
| | | item.setStatusName("å·²è¿æ"); |
| | | } else{ |
| | | item.setStatusName("æ£å¸¸"); |
| | | } |
| | | }); |
| | | return noticeDTOIPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<NoticeDTO> selectCount() { |
| | | List<NoticeDTO> result = new ArrayList<>(); |
| | | NoticeDTO notice = new NoticeDTO(); |
| | | notice.setType(1); |
| | | notice.setCount(noticeMapper.selectCount(new LambdaQueryWrapper<Notice>().eq(Notice::getType, 1))); |
| | | result.add(notice); |
| | | |
| | | NoticeDTO notice1 = new NoticeDTO(); |
| | | notice1.setType(2); |
| | | notice1.setCount(noticeMapper.selectCount(new LambdaQueryWrapper<Notice>().eq(Notice::getType, 2))); |
| | | result.add(notice1); |
| | | |
| | | return result; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | 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.collaborativeApproval.dto.RulesRegulationsManagementDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.RulesRegulationsManagementMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; |
| | | import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class RulesRegulationsManagementServiceImpl extends ServiceImpl<RulesRegulationsManagementMapper, RulesRegulationsManagement> implements RulesRegulationsManagementService { |
| | | @Autowired |
| | | private RulesRegulationsManagementMapper rulesRegulationsManagementMapper; |
| | | @Override |
| | | public IPage<RulesRegulationsManagementDTO> listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement) { |
| | | return rulesRegulationsManagementMapper.listPage(page, rulesRegulationsManagement); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | 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.collaborativeApproval.dto.SealApplicationManagementDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.SealApplicationManagementMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; |
| | | import com.ruoyi.collaborativeApproval.service.SealApplicationManagementService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SealApplicationManagementServiceImpl extends ServiceImpl<SealApplicationManagementMapper, SealApplicationManagement> implements SealApplicationManagementService { |
| | | @Autowired |
| | | private SealApplicationManagementMapper sealApplicationManagementMapper; |
| | | |
| | | @Override |
| | | public IPage<SealApplicationManagementDTO> listPage(Page page, SealApplicationManagement sealApplicationManagement) { |
| | | return sealApplicationManagementMapper.listPage(page, sealApplicationManagement); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.collaborativeApproval.dto.StaffContactsPersonalDTO; |
| | | import com.ruoyi.collaborativeApproval.mapper.StaffContactsPersonalMapper; |
| | | import com.ruoyi.collaborativeApproval.pojo.StaffContactsPersonal; |
| | | import com.ruoyi.collaborativeApproval.service.StaffContactsPersonalService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class StaffContactsPersonalServiceImpl extends ServiceImpl<StaffContactsPersonalMapper, StaffContactsPersonal> implements StaffContactsPersonalService { |
| | | @Autowired |
| | | private StaffContactsPersonalMapper staffContactsPersonalMapper; |
| | | @Override |
| | | public IPage listPage(Page page, StaffContactsPersonalDTO staffContactsPersonalDTO) { |
| | | return staffContactsPersonalMapper.listPage(page, staffContactsPersonalDTO); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.vo; |
| | | |
| | | import com.ruoyi.dto.PageDto; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/16 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class SearchMeetingApplicationVo extends PageDto { |
| | | private String title; |
| | | private String applicant; |
| | | private String status; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.dto.PageDto; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/15 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class SearchMeetingDraftVo extends PageDto { |
| | | private String title; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date meetingDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.vo; |
| | | |
| | | import com.ruoyi.dto.PageDto; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/15 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SearchMeetingRoomVo extends PageDto { |
| | | |
| | | private String name; |
| | | private String location; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.collaborativeApproval.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/16 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class SearchMeetingUseVo { |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date meetingDate; |
| | | } |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | |
| | | public enum FileNameType { |
| | | |
| | | SALE(1), // éå® |
| | |
| | | PURCHASELEDGER(4), |
| | | MEASURING(5), //计éå¨å
·å°è´¦ |
| | | MEASURINGRecord(6),//计éå¨å
·å°è´¦è®°å½ |
| | | ApproveNode(7); //åå审æ¹å®¡æ ¸ |
| | | ApproveNode(7), //åå审æ¹èç¹å®¡æ ¸ |
| | | ApproveProcess(8); //åå审æ¹ä¸»æ°æ® |
| | | |
| | | private final int value; |
| | | |
| | |
| | | @AllArgsConstructor |
| | | public enum StorageAttachmentRecordType { |
| | | // ä¾å å®é
å¼å请å é¤ |
| | | Template("Template","èä¾"); |
| | | Template("Template","èä¾"), |
| | | Archives("Archives","ææ¡£ç®¡ç"), |
| | | InspectionTasks("InspectionTasks","ç产巡æ£"), |
| | | QrCodeScanRecords("QrCodeScanRecords","äºç»´ç æ«ç è®°å½æä»¶"); |
| | | |
| | | |
| | | private final String code; |
| | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * çæé¢è§URL |
| | | * @param bucketFilename æä»¶å¨MinIOä¸çå¯ä¸æ è¯ |
| | | * @param bucketName å卿¡¶åç§° |
| | | * @param useDefaultExpiry æ¯å¦ä½¿ç¨é»è®¤è¿ææ¶é´ï¼true=使ç¨é»è®¤è¿ææ¶é´ï¼false=æ°¸ä¹
ææï¼ |
| | | * @return é¢è§URL |
| | | */ |
| | | public String getPreviewUrls(String bucketFilename, String bucketName, boolean useDefaultExpiry) { |
| | | if (StringUtils.isBlank(bucketFilename)) { |
| | | return null; |
| | | } |
| | | |
| | | try { |
| | | // éªè¯æä»¶å卿§ |
| | | minioClient.statObject(StatObjectArgs.builder() |
| | | .bucket(bucketName) |
| | | .object(bucketFilename) |
| | | .build()); |
| | | |
| | | GetPresignedObjectUrlArgs.Builder builder = GetPresignedObjectUrlArgs.builder() |
| | | .method(Method.GET) |
| | | .bucket(bucketName) |
| | | .object(bucketFilename); |
| | | |
| | | // è®¾ç½®è¿ææ¶é´ï¼useDefaultExpiry=true 使ç¨é
ç½®çè¿ææ¶é´ |
| | | if (useDefaultExpiry) { |
| | | builder.expiry(previewExpiry, TimeUnit.HOURS); |
| | | } |
| | | |
| | | return minioClient.getPresignedObjectUrl(builder.build()); |
| | | } catch (Exception e) { |
| | | throw new UtilException("çæé¢è§URL失败: " + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * çæä¸è½½URLï¼å¼ºå¶æµè§å¨ä¸è½½ï¼ |
| | | * @param bucketFilename æä»¶å¨MinIOä¸çå¯ä¸æ è¯ |
| | | * @param bucketName å卿¡¶åç§° |
| | | * @param originalFileName åå§æä»¶åï¼ç¨äºä¸è½½æ¶æ¾ç¤ºï¼ |
| | | * @param useDefaultExpiry æ¯å¦ä½¿ç¨é»è®¤è¿ææ¶é´ï¼true=使ç¨é»è®¤ï¼false=æ è¿ææ¶é´ï¼ |
| | | * @return ä¸è½½URL |
| | | */ |
| | | public String getDownloadUrls(String bucketFilename, String bucketName, String originalFileName, boolean useDefaultExpiry) { |
| | | if (StringUtils.isBlank(bucketFilename)) { |
| | | return null; |
| | | } |
| | | |
| | | try { |
| | | // éªè¯æä»¶å卿§ |
| | | minioClient.statObject(StatObjectArgs.builder() |
| | | .bucket(bucketName) |
| | | .object(bucketFilename) |
| | | .build()); |
| | | |
| | | // æ£ç¡®ç¼ç æä»¶åï¼æ¿æ¢ + 为 %20 |
| | | String encodedFileName = URLEncoder.encode(originalFileName, String.valueOf(StandardCharsets.UTF_8)) |
| | | .replace("+", "%20"); |
| | | |
| | | Map<String, String> reqParams = new HashMap<>(); |
| | | reqParams.put("response-content-disposition", |
| | | "attachment; filename=\"" + encodedFileName + "\""); |
| | | |
| | | GetPresignedObjectUrlArgs.Builder builder = GetPresignedObjectUrlArgs.builder() |
| | | .method(Method.GET) |
| | | .bucket(bucketName) |
| | | .object(bucketFilename) |
| | | .extraQueryParams(reqParams); |
| | | |
| | | // æ ¹æ®åæ°å³å®æ¯å¦è®¾ç½®è¿ææ¶é´ |
| | | if (useDefaultExpiry) { |
| | | // 使ç¨é»è®¤è¿ææ¶é´ï¼ä»é
置读åï¼ |
| | | builder.expiry(previewExpiry, TimeUnit.HOURS); |
| | | } else { |
| | | // ä¸è®¾ç½®è¿ææ¶é´ï¼MinIO é»è®¤7å¤©ï¼ |
| | | } |
| | | return minioClient.getPresignedObjectUrl(builder.build()); |
| | | } catch (Exception e) { |
| | | throw new UtilException("çæä¸è½½URL失败: " + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | public String getDownloadUrl(String bucketFileName, String bucketName) { |
| | | if (StringUtils.isNotBlank(bucketFileName)) { |
| | | try { |
| | | // æ£æ¥æä»¶æ¯å¦åå¨ |
| | | minioClient.statObject(StatObjectArgs.builder() |
| | | .bucket(bucketName) |
| | | .object(bucketFileName) |
| | | .build()); |
| | | |
| | | // 设置ååºå¤´ |
| | | Map<String, String> reqParams = new HashMap<>(); |
| | | // æååå§æä»¶åï¼å¦æå卿¶ä¿çäºåå§åç§°ï¼ |
| | | String originalFileName = extractOriginalFileName(bucketFileName); |
| | | reqParams.put("response-content-disposition", |
| | | "attachment; filename=\"" + URLEncoder.encode(originalFileName, String.valueOf(StandardCharsets.UTF_8)) + "\""); |
| | | |
| | | // æå»ºé¢ç¾åURLåæ° |
| | | GetPresignedObjectUrlArgs args = GetPresignedObjectUrlArgs.builder() |
| | | .method(Method.GET) |
| | | .bucket(bucketName) |
| | | .object(bucketFileName) |
| | | .expiry(previewExpiry, TimeUnit.HOURS) |
| | | .extraQueryParams(reqParams) |
| | | .build(); |
| | | |
| | | return minioClient.getPresignedObjectUrl(args); |
| | | } catch (Exception e) { |
| | | throw new UtilException("MinioUtilsï¼çæä¸è½½é¾æ¥å¼å¸¸", e); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private String extractOriginalFileName(String bucketFileName) { |
| | | // 示ä¾ï¼å¦æå卿 ¼å¼ä¸º "åå§æä»¶å_UUID" |
| | | int underscoreIndex = bucketFileName.lastIndexOf("_"); |
| | | if (underscoreIndex > 0) { |
| | | return bucketFileName.substring(0, underscoreIndex); |
| | | } |
| | | // å¦ææ²¡æç¹æ®æ ¼å¼ï¼ç´æ¥è¿å宿´æä»¶å |
| | | return bucketFileName; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 15:31 |
| | | */ |
| | | public class OrderUtils { |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢å½å¤©ï¼åºäºcreateTimeåæ®µï¼çè®°å½æ°é |
| | | * @param mapper å®ä½ç±»å¯¹åºçBaseMapper |
| | | * @param <T> å®ä½ç±»æ³å |
| | | * @return å½å¤©è®°å½æ°é |
| | | */ |
| | | public static <T> String countTodayByCreateTime(BaseMapper<T> mapper,String preFix) { |
| | | // è·åå½å¤©å¼å§æ¶é´ï¼00:00:00ï¼ |
| | | LocalDateTime todayStart = LocalDateTime.of( |
| | | LocalDateTime.now().toLocalDate(), |
| | | LocalTime.MIN |
| | | ); |
| | | // è·åå½å¤©ç»ææ¶é´ï¼23:59:59.999ï¼ |
| | | LocalDateTime todayEnd = LocalDateTime.of( |
| | | LocalDateTime.now().toLocalDate(), |
| | | LocalTime.MAX |
| | | ); |
| | | |
| | | // 转æ¢ä¸ºDateç±»åï¼å¦æå®ä½ç±»ä¸createTimeæ¯LocalDateTimeå¯ç´æ¥ä½¿ç¨ï¼ |
| | | Date startDate = Date.from(todayStart.atZone(ZoneId.systemDefault()).toInstant()); |
| | | Date endDate = Date.from(todayEnd.atZone(ZoneId.systemDefault()).toInstant()); |
| | | |
| | | // æå»ºæ¥è¯¢æ¡ä»¶ |
| | | QueryWrapper<T> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.ge("create_time", startDate) // 大äºçäºå½å¤©å¼å§ |
| | | .lt("create_time", endDate); // å°äºå½å¤©ç»æï¼é¿å
毫ç§ç²¾åº¦é®é¢ï¼ |
| | | |
| | | // æ§è¡æ¥è¯¢ |
| | | Long aLong = mapper.selectCount(queryWrapper); |
| | | // æ¼æ¥è®¢åç¼å· preFix + æ¶é´ï¼yyyyMMddï¼ + è®¢åæ°é(001) |
| | | return preFix + LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE).replaceAll("-", "") + String.format("%03d", (aLong + 1));} |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.excel; |
| | | |
| | | import com.alibaba.excel.metadata.Head; |
| | | import com.alibaba.excel.write.merge.AbstractMergeStrategy; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class ConfigurableMergeStrategy extends AbstractMergeStrategy { |
| | | private final List<CellRangeAddress> mergeRegions; |
| | | |
| | | public ConfigurableMergeStrategy(List<CellRangeAddress> mergeRegions) { |
| | | this.mergeRegions = mergeRegions; |
| | | } |
| | | |
| | | @Override |
| | | protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) { |
| | | // æ£æ¥å½ååå
æ ¼æ¯å¦å¨ä»»ä½ä¸ä¸ªåå¹¶åºåå
|
| | | for (CellRangeAddress region : mergeRegions) { |
| | | if (cell.getRowIndex() == region.getFirstRow() && |
| | | cell.getColumnIndex() == region.getFirstColumn()) { |
| | | sheet.addMergedRegion(region); // æ§è¡åå¹¶ |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.excel; |
| | | |
| | | import com.alibaba.excel.metadata.Head; |
| | | import com.alibaba.excel.metadata.data.WriteCellData; |
| | | import com.alibaba.excel.write.handler.CellWriteHandler; |
| | | import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
| | | import com.alibaba.excel.write.metadata.holder.WriteTableHolder; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class CustomCellStyleHandler implements CellWriteHandler { |
| | | |
| | | @Override |
| | | public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List<WriteCellData<?>> list, Cell cell, Head head, Integer integer, Boolean aBoolean) { |
| | | int row = cell.getRowIndex(); |
| | | int col = cell.getColumnIndex(); |
| | | |
| | | // éè¦æé¤çåå
æ ¼ |
| | | if ((row == 2 && col == 0) || (row == 10 && col == 0)) { |
| | | return; |
| | | } |
| | | |
| | | // 为å
¶ä»åå
æ ¼è®¾ç½®æ ·å¼ï¼å±
ä¸+èªå¨æ¢è¡ï¼ |
| | | Workbook workbook = writeSheetHolder.getSheet().getWorkbook(); |
| | | CellStyle style = workbook.createCellStyle(); |
| | | style.setAlignment(HorizontalAlignment.CENTER); |
| | | style.setVerticalAlignment(VerticalAlignment.CENTER); |
| | | style.setWrapText(true); |
| | | cell.setCellStyle(style); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.excel; |
| | | |
| | | import java.util.LinkedHashMap; |
| | | |
| | | /** |
| | | * @author sunnyzyq |
| | | * @date 2021/12/17 |
| | | */ |
| | | public class ExcelClassField { |
| | | |
| | | /** åæ®µåç§° */ |
| | | private String fieldName; |
| | | |
| | | /** 表头åç§° */ |
| | | private String name; |
| | | |
| | | /** æ å°å
³ç³» */ |
| | | private LinkedHashMap<String, String> kvMap; |
| | | |
| | | /** 示ä¾å¼ */ |
| | | private Object example; |
| | | |
| | | /** æåº */ |
| | | private int sort; |
| | | |
| | | /** æ¯å¦ä¸ºæ³¨è§£å段ï¼0-å¦ï¼1-æ¯ */ |
| | | private int hasAnnotation; |
| | | |
| | | public String getFieldName() { |
| | | return fieldName; |
| | | } |
| | | |
| | | public void setFieldName(String fieldName) { |
| | | this.fieldName = fieldName; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public LinkedHashMap<String, String> getKvMap() { |
| | | return kvMap; |
| | | } |
| | | |
| | | public void setKvMap(LinkedHashMap<String, String> kvMap) { |
| | | this.kvMap = kvMap; |
| | | } |
| | | |
| | | public Object getExample() { |
| | | return example; |
| | | } |
| | | |
| | | public void setExample(Object example) { |
| | | this.example = example; |
| | | } |
| | | |
| | | public int getSort() { |
| | | return sort; |
| | | } |
| | | |
| | | public void setSort(int sort) { |
| | | this.sort = sort; |
| | | } |
| | | |
| | | public int getHasAnnotation() { |
| | | return hasAnnotation; |
| | | } |
| | | |
| | | public void setHasAnnotation(int hasAnnotation) { |
| | | this.hasAnnotation = hasAnnotation; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.excel; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * @author sunnyzyq |
| | | * @date 2021/12/17 |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface ExcelExport { |
| | | |
| | | /** åæ®µåç§° */ |
| | | String value(); |
| | | |
| | | /** å¯¼åºæåºå
å: æ°åè¶å°è¶é åï¼é»è®¤æJavaç±»åæ®µé¡ºåºå¯¼åºï¼ */ |
| | | int sort() default 0; |
| | | |
| | | /** å¯¼åºæ å°ï¼æ ¼å¼å¦ï¼0-æªç¥;1-ç·;2-女 */ |
| | | String kv() default ""; |
| | | |
| | | /** å¯¼åºæ¨¡æ¿ç¤ºä¾å¼ï¼æå¼çè¯ï¼ç´æ¥å该å¼ï¼ä¸åæ å°ï¼ */ |
| | | String example() default ""; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.excel; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | /** |
| | | * @author sunnyzyq |
| | | * @date 2021/12/17 |
| | | */ |
| | | @Target(ElementType.FIELD) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface ExcelImport { |
| | | |
| | | /** åæ®µåç§° */ |
| | | String value(); |
| | | |
| | | /** å¯¼åºæ å°ï¼æ ¼å¼å¦ï¼0-æªç¥;1-ç·;2-女 */ |
| | | String kv() default ""; |
| | | |
| | | /** æ¯å¦ä¸ºå¿
å¡«åæ®µï¼é»è®¤ä¸ºéå¿
å¡«ï¼ */ |
| | | boolean required() default false; |
| | | |
| | | /** æå¤§é¿åº¦ï¼é»è®¤255ï¼ */ |
| | | int maxLength() default 255; |
| | | |
| | | /** 导å
¥å¯ä¸æ§éªè¯ï¼å¤ä¸ªå段ååèåéªè¯ï¼ */ |
| | | boolean unique() default false; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils.excel; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.apache.poi.hssf.usermodel.HSSFDataValidation; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.poifs.filesystem.POIFSFileSystem; |
| | | import org.apache.poi.ss.usermodel.*; |
| | | import org.apache.poi.ss.usermodel.ClientAnchor.AnchorType; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | import org.apache.poi.xssf.streaming.SXSSFWorkbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFClientAnchor; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URL; |
| | | import java.text.NumberFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.Map.Entry; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * Excel导å
¥å¯¼åºå·¥å
·ç±» |
| | | * åæé¾æ¥ï¼ä¸å®æ¶å¢å æ°åè½ï¼: https://zyqok.blog.csdn.net/article/details/121994504 |
| | | * |
| | | * @author sunnyzyq |
| | | * @date 2021/12/17 |
| | | */ |
| | | @SuppressWarnings("unused") |
| | | public class ExcelUtils { |
| | | |
| | | private static final String XLSX = ".xlsx"; |
| | | private static final String XLS = ".xls"; |
| | | public static final String ROW_MERGE = "row_merge"; |
| | | public static final String COLUMN_MERGE = "column_merge"; |
| | | private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; |
| | | private static final String ROW_NUM = "rowNum"; |
| | | private static final String ROW_DATA = "rowData"; |
| | | private static final String ROW_TIPS = "rowTips"; |
| | | private static final int CELL_OTHER = 0; |
| | | private static final int CELL_ROW_MERGE = 1; |
| | | private static final int CELL_COLUMN_MERGE = 2; |
| | | private static final int IMG_HEIGHT = 30; |
| | | private static final int IMG_WIDTH = 30; |
| | | private static final char LEAN_LINE = '/'; |
| | | private static final int BYTES_DEFAULT_LENGTH = 10240; |
| | | private static final NumberFormat NUMBER_FORMAT = NumberFormat.getNumberInstance(); |
| | | |
| | | |
| | | public static <T> List<T> readFile(File file, Class<T> clazz) throws Exception { |
| | | JSONArray array = readFile(file); |
| | | return getBeanList(array, clazz); |
| | | } |
| | | |
| | | public static <T> List<T> readMultipartFile(MultipartFile mFile, Class<T> clazz) throws Exception { |
| | | JSONArray array = readMultipartFile(mFile); |
| | | return getBeanList(array, clazz); |
| | | } |
| | | |
| | | public static JSONArray readFile(File file) throws Exception { |
| | | return readExcel(null, file); |
| | | } |
| | | |
| | | public static JSONArray readMultipartFile(MultipartFile mFile) throws Exception { |
| | | return readExcel(mFile, null); |
| | | } |
| | | |
| | | public static Map<String, JSONArray> readFileManySheet(File file) throws Exception { |
| | | return readExcelManySheet(null, file); |
| | | } |
| | | |
| | | public static Map<String, JSONArray> readFileManySheet(MultipartFile file) throws Exception { |
| | | return readExcelManySheet(file, null); |
| | | } |
| | | |
| | | private static <T> List<T> getBeanList(JSONArray array, Class<T> clazz) throws Exception { |
| | | List<T> list = new ArrayList<>(); |
| | | Map<Integer, String> uniqueMap = new HashMap<>(16); |
| | | for (int i = 0; i < array.size(); i++) { |
| | | list.add(getBean(clazz, array.getJSONObject(i), uniqueMap)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¯ä¸ªå¯¹è±¡çæ°æ® |
| | | */ |
| | | private static <T> T getBean(Class<T> c, JSONObject obj, Map<Integer, String> uniqueMap) throws Exception { |
| | | T t = c.newInstance(); |
| | | Field[] fields = c.getDeclaredFields(); |
| | | List<String> errMsgList = new ArrayList<>(); |
| | | boolean hasRowTipsField = false; |
| | | StringBuilder uniqueBuilder = new StringBuilder(); |
| | | int rowNum = 0; |
| | | for (Field field : fields) { |
| | | // è¡å· |
| | | if (field.getName().equals(ROW_NUM)) { |
| | | rowNum = obj.getInteger(ROW_NUM); |
| | | field.setAccessible(true); |
| | | field.set(t, rowNum); |
| | | continue; |
| | | } |
| | | // æ¯å¦éè¦è®¾ç½®å¼å¸¸ä¿¡æ¯ |
| | | if (field.getName().equals(ROW_TIPS)) { |
| | | hasRowTipsField = true; |
| | | continue; |
| | | } |
| | | // åå§æ°æ® |
| | | if (field.getName().equals(ROW_DATA)) { |
| | | field.setAccessible(true); |
| | | field.set(t, obj.toString()); |
| | | continue; |
| | | } |
| | | // 设置对åºå±æ§å¼ |
| | | setFieldValue(t, field, obj, uniqueBuilder, errMsgList); |
| | | } |
| | | // æ°æ®å¯ä¸æ§æ ¡éª |
| | | if (uniqueBuilder.length() > 0) { |
| | | if (uniqueMap.containsValue(uniqueBuilder.toString())) { |
| | | Set<Integer> rowNumKeys = uniqueMap.keySet(); |
| | | for (Integer num : rowNumKeys) { |
| | | if (uniqueMap.get(num).equals(uniqueBuilder.toString())) { |
| | | errMsgList.add(String.format("æ°æ®å¯ä¸æ§æ ¡éªå¤±è´¥,(%s)ä¸ç¬¬%sè¡éå¤)", uniqueBuilder, num)); |
| | | } |
| | | } |
| | | } else { |
| | | uniqueMap.put(rowNum, uniqueBuilder.toString()); |
| | | } |
| | | } |
| | | // 失败å¤ç |
| | | if (errMsgList.isEmpty() && !hasRowTipsField) { |
| | | return t; |
| | | } |
| | | StringBuilder sb = new StringBuilder(); |
| | | int size = errMsgList.size(); |
| | | for (int i = 0; i < size; i++) { |
| | | if (i == size - 1) { |
| | | sb.append(errMsgList.get(i)); |
| | | } else { |
| | | sb.append(errMsgList.get(i)).append(";"); |
| | | } |
| | | } |
| | | // 设置éè¯¯ä¿¡æ¯ |
| | | for (Field field : fields) { |
| | | if (field.getName().equals(ROW_TIPS)) { |
| | | field.setAccessible(true); |
| | | field.set(t, sb.toString()); |
| | | } |
| | | } |
| | | return t; |
| | | } |
| | | |
| | | private static <T> void setFieldValue(T t, Field field, JSONObject obj, StringBuilder uniqueBuilder, List<String> errMsgList) { |
| | | // è·å ExcelImport æ³¨è§£å±æ§ |
| | | ExcelImport annotation = field.getAnnotation(ExcelImport.class); |
| | | if (annotation == null) { |
| | | return; |
| | | } |
| | | String cname = annotation.value(); |
| | | if (cname.trim().length() == 0) { |
| | | return; |
| | | } |
| | | // è·åå
·ä½å¼ |
| | | String val = null; |
| | | if (obj.containsKey(cname)) { |
| | | val = getString(obj.getString(cname)); |
| | | } |
| | | if (val == null) { |
| | | return; |
| | | } |
| | | field.setAccessible(true); |
| | | // 夿æ¯å¦å¿
å¡« |
| | | boolean require = annotation.required(); |
| | | if (require && val.isEmpty()) { |
| | | errMsgList.add(String.format("[%s]ä¸è½ä¸ºç©º", cname)); |
| | | return; |
| | | } |
| | | // æ°æ®å¯ä¸æ§è·å |
| | | boolean unique = annotation.unique(); |
| | | if (unique) { |
| | | if (uniqueBuilder.length() > 0) { |
| | | uniqueBuilder.append("--").append(val); |
| | | } else { |
| | | uniqueBuilder.append(val); |
| | | } |
| | | } |
| | | // 夿æ¯å¦è¶
è¿æå¤§é¿åº¦ |
| | | int maxLength = annotation.maxLength(); |
| | | if (maxLength > 0 && val.length() > maxLength) { |
| | | errMsgList.add(String.format("[%s]é¿åº¦ä¸è½è¶
è¿%s个å符(å½å%s个å符)", cname, maxLength, val.length())); |
| | | } |
| | | // 夿å½å屿§æ¯å¦ææ å°å
³ç³» |
| | | LinkedHashMap<String, String> kvMap = getKvMap(annotation.kv()); |
| | | if (!kvMap.isEmpty()) { |
| | | boolean isMatch = false; |
| | | for (String key : kvMap.keySet()) { |
| | | if (kvMap.get(key).equals(val)) { |
| | | val = key; |
| | | isMatch = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!isMatch) { |
| | | errMsgList.add(String.format("[%s]çå¼ä¸æ£ç¡®(å½åå¼ä¸º%s)", cname, val)); |
| | | return; |
| | | } |
| | | } |
| | | // å
¶ä½æ
嵿 ¹æ®ç±»åèµå¼ |
| | | String fieldClassName = field.getType().getSimpleName(); |
| | | try { |
| | | if ("String".equalsIgnoreCase(fieldClassName)) { |
| | | field.set(t, val); |
| | | } else if ("boolean".equalsIgnoreCase(fieldClassName)) { |
| | | field.set(t, Boolean.valueOf(val)); |
| | | } else if ("int".equalsIgnoreCase(fieldClassName) || "Integer".equals(fieldClassName)) { |
| | | try { |
| | | field.set(t, Integer.valueOf(val)); |
| | | } catch (NumberFormatException e) { |
| | | errMsgList.add(String.format("[%s]ç弿 ¼å¼ä¸æ£ç¡®(å½åå¼ä¸º%s)", cname, val)); |
| | | } |
| | | } else if ("double".equalsIgnoreCase(fieldClassName)) { |
| | | field.set(t, Double.valueOf(val)); |
| | | } else if ("long".equalsIgnoreCase(fieldClassName)) { |
| | | field.set(t, Long.valueOf(val)); |
| | | } else if ("BigDecimal".equalsIgnoreCase(fieldClassName)) { |
| | | field.set(t, new BigDecimal(val)); |
| | | } else if ("Date".equalsIgnoreCase(fieldClassName)) { |
| | | try { |
| | | field.set(t, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(val)); |
| | | } catch (Exception e) { |
| | | field.set(t, new SimpleDateFormat("yyyy-MM-dd").parse(val)); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private static Map<String, JSONArray> readExcelManySheet(MultipartFile mFile, File file) throws IOException { |
| | | Workbook book = getWorkbook(mFile, file); |
| | | if (book == null) { |
| | | return Collections.emptyMap(); |
| | | } |
| | | Map<String, JSONArray> map = new LinkedHashMap<>(); |
| | | for (int i = 0; i < book.getNumberOfSheets(); i++) { |
| | | Sheet sheet = book.getSheetAt(i); |
| | | JSONArray arr = readSheet(sheet); |
| | | map.put(sheet.getSheetName(), arr); |
| | | } |
| | | book.close(); |
| | | return map; |
| | | } |
| | | |
| | | private static JSONArray readExcel(MultipartFile mFile, File file) throws IOException { |
| | | Workbook book = getWorkbook(mFile, file); |
| | | if (book == null) { |
| | | return new JSONArray(); |
| | | } |
| | | JSONArray array = readSheet(book.getSheetAt(0)); |
| | | book.close(); |
| | | return array; |
| | | } |
| | | |
| | | private static Workbook getWorkbook(MultipartFile mFile, File file) throws IOException { |
| | | boolean fileNotExist = (file == null || !file.exists()); |
| | | if (mFile == null && fileNotExist) { |
| | | return null; |
| | | } |
| | | // è§£æè¡¨æ ¼æ°æ® |
| | | InputStream in; |
| | | String fileName; |
| | | if (mFile != null) { |
| | | // ä¸ä¼ æä»¶è§£æ |
| | | in = mFile.getInputStream(); |
| | | fileName = getString(mFile.getOriginalFilename()).toLowerCase(); |
| | | } else { |
| | | // æ¬å°æä»¶è§£æ |
| | | in = new FileInputStream(file); |
| | | fileName = file.getName().toLowerCase(); |
| | | } |
| | | Workbook book; |
| | | if (fileName.endsWith(XLSX)) { |
| | | book = new XSSFWorkbook(in); |
| | | } else if (fileName.endsWith(XLS)) { |
| | | POIFSFileSystem poifsFileSystem = new POIFSFileSystem(in); |
| | | book = new HSSFWorkbook(poifsFileSystem); |
| | | } else { |
| | | return null; |
| | | } |
| | | in.close(); |
| | | return book; |
| | | } |
| | | |
| | | private static JSONArray readSheet(Sheet sheet) { |
| | | // é¦è¡ä¸æ |
| | | int rowStart = sheet.getFirstRowNum(); |
| | | // å°¾è¡ä¸æ |
| | | int rowEnd = sheet.getLastRowNum(); |
| | | // è·åè¡¨å¤´è¡ |
| | | Row headRow = sheet.getRow(rowStart); |
| | | if (headRow == null) { |
| | | return new JSONArray(); |
| | | } |
| | | int cellStart = headRow.getFirstCellNum(); |
| | | int cellEnd = headRow.getLastCellNum(); |
| | | Map<Integer, String> keyMap = new HashMap<>(); |
| | | for (int j = cellStart; j < cellEnd; j++) { |
| | | // è·åè¡¨å¤´æ°æ® |
| | | String val = getCellValue(headRow.getCell(j)); |
| | | if (val != null && val.trim().length() != 0) { |
| | | keyMap.put(j, val); |
| | | } |
| | | } |
| | | // å¦æè¡¨å¤´æ²¡ææ°æ®åä¸è¿è¡è§£æ |
| | | if (keyMap.isEmpty()) { |
| | | return (JSONArray) Collections.emptyList(); |
| | | } |
| | | // è·åæ¯è¡JSON对象çå¼ |
| | | JSONArray array = new JSONArray(); |
| | | // 妿é¦è¡ä¸å°¾è¡ç¸åï¼è¡¨æåªæä¸è¡ï¼è¿åè¡¨å¤´æ°æ® |
| | | if (rowStart == rowEnd) { |
| | | JSONObject obj = new JSONObject(); |
| | | // æ·»å è¡å· |
| | | obj.put(ROW_NUM, 1); |
| | | for (int i : keyMap.keySet()) { |
| | | obj.put(keyMap.get(i), ""); |
| | | } |
| | | array.add(obj); |
| | | return array; |
| | | } |
| | | for (int i = rowStart + 1; i <= rowEnd; i++) { |
| | | Row eachRow = sheet.getRow(i); |
| | | JSONObject obj = new JSONObject(); |
| | | // æ·»å è¡å· |
| | | obj.put(ROW_NUM, i + 1); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int k = cellStart; k < cellEnd; k++) { |
| | | if (eachRow != null) { |
| | | String val = getCellValue(eachRow.getCell(k)); |
| | | // æææ°æ®æ·»å å°éé¢ï¼ç¨äºå¤æè¯¥è¡æ¯å¦ä¸ºç©º |
| | | sb.append(val); |
| | | obj.put(keyMap.get(k), val); |
| | | } |
| | | } |
| | | if (sb.length() > 0) { |
| | | array.add(obj); |
| | | } |
| | | } |
| | | return array; |
| | | } |
| | | |
| | | private static String getCellValue(Cell cell) { |
| | | // ç©ºç½æç©º |
| | | if (cell == null || cell.getCellType() == CellType.BLANK) { |
| | | return ""; |
| | | } |
| | | // Stringç±»å |
| | | if (cell.getCellType() == CellType.STRING) { |
| | | String val = cell.getStringCellValue(); |
| | | if (val == null || val.trim().length() == 0) { |
| | | return ""; |
| | | } |
| | | return val.trim(); |
| | | } |
| | | // æ°åç±»å |
| | | if (cell.getCellType() == CellType.NUMERIC) { |
| | | String s = cell.getNumericCellValue() + ""; |
| | | // 廿尾巴ä¸çå°æ°ç¹0 |
| | | if (Pattern.matches(".*\\.0*", s)) { |
| | | return s.split("\\.")[0]; |
| | | } else { |
| | | return s; |
| | | } |
| | | } |
| | | // å¸å°å¼ç±»å |
| | | if (cell.getCellType() == CellType.BOOLEAN) { |
| | | return cell.getBooleanCellValue() + ""; |
| | | } |
| | | // é误类å |
| | | return cell.getCellFormula(); |
| | | } |
| | | |
| | | public static <T> void exportTemplate(HttpServletResponse response, String fileName, Class<T> clazz) { |
| | | exportTemplate(response, fileName, fileName, clazz, false); |
| | | } |
| | | |
| | | public static <T> void exportTemplate(HttpServletResponse response, String fileName, String sheetName, |
| | | Class<T> clazz) { |
| | | exportTemplate(response, fileName, sheetName, clazz, false); |
| | | } |
| | | |
| | | public static <T> void exportTemplate(HttpServletResponse response, String fileName, Class<T> clazz, |
| | | boolean isContainExample) { |
| | | exportTemplate(response, fileName, fileName, clazz, isContainExample); |
| | | } |
| | | |
| | | public static <T> void exportTemplate(HttpServletResponse response, String fileName, String sheetName, |
| | | Class<T> clazz, boolean isContainExample) { |
| | | // è·åè¡¨å¤´åæ®µ |
| | | List<ExcelClassField> headFieldList = getExcelClassFieldList(clazz); |
| | | // è·åè¡¨å¤´æ°æ®åç¤ºä¾æ°æ® |
| | | List<List<Object>> sheetDataList = new ArrayList<>(); |
| | | List<Object> headList = new ArrayList<>(); |
| | | List<Object> exampleList = new ArrayList<>(); |
| | | Map<Integer, List<String>> selectMap = new LinkedHashMap<>(); |
| | | for (int i = 0; i < headFieldList.size(); i++) { |
| | | ExcelClassField each = headFieldList.get(i); |
| | | headList.add(each.getName()); |
| | | exampleList.add(each.getExample()); |
| | | LinkedHashMap<String, String> kvMap = each.getKvMap(); |
| | | if (kvMap != null && kvMap.size() > 0) { |
| | | selectMap.put(i, new ArrayList<>(kvMap.values())); |
| | | } |
| | | } |
| | | sheetDataList.add(headList); |
| | | if (isContainExample) { |
| | | sheetDataList.add(exampleList); |
| | | } |
| | | // å¯¼åºæ°æ® |
| | | export(response, fileName, sheetName, sheetDataList, selectMap); |
| | | } |
| | | |
| | | private static <T> List<ExcelClassField> getExcelClassFieldList(Class<T> clazz) { |
| | | // è§£æææåæ®µ |
| | | Field[] fields = clazz.getDeclaredFields(); |
| | | boolean hasExportAnnotation = false; |
| | | Map<Integer, List<ExcelClassField>> map = new LinkedHashMap<>(); |
| | | List<Integer> sortList = new ArrayList<>(); |
| | | for (Field field : fields) { |
| | | ExcelClassField cf = getExcelClassField(field); |
| | | if (cf.getHasAnnotation() == 1) { |
| | | hasExportAnnotation = true; |
| | | } |
| | | int sort = cf.getSort(); |
| | | if (map.containsKey(sort)) { |
| | | map.get(sort).add(cf); |
| | | } else { |
| | | List<ExcelClassField> list = new ArrayList<>(); |
| | | list.add(cf); |
| | | sortList.add(sort); |
| | | map.put(sort, list); |
| | | } |
| | | } |
| | | Collections.sort(sortList); |
| | | // è·å表头 |
| | | List<ExcelClassField> headFieldList = new ArrayList<>(); |
| | | if (hasExportAnnotation) { |
| | | for (Integer sort : sortList) { |
| | | for (ExcelClassField cf : map.get(sort)) { |
| | | if (cf.getHasAnnotation() == 1) { |
| | | headFieldList.add(cf); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | headFieldList.addAll(map.get(0)); |
| | | } |
| | | return headFieldList; |
| | | } |
| | | |
| | | private static ExcelClassField getExcelClassField(Field field) { |
| | | ExcelClassField cf = new ExcelClassField(); |
| | | String fieldName = field.getName(); |
| | | cf.setFieldName(fieldName); |
| | | ExcelExport annotation = field.getAnnotation(ExcelExport.class); |
| | | // æ ExcelExport 注解æ
åµ |
| | | if (annotation == null) { |
| | | cf.setHasAnnotation(0); |
| | | cf.setName(fieldName); |
| | | cf.setSort(0); |
| | | return cf; |
| | | } |
| | | // æ ExcelExport 注解æ
åµ |
| | | cf.setHasAnnotation(1); |
| | | cf.setName(annotation.value()); |
| | | String example = getString(annotation.example()); |
| | | if (!example.isEmpty()) { |
| | | if (isNumeric(example) && example.length() < 8) { |
| | | cf.setExample(Double.valueOf(example)); |
| | | } else { |
| | | cf.setExample(example); |
| | | } |
| | | } else { |
| | | cf.setExample(""); |
| | | } |
| | | cf.setSort(annotation.sort()); |
| | | // è§£ææ å° |
| | | String kv = getString(annotation.kv()); |
| | | cf.setKvMap(getKvMap(kv)); |
| | | return cf; |
| | | } |
| | | |
| | | private static LinkedHashMap<String, String> getKvMap(String kv) { |
| | | LinkedHashMap<String, String> kvMap = new LinkedHashMap<>(); |
| | | if (kv.isEmpty()) { |
| | | return kvMap; |
| | | } |
| | | String[] kvs = kv.split(";"); |
| | | if (kvs.length == 0) { |
| | | return kvMap; |
| | | } |
| | | for (String each : kvs) { |
| | | String[] eachKv = getString(each).split("-"); |
| | | if (eachKv.length != 2) { |
| | | continue; |
| | | } |
| | | String k = eachKv[0]; |
| | | String v = eachKv[1]; |
| | | if (k.isEmpty() || v.isEmpty()) { |
| | | continue; |
| | | } |
| | | kvMap.put(k, v); |
| | | } |
| | | return kvMap; |
| | | } |
| | | |
| | | /** |
| | | * 导åºè¡¨æ ¼å°æ¬å° |
| | | * |
| | | * @param file æ¬å°æä»¶å¯¹è±¡ |
| | | * @param sheetData å¯¼åºæ°æ® |
| | | */ |
| | | public static void exportFile(File file, List<List<Object>> sheetData) { |
| | | if (file == null) { |
| | | System.out.println("æä»¶å建失败"); |
| | | return; |
| | | } |
| | | if (sheetData == null) { |
| | | sheetData = new ArrayList<>(); |
| | | } |
| | | Map<String, List<List<Object>>> map = new HashMap<>(); |
| | | map.put(file.getName(), sheetData); |
| | | export(null, file, file.getName(), map, null); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè¡¨æ ¼å°æ¬å° |
| | | * |
| | | * @param <T> å¯¼åºæ°æ®ç±»ä¼¼ï¼åKç±»åä¿æä¸è´ |
| | | * @param filePath æä»¶ç¶è·¯å¾ï¼å¦ï¼D:/doc/excel/ï¼ |
| | | * @param fileName æä»¶åç§°ï¼ä¸å¸¦å°¾ç¼ï¼å¦ï¼å¦çè¡¨ï¼ |
| | | * @param list å¯¼åºæ°æ® |
| | | * @throws IOException IOå¼å¸¸ |
| | | */ |
| | | public static <T> File exportFile(String filePath, String fileName, List<T> list) throws IOException { |
| | | File file = getFile(filePath, fileName); |
| | | List<List<Object>> sheetData = getSheetData(list); |
| | | exportFile(file, sheetData); |
| | | return file; |
| | | } |
| | | |
| | | /** |
| | | * è·åæä»¶ |
| | | * |
| | | * @param filePath filePath æä»¶ç¶è·¯å¾ï¼å¦ï¼D:/doc/excel/ï¼ |
| | | * @param fileName æä»¶åç§°ï¼ä¸å¸¦å°¾ç¼ï¼å¦ï¼ç¨æ·è¡¨ï¼ |
| | | * @return æ¬å°Fileæä»¶å¯¹è±¡ |
| | | */ |
| | | private static File getFile(String filePath, String fileName) throws IOException { |
| | | String dirPath = getString(filePath); |
| | | String fileFullPath; |
| | | if (dirPath.isEmpty()) { |
| | | fileFullPath = fileName; |
| | | } else { |
| | | // å¤å®æä»¶å¤¹æ¯å¦åå¨ï¼å¦æä¸åå¨ï¼å级èå建 |
| | | File dirFile = new File(dirPath); |
| | | if (!dirFile.exists()) { |
| | | boolean mkdirs = dirFile.mkdirs(); |
| | | if (!mkdirs) { |
| | | return null; |
| | | } |
| | | } |
| | | // è·åæä»¶å¤¹å
¨å |
| | | if (dirPath.endsWith(String.valueOf(LEAN_LINE))) { |
| | | fileFullPath = dirPath + fileName + XLSX; |
| | | } else { |
| | | fileFullPath = dirPath + LEAN_LINE + fileName + XLSX; |
| | | } |
| | | } |
| | | System.out.println(fileFullPath); |
| | | File file = new File(fileFullPath); |
| | | if (!file.exists()) { |
| | | boolean result = file.createNewFile(); |
| | | if (!result) { |
| | | return null; |
| | | } |
| | | } |
| | | return file; |
| | | } |
| | | |
| | | private static <T> List<List<Object>> getSheetData(List<T> list) { |
| | | // è·åè¡¨å¤´åæ®µ |
| | | List<ExcelClassField> excelClassFieldList = getExcelClassFieldList(list.get(0).getClass()); |
| | | List<String> headFieldList = new ArrayList<>(); |
| | | List<Object> headList = new ArrayList<>(); |
| | | Map<String, ExcelClassField> headFieldMap = new HashMap<>(); |
| | | for (ExcelClassField each : excelClassFieldList) { |
| | | String fieldName = each.getFieldName(); |
| | | headFieldList.add(fieldName); |
| | | headFieldMap.put(fieldName, each); |
| | | headList.add(each.getName()); |
| | | } |
| | | // æ·»å 表头åç§° |
| | | List<List<Object>> sheetDataList = new ArrayList<>(); |
| | | sheetDataList.add(headList); |
| | | // è·åè¡¨æ°æ® |
| | | for (T t : list) { |
| | | Map<String, Object> fieldDataMap = getFieldDataMap(t); |
| | | Set<String> fieldDataKeys = fieldDataMap.keySet(); |
| | | List<Object> rowList = new ArrayList<>(); |
| | | for (String headField : headFieldList) { |
| | | if (!fieldDataKeys.contains(headField)) { |
| | | continue; |
| | | } |
| | | Object data = fieldDataMap.get(headField); |
| | | if (data == null) { |
| | | rowList.add(""); |
| | | continue; |
| | | } |
| | | ExcelClassField cf = headFieldMap.get(headField); |
| | | // 夿æ¯å¦ææ å°å
³ç³» |
| | | LinkedHashMap<String, String> kvMap = cf.getKvMap(); |
| | | if (kvMap == null || kvMap.isEmpty()) { |
| | | rowList.add(data); |
| | | continue; |
| | | } |
| | | String val = kvMap.get(data.toString()); |
| | | if (isNumeric(val)) { |
| | | rowList.add(Double.valueOf(val)); |
| | | } else { |
| | | rowList.add(val); |
| | | } |
| | | } |
| | | sheetDataList.add(rowList); |
| | | } |
| | | return sheetDataList; |
| | | } |
| | | |
| | | private static <T> Map<String, Object> getFieldDataMap(T t) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Field[] fields = t.getClass().getDeclaredFields(); |
| | | try { |
| | | for (Field field : fields) { |
| | | String fieldName = field.getName(); |
| | | field.setAccessible(true); |
| | | Object object = field.get(t); |
| | | map.put(fieldName, object); |
| | | } |
| | | } catch (IllegalArgumentException | IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public static void exportEmpty(HttpServletResponse response, String fileName) { |
| | | List<List<Object>> sheetDataList = new ArrayList<>(); |
| | | List<Object> headList = new ArrayList<>(); |
| | | headList.add("å¯¼åºæ æ°æ®"); |
| | | sheetDataList.add(headList); |
| | | export(response, fileName, sheetDataList); |
| | | } |
| | | |
| | | public static void export(HttpServletResponse response, String fileName, List<List<Object>> sheetDataList) { |
| | | export(response, fileName, fileName, sheetDataList, null); |
| | | } |
| | | |
| | | public static void exportManySheet(HttpServletResponse response, String fileName, Map<String, List<List<Object>>> sheetMap) { |
| | | export(response, null, fileName, sheetMap, null); |
| | | } |
| | | |
| | | |
| | | public static void export(HttpServletResponse response, String fileName, String sheetName, |
| | | List<List<Object>> sheetDataList) { |
| | | export(response, fileName, sheetName, sheetDataList, null); |
| | | } |
| | | |
| | | public static void export(HttpServletResponse response, String fileName, String sheetName, |
| | | List<List<Object>> sheetDataList, Map<Integer, List<String>> selectMap) { |
| | | |
| | | Map<String, List<List<Object>>> map = new HashMap<>(); |
| | | map.put(sheetName, sheetDataList); |
| | | export(response, null, fileName, map, selectMap); |
| | | } |
| | | |
| | | public static <T, K> void export(HttpServletResponse response, String fileName, List<T> list, Class<K> template) { |
| | | // list æ¯å¦ä¸ºç©º |
| | | boolean lisIsEmpty = list == null || list.isEmpty(); |
| | | // å¦ææ¨¡æ¿æ°æ®ä¸ºç©ºï¼ä¸å¯¼å
¥çæ°æ®ä¸ºç©ºï¼å导åºç©ºæä»¶ |
| | | if (template == null && lisIsEmpty) { |
| | | exportEmpty(response, fileName); |
| | | return; |
| | | } |
| | | // 妿 list æ°æ®ï¼åå¯¼åºæ¨¡æ¿æ°æ® |
| | | if (lisIsEmpty) { |
| | | exportTemplate(response, fileName, template); |
| | | return; |
| | | } |
| | | // å¯¼åºæ°æ® |
| | | List<List<Object>> sheetDataList = getSheetData(list); |
| | | export(response, fileName, sheetDataList); |
| | | } |
| | | |
| | | public static void export(HttpServletResponse response, String fileName, List<List<Object>> sheetDataList, Map<Integer, List<String>> selectMap) { |
| | | export(response, fileName, fileName, sheetDataList, selectMap); |
| | | } |
| | | |
| | | private static void export(HttpServletResponse response, File file, String fileName, |
| | | Map<String, List<List<Object>>> sheetMap, Map<Integer, List<String>> selectMap) { |
| | | // æ´ä¸ª Excel è¡¨æ ¼ book 对象 |
| | | SXSSFWorkbook book = new SXSSFWorkbook(); |
| | | // æ¯ä¸ª Sheet 页 |
| | | Set<Entry<String, List<List<Object>>>> entries = sheetMap.entrySet(); |
| | | for (Entry<String, List<List<Object>>> entry : entries) { |
| | | List<List<Object>> sheetDataList = entry.getValue(); |
| | | Sheet sheet = book.createSheet(entry.getKey()); |
| | | Drawing<?> patriarch = sheet.createDrawingPatriarch(); |
| | | // è®¾ç½®è¡¨å¤´èæ¯è²ï¼ç°è²ï¼ |
| | | CellStyle headStyle = book.createCellStyle(); |
| | | headStyle.setFillForegroundColor(IndexedColors.GREY_80_PERCENT.index); |
| | | headStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); |
| | | headStyle.setAlignment(HorizontalAlignment.CENTER); |
| | | headStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.index); |
| | | // è®¾ç½®è¡¨èº«èæ¯è²ï¼é»è®¤è²ï¼ |
| | | CellStyle rowStyle = book.createCellStyle(); |
| | | rowStyle.setAlignment(HorizontalAlignment.CENTER); |
| | | rowStyle.setVerticalAlignment(VerticalAlignment.CENTER); |
| | | // è®¾ç½®è¡¨æ ¼å宽度ï¼é»è®¤ä¸º15个åèï¼ |
| | | sheet.setDefaultColumnWidth(15); |
| | | // å建åå¹¶ç®æ³æ°ç» |
| | | int rowLength = sheetDataList.size(); |
| | | int columnLength = sheetDataList.get(0).size(); |
| | | int[][] mergeArray = new int[rowLength][columnLength]; |
| | | for (int i = 0; i < sheetDataList.size(); i++) { |
| | | // æ¯ä¸ª Sheet 页ä¸çè¡æ°æ® |
| | | Row row = sheet.createRow(i); |
| | | List<Object> rowList = sheetDataList.get(i); |
| | | for (int j = 0; j < rowList.size(); j++) { |
| | | // æ¯ä¸ªè¡æ°æ®ä¸çåå
æ ¼æ°æ® |
| | | Object o = rowList.get(j); |
| | | int v = 0; |
| | | if (o instanceof URL) { |
| | | // 妿è¦å¯¼åºå¾ççè¯, 龿¥éè¦ä¼ é URL 对象 |
| | | setCellPicture(book, row, patriarch, i, j, (URL) o); |
| | | } else { |
| | | Cell cell = row.createCell(j); |
| | | if (i == 0) { |
| | | // 第ä¸è¡ä¸ºè¡¨å¤´è¡ï¼éç¨ç°è²åºèæ¯ |
| | | v = setCellValue(cell, o, headStyle); |
| | | } else { |
| | | // å
¶ä»è¡ä¸ºæ°æ®è¡ï¼é»è®¤ç½åºè² |
| | | v = setCellValue(cell, o, rowStyle); |
| | | } |
| | | } |
| | | mergeArray[i][j] = v; |
| | | } |
| | | } |
| | | // åå¹¶åå
æ ¼ |
| | | mergeCells(sheet, mergeArray); |
| | | // è®¾ç½®ä¸æå表 |
| | | setSelect(sheet, selectMap); |
| | | } |
| | | // åæ°æ® |
| | | if (response != null) { |
| | | // åç«¯å¯¼åº |
| | | try { |
| | | write(response, book, fileName); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } else { |
| | | // æ¬å°å¯¼åº |
| | | FileOutputStream fos; |
| | | try { |
| | | fos = new FileOutputStream(file); |
| | | ByteArrayOutputStream ops = new ByteArrayOutputStream(); |
| | | book.write(ops); |
| | | fos.write(ops.toByteArray()); |
| | | fos.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå¹¶å½åSheet页çåå
æ ¼ |
| | | * |
| | | * @param sheet å½å sheet 页 |
| | | * @param mergeArray åå¹¶åå
æ ¼ç®æ³ |
| | | */ |
| | | private static void mergeCells(Sheet sheet, int[][] mergeArray) { |
| | | // 横ååå¹¶ |
| | | for (int x = 0; x < mergeArray.length; x++) { |
| | | int[] arr = mergeArray[x]; |
| | | boolean merge = false; |
| | | int y1 = 0; |
| | | int y2 = 0; |
| | | for (int y = 0; y < arr.length; y++) { |
| | | int value = arr[y]; |
| | | if (value == CELL_COLUMN_MERGE) { |
| | | if (!merge) { |
| | | y1 = y; |
| | | } |
| | | y2 = y; |
| | | merge = true; |
| | | } else { |
| | | merge = false; |
| | | if (y1 > 0) { |
| | | sheet.addMergedRegion(new CellRangeAddress(x, x, (y1 - 1), y2)); |
| | | } |
| | | y1 = 0; |
| | | y2 = 0; |
| | | } |
| | | } |
| | | if (y1 > 0) { |
| | | sheet.addMergedRegion(new CellRangeAddress(x, x, (y1 - 1), y2)); |
| | | } |
| | | } |
| | | // 纵ååå¹¶ |
| | | int xLen = mergeArray.length; |
| | | int yLen = mergeArray[0].length; |
| | | for (int y = 0; y < yLen; y++) { |
| | | boolean merge = false; |
| | | int x1 = 0; |
| | | int x2 = 0; |
| | | for (int x = 0; x < xLen; x++) { |
| | | int value = mergeArray[x][y]; |
| | | if (value == CELL_ROW_MERGE) { |
| | | if (!merge) { |
| | | x1 = x; |
| | | } |
| | | x2 = x; |
| | | merge = true; |
| | | } else { |
| | | merge = false; |
| | | if (x1 > 0) { |
| | | // æ£æ¥æ¯å¦ä¸ç°æåå¹¶åºåéå ï¼å¦ææåå 餿§åºåï¼ååå¹¶æ°åºå |
| | | CellRangeAddress newRegion = new CellRangeAddress((x1 - 1), x2, y, y); |
| | | handleOverlappingRegions(sheet, newRegion); |
| | | } |
| | | x1 = 0; |
| | | x2 = 0; |
| | | } |
| | | } |
| | | if (x1 > 0) { |
| | | // æ£æ¥æ¯å¦ä¸ç°æåå¹¶åºåéå ï¼å¦ææåå 餿§åºåï¼ååå¹¶æ°åºå |
| | | CellRangeAddress newRegion = new CellRangeAddress((x1 - 1), x2, y, y); |
| | | handleOverlappingRegions(sheet, newRegion); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ£æ¥æ¯å¦ä¸ç°æåå¹¶åºåéå ï¼å¦ææåå 餿§åºåï¼ååå¹¶æ°åºå |
| | | * @param sheet Excelå·¥ä½è¡¨ |
| | | * @param newRegion æ°çåå¹¶åºå |
| | | */ |
| | | private static void handleOverlappingRegions(Sheet sheet, CellRangeAddress newRegion) { |
| | | // ç§»é¤éå çç°æåºå |
| | | List<CellRangeAddress> overlappingRegions = new ArrayList<>(); |
| | | for (int i = sheet.getNumMergedRegions() - 1; i >= 0; i--) { |
| | | CellRangeAddress existingRegion = sheet.getMergedRegion(i); |
| | | if (newRegion.intersects(existingRegion)) { |
| | | overlappingRegions.add(existingRegion); |
| | | sheet.removeMergedRegion(i); |
| | | } |
| | | } |
| | | // åå¹¶å°æ°åºåï¼è¿éç®åå°å°å®ä»¬æ·»å å°æ°çåå¹¶åºåå表ä¸ï¼å®é
åºç¨ä¸å¯è½éè¦æ´å¤æçé»è¾æ¥çæ£âåå¹¶âåºåï¼ |
| | | // 注æï¼POIçCellRangeAddress没ææä¾ç´æ¥å并两个åºåçæ¹æ³ï¼æä»¥è¿éåªæ¯ç¤ºä¾ |
| | | // 妿éè¦çæ£çåå¹¶ï¼å¯è½éè¦èªå®ä¹é»è¾æ¥è®¡ç®æ°çè¾¹ç |
| | | for (CellRangeAddress overlappingRegion : overlappingRegions) { |
| | | sheet.addMergedRegion(overlappingRegion); |
| | | } |
| | | sheet.addMergedRegion(newRegion); |
| | | } |
| | | |
| | | |
| | | private static void write(HttpServletResponse response, SXSSFWorkbook book, String fileName) throws IOException { |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | String name = new String(fileName.getBytes("GBK"), "ISO8859_1") + XLSX; |
| | | response.addHeader("Content-Disposition", "attachment;filename=" + name); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | book.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | private static int setCellValue(Cell cell, Object o, CellStyle style) { |
| | | // è®¾ç½®æ ·å¼ |
| | | cell.setCellStyle(style); |
| | | // æ°æ®ä¸ºç©ºæ¶ |
| | | if (o == null) { |
| | | cell.setCellType(CellType.STRING); |
| | | cell.setCellValue(""); |
| | | return CELL_OTHER; |
| | | } |
| | | // æ¯å¦ä¸ºå符串 |
| | | if (o instanceof String) { |
| | | String s = o.toString(); |
| | | // 彿°åç±»åé¿åº¦è¶
è¿8使¶ï¼æ¹ä¸ºåç¬¦ä¸²ç±»åæ¾ç¤ºï¼Excelæ°åè¶
è¿ä¸å®é¿åº¦ä¼æ¾ç¤ºä¸ºç§å¦è®¡æ°æ³ï¼ |
| | | if (isNumeric(s) && s.length() < 8) { |
| | | cell.setCellType(CellType.NUMERIC); |
| | | cell.setCellValue(Double.parseDouble(s)); |
| | | return CELL_OTHER; |
| | | } else { |
| | | cell.setCellType(CellType.STRING); |
| | | cell.setCellValue(s); |
| | | } |
| | | if (s.equals(ROW_MERGE)) { |
| | | return CELL_ROW_MERGE; |
| | | } else if (s.equals(COLUMN_MERGE)) { |
| | | return CELL_COLUMN_MERGE; |
| | | } else { |
| | | return CELL_OTHER; |
| | | } |
| | | } |
| | | // æ¯å¦ä¸ºå符串 |
| | | if (o instanceof Integer || o instanceof Long || o instanceof Double || o instanceof Float) { |
| | | cell.setCellType(CellType.NUMERIC); |
| | | cell.setCellValue(Double.parseDouble(o.toString())); |
| | | return CELL_OTHER; |
| | | } |
| | | // æ¯å¦ä¸ºBoolean |
| | | if (o instanceof Boolean) { |
| | | cell.setCellType(CellType.BOOLEAN); |
| | | cell.setCellValue((Boolean) o); |
| | | return CELL_OTHER; |
| | | } |
| | | // 妿æ¯BigDecimalï¼åé»è®¤3ä½å°æ° |
| | | if (o instanceof BigDecimal) { |
| | | cell.setCellType(CellType.NUMERIC); |
| | | cell.setCellValue(((BigDecimal) o).setScale(3, RoundingMode.HALF_UP).doubleValue()); |
| | | return CELL_OTHER; |
| | | } |
| | | // 妿æ¯Dateæ°æ®ï¼åæ¾ç¤ºæ ¼å¼åæ°æ® |
| | | if (o instanceof Date) { |
| | | cell.setCellType(CellType.STRING); |
| | | cell.setCellValue(formatDate((Date) o)); |
| | | return CELL_OTHER; |
| | | } |
| | | // 妿æ¯å
¶ä»ï¼åé»è®¤å符串类å |
| | | cell.setCellType(CellType.STRING); |
| | | cell.setCellValue(o.toString()); |
| | | return CELL_OTHER; |
| | | } |
| | | |
| | | private static void setCellPicture(SXSSFWorkbook wb, Row sr, Drawing<?> patriarch, int x, int y, URL url) { |
| | | // 设置å¾çå®½é« |
| | | sr.setHeight((short) (IMG_WIDTH * IMG_HEIGHT)); |
| | | // ï¼jdk1.7çæ¬tryä¸å®ä¹æµå¯èªå¨å
³éï¼ |
| | | try (InputStream is = url.openStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { |
| | | byte[] buff = new byte[BYTES_DEFAULT_LENGTH]; |
| | | int rc; |
| | | while ((rc = is.read(buff, 0, BYTES_DEFAULT_LENGTH)) > 0) { |
| | | outputStream.write(buff, 0, rc); |
| | | } |
| | | // 设置å¾çä½ç½® |
| | | XSSFClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, y, x, y + 1, x + 1); |
| | | // 设置è¿ä¸ªï¼å¾çä¼èªå¨å¡«æ»¡åå
æ ¼çé¿å®½ |
| | | anchor.setAnchorType(AnchorType.MOVE_AND_RESIZE); |
| | | patriarch.createPicture(anchor, wb.addPicture(outputStream.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | private static String formatDate(Date date) { |
| | | if (date == null) { |
| | | return ""; |
| | | } |
| | | SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT); |
| | | return format.format(date); |
| | | } |
| | | |
| | | private static void setSelect(Sheet sheet, Map<Integer, List<String>> selectMap) { |
| | | if (selectMap == null || selectMap.isEmpty()) { |
| | | return; |
| | | } |
| | | Set<Entry<Integer, List<String>>> entrySet = selectMap.entrySet(); |
| | | for (Entry<Integer, List<String>> entry : entrySet) { |
| | | int y = entry.getKey(); |
| | | List<String> list = entry.getValue(); |
| | | if (list == null || list.isEmpty()) { |
| | | continue; |
| | | } |
| | | String[] arr = new String[list.size()]; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | arr[i] = list.get(i); |
| | | } |
| | | DataValidationHelper helper = sheet.getDataValidationHelper(); |
| | | CellRangeAddressList addressList = new CellRangeAddressList(1, 65000, y, y); |
| | | DataValidationConstraint dvc = helper.createExplicitListConstraint(arr); |
| | | DataValidation dv = helper.createValidation(dvc, addressList); |
| | | if (dv instanceof HSSFDataValidation) { |
| | | dv.setSuppressDropDownArrow(false); |
| | | } else { |
| | | dv.setSuppressDropDownArrow(true); |
| | | dv.setShowErrorBox(true); |
| | | } |
| | | sheet.addValidationData(dv); |
| | | } |
| | | } |
| | | |
| | | private static boolean isNumeric(String str) { |
| | | if(StringUtils.isEmpty(str)){ |
| | | return false; |
| | | } |
| | | if (Objects.nonNull(str) && "0.0".equals(str)) { |
| | | return true; |
| | | } |
| | | for (int i = str.length(); --i >= 0; ) { |
| | | if (!Character.isDigit(str.charAt(i))) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | private static String getString(String s) { |
| | | if (s == null) { |
| | | return ""; |
| | | } |
| | | if (s.isEmpty()) { |
| | | return s; |
| | | } |
| | | return s.trim(); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.compensationperformance.pojo.CompensationPerformance; |
| | | import com.ruoyi.compensationperformance.service.CompensationPerformanceService; |
| | | 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.purchase.dto.PaymentRegistrationDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return delete ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | @Log(title = "导åºèªèµç®¡çå表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response ) { |
| | | List<CompensationPerformance> list = compensationPerformanceService.list(); |
| | | ExcelUtil<CompensationPerformance> util = new ExcelUtil<CompensationPerformance>(CompensationPerformance.class); |
| | | util.exportExcel(response, list, "导åºèªèµç®¡çå表"); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * åå·¥id |
| | | */ |
| | | @ApiModelProperty("åå·¥id") |
| | | @Excel(name = "åå·¥id") |
| | | private Long staffId; |
| | | |
| | | /** |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.customervisits.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.compensationperformance.pojo.CompensationPerformance; |
| | | import com.ruoyi.customervisits.pojo.CustomerVisits; |
| | | import com.ruoyi.customervisits.service.impl.CustomerVisitsServiceImpl; |
| | | 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 io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/29 10:28 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å®¢æ·æè®¿") |
| | | @RequestMapping("/customerVisits") |
| | | public class CustomerVisitsController extends BaseController { |
| | | |
| | | @Autowired |
| | | private CustomerVisitsServiceImpl customerVisitsService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "å®¢æ·æè®¿-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å®¢æ·æè®¿-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, CustomerVisits customerVisits){ |
| | | IPage<CustomerVisits> listPage = customerVisitsService.listPage(page, customerVisits); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @Log(title = "å®¢æ·æè®¿-æ·»å ", businessType = BusinessType.INSERT) |
| | | @ApiOperation("å®¢æ·æè®¿-æ·»å ") |
| | | @PostMapping("/add") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody CustomerVisits customerVisits){ |
| | | boolean save = customerVisitsService.save(customerVisits); |
| | | if (save){ |
| | | return AjaxResult.success("æ·»å æå"); |
| | | } |
| | | return AjaxResult.error("æ·»å 失败"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.customervisits.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.customervisits.pojo.CustomerVisits; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/29 10:24 |
| | | */ |
| | | public interface CustomerVisitsMapper extends BaseMapper<CustomerVisits> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.customervisits.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| | | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/29 10:17 |
| | | */ |
| | | @TableName("customer_visits") |
| | | @Data |
| | | @Builder |
| | | @ApiModel |
| | | public class CustomerVisits { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | @ApiModelProperty("客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | /** |
| | | * è系人 |
| | | */ |
| | | @ApiModelProperty("è系人") |
| | | private String contact; |
| | | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | @ApiModelProperty("èç³»çµè¯") |
| | | private String contactPhone; |
| | | |
| | | /** |
| | | * ä½ç½® |
| | | */ |
| | | @ApiModelProperty("ä½ç½®") |
| | | private String location; |
| | | |
| | | /** |
| | | * æè®¿äºº |
| | | */ |
| | | @ApiModelProperty("æè®¿äºº") |
| | | private String visitingPeople; |
| | | |
| | | /** |
| | | * æè®¿ç®ç |
| | | */ |
| | | @ApiModelProperty("æè®¿ç®ç") |
| | | private String purposeVisit; |
| | | |
| | | /** |
| | | * æè®¿æ¶é´ |
| | | */ |
| | | @ApiModelProperty("æè®¿æ¶é´") |
| | | private String purposeDate; |
| | | |
| | | /** |
| | | * æè®¿å°å |
| | | */ |
| | | @ApiModelProperty("æè®¿å°å") |
| | | private String visitAddress; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.customervisits.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.customervisits.pojo.CustomerVisits; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/29 10:26 |
| | | */ |
| | | public interface CustomerVisitsService extends IService<CustomerVisits> { |
| | | IPage<CustomerVisits> listPage(Page page, CustomerVisits customerVisits); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.customervisits.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.common.utils.StringUtils; |
| | | import com.ruoyi.customervisits.mapper.CustomerVisitsMapper; |
| | | import com.ruoyi.customervisits.pojo.CustomerVisits; |
| | | import com.ruoyi.customervisits.service.CustomerVisitsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/29 10:27 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class CustomerVisitsServiceImpl extends ServiceImpl<CustomerVisitsMapper, CustomerVisits> implements CustomerVisitsService { |
| | | |
| | | @Autowired |
| | | private CustomerVisitsMapper customerVisitsMapper; |
| | | |
| | | @Override |
| | | public IPage<CustomerVisits> listPage(Page page, CustomerVisits customerVisits) { |
| | | LambdaQueryWrapper<CustomerVisits> customerVisitsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(customerVisits != null && !StringUtils.isEmpty(customerVisits.getCustomerName())){ |
| | | customerVisitsLambdaQueryWrapper.like(CustomerVisits::getCustomerName, customerVisits.getCustomerName()); |
| | | } |
| | | Page page1 = customerVisitsMapper.selectPage(page, customerVisitsLambdaQueryWrapper); |
| | | return page1; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.device.dto.DeviceDefectRecordDto; |
| | | import com.ruoyi.device.dto.DeviceRepairDto; |
| | | import com.ruoyi.device.pojo.DeviceDefectRecord; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.service.DeviceDefectRecordService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "设å¤ç¼ºé·è®°å½ç®¡ç") |
| | | @RequestMapping("/defect") |
| | | @RestController |
| | | public class DeviceDefectRecordController { |
| | | @Autowired |
| | | private DeviceDefectRecordService deviceDefectRecordService; |
| | | @ApiModelProperty("设å¤ç¼ºé·è®°å½å表") |
| | | @GetMapping("/page") |
| | | public AjaxResult page(Page page , DeviceDefectRecordDto deviceDefectRecordDto) { |
| | | return AjaxResult.success(deviceDefectRecordService.listPage(page,deviceDefectRecordDto)); |
| | | } |
| | | @ApiModelProperty("设å¤idæ¥è¯¢è®¾å¤ç¼ºé·è®°å½å表") |
| | | @GetMapping("/find/{deviceLedgerId}") |
| | | public AjaxResult find(@PathVariable Long deviceLedgerId) { |
| | | DeviceDefectRecordDto deviceDefectRecordDto = new DeviceDefectRecordDto(); |
| | | deviceDefectRecordDto.setDeviceLedgerId(deviceLedgerId); |
| | | return AjaxResult.success(deviceDefectRecordService.listPage(new Page<>(1,-1),deviceDefectRecordDto)); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiModelProperty("æ·»å 设å¤ç¼ºé·è®°å½") |
| | | public AjaxResult add(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return AjaxResult.success(deviceDefectRecordService.add(deviceDefectRecord)); |
| | | } |
| | | @PostMapping("/update") |
| | | @ApiModelProperty("ä¿®æ¹è®¾å¤ç¼ºé·è®°å½") |
| | | public AjaxResult update(@RequestBody DeviceDefectRecord deviceDefectRecord) { |
| | | return AjaxResult.success(deviceDefectRecordService.updateByDDR(deviceDefectRecord)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | @ApiModelProperty("å é¤è®¾å¤ç¼ºé·è®°å½") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | return AjaxResult.success(deviceDefectRecordService.removeById(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.device.dto.DeviceLedgerDto; |
| | | import com.ruoyi.device.mapper.DeviceLedgerMapper; |
| | | import com.ruoyi.device.mapper.DeviceMaintenanceMapper; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.pojo.DeviceMaintenance; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceMaintenanceService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Anonymous; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.ehcache.spi.service.MaintainableService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "设å¤å°è´¦ç®¡ç") |
| | | @RequestMapping("/device/ledger") |
| | |
| | | |
| | | @Autowired |
| | | private IDeviceLedgerService deviceLedgerService; |
| | | |
| | | @Autowired |
| | | private DeviceLedgerMapper deviceLedgerMapper; |
| | | |
| | | @Autowired |
| | | private DeviceMaintenanceMapper deviceMaintenanceMapper; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("设å¤å°è´¦å表") |
| | | @GetMapping("/page") |
| | |
| | | return AjaxResult.success(deviceLedgerService.list(new QueryWrapper<DeviceLedger>().lambda() |
| | | .select(DeviceLedger::getId, DeviceLedger::getDeviceName,DeviceLedger::getDeviceModel))); |
| | | } |
| | | |
| | | @GetMapping("scanDevice") |
| | | @ApiOperation("è·å设å¤å°è´¦") |
| | | @Anonymous |
| | | public AjaxResult scanDevice(Long id) { |
| | | List<DeviceMaintenance> list = deviceMaintenanceMapper.list1(id); |
| | | DeviceLedger deviceLedger = deviceLedgerMapper.selectById1(id); |
| | | if (list.size()>0){ |
| | | deviceLedger.setUpdateTime(list.get(0).getMaintenanceActuallyTime());//æåç»´æ¤æ¶é´ |
| | | } |
| | | deviceLedger.setCreateTime(deviceLedger.getUpdateTime().plusMonths(1));//䏿¬¡ç»´æ¤æ¶é´ |
| | | return AjaxResult.success(deviceLedger); |
| | | } |
| | | } |
| | |
| | | @PostMapping() |
| | | @ApiModelProperty("æ·»å è®¾å¤æ¥ä¿®") |
| | | public AjaxResult add( @RequestBody DeviceRepair deviceRepair) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceRepair.getDeviceLedgerId()); |
| | | deviceRepair.setDeviceName(byId.getDeviceName()); |
| | | deviceRepair.setDeviceModel(byId.getDeviceModel()); |
| | | return deviceRepairService.saveDeviceRepair(deviceRepair); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.dto; |
| | | |
| | | import com.ruoyi.device.pojo.DeviceDefectRecord; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DeviceDefectRecordDto extends DeviceDefectRecord { |
| | | @ApiModelProperty("设å¤åç§°") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty("设å¤åå·") |
| | | private String deviceModel; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | * ç§æ·ID |
| | | */ |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty("ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty("计åè¿è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate planRuntimeTime; |
| | | |
| | | @ApiModelProperty("å¼å§è¿è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startRuntimeTime; |
| | | |
| | | @ApiModelProperty("ç»æè¿è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endRuntimeTime; |
| | | |
| | | @ApiModelProperty("è¿è¡æ¶é¿") |
| | | private String runtimeDuration; |
| | | } |
| | |
| | | @ApiModelProperty("è§æ ¼åå·") |
| | | private String deviceModel; |
| | | |
| | | @Excel(name = "计åä¿å
»æ¥æ") |
| | | @Excel(name = "计åä¿å
»æ¥æ", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30) |
| | | @ApiModelProperty("计åä¿å
»æ¥æ") |
| | | private Date maintenancePlanTime; |
| | | |
| | |
| | | private String maintenanceActuallyName; |
| | | |
| | | @ApiModelProperty("å®é
ä¿å
»æ¥æ") |
| | | @Excel(name = "å®é
ä¿å
»æ¥æ") |
| | | @Excel(name = "å®é
ä¿å
»æ¥æ", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30) |
| | | private LocalDateTime maintenanceActuallyTime; |
| | | |
| | | @ApiModelProperty("ä¿å
»ç»æ 0 ç»´ä¿® 1 å®å¥½") |
| | |
| | | private String status; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @Excel(name = "å½å
¥æ¶é´") |
| | | @Excel(name = "å½å
¥æ¶é´", dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30) |
| | | private Date createTime; |
| | | |
| | | @ApiModelProperty("å建人") |
| | | @Excel(name = "å½å
¥äºº") |
| | | // @Excel(name = "å½å
¥äºº") |
| | | private String createUser; |
| | | |
| | | } |
| | |
| | | private String deviceModel; |
| | | |
| | | @ApiModelProperty("æ¥ä¿®æ¶é´") |
| | | @Excel(name = "æ¥ä¿®æ¶é´") |
| | | @Excel(name = "æ¥ä¿®æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date repairTime; |
| | | |
| | | @ApiModelProperty("æ¥ä¿®äºº") |
| | |
| | | private String maintenanceName; |
| | | |
| | | @ApiModelProperty("ç»´ä¿®æ¶é´") |
| | | @Excel(name = "ç»´ä¿®æ¶é´") |
| | | @Excel(name = "ç»´ä¿®æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date maintenanceTime; |
| | | |
| | | @ApiModelProperty("ç»´ä¿®ç»æ") |
| | |
| | | private String statusStr; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @Excel(name = "å½å
¥æ¶é´") |
| | | @Excel(name = "å½å
¥æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDateTime createTime; |
| | | |
| | | @Excel(name = "å½å
¥äºº") |
| | | // @Excel(name = "å½å
¥äºº") |
| | | @ApiModelProperty("å建人") |
| | | private String createUser; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.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.device.dto.DeviceDefectRecordDto; |
| | | import com.ruoyi.device.pojo.DeviceDefectRecord; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface DeviceDefectRecordMapper extends BaseMapper<DeviceDefectRecord> { |
| | | IPage<DeviceDefectRecordDto> listPage(Page page,@Param("deviceDefectRecordDto") DeviceDefectRecordDto deviceDefectRecordDto); |
| | | } |
| | |
| | | package com.ruoyi.device.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | IPage<DeviceLedgerDto> queryPage(Page page, @Param("deviceLedger") DeviceLedgerDto deviceLedgerDto); |
| | | |
| | | List<DeviceLedgerExeclDto> deviceLedgerExportList(DeviceLedger deviceLedger); |
| | | |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | DeviceLedger selectById1(Long id); |
| | | } |
| | |
| | | package com.ruoyi.device.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.InterceptorIgnore; |
| | | 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.device.pojo.DeviceMaintenance; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface DeviceMaintenanceMapper extends BaseMapper<DeviceMaintenance> { |
| | | |
| | | IPage<DeviceMaintenanceDto> queryPage(Page page, DeviceMaintenanceDto deviceMaintenanceDto); |
| | | |
| | | DeviceMaintenanceDto detailById(Long id); |
| | | |
| | | @InterceptorIgnore(tenantLine = "true") |
| | | List<DeviceMaintenance> list1(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("device_defect_record") |
| | | public class DeviceDefectRecord { |
| | | @ApiModelProperty("设å¤ç¼ºé·è®°å½id") |
| | | private Long id; |
| | | @ApiModelProperty("设å¤å°è´¦id") |
| | | private Long deviceLedgerId; |
| | | @ApiModelProperty("ç¼ºé·æè¿°") |
| | | private String defectDescription; |
| | | @ApiModelProperty("ç¶æ") |
| | | private String status; |
| | | @ApiModelProperty("æ¶é¤æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime eliminateTime; |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("æ´æ°äºº") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("ç§æ·id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| | |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /* *************************** è¿è¡ç®¡ç *************************** */ |
| | | |
| | | @ApiModelProperty("ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty("计åè¿è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate planRuntimeTime; |
| | | |
| | | @ApiModelProperty("å¼å§è¿è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startRuntimeTime; |
| | | |
| | | @ApiModelProperty("ç»æè¿è¡æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endRuntimeTime; |
| | | |
| | | @ApiModelProperty("è¿è¡æ¶é¿") |
| | | private String runtimeDuration; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.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.device.dto.DeviceDefectRecordDto; |
| | | import com.ruoyi.device.pojo.DeviceDefectRecord; |
| | | |
| | | public interface DeviceDefectRecordService extends IService<DeviceDefectRecord> { |
| | | IPage<DeviceDefectRecordDto> listPage(Page page, DeviceDefectRecordDto deviceDefectRecordDto); |
| | | |
| | | boolean updateByDDR(DeviceDefectRecord deviceDefectRecord); |
| | | |
| | | boolean add(DeviceDefectRecord deviceDefectRecord); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.device.service.impl; |
| | | |
| | | 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.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.dto.DeviceDefectRecordDto; |
| | | import com.ruoyi.device.mapper.DeviceDefectRecordMapper; |
| | | import com.ruoyi.device.mapper.DeviceRepairMapper; |
| | | import com.ruoyi.device.pojo.DeviceDefectRecord; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.service.DeviceDefectRecordService; |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class DeviceDefectRecordServiceImpl extends ServiceImpl<DeviceDefectRecordMapper, DeviceDefectRecord> implements DeviceDefectRecordService { |
| | | @Autowired |
| | | private DeviceDefectRecordMapper deviceDefectRecordMapper; |
| | | |
| | | @Autowired |
| | | private DeviceRepairMapper deviceRepairMapper; |
| | | |
| | | @Override |
| | | public IPage<DeviceDefectRecordDto> listPage(Page page, DeviceDefectRecordDto deviceDefectRecordDto) { |
| | | return deviceDefectRecordMapper.listPage(page, deviceDefectRecordDto); |
| | | } |
| | | @Override |
| | | public boolean add(DeviceDefectRecord deviceDefectRecord) { |
| | | String status = deviceDefectRecord.getStatus(); |
| | | if (status.equals("严é缺é·")) { |
| | | DeviceRepair deviceRepair = new DeviceRepair(); |
| | | deviceRepair.setDeviceLedgerId(deviceDefectRecord.getDeviceLedgerId()); |
| | | deviceRepair.setRemark(deviceDefectRecord.getDefectDescription()); |
| | | //è·åå½åç»å½ç¨æ· |
| | | deviceRepair.setRepairName(SecurityUtils.getUsername()); |
| | | deviceRepair.setRepairTime(new Date()); |
| | | deviceRepairMapper.insert(deviceRepair); |
| | | return deviceDefectRecordMapper.insert(deviceDefectRecord) > 0; |
| | | } else if (status.equals("ä¸è¬ç¼ºé·")) { |
| | | return deviceDefectRecordMapper.insert(deviceDefectRecord) > 0; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateByDDR(DeviceDefectRecord deviceDefectRecord) { |
| | | String status = deviceDefectRecord.getStatus(); |
| | | if (status.equals("严é缺é·")) { |
| | | // deviceDefectRecord.setStatus("æ£å¸¸"); |
| | | // deviceDefectRecord.setEliminateTime(LocalDateTime.now()); |
| | | throw new RuntimeException("严é缺é·-设å¤ç»´ä¿®åæ´æ°ä¸ºæ£å¸¸ç¶æ"); |
| | | } else if (status.equals("ä¸è¬ç¼ºé·")) { |
| | | deviceDefectRecord.setStatus("æ£å¸¸"); |
| | | } |
| | | deviceDefectRecord.setEliminateTime(LocalDateTime.now()); |
| | | return updateById(deviceDefectRecord); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.ZoneOffset; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, Long[] ids) { |
| | | ArrayList<Long> arrayList = new ArrayList<>(); |
| | | Arrays.stream(ids).map(id -> { |
| | | return arrayList.add( id); |
| | | }); |
| | | List<DeviceMaintenance> supplierManageList = deviceMaintenanceMapper.selectBatchIds(arrayList); |
| | | List<DeviceMaintenance> supplierManageList = deviceMaintenanceMapper.selectList(null); |
| | | ArrayList<DeviceMaintenanceExeclDto> deviceLedgerExeclDtos = new ArrayList<>(); |
| | | supplierManageList.stream().forEach(deviceMaintenance -> { |
| | | supplierManageList.forEach(deviceMaintenance -> { |
| | | DeviceMaintenanceExeclDto deviceRepairExeclDto = new DeviceMaintenanceExeclDto(); |
| | | BeanUtils.copyProperties(deviceMaintenance,deviceRepairExeclDto); |
| | | deviceRepairExeclDto.setStatus(deviceMaintenance.getStatus() == 0 ? "å¾
ç»´ä¿®" : "å®ç»"); |
| | | deviceRepairExeclDto.setMaintenanceResult(deviceMaintenance.getMaintenanceResult() == 0 ? "ç»´ä¿®" : "å®å¥½"); |
| | | deviceRepairExeclDto.setMaintenanceResult(deviceMaintenance.getMaintenanceResult() != null && deviceMaintenance.getMaintenanceResult() == 0 ? "ç»´ä¿®" : "å®å¥½"); |
| | | |
| | | deviceLedgerExeclDtos.add(deviceRepairExeclDto); |
| | | }); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.dto.DeviceDefectRecordDto; |
| | | import com.ruoyi.device.dto.DeviceRepairDto; |
| | | import com.ruoyi.device.execl.DeviceRepairExeclDto; |
| | | import com.ruoyi.device.mapper.DeviceDefectRecordMapper; |
| | | import com.ruoyi.device.mapper.DeviceRepairMapper; |
| | | import com.ruoyi.device.pojo.DeviceDefectRecord; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.device.service.DeviceDefectRecordService; |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceRepairService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | @Slf4j |
| | | public class DeviceRepairServiceImpl extends ServiceImpl<DeviceRepairMapper, DeviceRepair> implements IDeviceRepairService { |
| | | |
| | | |
| | | @Autowired |
| | | private DeviceDefectRecordService deviceDefectRecordService; |
| | | @Autowired |
| | | private DeviceRepairMapper deviceRepairMapper; |
| | | |
| | | @Autowired |
| | | private IDeviceLedgerService deviceLedgerService; |
| | | @Override |
| | | public IPage<DeviceRepairDto> queryPage(Page page, DeviceRepairDto deviceRepairDto) { |
| | | |
| | |
| | | |
| | | @Override |
| | | public AjaxResult saveDeviceRepair(DeviceRepair deviceRepair) { |
| | | DeviceLedger byId = deviceLedgerService.getById(deviceRepair.getDeviceLedgerId()); |
| | | deviceRepair.setDeviceName(byId.getDeviceName()); |
| | | deviceRepair.setDeviceModel(byId.getDeviceModel()); |
| | | boolean save = this.save(deviceRepair); |
| | | if (save){ |
| | | return AjaxResult.success(); |
| | |
| | | @Override |
| | | public AjaxResult updateDeviceRepair(DeviceRepair deviceRepair) { |
| | | if (this.updateById(deviceRepair)) { |
| | | Long id = deviceRepair.getId(); |
| | | // |
| | | DeviceDefectRecordDto deviceDefectRecordDto = new DeviceDefectRecordDto(); |
| | | deviceDefectRecordDto.setDeviceLedgerId(id); |
| | | deviceDefectRecordDto.setStatus("严é缺é·"); |
| | | List<DeviceDefectRecordDto> records = deviceDefectRecordService.listPage(new Page<>(1, -1), deviceDefectRecordDto).getRecords(); |
| | | if (!records.isEmpty()){ |
| | | records.forEach(deviceDefectRecord -> { |
| | | deviceDefectRecord.setStatus("æ£å¸¸"); |
| | | deviceDefectRecordService.updateByDDR(deviceDefectRecord); |
| | | }); |
| | | } |
| | | return AjaxResult.success(); |
| | | } |
| | | return AjaxResult.error(); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.dto; |
| | | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/3 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | public class PageDto implements Serializable { |
| | | private Integer current = 1; |
| | | private Integer size = 100; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.equipmentenergyconsumption.dto.ElectricityConsumptionAreaTreeDto; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.ElectricityConsumptionArea; |
| | | import com.ruoyi.equipmentenergyconsumption.service.ElectricityConsumptionAreaService; |
| | | 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 io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "ç¨çµåºå") |
| | | @RequestMapping("/electricityConsumptionArea") |
| | | public class ElectricityConsumptionAreaController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ElectricityConsumptionAreaService electricityConsumptionAreaService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ ç»æ |
| | | */ |
| | | @GetMapping("/list") |
| | | public List<ElectricityConsumptionAreaTreeDto> selectElectricityConsumptionAreaList() { |
| | | return electricityConsumptionAreaService.selectElectricityConsumptionAreaList(); |
| | | } |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("ç¨çµåºå-å页æ¥è¯¢") |
| | | @Log(title = "ç¨çµåºå-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, ElectricityConsumptionArea electricityConsumptionArea) { |
| | | IPage<ElectricityConsumptionArea> listPage = electricityConsumptionAreaService.listPage(page, electricityConsumptionArea); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("ç¨çµåºå-æ°å¢") |
| | | @Log(title = "ç¨çµåºå-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody ElectricityConsumptionArea electricityConsumptionArea) { |
| | | boolean save = electricityConsumptionAreaService.saveOrUpdate(electricityConsumptionArea); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("ç¨çµåºå-å é¤") |
| | | @Log(title = "ç¨çµåºå-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean remove = electricityConsumptionAreaService.removeBatchByIds(ids); |
| | | return remove ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.ElectricityConsumptionArea; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.EnergyPeriod; |
| | | import com.ruoyi.equipmentenergyconsumption.service.EnergyPeriodService; |
| | | 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 io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/energyPeriod") |
| | | @Api(tags = "ç¨çµæ¶æ®µ") |
| | | public class EnergyPeriodController extends BaseController { |
| | | @Autowired |
| | | private EnergyPeriodService energyPeriodService; |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("ç¨çµæ¶æ®µ-å页æ¥è¯¢") |
| | | @Log(title = "ç¨çµæ¶æ®µ-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, EnergyPeriod energyPeriod) { |
| | | IPage<EnergyPeriod> listPage = energyPeriodService.listPage(page, energyPeriod); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("ç¨çµæ¶æ®µ-æ°å¢") |
| | | @Log(title = "ç¨çµæ¶æ®µ-æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody EnergyPeriod energyPeriod) { |
| | | boolean save = energyPeriodService.save(energyPeriod); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/addBatch") |
| | | @ApiOperation("ç¨çµæ¶æ®µ-æ¹éæ°å¢") |
| | | @Log(title = "ç¨çµæ¶æ®µ-æ¹éæ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult addBatch(@RequestBody List<EnergyPeriod> energyPeriods) { |
| | | boolean save = energyPeriodService.saveBatch(energyPeriods); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ç¨çµæ¶æ®µ-ä¿®æ¹") |
| | | @Log(title = "ç¨çµæ¶æ®µ-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody EnergyPeriod energyPeriod) { |
| | | boolean update = energyPeriodService.updateById(energyPeriod); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("ç¨çµæ¶æ®µ-å é¤") |
| | | @Log(title = "ç¨çµæ¶æ®µ-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean remove = energyPeriodService.removeBatchByIds(ids); |
| | | return remove ? AjaxResult.success() : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导åºç¨çµæ¶æ®µ |
| | | */ |
| | | @Log(title = "导åºç¨çµæ¶æ®µ", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åºç¨çµæ¶æ®µ") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | EnergyPeriod energyPeriod = new EnergyPeriod(); |
| | | IPage<EnergyPeriod> listPage = energyPeriodService.listPage(page, energyPeriod); |
| | | ExcelUtil<EnergyPeriod> util = new ExcelUtil<EnergyPeriod>(EnergyPeriod.class); |
| | | util.exportExcel(response, listPage.getRecords() , "ç¨çµæ¶æ®µæ°æ®"); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.equipmentenergyconsumption.dto.EquipmentEnergyConsumptionDto; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.EquipmentEnergyConsumption; |
| | | import com.ruoyi.equipmentenergyconsumption.service.EquipmentEnergyConsumptionService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/addBatch") |
| | | @ApiOperation("设å¤è½è-æ¹éæ°å¢") |
| | | @Log(title = "设å¤è½è-æ¹éæ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult addBatch(@RequestBody List<EquipmentEnergyConsumption> list) { |
| | | boolean save = equipmentEnergyConsumptionService.saveBatch(list); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("设å¤è½è-ä¿®æ¹") |
| | | @Log(title = "设å¤è½è-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åºè®¾å¤è½è") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page<>(-1,-1); |
| | | EquipmentEnergyConsumption equipmentEnergyConsumption = new EquipmentEnergyConsumption(); |
| | | IPage<EquipmentEnergyConsumption> listPage = equipmentEnergyConsumptionService.listPage(page, equipmentEnergyConsumption); |
| | | ExcelUtil<EquipmentEnergyConsumption> util = new ExcelUtil<EquipmentEnergyConsumption>(EquipmentEnergyConsumption.class); |
| | | util.exportExcel(response, null , "å®¢æ·æ¡£æ¡æ°æ®"); |
| | | util.exportExcel(response, listPage.getRecords() , "导åºè®¾å¤è½è"); |
| | | } |
| | | |
| | | @GetMapping("/listPageByTrend") |
| | |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | /** |
| | | * 导åºè½æºè¶å¿ |
| | | */ |
| | | @Log(title = "导åºè½æºè¶å¿", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportTwo") |
| | | @ApiOperation("导åºè½æºè¶å¿") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | Page page = new Page<>(-1,-1); |
| | | EquipmentEnergyConsumption equipmentEnergyConsumption = new EquipmentEnergyConsumption(); |
| | | IPage<EquipmentEnergyConsumption> listPage = equipmentEnergyConsumptionService.listPageByTrend(page, equipmentEnergyConsumption); |
| | | List<EquipmentEnergyConsumptionDto> list = new ArrayList<>(); |
| | | listPage.getRecords().forEach(item -> { |
| | | EquipmentEnergyConsumptionDto dto = new EquipmentEnergyConsumptionDto(); |
| | | BeanUtils.copyProperties(item, dto); |
| | | list.add(dto); |
| | | }); |
| | | ExcelUtil<EquipmentEnergyConsumptionDto> util = new ExcelUtil<EquipmentEnergyConsumptionDto>(EquipmentEnergyConsumptionDto.class); |
| | | util.exportExcel(response, list , "导åºè½æºè¶å¿"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Data |
| | | public class ElectricityConsumptionAreaTreeDto { |
| | | |
| | | private Long id; |
| | | private Long parentId; |
| | | private String productName; |
| | | private String label; // ç¨äºæ å½¢ç»æçæ¾ç¤ºåç§° |
| | | private List<ElectricityConsumptionAreaTreeDto> children; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.dto; |
| | | |
| | | 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.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/11/3 15:22 |
| | | */ |
| | | @Data |
| | | public class EquipmentEnergyConsumptionDto { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 设å¤ç¼å· |
| | | */ |
| | | @ApiModelProperty("设å¤ç¼å·") |
| | | @Excel(name = "è§æ ¼åå·") |
| | | private String code; |
| | | |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @ApiModelProperty("设å¤åç§°") |
| | | @Excel(name = "设å¤åç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * é¢å®åç |
| | | */ |
| | | @ApiModelProperty("é¢å®åç") |
| | | // @Excel(name = "é¢å®åç") |
| | | private String powerRating; |
| | | |
| | | /** |
| | | * å®é
åç |
| | | */ |
| | | @ApiModelProperty("å®é
åç") |
| | | // @Excel(name = "å®é
åç") |
| | | private String powerActual; |
| | | |
| | | |
| | | /** |
| | | * 彿¥ç¨çµé |
| | | */ |
| | | @ApiModelProperty("彿¥ç¨çµé") |
| | | // @Excel(name = "彿¥ç¨çµé") |
| | | private BigDecimal dayNum; |
| | | |
| | | /** |
| | | * æ¨ç¨çµé |
| | | */ |
| | | @ApiModelProperty("æ¨ç¨çµé") |
| | | @TableField(exist = false) |
| | | @Excel(name = "æ¨ç¨çµé") |
| | | private BigDecimal toDayNum; |
| | | |
| | | /** |
| | | * æ¬æå¹³åçµéï¼30天计ç®ï¼ |
| | | */ |
| | | @ApiModelProperty("æ¬æå¹³åçµéï¼30天计ç®ï¼") |
| | | @TableField(exist = false) |
| | | @Excel(name = "æ¬æå¹³åçµé") |
| | | private BigDecimal avgNum; |
| | | |
| | | |
| | | /** |
| | | * è¶å¿ |
| | | */ |
| | | @ApiModelProperty("è¶å¿") |
| | | @TableField(exist = false) |
| | | @Excel(name = "è¶å¿") |
| | | private String trend; |
| | | |
| | | /** |
| | | * 累计ç¨çµé |
| | | */ |
| | | @ApiModelProperty("累计ç¨çµé") |
| | | // @Excel(name = "累计ç¨çµé") |
| | | private BigDecimal sumNum; |
| | | /** |
| | | * è¿è¡æ¶é´ |
| | | */ |
| | | @ApiModelProperty("è¿è¡æ¶é´") |
| | | @Excel(name = "è¿è¡æ¶é´" , width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date runDate; |
| | | |
| | | /** |
| | | * æ¯æ¥éå¶çµé |
| | | */ |
| | | @ApiModelProperty("æ¯æ¥éå¶çµé") |
| | | // @Excel(name = "æ¯æ¥éå¶çµé") |
| | | private BigDecimal everyNum; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.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.equipmentenergyconsumption.pojo.ElectricityConsumptionArea; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | @Mapper |
| | | public interface ElectricityConsumptionAreaMapper extends BaseMapper<ElectricityConsumptionArea> { |
| | | |
| | | IPage<ElectricityConsumptionArea> listPage(Page page, @Param("electricityConsumptionArea") ElectricityConsumptionArea electricityConsumptionArea); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.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.equipmentenergyconsumption.pojo.EnergyPeriod; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface EnergyPeriodMapper extends BaseMapper<EnergyPeriod> { |
| | | IPage<EnergyPeriod> listPage(Page page, EnergyPeriod energyPeriod); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | @TableName("electricity_consumption_area") |
| | | @ApiModel |
| | | public class ElectricityConsumptionArea { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * åºååç§° |
| | | */ |
| | | @ApiModelProperty("åºååç§°") |
| | | private String areaName; |
| | | |
| | | /** |
| | | * åºåç±»å |
| | | */ |
| | | @ApiModelProperty("åºåç±»å") |
| | | private String areaType; |
| | | /** |
| | | * æåº |
| | | */ |
| | | private Long sort; |
| | | |
| | | /** |
| | | * ç¶ç±»id |
| | | */ |
| | | private Long fuId; |
| | | /** |
| | | * ç§æ·id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.pojo; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("energy_period") |
| | | @ApiModel |
| | | public class EnergyPeriod { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * æ¥æ |
| | | */ |
| | | @ApiModelProperty("æ¥æ") |
| | | @Excel(name = "æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date date; |
| | | /** |
| | | * åä»· |
| | | */ |
| | | @ApiModelProperty("åä»·") |
| | | @Excel(name = "åä»·") |
| | | private Double price; |
| | | /** |
| | | * ç§æ·id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | /** |
| | | * 峰段 |
| | | */ |
| | | @ApiModelProperty("峰段") |
| | | @Excel(name = "峰段") |
| | | private Double peak; |
| | | /** |
| | | * 谷段 |
| | | */ |
| | | @ApiModelProperty("谷段") |
| | | @Excel(name = "谷段") |
| | | private Double valley; |
| | | /** |
| | | * 平段 |
| | | */ |
| | | @ApiModelProperty("平段") |
| | | @Excel(name = "平段") |
| | | private Double flat; |
| | | /** |
| | | * å°æ®µ |
| | | */ |
| | | @ApiModelProperty("å°æ®µ") |
| | | @Excel(name = "å°æ®µ") |
| | | private Double sharp; |
| | | } |
| | |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | /** |
| | | *æå±ç¨çµåºåid |
| | | */ |
| | | private Long electricityConsumptionAreaId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.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.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.equipmentenergyconsumption.dto.ElectricityConsumptionAreaTreeDto; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.ElectricityConsumptionArea; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ElectricityConsumptionAreaService extends IService<ElectricityConsumptionArea> { |
| | | IPage<ElectricityConsumptionArea> listPage(Page page, ElectricityConsumptionArea electricityConsumptionArea); |
| | | |
| | | List<ElectricityConsumptionAreaTreeDto> selectElectricityConsumptionAreaList(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.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.equipmentenergyconsumption.pojo.EnergyPeriod; |
| | | |
| | | public interface EnergyPeriodService extends IService<EnergyPeriod> { |
| | | IPage<EnergyPeriod> listPage(Page page, EnergyPeriod energyPeriod); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.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.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.equipmentenergyconsumption.dto.ElectricityConsumptionAreaTreeDto; |
| | | import com.ruoyi.equipmentenergyconsumption.mapper.ElectricityConsumptionAreaMapper; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.ElectricityConsumptionArea; |
| | | import com.ruoyi.equipmentenergyconsumption.service.ElectricityConsumptionAreaService; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class ElectricityConsumptionAreaServiceImpl extends ServiceImpl<ElectricityConsumptionAreaMapper, ElectricityConsumptionArea> implements ElectricityConsumptionAreaService { |
| | | |
| | | @Autowired |
| | | private ElectricityConsumptionAreaMapper electricityConsumptionAreaMapper; |
| | | |
| | | @Override |
| | | public IPage<ElectricityConsumptionArea> listPage(Page page, ElectricityConsumptionArea electricityConsumptionArea) { |
| | | return electricityConsumptionAreaMapper.listPage(page,electricityConsumptionArea); |
| | | } |
| | | |
| | | |
| | | //左侧æ ç»æ |
| | | @Override |
| | | public List<ElectricityConsumptionAreaTreeDto> selectElectricityConsumptionAreaList() { |
| | | // æ¥è¯¢æ ¹èç¹ï¼parentId 为 nullï¼ |
| | | LambdaQueryWrapper<ElectricityConsumptionArea> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.isNull(ElectricityConsumptionArea::getFuId); |
| | | // æ¥è¯¢æ ¹èç¹å表 |
| | | List<ElectricityConsumptionArea> rootProducts = electricityConsumptionAreaMapper.selectList(queryWrapper); |
| | | |
| | | // 转æ¢ä¸ºæ èç¹å¹¶éå½æå»ºåæ |
| | | List<ElectricityConsumptionAreaTreeDto> tree = new ArrayList<>(); |
| | | for (ElectricityConsumptionArea electricityConsumptionArea : rootProducts) { |
| | | ElectricityConsumptionAreaTreeDto node = convertToTreeDto(electricityConsumptionArea); |
| | | node.setChildren(buildChildrenNodes(electricityConsumptionArea.getId())); |
| | | tree.add(node); |
| | | } |
| | | return tree; |
| | | } |
| | | |
| | | // å° Product 转æ¢ä¸º ProductTreeDto |
| | | private ElectricityConsumptionAreaTreeDto convertToTreeDto(ElectricityConsumptionArea electricityConsumptionArea) { |
| | | ElectricityConsumptionAreaTreeDto dto = new ElectricityConsumptionAreaTreeDto(); |
| | | BeanUtils.copyProperties(electricityConsumptionArea, dto); |
| | | dto.setLabel(electricityConsumptionArea.getAreaName()); // 设置 label 为产ååç§° |
| | | dto.setChildren(new ArrayList<>()); |
| | | return dto; |
| | | } |
| | | |
| | | // éå½æå»ºåèç¹ |
| | | private List<ElectricityConsumptionAreaTreeDto> buildChildrenNodes(Long parentId) { |
| | | // æ¥è¯¢å½åç¶èç¹çåèç¹ |
| | | LambdaQueryWrapper<ElectricityConsumptionArea> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(ElectricityConsumptionArea::getFuId, parentId); |
| | | List<ElectricityConsumptionArea> childProducts = electricityConsumptionAreaMapper.selectList(queryWrapper); |
| | | |
| | | // 转æ¢åèç¹å¹¶éå½æå»ºå®ä»¬çåæ |
| | | List<ElectricityConsumptionAreaTreeDto> children = new ArrayList<>(); |
| | | for (ElectricityConsumptionArea child : childProducts) { |
| | | ElectricityConsumptionAreaTreeDto childNode = convertToTreeDto(child); |
| | | childNode.setChildren(buildChildrenNodes(child.getId())); |
| | | children.add(childNode); |
| | | } |
| | | return children; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.equipmentenergyconsumption.service.impl; |
| | | |
| | | 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.equipmentenergyconsumption.mapper.EnergyPeriodMapper; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.EnergyPeriod; |
| | | import com.ruoyi.equipmentenergyconsumption.service.EnergyPeriodService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | @Slf4j |
| | | public class EnergyPeriodServiceImpl extends ServiceImpl<EnergyPeriodMapper, EnergyPeriod> implements EnergyPeriodService { |
| | | @Autowired |
| | | private EnergyPeriodMapper energyPeriodMapper; |
| | | |
| | | @Override |
| | | public IPage<EnergyPeriod> listPage(Page page, EnergyPeriod energyPeriod) { |
| | | IPage<EnergyPeriod> listPage = energyPeriodMapper.listPage(page, energyPeriod); |
| | | return listPage; |
| | | } |
| | | } |
| | |
| | | .build()
|
| | | /* 设置å®å
¨æ¨¡å¼ï¼swaggerå¯ä»¥è®¾ç½®è®¿é®token */
|
| | | .securitySchemes(securitySchemes())
|
| | | .securityContexts(securityContexts())
|
| | | .pathMapping(pathMapping);
|
| | | .securityContexts(securityContexts());
|
| | | // .pathMapping(pathMapping);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @GetMapping("/todos") |
| | | @Log(title = "å¾
åäºé¡¹", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å¾
åäºé¡¹") |
| | | public AjaxResult todos(ApproveProcess req) { |
| | | public AjaxResult todos(ApproveProcess req) throws ParseException { |
| | | List<ApproveProcess> approveProcessList = homeService.todos(); |
| | | return AjaxResult.success(approveProcessList); |
| | | } |
| | |
| | | import com.ruoyi.home.dto.QualityStatisticsDto; |
| | | import com.ruoyi.home.dto.StatisticsReceivablePayableDto; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | QualityStatisticsDto qualityStatistics(); |
| | | |
| | | List<ApproveProcess> todos(); |
| | | List<ApproveProcess> todos() throws ParseException; |
| | | |
| | | StatisticsReceivablePayableDto statisticsReceivablePayable(Integer type); |
| | | } |
| | |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.home.dto.*; |
| | | import com.ruoyi.home.service.HomeService; |
| | | import com.ruoyi.lavorissue.mapper.LavorIssueMapper; |
| | | import com.ruoyi.lavorissue.pojo.LaborIssue; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordMapper; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | |
| | | |
| | | @Autowired |
| | | private PaymentRegistrationMapper paymentRegistrationMapper; |
| | | |
| | | @Autowired |
| | | private LavorIssueMapper lavorIssueMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ApproveProcess> todos() { |
| | | public List<ApproveProcess> todos() throws ParseException { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | LambdaQueryWrapper<ApproveProcess> approveProcessLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | approveProcessLambdaQueryWrapper.eq(ApproveProcess::getApproveDelete, 0) |
| | | .eq(ApproveProcess::getApproveUserCurrentId, loginUser.getUserId()) |
| | | .ne(ApproveProcess::getApproveStatus, 2) |
| | | .eq(ApproveProcess::getTenantId, loginUser.getTenantId()); |
| | | return approveProcessMapper.selectList(approveProcessLambdaQueryWrapper); |
| | | List<ApproveProcess> approveProcesses = approveProcessMapper.selectList(approveProcessLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty(approveProcesses)){ |
| | | approveProcesses = new ArrayList<>(); |
| | | } |
| | | // æ¥è¯¢æªé¢ç¨å³ä¿è®°å½ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | LaborIssue laborIssue1 = new LaborIssue(); |
| | | laborIssue1.setAdoptedDate(new Date()); |
| | | laborIssue1.setIssueDate(sdf.parse(sdf.format(new Date()))); |
| | | List<LaborIssue> laborIssues = lavorIssueMapper.list(laborIssue1); |
| | | if(!CollectionUtils.isEmpty(laborIssues)){ |
| | | for (LaborIssue laborIssue : laborIssues) { |
| | | ApproveProcess approveProcess = new ApproveProcess(); |
| | | approveProcess.setApproveId(laborIssue.getOrderNo()); |
| | | approveProcess.setApproveDeptName(sysDeptMapper.selectDeptById(loginUser.getTenantId()).getDeptName()); |
| | | approveProcess.setApproveTime(laborIssue.getIssueDate()); |
| | | approveProcess.setApproveReason(laborIssue.getDictTypeName() + "-" + laborIssue.getDictName() + "è¶
æ¶æªé¢å"); |
| | | approveProcesses.add(approveProcess); |
| | | } |
| | | } |
| | | return approveProcesses; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | // åºæ¶ |
| | | List<SalesLedger> salesLedgers = salesLedgerMapper.selectList(new LambdaQueryWrapper<SalesLedger>() |
| | | .ge(SalesLedger::getEntryDate, startDate) |
| | | .lt(SalesLedger::getEntryDate, endDate) |
| | | // .ge(SalesLedger::getEntryDate, startDate) |
| | | // .lt(SalesLedger::getEntryDate, endDate) |
| | | ); |
| | | BigDecimal receivableMoney = salesLedgers.stream().map(SalesLedger::getContractAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // åºä» |
| | | List<PurchaseLedger> procurementRecords = purchaseLedgerMapper.selectList(new LambdaQueryWrapper<PurchaseLedger>() |
| | | .ge(PurchaseLedger::getEntryDate, startDate) |
| | | .lt(PurchaseLedger::getEntryDate, endDate) |
| | | // .ge(PurchaseLedger::getEntryDate, startDate) |
| | | // .lt(PurchaseLedger::getEntryDate, endDate) |
| | | ); |
| | | BigDecimal payableMoney = procurementRecords.stream().map(PurchaseLedger::getContractAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 颿¶ |
| | | List<ReceiptPayment> receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>() |
| | | .ge(ReceiptPayment::getReceiptPaymentDate, startDate) |
| | | .lt(ReceiptPayment::getReceiptPaymentDate, endDate)); |
| | | // .ge(ReceiptPayment::getReceiptPaymentDate, startDate) |
| | | // .lt(ReceiptPayment::getReceiptPaymentDate, endDate) |
| | | ); |
| | | BigDecimal advanceMoney = receiptPayments.stream().map(ReceiptPayment::getReceiptPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // é¢ä» |
| | | List<PaymentRegistration> paymentRegistrations = paymentRegistrationMapper.selectList(new LambdaQueryWrapper<PaymentRegistration>() |
| | | .ge(PaymentRegistration::getPaymentDate, startDate) |
| | | .lt(PaymentRegistration::getPaymentDate, endDate)); |
| | | // .ge(PaymentRegistration::getPaymentDate, startDate) |
| | | // .lt(PaymentRegistration::getPaymentDate, endDate) |
| | | ); |
| | | BigDecimal prepayMoney = paymentRegistrations.stream().map(PaymentRegistration::getCurrentPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | StatisticsReceivablePayableDto statisticsReceivablePayableDto = new StatisticsReceivablePayableDto(); |
| | | statisticsReceivablePayableDto.setPayableMoney(payableMoney); |
| | | statisticsReceivablePayableDto.setReceivableMoney(receivableMoney); |
| | | statisticsReceivablePayableDto.setPayableMoney(payableMoney.subtract(prepayMoney)); |
| | | statisticsReceivablePayableDto.setReceivableMoney(receivableMoney.subtract(advanceMoney)); |
| | | statisticsReceivablePayableDto.setAdvanceMoney(advanceMoney); |
| | | statisticsReceivablePayableDto.setPrepayMoney(prepayMoney); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * éä»¶è®°å½ç±»åæä¸¾ |
| | | * |
| | | */ |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum StorageAttachmentRecordType { |
| | | // ä¾å å®é
å¼å请å é¤ |
| | | Template("Template","èä¾"), |
| | | Archives("Archives","ææ¡£ç®¡ç"), |
| | | InspectionTasks("InspectionTasks","ç产巡æ£"), |
| | | QrCodeScanRecords("QrCodeScanRecords","äºç»´ç æ«ç è®°å½æä»¶"); |
| | | |
| | | |
| | | private final String code; |
| | | private final String info; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.inspectiontask.dto.InspectionTaskDto; |
| | | import com.ruoyi.inspectiontask.dto.TimingTaskDto; |
| | | import com.ruoyi.inspectiontask.pojo.InspectionTask; |
| | | import com.ruoyi.inspectiontask.service.InspectionTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:52 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å·¡æ£ä»»å¡ç®¡ç") |
| | | @RequestMapping("/inspectionTask") |
| | | public class InspectionTaskController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InspectionTaskService inspectionTaskService; |
| | | |
| | | /** |
| | | * å·¡æ£ä»»å¡è¡¨è¡¨æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("å·¡æ£ä»»å¡è¡¨è¡¨æ¥è¯¢") |
| | | public R<IPage<InspectionTaskDto>> list(Page<InspectionTask> page, InspectionTaskDto inspectionTaskDto) { |
| | | IPage<InspectionTaskDto> list = inspectionTaskService.selectInspectionTaskList(page,inspectionTaskDto); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导åºå®æ¶ä»»å¡è®°å½") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page<>(-1,-1); |
| | | InspectionTaskDto timingTask = new InspectionTaskDto(); |
| | | IPage<InspectionTaskDto> list = inspectionTaskService.selectInspectionTaskList(page,timingTask); |
| | | ExcelUtil<InspectionTaskDto> util = new ExcelUtil<>(InspectionTaskDto.class); |
| | | util.exportExcel(response, list.getRecords(), "导åºå®æ¶ä»»å¡è®°å½"); |
| | | } |
| | | |
| | | /** |
| | | * å·¡æ£ä»»å¡è¡¨æ°å¢ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/addOrEditInspectionTask") |
| | | @ApiOperation("å·¡æ£ä»»å¡è¡¨æ°å¢ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addOrEditInspectionTask(@RequestBody InspectionTaskDto inspectionTaskDto) { |
| | | return R.ok(inspectionTaskService.addOrEditInspectionTask(inspectionTaskDto)); |
| | | } |
| | | |
| | | /** |
| | | * å·¡æ£ä»»å¡è¡¨å é¤ |
| | | */ |
| | | @DeleteMapping("/delInspectionTask") |
| | | @ApiOperation("å·¡æ£ä»»å¡è¡¨å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R remove(@RequestBody Long[] ids) { |
| | | return R.ok(inspectionTaskService.delByIds(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.inspectiontask.dto.QrCodeDto; |
| | | import com.ruoyi.inspectiontask.pojo.QrCode; |
| | | import com.ruoyi.inspectiontask.service.QrCodeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:52 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "äºç»´ç 管ç") |
| | | @RequestMapping("/qrCode") |
| | | public class QrCodeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private QrCodeService qrCodeService; |
| | | |
| | | /** |
| | | * äºç»´ç 管ç表æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("äºç»´ç 管ç表æ¥è¯¢") |
| | | public R<IPage<QrCode>> list(Page page, QrCodeDto qrCodeDto) { |
| | | IPage<QrCode> list = qrCodeService.selectQrCodeList(page, qrCodeDto); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * äºç»´ç 管ç表æ°å¢ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/addOrEditQrCode") |
| | | @ApiOperation("äºç»´ç 管ç表æ°å¢ä¿®æ¹") |
| | | public R<Long> addOrEditQrCode(@RequestBody QrCodeDto qrCodeDto) { |
| | | return R.ok(qrCodeService.addOrEditQrCode(qrCodeDto)); |
| | | } |
| | | |
| | | /** |
| | | * äºç»´ç 管ç表å é¤ |
| | | */ |
| | | @DeleteMapping("/delQrCode") |
| | | @ApiOperation("äºç»´ç 管ç表å é¤") |
| | | public R remove(@RequestBody Long[] ids) { |
| | | return R.ok(qrCodeService.delByIds(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.inspectiontask.dto.QrCodeScanRecordDto; |
| | | import com.ruoyi.inspectiontask.pojo.QrCodeScanRecord; |
| | | import com.ruoyi.inspectiontask.service.QrCodeScanRecordService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:53 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "äºç»´ç æ«æè®°å½ç®¡ç") |
| | | @RequestMapping("/qrCodeScanRecord") |
| | | public class QrCodeScanRecordController extends BaseController { |
| | | |
| | | @Autowired |
| | | private QrCodeScanRecordService qrCodeScanRecordService; |
| | | |
| | | /** |
| | | * äºç»´ç æ«ç è®°å½è¡¨æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation("äºç»´ç æ«ç è®°å½è¡¨æ¥è¯¢") |
| | | public R<IPage<QrCodeScanRecordDto>> list(Page<QrCodeScanRecord> page, QrCodeScanRecordDto qrCodeScanRecordDto) { |
| | | IPage<QrCodeScanRecordDto> list = qrCodeScanRecordService.selectQrCodeScanRecordList(page, qrCodeScanRecordDto); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * äºç»´ç æ«ç è®°å½è¡¨æ°å¢ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/addOrEditQrCodeRecord") |
| | | @ApiOperation("äºç»´ç æ«ç è®°å½è¡¨æ°å¢ä¿®æ¹") |
| | | public R addOrEditQrCodeRecord(@RequestBody QrCodeScanRecordDto qrCodeScanRecordDto) { |
| | | return R.ok(qrCodeScanRecordService.addOrEditQrCodeRecord(qrCodeScanRecordDto)); |
| | | } |
| | | |
| | | /** |
| | | * äºç»´ç æ«ç è®°å½è¡¨å é¤ |
| | | */ |
| | | @DeleteMapping("/delSalesRecord") |
| | | @ApiOperation("äºç»´ç æ«ç è®°å½è¡¨å é¤") |
| | | public R remove(@RequestBody Long[] ids) { |
| | | return R.ok(qrCodeScanRecordService.delByIds(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.inspectiontask.dto.TimingTaskDto; |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import com.ruoyi.inspectiontask.service.TimingTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.quartz.SchedulerException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:53 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "宿¶ä»»å¡ç®¡ç") |
| | | @RequestMapping("/timingTask") |
| | | public class TimingTaskController extends BaseController { |
| | | |
| | | |
| | | @Autowired |
| | | private TimingTaskService timingTaskService; |
| | | |
| | | /** |
| | | * 宿¶å·¡æ£ä»»å¡è¡¨æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "宿¶ä»»å¡å表") |
| | | public R<IPage<TimingTaskDto>> list(Page<TimingTask> page, TimingTask timingTask) { |
| | | IPage<TimingTaskDto> list = timingTaskService.selectTimingTaskList(page,timingTask); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation(value = "导åºå®æ¶ä»»å¡") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page<>(-1,-1); |
| | | TimingTaskDto timingTask = new TimingTaskDto(); |
| | | IPage<TimingTaskDto> list = timingTaskService.selectTimingTaskList(page,timingTask); |
| | | ExcelUtil<TimingTaskDto> util = new ExcelUtil<>(TimingTaskDto.class); |
| | | util.exportExcel(response, list.getRecords(), "导åºå®æ¶ä»»å¡"); |
| | | } |
| | | |
| | | /** |
| | | * 宿¶å·¡æ£ä»»å¡è¡¨æ°å¢ä¿®æ¹ |
| | | */ |
| | | @PostMapping("/addOrEditTimingTask") |
| | | @ApiOperation(value = "æ°å¢ä¿®æ¹å®æ¶ä»»å¡") |
| | | public R addOrEditTimingTask(@RequestBody TimingTaskDto timingTaskDto) throws SchedulerException { |
| | | return R.ok(timingTaskService.addOrEditTimingTask(timingTaskDto)); |
| | | } |
| | | |
| | | /** |
| | | * 宿¶å·¡æ£ä»»å¡è¡¨å é¤ |
| | | */ |
| | | @DeleteMapping("/delTimingTask") |
| | | @ApiOperation(value = "å é¤å®æ¶ä»»å¡") |
| | | public R remove(@RequestBody Long[] ids) { |
| | | return R.ok(timingTaskService.delByIds(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.dto; |
| | | |
| | | import com.ruoyi.basic.dto.StorageBlobDTO; |
| | | import com.ruoyi.basic.pojo.StorageAttachment; |
| | | import com.ruoyi.inspectiontask.pojo.InspectionTask; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class InspectionTaskDto extends InspectionTask { |
| | | |
| | | private List<StorageBlobDTO> storageBlobDTO; |
| | | private List<StorageBlobDTO> beforeProduction; |
| | | private List<StorageBlobDTO> afterProduction; |
| | | private List<StorageBlobDTO> productionIssues; |
| | | |
| | | private List<StorageAttachment> attachments; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.dto; |
| | | |
| | | import com.ruoyi.inspectiontask.pojo.QrCode; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class QrCodeDto extends QrCode { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.dto; |
| | | |
| | | |
| | | import com.ruoyi.basic.dto.StorageBlobDTO; |
| | | import com.ruoyi.inspectiontask.pojo.QrCode; |
| | | import com.ruoyi.inspectiontask.pojo.QrCodeScanRecord; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class QrCodeScanRecordDto extends QrCodeScanRecord { |
| | | |
| | | private QrCode qrCode; |
| | | |
| | | private String scanner; |
| | | |
| | | private List<StorageBlobDTO> storageBlobDTO; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.dto; |
| | | |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class TimingTaskDto extends TimingTask { |
| | | |
| | | private List<String> inspector; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.inspectiontask.pojo.InspectionTask; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:46 |
| | | */ |
| | | public interface InspectionTaskMapper extends BaseMapper<InspectionTask> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.inspectiontask.pojo.QrCode; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:46 |
| | | */ |
| | | public interface QrCodeMapper extends BaseMapper<QrCode> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.inspectiontask.pojo.QrCodeScanRecord; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:46 |
| | | */ |
| | | public interface QrCodeScanRecordMapper extends BaseMapper<QrCodeScanRecord> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:47 |
| | | */ |
| | | @Mapper |
| | | public interface TimingTaskMapper extends BaseMapper<TimingTask> { |
| | | |
| | | TimingTask getTaskById(@Param("id") Long id); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:25 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("inspection_task") |
| | | public class InspectionTask { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * å·¡æ£ä»»å¡å¯ä¸æ è¯ |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | @Excel(name = "å·¡æ£ä»»å¡åç§°") |
| | | private String taskName; |
| | | |
| | | @ApiModelProperty(value = "设å¤id") |
| | | private Integer taskId; |
| | | |
| | | @ApiModelProperty(value = "å·¡æ£äººID") |
| | | private String inspectorId; |
| | | |
| | | @ApiModelProperty(value = "æ§è¡å·¡æ£ç人åå§å") |
| | | @Excel(name = "æ§è¡å·¡æ£äººå") |
| | | private String inspector; |
| | | |
| | | @ApiModelProperty(value = "ä»»å¡éå 说ææç¹æ®æ
åµè®°å½") |
| | | @Excel(name = "夿³¨") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty(value = "ä»»å¡ç»è®°äººID") |
| | | private Long registrantId; |
| | | |
| | | @ApiModelProperty(value = "ä»»å¡ç»è®°äººå§å") |
| | | @Excel(name = "ç»è®°äºº") |
| | | private String registrant; |
| | | |
| | | @ApiModelProperty(value = "颿¬¡") |
| | | @Excel(name = "颿¬¡") |
| | | private String frequencyType; |
| | | |
| | | @ApiModelProperty(value = "æ¶é´ç»è") |
| | | @Excel(name = "å¼å§æ¥æä¸æ¶é´") |
| | | private String frequencyDetail; |
| | | |
| | | @ApiModelProperty(value = "å·¡æ£å°ç¹è¯¦ç»æè¿°") |
| | | private String inspectionLocation; |
| | | |
| | | @ApiModelProperty(value = "软å 餿 å¿ï¼0=æªå é¤ï¼1=å·²å é¤") |
| | | private Integer deleted; |
| | | |
| | | @ApiModelProperty(value = "å建该记å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½å建æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "ç»è®°æ¥æ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æåä¿®æ¹è¯¥è®°å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½æåæ´æ°æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.pojo; |
| | | |
| | | 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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:29 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("qr_code") |
| | | public class QrCode { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * äºç»´ç å¯ä¸æ è¯ |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty(value = "æå¨ä½ç½®æè¿°") |
| | | private String location; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·IDï¼ç¨äºå¤ç§æ·é离") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty(value = "软å 餿 å¿ï¼0=æªå é¤ï¼1=å·²å é¤") |
| | | private Integer deleted; |
| | | |
| | | @ApiModelProperty(value = "å建该记å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½å建æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æåä¿®æ¹è¯¥è®°å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½æåæ´æ°æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:29 |
| | | */ |
| | | @Data |
| | | @TableName("qr_code_scan_record") |
| | | @ApiModel |
| | | public class QrCodeScanRecord { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * æ«ç è®°å½å¯ä¸æ è¯ |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "å
³èçäºç»´ç ID") |
| | | private Long qrCodeId; |
| | | |
| | | @ApiModelProperty(value = "æ«ç äººç¨æ·ID") |
| | | private Long scannerId; |
| | | |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty(value = "设å¤id") |
| | | private Integer deviceId; |
| | | |
| | | @ApiModelProperty(value = "å®é
æ«ç æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime scanTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | @ApiModelProperty(value = "软å 餿 å¿ï¼0=æªå é¤ï¼1=å·²å é¤") |
| | | private Integer deleted; |
| | | |
| | | @ApiModelProperty(value = "å建该记å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½å建æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æåä¿®æ¹è¯¥è®°å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½æåæ´æ°æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.pojo; |
| | | |
| | | 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 com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:27 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("timing_task") |
| | | public class TimingTask { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主é®ID |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | @Excel(name = "å·¡æ£ä»»å¡åç§°") |
| | | private String taskName; |
| | | |
| | | @ApiModelProperty(value = "设å¤id") |
| | | private Integer taskId; |
| | | |
| | | @ApiModelProperty(value = "å·¡æ£äºº") |
| | | @Excel(name = "æ§è¡å·¡æ£äºº") |
| | | private String inspectorIds; |
| | | |
| | | @ApiModelProperty(value = "å·¡æ£å°ç¹") |
| | | private String inspectionLocation; |
| | | |
| | | @ApiModelProperty(value = "颿¬¡") |
| | | @Excel(name = "颿¬¡") |
| | | private String frequencyType; |
| | | |
| | | @ApiModelProperty(value = "颿¬¡è¯¦æ
") |
| | | @Excel(name = "å¼å§æ¥æä¸æ¶é´") |
| | | private String frequencyDetail; |
| | | |
| | | @ApiModelProperty(value = "䏿¬¡æ§è¡æ¶é´") |
| | | private LocalDateTime nextExecutionTime; |
| | | |
| | | @ApiModelProperty(value = "æåæ§è¡æ¶é´") |
| | | private LocalDateTime lastExecutionTime; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ¿æ´»") |
| | | private boolean isActive; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @Excel(name = "夿³¨") |
| | | private String remarks; |
| | | |
| | | @ApiModelProperty(value = "ç»è®°äººid") |
| | | private Long registrantId; |
| | | |
| | | @ApiModelProperty(value = "ç»è®°äºº") |
| | | @Excel(name = "ç»è®°äºº") |
| | | private String registrant; |
| | | |
| | | @ApiModelProperty(value = "ç»è®°æ¥æ") |
| | | @Excel(name = "ç»è®°æ¥æ", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDate registrationDate; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "软å 餿 å¿ï¼0=æªå é¤ï¼1=å·²å é¤") |
| | | private Integer deleted; |
| | | |
| | | @ApiModelProperty(value = "å建该记å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½å建æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "æåä¿®æ¹è¯¥è®°å½çç¨æ·") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "è®°å½æåæ´æ°æ¶é´") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = com.baomidou.mybatisplus.annotation.FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.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.inspectiontask.dto.InspectionTaskDto; |
| | | import com.ruoyi.inspectiontask.pojo.InspectionTask; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:49 |
| | | */ |
| | | public interface InspectionTaskService extends IService<InspectionTask> { |
| | | |
| | | IPage<InspectionTaskDto> selectInspectionTaskList(Page<InspectionTask> page, InspectionTaskDto inspectionTaskDto); |
| | | |
| | | int addOrEditInspectionTask(InspectionTaskDto inspectionTaskDto); |
| | | |
| | | int delByIds(Long[] ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.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.inspectiontask.dto.QrCodeScanRecordDto; |
| | | import com.ruoyi.inspectiontask.pojo.QrCodeScanRecord; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:50 |
| | | */ |
| | | public interface QrCodeScanRecordService extends IService<QrCodeScanRecord> { |
| | | |
| | | IPage<QrCodeScanRecordDto> selectQrCodeScanRecordList(Page<QrCodeScanRecord> page, QrCodeScanRecordDto qrCodeScanRecordDto); |
| | | |
| | | int addOrEditQrCodeRecord(QrCodeScanRecordDto qrCodeScanRecordDto); |
| | | |
| | | int delByIds(Long[] ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.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.inspectiontask.dto.QrCodeDto; |
| | | import com.ruoyi.inspectiontask.pojo.QrCode; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:50 |
| | | */ |
| | | public interface QrCodeService extends IService<QrCode>{ |
| | | IPage<QrCode> selectQrCodeList(Page page, QrCodeDto qrCodeDto); |
| | | |
| | | Long addOrEditQrCode(QrCodeDto qrCodeDto); |
| | | |
| | | int delByIds(Long[] ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.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.inspectiontask.dto.TimingTaskDto; |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import org.quartz.SchedulerException; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:51 |
| | | */ |
| | | public interface TimingTaskService extends IService<TimingTask> { |
| | | |
| | | IPage<TimingTaskDto> selectTimingTaskList(Page<TimingTask> page, TimingTask timingTask); |
| | | |
| | | int addOrEditTimingTask(TimingTaskDto timingTaskDto) throws SchedulerException; |
| | | |
| | | int delByIds(Long[] ids); |
| | | |
| | | void updateTaskExecutionTime(Long taskId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.StorageBlobDTO; |
| | | import com.ruoyi.basic.mapper.StorageAttachmentMapper; |
| | | import com.ruoyi.basic.mapper.StorageBlobMapper; |
| | | import com.ruoyi.basic.pojo.StorageAttachment; |
| | | import com.ruoyi.basic.pojo.StorageBlob; |
| | | import com.ruoyi.basic.service.StorageAttachmentService; |
| | | import com.ruoyi.common.utils.MinioUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.inspectiontask.dto.InspectionTaskDto; |
| | | import com.ruoyi.inspectiontask.mapper.InspectionTaskMapper; |
| | | import com.ruoyi.inspectiontask.pojo.InspectionTask; |
| | | import com.ruoyi.inspectiontask.service.InspectionTaskService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ruoyi.common.constant.StorageAttachmentConstants.StorageAttachmentFile; |
| | | import static com.ruoyi.common.enums.StorageAttachmentRecordType.InspectionTasks; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:54 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, InspectionTask> implements InspectionTaskService { |
| | | |
| | | |
| | | @Autowired |
| | | private InspectionTaskMapper inspectionTaskMapper; |
| | | |
| | | @Autowired |
| | | private StorageAttachmentService storageAttachmentService; |
| | | |
| | | @Autowired |
| | | private StorageBlobMapper storageBlobMapper; |
| | | |
| | | @Autowired |
| | | private StorageAttachmentMapper storageAttachmentMapper; |
| | | |
| | | @Autowired |
| | | private MinioUtils minioUtils; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public IPage<InspectionTaskDto> selectInspectionTaskList(Page<InspectionTask> page, InspectionTaskDto inspectionTaskDto) { |
| | | LambdaQueryWrapper<InspectionTask> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.orderByDesc(InspectionTask::getCreateTime); |
| | | IPage<InspectionTask> entityPage = inspectionTaskMapper.selectPage(page, queryWrapper); |
| | | |
| | | // æ æ°æ®æåè¿å |
| | | if (CollectionUtils.isEmpty(entityPage.getRecords())) { |
| | | return new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal()); |
| | | } |
| | | // è·åidéå |
| | | List<Long> ids = entityPage.getRecords().stream().map(InspectionTask::getId).collect(Collectors.toList()); |
| | | //ç»è®°äººids |
| | | List<Long> registrantIds = entityPage.getRecords().stream().map(InspectionTask::getRegistrantId).collect(Collectors.toList()); |
| | | // æ¹éæ¥è¯¢ç»è®°äºº |
| | | Map<Long, SysUser> sysUserMap; |
| | | if (!registrantIds.isEmpty()) { |
| | | List<SysUser> sysUsers = sysUserMapper.selectList(registrantIds); |
| | | sysUserMap = sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity())); |
| | | } else { |
| | | sysUserMap = new HashMap<>(); |
| | | } |
| | | //å·¡æ£äººids |
| | | List<String> inspectorIds = entityPage.getRecords().stream().map(InspectionTask::getInspectorId).collect(Collectors.toList()); |
| | | |
| | | //è·åææä¸éå¤çç¨æ·ID |
| | | Set<Long> allUserIds = entityPage.getRecords().stream() |
| | | .map(InspectionTask::getInspectorId) // è·å"2,3"è¿æ ·çå符串 |
| | | .filter(StringUtils::isNotBlank) |
| | | .flatMap(idsStr -> Arrays.stream(idsStr.split(","))) |
| | | .map(idStr -> { |
| | | try { |
| | | return Long.parseLong(idStr.trim()); |
| | | } catch (NumberFormatException e) { |
| | | return null; |
| | | } |
| | | }) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | // 使ç¨SQLæ¹éæ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | Map<Long, String> userIdToNameMap = allUserIds.isEmpty() |
| | | ? Collections.emptyMap() |
| | | : sysUserMapper.selectUsersByIds(new ArrayList<>(allUserIds)) |
| | | .stream() |
| | | .collect(Collectors.toMap( |
| | | SysUser::getUserId, |
| | | SysUser::getNickName, |
| | | (existing, replacement) -> existing)); |
| | | |
| | | //å¤çéä»¶ |
| | | Map<Long, List<StorageAttachment>> attachmentsMap = storageAttachmentMapper.selectList(new LambdaQueryWrapper<StorageAttachment>().in(StorageAttachment::getRecordId, ids) |
| | | .eq(StorageAttachment::getRecordType, InspectionTasks.ordinal())) |
| | | .stream() |
| | | .collect(Collectors.groupingBy(StorageAttachment::getRecordId)); |
| | | // æ¹éæ¥è¯¢ææéè¦çæä»¶æ°æ® |
| | | Set<Long> blobIds = attachmentsMap.values() |
| | | .stream() |
| | | .flatMap(List::stream) |
| | | .map(StorageAttachment::getStorageBlobId) |
| | | .collect(Collectors.toSet()); |
| | | Map<Long, StorageBlob> blobMap = blobIds.isEmpty() |
| | | ? Collections.emptyMap() |
| | | : storageBlobMapper.selectList(new LambdaQueryWrapper<StorageBlob>().in(StorageBlob::getId, blobIds)) |
| | | .stream() |
| | | .collect(Collectors.toMap(StorageBlob::getId, Function.identity())); |
| | | |
| | | List<InspectionTaskDto> dtoList = entityPage.getRecords().stream().map(inspectionTask -> { |
| | | InspectionTaskDto dto = new InspectionTaskDto(); |
| | | BeanUtils.copyProperties(inspectionTask, dto); // å¤å¶ä¸»å¯¹è±¡å±æ§ |
| | | |
| | | // 设置ç»è®°äºº |
| | | SysUser sysUser = sysUserMap.get(inspectionTask.getRegistrantId()); |
| | | if (sysUser != null) { |
| | | dto.setRegistrant(sysUser.getNickName()); |
| | | } |
| | | // å¤çå·¡æ£äººåç§° |
| | | if (StringUtils.isNotBlank(inspectionTask.getInspectorId())) { |
| | | String inspectorNames = Arrays.stream(inspectionTask.getInspectorId().split(",")) |
| | | .map(String::trim) |
| | | .map(idStr -> { |
| | | try { |
| | | Long userId = Long.parseLong(idStr); |
| | | return userIdToNameMap.getOrDefault(userId, "æªç¥ç¨æ·(" + idStr + ")"); |
| | | } catch (NumberFormatException e) { |
| | | return "æ æID(" + idStr + ")"; |
| | | } |
| | | }) |
| | | .collect(Collectors.joining(",")); |
| | | dto.setInspector(inspectorNames); |
| | | } |
| | | |
| | | // åå§åä¸ä¸ªéä»¶å表 |
| | | dto.setBeforeProduction(new ArrayList<>()); |
| | | dto.setAfterProduction(new ArrayList<>()); |
| | | dto.setProductionIssues(new ArrayList<>()); |
| | | |
| | | // å¤çéä»¶åç±» |
| | | Optional.ofNullable(attachmentsMap.get(inspectionTask.getId())) |
| | | .orElse(Collections.emptyList()) |
| | | .forEach(attachment -> { |
| | | StorageBlob blob = blobMap.get(attachment.getStorageBlobId()); |
| | | if (blob != null) { |
| | | // å建éä»¶DTO |
| | | StorageBlobDTO blobDto = createBlobDto(blob); |
| | | |
| | | // æ ¹æ®typeåç±» |
| | | switch ((int) blob.getType().longValue()) { |
| | | case 0: |
| | | dto.getBeforeProduction().add(blobDto); |
| | | break; |
| | | case 1: |
| | | dto.getAfterProduction().add(blobDto); |
| | | break; |
| | | case 2: |
| | | dto.getProductionIssues().add(blobDto); |
| | | break; |
| | | default: |
| | | // å¯éï¼è®°å½æªå类类å |
| | | break; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | // 7. æå»ºè¿åå页对象 |
| | | IPage<InspectionTaskDto> resultPage = new Page<>(); |
| | | BeanUtils.copyProperties(entityPage, resultPage); |
| | | resultPage.setRecords(dtoList); |
| | | return resultPage; |
| | | } |
| | | |
| | | // æåå建BlobDTOçå
Œ
±æ¹æ³ |
| | | private StorageBlobDTO createBlobDto(StorageBlob blob) { |
| | | StorageBlobDTO dto = new StorageBlobDTO(); |
| | | BeanUtils.copyProperties(blob, dto); |
| | | |
| | | // 设置URL |
| | | dto.setUrl(minioUtils.getPreviewUrls( |
| | | blob.getBucketFilename(), |
| | | blob.getBucketName(), |
| | | true |
| | | )); |
| | | |
| | | // 设置ä¸è½½URL |
| | | dto.setDownloadUrl(minioUtils.getDownloadUrls( |
| | | blob.getBucketFilename(), |
| | | blob.getBucketName(), |
| | | blob.getOriginalFilename(), |
| | | true |
| | | )); |
| | | return dto; |
| | | } |
| | | |
| | | @Override |
| | | public int addOrEditInspectionTask(InspectionTaskDto inspectionTaskDto) { |
| | | InspectionTask inspectionTask = new InspectionTask(); |
| | | BeanUtils.copyProperties(inspectionTaskDto, inspectionTask); |
| | | inspectionTask.setRegistrantId(SecurityUtils.getLoginUser().getUserId()); |
| | | inspectionTask.setRegistrant(SecurityUtils.getLoginUser().getUsername()); |
| | | int i; |
| | | if (Objects.isNull(inspectionTaskDto.getId())) { |
| | | i = inspectionTaskMapper.insert(inspectionTask); |
| | | } else { |
| | | i = inspectionTaskMapper.updateById(inspectionTask); |
| | | } |
| | | |
| | | if (inspectionTaskDto.getStorageBlobDTO() != null && !inspectionTaskDto.getStorageBlobDTO().isEmpty()) { |
| | | List<StorageAttachment> attachments = new ArrayList<>(); |
| | | |
| | | for (StorageBlobDTO storageBlobDTO : inspectionTaskDto.getStorageBlobDTO()) { |
| | | StorageAttachment storageAttachment = new StorageAttachment( |
| | | StorageAttachmentFile, |
| | | (long) InspectionTasks.ordinal(), |
| | | inspectionTask.getId() |
| | | ); |
| | | storageAttachment.setStorageBlobDTO(storageBlobDTO); |
| | | attachments.add(storageAttachment); |
| | | } |
| | | storageAttachmentService.saveStorageAttachment(attachments, inspectionTask.getId(), InspectionTasks, StorageAttachmentFile); |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int delByIds(Long[] ids) { |
| | | // æ£æ¥åæ° |
| | | if (ids == null || ids.length == 0) { |
| | | return 0; |
| | | } |
| | | return inspectionTaskMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.dto.StorageBlobDTO; |
| | | import com.ruoyi.basic.mapper.StorageAttachmentMapper; |
| | | import com.ruoyi.basic.mapper.StorageBlobMapper; |
| | | import com.ruoyi.basic.pojo.StorageAttachment; |
| | | import com.ruoyi.basic.pojo.StorageBlob; |
| | | import com.ruoyi.basic.service.StorageAttachmentService; |
| | | import com.ruoyi.common.constant.StorageAttachmentConstants; |
| | | import com.ruoyi.common.utils.MinioUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.inspectiontask.dto.QrCodeScanRecordDto; |
| | | import com.ruoyi.inspectiontask.mapper.QrCodeMapper; |
| | | import com.ruoyi.inspectiontask.mapper.QrCodeScanRecordMapper; |
| | | import com.ruoyi.inspectiontask.pojo.QrCode; |
| | | import com.ruoyi.inspectiontask.pojo.QrCodeScanRecord; |
| | | import com.ruoyi.inspectiontask.service.QrCodeScanRecordService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ruoyi.common.constant.StorageAttachmentConstants.StorageAttachmentFile; |
| | | import static com.ruoyi.common.enums.StorageAttachmentRecordType.QrCodeScanRecords; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:54 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class QrCodeScanRecordServiceImpl extends ServiceImpl<QrCodeScanRecordMapper, QrCodeScanRecord> implements QrCodeScanRecordService { |
| | | |
| | | @Autowired |
| | | private QrCodeScanRecordMapper qrCodeScanRecordMapper; |
| | | |
| | | @Autowired |
| | | private QrCodeMapper qrCodeMapper; |
| | | |
| | | @Autowired |
| | | private StorageAttachmentService storageAttachmentService; |
| | | |
| | | @Autowired |
| | | private StorageBlobMapper storageBlobMapper; |
| | | |
| | | @Autowired |
| | | private StorageAttachmentMapper storageAttachmentMapper; |
| | | |
| | | @Autowired |
| | | private MinioUtils minioUtils; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public IPage<QrCodeScanRecordDto> selectQrCodeScanRecordList(Page<QrCodeScanRecord> page, QrCodeScanRecordDto qrCodeScanRecordDto) { |
| | | // 1. æå»ºåºç¡æ¥è¯¢æ¡ä»¶ |
| | | LambdaQueryWrapper<QrCodeScanRecord> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.orderByDesc(QrCodeScanRecord::getCreateTime); |
| | | |
| | | // 2. æ§è¡å页æ¥è¯¢ |
| | | IPage<QrCodeScanRecord> scanRecordIPage = qrCodeScanRecordMapper.selectPage(page, queryWrapper); |
| | | |
| | | // 3. æ æ°æ®æåè¿å |
| | | if (CollectionUtils.isEmpty(scanRecordIPage.getRecords())) { |
| | | return new Page<>(scanRecordIPage.getCurrent(), scanRecordIPage.getSize(), scanRecordIPage.getTotal()); |
| | | } |
| | | |
| | | // 4. æ¹éè·åææè®°å½IDåäºç»´ç ID |
| | | List<Long> recordIds = scanRecordIPage.getRecords().stream() |
| | | .map(QrCodeScanRecord::getId) |
| | | .collect(Collectors.toList()); |
| | | |
| | | Set<Long> qrCodeIds = scanRecordIPage.getRecords().stream() |
| | | .map(QrCodeScanRecord::getQrCodeId) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | // 5. æ¹éæ¥è¯¢å
³èæ°æ®ï¼ä½¿ç¨ææ°APIï¼ |
| | | // 5.1 æ¥è¯¢äºç»´ç ä¿¡æ¯ï¼æ¿æ¢selectBatchIds为selectByIdsï¼ |
| | | Map<Long, QrCode> qrCodeMap = qrCodeIds.isEmpty() |
| | | ? Collections.emptyMap() |
| | | : qrCodeMapper.selectBatchIds(qrCodeIds).stream() |
| | | .collect(Collectors.toMap(QrCode::getId, Function.identity())); |
| | | |
| | | // 5.2 æ¥è¯¢éä»¶å
³èå
³ç³» |
| | | Map<Long, List<StorageAttachment>> attachmentsMap = storageAttachmentMapper |
| | | .selectList(new LambdaQueryWrapper<StorageAttachment>() |
| | | .in(StorageAttachment::getRecordId, recordIds) |
| | | .eq(StorageAttachment::getRecordType, QrCodeScanRecords.ordinal())) |
| | | .stream() |
| | | .collect(Collectors.groupingBy(StorageAttachment::getRecordId)); |
| | | |
| | | // 5.3 æ¥è¯¢æä»¶æ°æ®ï¼ä½¿ç¨selectByIdsï¼ |
| | | Set<Long> blobIds = attachmentsMap.values().stream() |
| | | .flatMap(List::stream) |
| | | .map(StorageAttachment::getStorageBlobId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | Map<Long, StorageBlob> blobMap = blobIds.isEmpty() |
| | | ? Collections.emptyMap() |
| | | : storageBlobMapper.selectBatchIds(blobIds).stream() |
| | | .collect(Collectors.toMap(StorageBlob::getId, Function.identity())); |
| | | |
| | | // 6. ç»è£
DTOæ°æ® |
| | | List<QrCodeScanRecordDto> dtoList = scanRecordIPage.getRecords().stream().map(record -> { |
| | | QrCodeScanRecordDto dto = new QrCodeScanRecordDto(); |
| | | BeanUtils.copyProperties(record, dto); |
| | | |
| | | SysUser sysUser = sysUserMapper.selectUserById(record.getScannerId()); |
| | | dto.setScanner(sysUser.getNickName()); |
| | | |
| | | // 6.1 设置äºç»´ç ä¿¡æ¯ |
| | | Optional.ofNullable(qrCodeMap.get(record.getQrCodeId())) |
| | | .ifPresent(qrCode -> { |
| | | BeanUtils.copyProperties(qrCode, dto); // å¤å¶å°ç¶ç±» |
| | | dto.setQrCode(qrCode); // è®¾ç½®å®æ´å¯¹è±¡ |
| | | }); |
| | | |
| | | // 6.2 设置éä»¶ä¿¡æ¯ |
| | | dto.setStorageBlobDTO( |
| | | Optional.ofNullable(attachmentsMap.get(record.getId())) |
| | | .orElse(Collections.emptyList()) |
| | | .stream() |
| | | .map(att -> { |
| | | StorageBlobDTO blobDTO = new StorageBlobDTO(); |
| | | Optional.ofNullable(blobMap.get(att.getStorageBlobId())) |
| | | .ifPresent(blob -> { |
| | | BeanUtils.copyProperties(blob, blobDTO); |
| | | blobDTO.setUrl(minioUtils.getPreviewUrls(blob.getBucketFilename(), blob.getBucketName(), true)); |
| | | blobDTO.setDownloadUrl(minioUtils.getDownloadUrls(blob.getBucketFilename(),blob.getBucketName(),blob.getOriginalFilename(),true)); |
| | | }); |
| | | return blobDTO; |
| | | }) |
| | | .filter(blobDTO -> blobDTO.getId() != null) // è¿æ»¤æ æéä»¶ |
| | | .collect(Collectors.toList()) |
| | | ); |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | // 7. æå»ºè¿åå页对象 |
| | | IPage<QrCodeScanRecordDto> resultPage = new Page<>(); |
| | | BeanUtils.copyProperties(scanRecordIPage, resultPage); |
| | | resultPage.setRecords(dtoList); |
| | | |
| | | return resultPage; |
| | | } |
| | | |
| | | @Override |
| | | public int addOrEditQrCodeRecord(QrCodeScanRecordDto qrCodeScanRecordDto) { |
| | | QrCodeScanRecord qrCodeScanRecord = new QrCodeScanRecord(); |
| | | BeanUtils.copyProperties(qrCodeScanRecordDto, qrCodeScanRecord); |
| | | int i; |
| | | if (Objects.isNull(qrCodeScanRecordDto.getId())) { |
| | | i = qrCodeScanRecordMapper.insert(qrCodeScanRecord); |
| | | } else { |
| | | i = qrCodeScanRecordMapper.updateById(qrCodeScanRecord); |
| | | } |
| | | |
| | | if (qrCodeScanRecordDto.getStorageBlobDTO() != null && !qrCodeScanRecordDto.getStorageBlobDTO().isEmpty()) { |
| | | List<StorageAttachment> attachments = new ArrayList<>(); |
| | | |
| | | for (StorageBlobDTO storageBlobDTO : qrCodeScanRecordDto.getStorageBlobDTO()) { |
| | | StorageAttachment storageAttachment = new StorageAttachment( |
| | | StorageAttachmentFile, |
| | | (long) QrCodeScanRecords.ordinal(), |
| | | qrCodeScanRecord.getId() |
| | | ); |
| | | storageAttachment.setStorageBlobDTO(storageBlobDTO); |
| | | attachments.add(storageAttachment); |
| | | } |
| | | storageAttachmentService.saveStorageAttachment(attachments, qrCodeScanRecord.getId(), QrCodeScanRecords, StorageAttachmentFile); |
| | | } |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int delByIds(Long[] ids) { |
| | | return qrCodeScanRecordMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.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.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.inspectiontask.dto.QrCodeDto; |
| | | import com.ruoyi.inspectiontask.mapper.QrCodeMapper; |
| | | import com.ruoyi.inspectiontask.pojo.QrCode; |
| | | import com.ruoyi.inspectiontask.service.QrCodeService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:55 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class QrCodeServiceImpl extends ServiceImpl<QrCodeMapper, QrCode> implements QrCodeService { |
| | | |
| | | @Autowired |
| | | private QrCodeMapper qrCodeMapper; |
| | | |
| | | @Override |
| | | public IPage<QrCode> selectQrCodeList(Page page, QrCodeDto qrCodeDto) { |
| | | LambdaQueryWrapper<QrCode> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.orderByDesc(QrCode::getCreateTime); |
| | | return qrCodeMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Long addOrEditQrCode(QrCodeDto qrCodeDto) { |
| | | QrCode qrCode = new QrCode(); |
| | | BeanUtils.copyProperties(qrCodeDto, qrCode); |
| | | if (Objects.isNull(qrCodeDto.getId())) { |
| | | qrCodeMapper.insert(qrCode); |
| | | } else { |
| | | qrCodeMapper.updateById(qrCode); |
| | | } |
| | | return qrCode.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public int delByIds(Long[] ids) { |
| | | return qrCodeMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.service.impl; |
| | | |
| | | import org.quartz.spi.TriggerFiredBundle; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.config.AutowireCapableBeanFactory; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.quartz.SchedulerFactoryBean; |
| | | import org.springframework.scheduling.quartz.SpringBeanJobFactory; |
| | | |
| | | @Configuration |
| | | public class QuartzConfig { |
| | | @Autowired |
| | | private ApplicationContext applicationContext; |
| | | |
| | | @Bean |
| | | public SchedulerFactoryBean schedulerFactoryBean() { |
| | | SchedulerFactoryBean schedulerFactory = new SchedulerFactoryBean(); |
| | | |
| | | // é
ç½®SpringBeanJobFactoryï¼ç¨äºæ¯æJobä¸çä¾èµæ³¨å
¥ |
| | | AutowiringSpringBeanJobFactory jobFactory = new AutowiringSpringBeanJobFactory(); |
| | | jobFactory.setApplicationContext(applicationContext); |
| | | schedulerFactory.setJobFactory(jobFactory); |
| | | |
| | | // å
¶ä»é
ç½®... |
| | | return schedulerFactory; |
| | | } |
| | | |
| | | // èªå®ä¹JobFactoryï¼æ¯æèªå¨æ³¨å
¥ |
| | | public static class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory |
| | | implements ApplicationContextAware { |
| | | |
| | | private transient AutowireCapableBeanFactory beanFactory; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) { |
| | | this.beanFactory = applicationContext.getAutowireCapableBeanFactory(); |
| | | } |
| | | |
| | | @Override |
| | | protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception { |
| | | Object jobInstance = super.createJobInstance(bundle); |
| | | // å°Jobå®ä¾äº¤ç»Spring容å¨ç®¡çï¼ä½¿å
¶è½å¤è¿è¡ä¾èµæ³¨å
¥ |
| | | beanFactory.autowireBean(jobInstance); |
| | | return jobInstance; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.service.impl; |
| | | |
| | | import org.quartz.JobExecutionContext; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | public class SpringContextHolder implements ApplicationContextAware { |
| | | private static ApplicationContext applicationContext; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext context) { |
| | | applicationContext = context; |
| | | } |
| | | |
| | | public static <T> T getBean(Class<T> clazz) { |
| | | return applicationContext.getBean(clazz); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.service.impl; |
| | | |
| | | import com.ruoyi.inspectiontask.mapper.InspectionTaskMapper; |
| | | import com.ruoyi.inspectiontask.mapper.TimingTaskMapper; |
| | | import com.ruoyi.inspectiontask.pojo.InspectionTask; |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import com.ruoyi.inspectiontask.service.TimingTaskService; |
| | | import org.quartz.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.sql.DataSource; |
| | | import java.time.DayOfWeek; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.YearMonth; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | @Component |
| | | @DisallowConcurrentExecution // ç¦æ¢å¹¶åæ§è¡åä¸ä¸ªJob |
| | | public class TimingTaskJob implements Job { |
| | | |
| | | @Autowired |
| | | private TimingTaskMapper timingTaskMapper; |
| | | |
| | | @Autowired |
| | | private TimingTaskService timingTaskService; |
| | | |
| | | @Autowired |
| | | private InspectionTaskMapper inspectionTaskMapper; |
| | | |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @Override |
| | | public void execute(JobExecutionContext context) throws JobExecutionException { |
| | | JobDataMap jobDataMap = context.getJobDetail().getJobDataMap(); |
| | | // ä¿®å¤ç±»å转æ¢éè¯¯ï¼æ£ç¡®è·åtaskId |
| | | Long taskId = jobDataMap.getLong("taskId"); |
| | | |
| | | try { |
| | | // 3. å°è¯æ¥è¯¢ä½ çä¸å¡æ°æ® |
| | | // éè¿JDBCæ¨¡æ¿æ¥è¯¢å®æ¶ä»»å¡ä¿¡æ¯ï¼ä½¿ç¨åæ°åæ¥è¯¢é²æ¢SQL注å
¥ |
| | | String yourSql = "SELECT * FROM timing_task where id = ?"; |
| | | List<TimingTask> tasks = jdbcTemplate.query( |
| | | yourSql, |
| | | new BeanPropertyRowMapper<>(TimingTask.class), |
| | | taskId |
| | | ); |
| | | TimingTask timingTask = tasks.isEmpty() ? null : tasks.get(0); |
| | | if (timingTask == null) { |
| | | throw new JobExecutionException("æ¾ä¸å°å®æ¶ä»»å¡: " + taskId); |
| | | } |
| | | |
| | | // if (!timingTask.isActive()) { |
| | | // throw new JobExecutionException("宿¶ä»»å¡å·²ç¦ç¨: " + taskId); |
| | | // } |
| | | |
| | | // 2. å建并ä¿åå·¡æ£ä»»å¡è®°å½ - è¿å°±æ¯æ¨æä¾ç代ç åºè¯¥æ¾çä½ç½® |
| | | InspectionTask inspectionTask = createInspectionTask(timingTask); |
| | | inspectionTaskMapper.insert(inspectionTask); |
| | | |
| | | // 3. æ´æ°å®æ¶ä»»å¡çæ§è¡æ¶é´ |
| | | if (!tasks.isEmpty()) { |
| | | TimingTask task = tasks.get(0); |
| | | |
| | | // æ´æ°æåæ§è¡æ¶é´ä¸ºå½åæ¶é´ |
| | | LocalDateTime lastExecutionTime = LocalDateTime.now(); |
| | | |
| | | // 计ç®ä¸æ¬¡æ§è¡æ¶é´ |
| | | LocalDateTime nextExecutionTime = calculateNextExecutionTime( |
| | | task.getFrequencyType(), |
| | | task.getFrequencyDetail(), |
| | | lastExecutionTime |
| | | ); |
| | | |
| | | // æ§è¡æ´æ°æä½ |
| | | String updateSql = "UPDATE timing_task " + |
| | | "SET last_execution_time = ?, next_execution_time = ? " + |
| | | "WHERE id = ?"; |
| | | |
| | | jdbcTemplate.update( |
| | | updateSql, |
| | | lastExecutionTime, |
| | | nextExecutionTime, |
| | | taskId |
| | | ); |
| | | } |
| | | // timingTaskService.updateTaskExecutionTime(taskId); |
| | | |
| | | // 4. è®°å½æ§è¡æ¥å¿ |
| | | // timingTaskService.recordExecutionLog(taskId, true, "任塿§è¡æåï¼çæå·¡æ£ä»»å¡ID: " + inspectionTask.getId()); |
| | | |
| | | } catch (Exception e) { |
| | | // timingTaskService.recordExecutionLog(taskId, false, "任塿§è¡å¤±è´¥: " + e.getMessage()); |
| | | throw new JobExecutionException(e); |
| | | } |
| | | } |
| | | |
| | | // è¿å°±æ¯æ¨æä¾ç代ç å°è£
æçæ¹æ³ |
| | | private InspectionTask createInspectionTask(TimingTask timingTask) { |
| | | InspectionTask inspectionTask = new InspectionTask(); |
| | | |
| | | // å¤å¶åºæ¬å±æ§ |
| | | inspectionTask.setTaskName(timingTask.getTaskName()); |
| | | inspectionTask.setTaskId(timingTask.getTaskId()); |
| | | inspectionTask.setInspectorId(timingTask.getInspectorIds()); |
| | | inspectionTask.setInspectionLocation(timingTask.getInspectionLocation()); |
| | | inspectionTask.setRemarks("èªå¨çæèªå®æ¶ä»»å¡ID: " + timingTask.getId()); |
| | | inspectionTask.setRegistrantId(timingTask.getRegistrantId()); |
| | | inspectionTask.setFrequencyType(timingTask.getFrequencyType()); |
| | | inspectionTask.setFrequencyDetail(timingTask.getFrequencyDetail()); |
| | | inspectionTask.setTenantId(timingTask.getTenantId()); |
| | | |
| | | return inspectionTask; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 计ç®ä¸æ¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateNextExecutionTime(String frequencyType, |
| | | String frequencyDetail, |
| | | LocalDateTime currentTime) { |
| | | try { |
| | | switch (frequencyType) { |
| | | case "DAILY": |
| | | return calculateDailyNextTime(frequencyDetail, currentTime); |
| | | case "WEEKLY": |
| | | return calculateWeeklyNextTime(frequencyDetail, currentTime); |
| | | case "MONTHLY": |
| | | return calculateMonthlyNextTime(frequencyDetail, currentTime); |
| | | case "QUARTERLY": |
| | | return calculateQuarterlyNextTime(frequencyDetail, currentTime); |
| | | default: |
| | | throw new IllegalArgumentException("䏿¯æçé¢çç±»å: " + frequencyType); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("计ç®ä¸æ¬¡æ§è¡æ¶é´å¤±è´¥: " + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯æ¥ä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateDailyNextTime(String timeStr, LocalDateTime current) { |
| | | LocalTime executionTime = LocalTime.parse(timeStr); // è§£ææ ¼å¼ "HH:mm" |
| | | LocalDateTime nextTime = LocalDateTime.of(current.toLocalDate(), executionTime); |
| | | |
| | | // 妿ä»å¤©çæ¶é´å·²è¿ï¼å宿æå¤© |
| | | return current.isBefore(nextTime) ? nextTime : nextTime.plusDays(1); |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯å¨ä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateWeeklyNextTime(String detail, LocalDateTime current) { |
| | | String[] parts = detail.split(","); |
| | | String dayOfWeekStr = parts[0]; // å¦ "MON" æ "MON|WED|FRI" |
| | | LocalTime time = LocalTime.parse(parts[1]); // æ¶é´é¨å |
| | | |
| | | // è§£æææå (æ¯æå¤ä¸ªææ) |
| | | Set<DayOfWeek> targetDays = parseDayOfWeeks(dayOfWeekStr); |
| | | |
| | | // ä»å½åæ¶é´å¼å§æ¾ä¸ä¸ä¸ªç¬¦åæ¡ä»¶çææå |
| | | LocalDateTime nextTime = current; |
| | | while (true) { |
| | | nextTime = nextTime.plusDays(1); |
| | | if (targetDays.contains(nextTime.getDayOfWeek())) { |
| | | return LocalDateTime.of(nextTime.toLocalDate(), time); |
| | | } |
| | | |
| | | // 鲿¢æ é循ç¯(ç论ä¸ä¸ä¼åç) |
| | | if (nextTime.isAfter(current.plusYears(1))) { |
| | | throw new RuntimeException("æ æ³æ¾å°ä¸æ¬¡æ§è¡æ¶é´"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯æä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateMonthlyNextTime(String detail, LocalDateTime current) { |
| | | String[] parts = detail.split(","); |
| | | int dayOfMonth = Integer.parseInt(parts[0]); |
| | | LocalTime time = LocalTime.parse(parts[1]); |
| | | |
| | | // ä»ä¸ä¸ªæå¼å§è®¡ç® |
| | | LocalDateTime nextTime = current.plusMonths(1) |
| | | .withDayOfMonth(Math.min(dayOfMonth, current.plusMonths(1).toLocalDate().lengthOfMonth())) |
| | | .with(time); |
| | | |
| | | return nextTime; |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯å£åº¦ä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateQuarterlyNextTime(String detail, LocalDateTime current) { |
| | | String[] parts = detail.split(","); |
| | | int quarterMonth = Integer.parseInt(parts[0]); // 1=第1个æï¼2=第2个æï¼3=第3个æ |
| | | int dayOfMonth = Integer.parseInt(parts[1]); |
| | | LocalTime time = LocalTime.parse(parts[2]); |
| | | |
| | | // 计ç®å½åå£åº¦ |
| | | int currentQuarter = (current.getMonthValue() - 1) / 3 + 1; |
| | | int currentMonthInQuarter = (current.getMonthValue() - 1) % 3 + 1; |
| | | |
| | | YearMonth targetYearMonth; |
| | | if (currentMonthInQuarter < quarterMonth) { |
| | | // æ¬å£åº¦å
è¿ææ§è¡æºä¼ |
| | | targetYearMonth = YearMonth.from(current) |
| | | .plusMonths(quarterMonth - currentMonthInQuarter); |
| | | } else { |
| | | // éè¦å°ä¸ä¸ªå£åº¦ |
| | | targetYearMonth = YearMonth.from(current) |
| | | .plusMonths(3 - currentMonthInQuarter + quarterMonth); |
| | | } |
| | | |
| | | // å¤çææ«æ¥æ |
| | | int adjustedDay = Math.min(dayOfMonth, targetYearMonth.lengthOfMonth()); |
| | | |
| | | return LocalDateTime.of( |
| | | targetYearMonth.getYear(), |
| | | targetYearMonth.getMonthValue(), |
| | | adjustedDay, |
| | | time.getHour(), |
| | | time.getMinute() |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * è§£æææå å符串 |
| | | */ |
| | | private Set<DayOfWeek> parseDayOfWeeks(String dayOfWeekStr) { |
| | | Set<DayOfWeek> days = new HashSet<>(); |
| | | String[] dayStrs = dayOfWeekStr.split("\\|"); |
| | | |
| | | for (String dayStr : dayStrs) { |
| | | switch (dayStr) { |
| | | case "MON": days.add(DayOfWeek.MONDAY); break; |
| | | case "TUE": days.add(DayOfWeek.TUESDAY); break; |
| | | case "WED": days.add(DayOfWeek.WEDNESDAY); break; |
| | | case "THU": days.add(DayOfWeek.THURSDAY); break; |
| | | case "FRI": days.add(DayOfWeek.FRIDAY); break; |
| | | case "SAT": days.add(DayOfWeek.SATURDAY); break; |
| | | case "SUN": days.add(DayOfWeek.SUNDAY); break; |
| | | default: throw new IllegalArgumentException("æ æçææå : " + dayStr); |
| | | } |
| | | } |
| | | |
| | | return days; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.service.impl; |
| | | |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import org.quartz.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeParseException; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class TimingTaskScheduler { |
| | | |
| | | @Autowired |
| | | private Scheduler scheduler; |
| | | |
| | | /** |
| | | * æ·»å æ°ä»»å¡å°è°åº¦å¨ |
| | | */ |
| | | public void scheduleTimingTask(TimingTask task) throws SchedulerException { |
| | | JobDetail jobDetail = buildJobDetail(task); |
| | | Trigger trigger = buildJobTrigger(task, jobDetail); |
| | | scheduler.scheduleJob(jobDetail, trigger); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å·²æä»»å¡ |
| | | */ |
| | | public void rescheduleTimingTask(TimingTask task) throws SchedulerException { |
| | | TriggerKey triggerKey = new TriggerKey("trigger_" + task.getId()); |
| | | |
| | | // è·åç°æè§¦åå¨å¹¶è½¬æ¢ä¸º CronTrigger |
| | | Trigger oldTrigger = scheduler.getTrigger(triggerKey); |
| | | if (!(oldTrigger instanceof CronTrigger)) { |
| | | throw new SchedulerException("Existing trigger is not a CronTrigger"); |
| | | } |
| | | |
| | | // æå»ºæ°è§¦åå¨ |
| | | Trigger newTrigger = TriggerBuilder.newTrigger() |
| | | .withIdentity(triggerKey) |
| | | .withDescription(task.getTaskName()) |
| | | .withSchedule(CronScheduleBuilder.cronSchedule(convertToCronExpression(task))) |
| | | .startAt(Date.from(task.getNextExecutionTime().atZone(ZoneId.systemDefault()).toInstant())) |
| | | .forJob(oldTrigger.getJobKey()) |
| | | .build(); |
| | | |
| | | scheduler.rescheduleJob(triggerKey, newTrigger); |
| | | } |
| | | |
| | | /** |
| | | * æåä»»å¡ |
| | | */ |
| | | public void pauseTimingTask(Long taskId) throws SchedulerException { |
| | | JobKey jobKey = new JobKey("timingTask_" + taskId); |
| | | scheduler.pauseJob(jobKey); |
| | | } |
| | | |
| | | /** |
| | | * æ¢å¤ä»»å¡ |
| | | */ |
| | | public void resumeTimingTask(Long taskId) throws SchedulerException { |
| | | JobKey jobKey = new JobKey("timingTask_" + taskId); |
| | | scheduler.resumeJob(jobKey); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡ |
| | | */ |
| | | public void unscheduleTimingTask(Long taskId) throws SchedulerException { |
| | | JobKey jobKey = new JobKey("timingTask_" + taskId); |
| | | scheduler.deleteJob(jobKey); |
| | | } |
| | | |
| | | private JobDetail buildJobDetail(TimingTask task) { |
| | | JobDataMap jobDataMap = new JobDataMap(); |
| | | jobDataMap.put("taskId", task.getId()); |
| | | |
| | | return JobBuilder.newJob(TimingTaskJob.class) |
| | | .withIdentity("timingTask_" + task.getId()) |
| | | .withDescription(task.getTaskName()) |
| | | .usingJobData(jobDataMap) |
| | | .storeDurably() |
| | | .build(); |
| | | } |
| | | |
| | | private Trigger buildJobTrigger(TimingTask task, JobDetail jobDetail) { |
| | | String cronExpression = convertToCronExpression(task); |
| | | |
| | | TriggerBuilder<CronTrigger> triggerBuilder = TriggerBuilder.newTrigger() |
| | | .withIdentity("trigger_" + task.getId()) |
| | | .withDescription(task.getTaskName()) |
| | | .withSchedule(CronScheduleBuilder.cronSchedule(cronExpression)); |
| | | |
| | | if (jobDetail != null) { |
| | | triggerBuilder.forJob(jobDetail); |
| | | } |
| | | |
| | | if (task.getNextExecutionTime() != null) { |
| | | triggerBuilder.startAt(Date.from(task.getNextExecutionTime().atZone(ZoneId.systemDefault()).toInstant())); |
| | | } |
| | | |
| | | return triggerBuilder.build(); |
| | | } |
| | | private String convertToCronExpression(TimingTask task) { |
| | | // åæ°æ ¡éª |
| | | if (task == null || task.getFrequencyType() == null || task.getFrequencyDetail() == null) { |
| | | throw new IllegalArgumentException("ä»»å¡åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | // 使ç¨switchç¡®ä¿æ¡ä»¶äºæ¥ |
| | | String frequencyType = task.getFrequencyType().toUpperCase(); // ç»ä¸è½¬ä¸ºå¤§åæ¯è¾ |
| | | switch (frequencyType) { |
| | | case "DAILY": |
| | | return convertDailyToCron(task.getFrequencyDetail()); |
| | | case "WEEKLY": |
| | | return convertWeeklyToCron(task.getFrequencyDetail()); |
| | | case "MONTHLY": |
| | | return convertMonthlyToCron(task.getFrequencyDetail()); |
| | | case "QUARTERLY": |
| | | return convertQuarterlyToCron(task.getFrequencyDetail()); |
| | | default: |
| | | throw new IllegalArgumentException("䏿¯æçé¢çç±»å: " + task.getFrequencyType()); |
| | | } |
| | | } |
| | | |
| | | // æ¯æ¥ä»»å¡è½¬æ¢ |
| | | private String convertDailyToCron(String frequencyDetail) { |
| | | LocalTime time = parseTime(frequencyDetail); |
| | | return String.format("0 %d %d * * ?", time.getMinute(), time.getHour()); |
| | | } |
| | | |
| | | // æ¯å¨ä»»å¡è½¬æ¢ |
| | | private String convertWeeklyToCron(String frequencyDetail) { |
| | | String[] parts = validateAndSplit(frequencyDetail, ",", 2); |
| | | String daysOfWeek = convertDayNamesToCron(parts[0]); |
| | | LocalTime time = parseTime(parts[1]); |
| | | return String.format("0 %d %d ? * %s", time.getMinute(), time.getHour(), daysOfWeek); |
| | | } |
| | | |
| | | // æ¯æä»»å¡è½¬æ¢ |
| | | private String convertMonthlyToCron(String frequencyDetail) { |
| | | String[] parts = validateAndSplit(frequencyDetail, ",", 2); |
| | | int day = validateDayOfMonth(parts[0]); |
| | | LocalTime time = parseTime(parts[1]); |
| | | return String.format("0 %d %d %d * ?", time.getMinute(), time.getHour(), day); |
| | | } |
| | | |
| | | // æ¯å£åº¦ä»»å¡è½¬æ¢ |
| | | private String convertQuarterlyToCron(String frequencyDetail) { |
| | | String[] parts = validateAndSplit(frequencyDetail, ",", 3); |
| | | int month = validateMonth(parts[0]); // éªè¯æä»½(1-12) |
| | | int day = validateDayOfMonth(parts[1]); // éªè¯æ¥æ |
| | | LocalTime time = parseTime(parts[2]); // è§£ææ¶é´ |
| | | |
| | | // 计ç®å£åº¦èµ·å§æä»½(1æ=1, 4æ=4, 7æ=7, 10æ=10) |
| | | int quarterStartMonth = ((month - 1) / 3) * 3 + 1; |
| | | |
| | | return String.format("0 %d %d %d %d/3 ?", |
| | | time.getMinute(), |
| | | time.getHour(), |
| | | day, |
| | | quarterStartMonth); |
| | | } |
| | | |
| | | // æ°å¢éªè¯æä»½çæ¹æ³(1-12) |
| | | private int validateMonth(String monthStr) { |
| | | try { |
| | | int month = Integer.parseInt(monthStr); |
| | | if (month < 1 || month > 12) { |
| | | throw new IllegalArgumentException("æä»½å¿
é¡»å¨1-12ä¹é´"); |
| | | } |
| | | return month; |
| | | } catch (NumberFormatException e) { |
| | | throw new IllegalArgumentException("æ æçæä»½æ ¼å¼"); |
| | | } |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼è§£ææ¶é´ |
| | | private LocalTime parseTime(String timeStr) { |
| | | try { |
| | | return LocalTime.parse(timeStr); |
| | | } catch (DateTimeParseException e) { |
| | | throw new IllegalArgumentException("æ¶é´æ ¼å¼å¿
须为HH:mm", e); |
| | | } |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼éªè¯å¹¶åå²å符串 |
| | | private String[] validateAndSplit(String input, String delimiter, int expectedParts) { |
| | | String[] parts = input.split(delimiter); |
| | | if (parts.length != expectedParts) { |
| | | throw new IllegalArgumentException( |
| | | String.format("æ ¼å¼é误ï¼åºä¸º%dé¨åç¨'%s'åé", expectedParts, delimiter)); |
| | | } |
| | | return parts; |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼éªè¯æä»½ä¸çæ¥ |
| | | private int validateDayOfMonth(String dayStr) { |
| | | int day = Integer.parseInt(dayStr); |
| | | if (day < 1 || day > 31) { |
| | | throw new IllegalArgumentException("æ¥æå¿
é¡»å¨1-31ä¹é´"); |
| | | } |
| | | return day; |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼éªè¯å£åº¦ä¸çæ |
| | | private int validateMonthInQuarter(String monthStr) { |
| | | int month = Integer.parseInt(monthStr); |
| | | if (month < 1 || month > 3) { |
| | | throw new IllegalArgumentException("å£åº¦æä»½å¿
é¡»æ¯1ã2æ3"); |
| | | } |
| | | return month; |
| | | } |
| | | |
| | | // è½¬æ¢ææå åç§° |
| | | private String convertDayNamesToCron(String dayNames) { |
| | | return Arrays.stream(dayNames.split("\\|")) |
| | | .map(this::convertSingleDayName) |
| | | .collect(Collectors.joining(",")); |
| | | } |
| | | |
| | | // 转æ¢å个ææå åç§° |
| | | private String convertSingleDayName(String dayName) { |
| | | switch (dayName.toUpperCase()) { |
| | | case "MON": return "MON"; |
| | | case "TUE": return "TUE"; |
| | | case "WED": return "WED"; |
| | | case "THU": return "THU"; |
| | | case "FRI": return "FRI"; |
| | | case "SAT": return "SAT"; |
| | | case "SUN": return "SUN"; |
| | | default: throw new IllegalArgumentException("æ æçææå : " + dayName); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inspectiontask.service.impl; |
| | | |
| | | 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.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.inspectiontask.dto.TimingTaskDto; |
| | | import com.ruoyi.inspectiontask.mapper.InspectionTaskMapper; |
| | | import com.ruoyi.inspectiontask.mapper.TimingTaskMapper; |
| | | import com.ruoyi.inspectiontask.pojo.TimingTask; |
| | | import com.ruoyi.inspectiontask.service.TimingTaskService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.quartz.SchedulerException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/19 10:55 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class TimingTaskServiceImpl extends ServiceImpl<TimingTaskMapper, TimingTask> implements TimingTaskService { |
| | | |
| | | @Autowired |
| | | private TimingTaskMapper timingTaskMapper; |
| | | |
| | | @Autowired |
| | | private InspectionTaskMapper inspectionTaskMapper; |
| | | |
| | | @Autowired |
| | | private TimingTaskScheduler timingTaskScheduler; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | |
| | | @Override |
| | | public IPage<TimingTaskDto> selectTimingTaskList(Page<TimingTask> page, TimingTask timingTask) { |
| | | // 1. å
å页æ¥è¯¢å®æ¶ä»»å¡æ°æ® |
| | | IPage<TimingTask> taskPage = timingTaskMapper.selectPage(page, null); |
| | | |
| | | // 2. å¦ææ²¡ææ°æ®ï¼ç´æ¥è¿å空å页 |
| | | if (taskPage.getRecords().isEmpty()) { |
| | | return new Page<>(taskPage.getCurrent(), taskPage.getSize(), taskPage.getTotal()); |
| | | } |
| | | |
| | | // 3. æ¶éææéè¦æ¥è¯¢çç¨æ·ID |
| | | Set<Long> userIds = new HashSet<>(); |
| | | |
| | | // æ¶éç»è®°äººID |
| | | taskPage.getRecords().forEach(task -> { |
| | | if (task.getRegistrantId() != null) { |
| | | userIds.add(task.getRegistrantId()); |
| | | } |
| | | }); |
| | | |
| | | // æ¶éå·¡æ£äººIDï¼å¤ä¸ªID以éå·åéï¼ |
| | | taskPage.getRecords().forEach(task -> { |
| | | if (StringUtils.isNotBlank(task.getInspectorIds())) { |
| | | Arrays.stream(task.getInspectorIds().split(",")) |
| | | .filter(StringUtils::isNotBlank) |
| | | .map(Long::valueOf) |
| | | .forEach(userIds::add); |
| | | } |
| | | }); |
| | | |
| | | // 4. æ¹éæ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | Map<Long, String> userNickNameMap = new HashMap<>(); |
| | | if (!userIds.isEmpty()) { |
| | | List<SysUser> users = sysUserMapper.selectUserByIds((new ArrayList<>(userIds))); |
| | | users.forEach(user -> userNickNameMap.put(user.getUserId(), user.getNickName())); |
| | | } |
| | | |
| | | // 5. 转æ¢ä¸ºDTO |
| | | List<TimingTaskDto> dtoList = taskPage.getRecords().stream().map(task -> { |
| | | TimingTaskDto dto = new TimingTaskDto(); |
| | | // å¤å¶åºæ¬å±æ§ |
| | | BeanUtils.copyProperties(task, dto); |
| | | |
| | | // 设置ç»è®°äººæµç§° |
| | | if (task.getRegistrantId() != null) { |
| | | dto.setRegistrant(userNickNameMap.getOrDefault(task.getRegistrantId(), "æªç¥ç¨æ·")); |
| | | } |
| | | |
| | | // 设置巡æ£äººæµç§°å表 |
| | | if (StringUtils.isNotBlank(task.getInspectorIds())) { |
| | | List<String> inspectorNickNames = new ArrayList<>(); |
| | | for (String idStr : task.getInspectorIds().split(",")) { |
| | | if (StringUtils.isNotBlank(idStr)) { |
| | | Long id = Long.valueOf(idStr); |
| | | inspectorNickNames.add(userNickNameMap.getOrDefault(id, "æªç¥ç¨æ·")); |
| | | } |
| | | } |
| | | dto.setInspector(inspectorNickNames); |
| | | } |
| | | |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | // 6. æå»ºè¿åçå页对象 |
| | | Page<TimingTaskDto> resultPage = new Page<>(taskPage.getCurrent(), taskPage.getSize(), taskPage.getTotal()); |
| | | resultPage.setRecords(dtoList); |
| | | return resultPage; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public int addOrEditTimingTask(TimingTaskDto timingTaskDto) throws SchedulerException { |
| | | TimingTask timingTask = new TimingTask(); |
| | | BeanUtils.copyProperties(timingTaskDto, timingTask); |
| | | |
| | | // 设置å建人信æ¯åé»è®¤å¼ |
| | | if (Objects.isNull(timingTaskDto.getId())) { |
| | | timingTask.setRegistrationDate(LocalDate.now()); |
| | | timingTask.setActive(true); |
| | | |
| | | // 计ç®é¦æ¬¡æ§è¡æ¶é´ |
| | | LocalDateTime firstExecutionTime = calculateFirstExecutionTime(timingTask); |
| | | timingTask.setNextExecutionTime(firstExecutionTime); |
| | | |
| | | int result = timingTaskMapper.insert(timingTask); |
| | | if (result > 0) { |
| | | // æ°å¢æååæ·»å å°è°åº¦å¨ |
| | | timingTaskScheduler.scheduleTimingTask(timingTask); |
| | | } |
| | | return result; |
| | | } else { |
| | | int result = timingTaskMapper.updateById(timingTask); |
| | | if (result > 0) { |
| | | // æ´æ°æååéæ°è°åº¦ä»»å¡ |
| | | timingTaskScheduler.rescheduleTimingTask(timingTask); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | private LocalDateTime calculateFirstExecutionTime(TimingTask task) { |
| | | // æ ¹æ®é¢çç±»åå详æ
计ç®é¦æ¬¡æ§è¡æ¶é´ |
| | | String frequencyType = task.getFrequencyType(); |
| | | if ("DAILY".equals(frequencyType)) { |
| | | // å¦ææ¯æ¯å¤©æ§è¡ï¼è®¡ç®ä»å¤©ææå¤©çå
·ä½æ¶é´ |
| | | return calculateDailyFirstExecution(task.getFrequencyDetail()); |
| | | } else if ("WEEKLY".equals(frequencyType)) { |
| | | // å¦ææ¯æ¯å¨æ§è¡ï¼è®¡ç®ä¸å¨çå
·ä½ææå |
| | | return calculateWeeklyFirstExecution(task.getFrequencyDetail()); |
| | | } else if ("MONTHLY".equals(frequencyType)) { |
| | | // å¦ææ¯æ¯ææ§è¡ï¼è®¡ç®ä¸ä¸ªæçå
·ä½æ¥æ |
| | | return calculateMonthlyFirstExecution(task.getFrequencyDetail()); |
| | | } else if ("QUARTERLY".equals(frequencyType)) { |
| | | // èªå®ä¹é¢çï¼å¦æ¯å°æ¶ãæ¯30åéç |
| | | return calculateCustomFirstExecution(task.getFrequencyDetail()); |
| | | } else { |
| | | throw new IllegalArgumentException("䏿¯æçé¢çç±»å: " + task.getFrequencyType()); |
| | | } |
| | | } |
| | | |
| | | private LocalDateTime calculateDailyFirstExecution(String frequencyDetail) { |
| | | // frequencyDetailå¯è½æ¯å
·ä½æ¶é´ï¼å¦ "14:30" |
| | | LocalTime executionTime = LocalTime.parse(frequencyDetail); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime todayExecution = LocalDateTime.of(now.toLocalDate(), executionTime); |
| | | |
| | | // 妿ä»å¤©çæ¶é´å·²è¿ï¼å宿æå¤©æ§è¡ |
| | | return now.isBefore(todayExecution) ? todayExecution : todayExecution.plusDays(1); |
| | | } |
| | | |
| | | // æ å°ææç®åä¸DayOfWeek |
| | | private static final Map<String, DayOfWeek> WEEK_DAY_MAP = new HashMap<>(); |
| | | static { |
| | | WEEK_DAY_MAP.put("MON", DayOfWeek.MONDAY); |
| | | WEEK_DAY_MAP.put("TUE", DayOfWeek.TUESDAY); |
| | | WEEK_DAY_MAP.put("WED", DayOfWeek.WEDNESDAY); |
| | | WEEK_DAY_MAP.put("THU", DayOfWeek.THURSDAY); |
| | | WEEK_DAY_MAP.put("FRI", DayOfWeek.FRIDAY); |
| | | WEEK_DAY_MAP.put("SAT", DayOfWeek.SATURDAY); |
| | | WEEK_DAY_MAP.put("SUN", DayOfWeek.SUNDAY); |
| | | } |
| | | |
| | | private LocalDateTime calculateWeeklyFirstExecution(String frequencyDetail) { |
| | | // è§£æè¾å
¥åæ° |
| | | String[] parts = frequencyDetail.split(","); |
| | | if (parts.length != 2) { |
| | | throw new IllegalArgumentException("åæ°æ ¼å¼é误ï¼åºä¸º'MON,13:43'æ ¼å¼"); |
| | | } |
| | | |
| | | String weekDayStr = parts[0].trim(); |
| | | String timeStr = parts[1].trim(); |
| | | |
| | | // è·å对åºçææå |
| | | DayOfWeek targetDay = WEEK_DAY_MAP.get(weekDayStr); |
| | | if (targetDay == null) { |
| | | throw new IllegalArgumentException("æ æçææç®å: " + weekDayStr); |
| | | } |
| | | |
| | | // è§£ææ¶é´ |
| | | LocalTime targetTime = LocalTime.parse(timeStr, DateTimeFormatter.ofPattern("HH:mm")); |
| | | |
| | | // è·åå½åæ¶é´ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime targetDateTime = now.with(targetDay).with(targetTime); |
| | | |
| | | // å¦æè®¡ç®åºçæ¶é´å¨å½åæ¶é´ä¹åï¼åå ä¸å¨ |
| | | if (targetDateTime.isBefore(now)) { |
| | | targetDateTime = targetDateTime.plusWeeks(1); |
| | | } |
| | | |
| | | return targetDateTime; |
| | | } |
| | | |
| | | private LocalDateTime calculateMonthlyFirstExecution(String frequencyDetail) { |
| | | // è§£æè¾å
¥åæ° |
| | | String[] parts = frequencyDetail.split(","); |
| | | if (parts.length != 2) { |
| | | throw new IllegalArgumentException("åæ°æ ¼å¼é误ï¼åºä¸º'03,17:00'æ ¼å¼"); |
| | | } |
| | | |
| | | String dayStr = parts[0].trim(); |
| | | String timeStr = parts[1].trim(); |
| | | |
| | | // è§£ææ¥æ |
| | | int dayOfMonth; |
| | | try { |
| | | dayOfMonth = Integer.parseInt(dayStr); |
| | | } catch (NumberFormatException e) { |
| | | throw new IllegalArgumentException("æ æçæ¥ææ ¼å¼: " + dayStr, e); |
| | | } |
| | | |
| | | // éªè¯æ¥ææææ§ï¼1-31ä¹é´ï¼ |
| | | if (dayOfMonth < 1 || dayOfMonth > 31) { |
| | | throw new IllegalArgumentException("æ¥æå¿
é¡»å¨1-31ä¹é´: " + dayOfMonth); |
| | | } |
| | | |
| | | // è§£ææ¶é´ |
| | | LocalTime targetTime; |
| | | try { |
| | | targetTime = LocalTime.parse(timeStr, DateTimeFormatter.ofPattern("HH:mm")); |
| | | } catch (DateTimeException e) { |
| | | throw new IllegalArgumentException("æ æçæ¶é´æ ¼å¼: " + timeStr, e); |
| | | } |
| | | |
| | | // è·åå½åæ¶é´ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime targetDateTime = now.withDayOfMonth(dayOfMonth).with(targetTime); |
| | | |
| | | // æ£æ¥æ¥ææ¯å¦è¢«èªå¨è°æ´ï¼å¦31æ¥å¨å°æä¼è¢«è°æ´ï¼ |
| | | boolean isDateAdjusted = targetDateTime.getDayOfMonth() != dayOfMonth; |
| | | |
| | | // å¦æç®æ æ¶é´å¨å½åæ¶é´ä¹åï¼æè
æ¥æè¢«ç³»ç»èªå¨è°æ´äº |
| | | if (targetDateTime.isBefore(now) || isDateAdjusted) { |
| | | // 计ç®ä¸ä¸ªæçæ¥æ |
| | | LocalDateTime nextMonth = now.plusMonths(1); |
| | | // å°è¯è®¾ç½®ä¸ä¸ªæçç®æ æ¥æ |
| | | LocalDateTime nextMonthTarget = nextMonth.withDayOfMonth(dayOfMonth).with(targetTime); |
| | | |
| | | // 妿ä¸ä¸ªæçæ¥æä¹è¢«è°æ´äºï¼å°±ç¨ä¸ä¸ªæçæåä¸å¤© |
| | | if (nextMonthTarget.getDayOfMonth() != dayOfMonth) { |
| | | // æ£ç¡®è·åä¸ä¸ªæçæåä¸å¤©ï¼ä¿®å¤isLeapYearè°ç¨é®é¢ï¼ |
| | | int lastDayOfMonth = nextMonth.getMonth().length( |
| | | Year.of(nextMonth.getYear()).isLeap() |
| | | ); |
| | | nextMonthTarget = nextMonth.withDayOfMonth(lastDayOfMonth).with(targetTime); |
| | | } |
| | | |
| | | targetDateTime = nextMonthTarget; |
| | | } |
| | | |
| | | return targetDateTime; |
| | | } |
| | | |
| | | private LocalDateTime calculateCustomFirstExecution(String frequencyDetail) { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void updateTaskExecutionTime(Long taskId) { |
| | | TimingTask task = timingTaskMapper.selectById(taskId); |
| | | if (task == null) { |
| | | throw new RuntimeException("宿¶ä»»å¡ä¸åå¨ï¼ID: " + taskId); |
| | | } |
| | | |
| | | // æ´æ°æåæ§è¡æ¶é´ä¸ºå½åæ¶é´ |
| | | task.setLastExecutionTime(LocalDateTime.now()); |
| | | |
| | | // 计ç®ä¸æ¬¡æ§è¡æ¶é´ |
| | | LocalDateTime nextExecutionTime = calculateNextExecutionTime( |
| | | task.getFrequencyType(), |
| | | task.getFrequencyDetail(), |
| | | LocalDateTime.now() |
| | | ); |
| | | task.setNextExecutionTime(nextExecutionTime); |
| | | |
| | | // æ´æ°æ°æ®åº |
| | | timingTaskMapper.updateById(task); |
| | | } |
| | | |
| | | /** |
| | | * 计ç®ä¸æ¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateNextExecutionTime(String frequencyType, |
| | | String frequencyDetail, |
| | | LocalDateTime currentTime) { |
| | | try { |
| | | switch (frequencyType) { |
| | | case "DAILY": |
| | | return calculateDailyNextTime(frequencyDetail, currentTime); |
| | | case "WEEKLY": |
| | | return calculateWeeklyNextTime(frequencyDetail, currentTime); |
| | | case "MONTHLY": |
| | | return calculateMonthlyNextTime(frequencyDetail, currentTime); |
| | | case "QUARTERLY": |
| | | return calculateQuarterlyNextTime(frequencyDetail, currentTime); |
| | | default: |
| | | throw new IllegalArgumentException("䏿¯æçé¢çç±»å: " + frequencyType); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("计ç®ä¸æ¬¡æ§è¡æ¶é´å¤±è´¥: " + e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯æ¥ä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateDailyNextTime(String timeStr, LocalDateTime current) { |
| | | LocalTime executionTime = LocalTime.parse(timeStr); // è§£ææ ¼å¼ "HH:mm" |
| | | LocalDateTime nextTime = LocalDateTime.of(current.toLocalDate(), executionTime); |
| | | |
| | | // 妿ä»å¤©çæ¶é´å·²è¿ï¼å宿æå¤© |
| | | return current.isBefore(nextTime) ? nextTime : nextTime.plusDays(1); |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯å¨ä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateWeeklyNextTime(String detail, LocalDateTime current) { |
| | | String[] parts = detail.split(","); |
| | | String dayOfWeekStr = parts[0]; // å¦ "MON" æ "MON|WED|FRI" |
| | | LocalTime time = LocalTime.parse(parts[1]); // æ¶é´é¨å |
| | | |
| | | // è§£æææå (æ¯æå¤ä¸ªææ) |
| | | Set<DayOfWeek> targetDays = parseDayOfWeeks(dayOfWeekStr); |
| | | |
| | | // ä»å½åæ¶é´å¼å§æ¾ä¸ä¸ä¸ªç¬¦åæ¡ä»¶çææå |
| | | LocalDateTime nextTime = current; |
| | | while (true) { |
| | | nextTime = nextTime.plusDays(1); |
| | | if (targetDays.contains(nextTime.getDayOfWeek())) { |
| | | return LocalDateTime.of(nextTime.toLocalDate(), time); |
| | | } |
| | | |
| | | // 鲿¢æ é循ç¯(ç论ä¸ä¸ä¼åç) |
| | | if (nextTime.isAfter(current.plusYears(1))) { |
| | | throw new RuntimeException("æ æ³æ¾å°ä¸æ¬¡æ§è¡æ¶é´"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯æä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateMonthlyNextTime(String detail, LocalDateTime current) { |
| | | String[] parts = detail.split(","); |
| | | int dayOfMonth = Integer.parseInt(parts[0]); |
| | | LocalTime time = LocalTime.parse(parts[1]); |
| | | |
| | | // ä»ä¸ä¸ªæå¼å§è®¡ç® |
| | | LocalDateTime nextTime = current.plusMonths(1) |
| | | .withDayOfMonth(Math.min(dayOfMonth, current.plusMonths(1).toLocalDate().lengthOfMonth())) |
| | | .with(time); |
| | | |
| | | return nextTime; |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç®æ¯å£åº¦ä»»å¡ç䏿¬¡æ§è¡æ¶é´ |
| | | */ |
| | | private LocalDateTime calculateQuarterlyNextTime(String detail, LocalDateTime current) { |
| | | String[] parts = detail.split(","); |
| | | int quarterMonth = Integer.parseInt(parts[0]); // 1=第1个æï¼2=第2个æï¼3=第3个æ |
| | | int dayOfMonth = Integer.parseInt(parts[1]); |
| | | LocalTime time = LocalTime.parse(parts[2]); |
| | | |
| | | // 计ç®å½åå£åº¦ |
| | | int currentQuarter = (current.getMonthValue() - 1) / 3 + 1; |
| | | int currentMonthInQuarter = (current.getMonthValue() - 1) % 3 + 1; |
| | | |
| | | YearMonth targetYearMonth; |
| | | if (currentMonthInQuarter < quarterMonth) { |
| | | // æ¬å£åº¦å
è¿ææ§è¡æºä¼ |
| | | targetYearMonth = YearMonth.from(current) |
| | | .plusMonths(quarterMonth - currentMonthInQuarter); |
| | | } else { |
| | | // éè¦å°ä¸ä¸ªå£åº¦ |
| | | targetYearMonth = YearMonth.from(current) |
| | | .plusMonths(3 - currentMonthInQuarter + quarterMonth); |
| | | } |
| | | |
| | | // å¤çææ«æ¥æ |
| | | int adjustedDay = Math.min(dayOfMonth, targetYearMonth.lengthOfMonth()); |
| | | |
| | | return LocalDateTime.of( |
| | | targetYearMonth.getYear(), |
| | | targetYearMonth.getMonthValue(), |
| | | adjustedDay, |
| | | time.getHour(), |
| | | time.getMinute() |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * è§£æææå å符串 |
| | | */ |
| | | private Set<DayOfWeek> parseDayOfWeeks(String dayOfWeekStr) { |
| | | Set<DayOfWeek> days = new HashSet<>(); |
| | | String[] dayStrs = dayOfWeekStr.split("\\|"); |
| | | |
| | | for (String dayStr : dayStrs) { |
| | | switch (dayStr) { |
| | | case "MON": days.add(DayOfWeek.MONDAY); break; |
| | | case "TUE": days.add(DayOfWeek.TUESDAY); break; |
| | | case "WED": days.add(DayOfWeek.WEDNESDAY); break; |
| | | case "THU": days.add(DayOfWeek.THURSDAY); break; |
| | | case "FRI": days.add(DayOfWeek.FRIDAY); break; |
| | | case "SAT": days.add(DayOfWeek.SATURDAY); break; |
| | | case "SUN": days.add(DayOfWeek.SUNDAY); break; |
| | | default: throw new IllegalArgumentException("æ æçææå : " + dayStr); |
| | | } |
| | | } |
| | | |
| | | return days; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int delByIds(Long[] ids) { |
| | | return timingTaskMapper.deleteBatchIds(Arrays.asList(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.lavorissue.controller; |
| | | |
| | | 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.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.approve.utils.DailyRedisCounter; |
| | | import com.ruoyi.approve.utils.StartAndEndDateDto; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | 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.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.lavorissue.dto.StatisticsLaborIssue; |
| | | import com.ruoyi.lavorissue.mapper.LavorIssueMapper; |
| | | import com.ruoyi.lavorissue.pojo.LaborIssue; |
| | | import com.ruoyi.lavorissue.service.LavorIssueService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/13 11:19 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å³ä¿åæ¾") |
| | | @RequestMapping("/lavorIssue") |
| | | public class LavorIssueController extends BaseController { |
| | | |
| | | @Autowired |
| | | private LavorIssueService laborIssueService; |
| | | |
| | | @Autowired |
| | | private LavorIssueMapper lavorIssueMapper; |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "å³ä¿åæ¾-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å³ä¿åæ¾-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, LaborIssue laborIssue){ |
| | | IPage<LaborIssue> listPage = laborIssueService.listPage(page, laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @GetMapping("/statisticsList") |
| | | @Log(title = "å³ä¿åæ¾-ç»è®¡æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å³ä¿åæ¾-ç»è®¡æ¥è¯¢") |
| | | public AjaxResult statisticsList(LaborIssue laborIssue){ |
| | | List<Map<String, Object>> listPage = laborIssueService.statisticsList(laborIssue); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @Log(title = "å³ä¿åæ¾-æ·»å ", businessType = BusinessType.INSERT) |
| | | @ApiOperation("å³ä¿åæ¾-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody LaborIssue laborIssue){ |
| | | String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | StartAndEndDateDto dateTime = DailyRedisCounter.getDateTime(); |
| | | Long approveId = lavorIssueMapper.selectCount(new LambdaQueryWrapper<LaborIssue>() |
| | | .gt(LaborIssue::getCreateTime, dateTime.getStartDate()) |
| | | .lt(LaborIssue::getCreateTime, dateTime.getEndDate())); |
| | | String formattedCount = String.format("%03d", approveId + 1); |
| | | laborIssue.setOrderNo(today + formattedCount); |
| | | List<LaborIssue> laborIssues = lavorIssueMapper.selectList(new LambdaQueryWrapper<LaborIssue>() |
| | | .like(LaborIssue::getOrderNo, today)); |
| | | if(!CollectionUtils.isEmpty(laborIssues)){ |
| | | long l = Long.parseLong(laborIssues.get(laborIssues.size() - 1).getOrderNo()); |
| | | laborIssue.setOrderNo(String.format("%03d", l + 1)); |
| | | } |
| | | boolean save = laborIssueService.save(laborIssue); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @Log(title = "å³ä¿åæ¾-ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @ApiOperation("å³ä¿åæ¾-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody LaborIssue laborIssue){ |
| | | boolean update = laborIssueService.updateById(laborIssue); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Log(title = "å³ä¿åæ¾-å é¤", businessType = BusinessType.DELETE) |
| | | @ApiOperation("å³ä¿åæ¾-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | boolean delete = laborIssueService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @GetMapping("/statistics") |
| | | @ApiOperation("å³ä¿åæ¾-ç»è®¡") |
| | | public AjaxResult statistics(StatisticsLaborIssue req) throws Exception { |
| | | StatisticsLaborIssue statisticsLaborIssue = laborIssueService.statistics(req); |
| | | return AjaxResult.success(statisticsLaborIssue); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * å³ä¿åæ¾-å¯¼åº |
| | | */ |
| | | @Log(title = "å³ä¿åæ¾-导åº", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("å³ä¿åæ¾-导åº") |
| | | public void export(HttpServletResponse response) { |
| | | Long tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | ExcelUtil<LaborIssue> util = new ExcelUtil<LaborIssue>(LaborIssue.class); |
| | | List<LaborIssue> list = lavorIssueMapper.list(new LaborIssue()); |
| | | SysDept sysDept = sysDeptMapper.selectDeptById(tenantId); |
| | | if(sysDept == null){ |
| | | throw new RuntimeException("é¨é¨ä¸åå¨!"); |
| | | } |
| | | list.forEach(item -> { |
| | | item.setDeptName(sysDept.getDeptName()); |
| | | }); |
| | | util.exportExcel(response, list , "å³ä¿å°è´¦"); |
| | | } |
| | | |
| | | /** |
| | | * å³ä¿åæ¾-å¯¼åº |
| | | */ |
| | | @Log(title = "å³ä¿åæ¾-导åº", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportCopy") |
| | | @ApiOperation("å³ä¿åæ¾-导åº") |
| | | public void exportCopy(HttpServletResponse response,LaborIssue laborIssue) throws UnsupportedEncodingException { |
| | | laborIssueService.exportCopy(response,laborIssue); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.lavorissue.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/14 11:53 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class StatisticsLaborIssue { |
| | | |
| | | private Integer season; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date issueDate; |
| | | |
| | | private Long ylqNum = 0L; |
| | | |
| | | private Long wlqNum = 0L; |
| | | |
| | | private Long csylqNum = 0L; |
| | | |
| | | private Long cswlqNum = 0L; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.lavorissue.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.lavorissue.pojo.LaborIssue; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/13 11:17 |
| | | */ |
| | | public interface LavorIssueMapper extends BaseMapper<LaborIssue> { |
| | | |
| | | /** |
| | | * è·åå表 |
| | | * |
| | | * @param page |
| | | * @param laborIssue |
| | | * @return |
| | | */ |
| | | IPage<LaborIssue> listPage(Page page, @Param("req") LaborIssue laborIssue); |
| | | |
| | | List<LaborIssue> list(@Param("req") LaborIssue laborIssue); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.lavorissue.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.approve.utils.StartAndEndDateDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/13 11:12 |
| | | */ |
| | | @Data |
| | | @TableName("labor_issue") |
| | | @ApiModel |
| | | public class LaborIssue extends StartAndEndDateDto { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("1-å·²é¢åå³ä¿æ°é 2-æªé¢åå³ä¿æ°é 3-è¶
æ¶å·²é¢åå³ä¿æ°é 4-è¶
æ¶æªé¢åå³ä¿æ°é") |
| | | private Integer status; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer season; |
| | | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | @ApiModelProperty("é¨é¨åç§°") |
| | | @Excel(name = "é¨é¨åç§°") |
| | | @TableField(exist = false) |
| | | private String deptName; |
| | | |
| | | /** |
| | | * å³ä¿åå· |
| | | */ |
| | | @ApiModelProperty("å³ä¿åå·") |
| | | @Excel(name = "å³ä¿åå·") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * åå·¥id |
| | | */ |
| | | @ApiModelProperty("åå·¥id") |
| | | private Long staffId; |
| | | |
| | | /** |
| | | * åå·¥åç§° |
| | | */ |
| | | @ApiModelProperty("åå·¥åç§°") |
| | | @Excel(name = "åå·¥åç§°") |
| | | @TableField(exist = false) |
| | | private String staffName; |
| | | |
| | | /** |
| | | * åå·¥ç¼å· |
| | | */ |
| | | @ApiModelProperty("åå·¥ç¼å·") |
| | | @Excel(name = "åå·¥ç¼å·") |
| | | @TableField(exist = false) |
| | | private String staffNo; |
| | | |
| | | /** |
| | | * å³ä¿ç±»å-åå
¸ |
| | | */ |
| | | @ApiModelProperty("å³ä¿ç±»å-åå
¸") |
| | | private String dictType; |
| | | |
| | | /** |
| | | * å³ä¿ç±»å |
| | | */ |
| | | @ApiModelProperty("å³ä¿ç±»å") |
| | | @Excel(name = "å³ä¿ç±»å") |
| | | @TableField(exist = false) |
| | | private String dictTypeName; |
| | | |
| | | /** |
| | | * é²å
·åç§°-åå
¸ |
| | | */ |
| | | @ApiModelProperty("é²å
·åç§°-åå
¸") |
| | | private String dictId; |
| | | |
| | | /** |
| | | * é²å
·åç§° |
| | | */ |
| | | @ApiModelProperty("é²å
·åç§°") |
| | | @Excel(name = "é²å
·åç§°") |
| | | @TableField(exist = false) |
| | | private String dictName; |
| | | |
| | | /** |
| | | * é¢ç¨æ°é |
| | | */ |
| | | @ApiModelProperty("é¢ç¨æ°é") |
| | | @Excel(name = "é¢ç¨æ°é") |
| | | private Long num; |
| | | |
| | | /** |
| | | * è¿åæ¥æ |
| | | */ |
| | | @ApiModelProperty("è¿åæ¥æ") |
| | | @Excel(name = "è¿åæ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date factoryDate; |
| | | |
| | | /** |
| | | * åæ¾æ¥æ |
| | | */ |
| | | @ApiModelProperty("åæ¾æ¥æ") |
| | | @Excel(name = "åæ¾æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date issueDate; |
| | | |
| | | /** |
| | | * é¢ç¨æ¥æ |
| | | */ |
| | | @ApiModelProperty("é¢ç¨æ¥æ") |
| | | @Excel(name = "é¢ç¨æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date adoptedDate; |
| | | |
| | | /** |
| | | * ç¾å |
| | | */ |
| | | @Excel(name = "ç¾å") |
| | | @TableField(exist = false) |
| | | private String sign; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.lavorissue.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.lavorissue.dto.StatisticsLaborIssue; |
| | | import com.ruoyi.lavorissue.pojo.LaborIssue; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/13 11:18 |
| | | */ |
| | | public interface LavorIssueService extends IService<LaborIssue> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | * |
| | | * @param page |
| | | * @param laborIssue |
| | | * @return |
| | | */ |
| | | IPage<LaborIssue> listPage(Page page, LaborIssue laborIssue); |
| | | |
| | | StatisticsLaborIssue statistics(StatisticsLaborIssue req) throws Exception; |
| | | |
| | | void exportCopy(HttpServletResponse response, LaborIssue laborIssue) throws UnsupportedEncodingException; |
| | | |
| | | List<Map<String, Object>> statisticsList(LaborIssue laborIssue); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.lavorissue.service.impl; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | 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.approve.utils.StartAndEndDateDto; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.excel.ConfigurableMergeStrategy; |
| | | import com.ruoyi.common.utils.excel.CustomCellStyleHandler; |
| | | import com.ruoyi.lavorissue.dto.StatisticsLaborIssue; |
| | | import com.ruoyi.lavorissue.mapper.LavorIssueMapper; |
| | | import com.ruoyi.lavorissue.pojo.LaborIssue; |
| | | import com.ruoyi.lavorissue.service.LavorIssueService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysDictData; |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysDictDataMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.util.CellRangeAddress; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/8/13 11:18 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class LavorIssueServiceImpl extends ServiceImpl<LavorIssueMapper, LaborIssue> implements LavorIssueService { |
| | | |
| | | @Autowired |
| | | private LavorIssueMapper lavorIssueMapper; |
| | | |
| | | @Override |
| | | public IPage<LaborIssue> listPage(Page page, LaborIssue laborIssue) { |
| | | StartAndEndDateDto startAndEndDateDto = getStartAndEndDateDto(laborIssue.getSeason(), laborIssue.getIssueDate()); |
| | | laborIssue.setStartDate(startAndEndDateDto.getStartDate()); |
| | | laborIssue.setEndDate(startAndEndDateDto.getEndDate()); |
| | | return lavorIssueMapper.listPage(page, laborIssue); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> statisticsList(LaborIssue laborIssue){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | StartAndEndDateDto startAndEndDateDto = getStartAndEndDateDto(laborIssue.getSeason(), laborIssue.getIssueDate()); |
| | | laborIssue.setStartDate(startAndEndDateDto.getStartDate()); |
| | | laborIssue.setEndDate(startAndEndDateDto.getEndDate()); |
| | | List<LaborIssue> laborIssueIPage = lavorIssueMapper.list(laborIssue); |
| | | |
| | | // 使ç¨å¯åçArrayListæ¿æ¢é»è®¤çä¸å¯åå表 |
| | | List<Map<String, Object>> records = new ArrayList<>(); |
| | | |
| | | Map<String, List<LaborIssue>> collect = laborIssueIPage.stream().collect(Collectors.groupingBy(LaborIssue::getStaffNo)); |
| | | collect.forEach((k, v) -> { |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | LaborIssue laborIssue1 = v.get(0); |
| | | hashMap.put("id", v.stream().map(LaborIssue::getId)); |
| | | hashMap.put("deptName", laborIssue1.getDeptName()); |
| | | hashMap.put("orderNo", laborIssue1.getOrderNo()); |
| | | hashMap.put("staffId", laborIssue1.getStaffId()); |
| | | hashMap.put("staffName", laborIssue1.getStaffName()); |
| | | hashMap.put("staffNo", laborIssue1.getStaffNo()); |
| | | hashMap.put("dictType", laborIssue1.getDictType()); |
| | | hashMap.put("dictTypeName", laborIssue1.getDictTypeName()); |
| | | hashMap.put("factoryDate", laborIssue1.getFactoryDate() == null ? "" : sdf.format(laborIssue1.getFactoryDate())); |
| | | hashMap.put("issueDate", laborIssue1.getIssueDate() == null ? "" : sdf.format(laborIssue1.getIssueDate())); |
| | | hashMap.put("adoptedDate", laborIssue1.getAdoptedDate() == null ? "" : sdf.format(laborIssue1.getAdoptedDate())); |
| | | hashMap.put("tenantId", laborIssue1.getTenantId()); |
| | | Map<String, List<LaborIssue>> collect1 = v.stream().collect(Collectors.groupingBy(LaborIssue::getDictId)); |
| | | collect1.forEach((k1, v1) -> { |
| | | hashMap.put(k1, v1.stream() |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum()); |
| | | }); |
| | | records.add(hashMap); |
| | | }); |
| | | return records; |
| | | } |
| | | |
| | | public StartAndEndDateDto getStartAndEndDateDto(Integer season,Date payDate){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | StartAndEndDateDto startAndEndDateDto = new StartAndEndDateDto(); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | int currentYear = calendar.get(Calendar.YEAR); |
| | | startAndEndDateDto.setYear(currentYear); |
| | | if(season != null){ |
| | | switch (season){ |
| | | case 1: |
| | | startAndEndDateDto.setStartDate(currentYear + "-01-01"); |
| | | startAndEndDateDto.setEndDate(currentYear + "-03-31"); |
| | | startAndEndDateDto.setStartMonth(1); |
| | | startAndEndDateDto.setEndMonth(3); |
| | | break; |
| | | case 2: |
| | | startAndEndDateDto.setStartDate(currentYear + "-04-01"); |
| | | startAndEndDateDto.setEndDate(currentYear + "-06-30"); |
| | | startAndEndDateDto.setStartMonth(4); |
| | | startAndEndDateDto.setEndMonth(6); |
| | | break; |
| | | case 3: |
| | | startAndEndDateDto.setStartDate(currentYear + "-07-01"); |
| | | startAndEndDateDto.setEndDate(currentYear + "-09-30"); |
| | | startAndEndDateDto.setStartMonth(7); |
| | | startAndEndDateDto.setEndMonth(9); |
| | | break; |
| | | case 4: |
| | | startAndEndDateDto.setStartDate(currentYear + "-10-01"); |
| | | startAndEndDateDto.setEndDate(currentYear + "-12-31"); |
| | | startAndEndDateDto.setStartMonth(10); |
| | | startAndEndDateDto.setEndMonth(12); |
| | | break; |
| | | } |
| | | } |
| | | if(payDate != null){ |
| | | Date lastDayOfMonth = getLastDayOfMonth(payDate); |
| | | Date firstDayOfMonth = getFirstDayOfMonth(payDate); |
| | | startAndEndDateDto.setStartDate(sdf.format(firstDayOfMonth)); |
| | | startAndEndDateDto.setEndDate(sdf.format(lastDayOfMonth)); |
| | | startAndEndDateDto.setStartMonth(payDate.getMonth() + 1); |
| | | startAndEndDateDto.setEndMonth(payDate.getMonth() + 1); |
| | | } |
| | | return startAndEndDateDto; |
| | | } |
| | | |
| | | @Override |
| | | public StatisticsLaborIssue statistics(StatisticsLaborIssue req) throws Exception{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | StatisticsLaborIssue statisticsLaborIssue = new StatisticsLaborIssue(); |
| | | StartAndEndDateDto startAndEndDateDto = getStartAndEndDateDto(req.getSeason(), req.getIssueDate()); |
| | | LambdaQueryWrapper<LaborIssue> laborIssueLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(req.getSeason() != null || req.getIssueDate() != null){ |
| | | laborIssueLambdaQueryWrapper.ge(LaborIssue::getIssueDate, startAndEndDateDto.getStartDate()) |
| | | .le(LaborIssue::getIssueDate, startAndEndDateDto.getEndDate()); |
| | | } |
| | | List<LaborIssue> laborIssues = lavorIssueMapper.selectList(laborIssueLambdaQueryWrapper); |
| | | if(!CollectionUtils.isEmpty(laborIssues)){ |
| | | Long sum = laborIssues.stream() |
| | | .filter(laborIssue -> laborIssue.getAdoptedDate() != null) |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum(); |
| | | statisticsLaborIssue.setYlqNum(sum); |
| | | statisticsLaborIssue.setWlqNum(laborIssues.stream() |
| | | .filter(laborIssue -> laborIssue.getAdoptedDate() == null) |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum()); |
| | | Date currentDate = new Date(); |
| | | Date parse = sdf.parse(sdf.format(currentDate)); |
| | | statisticsLaborIssue.setCsylqNum(laborIssues.stream() |
| | | .filter(laborIssue -> laborIssue.getIssueDate() != null |
| | | && laborIssue.getAdoptedDate() != null |
| | | && (laborIssue.getIssueDate().before(laborIssue.getAdoptedDate()))) |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum()); |
| | | statisticsLaborIssue.setCswlqNum(laborIssues.stream() |
| | | .filter(laborIssue -> laborIssue.getIssueDate() != null |
| | | && laborIssue.getIssueDate().before(parse) |
| | | && laborIssue.getAdoptedDate() == null) |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum()); |
| | | } |
| | | return statisticsLaborIssue; |
| | | } |
| | | |
| | | @Autowired |
| | | private SysDictDataMapper sysDictDataMapper; |
| | | |
| | | @Override |
| | | public void exportCopy(HttpServletResponse response, LaborIssue laborIssue) throws UnsupportedEncodingException { |
| | | List<SysDictData> sys_lavor_issue = sysDictDataMapper.selectDictDataByType("sys_lavor_issue"); |
| | | if(CollectionUtils.isEmpty(sys_lavor_issue)){ |
| | | throw new RuntimeException("åå
¸æ°æ®ä¸ºç©º"); |
| | | } |
| | | StartAndEndDateDto startAndEndDateDto = getStartAndEndDateDto(laborIssue.getSeason(), laborIssue.getIssueDate()); |
| | | BeanUtils.copyProperties(startAndEndDateDto, laborIssue); |
| | | List<LaborIssue> laborIssues = lavorIssueMapper.list(laborIssue); |
| | | if (CollectionUtils.isEmpty(laborIssues)) { |
| | | throw new RuntimeException("æ°æ®ä¸ºç©º"); |
| | | } |
| | | Map<String, List<LaborIssue>> laborIssueMap = laborIssues.stream() |
| | | .collect(Collectors.groupingBy(LaborIssue::getStaffNo)); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // è¿éURLEncoder.encodeå¯ä»¥é²æ¢ä¸æä¹±ç å½ç¶åeasyexcel没æå
³ç³» |
| | | String fileName = URLEncoder.encode("å³ä¿å°è´¦", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | |
| | | try { |
| | | //æ°å»ºExcelWriter |
| | | ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()) |
| | | .registerWriteHandler(new CustomCellStyleHandler()) |
| | | .registerWriteHandler(new ConfigurableMergeStrategy(exportExternalPackingListGetMerge(4,sys_lavor_issue.size(),laborIssueMap.size()))) |
| | | .build(); |
| | | |
| | | List<List<List<String>>> data = completeExternalPackingList(laborIssueMap, sys_lavor_issue,laborIssue); |
| | | |
| | | for (int i = 0; i < data.size(); i++) { |
| | | List<List<String>> list = data.get(i); |
| | | |
| | | //è·åsheet0对象 |
| | | WriteSheet mainSheet = EasyExcel.writerSheet(i, "å³ä¿å°è´¦" + i).build(); |
| | | //åsheet0åå
¥æ°æ® ä¼ å
¥ç©ºlistè¿æ ·åªå¯¼åºè¡¨å¤´ |
| | | excelWriter.write(list, mainSheet); |
| | | } |
| | | |
| | | //å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | |
| | | // å¤çå¤é¨è£
ç®±åæ°æ® |
| | | private List<List<List<String>>> completeExternalPackingList(Map<String, List<LaborIssue>> listMap,List<SysDictData> sys_lavor_issue,LaborIssue obj) { |
| | | List<List<List<String>>> data = new ArrayList<>(); |
| | | int num = sys_lavor_issue.size(); |
| | | |
| | | List<List<String>> item = new ArrayList<>(); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add("é¨é¨"); |
| | | list.add(""); |
| | | list.add("ä¼ä¸ç®¡çç§"); |
| | | list.add(""); |
| | | list.add("ä¼ä¸ç®¡çç§" + obj.getYear() + "å¹´" + obj.getStartMonth() + "æ-" + obj.getYear() + "å¹´" + obj.getEndMonth() +"æå³ä¿åæ¾è®¡å表"); |
| | | for (int i = 1; i <= num; i++){ |
| | | list.add(""); |
| | | } |
| | | item.add(list); |
| | | |
| | | List<String> list1 = new ArrayList<>(); |
| | | list1.add("å¼å§å¹´/æ"); |
| | | list1.add(""); |
| | | list1.add("ç»æå¹´/æ"); |
| | | list1.add(""); |
| | | for (int i = 0; i <= num; i++){ |
| | | list1.add(""); |
| | | } |
| | | item.add(list1); |
| | | |
| | | List<String> list2 = new ArrayList<>(); |
| | | list2.add(obj.getYear().toString()); |
| | | list2.add(obj.getStartMonth().toString()); |
| | | list2.add(obj.getYear().toString()); |
| | | list2.add(obj.getEndMonth().toString()); |
| | | for (int i = 0; i <= num; i++){ |
| | | list.add(""); |
| | | } |
| | | item.add(list2); |
| | | |
| | | List<String> list3 = new ArrayList<>(); |
| | | list3.add("é¨é¨åç§°"); |
| | | list3.add(""); |
| | | list3.add("å§å"); |
| | | list3.add("å·¥å·"); |
| | | for (SysDictData sysDictData : sys_lavor_issue) { |
| | | list3.add(sysDictData.getDictLabel()); |
| | | } |
| | | list3.add("ç¾å"); |
| | | item.add(list3); |
| | | |
| | | // å¡«å¼ |
| | | SysDept sysDept = sysDeptMapper.selectDeptById(SecurityUtils.getLoginUser().getTenantId()); |
| | | List<String> sumList = new ArrayList<>(); |
| | | AtomicInteger i = new AtomicInteger(); |
| | | listMap.forEach((key, value) -> { |
| | | List<String> list4 = new ArrayList<>(); |
| | | list4.add(sysDept.getDeptName()); |
| | | list4.add(""); |
| | | list4.add(value.get(0).getStaffName()); |
| | | list4.add(value.get(0).getStaffNo()); |
| | | int j = 0; |
| | | for (SysDictData sysDictData : sys_lavor_issue) { |
| | | list4.add(value.stream().filter(laborIssue -> laborIssue.getDictId().equals(sysDictData.getDictValue())) |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum() |
| | | + ""); |
| | | if(i.get() == 0){ |
| | | sumList.add(value.stream().filter(laborIssue -> laborIssue.getDictId().equals(sysDictData.getDictValue())) |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum() |
| | | + ""); |
| | | }else { |
| | | sumList.set(j,(Long.parseLong(sumList.get(j)) + value.stream().filter(laborIssue -> laborIssue.getDictId().equals(sysDictData.getDictValue())) |
| | | .mapToLong(LaborIssue::getNum) |
| | | .sum()) |
| | | + ""); |
| | | } |
| | | j++; |
| | | } |
| | | i.getAndIncrement(); |
| | | item.add(list4); |
| | | }); |
| | | List<String> list5 = new ArrayList<>(); |
| | | list5.add("å计"); |
| | | list5.add(""); |
| | | list5.add(""); |
| | | list5.add(""); |
| | | for (int h = 0; h < sumList.size(); h++){ |
| | | list5.add(sumList.get(h)); |
| | | } |
| | | item.add(list5); |
| | | data.add(item); |
| | | return data; |
| | | } |
| | | |
| | | /** |
| | | * å¤é¨è£
ç®±ååå¹¶åå
æ ¼ |
| | | * |
| | | * @return |
| | | */ |
| | | private List<CellRangeAddress> exportExternalPackingListGetMerge(Integer rowNum,Integer num,Integer listSize) { |
| | | List<CellRangeAddress> mergeRegions = new ArrayList<>(); |
| | | mergeRegions.add(new CellRangeAddress(0, 0, 0, 1)); // åå¹¶A1:Q2 |
| | | mergeRegions.add(new CellRangeAddress(0, 0, 2, 3)); // åå¹¶A4:Q4 |
| | | |
| | | mergeRegions.add(new CellRangeAddress(0, 2, rowNum, rowNum + num)); // åå¹¶A5:B6 |
| | | mergeRegions.add(new CellRangeAddress(1, 1, 0, 1)); // åå¹¶C5:E6 |
| | | mergeRegions.add(new CellRangeAddress(1, 1, 2, 3)); // åå¹¶F5:G6 |
| | | mergeRegions.add(new CellRangeAddress(3, 3, 0, 1)); // åå¹¶H5:I6 |
| | | for (int i = 1; i <= listSize; i++) { |
| | | mergeRegions.add(new CellRangeAddress(3 + i, 3 + i, 0, 1)); |
| | | } |
| | | mergeRegions.add(new CellRangeAddress(rowNum + listSize, rowNum + listSize, 0, 3)); |
| | | return mergeRegions; |
| | | } |
| | | |
| | | public Date getLastDayOfMonth(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); // è®¾ç½®ä¼ å
¥çDate |
| | | calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); // è®¾ç½®ä¸ºå½ææåä¸å¤© |
| | | return calendar.getTime(); // è¿åDate对象 |
| | | } |
| | | |
| | | /** |
| | | * è·åå½æç¬¬ä¸å¤© |
| | | * @param date |
| | | * @return |
| | | */ |
| | | public Date getFirstDayOfMonth(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); // è®¾ç½®ä¼ å
¥çDate |
| | | calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMinimum(Calendar.DAY_OF_MONTH)); // è®¾ç½®ä¸ºå½æç¬¬ä¸å¤© |
| | | return calendar.getTime(); // è¿åDate对象 |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.measuringinstrumentledger.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.measuringinstrumentledger.dto.SparePartsDto; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/spareParts") |
| | | @Api(tags = "å¤ä»¶åç±»æ¥å£") |
| | | public class SparePartsController { |
| | | @Autowired |
| | | private SparePartsService sparePartsService; |
| | | @GetMapping("/getTree") |
| | | @ApiOperation("å¤ä»¶åç±»-æ ç»æ") |
| | | public AjaxResult getTree(){ |
| | | List<SparePartsDto> tree = sparePartsService.getTree(); |
| | | return AjaxResult.success(tree); |
| | | } |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å¤ä»¶åç±»-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, SpareParts spareParts){ |
| | | IPage<SparePartsDto> listPage = sparePartsService.listPage(page, spareParts); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | // @GetMapping("/list") |
| | | // @ApiOperation("å¤ä»¶åç±»-æ¥è¯¢ææ") |
| | | // public AjaxResult list(){ |
| | | // return AjaxResult.success(sparePartsService.list()); |
| | | // } |
| | | @PostMapping("/add") |
| | | @ApiOperation("å¤ä»¶åç±»-æ·»å ") |
| | | @Log(title = "å¤ä»¶åç±»-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody SpareParts spareParts){ |
| | | return AjaxResult.success(sparePartsService.save(spareParts)); |
| | | } |
| | | @PostMapping("/update") |
| | | @ApiOperation("å¤ä»¶åç±»-æ´æ°") |
| | | @Log(title = "å¤ä»¶åç±»-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody SpareParts spareParts){ |
| | | return AjaxResult.success(sparePartsService.updateById(spareParts)); |
| | | } |
| | | @DeleteMapping("/delete/{id}") |
| | | @ApiOperation("å¤ä»¶åç±»-å é¤") |
| | | @Log(title = "å¤ä»¶åç±»-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@PathVariable Long id){ |
| | | return AjaxResult.success(sparePartsService.removeById(id)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.measuringinstrumentledger.dto; |
| | | |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SparePartsDto extends SpareParts { |
| | | /** |
| | | * å¤ä»¶åç±»ç¶åç§° |
| | | */ |
| | | private String parentName; |
| | | private List<SparePartsDto> children; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.measuringinstrumentledger.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.measuringinstrumentledger.dto.SparePartsDto; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface SparePartsMapper extends BaseMapper<SpareParts> { |
| | | IPage<SparePartsDto> listPage(Page page,@Param("spareParts") SpareParts spareParts); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.measuringinstrumentledger.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("spare_parts") |
| | | public class SpareParts { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * å¤ä»¶åç±»åç§° |
| | | */ |
| | | private String name; |
| | | /** |
| | | * å¤ä»¶åç±»ç¼å· |
| | | */ |
| | | private String sparePartsNo; |
| | | /** |
| | | * å¤ä»¶ç¶id |
| | | */ |
| | | private Long parentId; |
| | | /** |
| | | * å¤ä»¶ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * å¤ä»¶åç±»æè¿° |
| | | */ |
| | | private String description; |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty("æ´æ°äºº") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty("ç§æ·id") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.measuringinstrumentledger.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.measuringinstrumentledger.dto.SparePartsDto; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface SparePartsService extends IService<SpareParts> { |
| | | IPage<SparePartsDto> listPage(Page page, SpareParts spareParts); |
| | | |
| | | List<SparePartsDto> getTree(); |
| | | } |
| | |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| | |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.measuringinstrumentledger.service.impl; |
| | | |
| | | |
| | | 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.measuringinstrumentledger.dto.SparePartsDto; |
| | | import com.ruoyi.measuringinstrumentledger.mapper.SparePartsMapper; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.SpareParts; |
| | | import com.ruoyi.measuringinstrumentledger.service.SparePartsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class SparePartsServiceImpl extends ServiceImpl<SparePartsMapper, SpareParts> implements SparePartsService { |
| | | @Autowired |
| | | private SparePartsMapper sparePartsMapper; |
| | | @Override |
| | | public IPage<SparePartsDto> listPage(Page page, SpareParts spareParts) { |
| | | return sparePartsMapper.listPage(page,spareParts); |
| | | } |
| | | |
| | | @Override |
| | | public List<SparePartsDto> getTree() { |
| | | SpareParts spareParts = new SpareParts(); |
| | | IPage<SparePartsDto> sparePartsDtoIPage = sparePartsMapper.listPage(new Page<>(1, -1), spareParts); |
| | | List<SparePartsDto> records = sparePartsDtoIPage.getRecords(); |
| | | return buildTree(records); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å°æå¹³ç»ææ°æ®è½¬æ¢ä¸ºæ å½¢ç»æ |
| | | * @param flatData æå¹³èç¹å表 |
| | | * @return æ å½¢ç»ææ ¹èç¹å表 |
| | | */ |
| | | public static List<SparePartsDto> buildTree(List<SparePartsDto> flatData) { |
| | | List<SparePartsDto> result = new ArrayList<>(); |
| | | if (flatData == null || flatData.isEmpty()) { |
| | | return result; // 空è¾å
¥ç´æ¥è¿å空å表 |
| | | } |
| | | |
| | | // 1. å建èç¹æ å°è¡¨ï¼å卿æèç¹å¹¶åå§ååèç¹å表 |
| | | Map<Long, SparePartsDto> nodeMap = new HashMap<>(); |
| | | for (SparePartsDto node : flatData) { |
| | | // ç¡®ä¿åèç¹å表åå§å(é¿å
空æéå¼å¸¸) |
| | | if (node.getChildren() == null) { |
| | | node.setChildren(new ArrayList<>()); |
| | | } |
| | | nodeMap.put(node.getId(), node); |
| | | } |
| | | |
| | | // 2. æå»ºæ å½¢ç»æ |
| | | for (SparePartsDto node : flatData) { |
| | | Long parentId = node.getParentId(); |
| | | if (parentId == null || !nodeMap.containsKey(parentId)) { |
| | | // æ ç¶èç¹æç¶èç¹ä¸åå¨ï¼ä½ä¸ºæ ¹èç¹ |
| | | result.add(node); |
| | | } else { |
| | | // æç¶èç¹ï¼æ·»å å°ç¶èç¹çåèç¹å表 |
| | | SparePartsDto parentNode = nodeMap.get(parentId); |
| | | parentNode.getChildren().add(node); |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedger; |
| | | import com.ruoyi.oA.dto.OaProjectDto; |
| | | import com.ruoyi.oA.pojo.OaProject; |
| | | import com.ruoyi.oA.service.OaProjectService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "oA项ç®ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/oA/project") |
| | | public class OaProjectController { |
| | | @Autowired |
| | | private OaProjectService oaProjectService; |
| | | |
| | | @ApiOperation("è·å项ç®å表") |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, OaProjectDto oaProjectDto) { |
| | | IPage<OaProjectDto> listPage = oaProjectService.listPage(page, oaProjectDto); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | @ApiOperation("è·å项ç®å表详æ
") |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList(Page page, OaProjectDto oaProjectDto) { |
| | | IPage<OaProjectDto> listPage = oaProjectService.listPage(page, oaProjectDto); |
| | | HashMap<Object, Object> Map = new HashMap<>(); |
| | | listPage.getRecords().forEach(item -> { |
| | | Map.put(item.getProjectId(), item); |
| | | }); |
| | | return AjaxResult.success(Map); |
| | | } |
| | | @ApiOperation("墿·»é¡¹ç®") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody OaProject oaProject) { |
| | | boolean save = oaProjectService.save(oaProject); |
| | | return AjaxResult.success(save); |
| | | } |
| | | @ApiOperation("å é¤é¡¹ç®") |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | boolean remove = oaProjectService.deleteById(id); |
| | | return AjaxResult.success(remove); |
| | | } |
| | | @ApiOperation("æ´æ°é¡¹ç®") |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody OaProject oaProject) { |
| | | boolean update = oaProjectService.updateById(oaProject); |
| | | return AjaxResult.success(update); |
| | | } |
| | | // @ApiOperation("æ ¹æ®IDè·å项ç®è¯¦æ
") |
| | | // @GetMapping("/getById") |
| | | // public AjaxResult getById(Long id) { |
| | | // OaProject oaProject = oaProjectService.getById(id); |
| | | // return AjaxResult.success(oaProject); |
| | | // } |
| | | @ApiOperation("å¯¼åºæé项ç®") |
| | | @PostMapping("/export/{ids}") |
| | | public void export(HttpServletResponse response,@PathVariable("ids") List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | throw new IllegalArgumentException("导åºé¡¹ç®å表ä¸è½ä¸ºç©º"); |
| | | } |
| | | oaProjectService.export(response, ids); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.oA.pojo.OaProjectPhase; |
| | | import com.ruoyi.oA.service.OaProjectPhaseService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "oA项ç®é¶æ®µç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/oA/projectPhase") |
| | | public class OaProjectPhaseController { |
| | | @Autowired |
| | | private OaProjectPhaseService oaProjectPhaseService; |
| | | |
| | | @ApiOperation("æ°å¢é¡¹ç®é¶æ®µ") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody OaProjectPhase oaProjectPhase) { |
| | | return AjaxResult.success(oaProjectPhaseService.save(oaProjectPhase)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤é¡¹ç®é¶æ®µ") |
| | | @DeleteMapping("/delete/{phaseId}") |
| | | public AjaxResult delete(@PathVariable Integer phaseId) { |
| | | return AjaxResult.success(oaProjectPhaseService.deleteById(phaseId)); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°é¡¹ç®é¶æ®µ") |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody OaProjectPhase oaProjectPhase) { |
| | | return AjaxResult.success(oaProjectPhaseService.updateById(oaProjectPhase)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®é¡¹ç®idæ¥è¯¢é¡¹ç®é¶æ®µå表") |
| | | @GetMapping("/listByProjectId/{projectId}") |
| | | public AjaxResult listByProjectId(@PathVariable Integer projectId) { |
| | | return AjaxResult.success(oaProjectPhaseService.listByProjectId(projectId)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.oA.pojo.OaProjectPhaseTask; |
| | | import com.ruoyi.oA.service.OaProjectPhaseTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "oA项ç®é¶æ®µä»»å¡ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/oA/projectPhaseTask") |
| | | public class OaProjectPhaseTaskController { |
| | | @Autowired |
| | | private OaProjectPhaseTaskService oaProjectPhaseTaskService; |
| | | |
| | | @ApiOperation("æ°å¢é¡¹ç®é¶æ®µä»»å¡") |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody OaProjectPhaseTask oaProjectPhaseTask) { |
| | | return AjaxResult.success(oaProjectPhaseTaskService.save(oaProjectPhaseTask)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®é¡¹ç®é¶æ®µidæ¥è¯¢é¡¹ç®é¶æ®µä»»å¡å表") |
| | | @GetMapping("/listByPhaseId/{phaseId}") |
| | | public AjaxResult listByPhaseId(@PathVariable Integer phaseId) { |
| | | return AjaxResult.success(oaProjectPhaseTaskService.listByPhaseId(phaseId)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤é¡¹ç®é¶æ®µä»»å¡") |
| | | @DeleteMapping("/delete/{taskId}") |
| | | public AjaxResult delete(@PathVariable Integer taskId) { |
| | | return AjaxResult.success(oaProjectPhaseTaskService.removeById(taskId)); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°é¡¹ç®é¶æ®µä»»å¡") |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody OaProjectPhaseTask oaProjectPhaseTask) { |
| | | return AjaxResult.success(oaProjectPhaseTaskService.updateById(oaProjectPhaseTask)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.oA.pojo.OaProject; |
| | | import com.ruoyi.oA.pojo.OaProjectPhase; |
| | | import com.ruoyi.oA.pojo.OaProjectPhaseTask; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class OaProjectDto extends OaProject { |
| | | /** |
| | | * è´è´£äººåç§° |
| | | */ |
| | | @Excel(name = "è´è´£äººåç§°") |
| | | private String managerName; |
| | | /** |
| | | * 项ç®é¶æ®µå表 |
| | | */ |
| | | private List<OaProjectPhaseDto> oaProjectPhasesDto; |
| | | // /** |
| | | // * 项ç®é¶æ®µä»»å¡å表 |
| | | // */ |
| | | // private List<OaProjectPhaseTask> oaProjectPhaseTasks; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.dto; |
| | | |
| | | import com.ruoyi.oA.pojo.OaProjectPhase; |
| | | import com.ruoyi.oA.pojo.OaProjectPhaseTask; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class OaProjectPhaseDto extends OaProjectPhase { |
| | | private List<OaProjectPhaseTask> oaProjectPhaseTasks; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.oA.dto.OaProjectDto; |
| | | import com.ruoyi.oA.pojo.OaProject; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project(OAç³»ç»-项ç®ä»»å¡åå-项ç®è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-24 09:18:46 |
| | | * @Entity com.ruoyi.oA.pojo.OaProject |
| | | */ |
| | | public interface OaProjectMapper extends BaseMapper<OaProject> { |
| | | |
| | | IPage<OaProjectDto> listPage(Page page,@Param("req") OaProjectDto oaProjectDto); |
| | | |
| | | List<OaProjectDto> selectByIds(List<Long> ids); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.mapper; |
| | | |
| | | import com.ruoyi.oA.pojo.OaProjectPhase; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project_phase(OAç³»ç»-项ç®é¶æ®µè¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-24 09:18:46 |
| | | * @Entity com.ruoyi.oA.pojo.OaProjectPhase |
| | | */ |
| | | public interface OaProjectPhaseMapper extends BaseMapper<OaProjectPhase> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.mapper; |
| | | |
| | | import com.ruoyi.oA.pojo.OaProjectPhaseTask; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project_phase_task(OAç³»ç»-项ç®é¶æ®µ-ä»»å¡è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-24 09:18:46 |
| | | * @Entity com.ruoyi.oA.pojo.OaProjectPhaseTask |
| | | */ |
| | | public interface OaProjectPhaseTaskMapper extends BaseMapper<OaProjectPhaseTask> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * OAç³»ç»-项ç®ä»»å¡åå-项ç®è¡¨ |
| | | * @TableName oa_project |
| | | */ |
| | | @TableName(value ="oa_project") |
| | | @Data |
| | | public class OaProject implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer projectId; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | /** |
| | | * é¡¹ç®æè¿° |
| | | */ |
| | | @Excel(name = "é¡¹ç®æè¿°") |
| | | private String description; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @Excel(name = "å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @Excel(name = "ç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | |
| | | /** |
| | | * å®æåº¦ |
| | | */ |
| | | @Excel(name = "å®æåº¦") |
| | | private Integer completionRate; |
| | | |
| | | /** |
| | | * è´è´£äººid |
| | | */ |
| | | private Long managerId; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.pojo; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * OAç³»ç»-项ç®é¶æ®µè¡¨ |
| | | * @TableName oa_project_phase |
| | | */ |
| | | @TableName(value ="oa_project_phase") |
| | | @Data |
| | | public class OaProjectPhase implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer phaseId; |
| | | |
| | | /** |
| | | * 项ç®é¶æ®µåç§° |
| | | */ |
| | | private String phaseName; |
| | | |
| | | /** |
| | | * oa_project表id |
| | | */ |
| | | private Integer oaProjectId; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * OAç³»ç»-项ç®é¶æ®µ-ä»»å¡è¡¨ |
| | | * @TableName oa_project_phase_task |
| | | */ |
| | | @TableName(value ="oa_project_phase_task") |
| | | @Data |
| | | public class OaProjectPhaseTask implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer taskId; |
| | | |
| | | /** |
| | | * 项ç®é¶æ®µä»»å¡åç§° |
| | | */ |
| | | private String taskName; |
| | | |
| | | /** |
| | | * oa_project_phase表id |
| | | */ |
| | | private Integer phaseId; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | |
| | | /** |
| | | * ç®æ ä»»å¡å®ææ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate targetDate; |
| | | |
| | | /** |
| | | * ç®æ å¼ |
| | | */ |
| | | private Integer targetValue; |
| | | |
| | | /** |
| | | * å½åå¼ |
| | | */ |
| | | private Integer currentValue; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | private String unit; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * å®æåº¦ |
| | | */ |
| | | private Integer completionRate; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.service; |
| | | |
| | | import com.ruoyi.oA.dto.OaProjectPhaseDto; |
| | | import com.ruoyi.oA.pojo.OaProjectPhase; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project_phase(OAç³»ç»-项ç®é¶æ®µè¡¨)ãçæ°æ®åºæä½Service |
| | | * @createDate 2025-09-24 09:18:46 |
| | | */ |
| | | public interface OaProjectPhaseService extends IService<OaProjectPhase> { |
| | | |
| | | List<OaProjectPhaseDto> listByProjectId(Integer oaProjectId); |
| | | |
| | | boolean deleteById(Integer phaseId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.oA.pojo.OaProjectPhaseTask; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project_phase_task(OAç³»ç»-项ç®é¶æ®µ-ä»»å¡è¡¨)ãçæ°æ®åºæä½Service |
| | | * @createDate 2025-09-24 09:18:46 |
| | | */ |
| | | public interface OaProjectPhaseTaskService extends IService<OaProjectPhaseTask> { |
| | | |
| | | List<OaProjectPhaseTask> listByPhaseId(Integer phaseId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.oA.dto.OaProjectDto; |
| | | import com.ruoyi.oA.pojo.OaProject; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project(OAç³»ç»-项ç®ä»»å¡åå-项ç®è¡¨)ãçæ°æ®åºæä½Service |
| | | * @createDate 2025-09-24 09:18:46 |
| | | */ |
| | | public interface OaProjectService extends IService<OaProject> { |
| | | |
| | | IPage<OaProjectDto> listPage(Page page, OaProjectDto oaProjectDto); |
| | | |
| | | void export(HttpServletResponse response, List<Long> ids); |
| | | |
| | | boolean deleteById(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.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.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.oA.dto.OaProjectPhaseDto; |
| | | import com.ruoyi.oA.pojo.OaProjectPhase; |
| | | import com.ruoyi.oA.pojo.OaProjectPhaseTask; |
| | | import com.ruoyi.oA.service.OaProjectPhaseService; |
| | | import com.ruoyi.oA.mapper.OaProjectPhaseMapper; |
| | | import com.ruoyi.oA.service.OaProjectPhaseTaskService; |
| | | import lombok.val; |
| | | import org.hibernate.validator.constraints.br.TituloEleitoral; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project_phase(OAç³»ç»-项ç®é¶æ®µè¡¨)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2025-09-24 09:18:46 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class OaProjectPhaseServiceImpl extends ServiceImpl<OaProjectPhaseMapper, OaProjectPhase> |
| | | implements OaProjectPhaseService{ |
| | | @Autowired |
| | | private OaProjectPhaseMapper oaProjectPhaseMapper; |
| | | @Autowired |
| | | private OaProjectPhaseTaskService oaProjectPhaseTaskService; |
| | | |
| | | @Override |
| | | public List<OaProjectPhaseDto> listByProjectId(Integer oaProjectId) { |
| | | List<OaProjectPhase> oaProjectPhases = oaProjectPhaseMapper.selectList(new LambdaQueryWrapper<OaProjectPhase>() |
| | | .eq(OaProjectPhase::getOaProjectId, oaProjectId)); |
| | | List<OaProjectPhaseDto> collect = oaProjectPhases.stream().map(oaProjectPhase -> { |
| | | OaProjectPhaseDto oaProjectPhaseDto = new OaProjectPhaseDto(); |
| | | BeanUtils.copyProperties(oaProjectPhase, oaProjectPhaseDto); |
| | | // List<OaProjectPhaseTask> oaProjectPhaseTasks = oaProjectPhaseTaskService.listByPhaseId(oaProjectPhaseDto.getPhaseId()); |
| | | oaProjectPhaseDto.setOaProjectPhaseTasks(oaProjectPhaseTaskService.listByPhaseId(oaProjectPhaseDto.getPhaseId())); |
| | | return oaProjectPhaseDto; |
| | | }).collect(Collectors.toList()); |
| | | return collect; |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteById(Integer phaseId) { |
| | | // å
å é¤é¡¹ç®é¶æ®µä¸çä»»å¡ |
| | | oaProjectPhaseTaskService.remove(new LambdaQueryWrapper<OaProjectPhaseTask>() |
| | | .eq(OaProjectPhaseTask::getPhaseId, phaseId)); |
| | | return oaProjectPhaseMapper.deleteById(phaseId) > 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.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.oA.pojo.OaProjectPhaseTask; |
| | | import com.ruoyi.oA.service.OaProjectPhaseTaskService; |
| | | import com.ruoyi.oA.mapper.OaProjectPhaseTaskMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project_phase_task(OAç³»ç»-项ç®é¶æ®µ-ä»»å¡è¡¨)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2025-09-24 09:18:46 |
| | | */ |
| | | @Service |
| | | public class OaProjectPhaseTaskServiceImpl extends ServiceImpl<OaProjectPhaseTaskMapper, OaProjectPhaseTask> |
| | | implements OaProjectPhaseTaskService{ |
| | | |
| | | |
| | | @Override |
| | | public List<OaProjectPhaseTask> listByPhaseId(Integer phaseId) { |
| | | return baseMapper.selectList(new LambdaQueryWrapper<OaProjectPhaseTask>() |
| | | .eq(OaProjectPhaseTask::getPhaseId, phaseId)); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.oA.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.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.measuringinstrumentledger.pojo.MeasuringInstrumentLedgerRecord; |
| | | import com.ruoyi.oA.dto.OaProjectDto; |
| | | import com.ruoyi.oA.pojo.OaProject; |
| | | import com.ruoyi.oA.pojo.OaProjectPhase; |
| | | import com.ruoyi.oA.service.OaProjectPhaseService; |
| | | import com.ruoyi.oA.service.OaProjectService; |
| | | import com.ruoyi.oA.mapper.OaProjectMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ywx |
| | | * @description é对表ãoa_project(OAç³»ç»-项ç®ä»»å¡åå-项ç®è¡¨)ãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2025-09-24 09:18:45 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class OaProjectServiceImpl extends ServiceImpl<OaProjectMapper, OaProject> |
| | | implements OaProjectService{ |
| | | @Autowired |
| | | private OaProjectMapper oaProjectMapper; |
| | | @Autowired |
| | | private OaProjectPhaseService oaProjectPhaseService; |
| | | |
| | | @Override |
| | | public IPage<OaProjectDto> listPage(Page page, OaProjectDto oaProjectDto) { |
| | | IPage<OaProjectDto> iPage = oaProjectMapper.listPage(page, oaProjectDto); |
| | | // 项ç®é¶æ®µå表 |
| | | for (OaProjectDto projectDto : iPage.getRecords()) { |
| | | projectDto.setOaProjectPhasesDto(oaProjectPhaseService.listByProjectId(projectDto.getProjectId())); |
| | | } |
| | | return iPage; |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, List<Long> ids) { |
| | | List<OaProjectDto> list = oaProjectMapper.selectByIds(ids); |
| | | ExcelUtil<OaProjectDto> util = new ExcelUtil<OaProjectDto>(OaProjectDto.class); |
| | | util.exportExcel(response, list , "é¡¹ç®æ°æ®"); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteById(Long id) { |
| | | // å
å é¤é¡¹ç®ä¸çé¶æ®µ |
| | | List<OaProjectPhase> oaProjectPhases = oaProjectPhaseService.list(new LambdaQueryWrapper<OaProjectPhase>() |
| | | .eq(OaProjectPhase::getOaProjectId, id)); |
| | | if (!oaProjectPhases.isEmpty()) { |
| | | oaProjectPhases.forEach(oaProjectPhase -> { |
| | | oaProjectPhaseService.deleteById(oaProjectPhase.getPhaseId()); |
| | | }); |
| | | } |
| | | return oaProjectMapper.deleteById(id) > 0; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.officesupplies.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.equipmentenergyconsumption.pojo.EquipmentEnergyConsumption; |
| | | 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.officesupplies.pojo.OfficeSupplies; |
| | | import com.ruoyi.officesupplies.service.OfficeSuppliesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/4 14:16 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "åå
¬ç©èµ") |
| | | @RequestMapping("/officeSupplies") |
| | | public class OfficeSuppliesController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OfficeSuppliesService officeSuppliesService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("åå
¬ç©èµ-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, OfficeSupplies officeSupplies) { |
| | | return officeSuppliesService.listPage(page, officeSupplies); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("åå
¬ç©èµ-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody OfficeSupplies officeSupplies) { |
| | | // æç
§å½åæ¶é´yyyyMMdd + å½å¤©æ°å¢æ°é + 1çæç¼å· |
| | | // è·åå½å¤©æ°å¢æ°é |
| | | long count = officeSuppliesService.count(new LambdaQueryWrapper<OfficeSupplies>() |
| | | .gt(OfficeSupplies::getCreateTime, LocalDate.now()) |
| | | .lt(OfficeSupplies::getCreateTime, LocalDate.now().plusDays(1))); |
| | | String code = "WS" + LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + String.format("%03d", count + 1); |
| | | officeSupplies.setCode(code); |
| | | officeSupplies.setStatus(1); |
| | | officeSupplies.setApplyTime(new Date()); |
| | | return officeSuppliesService.save(officeSupplies) ? success() : error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("åå
¬ç©èµ-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody OfficeSupplies officeSupplies) { |
| | | return officeSuppliesService.updateById(officeSupplies) ? success() : error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("åå
¬ç©èµ-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return officeSuppliesService.removeBatchByIds(ids) ? success() : error(); |
| | | } |
| | | |
| | | /** |
| | | * 导åºåå
¬ç©èµ |
| | | */ |
| | | @Log(title = "导åºåå
¬ç©èµ", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åºåå
¬ç©èµ") |
| | | public void export(HttpServletResponse response) { |
| | | ExcelUtil<OfficeSupplies> util = new ExcelUtil<OfficeSupplies>(OfficeSupplies.class); |
| | | List<OfficeSupplies> list = officeSuppliesService.list(); |
| | | util.exportExcel(response, list , "åå
¬ç©èµ"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.officesupplies.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.officesupplies.pojo.OfficeSupplies; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/4 14:13 |
| | | */ |
| | | public interface OfficeSuppliesMapper extends BaseMapper<OfficeSupplies> { |
| | | |
| | | /** |
| | | * å表å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param officeSupplies |
| | | * @return |
| | | */ |
| | | IPage<OfficeSupplies> listPage(Page page,@Param("req") OfficeSupplies officeSupplies); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.officesupplies.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/4 14:02 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | @TableName("office_supplies") |
| | | public class OfficeSupplies { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("ç¼å·") |
| | | @Excel(name = "ç¼å·") |
| | | private String code; |
| | | |
| | | @ApiModelProperty("ç©ååç§°") |
| | | private String itemName; |
| | | |
| | | @ApiModelProperty("ç³è¯·äºº") |
| | | @Excel(name = "ç³è¯·äºº") |
| | | private String applicant; |
| | | |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | @ApiModelProperty("é¨é¨") |
| | | @Excel(name = "é¨é¨") |
| | | private String dept; |
| | | |
| | | /** |
| | | * ç©èµç±»åï¼1-å
¶ä» 2-æ¸
æ´ç¨å 3-çµåç¨å 4-çµå设å¤ï¼ |
| | | */ |
| | | @ApiModelProperty("ç©èµç±»åï¼1-å
¶ä» 2-æ¸
æ´ç¨å 3-çµåç¨å 4-çµå设å¤ï¼") |
| | | @Excel(name = "ç©èµç±»å", readConverterExp = "1=å
¶ä»,2=æ¸
æ´ç¨å,3=çµåç¨å,4=çµå设å¤") |
| | | private Integer materialType; |
| | | |
| | | /** |
| | | * ç³è¯·æ°é |
| | | */ |
| | | @ApiModelProperty("ç³è¯·æ°é") |
| | | @Excel(name = "ç³è¯·æ°é") |
| | | private Integer applyNum; |
| | | |
| | | /** |
| | | * å®¡æ¹æè§ |
| | | */ |
| | | @ApiModelProperty("å®¡æ¹æè§") |
| | | // @Excel(name = "å®¡æ¹æè§") |
| | | private String approvalOpinions; |
| | | |
| | | /** |
| | | * ç³è¯·åå |
| | | */ |
| | | @ApiModelProperty("ç³è¯·åå ") |
| | | @Excel(name = "ç³è¯·åå ") |
| | | private String reason; |
| | | |
| | | |
| | | /** |
| | | * ç´§æ¥ç¨åº¦ï¼1-æ®é 2-ç´§æ¥ 3-é常紧æ¥ï¼ |
| | | */ |
| | | @ApiModelProperty("ç´§æ¥ç¨åº¦ï¼1-æ®é 2-ç´§æ¥ 3-é常紧æ¥ï¼") |
| | | // @Excel(name = "ç´§æ¥ç¨åº¦", readConverterExp = "1=æ®é,2=ç´§æ¥,3=é常紧æ¥") |
| | | private Integer urgency; |
| | | |
| | | /** |
| | | * ç¶æï¼1-å¾
å®¡æ¹ 2-å·²æç» 3-å·²éè¿ 4-å·²åæ¾ï¼ |
| | | */ |
| | | @ApiModelProperty("ç¶æï¼1-å¾
å®¡æ¹ 2-å·²æç» 3-å·²éè¿ 4-已忾ï¼") |
| | | @Excel(name = "ç¶æ", readConverterExp = "1=å¾
审æ¹,2=å·²æç»,3=å·²éè¿,4=已忾") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * ç³è¯·æ¶é´ |
| | | */ |
| | | @ApiModelProperty("ç³è¯·æ¶é´") |
| | | @Excel(name = "ç³è¯·æ¶é´" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date applyTime; |
| | | |
| | | |
| | | /** |
| | | * 审æ¹äºº |
| | | */ |
| | | @ApiModelProperty("审æ¹äºº") |
| | | @Excel(name = "审æ¹äºº") |
| | | private String approval; |
| | | |
| | | /** |
| | | * å®¡æ¹æ¶é´ |
| | | */ |
| | | @ApiModelProperty("å®¡æ¹æ¶é´") |
| | | @Excel(name = "å®¡æ¹æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date approvalTime; |
| | | |
| | | /** |
| | | * åæ¾æ¶é´ |
| | | */ |
| | | @ApiModelProperty("åæ¾æ¶é´") |
| | | @Excel(name = "åæ¾æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date issueTime; |
| | | |
| | | @ApiModelProperty("åæ¾äºº") |
| | | // @Excel(name = "åæ¾äºº") |
| | | private String issueUser; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹è
|
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.officesupplies.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.officesupplies.pojo.OfficeSupplies; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/4 14:14 |
| | | */ |
| | | public interface OfficeSuppliesService extends IService<OfficeSupplies> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param officeSupplies |
| | | * @return |
| | | */ |
| | | AjaxResult listPage(Page page, OfficeSupplies officeSupplies); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.officesupplies.service.impl; |
| | | |
| | | 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.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.officesupplies.mapper.OfficeSuppliesMapper; |
| | | import com.ruoyi.officesupplies.pojo.OfficeSupplies; |
| | | import com.ruoyi.officesupplies.service.OfficeSuppliesService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/4 14:15 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class OfficeSuppliesServiceImpl extends ServiceImpl<OfficeSuppliesMapper, OfficeSupplies> implements OfficeSuppliesService { |
| | | |
| | | @Autowired |
| | | private OfficeSuppliesMapper officeSuppliesMapper; |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, OfficeSupplies officeSupplies) { |
| | | IPage<OfficeSupplies> list = officeSuppliesMapper.listPage(page, officeSupplies); |
| | | return AjaxResult.success(list); |
| | | } |
| | | } |
| | |
| | | * |
| | | * @param businessId ä¸å¡IDï¼éå®å°è´¦IDï¼ |
| | | * @param tempFileIds ä¸´æ¶æä»¶IDå表 |
| | | * @param fileType æä»¶ç±»å(æ¥èªFileNameType) |
| | | * @throws IOException æä»¶æä½å¼å¸¸ |
| | | */ |
| | | public void migrateTempFilesToFormal(Long businessId, List<String> tempFileIds, Integer fileType) throws IOException { |
| | |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.GasTankWarning; |
| | | import com.ruoyi.procurementrecord.service.GasTankWarningService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/gasTankWarning") |
| | | public class GasTankWarningController { |
| | | @Autowired |
| | | private GasTankWarningService gasTankWarningService; |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.listPage(page, gasTankWarning)); |
| | | } |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.save(gasTankWarning)); |
| | | } |
| | | @PostMapping("update") |
| | | public AjaxResult update(@RequestBody GasTankWarning gasTankWarning) { |
| | | return AjaxResult.success(gasTankWarningService.updateById(gasTankWarning)); |
| | | } |
| | | @DeleteMapping("delete") |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(gasTankWarningService.removeByIds(ids)); |
| | | } |
| | | //å¯¼åº |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response,@RequestParam(name = "ids", required = false) List<Long> ids){ |
| | | gasTankWarningService.export(response,ids); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.InboundManagement; |
| | | import com.ruoyi.procurementrecord.service.InboundManagementService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/16 16:38 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å°è´§ç®¡ç") |
| | | @RequestMapping("/inboundManagement") |
| | | public class InboundManagementController extends BaseController { |
| | | |
| | | @Autowired |
| | | private InboundManagementService inboundManagementService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å°è´§ç®¡ç-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, InboundManagement inboundManagement) { |
| | | IPage<InboundManagement> result = inboundManagementService.listPage(page, inboundManagement); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("å°è´§ç®¡ç-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody InboundManagement inboundManagement) { |
| | | inboundManagement.setArrivalTime(new Date()); |
| | | boolean result = inboundManagementService.save(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("å°è´§ç®¡ç-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody InboundManagement inboundManagement) { |
| | | boolean result = inboundManagementService.updateById(inboundManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å°è´§ç®¡ç-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean result = inboundManagementService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPlan; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPlanService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/18 16:13 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "éè´è®¡å") |
| | | @RequestMapping("/procurementPlan") |
| | | public class ProcurementPlanController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ProcurementPlanService procurementPlanService; |
| | | |
| | | @RequestMapping("/listPage") |
| | | @ApiOperation("éè´è®¡å-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProcurementPlan procurementPlan){ |
| | | IPage<ProcurementPlan> result = procurementPlanService.listPage(page, procurementPlan); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("éè´è®¡å-æ·»å ") |
| | | public AjaxResult add(@RequestBody ProcurementPlan procurementPlan){ |
| | | boolean result = procurementPlanService.save(procurementPlan); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("éè´è®¡å-ä¿®æ¹") |
| | | public AjaxResult update(@RequestBody ProcurementPlan procurementPlan){ |
| | | boolean result = procurementPlanService.updateById(procurementPlan); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("éè´è®¡å-å é¤") |
| | | public AjaxResult del(@RequestBody List<Long> ids){ |
| | | boolean result = procurementPlanService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * @param response |
| | | */ |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | procurementPlanService.export(response); |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPriceManagement; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPriceManagementService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 15:08 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "éè´ä»·æ ¼ç®¡ç") |
| | | @RequestMapping("/procurementPriceManagement") |
| | | public class ProcurementPriceManagementController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ProcurementPriceManagementService procurementPriceManagementService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("éè´ä»·æ ¼ç®¡ç-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProcurementPriceManagement procurementPriceManagement){ |
| | | IPage<ProcurementPriceManagement> result = procurementPriceManagementService.listPage(page, procurementPriceManagement); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("éè´ä»·æ ¼ç®¡ç-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | boolean result = procurementPriceManagementService.save(procurementPriceManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("éè´ä»·æ ¼ç®¡ç-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody ProcurementPriceManagement procurementPriceManagement){ |
| | | boolean result = procurementPriceManagementService.updateById(procurementPriceManagement); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("éè´ä»·æ ¼ç®¡ç-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if (ids == null || ids.isEmpty()) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | boolean result = procurementPriceManagementService.removeByIds(ids); |
| | | return result ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * @param response |
| | | */ |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | procurementPriceManagementService.export(response); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | | import com.ruoyi.procurementrecord.dto.*; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordService; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseReportDto; |
| | | import com.ruoyi.quality.pojo.QualityInspect; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "éè´å
¥åº-å
¥åºç®¡ç-å
¥åºæ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation(value = "å
¥åºæ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProcurementPageDto procurementDto) { |
| | | IPage<ProcurementPageDto> result =procurementRecordService.listPage(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | |
| | | IPage<ProcurementPageDtoCopy> result =procurementRecordService.listPageCopy(page, procurementDto); |
| | | return AjaxResult.success(result); |
| | | } |
| | | @GetMapping("/getReportList") |
| | | @Log(title = "åºåæ¥è¡¨æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult getReportList(Page page, ProcurementPageDto procurementDto) { |
| | | return AjaxResult.success(procurementRecordService.getReportList(page, procurementDto)); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åº |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.mapper.ReturnManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.procurementrecord.service.ReturnManagementService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 10:34 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å°è´§ç®¡ç") |
| | | @RequestMapping("/returnManagement") |
| | | public class ReturnManagementController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ReturnManagementService returnManagementService; |
| | | |
| | | @Autowired |
| | | private ReturnManagementMapper returnManagementMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å°è´§ç®¡ç-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ReturnManagement returnManagement) { |
| | | IPage<ReturnManagement> result = returnManagementService.listPage(page, returnManagement); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("å°è´§ç®¡ç-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody ReturnManagement returnManagement) { |
| | | String rt = OrderUtils.countTodayByCreateTime(returnManagementMapper, "RT"); |
| | | returnManagement.setReturnNo(rt); |
| | | boolean result = returnManagementService.save(returnManagement); |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("å°è´§ç®¡ç-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody ReturnManagement returnManagement) { |
| | | boolean result = returnManagementService.updateById(returnManagement); |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å°è´§ç®¡ç-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | boolean result = returnManagementService.removeByIds(ids); |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/7/7 16:17 |
| | | */ |
| | | @Data |
| | | public class Details { |
| | | private Integer id; |
| | | private BigDecimal inboundQuantity; |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | public BigDecimal getInboundQuantity() { |
| | | return inboundQuantity; |
| | | } |
| | | public void setInboundQuantity(BigDecimal inboundQuantity) { |
| | | this.inboundQuantity = inboundQuantity; |
| | | } |
| | | private BigDecimal warnNum; |
| | | } |
| | |
| | | |
| | | private Integer recordId; |
| | | |
| | | private BigDecimal warnNum; |
| | | |
| | | /** |
| | | * å
¥åºæ°é |
| | | */ |
| | |
| | | private BigDecimal quantity; |
| | | |
| | | /** |
| | | * æä½åºåæ°é |
| | | */ |
| | | @Excel(name = "æä½åºåæ°é") |
| | | private BigDecimal minStock; |
| | | /** |
| | | * å¾
å
¥åºæ°é |
| | | */ |
| | | @Excel(name = "å¾
å
¥åºæ°é") |
| | |
| | | public class ProcurementManagementUpdateDto { |
| | | |
| | | private String createBy; |
| | | private BigDecimal minStock; |
| | | |
| | | private Long createUser; |
| | | |
| | |
| | | private String entryDate; |
| | | |
| | | private Integer id; |
| | | |
| | | private Integer salesLedgerProductId; |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.dto; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | @Excel(name = "å
¥åºæ°é") |
| | | private BigDecimal inboundNum; |
| | | |
| | | @Excel(name = "é¢è¦æ°é") |
| | | private BigDecimal warnNum; |
| | | |
| | | /** |
| | | * å¾
åºåºæ°é |
| | | */ |
| | |
| | | // @Excel(name = "å
¥åºæ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | private String timeStr; |
| | | |
| | | /** |
| | | * åºå
¥åºæ¶é´ |
| | |
| | | */ |
| | | @Excel(name = "ä¸å«ç¨æ»ä»·") |
| | | private BigDecimal taxExclusiveTotalPrice; |
| | | /** |
| | | * æ¥è¡¨æ¥æ¥ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate reportDate; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startMonth; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endMonth; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | |
| | | @Excel(name = "å
¥åºæ¹æ¬¡") |
| | | private String inboundBatches; |
| | | |
| | | private BigDecimal warnNum; |
| | | |
| | | /** |
| | | * ååå· |
| | | */ |
| | |
| | | */ |
| | | @Excel(name = "å¾
åºåºæ°é") |
| | | private BigDecimal inboundNum0; |
| | | /** |
| | | * åºåºæ°é |
| | | */ |
| | | @Excel(name = "åºåºæ°é") |
| | | private BigDecimal totalInboundNum; |
| | | |
| | | |
| | | /** |
| | | * æä½åºåæ°é |
| | | */ |
| | | @Excel(name = "æä½åºåæ°é") |
| | | private BigDecimal minStock; |
| | | /** |
| | | * åºå
¥åºæ¶é´ |
| | | */ |
| | |
| | | */ |
| | | @Excel(name = "ä¸å«ç¨æ»ä»·") |
| | | private BigDecimal taxExclusiveTotalPrice; |
| | | /** |
| | | * æ¥è¡¨æ¥æ¥ |
| | | */ |
| | | @Excel(name = "æ¥è¡¨æ¥æ¥") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate reportDate; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @Excel(name = "æ¥è¡¨ææ¥å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate startMonth; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @Excel(name = "æ¥è¡¨ææ¥ç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate endMonth; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @Excel(name = "æ¥è¡¨ä½ä¸å¼å§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate startDate; |
| | | /** |
| | | * æ¥è¡¨ææ¥ |
| | | */ |
| | | @Excel(name = "æ¥è¡¨ä½ä¸ç»ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate endDate; |
| | | |
| | | } |
| | |
| | | @Data |
| | | public class ProcurementRecordOutPageDto { |
| | | |
| | | @Excel(name = "åºåºç¼å·") |
| | | private String code; |
| | | |
| | | private Integer id; |
| | | |
| | | private BigDecimal warnNum; |
| | | |
| | | /** |
| | | * åºå
¥åºæ°é |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | private String timeStr; |
| | | |
| | | @Excel(name = "åºåºæ¶é´") |
| | | private String time; |
| | | |
| | |
| | | |
| | | private Integer id; |
| | | |
| | | private BigDecimal warnNum; |
| | | |
| | | private BigDecimal quantityStock; |
| | | |
| | | private List<Integer> ids; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.GasTankWarning; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | @Mapper |
| | | public interface GasTankWarningMapper extends BaseMapper<GasTankWarning> { |
| | | IPage<GasTankWarning> listPage(Page page, @Param("gasTankWarning") GasTankWarning gasTankWarning); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.InboundManagement; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/16 16:33 |
| | | */ |
| | | public interface InboundManagementMapper extends BaseMapper<InboundManagement> { |
| | | |
| | | /** |
| | | * æ¥è¯¢éè´å
¥åº-å°è´§ç®¡çå表 |
| | | * |
| | | * @param page |
| | | * @param inboundManagement |
| | | * @return |
| | | */ |
| | | IPage<InboundManagement> listPage(Page page,@Param("req") InboundManagement inboundManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.ProcurementPlan; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/18 16:10 |
| | | */ |
| | | public interface ProcurementPlanMapper extends BaseMapper<ProcurementPlan> { |
| | | /** |
| | | * æ¥è¯¢éè´è®¡åå表 |
| | | * |
| | | * @param page |
| | | * @param procurementPlan |
| | | * @return |
| | | */ |
| | | IPage<ProcurementPlan> listPage(Page page,@Param("req") ProcurementPlan procurementPlan); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.ProcurementPriceManagement; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 15:05 |
| | | */ |
| | | public interface ProcurementPriceManagementMapper extends BaseMapper<ProcurementPriceManagement> { |
| | | |
| | | /** |
| | | * æ¥è¯¢éè´ä»·æ ¼ç®¡çå表 |
| | | * |
| | | * @param page |
| | | * @param procurementPriceManagement |
| | | * @return |
| | | */ |
| | | IPage<ProcurementPriceManagement> listPage(Page page,@Param("req") ProcurementPriceManagement procurementPriceManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.ReturnManagement; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 10:32 |
| | | */ |
| | | public interface ReturnManagementMapper extends BaseMapper<ReturnManagement> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | * |
| | | * @param page |
| | | * @return |
| | | */ |
| | | IPage<ReturnManagement> listPage(Page page,@Param("req") ReturnManagement returnManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("gas_tank_warning") |
| | | public class GasTankWarning implements Serializable { |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 卿°ç½ç¼ç |
| | | */ |
| | | @Excel(name = "卿°ç½ç¼ç ") |
| | | private String tankCode; |
| | | /** |
| | | * 卿°ç½åç§° |
| | | */ |
| | | @Excel(name = "卿°ç½åç§°") |
| | | private String tankName; |
| | | /** |
| | | * 卿°ç½ç±»å |
| | | */ |
| | | @Excel(name = "卿°ç½ç±»å") |
| | | private String tankType; |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | @Excel(name = "è§æ ¼åå·") |
| | | private String specificationModel; |
| | | /** |
| | | * 容积(m³) |
| | | */ |
| | | @Excel(name = "容积(m³)") |
| | | private Long volume; |
| | | /** |
| | | * å½åæ°ä½æ°´å¹³(m³) |
| | | */ |
| | | @Excel(name = "å½åæ°ä½æ°´å¹³(m³)") |
| | | private Long currentGasLevel; |
| | | /** |
| | | * å®å
¨æ°ä½æ°´å¹³(m³) |
| | | */ |
| | | @Excel(name = "å®å
¨æ°ä½æ°´å¹³(m³)") |
| | | private Long safetyGasLevel; |
| | | /** |
| | | * æå°æ°ä½æ°´å¹³(m³) |
| | | */ |
| | | @Excel(name = "æå°æ°ä½æ°´å¹³(m³)") |
| | | private Long minGasLevel; |
| | | /** |
| | | * æå¤§æ°ä½æ°´å¹³(m³) |
| | | */ |
| | | @Excel(name = "æå¤§æ°ä½æ°´å¹³(m³)") |
| | | private Long maxGasLevel; |
| | | /** |
| | | * å½ååå(MPa) |
| | | */ |
| | | @Excel(name = "å½ååå(MPa)") |
| | | private Double currentPressure; |
| | | /** |
| | | * é¢è¦ç±»å |
| | | */ |
| | | @Excel(name = "é¢è¦ç±»å") |
| | | private String warningType; |
| | | /** |
| | | * é¢è¦ç级 |
| | | */ |
| | | @Excel(name = "é¢è¦ç级") |
| | | private String warningLevel; |
| | | /** |
| | | * é¢è¦éå¼ |
| | | */ |
| | | @Excel(name = "é¢è¦éå¼") |
| | | private Long warningThreshold; |
| | | /** |
| | | * æ¯å¦å¯ç¨ |
| | | */ |
| | | @Excel(name = "æ¯å¦å¯ç¨") |
| | | private Boolean isEnabled; |
| | | /** |
| | | * é¢è¦è§å-å½???æ¶è§¦åé¢è¦ |
| | | */ |
| | | @Excel(name = "é¢è¦è§å") |
| | | private String warningRule; |
| | | /** |
| | | * é¢è¦æ¶é´ |
| | | */ |
| | | @Excel(name = "é¢è¦æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime warningTime; |
| | | /** |
| | | * é¢è¦æç»å¤©æ° |
| | | */ |
| | | @Excel(name = "é¢è¦æç»å¤©æ°") |
| | | private Long warningDuration; |
| | | /** |
| | | * æåæ´æ°æ¶é´ |
| | | */ |
| | | @Excel(name = "æåæ´æ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime lastUpdateTime; |
| | | /** |
| | | * 颿å
è£
æ¶é´ |
| | | */ |
| | | @Excel(name = "颿å
è£
æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime expectedRefillTime; |
| | | /** |
| | | * é¢æç¼ºæ°æ¶é´ |
| | | */ |
| | | @Excel(name = "é¢æç¼ºæ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime expectedShortageTime; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/16 16:29 |
| | | */ |
| | | @Data |
| | | @TableName("inbound_management") |
| | | @ApiModel |
| | | public class InboundManagement { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订åå·") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "å°è´§åå·") |
| | | private String arrivalNo; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty(value = "å°è´§ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "å°è´§æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date arrivalTime; |
| | | |
| | | @ApiModelProperty(value = "å°è´§æ°é") |
| | | private String arrivalQuantity; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @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 Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/18 16:00 |
| | | */ |
| | | @Data |
| | | @TableName("procurement_plan") |
| | | @ApiModel |
| | | public class ProcurementPlan { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "ç¼ç ") |
| | | @Excel(name = "ç¼ç ") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "åç§°") |
| | | @Excel(name = "åç§°") |
| | | private String planName; |
| | | |
| | | @ApiModelProperty(value = "æè¿°") |
| | | @Excel(name = "æè¿°") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | @Excel(name = "ç¶æ", readConverterExp = "disabled=ç¦ç¨,active=å¯ç¨") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦ç³»ç»é¢ç½®") |
| | | private Boolean isSystemPreset; |
| | | |
| | | @ApiModelProperty(value = "èèç°æåºå") |
| | | private Boolean considerExistingStock; |
| | | |
| | | @ApiModelProperty(value = "ä»åºè¿è¡MRPçæ§å¶") |
| | | private Boolean warehouseControl; |
| | | |
| | | @ApiModelProperty(value = "è®¡ç®æ»éæ±") |
| | | private Boolean calculateTotalDemand; |
| | | |
| | | @ApiModelProperty(value = "èèå®å
¨åºå") |
| | | private Boolean considerSafetyStock; |
| | | |
| | | @ApiModelProperty(value = "èèéåº") |
| | | private Boolean considerLockedStock; |
| | | |
| | | @ApiModelProperty(value = "ä¸èèç©æè¾
å©å±æ§") |
| | | private Boolean notConsiderMaterialAux; |
| | | |
| | | @ApiModelProperty(value = "è´åºåä½ä¸ºéæ±") |
| | | private Boolean negativeStockAsDemand; |
| | | |
| | | @ApiModelProperty(value = "ç©æ") |
| | | private Boolean summaryMaterial; |
| | | |
| | | @ApiModelProperty(value = "è¾
å©å±æ§") |
| | | private Boolean summaryAuxAttributes; |
| | | |
| | | @ApiModelProperty(value = "éæ±æ¥æ") |
| | | private Boolean summaryDemandDate; |
| | | |
| | | @ApiModelProperty(value = "计ç®å
¬å¼") |
| | | @Excel(name = "计ç®å
¬å¼") |
| | | private String formula; |
| | | |
| | | @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) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "æåè®¡ç®æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 14:58 |
| | | */ |
| | | @Data |
| | | @TableName("procurement_price_management") |
| | | @ApiModel |
| | | public class ProcurementPriceManagement { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "åååç§°") |
| | | @Excel(name = "åååç§°") |
| | | private String productName; |
| | | |
| | | @ApiModelProperty(value = "ååç¼ç ") |
| | | @Excel(name = "ååç¼ç ") |
| | | private String productCode; |
| | | |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | @Excel(name = "è§æ ¼åå·") |
| | | private String specification; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºååç§°") |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty(value = "åºç¡ä»·æ ¼") |
| | | @Excel(name = "åºç¡ä»·æ ¼") |
| | | private String basePrice; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | @TableField(exist = false) |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "åä½") |
| | | private String unit; |
| | | |
| | | @ApiModelProperty(value = "ææ£ç±»å") |
| | | @Excel(name = "ææ£ç±»å", readConverterExp = "=æ ææ£,percentage=ç¾åæ¯ææ£,fixed=åºå®éé¢") |
| | | private String discountType; |
| | | |
| | | @ApiModelProperty(value = "ææ£å¼") |
| | | @Excel(name = "ææ£å¼") |
| | | private String discountValue; |
| | | |
| | | @ApiModelProperty(value = "ææ£æææ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date discountEndTime; |
| | | |
| | | @ApiModelProperty(value = "æä½ä»·æ ¼") |
| | | @Excel(name = "æä½ä»·æ ¼") |
| | | private String minPrice; |
| | | |
| | | @ApiModelProperty(value = "æé«ä»·æ ¼") |
| | | @Excel(name = "æé«ä»·æ ¼") |
| | | private String maxPrice; |
| | | |
| | | @ApiModelProperty(value = "é¢è¦éå¼(%)") |
| | | private String warningThreshold; |
| | | |
| | | @ApiModelProperty(value = "çææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "çææ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date effectiveTime; |
| | | |
| | | @ApiModelProperty(value = "å¤±ææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date expireTime; |
| | | |
| | | @ApiModelProperty(value = "è°ä»·åå ") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @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) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "æ´æ°æ¶é´", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer procurementRecordStorageId; |
| | | |
| | | |
| | | /** |
| | | * ç¼å· |
| | | */ |
| | | private String code; |
| | | |
| | | /** |
| | | * åºåºæ¹æ¬¡ |
| | | */ |
| | |
| | | private BigDecimal inboundNum; |
| | | |
| | | /** |
| | | * é¢è¦æ°é |
| | | */ |
| | | private BigDecimal warnNum; |
| | | // /** |
| | | // * æä½åºåæ°é |
| | | // */ |
| | | // private BigDecimal minStock; |
| | | |
| | | /** |
| | | * å
¥åºç¨æ· |
| | | */ |
| | | private String createBy; |
| | | |
| | | |
| | | /** |
| | | * å
¥åºç¨æ·id |
| | | */ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 10:28 |
| | | */ |
| | | @Data |
| | | @TableName("return_management") |
| | | @ApiModel |
| | | public class ReturnManagement { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "éè´§åå·") |
| | | private String returnNo; |
| | | |
| | | @ApiModelProperty(value = "å
³èåå·") |
| | | private String relatedNo; |
| | | |
| | | @ApiModelProperty(value = "éè´§ç±»å") |
| | | private String returnType; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | @ApiModelProperty(value = "éè´§åå ") |
| | | private String returnReason; |
| | | |
| | | @ApiModelProperty(value = "éè´§ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | 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 Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.GasTankWarning; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | public interface GasTankWarningService extends IService<GasTankWarning> { |
| | | IPage listPage(Page page, GasTankWarning gasTankWarning); |
| | | |
| | | void export(HttpServletResponse response, List<Long> ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.InboundManagement; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/16 16:36 |
| | | */ |
| | | public interface InboundManagementService extends IService<InboundManagement> { |
| | | |
| | | /** |
| | | * è·åå表 |
| | | * |
| | | * @param page |
| | | * @param inboundManagement |
| | | * @return |
| | | */ |
| | | IPage<InboundManagement> listPage(Page page, InboundManagement inboundManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.ProcurementPlan; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/18 16:11 |
| | | */ |
| | | public interface ProcurementPlanService extends IService<ProcurementPlan> { |
| | | |
| | | /** |
| | | * æ¥è¯¢ |
| | | * @param page |
| | | * @param procurementPlan |
| | | * @return |
| | | */ |
| | | IPage<ProcurementPlan> listPage(Page page, ProcurementPlan procurementPlan); |
| | | |
| | | void export(HttpServletResponse response); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.ProcurementPriceManagement; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 15:06 |
| | | */ |
| | | public interface ProcurementPriceManagementService extends IService<ProcurementPriceManagement> { |
| | | |
| | | /** |
| | | * éè´ä»·æ ¼ç®¡ç-æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param procurementPriceManagement |
| | | * @return |
| | | */ |
| | | IPage<ProcurementPriceManagement> listPage(Page page, ProcurementPriceManagement procurementPriceManagement); |
| | | |
| | | void export(HttpServletResponse response); |
| | | } |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | int updateManagement(ProcurementManagementUpdateDto procurementDto); |
| | | |
| | | void exportCopy(HttpServletResponse response); |
| | | |
| | | Map<String, Object> getReportList(Page page, ProcurementPageDto procurementDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.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.procurementrecord.pojo.ReturnManagement; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 10:33 |
| | | */ |
| | | public interface ReturnManagementService extends IService<ReturnManagement> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | * |
| | | * @param page |
| | | * @param returnManagement |
| | | * @return |
| | | */ |
| | | IPage<ReturnManagement> listPage(Page page, ReturnManagement returnManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDto; |
| | | import com.ruoyi.procurementrecord.mapper.GasTankWarningMapper; |
| | | import com.ruoyi.procurementrecord.pojo.GasTankWarning; |
| | | import com.ruoyi.procurementrecord.service.GasTankWarningService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class GasTankWarningServiceImpl extends ServiceImpl<GasTankWarningMapper, GasTankWarning> implements GasTankWarningService { |
| | | @Autowired |
| | | private GasTankWarningMapper gasTankWarningMapper; |
| | | @Override |
| | | public IPage listPage(Page page, GasTankWarning gasTankWarning) { |
| | | return gasTankWarningMapper.listPage(page,gasTankWarning); |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, List<Long> ids) { |
| | | List<GasTankWarning> list = new ArrayList<>(); |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | list = gasTankWarningMapper.selectList(null); |
| | | }else { |
| | | list = gasTankWarningMapper.selectBatchIds(ids); |
| | | } |
| | | ExcelUtil<GasTankWarning> util = new ExcelUtil<>(GasTankWarning.class); |
| | | util.exportExcel(response, list, "卿°ç½é¢è¦.xlsx"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | 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.procurementrecord.mapper.InboundManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.InboundManagement; |
| | | import com.ruoyi.procurementrecord.service.InboundManagementService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/16 16:37 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class InboundManagementServiceImpl extends ServiceImpl<InboundManagementMapper, InboundManagement> implements InboundManagementService { |
| | | |
| | | @Autowired |
| | | private InboundManagementMapper inboundManagementMapper; |
| | | |
| | | @Override |
| | | public IPage<InboundManagement> listPage(Page page, InboundManagement inboundManagement) { |
| | | IPage<InboundManagement> result = inboundManagementMapper.listPage(page, inboundManagement); |
| | | return result; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | 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.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementPlanMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPlan; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPriceManagement; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPlanService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/18 16:12 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class ProcurementPlanServiceImpl extends ServiceImpl<ProcurementPlanMapper, ProcurementPlan> implements ProcurementPlanService { |
| | | |
| | | @Autowired |
| | | private ProcurementPlanMapper procurementPlanMapper; |
| | | |
| | | @Override |
| | | public IPage<ProcurementPlan> listPage(Page page, ProcurementPlan procurementPlan) { |
| | | IPage<ProcurementPlan> result = procurementPlanMapper.listPage(page, procurementPlan); |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response) { |
| | | List<ProcurementPlan> procurementPriceManagements = procurementPlanMapper.selectList(null); |
| | | ExcelUtil<ProcurementPlan> util = new ExcelUtil<ProcurementPlan>(ProcurementPlan.class); |
| | | util.exportExcel(response, procurementPriceManagements, "éè´è®¡å"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | 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.common.utils.excel.ExcelUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDto; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementPriceManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementPriceManagement; |
| | | import com.ruoyi.procurementrecord.service.ProcurementPriceManagementService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 15:07 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class ProcurementPriceManagementServiceImpl extends ServiceImpl<ProcurementPriceManagementMapper, ProcurementPriceManagement> implements ProcurementPriceManagementService { |
| | | |
| | | |
| | | @Autowired |
| | | private ProcurementPriceManagementMapper procurementPriceManagementMapper; |
| | | |
| | | |
| | | @Override |
| | | public IPage<ProcurementPriceManagement> listPage(Page page, ProcurementPriceManagement procurementPriceManagement) { |
| | | IPage<ProcurementPriceManagement> result = procurementPriceManagementMapper.listPage(page, procurementPriceManagement); |
| | | // æ ¹æ®çææ¶é´ï¼å¤±ææ¶é´å¤æç¶æ ææï¼å¾
çæï¼å·²è¿æ |
| | | for (ProcurementPriceManagement record : result.getRecords()) { |
| | | if (record.getEffectiveTime() != null) { |
| | | if (record.getEffectiveTime().getTime() <= System.currentTimeMillis()) { |
| | | record.setStatus("active"); |
| | | } |
| | | } |
| | | if (record.getEffectiveTime() != null) { |
| | | if (record.getEffectiveTime().getTime() > System.currentTimeMillis()) { |
| | | record.setStatus("pending"); |
| | | } |
| | | } |
| | | if (record.getExpireTime() != null) { |
| | | if (record.getExpireTime().getTime() <= System.currentTimeMillis()) { |
| | | record.setStatus("expired"); |
| | | } |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response) { |
| | | List<ProcurementPriceManagement> procurementPriceManagements = procurementPriceManagementMapper.selectList(null); |
| | | for (ProcurementPriceManagement procurementPriceManagement : procurementPriceManagements) { |
| | | if (procurementPriceManagement.getEffectiveTime() != null) { |
| | | if (procurementPriceManagement.getEffectiveTime().getTime() <= System.currentTimeMillis()) { |
| | | procurementPriceManagement.setStatus("ææ"); |
| | | } |
| | | } |
| | | if (procurementPriceManagement.getEffectiveTime() != null) { |
| | | if (procurementPriceManagement.getEffectiveTime().getTime() > System.currentTimeMillis()) { |
| | | procurementPriceManagement.setStatus("å¾
çæ"); |
| | | } |
| | | } |
| | | if (procurementPriceManagement.getExpireTime() != null) { |
| | | if (procurementPriceManagement.getExpireTime().getTime() <= System.currentTimeMillis()) { |
| | | procurementPriceManagement.setStatus("å·²è¿æ"); |
| | | } |
| | | } |
| | | } |
| | | ExcelUtil<ProcurementPriceManagement> util = new ExcelUtil<ProcurementPriceManagement>(ProcurementPriceManagement.class); |
| | | util.exportExcel(response, procurementPriceManagements, "éè´ä»·æ ¼ç®¡ç");} |
| | | } |
| | |
| | | import com.ruoyi.procurementrecord.dto.ProcurementUpdateDto; |
| | | import com.ruoyi.procurementrecord.mapper.ProcurementRecordOutMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordOut; |
| | | import com.ruoyi.procurementrecord.pojo.ProcurementRecordStorage; |
| | | import com.ruoyi.procurementrecord.service.ProcurementRecordOutService; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | if(sysUser == null){ |
| | | throw new RuntimeException("åºåºäººä¸åå¨"); |
| | | } |
| | | // æ¥è¯¢æ¶é´èå´ä¸ºå½å¤©æ°é |
| | | LocalDate now = LocalDate.now(); |
| | | DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordOutLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordOutLambdaQueryWrapper.ge(ProcurementRecordOut::getCreateTime, now) // 大äºçäºå½å¤© |
| | | .lt(ProcurementRecordOut::getCreateTime, now.plusDays(1)); // å°äºæå¤© |
| | | Long aLong1 = procurementRecordOutMapper.selectCount(procurementRecordOutLambdaQueryWrapper); |
| | | |
| | | // æ¥è¯¢éè´åºåºæ°é |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.eq(ProcurementRecordOut::getProcurementRecordStorageId, procurementRecordOutAdd.getId()); |
| | | Long aLong = procurementRecordOutMapper.selectCount(procurementRecordLambdaQueryWrapper); |
| | | ProcurementRecordOut.ProcurementRecordOutBuilder procurementRecordOut = ProcurementRecordOut.builder() |
| | | .procurementRecordStorageId(procurementRecordOutAdd.getId()) |
| | | .code("LS" + dateFormat.format(now) + String.format("%03d", aLong1 + 1)) |
| | | .salesLedgerProductId(procurementRecordOutAdd.getSalesLedgerProductId()) |
| | | .inboundBatches(aLong.equals(0L) ? "第1æ¹æ¬¡" : "第"+ (aLong + 1) + "æ¹æ¬¡") |
| | | .inboundNum(new BigDecimal(procurementRecordOutAdd.getQuantity())) |
| | |
| | | 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.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | public int updatePro(ProcurementUpdateDto procurementDto) { |
| | | ProcurementRecordStorage procurementRecordStorageById = getProcurementRecordById(procurementDto.getId()); |
| | | procurementRecordStorageById.setInboundNum(procurementDto.getQuantityStock()); |
| | | procurementRecordStorageById.setWarnNum(procurementDto.getWarnNum()); |
| | | procurementRecordStorageById.setUpdateUser(SecurityUtils.getLoginUser().getUserId()); |
| | | procurementRecordStorageById.setUpdateTime(LocalDateTime.now()); |
| | | return procurementRecordMapper.updateById(procurementRecordStorageById); |
| | |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String entryDateStr = procurementDto.getEntryDate() + " 00:00:00"; |
| | | String createTimeStr = procurementDto.getCreateTime() + " 00:00:00"; |
| | | SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(procurementDto.getSalesLedgerProductId()); |
| | | if(salesLedgerProduct == null){ |
| | | throw new RuntimeException("éå®å°è´¦äº§åä¸åå¨"); |
| | | } |
| | | salesLedgerProduct.setMinStock(procurementDto.getMinStock()); |
| | | salesLedgerProductMapper.updateById(salesLedgerProduct); |
| | | ProcurementRecordStorage procurementRecordStorageById = getProcurementRecordById(procurementDto.getId()); |
| | | procurementRecordStorageById.setCreateBy(sysUser.getNickName()); |
| | | procurementRecordStorageById.setCreateUser(sysUser.getUserId()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getReportList(Page page, ProcurementPageDto procurementDto) { |
| | | // æå»ºæ¥è¡¨æ°æ®ç»æ |
| | | Map<String, Object> reportData = new HashMap<>(); |
| | | // 2. æå»ºå¾è¡¨æ°æ® |
| | | Map<String, Object> chartData = new HashMap<>(); |
| | | |
| | | IPage<ProcurementPageDtoCopy> procurementPageDtoCopyIPage = procurementRecordMapper.listPageCopy(page, procurementDto); |
| | | List<ProcurementPageDtoCopy> procurementPageDtoCopyList = procurementPageDtoCopyIPage.getRecords(); |
| | | // 计ç®å¾
å
¥åºæ°é |
| | | reportData.put("tableData", procurementPageDtoCopyList); |
| | | // æ¥è¯¢éè´è®°å½å·²å
¥åºæ°é |
| | | List<Integer> collect = procurementPageDtoCopyList.stream().map(ProcurementPageDtoCopy::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(collect)){ |
| | | return reportData; |
| | | } |
| | | LambdaQueryWrapper<ProcurementRecordOut> procurementRecordLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | procurementRecordLambdaQueryWrapper.in(ProcurementRecordOut::getProcurementRecordStorageId, collect); |
| | | List<ProcurementRecordOut> procurementRecords = procurementRecordOutMapper.selectList(procurementRecordLambdaQueryWrapper); |
| | | if(CollectionUtils.isEmpty( procurementRecords)){ |
| | | return reportData; |
| | | } |
| | | int totalIn =0; |
| | | int totalOut =0; |
| | | int currentStock =0; |
| | | int turnoverRate =0; |
| | | List<String> dates = new ArrayList<>(); |
| | | List<Integer> values = new ArrayList<>(); |
| | | List<String> comparisonDates = new ArrayList<>(); |
| | | List<Integer> inValues = new ArrayList<>(); |
| | | List<Integer> outValues = new ArrayList<>(); |
| | | // å®ä¹æ¥ææ ¼å¼åå¨ï¼æå®ä¸ºyyyy-MM-ddæ ¼å¼ |
| | | DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE; |
| | | for (ProcurementPageDtoCopy dto : procurementPageDtoCopyList) { |
| | | dates.add(dto.getCreateTime().format(dateFormatter)); |
| | | comparisonDates.add(dto.getCreateTime().format(dateFormatter)); |
| | | |
| | | // æ ¹æ®éè´å°è´¦IDçé对åºçåºåºè®°å½ |
| | | List<ProcurementRecordOut> collect1 = procurementRecords.stream() |
| | | .filter(ProcurementRecordOut -> ProcurementRecordOut.getProcurementRecordStorageId().equals(dto.getId())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // å¦ææ²¡æç¸å
³çåºåºè®°å½ï¼è·³è¿è¯¥æ¡æ°æ® |
| | | if(CollectionUtils.isEmpty(collect1)){ |
| | | dto.setInboundNum0(dto.getInboundNum()); |
| | | continue; |
| | | } |
| | | |
| | | // 计ç®å·²åºåºæ°éæ»åï¼å¹¶è®¾ç½®å¾
åºåºæ°é |
| | | BigDecimal totalInboundNum = collect1.stream() |
| | | .map(ProcurementRecordOut::getInboundNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | // å¾
åºåºæ°é = æ»æ°é - å·²åºåºæ°é |
| | | dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum)); |
| | | |
| | | // è®¡ç®æ»å
¥åºæ°é |
| | | totalIn += dto.getInboundNum().intValue(); |
| | | inValues.add(totalIn); |
| | | // è®¡ç®æ»åºåºæ°é |
| | | totalOut += totalInboundNum.intValue(); |
| | | outValues.add(totalOut); |
| | | // 计ç®å½ååºå |
| | | currentStock += dto.getInboundNum().intValue() - totalInboundNum.intValue(); |
| | | values.add(currentStock); |
| | | // 计ç®å¨è½¬ç |
| | | if(totalIn > 0){ |
| | | turnoverRate = totalOut * 100 / totalIn; |
| | | } |
| | | } |
| | | |
| | | |
| | | // 1. æå»ºæ±æ»æ°æ® |
| | | Map<String, Object> summary = new HashMap<>(); |
| | | summary.put("totalIn", totalIn); // æ»å
¥åºéï¼å®é
åºä»æ°æ®è®¡ç® |
| | | summary.put("totalOut", totalOut); // æ»åºåºéï¼å®é
åºä»æ°æ®è®¡ç® |
| | | summary.put("currentStock", currentStock); // å½ååºåéï¼å®é
åºä»æ°æ®è®¡ç® |
| | | summary.put("turnoverRate", turnoverRate); // å¨è½¬çï¼å®é
åºä»æ°æ®è®¡ç® |
| | | reportData.put("summary", summary); |
| | | |
| | | // 2. æå»ºå¾è¡¨æ°æ® |
| | | // Map<String, Object> chartData = new HashMap<>(); |
| | | // List<String> dates = Arrays.asList("2025-09-15", "2025-09-16", "2025-09-17", "2025-09-18", "2025-09-19"); |
| | | // List<Integer> values = Arrays.asList(300, 350, 400, 380, 420); |
| | | |
| | | chartData.put("dates", dates); |
| | | chartData.put("values", values); |
| | | chartData.put("comparisonDates", comparisonDates); // å®é
åºä»æ°æ®è®¡ç® |
| | | chartData.put("inValues", inValues); // å®é
åºä»æ°æ®è®¡ç® |
| | | chartData.put("outValues", outValues); // å®é
åºä»æ°æ®è®¡ç® |
| | | reportData.put("chartData", chartData); |
| | | |
| | | // 3. è®¾ç½®è¡¨æ ¼æ°æ® |
| | | reportData.put("tableData", procurementPageDtoCopyList); |
| | | |
| | | return reportData; |
| | | } |
| | | |
| | | @Override |
| | | public int add(ProcurementAddDto procurementDto) { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | // æ¹éæ°å¢ |
| | |
| | | .salesLedgerProductId(detail.getId()) |
| | | .inboundBatches(aLong.equals(0L) ? "第1æ¹æ¬¡" : "第"+ (aLong + 1) + "æ¹æ¬¡") |
| | | .inboundNum(detail.getInboundQuantity()) |
| | | .warnNum(detail.getWarnNum()) |
| | | .createTime(LocalDateTime.now()) |
| | | .createUser(loginUser.getUserId()) |
| | | .updateTime(LocalDateTime.now()) |
| | |
| | | BigDecimal totalInboundNum = collect1.stream() |
| | | .map(ProcurementRecordOut::getInboundNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | // åºåºæ°é = æ»æ°é - å¾
åºåºæ°é |
| | | dto.setTotalInboundNum(totalInboundNum); |
| | | // å¾
åºåºæ°é = æ»æ°é - å·²åºåºæ°é |
| | | dto.setInboundNum0(dto.getInboundNum().subtract(totalInboundNum)); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | 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.procurementrecord.mapper.ReturnManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.procurementrecord.service.ReturnManagementService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 10:34 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class ReturnManagementServiceImpl extends ServiceImpl<ReturnManagementMapper, ReturnManagement> implements ReturnManagementService { |
| | | |
| | | @Autowired |
| | | private ReturnManagementMapper returnManagementMapper; |
| | | |
| | | @Override |
| | | public IPage<ReturnManagement> listPage(Page page, ReturnManagement returnManagement) { |
| | | IPage<ReturnManagement> returnManagementIPage = returnManagementMapper.listPage(page, returnManagement); |
| | | return returnManagementIPage; |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.controller.BaseController; |
| | |
| | | salesLedgerSchedulingService.export(response); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * @param response |
| | | */ |
| | | @PostMapping("/exportOne") |
| | | @ApiOperation("ç产管ç-ç产派工-导åº") |
| | | public void exportOne(HttpServletResponse response) { |
| | | salesLedgerSchedulingService.exportOne(response); |
| | | } |
| | | |
| | | @PostMapping("/productionDispatch") |
| | | @Log(title = "ç产管ç-ç产订å-ç产派工", businessType = BusinessType.INSERT) |
| | | @ApiOperation("ç产管ç-ç产订å-ç产派工") |
| | |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * @param response |
| | | */ |
| | | @PostMapping("/exportTwo") |
| | | @ApiOperation("ç产管ç-å·¥åºæäº§-导åº") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | SalesLedgerSchedulingProcessDto salesLedgerSchedulingDto = new SalesLedgerSchedulingProcessDto(); |
| | | IPage<SalesLedgerSchedulingProcessDto> result = salesLedgerSchedulingService.listPageProcess(page,salesLedgerSchedulingDto); |
| | | result.getRecords().forEach(item -> { |
| | | item.setStatusName(item.getStatus().toString()); |
| | | }); |
| | | ExcelUtil<SalesLedgerSchedulingProcessDto> util = new ExcelUtil<>(SalesLedgerSchedulingProcessDto.class); |
| | | util.exportExcel(response, result.getRecords(), "å·¥åºæäº§"); |
| | | } |
| | | |
| | | |
| | | @DeleteMapping("/productionDispatchDelete") |
| | | @Log(title = "ç产管ç-å·¥åºæäº§-åæ¶æäº§", businessType = BusinessType.DELETE) |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.ProcessSchedulingDto; |
| | | import com.ruoyi.production.dto.ProductionReportDto; |
| | | import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto; |
| | | import com.ruoyi.production.dto.SalesLedgerWorkDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerWork; |
| | | import com.ruoyi.production.service.SalesLedgerWorkService; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åº |
| | | * @param response |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("ç产管ç-ç产æ¥å·¥-导åº") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | SalesLedgerWorkDto salesLedgerSchedulingDto = new SalesLedgerWorkDto(); |
| | | IPage<SalesLedgerWorkDto> result = salesLedgerWorkService.listPage(page,salesLedgerSchedulingDto); |
| | | result.getRecords().forEach(item -> { |
| | | item.setDaiNum(item.getFinishedNum().subtract(item.getSchedulingNum())); |
| | | item.setStatusName(item.getStatus().toString()); |
| | | }); |
| | | ExcelUtil<SalesLedgerWorkDto> util = new ExcelUtil<>(SalesLedgerWorkDto.class); |
| | | util.exportExcel(response, result.getRecords(), "å·¥åºæäº§"); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @Log(title = "ç产æ¥å·¥-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("ç产æ¥å·¥-æ¥è¯¢") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/11/3 9:35 |
| | | */ |
| | | @Data |
| | | public class DaiDto{ |
| | | |
| | | @Excel(name = "å¾
ææ°é") |
| | | private BigDecimal daiNum; |
| | | |
| | | @ApiModelProperty(value = "éå®äº§åID") |
| | | private Long salesLedgerProductId; |
| | | |
| | | @ApiModelProperty(value = "éå®å°è´¦ID") |
| | | private Long salesLedgerId; |
| | | |
| | | /** |
| | | * éå®ååå· |
| | | */ |
| | | @Excel(name = "éå®ååå·") |
| | | @ApiModelProperty(value = "éå®ååå·") |
| | | private String salesContractNo; |
| | | |
| | | /** |
| | | * 客æ·ååå· |
| | | */ |
| | | @Excel(name = "客æ·ååå·") |
| | | @ApiModelProperty(value = "客æ·ååå·") |
| | | private String customerContractNo; |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | @Excel(name = "项ç®åç§°") |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | /** |
| | | * å½å
¥æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å½å
¥æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å½å
¥æ¥æ") |
| | | private Date entryDate; |
| | | |
| | | @ApiModelProperty(value = "å½å
¥æ¥æå¼å§") |
| | | private String entryDateStart; |
| | | |
| | | @ApiModelProperty(value = "å½å
¥æ¥æç»æ") |
| | | private String entryDateEnd; |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | @Excel(name = "客æ·åç§°") |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | |
| | | /** |
| | | * 产å大类 |
| | | */ |
| | | @Excel(name = "产å大类") |
| | | @ApiModelProperty(value = "产å大类") |
| | | private String productCategory; |
| | | |
| | | /** |
| | | * è§æ ¼åå· |
| | | */ |
| | | @Excel(name = "è§æ ¼åå·") |
| | | @ApiModelProperty(value = "è§æ ¼åå·") |
| | | private String specificationModel; |
| | | |
| | | /** |
| | | * åä½ |
| | | */ |
| | | @Excel(name = "åä½") |
| | | @ApiModelProperty(value = "åä½") |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | */ |
| | | @Excel(name = "æ°é") |
| | | @ApiModelProperty(value = "æ°é") |
| | | private BigDecimal quantity; |
| | | |
| | | /** |
| | | * æäº§æ°é |
| | | */ |
| | | @Excel(name = "æäº§æ°é") |
| | | @ApiModelProperty(value = "æäº§æ°é") |
| | | private BigDecimal schedulingNum; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | private Long tenantId; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "å®å·¥æ°é") |
| | | private BigDecimal successNum; |
| | | |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | private Long tenantId; |
| | | |
| | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Excel(name = "ç¶æ") |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | private Integer status; |
| | | |
| | | @Excel(name = "ç¶æ", readConverterExp = "1=å¾
æäº§,2=æäº§ä¸,3=å·²æäº§") |
| | | private String statusName; |
| | | |
| | | /** |
| | | * 派工人 |
| | |
| | | * å·²æäº§æ°é |
| | | */ |
| | | @ApiModelProperty(value = "å·²æäº§æ°é") |
| | | @Excel(name = "å·²æäº§æ°é") |
| | | private BigDecimal successNum; |
| | | |
| | | private Long tenantId; |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | * æäº§äººåç§° |
| | | */ |
| | | @ApiModelProperty(value = "æäº§äººåç§°") |
| | | @Excel(name = "æäº§äºº") |
| | | private String schedulingUserName; |
| | | |
| | | |
| | |
| | | * æäº§æ°é |
| | | */ |
| | | @ApiModelProperty(value = "æäº§æ°é") |
| | | @Excel(name = "æäº§æ°é") |
| | | private BigDecimal schedulingNum; |
| | | |
| | | /** |
| | | * ç产æ°é |
| | | */ |
| | | @ApiModelProperty(value = "ç产æ°é") |
| | | @Excel(name = "ç产æ°é") |
| | | private BigDecimal finishedNum; |
| | | |
| | | /** |
| | | * å¾
ç产æ°é |
| | | */ |
| | | @ApiModelProperty(value = "å¾
ç产æ°é") |
| | | @Excel(name = "å¾
ç产æ°é") |
| | | private BigDecimal daiNum; |
| | | |
| | | /** |
| | | * å·¥æ¶å®é¢ |
| | |
| | | * å·¥åº |
| | | */ |
| | | @ApiModelProperty(value = "å·¥åº") |
| | | @Excel(name = "å·¥åº") |
| | | private String process; |
| | | /** |
| | | * æäº§æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "æäº§æ¥æ") |
| | | @Excel(name = "æäº§æ¥æ") |
| | | private String schedulingDate; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¶é´") |
| | |
| | | @ApiModelProperty(value = "æ¥å·¥ç¶æ") |
| | | private Integer status; |
| | | |
| | | @Excel(name = "ç¶æ", readConverterExp = "1=å¾
ç产,2=ç产ä¸,3=å·²æ¥å·¥") |
| | | private String statusName; |
| | | |
| | | |
| | | } |
| | |
| | | int productionDispatchDelete(List<Long> ids); |
| | | |
| | | int processScheduling(List<ProcessSchedulingDto> processSchedulingDto); |
| | | |
| | | void exportOne(HttpServletResponse response); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto; |
| | | import com.ruoyi.production.dto.ProcessSchedulingDto; |
| | | import com.ruoyi.production.dto.ProductionDispatchAddDto; |
| | | import com.ruoyi.production.dto.SalesLedgerSchedulingDto; |
| | | import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto; |
| | | import com.ruoyi.production.dto.*; |
| | | import com.ruoyi.production.mapper.SalesLedgerSchedulingMapper; |
| | | import com.ruoyi.production.mapper.SalesLedgerWorkMapper; |
| | | import com.ruoyi.production.pojo.SalesLedgerScheduling; |
| | |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | |
| | | .filter(j -> j.getSalesLedgerProductId().equals(i.getSalesLedgerProductId())) |
| | | .map(SalesLedgerWork::getFinishedNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | // ç¶æ = æ°éåå®å·¥æ°éæ¯è¾ |
| | | if(i.getSchedulingNum().compareTo(i.getSuccessNum()) == 0){ |
| | | i.setStatus("已宿"); |
| | | }else{ |
| | | i.setStatus("æªå®æ"); |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public void exportOne(HttpServletResponse response) { |
| | | List<SalesLedgerSchedulingDto> list = salesLedgerSchedulingMapper.list(); |
| | | if(CollectionUtils.isEmpty(list)){ |
| | | throw new RuntimeException("æ å¯¼åºæ°æ®"); |
| | | } |
| | | List<DaiDto> dais = new ArrayList<>(); |
| | | list.forEach(i -> { |
| | | DaiDto daiDto = new DaiDto(); |
| | | BeanUtils.copyProperties(i, daiDto); |
| | | // è·åå¾
æäº§æ°é |
| | | daiDto.setDaiNum(daiDto.getQuantity().subtract(i.getSchedulingNum())); |
| | | dais.add(daiDto); |
| | | }); |
| | | ExcelUtil<DaiDto> util = new ExcelUtil<>(DaiDto.class); |
| | | util.exportExcel(response, dais, "ç产派工"); |
| | | } |
| | | } |
| | |
| | | import java.util.List;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import com.ruoyi.basic.service.StorageBlobService;
|
| | | import com.ruoyi.framework.web.domain.R;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | |
| | | *
|
| | | * @author ruoyi
|
| | | */
|
| | | @Api(tags = "éç¨æ¥å£")
|
| | | @RestController
|
| | | @RequestMapping("/common")
|
| | | public class CommonController
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Autowired
|
| | | private StorageBlobService storageBlobService;
|
| | |
|
| | |
|
| | | /**
|
| | | * minioéç¨ä¸ä¼ 请æ±ï¼å¤ä¸ªï¼
|
| | | */
|
| | | @PostMapping("/minioUploads")
|
| | | @ApiOperation(value = "minioéç¨ä¸ä¼ 请æ±")
|
| | | public AjaxResult minioUploadFiles(List<MultipartFile> files, String bucketName, Long type) throws Exception
|
| | | {
|
| | | return AjaxResult.success(storageBlobService.updateStorageBlobs(files, bucketName,type));
|
| | | }
|
| | |
|
| | | /**
|
| | | * éç¨ä¸ä¼ 请æ±ï¼å个ï¼
|
| | | */
|
| | |
| | | package com.ruoyi.project.system.mapper;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.ruoyi.project.system.domain.SysUser;
|
| | | import org.springframework.beans.PropertyValues;
|
| | |
|
| | | /**
|
| | | * ç¨æ·è¡¨ æ°æ®å±
|
| | |
| | | * @return ç»æ
|
| | | */
|
| | | public SysUser checkEmailUnique(String email);
|
| | |
|
| | | List<SysUser> selectList(List<Long> registrantIds);
|
| | |
|
| | | List<SysUser> selectUsersByIds(@Param("userIds") List<Long> userIds);
|
| | | }
|
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.purchase.dto.VatDto; |
| | | import com.ruoyi.purchase.pojo.InvoicePurchase; |
| | | import com.ruoyi.purchase.service.IInvoicePurchaseService; |
| | | import com.ruoyi.waterrecord.pojo.WaterRecord; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | 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.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-项ç®å©æ¶¦å¯¼åº", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | @ApiOperation("éè´æ¥è¡¨-项ç®å©æ¶¦å¯¼åº") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | InvoicePurchaseReportDto waterRecord = new InvoicePurchaseReportDto(); |
| | | IPage<InvoicePurchaseReportDto> listPage = invoicePurchaseService.listPurchaseReport(page, waterRecord); |
| | | ExcelUtil<InvoicePurchaseReportDto> util = new ExcelUtil<InvoicePurchaseReportDto>(InvoicePurchaseReportDto.class); |
| | | util.exportExcel(response, listPage.getRecords() , "项ç®å©æ¶¦å¯¼åº"); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.OTHER) |
| | | @GetMapping("/listVat") |
| | | public AjaxResult listVat(Page page,String month) { |
| | | IPage<VatDto> result = invoicePurchaseService.listVat(page, month); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @Log(title = "éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportTwo") |
| | | @ApiOperation("éè´æ¥è¡¨-å¢å¼ç¨æ¯å¯¹") |
| | | public void exportTwo(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | IPage<VatDto> result = invoicePurchaseService.listVat(page, null); |
| | | ExcelUtil<VatDto> util = new ExcelUtil<VatDto>(VatDto.class); |
| | | util.exportExcel(response, result.getRecords() , "å¢å¼ç¨æ¯å¯¹"); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.controller.BaseController; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导åºä»æ¬¾ç»è®°å表 |
| | | * 导åºä»æ¬¾æµæ°´å表 |
| | | */ |
| | | // @Log(title = "仿¬¾ç»è®°", businessType = BusinessType.EXPORT) |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, PaymentRegistrationDto paymentRegistrationDto) |
| | | // { |
| | | // List<PaymentRegistrationDto> list = paymentRegistrationService.selectPaymentRegistrationList(paymentRegistrationDto); |
| | | // ExcelUtil<PaymentRegistration> util = new ExcelUtil<PaymentRegistration>(PaymentRegistration.class); |
| | | // util.exportExcel(response, list, "仿¬¾ç»è®°æ°æ®"); |
| | | // } |
| | | @Log(title = "导åºä»æ¬¾æµæ°´å表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, PaymentRegistrationDto paymentRegistrationDto) |
| | | { |
| | | Page page = new Page<>(-1,-1); |
| | | IPage<PaymentRegistrationDto> paymentRegistrationDtoIPage = paymentHistoryListPage(page, paymentRegistrationDto); |
| | | ExcelUtil<PaymentRegistrationDto> util = new ExcelUtil<PaymentRegistrationDto>(PaymentRegistrationDto.class); |
| | | util.exportExcel(response, paymentRegistrationDtoIPage.getRecords(), "导åºä»æ¬¾æµæ°´å表"); |
| | | } |
| | | |
| | | /** |
| | | * è·å仿¬¾ç»è®°è¯¦ç»ä¿¡æ¯ |
| | |
| | | } |
| | | |
| | | /** |
| | | * å¯¼åºæ¥ç¥¨ç»è®°å表 |
| | | */ |
| | | @Log(title = "å¯¼åºæ¥ç¥¨ç»è®°å表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response, PurchaseLedger purchaseLedger) { |
| | | Page page = new Page(); |
| | | page.setCurrent(-1); |
| | | page.setSize(-1); |
| | | IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerService.selectPurchaseLedgerListPage(page, new PurchaseLedgerDto()); |
| | | ExcelUtil<PurchaseLedgerDto> util = new ExcelUtil<PurchaseLedgerDto>(PurchaseLedgerDto.class); |
| | | util.exportExcel(response, purchaseLedgerDtoIPage.getRecords(), "å¯¼åºæ¥ç¥¨ç»è®°å表"); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿®æ¹éè´å°è´¦ |
| | | */ |
| | | @Log(title = "éè´å°è´¦", businessType = BusinessType.INSERT) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 仿¬¾ç»è®°å¯¼åº |
| | | */ |
| | | @Log(title = "仿¬¾ç»è®°å¯¼åº", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response, TicketRegistration ticketRegistration) { |
| | | Page page = new Page<>(-1, -1); |
| | | IPage<TicketRegistration> ticketRegistrationIPage = listPage(page, ticketRegistration); |
| | | ExcelUtil<TicketRegistration> util = new ExcelUtil<TicketRegistration>(TicketRegistration.class); |
| | | util.exportExcel(response, ticketRegistrationIPage.getRecords(), "仿¬¾ç»è®°å¯¼åº"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¥ç¥¨ç»è®°å产åç¶åå表 |
| | | */ |
| | | @GetMapping("/getRegistrationById") |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | public class InvoicePurchaseReportDto { |
| | | |
| | | //éå®ååå· |
| | | @Excel(name = "éå®ååå·") |
| | | private String customerContractNo; |
| | | // 客æ·åç§° |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | // 项ç®åç§° |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | // ååéé¢ |
| | | @Excel(name = "ååéé¢") |
| | | private String contractAmount; |
| | | // éè´éé¢ |
| | | @Excel(name = "éè´éé¢") |
| | | private String purchaseAmount; |
| | | |
| | | private String saleTaxExclusiveTotalPrice; |
| | | |
| | | private String taxExclusiveTotalPrice; |
| | | // 婿¶¦ |
| | | @Excel(name = "婿¶¦") |
| | | private String balance; |
| | | // 婿¶¦ç |
| | | @Excel(name = "婿¶¦ç") |
| | | private String balanceRatio; |
| | | // å¢å¼ç¨ |
| | | @Excel(name = "å¢å¼ç¨") |
| | | private String balanceAmount; |
| | | |
| | | } |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.purchase.pojo.PaymentRegistration; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String salesContractNo; |
| | | |
| | | // éè´ååå· |
| | | @Excel(name = "éè´ååå·") |
| | | private String purchaseContractNumber; |
| | | |
| | | // ä¾åºååç§° |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | // åç¥¨å· |
| | |
| | | private String purchaseContractNumber; |
| | | //ä¾åºååç§° |
| | | private String supplierName; |
| | | private String projectName; |
| | | private Long issUerId; |
| | | private String issUer; |
| | | //å¢å¼ç¨ |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | |
| | | /** |
| | | * éè´ååå· |
| | | */ |
| | | @Excel(name = "éè´ååå·") |
| | | private String purchaseContractNumber; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * ä¾åºååç§° |
| | | */ |
| | | @Excel(name = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * å½å
¥äººå§å |
| | | */ |
| | | @Excel(name = "å½å
¥äººå§å") |
| | | private String recorderName; |
| | | |
| | | /** |
| | | * éå®ååå· |
| | | */ |
| | | @Excel(name = "éå®ååå·") |
| | | private String salesContractNo; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | /** |
| | | * å½å
¥æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å½å
¥æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date entryDate; |
| | | |
| | | /** |
| | | * ç¾è®¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç¾è®¢æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date executionDate; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | |
| | | /** |
| | | * ååéé¢ï¼äº§åå«ç¨æ»ä»·ï¼ |
| | | */ |
| | | @Excel(name = "ååéé¢") |
| | | private BigDecimal contractAmount = BigDecimal.ZERO; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("æ¥ç¥¨éé¢") |
| | | @Excel(name = "å·²æ¥ç¥¨éé¢(å
)") |
| | | private BigDecimal receiptPaymentAmount = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty("æªæ¥ç¥¨éé¢") |
| | | @TableField(exist = false) |
| | | @Excel(name = "æªæ¥ç¥¨éé¢(å
)") |
| | | private BigDecimal unReceiptPaymentAmount =BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty("æä»¶ç±»å å 4") |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | public class VatDto { |
| | | |
| | | //æä»½ |
| | | @Excel(name = "æä»½") |
| | | private String month ; |
| | | |
| | | //è¿é¡¹ç¨ |
| | | @Excel(name = "è¿é¡¹ç¨é¢") |
| | | private BigDecimal jTaxAmount; |
| | | |
| | | //éé¡¹ç¨ |
| | | @Excel(name = "é项ç¨é¢") |
| | | private BigDecimal xTaxAmount; |
| | | |
| | | @Excel(name = "é-è¿") |
| | | private BigDecimal taxAmount; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | /** |
| | | * æ¬æ¬¡ä»æ¬¾éé¢ |
| | | */ |
| | | @Excel(name = "仿¬¾éé¢") |
| | | private BigDecimal currentPaymentAmount; |
| | | |
| | | /** |
| | | * 仿¬¾å½¢å¼ |
| | | */ |
| | | @Excel(name = "仿¬¾å½¢å¼") |
| | | private String paymentMethod; |
| | | |
| | | /** |
| | |
| | | * 仿¬¾æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "仿¬¾æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date paymentDate; |
| | | |
| | | /** |
| | | * ç»è®°æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç»è®°æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date registrationtDate; |
| | | |
| | | /** |
| | |
| | | @Excel(name = "å½å
¥æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date entryDate; |
| | | |
| | | |
| | | /** |
| | | * ç¾è®¢æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç¾è®¢æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date executionDate; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Excel(name = "ç¶æ") |
| | | @TableField(exist = false) |
| | | private String statusName; |
| | | |
| | | /** |
| | | * éè´å°è´¦id |
| | | */ |
| | | private Long purchaseLedgerId; |
| | |
| | | |
| | | @ApiModelProperty(value = "已仿¬¾æ»éé¢") |
| | | @TableField(exist = false) |
| | | @Excel(name = "已仿¬¾æ»éé¢") |
| | | private BigDecimal paymentAmountTotal; |
| | | |
| | | @ApiModelProperty(value = "æªä»æ¬¾æ»éé¢") |
| | | @TableField(exist = false) |
| | | @Excel(name = "æªä»æ¬¾æ»éé¢") |
| | | private BigDecimal unPaymentAmountTotal; |
| | | |
| | | @TableField(exist = false) |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.account.pojo.AccountIncome; |
| | | import com.ruoyi.account.service.AccountExpenseService; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.basic.mapper.ProductMapper; |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.mapper.SupplierManageMapper; |
| | |
| | | @RequiredArgsConstructor |
| | | @Slf4j |
| | | public class PurchaseLedgerServiceImpl extends ServiceImpl<PurchaseLedgerMapper, PurchaseLedger> implements IPurchaseLedgerService { |
| | | |
| | | private final AccountExpenseService accountExpenseService; |
| | | private final PurchaseLedgerMapper purchaseLedgerMapper; |
| | | |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | |
| | | purchaseLedger.setRecorderId(purchaseLedgerDto.getRecorderId()); |
| | | purchaseLedger.setRecorderName(sysUser.getNickName()); |
| | | purchaseLedger.setPhoneNumber(sysUser.getPhonenumber()); |
| | | // 2. å¤çè´¦æ·æ¶å
¥ |
| | | AccountExpense accountExpense = new AccountExpense(); |
| | | accountExpense.setExpenseDate(purchaseLedger.getEntryDate()); |
| | | accountExpense.setExpenseType("0"); |
| | | accountExpense.setSupplierName(purchaseLedger.getSupplierName()); |
| | | accountExpense.setExpenseMoney(purchaseLedger.getContractAmount()); |
| | | accountExpense.setExpenseDescribed("éè´ååï¼" + purchaseLedger.getPurchaseContractNumber()); |
| | | accountExpense.setExpenseMethod("0"); |
| | | accountExpense.setInvoiceNumber(purchaseLedger.getPurchaseContractNumber()); |
| | | accountExpense.setInputTime(new Date()); |
| | | accountExpense.setInputUser(loginUser.getNickName()); |
| | | |
| | | |
| | | // 3. æ°å¢ææ´æ°ä¸»è¡¨ |
| | | if (purchaseLedger.getId() == null) { |
| | | purchaseLedgerMapper.insert(purchaseLedger); |
| | | // accountIncomeService.save(accountIncome); |
| | | accountExpenseService.save(accountExpense); |
| | | } else { |
| | | purchaseLedgerMapper.updateById(purchaseLedger); |
| | | PurchaseLedger purchaseLedgerDB = purchaseLedgerMapper.selectById(purchaseLedger.getId()); |
| | | List<AccountExpense> accountExpenseDBs = accountExpenseService.getByInvoiceNumberList(purchaseLedger.getPurchaseContractNumber()); |
| | | if (!CollectionUtils.isEmpty(accountExpenseDBs)) { |
| | | accountExpenseDBs.forEach(accountExpenseDB ->{ |
| | | accountExpenseDB.setExpenseDate(purchaseLedgerDB.getEntryDate()); |
| | | accountExpenseDB.setExpenseType("0"); |
| | | accountExpenseDB.setSupplierName(purchaseLedgerDB.getSupplierName()); |
| | | accountExpenseDB.setExpenseMoney(purchaseLedgerDB.getContractAmount()); |
| | | accountExpenseDB.setExpenseDescribed("éè´ååï¼" + purchaseLedgerDB.getPurchaseContractNumber()); |
| | | accountExpenseDB.setExpenseMethod("0"); |
| | | accountExpenseDB.setInvoiceNumber(purchaseLedgerDB.getPurchaseContractNumber()); |
| | | accountExpenseService.updateById(accountExpenseDB); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 4. å¤çåè¡¨æ°æ® |
| | |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| | |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| | |
| | | ticketRegistrationIPage.setTotal(ticketRegistrationIPage.getRecords().size()); |
| | | } |
| | | } |
| | | ticketRegistrationIPage.getRecords().forEach(item -> { |
| | | // 已仿¬¾éé¢ == å¾
仿¬¾éé¢ |
| | | item.setStatusName(item.getPaymentAmountTotal().compareTo(item.getInvoiceAmount()) == 0 ? "已宿仿¬¾" : "æªå®æä»æ¬¾"); |
| | | }); |
| | | return ticketRegistrationIPage; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * æäº¤ |
| | | * @param id |
| | | * @param qualityInspect |
| | | * @return |
| | | */ |
| | | @PostMapping("/submit") |
| | | public AjaxResult submit(Integer id) { |
| | | return AjaxResult.success(qualityInspectService.submit(id)); |
| | | public AjaxResult submit(@RequestBody QualityInspect qualityInspect) { |
| | | return AjaxResult.success(qualityInspectService.submit(qualityInspect)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸è½½ |
| | | * @param response |
| | | * @param id |
| | | * @param qualityInspect |
| | | */ |
| | | @PostMapping("/down") |
| | | public void down(HttpServletResponse response,Integer id) { |
| | | qualityInspectService.down(response, id); |
| | | public void down(HttpServletResponse response,@RequestBody QualityInspect qualityInspect) { |
| | | qualityInspectService.down(response, qualityInspect); |
| | | } |
| | | } |
| | |
| | | |
| | | QualityInspectDto getDetailById(Integer id); |
| | | |
| | | int submit(Integer id); |
| | | int submit(QualityInspect qualityInspect); |
| | | |
| | | void down(HttpServletResponse response, Integer id); |
| | | void down(HttpServletResponse response, QualityInspect qualityInspect); |
| | | } |
| | |
| | | |
| | | //æäº¤ |
| | | @Override |
| | | public int submit(Integer id) { |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(id); |
| | | public int submit(QualityInspect inspect) { |
| | | QualityInspect qualityInspect = qualityInspectMapper.selectById(inspect.getId()); |
| | | /*夿ä¸åæ ¼*/ |
| | | if (ObjectUtils.isNotNull(qualityInspect.getCheckResult()) && qualityInspect.getCheckResult().equals("ä¸åæ ¼")){ |
| | | QualityUnqualified qualityUnqualified = new QualityUnqualified(); |
| | | BeanUtils.copyProperties(qualityInspect,qualityUnqualified); |
| | | qualityUnqualified.setInspectState(0);//å¾
å¤ç |
| | | List<QualityInspectParam> inspectParams = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, id)); |
| | | List<QualityInspectParam> inspectParams = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, inspect.getId())); |
| | | String text = inspectParams.stream().map(QualityInspectParam::getParameterItem).collect(Collectors.joining(",")); |
| | | qualityUnqualified.setDefectivePhenomena(text+"è¿äºææ ä¸åå¨ä¸åæ ¼");//ä¸åæ ¼ç°è±¡ |
| | | qualityUnqualifiedMapper.insert(qualityUnqualified); |
| | |
| | | |
| | | /*çææ£éªæ¥å*/ |
| | | @Override |
| | | public void down(HttpServletResponse response, Integer id) { |
| | | QualityInspect inspect = qualityInspectMapper.selectById(id); |
| | | public void down(HttpServletResponse response, QualityInspect qualityInspect) { |
| | | QualityInspect inspect = qualityInspectMapper.selectById(qualityInspect.getId()); |
| | | String inspectType=""; |
| | | switch (inspect.getInspectType()){ |
| | | case 0: |
| | |
| | | inspectType="åºåæ£éª"; |
| | | break; |
| | | } |
| | | List<QualityInspectParam> paramList = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, id)); |
| | | List<QualityInspectParam> paramList = qualityInspectParamService.list(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId, inspect.getId())); |
| | | int index = 1; |
| | | for (QualityInspectParam detail : paramList) { |
| | | detail.setIndex(index); |
| | |
| | | response.setContentType("application/msword"); |
| | | String fileName = URLEncoder.encode( |
| | | "æ£éªæ¥å", "UTF-8"); |
| | | response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); |
| | | response.setHeader("Content-disposition", |
| | | "attachment;filename=" + fileName + ".docx"); |
| | | OutputStream os = response.getOutputStream(); |
| | |
| | | |
| | | @Override |
| | | public int updateQualityInspect(QualityInspectDto qualityInspectDto) { |
| | | if (qualityInspectDto.getQualityInspectParams().size()>0) { |
| | | if (ObjectUtils.isNotNull(qualityInspectDto.getQualityInspectParams())) { |
| | | qualityInspectParamService.remove(Wrappers.<QualityInspectParam>lambdaQuery().eq(QualityInspectParam::getInspectId,qualityInspectDto.getId())); |
| | | for (QualityInspectParam qualityInspectParam : qualityInspectDto.getQualityInspectParams()) { |
| | | qualityInspectParam.setInspectId(qualityInspectDto.getId()); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.mapper.PaymentShippingMapper; |
| | | import com.ruoyi.sales.pojo.PaymentShipping; |
| | | import com.ruoyi.sales.service.PaymentShippingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 14:02 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/paymentShipping") |
| | | @Api(tags = "æ¯ä»ä¸å货管ç") |
| | | public class PaymentShippingController extends BaseController { |
| | | |
| | | @Autowired |
| | | private PaymentShippingService paymentShippingService; |
| | | |
| | | @Autowired |
| | | private PaymentShippingMapper paymentShippingMapper; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å页æ¥è¯¢æ¯ä»ä¸åè´§ä¿¡æ¯") |
| | | public AjaxResult listPage(Page page, PaymentShipping paymentShipping) { |
| | | IPage<PaymentShipping> listPage = paymentShippingService.listPage(page, paymentShipping); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ·»å æ¯ä»ä¸åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody PaymentShipping paymentShipping) { |
| | | String ord = OrderUtils.countTodayByCreateTime(paymentShippingMapper, "ORD"); |
| | | paymentShipping.setOrderNo(ord); |
| | | boolean save = paymentShippingService.save(paymentShipping); |
| | | return save ? success() : error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹æ¯ä»ä¸åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody PaymentShipping paymentShipping) { |
| | | boolean update = paymentShippingService.updateById(paymentShipping); |
| | | return update ? success() : error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å 餿¯ä»ä¸åè´§ä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids){ |
| | | if (CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | return AjaxResult.success(paymentShippingService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | 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.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.InvoicePurchaseDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentDto; |
| | | import com.ruoyi.sales.dto.ReceiptPaymentRecordDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.service.ReceiptPaymentService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导åºåæ¬¾æµæ°´å表 |
| | | */ |
| | | @Log(title = "导åºåæ¬¾æµæ°´å表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response, ReceiptPaymentDto salesLedgerDto) { |
| | | Page page = new Page(); |
| | | page.setCurrent(-1); |
| | | page.setSize(-1); |
| | | IPage<ReceiptPaymentDto> salesLedgerIPage = receiptPaymentHistoryListPage(page, salesLedgerDto); |
| | | ExcelUtil<ReceiptPaymentRecordDto> util = new ExcelUtil<ReceiptPaymentRecordDto>(ReceiptPaymentRecordDto.class); |
| | | List<ReceiptPaymentRecordDto> receiptPaymentRecordDtos = new ArrayList<>(); |
| | | salesLedgerIPage.getRecords().forEach(receiptPaymentRecordDto -> { |
| | | ReceiptPaymentRecordDto receiptPaymentRecordDto1 = new ReceiptPaymentRecordDto(); |
| | | BeanUtils.copyBeanProp(receiptPaymentRecordDto, receiptPaymentRecordDto1); |
| | | receiptPaymentRecordDtos.add(receiptPaymentRecordDto1); |
| | | }); |
| | | util.exportExcel(response, receiptPaymentRecordDtos, "导åºå¼ç¥¨ç»è®°å表"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å款记å½ä¸å页 |
| | | */ |
| | | @GetMapping("/receiptPaymentHistoryListNoPage") |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.mapper.InvoiceLedgerMapper; |
| | | import com.ruoyi.sales.mapper.InvoiceRegistrationProductMapper; |
| | | import com.ruoyi.sales.mapper.ReceiptPaymentMapper; |
| | | import com.ruoyi.sales.pojo.InvoiceLedger; |
| | | import com.ruoyi.sales.pojo.InvoiceRegistrationProduct; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.service.ICommonFileService; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Autowired |
| | | private InvoiceLedgerMapper invoiceLedgerMapper; |
| | | |
| | | @Autowired |
| | | private InvoiceRegistrationProductMapper invoiceRegistrationProductMapper; |
| | | |
| | | @Autowired |
| | | private ReceiptPaymentMapper receiptPaymentMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢éå®å°è´¦å表 |
| | | */ |
| | |
| | | if (salesLedger.getId().intValue() == invoiceLedgerDto.getSalesLedgerId()) { |
| | | BigDecimal noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); |
| | | salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | List<SalesLedger> list = salesLedgerService.selectSalesLedgerList(salesLedgerDto); |
| | | ExcelUtil<SalesLedger> util = new ExcelUtil<SalesLedger>(SalesLedger.class); |
| | | util.exportExcel(response, list, "éå®å°è´¦æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * 导åºå¼ç¥¨ç»è®°å表 |
| | | */ |
| | | @Log(title = "导åºå¼ç¥¨ç»è®°å表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/exportOne") |
| | | public void exportOne(HttpServletResponse response, SalesLedgerDto salesLedgerDto) { |
| | | Page page = new Page(); |
| | | page.setCurrent(-1); |
| | | page.setSize(-1); |
| | | IPage<SalesLedger> salesLedgerIPage = listPage(page, salesLedgerDto); |
| | | ExcelUtil<SalesLedger> util = new ExcelUtil<SalesLedger>(SalesLedger.class); |
| | | util.exportExcel(response, salesLedgerIPage == null ? new ArrayList<>() : salesLedgerIPage.getRecords(), "导åºå¼ç¥¨ç»è®°å表"); |
| | | } |
| | | |
| | | /** |
| | |
| | | iPage.setTotal(iPage.getRecords().size()); |
| | | return iPage; |
| | | } |
| | | // 计ç®å款éé¢ï¼å¾
忬¾éé¢ |
| | | List<InvoiceRegistrationProduct> invoiceRegistrationProducts = invoiceRegistrationProductMapper.selectList(new LambdaQueryWrapper<InvoiceRegistrationProduct>() |
| | | .in(InvoiceRegistrationProduct::getSalesLedgerId, salesLedgerIds)); |
| | | |
| | | List<InvoiceLedger> invoiceLedgers = invoiceLedgerMapper.selectList(new LambdaQueryWrapper<InvoiceLedger>() |
| | | .in(InvoiceLedger::getInvoiceRegistrationProductId, invoiceRegistrationProducts.stream().map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()))); |
| | | List<ReceiptPayment> receiptPayments = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(invoiceLedgers)){ |
| | | receiptPayments = receiptPaymentMapper.selectList(new LambdaQueryWrapper<ReceiptPayment>() |
| | | .in(ReceiptPayment::getInvoiceLedgerId, invoiceLedgers.stream().map(InvoiceLedger::getId).collect(Collectors.toList()))); |
| | | } |
| | | for (SalesLedger salesLedger : iPage.getRecords()) { |
| | | boolean existFlag = false; |
| | | BigDecimal noInvoiceAmountTotal = BigDecimal.ZERO; |
| | |
| | | noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal()); |
| | | invoiceTotal = invoiceLedgerDto.getInvoiceTotal(); |
| | | existFlag = true; |
| | | if(!CollectionUtils.isEmpty(receiptPayments)){ |
| | | List<InvoiceRegistrationProduct> collect = invoiceRegistrationProducts.stream() |
| | | .filter(item -> salesLedger.getId().equals(Long.parseLong(item.getSalesLedgerId().toString()))) |
| | | .collect(Collectors.toList()); |
| | | List<Integer> collect1 = collect.stream() |
| | | .map(InvoiceRegistrationProduct::getId).collect(Collectors.toList()); |
| | | List<InvoiceLedger> collect2 = invoiceLedgers.stream() |
| | | .filter(item -> collect1.contains(item.getInvoiceRegistrationProductId())) |
| | | .collect(Collectors.toList()); |
| | | // è·å已忬¾éé¢ |
| | | List<ReceiptPayment> collect3 = receiptPayments.stream() |
| | | .filter(item -> collect2.stream().anyMatch(item1 -> item1.getId().equals(item.getInvoiceLedgerId()))) |
| | | .collect(Collectors.toList()); |
| | | BigDecimal receiptPaymentAmountTotal = collect3.stream().map(ReceiptPayment::getReceiptPaymentAmount) |
| | | .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // è·åå¾
忬¾éé¢ |
| | | BigDecimal noReceiptPaymentAmountTotal = invoiceLedgerDto.getInvoiceTotal().subtract(receiptPaymentAmountTotal); |
| | | salesLedger.setReceiptPaymentAmountTotal(receiptPaymentAmountTotal); |
| | | salesLedger.setNoReceiptAmount(noReceiptPaymentAmountTotal); |
| | | } |
| | | break; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.aftersalesservice.dto.AfterSalesServiceDto; |
| | | import com.ruoyi.aftersalesservice.pojo.AfterSalesService; |
| | | 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.sales.dto.SalesQuotationDto; |
| | | import com.ruoyi.sales.service.SalesQuotationService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/sales/quotation") |
| | | public class SalesQuotationController { |
| | | @Autowired |
| | | private SalesQuotationService salesQuotationService; |
| | | @GetMapping("/list") |
| | | public AjaxResult getList(Page page, SalesQuotationDto salesQuotationDto) { |
| | | return AjaxResult.success(salesQuotationService.listPage(page, salesQuotationDto)); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response) { |
| | | Page page = new Page(-1,-1); |
| | | SalesQuotationDto afterSalesService = new SalesQuotationDto(); |
| | | IPage<SalesQuotationDto> listPage = salesQuotationService.listPage(page, afterSalesService); |
| | | ExcelUtil<SalesQuotationDto> util = new ExcelUtil<SalesQuotationDto>(SalesQuotationDto.class); |
| | | util.exportExcel(response, listPage.getRecords() , "åé¦ç»è®°"); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SalesQuotationDto salesQuotationDto) { |
| | | return AjaxResult.success(salesQuotationService.add(salesQuotationDto)); |
| | | } |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody SalesQuotationDto salesQuotationDto) { |
| | | return AjaxResult.success(salesQuotationService.edit(salesQuotationDto)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody Long id) { |
| | | return AjaxResult.success(salesQuotationService.delete(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.InvoiceLedgerDto; |
| | | import com.ruoyi.sales.pojo.SalespersonManagement; |
| | | import com.ruoyi.sales.service.SalespersonManagementService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 10:04 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/salespersonManagement") |
| | | @Api(tags = "ä¸å¡å管ç") |
| | | public class SalespersonManagementController extends BaseController { |
| | | |
| | | |
| | | @Autowired |
| | | private SalespersonManagementService salespersonManagementService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å页æ¥è¯¢ä¸å¡åä¿¡æ¯") |
| | | public AjaxResult listPage(Page page, SalespersonManagement salespersonManagement) { |
| | | IPage<SalespersonManagement> listPage = salespersonManagementService.listPage(page, salespersonManagement); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ·»å ä¸å¡åä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody SalespersonManagement salespersonManagement) { |
| | | boolean save = salespersonManagementService.save(salespersonManagement); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹ä¸å¡åä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody SalespersonManagement salespersonManagement) { |
| | | boolean update = salespersonManagementService.updateById(salespersonManagement); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤ä¸å¡åä¿¡æ¯") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if (ids == null || ids.isEmpty()) { |
| | | return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | } |
| | | boolean delete = salespersonManagementService.removeByIds(ids); |
| | | return delete ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.service.ShippingInfoService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/10/22 9:34 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/shippingInfo") |
| | | @Api(tags = "åè´§ä¿¡æ¯ç®¡ç") |
| | | public class ShippingInfoController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ShippingInfoService shippingInfoService; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("åè´§ä¿¡æ¯å表") |
| | | public AjaxResult listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfo> listPage = shippingInfoService.listPage(page,req); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ·»å åè´§ä¿¡æ¯") |
| | | public AjaxResult add(@RequestBody ShippingInfo req) { |
| | | boolean save = shippingInfoService.save(req); |
| | | return save ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹åè´§ä¿¡æ¯") |
| | | public AjaxResult update(@RequestBody ShippingInfo req) { |
| | | ShippingInfo byId = shippingInfoService.getById(req.getId()); |
| | | if (byId == null) { |
| | | return AjaxResult.error("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | Long userId = getLoginUser().getUserId(); |
| | | if(!userId.equals(Long.parseLong(byId.getCreateUser().toString()))){ |
| | | return AjaxResult.error("æ¨æ²¡ææéä¿®æ¹æ¤åè´§ä¿¡æ¯"); |
| | | } |
| | | boolean update = shippingInfoService.updateById(req); |
| | | return update ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤åè´§ä¿¡æ¯") |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | Long userId = getLoginUser().getUserId(); |
| | | ids.forEach(id -> { |
| | | ShippingInfo byId = shippingInfoService.getById(id); |
| | | if (byId == null) { |
| | | throw new RuntimeException("åè´§ä¿¡æ¯ä¸åå¨"); |
| | | } |
| | | if(!userId.equals(Long.parseLong(byId.getCreateUser().toString()))){ |
| | | throw new RuntimeException("æ¨æ²¡ææéå 餿¤åè´§ä¿¡æ¯"); |
| | | } |
| | | }); |
| | | boolean delete = shippingInfoService.removeBatchByIds(ids); |
| | | return delete ? AjaxResult.success("å 餿å") : AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | @Autowired |
| | | private ShippingInfoMapper shippingInfoMapper; |
| | | |
| | | /** |
| | | * 导åºåè´§ä¿¡æ¯ç®¡ç |
| | | */ |
| | | @PostMapping("/export") |
| | | @ApiOperation("导åºåè´§ä¿¡æ¯") |
| | | public void export(HttpServletResponse response) { |
| | | List<ShippingInfo> list = shippingInfoMapper.listAll(); |
| | | ExcelUtil<ShippingInfo> util = new ExcelUtil<ShippingInfo>(ShippingInfo.class); |
| | | util.exportExcel(response, list, "åè´§ä¿¡æ¯"); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.sales.pojo.ReceiptPayment; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class ReceiptPaymentDto extends ReceiptPayment { |
| | |
| | | @Excel(name = "客æ·ååå·") |
| | | private String customerContractNo; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | @Excel(name = "ç¶æ") |
| | | private String statusName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "å¼ç¥¨æ¥æ",width = 30,dateFormat = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "å¼ç¥¨æ¥æ") |
| | | private Date invoiceDate; |
| | | |
| | | @TableField(exist = false) |
| | | private String invoiceDateStart; |
| | | @TableField(exist = false) |
| | | private String invoiceDateEnd; |
| | | |
| | | @ApiModelProperty(value = "æ¥è¯¢ææ¬") |
| | | private String searchText; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/10/31 10:17 |
| | | */ |
| | | @Data |
| | | public class ReceiptPaymentRecordDto { |
| | | |
| | | @ApiModelProperty(value = "客æ·ååå·") |
| | | @Excel(name = "客æ·ååå·") |
| | | private String customerContractNo; |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "ç»è®°æ¥æ",width = 30,dateFormat = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "ç»è®°æ¥æ") |
| | | private Date invoiceDate; |
| | | |
| | | @ApiModelProperty(value = "éå®ååå·") |
| | | @Excel(name = "éå®ååå·") |
| | | private String salesContractNo; |
| | | |
| | | @ApiModelProperty(value = "忬¾éé¢") |
| | | @Excel(name = "忬¾éé¢") |
| | | private BigDecimal receiptPaymentAmountTotal; |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | @Excel(name = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "忬¾å½¢å¼ 0çµæ±1æ¿å
") |
| | | @Excel(name = "忬¾å½¢å¼",readConverterExp = "0=çµæ±,1=æ¿å
") |
| | | private String receiptPaymentType; |
| | | |
| | | @ApiModelProperty(value = "ç»è®°äºº") |
| | | @Excel(name = "ç»è®°äºº") |
| | | private String registrant; |
| | | |
| | | @ApiModelProperty(value = "æ¥æ¬¾æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æ¥æ¬¾æ¥æ",width = 30,dateFormat = "yyyy-MM-dd") |
| | | private LocalDate receiptPaymentDate; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.dto; |
| | | |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.pojo.SalesQuotationProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class SalesQuotationDto extends SalesQuotation { |
| | | @ApiModelProperty(value = "æ¥ä»·åå") |
| | | private List<SalesQuotationProduct> products; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.pojo.PaymentShipping; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 14:00 |
| | | */ |
| | | public interface PaymentShippingMapper extends BaseMapper<PaymentShipping> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param paymentShipping |
| | | * @return |
| | | */ |
| | | IPage<PaymentShipping> listPage(Page page,@Param("req") PaymentShipping paymentShipping); |
| | | } |
| | |
| | | * @param receiptPaymentDto |
| | | * @return |
| | | */ |
| | | IPage<ReceiptPaymentDto> bindInvoiceNoRegPage(Page page, @Param("c") ReceiptPaymentDto receiptPaymentDto); |
| | | IPage<ReceiptPaymentDto> bindInvoiceNoRegPage(Page page, @Param("req") ReceiptPaymentDto receiptPaymentDto); |
| | | |
| | | /** |
| | | * å¼ç¥¨å°è´¦è¯¦æ
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.sales.dto.SalesQuotationDto; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.data.repository.query.Param; |
| | | |
| | | @Mapper |
| | | public interface SalesQuotationMapper extends BaseMapper<SalesQuotation> { |
| | | IPage<SalesQuotationDto> listPage(Page page,@Param("salesQuotationDto") SalesQuotationDto salesQuotationDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.sales.pojo.SalesQuotationProduct; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface SalesQuotationProductMapper extends BaseMapper<SalesQuotationProduct> { |
| | | // List<SalesQuotationProduct> selectBySalesQuotationIds(List<Long> salesQuotationIds); |
| | | |
| | | List<SalesQuotationProduct> selectBySalesQuotationId(@Param("id") Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.pojo.SalespersonManagement; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 10:12 |
| | | */ |
| | | public interface SalespersonManagementMapper extends BaseMapper<SalespersonManagement> { |
| | | |
| | | |
| | | IPage<SalespersonManagement> listPage(Page page,@Param("req") SalespersonManagement salespersonManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.pojo.ShippingInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/10/22 9:32 |
| | | */ |
| | | public interface ShippingInfoMapper extends BaseMapper<ShippingInfo> { |
| | | IPage<ShippingInfo> listPage(Page page,@Param("req") ShippingInfo req); |
| | | |
| | | List<ShippingInfo> listAll(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 13:56 |
| | | */ |
| | | @TableName(value = "payment_shipping") |
| | | @Data |
| | | @ApiModel |
| | | public class PaymentShipping { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "订åå·") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | private String customer; |
| | | |
| | | @ApiModelProperty(value = "订åéé¢") |
| | | private String orderAmount; |
| | | |
| | | @ApiModelProperty(value = "已仿¬¾éé¢") |
| | | private String paidAmount; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾ç¶æ") |
| | | private String paymentStatus; |
| | | |
| | | @ApiModelProperty(value = "åè´§ç¶æ") |
| | | private String shippingStatus; |
| | | |
| | | @ApiModelProperty(value = "åè´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date shippingDate; |
| | | |
| | | @ApiModelProperty(value = "ç©æµåå·") |
| | | private String trackingNo; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @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 Long tenantId; |
| | | |
| | | } |
| | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "æªå¼ç¥¨éé¢(å
)") |
| | | private BigDecimal noInvoiceAmountTotal; |
| | | @Excel(name = "æªå¼ç¥¨éé¢") |
| | | private BigDecimal noInvoiceAmountTotal = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "ç¾è®¢æ¥æ") |
| | | private LocalDate executionDate; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å·²å¼ç¥¨éé¢(å
)") |
| | | private BigDecimal invoiceTotal; |
| | | @Excel(name = "å·²å¼ç¥¨éé¢") |
| | | private BigDecimal invoiceTotal = BigDecimal.ZERO; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "忬¾éé¢") |
| | | private BigDecimal receiptPaymentAmountTotal = BigDecimal.ZERO; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å¾
忬¾éé¢") |
| | | private BigDecimal noReceiptAmount = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | |
| | | private Long salesLedgerId; |
| | | |
| | | /** |
| | | * é¢è¦æ°é |
| | | */ |
| | | private BigDecimal warnNum; |
| | | |
| | | /** |
| | | * 产å大类 |
| | | */ |
| | | @Excel(name = "产å大类") |
| | |
| | | */ |
| | | @Excel(name = "æ°é") |
| | | private BigDecimal quantity; |
| | | |
| | | @Excel(name = "æä½åºåæ°é") |
| | | private BigDecimal minStock; |
| | | /** |
| | | * ç¨ç |
| | | */ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("sales_quotation") |
| | | public class SalesQuotation { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | @ApiModelProperty(value = "æ¥ä»·åç¼å·") |
| | | @Excel(name = "æ¥ä»·åç¼å·") |
| | | private String quotationNo; |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customer; |
| | | |
| | | @ApiModelProperty(value = "ä¸å¡å") |
| | | @Excel(name = "ä¸å¡å") |
| | | private String salesperson; |
| | | @ApiModelProperty(value = "æ¥ä»·æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æ¥ä»·æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate quotationDate; |
| | | @ApiModelProperty(value = "æææè³") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "æææè³", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private LocalDate validDate; |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | @ApiModelProperty(value = "äº¤è´§å¨æå¤©æ°") |
| | | private String deliveryPeriod; |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | private String status; |
| | | @ApiModelProperty(value = "æ¥ä»·æ»éé¢") |
| | | @Excel(name = "æ¥ä»·éé¢") |
| | | private Double totalAmount; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | @TableName("sales_quotation_product") |
| | | public class SalesQuotationProduct { |
| | | @ApiModelProperty(value = "æ¥ä»·ååID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | @ApiModelProperty(value = "é宿¥ä»·åid") |
| | | private Long salesQuotationId; |
| | | |
| | | @ApiModelProperty(value = "åååç§°") |
| | | private String product; |
| | | @ApiModelProperty(value = "ååè§æ ¼") |
| | | private String specification; |
| | | @ApiModelProperty(value = "åä½") |
| | | private String unit; |
| | | @ApiModelProperty(value = "åä»·") |
| | | private Double unitPrice; |
| | | @ApiModelProperty(value = "æ°é") |
| | | private Integer quantity; |
| | | @ApiModelProperty(value = "éé¢") |
| | | private Double amount; |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 10:06 |
| | | */ |
| | | @TableName(value = "salesperson_management") |
| | | @Data |
| | | @ApiModel |
| | | public class SalespersonManagement { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "å§å") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "èç³»çµè¯") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "é®ç®±") |
| | | private String email; |
| | | |
| | | @ApiModelProperty(value = "é¨é¨") |
| | | private String department; |
| | | |
| | | @ApiModelProperty(value = "èä½") |
| | | private String position; |
| | | |
| | | @ApiModelProperty(value = "å
¥èæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date hireDate; |
| | | |
| | | @ApiModelProperty(value = "æé") |
| | | private String permissions; |
| | | |
| | | @ApiModelProperty(value = "æéList") |
| | | @TableField(exist = false) |
| | | private List<String> permissionsList; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ") |
| | | private String status; |
| | | |
| | | @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 Long tenantId; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | 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 org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/10/22 9:29 |
| | | */ |
| | | @Data |
| | | @TableName("shipping_info") |
| | | public class ShippingInfo { |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "éå®å°è´¦id") |
| | | private Long salesLedgerId; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "éå®ååå·") |
| | | @Excel(name = "éå®ååå·") |
| | | private String salesContractNo; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | @Excel(name = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @ApiModelProperty(value = "åè´§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @Excel(name = "åè´§æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date shippingDate; |
| | | |
| | | @ApiModelProperty(value = "å货车çå·") |
| | | @Excel(name = "å货车çå·") |
| | | private String shippingCarNumber; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.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.sales.pojo.PaymentShipping; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 14:01 |
| | | */ |
| | | public interface PaymentShippingService extends IService<PaymentShipping> { |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param page |
| | | * @param paymentShipping |
| | | * @return |
| | | */ |
| | | IPage<PaymentShipping> listPage(Page page, PaymentShipping paymentShipping); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.sales.pojo.SalesQuotationProduct; |
| | | |
| | | |
| | | public interface SalesQuotationProductService extends IService<SalesQuotationProduct> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.sales.dto.SalesQuotationDto; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | public interface SalesQuotationService extends IService<SalesQuotation> { |
| | | IPage listPage(Page page, SalesQuotationDto salesQuotationDto); |
| | | |
| | | boolean add(SalesQuotationDto salesQuotationDto); |
| | | |
| | | boolean delete(Long id); |
| | | |
| | | boolean edit(SalesQuotationDto salesQuotationDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.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.sales.pojo.SalespersonManagement; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 10:14 |
| | | */ |
| | | public interface SalespersonManagementService extends IService<SalespersonManagement> { |
| | | |
| | | /** |
| | | * å表å页 |
| | | * |
| | | * @param page |
| | | * @param salespersonManagement |
| | | * @return |
| | | */ |
| | | IPage<SalespersonManagement> listPage(Page page, SalespersonManagement salespersonManagement); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.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.sales.pojo.ShippingInfo; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/10/22 9:33 |
| | | */ |
| | | public interface ShippingInfoService extends IService<ShippingInfo>{ |
| | | IPage<ShippingInfo> listPage(Page page, ShippingInfo req); |
| | | } |
| | |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | 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.mapper.PaymentShippingMapper; |
| | | import com.ruoyi.sales.pojo.PaymentShipping; |
| | | import com.ruoyi.sales.service.PaymentShippingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 14:01 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class PaymentShippingServiceImpl extends ServiceImpl<PaymentShippingMapper, PaymentShipping> implements PaymentShippingService { |
| | | |
| | | @Autowired |
| | | private PaymentShippingMapper paymentShippingMapper; |
| | | |
| | | @Override |
| | | public IPage<PaymentShipping> listPage(Page page, PaymentShipping paymentShipping) { |
| | | IPage<PaymentShipping> listPage = paymentShippingMapper.listPage(page, paymentShipping); |
| | | return listPage; |
| | | } |
| | | } |
| | |
| | | if (receiptPaymentDto.getStatus()) { |
| | | receiptPaymentDtoIPage.getRecords().removeIf(receiptPaymentDto1 -> new BigDecimal("0.00").equals(receiptPaymentDto1.getNoReceiptAmount())); |
| | | } |
| | | receiptPaymentDtoIPage.getRecords().forEach(item -> { |
| | | // æ¯è¾å款éé¢ == å¾
忬¾éé¢ |
| | | if (item.getInvoiceTotal().compareTo(item.getReceiptPaymentAmountTotal()) == 0) { |
| | | item.setStatusName("已宿忬¾"); |
| | | }else{ |
| | | item.setStatusName("æªå®æå款"); |
| | | } |
| | | |
| | | }); |
| | | return receiptPaymentDtoIPage; |
| | | } |
| | | |
| | |
| | | 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.account.pojo.AccountExpense; |
| | | import com.ruoyi.account.pojo.AccountIncome; |
| | | import com.ruoyi.account.service.AccountIncomeService; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | |
| | | @RequiredArgsConstructor |
| | | @Slf4j |
| | | public class SalesLedgerServiceImpl extends ServiceImpl<SalesLedgerMapper, SalesLedger> implements ISalesLedgerService { |
| | | private final AccountIncomeService accountIncomeService; |
| | | |
| | | private final SalesLedgerMapper salesLedgerMapper; |
| | | |
| | |
| | | salesLedger.setCustomerName(customer.getCustomerName()); |
| | | salesLedger.setTenantId(customer.getTenantId()); |
| | | |
| | | AccountIncome accountIncome = new AccountIncome(); |
| | | accountIncome.setIncomeDate(salesLedger.getEntryDate()); |
| | | accountIncome.setIncomeType("0"); |
| | | accountIncome.setCustomerName(customer.getCustomerName()); |
| | | accountIncome.setIncomeMoney(salesLedger.getContractAmount()); |
| | | accountIncome.setIncomeMethod("0"); |
| | | accountIncome.setInputTime(new Date()); |
| | | accountIncome.setInputUser(salesLedger.getEntryPerson()); |
| | | // 3. æ°å¢ææ´æ°ä¸»è¡¨ |
| | | if (salesLedger.getId() == null) { |
| | | String contractNo = generateSalesContractNo(); |
| | | salesLedger.setSalesContractNo(contractNo); |
| | | salesLedgerMapper.insert(salesLedger); |
| | | accountIncome.setIncomeDescribed("éå®ååï¼" + salesLedger.getSalesContractNo()); |
| | | accountIncome.setInvoiceNumber(salesLedger.getSalesContractNo()); |
| | | accountIncomeService.save(accountIncome); |
| | | } else { |
| | | salesLedgerMapper.updateById(salesLedger); |
| | | SalesLedger salesLedgerDB = salesLedgerMapper.selectById(salesLedger.getId()); |
| | | List<AccountIncome> accountIncomeDBs = accountIncomeService.getByInvoiceNumberList(salesLedger.getSalesContractNo()); |
| | | if (!CollectionUtils.isEmpty(accountIncomeDBs)) { |
| | | accountIncomeDBs.forEach(accountIncomeDB ->{ |
| | | accountIncomeDB.setCustomerName(salesLedgerDB.getCustomerName()); |
| | | accountIncomeDB.setIncomeMoney(salesLedgerDB.getContractAmount()); |
| | | accountIncomeDB.setIncomeDescribed("éå®ååï¼" + salesLedgerDB.getSalesContractNo()); |
| | | accountIncomeDB.setInvoiceNumber(salesLedgerDB.getSalesContractNo()); |
| | | accountIncomeDB.setInputTime(new Date()); |
| | | accountIncomeDB.setInputUser(salesLedgerDB.getEntryPerson()); |
| | | accountIncomeService.updateById(accountIncomeDB); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | // 4. å¤çåè¡¨æ°æ® |
| | |
| | | |
| | | try { |
| | | // æ§è¡æä»¶è¿ç§»ï¼ä½¿ç¨ååæä½ç¡®ä¿å®å
¨æ§ï¼ |
| | | Files.move( |
| | | Paths.get(tempFile.getTempPath()), |
| | | formalFilePath, |
| | | StandardCopyOption.REPLACE_EXISTING, |
| | | StandardCopyOption.ATOMIC_MOVE |
| | | ); |
| | | // Files.move( |
| | | // Paths.get(tempFile.getTempPath()), |
| | | // formalFilePath, |
| | | // StandardCopyOption.REPLACE_EXISTING, |
| | | // StandardCopyOption.ATOMIC_MOVE |
| | | // ); |
| | | // ååç§»å¨å¤±è´¥ï¼ä½¿ç¨å¤å¶+å é¤ |
| | | Files.copy(Paths.get(tempFile.getTempPath()), formalFilePath, StandardCopyOption.REPLACE_EXISTING); |
| | | Files.deleteIfExists(Paths.get(tempFile.getTempPath())); |
| | | log.info("æä»¶è¿ç§»æå: {} -> {}", tempFile.getTempPath(), formalFilePath); |
| | | |
| | | // æ´æ°æä»¶è®°å½ï¼å
³èå°ä¸å¡IDï¼ |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesQuotationProduct; |
| | | import com.ruoyi.sales.service.SalesQuotationProductService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class SalesQuotationProductServiceImpl extends ServiceImpl<SalesQuotationProductMapper, SalesQuotationProduct> implements SalesQuotationProductService { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.sales.dto.SalesQuotationDto; |
| | | import com.ruoyi.sales.mapper.SalesQuotationMapper; |
| | | import com.ruoyi.sales.mapper.SalesQuotationProductMapper; |
| | | import com.ruoyi.sales.pojo.SalesQuotation; |
| | | import com.ruoyi.sales.pojo.SalesQuotationProduct; |
| | | import com.ruoyi.sales.service.SalesQuotationProductService; |
| | | import com.ruoyi.sales.service.SalesQuotationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class SalesQuotationServiceImpl extends ServiceImpl<SalesQuotationMapper, SalesQuotation> implements SalesQuotationService { |
| | | @Autowired |
| | | private SalesQuotationMapper salesQuotationMapper; |
| | | @Autowired |
| | | private SalesQuotationProductMapper salesQuotationProductMapper; |
| | | @Autowired |
| | | private SalesQuotationProductService salesQuotationProductService; |
| | | @Override |
| | | public IPage<SalesQuotationDto> listPage(Page page, SalesQuotationDto salesQuotationDto) { |
| | | IPage<SalesQuotationDto> salesQuotationDtoIPage = salesQuotationMapper.listPage(page, salesQuotationDto); |
| | | if(CollectionUtils.isEmpty(salesQuotationDtoIPage.getRecords())){ |
| | | return salesQuotationDtoIPage; |
| | | } |
| | | salesQuotationDtoIPage.getRecords().forEach(record -> { |
| | | List<SalesQuotationProduct> products = salesQuotationProductMapper.selectBySalesQuotationId(record.getId()); |
| | | record.setProducts(products); |
| | | }); |
| | | return salesQuotationDtoIPage; |
| | | } |
| | | |
| | | @Override |
| | | public boolean add(SalesQuotationDto salesQuotationDto) { |
| | | SalesQuotation salesQuotation = new SalesQuotation(); |
| | | BeanUtils.copyProperties(salesQuotationDto, salesQuotation); |
| | | String quotationNo = salesQuotation.getQuotationNo(); |
| | | salesQuotationMapper.insert(salesQuotation); |
| | | // if(salesQuotationMapper.insert(salesQuotation)!=1){ |
| | | // return false; |
| | | // } |
| | | if(CollectionUtils.isEmpty(salesQuotationDto.getProducts())){ |
| | | return true; |
| | | } |
| | | List<SalesQuotationProduct> products = salesQuotationDto.getProducts().stream().map(product -> { |
| | | SalesQuotationProduct salesQuotationProduct = new SalesQuotationProduct(); |
| | | BeanUtils.copyProperties(product, salesQuotationProduct); |
| | | salesQuotationProduct.setSalesQuotationId(salesQuotationMapper.selectOne(new LambdaQueryWrapper<SalesQuotation>().eq(SalesQuotation::getQuotationNo, quotationNo)).getId()); |
| | | return salesQuotationProduct; |
| | | }).collect(Collectors.toList()); |
| | | salesQuotationProductService.saveBatch(products); |
| | | return true; |
| | | } |
| | | @Override |
| | | public boolean edit(SalesQuotationDto salesQuotationDto) { |
| | | SalesQuotation salesQuotation = new SalesQuotation(); |
| | | BeanUtils.copyProperties(salesQuotationDto, salesQuotation); |
| | | if(salesQuotationMapper.updateById(salesQuotation)!=1){ |
| | | return false; |
| | | } |
| | | salesQuotationProductMapper.delete(new LambdaQueryWrapper<SalesQuotationProduct>().eq(SalesQuotationProduct::getSalesQuotationId, salesQuotationDto.getId())); |
| | | if(CollectionUtils.isEmpty(salesQuotationDto.getProducts())){ |
| | | return true; |
| | | } |
| | | List<SalesQuotationProduct> products = salesQuotationDto.getProducts().stream().map(product -> { |
| | | SalesQuotationProduct salesQuotationProduct = new SalesQuotationProduct(); |
| | | BeanUtils.copyProperties(product, salesQuotationProduct); |
| | | salesQuotationProduct.setSalesQuotationId(salesQuotation.getId()); |
| | | return salesQuotationProduct; |
| | | }).collect(Collectors.toList()); |
| | | salesQuotationProductService.saveBatch(products); |
| | | return true; |
| | | } |
| | | @Override |
| | | public boolean delete(Long id) { |
| | | salesQuotationMapper.deleteById(id); |
| | | salesQuotationProductMapper.delete(new LambdaQueryWrapper<SalesQuotationProduct>().eq(SalesQuotationProduct::getSalesQuotationId, id)); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | 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.common.utils.StringUtils; |
| | | import com.ruoyi.sales.mapper.SalespersonManagementMapper; |
| | | import com.ruoyi.sales.pojo.SalespersonManagement; |
| | | import com.ruoyi.sales.service.SalespersonManagementService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/15 10:15 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class SalespersonManagementServiceImpl extends ServiceImpl<SalespersonManagementMapper, SalespersonManagement> implements SalespersonManagementService { |
| | | |
| | | @Autowired |
| | | private SalespersonManagementMapper salespersonManagementMapper; |
| | | |
| | | @Override |
| | | public IPage<SalespersonManagement> listPage(Page page, SalespersonManagement salespersonManagement) { |
| | | IPage<SalespersonManagement> salespersonManagementIPage = salespersonManagementMapper.listPage(page, salespersonManagement); |
| | | salespersonManagementIPage.getRecords().forEach(item -> { |
| | | if(!StringUtils.isEmpty(item.getPermissions())){ |
| | | item.setPermissionsList(Arrays.asList(item.getPermissions().split(","))); |
| | | } |
| | | }); |
| | | return salespersonManagementIPage; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.service.impl; |
| | | |
| | | 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.mapper.ShippingInfoMapper; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.service.ShippingInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/10/22 9:33 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class ShippingInfoServiceImpl extends ServiceImpl<ShippingInfoMapper, ShippingInfo> implements ShippingInfoService { |
| | | |
| | | @Autowired |
| | | private ShippingInfoMapper shippingInfoMapper; |
| | | |
| | | @Override |
| | | public IPage<ShippingInfo> listPage(Page page, ShippingInfo req) { |
| | | IPage<ShippingInfo> listPage = shippingInfoMapper.listPage(page, req); |
| | | |
| | | return listPage; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.HolidayApplicationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/staff/holidayApplication") |
| | | public class HolidayApplicationController { |
| | | @Autowired |
| | | private HolidayApplicationService holidayApplicationService; |
| | | /** |
| | | * 请åç³è¯·å页æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, HolidayApplication holidayApplication){ |
| | | return AjaxResult.success(holidayApplicationService.listPage(page, holidayApplication)); |
| | | } |
| | | /** |
| | | * æ°å¢è¯·åç³è¯· |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody HolidayApplication holidayApplication){ |
| | | return AjaxResult.success(holidayApplicationService.save(holidayApplication)); |
| | | } |
| | | /** |
| | | * ä¿®æ¹è¯·åç³è¯· |
| | | */ |
| | | @PostMapping("/update") |
| | | public AjaxResult update(@RequestBody HolidayApplication holidayApplication){ |
| | | return AjaxResult.success(holidayApplicationService.updateById(holidayApplication)); |
| | | } |
| | | /** |
| | | * å é¤è¯·åç³è¯· |
| | | */ |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable("id") Long id){ |
| | | return AjaxResult.success(holidayApplicationService.removeById(id)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.pojo.StaffJoinLeaveRecord; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @AllArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/staff/personalAttendanceRecords") |
| | | public class PersonalAttendanceRecordsController { |
| | | @Autowired |
| | | private PersonalAttendanceRecordsService personalAttendanceRecordsService; |
| | | /** |
| | | * 个人èå¤è®°å½å页æ¥è¯¢ |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult personalAttendanceRecordsListPage(Page page, PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.listPage(page, personalAttendanceRecords)); |
| | | } |
| | | /** |
| | | * æ°å¢ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.save(personalAttendanceRecords)); |
| | | } |
| | | /** |
| | | * ä¿®æ¹ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody PersonalAttendanceRecords personalAttendanceRecords) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.updateById(personalAttendanceRecords)); |
| | | } |
| | | /** |
| | | * å é¤ä¸ªäººèå¤è®°å½ |
| | | */ |
| | | @DeleteMapping("/delete/{id}") |
| | | public AjaxResult delete(@PathVariable("id") Long id) { |
| | | return AjaxResult.success(personalAttendanceRecordsService.removeById(id)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.staff.pojo.StaffJoinLeaveRecord; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | |
| | | import com.ruoyi.staff.service.IStaffOnJobService; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | public AjaxResult staffOnJobDetail(String staffNo) { |
| | | return AjaxResult.success(staffOnJobService.staffOnJobDetail(staffNo)); |
| | | } |
| | | /** |
| | | * å¨èå工导å
¥ |
| | | */ |
| | | @PostMapping("/import") |
| | | @Log(title = "å¨èå工导å
¥", businessType = BusinessType.IMPORT) |
| | | public AjaxResult importData(@RequestPart("file") MultipartFile file) { |
| | | Boolean b = staffOnJobService.importData(file); |
| | | if (b) { |
| | | return AjaxResult.success("导å
¥æå"); |
| | | } |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * å¨èåå·¥å¯¼åº |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.compensationperformance.pojo.CompensationPerformance; |
| | | 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.staff.dto.SaveStaffSchedulingDto; |
| | | import com.ruoyi.staff.dto.StaffSchedulingDto; |
| | | import com.ruoyi.staff.service.StaffSchedulingService; |
| | | import com.ruoyi.staff.vo.SearchSchedulingVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æç |
| | | * @author buhuazhen |
| | | * @date 2025/9/3 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staff/staffScheduling") |
| | | @RequiredArgsConstructor |
| | | public class StaffSchedulingController { |
| | | |
| | | private final StaffSchedulingService staffSchedulingService; |
| | | |
| | | @PostMapping("/listPage") |
| | | public AjaxResult listPage(@RequestBody SearchSchedulingVo vo){ |
| | | return AjaxResult.success(staffSchedulingService.listPage(vo)); |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | public AjaxResult save(@RequestBody @Validated SaveStaffSchedulingDto saveStaffSchedulingDto){ |
| | | staffSchedulingService.saveStaffScheduling(saveStaffSchedulingDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @DeleteMapping("/delByIds") |
| | | public AjaxResult delByIds(@RequestBody List<Integer> ids){ |
| | | staffSchedulingService.removeByIds(ids); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @DeleteMapping("/del/{id}") |
| | | public AjaxResult del(@PathVariable("id") Integer id){ |
| | | staffSchedulingService.removeById(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Log(title = "导åºäººåæçå表", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response ) { |
| | | SearchSchedulingVo vo = new SearchSchedulingVo(); |
| | | vo.setCurrent(-1); |
| | | vo.setSize(-1); |
| | | IPage<StaffSchedulingDto> list = staffSchedulingService.listPage(vo); |
| | | ExcelUtil<StaffSchedulingDto> util = new ExcelUtil<StaffSchedulingDto>(StaffSchedulingDto.class); |
| | | util.exportExcel(response, list.getRecords(), "导åºäººåæçå表"); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/3 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SaveStaffSchedulingDto implements Serializable { |
| | | private Integer id; |
| | | |
| | | @NotNull(message = "å¿
é¡»è¦éæ©åå·¥") |
| | | private Integer staffId; |
| | | |
| | | @NotNull(message = "é¨é¨idä¸è½ä¸ºç©º!") |
| | | private Integer department; |
| | | |
| | | @NotNull(message = "çæ¬¡idä¸è½ä¸ºç©º!") |
| | | private Integer shiftType; |
| | | |
| | | @NotNull(message = "工使¥ä¸è½ä¸ºç©º!") |
| | | private Date workDate; |
| | | |
| | | @NotNull(message = "ä¸çæ¶é´ä¸è½ä¸ºç©º!") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime workStartTime; |
| | | |
| | | @NotNull(message = "ä¸çæ¶é´ä¸è½ä¸ºç©º!") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime workEndTime; |
| | | |
| | | @NotNull(message = "å·¥æ¶ä¸è½ä¸ºç©º!") |
| | | private Integer status; |
| | | |
| | | private String remark; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/4 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | public class StaffSchedulingDto implements Serializable { |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * åå·¥ID |
| | | */ |
| | | private Integer staffId; |
| | | |
| | | @Excel(name = "åå·¥åç§°") |
| | | private String staffName; |
| | | |
| | | @Excel(name = "åå·¥ç¼å·") |
| | | private String staffNo; |
| | | |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | @Excel(name = "é¨é¨åç§°") |
| | | private String department; |
| | | |
| | | /** |
| | | * æçç±»å |
| | | */ |
| | | @Excel(name = "çæ¬¡åç§°", readConverterExp = "1=æ©ç,2=ä¸ç,3=æç,4=å¤çç") |
| | | private String shiftType; |
| | | |
| | | /** |
| | | * 工使¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @Excel(name = "工使¥æ", dateFormat = "yyyy-MM-dd", width = 20) |
| | | private Date workDate; |
| | | |
| | | /** |
| | | * å¼å§å·¥ä½æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Excel(name = "å¼å§å·¥ä½æ¶é´", dateFormat = "mm:ss", width = 20) |
| | | private LocalDateTime workStartTime; |
| | | |
| | | /** |
| | | * ç»æå·¥ä½æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Excel(name = "ç»æå·¥ä½æ¶é´", dateFormat = "mm:ss", width = 20) |
| | | private LocalDateTime workEndTime; |
| | | |
| | | /** |
| | | * 工使¶é¿ |
| | | */ |
| | | @Excel(name = "工使¶é¿", width = 20) |
| | | private BigDecimal workHours; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @Excel(name = "ç¶æ", readConverterExp = "1=已宿,2=已确认,3=已宿,4=已忶") |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface HolidayApplicationMapper extends BaseMapper<HolidayApplication> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | @Mapper |
| | | public interface PersonalAttendanceRecordsMapper extends BaseMapper<PersonalAttendanceRecords> { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.staff.dto.StaffSchedulingDto; |
| | | import com.ruoyi.staff.pojo.StaffScheduling; |
| | | import com.ruoyi.staff.vo.SearchSchedulingVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãstaff_schedulingãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-09-03 14:50:34 |
| | | * @Entity generator.domain.StaffScheduling |
| | | */ |
| | | public interface StaffSchedulingMapper extends BaseMapper<StaffScheduling> { |
| | | |
| | | IPage<StaffSchedulingDto> listPage(IPage page, @Param("vo") SearchSchedulingVo vo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalTime; |
| | | |
| | | @Data |
| | | @TableName("holiday_application") |
| | | public class HolidayApplication { |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * åå·¥id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long staffId; |
| | | /** |
| | | * åæç±»å |
| | | */ |
| | | private String type; |
| | | /** |
| | | * å¼å§æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate startDate; |
| | | /** |
| | | * ç»ææ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate endDate; |
| | | |
| | | /** |
| | | * åæå¤©æ° |
| | | */ |
| | | private Integer days; |
| | | /** |
| | | * ç³è¯·çç± |
| | | */ |
| | | private String reason; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalTime; |
| | | |
| | | @Data |
| | | @TableName("personal_attendance_records") |
| | | public class PersonalAttendanceRecords implements Serializable { |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * æ¥æ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate date; |
| | | /** |
| | | * ç¾å°æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime checkIn; |
| | | /** |
| | | * ç¾éæ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime checkOut; |
| | | /** |
| | | * 工使¶é¿ |
| | | */ |
| | | private String workHours; |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | private String status; |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| | |
| | | private Integer staffState; |
| | | |
| | | /** |
| | | * è¯ç¨æï¼æï¼ |
| | | */ |
| | | @Excel(name = "è¯ç¨æï¼æï¼") |
| | | private Integer probationPeriod; |
| | | |
| | | |
| | | |
| | | /** |
| | | * åå·¥ç¼å· |
| | | */ |
| | | @Excel(name = "åå·¥ç¼å·") |
| | |
| | | /** |
| | | * åå·¥ç¼å· |
| | | */ |
| | | @Excel(name = "åå·¥ç¼å·") |
| | | @Excel(name = "åå·¥ç¼å·", type = Excel.Type.EXPORT, cellType = Excel.ColumnType.STRING) |
| | | private String staffNo; |
| | | |
| | | /** |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @TableName staff_scheduling |
| | | */ |
| | | @TableName(value ="staff_scheduling") |
| | | @Data |
| | | public class StaffScheduling { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * åå·¥ID |
| | | */ |
| | | @TableField(value = "staff_id") |
| | | private Integer staffId; |
| | | |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | @TableField(value = "department") |
| | | private Integer department; |
| | | |
| | | /** |
| | | * æçç±»å |
| | | */ |
| | | @TableField(value = "shift_type") |
| | | private Integer shiftType; |
| | | |
| | | /** |
| | | * 工使¥æ |
| | | */ |
| | | @TableField(value = "work_date") |
| | | private Date workDate; |
| | | |
| | | /** |
| | | * å¼å§å·¥ä½æ¶é´ |
| | | */ |
| | | @TableField(value = "work_start_time") |
| | | private LocalDateTime workStartTime; |
| | | |
| | | /** |
| | | * ç»æå·¥ä½æ¶é´ |
| | | */ |
| | | @TableField(value = "work_end_time") |
| | | private LocalDateTime workEndTime; |
| | | |
| | | /** |
| | | * 工使¶é¿ |
| | | */ |
| | | @TableField(value = "work_hours") |
| | | private BigDecimal workHours; |
| | | |
| | | /** |
| | | * ç¶æ |
| | | */ |
| | | @TableField(value = "status") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @TableField(value = "remark") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(value = "create_user",fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(value = "tenant_id",fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.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.staff.pojo.HolidayApplication; |
| | | |
| | | public interface HolidayApplicationService extends IService<HolidayApplication> { |
| | | IPage listPage(Page page, HolidayApplication holidayApplication); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.staff.pojo.StaffJoinLeaveRecord; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | |
| | | void staffOnJobExport(HttpServletResponse response, StaffOnJob staffOnJob); |
| | | |
| | | List<StaffJoinLeaveRecord> staffOnJobList(); |
| | | |
| | | Boolean importData(MultipartFile file); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.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.staff.pojo.PersonalAttendanceRecords; |
| | | |
| | | public interface PersonalAttendanceRecordsService extends IService<PersonalAttendanceRecords> { |
| | | IPage listPage(Page page, PersonalAttendanceRecords personalAttendanceRecords); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.staff.dto.SaveStaffSchedulingDto; |
| | | import com.ruoyi.staff.dto.StaffSchedulingDto; |
| | | import com.ruoyi.staff.pojo.StaffScheduling; |
| | | import com.ruoyi.staff.vo.SearchSchedulingVo; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãstaff_schedulingãçæ°æ®åºæä½Service |
| | | * @createDate 2025-09-03 14:50:34 |
| | | */ |
| | | public interface StaffSchedulingService extends IService<StaffScheduling> { |
| | | |
| | | void saveStaffScheduling(SaveStaffSchedulingDto saveStaffSchedulingDto); |
| | | |
| | | IPage<StaffSchedulingDto> listPage(SearchSchedulingVo vo); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.staff.mapper.HolidayApplicationMapper; |
| | | import com.ruoyi.staff.pojo.HolidayApplication; |
| | | import com.ruoyi.staff.service.HolidayApplicationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class HolidayApplicationServiceImpl extends ServiceImpl<HolidayApplicationMapper, HolidayApplication> implements HolidayApplicationService { |
| | | @Autowired |
| | | private HolidayApplicationMapper holidayApplicationMapper; |
| | | |
| | | @Override |
| | | public IPage listPage(Page page, HolidayApplication holidayApplication) { |
| | | return holidayApplicationMapper.selectPage(page, new QueryWrapper<>(holidayApplication)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class PersonalAttendanceRecordsServiceImpl extends ServiceImpl<PersonalAttendanceRecordsMapper, PersonalAttendanceRecords> implements PersonalAttendanceRecordsService { |
| | | @Autowired |
| | | private PersonalAttendanceRecordsMapper personalAttendanceRecordsMapper; |
| | | |
| | | @Override |
| | | public IPage listPage(Page page, PersonalAttendanceRecords personalAttendanceRecords) { |
| | | // return personalAttendanceRecordsMapper.ListPage(page, personalAttendanceRecords); |
| | | return baseMapper.selectPage(page, new QueryWrapper<>(personalAttendanceRecords)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.staff.service.IStaffOnJobService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | return staffJoinLeaveRecordMapper.staffOnJobList(); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean importData(MultipartFile file) { |
| | | try { |
| | | ExcelUtil<StaffOnJob> util = new ExcelUtil<>(StaffOnJob.class); |
| | | List<StaffOnJob> staffOnJobs = util.importExcel(file.getInputStream()); |
| | | return saveOrUpdateBatch(staffOnJobs); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | 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.staff.dto.SaveStaffSchedulingDto; |
| | | import com.ruoyi.staff.dto.StaffSchedulingDto; |
| | | import com.ruoyi.staff.mapper.StaffSchedulingMapper; |
| | | import com.ruoyi.staff.pojo.StaffScheduling; |
| | | import com.ruoyi.staff.service.StaffSchedulingService; |
| | | import com.ruoyi.staff.vo.SearchSchedulingVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.Duration; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãstaff_schedulingãçæ°æ®åºæä½Serviceå®ç° |
| | | * @createDate 2025-09-03 14:50:34 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class StaffSchedulingServiceImpl extends ServiceImpl<StaffSchedulingMapper, StaffScheduling> |
| | | implements StaffSchedulingService { |
| | | |
| | | private final StaffSchedulingMapper staffSchedulingMapper; |
| | | |
| | | @Lazy |
| | | @Resource |
| | | private StaffSchedulingService staffSchedulingService; |
| | | |
| | | @Override |
| | | public void saveStaffScheduling(SaveStaffSchedulingDto saveStaffSchedulingDto) { |
| | | StaffScheduling staffScheduling = new StaffScheduling(); |
| | | BeanUtils.copyProperties(saveStaffSchedulingDto, staffScheduling); |
| | | // å¼å§è®¡ç®æ¶é´ |
| | | Duration duration = Duration.between(staffScheduling.getWorkStartTime(), staffScheduling.getWorkEndTime()); |
| | | long hours = duration.toHours(); |
| | | // 0.5 |
| | | double minutes = (duration.toMinutes() % 60) / 60.0; |
| | | // minutes = minutes < 0.5 ? 0 : 0.5; å
¬å¸ä¸è¬ä»¥0.5为æ åè®¡ç® |
| | | staffScheduling.setWorkHours(BigDecimal.valueOf(hours + minutes)); |
| | | staffSchedulingService.saveOrUpdate(staffScheduling); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<StaffSchedulingDto> listPage(SearchSchedulingVo vo) { |
| | | Page<StaffScheduling> page = new Page<>(vo.getCurrent(), vo.getSize()); |
| | | |
| | | return staffSchedulingMapper.listPage(page, vo); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.vo; |
| | | |
| | | import com.ruoyi.dto.PageDto; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2025/9/3 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SearchSchedulingVo extends PageDto { |
| | | |
| | | private String staffName; |
| | | |
| | | private String shiftType; |
| | | |
| | | private LocalDate startDate; |
| | | |
| | | private LocalDate endDate; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | | 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.warehouse.dto.DocumentClassificationDto; |
| | | import com.ruoyi.warehouse.dto.DocumentClassificationTreeDto; |
| | | import com.ruoyi.warehouse.pojo.DocumentClassification; |
| | | import com.ruoyi.warehouse.service.DocumentClassificationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "ææ¡£åç±»") |
| | | @RequestMapping("/warehouse/documentClassification") |
| | | public class DocumentClassificationController extends BaseController { |
| | | @Autowired |
| | | private DocumentClassificationService documentClassificationService; |
| | | //æ ç»æ |
| | | @GetMapping("/getList") |
| | | public AjaxResult getList() { |
| | | return AjaxResult.success(documentClassificationService.selectDocumentClassificationList()); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("ææ¡£åç±»-æ·»å ") |
| | | @Log(title = "ææ¡£åç±»-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody DocumentClassification documentClassification) { |
| | | return AjaxResult.success(documentClassificationService.save(documentClassification)); |
| | | } |
| | | @PutMapping("/update") |
| | | @ApiOperation("ææ¡£åç±»-æ´æ°") |
| | | @Log(title = "ææ¡£åç±»-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody DocumentClassification documentClassification) { |
| | | return AjaxResult.success(documentClassificationService.updateById(documentClassification)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("ææ¡£åç±»å é¤") |
| | | @Log(title = "ææ¡£åç±»å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentClassificationService.deleteByIds(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | 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.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.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | |
| | | import com.ruoyi.warehouse.mapper.DocumentationBorrowManagementMapper; |
| | | import com.ruoyi.warehouse.mapper.DocumentationReturnManagementMapper; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import com.ruoyi.warehouse.pojo.DocumentationReturnManagement; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.service.DocumentationBorrowManagementService; |
| | | import com.ruoyi.warehouse.service.WarehouseService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "ææ¡£åé
管ç") |
| | | @RequestMapping("/documentationBorrowManagement") |
| | | public class DocumentationBorrowManagementController extends BaseController { |
| | | @Autowired |
| | | private DocumentationBorrowManagementService documentationBorrowManagementService; |
| | | @Autowired |
| | | private DocumentationBorrowManagementMapper documentationBorrowManagementMapper; |
| | | @Autowired |
| | | private DocumentationReturnManagementMapper documentationReturnManagementMapper; |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("ææ¡£åé
管ç-åé
å页æ¥è¯¢") |
| | | @Log(title = "ææ¡£åé
管ç-åé
å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.listPage(page, documentationBorrowManagement)); |
| | | } |
| | | @GetMapping("/list") |
| | | @ApiOperation("ææ¡£åé
管ç-åé
æ¥è¯¢") |
| | | @Log(title = "ææ¡£åé
管ç-åé
æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list() { |
| | | return AjaxResult.success(documentationBorrowManagementService.listAll()); |
| | | } |
| | | @GetMapping("/listPageReturn") |
| | | @ApiOperation("ææ¡£åé
管ç-å½è¿å页æ¥è¯¢") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPageReturn(Page page, DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationReturnManagementMapper.listPage(page, documentationReturnManagement)); |
| | | } |
| | | @GetMapping("/getByDocumentationId/{id}") |
| | | @ApiOperation("æ ¹æ®ä¹¦ç±idæ¥è¯¢åé
è®°å½") |
| | | @Log(title = "æ ¹æ®ä¹¦ç±idæ¥è¯¢åé
è®°å½", businessType = BusinessType.OTHER) |
| | | public AjaxResult getByDocumentationId(@PathVariable Long id) { |
| | | return AjaxResult.success(documentationBorrowManagementService.selectByDocumentationId(id)); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("ææ¡£åé
管ç-åé
") |
| | | @Log(title = "ææ¡£åé
管ç-åé
", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.add(documentationBorrowManagement)); |
| | | } |
| | | @PutMapping("/revent") |
| | | @ApiOperation("ææ¡£åé
管ç-å½è¿") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿", businessType = BusinessType.UPDATE) |
| | | public AjaxResult revent(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.reventdbm(documentationReturnManagement)); |
| | | } |
| | | @PutMapping("/update") |
| | | @ApiOperation("ææ¡£åé
管ç-æ´æ°") |
| | | @Log(title = "ææ¡£åé
管ç-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody DocumentationBorrowManagement documentationBorrowManagement) { |
| | | return AjaxResult.success(documentationBorrowManagementService.updateById(documentationBorrowManagement)); |
| | | } |
| | | @PutMapping("/reventUpdate") |
| | | @ApiOperation("ææ¡£åé
管ç-å½è¿æ´æ°") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult reventupdate(@RequestBody DocumentationReturnManagement documentationReturnManagement) { |
| | | return AjaxResult.success(documentationReturnManagementMapper.updateById(documentationReturnManagement)); |
| | | } |
| | | @DeleteMapping ("/delete") |
| | | @ApiOperation("ææ¡£åé
管ç-åé
å é¤") |
| | | @Log(title = "ææ¡£åé
管ç-åé
å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentationBorrowManagementService.deleteByIds(ids)); |
| | | } |
| | | @DeleteMapping ("/reventDelete") |
| | | @ApiOperation("ææ¡£åé
管ç-å½è¿å é¤") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult reventdelete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentationBorrowManagementService.reventDeleteByIds(ids)); |
| | | } |
| | | @PostMapping("/export") |
| | | @ApiOperation("ææ¡£åé
管ç-åé
导åº") |
| | | @Log(title = "ææ¡£åé
管ç-åé
导åº", businessType = BusinessType.EXPORT) |
| | | public void export(HttpServletResponse response,DocumentationBorrowManagement documentationBorrowManagement) { |
| | | documentationBorrowManagementService.export(response,documentationBorrowManagement); |
| | | } |
| | | @PostMapping("/exportrevent") |
| | | @ApiOperation("ææ¡£åé
管ç-å½è¿å¯¼åº") |
| | | @Log(title = "ææ¡£åé
管ç-å½è¿å¯¼åº", businessType = BusinessType.EXPORT) |
| | | public void exportrevent(HttpServletResponse response, DocumentationReturnManagement documentationReturnManagement) { |
| | | documentationBorrowManagementService.exportrevent(response,documentationReturnManagement); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.warehouse.dto.DocumentationDto; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.service.DocumentationService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/documentation") |
| | | @Api(tags = "ææ¡£ä¿¡æ¯è¡¨") |
| | | public class DocumentationController extends BaseController { |
| | | @Autowired |
| | | private DocumentationService documentationService; |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-å页æ¥è¯¢") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listPage(Page page, Documentation documentation) { |
| | | IPage<DocumentationDto> list = documentationService.listPage(page, documentation); |
| | | return AjaxResult.success(list); |
| | | } |
| | | @GetMapping("/list") |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨æ¥è¯¢") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list() { |
| | | List<DocumentationDto> list = documentationService.listAll(); |
| | | return AjaxResult.success(list); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-æ·»å ") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Documentation documentation) { |
| | | return AjaxResult.success(documentationService.save(documentation)); |
| | | } |
| | | @PutMapping("/update") |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-æ´æ°") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Documentation documentation) { |
| | | return AjaxResult.success(documentationService.updateById(documentation)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-å é¤") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(documentationService.deleteByIds(ids)); |
| | | } |
| | | |
| | | @PostMapping("/export") |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-导åº") |
| | | @Log(title = "ææ¡£ä¿¡æ¯è¡¨-导åº", businessType = BusinessType.EXPORT) |
| | | public void export(HttpServletResponse response,Documentation documentation ) { |
| | | documentationService.export(response,documentation); |
| | | } |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-ç»è®¡") |
| | | @GetMapping("/overview") |
| | | public AjaxResult getOverviewStatistics() { |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("totalDocsCount", documentationService.getTotalDocsCount()); |
| | | result.put("categoryNumCount", documentationService.getCategoryNumCount()); |
| | | result.put("borrowedDocsCount", documentationService.getBorrowedDocsCount()); |
| | | result.put("monthlyAddedDocsCount", documentationService.getMonthlyAddedDocsCount()); |
| | | return AjaxResult.success(result); |
| | | } |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-åç±»ç»è®¡") |
| | | @GetMapping("/category") |
| | | public AjaxResult getCategoryDistribution() { |
| | | return AjaxResult.success(documentationService.getCategoryDistribution()); |
| | | } |
| | | @ApiOperation("ææ¡£ä¿¡æ¯è¡¨-ç¶æç»è®¡") |
| | | @GetMapping("/status") |
| | | public AjaxResult getStatusDistribution() { |
| | | return AjaxResult.success(documentationService.getStatusDistribution()); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.pojo.AccountFile; |
| | | import com.ruoyi.account.service.AccountFileService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.warehouse.pojo.DocumentationFile; |
| | | import com.ruoyi.warehouse.service.DocumentationFileService; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ææ¡£éä»¶ |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/documentation/documentationFile") |
| | | public class DocumentationFileController { |
| | | |
| | | |
| | | @Resource |
| | | private DocumentationFileService documentationFileService; |
| | | |
| | | /** |
| | | * æ°å¢ |
| | | * @param documentationFile |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody DocumentationFile documentationFile) { |
| | | return AjaxResult.success(documentationFileService.save(documentationFile)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/del") |
| | | public AjaxResult delDocumentationFile(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | //å 餿£éªéä»¶ |
| | | return AjaxResult.success(documentationFileService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | *æ¥è¯¢ |
| | | * @param |
| | | * @param documentationFile |
| | | * @return |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public AjaxResult documentationFileListPage(DocumentationFile documentationFile) { |
| | | return AjaxResult.success(documentationFileService.documentationFileListPage( documentationFile)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | |
| | | 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.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.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService; |
| | | import com.ruoyi.warehouse.service.WarehouseService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "ä»åº") |
| | | @RequestMapping("/warehouse") |
| | | public class WarehouseController extends BaseController { |
| | | @Autowired |
| | | private WarehouseService warehouseService; |
| | | @GetMapping("/tree") |
| | | @ApiOperation("ä»åº-æ¥è¯¢æ ") |
| | | @Log(title = "ä»åº-æ¥è¯¢æ ", businessType = BusinessType.OTHER) |
| | | public AjaxResult listTree() { |
| | | return AjaxResult.success(warehouseService.findListTree()); |
| | | } |
| | | @GetMapping("/list") |
| | | @ApiOperation("ä»åº-æ¥è¯¢") |
| | | @Log(title = "ä»åº-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.findList(warehouse)); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("ä»åº-æ·»å ") |
| | | @Log(title = "ä»åº-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.save(warehouse)); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @ApiOperation("ä»åº-æ´æ°") |
| | | @Log(title = "ä»åº-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Warehouse warehouse) { |
| | | return AjaxResult.success(warehouseService.updateById(warehouse)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("ä»åº-å é¤") |
| | | @Log(title = "ä»åº-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(warehouseService.deleteByIds(ids)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.warehouse.dto.WarehouseGoodsShelvesDto; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "ååè´§æ¶") |
| | | @RequestMapping("/warehouse/goodsShelves") |
| | | public class WarehouseGoodsShelvesController extends BaseController { |
| | | @Autowired |
| | | private WarehouseGoodsShelvesService warehouseGoodsShelvesService; |
| | | |
| | | @GetMapping("/listById") |
| | | @ApiOperation("ååè´§æ¶-æ¥è¯¢") |
| | | @Log(title = "ååè´§æ¶-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult listById(WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | List<WarehouseGoodsShelvesDto> list = warehouseGoodsShelvesService.findList(warehouseGoodsShelves); |
| | | return AjaxResult.success(list); |
| | | } |
| | | @PostMapping("/add") |
| | | @ApiOperation("ååè´§æ¶-æ·»å ") |
| | | @Log(title = "ååè´§æ¶-æ·»å ", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | return AjaxResult.success(warehouseGoodsShelvesService.add(warehouseGoodsShelves)); |
| | | } |
| | | @PutMapping("/update") |
| | | @ApiOperation("ååè´§æ¶-æ´æ°") |
| | | @Log(title = "ååè´§æ¶-æ´æ°", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody WarehouseGoodsShelves warehouseGoodsShelves) { |
| | | return AjaxResult.success(warehouseGoodsShelvesService.updateRowcolById(warehouseGoodsShelves)); |
| | | } |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("ååè´§æ¶-å é¤") |
| | | @Log(title = "ååè´§æ¶-å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("è¯·ä¼ å
¥è¦å é¤çID"); |
| | | return AjaxResult.success(warehouseGoodsShelvesService.deleteByIds(ids)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.controller; |
| | | |
| | | 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.warehouse.pojo.WarehouseGoodsShelvesRowcol; |
| | | import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto; |
| | | import com.ruoyi.warehouse.service.WarehouseGoodsShelvesRowcolService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "ååè´§æ¶è¡å") |
| | | @RequestMapping("/warehouse/goodsShelvesRowcol") |
| | | public class WarehouseGoodsShelvesRowcolController extends BaseController { |
| | | @Autowired |
| | | private WarehouseGoodsShelvesRowcolService warehouseGoodsShelvesRowcolService; |
| | | @GetMapping("/list") |
| | | @ApiOperation("ååè´§æ¶è¡å-æ¥è¯¢") |
| | | @Log(title = "ååè´§æ¶è¡å-æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | public AjaxResult list(WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol) { |
| | | |
| | | List<WarehouseGoodsShelvesRowcolDto> list = warehouseGoodsShelvesRowcolService.getList(warehouseGoodsShelvesRowcol); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.ruoyi.warehouse.pojo.DocumentClassification; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DocumentClassificationDto extends DocumentClassification { |
| | | |
| | | private List<DocumentClassification> documentClassificationList; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class DocumentClassificationTreeDto { |
| | | private Long id; |
| | | private Long parentId; |
| | | private String category; |
| | | private List<DocumentClassificationTreeDto> children; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DocumentationBorrowManagementDto extends DocumentationBorrowManagement { |
| | | /** |
| | | * ææ¡£åç§° |
| | | */ |
| | | @Excel(name = "ææ¡£åç§°") |
| | | private String docName; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DocumentationDto extends Documentation { |
| | | /** |
| | | * ç±»å«åç§° |
| | | */ |
| | | @Excel(name = "ç±»å«åç§°") |
| | | private String category; |
| | | /** |
| | | * ä½ç½®ä¿¡æ¯ |
| | | */ |
| | | @Excel(name = "ä½ç½®ä¿¡æ¯") |
| | | private String locationInfo; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.ruoyi.warehouse.pojo.DocumentationReturnManagement; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class DocumentationReturnManagementDto extends DocumentationReturnManagement { |
| | | /** |
| | | * ææ¡£åç§° |
| | | */ |
| | | private String docName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.time.LocalDateTime; |
| | | |
| | | public class ReturnExportDto { |
| | | private String id; // è®°å½ç¼å· |
| | | @Excel(name = "ææ¡£åç§°") |
| | | private String docName; // ææ¡£åç§° |
| | | @Excel(name = "ååé
人") |
| | | private String borrower; // åé
人 |
| | | @Excel(name = "åé
æ¶é´", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDateTime borrowDate; // åé
æ¶é´ |
| | | @Excel(name = "å½è¿äºº") |
| | | @NotBlank(message = "å½è¿äººä¸è½ä¸ºç©º!!") |
| | | private String returner; // å½è¿äºº |
| | | @Excel(name = "å½è¿æ¶é´", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDateTime returnDate; // å½è¿æ¶é´ |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.ruoyi.warehouse.pojo.*; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class WarehouseDto extends Warehouse { |
| | | |
| | | private String goodsShelvesName; |
| | | private String category; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class WarehouseGoodsShelvesDto extends WarehouseGoodsShelves { |
| | | private String warehouseName; |
| | | private String docName; |
| | | private String docNumber; |
| | | private String category; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import com.ruoyi.warehouse.dto.DocumentationDto; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class WarehouseGoodsShelvesRowcolDto extends WarehouseGoodsShelvesRowcol { |
| | | private String warehouseName; |
| | | private String name; |
| | | private List<DocumentationDto> documentationDtoList; |
| | | private String category; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class WarehouseTreeDto { |
| | | private Long id; |
| | | private String label; |
| | | private List<WarehouseTreeDto> children; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.warehouse.pojo.DocumentClassification; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãdocument_classification(ææ¡£å类表)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-08-15 10:44:23 |
| | | * @Entity com.ruoyi.warehouse.pojo.DocumentClassification |
| | | */ |
| | | @Mapper |
| | | public interface DocumentClassificationMapper extends BaseMapper<DocumentClassification> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | 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.ruoyi.warehouse.dto.DocumentationBorrowManagementDto; |
| | | import com.ruoyi.warehouse.dto.ReturnExportDto; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãdocumentation_borrow_management(ææ¡£åé
-å½è¿è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-08-14 15:55:45 |
| | | * @Entity com.ruoyi.warehouse.pojo.DocumentationBorrowManagement |
| | | */ |
| | | @Mapper |
| | | public interface DocumentationBorrowManagementMapper extends BaseMapper<DocumentationBorrowManagement> { |
| | | |
| | | IPage<DocumentationBorrowManagement> listPage(Page page, @Param("documentationBorrowManagement") DocumentationBorrowManagement documentationBorrowManagement); |
| | | |
| | | List<DocumentationBorrowManagementDto> export(@Param("documentationBorrowManagement") DocumentationBorrowManagement documentationBorrowManagement); |
| | | |
| | | List<DocumentationBorrowManagementDto> list(@Param("ew") Wrapper<DocumentationBorrowManagementDto> queryWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.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.account.pojo.AccountFile; |
| | | import com.ruoyi.warehouse.pojo.DocumentationFile; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface DocumentationFileMapper extends BaseMapper<DocumentationFile> { |
| | | |
| | | List<DocumentationFile> documentationFileListPage(@Param("documentationFile") DocumentationFile documentationFile); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto; |
| | | import com.ruoyi.warehouse.dto.DocumentationDto; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãdocumentation(ææ¡£ä¿¡æ¯è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-08-14 14:05:49 |
| | | * @Entity com.ruoyi.warehouse.pojo.Documentation |
| | | */ |
| | | @Mapper |
| | | public interface DocumentationMapper extends BaseMapper<Documentation> { |
| | | |
| | | IPage<DocumentationDto> listPage(Page page, @Param("documentation") Documentation documentation); |
| | | List<DocumentationDto> list(); |
| | | List<DocumentationDto> listByDocumentClassificationId(@Param("documentClassificationId") Long documentClassificationId); |
| | | List<DocumentationDto> listBywarehouseGoodsShelvesRowcolId(@Param("warehouseGoodsShelvesRowcolId") Long warehouseGoodsShelvesRowcolId); |
| | | @Select("select count(*) from documentation") |
| | | Integer countTotalDocs(); |
| | | @Select("select count(distinct document_classification_id) from documentation") |
| | | Integer countCategoryNum(); |
| | | @Select("select count(*) from documentation where doc_status = 'ååº'") |
| | | Integer countBorrowedDocs(); |
| | | @Select("select count(*) from documentation where create_time >= date_format(now(), '%Y-%m-01') and create_time < date_format(now(), '%Y-%m-%d')") |
| | | Integer countMonthlyAddedDocs(); |
| | | |
| | | @Select("select dc.category, count(*) as count from documentation doc left join document_classification dc on doc.document_classification_id = dc.id group by dc.category") |
| | | List<Map<String, Object>> countCategoryDistribution(); |
| | | |
| | | @Select("select doc_status as docStatus, count(*) as count from documentation group by doc_status") |
| | | List<Map<String, Object>> countStatusDistribution(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.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.warehouse.dto.DocumentationBorrowManagementDto; |
| | | import com.ruoyi.warehouse.dto.ReturnExportDto; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import com.ruoyi.warehouse.pojo.DocumentationReturnManagement; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãdocumentation_borrow_management(ææ¡£åé
-å½è¿è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-08-14 15:55:45 |
| | | * @Entity com.ruoyi.warehouse.pojo.DocumentationBorrowManagement |
| | | */ |
| | | @Mapper |
| | | public interface DocumentationReturnManagementMapper extends BaseMapper<DocumentationReturnManagement> { |
| | | |
| | | IPage<DocumentationReturnManagement> listPage(Page page, @Param("documentationReturnManagement") DocumentationReturnManagement documentationReturnManagement); |
| | | // |
| | | // List<DocumentationReturnManagementDto> export(@Param("documentationReturnManagement") DocumentationReturnManagement documentationReturnManagement); |
| | | // |
| | | List<ReturnExportDto> exportrevent(@Param("documentationReturnManagement") DocumentationReturnManagement documentationReturnManagement); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.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.warehouse.dto.WarehouseGoodsShelvesDto; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelves; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * |
| | | * @description é对表ãwarehouse_goods_shelves(ä»åºè´§æ¶è¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-08-13 11:49:02 |
| | | * @Entity warehouse.pojo.WarehouseGoodsShelves |
| | | */ |
| | | @Mapper |
| | | public interface WarehouseGoodsShelvesMapper extends BaseMapper<WarehouseGoodsShelves> { |
| | | |
| | | List<WarehouseGoodsShelvesDto> findList(@Param("warehouseGoodsShelves") WarehouseGoodsShelves warehouseGoodsShelves); |
| | | List<WarehouseGoodsShelvesDto> listAll(@Param("warehouseGoodsShelves") WarehouseGoodsShelves warehouseGoodsShelves); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.mapper; |
| | | |
| | | import com.ruoyi.warehouse.dto.WarehouseGoodsShelvesRowcolDto; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.ruoyi.warehouse.pojo.WarehouseGoodsShelvesRowcol; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãwarehouse_goods_shelves_rowcol(ä»åºè´§æ¶å±ï¼å表)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-08-13 11:49:02 |
| | | * @Entity warehouse.pojo.WarehouseGoodsShelvesRowcol |
| | | */ |
| | | @Mapper |
| | | public interface WarehouseGoodsShelvesRowcolMapper extends BaseMapper<WarehouseGoodsShelvesRowcol> { |
| | | |
| | | List<WarehouseGoodsShelvesRowcolDto> findList(@Param("warehouseGoodsShelvesRowcol") WarehouseGoodsShelvesRowcol warehouseGoodsShelvesRowcol); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.mapper; |
| | | |
| | | |
| | | import com.ruoyi.warehouse.dto.WarehouseDto; |
| | | import com.ruoyi.warehouse.pojo.Warehouse; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãwarehouse(ä»åºè¡¨)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2025-08-13 11:49:02 |
| | | * @Entity warehouse.pojo.Warehouse |
| | | */ |
| | | @Mapper |
| | | public interface WarehouseMapper extends BaseMapper<Warehouse> { |
| | | List<WarehouseDto> findList(@Param("warehouse") Warehouse warehouse); |
| | | List<Warehouse> listAll(@Param("warehouse") Warehouse warehouse); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ææ¡£å类表 |
| | | * @TableName document_classification |
| | | */ |
| | | @TableName(value ="document_classification") |
| | | @Data |
| | | @ApiModel(value = "ææ¡£å类表") |
| | | public class DocumentClassification implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç±»å«åç§° |
| | | */ |
| | | private String category; |
| | | |
| | | /** |
| | | * ç¶ç±»id |
| | | */ |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ææ¡£ä¿¡æ¯è¡¨ |
| | | * @TableName documentation |
| | | */ |
| | | @TableName(value ="documentation") |
| | | @Data |
| | | @ApiModel(value = "ææ¡£ä¿¡æ¯è¡¨") |
| | | public class Documentation implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "ææ¡£ID") |
| | | private Long id; |
| | | |
| | | /** |
| | | * ç±»å«åç§°id |
| | | */ |
| | | @Excel(name = "ç±»å«åç§°id") |
| | | @ApiModelProperty(value = "ç±»å«åç§°id") |
| | | private Long documentClassificationId; |
| | | |
| | | /** |
| | | * ææ¡£åç§° |
| | | */ |
| | | @Excel(name = "ææ¡£åç§°") |
| | | @ApiModelProperty(value = "ææ¡£åç§°") |
| | | private String docName; |
| | | |
| | | /** |
| | | * ææ¡£ç¼å· |
| | | */ |
| | | @Excel(name = "ææ¡£ç¼å·") |
| | | @ApiModelProperty(value = "ææ¡£ç¼å·") |
| | | private String docNumber; |
| | | |
| | | /** |
| | | * 年份 |
| | | */ |
| | | @Excel(name = "年份") |
| | | @ApiModelProperty(value = "年份") |
| | | private Long year; |
| | | |
| | | /** |
| | | * 责任人 |
| | | */ |
| | | @Excel(name = "责任人") |
| | | @ApiModelProperty(value = "责任人") |
| | | private String responsiblePerson; |
| | | |
| | | /** |
| | | * ææ¡£æ¾ç½®ä½ç½® |
| | | */ |
| | | @Excel(name = "ææ¡£æ¾ç½®ä½ç½®") |
| | | @ApiModelProperty(value = "ææ¡£æ¾ç½®ä½ç½®") |
| | | private Long warehouseGoodsShelvesRowcolId; |
| | | |
| | | /** |
| | | * ææ¡£æ¥æ |
| | | */ |
| | | |
| | | @Excel(name = "ææ¡£æ¥æ", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @ApiModelProperty(value = "ææ¡£æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime docDate; |
| | | |
| | | /** |
| | | * ä¿ç®¡æé |
| | | */ |
| | | @Excel(name = "ä¿ç®¡æé") |
| | | @ApiModelProperty(value = "ä¿ç®¡æé") |
| | | private Long retentionPeriod; |
| | | |
| | | /** |
| | | * ä¿å¯çº§å« |
| | | */ |
| | | @Excel(name = "ä¿å¯çº§å«") |
| | | @ApiModelProperty(value = "ä¿å¯çº§å«") |
| | | private String securityLevel; |
| | | |
| | | /** |
| | | * ä»½æ° |
| | | */ |
| | | @Excel(name = "份æ°") |
| | | @ApiModelProperty(value = "份æ°") |
| | | private Long copyCount; |
| | | |
| | | /** |
| | | * é¡µæ° |
| | | */ |
| | | @Excel(name = "页æ°") |
| | | @ApiModelProperty(value = "页æ°") |
| | | private Long pageCount; |
| | | |
| | | /** |
| | | * ææ¡£ç±»å« |
| | | */ |
| | | @Excel(name = "ææ¡£ç±»å«") |
| | | @ApiModelProperty(value = "ææ¡£ç±»å«") |
| | | private String docCategory; |
| | | |
| | | /** |
| | | * ææ¡£ç§ç±» |
| | | */ |
| | | @Excel(name = "ææ¡£ç§ç±»") |
| | | @ApiModelProperty(value = "ææ¡£ç§ç±»") |
| | | private String docType; |
| | | |
| | | /** |
| | | * ç´§æ¥ç¨åº¦ |
| | | */ |
| | | @Excel(name = "ç´§æ¥ç¨åº¦") |
| | | @ApiModelProperty(value = "ç´§æ¥ç¨åº¦") |
| | | private String urgencyLevel; |
| | | |
| | | /** |
| | | * ææ¡£ç¶æ |
| | | */ |
| | | @Excel(name = "ææ¡£ç¶æ") |
| | | @ApiModelProperty(value = "ææ¡£ç¶æ") |
| | | private String docStatus; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨") |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * ææ¡£åé
-å½è¿è¡¨ |
| | | * @TableName documentation_borrow_management |
| | | */ |
| | | @TableName(value ="documentation_borrow_management") |
| | | @Data |
| | | @ApiModel(value = "ææ¡£åé
表") |
| | | public class DocumentationBorrowManagement extends DateQueryDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ææ¡£id |
| | | */ |
| | | @ApiModelProperty(value = "ææ¡£id") |
| | | private Long documentationId; |
| | | |
| | | /** |
| | | * åé
人 |
| | | */ |
| | | @ApiModelProperty(value = "åé
人") |
| | | @Excel(name = "åé
人") |
| | | private String borrower; |
| | | /** |
| | | * å½è¿äºº |
| | | */ |
| | | @ApiModelProperty(value = "å½è¿äºº") |
| | | @Excel(name = "å½è¿äºº") |
| | | private String returner; |
| | | |
| | | /** |
| | | * åé
ç®ç |
| | | */ |
| | | @Excel(name = "åé
ç®ç") |
| | | @ApiModelProperty(value = "åé
ç®ç") |
| | | private String borrowPurpose; |
| | | |
| | | /** |
| | | * åé
æ¥æ |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "åé
æ¥æ") |
| | | @Excel(name = "åé
æ¥æ", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate borrowDate; |
| | | |
| | | /** |
| | | * åºå½è¿æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "åºå½è¿æ¥æ") |
| | | @Excel(name = "åºå½è¿æ¥æ", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate dueReturnDate; |
| | | |
| | | /** |
| | | * å®é
å½è¿æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "å®é
å½è¿æ¥æ") |
| | | @Excel(name = "å®é
å½è¿æ¥æ", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate returnDate; |
| | | |
| | | /** |
| | | * åé
ç¶æ |
| | | */ |
| | | @ApiModelProperty(value = "åé
ç¶æ") |
| | | @Excel(name = "åé
ç¶æ") |
| | | private String borrowStatus; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * ææ¡£ä¿¡æ¯è¡¨--éä»¶ |
| | | * documentation_file |
| | | */ |
| | | @TableName(value = "documentation_file") |
| | | @Data |
| | | public class DocumentationFile implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "æä»¶åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "æä»¶è·¯å¾") |
| | | private String url; |
| | | |
| | | @ApiModelProperty(value = "æä»¶å¤§å°") |
| | | private Long fileSize; |
| | | |
| | | @ApiModelProperty(value = "ææ¡£ID") |
| | | @NotBlank(message = "ææ¡£idä¸è½ä¸ºç©º!") |
| | | private Long documentationId; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.dto.DateQueryDto; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * ææ¡£åé
-å½è¿è¡¨ |
| | | * @TableName documentation_return_management |
| | | */ |
| | | @TableName(value ="documentation_return_management") |
| | | @Data |
| | | @ApiModel(value = "ææ¡£å½è¿è¡¨") |
| | | public class DocumentationReturnManagement extends DateQueryDto implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ææ¡£id |
| | | */ |
| | | @ApiModelProperty(value = "ææ¡£id") |
| | | private Long documentationId; |
| | | /** |
| | | * åé
id |
| | | */ |
| | | private Long borrowId; |
| | | /** |
| | | * åé
人 |
| | | */ |
| | | @ApiModelProperty(value = "åé
人") |
| | | @Excel(name = "åé
人") |
| | | private String borrower; |
| | | /** |
| | | * å½è¿äºº |
| | | */ |
| | | @ApiModelProperty(value = "å½è¿äºº") |
| | | @Excel(name = "å½è¿äºº") |
| | | private String returner; |
| | | |
| | | /** |
| | | * åé
ç®ç |
| | | */ |
| | | @Excel(name = "åé
ç®ç") |
| | | @ApiModelProperty(value = "åé
ç®ç") |
| | | private String borrowPurpose; |
| | | |
| | | /** |
| | | * åé
æ¥æ |
| | | */ |
| | | |
| | | @ApiModelProperty(value = "åé
æ¥æ") |
| | | @Excel(name = "åé
æ¥æ", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate borrowDate; |
| | | |
| | | /** |
| | | * åºå½è¿æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "åºå½è¿æ¥æ") |
| | | @Excel(name = "åºå½è¿æ¥æ", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate dueReturnDate; |
| | | |
| | | /** |
| | | * å®é
å½è¿æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "å®é
å½è¿æ¥æ") |
| | | @Excel(name = "å®é
å½è¿æ¥æ", dateFormat = "yyyy-MM-dd", width = 30) |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private LocalDate returnDate; |
| | | |
| | | /** |
| | | * åé
ç¶æ |
| | | */ |
| | | @ApiModelProperty(value = "åé
ç¶æ") |
| | | @Excel(name = "åé
ç¶æ") |
| | | private String borrowStatus; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @Excel(name = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ä»åºè¡¨ |
| | | * @TableName warehouse |
| | | */ |
| | | @TableName(value ="warehouse") |
| | | @Data |
| | | @ApiModel |
| | | public class Warehouse implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * ä»åºåç§° |
| | | */ |
| | | private String warehouseName; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ä»åºè´§æ¶è¡¨ |
| | | * @TableName warehouse_goods_shelves |
| | | */ |
| | | @TableName(value ="warehouse_goods_shelves") |
| | | @Data |
| | | @ApiModel |
| | | public class WarehouseGoodsShelves implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * è´§æ¶åç§° |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 屿° |
| | | */ |
| | | @TableField("`row`") |
| | | private Long row; |
| | | |
| | | /** |
| | | * åæ° |
| | | */ |
| | | @TableField("`col`") |
| | | private Long col; |
| | | |
| | | /** |
| | | * ä»åºid |
| | | */ |
| | | private Long warehouseId; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ä»åºè´§æ¶å±ï¼å表 |
| | | * @TableName warehouse_goods_shelves_rowcol |
| | | */ |
| | | @TableName(value ="warehouse_goods_shelves_rowcol") |
| | | @Data |
| | | @ApiModel(value = "ä»åºè´§æ¶å±ï¼å表") |
| | | public class WarehouseGoodsShelvesRowcol implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 屿° |
| | | */ |
| | | @TableField("`row`") |
| | | private Long row; |
| | | |
| | | /** |
| | | * åæ° |
| | | */ |
| | | @TableField("`col`") |
| | | private Long col; |
| | | |
| | | /** |
| | | * è´§æ¶id |
| | | */ |
| | | private Long warehouseGoodsShelvesId; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * åå»ºç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¶é´ |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * ç§æ·ID |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.warehouse.dto.DocumentClassificationDto; |
| | | import com.ruoyi.warehouse.dto.DocumentClassificationTreeDto; |
| | | import com.ruoyi.warehouse.pojo.DocumentClassification; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãdocument_classification(ææ¡£å类表)ãçæ°æ®åºæä½Service |
| | | * @createDate 2025-08-15 10:44:23 |
| | | */ |
| | | public interface DocumentClassificationService extends IService<DocumentClassification> { |
| | | |
| | | boolean deleteByIds(List<Long> ids); |
| | | |
| | | List<DocumentClassificationTreeDto> selectDocumentClassificationList(); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.warehouse.dto.DocumentationBorrowManagementDto; |
| | | import com.ruoyi.warehouse.pojo.DocumentationBorrowManagement; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.warehouse.pojo.DocumentationReturnManagement; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãdocumentation_borrow_management(ææ¡£åé
-å½è¿è¡¨)ãçæ°æ®åºæä½Service |
| | | * @createDate 2025-08-14 15:55:45 |
| | | */ |
| | | public interface DocumentationBorrowManagementService extends IService<DocumentationBorrowManagement> { |
| | | |
| | | IPage<DocumentationBorrowManagement> listPage(Page page, DocumentationBorrowManagement documentationBorrowManagement); |
| | | |
| | | |
| | | boolean add(DocumentationBorrowManagement documentationBorrowManagement); |
| | | |
| | | boolean deleteByIds(List<Long> ids); |
| | | |
| | | boolean reventdbm(DocumentationReturnManagement documentationReturnManagement); |
| | | |
| | | boolean reventDeleteByIds(List<Long> ids); |
| | | |
| | | void export(HttpServletResponse response, DocumentationBorrowManagement documentationBorrowManagement); |
| | | |
| | | void exportrevent(HttpServletResponse response, DocumentationReturnManagement documentationReturnManagement); |
| | | |
| | | List<DocumentationBorrowManagementDto> listAll(); |
| | | |
| | | List<DocumentationBorrowManagementDto> selectByDocumentationId(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.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.account.pojo.AccountFile; |
| | | import com.ruoyi.warehouse.pojo.DocumentationFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface DocumentationFileService extends IService<DocumentationFile> { |
| | | |
| | | List<DocumentationFile> documentationFileListPage(DocumentationFile documentationFile); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.warehouse.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.warehouse.dto.DocumentationDto; |
| | | import com.ruoyi.warehouse.pojo.Documentation; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author 86151 |
| | | * @description é对表ãdocumentation(ææ¡£ä¿¡æ¯è¡¨)ãçæ°æ®åºæä½Service |
| | | * @createDate 2025-08-14 14:05:49 |
| | | */ |
| | | public interface DocumentationService extends IService<Documentation> { |
| | | |
| | | IPage<DocumentationDto> listPage(Page page, Documentation documentation); |
| | | |
| | | void export(HttpServletResponse response,Documentation documentation); |
| | | |
| | | boolean deleteByIds(List<Long> ids); |
| | | |
| | | List<DocumentationDto> listAll(); |
| | | Integer getTotalDocsCount(); |
| | | |
| | | Integer getCategoryNumCount(); |
| | | |
| | | Integer getBorrowedDocsCount(); |
| | | |
| | | Integer getMonthlyAddedDocsCount(); |
| | | |
| | | |
| | | List<Map<String, Object>> getCategoryDistribution(); |
| | | |
| | | |
| | | List<Map<String, Object>> getStatusDistribution(); |
| | | } |
| src/main/java/com/ruoyi/warehouse/service/WarehouseGoodsShelvesRowcolService.java
src/main/java/com/ruoyi/warehouse/service/WarehouseGoodsShelvesService.java
src/main/java/com/ruoyi/warehouse/service/WarehouseService.java
src/main/java/com/ruoyi/warehouse/service/impl/DocumentClassificationServiceImpl.java
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationBorrowManagementServiceImpl.java
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationFileServiceImpl.java
src/main/java/com/ruoyi/warehouse/service/impl/DocumentationServiceImpl.java
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseGoodsShelvesRowcolServiceImpl.java
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseGoodsShelvesServiceImpl.java
src/main/java/com/ruoyi/warehouse/service/impl/WarehouseServiceImpl.java
src/main/java/com/ruoyi/waterrecord/controller/WaterRecordController.java
src/main/java/com/ruoyi/waterrecord/mapper/WaterRecordMapper.java
src/main/java/com/ruoyi/waterrecord/pojo/WaterRecord.java
src/main/java/com/ruoyi/waterrecord/service/WaterRecordService.java
src/main/java/com/ruoyi/waterrecord/service/impl/WaterRecordServiceImpl.java
src/main/resources/application-bdsm.yml
src/main/resources/application-bhmy.yml
src/main/resources/application-cjny.yml
src/main/resources/application-cmny.yml
src/main/resources/application-demo.yml
src/main/resources/application-dhdc.yml
src/main/resources/application-hbkj.yml
src/main/resources/application-hbxm.yml
src/main/resources/application-hckx.yml
src/main/resources/application-hcmy.yml
src/main/resources/application-hhkj.yml
src/main/resources/application-hsmy.yml
src/main/resources/application-hsxny.yml
src/main/resources/application-hxgy.yml
src/main/resources/application-hxsj.yml
src/main/resources/application-hysn.yml
src/main/resources/application-jjxm.yml
src/main/resources/application-jlsn.yml
src/main/resources/application-jsmy.yml
src/main/resources/application-jsyny.yml
src/main/resources/application-jyhj.yml
src/main/resources/application-mkzs.yml
src/main/resources/application-mqsp.yml
src/main/resources/application-mxsc.yml
src/main/resources/application-nydl.yml
src/main/resources/application-phmk.yml
src/main/resources/application-prod.yml
src/main/resources/application-qlmc.yml
src/main/resources/application-rzny.yml
src/main/resources/application-tjxm.yml
src/main/resources/application-tymk.yml
src/main/resources/application-wdsy.yml
src/main/resources/application-xyhb.yml
src/main/resources/application-zjyj.yml
src/main/resources/application-zqhx.yml
src/main/resources/application-zyrq.yml
src/main/resources/application-zyrqCopy.yml
src/main/resources/mapper/account/AccountFileMapper.xml
src/main/resources/mapper/approve/AnnualLeaveSettingMapper.xml
src/main/resources/mapper/approve/ApproveProcessMapper.xml
src/main/resources/mapper/approve/FileSharingMapper.xml
src/main/resources/mapper/approve/HolidaySettingsMapper.xml
src/main/resources/mapper/approve/KnowledgeBaseMapper.xml
src/main/resources/mapper/approve/NotificationManagementMapper.xml
src/main/resources/mapper/approve/OnlineMeetingMapper.xml
src/main/resources/mapper/approve/OvertimeSettingMapper.xml
src/main/resources/mapper/approve/RpaProcessAutomationMapper.xml
src/main/resources/mapper/approve/WorkingHoursSettingMapper.xml
src/main/resources/mapper/collaborativeApproval/DutyPlanMapper.xml
src/main/resources/mapper/collaborativeApproval/MeetApplicationMapper.xml
src/main/resources/mapper/collaborativeApproval/MeetDraftMapper.xml
src/main/resources/mapper/collaborativeApproval/MeetingMinutesMapper.xml
src/main/resources/mapper/collaborativeApproval/MeetingRoomMapper.xml
src/main/resources/mapper/collaborativeApproval/NoticeMapper.xml
src/main/resources/mapper/collaborativeApproval/ReadingStatusMapper.xml
src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementMapper.xml
src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml
src/main/resources/mapper/collaborativeApproval/StaffContactsPersonalMapper.xml
src/main/resources/mapper/customervisits/CustomerVisitsMapper.xml
src/main/resources/mapper/device/DeviceDefectRecordMapper.xml
src/main/resources/mapper/device/DeviceLedgerMapper.xml
src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
src/main/resources/mapper/equipmentenergyconsumption/EnergyPeriodMapper.xml
src/main/resources/mapper/equipmentenergyconsumption/electricityConsumptionAreaMapper.xml
src/main/resources/mapper/inspectiontask/TimingTaskMapper.xml
src/main/resources/mapper/lavorissue/LavorIssueMapper.xml
src/main/resources/mapper/measuringinstrumentledger/SparePartsMapper.xml
src/main/resources/mapper/oA/OaProjectMapper.xml
src/main/resources/mapper/oA/OaProjectPhaseMapper.xml
src/main/resources/mapper/oA/OaProjectPhaseTaskMapper.xml
src/main/resources/mapper/officesupplies/OfficeSuppliesMapper.xml
src/main/resources/mapper/procurementrecord/GasTankWarningMapper.xml
src/main/resources/mapper/procurementrecord/InboundManagementMapper.xml
src/main/resources/mapper/procurementrecord/ProcurementPlanMapper.xml
src/main/resources/mapper/procurementrecord/ProcurementPriceManagementMapper.xml
src/main/resources/mapper/procurementrecord/ProcurementRecordMapper.xml
src/main/resources/mapper/procurementrecord/ProcurementRecordOutMapper.xml
src/main/resources/mapper/procurementrecord/ReturnManagementMapper.xml
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
src/main/resources/mapper/purchase/PaymentRegistrationMapper.xml
src/main/resources/mapper/purchase/ProductRecordMapper.xml
src/main/resources/mapper/sales/InvoiceLedgerMapper.xml
src/main/resources/mapper/sales/PaymentShippingMapper.xml
src/main/resources/mapper/sales/ReceiptPaymentMapper.xml
src/main/resources/mapper/sales/SalesQuotationMapper.xml
src/main/resources/mapper/sales/SalesQuotationProductMapper.xml
src/main/resources/mapper/sales/SalespersonManagementMapper.xml
src/main/resources/mapper/sales/ShippingInfoMapper.xml
src/main/resources/mapper/staff/HolidayApplicationMapper.xml
src/main/resources/mapper/staff/PersonalAttendanceRecordsMapper.xml
src/main/resources/mapper/staff/StaffJoinLeaveRecordMapper.xml
src/main/resources/mapper/staff/StaffSchedulingMapper.xml
src/main/resources/mapper/system/SysUserDeptMapper.xml
src/main/resources/mapper/system/SysUserMapper.xml
src/main/resources/mapper/warehouse/DocumentClassificationMapper.xml
src/main/resources/mapper/warehouse/DocumentationBorrowManagementMapper.xml
src/main/resources/mapper/warehouse/DocumentationFileMapper.xml
src/main/resources/mapper/warehouse/DocumentationMapper.xml
src/main/resources/mapper/warehouse/DocumentationReturnManagementMapper.xml
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesMapper.xml
src/main/resources/mapper/warehouse/WarehouseGoodsShelvesRowcolMapper.xml
src/main/resources/mapper/warehouse/WarehouseMapper.xml
src/main/resources/mapper/waterrecord/WaterRecordMapper.xml
src/main/resources/mybatis/mybatis-config.xml
src/main/resources/static/report-template.docx |