jeecg excel in export processing jeecg empty field sentenced to excel in the field of export processing sentenced empty

jeecg excel in export processing empty field sentenced

 

We know, jeecg export excel uses easypoi, I do not know if you are experiencing this situation:

We have a physical property as an example:

@Excel(name="问题分类",dicCode="xx")
private java.lang.String mwoQuestionCategory;

Easypoi provides a basis @Excel comment in  exportConvert  attributes:

@Excel(name="问题分类",width=15,dicCode="mwo_question_type",exportConvert=true)
private java.lang.String mwoQuestionCategory;

get...

set...

public java.lang.String convertgetMwoQuestionCategory() 
{
   return mwoQuestionCategory == null ? "" : mwoQuestionCategory;
}

This method is newly added, get set method with no cross, writing rules to convert + entity get method name.

As examples above, mwoQuestionCategory, empty judgment method of splicing is obtained: convert + getMwoQuestionCategory = convertgetMwoQuestionCategory ().


A small partner proposal, why not do it directly in the operation three head entity in the get method. In fact, he thought it would invade entity object, do not need to change the null value originally assigned to the empty string, of course, if your entity is only available to export Excel to use, then the answer is also possible.

We know, jeecg export excel uses easypoi, I do not know if you are experiencing this situation:

We have a physical property as an example:

@Excel(name="问题分类",dicCode="xx")
private java.lang.String mwoQuestionCategory;

Easypoi provides a basis @Excel comment in  exportConvert  attributes:

@Excel(name="问题分类",width=15,dicCode="mwo_question_type",exportConvert=true)
private java.lang.String mwoQuestionCategory;

get...

set...

public java.lang.String convertgetMwoQuestionCategory() 
{
   return mwoQuestionCategory == null ? "" : mwoQuestionCategory;
}

This method is newly added, get set method with no cross, writing rules to convert + entity get method name.

As examples above, mwoQuestionCategory, empty judgment method of splicing is obtained: convert + getMwoQuestionCategory = convertgetMwoQuestionCategory ().


A small partner proposal, why not do it directly in the operation three head entity in the get method. In fact, he thought it would invade entity object, do not need to change the null value originally assigned to the empty string, of course, if your entity is only available to export Excel to use, then the answer is also possible.

Guess you like

Origin www.cnblogs.com/Jeely/p/11309575.html
Recommended