| | |
| | | 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.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.dto.DeviceLedgerDto; |
| | | import com.ruoyi.device.execl.DeviceLedgerExeclDto; |
| | | import com.ruoyi.device.mapper.DeviceLedgerMapper; |
| | | import com.ruoyi.device.mapper.DeviceMaintenanceMapper; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | |
| | | import com.ruoyi.device.service.IDeviceLedgerService; |
| | | import com.ruoyi.device.service.IDeviceMaintenanceService; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Anonymous; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | @PostMapping("import") |
| | | @ApiModelProperty("导入设备台账") |
| | | @Log(title = "设备台账导入", businessType = BusinessType.IMPORT) |
| | | public AjaxResult importData(MultipartFile file) throws IOException { |
| | | Boolean b = deviceLedgerService.importData(file); |
| | | if (b) { |
| | |
| | | return AjaxResult.error("导入失败"); |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | | @ApiModelProperty("下载导入模板") |
| | | @Log(title = "设备台账导入", businessType = BusinessType.IMPORT) |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<DeviceLedgerExeclDto> util = new ExcelUtil<DeviceLedgerExeclDto>(DeviceLedgerExeclDto.class); |
| | | util.importTemplateExcel(response, "设备台账模板"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("getDeviceLedger") |
| | | @ApiModelProperty("获取设备台账") |
| | |
| | | */ |
| | | private BigDecimal unTaxIncludingPriceTotal; |
| | | |
| | | private String deviceBrand; |
| | | |
| | | private String storageLocation; |
| | | |
| | | /** |
| | | * 录入时间 |
| | | */ |
| | |
| | | * 数量 |
| | | */ |
| | | @Excel(name = "数量",sort = 5) |
| | | private BigDecimal number; |
| | | private Integer number; |
| | | |
| | | /** |
| | | * 含税单价 |
| | | * 资产原值 |
| | | */ |
| | | @Excel(name = "含税单价",sort = 6) |
| | | @Excel(name = "资产原值",sort = 6) |
| | | private BigDecimal taxIncludingPriceUnit; |
| | | // |
| | | // /** |
| | | // * 含税总价 |
| | | // */ |
| | | // @Excel(name = "含税总价",sort = 7) |
| | | // private BigDecimal taxIncludingPriceTotal; |
| | | // |
| | | // /** |
| | | // * 税率 |
| | | // */ |
| | | // @Excel(name = "税率",sort = 8) |
| | | // private BigDecimal taxRate; |
| | | |
| | | /** |
| | | * 含税总价 |
| | | */ |
| | | @Excel(name = "含税总价",sort = 7) |
| | | private BigDecimal taxIncludingPriceTotal; |
| | | |
| | | /** |
| | | * 税率 |
| | | */ |
| | | @Excel(name = "税率",sort = 8) |
| | | private BigDecimal taxRate; |
| | | |
| | | /** |
| | | * 不含税总价 |
| | | */ |
| | | @Excel(name = "不含税总价",sort = 9) |
| | | private BigDecimal unTaxIncludingPriceTotal; |
| | | // /** |
| | | // * 不含税总价 |
| | | // */ |
| | | // @Excel(name = "不含税总价",sort = 9) |
| | | // private BigDecimal unTaxIncludingPriceTotal; |
| | | // |
| | | // /** |
| | | // * 录入时间 |
| | |
| | | // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | // private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @Excel(name = "存放地点",sort = 7) |
| | | private String storageLocation; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @Excel(name = "设备品牌",sort = 8) |
| | | private String deviceBrand; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | private BigDecimal unTaxIncludingPriceTotal; |
| | | |
| | | private String deviceBrand; |
| | | |
| | | private String storageLocation; |
| | | |
| | | /** |
| | | * 录入时间 |
| | | */ |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.time.ZoneOffset; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | |
| | | ExcelUtil<DeviceLedgerExeclDto> util = new ExcelUtil<DeviceLedgerExeclDto>(DeviceLedgerExeclDto.class); |
| | | List<DeviceLedgerExeclDto> userList = util.importExcel(file.getInputStream()); |
| | | userList.forEach(c -> { |
| | | DeviceLedger deviceLedger = new DeviceLedger(); |
| | | SysUser sysUser = sysUserMapper.selectUserByUserName(c.getCreateUser()); |
| | | if (sysUser!=null) { |
| | | deviceLedger.setCreateUser(sysUser.getUserId().intValue()); |
| | | }else { |
| | | deviceLedger.setCreateUser(SecurityUtils.getUserId().intValue()); |
| | | for (Integer i = 0; i < c.getNumber(); i++) { |
| | | DeviceLedger deviceLedger = new DeviceLedger(); |
| | | SysUser sysUser = sysUserMapper.selectUserByUserName(c.getCreateUser()); |
| | | if (sysUser!=null) { |
| | | deviceLedger.setCreateUser(sysUser.getUserId().intValue()); |
| | | }else { |
| | | deviceLedger.setCreateUser(SecurityUtils.getUserId().intValue()); |
| | | } |
| | | BeanUtils.copyProperties(c,deviceLedger); |
| | | deviceLedger.setNumber(new BigDecimal(1)); |
| | | deviceLedgerMapper.insert(deviceLedger); |
| | | } |
| | | BeanUtils.copyProperties(c,deviceLedger); |
| | | deviceLedgerMapper.insert(deviceLedger); |
| | | }); |
| | | |
| | | return true; |
| | |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | # host: 127.0.0.1 |
| | | host: 192.168.1.185 |
| | | host: 127.0.0.1 |
| | | # host: 192.168.1.185 |
| | | # 端口,默认为6379 |
| | | port: 6380 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 15 |
| | | # 密码 |
| | |
| | | |
| | | <select id="queryPage" resultType="com.ruoyi.device.dto.DeviceLedgerDto"> |
| | | SELECT |
| | | dl.id, |
| | | dl.device_name, |
| | | dl.device_model, |
| | | dl.supplier_name, |
| | | dl.unit, |
| | | dl.number, |
| | | dl.status, |
| | | dl.plan_runtime_time, |
| | | dl.start_runtime_time, |
| | | dl.end_runtime_time, |
| | | dl.runtime_duration, |
| | | dl.tax_including_price_unit, |
| | | dl.tax_including_price_total, |
| | | dl.tax_rate, |
| | | dl.un_tax_including_price_total, |
| | | dl.create_time, |
| | | dl.update_time , |
| | | su.user_name AS createUser, |
| | | dl.update_user, |
| | | dl.tenant_id |
| | | dl.* , |
| | | su.user_name AS createUser |
| | | FROM device_ledger dl |
| | | left join sys_user su on dl.create_user = su.user_id |
| | | <where> |