|
@@ -73,6 +73,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.NotNull;
|
|
import java.io.*;
|
|
import java.io.*;
|
|
|
|
+import java.lang.reflect.Field;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.math.RoundingMode;
|
|
import java.math.RoundingMode;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
@@ -2957,12 +2958,32 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
return reportResult;
|
|
return reportResult;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void setZeroBigDecimalFieldsToNull(Object obj) throws IllegalAccessException {
|
|
|
|
+ Class<?> clazz = obj.getClass();
|
|
|
|
+ Field[] fields = clazz.getDeclaredFields();
|
|
|
|
+
|
|
|
|
+ for (Field field : fields) {
|
|
|
|
+ if (field.getType() == BigDecimal.class) {
|
|
|
|
+ field.setAccessible(true); // 设置访问权限
|
|
|
|
+ BigDecimal value = (BigDecimal) field.get(obj);
|
|
|
|
+ if (value != null && value.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
+ field.set(obj, null);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static void setZeroBigDecimalFieldsToNullInList(List<?> list) throws IllegalAccessException {
|
|
|
|
+ for (Object obj : list) {
|
|
|
|
+ setZeroBigDecimalFieldsToNull(obj);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 工程支付月报获取pdfUrl CR2
|
|
* 工程支付月报获取pdfUrl CR2
|
|
* @param url
|
|
* @param url
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public ReportResult getMonthlyReportPDF(String url, Long reportId,Long contractId, Long periodId, Long projectId,List<ContractMeterPeriod> list,Long redisId){
|
|
|
|
|
|
+ public ReportResult getMonthlyReportPDF(String url, Long reportId,Long contractId, Long periodId, Long projectId,List<ContractMeterPeriod> list,Long redisId) throws IllegalAccessException {
|
|
String sql="SELECT id from s_contract_inventory_form where contract_id="+contractId+" and parent_id=0";
|
|
String sql="SELECT id from s_contract_inventory_form where contract_id="+contractId+" and parent_id=0";
|
|
Long id = jdbcTemplate.queryForObject(sql, Long.class);
|
|
Long id = jdbcTemplate.queryForObject(sql, Long.class);
|
|
InventoryFormDetailVO detail = iContractInventoryFormClient.detail(id);
|
|
InventoryFormDetailVO detail = iContractInventoryFormClient.detail(id);
|
|
@@ -3167,7 +3188,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
percentage6 = percentage6.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
percentage6 = percentage6.setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
m19.setNowC(percentage6);
|
|
m19.setNowC(percentage6);
|
|
values.add(m19);
|
|
values.add(m19);
|
|
-
|
|
|
|
|
|
+ setZeroBigDecimalFieldsToNullInList(values);
|
|
InputStream modInput = null;
|
|
InputStream modInput = null;
|
|
FileInputStream excelFileInput = null;
|
|
FileInputStream excelFileInput = null;
|
|
FileOutputStream outputStream = null;
|
|
FileOutputStream outputStream = null;
|
|
@@ -3349,6 +3370,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
}
|
|
}
|
|
list1.add(vo);
|
|
list1.add(vo);
|
|
}
|
|
}
|
|
|
|
+ setZeroBigDecimalFieldsToNullInList(list1);
|
|
ReportResult reportResult = new ReportResult();
|
|
ReportResult reportResult = new ReportResult();
|
|
String suffix=SnowFlakeUtil.getId()+".pdf";
|
|
String suffix=SnowFlakeUtil.getId()+".pdf";
|
|
String sysLocalFileUrl = FileUtils.getSysLocalFileUrl();
|
|
String sysLocalFileUrl = FileUtils.getSysLocalFileUrl();
|