Commit bde9cc9c authored by qinhu's avatar qinhu

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleCheck.java
parents e286410e 1c14e234
......@@ -347,7 +347,6 @@ public class EntrustController {
return BaseResponse.errorMsg("失败!");
}
@ApiOperation(value = "数据校核")
@PostMapping("/check")
public BaseResponse check(@RequestBody CheckQuery query) {
......
......@@ -82,15 +82,6 @@ public class Sample implements Serializable {
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("基本元素检测结果")
private String baseResult;
@ApiModelProperty("比表面积校核结果")
private String surfaceResult;
//样品管理列表信息
@ApiModelProperty("样品登记操作人id")
private Integer operatorId;
......@@ -117,6 +108,9 @@ public class Sample implements Serializable {
private Integer isHandle;
@ApiModelProperty("样品是否检测完成(0未检测完成, 1检测完成,)")
private Integer isDistribution;
@ApiModelProperty("样品是否校核完成(0未检测完成, 1检测完成,)")
private Integer isCheck;
......
......@@ -2,7 +2,6 @@ package cn.wise.sc.cement.business.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
......@@ -24,7 +23,7 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class SampleCheck implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID=1L;
/**
* 主键
......@@ -32,17 +31,23 @@ public class SampleCheck implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("样品表d")
private Integer sampleId;
@ApiModelProperty("委托表id")
private Integer entrustId;
@ApiModelProperty("本所编号")
private String cementCode;
@ApiModelProperty("处理人id")
private Integer userId;
@ApiModelProperty("检测组id")
private Integer teamGroupId;
@ApiModelProperty("检测设备表id")
private Integer equipmentId;
@ApiModelProperty("检测组名称")
private String teamGroupName;
@ApiModelProperty("检测设备名称")
private String equipmentName;
@ApiModelProperty("最终校核计算结果json串")
private String countResult;
@ApiModelProperty("是否平行样(1是,0否)")
private Integer isParallel;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
......@@ -50,4 +55,9 @@ public class SampleCheck implements Serializable {
@ApiModelProperty("备注")
private String remark;
}
......@@ -31,27 +31,27 @@ public class SampleCheckTeam implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("样品检测表id")
@ApiModelProperty("校核表id")
private Integer checkId;
@ApiModelProperty("检测组id")
private Integer teamGroupId;
@ApiModelProperty("样品表d")
private Integer sampleId;
@ApiModelProperty("检测组名称")
private String teamGroupName;
@ApiModelProperty("处理人id")
private Integer userId;
@ApiModelProperty("检测设备表id")
private Integer equipmentId;
@ApiModelProperty("检测设备名称")
private String equipmentName;
/**
* json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/
@ApiModelProperty("主样检测结果 json串")
private String main_result;
@ApiModelProperty("次样检测结果json串")
private String secondary_result;
@ApiModelProperty("最终校核计算结果json串")
private String end_result;
@ApiModelProperty("校核人员输入检测结果 json串")
private String inputResult;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
......
......@@ -37,15 +37,18 @@ public interface SampleMapper extends BaseMapper<Sample> {
" and is_handle != 1 order by id asc")
List<Sample> getNoHandleList(Integer entrustId);
@Select("select * from sample where entrust_id = #{entrustId} and is_check != 1 order by id asc")
@Select("select * from sample where entrust_id = #{entrustId} and is_distribution != 1 order by id asc")
List<Sample> getNoDistributionList(Integer entrustId);
//校核详情样品列表(不展示平行样副样)
@Select("select * from sample where cement_code = parallel_code and entrust_id = #{entrustId} " +
"and is_handle = 1 and is_check = 1 order by id asc")
"and is_handle = 1 and is_distribution = 1 order by id asc")
List<Sample> getCheckSampleList(Integer entrustId);
@Select("select * from sample where entrust_id = #{entrustId} and is_check != 1 order by id asc")
List<Sample> getNoCheckList(Integer entrustId);
}
......@@ -12,17 +12,14 @@ import java.util.List;
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel("委托-校核请求")
@ApiModel("数据校核-委托单请求")
public class CheckQuery {
@ApiModelProperty("委托表id")
private Integer id;
/**
* 样品原始数据
*/
@ApiModelProperty("样品原始数据列表")
private List<SampleCheckQuery> sampleCheckQueryList;
@ApiModelProperty("检测组信息列表")
private List<SampleCheckTeamQuery> sampleCheckTeamQueryList;
......
package cn.wise.sc.cement.business.model.query;
/*package cn.wise.sc.cement.business.model.query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -6,33 +6,18 @@ import lombok.Data;
import java.util.List;
/**
*//**
* @description:
* @author: ztw
* @create: 2020-08-07 14:58
**/
**//*
@Data
@ApiModel("委托校核-样品原始数据请求")
@ApiModel("数据校核-样品信息")
public class SampleCheckQuery {
@ApiModelProperty("样品表d")
private Integer sampleId;
@ApiModelProperty("检测人员id")
private String userId;
@ApiModelProperty("检测设备表id")
private Integer equipmentId;
@ApiModelProperty("基本元素检测结果 json串")
private String baseResult;
@ApiModelProperty("比表面积校核结果 json串")
private String surfaceResult;
@ApiModelProperty("检测样品信息列表")
@ApiModelProperty("检测组信息-type页")
public List<SampleCheckTeamQuery> sampleCheckTeamQueryList;
}
}*/
......@@ -23,13 +23,15 @@ import java.util.Map;
* @since 2020-08-24
*/
@Data
@ApiModel("委托校核-检测样品")
@ApiModel("数据校核-检测组信息")
public class SampleCheckTeamQuery {
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("本所编号")
private String cementCode;
@ApiModelProperty("是否平行样(1是,0否)")
private Integer isParallel;
@ApiModelProperty("检测组id")
private Integer teamGroupId;
......@@ -37,21 +39,43 @@ public class SampleCheckTeamQuery {
@ApiModelProperty("检测组名称")
private String teamGroupName;
@ApiModelProperty("主样-检测人员id")
private Integer mainUserId;
@ApiModelProperty("次样-检测人员id")
private Integer secondaryUserId;
@ApiModelProperty("主样-检测设备表id")
private Integer mainEquipmentId;
@ApiModelProperty("主样-检测设备名称")
private String mainEquipmentName;
@ApiModelProperty("次样-检测设备表id")
private Integer secondaryEquipmentId;
@ApiModelProperty("次样-检测设备名称")
private String secondaryEquipmentName;
@ApiModelProperty("主样-样品表d")
private Integer mainSampleId;
/**
* json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/
@ApiModelProperty("主样检测结果 json串")
@ApiModelProperty("主样检测结果 Map集合")
private Map<String, Object> mainResult;
@ApiModelProperty("次样检测结果json串")
private JSONArray secondaryResult;
@ApiModelProperty("次样-样品表d")
private Integer secondarySampleId;
@ApiModelProperty("最终校核计算结果json串")
private JSONArray endResult;
@ApiModelProperty("次样检测结果 Map集合")
private Map<String, Object>secondaryResult;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("最终校核计算结果 Map集合")
private Map<String, Object> endResult;
}
......@@ -13,7 +13,7 @@ import java.util.List;
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel("校核-检测组Vo")
@ApiModel("校核-检测组和用户Vo")
public class SampleCheckGroupVo {
@ApiModelProperty("检测组id")
......@@ -28,14 +28,7 @@ public class SampleCheckGroupVo {
@ApiModelProperty("检测人姓名")
private String userName;
@ApiModelProperty("校核元素 json串")
private String checkElement;
@ApiModelProperty("校核元素 json数组")
private JSONArray checkElementList;
@ApiModelProperty("校核结果 json串")
private List<String> checkResult;
}
package cn.wise.sc.cement.business.model.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description:
* @author: qh
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel("校核-检测组列表Vo")
public class SampleCheckTeamVo {
@ApiModelProperty("校核表id")
private Integer checkId;
@ApiModelProperty("样品表d")
private Integer sampleId;
@ApiModelProperty("检测人id")
private Integer userId;
@ApiModelProperty("检测人姓名")
private String userName;
@ApiModelProperty("检测设备表id")
private Integer equipmentId;
@ApiModelProperty("检测设备名称")
private String equipmentName;
/**
* json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/
@ApiModelProperty("校核人员输入检测结果 json串")
private String inputResult;
}
......@@ -18,32 +18,29 @@ import java.util.List;
@ApiModel("校核-样品Vo")
public class SampleCheckVo {
@ApiModelProperty("样品表id")
private Integer id;
@ApiModelProperty("委托表id")
private Integer entrustId;
@ApiModelProperty("样品名")
private String name;
@ApiModelProperty("来样编号")
private String sampleCode;
private String sampleName;
@ApiModelProperty("本所编号")
private String cementCode;
@ApiModelProperty("平行样编号")
private String parallelCode;
@ApiModelProperty("检测组列表")
public List<SampleCheckGroupVo> sampleCheckGroupVoList;
@ApiModelProperty("检测组id")
private Integer teamGroupId;
@ApiModelProperty("检测组名称")
private String teamGroupName;
@ApiModelProperty("最终校核计算结果json串")
private String countResult;
@ApiModelProperty("是否平行样(1是,0否)")
private Integer isParallel;
@ApiModelProperty("检测组列表")
public List<SampleCheckTeamVo> sampleCheckGroupVoList;
}
......@@ -200,17 +200,23 @@ public class CommonServiceImpl {
countMap.put(name,CheckCountUtil.checkCount(name,resultMap));
}else if(name.equals("Aad2")) {
countMap.put(name, CheckCountUtil.checkCount(name, resultMap));
}else if(name.equals("焦渣")){
countMap.put(name, CheckCountUtil.checkCount(name, resultMap));
}else if(name.equals("St,ad")){
countMap.put(name, CheckCountUtil.checkCount(name, resultMap));
}else if(name.equals("易磨性等级")){
countMap.put(name, CheckCountUtil.countYMXGrade(resultMap));
}else if(name.equals("易磨性校验码")){
countMap.put(name, CheckCountUtil.countYMXCode(resultMap));
}
}
//输出检测项第二次循环
for(String name : checkResutlList){
if(name.equals("SO3")){
BigDecimal countSO3 = CheckCountUtil.countSO3(countMap);
BigDecimal countSO3 = CheckCountUtil.countSO3(resultMap, countMap);
countMap.put(name, countSO3);
}else if(name.equals("KH")){
BigDecimal countKH = CheckCountUtil.countKH(countMap);
......@@ -322,14 +328,12 @@ public class CommonServiceImpl {
}
//输出检测项第九次循环
//todo countQnet_adMJ_kg
/*for(String name : checkResutlList){
for(String name : checkResutlList){
if(name.equals("Qnet,ad MJ/kg")){
BigDecimal countQnet_adMJ_kg = CheckCountUtil.countQnet_adMJ_kg(countMap);
BigDecimal countQnet_adMJ_kg = CheckCountUtil.countQnet_adMJ_kg(resultMap, countMap);
countMap.put(name, countQnet_adMJ_kg);
}
}
*/
......
......@@ -122,7 +122,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
//标样入库记录添加
LoginUser loginUser = userService.getLoginUser();
StandardEnter enter = new StandardEnter();
enter.setStandardId(query.getId())
enter.setStandardId(standard.getId())
.setUserId(loginUser.getId())
.setEnterNum(query.getStockNum())
.setCreateTime(LocalDateTime.now())
......
package cn.wise.sc.cement.business.util;
import com.sun.org.apache.bcel.internal.generic.RETURN;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.*;
......@@ -262,20 +263,30 @@ public class CheckCountUtil {
//计算的核心公式结果
BigDecimal countResult = SZ_A2.subtract(MZ_A2).divide(YZ_A2);
endResult = countResult.multiply(param100);
}else if(name.equals("焦渣")){
endResult = getBigDecimal(resultMap.get("焦渣特征"));
}else if(name.equals("St,ad")){
endResult = getBigDecimal(resultMap.get("显示值"));
}
return endResult;
}
/**
* 求SO3
* @param resultMap
* @param countMap
* @return
*/
public static BigDecimal countSO3(Map<String, Object> countMap) {
public static BigDecimal countSO3(Map<String, Object> resultMap, Map<String, Object> countMap) {
BigDecimal weightSO3 = getBigDecimal(countMap.get("重量法_SO3"));
BigDecimal displaySO3= getBigDecimal(countMap.get("显示值"));
BigDecimal mSO3= getBigDecimal(countMap.get("样重SO3"));
BigDecimal displaySO3= getBigDecimal(resultMap.get("显示值"));
BigDecimal mSO3= getBigDecimal(resultMap.get("样重SO3"));
BigDecimal elseResult = displaySO3.multiply(new BigDecimal(2.5));
BigDecimal countResult = weightSO3.compareTo(new BigDecimal(0))==1?
weightSO3:elseResult;
......@@ -395,8 +406,8 @@ public class CheckCountUtil {
BigDecimal Mad1= getBigDecimal(countMap.get("Mad1"));
BigDecimal Mad2= getBigDecimal(countMap.get("Mad2"));
//计算Mad1 和 Mad2 的平均值
BigDecimal MadAve = Mad1.add(Mad2).divide(new BigDecimal(2));
return MadAve;
BigDecimal BC_Mad = Mad1.add(Mad2).divide(new BigDecimal(2));
return BC_Mad;
}
/**
......@@ -405,15 +416,15 @@ public class CheckCountUtil {
* @return
*/
public static BigDecimal countMad(Map<String, Object> countMap) {
BigDecimal MadAve= getBigDecimal(countMap.get("报出_Mad"));
BigDecimal BC_Mad= getBigDecimal(countMap.get("报出_Mad"));
//判断奇偶数的最终值
BigDecimal result1 = MadAve.multiply(param100);
BigDecimal result1 = BC_Mad.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
BigDecimal Mad = null;
if((resultInt1&1) == 1){ //如果结果为奇数
Mad = MadAve.setScale(2,BigDecimal.ROUND_HALF_UP);
Mad = BC_Mad.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
Mad = MadAve.subtract(new BigDecimal(0.00000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
Mad = BC_Mad.subtract(new BigDecimal(0.00000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
return Mad;
}
......@@ -427,8 +438,8 @@ public class CheckCountUtil {
BigDecimal Aad1= getBigDecimal(countMap.get("Aad1"));
BigDecimal Aad2= getBigDecimal(countMap.get("Aad2"));
//计算Mad1 和 Mad2 的平均值
BigDecimal AadAve = Aad1.add(Aad2).divide(new BigDecimal(2));
return AadAve;
BigDecimal BC_Aad = Aad1.add(Aad2).divide(new BigDecimal(2));
return BC_Aad;
}
/**
......@@ -437,15 +448,15 @@ public class CheckCountUtil {
* @return
*/
public static BigDecimal countAad(Map<String, Object> countMap) {
BigDecimal AadAve= getBigDecimal(countMap.get("报出_Aad"));
BigDecimal BC_Aad= getBigDecimal(countMap.get("报出_Aad"));
//判断奇偶数的最终值
BigDecimal result1 = AadAve.multiply(param100);
BigDecimal result1 = BC_Aad.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
BigDecimal Aad = null;
if((resultInt1&1) == 1){ //如果结果为奇数
Aad = AadAve.setScale(2,BigDecimal.ROUND_HALF_UP);
Aad = BC_Aad.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
Aad = AadAve.subtract(new BigDecimal(0.00000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
Aad = BC_Aad.subtract(new BigDecimal(0.00000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
return Aad;
}
......@@ -493,8 +504,8 @@ public class CheckCountUtil {
BigDecimal Vad1= getBigDecimal(countMap.get("Vad1"));
BigDecimal Vad2= getBigDecimal(countMap.get("Vad2"));
//计算Vad1 和 Vad2 的平均值
BigDecimal VadAve = Vad1.add(Vad2).divide(new BigDecimal(2));
return VadAve;
BigDecimal BC_Vad = Vad1.add(Vad2).divide(new BigDecimal(2));
return BC_Vad;
}
/**
......@@ -503,15 +514,15 @@ public class CheckCountUtil {
* @return
*/
public static BigDecimal countVad(Map<String, Object> countMap) {
BigDecimal VadAve= getBigDecimal(countMap.get("报出_Vad"));
BigDecimal BC_Vad= getBigDecimal(countMap.get("报出_Vad"));
//判断奇偶数的最终值
BigDecimal result1 = VadAve.multiply(param100);
BigDecimal result1 = BC_Vad.multiply(param100);
int resultInt1 = result1.setScale( 0, BigDecimal.ROUND_DOWN ).intValue();
BigDecimal Vad = null;
if((resultInt1&1) == 1){ //如果结果为奇数
Vad = VadAve.setScale(2,BigDecimal.ROUND_HALF_UP);
Vad = BC_Vad.setScale(2,BigDecimal.ROUND_HALF_UP);
}else{
Vad = VadAve.subtract(new BigDecimal(0.00000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
Vad = BC_Vad.subtract(new BigDecimal(0.00000000001)).setScale(2,BigDecimal.ROUND_HALF_UP);
}
return Vad;
}
......@@ -697,6 +708,96 @@ public class CheckCountUtil {
return count;
}
/**
* 求Qnet,ad MJ/kg
* @param countMap
* @return
*/
public static BigDecimal countQnet_adMJ_kg(Map<String, Object> resultMap, Map<String, Object> countMap) {
BigDecimal YWH_123= getBigDecimal(resultMap.get("烟无褐123"));
BigDecimal K1_= getBigDecimal(countMap.get("K1,"));
BigDecimal BC_Mad= getBigDecimal(countMap.get("报出_Mad"));
BigDecimal BC_Aad= getBigDecimal(countMap.get("报出_Aad"));
BigDecimal BC_Vad= getBigDecimal(countMap.get("报出_Vad"));
BigDecimal K= getBigDecimal(countMap.get("K"));
BigDecimal _40Mad_0_1= getBigDecimal(countMap.get("40Mad 0或1"));
BigDecimal K0_= getBigDecimal(countMap.get("K0,"));
BigDecimal value = null;
if(YWH_123.compareTo(new BigDecimal(3))==0){
value =param100.multiply(K1_).subtract(K1_.add(new BigDecimal(6)).multiply(BC_Mad.add(BC_Aad)))
.subtract(BC_Vad);
} else if(YWH_123.compareTo(new BigDecimal(1))==0){
value =param100.multiply(K).subtract(K.add(new BigDecimal(6)).multiply(BC_Mad.add(BC_Aad)))
.subtract(new BigDecimal(3).multiply(BC_Vad))
.subtract(new BigDecimal(40).multiply(BC_Mad).multiply(_40Mad_0_1));
}else if(YWH_123.compareTo(new BigDecimal(2))==0){
value =K0_.subtract(new BigDecimal(86).multiply(BC_Mad))
.subtract(new BigDecimal(92).multiply(BC_Aad))
.subtract(new BigDecimal(24).multiply(BC_Vad));
}
BigDecimal count = value.multiply(new BigDecimal(4.1816)).divide(param1000);
return count;
}
/**
* 求易磨性等级
* @param resultMap
* @return
*/
public static String countYMXGrade(Map<String, Object> resultMap) {
BigDecimal YMX_kWh_t = getBigDecimal(resultMap.get("易磨性(kWh/t)"));
if(YMX_kWh_t.compareTo(new BigDecimal(18))==1){
return "E";
}else if(YMX_kWh_t.compareTo(new BigDecimal(13))==1){
return "D";
}else if(YMX_kWh_t.compareTo(new BigDecimal(10))==1){
return "C";
}else if(YMX_kWh_t.compareTo(new BigDecimal(8))==1){
return "B";
}else{
return "A";
}
}
/**
* 求易磨性校验码
* @param resultMap
* @return
*/
public static String countYMXCode(Map<String, Object> resultMap) {
Double G = Double.valueOf(resultMap.get("G").toString());
Double P80 = Double.valueOf(resultMap.get("P80").toString());
Double F80 = Double.valueOf(resultMap.get("F80").toString());
BigDecimal YMX_kWh_t = getBigDecimal(resultMap.get("易磨性(kWh/t)"));
BigDecimal YMX_MJ_t = getBigDecimal(resultMap.get("易磨性(MJ/t)"));
Double countResult =
Math.pow(80,0.23)*Math.pow(G,0.82)*(10/(Math.pow(P80,0.5)- 10/Math.pow(F80,0.5)));
BigDecimal result1 = new BigDecimal(countResult);
BigDecimal value1 =
new BigDecimal(176.2).divide(result1).subtract(new BigDecimal(3.6).multiply(new BigDecimal(P80))).abs();
BigDecimal value2 = YMX_MJ_t.divide(YMX_kWh_t);
if(value1.compareTo(new BigDecimal(0.5) ) == -1 &&
value2.compareTo(new BigDecimal(3.5)) == 1 &&
value2.compareTo(new BigDecimal(3.7)) == -1){
return "OK";
}else{
return "出错了";
}
}
}
......
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