From 54f04ea51b703abd818ecc5a4d96d4f6b0602e83 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 18 Mar 2024 15:47:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4=EF=BC=8C=E5=87=BA=E5=B7=AE?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=98=8E=E7=BB=86=E5=88=97=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2sql=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmd/GetBusinessTripsApplyListCmd.java | 109 ------------------ .../impl/BusinessTripsApplyServiceImpl.java | 6 +- 2 files changed, 3 insertions(+), 112 deletions(-) delete mode 100644 src/com/engine/attendance/workflow/cmd/GetBusinessTripsApplyListCmd.java diff --git a/src/com/engine/attendance/workflow/cmd/GetBusinessTripsApplyListCmd.java b/src/com/engine/attendance/workflow/cmd/GetBusinessTripsApplyListCmd.java deleted file mode 100644 index 4502f4a..0000000 --- a/src/com/engine/attendance/workflow/cmd/GetBusinessTripsApplyListCmd.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.engine.attendance.workflow.cmd; - -import com.cloudstore.eccom.constant.WeaBoolAttr; -import com.cloudstore.eccom.pc.table.WeaTable; -import com.cloudstore.eccom.pc.table.WeaTableColumn; -import com.cloudstore.eccom.result.WeaResultMsg; -import com.engine.common.biz.AbstractCommonCommand; -import com.engine.common.entity.BizLogContext; -import com.engine.core.interceptor.CommandContext; -import com.engine.common.util.DbTools; -import weaver.general.Util; -import weaver.hrm.User; -import weaver.systeminfo.SystemEnv; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Author: sy - * @Description: 出差申请列表 - * @Date: 2024/3/15 - **/ -public class GetBusinessTripsApplyListCmd extends AbstractCommonCommand> { - - public GetBusinessTripsApplyListCmd(Map params, User user){ - this.user = user; - this.params = params; - } - - @Override - public BizLogContext getLogContext() { - return null; - } - - @Override - public Map execute(CommandContext commandContext) { - Map retmap = new HashMap(); - - //获取主表id列表 - String targetUserId = Util.null2String(params.get("targetUserId")); - String businessTripsType = Util.null2String(params.get("businessTripsType")); - String startDate = Util.null2String(params.get("startDate")); - String endDate = Util.null2String(params.get("endDate")); - - String sql = "select * from uf_jcl_kq_ccjl where ccr="+targetUserId; - if (!businessTripsType.equals("")) { - sql += "and cclx = " + businessTripsType; - } - if (!startDate.equals("")) { - sql += "and ksrq >= " + startDate; - } - if (!endDate.equals("")) { - sql += "and jsrq <= " + endDate; - } - List maidList = new ArrayList<>(); - if (!targetUserId.equals("")) { - List> datas = DbTools.getSqlToList(sql); - if (datas.size() > 0) { - datas.forEach(f -> { - maidList.add(f.get("id").toString()); - }); - } - } - - String backFields = "a.id,a.cxcc,a.ksrq,a.kssj,a.jsrq,a.jssj,a.ccsc,a.qtcc,a.btcc,a.cxsm"; - String sqlFrom = " uf_jcl_kq_ccjl_dt1 a"; - String sqlWhere = " where 1=1"; - if (maidList.size() > 0) { - sqlWhere = sqlWhere+ " and mainid in ("+String.join(",",maidList)+")"; - } - String orderby = " id "; - String tableString = ""; - -// String pageId = PageUidFactory.getHrmPageUid("KQCalendarSettingList"); - WeaTable table = new WeaTable(); -// table.setPageID(pageId); -// table.setPageUID(pageId + "_" + user.getUID()); -// String pageSize = PageIdConst.getPageSize(pageId, user.getUID()); - table.setPagesize("10"); - - table.setBackfields(backFields); - table.setSqlform(sqlFrom); - table.setSqlwhere(sqlWhere); - table.setSqlprimarykey("id"); - table.setSqlorderby("id"); -// table.getColumns().addAll(tableFields()); - - WeaResultMsg result = new WeaResultMsg(false); - if (maidList.size() > 0) { - result.putAll(table.makeDataResult()); - } - result.success(); - retmap.putAll(result.getResultMap()); - - return retmap; - } - /** - * 构建表格字段 - */ - private List tableFields() { - return new ArrayList() {{ - add(new WeaTableColumn("id").setDisplay(WeaBoolAttr.FALSE)); - add(new WeaTableColumn("10%", SystemEnv.getHtmlLabelName(000000, user.getLanguage()), "xxxxxxx"));// - }}; - } - -} diff --git a/src/com/engine/attendance/workflow/service/impl/BusinessTripsApplyServiceImpl.java b/src/com/engine/attendance/workflow/service/impl/BusinessTripsApplyServiceImpl.java index 7a3ceae..afa4167 100644 --- a/src/com/engine/attendance/workflow/service/impl/BusinessTripsApplyServiceImpl.java +++ b/src/com/engine/attendance/workflow/service/impl/BusinessTripsApplyServiceImpl.java @@ -31,13 +31,13 @@ public class BusinessTripsApplyServiceImpl extends Service implements BusinessTr log.info("targetUserId : {}, businessTripsType : {}, startDate : {}, endDate : {}",targetUserId, businessTripsType, startDate, endDate); String sql = "select * from uf_jcl_kq_ccjl where ccr="+targetUserId; if (!businessTripsType.equals("")) { - sql += "and cclx = " + businessTripsType; + sql += " and cclx = " + businessTripsType; } if (!startDate.equals("")) { - sql += "and ksrq >= " + startDate; + sql += " and ksrq >= " + startDate; } if (!endDate.equals("")) { - sql += "and jsrq <= " + endDate; + sql += " and jsrq <= " + endDate; } List maidList = new ArrayList<>(); if (!targetUserId.equals("")) {