Commit aaee51b2 by 徐澳

平台规范

parent c176b254
package com.baosight.iplat4j.common;
import com.baosight.iplat4j.core.ei.EiBlock;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum CompanyTypeEnum {
GQ(1,"国企"),
MY(2,"民营");
private Integer code;
private String value;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
CompanyTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public static EiBlock generatorEiBlock(){
EiBlock block = new EiBlock("company_type_block_id");
List<Map<String,Object>> rows = new ArrayList<Map<String,Object>>(){{
add(new HashMap<String,Object>(){{
put(HPConstants.TEXT_FIELD,GQ.code);
put(HPConstants.VALUE_FIELD,GQ.value);
}});
add(new HashMap<String,Object>(){{
put(HPConstants.TEXT_FIELD,MY.code);
put(HPConstants.VALUE_FIELD,MY.value);
}});
}};
block.setRows(rows);
return block;
}
}
package com.baosight.iplat4j.common;
/**
* @author xuao
* @date 2024年01月09日 14:53
*/
public class HPConstants {
//公司編碼
public static final String SQL_FIELD_COMPANYCODE = "companyCode";
//創建人
public static final String SQL_FIELD_CREATED_BY = "createdBy";
//創建時間
public static final String SQL_FIELD_CREATED_TIME = "createdTime";
//修改人
public static final String SQL_FIELD_UPDATED_BY = "updatedBy";
//修改時間
public static final String SQL_FIELD_UPDATED_TIME = "updatedTime";
//代碼名字分隔符
public static final String SPLICING_SYMBOL = "-";
public static final String TEXT_FIELD = "textField";
public static final String VALUE_FIELD = "valueField";
}
package com.baosight.iplat4j.common;
\ No newline at end of file
package com.baosight.iplat4j.util;
import com.baosight.iplat4j.common.HPConstants;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.web.threadlocal.UserSession;
/**
* @author xuao
* @date 2024年01月09日 14:50
*/
public class CommonMethod {
public static void creatorInfo(EiInfo eiInfo, String resultBlock){
EiBlock block=eiInfo.getBlock(resultBlock);
String userId = UserSession.getLoginName();
String userName = UserSession.getLoginCName();
String time = DateUtils.curDateTimeStr14();
for(int i=0; i < block.getRowCount(); i++){
//TODO 公司代码待补充
block.setCell(i, HPConstants.SQL_FIELD_COMPANYCODE, "");
block.setCell(i, HPConstants.SQL_FIELD_CREATED_BY, userId+ HPConstants.SPLICING_SYMBOL + userName);
block.setCell(i, HPConstants.SQL_FIELD_CREATED_TIME, time);
block.setCell(i, HPConstants.SQL_FIELD_UPDATED_BY, userId+ HPConstants.SPLICING_SYMBOL + userName);
block.setCell(i, HPConstants.SQL_FIELD_UPDATED_TIME, time);
}
}
}
package com.baosight.iplat4j.util;
\ No newline at end of file
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