Commit ed545c7d authored by niminmin's avatar niminmin

Merge branch 'feature/售后回租合同变更部分开发' into develop

parents 4fa26125 e0292fd7
This diff is collapsed.
package com.hand.hls.hlcm.emay;
public class ResultModel {
private String code;
private String result;
public ResultModel(String code, String result) {
this.code = code;
this.result = result;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
}
package com.hand.hls.hlcm.emay;
import com.hand.hls.hlcm.emay.util.DateUtil;
import com.hand.hls.hlcm.emay.util.Md5;
import com.hand.hls.hlcm.emay.util.http.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class RetrieveReportExample {
public static void main(String[] args) {
// appId
String appId = "EUCe-EMt-SMS9-XXXXX";// 请联系销售,或者在页面中 获取
// 密钥
String secretKey = "1234567893214567";// 请联系销售,或者在页面中 获取
// 接口地址
String host = "127.0.0.1:8999";// 请联系销售获取
// 编码
String encode = "UTF-8";
// 时间戳
String timestamp = DateUtil.toString(new Date(), "yyyyMMddHHmmss");
// 签名
String sign = Md5.md5((appId + secretKey + timestamp).getBytes());
String startTime = "20170101120000";
String endTime = "20170101120000";
String smsId = "123123123,321321321";
getReport(appId, host, encode, timestamp, sign, startTime, endTime, smsId);
}
/**
* 获取状态报告
*/
private static void getReport(String appId, String host, String encode,// 时间戳
String timestamp, String sign, String startTime, String endTime, String smsId) {
System.out.println("=============begin getReport==================");
Map<String, String> params = new HashMap<String, String>();
params.put("appId", appId);
params.put("timestamp", timestamp);
params.put("sign", sign);
params.put("startTime", startTime);
params.put("endTime", endTime);
if (null != smsId && !"".equals(smsId)) {
params.put("smsId", smsId);
}
String url = "http://" + host + "/report/retrieveReport";
String result = request(params, url);
System.out.println(result);
System.out.println("=============end getReport==================");
}
/**
* 公共请求方法
*/
public static String request(Map<String, String> params, String url) {
HttpRequestParams<Map<String, String>> requestparams = new HttpRequestParams<Map<String, String>>();
requestparams.setCharSet("UTF-8");
requestparams.setMethod("POST");
requestparams.setParams(params);
requestparams.setUrl(url);
HttpRequest<Map<String, String>> request;
if(url.startsWith("https://")) {
request = new HttpsRequestKV(requestparams,null);
}else {
request = new HttpRequestKV(requestparams);
}
HttpClient client = new HttpClient();
String json = null;
try {
String mapst = "";
for (String key : params.keySet()) {
String value = params.get(key);
mapst += key + "=" + value + "&";
}
mapst = mapst.substring(0, mapst.length() - 1);
System.out.println("request params: " + mapst);
HttpResponseString res = client.service(request, new HttpResponseStringPraser());
if (res == null) {
System.err.println("请求接口异常");
return null;
}
if (res.getResultCode().equals(HttpResultCode.SUCCESS)) {
if (res.getHttpCode() == 200) {
json = res.getResult();
System.out.println("response json: " + json);
} else {
System.out.println("请求接口异常,请求码:" + res.getHttpCode());
}
} else {
System.out.println("请求接口网络异常:" + res.getResultCode().getCode());
}
} catch (Exception e) {
System.err.println("解析失败");
e.printStackTrace();
}
return json;
}
}
This diff is collapsed.
package com.hand.hls.hlcm.emay.eucp.inter.framework.dto;
import java.io.Serializable;
/**
* 自定义SMSID 手机号
* @author Frank
*
*/
public class CustomSmsIdAndMobile implements Serializable {
private static final long serialVersionUID = 1L;
private String customSmsId;
private String mobile;
public CustomSmsIdAndMobile(){
}
public CustomSmsIdAndMobile(String customSmsId,String mobile){
this.customSmsId = customSmsId;
this.mobile = mobile;
}
public String getCustomSmsId() {
return customSmsId;
}
public void setCustomSmsId(String customSmsId) {
this.customSmsId = customSmsId;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.framework.dto;
import java.io.Serializable;
/**
* 自定义SMSID 手机号 内容
* @author Frank
*
*/
public class CustomSmsIdAndMobileAndContent implements Serializable {
private static final long serialVersionUID = 1L;
private String customSmsId;
private String mobile;
private String content;
public CustomSmsIdAndMobileAndContent(){
}
public CustomSmsIdAndMobileAndContent(String customSmsId,String mobile,String content){
this.customSmsId = customSmsId;
this.mobile = mobile;
this.content = content;
}
public String getCustomSmsId() {
return customSmsId;
}
public void setCustomSmsId(String customSmsId) {
this.customSmsId = customSmsId;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.framework.dto;
import java.io.Serializable;
/**
* 自定义SMSID 手机号 内容
* @author Frank
*
*/
public class PersonalityParams implements Serializable {
private static final long serialVersionUID = 1L;
private String customSmsId;
private String mobile;
private String content;
private String extendedCode;
private String timerTime;
public PersonalityParams(){
}
public PersonalityParams(String customSmsId,String mobile,String content,String extendedCode,String timerTime){
this.customSmsId = customSmsId;
this.mobile = mobile;
this.content = content;
this.timerTime = timerTime;
this.extendedCode = extendedCode;
}
public String getCustomSmsId() {
return customSmsId;
}
public void setCustomSmsId(String customSmsId) {
this.customSmsId = customSmsId;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getExtendedCode() {
return extendedCode;
}
public void setExtendedCode(String extendedCode) {
this.extendedCode = extendedCode;
}
public String getTimerTime() {
return timerTime;
}
public void setTimerTime(String timerTime) {
this.timerTime = timerTime;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
/**
* 请求Balance参数
* @author Frank
*
*/
public class BalanceRequest extends BaseRequest {
private static final long serialVersionUID = 1L;
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
import java.io.Serializable;
public class BaseRequest implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 请求时间
*/
private long requestTime = System.currentTimeMillis();
/**
* 请求有效时间(秒)<br/>
* 服务器接受时间与请求时间对比,如果超过有效时间,拒绝此次请求<br/>
* 防止被网络抓包不断发送同一条请求<br/>
* 默认1分钟有效期
*/
private int requestValidPeriod = 60;
public long getRequestTime() {
return requestTime;
}
public void setRequestTime(long requestTime) {
this.requestTime = requestTime;
};
public int getRequestValidPeriod() {
return requestValidPeriod;
}
public void setRequestValidPeriod(int requestValidPeriod) {
this.requestValidPeriod = requestValidPeriod;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
/**
* 请求Balance参数
* @author Frank
*
*/
public class MoRequest extends BaseRequest {
private static final long serialVersionUID = 1L;
/**
* 请求数量<br/>
* 最大500
*/
private int number = 500;
public int getNumber() {
if(number <= 0 || number > 500){
number = 500;
}
return number;
}
public void setNumber(int number) {
if(number > 500){
number = 500;
}
this.number = number;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
/**
* 请求Balance参数
* @author Frank
*
*/
public class ReportRequest extends BaseRequest {
private static final long serialVersionUID = 1L;
/**
* 请求数量<br/>
* 最大500
*/
private int number = 500;
public int getNumber() {
if(number <= 0 || number > 500){
number = 500;
}
return number;
}
public void setNumber(int number) {
if(number > 500){
number = 500;
}
this.number = number;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
public class SmsBaseRequest extends BaseRequest {
private static final long serialVersionUID = 1L;
/**
* 定时时间
* yyyy-MM-dd HH:mm:ss
*/
private String timerTime;
/**
* 扩展码
*/
private String extendedCode;
public String getTimerTime() {
return timerTime;
}
public void setTimerTime(String timerTime) {
this.timerTime = timerTime;
}
public String getExtendedCode() {
return extendedCode;
}
public void setExtendedCode(String extendedCode) {
this.extendedCode = extendedCode;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
/**
* 批量短信发送参数
* @author Frank
*
*/
public class SmsBatchOnlyRequest extends SmsBaseRequest {
private static final long serialVersionUID = 1L;
/**
* 手机号与自定义SmsId
*/
private String[] mobiles;
/**
* 短信内容
*/
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String[] getMobiles() {
return mobiles;
}
public void setMobiles(String[] mobiles) {
this.mobiles = mobiles;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
import com.hand.hls.hlcm.emay.eucp.inter.framework.dto.CustomSmsIdAndMobile;
/**
* 批量短信发送参数
* @author Frank
*
*/
public class SmsBatchRequest extends SmsBaseRequest {
private static final long serialVersionUID = 1L;
/**
* 手机号与自定义SmsId
*/
private CustomSmsIdAndMobile[] smses;
/**
* 短信内容
*/
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public CustomSmsIdAndMobile[] getSmses() {
return smses;
}
public void setSmses(CustomSmsIdAndMobile[] smses) {
this.smses = smses;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
import com.hand.hls.hlcm.emay.eucp.inter.framework.dto.PersonalityParams;
/**
* 批量短信发送参数
* @author Frank
*
*/
public class SmsPersonalityAllRequest extends BaseRequest {
private static final long serialVersionUID = 1L;
private PersonalityParams[] smses;
public PersonalityParams[] getSmses() {
return smses;
}
public void setSmses(PersonalityParams[] smses) {
this.smses = smses;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
import com.hand.hls.hlcm.emay.eucp.inter.framework.dto.CustomSmsIdAndMobileAndContent;
/**
* 批量短信发送参数
* @author Frank
*
*/
public class SmsPersonalityRequest extends SmsBaseRequest {
private static final long serialVersionUID = 1L;
private CustomSmsIdAndMobileAndContent[] smses;
public CustomSmsIdAndMobileAndContent[] getSmses() {
return smses;
}
public void setSmses(CustomSmsIdAndMobileAndContent[] smses) {
this.smses = smses;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.request;
/**
* 单条短信发送参数
* @author Frank
*
*/
public class SmsSingleRequest extends SmsBaseRequest {
private static final long serialVersionUID = 1L;
/**
* 电话号码
*/
private String mobile;
/**
* 短信内容
*/
private String content;
/**
* 自定义smsid
*/
private String customSmsId;
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getCustomSmsId() {
return customSmsId;
}
public void setCustomSmsId(String customSmsId) {
this.customSmsId = customSmsId;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.response;
import java.io.Serializable;
/**
* 余额数据
* @author Frank
*
*/
public class BalanceResponse implements Serializable{
private static final long serialVersionUID = 1L;
private long balance;// 余额
public BalanceResponse() {
}
public BalanceResponse(long balance) {
this.balance = balance;
}
public long getBalance() {
return balance;
}
public void setBalance(long balance) {
this.balance = balance;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.response;
import java.io.Serializable;
/**
* 上行数据
* @author Frank
*
*/
public class MoResponse implements Serializable {
private static final long serialVersionUID = 1L;
private String mobile;// 手机号
private String extendedCode; // 扩展码
private String content;// 内容
private String moTime;// 手机上行时间
public MoResponse(){
}
public MoResponse(String mobile,String extendedCode,String content,String moTime){
this.mobile = mobile;
this.extendedCode = extendedCode;
this.content = content;
this.moTime = moTime;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getExtendedCode() {
return extendedCode;
}
public void setExtendedCode(String extendedCode) {
this.extendedCode = extendedCode;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getMoTime() {
return moTime;
}
public void setMoTime(String moTime) {
this.moTime = moTime;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.response;
import java.io.Serializable;
/**
* 状态报告数据
* @author Frank
*
*/
public class ReportResponse implements Serializable {
private static final long serialVersionUID = 1L;
private String smsId;// 短信唯一标识
private String customSmsId;// 客户自定义SmsId
private String state;// 成功失败标识
private String desc;// 状态报告描述
private String mobile;// 手机号
private String receiveTime;// 状态报告返回时间
private String submitTime;// 信息提交时间
private String extendedCode;// 扩展码
public String getCustomSmsId() {
return customSmsId;
}
public void setCustomSmsId(String customSmsId) {
this.customSmsId = customSmsId;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getReceiveTime() {
return receiveTime;
}
public void setReceiveTime(String receiveTime) {
this.receiveTime = receiveTime;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getSmsId() {
return smsId;
}
public void setSmsId(String smsId) {
this.smsId = smsId;
}
public String getSubmitTime() {
return submitTime;
}
public void setSubmitTime(String submitTime) {
this.submitTime = submitTime;
}
public String getExtendedCode() {
return extendedCode;
}
public void setExtendedCode(String extendedCode) {
this.extendedCode = extendedCode;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.response;
import java.io.Serializable;
public class ResponseData<T> implements Serializable {
private static final long serialVersionUID = 1L;
private String code;
private T data;
public ResponseData(String code,T data){
this.code = code;
this.data = data;
}
public ResponseData(){
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
package com.hand.hls.hlcm.emay.eucp.inter.http.v1.dto.response;
import java.io.Serializable;
/**
* 单条短信发送响应
* @author Frank
*
*/
public class SmsResponse implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 系统唯一smsId
*/
private String smsId;
private String mobile;
private String customSmsId;
public SmsResponse(){
}
public SmsResponse(String smsId,String mobile,String customSmsId){
this.smsId = smsId;
this.mobile = mobile;
this.customSmsId = customSmsId;
}
public String getSmsId() {
return smsId;
}
public void setSmsId(String smsId) {
this.smsId = smsId;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getCustomSmsId() {
return customSmsId;
}
public void setCustomSmsId(String customSmsId) {
this.customSmsId = customSmsId;
}
}
package com.hand.hls.hlcm.emay.util;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
/**
* AES加解密工具
*
* @author Frank
*
*/
public class AES {
public final static String ALGORITHM_AEPP = "AES/ECB/PKCS5Padding";
/**
* AES加密
*
* @param content
* 内容
* @param password
* 密钥
* @param algorithm
* 算法
* @return 加密后数据
*/
public static byte[] encrypt(byte[] content, byte[] password, String algorithm) {
if (content == null || password == null)
return null;
try {
Cipher cipher = null;
if (algorithm.endsWith("PKCS7Padding")) {
cipher = Cipher.getInstance(algorithm, "BC");
} else {
cipher = Cipher.getInstance(algorithm);
}
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(password, "AES"));
return cipher.doFinal(content);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* AES解密
*
* @param content
* 加密内容
* @param password
* 密钥
* @param algorithm
* 算法
* @return 解密后数据
*/
public static byte[] decrypt(byte[] content, byte[] password, String algorithm) {
if (content == null || password == null)
return null;
try {
Cipher cipher = null;
if (algorithm.endsWith("PKCS7Padding")) {
cipher = Cipher.getInstance(algorithm, "BC");
} else {
cipher = Cipher.getInstance(algorithm);
}
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(password, "AES"));
byte[] bytes = cipher.doFinal(content);
return bytes;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* AES加密
*
* @param content
* 内容
* @param password
* 密钥
* @param algorithm
* 算法
* @param ivStr
* 向量
* @return 加密后数据
*/
public static byte[] encrypt(byte[] content, byte[] password, byte[] ivStr, String algorithm) {
if (content == null || password == null)
return null;
try {
Cipher cipher = null;
if (algorithm.endsWith("PKCS7Padding")) {
cipher = Cipher.getInstance(algorithm, "BC");
} else {
cipher = Cipher.getInstance(algorithm);
}
IvParameterSpec iv = new IvParameterSpec(ivStr);
cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(password, "AES"), iv);
return cipher.doFinal(content);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* AES解密
*
* @param content
* 加密内容
* @param password
* 密钥
* @param algorithm
* 算法
* @param ivStr
* 向量
* @return 解密后数据
*/
public static byte[] decrypt(byte[] content, byte[] password, byte[] ivStr, String algorithm) {
if (content == null || password == null)
return null;
try {
Cipher cipher = null;
if (algorithm.endsWith("PKCS7Padding")) {
cipher = Cipher.getInstance(algorithm, "BC");
} else {
cipher = Cipher.getInstance(algorithm);
}
IvParameterSpec iv = new IvParameterSpec(ivStr);
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(password, "AES"), iv);
byte[] bytes = cipher.doFinal(content);
return bytes;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
package com.hand.hls.hlcm.emay.util;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateUtil {
public static final long ONE_HOUR_TIME_LONG = 3600000;
public static String toString(Date date, String format) {
String dateStr = null;
try {
SimpleDateFormat sdf = new SimpleDateFormat(format);
dateStr = sdf.format(date);
} catch (Exception e) {
}
return dateStr;
}
public static Date parseDate(String dateStr, String format) {
Date date = null;
try {
SimpleDateFormat sdf = new SimpleDateFormat(format);
date = sdf.parse(dateStr);
} catch (Exception e) {
}
return date;
}
/**
* 获取日期当天的最小时间日期,0点
*/
public static Date getMinTimeDateByDate(Date date) {
if (date == null)
return null;
String datestr = toString(date, "yyyyMMdd");
return parseDate(datestr, "yyyyMMdd");
}
/**
* 获取日期当天的最大时间日期,12点整
*/
public static Date getMaxTimeDateByDate(Date date) {
if (date == null)
return null;
String datestr = toString(date, "yyyyMMdd");
Date d = parseDate(datestr, "yyyyMMdd");
return new Date(d.getTime() + 24l * 60l * 60l * 1000l - 1l);
}
public static long subTime(Date startDate, Date endDate) {
return endDate.getTime() - startDate.getTime();
}
/**
* 获取上月第一天最早时间
* @return Date
*/
public static Date getLastMonthFirstDay() {
Calendar cal_1 = Calendar.getInstance();// 获取当前日期
cal_1.setTime(getMinTimeDateByDate(new Date()));
cal_1.add(Calendar.MONTH, -1);
cal_1.set(Calendar.DAY_OF_MONTH, 1);
return cal_1.getTime();
}
/**
* 获取上月最后一天最晚时间
* @return Date
*/
public static Date getLastMonthLastDay() {
Calendar cale = Calendar.getInstance();
cale.setTime(getMinTimeDateByDate(new Date()));
cale.add(Calendar.MONTH, -1);
cale.set(Calendar.DAY_OF_MONTH, cale.getActualMaximum(Calendar.DAY_OF_MONTH));
return new Date(cale.getTime().getTime() + 1000l * 60l * 60l * 24l - 1l);
}
/**
* 获取本月第一天最早时间
* @return Date
*/
public static Date getNowMonthFirstDay() {
Calendar cal_1 = Calendar.getInstance();// 获取当前日期
cal_1.setTime(getMinTimeDateByDate(new Date()));
cal_1.add(Calendar.MONTH, 0);
cal_1.set(Calendar.DAY_OF_MONTH, 1);
return cal_1.getTime();
}
/**
* 获取本月最后一天最晚时间
* @return Date
*/
public static Date getNowMonthLastDay() {
Calendar cale = Calendar.getInstance();
cale.setTime(getMinTimeDateByDate(new Date()));
cale.set(Calendar.DAY_OF_MONTH, cale.getActualMaximum(Calendar.DAY_OF_MONTH));
return new Date(cale.getTime().getTime() + 1000l * 60l * 60l * 24l - 1l);
}
/**
* 获取本月最后一天
* @return Date
*/
public static Date getTheMonthLastDay(Date date) {
if(date == null){
return null;
}
Calendar cale = Calendar.getInstance();
cale.setTime(date);
cale.set(Calendar.DAY_OF_MONTH, cale.getActualMaximum(Calendar.DAY_OF_MONTH));
cale.set(Calendar.HOUR, 0);
cale.set(Calendar.HOUR_OF_DAY, 0);
cale.set(Calendar.MINUTE, 0);
cale.set(Calendar.SECOND, 0);
cale.set(Calendar.MILLISECOND, 0);
return cale.getTime();
}
public static void main(String[] args) {
// System.out.println(toString(getTheMonthLastDay(new Date()), "yyyy-MM-dd HH:mm:ss"));
// System.out.println(toString(getLastMonthLastDay(), "yyyy-MM-dd HH:mm:ss"));
// System.out.println(toString(getNowMonthFirstDay(), "yyyy-MM-dd HH:mm:ss"));
// System.out.println(toString(getNowMonthLastDay(), "yyyy-MM-dd HH:mm:ss"));
}
}
package com.hand.hls.hlcm.emay.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
/**
* GZIP 压缩工具
* @author Frank
*
*/
public class GZIPUtils {
public static void main(String[] args) throws IOException {
String sst = "hahahah";
System.out.println(sst);
System.out.println(System.currentTimeMillis());
System.out.println("size:" + sst.length());
byte[] bytes = sst.getBytes();
System.out.println("length:" + bytes.length);
System.out.println(System.currentTimeMillis());
byte[] end = compress(bytes);
System.out.println(System.currentTimeMillis());
System.out.println("length:" + end.length);
System.out.println(System.currentTimeMillis());
byte[] start = decompress(end);
System.out.println(System.currentTimeMillis());
System.out.println("length:" + start.length);
System.out.println(new String(start));
}
/**
* 数据压缩传输
*
* @param is
* @param os
* @throws Exception
*/
public static void compressTransfe(byte[] bytes, OutputStream out) throws IOException {
GZIPOutputStream gos = null;
try {
gos = new GZIPOutputStream(out);
gos.write(bytes);
gos.finish();
gos.flush();
} finally{
if(gos != null){
gos.close();
}
}
}
/**
* 数据压缩
*
* @param is
* @param os
* @throws Exception
*/
public static byte[] compress(byte[] bytes) throws IOException {
ByteArrayOutputStream out = null;
GZIPOutputStream gos = null;
try {
out = new ByteArrayOutputStream();
gos = new GZIPOutputStream(out);
gos.write(bytes);
gos.finish();
gos.flush();
} finally{
if(gos != null){
gos.close();
}
if(out != null){
out.close();
}
}
return out.toByteArray();
}
/**
* 数据解压
*
* @param in
* @return
* @throws IOException
*/
public static byte[] decompress(byte[] bytes) throws IOException {
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
GZIPInputStream gin = new GZIPInputStream(in);
ByteArrayOutputStream out = new ByteArrayOutputStream();
int count;
byte data[] = new byte[1024];
while ((count = gin.read(data, 0, 1024)) != -1) {
out.write(data, 0, count);
}
out.flush();
out.close();
gin.close();
return out.toByteArray();
}
}
package com.hand.hls.hlcm.emay.util;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import java.util.HashMap;
import java.util.Map;
/**
* json util
*
* @author 东旭
*
*/
public class JsonHelper {
private static Map<String,Gson> gsons = new HashMap<String, Gson>();
private static String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";
static {
gsons.put(DEFAULT_DATE_PATTERN, createGson(DEFAULT_DATE_PATTERN));
}
private static Gson createGson(String datePattern){
return new GsonBuilder().setDateFormat(datePattern).disableHtmlEscaping().serializeNulls().create();
}
public static Gson getGson() {
return gsons.get(DEFAULT_DATE_PATTERN);
}
public static Gson getGson(String datePattern) {
Gson gson = gsons.get(datePattern);
if(gson == null){
gson = createGson(datePattern);
gsons.put(datePattern, gson);
}
return gson;
}
public static GsonBuilder newGsonBuilder() {
return new GsonBuilder();
}
/**
* 将对象转换为json串
*
* @param obj
* @return
*/
public static String toJsonString(Object obj) {
if (obj == null) {
return null;
}
return getGson().toJson(obj);
}
/**
* 将对象转换为json串,自定义日期转换规则
*
* @param obj
* @param datePattern
* @return
*/
public static String toJsonString(Object obj, String datePattern) {
if (obj == null) {
return null;
}
return getGson(datePattern).toJson(obj);
}
/**
* 将json串转换为对象
*
* @param clazz
* @param jsonString
* @return
*/
public static <T> T fromJson(Class<T> clazz, String jsonString) {
if (jsonString == null) {
return null;
}
return getGson().fromJson(jsonString, clazz);
}
/**
* 将json串转换为对象
*
* @Type type
* @param jsonString
* @return
*/
public static <T> T fromJson(TypeToken<T> token, String jsonString) {
if (jsonString == null) {
return null;
}
return getGson().fromJson(jsonString, token.getType());
}
/**
* 将json串转换为对象
*
* @Type type
* @param jsonString
* @return
*/
public static <T> T fromJson(TypeToken<T> token, String jsonString, String datePattern) {
if (jsonString == null) {
return null;
}
return getGson(datePattern).fromJson(jsonString, token.getType());
}
/**
* 将json串转换为对象
*
* @param clazz
* @param jsonString
* @return
*/
public static <T> T fromJson(Class<T> clazz, String jsonString, String datePattern) {
if (jsonString == null) {
return null;
}
return getGson(datePattern).fromJson(jsonString, clazz);
}
}
package com.hand.hls.hlcm.emay.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* md5特征码工具
*
* @author Frank
*
*/
public class Md5 {
/**
* MD5
* @param bytes
* @return
*/
public static String md5(byte[] bytes) {
if (bytes == null || bytes.length == 0)
return null;
String s = null;
char hexDigits[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(bytes);
byte tmp[] = md.digest();
char str[] = new char[16 * 2];
int k = 0;
for (int i = 0; i < 16; i++) {
byte byte0 = tmp[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
s = new String(str);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return s;
}
/**
* MD5[16位]
*
* @param bytes
* @return
*/
public static String md5For16(byte[] bytes) {
return md5(bytes).substring(8,24);
}
}
This diff is collapsed.
package com.hand.hls.hlcm.emay.util.http;
/**
* Http 请求实体<请求数据类型>
*
* @author Frank
*
* @param <T>
*/
public class HttpRequest<T> {
/**
* http参数
*/
private HttpRequestParams<T> httpParams;
/**
* https参数
*/
private HttpsParams httpsParams;
/**
* 内容解析器
*/
private HttpRequestPraser<T> contentPraser;
/**
* 是否https请求
*/
private boolean isHttps;
/**
*
*/
protected HttpRequest() {
}
/**
*
* @param httpParams
* http参数
* @param contentPraser
* 内容解析器
*/
protected HttpRequest(HttpRequestParams<T> httpParams, HttpRequestPraser<T> contentPraser) {
this.httpParams = httpParams;
this.contentPraser = contentPraser;
this.isHttps = false;
}
/**
*
* @param httpParams
* http参数
* @param httpsParams
* https参数
* @param contentPraser
* 内容解析器
*/
protected HttpRequest(HttpRequestParams<T> httpParams, HttpsParams httpsParams, HttpRequestPraser<T> contentPraser) {
this.httpParams = httpParams;
this.httpsParams = httpsParams;
this.contentPraser = contentPraser;
this.isHttps = true;
}
public boolean isHttps() {
return isHttps;
}
public HttpRequestParams<T> getHttpParams() {
return httpParams;
}
public void setHttpParams(HttpRequestParams<T> httpParams) {
this.httpParams = httpParams;
}
public HttpsParams getHttpsParams() {
return httpsParams;
}
public void setHttpsParams(HttpsParams httpsParams) {
this.httpsParams = httpsParams;
}
public HttpRequestPraser<T> getContentPraser() {
return contentPraser;
}
public void setContentPraser(HttpRequestPraser<T> contentPraser) {
this.contentPraser = contentPraser;
}
}
package com.hand.hls.hlcm.emay.util.http;
/**
* Http 请求实体<byte[]>
*
* @author Frank
*
*/
public class HttpRequestBytes extends HttpRequest<byte[]> {
/**
*
* @param httpParams
* 请求参数
*/
public HttpRequestBytes(HttpRequestParams<byte[]> httpParams) {
super(httpParams, new HttpRequestPraserBytes());
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.util.Map;
/**
* Http 请求实体<Map<String, String>>
*
* @author Frank
*
*/
public class HttpRequestKV extends HttpRequest<Map<String, String>> {
/**
*
* @param httpParams
* 请求参数
*/
public HttpRequestKV(HttpRequestParams<Map<String, String>> httpParams) {
super(httpParams, new HttpRequestPraserKV());
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.util.Map;
/**
* Http参数
*
* @author Frank
*
* @param <T>
* 传输数据类型
*/
public class HttpRequestParams<T> {
private String url;// URL
private String charSet = "UTF-8";// 编码
private String method = "GET";// Http方法
private Map<String, String> headers;// 头信息
private String cookies;// cookie信息
private T params;// 传输数据
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getCharSet() {
return charSet;
}
public void setCharSet(String charSet) {
this.charSet = charSet;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public Map<String, String> getHeaders() {
return headers;
}
public void setHeaders(Map<String, String> headers) {
this.headers = headers;
}
public String getCookies() {
return cookies;
}
public void setCookies(String cookies) {
this.cookies = cookies;
}
public T getParams() {
return params;
}
public void setParams(T params) {
this.params = params;
}
}
package com.hand.hls.hlcm.emay.util.http;
/**
* Http请求,参数解析器
*
* @author Frank
*
* @param <T>
*/
public interface HttpRequestPraser<T> {
/**
* 将请求参数转换为String<br/>
* 主要用于get方法传输
*
* @param httpParams
* 请求参数
* @return
*/
public String praseRqeuestContentToString(HttpRequestParams<T> httpParams);
/**
* 将请求参数转换为byte[]<br/>
* 主要用于post方法传输
*
* @param httpParams
* 请求参数
* @return
*/
public byte[] praseRqeuestContentToBytes(HttpRequestParams<T> httpParams);
/**
* 获取请求参数大小<br/>
* 主要用于post方法传输
*
* @param httpParams
* 请求参数
* @return
*/
public int praseRqeuestContentLength(HttpRequestParams<T> httpParams);
}
package com.hand.hls.hlcm.emay.util.http;
import java.io.UnsupportedEncodingException;
/**
* Http 请求解析器:byte[]
*
* @author Frank
*
*/
public class HttpRequestPraserBytes implements HttpRequestPraser<byte[]> {
/**
* 请求内容字符串
*/
private String contentString;
@Override
public String praseRqeuestContentToString(HttpRequestParams<byte[]> httpParams) {
if (contentString != null) {
return contentString;
}
try {
contentString = new String(httpParams.getParams(), httpParams.getCharSet());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return contentString;
}
@Override
public byte[] praseRqeuestContentToBytes(HttpRequestParams<byte[]> httpParams) {
return httpParams.getParams();
}
@Override
public int praseRqeuestContentLength(HttpRequestParams<byte[]> httpParams) {
if (httpParams.getParams() != null) {
return httpParams.getParams().length;
} else {
return 0;
}
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.io.UnsupportedEncodingException;
import java.util.Map;
import java.util.Map.Entry;
/**
* Http 请求解析器:Map<String, String>
*
* @author Frank
*
*/
public class HttpRequestPraserKV implements HttpRequestPraser<Map<String, String>> {
/**
* 请求内容byte数组
*/
private byte[] contentBytes;
/**
* 请求内容字符串
*/
private String contentString;
@Override
public String praseRqeuestContentToString(HttpRequestParams<Map<String, String>> httpParams) {
if (contentString != null) {
return contentString;
}
Map<String, String> params = httpParams.getParams();
if (params == null || params.size() == 0) {
return null;
}
StringBuffer buffer = new StringBuffer();
for (Entry<String, String> entry : params.entrySet()) {
if (entry.getValue() != null) {
buffer.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
}
}
String param = buffer.toString();
contentString = param.substring(0, param.length() - 1);
return contentString;
}
@Override
public byte[] praseRqeuestContentToBytes(HttpRequestParams<Map<String, String>> httpParams) {
if (contentBytes != null) {
return contentBytes;
}
String paramStr = praseRqeuestContentToString(httpParams);
if (paramStr == null) {
return null;
}
try {
contentBytes = paramStr.getBytes(httpParams.getCharSet());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return contentBytes;
}
@Override
public int praseRqeuestContentLength(HttpRequestParams<Map<String, String>> httpParams) {
praseRqeuestContentToBytes(httpParams);
if (contentBytes != null) {
return contentBytes.length;
} else {
return 0;
}
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.io.UnsupportedEncodingException;
/**
* Http 请求解析器:String
*
* @author Frank
*
*/
public class HttpRequestPraserString implements HttpRequestPraser<String> {
/**
* 请求内容byte数组
*/
private byte[] contentBytes;
@Override
public String praseRqeuestContentToString(HttpRequestParams<String> httpParams) {
return httpParams.getParams();
}
@Override
public byte[] praseRqeuestContentToBytes(HttpRequestParams<String> httpParams) {
if (contentBytes != null) {
return contentBytes;
}
try {
contentBytes = httpParams.getParams().getBytes(httpParams.getCharSet());
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
contentBytes = null;
}
return contentBytes;
}
@Override
public int praseRqeuestContentLength(HttpRequestParams<String> httpParams) {
praseRqeuestContentToBytes(httpParams);
if (contentBytes != null) {
return contentBytes.length;
} else {
return 0;
}
}
}
package com.hand.hls.hlcm.emay.util.http;
/**
* Http 请求实体<String>
*
* @author Frank
*
*/
public class HttpRequestString extends HttpRequest<String> {
/**
*
* @param httpParams
* 请求参数
*/
public HttpRequestString(HttpRequestParams<String> httpParams) {
super(httpParams, new HttpRequestPraserString());
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.util.List;
import java.util.Map;
/**
* Http响应
*
* @author Frank
*
*/
public class HttpResponse<T> {
/**
* Http 结果代码
*/
private HttpResultCode resultCode;
/**
* Http链接Code
*/
private int httpCode;
/**
* Http响应头
*/
private Map<String, String> headers;
/**
* http响应Cookies
*/
private List<String> cookies;
/**
* http字符集
*/
private String charSet;
/**
* http响应数据
*/
private T result;
/**
*
* @param resultCode
* Http 结果代码
* @param httpCode
* Http链接Code
* @param headers
* Http响应头
* @param cookies
* http响应Cookies
* @param charSet
* http字符集
* @param result
* http响应数据
*/
public HttpResponse(HttpResultCode resultCode, int httpCode, Map<String, String> headers, List<String> cookies, String charSet, T result) {
this.resultCode = resultCode;
this.httpCode = httpCode;
this.headers = headers;
this.cookies = cookies;
this.charSet = charSet;
this.result = result;
}
public HttpResultCode getResultCode() {
return resultCode;
}
public void setResultCode(HttpResultCode resultCode) {
this.resultCode = resultCode;
}
public int getHttpCode() {
return httpCode;
}
public void setHttpCode(int httpCode) {
this.httpCode = httpCode;
}
public Map<String, String> getHeaders() {
return headers;
}
public void setHeaders(Map<String, String> headers) {
this.headers = headers;
}
public List<String> getCookies() {
return cookies;
}
public void setCookies(List<String> cookies) {
this.cookies = cookies;
}
public String getCharSet() {
return charSet;
}
public void setCharSet(String charSet) {
this.charSet = charSet;
}
public T getResult() {
return result;
}
public void setResult(T result) {
this.result = result;
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.util.List;
import java.util.Map;
/**
* http 响应: byte[]
*
* @author Frank
*
*/
public class HttpResponseBytes extends HttpResponse<byte[]> {
/**
*
* @param resultCode
* Http 结果代码
* @param httpCode
* Http链接Code
* @param headers
* Http响应头
* @param cookies
* http响应Cookies
* @param charSet
* http字符集
* @param result
* http响应数据
*/
public HttpResponseBytes(HttpResultCode resultCode, int httpCode, Map<String, String> headers, List<String> cookies, String charSet, byte[] result) {
super(resultCode, httpCode, headers, cookies, charSet, result);
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.io.ByteArrayOutputStream;
import java.util.List;
import java.util.Map;
/**
* 解析Byte[]响应的解析器
*
* @author Frank
*
*/
public class HttpResponseBytesPraser implements HttpResponsePraser<HttpResponseBytes> {
@Override
public HttpResponseBytes prase(HttpResultCode resultCode, int httpCode, Map<String, String> headers, List<String> cookies, String charSet, ByteArrayOutputStream outputStream) {
return new HttpResponseBytes(resultCode, httpCode, headers, cookies, charSet, outputStream == null ? null : outputStream.toByteArray());
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.io.ByteArrayOutputStream;
import java.util.List;
import java.util.Map;
/**
*
* Http响应解析器
*
* @author Frank
*
* @param <T>
* http响应数据转换后实体
*/
public interface HttpResponsePraser<T> {
/**
* 解析
*
* @param resultCode
* Http 结果代码
* @param httpCode
* Http链接Code
* @param headers
* Http响应头
* @param cookies
* http响应Cookies
* @param charSet
* http字符集
* @param result
* http响应数据
*/
public T prase(HttpResultCode resultCode, int httpCode, Map<String, String> headers, List<String> cookies, String charSet, ByteArrayOutputStream outputStream);
}
package com.hand.hls.hlcm.emay.util.http;
import java.util.List;
import java.util.Map;
/**
* http 响应: String
*
* @author Frank
*
*/
public class HttpResponseString extends HttpResponse<String> {
/**
*
* @param resultCode
* Http 结果代码
* @param httpCode
* Http链接Code
* @param headers
* Http响应头
* @param cookies
* http响应Cookies
* @param charSet
* http字符集
* @param result
* http响应数据
*/
public HttpResponseString(HttpResultCode resultCode, int httpCode, Map<String, String> headers, List<String> cookies, String charSet, String result) {
super(resultCode, httpCode, headers, cookies, charSet, result);
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;
/**
* 解析String响应的解析器
*
* @author Frank
*
*/
public class HttpResponseStringPraser implements HttpResponsePraser<HttpResponseString>{
@Override
public HttpResponseString prase(HttpResultCode resultCode, int httpCode, Map<String, String> headers, List<String> cookies, String charSet, ByteArrayOutputStream outputStream) {
String st = null;
try {
if(outputStream != null){
byte[] resultBytes = outputStream.toByteArray();
st = new String(resultBytes, charSet);
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return new HttpResponseString(resultCode, httpCode, headers, cookies, charSet, st);
}
}
package com.hand.hls.hlcm.emay.util.http;
/**
* HTTP 访问结果编码
*
* @author Frank
*
*/
public enum HttpResultCode {
SUCCESS("成功", "SUCCESS"), //
ERROR_URL_NULL("URL为空", "ERROR-URL-NULL"), //
ERROR_URL("URL访问失败", "ERROR-URL"), //
ERROR_HTTPS_SSL("HTTPS异常", "ERROR-HTTPS-SSL"), //
ERROR_METHOD("HTTP方法无法识别", "ERROR-METHOD"), //
ERROR_CHARSET("编码错误", "ERROR-CHARSET"), //
ERROR_CONNECT("访问失败", "ERROR-CONNECT"), //
ERROR_TIMEOUT("访问超时", "ERROR-TIMEOUT"), //
;
/**
* 名称
*/
private String name;
/**
* 编码
*/
private String code;
private HttpResultCode(String name, String code) {
this.name = name;
this.code = code;
}
public static String findNameByCode(String code) {
for (HttpResultCode oc : HttpResultCode.values()) {
if (oc.getCode().equals(code)) {
return oc.getName();
}
}
return null;
}
public static String findCodeByName(String name) {
for (HttpResultCode oc : HttpResultCode.values()) {
if (oc.getName().equals(name)) {
return oc.getCode();
}
}
return null;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
package com.hand.hls.hlcm.emay.util.http;
/**
* https 参数
*
* @author Frank
*
*/
public class HttpsParams {
private String password;// 密钥库密钥
private String keyStorePath;// 密钥库文件地址
private String trustStorePath;// 信任库文件地址
private String algorithm;// 指定交换数字证书的加密标准:JKS
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getKeyStorePath() {
return keyStorePath;
}
public void setKeyStorePath(String keyStorePath) {
this.keyStorePath = keyStorePath;
}
public String getTrustStorePath() {
return trustStorePath;
}
public void setTrustStorePath(String trustStorePath) {
this.trustStorePath = trustStorePath;
}
public String getAlgorithm() {
return algorithm;
}
public void setAlgorithm(String algorithm) {
this.algorithm = algorithm;
}
}
package com.hand.hls.hlcm.emay.util.http;
/**
* Https 请求实体<byte[]>
*
* @author Frank
*
*/
public class HttpsRequestBytes extends HttpRequest<byte[]> {
/**
*
* @param httpParams
* http请求参数
* @param httpsParams
* https参数
*/
public HttpsRequestBytes(HttpRequestParams<byte[]> httpParams, HttpsParams httpsParams) {
super(httpParams, httpsParams, new HttpRequestPraserBytes());
}
}
package com.hand.hls.hlcm.emay.util.http;
import java.util.Map;
/**
* Https 请求实体<Map<String, String>>
*
* @author Frank
*
*/
public class HttpsRequestKV extends HttpRequest<Map<String, String>> {
/**
*
* @param httpParams
* http请求参数
* @param httpsParams
* https参数
*/
public HttpsRequestKV(HttpRequestParams<Map<String, String>> httpParams, HttpsParams httpsParams) {
super(httpParams, httpsParams, new HttpRequestPraserKV());
}
}
package com.hand.hls.hlcm.emay.util.http;
/**
* Https 请求实体<String>
*
* @author Frank
*
*/
public class HttpsRequestString extends HttpRequest<String> {
/**
*
* @param httpParams
* http请求参数
* @param httpsParams
* https参数
*/
public HttpsRequestString(HttpRequestParams<String> httpParams, HttpsParams httpsParams) {
super(httpParams, httpsParams, new HttpRequestPraserString());
}
}
......@@ -127,4 +127,8 @@ leaf.logDebuggerModel=true
session.filter.excludePattern=
#layout config
layout.gridButtonIgnoreReadModel=false
\ No newline at end of file
layout.gridButtonIgnoreReadModel=false
#emay dev
emay.appId=EUCP-EMY-SMS0-JBZOQ
emay.secretKey=3E6BA3366DCF8959
emay.host=bjmtn.b2m.cn:80
\ No newline at end of file
......@@ -86,7 +86,9 @@
t1.lease_channel,
t2.cf_direction,
t2.billing_status,
t2.cf_status
t2.cf_status,
t1.business_type,
t1.business_type_desc
from acr_invoice_contract_v t1, ACR_INVOICE_CONTRACT_CF_V t2
where
t1.contract_id=t2.contract_id
......@@ -94,9 +96,9 @@
'250',
t1.inv_object_taxpayer_type,
t1.object_taxpayer_type) = 'SMALL_SCALE_TAXPAYER' and
to_char(t2.due_date,'yyyy-mm') <= to_char(SYSDATE,'yyyy-mm')) or (t2.write_off_flag = 'FULL' and t1.contract_status not in('REPURING','REPUR')) or(nvl(t2.write_off_flag,'NOT')='FULL' and t1.contract_status in('REPURING','REPUR') and t2.cf_item<>1) or (nvl(t2.write_off_flag,'NOT')='PARTIAL' and t1.contract_status in('REPURING','REPUR') and t2.cf_item=1 ) )
to_char(t2.due_date,'yyyy-mm') <= to_char(SYSDATE,'yyyy-mm')) or (t2.write_off_flag = 'FULL' and t1.contract_status not in('REPURING','REPUR')) or(nvl(t2.write_off_flag,'NOT')='FULL' and t1.contract_status in('REPURING','REPUR') and t2.cf_item<>1) or (nvl(t2.write_off_flag,'NOT') <> 'NOT' and t1.contract_status in('REPURING','REPUR') and t2.cf_item=1 ) )
AND cf_item<> 9
AND ((t2.cf_status='RELEASE' and t1.contract_status not in('REPURING','REPUR') and t2.cf_direction='INFLOW') or(t1.contract_status in ('REPURING','REPUR') and t2.cf_item=250 and t2.cf_status='RELEASE' )or ( t2.cf_status in('BLOCK') and nvl(t2.write_off_flag,'NOT')='PARTIAL' and nvl(t2.billing_status,'NOT') != 'FULL' and t1.contract_status in ('REPURING','REPUR') and t2.cf_item =1 and t2.cf_direction='NONCASH' and nvl(t2.billing_amount,0) <> t2.received_amount))
AND ((t2.cf_status='RELEASE' and t1.contract_status not in('REPURING','REPUR') and t2.cf_direction='INFLOW') or(t1.contract_status in ('REPURING','REPUR') and t2.cf_item in(1,250) and t2.cf_status='RELEASE' )or ( t2.cf_status in('BLOCK') and nvl(t2.write_off_flag,'NOT')='PARTIAL' and nvl(t2.billing_status,'NOT') != 'FULL' and t1.contract_status in ('REPURING','REPUR') and t2.cf_item =1 and t2.cf_direction='NONCASH' and nvl(t2.billing_amount,0) <> t2.received_amount))
and t2.cashflow_id not in (20265,34267,24445)
and nvl(t2.billing_status,'NOT') != 'FULL'
--and t2.cf_direction='INFLOW'
......@@ -192,7 +194,9 @@
t1.lease_channel,
NULL cf_direction,
NULL billing_status,
NULL cf_status
NULL cf_status,
t1.business_type,
t1.business_type_desc
from acr_invoice_contract_v t1, acr_invoice_penalty_v t2
where
t2.contract_id=t1.contract_id
......@@ -283,6 +287,8 @@
<bm:field name="bp_id_agent_level1_n"/>
<bm:field name="termination_date"/>
<bm:field name="lease_channel"/>
<bm:field name="business_type_desc"/>
<bm:field name="business_type"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="billing_object_name" queryExpression="vv.billing_object_name = ${@billing_object_name}"/>
......@@ -314,6 +320,7 @@
<bm:query-field name="project_name" queryExpression="vv.project_name like &apos;%&apos;||${@project_name}||&apos;%&apos; "/>
<bm:query-field name="contract_name" queryExpression="vv.contract_name like &apos;%&apos;||${@contract_name}||&apos;%&apos; "/>
<bm:query-field name="document_type" queryExpression="vv.document_type=${@document_type}"/>
<bm:query-field name="business_type" queryExpression="vv.business_type=${@business_type}"/>
<bm:query-field name="contract_status" queryExpression="vv.contract_status = ${@contract_status}"/>
<bm:query-field name="bp_id_agent_level1" queryExpression="vv.bp_id_agent_level1 = ${@bp_id_agent_level1}"/>
<bm:query-field name="bp_id_agent_level1_n" queryExpression="vv.bp_id_agent_level1_n like &apos;%&apos;||${@bp_id_agent_level1_n}||&apos;%&apos;"/>
......
......@@ -318,7 +318,10 @@
AND ccc.cf_status = 'RELEASE'
AND to_char(ccc.due_date, 'yyyymm') >
to_char(to_date(${@base_date}, 'yyyy-mm-dd'),
'yyyymm')),0) net_future_interest
'yyyymm')),0) net_future_interest,
(Select bt.description
From hls_business_type bt
Where bt.business_type = t.business_type) business_type_n
FROM con_contract t
WHERE t.data_class = 'NORMAL'
......@@ -327,6 +330,9 @@
trunc(to_date(${@due_date_from}, 'yyyy-mm-dd'))
AND trunc(t.lease_start_date) <=
trunc(to_date(${@due_date_to}, 'yyyy-mm-dd'))
And ((${@business_type} is null) or
(${@business_type} is not null and
t.business_type = ${@business_type}))
) v
......
......@@ -29,5 +29,6 @@
<bm:query-field name="journal_date_from" queryExpression="to_char(t.journal_date,&apos;yyyy-mm-dd&apos;) &gt;= ${@journal_date_from}"/>
<bm:query-field name="journal_date_to" queryExpression="to_char(t.journal_date,&apos;yyyy-mm-dd&apos;) &lt;= ${@journal_date_to}"/>
<bm:query-field name="bp_id_agent_level1" queryExpression="t.bp_id_agent_level1=${@bp_id_agent_level1}"/>
<bm:query-field name="business_type" queryExpression="t.business_type=${@business_type}"/>
</bm:query-fields>
</bm:model>
......@@ -70,8 +70,9 @@
<bm:pk-field name="contract_id"/>
</bm:primary-key>
<bm:query-fields>
<bm:query-field field="contract_number" queryExpression="contract_number like upper(&apos;%&apos;||${@contract_number}||&apos;%&apos;)"/>
<!-- <bm:query-field field="contract_number" queryExpression="contract_number like upper(&apos;%&apos;||${@contract_number}||&apos;%&apos;)"/>-->
<bm:query-field field="owner_user_id" queryOperator="="/>
<bm:query-field field="contract_number" queryOperator="="/>
<bm:query-field field="bp_id_tenant" queryOperator="="/>
<!-- <bm:query-field field="lease_organization" queryOperator="="/>-->
<bm:query-field field="contract_status" queryOperator="="/>
......
......@@ -51,7 +51,10 @@
Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount,
nvl(cwo.trans_pently_flag, 'N') trans_pently_flag
decode((Select count(1)
From penalty_trans_write_off t1
Where t1.csh_write_off_id = cwo.write_off_id
And t1.trans_pently_hd_id = ${@record_id}),0,'N','Y')trans_pently_flag
From con_contract_cashflow ccc,
con_contract c,
hls_bp_master h,
......
......@@ -78,6 +78,10 @@
(select contract_number
from con_contract
where contract_id = t.contract_id) contract_number,
(Select bt.description
From hls_business_type bt,con_contract ct
Where bt.business_type = ct.business_type
and ct.contract_id = t.contract_id) As business_type_n,
t.account_code account_id_n,
(select description_text
from fnd_descriptions
......@@ -164,6 +168,10 @@
(select contract_number
from con_contract
where contract_id = tt.contract_id) contract_number,
(Select bt.description
From hls_business_type bt,con_contract ct
Where bt.business_type = ct.business_type
and ct.contract_id = tt.contract_id) As business_type_n,
'小计:' account_id_n,
null account_name,
tt.contract_id,
......@@ -259,6 +267,7 @@
p_due_date =>to_date(${@due_date},'yyyy-mm-dd'),
p_user_id =>${/session/@user_id},
p_bp_id =>${@bp_id},
p_business_type =>${@business_type},
p_overday1 =>${@overday1},
p_overday2 =>${@overday2},
p_overday3 =>${@overday3},
......@@ -274,6 +283,7 @@
</bm:operations>
<bm:fields>
<bm:field name="division_n"/>
<bm:field name="business_type_n"/>
<bm:field name="contract_id"/>
<bm:field name="bp_code"/>
<bm:field name="contract_number"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select ccw.due_amount a,ccw.due_amount b from con_contract_cashflow ccw where rownum<=2
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select ccw.due_amount a,ccw.due_amount b from con_contract_cashflow ccw where rownum<=5
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
......@@ -50,7 +50,18 @@
p_role_flag => ${@role_flag},
p_csh_date => ${@csh_date},
p_ref_v04 => ${@ref_v04},
p_user_id => ${/session/@user_id});
p_user_id => ${/session/@user_id},
p_err_msg=> ${@p_err_msg});
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="p_err_msg" dataType="java.lang.String" input="false" output="true" outputPath="@p_err_msg"/>
</bm:parameters>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
hls_monthend_new_pkg.csh_check_acr(p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
......
......@@ -29,7 +29,7 @@ SELECT h.period_year,
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
SUM(decode(reference6, NULL, 0, NVL(l.amount_cr,0))) amount_tax,
decode(reference6, NULL, 0, NVL(round(l.amount_cr,2),0)) amount_tax,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
'违约金',
......@@ -48,69 +48,72 @@ SELECT h.period_year,
0,
'设备款')
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id)) times,
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
'违约金') times,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
h.journal_date,
'HL_SALES_TAX_ACT_NEW',
(SELECT due_date
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id)) due_date,
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
h.journal_date) due_date,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, l.amount_dr, 0)),
decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW',
(SELECT due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id)) due_amount,
WHERE cashflow_id = l.cashflow_id),
decode(reference6, NULL, l.amount_dr, 0),
'CON_REPURCHASE',
decode(reference6, NULL, l.amount_dr, 0)) due_amount,
(SELECT principal
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id) principal,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, l.amount_dr, 0)),
decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW',
(SELECT decode(cf_item, 8, due_amount, interest)
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id)) interest,
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
decode(reference6, NULL, l.amount_dr, 0)
) interest,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, 0, NVL(l.amount_cr,0))),
decode(reference6, NULL, 0, NVL(l.amount_cr,0)),
'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id)) vat_due_amount,
nvl(ROUND((DECODE(h.je_transaction_code,
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
decode(reference6, NULL, 0, NVL(l.amount_cr,0))) vat_due_amount,
nvl(ROUND((DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, 0, NVL(l.amount_cr,0))),
l.amount_cr/(l.reference7-l.amount_cr),
'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount
(SELECT vat_due_amount/(due_amount-vat_due_amount)
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id))) /
(DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, l.amount_dr, 0)),
'HL_SALES_TAX_ACT_NEW',
(SELECT due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id
AND due_amount > 0)) -
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, 0, NVL(l.amount_cr,0))),
'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id
AND vat_due_amount > 0))),
2) * 100,
0) || '%' vat_rate,
h.je_transaction_code
FROM hls_journal_header h, hls_journal_detail l
WHERE cashflow_id = l.cashflow_id),
l.amount_cr/(l.reference7-l.amount_cr),
'CON_REPURCHASE',
l.amount_cr/(l.reference7-l.amount_cr))),2) * 100,0)|| '%' vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
AND h.je_transaction_code IN
and ga.account_id=l.account_id
and ga.account_code='2221001020'
and h.reversed_flag='N'
AND ((h.je_transaction_code IN
('HL_SALES_TAX_ACT_NEW', 'HL_CSH_CONSOLIDATION_DALAY')
)or(h.je_transaction_code = 'CON_REPURCHASE' and
instr(h.description, '调平') > 0))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
......@@ -118,20 +121,29 @@ SELECT h.period_year,
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period}
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n04 = l.journal_line_id))
GROUP BY l.reference1,
reference3,
reference4,
h.sbo_num,
l.cashflow_id,
l.journal_header_id,
h.je_transaction_code,
h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date
li.ref_n03 = l.journal_header_id))
UNION
select vl.*
from ET_VAT_JOURNAL_LV vl
where not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date, 'yyyymm') <= ${@base_period}
AND (li.cashflow_id = vl.cashflow_id))
UNION
select rl.*
from REPURSE_VAT_JOURNAL_LV rl
where not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date, 'yyyymm') <= ${@base_period}
AND (li.cashflow_id = rl.cashflow_id))
UNION
UNION
SELECT h.period_year,
h.period_num,
......@@ -153,7 +165,7 @@ SELECT h.period_year,
AND li.cf_item = 2
and hi.contract_id = l.source_doc_id
AND ROWNUM = 1) invoice_date,
l.amount_dr amount_tax,
round(l.amount_dr,2) amount_tax,
'首付款' times,
(SELECT due_date
......@@ -186,26 +198,20 @@ SELECT h.period_year,
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) vat_due_amount,
NVL(ROUND((
(SELECT vat_due_amount
NVL(ROUND(
(SELECT vat_due_amount/net_due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1)
/
(SELECT net_due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1)
),
AND ROWNUM = 1),
2) * 100,
0) || '%' vat_rate,
h.je_transaction_code
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.reversed_flag='N'
AND h.je_transaction_code = 'LEASE_INCEPT'
AND l.je_template_ln_id = 8797
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
......@@ -223,6 +229,7 @@ SELECT h.period_year,
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="to_char(t1.journal_date,'yyyymm') = ${@base_period}"/>
<bm:data-filter enforceOperations="query" expression="t1.amount_tax > 0"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
......
......@@ -44,7 +44,7 @@
WHERE t.session_id=${/session/@session_id}
) t1
#WHERE_CLAUSE#
order by invoice_hd_id,due_date ASC,invoice_line_id asc
order by invoice_hd_id,due_date ASC,invoice_number asc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
......
......@@ -82,6 +82,9 @@
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID').style.display = 'none';
}
if (record.get('contract_status') == 'REPUR'&&record.get('contract_status') == 'REPURING') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_BP_ID_TENANT_BF_REPUR_N').style.display = 'none';
}
}
};
......
......@@ -38,6 +38,7 @@
$(ds).setQueryParameter('due_date_from',record.get('due_date_from'));
$(ds).setQueryParameter('due_date_to',record.get('due_date_to'));
$(ds).setQueryParameter('base_date',record.get('base_date'));
$(ds).setQueryParameter('business_type',record.get('business_type'));
$(ds).query();
}else{
$L.showInfoMessage("提示",'请输入字段:租赁开始日从、租赁开始日到、基准日!');
......
......@@ -153,6 +153,13 @@
}
}
}
function change_background_color(record) {
if (record.get('trans_pently_flag') == 'Y') {
return 'background-color:#00ff00';
}
}
]]></script>
<a:dataSets>
<a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true"
......@@ -164,7 +171,7 @@
</a:dataSet>
<a:dataSet id="con7000_csh_write_off_ds" fetchAll="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_csh_write_off"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_csh_write_off/query?contract_id=${/parameter/@contract_id}"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_csh_write_off/query?contract_id=${/parameter/@contract_id}&amp;record_id=${/parameter/@record_id}"
selectable="true">
<a:events>
<a:event name="load" handler="con7000_csh_write_off_ds_load"/>
......@@ -209,7 +216,7 @@
<a:tabs>
<a:tab prompt="营业违约金核销明细" width="150">
<a:grid id="con7000_csh_write_off_grid" bindTarget="con7000_csh_write_off_ds" marginHeight="130"
marginWidth="200" navBar="true">
marginWidth="200" navBar="true" rowRenderer="change_background_color">
<a:columns>
<a:column name="times" prompt="回数" width="70" align="center"/>
<a:column name="due_date" prompt="预定支付日" width="120" align="center"
......
......@@ -47,6 +47,13 @@
function con7000_csh_write_off_ds_unselect(ds, record) {
return false;
}
function change_background_color(record) {
if (record.get('trans_pently_flag') == 'Y') {
return 'background-color:#00ff00';
}
}
]]></script>
<a:dataSets>
<a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true"
......@@ -55,7 +62,7 @@
</a:dataSet>
<a:dataSet id="con7000_csh_write_off_ds" autoPageSize="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_csh_write_off"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_csh_write_off/query?contract_id=${/parameter/@contract_id}"
queryUrl="${/request/@context_path}/autocrud/cont.CON7001.con_rent_trans_penalty_csh_write_off/query?contract_id=${/parameter/@contract_id}&amp;record_id=${/parameter/@record_id}"
selectable="true" showCheckAll="false">
<a:events>
<a:event name="load" handler="con7000_csh_write_off_ds_load"/>
......@@ -98,7 +105,7 @@
<a:tabs>
<a:tab prompt="营业违约金核销明细" width="150">
<a:grid id="con7000_csh_write_off_grid" bindTarget="con7000_csh_write_off_ds" marginHeight="130"
marginWidth="200" navBar="true">
marginWidth="200" navBar="true" rowRenderer="change_background_color">
<a:columns>
<a:column name="times" prompt="回数" width="70" align="center"/>
<a:column name="due_date" prompt="预定支付日" width="120" align="center"
......
......@@ -20,6 +20,7 @@
para: {
due_date : record.get('due_date'),
bp_id : record.get('bp_id_agent_level1'),
business_type : record.get('business_type'),
overday1:record.get('overdue_day1'),
overday2:record.get('overdue_day2'),
overday3:record.get('overdue_day3'),
......@@ -53,9 +54,18 @@
}
]]></script>
<a:dataSets>
<a:dataSet id="business_type_desc_ds">
<a:datas>
<a:record code_value="LEASE" code_value_name="直租"/>
<a:record code_value="LEASEBACK" code_value_name="售后回租"/>
</a:datas>
</a:dataSet>
<a:dataSet id="gld_accounts_ds" loadData="true" model="cont.CON930.gld_accounts_ds"/>
<a:dataSet id="con_contract_cashflow_monthly_query_ds" autoCreate="true">
<a:fields>
<a:field name="business_type"/>
<a:field name="business_type_desc" displayField="code_value_name" options="business_type_desc_ds"
returnField="business_type" valueField="code_value" prompt="业务类型"/>
<a:field name="due_date" required="true" prompt="基准日期"/>
<a:field name="bp_id_agent_level1" />
<a:field name="account_name" displayField="account_name" options="gld_accounts_ds" returnField="account_id" valueField="account_id"/>
......@@ -87,6 +97,7 @@
</a:screenTopToolbar>
<a:form bindTarget="con_contract_cashflow_balance_query_ds" column="4" title="收付款预定查询" marginWidth="40">
<a:datePicker name="due_date" bindTarget="con_contract_cashflow_monthly_query_ds"/>
<a:comboBox name="business_type_desc" bindTarget="con_contract_cashflow_monthly_query_ds"/>
<!-- <a:lov name="bp_id_agent_level1_n" bindTarget="con_contract_cashflow_monthly_query_ds"/>-->
<!-- <a:numberField name="overdue_day1" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>-->
<!-- <a:numberField name="overdue_day2" bindTarget="con_contract_cashflow_monthly_query_ds" allowDecimals="false"/>-->
......@@ -111,6 +122,7 @@
<a:column name="division_n" align="center" prompt="租赁物" width="220"/>
<a:column name="bp_id_agent_level1_n" align="center" prompt="代理店" width="200"/>
<a:column name="contract_number" align="center" prompt="合同号" width="120"/>
<a:column name="business_type_n" align="center" prompt="业务类型" width="80"/>
<a:column name="bp_code" align="center" prompt="业务伙伴号" width="100"/>
<a:column name="account_id_n" align="center" prompt="科目代码" width="120"/>
<a:column name="account_name" align="center" prompt="科目名称" width="180"/>
......
......@@ -19,7 +19,7 @@
function cshdeposit102_transfer_submit() {
if ($('deposit_transfer_detail_result_ds').validate()) {
var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
var head_record = $('deposit_transfer_maintain_result_ds').getSelected()[0];
var deposit_records = $('deposit_transfer_detail_result_ds').getAll();
var param = {};
var saveData = [];
......@@ -116,7 +116,7 @@
function on_csh_trx_deposit_write_off_update(ds, record, name, value, oldvalue) {
debugger;
var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
var head_record = $('deposit_transfer_maintain_result_ds').getSelected()[0];
var unwrite_off_amount = get_current_amount(head_record.get("unwrite_off_amount"));
if (name == 'deposit_amount') {
if ((!Ext.isEmpty(value) || !Ext.isEmpty(oldvalue)) && value != oldvalue) {
......@@ -149,7 +149,7 @@
debugger;
var selected = [].concat(ds.getSelected());
var head_record = $('deposit_transfer_maintain_result_ds').getAt(0);
var head_record = $('deposit_transfer_maintain_result_ds').getSelected()[0];
var change_value = get_current_amount(record.get('deposit_amount')),
current_apply_amount = get_current_amount(head_record.get('current_apply_amount'));
// setTimeout(function () {
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:dr="leaf.plugin.excelreport" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-query fetchAll="true" model="excel_test" rootPath="/model/datasource"/>
<a:model-query fetchAll="true" model="excel_test1" rootPath="/model/datasource1"/>
<dr:excel-report enableTask="false" filename="exceltest.xlsm" template="D:\u01\hls_file\test111.xlsm">
<dr:styles>
<dr:cell-style name="cell1" align="ALIGN_LEFT" vertical="VERTICAL_CENTER">
<dr:font bold="false" fontName="宋体" height="9"/>
</dr:cell-style>
<dr:cell-style name="cell2" align="ALIGN_LEFT" vertical="VERTICAL_CENTER">
<dr:font bold="false" fontName="Arial" height="9"/>
</dr:cell-style>
<dr:cell-style name="cell3" align="ALIGN_CENTER" vertical="VERTICAL_CENTER">
<dr:font bold="false" fontName="Arial" fontcolor="RED" height="9"/>
</dr:cell-style>
<dr:cell-style name="header" cell_style_id="2" foregroundcolor="BLACK">
<dr:font cell_style_id="2" fontname="宋体" height="10"/>
</dr:cell-style>
<dr:cell-style name="header2" cell_style_id="2" foregroundcolor="RED">
<dr:font cell_style_id="2" fontcolor="RED" fontname="宋体" height="10"/>
</dr:cell-style>
</dr:styles>
<dr:sheets>
<dr:sheet name="A2-底层参数" autoSizeColumns="3" displayGridlines="true">
<!-- <dr:static-content>-->
<!-- <dr:cell-data cell="A" row="1" stylename="cell_center" type="content" value="100"/>-->
<!-- <dr:cell-data cell="B" row="1" type="content" value="200"/>-->
<!-- </dr:static-content>-->
<dr:dynamic-content cell="A" dataModel="/model/datasource">
<dr:columns>
<dr:table-column cellStyle="cell1" field="a" type="content"/>
<dr:table-column cellStyle="cell1" field="b" type="content"/>
</dr:columns>
</dr:dynamic-content>
<dr:dynamic-content cell="0" dataModel="/model/datasource1">
<dr:columns>
<dr:table-column cellStyle="cell1" field="a" type="content"/>
<dr:table-column cellStyle="cell1" field="b" type="content"/>
</dr:columns>
</dr:dynamic-content>
</dr:sheet>
<!-- <dr:sheet name="备注" autoSizeColumns="0,1,2,3" displayGridlines="true">
<dr:dynamic-content cell="C" dataModel="/model/datasource">
<dr:columns>
<dr:table-column cellStyle="cell1" title="电话催收:CALL电子邮件催收:EMAIL催款函催收:LETTER短信催收:MESSAGE上门拜访:VISIT" titlestyle="header2" type="content"/>
</dr:columns>
</dr:dynamic-content>
</dr:sheet> -->
</dr:sheets>
</dr:excel-report>
<s:server-script><![CDATA[
println(222222);
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:dr="leaf.plugin.excelreport" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<!-- <a:model-query fetchAll="true" model="excel_test" rootPath="/model/datasource"/>-->
<s:server-script><![CDATA[
importPackage(Packages.com.hand.hls.hlcm.emay);
var example = new Example();
var result=example.setSingleSms('Testsms', '18225695917');
var aa=JSON.parse(result);
println(2222);
println(aa.code);
println(JSON.stringify(aa.result));
// println("result"+JSON.stringify(result));
]]></s:server-script>
<!-- <dr:excel-report enableTask="false" filename="exceltest.xlsx" template="D:\u01\hls_file\test.xlsx">-->
<!-- <dr:styles>-->
<!-- <dr:cell-style name="cell1" align="ALIGN_LEFT" vertical="VERTICAL_CENTER">-->
<!-- <dr:font bold="false" fontName="宋体" height="9"/>-->
<!-- </dr:cell-style>-->
<!-- <dr:cell-style name="cell2" align="ALIGN_LEFT" vertical="VERTICAL_CENTER">-->
<!-- <dr:font bold="false" fontName="Arial" height="9"/>-->
<!-- </dr:cell-style>-->
<!-- <dr:cell-style name="cell3" align="ALIGN_CENTER" vertical="VERTICAL_CENTER">-->
<!-- <dr:font bold="false" fontName="Arial" fontcolor="RED" height="9"/>-->
<!-- </dr:cell-style>-->
<!-- <dr:cell-style name="header" cell_style_id="2" foregroundcolor="BLACK">-->
<!-- <dr:font cell_style_id="2" fontname="宋体" height="10"/>-->
<!-- </dr:cell-style>-->
<!-- <dr:cell-style name="header2" cell_style_id="2" foregroundcolor="RED">-->
<!-- <dr:font cell_style_id="2" fontcolor="RED" fontname="宋体" height="10"/>-->
<!-- </dr:cell-style>-->
<!-- </dr:styles>-->
<!-- <dr:sheets>-->
<!-- <dr:sheet name="催收明细" autoSizeColumns="0,1" displayGridlines="true">-->
<!--&lt;!&ndash; <dr:static-content>&ndash;&gt;-->
<!--&lt;!&ndash; <dr:cell-data cell="A" row="1" stylename="cell_center" type="content" value="100"/>&ndash;&gt;-->
<!--&lt;!&ndash; <dr:cell-data cell="B" row="1" type="content" value="200"/>&ndash;&gt;-->
<!--&lt;!&ndash; </dr:static-content>&ndash;&gt;-->
<!-- <dr:dynamic-content cell="A" dataModel="/model/datasource">-->
<!-- <dr:columns>-->
<!-- <dr:table-column cellStyle="cell1" field="a" type="content"/>-->
<!-- <dr:table-column cellStyle="cell1" field="b" type="content"/>-->
<!-- </dr:columns>-->
<!-- </dr:dynamic-content>-->
<!-- </dr:sheet>-->
<!-- &lt;!&ndash; <dr:sheet name="备注" autoSizeColumns="0,1,2,3" displayGridlines="true">-->
<!-- <dr:dynamic-content cell="C" dataModel="/model/datasource">-->
<!-- <dr:columns>-->
<!-- <dr:table-column cellStyle="cell1" title="电话催收:CALL电子邮件催收:EMAIL催款函催收:LETTER短信催收:MESSAGE上门拜访:VISIT" titlestyle="header2" type="content"/>-->
<!-- </dr:columns>-->
<!-- </dr:dynamic-content>-->
<!-- </dr:sheet> &ndash;&gt;-->
<!-- </dr:sheets>-->
<!-- </dr:excel-report>-->
<!-- <s:server-script><![CDATA[-->
<!-- println(222222);-->
<!-- ]]></s:server-script>-->
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
......@@ -1022,7 +1022,8 @@
if (bp_tenant_detail_r) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n') {
if (!bp_tenant_detail_r.get(key)) {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key)== "null"||typeof bp_tenant_detail_r.get(key)== "undefined"|| bp_tenant_detail_r.get(key)=== "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方信用度\"外,其他都为必输字段,请填写!");
return;
}
......@@ -1144,7 +1145,8 @@
if (bp_tenant_detail_r && ds.id == prj_project_ds_id) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n') {
if (!bp_tenant_detail_r.get(key)) {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key)== "null"||typeof bp_tenant_detail_r.get(key)== "undefined"|| bp_tenant_detail_r.get(key)=== "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方信用度\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
......
......@@ -305,7 +305,8 @@
if (bp_tenant_detail_r && ds.id == prj_project_ds_id) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id'&& key != 'third_party_credibility' && key != 'third_party_credibility_n') {
if(!bp_tenant_detail_r.get(key)){
//if(!bp_tenant_detail_r.get(key)){
if (typeof bp_tenant_detail_r.get(key)== "null"||typeof bp_tenant_detail_r.get(key)== "undefined"|| bp_tenant_detail_r.get(key)=== "") {
Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方信用度\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment