|
|
@@ -12,12 +12,16 @@ import cn.start.tz.module.pressure2.dal.mysql.equipboiler.EquipBoilerMapper;
|
|
|
import cn.start.tz.module.pressure2.service.dynamicOFData.IDynamicOFData;
|
|
|
import cn.start.tz.module.pressure2.service.dynamicOFData.util.AutoDataBoilerService;
|
|
|
import cn.start.tz.module.pressure2.service.dynamicOFData.util.GenerateReportJsonService;
|
|
|
+import cn.start.tz.module.system.api.clientunit.ClientUnitApi;
|
|
|
+import cn.start.tz.module.system.api.clientunit.dto.ClientUnitDTO;
|
|
|
import cn.start.tz.module.system.api.user.AdminUserApi;
|
|
|
import cn.start.tz.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+
|
|
|
/**
|
|
|
* 电站锅炉内部检验记录
|
|
|
*/
|
|
|
@@ -39,9 +43,15 @@ public class QC10101_202401ReportOFData implements IDynamicOFData {
|
|
|
@Resource
|
|
|
private GenerateReportJsonService generateReportJsonService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private BoilerTaskOrderMapper boilerTaskOrderMapper;
|
|
|
+
|
|
|
@Resource
|
|
|
private AdminUserApi adminUserApi;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ClientUnitApi clientUnitApi;
|
|
|
+
|
|
|
@Override
|
|
|
public JSONObject getOFData(JSONObject params) {
|
|
|
return null;
|
|
|
@@ -49,9 +59,13 @@ public class QC10101_202401ReportOFData implements IDynamicOFData {
|
|
|
|
|
|
@Override
|
|
|
public JSONObject getOfDataByVO(CreateInstantiateWithRuleVO ruleVO) {
|
|
|
+
|
|
|
//设备报表ID
|
|
|
String refId = ruleVO.getRefId();
|
|
|
|
|
|
+ //日期格式
|
|
|
+ DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy年MM月dd日");
|
|
|
+
|
|
|
JSONObject result = new JSONObject();
|
|
|
BoilerTaskOrderItemReportDO itemReportDO = boilerTaskOrderItemReportMapper.selectById(refId);
|
|
|
|
|
|
@@ -62,11 +76,6 @@ public class QC10101_202401ReportOFData implements IDynamicOFData {
|
|
|
result = generateReportJsonService.generateReportFromRecord(ruleVO.getReportType(), ruleVO.getTemplateId(), refId);
|
|
|
result = autoDataBoilerService.autoGenerateBoilerRecordData(result, refId);
|
|
|
|
|
|
- EquipBoilerDO equipBoilerDO = equipBoilerMapper.selectById(itemDO.getEquipId());
|
|
|
- if (equipBoilerDO != null) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
//检验员信息
|
|
|
AdminUserRespDTO userInfo;
|
|
|
if (itemDO.getMainChecker() != null){
|
|
|
@@ -76,6 +85,43 @@ public class QC10101_202401ReportOFData implements IDynamicOFData {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ EquipBoilerDO equipBoilerDO = equipBoilerMapper.selectById(itemDO.getEquipId());
|
|
|
+ BoilerTaskOrderDO taskOrderDO = boilerTaskOrderMapper.selectById(itemReportDO.getOrderId());
|
|
|
+ if (equipBoilerDO != null) {
|
|
|
+ result.put("factoryCode", equipBoilerDO.getFactoryCode());
|
|
|
+
|
|
|
+ if (itemDO.getEndCheckDate() != null){
|
|
|
+ result.put("checkDate2", itemDO.getEndCheckDate().format(dateFormat));
|
|
|
+ }
|
|
|
+
|
|
|
+ //社会统一信用代码socialCreditCode
|
|
|
+ if (equipBoilerDO.getUnitCode() != null){
|
|
|
+ ClientUnitDTO clientUnit = clientUnitApi.getClientUnitByCode(equipBoilerDO.getUnitCode()).getData();
|
|
|
+ if (clientUnit != null){
|
|
|
+ result.put("socialCreditCode", clientUnit.getSocialCreditCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (taskOrderDO != null) {
|
|
|
+ Integer checkType = taskOrderDO.getCheckType();
|
|
|
+ switch (checkType) {
|
|
|
+ case 100: {
|
|
|
+ result.put("sh1_val_1", "true");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 200: {
|
|
|
+ result.put("sh1_val_2", "true");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 300: {
|
|
|
+ result.put("sh1_val_3", "true");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return result;
|