|
|
@@ -0,0 +1,62 @@
|
|
|
+package nckd.jxccl.base.swc.helper;
|
|
|
+
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.logging.Log;
|
|
|
+import kd.bos.logging.LogFactory;
|
|
|
+import kd.bos.servicehelper.BusinessDataServiceHelper;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+public class SWCHelper {
|
|
|
+
|
|
|
+ private static final Log log = LogFactory.getLog(SWCHelper.class);
|
|
|
+ /**
|
|
|
+ * 根据任务ID查询任务信息
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static DynamicObject queryTaskInfoById(Long id) {
|
|
|
+ String selPros = "id,number,taskstatus, name, startdate, enddate, ishandleproration,taxitemschemev,country,org,calrulev,paysubjectv,calversionno,tasktype,payrollgroupv.currency.amtprecision,islimitadd,payrollgroupv.currency.name";
|
|
|
+ return queryOne(selPros,"hsas_calpayrolltask", id);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询单条数据
|
|
|
+ * @param selectProperties
|
|
|
+ * @param entityName
|
|
|
+ * @param pk
|
|
|
+ */
|
|
|
+ public static DynamicObject queryOne(String selectProperties,String entityName, Object pk) {
|
|
|
+ try {
|
|
|
+ return BusinessDataServiceHelper.loadSingle(pk, entityName, selectProperties);
|
|
|
+ } catch (RuntimeException var4) {
|
|
|
+ log.error("Error occurs when query {}[{}]", entityName, pk);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询单条数据
|
|
|
+ * @param entityName
|
|
|
+ * @param pk
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static DynamicObject queryOne(String entityName,Object pk) {
|
|
|
+ try {
|
|
|
+ return BusinessDataServiceHelper.loadSingle(pk, entityName);
|
|
|
+ } catch (RuntimeException var3) {
|
|
|
+ log.error("Error occurs when query {}[{}]", entityName, pk);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 判断集合是否为空
|
|
|
+ * @param list
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public static <T> boolean isEmpty(List<T> list) {
|
|
|
+ return null == list || list.size() == 0;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|