src/main/java/com/ruoyi/device/dto/DeviceMaintenanceDto.java
@@ -13,7 +13,6 @@ @ApiModelProperty("设备保养id") private Long id; @ApiModelProperty("设备台账id") @@ -41,7 +40,7 @@ private String maintenanceActuallyTimeReq; @ApiModelProperty("保养结果 0 维修 1 完好") private Integer maintenanceResult; private String maintenanceResult; @ApiModelProperty("状态 0 待保养 1 完结") private Integer status; src/main/java/com/ruoyi/device/pojo/DeviceMaintenance.java
@@ -41,7 +41,7 @@ private LocalDateTime maintenanceActuallyTime; @ApiModelProperty("保养结果 0 维修 1 完好") private Integer maintenanceResult; private String maintenanceResult; @ApiModelProperty("状态 0 待保养 1 完结") private Integer status; src/main/java/com/ruoyi/device/service/impl/DeviceMaintenanceServiceImpl.java
@@ -60,8 +60,7 @@ 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); src/main/java/com/ruoyi/home/controller/HomeController.java
@@ -23,6 +23,7 @@ import java.text.ParseException; import java.util.List; import java.util.Map; /** * @author :yys @@ -77,5 +78,12 @@ return AjaxResult.success(statisticsReceivablePayable); } @GetMapping("/approveAndDeviceTodos") @ApiOperation("审批协同,设备报修待办事项") public AjaxResult approveAndDeviceTodos(){ Map<String, Object> map = homeService.approveAndDeviceTodos(); return AjaxResult.success(map); } } src/main/java/com/ruoyi/home/service/HomeService.java
@@ -8,6 +8,7 @@ import java.text.ParseException; import java.util.List; import java.util.Map; /** * @author :yys @@ -26,4 +27,6 @@ List<ApproveProcess> todos() throws ParseException; StatisticsReceivablePayableDto statisticsReceivablePayable(Integer type); Map<String, Object> approveAndDeviceTodos(); } src/main/java/com/ruoyi/home/service/impl/HomeServiceImpl.java
@@ -4,6 +4,10 @@ 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.*; @@ -409,4 +413,23 @@ 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); }}; } } src/main/java/com/ruoyi/procurementrecord/pojo/CustomStorage.java
@@ -29,6 +29,9 @@ @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd") private Date inboundDate; @TableField(exist = false) private String timeStr; /** * 待出库数量 */ @@ -83,7 +86,7 @@ * 入库用户id */ @TableField(fill = FieldFill.INSERT) private Long createUser; private Integer createUser; /** * 入库时间 @@ -97,7 +100,7 @@ * 修改者 */ @TableField(fill = FieldFill.INSERT_UPDATE) private Long updateUser; private Integer updateUser; /** * 修改时间 src/main/java/com/ruoyi/procurementrecord/service/impl/ProcurementRecordServiceImpl.java
@@ -464,8 +464,8 @@ 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); src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java
@@ -30,7 +30,6 @@ @ApiModelProperty(value = "排产数量") private BigDecimal schedulingNum; /** * 工时定额 */ @@ -38,10 +37,18 @@ private BigDecimal workHours; /** * 产线 */ @ApiModelProperty(value = "产线") private String productionLine; /** * 工序 */ @ApiModelProperty(value = "工序") private String process; /** * 排产日期 */ src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
@@ -1,6 +1,7 @@ package com.ruoyi.production.pojo; import com.baomidou.mybatisplus.annotation.*; import io.swagger.annotations.ApiModelProperty; import lombok.Builder; import lombok.Data; @@ -67,6 +68,12 @@ * 工序 */ private String process; /** * 产线 */ private String productionLine; /** * 排产日期 */ src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
@@ -66,6 +66,7 @@ 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 @@ -73,14 +74,7 @@ .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])){ @@ -88,6 +82,15 @@ .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("生产中"); } }); @@ -339,6 +342,7 @@ .salesLedgerSchedulingId(salesLedgerScheduling.getId()) .salesLedgerId(salesLedgerScheduling.getSalesLedgerId()) .remark(processSchedulingDto.getRemark()) .productionLine(processSchedulingDto.getProductionLine()) .type(processSchedulingDto.getType()) .loss(processSchedulingDto.getLoss()) .receive(processSchedulingDto.getReceive()) src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
@@ -20,7 +20,7 @@ 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 src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
@@ -43,6 +43,10 @@ </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