Commit 2037ac40 authored by renchao's avatar renchao
parents f46bda85 291f1cfa
...@@ -43,13 +43,13 @@ public class TMaterialOutQuery { ...@@ -43,13 +43,13 @@ public class TMaterialOutQuery {
private String processesName; private String processesName;
/** /**
* 材料消耗的类型,包括燃料及动力、润滑察试、配件、工具、火工材料、电力和其它等 * 材料消耗的类型,包括燃料及动力、润滑察试、配件、工具、火工材料、电力和其它等 ==== 项目
*/ */
@ApiModelProperty("材料消耗的类型,包括燃料及动力、润滑察试、配件、工具、火工材料、电力和其它等") @ApiModelProperty("材料消耗的类型,包括燃料及动力、润滑察试、配件、工具、火工材料、电力和其它等")
private String consumeType; private String consumeType;
/** /**
* 材料消耗日期 * 材料消耗日期 ====材料领用日期
*/ */
@ApiModelProperty("材料消耗日期") @ApiModelProperty("材料消耗日期")
private LocalDateTime consumeDate; private LocalDateTime consumeDate;
......
...@@ -80,8 +80,11 @@ public class TSafeTroubleServiceImpl extends ServiceImpl<TSafeTroubleMapper, TSa ...@@ -80,8 +80,11 @@ public class TSafeTroubleServiceImpl extends ServiceImpl<TSafeTroubleMapper, TSa
safeTroubleMapper.insert(safeTrouble); safeTroubleMapper.insert(safeTrouble);
//保存隐患图片 //保存隐患图片
List<MultipartFile> photos = ((MultipartHttpServletRequest) request).getFiles("photos"); List<MultipartFile> photos = ((MultipartHttpServletRequest) request).getFiles("photos");
return saveImg(TSafeTroubleImg.ImgType.YH, safeTrouble.getUid(), photos); if (photos != null && photos.size() > 0) {
return saveImg(TSafeTroubleImg.ImgType.YH, safeTrouble.getUid(), photos);
}
return R.ok();
} }
...@@ -100,8 +103,11 @@ public class TSafeTroubleServiceImpl extends ServiceImpl<TSafeTroubleMapper, TSa ...@@ -100,8 +103,11 @@ public class TSafeTroubleServiceImpl extends ServiceImpl<TSafeTroubleMapper, TSa
safeTroubleMapper.updateById(safeTrouble); safeTroubleMapper.updateById(safeTrouble);
//保存隐患图片 //保存隐患图片
List<MultipartFile> photos = ((MultipartHttpServletRequest) request).getFiles("photos"); List<MultipartFile> photos = ((MultipartHttpServletRequest) request).getFiles("photos");
return saveImg(TSafeTroubleImg.ImgType.ZG, safeTrouble.getUid(), photos); if (photos != null && photos.size() > 0) {
return saveImg(TSafeTroubleImg.ImgType.ZG, safeTrouble.getUid(), photos);
}
return R.ok();
} }
......
...@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; ...@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.time.format.DateTimeFormatter;
/** /**
* <p> * <p>
...@@ -156,9 +157,33 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora ...@@ -156,9 +157,33 @@ public class TSampleLaboratorysheetServiceImpl extends ServiceImpl<TSampleLabora
if (tSampleLaboratorysheet == null) { if (tSampleLaboratorysheet == null) {
return R.failed("数据不存在,样号:" + query.getYh()); return R.failed("数据不存在,样号:" + query.getYh());
} }
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String content = "";
if(tSampleLaboratorysheet != null){
//上标 下标 ₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ⁻
String yh = "样号:"+( tSampleLaboratorysheet.getYh()!= null?tSampleLaboratorysheet.getYh():"") +" \n ";
content = yh+
"化验室编号:"+( tSampleLaboratorysheet.getLaboratoryID()!= null?tSampleLaboratorysheet.getLaboratoryID():"") +" \n "+
"CaO:"+( tSampleLaboratorysheet.getCao()!= null?tSampleLaboratorysheet.getCao():"") +" \n "+
"MgO:"+( tSampleLaboratorysheet.getMgO()!= null?tSampleLaboratorysheet.getMgO():"") +" \n "+
"SiO₂:"+( tSampleLaboratorysheet.getSiO2()!= null?tSampleLaboratorysheet.getSiO2():"") +" \n "+
"Al₂O₃:"+( tSampleLaboratorysheet.getAl2O3()!= null?tSampleLaboratorysheet.getAl2O3():"") +" \n "+
"Fe₂O₃:"+( tSampleLaboratorysheet.getFe2O3()!= null?tSampleLaboratorysheet.getFe2O3():"") +" \n "+
"K₂O:"+( tSampleLaboratorysheet.getK2o()!= null?tSampleLaboratorysheet.getK2o():"") +" \n "+
"Na₂O:"+( tSampleLaboratorysheet.getNa2O()!= null?tSampleLaboratorysheet.getNa2O():"") +" \n "+
"SO₃:"+( tSampleLaboratorysheet.getSo3()!= null?tSampleLaboratorysheet.getSo3():"") +" \n "+
"Cl⁻:"+( tSampleLaboratorysheet.getCl()!= null?tSampleLaboratorysheet.getCl():"") +" \n "+
"烧失量:"+( tSampleLaboratorysheet.getSsl()!= null?tSampleLaboratorysheet.getSsl():"") +" \n "+
"收样时间:"+( tSampleLaboratorysheet.getSysj()!= null?df.format(tSampleLaboratorysheet.getSysj()):"") +" \n "+
"化验人:"+( tSampleLaboratorysheet.getHyr()!= null?tSampleLaboratorysheet.getHyr():"") +" \n "+
"化验时间:"+( tSampleLaboratorysheet.getHysj()!= null?df.format(tSampleLaboratorysheet.getHysj()):"");
}
//获取二维码或者记录形式 //获取二维码或者记录形式
//先生成二维码并且放到实体中 //先生成二维码并且放到实体中
tSampleLaboratorysheet.setQRCode(ImageUtil.QRCodeGenerator(JSON.toJSONString(tSampleLaboratorysheet))); // tSampleLaboratorysheet.setQRCode(ImageUtil.QRCodeGenerator(JSON.toJSONString(tSampleLaboratorysheet)));
tSampleLaboratorysheet.setQRCode(ImageUtil.QRCodeGenerator(content));
//下载图片 //下载图片
ImageUtil.getImage(ProjectEnum.ImageType.QR_CODE.getValue(), tSampleLaboratorysheet, response); ImageUtil.getImage(ProjectEnum.ImageType.QR_CODE.getValue(), tSampleLaboratorysheet, response);
//如果下载失败才会执行return //如果下载失败才会执行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