2026-04-08永明实业项目初始化
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package com.seeyon.apps.src_financing;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_financing.constants.FinancingConstants;
|
||||
|
||||
|
||||
public class FinancingPluginApi extends APluginInfoApi {
|
||||
public FinancingPluginApi() {
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
System.out.println(FinancingConstants.getPluginId());
|
||||
return FinancingConstants.getPluginId();
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return "橙阳科技";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return "融资管理";
|
||||
}
|
||||
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
FinancingConstants[] var2 = FinancingConstants.values();
|
||||
int var3 = var2.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
FinancingConstants value = var2[var4];
|
||||
if (value != FinancingConstants.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", "资产管理待办推送");
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.seeyon.apps.src_financing.constants;
|
||||
|
||||
public enum FinancingConstants {
|
||||
|
||||
|
||||
plugin("src_financing","插件ID"),
|
||||
loginName("shenxian", "辅助表创建人");
|
||||
FinancingConstants(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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,463 @@
|
||||
package com.seeyon.apps.src_financing.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_financing.constants.FinancingConstants;
|
||||
import com.seeyon.apps.src_financing.dao.IFinancingContractDao;
|
||||
import com.seeyon.apps.src_financing.util.FormExportUtil;
|
||||
import com.seeyon.apps.src_financing.util.InterestCalculationUtil;
|
||||
import com.seeyon.apps.src_financing.util.NumberUtil;
|
||||
import com.seeyon.cap4.form.api.FormApi4Cap4;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.controller.BaseController;
|
||||
import com.seeyon.ctp.util.UUIDLong;
|
||||
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.RecordExport;
|
||||
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 InterestMeasurementController extends BaseController {
|
||||
private static Log log = Log.get(InterestMeasurementController.class);
|
||||
private FormFactory formFactory;
|
||||
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
public FormFactory getFormFactory() {
|
||||
if (formFactory == null) {
|
||||
formFactory = (FormFactory) AppContext.getBean("formFactory");
|
||||
}
|
||||
return formFactory;
|
||||
}
|
||||
|
||||
public void setFormFactory(FormFactory formFactory) {
|
||||
this.formFactory = formFactory;
|
||||
}
|
||||
|
||||
private IFinancingContractDao financingContractDao;
|
||||
|
||||
public IFinancingContractDao getLeaseContractDao() {
|
||||
if (financingContractDao == null) {
|
||||
financingContractDao = (IFinancingContractDao) AppContext.getBean("financingContractDao");
|
||||
}
|
||||
return financingContractDao;
|
||||
}
|
||||
|
||||
public void setFinancingContractDao(IFinancingContractDao financingContractDao) {
|
||||
this.financingContractDao = financingContractDao;
|
||||
}
|
||||
|
||||
private FormApi4Cap4 formApi4Cap4;
|
||||
|
||||
public FormApi4Cap4 getFormApi4Cap4() {
|
||||
if (this.formApi4Cap4 == null) {
|
||||
this.formApi4Cap4 = (FormApi4Cap4)AppContext.getBean("formApi4Cap4");
|
||||
}
|
||||
|
||||
return this.formApi4Cap4;
|
||||
}
|
||||
public ConfigVo getFinancingConfig() {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
return FinancingConstants.getPluginId();
|
||||
}
|
||||
|
||||
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
log.info("进入ajax方法");
|
||||
ConfigVo configVo = getFinancingConfig();
|
||||
// 设置返回值对象
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
InterestCalculationUtil rentCalculationUtil = new InterestCalculationUtil();
|
||||
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]);
|
||||
}
|
||||
}
|
||||
log.info("处理参数");
|
||||
String interestType = jsonObject.getString("interestType");
|
||||
// 获取初次提款时间
|
||||
String money = jsonObject.getString("money");
|
||||
String[] moneys = money.split(";");
|
||||
// 转list
|
||||
List<String> moneyList = Arrays.asList(moneys);
|
||||
Collections.sort(moneyList);
|
||||
String[] moenyValue = moneyList.get(0).split("~");
|
||||
String moneyDateStr = moenyValue[0];
|
||||
// 获取利率初次设置时间
|
||||
String interestRate = jsonObject.getString("interestRate");
|
||||
String[] interestRates = interestRate.split(";");
|
||||
// 转list
|
||||
List<String> interestRateList = Arrays.asList(interestRates);
|
||||
// list排序
|
||||
Collections.sort(interestRateList);
|
||||
String[] interestRateValue = interestRateList.get(0).split("~");
|
||||
String interestRateDateStr = interestRateValue[0];
|
||||
// 获取还本金列表参数
|
||||
String principal = jsonObject.getString("principal");
|
||||
// 根据开始时间和合同年限进行时间拆分
|
||||
String startDate = jsonObject.getString("startDate");
|
||||
Date date = sdf.parse(startDate);
|
||||
// 开始日期
|
||||
Calendar start = Calendar.getInstance();
|
||||
start.setTime(date);
|
||||
// 结束日期
|
||||
Calendar end = Calendar.getInstance();
|
||||
end.setTime(date);
|
||||
String period = jsonObject.getString("period");
|
||||
period = period.substring(0,period.length()-1);
|
||||
int periodNum = NumberUtil.convertChineseNumberToArabic(period);
|
||||
end.add(Calendar.YEAR, periodNum);
|
||||
end.add(Calendar.DATE, 1);
|
||||
log.info("设置结束时间");
|
||||
// 根据开始结束时间和周期计算时间列表
|
||||
String cycle = jsonObject.getString("cycle");
|
||||
int cycleNum = rentCalculationUtil.getCycleNum(cycle);
|
||||
// 查询计划还本金列表中的最后还款日期
|
||||
Calendar maxDate = rentCalculationUtil.getPrincipalMaxDate(principal);
|
||||
List<Date> cycleDates = rentCalculationUtil.cycleDates(start,end,cycleNum,maxDate);
|
||||
|
||||
// 计算开始时间
|
||||
Date lxstartDate = sdf.parse(moneyDateStr);
|
||||
// 结算结束时间
|
||||
Date lxendDate = cycleDates.get(0);
|
||||
if(lxendDate.getTime()<lxstartDate.getTime()){
|
||||
System.out.println("时间有误,初次还利息时间不能早于初次提款时间");
|
||||
res.put("success", false);
|
||||
res.put("name", AppContext.currentUserLoginName());
|
||||
res.put("msg", "时间有误,初次还利息时间不能早于初次提款时间");
|
||||
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}
|
||||
log.info("设置利率开始时间");
|
||||
// 利率开始时间
|
||||
Date llstartDate = sdf.parse(interestRateDateStr);
|
||||
if(llstartDate.getTime()>lxstartDate.getTime()){
|
||||
System.out.println("时间有误,初次利率设置时间不能晚于初次提款时间");
|
||||
res.put("success", false);
|
||||
res.put("name", AppContext.currentUserLoginName());
|
||||
res.put("s", "时间有误,初次利率设置时间不能晚于初次提款时间");
|
||||
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}
|
||||
log.info("判断是否为农发行规则");
|
||||
|
||||
// 数据生成前根据合同编号清楚所有的辅助表信息
|
||||
String contractCode = jsonObject.getString("contractCode");
|
||||
// if(!StringUtil.isEmpty(contractCode)){
|
||||
//// 删除明细表辅助数据
|
||||
// int daleteFZFinancingSubnum = getLeaseContractDao().daleteFZFinancingSub(contractCode);
|
||||
//// 删除主表辅助数据
|
||||
// int daleteFZFinancingnum = getLeaseContractDao().daleteFZFinancing(contractCode);
|
||||
// if(daleteFZFinancingSubnum!=0 &&daleteFZFinancingnum!=0){
|
||||
// System.out.println("存在辅助表数据,删除成功,主表删除"+daleteFZFinancingnum+"条数据,明细表删除"+daleteFZFinancingSubnum+"条数据");
|
||||
// }else{
|
||||
// System.out.println("删除失败,主表"+daleteFZFinancingSubnum+"明细表"+daleteFZFinancingnum+"合同编码"+contractCode);
|
||||
// }
|
||||
// }
|
||||
log.info("删除历史生成的数据");
|
||||
// 创建保存利息明细信息
|
||||
List<Map<String,Object>> sublist = new ArrayList<Map<String,Object>>();
|
||||
// 判断利息测算类型
|
||||
String type = "";
|
||||
String loanType = jsonObject.getString("loanType");
|
||||
if("政府专项债券".equals(loanType)){
|
||||
type = "政府专项利息测算";
|
||||
}else{
|
||||
String[] principals = principal.split(";");
|
||||
String str = principals[0].substring(principals[0].length()-2);
|
||||
if(!"~0".equals(str)){
|
||||
if("农发行利息测算".equals(interestType)&& interestRates.length!=moneys.length){
|
||||
System.out.println("数据有误,农发行融资利息测算提款明细行数与融资利率明细行数必须相等");
|
||||
res.put("success", false);
|
||||
res.put("name", AppContext.currentUserLoginName());
|
||||
res.put("s", "数据有误,农发行融资利息测算提款明细行数与融资利率明细行数必须相等");
|
||||
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}
|
||||
type = "农发行利息测算";
|
||||
}else{
|
||||
type = "银行贷款利息测算";
|
||||
}
|
||||
}
|
||||
// 设置更新触发规则
|
||||
String updateCode = jsonObject.getString("updateCode");
|
||||
int codenum = 0;
|
||||
if(!StringUtil.isEmpty(updateCode)){
|
||||
String code = updateCode.substring(updateCode.length()-1);
|
||||
codenum = Integer.parseInt(code);
|
||||
codenum =codenum%10;
|
||||
codenum +=1;
|
||||
}
|
||||
|
||||
// 计算利息信息保存利息明细对象
|
||||
sublist = rentCalculationUtil.detailedHandle(jsonObject,type);
|
||||
log.info("生成完成所有利息");
|
||||
|
||||
log.info("创建档案");
|
||||
List<String> contractIds = getLeaseContractDao().getFZinancingid(contractCode);
|
||||
FormExport[] formExports = getFormFactory().exportBusinessFormData("LXCSMX",
|
||||
"2024-11-01 00:00:00",simpleDateFormat.format(new Date()),new String[]{});
|
||||
FormExportUtil formExportUtil = new FormExportUtil();
|
||||
FormExport formExport = new FormExport();
|
||||
for(FormExport formExportold :formExports){
|
||||
for(ValueExport valueExport : formExportold.getValues()){
|
||||
if("合同编号".equals(valueExport.getDisplayName())){
|
||||
if(contractCode.equals(valueExport.getValue())){
|
||||
formExport = formExportold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(contractIds.size()==0){
|
||||
Map<String,Object> mainmap = new HashMap<String,Object>();
|
||||
mainmap.put("合同编号", contractCode);
|
||||
mainmap.put("触发文本更新", contractCode+codenum);
|
||||
|
||||
List<SubordinateFormExport> subordinateFormExports = formExportUtil.setSubordinateFormValue(sublist);
|
||||
List<ValueExport> valueExports = formExportUtil.setFormValue(mainmap);
|
||||
formExport.setSubordinateForms(subordinateFormExports);
|
||||
formExport.setValues(valueExports);
|
||||
|
||||
log.info("创建档案");
|
||||
String loginName = configVo.getParamVal(FinancingConstants.loginName.name());
|
||||
getFormFactory().importBusinessFormData(loginName, "LXCSMX",
|
||||
formExport, new String[] {});
|
||||
}else{
|
||||
// 查询需要修改的ID
|
||||
String contractId = contractIds.get(0);
|
||||
// 修改主表信息
|
||||
int issuccessform = getLeaseContractDao().updateLXFinancingbyId(contractCode+codenum,contractId);
|
||||
// 修改从表信息
|
||||
// 获取明细表对象列表
|
||||
List<SubordinateFormExport> subordinateFormExports = formExport.getSubordinateForms();
|
||||
// 获取第一个明细表对象
|
||||
SubordinateFormExport subordinateFormExport =subordinateFormExports.get(0);
|
||||
// 获取明细行对象
|
||||
List<RecordExport> recordExports = subordinateFormExport.getValues();
|
||||
// 判断明细行与当前明细行是否匹配
|
||||
int differ = recordExports.size()-sublist.size();
|
||||
if(differ==0){
|
||||
for(int i = 0 ; i < recordExports.size() ;i++){
|
||||
// 替换原本数据信息
|
||||
Map<String ,String> paramMap = new HashMap<>();
|
||||
RecordExport recordExport = recordExports.get(i);
|
||||
Map<String,Object> map = sublist.get(i);
|
||||
List<ValueExport> valueExports = recordExport.getRecord();
|
||||
for(int n = 0 ; n < valueExports.size();n ++){
|
||||
ValueExport subValueExport = valueExports.get(n);
|
||||
if("序号1".equals(subValueExport.getDisplayName())){
|
||||
paramMap.put("field0001",subValueExport.getValue());
|
||||
}if("计划利息还款明细编号".equals(subValueExport.getDisplayName())){
|
||||
paramMap.put("field0004",subValueExport.getValue());
|
||||
}
|
||||
}
|
||||
paramMap.put("field0005","-4351865301164799504");
|
||||
paramMap.put("formmainId",contractId);
|
||||
paramMap.put("field0006",map.get("计划还款日期").toString());
|
||||
paramMap.put("field0007",map.get("计划还款金额").toString());
|
||||
paramMap.put("field0008","");
|
||||
// 查询出来基础数据
|
||||
int issuccessSub = getLeaseContractDao().updateLXFinancingSubbyFormId(paramMap);
|
||||
System.out.println("替换"+issuccessform);
|
||||
}
|
||||
}else if (differ>0){
|
||||
for(int i = 0 ; i < sublist.size() ;i++){
|
||||
// 替换原有数据库数据
|
||||
Map<String ,String> paramMap = new HashMap<>();
|
||||
RecordExport recordExport = recordExports.get(i);
|
||||
Map<String,Object> map = sublist.get(i);
|
||||
List<ValueExport> valueExports = recordExport.getRecord();
|
||||
for(int n = 0 ; n < valueExports.size();n ++){
|
||||
ValueExport subValueExport = valueExports.get(n);
|
||||
if("序号1".equals(subValueExport.getDisplayName())){
|
||||
paramMap.put("field0001",subValueExport.getValue());
|
||||
}if("计划利息还款明细编号".equals(subValueExport.getDisplayName())){
|
||||
paramMap.put("field0004",subValueExport.getValue());
|
||||
}
|
||||
}
|
||||
paramMap.put("field0005","-4351865301164799504");
|
||||
paramMap.put("formmainId",contractId);
|
||||
paramMap.put("field0006",map.get("计划还款日期").toString());
|
||||
paramMap.put("field0007",map.get("计划还款金额").toString());
|
||||
paramMap.put("field0008","");
|
||||
// 查询出来基础数据
|
||||
int issuccessSub = getLeaseContractDao().updateLXFinancingSubbyFormId(paramMap);
|
||||
System.out.println("替换"+issuccessSub);
|
||||
}
|
||||
// 删除多余明细行数据
|
||||
int isdeleteSub = getLeaseContractDao().deleteLXFinancingSubbyFormId(sublist.size()+"",contractId );
|
||||
System.out.println("删除"+isdeleteSub);
|
||||
}else if (differ<0){
|
||||
for(int i = 0 ; i < recordExports.size() ;i++){
|
||||
// 替换原本数据信息
|
||||
Map<String ,String> paramMap = new HashMap<>();
|
||||
RecordExport recordExport = recordExports.get(i);
|
||||
Map<String,Object> map = sublist.get(i);
|
||||
List<ValueExport> valueExports = recordExport.getRecord();
|
||||
for(int n = 0 ; n < valueExports.size();n ++){
|
||||
ValueExport subValueExport = valueExports.get(n);
|
||||
if("序号1".equals(subValueExport.getDisplayName())){
|
||||
paramMap.put("field0001",subValueExport.getValue());
|
||||
}if("计划利息还款明细编号".equals(subValueExport.getDisplayName())){
|
||||
paramMap.put("field0004",subValueExport.getValue());
|
||||
}
|
||||
}
|
||||
paramMap.put("field0005","-4351865301164799504");
|
||||
paramMap.put("formmainId",contractId);
|
||||
paramMap.put("field0006",map.get("计划还款日期").toString());
|
||||
paramMap.put("field0007",map.get("计划还款金额").toString());
|
||||
paramMap.put("field0008","");
|
||||
// 查询出来基础数据
|
||||
int issuccessSub = getLeaseContractDao().updateLXFinancingSubbyFormId(paramMap);
|
||||
System.out.println("替换"+issuccessSub);
|
||||
}
|
||||
for(int i = 0 ; i<(differ*-1) ; i++){
|
||||
// 添加明细表
|
||||
Map<String,Object> map = sublist.get(recordExports.size()+i);
|
||||
Map<String ,String> paramMap = new HashMap<>();
|
||||
long l = UUIDLong.longUUID();
|
||||
paramMap.put("id",l+"");
|
||||
paramMap.put("formmainId",contractId);
|
||||
paramMap.put("field0001",recordExports.size()+i+1+"");
|
||||
paramMap.put("field0004",contractCode+(recordExports.size()+i+1));
|
||||
paramMap.put("field0005","-4351865301164799504");
|
||||
paramMap.put("field0006",map.get("计划还款日期").toString());
|
||||
paramMap.put("field0007",map.get("计划还款金额").toString());
|
||||
int isAddSub = getLeaseContractDao().addLXFinancingSubbyFormId(paramMap);
|
||||
System.out.println("新增"+isAddSub);
|
||||
}
|
||||
}
|
||||
|
||||
// Map<String,Object> mainmap = new HashMap<String,Object>();
|
||||
// mainmap.put("触发文本更新", contractCode+codenum);
|
||||
// formExport = formExportUtil.updateFormValue(formExport,mainmap);
|
||||
// formExport = formExportUtil.updateSubordinateFormValue(formExport,sublist);
|
||||
// long updateId = getFormFactory().updateBusinessFormData(Long.parseLong(contractCodes.get(0)),
|
||||
// "shenxian", "LXCSMX",formExport);
|
||||
// System.out.println(updateId);
|
||||
}
|
||||
|
||||
// Map<String,Object> mainmap = new HashMap<String,Object>();
|
||||
// mainmap.put("合同编号", contractCode);
|
||||
// mainmap.put("触发文本更新", contractCode+codenum);
|
||||
//
|
||||
// List<SubordinateFormExport> subordinateFormExports = formExportUtil.setSubordinateFormValue(sublist);
|
||||
// List<ValueExport> valueExports = formExportUtil.setFormValue(mainmap);
|
||||
// formExport.setSubordinateForms(subordinateFormExports);
|
||||
// formExport.setValues(valueExports);
|
||||
// FormBean cap4FormBean = getFormApi4Cap4().getFormByFormCode("LXCSMX");
|
||||
|
||||
|
||||
// getFormFactory().updateBusinessFormData(1l,"shenxian", "LXCSMX",formExport);
|
||||
// getFormFactory().importBusinessFormData("admin1", "LXCSMX",
|
||||
// formExport, new String[] {});
|
||||
// getFormFactory().importBusinessFormData("admin1", "LXCSMX",
|
||||
// formExport, new String[] {});
|
||||
// getFormFactory().importBusinessFormData("demo2", "LXCSMX",
|
||||
// formExport, new String[] {});
|
||||
res.put("success", true);
|
||||
res.put("name", AppContext.currentUserLoginName());
|
||||
res.put("s", "");
|
||||
res.put("num", contractCode+codenum);
|
||||
|
||||
// JSONObject patchData = new JSONObject();
|
||||
// patchData.put("code",0);
|
||||
// JSONObject jsonData = new JSONObject();
|
||||
// jsonData.put("success",1);
|
||||
// jsonData.put("code","200");
|
||||
// jsonData.put("message","操作成功!");
|
||||
// JSONObject formData = new JSONObject();
|
||||
// JSONObject tableData = new JSONObject();
|
||||
// JSONObject formmain_0087 = new JSONObject();
|
||||
// JSONObject formupdate0087 = new JSONObject();
|
||||
// JSONObject field0215 = new JSONObject();
|
||||
// field0215.put("value","1");
|
||||
// field0215.put("showValue","1");
|
||||
// field0215.put("showValue2","1");
|
||||
// formupdate0087.put("field0215",field0215);
|
||||
// formmain_0087.put("update",formupdate0087);
|
||||
// formmain_0087.put("empty",false);
|
||||
// tableData.put("formmain_0087",formmain_0087);
|
||||
// JSONObject formson_0091 = new JSONObject();
|
||||
// JSONArray formadds0091 = new JSONArray();
|
||||
// sublist.size();
|
||||
// for(int i = 0 ; i < sublist.size() ; i ++){
|
||||
// JSONObject recordId = new JSONObject();
|
||||
// recordId.put("recordId", UUIDLong.longUUID());
|
||||
// formadds0091.add(recordId);
|
||||
// }
|
||||
// formson_0091.put("add",formadds0091);
|
||||
// List<String> lxFinancingSubId = getLeaseContractDao().getLXFinancingSubId(contractCode);
|
||||
// String[] deletes0091 =lxFinancingSubId.stream().toArray(String[]::new);
|
||||
// formson_0091.put("delete",deletes0091);
|
||||
// formson_0091.put("empty",false);
|
||||
// tableData.put("formson_0091",formson_0091);
|
||||
// formData.put("tableData",tableData);
|
||||
// JSONObject extend = new JSONObject();
|
||||
// formData.put("extend",extend);
|
||||
// jsonData.put("data",formData);
|
||||
// patchData.put("data",jsonData);
|
||||
// patchData.put("message","");
|
||||
|
||||
// String sss = "{\"code\":0,\"data\":{\"code\":\"2000\",\"data\":{\"tableData\":{\"formson_0091\":{\"update\":{\""+lxFinancingSubId.get(0)+"\":{\"field0193\":{\"showValue\":\"11\",\"showValue2\":\"11\",\"value\":\"11\"}}}}}},\"message\":\"the operation is success!!!\"},\"message\":\"\"}";
|
||||
|
||||
// JSONObject jsonnnn = JSON.parseObject(sss);
|
||||
|
||||
// res.put("data",patchData);
|
||||
// log.info(patchData.toString());
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
package com.seeyon.apps.src_financing.dao;
|
||||
|
||||
|
||||
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 FinancingContractDaoImpl implements IFinancingContractDao {
|
||||
|
||||
// 本地
|
||||
// private String daleteFZFinancing = "delete from formmain_0097 WHERE field0002 = ?";
|
||||
// private String daleteFZFinancingSub = "delete from formson_0098 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0097 WHERE field0002 = ? )";
|
||||
// private String getFZinancingid = "SELECT ID FROM formmain_0097 WHERE field0002 = ?";
|
||||
// private String getLXFinancingSub = "select id from formson_0091 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0087 WHERE field0001 = ? )";
|
||||
// private String updateLXFinancingbyId = "update formmain_0097 set field0009 = ? where id = ?";
|
||||
// private String updateLXFinancingSubbyFormId =
|
||||
// "update formson_0098 set field0004 = ?,field0005= ? ,field0006= ? ,field0007= ? ,field0008= ? where formmain_id = ? and field0001 = ?";
|
||||
// private String addLXFinancingSubbyFormId =
|
||||
// "INSERT INTO formson_0098 (id, formmain_id, sort,field0001,field0004,field0005,field0006,field0007) VALUES (?,?,?,?,?,?,?,?)";
|
||||
// private String deleteLXFinancingSubbyFormId ="delete from formson_0098 where field0001>? and formmain_id = ?";
|
||||
|
||||
// 测试
|
||||
// private String daleteFZFinancing = "delete from formmain_0019 WHERE field0002 = ?";
|
||||
// private String daleteFZFinancingSub = "delete from formson_0020 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0019 WHERE field0002 = ? )";
|
||||
// 正式
|
||||
private String daleteFZFinancing = "delete from formmain_0156 WHERE field0002 = ?";
|
||||
private String daleteFZFinancingSub = "delete from formson_0157 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0760 WHERE field0002 = ? )";
|
||||
private String getFZinancingid = "SELECT ID FROM formmain_0156 WHERE field0002 = ?";
|
||||
private String getLXFinancingSub = "select id from formson_0157 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0725 WHERE field0001 = ? )";
|
||||
private String updateLXFinancingbyId = "update formmain_0156 set field0009 = ? where id = ?";
|
||||
private String updateLXFinancingSubbyFormId = "update formson_0157 set field0004 = ?,field0005= ? ,field0006= ? ,field0007= ? ,field0008= ? where formmain_id = ? and field0001 = ?";
|
||||
private String addLXFinancingSubbyFormId = "INSERT INTO formson_0157 (id, formmain_id, sort,field0001,field0004,field0005,field0006,field0007) VALUES (?,?,?,?,?,?,?,?)";
|
||||
private String deleteLXFinancingSubbyFormId = "delete from formson_0157 where field0001>? and formmain_id = ?";
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int daleteFZFinancing(String contractCode) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(daleteFZFinancing);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(contractCode);
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateLXFinancingbyId(String contractCodenum,String id) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(updateLXFinancingbyId);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(contractCodenum);
|
||||
p.add(id);
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateLXFinancingSubbyFormId(Map<String,String> map) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(updateLXFinancingSubbyFormId);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(map.get("field0004"));
|
||||
p.add(map.get("field0005"));
|
||||
p.add(map.get("field0006"));
|
||||
p.add(map.get("field0007"));
|
||||
p.add(map.get("field0008"));
|
||||
p.add(map.get("formmainId"));
|
||||
p.add(map.get("field0001"));
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addLXFinancingSubbyFormId(Map<String,String> map) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(addLXFinancingSubbyFormId);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(map.get("id"));
|
||||
p.add(map.get("formmainId"));
|
||||
p.add(map.get("field0001"));
|
||||
p.add(map.get("field0001"));
|
||||
p.add(map.get("field0004"));
|
||||
p.add(map.get("field0005"));
|
||||
p.add(map.get("field0006"));
|
||||
p.add(map.get("field0007"));
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteLXFinancingSubbyFormId(String num, String formmainId) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(deleteLXFinancingSubbyFormId);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(num);
|
||||
p.add(formmainId);
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int daleteFZFinancingSub(String contractCode) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(daleteFZFinancingSub);
|
||||
// StringBuilder sql = new StringBuilder("delete from formmain_0536 where id=?");
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(contractCode);
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLXFinancingSubId(String contractCode) throws BusinessException, SQLException {
|
||||
List<String> lists = new ArrayList<String>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getLXFinancingSub);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(contractCode);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> 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 List<String> getFZinancingid(String contractCode) throws BusinessException, SQLException {
|
||||
List<String> lists = new ArrayList<String>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getFZinancingid);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(contractCode);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.seeyon.apps.src_financing.dao;
|
||||
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IFinancingContractDao {
|
||||
|
||||
/**
|
||||
* 删除主表辅助租金计算表数据
|
||||
* @param contractCode
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public int daleteFZFinancing(String contractCode) throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 删除明细表表辅助租金计算表数据
|
||||
* @param contractCode
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public int daleteFZFinancingSub(String contractCode) throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 修改主表触发文本信息计算表数据
|
||||
* @param id
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public int updateLXFinancingbyId(String contractCodenum, String id) throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 修改从表信息计算表数据
|
||||
* @param map
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public int updateLXFinancingSubbyFormId(Map<String, String> map) throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 新增从表信息计算表数据
|
||||
* @param map
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public int addLXFinancingSubbyFormId(Map<String, String> map) throws BusinessException, SQLException;
|
||||
/**
|
||||
* 新增从表信息计算表数据
|
||||
* @param num
|
||||
* @param formmain_id
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public int deleteLXFinancingSubbyFormId(String num, String formmain_id) throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 查询融资合同档案中利息明细信息
|
||||
* @param contractCode
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public List<String> getLXFinancingSubId(String contractCode) throws BusinessException, SQLException;
|
||||
|
||||
/**
|
||||
* 查询融资合同档案ID
|
||||
* @param contractCode
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public List<String> getFZinancingid(String contractCode) throws BusinessException, SQLException;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.seeyon.apps.src_financing.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;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 自定义控件:调用接口
|
||||
* </pre>
|
||||
*/
|
||||
public class InterestMeasurementFieldCtrl extends FormFieldCustomCtrl {
|
||||
|
||||
/**
|
||||
* UUIDLong.longUUID()
|
||||
* UUIDUtil.getUUIDString()
|
||||
*/
|
||||
public String getKey() {
|
||||
return "6664988151731237757";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(UUIDUtil.getUUIDLong());
|
||||
}
|
||||
|
||||
public String getFieldLength() {
|
||||
return "20";
|
||||
}
|
||||
|
||||
/**
|
||||
* 控件初始化接口,此接口在控件初始化的时候,会调用,主要用于定义控件所属插件id、在表单编辑器中的图标、表单编辑器中有哪些属性可以设置。
|
||||
* 使用举例:在接口中定义自定义控件在在表单编辑器中有哪些控件属性需要配置
|
||||
*/
|
||||
public void init() {
|
||||
setPluginId("interestMeasurement");
|
||||
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/interestMeasurementResources/',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<String[]> getListShowDefaultVal(Integer externalType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始值生成接口
|
||||
*/
|
||||
public String[] getDefaultVal(String defaultValue) {
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
public boolean canInjectionWord() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.seeyon.apps.src_financing.util;
|
||||
|
||||
import com.seeyon.v3x.services.form.bean.FormExport;
|
||||
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<ValueExport> setFormValue(Map<String, Object> map){
|
||||
// 创建返回值对象
|
||||
List<ValueExport> valueExports = new ArrayList<ValueExport>();
|
||||
ValueExport valueExport ;
|
||||
// 获取参数信息(显示名称)
|
||||
Set<String> keys = map.keySet();
|
||||
if(keys.size()>0) {
|
||||
// 对控件赋值
|
||||
for (String key : keys) {
|
||||
valueExport = new ValueExport();
|
||||
valueExport.setDisplayName(key);
|
||||
valueExport.setValue(map.get(key).toString());
|
||||
valueExports.add(valueExport);
|
||||
}
|
||||
}
|
||||
return valueExports;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置从表信息
|
||||
* @param lists 设置主表字段。List<Map<显示名称,数据值>>
|
||||
*/
|
||||
public List<SubordinateFormExport> setSubordinateFormValue(List<Map<String, Object>> lists){
|
||||
List<SubordinateFormExport> subordinateFormExports = new ArrayList<SubordinateFormExport>();
|
||||
SubordinateFormExport subordinateFormExport = new SubordinateFormExport();
|
||||
List<RecordExport> recordExports = new ArrayList<RecordExport>();
|
||||
List<ValueExport> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改从表信息
|
||||
* @param lists 设置主表字段。List<Map<显示名称,数据值>>
|
||||
*/
|
||||
public FormExport updateSubordinateFormValue(FormExport formExport,List<Map<String, Object>> lists){
|
||||
// 获取明细表对象列表
|
||||
List<SubordinateFormExport> subordinateFormExports = formExport.getSubordinateForms();
|
||||
// 获取第一个明细表对象
|
||||
SubordinateFormExport subordinateFormExport =subordinateFormExports.get(0);
|
||||
// 获取明细行对象
|
||||
List<RecordExport> recordExports = subordinateFormExport.getValues();
|
||||
// 判断明细行与当前明细行是否匹配
|
||||
int differ = recordExports.size()-lists.size();
|
||||
if(differ==0){
|
||||
for(int i = 0 ; i < recordExports.size() ;i++){
|
||||
RecordExport recordExport = recordExports.get(i);
|
||||
List<ValueExport> records = recordExport.getRecord();
|
||||
Map<String, Object> map = lists.get(i);
|
||||
for(int n = 0 ; n < records.size();n++){
|
||||
ValueExport record = records.get(n);
|
||||
if(map.containsKey(record.getDisplayName())){
|
||||
record.setValue(map.get(record.getDisplayName()).toString());
|
||||
records.set(n,record);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if (differ<0){
|
||||
for(int i = 0 ; i < recordExports.size() ;i++){
|
||||
RecordExport recordExport = recordExports.get(i);
|
||||
List<ValueExport> records = recordExport.getRecord();
|
||||
Map<String, Object> map = lists.get(i);
|
||||
// for(ValueExport record : records){
|
||||
for(int n = 0 ; n < records.size(); n++){
|
||||
ValueExport record = records.get(n);
|
||||
if(map.containsKey(record.getDisplayName())){
|
||||
record.setValue(map.get(record.getDisplayName()).toString());
|
||||
records.set(n,record);
|
||||
}
|
||||
}
|
||||
recordExport.setRecord(records);
|
||||
recordExports.set(i,recordExport);
|
||||
}
|
||||
}else if (differ>0){
|
||||
for(int i = 0 ; i < recordExports.size() ;i++){
|
||||
RecordExport recordExport = recordExports.get(i);
|
||||
List<ValueExport> records = recordExport.getRecord();
|
||||
if(i<lists.size()){
|
||||
Map<String, Object> map = lists.get(i);
|
||||
// for(ValueExport record : records){
|
||||
for(int n = 0 ;n< records.size() ; n++){
|
||||
ValueExport record = records.get(n);
|
||||
if(map.containsKey(record.getDisplayName())){
|
||||
record.setValue(map.get(record.getDisplayName()).toString());
|
||||
records.set(n,record);
|
||||
}
|
||||
}
|
||||
recordExport.setRecord(records);
|
||||
recordExports.set(i,recordExport);
|
||||
}else{
|
||||
recordExports.remove(i);
|
||||
}
|
||||
}
|
||||
List<ValueExport> valueExports ;
|
||||
for(int i = 0 ; i<differ ; i++){
|
||||
RecordExport recordExport = new RecordExport();
|
||||
valueExports = setFormValue(lists.get(i));
|
||||
recordExport.setRecord(valueExports);
|
||||
recordExports.add(recordExport);
|
||||
}
|
||||
}
|
||||
subordinateFormExport.setValues(recordExports);
|
||||
subordinateFormExports.set(0,subordinateFormExport);
|
||||
formExport.setSubordinateForms(subordinateFormExports);
|
||||
// List<SubordinateFormExport> subordinateFormExports = new ArrayList<SubordinateFormExport>();
|
||||
// SubordinateFormExport subordinateFormExport = new SubordinateFormExport();
|
||||
// List<RecordExport> recordExports = new ArrayList<RecordExport>();
|
||||
// List<ValueExport> 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;
|
||||
return formExport;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改主表信息
|
||||
* @param map 设置主表字段。Map<主表显示名称,主表数据>
|
||||
* @return
|
||||
*/
|
||||
public FormExport updateFormValue(FormExport formExport, Map<String, Object> map){
|
||||
List<ValueExport> valueExports = formExport.getValues();
|
||||
for(int i = 0 ; i < valueExports.size();i++){
|
||||
ValueExport valueExport = valueExports.get(i);
|
||||
if(map.containsKey(valueExport.getDisplayName()) ){
|
||||
valueExport.setValue(map.get(valueExport.getDisplayName()).toString());
|
||||
valueExports.set(i,valueExport);
|
||||
}
|
||||
}
|
||||
formExport.setValues(valueExports);
|
||||
//// 创建返回值对象
|
||||
//// List<ValueExport> valueExports = new ArrayList<ValueExport>();
|
||||
// ValueExport valueExport ;
|
||||
//// 获取参数信息(显示名称)
|
||||
// Set<String> keys = map.keySet();
|
||||
// if(keys.size()>0) {
|
||||
//// 对控件赋值
|
||||
// for (String key : keys) {
|
||||
// valueExport = new ValueExport();
|
||||
// valueExport.setDisplayName(key);
|
||||
// valueExport.setValue(map.get(key).toString());
|
||||
// valueExports.add(valueExport);
|
||||
// }
|
||||
// }
|
||||
return formExport;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,539 @@
|
||||
package com.seeyon.apps.src_financing.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.util.*;
|
||||
|
||||
public class InterestCalculationUtil {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
|
||||
/**
|
||||
* 还款周期
|
||||
* @return
|
||||
* @throws
|
||||
*/
|
||||
public List<Date> cycleDates(Calendar startDate,Calendar endDate,int cycleNum,Calendar maxDate) throws ParseException {
|
||||
List<Date> cycleDates = new ArrayList<>();
|
||||
for(Calendar start = startDate;
|
||||
start.getTime().getTime()<maxDate.getTime().getTime();
|
||||
start.add(Calendar.MONTH, cycleNum)){
|
||||
cycleDates.add(start.getTime());
|
||||
System.out.println(sdf.format(start.getTime()));
|
||||
}
|
||||
System.out.println(sdf.format(maxDate.getTime()));
|
||||
cycleDates.add(maxDate.getTime());
|
||||
return cycleDates;
|
||||
}
|
||||
|
||||
/**
|
||||
* 政府专项利息测算
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public List<Map<String ,Object>> getGovernmentMeasurement(double credit,Date lxstartDate,Date lxendDate,List<String> interestRateList,List<Date> cycleDates ,String contractCode) throws ParseException {
|
||||
// 设置返回值参数
|
||||
List<Map<String,Object>> ret = new ArrayList<>();
|
||||
// 利率获取
|
||||
String[] interestRates = interestRateList.get(0).split("~");
|
||||
String interestRatestr = interestRates[1].substring(0,interestRates[1].length()-1);
|
||||
double interestRate = stringToNum(interestRatestr);
|
||||
for(int i = 0 ; i <cycleDates.size() ; i++){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
// 设置开始结束时间
|
||||
if(i>0){
|
||||
lxstartDate = cycleDates.get(i-1);
|
||||
lxendDate = cycleDates.get(i);
|
||||
}else{
|
||||
|
||||
}
|
||||
// 计算利息
|
||||
// double countInterest = countInterestGovernment(lxstartDate,lxendDate,moneyList,interestRateList,principalList);
|
||||
double days = (lxendDate.getTime()-lxstartDate.getTime())/1000/60/60/24;
|
||||
double countInterest = credit*days*interestRate/100/360;
|
||||
map.put("计划还款金额",countInterest+"");
|
||||
// 利息还款编号
|
||||
int n = i+1;
|
||||
String num= contractCode+n;
|
||||
map.put("计划利息还款明细编号",num+"");
|
||||
// 还款类型枚举固定为利息
|
||||
String type = "-4351865301164799504";
|
||||
map.put("还款费项类型",type);
|
||||
// 计划还款日期
|
||||
String dateStr = sdf.format(cycleDates.get(i));
|
||||
map.put("计划还款日期",dateStr);
|
||||
map.put("备注","");
|
||||
ret.add(map);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 农发行利息测算
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public List<Map<String ,Object>> getNFHMeasurement(
|
||||
Date lxstartDate,Date lxendDate,List<String> moneyList,List<String> interestRateList, List<String> principalList,List<Date> cycleDates,String contractCode) throws ParseException {
|
||||
// 设置返回值参数
|
||||
List<Map<String,Object>> ret = new ArrayList<>();
|
||||
|
||||
for(int i = 0 ; i <cycleDates.size() ; i++){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
// 设置开始结束时间
|
||||
if(i>0){
|
||||
lxstartDate = cycleDates.get(i-1);
|
||||
lxendDate = cycleDates.get(i);
|
||||
}
|
||||
// 返回值设置:计划利息还款明细编号,还款费项类型(枚举),计划还款日期,计划还款金额,备注
|
||||
// 计算利息
|
||||
double countInterest = countInterestNFH(lxstartDate,lxendDate,moneyList,interestRateList,principalList);
|
||||
map.put("计划还款金额",countInterest+"");
|
||||
// 利息还款编号
|
||||
int n = i+1;
|
||||
String num= contractCode+n;
|
||||
map.put("计划利息还款明细编号",num+"");
|
||||
// 还款类型枚举
|
||||
String type = "-4351865301164799504";
|
||||
map.put("还款费项类型",type);
|
||||
// 计划还款日期
|
||||
String dateStr = sdf.format(cycleDates.get(i));
|
||||
map.put("计划还款日期",dateStr);
|
||||
map.put("备注","");
|
||||
ret.add(map);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 银行贷款利息测算
|
||||
* @param lxstartDate 利息计算初次开始时间
|
||||
* @param lxendDate 利息计算初次结束时间
|
||||
* @param moneyList 提款信息明细
|
||||
* @param interestRateList 利率信息明细
|
||||
* @param principalList 还款信息明细
|
||||
* @param cycleDates 利息测算时间明细
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public List<Map<String ,Object>> getBankMeasurement(
|
||||
Date lxstartDate,Date lxendDate,List<String> moneyList,List<String> interestRateList, List<String> principalList,List<Date> cycleDates,String contractCode) throws ParseException {
|
||||
List<Map<String ,Object>> ret = new ArrayList<>();
|
||||
for(int i = 0 ; i <cycleDates.size() ; i++){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
// 设置开始结束时间
|
||||
if(i>0){
|
||||
lxstartDate = cycleDates.get(i-1);
|
||||
lxendDate = cycleDates.get(i);
|
||||
}
|
||||
// 返回值设置:计划利息还款明细编号,还款费项类型(枚举),计划还款日期,计划还款金额,备注
|
||||
// 计算利息
|
||||
double countInterest = countInterest(lxstartDate,lxendDate,moneyList,interestRateList,principalList);
|
||||
map.put("计划还款金额",countInterest+"");
|
||||
// 利息还款编号
|
||||
int n= i+1;
|
||||
String num = contractCode+n;
|
||||
map.put("计划利息还款明细编号",num+"");
|
||||
// 还款类型枚举
|
||||
String type = "-4351865301164799504";
|
||||
map.put("还款费项类型",type);
|
||||
// 计划还款日期
|
||||
String dateStr = sdf.format(cycleDates.get(i));
|
||||
map.put("计划还款日期",dateStr);
|
||||
map.put("备注","");
|
||||
ret.add(map);
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文本拆分列表
|
||||
* 还本金字段格式:还款费项类型~计划还款时间~计划还款金额~农发行还款规则
|
||||
* 提款字段格式:提款日期~提款金额
|
||||
* 利率还款字段格式:生效日期~利率
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public String[] stringSplit(String str){
|
||||
String[] strs = str.split(";");
|
||||
return strs;
|
||||
}
|
||||
|
||||
public List<Map<String,Object>> detailedHandle(JSONObject jsonObject,String interestType) throws ParseException {
|
||||
|
||||
// 根据开始时间和合同年限进行时间拆分
|
||||
String startDate = jsonObject.getString("startDate");
|
||||
Date date = sdf.parse(startDate);
|
||||
// 开始日期
|
||||
Calendar start = Calendar.getInstance();
|
||||
start.setTime(date);
|
||||
// 结束日期
|
||||
Calendar end = Calendar.getInstance();
|
||||
end.setTime(date);
|
||||
String period = jsonObject.getString("period");
|
||||
period = period.substring(0,period.length()-1);
|
||||
int periodNum = NumberUtil.convertChineseNumberToArabic(period);
|
||||
//
|
||||
// int periodNum = Integer.parseInt(period)+1;
|
||||
end.add(Calendar.YEAR, periodNum);
|
||||
end.add(Calendar.DATE, 1);
|
||||
// 根据开始结束时间和周期计算时间列表
|
||||
String cycle = jsonObject.getString("cycle");
|
||||
int cycleNum = getCycleNum(cycle);
|
||||
String principal = jsonObject.getString("principal");
|
||||
Calendar maxDate = getPrincipalMaxDate(principal);
|
||||
List<Date> cycleDates = cycleDates(start,end,cycleNum,maxDate);
|
||||
// 获取初次提款时间
|
||||
String money = jsonObject.getString("money");
|
||||
String[] moneys = money.split(";");
|
||||
// 转list
|
||||
List<String> moneyList = Arrays.asList(moneys);
|
||||
// list排序
|
||||
Collections.sort(moneyList);
|
||||
String[] moenyValue = moneyList.get(0).split("~");
|
||||
String moneyDateStr = moenyValue[0];
|
||||
// 计算开始时间
|
||||
Date lxstartDate = sdf.parse(moneyDateStr);
|
||||
// 结算结束时间
|
||||
Date lxendDate = cycleDates.get(0);
|
||||
|
||||
// 获取利率初次设置时间
|
||||
String interestRate = jsonObject.getString("interestRate");
|
||||
String[] interestRates = interestRate.split(";");
|
||||
// 转list
|
||||
List<String> interestRateList = Arrays.asList(interestRates);
|
||||
// list排序
|
||||
Collections.sort(interestRateList);
|
||||
|
||||
// 还本金计划列表
|
||||
String[] principals = principal.split(";");
|
||||
// 转list
|
||||
List<String> principalList = Arrays.asList(principals);
|
||||
// list排序
|
||||
Collections.sort(principalList);
|
||||
|
||||
String contractDatestr = jsonObject.getString("contractDate");
|
||||
Date contractDate = sdf.parse(contractDatestr);
|
||||
String creditstr = jsonObject.getString("credit");
|
||||
double credit = stringToNum(creditstr);
|
||||
|
||||
List<Map<String,Object>> ret = new ArrayList<>();
|
||||
String contractCode = jsonObject.getString("contractCode");
|
||||
// 判断利息测算方式
|
||||
if("政府专项利息测算".equals(interestType)){
|
||||
ret = getGovernmentMeasurement(credit,contractDate,lxendDate,interestRateList,cycleDates,contractCode);
|
||||
}else if("农发行利息测算".equals(interestType)){
|
||||
ret = getNFHMeasurement(lxstartDate,lxendDate,moneyList,interestRateList,principalList,cycleDates,contractCode);
|
||||
}else if("银行贷款利息测算".equals(interestType)){
|
||||
ret = getBankMeasurement(lxstartDate,lxendDate,moneyList,interestRateList,principalList,cycleDates,contractCode);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 银行贷款利息测算
|
||||
* @param startDate 开始时间
|
||||
* @param endDate 结束时间
|
||||
* @param moneyList 提款明细
|
||||
* @param interestRateList 利率明细
|
||||
* @param principalList 还本金明细
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public double countInterest(Date startDate,Date endDate,List<String> moneyList,List<String> interestRateList , List<String> principalList) throws ParseException {
|
||||
|
||||
// 设置开始时间的还款金额
|
||||
double startNum = 0;
|
||||
// 开始时间之前所有提款
|
||||
for(int i = 0 ; i < moneyList.size() ; i++){
|
||||
String[] moneyValues = moneyList.get(i).split("~");
|
||||
Date moneyDate = sdf.parse(moneyValues[0]);
|
||||
double num = stringToNum(moneyValues[1]);
|
||||
if(moneyDate.getTime()<startDate.getTime()){
|
||||
startNum+=num;
|
||||
}
|
||||
}
|
||||
// 开始时间之前所有还款
|
||||
for(int i = 0 ; i < principalList.size() ; i++){
|
||||
String[] principalValues = principalList.get(i).split("~");
|
||||
Date principalDate = sdf.parse(principalValues[1]);
|
||||
double num = stringToNum(principalValues[2]);
|
||||
if(principalDate.getTime()<startDate.getTime()){
|
||||
startNum-=num;
|
||||
}
|
||||
}
|
||||
|
||||
// 设置开始利率
|
||||
double startll = 0;
|
||||
for(int i = 0 ; i < interestRateList.size() ; i++){
|
||||
String[] interestValues = interestRateList.get(i).split("~");
|
||||
Date interestDate = sdf.parse(interestValues[0]);
|
||||
double interestValue = stringToNum(interestValues[1].substring(0,interestValues[1].length()-1));
|
||||
if(interestDate.getTime()<startDate.getTime()){
|
||||
startll = interestValue;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> strList = new ArrayList();
|
||||
strList.add(sdf.format(startDate));
|
||||
// 添加开始结束日期内的提款信息
|
||||
for(int i = 0 ; i < moneyList.size() ; i++){
|
||||
String[] moneyValues = moneyList.get(i).split("~");
|
||||
Date moneyDate = sdf.parse(moneyValues[0]);
|
||||
if(moneyDate.getTime()<endDate.getTime() && moneyDate.getTime()>=startDate.getTime()){
|
||||
strList.add(moneyList.get(i));
|
||||
}
|
||||
}
|
||||
// 添加开始结束日期内的利率变化信息
|
||||
for(int i = 0 ; i < interestRateList.size() ; i++){
|
||||
String[] interestValues = interestRateList.get(i).split("~");
|
||||
Date interestDate = sdf.parse(interestValues[0]);
|
||||
if(interestDate.getTime()<endDate.getTime() && interestDate.getTime()>=startDate.getTime()){
|
||||
strList.add(interestRateList.get(i));
|
||||
}
|
||||
}
|
||||
// 添加开始结束日期内的计划还本金信息信息
|
||||
for(int i = 0 ; i < principalList.size() ; i++){
|
||||
String[] principalValues = principalList.get(i).split("~");
|
||||
if("本金".equals(principalValues[0])){
|
||||
Date principalDate = sdf.parse(principalValues[1]);
|
||||
if(principalDate.getTime()<endDate.getTime() && principalDate.getTime()>=startDate.getTime()){
|
||||
strList.add(principalList.get(i).substring(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
strList.add(sdf.format(endDate));
|
||||
Collections.sort(strList);
|
||||
// 开始金额--》startNum ; 开始利率--》startll;开始时间--》startDate
|
||||
// 第一个开始时间,最后一个结束时间,中间只存在时间+数字的是提款金额,时间+数字+0的是计划本金还款,时间+数字%的是变化利率
|
||||
// System.out.println("开始时间之前金额"+startNum+"开始时间之前利率"+startll+"开始时间"+sdf.format(startDate));
|
||||
double lxnum = 0;
|
||||
for(int i = 1 ; i <strList.size(); i++ ){
|
||||
String[] strs = strList.get(i).split("~");
|
||||
|
||||
switch (strs.length){
|
||||
case 1 :
|
||||
// 计算出两个时间差
|
||||
Date end1 = sdf.parse(strs[0]);
|
||||
long days1 = ((end1.getTime()-startDate.getTime())/1000/60/60/24);
|
||||
System.out.println("1历史利息"+lxnum+"开始金额"+startNum+"本次计算天数"+days1+"利率"+startll+"本次利息"+startNum*days1*startll/100/360);
|
||||
lxnum =lxnum+(startNum*days1*startll/100/360);
|
||||
startDate = end1;
|
||||
break;
|
||||
case 2 :
|
||||
boolean endsWithSuffix = strs[1].endsWith("%");
|
||||
Date end2 = sdf.parse(strs[0]);
|
||||
long days2 = (end2.getTime()-startDate.getTime())/1000/60/60/24;
|
||||
System.out.println("2历史利息"+lxnum+"开始金额"+startNum+"本次计算天数"+days2+"利率"+startll+"本次利息"+startNum*days2*startll/100/360);
|
||||
lxnum =lxnum+(startNum*days2*startll/100/360);
|
||||
if (endsWithSuffix){
|
||||
String llstr = strs[1].substring(0,strs[1].length()-1);
|
||||
double llnum = stringToNum(llstr);
|
||||
startll = llnum;
|
||||
} else{
|
||||
double num = stringToNum(strs[1]);
|
||||
startNum += num;
|
||||
}
|
||||
startDate = end2;
|
||||
break;
|
||||
case 3 :
|
||||
Date end3 = sdf.parse(strs[0]);
|
||||
long days3 = (end3.getTime()-startDate.getTime())/1000/60/60/24;
|
||||
System.out.println("3历史利息"+lxnum+"开始金额"+startNum+"本次计算天数"+days3+"利率"+startll+"本次利息"+startNum*days3*startll/100/360);
|
||||
lxnum =lxnum+(startNum*days3*startll/100/360);
|
||||
double tknum = stringToNum(strs[1]);
|
||||
startNum -= tknum;
|
||||
startDate = end3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return lxnum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 农发行银行贷款利息测算
|
||||
* @param startDate 开始时间
|
||||
* @param endDate 结束时间
|
||||
* @param moneyList 提款明细
|
||||
* @param interestRateList 利率明细
|
||||
* @param principalList 还本金明细
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public double countInterestNFH(Date startDate,Date endDate,List<String> moneyList,List<String> interestRateList , List<String> principalList) throws ParseException {
|
||||
List<Double> lixis = new ArrayList<>();
|
||||
Date date = startDate;
|
||||
double ret = 0 ;
|
||||
// 根据提款维度进行利息测算
|
||||
for(int i = 0 ; i < moneyList.size() ; i++){
|
||||
startDate = date;
|
||||
// 当前提款编号
|
||||
int num = i+1;
|
||||
// 筛选出当前的提款信息和利率信息
|
||||
// 获取开始时间的提款金额
|
||||
String[] moneys = moneyList.get(i).split("~");
|
||||
Date moneyDate = sdf.parse(moneys[0]);
|
||||
double money = stringToNum(moneys[1]);;
|
||||
if(moneyDate.getTime()>=startDate.getTime() && moneyDate.getTime()<endDate.getTime()) {
|
||||
startDate = moneyDate;
|
||||
}else if(moneyDate.getTime()>endDate.getTime()){
|
||||
continue;
|
||||
}
|
||||
for(int n = 0 ; n < principalList.size(); n++){
|
||||
String[] principals = principalList.get(n).split("~");
|
||||
Date principalDate = sdf.parse(principals[1]) ;
|
||||
if(principalDate.getTime()<startDate.getTime()){
|
||||
Map<String,String> nfhDetailed = getNFHDetailed(principals[3]);
|
||||
Set<String> keys =nfhDetailed.keySet();
|
||||
for(String key:keys){
|
||||
if(key.equals(num+"")){
|
||||
String moneyStr = nfhDetailed.get(key);
|
||||
double principal = stringToNum(moneyStr);
|
||||
money = money-principal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
List<String> strList = new ArrayList();
|
||||
strList.add(sdf.format(startDate));
|
||||
// 添加开始结束日期内的计划还本金信息
|
||||
for(int n = 0 ; n < principalList.size() ; n++){
|
||||
String[] principalValues = principalList.get(n).split("~");
|
||||
if("本金".equals(principalValues[0])){
|
||||
Date principalDate = sdf.parse(principalValues[1]);
|
||||
if(principalDate.getTime()<endDate.getTime() && principalDate.getTime()>=startDate.getTime()){
|
||||
strList.add(principalList.get(n).substring(3));
|
||||
}
|
||||
}
|
||||
}
|
||||
strList.add(sdf.format(endDate));
|
||||
Collections.sort(strList);
|
||||
|
||||
// 设置利率信息
|
||||
String[] interestRates = interestRateList.get(i).split("~");
|
||||
double interestRate = Double.parseDouble(interestRates[1].substring(0,interestRates[1].length()-1));
|
||||
double lixi = 0;
|
||||
// 计算利息
|
||||
for(int n = 1 ; n <strList.size(); n++ ){
|
||||
String[] strs = strList.get(n).split("~");
|
||||
|
||||
switch (strs.length){
|
||||
case 1 :
|
||||
// 计算出两个时间差
|
||||
Date end1 = sdf.parse(strs[0]);
|
||||
long days1 = ((end1.getTime()-startDate.getTime())/1000/60/60/24);
|
||||
lixi =money*days1*interestRate/100/360;
|
||||
startDate = end1;
|
||||
lixis.add(lixi);
|
||||
break;
|
||||
case 3 :
|
||||
Date end3 = sdf.parse(strs[0]);
|
||||
long days3 = (end3.getTime()-startDate.getTime())/1000/60/60/24;
|
||||
lixi =money*days3*interestRate/100/360;
|
||||
lixis.add(lixi);
|
||||
Map<String,String> nfhDetailed = getNFHDetailed(strs[2]);
|
||||
Set<String> keys =nfhDetailed.keySet();
|
||||
for(String key:keys){
|
||||
if(key.equals(num+"")){
|
||||
String moneyStr = nfhDetailed.get(key);
|
||||
double principal = stringToNum(moneyStr);
|
||||
money = money-principal;
|
||||
}
|
||||
}
|
||||
startDate = end3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0 ; i < lixis.size();i ++){
|
||||
ret = ret+ lixis.get(i);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Map<String , String> getNFHDetailed(String detailed){
|
||||
Map<String,String> ret = new HashMap<>();
|
||||
String[] detaileds = detailed.split("_");
|
||||
for(String d : detaileds){
|
||||
String[] ds = d.split(":");
|
||||
ret.put(ds[0],ds[1]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// public double countInterestGovernment (){
|
||||
// double ret = 0 ;
|
||||
// return ret;
|
||||
// }
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
public int getCycleNum (String cycle){
|
||||
int cycleNum = 1;
|
||||
|
||||
if("月".equals(cycle)){
|
||||
cycleNum = 1;
|
||||
}else if("季".equals(cycle)){
|
||||
cycleNum = 3;
|
||||
}else if("半年".equals(cycle)){
|
||||
cycleNum = 6;
|
||||
}else if("年".equals(cycle)){
|
||||
cycleNum = 12;
|
||||
}
|
||||
return cycleNum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取本金还款记录中最大还款时间
|
||||
* @param principal
|
||||
* @return
|
||||
*/
|
||||
public Calendar getPrincipalMaxDate(String principal) throws ParseException {
|
||||
Calendar maxDate = Calendar.getInstance();
|
||||
String[] principals = principal.split(";");
|
||||
Date date = new Date();
|
||||
for(int i = 0 ; i < principals.length ; i++){
|
||||
// 0=类型 , 1=日期 2=金额 3=农发行规则
|
||||
String[] principalss = principals[i].split("~");
|
||||
if(i == 0 ){
|
||||
date = sdf.parse(principalss[1]);
|
||||
}else{
|
||||
Date thisDate = sdf.parse(principalss[1]);
|
||||
if(thisDate.getTime()>date.getTime()){
|
||||
date = thisDate;
|
||||
}
|
||||
}
|
||||
}
|
||||
maxDate.setTime(date);
|
||||
return maxDate;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.seeyon.apps.src_financing.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class NumberUtil {
|
||||
|
||||
private static final Map<Character,Integer> numberMap = new HashMap<Character, Integer>() {{
|
||||
put('一',1);
|
||||
put('二',2);
|
||||
put('三',3);
|
||||
put('四',4);
|
||||
put('五',5);
|
||||
put('六',6);
|
||||
put('七',7);
|
||||
put('八',8);
|
||||
put('九',9);
|
||||
put('十',10);
|
||||
put('百',100);
|
||||
put('千',1000);
|
||||
}};
|
||||
public static int convertChineseNumberToArabic(String chineseNumber){
|
||||
int result = 0 ;
|
||||
int partiaResult = 0 ;
|
||||
for(int i = 0 ; i < chineseNumber.length() ; i++){
|
||||
char c = chineseNumber.charAt(i);
|
||||
int currentNumber = numberMap.get(c);
|
||||
if(currentNumber<10){
|
||||
partiaResult += currentNumber;
|
||||
}else{
|
||||
if(partiaResult == 0 ){
|
||||
partiaResult = 1;
|
||||
}
|
||||
result += partiaResult*currentNumber;
|
||||
partiaResult = 0;
|
||||
}
|
||||
}
|
||||
return result + partiaResult;
|
||||
}
|
||||
|
||||
public static void main(String[] arge){
|
||||
String chinsesNumber = "二十一";
|
||||
int arabicNumber = convertChineseNumberToArabic(chinsesNumber);
|
||||
System.out.println(chinsesNumber + "转换为阿拉伯数字是:"+arabicNumber);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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", "资产管理待办推送");
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<String, Object> 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<String> 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<Map<String,String>> rents = new ArrayList<Map<String,String>>();
|
||||
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.contains("一")){
|
||||
// 采用方式一
|
||||
rents = leaseBillUtil.getLeaseBillYers1(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
||||
}else if(njiaofeifs.contains("二")){
|
||||
// 采用方式二
|
||||
rents = leaseBillUtil.getLeaseBillYers2(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// 根据标准方法生成
|
||||
rents = leaseBillUtil.getLeaseBill(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
||||
}
|
||||
log.info("创建档案");
|
||||
List<SubordinateFormExport> subordinateFormExports = formExportUtil.setSubordinateFormValue(rents);
|
||||
Map<String , String > billMap = new HashMap<String, String>();
|
||||
billMap.put("账单编号", code);
|
||||
List<ValueExport> 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();
|
||||
}
|
||||
}
|
||||
@@ -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<String> leaseBillByCode(String code) throws BusinessException, SQLException;
|
||||
|
||||
// 删除账单底表
|
||||
public int deleteBillById(String id) throws BusinessException, SQLException;
|
||||
|
||||
// 删除账单明细表
|
||||
public int deleteBillsByBillId(String formmainId) throws BusinessException, SQLException;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
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=?";
|
||||
// 正式formmain_0111 field0004
|
||||
private String leaseBillByCode = "SELECT id FROM formmain_0164 WHERE field0004 = ? ";
|
||||
private String deleteBillById = "delete from formmain_0164 where id=?";
|
||||
private String deleteBillsByBillId = "delete from formson_0165 where formmain_id=?";
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> leaseBillByCode(String code) throws BusinessException, SQLException {
|
||||
List<String> lists = new ArrayList<String>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(leaseBillByCode);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(code);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> 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);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
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);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(formmainId);
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 自定义控件:调用接口
|
||||
* </pre>
|
||||
*/
|
||||
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<String[]> getListShowDefaultVal(Integer externalType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始值生成接口
|
||||
*/
|
||||
public String[] getDefaultVal(String defaultValue) {
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
public boolean canInjectionWord() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)){
|
||||
cycleNum = 1;
|
||||
}else if("季".equals(cycle)){
|
||||
cycleNum = 3;
|
||||
}else if("半年".equals(cycle)){
|
||||
cycleNum = 6;
|
||||
}else if("年".equals(cycle)){
|
||||
cycleNum = 12;
|
||||
}else if("一次性".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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<ValueExport> setFormValue(Map<String, String> map){
|
||||
// 创建返回值对象
|
||||
List<ValueExport> valueExports = new ArrayList<ValueExport>();
|
||||
ValueExport valueExport ;
|
||||
// 获取参数信息(显示名称)
|
||||
Set<String> 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<Map<显示名称,数据值>>
|
||||
*/
|
||||
public List<SubordinateFormExport> setSubordinateFormValue(List<Map<String, String>> lists){
|
||||
List<SubordinateFormExport> subordinateFormExports = new ArrayList<SubordinateFormExport>();
|
||||
SubordinateFormExport subordinateFormExport = new SubordinateFormExport();
|
||||
List<RecordExport> recordExports = new ArrayList<RecordExport>();
|
||||
List<ValueExport> 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,301 @@
|
||||
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<Map<String,String>> getLeaseBill(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum,
|
||||
JSONObject jsonObject, String jifeifs){
|
||||
List<Map<String,String>> rents = new ArrayList<>();
|
||||
DateUtil dateUtil = new DateUtil();
|
||||
// 两个日期相差多少月
|
||||
int monthNum = dateUtil.betweenMonthByTwoCalendar(startTime,endTime);
|
||||
if(jfzqNum==99){
|
||||
// 一次性账单生成
|
||||
Map<String,String> 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()));
|
||||
rent.put("开始日期",sdf.format(startTime.getTime()));
|
||||
endTime.add(Calendar.DATE, -1);
|
||||
// rent.put("结束日期",sdf.format(endTime.getTime()));
|
||||
rent.put("结束日期",sdf.format(endTime.getTime()));
|
||||
// rent.put("租费",zf+"");
|
||||
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<String, String> rentMap = new HashMap<String, String>();
|
||||
// 设置租费时间
|
||||
// rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
||||
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) + "");
|
||||
rentMap.put("租费", (zf * jfzqNum) + "");
|
||||
}else if ("固定租金".equals(jifeifs)){
|
||||
// rentMap.put("租费", (zf * 1) + "");
|
||||
rentMap.put("租费", (zf * 1) + "");
|
||||
}
|
||||
// rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
||||
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) + "");
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
}else if ("固定租金".equals(jifeifs)){
|
||||
// rentMap.put("租费", (zf * 1) + "");
|
||||
rentMap.put("租费", (zf * 1) + "");
|
||||
}
|
||||
|
||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
||||
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<Map<String,String>> getLeaseBillYers1(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum,
|
||||
JSONObject jsonObject, String jifeifs){
|
||||
List<Map<String,String>> 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<String, String> rentMap = new HashMap<String, String>();
|
||||
// 设置租费时间
|
||||
// rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
||||
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) + "");
|
||||
rentMap.put("租费", (zf * 1) + "");
|
||||
}else{
|
||||
// rentMap.put("租费", (zf * jfzqNum) + "");
|
||||
rentMap.put("租费", (zf * jfzqNum) + "");
|
||||
}
|
||||
// rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
||||
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) + "");
|
||||
rentMap.put("租费", (zf * 1) + "");
|
||||
}else{
|
||||
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
}
|
||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
||||
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<Map<String,String>> getLeaseBillYers2(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum,
|
||||
JSONObject jsonObject, String jifeifs){
|
||||
List<Map<String,String>> 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<String, String> rentMap = new HashMap<String, String>();
|
||||
// 设置租费时间
|
||||
// rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
||||
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) + "");
|
||||
rentMap.put("租费", (zf * 1) + "");
|
||||
}else{
|
||||
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
}
|
||||
// rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
||||
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) + "");
|
||||
rentMap.put("租费", (zf * 1) + "");
|
||||
}else{
|
||||
// rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
}
|
||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
// rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.seeyon.apps.src_monitoring.constant;
|
||||
|
||||
public enum MonitoringConstant {
|
||||
|
||||
plugin("src_monitoring","插件ID"),
|
||||
loginName("shenxian","辅助表创建人");
|
||||
|
||||
MonitoringConstant(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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.seeyon.apps.src_monitoring.quartz;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.ext.quartz.AbstractQuartzTask;
|
||||
import com.seeyon.apps.src_monitoring.constant.MonitoringConstant;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
|
||||
public class MonitoringQuartz extends AbstractQuartzTask {
|
||||
|
||||
private static Log log = Log.get(MonitoringQuartz.class);
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "监控列表同步定时任务";
|
||||
}
|
||||
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
public String getPluginId() {return MonitoringConstant.getPluginId();}
|
||||
public ConfigVo getMonitoringConfig() {return cstConfigApi.getConfig(getPluginId());}
|
||||
|
||||
@Override
|
||||
public String taskRun(String s) throws Exception {
|
||||
ConfigVo configVo = this.cstConfigApi.getConfig(this.getPluginId());
|
||||
String loginName = configVo.getParamVal(MonitoringConstant.loginName.name());
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_financing</id>
|
||||
<name>融资管理</name>
|
||||
<category>20260303</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,9 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd" default-autowire="byName">
|
||||
<bean name="/interestMeasurementController.do" class="com.seeyon.apps.src_financing.controller.InterestMeasurementController" />
|
||||
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
|
||||
<bean id="financingContractDao" class="com.seeyon.apps.src_financing.dao.FinancingContractDaoImpl" />
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="interestMeasurementFieldCtrl" class="com.seeyon.apps.src_financing.fieldCtrl.InterestMeasurementFieldCtrl" />
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd" default-autowire="byName">
|
||||
<bean id="financingPluginApi" class="com.seeyon.apps.src_financing.FinancingPluginApi" />
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_leasebill</id>
|
||||
<name>租赁账单生成</name>
|
||||
<category>20260302</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,9 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd" default-autowire="byName">
|
||||
<bean name="/leaseBillController.do" class="com.seeyon.apps.src_leasebill.controller.LeaseBillController" />
|
||||
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="leaseBillDao" class="com.seeyon.apps.src_leasebill.dao.impl.LeaseBillDaoImpl" />
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="leaseBillFieldCtrl" class="com.seeyon.apps.src_leasebill.fieldCtrl.LeaseBillFieldCtrl" />
|
||||
</beans>
|
||||
@@ -0,0 +1,8 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd" default-autowire="byName">
|
||||
<bean id="LeaseBillPluginApi" class="com.seeyon.apps.src_leasebill.LeaseBillPluginApi" />
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_monitoring</id>
|
||||
<name>监控列表同步</name>
|
||||
<category>202600408</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="monitoringQuartz" class="com.seeyon.apps.src_monitoring.quartz.MonitoringQuartz" />
|
||||
</beans>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../css/setTemplate.css"/>
|
||||
<script src="/seeyon/m3/apps/v5/commons/jquery/jquery-2.1.4.min.js"></script>
|
||||
<script src="../js/setTemplate.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tab">
|
||||
<span id="tab_queryList" class="select">选择底表</span>
|
||||
</div>
|
||||
|
||||
<div id="queryList">
|
||||
<div class="search-box">
|
||||
<i class="cap-icon-sousuo" onclick="search()"></i>
|
||||
<input type="text" class="search-input" id="search_query">
|
||||
</div>
|
||||
<ul class="list"></ul>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
|
||||
//----------------------------------
|
||||
</script>
|
||||
</html>
|
||||
@@ -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 = "<br><font color='#FF00FF'>打印控件";
|
||||
var strLodopInstall = strFontTag + "未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>";
|
||||
var strLodopUpdate = strFontTag + "需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>";
|
||||
var strLodop64Install = strFontTag + "未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>";
|
||||
var strLodop64Update = strFontTag + "需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>";
|
||||
var strCLodopInstallA = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动,点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>";
|
||||
var strCLodopInstallB = "<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)";
|
||||
var strCLodopUpdate = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>";
|
||||
var strLodop7FontTag = "<br><font color='#FF00FF'>Web打印服务Lodop7";
|
||||
var strLodop7HrefX86 = "点击这里<a href='Lodop7_Linux_X86_64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
|
||||
var strLodop7HrefARM = "点击这里<a href='Lodop7_Linux_ARM64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
|
||||
var strLodop7Install_X86 = strLodop7FontTag + "未安装启动," + strLodop7HrefX86;
|
||||
var strLodop7Install_ARM = strLodop7FontTag + "未安装启动," + strLodop7HrefARM;
|
||||
var strLodop7Update_X86 = strLodop7FontTag + "需升级," + strLodop7HrefX86;
|
||||
var strLodop7Update_ARM = strLodop7FontTag + "需升级," + strLodop7HrefARM;
|
||||
var strInstallOK = ",成功后请刷新本页面或重启浏览器。</font>";
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
(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;
|
||||
// 监听是否数据刷新
|
||||
|
||||
$(".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 = '<section class="customButton_box_content">'+
|
||||
'<div class="customButton_class_box '+ self.privateId + '" title="' + self.messageObj.display.escapeHTML() + '">'+ self.messageObj.display.escapeHTML() +'</div>'+
|
||||
'</section>';
|
||||
document.querySelector('#' + self.privateId).innerHTML = domStructure;
|
||||
var jumpFun = function() {
|
||||
var url2 = window.location.origin;
|
||||
var s = self;
|
||||
const fieldInfo = s.messageObj.formdata.alldata.tableInfo.formmain.fieldInfo;
|
||||
|
||||
var startDateValue='',contractCodeValue='',contractDateValue='',creditValue='',principalValue='',moneyValue=''
|
||||
,interestRateValue='',updateCodeValue='',cycleValue='',loanTypeValue='',periodValue='';
|
||||
|
||||
for (const key in fieldInfo) {
|
||||
const field = fieldInfo[key];
|
||||
if (field.display === "利息初始时间") {
|
||||
var startDate = {fieldId: key};
|
||||
startDateValue = csdk.core.getFieldData(startDate).value;
|
||||
// startDateValue = field.value;
|
||||
} else if (field.display === "合同编号"){
|
||||
var contractCode = {fieldId: key};
|
||||
contractCodeValue = csdk.core.getFieldData(contractCode).value;
|
||||
// contractCodeValue = field.value;
|
||||
}else if(field.display === "签订日期"){
|
||||
var contractDate = {fieldId: key};
|
||||
contractDateValue = csdk.core.getFieldData(contractDate).value;
|
||||
// contractDateValue = field.value;
|
||||
}else if(field.display === "授信金额"){
|
||||
var credit = {fieldId: key};
|
||||
creditValue = csdk.core.getFieldData(credit).value;
|
||||
// creditValue = field.value;
|
||||
}else if(field.display === "计划还本金-列"){
|
||||
var principal = {fieldId: key};
|
||||
principalValue = csdk.core.getFieldData(principal).value;
|
||||
// principalValue = field.value;
|
||||
}else if(field.display === "提款明细-列"){
|
||||
var money = {fieldId: key};
|
||||
moneyValue = csdk.core.getFieldData(money).value;
|
||||
// moneyValue = field.value;
|
||||
}else if(field.display === "利率明细-列"){
|
||||
var interestRate = {fieldId: key};
|
||||
interestRateValue = csdk.core.getFieldData(interestRate).value;
|
||||
// interestRateValue = field.value;
|
||||
}else if(field.display === "触发文本更新"){
|
||||
var updateCode = {fieldId: key};
|
||||
updateCodeValue = csdk.core.getFieldData(updateCode).value;
|
||||
// updateCodeValue = field.value;
|
||||
}else if(field.display === "利息还款周期"){
|
||||
var cycle = {fieldId: key};
|
||||
cycleValue = csdk.core.getFieldData(cycle).showValue;
|
||||
// cycleValue = field.showValue;
|
||||
}else if(field.display === "借款类型"){
|
||||
var loanType = {fieldId: key};
|
||||
loanTypeValue = csdk.core.getFieldData(loanType).showValue;
|
||||
// loanTypeValue = field.showValue;
|
||||
}else if(field.display === "借款期限"){
|
||||
var period = {fieldId: key};
|
||||
periodValue = csdk.core.getFieldData(period).showValue;
|
||||
// periodValue = field.showValue;
|
||||
}
|
||||
}
|
||||
// var startDate = {fieldId: 'field0206'};//利息初始时间
|
||||
// var startDateValue = csdk.core.getFieldData(startDate).value;
|
||||
// var contractCode = {fieldId: 'field0001'};//合同编号
|
||||
// var contractCodeValue = csdk.core.getFieldData(contractCode).value;
|
||||
// var contractDate = {fieldId: 'field0007'};//签订日期
|
||||
// var contractDateValue = csdk.core.getFieldData(contractDate).value;
|
||||
// var credit = {fieldId: 'field0068'};//授信金额
|
||||
// var creditValue = csdk.core.getFieldData(credit).value;
|
||||
// var principal = {fieldId: 'field0212'};//计划还本金-列
|
||||
// var principalValue = csdk.core.getFieldData(principal).value;
|
||||
// var money = {fieldId: 'field0213'};//提款明细-列
|
||||
// var moneyValue = csdk.core.getFieldData(money).value;
|
||||
// var interestRate = {fieldId: 'field0214'};//利率明细-列
|
||||
// var interestRateValue = csdk.core.getFieldData(interestRate).value;
|
||||
// var updateCode = {fieldId: 'field0216'};//触发文本更新
|
||||
// var updateCodeValue = csdk.core.getFieldData(updateCode).value;
|
||||
// var cycle = {fieldId: 'field0207'};//利息还款周期
|
||||
// var cycleValue = csdk.core.getFieldData(cycle).showValue;
|
||||
// var loanType = {fieldId: 'field0014'};//借款类型
|
||||
// var loanTypeValue = csdk.core.getFieldData(loanType).showValue;
|
||||
// var period = {fieldId: 'field0011'};//借款期限
|
||||
// var periodValue = csdk.core.getFieldData(period).showValue;
|
||||
console.log(url2);
|
||||
var str = "";
|
||||
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
async : true,
|
||||
// 记得加随机数,不然如果ajax轮询请求会不执行
|
||||
url : encodeURI('/seeyon/interestMeasurementController.do?datetime=' + Math.random()),
|
||||
data:{"startDate":startDateValue,
|
||||
"cycle":cycleValue,
|
||||
"contractDate":contractDateValue,
|
||||
"credit":creditValue,
|
||||
"principal":principalValue,
|
||||
"money":moneyValue,
|
||||
"interestRate":interestRateValue,
|
||||
"loanType":loanTypeValue,
|
||||
"contractCode":contractCodeValue,
|
||||
"updateCode":updateCodeValue,
|
||||
"period":periodValue},
|
||||
dataType : 'json',
|
||||
contentType : 'application/json; charset=UTF-8',
|
||||
success(res) {
|
||||
var randomNum = Math.floor(Math.random() * 10001);
|
||||
if(res.success){
|
||||
var money = updateCodeValue;
|
||||
if(money!="" ){
|
||||
// self.adaptation.formdata.field0215.formmains.formmain_0725.field0216.value = res.num;
|
||||
var data = {
|
||||
fieldId: 'field0216',
|
||||
fieldData: {
|
||||
value: res.num+'', //数据值,存入数据库中的value值
|
||||
display: res.num+'' //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
}
|
||||
};
|
||||
csdk.core.setFieldData(data);
|
||||
}else{
|
||||
var data = {
|
||||
fieldId: 'field0216',
|
||||
fieldData: {
|
||||
value: res.num+'', //数据值,存入数据库中的value值
|
||||
display: res.num+'' //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
}
|
||||
};
|
||||
csdk.core.setFieldData(data);
|
||||
var data1 = {
|
||||
fieldId: 'field0215',
|
||||
fieldData: {
|
||||
value: randomNum+'', //数据值,存入数据库中的value值
|
||||
display: randomNum+'' //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
}
|
||||
};
|
||||
csdk.core.setFieldData(data1);
|
||||
}
|
||||
}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 = '<div class="cap4-text__browse" style="line-height: 1.8; color: rgb(0, 0, 0) !important;">***</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
function test1() {
|
||||
console.log("回调方法");
|
||||
}
|
||||
|
||||
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;
|
||||
});
|
||||
@@ -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 = '<section class="customButton_box_content">'+
|
||||
'<div class="customButton_class_box '+ self.privateId + '" title="' + self.messageObj.display.escapeHTML() + '">'+ self.messageObj.display.escapeHTML() +'</div>'+
|
||||
'</section>';
|
||||
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 = '<div class="cap4-text__browse" style="line-height: 1.8; color: rgb(0, 0, 0) !important;">***</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
});
|
||||
@@ -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(
|
||||
$("<li id='"
|
||||
+ result[i].id
|
||||
+ "'><span class='icon'></span>"
|
||||
+ result[i].name
|
||||
+ "</li>").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(
|
||||
$("<li><span class='icon'></span>"
|
||||
+ unflowList[i].name + "</li>").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
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 101 KiB |
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../css/setTemplate.css"/>
|
||||
<script src="/seeyon/m3/apps/v5/commons/jquery/jquery-2.1.4.min.js"></script>
|
||||
<script src="../js/setTemplate.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tab">
|
||||
<span id="tab_queryList" class="select">选择底表</span>
|
||||
</div>
|
||||
|
||||
<div id="queryList">
|
||||
<div class="search-box">
|
||||
<i class="cap-icon-sousuo" onclick="search()"></i>
|
||||
<input type="text" class="search-input" id="search_query">
|
||||
</div>
|
||||
<ul class="list"></ul>
|
||||
</div>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
|
||||
//----------------------------------
|
||||
</script>
|
||||
</html>
|
||||
@@ -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 = "<br><font color='#FF00FF'>打印控件";
|
||||
var strLodopInstall = strFontTag + "未安装!点击这里<a href='install_lodop32.exe' target='_self'>执行安装</a>";
|
||||
var strLodopUpdate = strFontTag + "需要升级!点击这里<a href='install_lodop32.exe' target='_self'>执行升级</a>";
|
||||
var strLodop64Install = strFontTag + "未安装!点击这里<a href='install_lodop64.exe' target='_self'>执行安装</a>";
|
||||
var strLodop64Update = strFontTag + "需要升级!点击这里<a href='install_lodop64.exe' target='_self'>执行升级</a>";
|
||||
var strCLodopInstallA = "<br><font color='#FF00FF'>Web打印服务CLodop未安装启动,点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>下载执行安装</a>";
|
||||
var strCLodopInstallB = "<br>(若此前已安装过,可<a href='CLodop.protocol:setup' target='_self'>点这里直接再次启动</a>)";
|
||||
var strCLodopUpdate = "<br><font color='#FF00FF'>Web打印服务CLodop需升级!点击这里<a href='CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>";
|
||||
var strLodop7FontTag = "<br><font color='#FF00FF'>Web打印服务Lodop7";
|
||||
var strLodop7HrefX86 = "点击这里<a href='Lodop7_Linux_X86_64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
|
||||
var strLodop7HrefARM = "点击这里<a href='Lodop7_Linux_ARM64.tar.gz' target='_self'>下载安装</a>(下载后解压,点击lodop文件开始执行)";
|
||||
var strLodop7Install_X86 = strLodop7FontTag + "未安装启动," + strLodop7HrefX86;
|
||||
var strLodop7Install_ARM = strLodop7FontTag + "未安装启动," + strLodop7HrefARM;
|
||||
var strLodop7Update_X86 = strLodop7FontTag + "需升级," + strLodop7HrefX86;
|
||||
var strLodop7Update_ARM = strLodop7FontTag + "需升级," + strLodop7HrefARM;
|
||||
var strInstallOK = ",成功后请刷新本页面或重启浏览器。</font>";
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
(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;
|
||||
// 监听是否数据刷新
|
||||
|
||||
$(".field0057__").css("background-color","#008BFF");
|
||||
$(".field0057__").css("color","#FFFFFF");
|
||||
$(".field0057__").css("border-radius","10px");
|
||||
$(".field0057__").mouseover(function (e) {
|
||||
var $this = $(this);// 当前触发事件的标签对象
|
||||
}).mouseout(function (e) {
|
||||
$(".field0057__").css("background-color","#008BFF");
|
||||
}).mousemove(function (e) {
|
||||
$(".field0057__").css("background-color","#005297");
|
||||
});
|
||||
|
||||
},
|
||||
appendChildDom : function () {
|
||||
var self = this;
|
||||
var domStructure = '<section class="customButton_box_content">'+
|
||||
'<div class="customButton_class_box '+ self.privateId + '" title="' + self.messageObj.display.escapeHTML() + '">'+ self.messageObj.display.escapeHTML() +'</div>'+
|
||||
'</section>';
|
||||
document.querySelector('#' + self.privateId).innerHTML = domStructure;
|
||||
var jumpFun = function() {
|
||||
var url2 = window.location.origin;
|
||||
var s = self;
|
||||
const fieldInfo = s.messageObj.formdata.alldata.tableInfo.formmain.fieldInfo;
|
||||
|
||||
var jifeifsValue='',jiaofeifsValue='',njiaofeifsValue='',mjzjValue='',gdzjValue='',startDateValue=''
|
||||
,endDateValue='',mjValue='',bdidValue='',bdidField = '';
|
||||
for (const key in fieldInfo) {
|
||||
const field = fieldInfo[key];
|
||||
if (field.display === "计费方式") {
|
||||
var jifeifsfield = {fieldId: key};
|
||||
jifeifsValue = csdk.core.getFieldData(jifeifsfield).showValue;
|
||||
// jifeifsValue = field.showValue;
|
||||
} else if (field.display === "缴费方式"){
|
||||
var jiaofeifs = {fieldId: key};
|
||||
jiaofeifsValue = csdk.core.getFieldData(jiaofeifs).showValue;
|
||||
// jiaofeifsValue = field.showValue;
|
||||
}else if(field.display === "年缴费方案选项"){
|
||||
var njiaofeifs = {fieldId: key};
|
||||
njiaofeifsValue = csdk.core.getFieldData(njiaofeifs).showValue;
|
||||
// njiaofeifsValue = field.showValue;
|
||||
}else if(field.display === "租赁单价"){
|
||||
var mjzj = {fieldId: key};
|
||||
mjzjValue = csdk.core.getFieldData(mjzj).value;
|
||||
// mjzjValue = field.value;
|
||||
}else if(field.display === "固定租金标准"){
|
||||
var gdzj = {fieldId: key};
|
||||
gdzjValue = csdk.core.getFieldData(gdzj).value;
|
||||
// gdzjValue = field.value;
|
||||
}else if(field.display === "合同开始日期"){
|
||||
var startDate = {fieldId: key};
|
||||
startDateValue = csdk.core.getFieldData(startDate).value;
|
||||
// startDateValue = field.value;
|
||||
}else if(field.display === "合同截止日期"){
|
||||
var endDate = {fieldId: key};
|
||||
endDateValue = csdk.core.getFieldData(endDate).value;
|
||||
// endDateValue = field.value;
|
||||
}else if(field.display === "租赁总面积"){
|
||||
var mj = {fieldId: key};
|
||||
mjValue = csdk.core.getFieldData(mj).value;
|
||||
// mjValue = field.value;
|
||||
}else if(field.display === "账单编号"){
|
||||
var bdid = {fieldId: key};
|
||||
bdidValue = csdk.core.getFieldData(bdid).value;
|
||||
bdidField = key;
|
||||
// bdidValue = field.value;
|
||||
}
|
||||
}
|
||||
// // 计费方式
|
||||
// var jifeifsfield = {fieldId: 'field0027'};
|
||||
// var jifeifs = csdk.core.getFieldData(jifeifsfield).showValue;
|
||||
// // 缴费方式
|
||||
// var jiaofeifsfield = {fieldId: 'field0028'};
|
||||
// var jiaofeifs = csdk.core.getFieldData(jiaofeifsfield).showValue;
|
||||
// // 年缴费方式类型
|
||||
// var njiaofeifsfield = {fieldId: 'field0029'};
|
||||
// var njiaofeifs = csdk.core.getFieldData(njiaofeifsfield).showValue;
|
||||
// // 面积单价
|
||||
// var mjzjfield = {fieldId: 'field0030'};
|
||||
// var mjzj = csdk.core.getFieldData(mjzjfield).value;
|
||||
// // 固定租金单价
|
||||
// var gdzjfield = {fieldId: 'field0031'};
|
||||
// var gdzj = csdk.core.getFieldData(gdzjfield).value;
|
||||
// // 合同开始日期
|
||||
// var startDatefield = {fieldId: 'field0033'};
|
||||
// var startDate = csdk.core.getFieldData(startDatefield).value;
|
||||
// // 合同结束日期
|
||||
// var endDatefield = {fieldId: 'field0034'};
|
||||
// var endDate = csdk.core.getFieldData(endDatefield).value;
|
||||
// // 租赁面积
|
||||
// var mjfield = {fieldId: 'field0041'};
|
||||
// var mj = csdk.core.getFieldData(mjfield).value;
|
||||
// // 账单编号
|
||||
// var bdidfield = {fieldId: 'field0062'};
|
||||
// var bdid = csdk.core.getFieldData(bdidfield).value;
|
||||
|
||||
// 判断合同开始日期是否在合同结束日期之前
|
||||
if(!isEmpty(startDateValue)|| !isEmpty(endDateValue)){
|
||||
if(Date.parse(startDateValue)>Date.parse(endDateValue)){
|
||||
$.alert("请正确填写合同日期");
|
||||
return ;
|
||||
}
|
||||
}else{
|
||||
$.alert("请填写合同日期");
|
||||
return ;
|
||||
}
|
||||
|
||||
// 当缴费方式为年缴费时年缴费类型必填
|
||||
if(jiaofeifsValue=='年'){
|
||||
if(isEmpty(njiaofeifsValue)){
|
||||
$.alert("请选择年缴费方式选项");
|
||||
return ;
|
||||
}
|
||||
}
|
||||
console.log(url2);
|
||||
var str = "";
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
async : true,
|
||||
// 记得加随机数,不然如果ajax轮询请求会不执行
|
||||
url : encodeURI('/seeyon/leaseBillController.do?datetime=' + Math.random()),
|
||||
data:{
|
||||
"jifeifs":jifeifsValue,
|
||||
"jiaofeifs":jiaofeifsValue,
|
||||
"njiaofeifs":njiaofeifsValue,
|
||||
"startDate":startDateValue,
|
||||
"endDate":endDateValue,
|
||||
"mj":mjValue,
|
||||
"mjzj":mjzjValue,
|
||||
"gdzj":gdzjValue,
|
||||
"bdid":bdidValue
|
||||
},
|
||||
dataType : 'json',
|
||||
contentType : 'application/json; charset=UTF-8',
|
||||
success : function(res) {
|
||||
var randomNum = Math.floor(Math.random() * 10001);
|
||||
if(res.success){
|
||||
// $.alert("账单明细生成完成");
|
||||
if(bdidValue=="" ){
|
||||
//账单编号
|
||||
var data = {
|
||||
fieldId: bdidField,
|
||||
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.field0125.formmains.formmain_0213.field0063.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 = '<div class="cap4-text__browse" style="line-height: 1.8; color: rgb(0, 0, 0) !important;">***</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
});
|
||||
@@ -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 = '<section class="customButton_box_content">'+
|
||||
'<div class="customButton_class_box '+ self.privateId + '" title="' + self.messageObj.display.escapeHTML() + '">'+ self.messageObj.display.escapeHTML() +'</div>'+
|
||||
'</section>';
|
||||
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 = '<div class="cap4-text__browse" style="line-height: 1.8; color: rgb(0, 0, 0) !important;">***</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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;
|
||||
});
|
||||
@@ -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(
|
||||
$("<li id='"
|
||||
+ result[i].id
|
||||
+ "'><span class='icon'></span>"
|
||||
+ result[i].name
|
||||
+ "</li>").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(
|
||||
$("<li><span class='icon'></span>"
|
||||
+ unflowList[i].name + "</li>").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
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user