Commit 47379ad3 authored by helinlin's avatar helinlin

修改气瓶系统bug

parent a44c3537
package com.yeejoin.amos.boot.module.tzs.config;
import org.springframework.context.annotation.Configuration;
/**
* @description:
* @author: tw
* @createDate: 2022/3/31
*/
@Configuration
public class MybatisPlusConfiguration {
/**
* plus分页插件支持
*/
/*@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return mybatisPlusInterceptor;
}*/
}
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
......@@ -15,7 +16,7 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="CylinderFillingCheckDataUnitDto", description="气瓶充装检查情况统计表-企业")
@ApiModel(value = "CylinderFillingCheckDataUnitDto", description = "气瓶充装检查情况统计表-企业")
public class CylinderFillingCheckDataUnitDto extends BaseDto {
private static final long serialVersionUID = 1L;
......@@ -23,13 +24,24 @@ public class CylinderFillingCheckDataUnitDto extends BaseDto {
@ApiModelProperty(value = "充装次数")
private Long totalSum;
@ApiModelProperty(value = "充装次数*2(充装检查合格率组态配置temp字段)")
private Long totalSumDouble;
@ApiModelProperty(value = "充装前检查数")
private Long fillingCount;
@ApiModelProperty(value = "充装前检查率")
private Double fillingPercent;
@ApiModelProperty(value = "充装后检查数")
private Long fillingCheckCount;
@ApiModelProperty(value = "充装后检查率")
private Double fillingCheckPercent;
@ApiModelProperty(value = "充装检查合格数")
private Long fillingPassedCount;
@ApiModelProperty(value = "充装检查合格率")
private Double fillingPassedPercent;
@ApiModelProperty(value = "企业编码")
private String appId;
......@@ -41,8 +53,4 @@ public class CylinderFillingCheckDataUnitDto extends BaseDto {
@ApiModelProperty(value = "充装月份")
private String fillingMonth;
@ApiModelProperty(value = "充装检查合格率")
private Double fillingPassedPercent;
}
......@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
......@@ -29,18 +30,47 @@ public class CylinderFillingCheckDataUnit extends BaseEntity {
private Long totalSum;
/**
* 充装次数*2(充装检查合格率组态配置temp字段)
*/
@TableField("total_sum_double")
private Long totalSumDouble;
/**
* 充装前检查数
*/
@TableField("filling_count")
private Long fillingCount;
/**
* 充装前检查率
*/
@TableField("filling_percent")
private Double fillingPercent;
/**
* 充装后检查数
*/
@TableField("filling_check_count")
private Long fillingCheckCount;
/**
* 充装后检查率
*/
@TableField("filling_check_percent")
private Double fillingCheckPercent;
/**
* 充装检查合格数
*/
@TableField("filling_passed_count")
private Long fillingPassedCount;
/**
* 充装检查合格率
*/
@TableField("filling_passed_percent")
private Double fillingPassedPercent;
/**
* 企业编码
*/
@TableField("app_id")
......@@ -63,11 +93,4 @@ public class CylinderFillingCheckDataUnit extends BaseEntity {
*/
@TableField("filling_month")
private String fillingMonth;
/**
* 充装检查合格率
*/
@TableField("filling_passed_percent")
private Double fillingPassedPercent;
}
......@@ -437,7 +437,7 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
}
/**
* 装详情按单位统计
* 装详情按单位统计
*/
@Transactional(rollbackFor = Exception.class)
@Scheduled(cron = "0 0 2 * * ?")
......@@ -456,22 +456,24 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
String monthStr = month < 10 ? "0" + month : month + "";
temp.setFillingMonth(monthStr);
temp.setFillingYear(year);
Integer thisMonth = cylinderFillingRecordServiceImpl.getFillingCountByMonth(cylinderUnit.getAppId(), c.getTime());
temp.setTotalSum((long) thisMonth);
Integer countThisMonth = cylinderFillingRecordServiceImpl.getFillingCountByMonth(cylinderUnit.getAppId(), c.getTime());
temp.setTotalSum((long) countThisMonth);
// 获取本月数据
Integer fillingCount = cylinderFillingServiceImpl.getFillingCountByMonth(cylinderUnit.getAppId(), c.getTime());
Integer fillingCheckCount = cylinderFillingCheckServiceImpl.getFillingCountByMonth(cylinderUnit.getAppId(), c.getTime());
// 充装前检查率:充装前检查次数/充装次数
double before = 0d;
if (thisMonth != 0) {
before = (double) (fillingCount) / (double) thisMonth;
if (countThisMonth != 0) {
before = (double) (fillingCount) / (double) countThisMonth;
}
temp.setFillingCount((long) fillingCount);
temp.setFillingPercent(before * 100);
// 充装后检查率:充装后检查次数/充装次数
double after = 0d;
if (thisMonth != 0) {
after = (double) (fillingCheckCount) / (double) thisMonth;
if (countThisMonth != 0) {
after = (double) (fillingCheckCount) / (double) countThisMonth;
}
temp.setFillingCheckCount((long) fillingCheckCount);
temp.setFillingCheckPercent(after * 100);
// 充装合格率:充装前检查合格次数+充装后检查合格次数/2*充装次数
double passed = 0d;
......@@ -479,9 +481,11 @@ public class CylinderInfoServiceImpl extends BaseService<CylinderInfoDto, Cylind
Integer fillingPassedCount = cylinderFillingServiceImpl.getFillingPassedCountByMonth(cylinderUnit.getAppId(), c.getTime());
// 充装后检查合格次数
Integer fillingCheckPassedCount = cylinderFillingCheckServiceImpl.getFillingPassedCountByMonth(cylinderUnit.getAppId(), c.getTime());
if (thisMonth != 0) {
passed = ((double) (fillingPassedCount) + (double) fillingCheckPassedCount) / (double) (2 * thisMonth);
if (countThisMonth != 0) {
passed = ((double) (fillingPassedCount) + (double) fillingCheckPassedCount) / (double) (2 * countThisMonth);
}
temp.setFillingPassedCount((long) (fillingPassedCount + fillingCheckPassedCount));
temp.setTotalSumDouble((long) 2 * countThisMonth);
temp.setFillingPassedPercent(passed * 100);
temp.setAppId(cylinderUnit.getAppId());
c.add(Calendar.MONTH, -1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment