宜都城投OA项目初始化
This commit is contained in:
111
v5/apps-customize/src/main/java/GitDiff.java
Normal file
111
v5/apps-customize/src/main/java/GitDiff.java
Normal file
@@ -0,0 +1,111 @@
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.sql.SQLOutput;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class GitDiff {
|
||||
public static void main(String[] args) throws Exception {
|
||||
packFolder("/Users/mac/Desktop", "A8V5_8.2_橙阳科技U8C集成开发_20240428","d2cd64d3","9630006d");
|
||||
}
|
||||
|
||||
private static File packFolder(String path, String name,String startV,String endV) throws Exception {
|
||||
String destPath = path + File.separator + name;
|
||||
String javaCode = "/src/main/java";
|
||||
String webCode = "/src/main/webapp";
|
||||
String resCode = "src/main/resources";
|
||||
String targetClass = "/target/classes";
|
||||
File file = new File(GitDiff.class.getResource("").getPath());
|
||||
String[] split = file.getPath().split("v5");
|
||||
File rootFile = new File(URLDecoder.decode(split[0], "utf-8"));
|
||||
File[] files = rootFile.listFiles();
|
||||
List<String> filePaths = new ArrayList<>();
|
||||
for (File v5 : files) {
|
||||
if ("cap_code".equals(v5.getName())) {
|
||||
File capCore = new File(v5.getAbsoluteFile() + File.separator + "core" + File.separator + "target" + File.separator + "classes");
|
||||
if (capCore.exists()) {
|
||||
traverseFile(capCore, filePaths);
|
||||
}
|
||||
}
|
||||
if ("v5".equals(v5.getName())) {
|
||||
File[] v5Files = v5.listFiles();
|
||||
for (File v5File : v5Files) {
|
||||
File v5Classes = new File(v5File.getAbsoluteFile() + File.separator + "target" + File.separator + "classes");
|
||||
File v5Webapps = new File(v5File.getAbsoluteFile() + File.separator + "src" + File.separator + "main" + File.separator + "webapp");
|
||||
if (v5Classes.exists()) {
|
||||
traverseFile(v5Classes, filePaths);
|
||||
}
|
||||
if (v5Webapps.exists()) {
|
||||
traverseFile(v5Webapps, filePaths);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("\r\n产品编译后编译后文件列表");
|
||||
filePaths.forEach(System.out::println);
|
||||
|
||||
System.out.println("\r\n异常源码列表");
|
||||
Process process = Runtime.getRuntime().exec("git diff "+startV+" "+endV+" --name-only");
|
||||
//process.waitFor();
|
||||
List<String> gitFiles = IOUtils.readLines(process.getInputStream(), "utf-8").stream().filter(p -> p.contains(javaCode) || p.contains(webCode) || p.contains(resCode)).map(p -> {
|
||||
if (p.contains(javaCode)) {
|
||||
return p.split(javaCode)[1];
|
||||
} else if (p.contains(resCode)) {
|
||||
return p.split(resCode)[1];
|
||||
} else {
|
||||
return p.split(webCode)[1];
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
System.out.println("\r\n有效GIT变动文件列表");
|
||||
gitFiles.forEach(System.out::println);
|
||||
|
||||
//有效的文件列表
|
||||
List<String> paths = filePaths.stream().filter(p -> p.contains(targetClass) || p.contains(webCode)).collect(Collectors.toList());
|
||||
System.out.println("\r\n有效的编译文件列表");
|
||||
paths.forEach(System.out::println);
|
||||
|
||||
System.out.println("\r\n有效的GIT版本文件");
|
||||
for (String filePath : paths) {
|
||||
if (filePath.contains(targetClass)) {
|
||||
String cp = filePath.split(targetClass)[1];
|
||||
for (String gitFile : gitFiles) {
|
||||
if (cp.contains(gitFile.replaceAll(".java", ""))) {
|
||||
File destFile = new File(destPath + "/seeyon/WEB-INF/classes/" + cp);
|
||||
FileUtils.copyFile(new File(filePath), destFile);
|
||||
System.out.println(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (filePath.contains(webCode)) {
|
||||
String wp = filePath.split(webCode)[1];
|
||||
for (String gitFile : gitFiles) {
|
||||
if (wp.contains(gitFile)) {
|
||||
File destFile = new File(destPath + "/seeyon/" + wp);
|
||||
FileUtils.copyFile(new File(filePath), destFile);
|
||||
System.out.println(filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new File(destPath);
|
||||
}
|
||||
|
||||
private static List<String> traverseFile(File file, List<String> resultFileName) {
|
||||
File[] files = file.listFiles();
|
||||
if (files == null) return resultFileName;// 判断目录下是不是空的
|
||||
for (File f : files) {
|
||||
if (f.isDirectory()) {// 判断是否文件夹
|
||||
traverseFile(f, resultFileName);// 调用自身,查找子目录
|
||||
} else
|
||||
resultFileName.add(f.getPath().replaceAll("\\\\", "/"));
|
||||
}
|
||||
return resultFileName;
|
||||
}
|
||||
}
|
||||
@@ -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.ydctu8c.constants.U8cConstants;
|
||||
|
||||
|
||||
public class FinancingPluginApi extends APluginInfoApi {
|
||||
public FinancingPluginApi() {
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
System.out.println(U8cConstants.getPluginId());
|
||||
return U8cConstants.getPluginId();
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return "橙阳科技";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return "融资管理";
|
||||
}
|
||||
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
U8cConstants[] var2 = U8cConstants.values();
|
||||
int var3 = var2.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
U8cConstants value = var2[var4];
|
||||
if (value != U8cConstants.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,29 @@
|
||||
package com.seeyon.apps.src_financing.constants;
|
||||
|
||||
public enum FinancingConstants {
|
||||
|
||||
|
||||
plugin("src_financing","插件ID");
|
||||
// u8cUrl("http://ip:port", "U8C地址"),
|
||||
|
||||
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,247 @@
|
||||
package com.seeyon.apps.src_financing.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.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.ServletOutputStream;
|
||||
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 FormFactory formFactory;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
logger.info("进入ajax方法");
|
||||
// 设置返回值对象
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
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]);
|
||||
}
|
||||
}
|
||||
logger.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);
|
||||
logger.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;
|
||||
}
|
||||
logger.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;
|
||||
}
|
||||
logger.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);
|
||||
}
|
||||
}
|
||||
logger.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);
|
||||
logger.info("生成完成所有利息");
|
||||
Map<String,Object> mainmap = new HashMap<String,Object>();
|
||||
mainmap.put("合同编号", contractCode);
|
||||
mainmap.put("触发文本更新", contractCode+codenum);
|
||||
FormExportUtil formExportUtil = new FormExportUtil();
|
||||
FormExport formExport = new FormExport();
|
||||
List<SubordinateFormExport> subordinateFormExports = formExportUtil.setSubordinateFormValue(sublist);
|
||||
List<ValueExport> valueExports = formExportUtil.setFormValue(mainmap);
|
||||
formExport.setSubordinateForms(subordinateFormExports);
|
||||
formExport.setValues(valueExports);
|
||||
logger.info("创建档案");
|
||||
// getFormFactory().importBusinessFormData("shenxian", "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);
|
||||
|
||||
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,63 @@
|
||||
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;
|
||||
|
||||
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 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_0760 WHERE field0002 = ?";
|
||||
private String daleteFZFinancingSub = "delete from formson_0761 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0760 WHERE field0002 = ? )";
|
||||
|
||||
|
||||
|
||||
|
||||
@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 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -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 com.seeyon.cap4.form.bean.fieldCtrl.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 com.seeyon.cap4.form.bean.fieldCtrl.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,62 @@
|
||||
package com.seeyon.apps.src_financing.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, 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 map 设置主表字段。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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,549 @@
|
||||
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());
|
||||
}
|
||||
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){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(cycleDates.get(i-1));
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加1天
|
||||
lxstartDate = calendar.getTime();
|
||||
lxendDate = cycleDates.get(i);
|
||||
}else{
|
||||
|
||||
}
|
||||
// 计算利息
|
||||
// double countInterest = countInterestGovernment(lxstartDate,lxendDate,moneyList,interestRateList,principalList);
|
||||
double days = ((lxendDate.getTime()-lxstartDate.getTime())/1000/60/60/24)+1;
|
||||
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){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(cycleDates.get(i-1));
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加1天
|
||||
lxstartDate = calendar.getTime();
|
||||
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){
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(cycleDates.get(i-1));
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 1); // 增加1天
|
||||
lxstartDate = calendar.getTime();
|
||||
lxendDate = cycleDates.get(i);
|
||||
}
|
||||
// 返回值设置:计划利息还款明细编号,还款费项类型(枚举),计划还款日期,计划还款金额,备注
|
||||
// 计算利息
|
||||
System.out.println(sdf.format(lxstartDate)+":"+sdf.format(lxendDate));
|
||||
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++ ){
|
||||
System.out.println(strList.get(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)+1;
|
||||
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++ ){
|
||||
System.out.println(strList.get(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)+1;
|
||||
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,111 @@
|
||||
package com.seeyon.apps.ydctu8c;
|
||||
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
import com.seeyon.apps.common.workflow.node.ACommonSuperNode;
|
||||
import com.seeyon.apps.ext.workflow.vo.FieldDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.apps.ydctu8c.constants.U8cConstants;
|
||||
import com.seeyon.apps.ydctu8c.util.Cap4ReturnUtil;
|
||||
import com.seeyon.apps.ydctu8c.util.ParamUtil;
|
||||
import com.seeyon.apps.ydctu8c.util.U8cHttpUtil;
|
||||
import com.seeyon.apps.ydctu8c.vo.U8cResponse;
|
||||
import com.seeyon.cap4.form.api.FormDataApi4Cap4;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
public abstract class U8CCommonNode extends ACommonSuperNode {
|
||||
|
||||
private static Log log = LogFactory.getLog(U8CCommonNode.class);
|
||||
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return U8cConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormParse() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkFlowType[] getTypes() {
|
||||
return new WorkFlowType[] {WorkFlowType.superNode};
|
||||
}
|
||||
|
||||
public ConfigVo getU8cConfig() {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SuperNodeContext proceed(String request, FormDataVo formDataVo, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
SuperNodeContext context = new SuperNodeContext();
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
String param = paramUtil.param(request,getMethod(),formDataVo);
|
||||
Cap4ReturnUtil cap4ReturnUtil = new Cap4ReturnUtil();
|
||||
try {
|
||||
FieldDataVo fhjg = formDataVo.getFieldData("U8C返回结果");
|
||||
String value = fhjg.getStringValue();
|
||||
if(value.startsWith("推送BIP成功")) {
|
||||
return context.success("跳过:" + value);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
ConfigVo configVo = getU8cConfig();
|
||||
context.setNeedSave(true);
|
||||
String url = configVo.getParamVal(U8cConstants.u8cUrl.name());
|
||||
url += getMethod();
|
||||
context.setRequest(param);
|
||||
context.setUrl(url);
|
||||
try {
|
||||
String u8cSystem = configVo.getParamVal(U8cConstants.u8cSystem.name());
|
||||
String u8cUsercode = configVo.getParamVal(U8cConstants.u8cUsercode.name());
|
||||
String u8cPassword = configVo.getParamVal(U8cConstants.u8cPassword.name());
|
||||
String u8cContentType = configVo.getParamVal(U8cConstants.u8cContentType.name());
|
||||
String u8cConnection = configVo.getParamVal(U8cConstants.u8cConnection.name());
|
||||
log.info(param);
|
||||
String response = U8cHttpUtil.doPost(url, param,u8cSystem,u8cUsercode,u8cPassword,u8cConnection,u8cContentType);
|
||||
System.out.println(response);
|
||||
context.setResponse(response);
|
||||
U8cResponse u8cResponse = U8cHttpUtil.parseResponse(response);
|
||||
if(u8cResponse.isSuccess()) {
|
||||
cap4ReturnUtil.setParamReturn(getMethod(),u8cResponse,formDataVo);
|
||||
System.out.println("参数处理完成"+u8cResponse);
|
||||
log.info(u8cResponse.getData());
|
||||
System.out.println("推送成功显示"+u8cResponse.getStatus());
|
||||
context.success("推送U8C成功:" + u8cResponse.getStatus(), false);
|
||||
formDataVo.getNewFieldDataMap().put("U8C返回结果", "推送U8C成功:" + u8cResponse.getStatus());
|
||||
} else {
|
||||
context.setErrMsg(u8cResponse.getMsg());
|
||||
context.setException(true);
|
||||
context.back("推送U8C失败:" + u8cResponse.getMsg());
|
||||
formDataVo.getNewFieldDataMap().put("U8C返回结果", "推送U8C失败:" + u8cResponse.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
context.setException(true);
|
||||
context.back("推送BIP失败:OA处理异常:" + e.getMessage());
|
||||
formDataVo.getNewFieldDataMap().put("BIP返回结果", "推送U8C失败:OA处理异常" + e.getMessage());
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
public abstract String getMethod();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.seeyon.apps.ydctu8c;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.ydctu8c.constants.U8cConstants;
|
||||
|
||||
|
||||
public class U8cPluginApi extends APluginInfoApi {
|
||||
public U8cPluginApi() {
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
System.out.println(U8cConstants.getPluginId());
|
||||
return U8cConstants.getPluginId();
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return "橙阳科技";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return "U8C集成管理";
|
||||
}
|
||||
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
U8cConstants[] var2 = U8cConstants.values();
|
||||
int var3 = var2.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
U8cConstants value = var2[var4];
|
||||
if (value != U8cConstants.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,224 @@
|
||||
package com.seeyon.apps.ydctu8c.aop;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.seeyon.cap4.form.api.FormApi4Cap4;
|
||||
import com.seeyon.cap4.form.bean.FormBean;
|
||||
import com.seeyon.cap4.form.bean.FormFieldBean;
|
||||
import com.seeyon.cap4.form.bean.FormFieldComEnum;
|
||||
import com.seeyon.ctp.common.ctpenumnew.manager.EnumManager;
|
||||
import com.seeyon.ctp.common.po.ctpenumnew.CtpEnumItem;
|
||||
import com.seeyon.ctp.organization.bo.*;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import org.apache.commons.collections.ListUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
* 处理数据
|
||||
* 转换相关参数
|
||||
* 部门编码--> 部门
|
||||
* 单位编码--> 单位
|
||||
* 人员编码--> 人员
|
||||
* 岗位编号--> 岗位
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
@Aspect
|
||||
public class BpmProcessAop {
|
||||
|
||||
@Inject
|
||||
private FormApi4Cap4 formApi4Cap4;
|
||||
@Inject
|
||||
private EnumManager enumManagerNew;
|
||||
@Inject
|
||||
private OrgManager orgManager;
|
||||
|
||||
private static final Log log = LogFactory.getLog(BpmProcessAop.class);
|
||||
|
||||
@Pointcut("execution(public * com.seeyon.apps.collaboration.manager.CollaborationBPMHandlerImpl.transPreStartProcess(..))")
|
||||
private void dealParam() {
|
||||
}
|
||||
|
||||
@Around(value = "dealParam()")
|
||||
public Object dealFormData(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
log.info("处理数据问题!!");
|
||||
Object[] args = joinPoint.getArgs();
|
||||
try {
|
||||
Map<String, Object> params = (Map<String, Object>) args[0];
|
||||
Map<String, Object> data = (Map<String, Object>) params.get("data");
|
||||
// 开始处理表单数据
|
||||
FormBean formBean = formApi4Cap4.getFormByFormCode((String) params.get("templateCode"));;
|
||||
Map<String, Object> masterData = (Map<String, Object>) data.get("masterTable");
|
||||
Map<String, Object> record = (Map<String, Object>) masterData.get("record");
|
||||
List<Map<String, String>> fields = (List<Map<String, String>>) record.get("fields");
|
||||
List<Map<String, String>> fieldsClone = new ArrayList<>();
|
||||
for (Map<String, String> field : fields) {
|
||||
String val = field.get("value");
|
||||
if(StringUtils.isNotBlank(val)) {
|
||||
FormFieldBean fieldBean = formBean.getFieldBeanByName(field.get("name"));
|
||||
if(null != fieldBean) {
|
||||
field.put("value", dealParams(fieldBean, val));
|
||||
}
|
||||
}
|
||||
fieldsClone.add(field);
|
||||
}
|
||||
// 主表字段处理完成
|
||||
record.put("fields", fieldsClone);
|
||||
masterData.put("record", record);
|
||||
data.put("masterTable", masterData);
|
||||
// 处理明细表字段
|
||||
|
||||
List<Map<String, Object>> subTables = (List<Map<String, Object>>) data.get("subTables");
|
||||
if(null != subTables) {
|
||||
log.info("开始处理明细表数据");
|
||||
try {
|
||||
List<Map<String, Object>> subTablesClone = new ArrayList<>();
|
||||
subTables.forEach(row -> {
|
||||
List<Map<String, Object>> subRecords = (List<Map<String, Object>>) row.get("records");
|
||||
List<Map<String, Object>> newSubRecords = new ArrayList<>();
|
||||
subRecords.forEach(subrecord -> {
|
||||
List<Map<String, String>> subFields = (List<Map<String, String>>) subrecord.get("fields");
|
||||
List<Map<String, String>> subFieldsClone = new ArrayList<>();
|
||||
for (Map<String, String> field : subFields) {
|
||||
String val = field.get("value");
|
||||
if(StringUtils.isNotBlank(val)) {
|
||||
FormFieldBean fieldBean = formBean.getFieldBeanByName(field.get("name"));
|
||||
if(null != fieldBean) {
|
||||
field.put("value", dealParams(fieldBean, val));
|
||||
}
|
||||
}
|
||||
subFieldsClone.add(field);
|
||||
}
|
||||
subrecord.put("fields", subFieldsClone);
|
||||
newSubRecords.add(subrecord);
|
||||
row.put("records", newSubRecords);
|
||||
});
|
||||
subTablesClone.add(row);
|
||||
});
|
||||
data.put("subTables", subTablesClone);
|
||||
} catch (Exception e) {
|
||||
log.error("处理失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
params.put("data", data);
|
||||
|
||||
args[0] = params;
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
log.error("处理数据发生异常:", e);
|
||||
}
|
||||
return joinPoint.proceed(args);
|
||||
}
|
||||
|
||||
private String dealParams(FormFieldBean field, String val) {
|
||||
FormFieldComEnum inputTypeEnum = field.getInputTypeEnum();
|
||||
try {
|
||||
switch (inputTypeEnum) {
|
||||
case RADIO:
|
||||
case SELECT:
|
||||
String code = Convert.toStr(val);
|
||||
if (StringUtils.isBlank(code)) {
|
||||
val = null;
|
||||
}
|
||||
CtpEnumItem item = enumManagerNew .getItemByCode(code);
|
||||
if (null == item) {
|
||||
long enumId = field.getEnumId();
|
||||
List<CtpEnumItem> emumItems = enumManagerNew.getEmumItemByEmumId(enumId);
|
||||
if (null != emumItems) {
|
||||
for (CtpEnumItem emumItem : emumItems) {
|
||||
if (emumItem.getShowvalue().equals(code)) {
|
||||
val = emumItem.getId() + "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
log.error("枚举不存在:" + val);
|
||||
val = null;
|
||||
} else {
|
||||
val = item.getId() + "";
|
||||
}
|
||||
break;
|
||||
case EXTEND_MEMBER:
|
||||
//V3xOrgMember member = orgManager.getMemberByLoginName(val);
|
||||
List<V3xOrgEntity> memberList = orgManager.getEntityListNoRelation(V3xOrgMember.class.getSimpleName(),
|
||||
"code", val, null);
|
||||
log.info("人员转换:" + val + ",查询结果:" + (memberList != null && memberList.size() > 0));
|
||||
if(memberList != null&&! ListUtils.EMPTY_LIST.equals(memberList)){
|
||||
for (V3xOrgEntity v3xOrgEntity : memberList) {
|
||||
V3xOrgMember member = (V3xOrgMember) v3xOrgEntity;
|
||||
if(val.equals(member.getCode())){
|
||||
val = member.getId() + "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTEND_ACCOUNT:
|
||||
List<V3xOrgEntity> accList = orgManager.getEntityListNoRelation(V3xOrgAccount.class.getSimpleName(),
|
||||
"code", val, null);
|
||||
log.info("单位值转换:" + val + ",查询结果:" + (accList != null && accList.size() > 0));
|
||||
if(accList != null&&! ListUtils.EMPTY_LIST.equals(accList)){
|
||||
for (V3xOrgEntity acc : accList) {
|
||||
V3xOrgAccount account = (V3xOrgAccount) acc;
|
||||
if(val.equals(account.getCode())){
|
||||
val = account.getId() + "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTEND_DEPARTMENT:
|
||||
List<V3xOrgEntity> deptList = orgManager.getEntityListNoRelation(V3xOrgDepartment.class.getSimpleName(),
|
||||
"code", val, null);
|
||||
log.info("部门值转换:" + val + ",查询结果:" + (deptList != null && deptList.size() > 0));
|
||||
if(deptList != null&&! ListUtils.EMPTY_LIST.equals(deptList)){
|
||||
for (V3xOrgEntity v3xOrgEntity : deptList) {
|
||||
V3xOrgDepartment dept = (V3xOrgDepartment) v3xOrgEntity;
|
||||
if(val.equals(dept.getCode())){
|
||||
val = dept.getId() + "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXTEND_POST:
|
||||
List<V3xOrgEntity> postlist = orgManager.getEntityListNoRelation(V3xOrgPost.class.getSimpleName(),
|
||||
"code", val, null);
|
||||
log.info("岗位转换:" + val + ",查询结果:" + (postlist != null && postlist.size() > 0));
|
||||
if(postlist != null&&! ListUtils.EMPTY_LIST.equals(postlist)){
|
||||
for (V3xOrgEntity v3xOrgEntity : postlist) {
|
||||
V3xOrgPost post = (V3xOrgPost) v3xOrgEntity;
|
||||
if(val.equals(post.getCode())){
|
||||
val = post.getId() + "";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("处理字段异常:" + field.getName()+ "," + field.getDisplay());
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class ChaiLvYdctExpensePaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ChaiLvYdctExpensePaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT差旅费用报销审批推送U8C付款结算单";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class ContractYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/sj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ContractYdctCollectionNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT合同收款审批推送U8C收款结算单";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class TongYongYdctFenZhangNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "TongYongYdctFenZhangNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT通用分账审批推送U8C付款结算单";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class TongYongYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "TongYongYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT通用支付审批推送U8C付款结算单";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class XiangMuYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "XiangMuYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT项目合同支付审批推送U8C付款结算单";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class ZijinYdctTransferNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ZijinYdctTransferNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT内部资金划拨推送U8C付款结算单";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class ZongHeYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ZongHeYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT综合合同支付审批推送U8C付款结算单";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.seeyon.apps.ydctu8c.constants;
|
||||
|
||||
public enum U8cConstants {
|
||||
|
||||
|
||||
plugin("ydctu8c","插件ID"),
|
||||
u8cUrl("http://ip:port", "U8C地址"),
|
||||
u8cSystem("OA01", "u8cSystem"),
|
||||
u8cUsercode("oa01", "u8cUsercode"),
|
||||
u8cPassword("6037acc6da44686e344385233e8208b7", "u8cPassword"),
|
||||
u8cContentType("application/json", "u8cContentType"),
|
||||
u8cConnection("Keep-Alive", "u8cConnection");
|
||||
|
||||
U8cConstants(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,31 @@
|
||||
package com.seeyon.apps.ydctu8c.custmandoc.node;
|
||||
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class AddYdctCustdocNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/uapbd/custdoc/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "AddYdctCustdocNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT新增客商基础档案推送U8C";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.seeyon.apps.ydctu8c.custmandoc.node;
|
||||
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
public class AddYdctCustmandocNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/uapbd/custmandoc/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "AddYdctCustmandocNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT新增客商档案推送U8C";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.seeyon.apps.ydctu8c.custmandoc.node;
|
||||
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class AllYdctocationCustdocNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/uapbd/custdoc/assign";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "AllYdctocationCustdocNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT客商基础档案分配推送U8C";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.seeyon.apps.ydctu8c.custmandoc.node;
|
||||
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class UpdateYdctCustdocNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/uapbd/custdoc/update";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "UpdateYdctCustdocNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT修改客商基础档案推送U8C";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.seeyon.apps.ydctu8c.salesorders.node;
|
||||
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
public class AddYdctSaleorderNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/so/saleorder/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "AddYdctSaleorderNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT新增销售订单推送U8C";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package com.seeyon.apps.ydctu8c.util;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.cap4.form.bean.*;
|
||||
import com.seeyon.cap4.form.service.CAP4FormManager;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//import com.seeyon.apps.jync_file.kit.StrKit;
|
||||
//import org.apache.commons.logging.Log;
|
||||
|
||||
|
||||
/**
|
||||
* Description
|
||||
* <pre></pre>
|
||||
* @author FanGaowei<br>
|
||||
* Date 2018年1月23日 上午11:22:28<br>
|
||||
* Copyright(c) Beijing Seeyon Software Co.,LTD
|
||||
*/
|
||||
public class CAP4FormKit {
|
||||
|
||||
// private static final Log LOGGER = CtpLogFactory.getLog(CAP4FormKit.class);
|
||||
private static Log log = Log.get(CAP4FormKit.class);
|
||||
|
||||
public static FormBean getFormBean(CAP4FormManager cap4FormManager, String code) {
|
||||
FormBean formBean = null;
|
||||
try {
|
||||
formBean = cap4FormManager.getFormByFormCode(code);
|
||||
} catch(BusinessException e) {
|
||||
log.error("获取表单发生异常,编号:" + code, e);
|
||||
}
|
||||
return formBean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据表单的显示名称获取字段的值
|
||||
* @param bean
|
||||
* @param disPlay
|
||||
* @return
|
||||
*/
|
||||
public static Object getFieldValue(FormDataBean bean, String disPlay) {
|
||||
if(bean == null) {
|
||||
return null;
|
||||
}
|
||||
FormTableBean table = bean.getFormTable();
|
||||
if(table == null) {
|
||||
return null;
|
||||
}
|
||||
FormFieldBean field = table.getFieldBeanByDisplay(disPlay);
|
||||
if(field == null) {
|
||||
log.info("字段不存在:" + disPlay);
|
||||
return null;
|
||||
}
|
||||
return bean.getFieldValue(field.getName());
|
||||
}
|
||||
|
||||
|
||||
public static int getIntValue(FormDataBean bean, String disPlay) {
|
||||
Object value = getFieldValue(bean, disPlay);
|
||||
return StrKit.toInteger(value);
|
||||
}
|
||||
|
||||
public static String getFieldStrValue(FormDataBean bean, String disPlay) {
|
||||
Object value = getFieldValue(bean, disPlay);
|
||||
return StrKit.str(value, true);
|
||||
}
|
||||
|
||||
public static Object getFieldValueByName(FormDataBean bean, String fieldName) {
|
||||
return bean.getFieldValue(fieldName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据表单的显示名称获取字段是 field000?
|
||||
* @param bean
|
||||
* @param disPlay
|
||||
* @return
|
||||
*/
|
||||
public static String getFieldTaleId(FormBean bean, String disPlay) {
|
||||
if(bean == null) {
|
||||
return null;
|
||||
}
|
||||
FormTableBean table = bean.getMasterTableBean();
|
||||
return getFieldTaleId(table, disPlay);
|
||||
}
|
||||
|
||||
/**
|
||||
* 直接根据table来获取
|
||||
* @param table
|
||||
* @param disPlay
|
||||
* @return
|
||||
*/
|
||||
public static String getFieldTaleId(FormTableBean table, String disPlay) {
|
||||
if(table == null) {
|
||||
return null;
|
||||
}
|
||||
FormFieldBean field = table.getFieldBeanByDisplay(disPlay);
|
||||
if(field == null) {
|
||||
log.info("字段不存在:" + disPlay);
|
||||
return null;
|
||||
}
|
||||
return field.getName();
|
||||
}
|
||||
|
||||
public static String getFieldTaleId(FormDataBean bean, String disPlay) {
|
||||
if(bean == null) {
|
||||
return null;
|
||||
}
|
||||
FormTableBean table = bean.getFormTable();
|
||||
if(table == null) {
|
||||
return null;
|
||||
}
|
||||
FormFieldBean field = table.getFieldBeanByDisplay(disPlay);
|
||||
if(field == null) {
|
||||
return null;
|
||||
}
|
||||
return field.getName();
|
||||
}
|
||||
|
||||
public static FormFieldBean getFieldBean(FormDataBean bean, String disPlay) {
|
||||
if(bean == null) {
|
||||
return null;
|
||||
}
|
||||
FormTableBean table = bean.getFormTable();
|
||||
if(table == null) {
|
||||
return null;
|
||||
}
|
||||
FormFieldBean field = table.getFieldBeanByDisplay(disPlay);
|
||||
if(null == field) {
|
||||
log.info("字段不存在:" + disPlay);
|
||||
}
|
||||
return field;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* <pre></pre>
|
||||
* @param bean 这里的bean必须是getMasterBean() 方法获取到的bean
|
||||
* @param disPlay
|
||||
* @param value
|
||||
*/
|
||||
public static void setCellValue(FormDataBean bean, String disPlay, Object value) {
|
||||
FormFieldBean cell = CAP4FormKit.getFieldBean(bean, disPlay);
|
||||
if(cell != null) {
|
||||
bean.addFieldValue(cell.getName(), value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setCellValue(FormDataSubBean bean, String disPlay, Object value) {
|
||||
FormFieldBean cell = CAP4FormKit.getFieldBean(bean, disPlay);
|
||||
if(cell != null) {
|
||||
bean.addFieldValue(cell.getName(), value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* <pre>只适用于只有一个子表的表单</pre>
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static List<FormDataSubBean> getSubBeans(FormDataMasterBean master) {
|
||||
Map<String, List<FormDataSubBean>> subs = master.getSubTables();
|
||||
if(null == subs) {
|
||||
return null;
|
||||
}
|
||||
for(String key : subs.keySet()) {
|
||||
return subs.get(key);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<FormDataSubBean> getSubBeans(FormDataMasterBean master, String display) {
|
||||
Map<String, List<FormDataSubBean>> subs = master.getSubTables();
|
||||
if(null == subs) {
|
||||
return null;
|
||||
}
|
||||
for(String key : subs.keySet()) {
|
||||
FormDataSubBean data = subs.get(key).get(0);
|
||||
if(display.equals(data.getFormTable().getDisplay())) {
|
||||
return subs.get(key);
|
||||
}
|
||||
}
|
||||
log.info("表单不存在:" + display);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* <pre>获取从表字段</pre>
|
||||
* @param sub
|
||||
* @param disPlay
|
||||
* @return
|
||||
*/
|
||||
public static Object getSubFieldValue(FormDataSubBean sub, String disPlay) {
|
||||
return getFieldValue(sub, disPlay);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.seeyon.apps.ydctu8c.util;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ydctu8c.vo.U8cResponse;
|
||||
import com.seeyon.cap4.form.api.FormDataApi4Cap4;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.cap4.form.bean.FormDataSubBean;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Cap4ReturnUtil {
|
||||
|
||||
public void setParamReturn(String method, U8cResponse u8cResponse, FormDataVo formDataVo) throws BusinessException {
|
||||
if("/u8cloud/api/uapbd/custdoc/insert".equals(method)){
|
||||
String data = u8cResponse.getData();
|
||||
JSONArray jsonArray = (JSONArray) JSON.parse(data);
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||
JSONObject parentvo = jsonObject.getJSONObject("parentvo");
|
||||
formDataVo.getNewFieldDataMap().put("客商主键", parentvo.getString("pk_cubasdoc"));
|
||||
JSONArray banks = jsonObject.getJSONArray("BANK");
|
||||
// 银行id
|
||||
String bankIds = "";
|
||||
for(int i = 0 ; i < banks.size() ; i++){
|
||||
JSONObject bank = banks.getJSONObject(i);
|
||||
String bankNo = bank.getString("account");
|
||||
String bankId = bank.getString("pk_custbank");
|
||||
bankIds = bankIds+bankNo+":"+bankId+";";
|
||||
}
|
||||
bankIds = bankIds.substring(0,bankIds.length() - 1);
|
||||
formDataVo.getNewFieldDataMap().put("U8C返回客商银行对照", bankIds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
package com.seeyon.apps.ydctu8c.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 日期处理工具类
|
||||
* @Copyright Beijing Seeyon Software Co.,LTD
|
||||
*/
|
||||
public class DateKit {
|
||||
|
||||
private static SimpleDateFormat simple = new SimpleDateFormat("yyyyMMdd");
|
||||
|
||||
private static SimpleDateFormat sixFormat = new SimpleDateFormat("yyMMdd");
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
private static SimpleDateFormat dayFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
private static SimpleDateFormat monthFormat = new SimpleDateFormat("yyyy-MM");
|
||||
|
||||
private static SimpleDateFormat weekDay = new SimpleDateFormat("MM-dd");
|
||||
|
||||
private static SimpleDateFormat hour = new SimpleDateFormat("HH:mm");
|
||||
|
||||
private static SimpleDateFormat detailDate = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
|
||||
private static final String dayNames[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五","星期六" };
|
||||
|
||||
public static int getYear(Date date) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
return cal.get(Calendar.YEAR);
|
||||
}
|
||||
|
||||
public static String getSixDate() {
|
||||
return getSixDate(null);
|
||||
}
|
||||
|
||||
public static String getSixDate(Date date) {
|
||||
if(null == date) {
|
||||
return sixFormat.format(new Date());
|
||||
}
|
||||
return sixFormat.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取这个时间属于一年的第几周
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static int getWeekNum(Date date) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(date);
|
||||
int week = cal.get(Calendar.WEEK_OF_YEAR);
|
||||
// 如果是星期天,那么需要减1
|
||||
if("星期日".equals(DateKit.getDayWeekName(date))) {
|
||||
week -= 1;
|
||||
}
|
||||
return week;
|
||||
}
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* <pre>
|
||||
* 获取一周
|
||||
* </pre>
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static void getWeekInterval(Map<String, Object> param) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
// 判断要计算的日期是否是周日,如果是则减一天计算周六的,否则会出问题,计算到下一周去了
|
||||
int dayWeek = cal.get(Calendar.DAY_OF_WEEK);// 获得当前日期是一个星期的第几天
|
||||
if(1 == dayWeek) {
|
||||
cal.add(Calendar.DAY_OF_MONTH, -1);
|
||||
}
|
||||
// System.out.println("要计算日期为:" + sdf.format(cal.getTime())); // 输出要计算日期
|
||||
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
|
||||
cal.setFirstDayOfWeek(Calendar.MONDAY);
|
||||
// 获得当前日期是一个星期的第几天
|
||||
int day = cal.get(Calendar.DAY_OF_WEEK);
|
||||
// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值
|
||||
cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day);
|
||||
param.put("startDate", cal.getTime());
|
||||
// System.out.println("所在周星期一的日期:" + imptimeBegin);
|
||||
cal.add(Calendar.DATE, 6);
|
||||
param.put("endDate", cal.getTime());
|
||||
// System.out.println("所在周星期日的日期:" + imptimeEnd);
|
||||
}
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* <pre>
|
||||
* 根据传入的日期,获取当前日期所在的一周时间段
|
||||
* </pre>
|
||||
*
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static void getWeekInterval(Map<String, Object> param, Date now) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(now);
|
||||
// 判断要计算的日期是否是周日,如果是则减一天计算周六的,否则会出问题,计算到下一周去了
|
||||
int dayWeek = cal.get(Calendar.DAY_OF_WEEK);// 获得当前日期是一个星期的第几天
|
||||
if(1 == dayWeek) {
|
||||
cal.add(Calendar.DAY_OF_MONTH, -1);
|
||||
}
|
||||
// System.out.println("要计算日期为:" + sdf.format(cal.getTime())); // 输出要计算日期
|
||||
// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一
|
||||
cal.setFirstDayOfWeek(Calendar.MONDAY);
|
||||
// 获得当前日期是一个星期的第几天
|
||||
int day = cal.get(Calendar.DAY_OF_WEEK);
|
||||
// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值
|
||||
cal.add(Calendar.DATE, cal.getFirstDayOfWeek() - day);
|
||||
String time = DateKit.getDayDate(cal.getTime()) + " 00:00:00";
|
||||
try {
|
||||
param.put("beginDate", DateKit.getdayDate(time));
|
||||
} catch(Exception e) {
|
||||
// TODO
|
||||
}
|
||||
// System.out.println("所在周星期一的日期:" + imptimeBegin);
|
||||
cal.add(Calendar.DATE, 6);
|
||||
time = DateKit.getDayDate(cal.getTime()) + " 23:59:59";
|
||||
try {
|
||||
param.put("endDate", DateKit.getdayDate(time));
|
||||
} catch(Exception e) {
|
||||
//
|
||||
}
|
||||
// System.out.println("所在周星期日的日期:" + imptimeEnd);
|
||||
}
|
||||
|
||||
public static String getSimpleDate(Date date) {
|
||||
if(date == null) {
|
||||
return "";
|
||||
}
|
||||
return simple.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给日志格式化使用
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String getDate4Cal(Date date) {
|
||||
if(date == null) {
|
||||
return "";
|
||||
}
|
||||
return hour.format(date);
|
||||
}
|
||||
|
||||
public static String getDateString(Date date) {
|
||||
if(date == null) {
|
||||
return "";
|
||||
}
|
||||
return sdf.format(date);
|
||||
}
|
||||
|
||||
public static String getDayDate(Date date) {
|
||||
if(date == null) {
|
||||
return "";
|
||||
}
|
||||
return dayFormat.format(date);
|
||||
}
|
||||
|
||||
public static String getWeekDay(Date date) {
|
||||
if(date == null) {
|
||||
return "";
|
||||
}
|
||||
return weekDay.format(date);
|
||||
}
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* <pre>
|
||||
* 获取多少天以后的日期
|
||||
* </pre>
|
||||
*
|
||||
* @param day
|
||||
* @return
|
||||
*/
|
||||
public static Date getDayAfter(int day) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.add(Calendar.DATE, day);
|
||||
return cal.getTime();
|
||||
}
|
||||
// 获得某天的几天后
|
||||
public static Date getDayAfter(Date d, int day) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(d);
|
||||
cal.add(Calendar.DATE, day);
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一个月有多少天
|
||||
* @param year
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
public static int getDaysByYearMonth(int year, int month) {
|
||||
Calendar a = Calendar.getInstance();
|
||||
a.set(Calendar.YEAR, year);
|
||||
a.set(Calendar.MONTH, month);
|
||||
a.set(Calendar.DATE, 1);
|
||||
a.roll(Calendar.DATE, -1);
|
||||
int maxDate = a.get(Calendar.DATE);
|
||||
return maxDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今天是星期几
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static String getDayWeekName(Date date) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
||||
if(dayOfWeek < 0)
|
||||
dayOfWeek = 0;
|
||||
return dayNames[dayOfWeek];
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析时间,先解析yyyy-MM-dd HH:mm:ss
|
||||
* @param dateStr
|
||||
* @return
|
||||
* @throws ParseException
|
||||
* @throws Exception
|
||||
*/
|
||||
public static Date getdayDate(String dateStr) throws Exception {
|
||||
try {
|
||||
return sdf.parse(dateStr);
|
||||
} catch(Exception e) {
|
||||
try {
|
||||
return detailDate.parse(dateStr);
|
||||
} catch(Exception e1) {
|
||||
try {
|
||||
return dayFormat.parse(dateStr);
|
||||
} catch(Exception e2) {
|
||||
try {
|
||||
return simple.parse(dateStr);
|
||||
}
|
||||
catch(Exception e3) {
|
||||
return monthFormat.parse(dateStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据时间获取周区间字符串
|
||||
* @param now
|
||||
* @return 第XX周:2018-08-27至2018-09-02
|
||||
*/
|
||||
public static String getWeekNumAndDateZone(Date now) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("第");
|
||||
sb.append(getWeekNum(now));
|
||||
sb.append("周:");
|
||||
Map<String, Object> param = new HashMap<String, Object>();
|
||||
getWeekInterval(param, now);
|
||||
Date beginDate = (Date)param.get("beginDate");
|
||||
Date endDate = (Date)param.get("endDate");
|
||||
sb.append(dayFormat.format(beginDate));
|
||||
sb.append("至");
|
||||
sb.append(dayFormat.format(endDate));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据日期和时间获取一个返回该日期该时间的date
|
||||
* @param d 日期
|
||||
* @param time 时间 HH:mm格式
|
||||
* @return d日期+time时间
|
||||
* @throws ParseException
|
||||
*/
|
||||
public static Date getDateFromTime(Date d, String time) throws ParseException {
|
||||
String dateTime = dayFormat.format(d) + " " + time;
|
||||
return detailDate.parse(dateTime);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.seeyon.apps.ydctu8c.util;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.ext.workflow.vo.FieldDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
|
||||
public class ParamUtil {
|
||||
|
||||
public String param(String request, String method , FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
String param = "";
|
||||
switch(method){
|
||||
case "/u8cloud/api/uapbd/custmandoc/insert":
|
||||
param = insertCustmandocParam(request,formDataVo);
|
||||
break;
|
||||
case "/u8cloud/api/uapbd/custdoc/insert":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/cmp/fj/insert":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/cmp/sj/insert":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/arap/yf/insert":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/uapbd/custdoc/assign":
|
||||
param = allocationCustdocParam (request);
|
||||
break;
|
||||
case "/u8cloud/api/uapbd/custdoc/update":
|
||||
param = request;
|
||||
break;
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*客商分配
|
||||
* @return
|
||||
*/
|
||||
public String allocationCustdocParam (String request) throws NoSuchFieldException {
|
||||
// 获取指定的json格式
|
||||
JSONObject jsonObject = JSON.parseObject(request);
|
||||
JSONArray custbasvos = jsonObject.getJSONArray("custbasvo");
|
||||
JSONObject custbasvo = custbasvos.getJSONObject(0);
|
||||
String pkCorps = custbasvo.getString("pk_corp");
|
||||
String[] corpCodes = pkCorps.split(",");
|
||||
JSONObject ret = new JSONObject();
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
for (String corpCode : corpCodes) {
|
||||
JSONObject newCustbasvo = new JSONObject();
|
||||
newCustbasvo.put("pk_cubasdoc",custbasvo.getString("pk_cubasdoc"));
|
||||
newCustbasvo.put("custprop",custbasvo.getString("custprop"));
|
||||
newCustbasvo.put("pk_corp",corpCode);
|
||||
array.add(newCustbasvo);
|
||||
}
|
||||
ret.put("custbasvo",array);
|
||||
|
||||
return ret.toString();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 客商管理档案新增,接口参数调整
|
||||
* @param request 自动获取接口原参数
|
||||
* @param formDataVo 表单字段对象
|
||||
* @return
|
||||
* @throws NoSuchFieldException
|
||||
*/
|
||||
public String insertCustmandocParam(String request, FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
// 获取指定的json格式
|
||||
JSONObject jsonObject = JSON.parseObject(request);
|
||||
JSONArray billvos = jsonObject.getJSONArray("billvo");
|
||||
JSONObject billvo = billvos.getJSONObject(0);
|
||||
FieldDataVo custmandocType = formDataVo.getFieldData("客商类型");
|
||||
String custmandocTypeValue = custmandocType.getStringValue();
|
||||
JSONArray childrenvos = new JSONArray();
|
||||
JSONObject childrenvo1 = new JSONObject();
|
||||
JSONObject childrenvo2 = new JSONObject();
|
||||
if("客户".equals(custmandocTypeValue)){
|
||||
childrenvo1.put("custflag","0");
|
||||
childrenvo2.put("custflag","4");
|
||||
childrenvos.add(childrenvo1);
|
||||
childrenvos.add(childrenvo2);
|
||||
billvo.put("childrenvo",childrenvos);
|
||||
}else if ("供应商".equals(custmandocTypeValue)){
|
||||
childrenvo1.put("custflag","1");
|
||||
childrenvo2.put("custflag","");
|
||||
childrenvos.add(childrenvo1);
|
||||
childrenvos.add(childrenvo2);
|
||||
billvo.put("childrenvo",childrenvos);
|
||||
}else if ("客商".equals(custmandocTypeValue)){
|
||||
childrenvo1.put("custflag","2");
|
||||
childrenvo2.put("custflag","3");
|
||||
childrenvos.add(childrenvo1);
|
||||
childrenvos.add(childrenvo2);
|
||||
billvo.put("childrenvo",childrenvos);
|
||||
}
|
||||
System.out.println(jsonObject);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
package com.seeyon.apps.ydctu8c.util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字符处理工具类
|
||||
* @date 2018年5月23日上午9:05:01
|
||||
* @Copyright Beijing Seeyon Software Co.,LTD
|
||||
*/
|
||||
public class StrKit {
|
||||
|
||||
public static String str(Object o) {
|
||||
if(o == null) {
|
||||
return null;
|
||||
}
|
||||
if(o instanceof Date) {
|
||||
return DateKit.getDayDate((Date)o);
|
||||
}
|
||||
if(o instanceof Timestamp) {
|
||||
return DateKit.getDayDate((Timestamp)o);
|
||||
}
|
||||
if(o instanceof String) {
|
||||
return (String)o;
|
||||
}
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
public static String str(Object o, boolean null2Str) {
|
||||
if(o == null && null2Str) {
|
||||
return "";
|
||||
}
|
||||
return str(o);
|
||||
}
|
||||
|
||||
public static float toFloat(Object o) {
|
||||
if(o == null) {
|
||||
return 0f;
|
||||
} else if(o instanceof Float) {
|
||||
return (Float)o;
|
||||
} else if(o instanceof String) {
|
||||
return Float.valueOf((String)o);
|
||||
} else if(o instanceof BigDecimal) {
|
||||
return ((BigDecimal)o).floatValue();
|
||||
}
|
||||
return 0f;
|
||||
}
|
||||
|
||||
public static Long toLong(Object o) {
|
||||
if(null == o) {
|
||||
return 0L;
|
||||
} else if(o instanceof Long) {
|
||||
return (Long)o;
|
||||
} else if(o instanceof String) {
|
||||
if("".equals(o)) {
|
||||
return 0L;
|
||||
}
|
||||
return Long.valueOf((String)o);
|
||||
} else if(o instanceof BigDecimal) {
|
||||
return ((BigDecimal)o).longValue();
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取int值,为空返回0
|
||||
* @param obj 对象
|
||||
* @return
|
||||
*/
|
||||
public static Integer toInteger(Object obj) {
|
||||
if(obj == null) {
|
||||
return 0;
|
||||
} else if(obj instanceof Long){
|
||||
return ((Long)obj).intValue();
|
||||
} else if(obj instanceof BigDecimal) {
|
||||
return ((BigDecimal)obj).intValue();
|
||||
}else if(obj instanceof String) {
|
||||
String o = (String) obj;
|
||||
if("".equals(o)) {
|
||||
return 0;
|
||||
} else {
|
||||
try {
|
||||
return Integer.valueOf((String) obj);
|
||||
} catch(Exception e) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else if(obj instanceof Integer) {
|
||||
return (Integer) obj;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static Date toDate(Object o) throws Exception {
|
||||
if(null == o) {
|
||||
return null;
|
||||
} else if(o instanceof Date) {
|
||||
return (Date)o;
|
||||
} else if(o instanceof Timestamp) {
|
||||
return ((Timestamp) o);
|
||||
} else if(o instanceof String){
|
||||
return DateKit.getdayDate((String) o);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static List<?> toList(Object o) {
|
||||
if(o == null) {
|
||||
return null;
|
||||
} else if(o instanceof List) {
|
||||
return (List<?>) o;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断对象是否为空
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
public static boolean isNull(Object o) {
|
||||
if(null == o) {
|
||||
return true;
|
||||
}
|
||||
if(o instanceof String) {
|
||||
return "".equals((String) o);
|
||||
}
|
||||
if(o instanceof Collection) {
|
||||
// 集合数量为0 则为空
|
||||
return ((Collection<?>) o).size() == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除最后一个字符
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static String deleteLastChar(String input) {
|
||||
if(isNull(input))
|
||||
return "";
|
||||
return input.substring(0, input.length() - 1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换成 123,456,789的格式
|
||||
* @param inputString
|
||||
* @param length
|
||||
* @return
|
||||
*/
|
||||
public static String getListStr(String inputString, int length) {
|
||||
if(isNull(inputString))
|
||||
return "";
|
||||
String str = "";
|
||||
List<String> strList = getStrList(inputString, length);
|
||||
for(String string : strList) {
|
||||
str += string + ",";
|
||||
}
|
||||
return deleteLastChar(str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 把原始字符串分割成指定长度的字符串列表
|
||||
*
|
||||
* @param inputString
|
||||
* 原始字符串
|
||||
* @param length
|
||||
* 指定长度
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getStrList(String inputString, int length) {
|
||||
int size = inputString.length() / length;
|
||||
if (inputString.length() % length != 0) {
|
||||
size += 1;
|
||||
}
|
||||
return getStrList(inputString, length, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* 把原始字符串分割成指定长度的字符串列表
|
||||
*
|
||||
* @param inputString
|
||||
* 原始字符串
|
||||
* @param length
|
||||
* 指定长度
|
||||
* @param size
|
||||
* 指定列表大小
|
||||
* @return
|
||||
*/
|
||||
private static List<String> getStrList(String inputString, int length,
|
||||
int size) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
for (int index = 0; index < size; index++) {
|
||||
String childStr = substring(inputString, index * length,
|
||||
(index + 1) * length);
|
||||
list.add(childStr);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分割字符串,如果开始位置大于字符串长度,返回空
|
||||
*
|
||||
* @param str
|
||||
* 原始字符串
|
||||
* @param f
|
||||
* 开始位置
|
||||
* @param t
|
||||
* 结束位置
|
||||
* @return
|
||||
*/
|
||||
private static String substring(String str, int f, int t) {
|
||||
if (f > str.length())
|
||||
return null;
|
||||
if (t > str.length()) {
|
||||
return str.substring(f, str.length());
|
||||
} else {
|
||||
return str.substring(f, t);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getFixedLengthStr(String str, int length) {
|
||||
// 如果为空,返回全部都是0
|
||||
if(length < 1) {
|
||||
return "";
|
||||
}
|
||||
if(isNull(str)) {
|
||||
return getZeor(length);
|
||||
}
|
||||
if(str.length() < length) {
|
||||
return getZeor(length - str.length()) + str;
|
||||
}
|
||||
return str.substring(0, length);
|
||||
}
|
||||
|
||||
private static String getZeor(int length) {
|
||||
String str = "";
|
||||
for(int i = 0; i < length; i++) {
|
||||
str += "0";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.seeyon.apps.ydctu8c.util;
|
||||
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.ydctu8c.vo.U8cResponse;
|
||||
import com.seeyon.ctp.util.json.JSONUtil;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
public class U8cHttpUtil {
|
||||
|
||||
private U8cHttpUtil() {
|
||||
|
||||
}
|
||||
|
||||
public static String doPost(String url, String body, String u8cSystem, String u8cUsercode,String u8cPassword,String connection,String contentType) throws Exception {
|
||||
|
||||
return HttpRequest.post(url).header("accept", "*/*")
|
||||
.header("connection", connection)
|
||||
.header("Content-Type", contentType)
|
||||
.header("system", u8cSystem)
|
||||
.header("usercode", u8cUsercode)
|
||||
.header("password", u8cPassword)
|
||||
.body(body).execute().body();
|
||||
}
|
||||
|
||||
public static U8cResponse parseResponse(String response) throws Exception {
|
||||
try {
|
||||
JSONObject object = JSONUtil.parseJSONString(response, JSONObject.class);
|
||||
return new U8cResponse(object);
|
||||
} catch (Exception e) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("Status", "0");
|
||||
jsonObject.put("Msg", "解析json异常");
|
||||
jsonObject.put("Data", response);
|
||||
return new U8cResponse(jsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String url = "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.seeyon.apps.ydctu8c.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/4/28
|
||||
*/
|
||||
public class U8cResponse {
|
||||
|
||||
private boolean success;
|
||||
private int status;
|
||||
private String msg;
|
||||
private String data;
|
||||
|
||||
|
||||
public U8cResponse(JSONObject object) {
|
||||
if(object.containsKey("Status")) {
|
||||
this.status = object.getInteger("Status");
|
||||
} else {
|
||||
this.status = object.getString("status").equals("success")?1:2;
|
||||
}
|
||||
this.success = (1 == status);
|
||||
if(object.containsKey("Msg")) {
|
||||
this.msg = object.getString("Msg");
|
||||
} else {
|
||||
this.msg = object.getString("errormsg");
|
||||
}
|
||||
if(object.containsKey("Data")) {
|
||||
this.data = object.getString("Data");
|
||||
} else {
|
||||
this.data = object.getString("data");
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public U8cResponse setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public U8cResponse setStatus(int status) {
|
||||
this.status = status;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public U8cResponse setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public U8cResponse setData(String data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
322
v5/apps-customize/src/main/resources/needless_check_login.xml
Normal file
322
v5/apps-customize/src/main/resources/needless_check_login.xml
Normal file
@@ -0,0 +1,322 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans>
|
||||
<bean>
|
||||
<id>/qrCodeForm.do</id>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
<method>newMain</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/sc.do</id>
|
||||
<methods>
|
||||
<method>qr</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/elearning.do</id>
|
||||
<methods>
|
||||
<method>error</method>
|
||||
<method>m3Redirect</method>
|
||||
<method>message</method>
|
||||
<method>pcRedirect</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/phoneLogin/phoneLogin.do</id>
|
||||
<methods>
|
||||
<method>getMessageCode</method>
|
||||
<method>validateMessageCode</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/wechat/miniprogram.do</id>
|
||||
<methods>
|
||||
<method>a8home</method>
|
||||
<method>bind</method>
|
||||
<method>bindMemberPhone</method>
|
||||
<method>login</method>
|
||||
<method>unbind</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/portal/spaceController.do</id>
|
||||
<methods>
|
||||
<method>showThemSpace</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/identification.do</id>
|
||||
<methods>
|
||||
<method>getSessionId</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/fileUpload.do</id>
|
||||
<methods>
|
||||
<method>showRTE</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/fileDownload.do</id>
|
||||
<methods>
|
||||
<method>showRTE</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/form/formUpgrade.do</id>
|
||||
<methods>
|
||||
<method>toUpgrade</method>
|
||||
<method>upgrade</method>
|
||||
<method>viewUpgrade</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>formtalkFormMapperController.do</id>
|
||||
<methods>
|
||||
<method>importFormtalkData</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/thirdpartyController.do</id>
|
||||
<methods>
|
||||
<method>access</method>
|
||||
<method>index</method>
|
||||
<method>logoutNotify</method>
|
||||
<method>show</method>
|
||||
<method>mailAuth</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/main.do</id>
|
||||
<methods>
|
||||
<method>changeLocale</method>
|
||||
<method>hangup</method>
|
||||
<method>headerjs</method>
|
||||
<method>index</method>
|
||||
<method>login</method>
|
||||
<method>login4Ucpc</method>
|
||||
<method>login4Ucpc3</method>
|
||||
<method>login4Vjoin</method>
|
||||
<method>logout</method>
|
||||
<method>logout4Session</method>
|
||||
<method>logout4Vjoin</method>
|
||||
<method>logout4ZX</method>
|
||||
<method>main</method>
|
||||
<method>login4QrCode</method>
|
||||
<method>qrCodeHelp</method>
|
||||
<method>updateLoginSeed</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/trustdo/A8/XRD.do</id>
|
||||
<methods>
|
||||
<method>getLoginAccount</method>
|
||||
<method>getLoginAcctoken</method>
|
||||
<method>webLogin</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/share.do</id>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/genericController.do</id>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/edoc/edocUpgradeControllor.do</id>
|
||||
<methods>
|
||||
<method>upgrade</method>
|
||||
<method>download</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/uploadService.do</id>
|
||||
<methods>
|
||||
<method>processUploadService</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/autoinstall.do</id>
|
||||
<methods>
|
||||
<method>ieSetDown</method>
|
||||
<method>regInstallDown</method>
|
||||
<method>regInstallDown64</method>
|
||||
<method>downloadAssistant</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/personalBind.do</id>
|
||||
<methods>
|
||||
<method>getBindTypeByLoginName</method>
|
||||
<method>isCanUse</method>
|
||||
<method>retrievePassword</method>
|
||||
<method>sendVerificationCodeToBindEmail</method>
|
||||
<method>sendVerificationCodeToBindNum</method>
|
||||
<method>validateVerificationCode</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<!-- <bean>白名单清理-->
|
||||
<!-- <id>/meetingPanel.do</id>-->
|
||||
<!-- <methods>-->
|
||||
<!-- <method>meetingPanelDisplay</method>-->
|
||||
<!-- <method>meetingPanelView</method>-->
|
||||
<!-- </methods>-->
|
||||
<!-- </bean>-->
|
||||
<bean>
|
||||
<id>/commonimage.do</id>
|
||||
<methods>
|
||||
<method>showImage</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/individualManager.do</id>
|
||||
<methods>
|
||||
<method>resetPassword</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/wechat/dingding.do</id>
|
||||
<methods>
|
||||
<method>binding</method>
|
||||
<method>index</method>
|
||||
<method>main</method>
|
||||
<method>newIndex</method>
|
||||
<method>newMain</method>
|
||||
<method>viewh5Message</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/uc/rest.do</id>
|
||||
<methods>
|
||||
<method>commonPierce</method>
|
||||
<method>downloadImage</method>
|
||||
<method>getBgTimeStamp</method>
|
||||
<method>getLoginsecurityMsg</method>
|
||||
<method>sendsms</method>
|
||||
<method>smsrequired</method>
|
||||
<method>testIp</method>
|
||||
<method>isQrLogin</method>
|
||||
<method>getDigitalCodeInfo</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>portalManager</id>
|
||||
<methods>
|
||||
<method>sendSMSLoginCode</method>
|
||||
<method>smsLoginEnabled</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>loginUserManager</id>
|
||||
<methods>
|
||||
<method>getLockTime</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>qrCodeLoginManager</id>
|
||||
<methods>
|
||||
<method>isLogin</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>meetingAjaxManager</id>
|
||||
<methods>
|
||||
<method>meetingPanelData</method>
|
||||
<method>meetingPanelDisplay</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/loginController.do</id>
|
||||
<methods>
|
||||
<method>transLogin</method>
|
||||
<method>transLogout</method>
|
||||
<method>getProfile</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/mClientBindController.do</id>
|
||||
<methods>
|
||||
<method>bindApply</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>m3ProductManager</id>
|
||||
<methods>
|
||||
<method>productInfo</method>
|
||||
<method>productStatus</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/homeSkinController.do</id>
|
||||
<methods>
|
||||
<method>downloadImage</method>
|
||||
<method>getSkinImageUrl</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/transModeController.do</id>
|
||||
<methods>
|
||||
<method>getTransModeForMobile</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/media/media.do</id>
|
||||
<methods>
|
||||
<method>mediaShow</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/ocipEdoc.do</id>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/colView.do</id>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/caAccountManagerController.do</id>
|
||||
<methods>
|
||||
<method>findKeyNumByLoginName</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/fddCallbackController.do</id>
|
||||
<methods>
|
||||
<method>asynch</method>
|
||||
<method>synch</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/seeyonReport/seeyonReportController.do</id>
|
||||
<methods>
|
||||
<method>redirectSeeyonReport</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/imc.do</id>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
<method>logout</method>
|
||||
</methods>
|
||||
</bean>
|
||||
|
||||
<bean>
|
||||
<id>/cloudbuild.do</id>
|
||||
<methods>
|
||||
<method>download</method>
|
||||
<method>getDownloadPageInfo</method>
|
||||
<method>getLatestVersionInfo</method>
|
||||
<method>getDownloadQrUrl</method>
|
||||
</methods>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,426 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<beans>
|
||||
|
||||
<bean>
|
||||
<id>/qrCodeForm.do</id>
|
||||
<name>com.seeyon.apps.qrCodeForm.controller.QrCodeFormController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
<method>newMain</method>
|
||||
</methods>
|
||||
</bean>
|
||||
|
||||
<bean>
|
||||
<id>/sc.do</id>
|
||||
<name>com.seeyon.cap4.form.modules.smartCode.controller.SmartCodeController</name>
|
||||
<methods>
|
||||
<method>qr</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/media/media.do</id>
|
||||
<name>com.seeyon.ctp.common.media.controller.MediaController</name>
|
||||
<methods>
|
||||
<method>mediaShow</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/phoneLogin/phoneLogin.do</id>
|
||||
<name>com.seeyon.ctp.login.controller.PhoneLoginController</name>
|
||||
<methods>
|
||||
<method>getMessageCode</method>
|
||||
<method>validateMessageCode</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>portalManager</id>
|
||||
<name>com.seeyon.ctp.portal.manager.PortalManagerImpl</name>
|
||||
<methods>
|
||||
<method>sendSMSLoginCode</method>
|
||||
<method>smsLoginEnabled</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/fileDownload.do</id>
|
||||
<name>com.seeyon.ctp.common.fileupload.FileUploadController</name>
|
||||
<methods>
|
||||
<method>showRTE</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>loginUserManager</id>
|
||||
<name>com.seeyon.ctp.login.LoginUserManagerImpl</name>
|
||||
<methods>
|
||||
<method>getLockTime</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/main.do</id>
|
||||
<name>com.seeyon.ctp.login.controller.MainController</name>
|
||||
<methods>
|
||||
<method>changeLocale</method>
|
||||
<method>hangup</method>
|
||||
<method>headerjs</method>
|
||||
<method>index</method>
|
||||
<method>login</method>
|
||||
<method>login4Ucpc</method>
|
||||
<method>login4Ucpc3</method>
|
||||
<method>login4Vjoin</method>
|
||||
<method>logout</method>
|
||||
<method>logout4Session</method>
|
||||
<method>logout4Vjoin</method>
|
||||
<method>logout4ZX</method>
|
||||
<method>main</method>
|
||||
<method>login4QrCode</method>
|
||||
<method>qrCodeHelp</method>
|
||||
<method>updateLoginSeed</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/trustdo/A8/XRD.do</id>
|
||||
<name>com.seeyon.apps.trustdo.controller.XRDController</name>
|
||||
<methods>
|
||||
<method>getLoginAccount</method>
|
||||
<method>getLoginAcctoken</method>
|
||||
<method>webLogin</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/share.do</id>
|
||||
<name>com.seeyon.v3x.system.share.controller.ShareController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/edoc/edocUpgradeControllor.do</id>
|
||||
<name>com.seeyon.v3x.edoc.controller.EdocUpgradeControllor</name>
|
||||
<methods>
|
||||
<method>upgrade</method>
|
||||
<method>download</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/mClientBindController.do</id>
|
||||
<name>com.seeyon.apps.m3.bind.controller.M3ClientBindController</name>
|
||||
<methods>
|
||||
<method>bindApply</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/uploadService.do</id>
|
||||
<name>com.seeyon.ctp.services.FileUploadService</name>
|
||||
<methods>
|
||||
<method>processUploadService</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/uc/rest.do</id>
|
||||
<name>com.seeyon.apps.zx.controller.ZxRestController</name>
|
||||
<methods>
|
||||
<method>commonPierce</method>
|
||||
<method>downloadImage</method>
|
||||
<method>getBgTimeStamp</method>
|
||||
<method>getLoginsecurityMsg</method>
|
||||
<method>sendsms</method>
|
||||
<method>smsrequired</method>
|
||||
<method>testIp</method>
|
||||
<method>isQrLogin</method>
|
||||
<method>getDigitalCodeInfo</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/homeSkinController.do</id>
|
||||
<name>com.seeyon.apps.m3.skin.controller.M3HomeSkinController</name>
|
||||
<methods>
|
||||
<method>downloadImage</method>
|
||||
<method>getSkinImageUrl</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/colView.do</id>
|
||||
<name>com.seeyon.apps.ocip.exchange.collaboration.controller.CollViewController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/autoinstall.do</id>
|
||||
<name>com.seeyon.apps.autoinstall.controller.AutoInstallController</name>
|
||||
<methods>
|
||||
<method>ieSetDown</method>
|
||||
<method>regInstallDown</method>
|
||||
<method>regInstallDown64</method>
|
||||
<method>downloadAssistant</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<!-- <bean> 白名单清理-->
|
||||
<!-- <id>/meetingPanel.do</id>-->
|
||||
<!-- <name>com.seeyon.apps.meeting.controller.MeetingPanelController</name>-->
|
||||
<!-- <methods>-->
|
||||
<!-- <method>meetingPanelDisplay</method>-->
|
||||
<!-- <method>meetingPanelView</method>-->
|
||||
<!-- </methods>-->
|
||||
<!-- </bean>-->
|
||||
<bean>
|
||||
<id>/caAccountManagerController.do</id>
|
||||
<name>com.seeyon.v3x.ca.caaccount.controller.CAAccountManagerController</name>
|
||||
<methods>
|
||||
<method>findKeyNumByLoginName</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/elearning.do</id>
|
||||
<name>com.seeyon.apps.elearning.controller.ElearningController</name>
|
||||
<methods>
|
||||
<method>error</method>
|
||||
<method>m3Redirect</method>
|
||||
<method>message</method>
|
||||
<method>pcRedirect</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/wechat/miniprogram.do</id>
|
||||
<name>com.seeyon.apps.weixin.controller.MiniProgramController</name>
|
||||
<methods>
|
||||
<method>a8home</method>
|
||||
<method>bind</method>
|
||||
<method>bindMemberPhone</method>
|
||||
<method>login</method>
|
||||
<method>unbind</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/portal/spaceController.do</id>
|
||||
<name>com.seeyon.ctp.portal.space.controller.SpaceController</name>
|
||||
<methods>
|
||||
<method>showThemSpace</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/identification.do</id>
|
||||
<name>com.seeyon.v3x.identification.controller.IdentificationController</name>
|
||||
<methods>
|
||||
<method>getSessionId</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/fddCallbackController.do</id>
|
||||
<name>com.seeyon.apps.econtract.fdd.controller.FddCallbackController</name>
|
||||
<methods>
|
||||
<method>asynch</method>
|
||||
<method>synch</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>m3ProductManager</id>
|
||||
<name>com.seeyon.apps.m3.product.manager.impl.M3ProductManagerImpl</name>
|
||||
<methods>
|
||||
<method>productInfo</method>
|
||||
<method>productStatus</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/ocipEdoc.do</id>
|
||||
<name>com.seeyon.apps.ocip.exchange.edoc.OCIPEdocController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/loginController.do</id>
|
||||
<methods>
|
||||
<method>transLogin</method>
|
||||
<method>transLogout</method>
|
||||
<method>getProfile</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/fileUpload.do</id>
|
||||
<name>com.seeyon.ctp.common.fileupload.FileUploadController</name>
|
||||
<methods>
|
||||
<method>showRTE</method>
|
||||
<method>processUpload</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>qrCodeLoginManager</id>
|
||||
<name>com.seeyon.ctp.login.manager.QrCodeLoginManagerImpl</name>
|
||||
<methods>
|
||||
<method>isLogin</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/form/formUpgrade.do</id>
|
||||
<name>com.seeyon.ctp.form.service.FormUpgradeController</name>
|
||||
<methods>
|
||||
<method>toUpgrade</method>
|
||||
<method>upgrade</method>
|
||||
<method>viewUpgrade</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/seeyonReport/seeyonReportController.do</id>
|
||||
<name>com.seeyon.apps.seeyonreport.controller.SeeyonReportController</name>
|
||||
<methods>
|
||||
<method>redirectSeeyonReport</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>formtalkFormMapperController.do</id>
|
||||
<name>com.seeyon.apps.formtalk.controller.FormtalkImportController</name>
|
||||
<methods>
|
||||
<method>importFormtalkData</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/thirdpartyController.do</id>
|
||||
<name>com.seeyon.ctp.portal.sso.thirdpartyintegration.controller.ThirdpartyController</name>
|
||||
<methods>
|
||||
<method>access</method>
|
||||
<method>index</method>
|
||||
<method>logoutNotify</method>
|
||||
<method>show</method>
|
||||
<method>mailAuth</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/m3/transModeController.do</id>
|
||||
<name>com.seeyon.apps.m3.transmissionmode.controller.M3TransModeController</name>
|
||||
<methods>
|
||||
<method>getTransModeForMobile</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/genericController.do</id>
|
||||
<name>com.seeyon.v3x.common.controller.GenericController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/personalBind.do</id>
|
||||
<name>com.seeyon.v3x.personalaffair.controller.PersonalBindController</name>
|
||||
<methods>
|
||||
<method>getBindTypeByLoginName</method>
|
||||
<method>isCanUse</method>
|
||||
<method>retrievePassword</method>
|
||||
<method>sendVerificationCodeToBindEmail</method>
|
||||
<method>sendVerificationCodeToBindNum</method>
|
||||
<method>validateVerificationCode</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/commonimage.do</id>
|
||||
<name>com.seeyon.apps.common.image.controller.ImageController</name>
|
||||
<methods>
|
||||
<method>showImage</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/individualManager.do</id>
|
||||
<name>com.seeyon.v3x.personalaffair.controller.IndividualManagerController</name>
|
||||
<methods>
|
||||
<method>resetPassword</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>meetingAjaxManager</id>
|
||||
<name>com.seeyon.apps.meeting.manager.MeetingAjaxManagerImpl</name>
|
||||
<methods>
|
||||
<method>meetingPanelData</method>
|
||||
<method>meetingPanelDisplay</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/wechat/dingding.do</id>
|
||||
<name>com.seeyon.apps.weixin.controller.DingDingController</name>
|
||||
<methods>
|
||||
<method>binding</method>
|
||||
<method>index</method>
|
||||
<method>main</method>
|
||||
<method>newIndex</method>
|
||||
<method>newMain</method>
|
||||
<method>viewh5Message</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/imc.do</id>
|
||||
<name>com.seeyon.apps.imc.controller.ImcLoginController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
<method>logout</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/wechat/feishu.do</id>
|
||||
<name>com.seeyon.apps.weixin.controller.FeishuController</name>
|
||||
<methods>
|
||||
<method>newMain</method>
|
||||
<method>viewh5Message</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<!-- <bean>-->
|
||||
<!-- <id>/wechat/pcapp.do</id>-->
|
||||
<!-- <name>com.seeyon.apps.zhifei.controller.ZhifeiPcAppController</name>-->
|
||||
<!-- <methods>-->
|
||||
<!-- <method>transferPageFromWxCoreServer</method>-->
|
||||
<!-- <method>gotoPcApp</method>-->
|
||||
<!-- <method>checkCodeTurnToRightPage</method>-->
|
||||
<!-- <method>transfer</method>-->
|
||||
<!-- <method>transferMsg</method>-->
|
||||
<!-- </methods>-->
|
||||
<!-- </bean>-->
|
||||
<bean>
|
||||
<id>/wechat/pcapp.do</id>
|
||||
<name>com.seeyon.apps.weixin.controller.PcAppController</name>
|
||||
<methods>
|
||||
<method>transferPageFromWxCoreServer</method>
|
||||
<method>gotoPcApp</method>
|
||||
<method>checkCodeTurnToRightPage</method>
|
||||
<method>transfer</method>
|
||||
<method>transferMsg</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/wechat/feishu/approvalData.do</id>
|
||||
<name>com.seeyon.apps.zhifei.feishu.approval.controller.ApprovalDataController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/zhifei/feishu.do</id>
|
||||
<name>com.seeyon.apps.zhifei.controller.FeishuController</name>
|
||||
<methods>
|
||||
<method>newMain</method>
|
||||
<method>viewh5Message</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/zhifei/pcapp.do</id>
|
||||
<name>com.seeyon.apps.zhifei.controller.ZhifeiPcAppController</name>
|
||||
<methods>
|
||||
<method>transferPageFromWxCoreServer</method>
|
||||
<method>gotoPcApp</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/zhifei/feishu/approvalData.do</id>
|
||||
<name>com.seeyon.apps.zhifei.feishu.approval.controller.ApprovalDataController</name>
|
||||
<methods>
|
||||
<method>index</method>
|
||||
</methods>
|
||||
</bean>
|
||||
<bean>
|
||||
<id>/cloudbuild.do</id>
|
||||
<name>com.seeyon.apps.cloudbuild.controller.CloudBuildController</name>
|
||||
<methods>
|
||||
<method>download</method>
|
||||
<method>getDownloadPageInfo</method>
|
||||
<method>getLatestVersionInfo</method>
|
||||
<method>getDownloadQrUrl</method>
|
||||
</methods>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_financing</id>
|
||||
<name>宜都城投融资管理</name>
|
||||
<category>20240914</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>ydctu8c</id>
|
||||
<name>宜都城投U8C集成</name>
|
||||
<category>20240913</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,24 @@
|
||||
<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="addYdctSaleorderNode" class="com.seeyon.apps.ydctu8c.salesorders.node.AddYdctSaleorderNode" />
|
||||
|
||||
<!--客商管理节点-->
|
||||
<bean id="addYdctCustdocNode" class="com.seeyon.apps.ydctu8c.custmandoc.node.AddYdctCustdocNode" />
|
||||
<bean id="addYdctCustmandocNode" class="com.seeyon.apps.ydctu8c.custmandoc.node.AddYdctCustmandocNode" />
|
||||
<bean id="allYdctocationCustdocNode" class="com.seeyon.apps.ydctu8c.custmandoc.node.AllYdctocationCustdocNode" />
|
||||
<bean id="updateYdctCustdocNode" class="com.seeyon.apps.ydctu8c.custmandoc.node.UpdateYdctCustdocNode" />
|
||||
|
||||
<!--现金管理节点-->
|
||||
<bean id="chaiLvYdctExpensePaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.ChaiLvYdctExpensePaymentNode" />
|
||||
<bean id="contractYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.ContractYdctCollectionNode" />
|
||||
<bean id="tongYongYdctFenZhangNode" class="com.seeyon.apps.ydctu8c.cash.node.TongYongYdctFenZhangNode" />
|
||||
<bean id="tongYongYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.TongYongYdctPaymentNode" />
|
||||
<bean id="xiangMuYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.XiangMuYdctPaymentNode" />
|
||||
<bean id="zijinYdctTransferNode" class="com.seeyon.apps.ydctu8c.cash.node.ZijinYdctTransferNode" />
|
||||
<bean id="zongHeYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.ZongHeYdctPaymentNode" />
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -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 id="u8cPluginApi" class="com.seeyon.apps.ydctu8c.U8cPluginApi" />
|
||||
<bean id="bpmProcessAop" class="com.seeyon.apps.ydctu8c.aop.BpmProcessAop" />
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8" isELIgnored="false" %>
|
||||
<%@ page language="java" import=" com.seeyon.apps.m3.skin.enums.M3StartPageCustomEnum" %>
|
||||
<!DOCTYPE html>
|
||||
<html class="h100b">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
|
||||
<title>模板二维码生成</title>
|
||||
<style>
|
||||
body {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
#center {
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#sidebar-l {
|
||||
float: left;
|
||||
width: 250px;
|
||||
margin-top: 20px;
|
||||
height: calc(100% - 40px);
|
||||
overflow: hidden;
|
||||
border: 1px solid #DCDBD9;
|
||||
background: #fff;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
|
||||
#sidebar-c {
|
||||
float: left;
|
||||
width: 250px;
|
||||
margin-top: 20px;
|
||||
height: calc(100% - 40px);
|
||||
overflow: hidden;
|
||||
border: 1px solid #DCDBD9;
|
||||
background: #fff;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#sidebar-r {
|
||||
margin-left: 538px;
|
||||
height: calc(100% - 40px);
|
||||
margin-top: 20px;
|
||||
overflow: auto;
|
||||
border: 1px solid #DCDBD9;
|
||||
background: #fff;
|
||||
}
|
||||
.bizDiv,.formTemDiv{
|
||||
padding-left: 15px;
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.formlist_content{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.formlist_content .current{
|
||||
background-color: #2490f8;
|
||||
}
|
||||
|
||||
|
||||
.formlist_title{
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
background: #f1f1f1;
|
||||
padding-left:15px;
|
||||
}
|
||||
.qr_title{
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
background: #f1f1f1;
|
||||
padding-left: 15px;
|
||||
}
|
||||
.qr_content{
|
||||
margin-top: 50px;
|
||||
text-align:center;
|
||||
}
|
||||
.qr_address{
|
||||
width: 80%;
|
||||
padding: 15px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="h100b">
|
||||
|
||||
<div id="center">
|
||||
<div id="sidebar-l">
|
||||
<div class="formlist_title">
|
||||
应用包
|
||||
</div>
|
||||
<div class="formlist_content">
|
||||
<c:if test="${fn:length(bizList)>0}">
|
||||
<c:forEach items="${bizList}" var="biz">
|
||||
<div class="bizDiv" bizId="${biz.id}">${ctp:toHTML(biz.name)}</div>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebar-c">
|
||||
<div class="formlist_title">
|
||||
应用模板
|
||||
</div>
|
||||
<div class="formlist_content">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="sidebar-r">
|
||||
<div id="qrcode">
|
||||
<div class="qr_title">
|
||||
模板二维码
|
||||
</div>
|
||||
<div class="qr_content">
|
||||
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<textarea class="qr_address" readonly></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script type="text/javascript"
|
||||
src="${staticPath}/main/common/js/jquery.qrcode.min.js${ctp:resSuffix()}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
bindEvent();
|
||||
defaultInit();
|
||||
});
|
||||
|
||||
function bindEvent(){
|
||||
//应用包绑定点击事件
|
||||
$('#sidebar-l .bizDiv').bind('click',function(e) {
|
||||
var _dom = $(e.target);
|
||||
var _bizId = _dom[0].getAttribute("bizId");
|
||||
$(".formlist_content .bizDiv").removeClass("current");
|
||||
_dom.addClass("current");
|
||||
if(_bizId){
|
||||
var param = {
|
||||
type : "formApp",
|
||||
bizConfigId : _bizId
|
||||
};
|
||||
callBackendMethod("qrCodeFormManager","listFormApp", param,{
|
||||
success : function(ret){
|
||||
if(ret && ret.length > 0){
|
||||
renderFormAppDom(ret);
|
||||
}
|
||||
},
|
||||
error : function(request, settings, e){
|
||||
$.alert(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function defaultInit(){
|
||||
var defaultDom = $("#sidebar-l .bizDiv");
|
||||
if(defaultDom && defaultDom.size() > 0){
|
||||
$(defaultDom[0]).trigger("click");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function renderFormAppDom(ret){
|
||||
$("#sidebar-c .formlist_content").empty();
|
||||
ret.forEach(function(e){
|
||||
var formTemDom = $("<div class='formTemDiv' onclick='qrCodeFormInfo(this,"+JSON.stringify(e)+")'>"+ e.name +"</div>");
|
||||
$("#sidebar-c .formlist_content").append(formTemDom);
|
||||
});
|
||||
|
||||
$($("#sidebar-c .formTemDiv")[0]).trigger("click");
|
||||
}
|
||||
|
||||
function qrCodeFormInfo(dom , ret){
|
||||
$(".formlist_content .formTemDiv").removeClass("current");
|
||||
$(dom).addClass("current");
|
||||
var _map = {
|
||||
templateId : ret.id,
|
||||
sourceType : ret.sourceType
|
||||
}
|
||||
if(ret.sourceType == 2){
|
||||
_map = {
|
||||
sourceType : ret.sourceType,
|
||||
formType: 'main',
|
||||
type: 'new',
|
||||
title: ret.name,
|
||||
rightId: "-1",
|
||||
moduleId: ret.id,
|
||||
formTemplateId: ret.id,
|
||||
moduleType: '42',
|
||||
operateType: '0'
|
||||
}
|
||||
}
|
||||
callBackendMethod("qrCodeFormManager","qrCodeFormUrl", _map,{
|
||||
success : function(ret){
|
||||
if(ret && ret.fillUrl){
|
||||
renderQrCode(ret.fillUrl);
|
||||
}
|
||||
},
|
||||
error : function(request, settings, e){
|
||||
$.alert(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderQrCode(temFormUrl){
|
||||
$("#qrcode .qr_content").empty();
|
||||
$("#qrcode .qr_address").empty();
|
||||
$("#qrcode .qr_content").qrcode({
|
||||
render: "canvas",
|
||||
width:"300",
|
||||
height:"300",
|
||||
text: temFormUrl
|
||||
});
|
||||
$("#qrcode .qr_address").html(temFormUrl);
|
||||
$.each($(".qr_address"),function(i,n){
|
||||
$(n).css("height",n.scrollHeight + 2 + "px");
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Binary file not shown.
Binary file not shown.
@@ -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,184 @@
|
||||
(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;
|
||||
var recordId = self.messageObj.formdata.formsons.front_formson_7.records[0].recordId;
|
||||
opts = {
|
||||
fieldId: 'field0191',
|
||||
tableName:'formson_0744',
|
||||
recordId:recordId
|
||||
};
|
||||
var data = csdk.core.getFieldData(opts);
|
||||
var field0206 = {fieldId: 'field0206'};
|
||||
var field0206value = csdk.core.getFieldData(field0206).value;
|
||||
var field0001 = {fieldId: 'field0001'};
|
||||
var field0001value = csdk.core.getFieldData(field0001).value;
|
||||
var field0007 = {fieldId: 'field0007'};
|
||||
var field0007value = csdk.core.getFieldData(field0007).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 field0216 = {fieldId: 'field0216'};
|
||||
var field0216value = csdk.core.getFieldData(field0216).value;
|
||||
var field0207 = {fieldId: 'field0207'};
|
||||
var field0207value = csdk.core.getFieldData(field0207).showValue;
|
||||
var field0014 = {fieldId: 'field0014'};
|
||||
var field0014value = csdk.core.getFieldData(field0014).showValue;
|
||||
var field0011 = {fieldId: 'field0011'};
|
||||
var field0011value = csdk.core.getFieldData(field0011).showValue;
|
||||
console.log(url2);
|
||||
var str = "";
|
||||
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
async : true,
|
||||
// 记得加随机数,不然如果ajax轮询请求会不执行
|
||||
url : encodeURI('/seeyon/interestMeasurementController.do?datetime=' + Math.random()),
|
||||
data:{"startDate":field0206value,
|
||||
"cycle":field0207value,
|
||||
"contractDate":field0007value,
|
||||
"credit":field0068value,
|
||||
"principal":field0212value,
|
||||
"money":field0213value,
|
||||
"interestRate":field0214value,
|
||||
"loanType":field0014value,
|
||||
"contractCode":field0001value,
|
||||
"updateCode":field0216value,
|
||||
"period":field0011value},
|
||||
dataType : 'json',
|
||||
contentType : 'application/json; charset=UTF-8',
|
||||
success : function(res) {
|
||||
|
||||
var randomNum = Math.floor(Math.random() * 10001);
|
||||
if(res.success){
|
||||
var money = data.showValue;
|
||||
if(money!="" ){
|
||||
|
||||
self.adaptation.formdata.field0215__.formmains.formmain_0725.field0216.value = res.num;
|
||||
}else{
|
||||
self.adaptation.formdata.field0215__.formmains.formmain_0725.field0211.value = randomNum;
|
||||
self.adaptation.formdata.field0215__.formmains.formmain_0725.field0216.value = res.num;
|
||||
}
|
||||
$.alert(利息明细生成完成);
|
||||
// var data = {
|
||||
// fieldId: 'field0211',
|
||||
// fieldData: {
|
||||
// value: randomNum+'', //数据值,存入数据库中的value值
|
||||
// display: randomNum+'', //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
// auth: ''
|
||||
// }
|
||||
// };
|
||||
// csdk.core.setFieldData(data);
|
||||
// self.adaptation.formdata.field0210__.formmains.formmain_0087.field0215.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>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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,13 @@
|
||||
|
||||
csdk.event.on('formRendered', function(){
|
||||
|
||||
try {
|
||||
if(cmp.href.getParam().qc = "ext") {
|
||||
document.getElementById("relationBtns").style.display="none";
|
||||
document.getElementById("attachment_wrap").style.display="none";
|
||||
}
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
document.addEventListener('cap_form_afterFormRender', function(evt) {
|
||||
try {
|
||||
if(cmp.href.getParam().qc == "ext") {
|
||||
document.getElementById("relationBtns").style.display="none";
|
||||
document.getElementById("attachment_wrap").style.display="none";
|
||||
document.getElementsByClassName("cmp-button-left-iconContent btn-box2")[0].style.display="none";
|
||||
}
|
||||
} catch(e) {
|
||||
|
||||
}
|
||||
});
|
||||
BIN
v5/apps-customize/src/main/webapp/test-classes/Test.class
Normal file
BIN
v5/apps-customize/src/main/webapp/test-classes/Test.class
Normal file
Binary file not shown.
17
v5/apps-customize/src/test/java/Test.java
Normal file
17
v5/apps-customize/src/test/java/Test.java
Normal file
@@ -0,0 +1,17 @@
|
||||
import com.seeyon.ctp.util.LightWeightEncoder;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
* <pre>
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @Author: FanGaowei
|
||||
* @Date: 2023/12/21
|
||||
*/
|
||||
public class Test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(LightWeightEncoder.encodeString("https://www.baidu.com"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user