业务单元查询0.1
This commit is contained in:
parent
93675c6a81
commit
b3f3ffd6f3
|
@ -0,0 +1,38 @@
|
|||
package shkd.bamp.basedata.plugin;
|
||||
|
||||
import kd.bos.openapi.api.plugin.ApiQueryPlugin;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
public class GetBosOrgApiQueryPlugin implements ApiQueryPlugin {
|
||||
@Override
|
||||
public QFilter getFilter(QFilter filter, Map<String, Object> reqData) {
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Map<String, Map<String, Object>> data = (Map<String, Map<String, Object>>) reqData.get("data");
|
||||
Object numberObj = data.get("number");
|
||||
if (numberObj != null && !String.valueOf(numberObj).isEmpty()) {
|
||||
filter.and(new QFilter("number", QCP.equals, numberObj));
|
||||
}
|
||||
try {
|
||||
Object updateTimeFrom = data.get("updateTimeFrom");
|
||||
if (updateTimeFrom != null) {
|
||||
Date fromDate = format.parse(String.valueOf(updateTimeFrom));
|
||||
filter.and(new QFilter("modifytime", QCP.large_equals, fromDate));
|
||||
}
|
||||
Object updateTimeTo = data.get("updateTimeTo");
|
||||
if (updateTimeTo != null) {
|
||||
Date toDate = format.parse(String.valueOf(updateTimeTo));
|
||||
filter.and(new QFilter("modifytime", QCP.less_equals, toDate));
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue