2024-12-10上线代码上传
This commit is contained in:
@@ -3,9 +3,8 @@ package com.seeyon.apps.src_financing.constants;
|
||||
public enum FinancingConstants {
|
||||
|
||||
|
||||
plugin("src_financing","插件ID");
|
||||
// u8cUrl("http://ip:port", "U8C地址"),
|
||||
|
||||
plugin("src_financing","插件ID"),
|
||||
loginName("demo3", "辅助表创建人");
|
||||
FinancingConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.seeyon.apps.src_financing.controller;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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.apps.ydctu8c.U8CCommonNode;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.controller.BaseController;
|
||||
import com.seeyon.ctp.util.UUIDLong;
|
||||
import com.seeyon.ctp.util.json.JSONUtil;
|
||||
import com.seeyon.v3x.services.form.FormFactory;
|
||||
import com.seeyon.v3x.services.form.bean.FormExport;
|
||||
@@ -25,7 +30,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class InterestMeasurementController extends BaseController {
|
||||
|
||||
private static Log log = Log.get(InterestMeasurementController.class);
|
||||
private FormFactory formFactory;
|
||||
|
||||
public FormFactory getFormFactory() {
|
||||
@@ -55,7 +60,7 @@ public class InterestMeasurementController extends BaseController {
|
||||
|
||||
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
logger.info("进入ajax方法");
|
||||
log.info("进入ajax方法");
|
||||
// 设置返回值对象
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
@@ -79,7 +84,7 @@ public class InterestMeasurementController extends BaseController {
|
||||
jsonObject.put(params[0],params[1]);
|
||||
}
|
||||
}
|
||||
logger.info("处理参数");
|
||||
log.info("处理参数");
|
||||
String interestType = jsonObject.getString("interestType");
|
||||
// 获取初次提款时间
|
||||
String money = jsonObject.getString("money");
|
||||
@@ -114,7 +119,7 @@ public class InterestMeasurementController extends BaseController {
|
||||
int periodNum = NumberUtil.convertChineseNumberToArabic(period);
|
||||
end.add(Calendar.YEAR, periodNum);
|
||||
end.add(Calendar.DATE, 1);
|
||||
logger.info("设置结束时间");
|
||||
log.info("设置结束时间");
|
||||
// 根据开始结束时间和周期计算时间列表
|
||||
String cycle = jsonObject.getString("cycle");
|
||||
int cycleNum = rentCalculationUtil.getCycleNum(cycle);
|
||||
@@ -135,7 +140,7 @@ public class InterestMeasurementController extends BaseController {
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}
|
||||
logger.info("设置利率开始时间");
|
||||
log.info("设置利率开始时间");
|
||||
// 利率开始时间
|
||||
Date llstartDate = sdf.parse(interestRateDateStr);
|
||||
if(llstartDate.getTime()>lxstartDate.getTime()){
|
||||
@@ -147,7 +152,7 @@ public class InterestMeasurementController extends BaseController {
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}
|
||||
logger.info("判断是否为农发行规则");
|
||||
log.info("判断是否为农发行规则");
|
||||
|
||||
// 数据生成前根据合同编号清楚所有的辅助表信息
|
||||
String contractCode = jsonObject.getString("contractCode");
|
||||
@@ -162,7 +167,7 @@ public class InterestMeasurementController extends BaseController {
|
||||
System.out.println("删除失败,主表"+daleteFZFinancingSubnum+"明细表"+daleteFZFinancingnum+"合同编码"+contractCode);
|
||||
}
|
||||
}
|
||||
logger.info("删除历史生成的数据");
|
||||
log.info("删除历史生成的数据");
|
||||
// 创建保存利息明细信息
|
||||
List<Map<String,Object>> sublist = new ArrayList<Map<String,Object>>();
|
||||
// 判断利息测算类型
|
||||
@@ -171,7 +176,6 @@ public class InterestMeasurementController extends BaseController {
|
||||
if("政府专项债券".equals(loanType)){
|
||||
type = "政府专项利息测算";
|
||||
}else{
|
||||
|
||||
String[] principals = principal.split(";");
|
||||
String str = principals[0].substring(principals[0].length()-2);
|
||||
if(!"~0".equals(str)){
|
||||
@@ -202,7 +206,7 @@ public class InterestMeasurementController extends BaseController {
|
||||
|
||||
// 计算利息信息保存利息明细对象
|
||||
sublist = rentCalculationUtil.detailedHandle(jsonObject,type);
|
||||
logger.info("生成完成所有利息");
|
||||
log.info("生成完成所有利息");
|
||||
Map<String,Object> mainmap = new HashMap<String,Object>();
|
||||
mainmap.put("合同编号", contractCode);
|
||||
mainmap.put("触发文本更新", contractCode+codenum);
|
||||
@@ -212,18 +216,63 @@ public class InterestMeasurementController extends BaseController {
|
||||
List<ValueExport> valueExports = formExportUtil.setFormValue(mainmap);
|
||||
formExport.setSubordinateForms(subordinateFormExports);
|
||||
formExport.setValues(valueExports);
|
||||
logger.info("创建档案");
|
||||
// getFormFactory().importBusinessFormData("shenxian", "LXCSMX",
|
||||
// formExport, new String[] {});
|
||||
log.info("创建档案");
|
||||
getFormFactory().importBusinessFormData("shenxian", "LXCSMX",
|
||||
formExport, new String[] {});
|
||||
// getFormFactory().importBusinessFormData("admin1", "LXCSMX",
|
||||
// formExport, new String[] {});
|
||||
getFormFactory().importBusinessFormData("demo2", "LXCSMX",
|
||||
formExport, new String[] {});
|
||||
// getFormFactory().importBusinessFormData("demo2", "LXCSMX",
|
||||
// formExport, new String[] {});
|
||||
res.put("success", true);
|
||||
res.put("name", AppContext.currentUserLoginName());
|
||||
res.put("s", "");
|
||||
res.put("num", contractCode+codenum);
|
||||
|
||||
JSONObject patchData = new JSONObject();
|
||||
patchData.put("code",0);
|
||||
JSONObject jsonData = new JSONObject();
|
||||
jsonData.put("success",1);
|
||||
jsonData.put("code","200");
|
||||
jsonData.put("message","操作成功!");
|
||||
JSONObject formData = new JSONObject();
|
||||
JSONObject tableData = new JSONObject();
|
||||
JSONObject formmain_0087 = new JSONObject();
|
||||
JSONObject formupdate0087 = new JSONObject();
|
||||
JSONObject field0215 = new JSONObject();
|
||||
field0215.put("value","1");
|
||||
field0215.put("showValue","1");
|
||||
field0215.put("showValue2","1");
|
||||
formupdate0087.put("field0215",field0215);
|
||||
formmain_0087.put("update",formupdate0087);
|
||||
formmain_0087.put("empty",false);
|
||||
tableData.put("formmain_0087",formmain_0087);
|
||||
JSONObject formson_0091 = new JSONObject();
|
||||
JSONArray formadds0091 = new JSONArray();
|
||||
sublist.size();
|
||||
for(int i = 0 ; i < sublist.size() ; i ++){
|
||||
JSONObject recordId = new JSONObject();
|
||||
recordId.put("recordId", UUIDLong.longUUID());
|
||||
formadds0091.add(recordId);
|
||||
}
|
||||
formson_0091.put("add",formadds0091);
|
||||
List<String> lxFinancingSubId = getLeaseContractDao().getLXFinancingSubId(contractCode);
|
||||
String[] deletes0091 =lxFinancingSubId.stream().toArray(String[]::new);
|
||||
formson_0091.put("delete",deletes0091);
|
||||
formson_0091.put("empty",false);
|
||||
tableData.put("formson_0091",formson_0091);
|
||||
formData.put("tableData",tableData);
|
||||
JSONObject extend = new JSONObject();
|
||||
formData.put("extend",extend);
|
||||
jsonData.put("data",formData);
|
||||
patchData.put("data",jsonData);
|
||||
patchData.put("message","");
|
||||
|
||||
// String sss = "{\"code\":0,\"data\":{\"code\":\"2000\",\"data\":{\"tableData\":{\"formson_0091\":{\"update\":{\""+lxFinancingSubId.get(0)+"\":{\"field0193\":{\"showValue\":\"11\",\"showValue2\":\"11\",\"value\":\"11\"}}}}}},\"message\":\"the operation is success!!!\"},\"message\":\"\"}";
|
||||
|
||||
// JSONObject jsonnnn = JSON.parseObject(sss);
|
||||
|
||||
res.put("data",patchData);
|
||||
log.info(patchData.toString());
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -7,18 +7,20 @@ import com.seeyon.ctp.util.JDBCAgent;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class FinancingContractDaoImpl implements IFinancingContractDao {
|
||||
|
||||
// 本地
|
||||
// private String daleteFZFinancing = "delete from formmain_0097 WHERE field0002 = ?";
|
||||
// private String daleteFZFinancingSub = "delete from formson_0098 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0097 WHERE field0002 = ? )";
|
||||
private String 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 getLXFinancingSub = "select id from formson_0091 WHERE FORMMAIN_ID in (SELECT ID FROM formmain_0087 WHERE field0001 = ? )";
|
||||
// 测试
|
||||
// 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 = ? )";
|
||||
// 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 = ? )";
|
||||
|
||||
|
||||
|
||||
@@ -59,5 +61,30 @@ public class FinancingContractDaoImpl implements IFinancingContractDao {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getLXFinancingSubId(String contractCode) throws BusinessException, SQLException {
|
||||
List<String> lists = new ArrayList<String>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(getLXFinancingSub);
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(contractCode);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
if (list != null && list.size() > 0) {
|
||||
for(int i = 0 ; i < list.size() ; i++) {
|
||||
Map map = list.get(i);
|
||||
Object object = map.get("id");
|
||||
lists.add(object.toString());
|
||||
}
|
||||
}
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return lists;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -26,6 +26,13 @@ public interface IFinancingContractDao {
|
||||
*/
|
||||
public int daleteFZFinancingSub(String contractCode) throws BusinessException, SQLException;
|
||||
|
||||
|
||||
/**
|
||||
* 查询融资合同档案中利息明细信息
|
||||
* @param contractCode
|
||||
* @return
|
||||
* @throws SQLException
|
||||
* @throws BusinessException
|
||||
*/
|
||||
public List<String> getLXFinancingSubId(String contractCode) throws BusinessException, SQLException;
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,9 @@ public class InterestCalculationUtil {
|
||||
start.getTime().getTime()<maxDate.getTime().getTime();
|
||||
start.add(Calendar.MONTH, cycleNum)){
|
||||
cycleDates.add(start.getTime());
|
||||
System.out.println(sdf.format(start.getTime()));
|
||||
}
|
||||
System.out.println(sdf.format(maxDate.getTime()));
|
||||
cycleDates.add(maxDate.getTime());
|
||||
return cycleDates;
|
||||
}
|
||||
@@ -46,17 +48,14 @@ public class InterestCalculationUtil {
|
||||
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();
|
||||
lxstartDate = cycleDates.get(i-1);
|
||||
lxendDate = cycleDates.get(i);
|
||||
}else{
|
||||
|
||||
}
|
||||
// 计算利息
|
||||
// double countInterest = countInterestGovernment(lxstartDate,lxendDate,moneyList,interestRateList,principalList);
|
||||
double days = ((lxendDate.getTime()-lxstartDate.getTime())/1000/60/60/24)+1;
|
||||
double days = (lxendDate.getTime()-lxstartDate.getTime())/1000/60/60/24;
|
||||
double countInterest = credit*days*interestRate/100/360;
|
||||
map.put("计划还款金额",countInterest+"");
|
||||
// 利息还款编号
|
||||
@@ -91,10 +90,7 @@ public class InterestCalculationUtil {
|
||||
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();
|
||||
lxstartDate = cycleDates.get(i-1);
|
||||
lxendDate = cycleDates.get(i);
|
||||
}
|
||||
// 返回值设置:计划利息还款明细编号,还款费项类型(枚举),计划还款日期,计划还款金额,备注
|
||||
@@ -138,15 +134,11 @@ public class InterestCalculationUtil {
|
||||
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();
|
||||
lxstartDate = cycleDates.get(i-1);
|
||||
lxendDate = cycleDates.get(i);
|
||||
}
|
||||
// 返回值设置:计划利息还款明细编号,还款费项类型(枚举),计划还款日期,计划还款金额,备注
|
||||
// 计算利息
|
||||
System.out.println(sdf.format(lxstartDate)+":"+sdf.format(lxendDate));
|
||||
double countInterest = countInterest(lxstartDate,lxendDate,moneyList,interestRateList,principalList);
|
||||
map.put("计划还款金额",countInterest+"");
|
||||
// 利息还款编号
|
||||
@@ -331,14 +323,13 @@ public class InterestCalculationUtil {
|
||||
// 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;
|
||||
long days1 = ((end1.getTime()-startDate.getTime())/1000/60/60/24);
|
||||
System.out.println("1历史利息"+lxnum+"开始金额"+startNum+"本次计算天数"+days1+"利率"+startll+"本次利息"+startNum*days1*startll/100/360);
|
||||
lxnum =lxnum+(startNum*days1*startll/100/360);
|
||||
startDate = end1;
|
||||
@@ -438,14 +429,13 @@ public class InterestCalculationUtil {
|
||||
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;
|
||||
long days1 = ((end1.getTime()-startDate.getTime())/1000/60/60/24);
|
||||
lixi =money*days1*interestRate/100/360;
|
||||
startDate = end1;
|
||||
lixis.add(lixi);
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.seeyon.apps.src_ydctleasebill;
|
||||
|
||||
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 YdctLeaseBillPluginApi extends APluginInfoApi {
|
||||
public YdctLeaseBillPluginApi() {
|
||||
}
|
||||
|
||||
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,30 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.constant;
|
||||
|
||||
public enum YdctLeaseBillConstant {
|
||||
|
||||
|
||||
plugin("src_ydctleasebill","插件ID"),
|
||||
loginName("demo2","辅助表创建人");
|
||||
// u8cUrl("http://ip:port", "U8C地址"),
|
||||
|
||||
YdctLeaseBillConstant(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,214 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.controller;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_financing.util.InterestCalculationUtil;
|
||||
import com.seeyon.apps.src_ydctleasebill.constant.YdctLeaseBillConstant;
|
||||
import com.seeyon.apps.src_ydctleasebill.dao.ILeaseBillDao;
|
||||
import com.seeyon.apps.src_ydctleasebill.util.DateUtil;
|
||||
import com.seeyon.apps.src_ydctleasebill.util.FormExportUtil;
|
||||
import com.seeyon.apps.src_ydctleasebill.util.LeaseBillUtil;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.controller.BaseController;
|
||||
import com.seeyon.ctp.util.json.JSONUtil;
|
||||
import com.seeyon.v3x.services.form.FormFactory;
|
||||
import com.seeyon.v3x.services.form.bean.FormExport;
|
||||
import com.seeyon.v3x.services.form.bean.SubordinateFormExport;
|
||||
import com.seeyon.v3x.services.form.bean.ValueExport;
|
||||
import nc.vo.jcom.lang.StringUtil;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class YdctLeaseBillController extends BaseController {
|
||||
|
||||
private static Log log = Log.get(YdctLeaseBillController.class);
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
private FormFactory formFactory;
|
||||
|
||||
public FormFactory getFormFactory() {
|
||||
if (formFactory == null) {
|
||||
formFactory = (FormFactory) AppContext.getBean("formFactory");
|
||||
}
|
||||
return formFactory;
|
||||
}
|
||||
|
||||
public void setFormFactory(FormFactory formFactory) {
|
||||
this.formFactory = formFactory;
|
||||
}
|
||||
|
||||
|
||||
private ILeaseBillDao leaseBillDao;
|
||||
|
||||
public void setLeaseBillDao(ILeaseBillDao leaseBillDao) {
|
||||
this.leaseBillDao = leaseBillDao;
|
||||
}
|
||||
public ILeaseBillDao getLeaseBillDao() {
|
||||
if (leaseBillDao == null) {
|
||||
leaseBillDao = (ILeaseBillDao) AppContext.getBean("leaseBillDao");
|
||||
}
|
||||
return leaseBillDao;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
log.info("进入ajax方法");
|
||||
ConfigVo configVo = getYdctLeaseBillConfig();
|
||||
DateUtil dateUtil = new DateUtil();
|
||||
LeaseBillUtil leaseBillUtil = new LeaseBillUtil();
|
||||
FormExportUtil formExportUtil = new FormExportUtil();
|
||||
// 设置返回值对象
|
||||
Map<String, Object> res = new HashMap<>();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmsssss");
|
||||
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]);
|
||||
}else{
|
||||
if(params[0].equals("bdid")){
|
||||
jsonObject.put("bdid","0");
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
String bdidValue = jsonObject.getString("bdid");
|
||||
log.info("当前账单编号为:"+bdidValue);
|
||||
if("0".equals(bdidValue)){
|
||||
Date formDate = new Date();
|
||||
String formId = simpleDateFormat.format(formDate);
|
||||
// 账单编号
|
||||
bdidValue = formId;
|
||||
// formDataVo.getNewFieldDataMap().put("账单编号", formId);
|
||||
}else {
|
||||
List<String> ids = leaseBillDao.leaseBillByCode(bdidValue);
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
// 删除明细账单
|
||||
leaseBillDao.deleteBillsByBillId(ids.get(i));
|
||||
// 删除主表数据
|
||||
leaseBillDao.deleteBillById(ids.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
String code = bdidValue;
|
||||
// 开始日期
|
||||
String startDateStr = jsonObject.getString("startDate");
|
||||
Date startDate = sdf.parse(startDateStr);
|
||||
// 结束日期
|
||||
String endDateStr = jsonObject.getString("endDate");
|
||||
Date endDate = sdf.parse(endDateStr);
|
||||
// 设置面积
|
||||
String jifeifs = jsonObject.getString("jifeifs");
|
||||
// 设置合同开始日期
|
||||
Calendar startTime = Calendar.getInstance();
|
||||
startTime.setTime(startDate);
|
||||
// 判断合同开始时间是否为月底
|
||||
boolean isMaxDay = false;
|
||||
int currentDay = startTime.get(Calendar.DAY_OF_MONTH);
|
||||
int maxDay = startTime.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
if(currentDay==maxDay){
|
||||
isMaxDay = true;
|
||||
}
|
||||
// 设置合同结束日期
|
||||
Calendar endTime = Calendar.getInstance();
|
||||
endTime.setTime(endDate);
|
||||
endTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||
|
||||
// 根据缴费方式设置开始结束时间
|
||||
String jiaofeifs = jsonObject.getString("jiaofeifs");
|
||||
int jfzqNum = dateUtil.getCycleNum(jiaofeifs);
|
||||
|
||||
FormExport formExport = new FormExport();
|
||||
// 租金
|
||||
List<Map<String,String>> rents = new ArrayList<Map<String,String>>();
|
||||
if(jfzqNum==12){
|
||||
String njiaofeifs = jsonObject.getString("njiaofeifs");
|
||||
if(StringUtil.isEmpty(njiaofeifs)){
|
||||
res.put("success", true);
|
||||
res.put("name", AppContext.currentUserLoginName());
|
||||
res.put("s", "请选择年缴费计算方式");
|
||||
res.put("num", "");
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}else{
|
||||
if(njiaofeifs.contains("一")){
|
||||
// 采用方式一
|
||||
rents = leaseBillUtil.getLeaseBillYers1(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
||||
}else if(njiaofeifs.contains("二")){
|
||||
// 采用方式二
|
||||
rents = leaseBillUtil.getLeaseBillYers2(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// 根据标准方法生成
|
||||
rents = leaseBillUtil.getLeaseBill(startTime,endTime,isMaxDay,jfzqNum,jsonObject,jifeifs);
|
||||
}
|
||||
log.info("创建档案");
|
||||
List<SubordinateFormExport> subordinateFormExports = formExportUtil.setSubordinateFormValue(rents);
|
||||
Map<String , String > billMap = new HashMap<String, String>();
|
||||
billMap.put("账单编号", code);
|
||||
List<ValueExport> valueExports = formExportUtil.setFormValue(billMap);
|
||||
formExport.setSubordinateForms(subordinateFormExports);
|
||||
formExport.setValues(valueExports);
|
||||
String loginName = configVo.getParamVal(YdctLeaseBillConstant.loginName.name());
|
||||
getFormFactory().importBusinessFormData(loginName, "ZJZDMX",
|
||||
formExport, new String[] {});
|
||||
res.put("success", true);
|
||||
res.put("name", AppContext.currentUserLoginName());
|
||||
res.put("s", "");
|
||||
res.put("num", code);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
render(response, JSONUtil.toJSONString(res));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 给前台渲染json数据
|
||||
* @param response
|
||||
* @param text
|
||||
*/
|
||||
private void render(HttpServletResponse response, String text) {
|
||||
response.setContentType("application/json;charset=UTF-8");
|
||||
try {
|
||||
response.setContentLength(text.getBytes("UTF-8").length);
|
||||
response.getWriter().write(text);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public ConfigVo getYdctLeaseBillConfig() {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
return YdctLeaseBillConstant.getPluginId();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.dao;
|
||||
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
public interface ILeaseBillDao {
|
||||
|
||||
// 查询账单底表id
|
||||
public List<String> leaseBillByCode(String code) throws BusinessException, SQLException;
|
||||
|
||||
// 删除账单底表
|
||||
public int deleteBillById(String id) throws BusinessException, SQLException;
|
||||
|
||||
// 删除账单明细表
|
||||
public int deleteBillsByBillId(String formmainId) throws BusinessException, SQLException;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.dao.impl;
|
||||
|
||||
import com.seeyon.apps.src_ydctleasebill.dao.ILeaseBillDao;
|
||||
import com.seeyon.ctp.common.exceptions.BusinessException;
|
||||
import com.seeyon.ctp.util.JDBCAgent;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class LeaseBillDaoImpl implements ILeaseBillDao {
|
||||
//本地
|
||||
private String leaseBillByCode = "SELECT id FROM formmain_0129 WHERE field0001 = ? ";
|
||||
private String deleteBillById = "delete from formmain_0129 where id=?";
|
||||
private String deleteBillsByBillId = "delete from formson_0130 where formmain_id=?";
|
||||
// 正式
|
||||
// private String leaseBillByCode = "SELECT id FROM formmain_1062 WHERE field0004 = ? ";
|
||||
// private String deleteBillById = "delete from formmain_1062 where id=?";
|
||||
// private String deleteBillsByBillId = "delete from formson_1182 where formmain_id=?";
|
||||
|
||||
|
||||
@Override
|
||||
public List<String> leaseBillByCode(String code) throws BusinessException, SQLException {
|
||||
List<String> lists = new ArrayList<String>();
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(leaseBillByCode);
|
||||
// StringBuilder sql = new StringBuilder("SELECT id FROM formmain_0536 WHERE field0013 = ? ");
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(code);
|
||||
agent.execute(sql.toString(), p);
|
||||
List<Map> list = agent.resultSetToList();
|
||||
if (list != null && list.size() > 0) {
|
||||
for(int i = 0 ; i < list.size() ; i++) {
|
||||
Map map = list.get(i);
|
||||
Object object = map.get("id");
|
||||
lists.add(object.toString());
|
||||
}
|
||||
}
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return lists;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteBillById(String id) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(deleteBillById);
|
||||
// StringBuilder sql = new StringBuilder("delete from formmain_0536 where id=?");
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(id);
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteBillsByBillId(String formmainId) throws BusinessException, SQLException {
|
||||
int i = 0 ;
|
||||
JDBCAgent agent = new JDBCAgent();
|
||||
try {
|
||||
StringBuilder sql = new StringBuilder(deleteBillsByBillId);
|
||||
// StringBuilder sql = new StringBuilder("delete from formson_0538 where formmain_id=?");
|
||||
List<Object> p = new ArrayList<Object>();
|
||||
p.add(formmainId);
|
||||
i=agent.execute(sql.toString(), p);
|
||||
}finally {
|
||||
if (agent != null) {
|
||||
agent.close();
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.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 YdctLeaseBillFieldCtrl extends FormFieldCustomCtrl {
|
||||
|
||||
/**
|
||||
* UUIDLong.longUUID()
|
||||
* UUIDUtil.getUUIDString()
|
||||
*/
|
||||
public String getKey() {
|
||||
return "5209586381190735608";
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(UUIDUtil.getUUIDLong());
|
||||
}
|
||||
|
||||
public String getFieldLength() {
|
||||
return "20";
|
||||
}
|
||||
|
||||
/**
|
||||
* 控件初始化接口,此接口在控件初始化的时候,会调用,主要用于定义控件所属插件id、在表单编辑器中的图标、表单编辑器中有哪些属性可以设置。
|
||||
* 使用举例:在接口中定义自定义控件在在表单编辑器中有哪些控件属性需要配置
|
||||
*/
|
||||
public void init() {
|
||||
setPluginId("ydctLeaseBill");
|
||||
setIcon("cap-icon-interestMeasurement");
|
||||
// 自定义参数
|
||||
ParamDefinition templateIdParam = new ParamDefinition();
|
||||
templateIdParam.setParamType(ParamType.button);
|
||||
addDefinition(templateIdParam);
|
||||
}
|
||||
|
||||
/** (non-Javadoc)
|
||||
* @see FormFieldCustomCtrl#getPCInjectionInfo()
|
||||
* PC端的资源文件路径
|
||||
*/
|
||||
public String getPCInjectionInfo() {
|
||||
return "{path:'apps_res/cap/customCtrlResources/ydctLeaseBillResources/',jsUri:'js/openUnflow.js',initMethod:'init',nameSpace:'field_" + getKey() + "'}";
|
||||
}
|
||||
|
||||
/** (non-Javadoc)
|
||||
* @see FormFieldCustomCtrl#getMBInjectionInfo()
|
||||
* 移动端的资源地址
|
||||
*/
|
||||
public String getMBInjectionInfo() {
|
||||
return "{path:'http://newwidget.v5.cmp/v1.0.0/',weixinpath:'newwidget',jsUri:'js/newwidget.js',initMethod:'init',nameSpace:'field_" + this.getKey() + "'}";
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return "租金计算按钮";
|
||||
}
|
||||
|
||||
public boolean canBathUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<String[]> getListShowDefaultVal(Integer externalType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始值生成接口
|
||||
*/
|
||||
public String[] getDefaultVal(String defaultValue) {
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
public boolean canInjectionWord() {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class DateUtil {
|
||||
|
||||
// 查询两个时间相差多少月
|
||||
public int betweenMonthByTwoCalendar(Calendar startCalendar,Calendar endCalendar) {
|
||||
if(startCalendar.after(endCalendar)){
|
||||
Calendar temp = startCalendar;
|
||||
startCalendar = endCalendar;
|
||||
endCalendar = temp;
|
||||
}
|
||||
// int startYear = startCalendar.get(Calendar.YEAR);
|
||||
// int endYear = endCalendar.get(Calendar.YEAR);
|
||||
// int startMonth = startCalendar.get(Calendar.MONTH);
|
||||
// int endMonth = endCalendar.get(Calendar.MONTH);
|
||||
// int monthNum = (endYear - startYear)*12+(endMonth-startMonth);
|
||||
// return monthNum;
|
||||
|
||||
int yearsDiff = endCalendar.get(Calendar.YEAR) - startCalendar.get(Calendar.YEAR);
|
||||
int monthsDiff = yearsDiff * 12 + endCalendar.get(Calendar.MONTH)- startCalendar.get(Calendar.MONTH);
|
||||
if (endCalendar.get(Calendar.DAY_OF_MONTH) > startCalendar.get(Calendar.DAY_OF_MONTH)) {
|
||||
monthsDiff++;
|
||||
}
|
||||
return monthsDiff;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public String discrepancyDay(String str1,String str2) throws ParseException {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
// 将字符串转换成日期
|
||||
Date start = sdf.parse(str1);
|
||||
Date end = sdf.parse(str2);
|
||||
// Date end = new Date();
|
||||
Date d3 = null;
|
||||
if(start.getTime()-end.getTime()>0){
|
||||
d3 = start;
|
||||
start = end;
|
||||
end = d3;
|
||||
}
|
||||
Calendar c1 = Calendar.getInstance();
|
||||
|
||||
Calendar c2 = Calendar.getInstance();
|
||||
c1.setTime(start);
|
||||
c2.setTime(end);
|
||||
c2.add(c2.DATE,1);
|
||||
end = c2.getTime();
|
||||
// System.out.println(sdf.format( c2.getTime()));
|
||||
int year1 = c1.get(Calendar.YEAR);
|
||||
|
||||
int year2 = c2.get(Calendar.YEAR);
|
||||
|
||||
int month1 = c1.get(Calendar.MONTH);
|
||||
|
||||
int month2 = c2.get(Calendar.MONTH);
|
||||
|
||||
int day1 = c1.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
int day2 = c2.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
int yearInterval = year1 - year2;
|
||||
|
||||
if (month1 < month2 || month1 == month2 && day1 < day2)
|
||||
|
||||
yearInterval--;
|
||||
|
||||
int monthInterval = (month1 + 12) - month2;
|
||||
|
||||
if (day1 < day2)
|
||||
|
||||
monthInterval--;
|
||||
|
||||
monthInterval %= 12;
|
||||
|
||||
int monthsDiff = Math.abs(yearInterval * 12 + monthInterval);
|
||||
|
||||
|
||||
|
||||
int nian = monthsDiff/12;
|
||||
int yue = monthsDiff - (nian*12);
|
||||
c1.add(Calendar.YEAR, nian);
|
||||
if(day1==day2){
|
||||
c1.add(Calendar.MONTH, yue);
|
||||
}else {
|
||||
|
||||
c1.add(Calendar.MONTH, yue-1);
|
||||
if(yue-1<0) {
|
||||
nian--;
|
||||
yue=11;
|
||||
}else {
|
||||
yue -=1;
|
||||
}
|
||||
}
|
||||
// System.out.println(nian+"年");
|
||||
// System.out.println(yue+"月");
|
||||
Date dt1 = c1.getTime();
|
||||
long l = dt1.getTime() - end.getTime();
|
||||
long tian = l/-(24*60*60*1000);
|
||||
return nian+"-"+yue+"-"+tian;
|
||||
}
|
||||
|
||||
|
||||
public int getCycleNum (String cycle){
|
||||
int cycleNum = 1;
|
||||
if("月".equals(cycle)){
|
||||
cycleNum = 1;
|
||||
}else if("季".equals(cycle)){
|
||||
cycleNum = 3;
|
||||
}else if("半年".equals(cycle)){
|
||||
cycleNum = 6;
|
||||
}else if("年".equals(cycle)){
|
||||
cycleNum = 12;
|
||||
}else if("一次性".equals(cycle)){
|
||||
cycleNum = 99;
|
||||
}
|
||||
return cycleNum;
|
||||
}
|
||||
|
||||
public double stringToNum(String str){
|
||||
double i = 0 ;
|
||||
String[] strs = str.split(",");
|
||||
StringBuilder numString = new StringBuilder();
|
||||
for (String value: strs) {
|
||||
numString.append(value);
|
||||
}
|
||||
i = Double.parseDouble(numString.toString());
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.util;
|
||||
|
||||
import com.seeyon.v3x.services.form.bean.RecordExport;
|
||||
import com.seeyon.v3x.services.form.bean.SubordinateFormExport;
|
||||
import com.seeyon.v3x.services.form.bean.ValueExport;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
//创建无流程表单数据处理工具类
|
||||
public class FormExportUtil {
|
||||
|
||||
/**
|
||||
* 设置主表信息
|
||||
* @param map 设置主表字段。Map<主表显示名称,主表数据>
|
||||
* @return
|
||||
*/
|
||||
public List<ValueExport> setFormValue(Map<String, String> map){
|
||||
// 创建返回值对象
|
||||
List<ValueExport> valueExports = new ArrayList<ValueExport>();
|
||||
ValueExport valueExport ;
|
||||
// 获取参数信息(显示名称)
|
||||
Set<String> keys = map.keySet();
|
||||
if(keys.size()>0) {
|
||||
// 对控件赋值
|
||||
for (String key : keys) {
|
||||
valueExport = new ValueExport();
|
||||
valueExport.setDisplayName(key);
|
||||
valueExport.setValue(map.get(key));
|
||||
valueExports.add(valueExport);
|
||||
}
|
||||
}
|
||||
return valueExports;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置从表信息
|
||||
* @param map 设置主表字段。List<Map<显示名称,数据值>>
|
||||
*/
|
||||
public List<SubordinateFormExport> setSubordinateFormValue(List<Map<String, String>> lists){
|
||||
List<SubordinateFormExport> subordinateFormExports = new ArrayList<SubordinateFormExport>();
|
||||
SubordinateFormExport subordinateFormExport = new SubordinateFormExport();
|
||||
List<RecordExport> recordExports = new ArrayList<RecordExport>();
|
||||
List<ValueExport> valueExports;
|
||||
RecordExport recordExport;
|
||||
for(int i = 0 ; i < lists.size() ; i++) {
|
||||
recordExport = new RecordExport();
|
||||
valueExports = setFormValue(lists.get(i));
|
||||
recordExport.setRecord(valueExports);
|
||||
recordExports.add(recordExport);
|
||||
}
|
||||
subordinateFormExport.setValues(recordExports);
|
||||
subordinateFormExports.add(subordinateFormExport);
|
||||
|
||||
return subordinateFormExports;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
package com.seeyon.apps.src_ydctleasebill.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class LeaseBillUtil {
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
/**
|
||||
* 生成租金账单
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param isMaxDay 是否每月最后一天
|
||||
* @param jfzqNum 缴费周期月
|
||||
* @param jsonObject 请求参数
|
||||
* @param jifeifs 计费方式
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,String>> getLeaseBill(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum,
|
||||
JSONObject jsonObject,String jifeifs){
|
||||
List<Map<String,String>> rents = new ArrayList<>();
|
||||
DateUtil dateUtil = new DateUtil();
|
||||
// 两个日期相差多少月
|
||||
int monthNum = dateUtil.betweenMonthByTwoCalendar(startTime,endTime);
|
||||
if(jfzqNum==99){
|
||||
// 一次性账单生成
|
||||
Map<String,String> rent = new HashMap<>();
|
||||
float zlmjFloat = 0;
|
||||
double zf = 0;
|
||||
if("面积计费".equals(jifeifs)){
|
||||
String mjStr = jsonObject.getString("mj");
|
||||
zlmjFloat = Float.parseFloat(mjStr);
|
||||
String mjzjStr = jsonObject.getString("mjzj");
|
||||
double mjzj = dateUtil.stringToNum(mjzjStr);
|
||||
zf = mjzj*zlmjFloat;
|
||||
}else if ("固定租金".equals(jifeifs)){
|
||||
zlmjFloat = 1;
|
||||
String gdzjStr = jsonObject.getString("gdzj");
|
||||
double gdzj = dateUtil.stringToNum(gdzjStr);
|
||||
zf = gdzj*zlmjFloat;
|
||||
}
|
||||
rent.put("开始日期",sdf.format(startTime.getTime()));
|
||||
endTime.add(Calendar.DATE, -1);
|
||||
rent.put("结束日期",sdf.format(endTime.getTime()));
|
||||
rent.put("租费",zf+"");
|
||||
rents.add(rent);
|
||||
}else{
|
||||
// 月,季,半年,账单生成
|
||||
int termNum = monthNum/jfzqNum;
|
||||
int mo = monthNum%jfzqNum;
|
||||
if(mo!=0){
|
||||
termNum++;
|
||||
}
|
||||
float zlmjFloat = 0;
|
||||
double zf = 0;
|
||||
if("面积计费".equals(jifeifs)){
|
||||
String mjStr = jsonObject.getString("mj");
|
||||
zlmjFloat = Float.parseFloat(mjStr);
|
||||
String mjzjStr = jsonObject.getString("mjzj");
|
||||
double mjzj = dateUtil.stringToNum(mjzjStr);
|
||||
zf = mjzj*zlmjFloat;
|
||||
}else if ("固定租金".equals(jifeifs)){
|
||||
zlmjFloat = 1;
|
||||
String gdzjStr = jsonObject.getString("gdzj");
|
||||
double gdzj = dateUtil.stringToNum(gdzjStr);
|
||||
zf = gdzj*zlmjFloat;
|
||||
}
|
||||
for(int i = 0 ; i < termNum ; i ++) {
|
||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||
Map<String, String> rentMap = new HashMap<String, String>();
|
||||
// 设置租费时间
|
||||
rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
||||
if (!isMaxDay) {
|
||||
startTime.add(Calendar.MONTH, jfzqNum);
|
||||
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
}else{
|
||||
startTime.add(Calendar.MONTH, jfzqNum);
|
||||
startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH)-1);
|
||||
}
|
||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||
// rentMap.put("期间月数-租金",jfzqNum+"");
|
||||
rentMap.put("租费", (zf * jfzqNum) + "");
|
||||
rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
||||
} else {
|
||||
//两个日期相差多少月
|
||||
int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(startTime, endTime);
|
||||
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
||||
}
|
||||
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||
if (isMaxDay) {
|
||||
startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
}
|
||||
rents.add(rentMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rents;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成租金账单
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param isMaxDay 是否每月最后一天
|
||||
* @param jfzqNum 缴费周期月
|
||||
* @param jsonObject 请求参数
|
||||
* @param jifeifs 计费方式
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,String>> getLeaseBillYers1(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum,
|
||||
JSONObject jsonObject,String jifeifs){
|
||||
List<Map<String,String>> rents = new ArrayList<>();
|
||||
DateUtil dateUtil = new DateUtil();
|
||||
// 两个日期相差多少月
|
||||
int monthNum = dateUtil.betweenMonthByTwoCalendar(startTime,endTime);
|
||||
int termNum = monthNum/jfzqNum;
|
||||
int mo = monthNum%jfzqNum;
|
||||
if(mo!=0){
|
||||
termNum++;
|
||||
}
|
||||
float zlmjFloat = 0;
|
||||
double zf = 0;
|
||||
if("面积计费".equals(jifeifs)){
|
||||
String mjStr = jsonObject.getString("mj");
|
||||
zlmjFloat = Float.parseFloat(mjStr);
|
||||
String mjzjStr = jsonObject.getString("mjzj");
|
||||
double mjzj = dateUtil.stringToNum(mjzjStr);
|
||||
zf = mjzj*zlmjFloat;
|
||||
}else if ("固定租金".equals(jifeifs)){
|
||||
zlmjFloat = 1;
|
||||
String gdzjStr = jsonObject.getString("gdzj");
|
||||
double gdzj = dateUtil.stringToNum(gdzjStr);
|
||||
zf = gdzj*zlmjFloat;
|
||||
}
|
||||
for(int i = 0 ; i < termNum ; i ++) {
|
||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||
Map<String, String> rentMap = new HashMap<String, String>();
|
||||
// 设置租费时间
|
||||
rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
||||
startTime.add(Calendar.MONTH, jfzqNum);
|
||||
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||
// rentMap.put("期间月数-租金",jfzqNum+"");
|
||||
rentMap.put("租费", (zf * jfzqNum) + "");
|
||||
rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
||||
} else {
|
||||
//两个日期相差多少月
|
||||
int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(startTime, endTime);
|
||||
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
||||
}
|
||||
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||
if (isMaxDay) {
|
||||
startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
}
|
||||
rents.add(rentMap);
|
||||
}
|
||||
}
|
||||
return rents;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成租金账单
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param isMaxDay 是否每月最后一天
|
||||
* @param jfzqNum 缴费周期月
|
||||
* @param jsonObject 请求参数
|
||||
* @param jifeifs 计费方式
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,String>> getLeaseBillYers2(Calendar startTime, Calendar endTime, boolean isMaxDay, int jfzqNum,
|
||||
JSONObject jsonObject,String jifeifs){
|
||||
List<Map<String,String>> rents = new ArrayList<>();
|
||||
DateUtil dateUtil = new DateUtil();
|
||||
// 两个日期相差多少年
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(startTime.getTime());
|
||||
int starYear = startTime.get(Calendar.YEAR);
|
||||
int endYear = endTime.get(Calendar.YEAR);
|
||||
int termNum = endYear-starYear+1;
|
||||
float zlmjFloat = 0;
|
||||
double zf = 0;
|
||||
if("面积计费".equals(jifeifs)){
|
||||
String mjStr = jsonObject.getString("mj");
|
||||
zlmjFloat = Float.parseFloat(mjStr);
|
||||
String mjzjStr = jsonObject.getString("mjzj");
|
||||
double mjzj = dateUtil.stringToNum(mjzjStr);
|
||||
zf = mjzj*zlmjFloat;
|
||||
}else if ("固定租金".equals(jifeifs)){
|
||||
zlmjFloat = 1;
|
||||
String gdzjStr = jsonObject.getString("gdzj");
|
||||
double gdzj = dateUtil.stringToNum(gdzjStr);
|
||||
zf = gdzj*zlmjFloat;
|
||||
}
|
||||
|
||||
for(int i = 0 ; i < termNum ; i ++) {
|
||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||
Map<String, String> rentMap = new HashMap<String, String>();
|
||||
// 设置租费时间
|
||||
rentMap.put("开始日期", sdf.format(startTime.getTime()));
|
||||
startTime.set(Calendar.MONTH, 11);
|
||||
startTime.set(Calendar.DATE, 31);
|
||||
if (startTime.getTime().getTime() < endTime.getTime().getTime()) {
|
||||
// rentMap.put("期间月数-租金",jfzqNum+"");
|
||||
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||
int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(calendar, startTime);
|
||||
startTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
rentMap.put("结束日期", sdf.format(startTime.getTime()));
|
||||
calendar.set(Calendar.MONTH, 11);
|
||||
calendar.set(Calendar.DATE, 31);
|
||||
} else {
|
||||
//两个日期相差多少月
|
||||
int qijianyueshu = dateUtil.betweenMonthByTwoCalendar(calendar, endTime);
|
||||
// rentMap.put("期间月数-租金",qijianyueshu+"");
|
||||
rentMap.put("租费", (zf * qijianyueshu) + "");
|
||||
endTime.add(Calendar.DAY_OF_MONTH, -1);
|
||||
rentMap.put("结束日期", sdf.format(endTime.getTime()));
|
||||
}
|
||||
startTime.add(Calendar.DAY_OF_MONTH, 1);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||
if (isMaxDay) {
|
||||
startTime.set(Calendar.DAY_OF_MONTH, startTime.getActualMaximum(Calendar.DAY_OF_MONTH));
|
||||
}
|
||||
rents.add(rentMap);
|
||||
}
|
||||
}
|
||||
return rents;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.seeyon.apps.ydctu8c;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
@@ -15,8 +16,11 @@ 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;
|
||||
//import org.apache.commons.logging.Log;
|
||||
//import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 功能描述:<br>
|
||||
@@ -29,8 +33,8 @@ import org.apache.commons.logging.LogFactory;
|
||||
*/
|
||||
public abstract class U8CCommonNode extends ACommonSuperNode {
|
||||
|
||||
private static Log log = LogFactory.getLog(U8CCommonNode.class);
|
||||
|
||||
// private static Log log = LogFactory.getLog(U8CCommonNode.class);
|
||||
private static Log log = Log.get(U8CCommonNode.class);
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Override
|
||||
@@ -52,15 +56,22 @@ public abstract class U8CCommonNode extends ACommonSuperNode {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
protected FormDataApi4Cap4 formDataApi4Cap4;
|
||||
|
||||
public void setFormDataApi4Cap4(FormDataApi4Cap4 formDataApi4Cap4) {
|
||||
this.formDataApi4Cap4 = formDataApi4Cap4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SuperNodeContext proceed(String request, FormDataVo formDataVo, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
SuperNodeContext context = new SuperNodeContext();
|
||||
System.out.println("开始处理单据"+getNodeId());
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
String param = paramUtil.param(request,getMethod(),formDataVo);
|
||||
Cap4ReturnUtil cap4ReturnUtil = new Cap4ReturnUtil();
|
||||
try {
|
||||
FieldDataVo fhjg = formDataVo.getFieldData("U8C返回结果");
|
||||
FieldDataVo fhjg = formDataVo.getFieldData("U8C-返回结果");
|
||||
String value = fhjg.getStringValue();
|
||||
if(value.startsWith("推送BIP成功")) {
|
||||
return context.success("跳过:" + value);
|
||||
@@ -86,22 +97,29 @@ public abstract class U8CCommonNode extends ACommonSuperNode {
|
||||
context.setResponse(response);
|
||||
U8cResponse u8cResponse = U8cHttpUtil.parseResponse(response);
|
||||
if(u8cResponse.isSuccess()) {
|
||||
cap4ReturnUtil.setParamReturn(getMethod(),u8cResponse,formDataVo);
|
||||
cap4ReturnUtil.setParamReturn(getMethod(),u8cResponse,formDataVo,getNodeId());
|
||||
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());
|
||||
if("DiaoBoYdctCollectionNode".equals(getNodeId())){
|
||||
formDataVo.getNewFieldDataMap().put("U8C-返回结果收", "推送U8C成功:" + u8cResponse.getStatus());
|
||||
}else if ("DiaoBoYdctPaymentNode".equals(getNodeId())){
|
||||
formDataVo.getNewFieldDataMap().put("U8C-返回结果付", "推送U8C成功:" + u8cResponse.getStatus());
|
||||
}else{
|
||||
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());
|
||||
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());
|
||||
formDataVo.getNewFieldDataMap().put("U8C-返回结果", "推送U8C失败:OA处理异常" + e.getMessage());
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.seeyon.apps.ydctu8c.aop;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.cap4.form.api.FormApi4Cap4;
|
||||
import com.seeyon.cap4.form.bean.FormBean;
|
||||
import com.seeyon.cap4.form.bean.FormFieldBean;
|
||||
@@ -11,8 +12,8 @@ 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.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;
|
||||
@@ -47,7 +48,8 @@ public class BpmProcessAop {
|
||||
@Inject
|
||||
private OrgManager orgManager;
|
||||
|
||||
private static final Log log = LogFactory.getLog(BpmProcessAop.class);
|
||||
private static final Log log = Log.get(BpmProcessAop.class);
|
||||
|
||||
|
||||
@Pointcut("execution(public * com.seeyon.apps.collaboration.manager.CollaborationBPMHandlerImpl.transPreStartProcess(..))")
|
||||
private void dealParam() {
|
||||
|
||||
@@ -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 CaiLiaocaigouYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "CaiLiaocaigouYdctPaymentNode";
|
||||
}
|
||||
|
||||
@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 ChaiLvbaoxiaoYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ChaiLvbaoxiaoYdctPaymentNode";
|
||||
}
|
||||
|
||||
@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 DiaoBoYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/sj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "DiaoBoYdctCollectionNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT资金调拨推送U8C收款结算单";
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class ZijinYdctTransferNode extends U8CCommonNode {
|
||||
public class DiaoBoYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
@@ -20,11 +20,11 @@ public class ZijinYdctTransferNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ZijinYdctTransferNode";
|
||||
return "DiaoBoYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT内部资金划拨推送U8C付款结算单";
|
||||
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 DiaoBoYdctRemittanceNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/hj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "DiaoBoYdctRemittanceNode";
|
||||
}
|
||||
|
||||
@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 ExamineYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/sj/audit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ExamineYdctCollectionNode";
|
||||
}
|
||||
|
||||
@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 ExamineYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/audit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ExamineYdctPaymentNode";
|
||||
}
|
||||
|
||||
@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 FeiYongbaoxiaoYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "FeiYongbaoxiaoYdctPaymentNode";
|
||||
}
|
||||
|
||||
@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 GongHuibaoxiaoYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "GongHuibaoxiaoYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT工会报销推送U8C付款结算单";
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class TongYongYdctFenZhangNode extends U8CCommonNode {
|
||||
public class HeTongfukuanYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
@@ -20,11 +20,11 @@ public class TongYongYdctFenZhangNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "TongYongYdctFenZhangNode";
|
||||
return "HeTongfukuanYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT通用分账审批推送U8C付款结算单";
|
||||
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 HeTongshoukuanYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/sj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "HeTongshoukuanYdctCollectionNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT合同收款推送U8C收款结算单";
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class TongYongYdctPaymentNode extends U8CCommonNode {
|
||||
public class JieZhiYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
@@ -20,11 +20,11 @@ public class TongYongYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "TongYongYdctPaymentNode";
|
||||
return "JiezhiYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT通用支付审批推送U8C付款结算单";
|
||||
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 RongZihuankuanYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "RongZihuankuanYdctPaymentNode";
|
||||
}
|
||||
|
||||
@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 RongZijiekuanYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/sj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "RongZijiekuanYdctCollectionNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT融资借款推送U8C收款结算单";
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class ContractYdctCollectionNode extends U8CCommonNode {
|
||||
public class ShouKuanYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
@@ -20,11 +20,11 @@ public class ContractYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ContractYdctCollectionNode";
|
||||
return "ShouKuanYdctCollectionNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT合同收款审批推送U8C收款结算单";
|
||||
return "YDCT财务收款登记推送U8C收款结算单";
|
||||
}
|
||||
}
|
||||
@@ -11,20 +11,20 @@ import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class ChaiLvYdctExpensePaymentNode extends U8CCommonNode {
|
||||
public class TingCheshoukanYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
return "/u8cloud/api/cmp/sj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ChaiLvYdctExpensePaymentNode";
|
||||
return "TingCheshoukanYdctCollectionNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT差旅费用报销审批推送U8C付款结算单";
|
||||
return "YDCT华美停车场收款推送U8C收款结算单";
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
* @Author: HuangZhengguo
|
||||
* @Date: 2024/9/19
|
||||
*/
|
||||
public class XiangMuYdctPaymentNode extends U8CCommonNode {
|
||||
public class TongYongzhifuYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
@@ -20,11 +20,11 @@ public class XiangMuYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "XiangMuYdctPaymentNode";
|
||||
return "TongYongzhifuYdctPaymentNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT项目合同支付审批推送U8C付款结算单";
|
||||
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 XiangMubofuYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "XiangMubofuYdctPaymentNode";
|
||||
}
|
||||
|
||||
@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 XiangMuzhifuYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "XiangMuzhifudctPaymentNode";
|
||||
}
|
||||
|
||||
@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 ZiJindiaoboExamineYdctCollectionNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/sj/audit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ZiJindiaoboExamineYdctCollectionNode";
|
||||
}
|
||||
|
||||
@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 ZiJindiaoboExamineYdctPaymentNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/fj/audit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ZiJindiaoboExamineYdctPaymentNode";
|
||||
}
|
||||
|
||||
@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 ZiJindiaoboExamineYdctRemittanceNode extends U8CCommonNode {
|
||||
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/hj/audit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ZiJindiaoboExamineYdctRemittanceNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT资金调拨划账结算单审核推送U8C";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
public class ZuLinFuKuanYdctPaymentNode 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,20 @@
|
||||
package com.seeyon.apps.ydctu8c.cash.node;
|
||||
|
||||
import com.seeyon.apps.ydctu8c.U8CCommonNode;
|
||||
|
||||
public class ZuLinShouKuanYdctCollectionNode extends U8CCommonNode {
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "/u8cloud/api/cmp/sj/insert";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "ZuLinShouKuanYdctCollectionNode";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
return "YDCT租赁财务收款结算推送U8C收款结算单";
|
||||
}
|
||||
}
|
||||
@@ -3,27 +3,31 @@ 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;
|
||||
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 nc.vo.jcom.lang.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class Cap4ReturnUtil {
|
||||
|
||||
public void setParamReturn(String method, U8cResponse u8cResponse, FormDataVo formDataVo) throws BusinessException {
|
||||
public void setParamReturn(String method, U8cResponse u8cResponse, FormDataVo formDataVo,String nodeId) throws BusinessException, NoSuchFieldException {
|
||||
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"));
|
||||
formDataVo.getNewFieldDataMap().put("U8C-客商主键", parentvo.getString("pk_cubasdoc"));
|
||||
JSONArray banks = jsonObject.getJSONArray("BANK");
|
||||
// 银行id
|
||||
String bankIds = "";
|
||||
if(banks.size()>0){
|
||||
for(int i = 0 ; i < banks.size() ; i++){
|
||||
JSONObject bank = banks.getJSONObject(i);
|
||||
String bankNo = bank.getString("account");
|
||||
@@ -31,8 +35,212 @@ public class Cap4ReturnUtil {
|
||||
bankIds = bankIds+bankNo+":"+bankId+";";
|
||||
}
|
||||
bankIds = bankIds.substring(0,bankIds.length() - 1);
|
||||
formDataVo.getNewFieldDataMap().put("U8C返回客商银行对照", bankIds);
|
||||
formDataVo.getNewFieldDataMap().put("U8C-返回客商银行对照", bankIds);
|
||||
}
|
||||
}else if("/u8cloud/api/uapbd/custdoc/update".equals(method)){
|
||||
String data = u8cResponse.getData();
|
||||
JSONArray jsonArray = (JSONArray) JSON.parse(data);
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||
JSONArray banks = jsonObject.getJSONArray("BANK");
|
||||
// 银行id
|
||||
String bankIds = "";
|
||||
if(banks.size()>0){
|
||||
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);
|
||||
}
|
||||
}else if("/u8cloud/api/cmp/fj/insert".equals(method)){
|
||||
String data = u8cResponse.getData();
|
||||
JSONArray jsonArray = (JSONArray) JSON.parse(data);
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||
JSONObject parentvo = jsonObject.getJSONObject("parentvo");
|
||||
if("DiaoBoYdctPaymentNode".equals(nodeId)){
|
||||
formDataVo.getNewFieldDataMap().put("U8C-单据号付", parentvo.getString("djbh"));
|
||||
// 税金回写
|
||||
JSONArray childrenvos = jsonObject.getJSONArray("childrenvo");
|
||||
Map<String, List<FormDataVo>> subFormMap = formDataVo.getSubFormMap();
|
||||
List<FormDataVo> subFormDataVos = subFormMap.get("U8C-结算明细付");
|
||||
for(int i = 0 ; i < subFormDataVos.size() ; i++){
|
||||
FormDataVo subFormDataVo = subFormDataVos.get(i);
|
||||
FieldDataVo u8cSubNo = subFormDataVo.getFieldData("U8C-明细表编号付");
|
||||
String u8cSubNoValue = u8cSubNo.getStringValue();
|
||||
System.out.println("当前明细行编号为"+u8cSubNoValue);
|
||||
for(int n = 0 ; n < childrenvos.size() ; n++){
|
||||
JSONObject childrenvo = childrenvos.getJSONObject(n);
|
||||
String zyx20 = childrenvo.getString("zyx20");
|
||||
System.out.println(u8cSubNoValue.equals(zyx20)+":"+u8cSubNoValue+"="+zyx20);
|
||||
if(u8cSubNoValue.equals(zyx20)){
|
||||
String jfybsj = childrenvo.getString("jfybsj");
|
||||
String jfybwsje = childrenvo.getString("jfybwsje");
|
||||
System.out.println("jfybsj"+jfybsj);
|
||||
System.out.println("jfybwsje"+jfybwsje);
|
||||
double jfybsjd = 0;
|
||||
double jfybwsjed = 0;
|
||||
System.out.println(!StringUtil.isEmpty(jfybsj));
|
||||
if(!StringUtil.isEmpty(jfybsj)){
|
||||
jfybsjd = Double.parseDouble(jfybsj);
|
||||
}
|
||||
System.out.println(!StringUtil.isEmpty(jfybwsje));
|
||||
if(!StringUtil.isEmpty(jfybwsje)){
|
||||
jfybwsjed = Double.parseDouble(jfybwsje);
|
||||
}
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币税金付", jfybsjd);
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币无税金额付", jfybwsjed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// 单据号回写
|
||||
formDataVo.getNewFieldDataMap().put("U8C-单据号", parentvo.getString("djbh"));
|
||||
|
||||
JSONArray childrenvos = jsonObject.getJSONArray("childrenvo");
|
||||
if("TongYongzhifuYdctPaymentNode".equals(nodeId)){
|
||||
JSONObject childrenvo = childrenvos.getJSONObject(0);
|
||||
String jfybsj = childrenvo.getString("jfybsj");
|
||||
String jfybwsje = childrenvo.getString("jfybwsje");
|
||||
double jfybsjd = 0;
|
||||
double jfybwsjed = 0;
|
||||
System.out.println(!StringUtil.isEmpty(jfybsj));
|
||||
if(!StringUtil.isEmpty(jfybsj)){
|
||||
jfybsjd = Double.parseDouble(jfybsj);
|
||||
}
|
||||
System.out.println(!StringUtil.isEmpty(jfybwsje));
|
||||
if(!StringUtil.isEmpty(jfybwsje)){
|
||||
jfybwsjed = Double.parseDouble(jfybwsje);
|
||||
}
|
||||
formDataVo.getNewFieldDataMap().put("主表-U8C本币税金", jfybsjd);
|
||||
formDataVo.getNewFieldDataMap().put("主表-U8C本币无税金额", jfybwsjed);
|
||||
}else{
|
||||
// 税金回写
|
||||
Map<String, List<FormDataVo>> subFormMap = formDataVo.getSubFormMap();
|
||||
|
||||
for(Map.Entry<String, List<FormDataVo>> entry : subFormMap.entrySet()){
|
||||
String key = entry.getKey();
|
||||
boolean startsWith = key.startsWith("U8C-");
|
||||
if(startsWith){
|
||||
List<FormDataVo> subFormDataVos = entry.getValue();
|
||||
for(int i = 0 ; i < subFormDataVos.size() ; i++){
|
||||
FormDataVo subFormDataVo = subFormDataVos.get(i);
|
||||
FieldDataVo u8cSubNo = subFormDataVo.getFieldData("U8C-明细表编号");
|
||||
String u8cSubNoValue = u8cSubNo.getStringValue();
|
||||
System.out.println("当前明细行编号为"+u8cSubNoValue);
|
||||
for(int n = 0 ; n < childrenvos.size() ; n++){
|
||||
JSONObject childrenvo = childrenvos.getJSONObject(n);
|
||||
String zyx20 = childrenvo.getString("zyx20");
|
||||
System.out.println(u8cSubNoValue.equals(zyx20)+":"+u8cSubNoValue+"="+zyx20);
|
||||
if(u8cSubNoValue.equals(zyx20)){
|
||||
String jfybsj = childrenvo.getString("jfybsj");
|
||||
String jfybwsje = childrenvo.getString("jfybwsje");
|
||||
System.out.println("jfybsj"+jfybsj);
|
||||
System.out.println("jfybwsje"+jfybwsje);
|
||||
double jfybsjd = 0;
|
||||
double jfybwsjed = 0;
|
||||
System.out.println(!StringUtil.isEmpty(jfybsj));
|
||||
if(!StringUtil.isEmpty(jfybsj)){
|
||||
jfybsjd = Double.parseDouble(jfybsj);
|
||||
}
|
||||
System.out.println(!StringUtil.isEmpty(jfybwsje));
|
||||
if(!StringUtil.isEmpty(jfybwsje)){
|
||||
jfybwsjed = Double.parseDouble(jfybwsje);
|
||||
}
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币税金", jfybsjd);
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币无税金额", jfybwsjed);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if("/u8cloud/api/cmp/sj/insert".equals(method)){
|
||||
String data = u8cResponse.getData();
|
||||
JSONArray jsonArray = (JSONArray) JSON.parse(data);
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||
JSONObject parentvo = jsonObject.getJSONObject("parentvo");
|
||||
if("DiaoBoYdctCollectionNode".equals(nodeId)){
|
||||
formDataVo.getNewFieldDataMap().put("U8C-单据号收", parentvo.getString("djbh"));
|
||||
|
||||
Map<String, List<FormDataVo>> subFormMap = formDataVo.getSubFormMap();
|
||||
JSONArray childrenvos = jsonObject.getJSONArray("childrenvo");
|
||||
List<FormDataVo> subFormDataVos = subFormMap.get("U8C-结算明细收");
|
||||
for(int i = 0 ; i < subFormDataVos.size() ; i++){
|
||||
FormDataVo subFormDataVo = subFormDataVos.get(i);
|
||||
FieldDataVo u8cSubNo = subFormDataVo.getFieldData("U8C-明细表编号收");
|
||||
String u8cSubNoValue = u8cSubNo.getStringValue();
|
||||
System.out.println("当前明细行编号为"+u8cSubNoValue);
|
||||
for(int n = 0 ; n < childrenvos.size() ; n++){
|
||||
JSONObject childrenvo = childrenvos.getJSONObject(n);
|
||||
String zyx20 = childrenvo.getString("zyx20");
|
||||
System.out.println(u8cSubNoValue.equals(zyx20)+":"+u8cSubNoValue+"="+zyx20);
|
||||
if(u8cSubNoValue.equals(zyx20)){
|
||||
String dfybsj = childrenvo.getString("dfybsj");
|
||||
String dfybwsje = childrenvo.getString("dfybwsje");
|
||||
double dfybsjd = 0;
|
||||
double dfybwsjed = 0;
|
||||
if(!StringUtil.isEmpty(dfybsj)){
|
||||
dfybsjd = Double.parseDouble(dfybsj);
|
||||
}
|
||||
if(!StringUtil.isEmpty(dfybwsje)){
|
||||
dfybwsjed = Double.parseDouble(dfybwsje);
|
||||
}
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币税金收", dfybsjd);
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币无税金额收", dfybwsjed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// 单据号回写
|
||||
formDataVo.getNewFieldDataMap().put("U8C-单据号", parentvo.getString("djbh"));
|
||||
// 税金回写
|
||||
Map<String, List<FormDataVo>> subFormMap = formDataVo.getSubFormMap();
|
||||
JSONArray childrenvos = jsonObject.getJSONArray("childrenvo");
|
||||
for(Map.Entry<String, List<FormDataVo>> entry : subFormMap.entrySet()){
|
||||
String key = entry.getKey();
|
||||
boolean startsWith = key.startsWith("U8C-");
|
||||
if(startsWith){
|
||||
List<FormDataVo> subFormDataVos = entry.getValue();
|
||||
for(int i = 0 ; i < subFormDataVos.size() ; i++){
|
||||
FormDataVo subFormDataVo = subFormDataVos.get(i);
|
||||
FieldDataVo u8cSubNo = subFormDataVo.getFieldData("U8C-明细表编号");
|
||||
String u8cSubNoValue = u8cSubNo.getStringValue();
|
||||
System.out.println("当前明细行编号为"+u8cSubNoValue);
|
||||
for(int n = 0 ; n < childrenvos.size() ; n++){
|
||||
JSONObject childrenvo = childrenvos.getJSONObject(n);
|
||||
String zyx20 = childrenvo.getString("zyx20");
|
||||
System.out.println(u8cSubNoValue.equals(zyx20)+":"+u8cSubNoValue+"="+zyx20);
|
||||
if(u8cSubNoValue.equals(zyx20)){
|
||||
String dfybsj = childrenvo.getString("dfybsj");
|
||||
String dfybwsje = childrenvo.getString("dfybwsje");
|
||||
double dfybsjd = 0;
|
||||
double dfybwsjed = 0;
|
||||
if(!StringUtil.isEmpty(dfybsj)){
|
||||
dfybsjd = Double.parseDouble(dfybsj);
|
||||
}
|
||||
if(!StringUtil.isEmpty(dfybwsje)){
|
||||
dfybwsjed = Double.parseDouble(dfybwsje);
|
||||
}
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币税金", dfybsjd);
|
||||
subFormDataVo.getNewFieldDataMap().put("U8C-本币无税金额", dfybwsjed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if("/u8cloud/api/cmp/hj/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("U8C-单据号付", parentvo.getString("djbh"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.ext.workflow.vo.FieldDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ParamUtil {
|
||||
|
||||
public String param(String request, String method , FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
@@ -23,6 +26,9 @@ public class ParamUtil {
|
||||
case "/u8cloud/api/cmp/sj/insert":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/cmp/hj/insert":
|
||||
param = insertRemittanceParam(request,formDataVo);
|
||||
break;
|
||||
case "/u8cloud/api/arap/yf/insert":
|
||||
param = request;
|
||||
break;
|
||||
@@ -32,6 +38,15 @@ public class ParamUtil {
|
||||
case "/u8cloud/api/uapbd/custdoc/update":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/cmp/sj/audit":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/cmp/fj/audit":
|
||||
param = request;
|
||||
break;
|
||||
case "/u8cloud/api/cmp/hj/audit":
|
||||
param = request;
|
||||
break;
|
||||
}
|
||||
return param;
|
||||
}
|
||||
@@ -106,6 +121,42 @@ public class ParamUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 客商管理档案新增,接口参数调整
|
||||
* @param request 自动获取接口原参数
|
||||
* @param formDataVo 表单字段对象
|
||||
* @return
|
||||
* @throws NoSuchFieldException
|
||||
*/
|
||||
public String insertRemittanceParam(String request, FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
// 获取指定的json格式
|
||||
JSONObject jsonObject = JSON.parseObject(request);
|
||||
JSONObject billvo = jsonObject.getJSONObject("billvo");
|
||||
JSONArray childrens = new JSONArray();
|
||||
Map<String, List<FormDataVo>> map = formDataVo.getSubFormMap();
|
||||
List<FormDataVo> formDataVos = map.get("结算明细付");
|
||||
for(int i = 0 ; i < formDataVos.size() ; i++){
|
||||
FormDataVo subformDataVo = formDataVos.get(i);
|
||||
FieldDataVo zy = subformDataVo.getFieldData("U8C-摘要明细表付");
|
||||
String zyValue = zy.getStringValue();
|
||||
FieldDataVo fkybje = subformDataVo.getFieldData("U8C-付款原币金额明细表付");
|
||||
String fkybjeValue = fkybje.getStringValue();
|
||||
JSONObject children1 = new JSONObject();
|
||||
children1.put("dfybje",fkybjeValue);
|
||||
children1.put("zy",zyValue);
|
||||
JSONObject children2 = new JSONObject();
|
||||
children2.put("jfybje",fkybjeValue);
|
||||
children2.put("zy",zyValue);
|
||||
childrens.add(children1);
|
||||
childrens.add(children2);
|
||||
}
|
||||
billvo.put("children",childrens);
|
||||
// jsonObject.put("billvo",billvo);
|
||||
System.out.println(jsonObject);
|
||||
return jsonObject.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_ydctleasebill</id>
|
||||
<name>宜都城投租赁账单生成</name>
|
||||
<category>20241123</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="/ydctLeaseBillController.do" class="com.seeyon.apps.src_ydctleasebill.controller.YdctLeaseBillController" />
|
||||
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="leaseBillDao" class="com.seeyon.apps.src_ydctleasebill.dao.impl.LeaseBillDaoImpl" />
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="ydctLeaseBillFieldCtrl" class="com.seeyon.apps.src_ydctleasebill.fieldCtrl.YdctLeaseBillFieldCtrl" />
|
||||
</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="ydctLeaseBillPluginApi" class="com.seeyon.apps.src_ydctleasebill.YdctLeaseBillPluginApi" />
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -12,13 +12,31 @@
|
||||
<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="caiLiaocaigouYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.CaiLiaocaigouYdctPaymentNode" />
|
||||
<bean id="chaiLvbaoxiaoYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.ChaiLvbaoxiaoYdctPaymentNode" />
|
||||
<bean id="diaoBoYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.DiaoBoYdctCollectionNode" />
|
||||
<bean id="diaoBoYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.DiaoBoYdctPaymentNode" />
|
||||
<bean id="feiYongbaoxiaoYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.FeiYongbaoxiaoYdctPaymentNode" />
|
||||
<bean id="gongHuibaoxiaoYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.GongHuibaoxiaoYdctPaymentNode" />
|
||||
<bean id="heTongfukuanYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.HeTongfukuanYdctPaymentNode" />
|
||||
<bean id="heTongshoukuanYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.HeTongshoukuanYdctCollectionNode" />
|
||||
<bean id="jieZhiYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.JieZhiYdctPaymentNode" />
|
||||
<bean id="rongZihuankuanYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.RongZihuankuanYdctPaymentNode" />
|
||||
<bean id="rongZijiekuanYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.RongZijiekuanYdctCollectionNode" />
|
||||
<bean id="shouKuanYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.ShouKuanYdctCollectionNode" />
|
||||
<bean id="xiangMuzhifuYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.XiangMuzhifuYdctPaymentNode" />
|
||||
<bean id="zongHeYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.ZongHeYdctPaymentNode" />
|
||||
<bean id="xiangMubofuYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.XiangMubofuYdctPaymentNode" />
|
||||
<bean id="tingCheshoukanYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.TingCheshoukanYdctCollectionNode" />
|
||||
<bean id="examineYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.ExamineYdctPaymentNode" />
|
||||
<bean id="examineYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.ExamineYdctCollectionNode" />
|
||||
<bean id="ziJindiaoboExamineYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.ZiJindiaoboExamineYdctCollectionNode" />
|
||||
<bean id="ziJindiaoboExamineYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.ZiJindiaoboExamineYdctPaymentNode" />
|
||||
<bean id="tongYongzhifuYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.TongYongzhifuYdctPaymentNode" />
|
||||
<bean id="ziJindiaoboExamineYdctRemittanceNode" class="com.seeyon.apps.ydctu8c.cash.node.ZiJindiaoboExamineYdctRemittanceNode" />
|
||||
<bean id="diaoBoYdctRemittanceNode" class="com.seeyon.apps.ydctu8c.cash.node.DiaoBoYdctRemittanceNode" />
|
||||
<bean id="zuLinShouKuanYdctCollectionNode" class="com.seeyon.apps.ydctu8c.cash.node.ZuLinShouKuanYdctCollectionNode" />
|
||||
<bean id="zuLinFuKuanYdctPaymentNode" class="com.seeyon.apps.ydctu8c.cash.node.ZuLinFuKuanYdctPaymentNode" />
|
||||
|
||||
</beans>
|
||||
|
||||
|
||||
@@ -64,13 +64,13 @@
|
||||
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 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'};
|
||||
@@ -114,19 +114,56 @@
|
||||
"period":field0011value},
|
||||
dataType : 'json',
|
||||
contentType : 'application/json; charset=UTF-8',
|
||||
success : function(res) {
|
||||
|
||||
success(res) {
|
||||
var randomNum = Math.floor(Math.random() * 10001);
|
||||
if(res.success){
|
||||
var money = data.showValue;
|
||||
var money = field0216value;
|
||||
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;
|
||||
// self.adaptation.formdata.field0215.formmains.formmain_0725.field0216.value = res.num;
|
||||
var data = {
|
||||
fieldId: 'field0216',
|
||||
fieldData: {
|
||||
value: res.num+'', //数据值,存入数据库中的value值
|
||||
display: res.num+'' //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
}
|
||||
$.alert(利息明细生成完成);
|
||||
};
|
||||
csdk.core.setFieldData(data);
|
||||
}else{
|
||||
var data = {
|
||||
fieldId: 'field0216',
|
||||
fieldData: {
|
||||
value: res.num+'', //数据值,存入数据库中的value值
|
||||
display: res.num+'' //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
}
|
||||
};
|
||||
// csdk.core.setFieldData(data);
|
||||
// var data1 = {
|
||||
// fieldId: 'field0215',
|
||||
// fieldData: {
|
||||
// value: randomNum+'', //数据值,存入数据库中的value值
|
||||
// display: randomNum+'' //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
// }
|
||||
// };
|
||||
// csdk.core.setFieldData(data1);
|
||||
|
||||
|
||||
csdk.core.patchData(res.data.data.data.tableData);
|
||||
// csdk.core.preSave(function(err, data){
|
||||
// if (err) {
|
||||
// //调用失败
|
||||
// console.log(err);
|
||||
// return;
|
||||
// }
|
||||
// console.log(data)
|
||||
// //调用成功
|
||||
// //do something
|
||||
// });
|
||||
// window.thirdPartyFormAPI.backfillFormControlData(adddata);
|
||||
// self.adaptation.formdata.field0215.formmains.formmain_0725.field0211.value = randomNum+'';
|
||||
|
||||
|
||||
}
|
||||
// alert("利息明细生成完成");
|
||||
// var data = {
|
||||
// fieldId: 'field0211',
|
||||
// fieldData: {
|
||||
@@ -140,6 +177,7 @@
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
$.alert(res.s);
|
||||
}
|
||||
}
|
||||
@@ -155,6 +193,9 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
function test1() {
|
||||
console.log("回调方法");
|
||||
}
|
||||
|
||||
var dynamicLoading = {
|
||||
css: function(path) {
|
||||
|
||||
@@ -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,247 @@
|
||||
(function(f){
|
||||
var nameSpace = 'field_5209586381190735608';
|
||||
if(!window[nameSpace]){
|
||||
var Builder = f();
|
||||
window[nameSpace] = {
|
||||
instance: {}
|
||||
};
|
||||
window[nameSpace].init = function (options) {
|
||||
window[nameSpace].instance[options.privateId] = new Builder(options);
|
||||
};
|
||||
}
|
||||
})(function(){
|
||||
/**
|
||||
* 构造函数
|
||||
* @param options
|
||||
* @constructor
|
||||
*/
|
||||
function App(options) {
|
||||
var self = this;
|
||||
//初始化参数
|
||||
self.initParams(options);
|
||||
//初始化dom
|
||||
self.initDom();
|
||||
//事件
|
||||
self.events();
|
||||
}
|
||||
|
||||
App.prototype = {
|
||||
initParams : function (options) {
|
||||
var self = this;
|
||||
self.adaptation = options.adaptation;
|
||||
self.adaptation.formMessage = options.formMessage;
|
||||
self.privateId = options.privateId;
|
||||
self.messageObj = options.getData;
|
||||
self.preUrl = options.url_prefix;
|
||||
},
|
||||
initDom : function () {
|
||||
var self = this;
|
||||
dynamicLoading.css(self.preUrl + 'css/formQueryBtn.css');
|
||||
self.appendChildDom();
|
||||
},
|
||||
events : function () {
|
||||
var self = this;
|
||||
// 监听是否数据刷新
|
||||
|
||||
$(".field0215__").css("background-color","#008BFF");
|
||||
$(".field0215__").css("color","#FFFFFF");
|
||||
$(".field0215__").css("border-radius","10px");
|
||||
$(".field0215__").mouseover(function (e) {
|
||||
var $this = $(this);// 当前触发事件的标签对象
|
||||
}).mouseout(function (e) {
|
||||
$(".field0215__").css("background-color","#008BFF");
|
||||
}).mousemove(function (e) {
|
||||
$(".field0215__").css("background-color","#005297");
|
||||
});
|
||||
|
||||
},
|
||||
appendChildDom : function () {
|
||||
var self = this;
|
||||
var domStructure = '<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;
|
||||
// 计费方式
|
||||
var field0021 = {fieldId: 'field0021'};
|
||||
var field0021value = csdk.core.getFieldData(field0021).showValue;
|
||||
// 缴费方式
|
||||
var field0019 = {fieldId: 'field0019'};
|
||||
var field0019value = csdk.core.getFieldData(field0019).showValue;
|
||||
// 年缴费方式类型
|
||||
var field0025 = {fieldId: 'field0025'};
|
||||
var field0025value = csdk.core.getFieldData(field0025).showValue;
|
||||
// 面积单价
|
||||
var field0022 = {fieldId: 'field0022'};
|
||||
var field0022value = csdk.core.getFieldData(field0022).value;
|
||||
// 固定租金单价
|
||||
var field0023 = {fieldId: 'field0023'};
|
||||
var field0023value = csdk.core.getFieldData(field0023).value;
|
||||
// 合同开始日期
|
||||
var field0027 = {fieldId: 'field0027'};
|
||||
var field0027value = csdk.core.getFieldData(field0027).value;
|
||||
// 合同结束日期
|
||||
var field0028 = {fieldId: 'field0028'};
|
||||
var field0028value = csdk.core.getFieldData(field0028).value;
|
||||
// 租赁面积
|
||||
var field0060 = {fieldId: 'field0060'};
|
||||
var field0060value = csdk.core.getFieldData(field0060).value;
|
||||
// 账单编号
|
||||
// var field0083 = {fieldId: 'field0083'};
|
||||
// var field0083value = csdk.core.getFieldData(field0083).value;
|
||||
var field0083 = {fieldId: 'field0082'};
|
||||
var field0083value = csdk.core.getFieldData(field0083).value;
|
||||
|
||||
// 判断合同开始日期是否在合同结束日期之前
|
||||
if(!isEmpty(field0027value)|| !isEmpty(field0028value)){
|
||||
if(Date.parse(field0027value)>Date.parse(field0028value)){
|
||||
$.alert("请正确填写合同日期");
|
||||
return ;
|
||||
}
|
||||
}else{
|
||||
$.alert("请填写合同日期");
|
||||
return ;
|
||||
}
|
||||
|
||||
// 当缴费方式为年缴费时年缴费类型必填
|
||||
if(field0019value=='年'){
|
||||
if(isEmpty(field0025value)){
|
||||
$.alert("请选择年缴费方式选项");
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(url2);
|
||||
var str = "";
|
||||
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
async : true,
|
||||
// 记得加随机数,不然如果ajax轮询请求会不执行
|
||||
url : encodeURI('/seeyon/ydctLeaseBillController.do?datetime=' + Math.random()),
|
||||
data:{
|
||||
"jifeifs":field0021value,
|
||||
"jiaofeifs":field0019value,
|
||||
"njiaofeifs":field0025value,
|
||||
"startDate":field0027value,
|
||||
"endDate":field0028value,
|
||||
"mj":field0060value,
|
||||
"mjzj":field0022value,
|
||||
"gdzj":field0023value,
|
||||
"bdid":field0083value
|
||||
},
|
||||
dataType : 'json',
|
||||
contentType : 'application/json; charset=UTF-8',
|
||||
success : function(res) {
|
||||
var randomNum = Math.floor(Math.random() * 10001);
|
||||
if(res.success){
|
||||
// $.alert("账单明细生成完成");
|
||||
if(field0083value=="" ){
|
||||
//self.adaptation.formdata.field0215__.formmains.formmain_0725.field0216.value = res.num;
|
||||
var data = {
|
||||
fieldId: 'field0083',
|
||||
fieldData: {
|
||||
value: res.num+'', //数据值,存入数据库中的value值
|
||||
display: res.num+'', //字段渲染在页面上的显示值,通常是经过format后的值
|
||||
auth: ''
|
||||
}
|
||||
};
|
||||
csdk.core.setFieldData(data);
|
||||
}
|
||||
// var field0084 = {fieldId: 'field0084'};
|
||||
// let field0084val = csdk.core.getFieldData(field0084)
|
||||
// field0084val.value = randomNum+"";
|
||||
// field0084val.showValue = randomNum+"";
|
||||
// field0084val.showValue2 = randomNum+"";
|
||||
// var adddata = {tableName : "formmain_0126",
|
||||
// tableCategory : "formmain",
|
||||
// updateData : {
|
||||
// field0084 :field0084val
|
||||
// }
|
||||
// };
|
||||
// window.thirdPartyFormAPI.backfillFormControlData(adddata);
|
||||
self.adaptation.formdata.field0082__.formmains.formmain_0126.field0084.value = randomNum;
|
||||
// for(var i = 0 ; i < 20 ; i++){
|
||||
// var data1 ={
|
||||
// tableName:"formson_0128",
|
||||
// isFormRecords:false,
|
||||
// chooseRecords:{
|
||||
// formson_0128 : 0,
|
||||
// },
|
||||
// callbackFn:test()
|
||||
// }
|
||||
//
|
||||
// window.thirdPartyFormAPI.insertFormsonRecords(data1);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
//self.adaptation.formdata.field0215__.formmains.formmain_0725.field0211.value = randomNum;
|
||||
//self.adaptation.formdata.field0215__.formmains.formmain_0725.field0216.value = res.num;
|
||||
// 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>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function test() {
|
||||
console.log("明细行生成成功");;
|
||||
}
|
||||
|
||||
|
||||
function isEmpty(text) {
|
||||
return !text || text.trim() === '';
|
||||
}
|
||||
|
||||
var dynamicLoading = {
|
||||
css: function(path) {
|
||||
if(!path || path.length === 0) {
|
||||
throw new Error('argument "path" is required !');
|
||||
}
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var link = document.createElement('link');
|
||||
link.href = path;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
head.appendChild(link);
|
||||
},
|
||||
js: function(path) {
|
||||
if(!path || path.length === 0) {
|
||||
throw new Error('argument "path" is required !');
|
||||
}
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var script = document.createElement('script');
|
||||
script.src = path;
|
||||
script.type = 'text/javascript';
|
||||
head.appendChild(script);
|
||||
}
|
||||
}
|
||||
|
||||
return App;
|
||||
});
|
||||
@@ -0,0 +1,134 @@
|
||||
(function(f){
|
||||
var nameSpace = 'field_6664988151731237757';
|
||||
if(!window[nameSpace]){
|
||||
var Builder = f();
|
||||
window[nameSpace] = {
|
||||
instance: {}
|
||||
};
|
||||
window[nameSpace].init = function (options) {
|
||||
window[nameSpace].instance[options.privateId] = new Builder(options);
|
||||
};
|
||||
}
|
||||
})(function(){
|
||||
/**
|
||||
* 构造函数
|
||||
* @param options
|
||||
* @constructor
|
||||
*/
|
||||
function App(options) {
|
||||
var self = this;
|
||||
//初始化参数
|
||||
self.initParams(options);
|
||||
//初始化dom
|
||||
self.initDom();
|
||||
//事件
|
||||
self.events();
|
||||
}
|
||||
|
||||
App.prototype = {
|
||||
initParams : function (options) {
|
||||
var self = this;
|
||||
self.adaptation = options.adaptation;
|
||||
self.adaptation.formMessage = options.formMessage;
|
||||
self.privateId = options.privateId;
|
||||
self.messageObj = options.getData;
|
||||
self.preUrl = options.url_prefix;
|
||||
},
|
||||
initDom : function () {
|
||||
var self = this;
|
||||
dynamicLoading.css(self.preUrl + 'css/formQueryBtn.css');
|
||||
self.appendChildDom();
|
||||
},
|
||||
events : function () {
|
||||
var self = this;
|
||||
// 监听是否数据刷新
|
||||
|
||||
//$(".field0313__").css("background-color","#008BFF");
|
||||
//$(".field0313__").css("color","#FFFFFF");
|
||||
//$(".field0313__").css("border-radius","10px");
|
||||
//$(".field0313__").mouseover(function (e) {
|
||||
// var $this = $(this);// 当前触发事件的标签对象
|
||||
//}).mouseout(function (e) {
|
||||
// $(".field0313__").css("background-color","#008BFF");
|
||||
//}).mousemove(function (e) {
|
||||
// $(".field0313__").css("background-color","#005297");
|
||||
//});
|
||||
|
||||
},
|
||||
appendChildDom : function () {
|
||||
var self = this;
|
||||
var domStructure = '<section class="customButton_box_content">'+
|
||||
'<div class="customButton_class_box '+ self.privateId + '" title="' + self.messageObj.display.escapeHTML() + '">'+ self.messageObj.display.escapeHTML() +'</div>'+
|
||||
'</section>';
|
||||
document.querySelector('#' + self.privateId).innerHTML = domStructure;
|
||||
var jumpFun = function() {
|
||||
var url2 = window.location.origin;
|
||||
var s = self;
|
||||
|
||||
var field0206 = {fieldId: 'field0206'};
|
||||
var field0206value = csdk.core.getFieldData(field0206).value;
|
||||
var field0068 = {fieldId: 'field0068'};
|
||||
var field0068value = csdk.core.getFieldData(field0068).value;
|
||||
var field0212 = {fieldId: 'field0212'};
|
||||
var field0212value = csdk.core.getFieldData(field0212).value;
|
||||
var field0213 = {fieldId: 'field0213'};
|
||||
var field0213value = csdk.core.getFieldData(field0213).value;
|
||||
var field0214 = {fieldId: 'field0214'};
|
||||
var field0214value = csdk.core.getFieldData(field0214).value;
|
||||
var field0207 = {fieldId: 'field0207'};
|
||||
var field0207value = csdk.core.getFieldData(field0207).showValue;
|
||||
|
||||
var str = "";
|
||||
|
||||
$.ajax({
|
||||
type : 'post',
|
||||
async : true,
|
||||
// 记得加随机数,不然如果ajax轮询请求会不执行
|
||||
url : encodeURI('/seeyon/interestMeasurementController.do?datetime=' + Math.random()),
|
||||
data:{"startDate":field0206value,"cycle":field0207value,"credit":field0068,"principal":field0212,"money":field0213,"interestRate":field0214,},
|
||||
dataType : 'json',
|
||||
contentType : 'application/json; charset=UTF-8',
|
||||
success : function(res) {
|
||||
alert("123123123");
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
var content = self.messageObj.formdata.content;
|
||||
|
||||
};
|
||||
document.querySelector('.' + self.privateId).removeEventListener('click', jumpFun);
|
||||
document.querySelector('.' + self.privateId).addEventListener('click', jumpFun);
|
||||
//渲染隐藏权限
|
||||
if (self.messageObj.auth === 'hide') {
|
||||
document.querySelector('#' + self.privateId).innerHTML = '<div class="cap4-text__browse" style="line-height: 1.8; color: rgb(0, 0, 0) !important;">***</div>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var dynamicLoading = {
|
||||
css: function(path) {
|
||||
if(!path || path.length === 0) {
|
||||
throw new Error('argument "path" is required !');
|
||||
}
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var link = document.createElement('link');
|
||||
link.href = path;
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
head.appendChild(link);
|
||||
},
|
||||
js: function(path) {
|
||||
if(!path || path.length === 0) {
|
||||
throw new Error('argument "path" is required !');
|
||||
}
|
||||
var head = document.getElementsByTagName('head')[0];
|
||||
var script = document.createElement('script');
|
||||
script.src = path;
|
||||
script.type = 'text/javascript';
|
||||
head.appendChild(script);
|
||||
}
|
||||
}
|
||||
|
||||
return App;
|
||||
});
|
||||
@@ -0,0 +1,99 @@
|
||||
var unflowList, param, loading, process;
|
||||
$(document).ready(function() {
|
||||
param = initParam().params;// 获取页面参数
|
||||
// 处理进度条
|
||||
process = top.$.progressBar({
|
||||
text : "加载中..."
|
||||
});
|
||||
loading = true;
|
||||
getUnflowList();
|
||||
});
|
||||
|
||||
|
||||
// 获取底表
|
||||
function getUnflowList() {
|
||||
$.ajax({
|
||||
url : "/seeyon/rest/cap4/unflow/select",
|
||||
async : true,
|
||||
success : function(data) {
|
||||
// 处理进度条
|
||||
if (loading)
|
||||
process.close();
|
||||
loading = false;
|
||||
//data = JSON.parse(data);
|
||||
var result = data.data;
|
||||
unflowList = result;
|
||||
for (var i = 0; i < result.length; i++) {
|
||||
$("#queryList ul").append(
|
||||
$("<li id='"
|
||||
+ result[i].id
|
||||
+ "'><span class='icon'></span>"
|
||||
+ result[i].name
|
||||
+ "</li>").attr("info",
|
||||
JSON.stringify(result[i])));
|
||||
}
|
||||
$("#queryList ul").delegate(
|
||||
"li",
|
||||
"click",
|
||||
function() {
|
||||
$(this).siblings().removeClass('active').end()
|
||||
.addClass('active');
|
||||
});
|
||||
if (param && param.id) { // 激活当前项
|
||||
$('#' + param.id).trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 搜索
|
||||
function search() {
|
||||
var searchValue = $("#search_query").val();
|
||||
$("#queryList ul").empty();
|
||||
for (var i = 0; i < unflowList.length; i++) {
|
||||
if (unflowList[i].name.indexOf(searchValue) != -1) {
|
||||
$("#queryList ul").append(
|
||||
$("<li><span class='icon'></span>"
|
||||
+ unflowList[i].name + "</li>").attr(
|
||||
"info", JSON.stringify(unflowList[i])));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 返回参数获取
|
||||
function getResult() {
|
||||
return JSON.parse($("#queryList ul").find(".active").attr("info")
|
||||
|| "{}");
|
||||
}
|
||||
|
||||
// --------------------以下为固定方法,需要实现返回参数获取--------------
|
||||
|
||||
// 获取弹窗传递过来的参数
|
||||
function initParam() {
|
||||
var obj = window.parentDialogObj && (window.parentDialogObj["ctrlDialog"]);// 获取窗口对象
|
||||
if (obj && obj.getTransParams) {
|
||||
// 然后通过V5方法获取弹窗传递过来的参数
|
||||
return obj.getTransParams();
|
||||
}
|
||||
}
|
||||
|
||||
// 确定按钮调用方法,返回需要的json数据
|
||||
function OK() {
|
||||
var result = getResult();
|
||||
|
||||
if (param && param.designId !== result.designId)
|
||||
return {
|
||||
valid : true,
|
||||
data : {
|
||||
customParam : {
|
||||
templateId : result,
|
||||
mapping : null
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
valid : true,
|
||||
data : result
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user