commit eaf41abe7ffd9549387fa20111060ede2fee7b88 Author: 黄正国 <438926402@qq.com> Date: Thu Apr 9 15:45:42 2026 +0800 2026-04-09供销社OA项目初始化上传 diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/LeaseBillPluginApi.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/LeaseBillPluginApi.java new file mode 100644 index 0000000..2084784 --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/LeaseBillPluginApi.java @@ -0,0 +1,46 @@ +package com.seeyon.apps.src_leasebill; + +import com.seeyon.apps.common.plugin.api.APluginInfoApi; +import com.seeyon.apps.common.plugin.vo.ConfigVo; +import com.seeyon.apps.src_leasebill.constant.LeaseBillConstant; + + +public class LeaseBillPluginApi extends APluginInfoApi { + public LeaseBillPluginApi() { + } + + public String getPluginId() { + System.out.println(LeaseBillConstant.getPluginId()); + return LeaseBillConstant.getPluginId(); + } + + public String getCreateUser() { + return "橙阳科技"; + } + + public String getDescription() { + return "租赁账单生成"; + } + + public ConfigVo getDefaultConfig() { + ConfigVo configVo = new ConfigVo(); + LeaseBillConstant[] var2 = LeaseBillConstant.values(); + int var3 = var2.length; + + for(int var4 = 0; var4 < var3; ++var4) { + LeaseBillConstant value = var2[var4]; + if (value != LeaseBillConstant.plugin) { + configVo.getDevParams().put(value.name(), value.getDefaultValue()); + configVo.getProdParams().put(value.name(), value.getDefaultValue()); + configVo.getParamMap().put(value.name(), value.getDescription()); + } + } + + return configVo; + } + +// public void registerCustomEvent(Map eventAndNodes) { +// eventAndNodes.put("propertyDispose", "资产管理待办推送"); +// } +} + diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/constant/LeaseBillConstant.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/constant/LeaseBillConstant.java new file mode 100644 index 0000000..36a11a2 --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/constant/LeaseBillConstant.java @@ -0,0 +1,30 @@ +package com.seeyon.apps.src_leasebill.constant; + +public enum LeaseBillConstant { + + + plugin("src_leasebill","插件ID"), + loginName("shenxian","辅助表创建人"); +// u8cUrl("http://ip:port", "U8C地址"), + + LeaseBillConstant(String defaultValue, String description) { + this.defaultValue = defaultValue; + this.description = description; + } + + private String defaultValue; + private String description; + + public String getDefaultValue() { + return defaultValue; + } + + public String getDescription() { + return description; + } + + public static String getPluginId() { + return plugin.defaultValue; + } + +} diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/controller/LeaseBillController.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/controller/LeaseBillController.java new file mode 100644 index 0000000..409d69b --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/controller/LeaseBillController.java @@ -0,0 +1,207 @@ +package com.seeyon.apps.src_leasebill.controller; + +import cn.hutool.log.Log; +import com.alibaba.fastjson.JSONObject; +import com.seeyon.apps.common.config.ICstConfigApi; +import com.seeyon.apps.common.plugin.vo.ConfigVo; +import com.seeyon.apps.src_leasebill.constant.LeaseBillConstant; +import com.seeyon.apps.src_leasebill.dao.ILeaseBillDao; +import com.seeyon.apps.src_leasebill.util.DateUtil; +import com.seeyon.apps.src_leasebill.util.FormExportUtil; +import com.seeyon.apps.src_leasebill.util.LeaseBillUtil; +import com.seeyon.ctp.common.AppContext; +import com.seeyon.ctp.common.controller.BaseController; +import com.seeyon.ctp.util.json.JSONUtil; +import com.seeyon.v3x.services.form.FormFactory; +import com.seeyon.v3x.services.form.bean.FormExport; +import com.seeyon.v3x.services.form.bean.SubordinateFormExport; +import com.seeyon.v3x.services.form.bean.ValueExport; +import nc.vo.jcom.lang.StringUtil; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedReader; +import java.io.IOException; +import java.net.URLDecoder; +import java.text.SimpleDateFormat; +import java.util.*; + +public class LeaseBillController extends BaseController { + + private static Log log = Log.get(LeaseBillController.class); + protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi"); + + private FormFactory formFactory; + + public FormFactory getFormFactory() { + if (formFactory == null) { + formFactory = (FormFactory) AppContext.getBean("formFactory"); + } + return formFactory; + } + + public void setFormFactory(FormFactory formFactory) { + this.formFactory = formFactory; + } + + private ILeaseBillDao leaseBillDao; + public void setLeaseBillDao(ILeaseBillDao leaseBillDao) { + this.leaseBillDao = leaseBillDao; + } + public ILeaseBillDao getLeaseBillDao() { + if (leaseBillDao == null) { + leaseBillDao = (ILeaseBillDao) AppContext.getBean("leaseBillDao"); + } + return leaseBillDao; + } + + public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception { + log.info("进入ajax方法"); + ConfigVo configVo = getYdctLeaseBillConfig(); + DateUtil dateUtil = new DateUtil(); + LeaseBillUtil leaseBillUtil = new LeaseBillUtil(); + FormExportUtil formExportUtil = new FormExportUtil(); + // 设置返回值对象 + Map res = new HashMap<>(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmsssss"); + request.setCharacterEncoding("UTF-8"); + response.setCharacterEncoding("UTF-8"); + + BufferedReader reader = request.getReader(); + String line; + StringBuilder requestBody = new StringBuilder(); + while((line = reader.readLine())!=null){ + requestBody.append(line); + } + String data = requestBody.toString(); + String decodedParam = URLDecoder.decode(data, "UTF-8"); + String[] datas = decodedParam.split("&"); + JSONObject jsonObject = new JSONObject(); + for(int i = 0 ; i < datas.length ; i ++ ){ + String[] params = datas[i].split("="); + if(params.length>1){ + jsonObject.put(params[0],params[1]); + }else{ + if(params[0].equals("bdid")){ + jsonObject.put("bdid","0"); + } + } + } + try { + String bdidValue = jsonObject.getString("bdid"); + log.info("当前账单编号为:"+bdidValue); + if("0".equals(bdidValue)){ + Date formDate = new Date(); + String formId = simpleDateFormat.format(formDate); +// 账单编号 + bdidValue = formId; +// formDataVo.getNewFieldDataMap().put("账单编号", formId); + }else { + List ids = leaseBillDao.leaseBillByCode(bdidValue); + for (int i = 0; i < ids.size(); i++) { +// 删除明细账单 + leaseBillDao.deleteBillsByBillId(ids.get(i)); +// 删除主表数据 + leaseBillDao.deleteBillById(ids.get(i)); + } + } + String code = bdidValue; +// 开始日期 + String startDateStr = jsonObject.getString("startDate"); + Date startDate = sdf.parse(startDateStr); +// 结束日期 + String endDateStr = jsonObject.getString("endDate"); + Date endDate = sdf.parse(endDateStr); +// 设置面积 + String jifeifs = jsonObject.getString("jifeifs"); +// 设置合同开始日期 + Calendar startTime = Calendar.getInstance(); + startTime.setTime(startDate); +// 判断合同开始时间是否为月底 + boolean isMaxDay = false; + int currentDay = startTime.get(Calendar.DAY_OF_MONTH); + int maxDay = startTime.getActualMaximum(Calendar.DAY_OF_MONTH); + if(currentDay==maxDay){ + isMaxDay = true; + } +// 设置合同结束日期 + Calendar endTime = Calendar.getInstance(); + endTime.setTime(endDate); + endTime.add(Calendar.DAY_OF_MONTH, 1); + +// 根据缴费方式设置开始结束时间 + String jiaofeifs = jsonObject.getString("jiaofeifs"); + int jfzqNum = dateUtil.getCycleNum(jiaofeifs); + + FormExport formExport = new FormExport(); +// 租金 + List> rents = new ArrayList>(); + if(jfzqNum==12){ + String njiaofeifs = jsonObject.getString("njiaofeifs"); + if(StringUtil.isEmpty(njiaofeifs)){ + res.put("success", true); + res.put("name", AppContext.currentUserLoginName()); + res.put("s", "请选择年缴费计算方式"); + res.put("num", ""); + render(response, JSONUtil.toJSONString(res)); + return null; + }else{ + if(njiaofeifs.equals("正常年度")){ +// 采用方式一/正常年度 + rents = leaseBillUtil.getLeaseBillYers1(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs); + }else if(njiaofeifs.equals("非正常年度")){ +// 采用方式二/非正常年度 + rents = leaseBillUtil.getLeaseBillYers2(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs); + } + } + }else{ +// 根据标准方法生成 + rents = leaseBillUtil.getLeaseBill(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs); + } + log.info("创建档案"); + List subordinateFormExports = formExportUtil.setSubordinateFormValue(rents); + Map billMap = new HashMap(); + billMap.put("账单编号", code); + List valueExports = formExportUtil.setFormValue(billMap); + formExport.setSubordinateForms(subordinateFormExports); + formExport.setValues(valueExports); + String loginName = configVo.getParamVal(LeaseBillConstant.loginName.name()); + getFormFactory().importBusinessFormData(loginName, "ZJZDMX", + formExport, new String[] {}); + res.put("success", true); + res.put("name", AppContext.currentUserLoginName()); + res.put("s", ""); + res.put("num", code); + }catch (Exception e){ + e.printStackTrace(); + } + render(response, JSONUtil.toJSONString(res)); + return null; + } + + + /** + * 给前台渲染json数据 + * @param response + * @param text + */ + private void render(HttpServletResponse response, String text) { + response.setContentType("application/json;charset=UTF-8"); + try { + response.setContentLength(text.getBytes("UTF-8").length); + response.getWriter().write(text); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public ConfigVo getYdctLeaseBillConfig() { + return cstConfigApi.getConfig(getPluginId()); + } + + public String getPluginId() { + return LeaseBillConstant.getPluginId(); + } +} diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/dao/ILeaseBillDao.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/dao/ILeaseBillDao.java new file mode 100644 index 0000000..9329dcd --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/dao/ILeaseBillDao.java @@ -0,0 +1,20 @@ +package com.seeyon.apps.src_leasebill.dao; + +import com.seeyon.ctp.common.exceptions.BusinessException; + +import java.sql.SQLException; +import java.util.List; + +public interface ILeaseBillDao { + + // 查询账单底表id + public List leaseBillByCode(String code) throws BusinessException, SQLException; + + // 删除账单底表 + public int deleteBillById(String id) throws BusinessException, SQLException; + + // 删除账单明细表 + public int deleteBillsByBillId(String formmainId) throws BusinessException, SQLException; + + +} diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/dao/impl/LeaseBillDaoImpl.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/dao/impl/LeaseBillDaoImpl.java new file mode 100644 index 0000000..a344768 --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/dao/impl/LeaseBillDaoImpl.java @@ -0,0 +1,84 @@ +package com.seeyon.apps.src_leasebill.dao.impl; + +import com.seeyon.apps.src_leasebill.dao.ILeaseBillDao; +import com.seeyon.ctp.common.exceptions.BusinessException; +import com.seeyon.ctp.util.JDBCAgent; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class LeaseBillDaoImpl implements ILeaseBillDao { +//本地 +// private String leaseBillByCode = "SELECT id FROM formmain_0231 WHERE field0004 = ? "; +// private String deleteBillById = "delete from formmain_0231 where id=?"; +// private String deleteBillsByBillId = "delete from formson_0232 where formmain_id=?"; +// 正式 + private String leaseBillByCode = "SELECT id FROM formmain_0031 WHERE field0004 = ? "; + private String deleteBillById = "delete from formmain_0031 where id=?"; + private String deleteBillsByBillId = "delete from formson_0032 where formmain_id=?"; + + + @Override + public List leaseBillByCode(String code) throws BusinessException, SQLException { + List lists = new ArrayList(); + JDBCAgent agent = new JDBCAgent(); + try { + StringBuilder sql = new StringBuilder(leaseBillByCode); +// StringBuilder sql = new StringBuilder("SELECT id FROM formmain_0536 WHERE field0013 = ? "); + List p = new ArrayList(); + p.add(code); + agent.execute(sql.toString(), p); + List list = agent.resultSetToList(); + if (list != null && list.size() > 0) { + for(int i = 0 ; i < list.size() ; i++) { + Map map = list.get(i); + Object object = map.get("id"); + lists.add(object.toString()); + } + } + }finally { + if (agent != null) { + agent.close(); + } + } + return lists; + } + + @Override + public int deleteBillById(String id) throws BusinessException, SQLException { + int i = 0 ; + JDBCAgent agent = new JDBCAgent(); + try { + StringBuilder sql = new StringBuilder(deleteBillById); +// StringBuilder sql = new StringBuilder("delete from formmain_0536 where id=?"); + List p = new ArrayList(); + p.add(id); + i=agent.execute(sql.toString(), p); + }finally { + if (agent != null) { + agent.close(); + } + } + return i; + } + + @Override + public int deleteBillsByBillId(String formmainId) throws BusinessException, SQLException { + int i = 0 ; + JDBCAgent agent = new JDBCAgent(); + try { + StringBuilder sql = new StringBuilder(deleteBillsByBillId); +// StringBuilder sql = new StringBuilder("delete from formson_0538 where formmain_id=?"); + List p = new ArrayList(); + p.add(formmainId); + i=agent.execute(sql.toString(), p); + }finally { + if (agent != null) { + agent.close(); + } + } + return i; + } +} diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/fieldCtrl/LeaseBillFieldCtrl.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/fieldCtrl/LeaseBillFieldCtrl.java new file mode 100644 index 0000000..1260013 --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/fieldCtrl/LeaseBillFieldCtrl.java @@ -0,0 +1,85 @@ +package com.seeyon.apps.src_leasebill.fieldCtrl; + +import com.seeyon.cap4.form.bean.ParamDefinition; +import com.seeyon.cap4.form.bean.fieldCtrl.FormFieldCustomCtrl; +import com.seeyon.cap4.form.util.Enums.ParamType; +import www.seeyon.com.utils.UUIDUtil; + +import java.util.List; + +/** + *
+ * 自定义控件:调用接口
+ * 
+ */ +public class LeaseBillFieldCtrl extends FormFieldCustomCtrl { + + /** + * UUIDLong.longUUID() + * UUIDUtil.getUUIDString() + */ + public String getKey() { + return "5209586381190735608"; + } + + public static void main(String[] args) { + System.out.println(UUIDUtil.getUUIDLong()); + } + + public String getFieldLength() { + return "20"; + } + + /** + * 控件初始化接口,此接口在控件初始化的时候,会调用,主要用于定义控件所属插件id、在表单编辑器中的图标、表单编辑器中有哪些属性可以设置。 + * 使用举例:在接口中定义自定义控件在在表单编辑器中有哪些控件属性需要配置 + */ + public void init() { + setPluginId("ydctLeaseBill"); + setIcon("cap-icon-interestMeasurement"); + // 自定义参数 + ParamDefinition templateIdParam = new ParamDefinition(); + templateIdParam.setParamType(ParamType.button); + addDefinition(templateIdParam); + } + + /** (non-Javadoc) + * @see FormFieldCustomCtrl#getPCInjectionInfo() + * PC端的资源文件路径 + */ + public String getPCInjectionInfo() { + return "{path:'apps_res/cap/customCtrlResources/leaseBillResources/',jsUri:'js/openUnflow.js',initMethod:'init',nameSpace:'field_" + getKey() + "'}"; + } + + /** (non-Javadoc) + * @see FormFieldCustomCtrl#getMBInjectionInfo() + * 移动端的资源地址 + */ + public String getMBInjectionInfo() { + return "{path:'http://newwidget.v5.cmp/v1.0.0/',weixinpath:'newwidget',jsUri:'js/newwidget.js',initMethod:'init',nameSpace:'field_" + this.getKey() + "'}"; + } + + public String getText() { + return "租金计算按钮"; + } + + public boolean canBathUpdate() { + return false; + } + + public List getListShowDefaultVal(Integer externalType) { + return null; + } + + /** + * 初始值生成接口 + */ + public String[] getDefaultVal(String defaultValue) { + return new String[0]; + } + + public boolean canInjectionWord() { + return false; + } + +} diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/DateUtil.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/DateUtil.java new file mode 100644 index 0000000..9cd3f6d --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/DateUtil.java @@ -0,0 +1,135 @@ +package com.seeyon.apps.src_leasebill.util; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +public class DateUtil { + +// 查询两个时间相差多少月 + public int betweenMonthByTwoCalendar(Calendar startCalendar,Calendar endCalendar) { + if(startCalendar.after(endCalendar)){ + Calendar temp = startCalendar; + startCalendar = endCalendar; + endCalendar = temp; + } +// int startYear = startCalendar.get(Calendar.YEAR); +// int endYear = endCalendar.get(Calendar.YEAR); +// int startMonth = startCalendar.get(Calendar.MONTH); +// int endMonth = endCalendar.get(Calendar.MONTH); +// int monthNum = (endYear - startYear)*12+(endMonth-startMonth); +// return monthNum; + + int yearsDiff = endCalendar.get(Calendar.YEAR) - startCalendar.get(Calendar.YEAR); + int monthsDiff = yearsDiff * 12 + endCalendar.get(Calendar.MONTH)- startCalendar.get(Calendar.MONTH); + if (endCalendar.get(Calendar.DAY_OF_MONTH) > startCalendar.get(Calendar.DAY_OF_MONTH)) { + monthsDiff++; + } + return monthsDiff; + + + } + + public String discrepancyDay(String str1,String str2) throws ParseException { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); +// 将字符串转换成日期 + Date start = sdf.parse(str1); + Date end = sdf.parse(str2); +// Date end = new Date(); + Date d3 = null; + if(start.getTime()-end.getTime()>0){ + d3 = start; + start = end; + end = d3; + } + Calendar c1 = Calendar.getInstance(); + + Calendar c2 = Calendar.getInstance(); + c1.setTime(start); + c2.setTime(end); + c2.add(c2.DATE,1); + end = c2.getTime(); +// System.out.println(sdf.format( c2.getTime())); + int year1 = c1.get(Calendar.YEAR); + + int year2 = c2.get(Calendar.YEAR); + + int month1 = c1.get(Calendar.MONTH); + + int month2 = c2.get(Calendar.MONTH); + + int day1 = c1.get(Calendar.DAY_OF_MONTH); + + int day2 = c2.get(Calendar.DAY_OF_MONTH); + + int yearInterval = year1 - year2; + + if (month1 < month2 || month1 == month2 && day1 < day2) + + yearInterval--; + + int monthInterval = (month1 + 12) - month2; + + if (day1 < day2) + + monthInterval--; + + monthInterval %= 12; + + int monthsDiff = Math.abs(yearInterval * 12 + monthInterval); + + + + int nian = monthsDiff/12; + int yue = monthsDiff - (nian*12); + c1.add(Calendar.YEAR, nian); + if(day1==day2){ + c1.add(Calendar.MONTH, yue); + }else { + + c1.add(Calendar.MONTH, yue-1); + if(yue-1<0) { + nian--; + yue=11; + }else { + yue -=1; + } + } +// System.out.println(nian+"年"); +// System.out.println(yue+"月"); + Date dt1 = c1.getTime(); + long l = dt1.getTime() - end.getTime(); + long tian = l/-(24*60*60*1000); + return nian+"-"+yue+"-"+tian; + } + + + public int getCycleNum (String cycle){ + int cycleNum = 1; + if("月".equals(cycle)||"月付".equals(cycle)){ + cycleNum = 1; + }else if("季".equals(cycle)||"季付".equals(cycle)){ + cycleNum = 3; + }else if("半年".equals(cycle)||"半年付".equals(cycle)){ + cycleNum = 6; + }else if("年".equals(cycle)||"年付".equals(cycle)){ + cycleNum = 12; + }else if("一次性".equals(cycle)||"其他".equals(cycle)){ + cycleNum = 99; + } + return cycleNum; + } + + public double stringToNum(String str){ + double i = 0 ; + String[] strs = str.split(","); + StringBuilder numString = new StringBuilder(); + for (String value: strs) { + numString.append(value); + } + i = Double.parseDouble(numString.toString()); + return i; + } + +} diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/FormExportUtil.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/FormExportUtil.java new file mode 100644 index 0000000..b841558 --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/FormExportUtil.java @@ -0,0 +1,63 @@ +package com.seeyon.apps.src_leasebill.util + ; + +import com.seeyon.v3x.services.form.bean.RecordExport; +import com.seeyon.v3x.services.form.bean.SubordinateFormExport; +import com.seeyon.v3x.services.form.bean.ValueExport; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +//创建无流程表单数据处理工具类 +public class FormExportUtil { + + /** + * 设置主表信息 + * @param map 设置主表字段。Map<主表显示名称,主表数据> + * @return + */ + public List setFormValue(Map map){ +// 创建返回值对象 + List valueExports = new ArrayList(); + ValueExport valueExport ; +// 获取参数信息(显示名称) + Set keys = map.keySet(); + if(keys.size()>0) { +// 对控件赋值 + for (String key : keys) { + valueExport = new ValueExport(); + valueExport.setDisplayName(key); + valueExport.setValue(map.get(key)); + valueExports.add(valueExport); + } + } + return valueExports; + } + + /** + * 设置从表信息 + * @param map 设置主表字段。List> + */ + public List setSubordinateFormValue(List> lists){ + List subordinateFormExports = new ArrayList(); + SubordinateFormExport subordinateFormExport = new SubordinateFormExport(); + List recordExports = new ArrayList(); + List valueExports; + RecordExport recordExport; + for(int i = 0 ; i < lists.size() ; i++) { + recordExport = new RecordExport(); + valueExports = setFormValue(lists.get(i)); + recordExport.setRecord(valueExports); + recordExports.add(recordExport); + } + subordinateFormExport.setValues(recordExports); + subordinateFormExports.add(subordinateFormExport); + + return subordinateFormExports; + } + + + +} diff --git a/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/LeaseBillUtil.java b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/LeaseBillUtil.java new file mode 100644 index 0000000..eeceda4 --- /dev/null +++ b/v5/apps-customize/src/main/java/com/seeyon/apps/src_leasebill/util/LeaseBillUtil.java @@ -0,0 +1,277 @@ +package com.seeyon.apps.src_leasebill.util; + +import com.alibaba.fastjson.JSONObject; + +import java.text.SimpleDateFormat; +import java.util.*; + +public class LeaseBillUtil { + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + /** + * 生成租金账单 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param isMaxDay 是否每月最后一天 + * @param jfzqNum 缴费周期月 + * @param jsonObject 请求参数 + * @param jifeifs 计费方式 + * @return + */ + public List> getLeaseBill(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum, + JSONObject jsonObject,String jifeifs){ + List> rents = new ArrayList<>(); + DateUtil dateUtil = new DateUtil(); +// 两个日期相差多少月 + int monthNum = dateUtil.betweenMonthByTwoCalendar(startTime,endTime); + if(jfzqNum==99){ +// 一次性账单生成 + Map rent = new HashMap<>(); + float zlmjFloat = 0; + double zf = 0; + if("面积计费".equals(jifeifs)){ + String mjStr = jsonObject.getString("mj"); + zlmjFloat = Float.parseFloat(mjStr); + String mjzjStr = jsonObject.getString("mjzj"); + double mjzj = dateUtil.stringToNum(mjzjStr); + zf = mjzj*zlmjFloat*monthNum; + }else if ("固定租金".equals(jifeifs)){ + zlmjFloat = 1; + String gdzjStr = jsonObject.getString("gdzj"); + double gdzj = dateUtil.stringToNum(gdzjStr); +// zf = gdzj*zlmjFloat*monthNum; + zf = gdzj*zlmjFloat; + } + rent.put("开始日期",sdf.format(startTime.getTime())); + endTime.add(Calendar.DATE, -1); + rent.put("结束日期",sdf.format(endTime.getTime())); + rent.put("租费",zf+""); + rents.add(rent); + }else{ +// 月,季,半年,账单生成 + int termNum = monthNum/jfzqNum; + int mo = monthNum%jfzqNum; + if(mo!=0){ + termNum++; + } + float zlmjFloat = 0; + double zf = 0; + if("面积计费".equals(jifeifs)){ + String mjStr = jsonObject.getString("mj"); + zlmjFloat = Float.parseFloat(mjStr); + String mjzjStr = jsonObject.getString("mjzj"); + double mjzj = dateUtil.stringToNum(mjzjStr); + zf = mjzj*zlmjFloat; + }else if ("固定租金".equals(jifeifs)){ + zlmjFloat = 1; + String gdzjStr = jsonObject.getString("gdzj"); + double gdzj = dateUtil.stringToNum(gdzjStr); + zf = gdzj*zlmjFloat; + } + for(int i = 0 ; i < termNum ; i ++) { + if (startTime.getTime().getTime() < endTime.getTime().getTime()) { + Map rentMap = new HashMap(); +// 设置租费时间 + rentMap.put("开始日期", sdf.format(startTime.getTime())); + if (!isMaxDay) { + startTime.add(Calendar.MONTH, jfzqNum); + startTime.add(Calendar.DAY_OF_MONTH, -1); + }else{ + startTime.add(Calendar.MONTH, jfzqNum); + startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH)-1); + } + if (startTime.getTime().getTime() < endTime.getTime().getTime()) { +// rentMap.put("期间月数-租金",jfzqNum+""); +// rentMap.put("租费", (zf * jfzqNum) + ""); + if("面积计费".equals(jifeifs)){ + rentMap.put("租费", (zf * jfzqNum) + ""); + }else if ("固定租金".equals(jifeifs)){ + rentMap.put("租费", (zf * 1) + ""); + } + rentMap.put("结束日期", sdf.format(startTime.getTime())); + } else { + //两个日期相差多少月 + startTime.add(Calendar.MONTH, jfzqNum*-1); + startTime.add(Calendar.DAY_OF_MONTH, 1); + int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(startTime, endTime); +// rentMap.put("期间月数-租金",qijianyueshu+""); + if("面积计费".equals(jifeifs)){ + rentMap.put("租费", (zf * qijianyueshu) + ""); + }else if ("固定租金".equals(jifeifs)){ + rentMap.put("租费", (zf * 1) + ""); + } + + endTime.add(Calendar.DAY_OF_MONTH, -1); + rentMap.put("结束日期", sdf.format(endTime.getTime())); + } + startTime.add(Calendar.DAY_OF_MONTH, 1); + if (isMaxDay) { + startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH)); + } + rents.add(rentMap); + } + } + } + return rents; + } + + + /** + * 生成租金账单 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param isMaxDay 是否每月最后一天 + * @param jfzqNum 缴费周期月 + * @param jsonObject 请求参数 + * @param jifeifs 计费方式 + * @return + */ + public List> getLeaseBillYers1(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum, + JSONObject jsonObject,String jifeifs){ + List> rents = new ArrayList<>(); + DateUtil dateUtil = new DateUtil(); +// 两个日期相差多少月 + int monthNum = dateUtil.betweenMonthByTwoCalendar(startTime,endTime); + int termNum = monthNum/jfzqNum; + int mo = monthNum%jfzqNum; + if(mo!=0){ + termNum++; + } + float zlmjFloat = 0; + double zf = 0; + if("面积计费".equals(jifeifs)){ + String mjStr = jsonObject.getString("mj"); + zlmjFloat = Float.parseFloat(mjStr); + String mjzjStr = jsonObject.getString("mjzj"); + double mjzj = dateUtil.stringToNum(mjzjStr); + zf = mjzj*zlmjFloat; + }else if ("固定租金".equals(jifeifs)){ + zlmjFloat = 1; + String gdzjStr = jsonObject.getString("gdzj"); + double gdzj = dateUtil.stringToNum(gdzjStr); + zf = gdzj*zlmjFloat; + } + for(int i = 0 ; i < termNum ; i ++) { + if (startTime.getTime().getTime() < endTime.getTime().getTime()) { + Map rentMap = new HashMap(); +// 设置租费时间 + rentMap.put("开始日期", sdf.format(startTime.getTime())); + startTime.add(Calendar.MONTH, jfzqNum); + startTime.add(Calendar.DAY_OF_MONTH, -1); + if (startTime.getTime().getTime() < endTime.getTime().getTime()) { +// rentMap.put("期间月数-租金",jfzqNum+""); +// rentMap.put("租费", (zf * jfzqNum) + ""); + if("固定租金".equals(jifeifs)){ + rentMap.put("租费", (zf * 1) + ""); + }else{ + rentMap.put("租费", (zf * jfzqNum) + ""); + } + rentMap.put("结束日期", sdf.format(startTime.getTime())); + } else { + //两个日期相差多少月 + startTime.add(Calendar.MONTH, jfzqNum*-1); + startTime.add(Calendar.DAY_OF_MONTH, 1); + int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(startTime, endTime); +// rentMap.put("期间月数-租金",qijianyueshu+""); +// rentMap.put("租费", (zf * qijianyueshu) + ""); + if("固定租金".equals(jifeifs)){ + rentMap.put("租费", (zf * 1) + ""); + }else{ + rentMap.put("租费", (zf * qijianyueshu) + ""); + } + endTime.add(Calendar.DAY_OF_MONTH, -1); + rentMap.put("结束日期", sdf.format(endTime.getTime())); + } + startTime.add(Calendar.DAY_OF_MONTH, 1); + if (isMaxDay) { + startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH)); + } + rents.add(rentMap); + } + } + return rents; + } + + + /** + * 生成租金账单 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param isMaxDay 是否每月最后一天 + * @param jfzqNum 缴费周期月 + * @param jsonObject 请求参数 + * @param jifeifs 计费方式 + * @return + */ + public List> getLeaseBillYers2(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum, + JSONObject jsonObject,String jifeifs){ + List> rents = new ArrayList<>(); + DateUtil dateUtil = new DateUtil(); +// 两个日期相差多少年 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(startTime.getTime()); + int starYear = startTime.get(Calendar.YEAR); + int endYear = endTime.get(Calendar.YEAR); + int termNum = endYear-starYear+1; + float zlmjFloat = 0; + double zf = 0; + if("面积计费".equals(jifeifs)){ + String mjStr = jsonObject.getString("mj"); + zlmjFloat = Float.parseFloat(mjStr); + String mjzjStr = jsonObject.getString("mjzj"); + double mjzj = dateUtil.stringToNum(mjzjStr); + zf = mjzj*zlmjFloat; + }else if ("固定租金".equals(jifeifs)){ + zlmjFloat = 1; + String gdzjStr = jsonObject.getString("gdzj"); + double gdzj = dateUtil.stringToNum(gdzjStr); + zf = gdzj*zlmjFloat; + } + + for(int i = 0 ; i < termNum ; i ++) { + if (startTime.getTime().getTime() < endTime.getTime().getTime()) { + Map rentMap = new HashMap(); +// 设置租费时间 + rentMap.put("开始日期", sdf.format(startTime.getTime())); + startTime.set(Calendar.MONTH, 11); + startTime.set(Calendar.DATE, 31); + if (startTime.getTime().getTime() < endTime.getTime().getTime()) { +// rentMap.put("期间月数-租金",jfzqNum+""); + startTime.add(Calendar.DAY_OF_MONTH, 1); + int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(calendar, startTime); + startTime.add(Calendar.DAY_OF_MONTH, -1); +// rentMap.put("租费", (zf * qijianyueshu) + ""); + if ("固定租金".equals(jifeifs)){ + rentMap.put("租费", (zf * 1) + ""); + }else{ + rentMap.put("租费", (zf * qijianyueshu) + ""); + } + rentMap.put("结束日期", sdf.format(startTime.getTime())); + calendar.set(Calendar.MONTH, 11); + calendar.set(Calendar.DATE, 31); + } else { + //两个日期相差多少月 + int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(calendar, endTime); +// rentMap.put("期间月数-租金",qijianyueshu+""); +// rentMap.put("租费", (zf * qijianyueshu) + ""); + if ("固定租金".equals(jifeifs)){ + rentMap.put("租费", (zf * 1) + ""); + }else{ + rentMap.put("租费", (zf * qijianyueshu) + ""); + } + endTime.add(Calendar.DAY_OF_MONTH, -1); + rentMap.put("结束日期", sdf.format(endTime.getTime())); + } + startTime.add(Calendar.DAY_OF_MONTH, 1); + calendar.add(Calendar.DAY_OF_MONTH, 1); + if (isMaxDay) { + startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH)); + } + rents.add(rentMap); + } + } + return rents; + } + +} diff --git a/v5/apps-customize/src/main/resources/needless_check_login.xml b/v5/apps-customize/src/main/resources/needless_check_login.xml new file mode 100644 index 0000000..97114bc --- /dev/null +++ b/v5/apps-customize/src/main/resources/needless_check_login.xml @@ -0,0 +1,322 @@ + + + + /qrCodeForm.do + + index + newMain + + + + /sc.do + + qr + + + + /elearning.do + + error + m3Redirect + message + pcRedirect + + + + /phoneLogin/phoneLogin.do + + getMessageCode + validateMessageCode + + + + /wechat/miniprogram.do + + a8home + bind + bindMemberPhone + login + unbind + + + + /portal/spaceController.do + + showThemSpace + + + + /identification.do + + getSessionId + + + + /fileUpload.do + + showRTE + + + + /fileDownload.do + + showRTE + + + + /form/formUpgrade.do + + toUpgrade + upgrade + viewUpgrade + + + + formtalkFormMapperController.do + + importFormtalkData + + + + /thirdpartyController.do + + access + index + logoutNotify + show + mailAuth + + + + /main.do + + changeLocale + hangup + headerjs + index + login + login4Ucpc + login4Ucpc3 + login4Vjoin + logout + logout4Session + logout4Vjoin + logout4ZX + main + login4QrCode + qrCodeHelp + updateLoginSeed + + + + /trustdo/A8/XRD.do + + getLoginAccount + getLoginAcctoken + webLogin + + + + /share.do + + index + + + + /genericController.do + + index + + + + /edoc/edocUpgradeControllor.do + + upgrade + download + + + + /uploadService.do + + processUploadService + + + + /autoinstall.do + + ieSetDown + regInstallDown + regInstallDown64 + downloadAssistant + + + + /personalBind.do + + getBindTypeByLoginName + isCanUse + retrievePassword + sendVerificationCodeToBindEmail + sendVerificationCodeToBindNum + validateVerificationCode + + + + + + + + + + + /commonimage.do + + showImage + + + + /individualManager.do + + resetPassword + + + + /wechat/dingding.do + + binding + index + main + newIndex + newMain + viewh5Message + + + + /uc/rest.do + + commonPierce + downloadImage + getBgTimeStamp + getLoginsecurityMsg + sendsms + smsrequired + testIp + isQrLogin + getDigitalCodeInfo + + + + portalManager + + sendSMSLoginCode + smsLoginEnabled + + + + loginUserManager + + getLockTime + + + + qrCodeLoginManager + + isLogin + + + + meetingAjaxManager + + meetingPanelData + meetingPanelDisplay + + + + /m3/loginController.do + + transLogin + transLogout + getProfile + + + + /m3/mClientBindController.do + + bindApply + + + + m3ProductManager + + productInfo + productStatus + + + + /m3/homeSkinController.do + + downloadImage + getSkinImageUrl + + + + /m3/transModeController.do + + getTransModeForMobile + + + + /media/media.do + + mediaShow + + + + /ocipEdoc.do + + index + + + + /colView.do + + index + + + + /caAccountManagerController.do + + findKeyNumByLoginName + + + + /fddCallbackController.do + + asynch + synch + + + + /seeyonReport/seeyonReportController.do + + redirectSeeyonReport + + + + /imc.do + + index + logout + + + + + /cloudbuild.do + + download + getDownloadPageInfo + getLatestVersionInfo + getDownloadQrUrl + + + \ No newline at end of file diff --git a/v5/apps-customize/src/main/resources/needless_check_login_recheck.xml b/v5/apps-customize/src/main/resources/needless_check_login_recheck.xml new file mode 100644 index 0000000..0e84aeb --- /dev/null +++ b/v5/apps-customize/src/main/resources/needless_check_login_recheck.xml @@ -0,0 +1,426 @@ + + + + + + /qrCodeForm.do + com.seeyon.apps.qrCodeForm.controller.QrCodeFormController + + index + newMain + + + + + /sc.do + com.seeyon.cap4.form.modules.smartCode.controller.SmartCodeController + + qr + + + + /media/media.do + com.seeyon.ctp.common.media.controller.MediaController + + mediaShow + + + + /phoneLogin/phoneLogin.do + com.seeyon.ctp.login.controller.PhoneLoginController + + getMessageCode + validateMessageCode + + + + portalManager + com.seeyon.ctp.portal.manager.PortalManagerImpl + + sendSMSLoginCode + smsLoginEnabled + + + + /fileDownload.do + com.seeyon.ctp.common.fileupload.FileUploadController + + showRTE + + + + loginUserManager + com.seeyon.ctp.login.LoginUserManagerImpl + + getLockTime + + + + /main.do + com.seeyon.ctp.login.controller.MainController + + changeLocale + hangup + headerjs + index + login + login4Ucpc + login4Ucpc3 + login4Vjoin + logout + logout4Session + logout4Vjoin + logout4ZX + main + login4QrCode + qrCodeHelp + updateLoginSeed + + + + /trustdo/A8/XRD.do + com.seeyon.apps.trustdo.controller.XRDController + + getLoginAccount + getLoginAcctoken + webLogin + + + + /share.do + com.seeyon.v3x.system.share.controller.ShareController + + index + + + + /edoc/edocUpgradeControllor.do + com.seeyon.v3x.edoc.controller.EdocUpgradeControllor + + upgrade + download + + + + /m3/mClientBindController.do + com.seeyon.apps.m3.bind.controller.M3ClientBindController + + bindApply + + + + /uploadService.do + com.seeyon.ctp.services.FileUploadService + + processUploadService + + + + /uc/rest.do + com.seeyon.apps.zx.controller.ZxRestController + + commonPierce + downloadImage + getBgTimeStamp + getLoginsecurityMsg + sendsms + smsrequired + testIp + isQrLogin + getDigitalCodeInfo + + + + /m3/homeSkinController.do + com.seeyon.apps.m3.skin.controller.M3HomeSkinController + + downloadImage + getSkinImageUrl + + + + /colView.do + com.seeyon.apps.ocip.exchange.collaboration.controller.CollViewController + + index + + + + /autoinstall.do + com.seeyon.apps.autoinstall.controller.AutoInstallController + + ieSetDown + regInstallDown + regInstallDown64 + downloadAssistant + + + + + + + + + + + + /caAccountManagerController.do + com.seeyon.v3x.ca.caaccount.controller.CAAccountManagerController + + findKeyNumByLoginName + + + + /elearning.do + com.seeyon.apps.elearning.controller.ElearningController + + error + m3Redirect + message + pcRedirect + + + + /wechat/miniprogram.do + com.seeyon.apps.weixin.controller.MiniProgramController + + a8home + bind + bindMemberPhone + login + unbind + + + + /portal/spaceController.do + com.seeyon.ctp.portal.space.controller.SpaceController + + showThemSpace + + + + /identification.do + com.seeyon.v3x.identification.controller.IdentificationController + + getSessionId + + + + /fddCallbackController.do + com.seeyon.apps.econtract.fdd.controller.FddCallbackController + + asynch + synch + + + + m3ProductManager + com.seeyon.apps.m3.product.manager.impl.M3ProductManagerImpl + + productInfo + productStatus + + + + /ocipEdoc.do + com.seeyon.apps.ocip.exchange.edoc.OCIPEdocController + + index + + + + /m3/loginController.do + + transLogin + transLogout + getProfile + + + + /fileUpload.do + com.seeyon.ctp.common.fileupload.FileUploadController + + showRTE + processUpload + + + + qrCodeLoginManager + com.seeyon.ctp.login.manager.QrCodeLoginManagerImpl + + isLogin + + + + /form/formUpgrade.do + com.seeyon.ctp.form.service.FormUpgradeController + + toUpgrade + upgrade + viewUpgrade + + + + /seeyonReport/seeyonReportController.do + com.seeyon.apps.seeyonreport.controller.SeeyonReportController + + redirectSeeyonReport + + + + formtalkFormMapperController.do + com.seeyon.apps.formtalk.controller.FormtalkImportController + + importFormtalkData + + + + /thirdpartyController.do + com.seeyon.ctp.portal.sso.thirdpartyintegration.controller.ThirdpartyController + + access + index + logoutNotify + show + mailAuth + + + + /m3/transModeController.do + com.seeyon.apps.m3.transmissionmode.controller.M3TransModeController + + getTransModeForMobile + + + + /genericController.do + com.seeyon.v3x.common.controller.GenericController + + index + + + + /personalBind.do + com.seeyon.v3x.personalaffair.controller.PersonalBindController + + getBindTypeByLoginName + isCanUse + retrievePassword + sendVerificationCodeToBindEmail + sendVerificationCodeToBindNum + validateVerificationCode + + + + /commonimage.do + com.seeyon.apps.common.image.controller.ImageController + + showImage + + + + /individualManager.do + com.seeyon.v3x.personalaffair.controller.IndividualManagerController + + resetPassword + + + + meetingAjaxManager + com.seeyon.apps.meeting.manager.MeetingAjaxManagerImpl + + meetingPanelData + meetingPanelDisplay + + + + /wechat/dingding.do + com.seeyon.apps.weixin.controller.DingDingController + + binding + index + main + newIndex + newMain + viewh5Message + + + + /imc.do + com.seeyon.apps.imc.controller.ImcLoginController + + index + logout + + + + /wechat/feishu.do + com.seeyon.apps.weixin.controller.FeishuController + + newMain + viewh5Message + + + + + + + + + + + + + + + /wechat/pcapp.do + com.seeyon.apps.weixin.controller.PcAppController + + transferPageFromWxCoreServer + gotoPcApp + checkCodeTurnToRightPage + transfer + transferMsg + + + + /wechat/feishu/approvalData.do + com.seeyon.apps.zhifei.feishu.approval.controller.ApprovalDataController + + index + + + + /zhifei/feishu.do + com.seeyon.apps.zhifei.controller.FeishuController + + newMain + viewh5Message + + + + /zhifei/pcapp.do + com.seeyon.apps.zhifei.controller.ZhifeiPcAppController + + transferPageFromWxCoreServer + gotoPcApp + + + + /zhifei/feishu/approvalData.do + com.seeyon.apps.zhifei.feishu.approval.controller.ApprovalDataController + + index + + + + /cloudbuild.do + com.seeyon.apps.cloudbuild.controller.CloudBuildController + + download + getDownloadPageInfo + getLatestVersionInfo + getDownloadQrUrl + + + diff --git a/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/pluginCfg.xml b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/pluginCfg.xml new file mode 100644 index 0000000..6cbb38b --- /dev/null +++ b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/pluginCfg.xml @@ -0,0 +1,6 @@ + + + src_leasebill + 租赁账单生成 + 20250905 + diff --git a/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-controller.xml b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-controller.xml new file mode 100644 index 0000000..3983620 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-controller.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-dao.xml b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-dao.xml new file mode 100644 index 0000000..451b067 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-dao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-fieldCtrl.xml b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-fieldCtrl.xml new file mode 100644 index 0000000..73fecec --- /dev/null +++ b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-fieldCtrl.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-financing.xml b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-financing.xml new file mode 100644 index 0000000..5baa9ef --- /dev/null +++ b/v5/apps-customize/src/main/webapp/WEB-INF/cfgHome/plugin/src_leasebill/spring/spring-financing.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/formQueryBtn.css b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/formQueryBtn.css new file mode 100644 index 0000000..ae96722 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/formQueryBtn.css @@ -0,0 +1,27 @@ +.customButton_class_box { + width: 100%; + line-height: 24px; + height:24px; + color: #1f85ec; + cursor: pointer; + font-family: "Microsoft YaHei"!important; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + word-break:keep-all; +} +.customButton_box_content{ + width: 100%; + height: 24px; + box-sizing: border-box; + -webkit-box-sizing : border-box; + -moz-box-sizing : border-box; + text-align: center; + outline: none; + border: 1px solid #1f85ec; + background-color: #fff; + border-radius: 15px; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; +} + diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/img/icon16.png b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/img/icon16.png new file mode 100644 index 0000000..e43def3 Binary files /dev/null and b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/img/icon16.png differ diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/setCondition.css b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/setCondition.css new file mode 100644 index 0000000..6e08db4 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/setCondition.css @@ -0,0 +1,13 @@ +.relation_container .panel_bottom .zidong_guanlian .guanlian_map{ + padding-left: 10px; +} +.relation_container .panel_bottom .zidong_guanlian .guanlian_map .error-title{ + margin: 0 2px; + visibility: hidden; +} +.relation_container .panel_bottom .zidong_guanlian .guanlian_map .error-title.active{ + visibility: visible; +} +.relation_container .biz_groupguanlian .div_sel3.active{ + border-color: red; +} \ No newline at end of file diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/setTemplate.css b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/setTemplate.css new file mode 100644 index 0000000..a87540a --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/css/setTemplate.css @@ -0,0 +1,87 @@ +body{ + font-family: "microsoft yahei"; +} +#tab { + height: 26px; + width: 100%; + border-bottom: 1px solid #666666; + margin-bottom: 5px; +} +#tab span { + height: 30px; + line-height: 30px; + width: 50%; + font-size: 14px; + text-align: center; + color: #666666; + margin-right: 20px; + padding: 0 5px 0 5px; + cursor: pointer; +} +#tab span.select { + border-bottom: 2px solid #2453b3; + color: #2453b3; +} + +.list{ + list-style: none; + margin: 0; + padding: 0; + font-size: 14px; + height: 310px; + overflow: auto; +} +.list .active{ + background-color: #1F85EC; + border: 1px solid #1F85EC; + color: #ffffff; +} + +.list li{ + cursor: pointer; + margin: 3px 0 3px 0; +} +.list span{ + display: inline-block; + background: url("img/icon16.png") -32px -240px no-repeat scroll transparent; + margin-right: 2px; + vertical-align: middle; + width: 16px; + height: 16px; +} +.search-box { + height: 20px; + margin: 10px 0 10px 0; + position: relative; +} +.cap-icon-sousuo { + position: absolute; + top: 2px; + left: 170px; + color: #1F85EC; + font-size: 20px; + line-height: 20px; + cursor: pointer; +} +.cap-icon-sousuo:before { + content: ""; + background: url("img/icon16.png") -192px -176px no-repeat; + height: 16px; + line-height: 16px; + width: 16px; + font-size: 12px; + display: block; + position: absolute; + top: 5px; + margin-left: 2px; +} +.search-input { + background: #FFFFFF; + border: 1px solid #D4D4D4; + border-radius: 100px; + min-height: 20px; + width: 150px; + padding-right: 35px; + padding-left: 10px; + outline: none; +} diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/html/setTemplate.html b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/html/setTemplate.html new file mode 100644 index 0000000..edb3554 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/html/setTemplate.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+ 选择底表 +
+ +
+ +
    +
    + + + \ No newline at end of file diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/LodopFuncs.js b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/LodopFuncs.js new file mode 100644 index 0000000..9bf5413 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/LodopFuncs.js @@ -0,0 +1,188 @@ +//==本JS是加载Lodop插件或Web打印服务CLodop/Lodop7的综合示例,可直接使用,建议理解后融入自己程序== + +//用双端口加载主JS文件Lodop.js(或CLodopfuncs.js兼容老版本)以防其中某端口被占: +var MainJS ="CLodopfuncs.js", + URL_WS1 = "ws://localhost:8000/"+MainJS, //ws用8000/18000 + URL_WS2 = "ws://localhost:18000/"+MainJS, + URL_HTTP1 = "http://localhost:8000/"+MainJS, //http用8000/18000 + URL_HTTP2 = "http://localhost:18000/"+MainJS, + URL_HTTP3 = "https://localhost.lodop.net:8443/"+MainJS; //https用8000/8443 + +var CreatedOKLodopObject, CLodopIsLocal, LoadJsState; + +//==判断是否需要CLodop(那些不支持插件的浏览器):== +function needCLodop() { + try { + var ua = navigator.userAgent; + if (ua.match(/Windows\sPhone/i) || + ua.match(/iPhone|iPod|iPad/i) || + ua.match(/Android/i) || + ua.match(/Edge\D?\d+/i)) + return true; + var verTrident = ua.match(/Trident\D?\d+/i); + var verIE = ua.match(/MSIE\D?\d+/i); + var verOPR = ua.match(/OPR\D?\d+/i); + var verFF = ua.match(/Firefox\D?\d+/i); + var x64 = ua.match(/x64/i); + if ((!verTrident) && (!verIE) && (x64)) return true; + else if (verFF) { + verFF = verFF[0].match(/\d+/); + if ((verFF[0] >= 41) || (x64)) return true; + } else if (verOPR) { + verOPR = verOPR[0].match(/\d+/); + if (verOPR[0] >= 32) return true; + } else if ((!verTrident) && (!verIE)) { + var verChrome = ua.match(/Chrome\D?\d+/i); + if (verChrome) { + verChrome = verChrome[0].match(/\d+/); + if (verChrome[0] >= 41) return true; + } + } + return false; + } catch (err) { + return true; + } +} + +//==检查加载成功与否,如没成功则用http(s)再试== +//==低版本CLODOP6.561/Lodop7.043及前)用本方法== +function checkOrTryHttp() { + if (window.getCLodop) { + LoadJsState = "complete"; + return true; + } + if (LoadJsState == "loadingB" || LoadJsState == "complete") return; + LoadJsState = "loadingB"; + var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement; + var JS1 = document.createElement("script") + ,JS2 = document.createElement("script") + ,JS3 = document.createElement("script"); + JS1.src = URL_HTTP1; + JS2.src = URL_HTTP2; + JS3.src = URL_HTTP3; + JS1.onload = JS2.onload = JS3.onload = JS2.onerror = JS3.onerror=function(){LoadJsState = "complete";} + JS1.onerror = function(e) { + if (window.location.protocol !== 'https:') + head.insertBefore(JS2, head.firstChild); else + head.insertBefore(JS3, head.firstChild); + } + head.insertBefore(JS1,head.firstChild); +} + +//==加载Lodop对象的主过程:== +(function loadCLodop(){ + if (!needCLodop()) return; + CLodopIsLocal = !!((URL_WS1 + URL_WS2).match(/\/\/localho|\/\/127.0.0./i)); + LoadJsState = "loadingA"; + if (!window.WebSocket && window.MozWebSocket) window.WebSocket=window.MozWebSocket; + //ws方式速度快(小于200ms)且可避免CORS错误,但要求Lodop版本足够新: + try { + var WSK1=new WebSocket(URL_WS1); + WSK1.onopen = function(e) { setTimeout("checkOrTryHttp();",200); } + WSK1.onmessage = function(e) {if (!window.getCLodop) eval(e.data);} + WSK1.onerror = function(e) { + var WSK2=new WebSocket(URL_WS2); + WSK2.onopen = function(e) {setTimeout("checkOrTryHttp();",200);} + WSK2.onmessage = function(e) {if (!window.getCLodop) eval(e.data);} + WSK2.onerror= function(e) {checkOrTryHttp();} + } + } catch(e){ + checkOrTryHttp(); + } +})(); + +//==获取LODOP对象主过程,判断是否安装、需否升级:== +function getLodop(oOBJECT, oEMBED) { + var strFontTag = "
    打印控件"; + var strLodopInstall = strFontTag + "未安装!点击这里执行安装"; + var strLodopUpdate = strFontTag + "需要升级!点击这里执行升级"; + var strLodop64Install = strFontTag + "未安装!点击这里执行安装"; + var strLodop64Update = strFontTag + "需要升级!点击这里执行升级"; + var strCLodopInstallA = "
    Web打印服务CLodop未安装启动,点击这里下载执行安装"; + var strCLodopInstallB = "
    (若此前已安装过,可点这里直接再次启动)"; + var strCLodopUpdate = "
    Web打印服务CLodop需升级!点击这里执行升级"; + var strLodop7FontTag = "
    Web打印服务Lodop7"; + var strLodop7HrefX86 = "点击这里下载安装(下载后解压,点击lodop文件开始执行)"; + var strLodop7HrefARM = "点击这里下载安装(下载后解压,点击lodop文件开始执行)"; + var strLodop7Install_X86 = strLodop7FontTag + "未安装启动," + strLodop7HrefX86; + var strLodop7Install_ARM = strLodop7FontTag + "未安装启动," + strLodop7HrefARM; + var strLodop7Update_X86 = strLodop7FontTag + "需升级," + strLodop7HrefX86; + var strLodop7Update_ARM = strLodop7FontTag + "需升级," + strLodop7HrefARM; + var strInstallOK = ",成功后请刷新本页面或重启浏览器。"; + var LODOP; + try { + var isWinIE = (/MSIE/i.test(navigator.userAgent)) || (/Trident/i.test(navigator.userAgent)); + var isWinIE64 = isWinIE && (/x64/i.test(navigator.userAgent)); + var isLinuxX86 = (/Linux/i.test(navigator.platform)) && (/x86/i.test(navigator.platform)); + var isLinuxARM = (/Linux/i.test(navigator.platform)) && (/aarch/i.test(navigator.platform)); + + if (needCLodop() || isLinuxX86 || isLinuxARM) { + try { + LODOP = window.getCLodop(); + } catch (err) {} + if (!LODOP && LoadJsState !== "complete") { + if (!LoadJsState) + alert("未曾加载Lodop主JS文件,请先调用loadCLodop过程."); else + alert("网页还没下载完毕,请稍等一下再操作."); + return; + } + var strAlertMessage; + if (!LODOP) { + if (isLinuxX86) + strAlertMessage = strLodop7Install_X86; + else if (isLinuxARM) + strAlertMessage = strLodop7Install_ARM; + else + strAlertMessage = strCLodopInstallA + (CLodopIsLocal ? strCLodopInstallB : ""); + document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML; + return; + } else { + if (isLinuxX86 && LODOP.CVERSION < "7.0.4.3") + strAlertMessage = strLodop7Update_X86; + else if (isLinuxARM && LODOP.CVERSION < "7.0.4.3") + strAlertMessage = strLodop7Update_ARM; + else if (CLODOP.CVERSION < "6.5.7.1") + strAlertMessage = strCLodopUpdate; + + if (strAlertMessage) + document.body.innerHTML = strAlertMessage + strInstallOK + document.body.innerHTML; + } + } else { + //==如果页面有Lodop插件就直接使用,否则新建:== + if (oOBJECT || oEMBED) { + if (isWinIE) + LODOP = oOBJECT; + else + LODOP = oEMBED; + } else if (!CreatedOKLodopObject) { + LODOP = document.createElement("object"); + LODOP.setAttribute("width", 0); + LODOP.setAttribute("height", 0); + LODOP.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;"); + if (isWinIE) + LODOP.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA"); + else + LODOP.setAttribute("type", "application/x-print-lodop"); + document.documentElement.appendChild(LODOP); + CreatedOKLodopObject = LODOP; + } else + LODOP = CreatedOKLodopObject; + //==Lodop插件未安装时提示下载地址:== + if ((!LODOP) || (!LODOP.VERSION)) { + document.body.innerHTML = (isWinIE64 ? strLodop64Install : strLodopInstall) + strInstallOK + document.body.innerHTML; + return LODOP; + } + if (LODOP.VERSION < "6.2.2.6") { + document.body.innerHTML = (isWinIE64 ? strLodop64Update : strLodopUpdate) + strInstallOK + document.body.innerHTML; + } + } + //===如下空白位置适合调用统一功能(如注册语句、语言选择等):======================= + + + //=============================================================================== + return LODOP; + } catch (err) { + alert("getLodop出错:" + err); + } +} + diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/openUnflow.js b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/openUnflow.js new file mode 100644 index 0000000..3d24b0e --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/openUnflow.js @@ -0,0 +1,206 @@ +(function(f){ + var nameSpace = 'field_5209586381190735608'; + if(!window[nameSpace]){ + var Builder = f(); + window[nameSpace] = { + instance: {} + }; + window[nameSpace].init = function (options) { + window[nameSpace].instance[options.privateId] = new Builder(options); + }; + } +})(function(){ + /** + * 构造函数 + * @param options + * @constructor + */ + function App(options) { + var self = this; + //初始化参数 + self.initParams(options); + //初始化dom + self.initDom(); + //事件 + self.events(); + } + + App.prototype = { + initParams : function (options) { + var self = this; + self.adaptation = options.adaptation; + self.adaptation.formMessage = options.formMessage; + self.privateId = options.privateId; + self.messageObj = options.getData; + self.preUrl = options.url_prefix; + }, + initDom : function () { + var self = this; + dynamicLoading.css(self.preUrl + 'css/formQueryBtn.css'); + self.appendChildDom(); + }, + events : function () { + var self = this; + // 监听是否数据刷新 + + $(".field0215__").css("background-color","#008BFF"); + $(".field0215__").css("color","#FFFFFF"); + $(".field0215__").css("border-radius","10px"); + $(".field0215__").mouseover(function (e) { + var $this = $(this);// 当前触发事件的标签对象 + }).mouseout(function (e) { + $(".field0215__").css("background-color","#008BFF"); + }).mousemove(function (e) { + $(".field0215__").css("background-color","#005297"); + }); + + }, + appendChildDom : function () { + var self = this; + var domStructure = '
    '+ + '
    '+ self.messageObj.display.escapeHTML() +'
    '+ + '
    '; + document.querySelector('#' + self.privateId).innerHTML = domStructure; + var jumpFun = function() { + var url2 = window.location.origin; + var s = self; + // var recordId = self.messageObj.formdata.formsons.front_formson_7.records[0].recordId; + // 计费方式 + var jifeifsfield = {fieldId: 'field0032'}; + var jifeifs = csdk.core.getFieldData(jifeifsfield).showValue; + // 缴费方式 + var jiaofeifsfield = {fieldId: 'field0033'}; + var jiaofeifs = csdk.core.getFieldData(jiaofeifsfield).showValue; + // 年缴费方式类型 + var njiaofeifsfield = {fieldId: 'field0034'}; + var njiaofeifs = csdk.core.getFieldData(njiaofeifsfield).showValue; + // 面积单价 + var mjzjfield = {fieldId: 'field0035'}; + var mjzj = csdk.core.getFieldData(mjzjfield).value; + // 固定租金单价 + var gdzjfield = {fieldId: 'field0038'}; + var gdzj = csdk.core.getFieldData(gdzjfield).value; + // 合同开始日期 + var startDatefield = {fieldId: 'field0041'}; + var startDate = csdk.core.getFieldData(startDatefield).value; + // 合同结束日期 + var endDatefield = {fieldId: 'field0042'}; + var endDate = csdk.core.getFieldData(endDatefield).value; + // 租赁面积 + var mjfield = {fieldId: 'field0081'}; + var mj = csdk.core.getFieldData(mjfield).value; + // 账单编号 + // var field0083 = {fieldId: 'field0083'}; + // var field0083value = csdk.core.getFieldData(field0083).value; + var bdidfield = {fieldId: 'field0101'}; + var bdid = csdk.core.getFieldData(bdidfield).value; + + // 判断合同开始日期是否在合同结束日期之前 + if(!isEmpty(startDate)|| !isEmpty(endDate)){ + if(Date.parse(startDate)>Date.parse(endDate)){ + $.alert("请正确填写合同日期"); + return ; + } + }else{ + $.alert("请填写合同日期"); + return ; + } + + // 当缴费方式为年缴费时年缴费类型必填 + if(jiaofeifs=='年'){ + if(isEmpty(njiaofeifs)){ + $.alert("请选择年缴费方式选项"); + return ; + } + } + + console.log(url2); + var str = ""; + + $.ajax({ + type : 'post', + async : true, + // 记得加随机数,不然如果ajax轮询请求会不执行 + url : encodeURI('/seeyon/leaseBillController.do?datetime=' + Math.random()), + data:{ + "jifeifs":jifeifs, + "jiaofeifs":jiaofeifs, + "njiaofeifs":njiaofeifs, + "startDate":startDate, + "endDate":endDate, + "mj":mj, + "mjzj":mjzj, + "gdzj":gdzj, + "bdid":bdid + }, + dataType : 'json', + contentType : 'application/json; charset=UTF-8', + success : function(res) { + var randomNum = Math.floor(Math.random() * 10001); + if(res.success){ + // $.alert("账单明细生成完成"); + if(bdid=="" ){ + var data = { + fieldId: 'field0101', + fieldData: { + value: res.num+'', //数据值,存入数据库中的value值 + display: res.num+'', //字段渲染在页面上的显示值,通常是经过format后的值 + auth: '' + } + }; + csdk.core.setFieldData(data); + } + // self.adaptation.formdata.field0095.formmains.formmain_0228.field0064.value = randomNum; + self.adaptation.formdata.field0100__.formmains.formmain_0033.field0102.value = randomNum; + }else{ + $.alert(res.s); + } + } + }); + var content = self.messageObj.formdata.content; + + }; + document.querySelector('.' + self.privateId).removeEventListener('click', jumpFun); + document.querySelector('.' + self.privateId).addEventListener('click', jumpFun); + //渲染隐藏权限 + if (self.messageObj.auth === 'hide') { + document.querySelector('#' + self.privateId).innerHTML = '
    ***
    '; + } + } + }; + + function test() { + console.log("明细行生成成功");; + } + + + function isEmpty(text) { + return !text || text.trim() === ''; + } + + var dynamicLoading = { + css: function(path) { + if(!path || path.length === 0) { + throw new Error('argument "path" is required !'); + } + var head = document.getElementsByTagName('head')[0]; + var link = document.createElement('link'); + link.href = path; + link.rel = 'stylesheet'; + link.type = 'text/css'; + head.appendChild(link); + }, + js: function(path) { + if(!path || path.length === 0) { + throw new Error('argument "path" is required !'); + } + var head = document.getElementsByTagName('head')[0]; + var script = document.createElement('script'); + script.src = path; + script.type = 'text/javascript'; + head.appendChild(script); + } + } + + return App; +}); \ No newline at end of file diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/openUnflow.js.bak b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/openUnflow.js.bak new file mode 100644 index 0000000..1eb4434 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/openUnflow.js.bak @@ -0,0 +1,134 @@ +(function(f){ + var nameSpace = 'field_6664988151731237757'; + if(!window[nameSpace]){ + var Builder = f(); + window[nameSpace] = { + instance: {} + }; + window[nameSpace].init = function (options) { + window[nameSpace].instance[options.privateId] = new Builder(options); + }; + } +})(function(){ + /** + * 构造函数 + * @param options + * @constructor + */ + function App(options) { + var self = this; + //初始化参数 + self.initParams(options); + //初始化dom + self.initDom(); + //事件 + self.events(); + } + + App.prototype = { + initParams : function (options) { + var self = this; + self.adaptation = options.adaptation; + self.adaptation.formMessage = options.formMessage; + self.privateId = options.privateId; + self.messageObj = options.getData; + self.preUrl = options.url_prefix; + }, + initDom : function () { + var self = this; + dynamicLoading.css(self.preUrl + 'css/formQueryBtn.css'); + self.appendChildDom(); + }, + events : function () { + var self = this; + // 监听是否数据刷新 + + //$(".field0313__").css("background-color","#008BFF"); + //$(".field0313__").css("color","#FFFFFF"); + //$(".field0313__").css("border-radius","10px"); + //$(".field0313__").mouseover(function (e) { + // var $this = $(this);// 当前触发事件的标签对象 + //}).mouseout(function (e) { + // $(".field0313__").css("background-color","#008BFF"); + //}).mousemove(function (e) { + // $(".field0313__").css("background-color","#005297"); + //}); + + }, + appendChildDom : function () { + var self = this; + var domStructure = '
    '+ + '
    '+ self.messageObj.display.escapeHTML() +'
    '+ + '
    '; + document.querySelector('#' + self.privateId).innerHTML = domStructure; + var jumpFun = function() { + var url2 = window.location.origin; + var s = self; + + var field0206 = {fieldId: 'field0206'}; + var field0206value = csdk.core.getFieldData(field0206).value; + var field0068 = {fieldId: 'field0068'}; + var field0068value = csdk.core.getFieldData(field0068).value; + var field0212 = {fieldId: 'field0212'}; + var field0212value = csdk.core.getFieldData(field0212).value; + var field0213 = {fieldId: 'field0213'}; + var field0213value = csdk.core.getFieldData(field0213).value; + var field0214 = {fieldId: 'field0214'}; + var field0214value = csdk.core.getFieldData(field0214).value; + var field0207 = {fieldId: 'field0207'}; + var field0207value = csdk.core.getFieldData(field0207).showValue; + + var str = ""; + + $.ajax({ + type : 'post', + async : true, + // 记得加随机数,不然如果ajax轮询请求会不执行 + url : encodeURI('/seeyon/interestMeasurementController.do?datetime=' + Math.random()), + data:{"startDate":field0206value,"cycle":field0207value,"credit":field0068,"principal":field0212,"money":field0213,"interestRate":field0214,}, + dataType : 'json', + contentType : 'application/json; charset=UTF-8', + success : function(res) { + alert("123123123"); + + + } + }); + var content = self.messageObj.formdata.content; + + }; + document.querySelector('.' + self.privateId).removeEventListener('click', jumpFun); + document.querySelector('.' + self.privateId).addEventListener('click', jumpFun); + //渲染隐藏权限 + if (self.messageObj.auth === 'hide') { + document.querySelector('#' + self.privateId).innerHTML = '
    ***
    '; + } + } + }; + + var dynamicLoading = { + css: function(path) { + if(!path || path.length === 0) { + throw new Error('argument "path" is required !'); + } + var head = document.getElementsByTagName('head')[0]; + var link = document.createElement('link'); + link.href = path; + link.rel = 'stylesheet'; + link.type = 'text/css'; + head.appendChild(link); + }, + js: function(path) { + if(!path || path.length === 0) { + throw new Error('argument "path" is required !'); + } + var head = document.getElementsByTagName('head')[0]; + var script = document.createElement('script'); + script.src = path; + script.type = 'text/javascript'; + head.appendChild(script); + } + } + + return App; +}); \ No newline at end of file diff --git a/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/setTemplate.js b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/setTemplate.js new file mode 100644 index 0000000..bc6bb40 --- /dev/null +++ b/v5/apps-customize/src/main/webapp/apps_res/cap/customCtrlResources/leaseBillResources/js/setTemplate.js @@ -0,0 +1,99 @@ +var unflowList, param, loading, process; +$(document).ready(function() { + param = initParam().params;// 获取页面参数 + // 处理进度条 + process = top.$.progressBar({ + text : "加载中..." + }); + loading = true; + getUnflowList(); +}); + + +// 获取底表 +function getUnflowList() { + $.ajax({ + url : "/seeyon/rest/cap4/unflow/select", + async : true, + success : function(data) { + // 处理进度条 + if (loading) + process.close(); + loading = false; + //data = JSON.parse(data); + var result = data.data; + unflowList = result; + for (var i = 0; i < result.length; i++) { + $("#queryList ul").append( + $("
  • " + + result[i].name + + "
  • ").attr("info", + JSON.stringify(result[i]))); + } + $("#queryList ul").delegate( + "li", + "click", + function() { + $(this).siblings().removeClass('active').end() + .addClass('active'); + }); + if (param && param.id) { // 激活当前项 + $('#' + param.id).trigger('click'); + } + } + }); +} + +// 搜索 +function search() { + var searchValue = $("#search_query").val(); + $("#queryList ul").empty(); + for (var i = 0; i < unflowList.length; i++) { + if (unflowList[i].name.indexOf(searchValue) != -1) { + $("#queryList ul").append( + $("
  • " + + unflowList[i].name + "
  • ").attr( + "info", JSON.stringify(unflowList[i]))); + } + } +} + +// 返回参数获取 +function getResult() { + return JSON.parse($("#queryList ul").find(".active").attr("info") + || "{}"); +} + +// --------------------以下为固定方法,需要实现返回参数获取-------------- + +// 获取弹窗传递过来的参数 +function initParam() { + var obj = window.parentDialogObj && (window.parentDialogObj["ctrlDialog"]);// 获取窗口对象 + if (obj && obj.getTransParams) { + // 然后通过V5方法获取弹窗传递过来的参数 + return obj.getTransParams(); + } +} + +// 确定按钮调用方法,返回需要的json数据 +function OK() { + var result = getResult(); + + if (param && param.designId !== result.designId) + return { + valid : true, + data : { + customParam : { + templateId : result, + mapping : null + } + } + }; + + return { + valid : true, + data : result + }; +} \ No newline at end of file