| | |
| | | |
| | | |
| | | @ApiModelProperty("设备保养id") |
| | | |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("设备台账id") |
| | |
| | | private String maintenanceActuallyTimeReq; |
| | | |
| | | @ApiModelProperty("保养结果 0 维修 1 完好") |
| | | private Integer maintenanceResult; |
| | | private String maintenanceResult; |
| | | |
| | | @ApiModelProperty("状态 0 待保养 1 完结") |
| | | private Integer status; |
| | |
| | | private LocalDateTime maintenanceActuallyTime; |
| | | |
| | | @ApiModelProperty("保养结果 0 维修 1 完好") |
| | | private Integer maintenanceResult; |
| | | private String maintenanceResult; |
| | | |
| | | @ApiModelProperty("状态 0 待保养 1 完结") |
| | | private Integer status; |
| | |
| | | DeviceMaintenanceExeclDto deviceRepairExeclDto = new DeviceMaintenanceExeclDto(); |
| | | BeanUtils.copyProperties(deviceMaintenance,deviceRepairExeclDto); |
| | | deviceRepairExeclDto.setStatus(deviceMaintenance.getStatus() == 0 ? "待维修" : "完结"); |
| | | deviceRepairExeclDto.setMaintenanceResult(deviceMaintenance.getMaintenanceResult() != null && deviceMaintenance.getMaintenanceResult() == 0 ? "维修" : "完好"); |
| | | |
| | | // deviceRepairExeclDto.setMaintenanceResult(deviceMaintenance.getMaintenanceResult() != null && deviceMaintenance.getMaintenanceResult() == 0 ? "维修" : "完好"); |
| | | deviceLedgerExeclDtos.add(deviceRepairExeclDto); |
| | | }); |
| | | ExcelUtil<DeviceMaintenanceExeclDto> util = new ExcelUtil<DeviceMaintenanceExeclDto>(DeviceMaintenanceExeclDto.class); |
| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | return AjaxResult.success(statisticsReceivablePayable); |
| | | } |
| | | |
| | | @GetMapping("/approveAndDeviceTodos") |
| | | @ApiOperation("审批协同,设备报修待办事项") |
| | | public AjaxResult approveAndDeviceTodos(){ |
| | | Map<String, Object> map = homeService.approveAndDeviceTodos(); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | List<ApproveProcess> todos() throws ParseException; |
| | | |
| | | StatisticsReceivablePayableDto statisticsReceivablePayable(Integer type); |
| | | |
| | | Map<String, Object> approveAndDeviceTodos(); |
| | | } |
| | |
| | | import com.ruoyi.approve.mapper.ApproveProcessMapper; |
| | | import com.ruoyi.approve.pojo.ApproveProcess; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.device.mapper.DeviceMaintenanceMapper; |
| | | import com.ruoyi.device.mapper.DeviceRepairMapper; |
| | | import com.ruoyi.device.pojo.DeviceMaintenance; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.dto.MapDto; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | | import com.ruoyi.home.dto.*; |
| | |
| | | |
| | | return statisticsReceivablePayableDto; |
| | | } |
| | | |
| | | @Autowired |
| | | private DeviceRepairMapper deviceRepairMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> approveAndDeviceTodos() { |
| | | // 审批协同待办 |
| | | Long aLong = approveProcessMapper.selectCount(new LambdaQueryWrapper<ApproveProcess>() |
| | | .eq(ApproveProcess::getApproveUserCurrentId, SecurityUtils.getUserId()) |
| | | .in(ApproveProcess::getApproveStatus, 0, 1, 3)); |
| | | // 设备报修待办 |
| | | Long aLong1 = deviceRepairMapper.selectCount(new LambdaQueryWrapper<DeviceRepair>() |
| | | .eq(DeviceRepair::getStatus, 0) |
| | | .eq(DeviceRepair::getRepairName, SecurityUtils.getLoginUser().getNickName())); |
| | | return new HashMap<String, Object>() {{ |
| | | put("approveTodo", aLong); |
| | | put("deviceRepairTodo", aLong1); |
| | | }}; |
| | | } |
| | | } |
| | |
| | | @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date inboundDate; |
| | | |
| | | @TableField(exist = false) |
| | | private String timeStr; |
| | | |
| | | /** |
| | | * 待出库数量 |
| | | */ |
| | |
| | | * 入库用户id |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * 入库时间 |
| | |
| | | * 修改者 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | |
| | | customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName()); |
| | | } |
| | | // 筛选入库时间 |
| | | if(customStorage.getInboundDate() != null){ |
| | | customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getInboundDate()); |
| | | if(customStorage.getTimeStr() != null){ |
| | | customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getTimeStr()); |
| | | } |
| | | } |
| | | customStorageLambdaQueryWrapper.orderByDesc(CustomStorage::getCreateTime); |
| | | IPage<CustomStorage> procurementPageDtoIPage = customStorageMapper.selectPage(page, customStorageLambdaQueryWrapper); |
| | | procurementPageDtoIPage.getRecords().forEach(item -> item.setInboundNum0(item.getInboundNum())); |
| | | List<CustomStorage> procurementPageDtos = procurementPageDtoIPage.getRecords(); |
| | |
| | | @Override |
| | | public IPage<CustomStorage> listPageCopyByCustom(Page page, CustomStorage customStorage) { |
| | | LambdaQueryWrapper<CustomStorage> customStorageLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | customStorageLambdaQueryWrapper.groupBy(CustomStorage::getSupplierName, CustomStorage::getProductCategory, CustomStorage::getSpecificationModel); |
| | | customStorageLambdaQueryWrapper.groupBy(CustomStorage::getProductCategory, CustomStorage::getSpecificationModel); |
| | | if(customStorage != null){ |
| | | if(!StringUtils.isEmpty(customStorage.getSupplierName())){ |
| | | customStorageLambdaQueryWrapper.like(CustomStorage::getSupplierName, customStorage.getSupplierName()); |
| | |
| | | customStorageLambdaQueryWrapper.eq(CustomStorage::getInboundDate, customStorage.getInboundDate()); |
| | | } |
| | | } |
| | | customStorageLambdaQueryWrapper.orderByDesc(CustomStorage::getCreateTime); |
| | | IPage<CustomStorage> pageList = customStorageMapper.selectPage(page, customStorageLambdaQueryWrapper); |
| | | List<CustomStorage> procurementPageDtoCopyList = pageList.getRecords(); |
| | | // 计算待入库数量 |
| | |
| | | @ApiModelProperty(value = "排产数量") |
| | | private BigDecimal schedulingNum; |
| | | |
| | | |
| | | /** |
| | | * 工时定额 |
| | | */ |
| | |
| | | private BigDecimal workHours; |
| | | |
| | | /** |
| | | * 产线 |
| | | */ |
| | | @ApiModelProperty(value = "产线") |
| | | private String productionLine; |
| | | |
| | | /** |
| | | * 工序 |
| | | */ |
| | | @ApiModelProperty(value = "工序") |
| | | private String process; |
| | | |
| | | |
| | | /** |
| | | * 排产日期 |
| | | */ |
| | |
| | | package com.ruoyi.production.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | |
| | | * 工序 |
| | | */ |
| | | private String process; |
| | | |
| | | |
| | | /** |
| | | * 产线 |
| | | */ |
| | | private String productionLine; |
| | | /** |
| | | * 排产日期 |
| | | */ |
| | |
| | | salesLedgerWorkLambdaQueryWrapper.in(SalesLedgerWork::getSalesLedgerProductId, collect) |
| | | .ne(SalesLedgerWork::getStatus, 1); |
| | | List<SalesLedgerWork> salesLedgerWorks = salesLedgerWorkMapper.selectList(salesLedgerWorkLambdaQueryWrapper); |
| | | List<SalesLedgerSchedulingDto> list1 = new ArrayList<>(); |
| | | list.getRecords().forEach(i -> { |
| | | // 获取完成数量 |
| | | i.setSuccessNum(salesLedgerWorks |
| | |
| | | .filter(j -> j.getSalesLedgerProductId().equals(i.getSalesLedgerProductId())) |
| | | .map(SalesLedgerWork::getFinishedNum) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | // 状态 = 数量和完工数量比较 |
| | | if(i.getSchedulingNum().compareTo(new BigDecimal(0)) == 0){ |
| | | i.setStatus("未完成"); |
| | | } else if(i.getSchedulingNum().compareTo(i.getSuccessNum()) == 0){ |
| | | i.setStatus("已完成"); |
| | | }else{ |
| | | i.setStatus("生产中"); |
| | | } |
| | | |
| | | // 计算生产总量 = 规格 * 数量 / 1000 |
| | | String[] split = i.getSpecificationModel().split("\\*"); |
| | | if(split.length == 2 && isNumeric(split[0]) && isNumeric(split[1])){ |
| | |
| | | .multiply(new BigDecimal(split[1]) |
| | | .multiply(i.getQuantity()).divide(new BigDecimal(1000),2, RoundingMode.CEILING)); |
| | | i.setTotalProduction(multiply); |
| | | } |
| | | |
| | | // 状态 = 数量和完工数量比较 |
| | | if(i.getSchedulingNum().compareTo(new BigDecimal(0)) == 0){ |
| | | i.setStatus("未完成"); |
| | | } else if(i.getQuantity().compareTo(i.getSchedulingNum()) <= 0){ |
| | | i.setStatus("已完成"); |
| | | }else{ |
| | | i.setStatus("生产中"); |
| | | } |
| | | |
| | | }); |
| | |
| | | .salesLedgerSchedulingId(salesLedgerScheduling.getId()) |
| | | .salesLedgerId(salesLedgerScheduling.getSalesLedgerId()) |
| | | .remark(processSchedulingDto.getRemark()) |
| | | .productionLine(processSchedulingDto.getProductionLine()) |
| | | .type(processSchedulingDto.getType()) |
| | | .loss(processSchedulingDto.getLoss()) |
| | | .receive(processSchedulingDto.getReceive()) |
| | |
| | | |
| | | // 3.查询上传文件 |
| | | LambdaQueryWrapper<CommonFile> salesLedgerFileWrapper = new LambdaQueryWrapper<>(); |
| | | salesLedgerFileWrapper.eq(CommonFile::getCommonId, purchaseLedger.getId()); |
| | | salesLedgerFileWrapper.eq(CommonFile::getCommonId, purchaseLedger.getId()) |
| | | .eq(CommonFile::getType, FileNameType.PURCHASE.getValue()); |
| | | List<CommonFile> salesLedgerFiles = commonFileMapper.selectList(salesLedgerFileWrapper); |
| | | |
| | | // 4. 转换 DTO |
| | |
| | | public IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedgerDto purchaseLedger) { |
| | | IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger); |
| | | purchaseLedgerDtoIPage.getRecords().forEach(purchaseLedgerDto -> { |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, purchaseLedgerDto.getId()).eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue())); |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, purchaseLedgerDto.getId()).eq(CommonFile::getType, FileNameType.PURCHASE.getValue())); |
| | | purchaseLedgerDto.setSalesLedgerFiles(commonFiles); |
| | | }); |
| | | return purchaseLedgerDtoIPage; |
| | |
| | | private String customerContractNo; |
| | | |
| | | /** |
| | | * 发货车牌号 |
| | | */ |
| | | @Excel(name = "发货车牌号") |
| | | @TableField(exist = false) |
| | | private String shippingCarNumber; |
| | | |
| | | /** |
| | | * 项目名称 |
| | | */ |
| | | @Excel(name = "项目名称") |
| | |
| | | |
| | | // 3.查询上传文件 |
| | | LambdaQueryWrapper<CommonFile> salesLedgerFileWrapper = new LambdaQueryWrapper<>(); |
| | | salesLedgerFileWrapper.eq(CommonFile::getCommonId, salesLedger.getId()); |
| | | salesLedgerFileWrapper.eq(CommonFile::getCommonId, salesLedger.getId()) |
| | | .eq(CommonFile::getType, FileNameType.SALE.getValue()); |
| | | List<CommonFile> salesLedgerFiles = commonFileMapper.selectList(salesLedgerFileWrapper); |
| | | |
| | | // 4. 转换 DTO |
| | |
| | | dm.maintenance_actually_name, |
| | | dl.device_name, |
| | | dl.device_model, |
| | | su.user_name as create_user_name |
| | | su.nick_name as create_user_name |
| | | from device_maintenance dm |
| | | left join device_ledger dl on dm.device_ledger_id = dl.id |
| | | left join sys_user su on dm.create_user = su.user_id |
| | |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDto"> |
| | | select |
| | |
| | | </if> |
| | | </where> |
| | | group by t3.supplier_name,t2.product_category,t2.specification_model |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listCopy" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | |
| | | and t1.create_time like concat('%',#{req.timeStr},'%') |
| | | </if> |
| | | </where> |
| | | order by t1.create_time desc |
| | | </select> |
| | | <select id="listPageCopyByProduction" resultType="com.ruoyi.procurementrecord.dto.ProcurementPageDtoCopy"> |
| | | select |
| | |
| | | and t1.create_time <= #{req.endDate} |
| | | </if> |
| | | </where> |
| | | group by t3.customer_name,t2.product_category,t2.specification_model |
| | | group by t2.product_category,t2.specification_model |
| | | order by t1.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | </where> |
| | | GROUP BY T2.id |
| | | <if test="salesLedgerDto.status != null and salesLedgerDto.status.equals('true')"> |
| | | HAVING quantity - schedulingNum > 0 |
| | | </if> |
| | | order by T1.entry_date desc |
| | | </select> |
| | | <select id="list" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingDto"> |
| | | SELECT |
| | |
| | | pl.project_name,pl.entry_date, |
| | | pl.recorder_name, |
| | | pl.contract_amount |
| | | |
| | | order by pl.entry_date desc |
| | | </select> |
| | | <select id="getPaymentRegistrationDtoById" resultType="com.ruoyi.purchase.dto.PaymentRegistrationDto"> |
| | | SELECT |
| | |
| | | T1.contract_amount, |
| | | T1.execution_date, |
| | | T2.nick_name AS entry_person_name, |
| | | T1.payment_method |
| | | T1.payment_method, |
| | | t3.shipping_car_number |
| | | FROM |
| | | sales_ledger T1 |
| | | LEFT JOIN sys_user T2 ON T1.entry_person = T2.user_id |
| | | left join shipping_info t3 on T1.id = t3.sales_ledger_id |
| | | <where> |
| | | <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' "> |
| | | AND T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%') |
| | |
| | | AND T1.entry_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | order by T1.entry_date desc |
| | | </select> |
| | | </mapper> |