Commit 14247df4 authored by congzhao's avatar congzhao

Merge branch 'develop' of https://hel.hand-china.com/hlcm/leaf-hlcm into 建机电子合同开发

parents 55047458 ed545c7d
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 ...@@ -127,4 +127,8 @@ leaf.logDebuggerModel=true
session.filter.excludePattern= session.filter.excludePattern=
#layout config #layout config
layout.gridButtonIgnoreReadModel=false layout.gridButtonIgnoreReadModel=false
\ No newline at end of file #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 @@ ...@@ -86,7 +86,9 @@
t1.lease_channel, t1.lease_channel,
t2.cf_direction, t2.cf_direction,
t2.billing_status, 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 from acr_invoice_contract_v t1, ACR_INVOICE_CONTRACT_CF_V t2
where where
t1.contract_id=t2.contract_id t1.contract_id=t2.contract_id
...@@ -94,9 +96,9 @@ ...@@ -94,9 +96,9 @@
'250', '250',
t1.inv_object_taxpayer_type, t1.inv_object_taxpayer_type,
t1.object_taxpayer_type) = 'SMALL_SCALE_TAXPAYER' and 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 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 t2.cashflow_id not in (20265,34267,24445)
and nvl(t2.billing_status,'NOT') != 'FULL' and nvl(t2.billing_status,'NOT') != 'FULL'
--and t2.cf_direction='INFLOW' --and t2.cf_direction='INFLOW'
...@@ -192,7 +194,9 @@ ...@@ -192,7 +194,9 @@
t1.lease_channel, t1.lease_channel,
NULL cf_direction, NULL cf_direction,
NULL billing_status, 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 from acr_invoice_contract_v t1, acr_invoice_penalty_v t2
where where
t2.contract_id=t1.contract_id t2.contract_id=t1.contract_id
...@@ -283,6 +287,8 @@ ...@@ -283,6 +287,8 @@
<bm:field name="bp_id_agent_level1_n"/> <bm:field name="bp_id_agent_level1_n"/>
<bm:field name="termination_date"/> <bm:field name="termination_date"/>
<bm:field name="lease_channel"/> <bm:field name="lease_channel"/>
<bm:field name="business_type_desc"/>
<bm:field name="business_type"/>
</bm:fields> </bm:fields>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="billing_object_name" queryExpression="vv.billing_object_name = ${@billing_object_name}"/> <bm:query-field name="billing_object_name" queryExpression="vv.billing_object_name = ${@billing_object_name}"/>
...@@ -314,6 +320,7 @@ ...@@ -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="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="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="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="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" 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;"/> <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;"/>
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
t.cf_billing_amount, t.cf_billing_amount,
t.received_amount, t.received_amount,
t.contract_id, t.contract_id,
cf.principal, decode(t.cf_item, 101, 0, cf.principal) principal,
cf.interest, cf.interest,
con.contract_number, con.contract_number,
con.contract_name, con.contract_name,
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 下午06:07:55
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
acr_invoice_pkg.acr_invoice_status_change(p_invoice_hd=> ${@invoice_hd_ids},
p_want_status=>${@want_status},
p_user_id=>${/session/@user_id} );
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
acr_invoice_pkg.acr_invoice_status_reject(p_invoice_hd_id=> ${@invoice_hd_id},
p_want_status=>${@want_status},
p_user_id=>${/session/@user_id} );
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 上午09:06:33
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM (SELECT t1.invoice_hd_id,
t1.document_number,
TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') AS invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
nvl(t1.contract_name,(select contract_name from con_contract
where contract_id =(select cf.contract_id
from con_contract_Cashflow cf,acr_invoice_ln ln
where ln.invoice_hd_id=t1.invoice_hd_id
and cf.cashflow_id=ln.cashflow_id
and rownum=1)
))contract_name, --modify by wuts 2019-1-22
--decode(t1.lease_channel,'01',t1.project_name,'') contract_name2,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.invoice_title,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
TO_CHAR(t1.accounting_date, 'yyyy-mm-dd') AS accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id
FROM acr_invoice_hd_v t1
ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE#
ORDER BY invoice_date DESC, document_number DESC
]]></bm:query-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.delete_invoice(p_invoice_hd_id => ${@invoice_hd_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE
acr_invoice_hd a
SET
a.merge_flag = ${@merge_flag}
WHERE
a.invoice_hd_id = ${@invoice_hd_id};
acr_invoice_pkg.invoice_row_merge(p_invoice_hd_id => ${@invoice_hd_id}, p_user_id => ${/session/@user_id}, p_merge_flag =>${@merge_flag});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/>
<bm:query-field name="document_number_t" queryExpression="t1.document_number &lt;= ${@document_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &lt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<bm:query-field name="contract_name" queryExpression="t1.contract_name like ${@contract_name}"/>
<bm:query-field name="invoice_bp_name" queryExpression="t1.invoice_bp_name like ${@invoice_bp_name}"/>
<bm:query-field name="invoice_status" queryExpression="t1.invoice_status like ${@invoice_status}"/>
<bm:query-field name="invoice_date_f" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/>
<!--
<bm:query-field name="contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
-->
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;CONFIRMING&apos;,&apos;REJECT&apos;)"/>
<bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: LR
$Date: 2013-7-16 上午09:06:33
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM (SELECT t1.invoice_hd_id,
t1.document_number,
TO_CHAR(t1.invoice_date, 'yyyy-mm-dd') AS invoice_date,
t1.document_category,
t1.contract_id,
t1.contract_number,
nvl(t1.contract_name,(select contract_name from con_contract
where contract_id =(select cf.contract_id
from con_contract_Cashflow cf,acr_invoice_ln ln
where ln.invoice_hd_id=t1.invoice_hd_id
and cf.cashflow_id=ln.cashflow_id
and rownum=1)
))contract_name, --modify by wuts 2019-1-22
--decode(t1.lease_channel,'01',t1.project_name,'') contract_name2,
t1.project_id,
t1.project_number,
t1.project_name,
t1.invoice_bp_id,
t1.invoice_bp_code,
t1.invoice_bp_name,
t1.invoice_title,
t1.invoice_number,
t1.invoice_status,
t1.invoice_status_desc,
t1.currency,
t1.business_type,
t1.business_type_desc,
t1.invoice_kind,
t1.invoice_kind_desc,
t1.document_type,
t1.created_by_name,
t1.created_by,
TO_CHAR(t1.accounting_date, 'yyyy-mm-dd') AS accounting_date,
t1.total_amount,
t1.tax_amount,
t1.billing_method,
t1.lease_organization,
t1.lease_channel,
t1.division,
t1.company_id,
t1.spv_company_id
FROM acr_invoice_hd_v t1
ORDER BY t1.invoice_date DESC, t1.document_number DESC) t1 #WHERE_CLAUSE#
ORDER BY invoice_date DESC, document_number DESC
]]></bm:query-sql>
</bm:operation>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
begin
ACR_INVOICE_PKG.delete_invoice(p_invoice_hd_id => ${@invoice_hd_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
UPDATE
acr_invoice_hd a
SET
a.merge_flag = ${@merge_flag}
WHERE
a.invoice_hd_id = ${@invoice_hd_id};
acr_invoice_pkg.invoice_row_merge(p_invoice_hd_id => ${@invoice_hd_id}, p_user_id => ${/session/@user_id}, p_merge_flag =>${@merge_flag});
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/>
<bm:query-field name="document_number_t" queryExpression="t1.document_number &lt;= ${@document_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &lt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<bm:query-field name="contract_name" queryExpression="t1.contract_name like ${@contract_name}"/>
<bm:query-field name="invoice_bp_name" queryExpression="t1.invoice_bp_name like ${@invoice_bp_name}"/>
<bm:query-field name="invoice_status" queryExpression="t1.invoice_status like ${@invoice_status}"/>
<bm:query-field name="invoice_date_f" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="to_date(t1.invoice_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="to_date(t1.accounting_date,&apos;yyyy-mm-dd&apos;) &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/>
<!--
<bm:query-field name="contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
-->
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="lease_channel" queryExpression="t1.lease_channel = ${@lease_channel}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.invoice_status in( &apos;NEW&apos;,&apos;CONFIRMING&apos;,&apos;REJECT&apos;)"/>
<bm:data-filter enforceOperations="query" expression="nvl(t1.spv_company_id,t1.company_id)=${/session/@company_id}"/>
</bm:data-filters>
</bm:model>
...@@ -67,6 +67,8 @@ ...@@ -67,6 +67,8 @@
<bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/> <bm:field name="vender_id_n" expression="(decode(vender_id,-100,'买断机',(select scv.bp_name from hls_bp_master scv where scv.enabled_flag=&apos;Y&apos; and scv.bp_id = t1.vender_id)))" forInsert="false" forUpdate="false"/>
<bm:field name="finance_type_n" expression="(select code_value_name from sys_code_values_v scv where scv.code=&apos;FINANCE_TYPE&apos; and scv.code_value = t1.finance_type)" forInsert="false" forUpdate="false"/> <bm:field name="finance_type_n" expression="(select code_value_name from sys_code_values_v scv where scv.code=&apos;FINANCE_TYPE&apos; and scv.code_value = t1.finance_type)" forInsert="false" forUpdate="false"/>
<bm:field name="pay_method"/>
<bm:field name="pay_method_n" expression="(select v.code_value_name from sys_code_values_v v where v.code = &apos;PAY_METHODS&apos; and v.code_value=t1.pay_method)" forInsert="false" forUpdate="false"/>
</bm:fields> </bm:fields>
<bm:features> <bm:features>
<o:sequence-pk sequenceName="con_contract_tmpt_clause_s"/> <o:sequence-pk sequenceName="con_contract_tmpt_clause_s"/>
......
...@@ -318,7 +318,10 @@ ...@@ -318,7 +318,10 @@
AND ccc.cf_status = 'RELEASE' AND ccc.cf_status = 'RELEASE'
AND to_char(ccc.due_date, 'yyyymm') > AND to_char(ccc.due_date, 'yyyymm') >
to_char(to_date(${@base_date}, 'yyyy-mm-dd'), 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 FROM con_contract t
WHERE t.data_class = 'NORMAL' WHERE t.data_class = 'NORMAL'
...@@ -327,6 +330,9 @@ ...@@ -327,6 +330,9 @@
trunc(to_date(${@due_date_from}, 'yyyy-mm-dd')) trunc(to_date(${@due_date_from}, 'yyyy-mm-dd'))
AND trunc(t.lease_start_date) <= AND trunc(t.lease_start_date) <=
trunc(to_date(${@due_date_to}, 'yyyy-mm-dd')) 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 ) v
......
...@@ -29,5 +29,6 @@ ...@@ -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_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="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="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:query-fields>
</bm:model> </bm:model>
...@@ -23,7 +23,11 @@ ...@@ -23,7 +23,11 @@
AND cwo.cf_item IN (1, 200, 250) AND cwo.cf_item IN (1, 200, 250)
AND nvl(cwo.reversed_flag, 'N') = 'N' AND nvl(cwo.reversed_flag, 'N') = 'N'
AND trunc(ct.transaction_date) <= AND trunc(ct.transaction_date) <=
trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))), trunc(to_date(${@last_month_date}, 'yyyy-mm-dd'))
and exists(select 1
from con_contract_cashflow cc
where cc.CASHFLOW_ID = cwo.CASHFLOW_ID
and cc.CF_STATUS = 'RELEASE')),
0) 0)
ELSE ELSE
0 0
...@@ -219,7 +223,12 @@ ...@@ -219,7 +223,12 @@
AND cwo.csh_transaction_id = ct.transaction_id AND cwo.csh_transaction_id = ct.transaction_id
AND nvl(cwo.reversed_flag, 'N') = 'N' AND nvl(cwo.reversed_flag, 'N') = 'N'
AND trunc(ct.transaction_date) <= AND trunc(ct.transaction_date) <=
TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))), TRUNC(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
and exists(select 1
from con_contract_cashflow cc
where cc.CASHFLOW_ID = cwo.CASHFLOW_ID
and cc.CF_STATUS = 'RELEASE')
),
0) rest_unpayment_amount, 0) rest_unpayment_amount,
--保证金后 --保证金后
contract_item_query_pkg.calc_rest_rent_by_dudt(p_contract_id => t.contract_id, contract_item_query_pkg.calc_rest_rent_by_dudt(p_contract_id => t.contract_id,
...@@ -369,16 +378,23 @@ ...@@ -369,16 +378,23 @@
where v.CODE = 'CON500_CONTRACT_STATUS' where v.CODE = 'CON500_CONTRACT_STATUS'
and v.CODE_VALUE = t.CONTRACT_STATUS and v.CODE_VALUE = t.CONTRACT_STATUS
and v.CODE_ENABLED_FLAG = 'Y' and v.CODE_ENABLED_FLAG = 'Y'
and v.CODE_VALUE_ENABLED_FLAG = 'Y') contract_status_n and v.CODE_VALUE_ENABLED_FLAG = 'Y') contract_status_n,
t.is_buyout,
(Select v1.code_value_name
From sys_code_values_v v1
Where v1.code = 'YES_OR_NO'
And v1.code_enabled_flag = 'Y'
And v1.code_value_enabled_flag = 'Y'
and v1.CODE_VALUE = t.is_buyout) is_buyout_n
FROM con_contract t, hls_bp_master h FROM con_contract t, hls_bp_master h
WHERE t.data_class = 'NORMAL' WHERE t.data_class = 'NORMAL'
AND t.bp_id_agent_level1 = h.bp_id AND t.bp_id_agent_level1 = h.bp_id
AND (t.contract_status IN ('INCEPT', AND (t.contract_status IN ('INCEPT',
'TERMINATING', 'TERMINATING',
'ETING', 'ETING',
'REPURING', 'REPURING') or
'ET') or (to_char(t.et_date, 'yyyy-mm') >= ${@period_name} and t.contract_status in ('TERMINATE',
(to_char(t.et_date, 'yyyy-mm') >= ${@period_name} and t.contract_status = 'TERMINATE')) 'ET')))
and trunc(t.lease_start_date) <= trunc(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd'))) and trunc(t.lease_start_date) <= trunc(last_day(to_date(${@start_calc_date}, 'yyyy-mm-dd')))
]]> ]]>
</bm:query-sql> </bm:query-sql>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<!--<bm:field name="bp_vender" expression="(select bp_name from hls_bp_master where bp_id=t1.bp_id_vender and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>--> <!--<bm:field name="bp_vender" expression="(select bp_name from hls_bp_master where bp_id=t1.bp_id_vender and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>-->
<bm:field name="lease_organization_desc" expression="(select description from hls_lease_organization where lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/> <bm:field name="lease_organization_desc" expression="(select description from hls_lease_organization where lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/>
<!--<bm:field name="owner_user_id_n" expression="(select description from sys_user where user_id = t1.created_by)" forInsert="false" forUpdate="false"/>--> <!--<bm:field name="owner_user_id_n" expression="(select description from sys_user where user_id = t1.created_by)" forInsert="false" forUpdate="false"/>-->
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0)) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/> <bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0)) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_total" expression="(select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item=1)" forInsert="false" forUpdate="false"/> <bm:field name="amount_total" expression="(select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item=1)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_principal" expression="(select sum(nvl(ccc.principal,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos;)" forInsert="false" forUpdate="false"/> <bm:field name="amount_principal" expression="(select sum(nvl(ccc.principal,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos;)" forInsert="false" forUpdate="false"/>
<bm:field name="amount_interest" expression="(select sum(nvl(ccc.interest,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and cf_item=1)" forInsert="false" forUpdate="false"/> <bm:field name="amount_interest" expression="(select sum(nvl(ccc.interest,0)) from con_contract_cashflow ccc where ccc.contract_id=t1.contract_id and ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and cf_item=1)" forInsert="false" forUpdate="false"/>
...@@ -70,8 +70,9 @@ ...@@ -70,8 +70,9 @@
<bm:pk-field name="contract_id"/> <bm:pk-field name="contract_id"/>
</bm:primary-key> </bm:primary-key>
<bm:query-fields> <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="owner_user_id" queryOperator="="/>
<bm:query-field field="contract_number" queryOperator="="/>
<bm:query-field field="bp_id_tenant" queryOperator="="/> <bm:query-field field="bp_id_tenant" queryOperator="="/>
<!-- <bm:query-field field="lease_organization" queryOperator="="/>--> <!-- <bm:query-field field="lease_organization" queryOperator="="/>-->
<bm:query-field field="contract_status" queryOperator="="/> <bm:query-field field="contract_status" queryOperator="="/>
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<!--<bm:field name="bp_vender" expression="(select bp_name from hls_bp_master where bp_id=t1.bp_id_vender and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>--> <!--<bm:field name="bp_vender" expression="(select bp_name from hls_bp_master where bp_id=t1.bp_id_vender and enabled_flag=&apos;Y&apos;)" forInsert="false" forUpdate="false"/>-->
<bm:field name="lease_organization_desc" expression="(select description from hls_lease_organization where lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/> <bm:field name="lease_organization_desc" expression="(select description from hls_lease_organization where lease_organization = t1.lease_organization)" forInsert="false" forUpdate="false"/>
<!--<bm:field name="owner_user_id_n" expression="(select description from sys_user where user_id = t1.created_by)" forInsert="false" forUpdate="false"/>--> <!--<bm:field name="owner_user_id_n" expression="(select description from sys_user where user_id = t1.created_by)" forInsert="false" forUpdate="false"/>-->
<bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0)) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/> <bm:field name="is_terminate" expression="(CASE WHEN ((select sum(ccc.due_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0) - (select sum(ccc.received_amount) from con_contract_cashflow ccc where ccc.contract_id = t1.contract_id AND ccc.cf_status&lt;&gt;&apos;BLOCK&apos; and ccc.cf_item&lt;&gt;0)) = 0 THEN &apos;是&apos; ELSE &apos;否&apos; END)" forInsert="false" forUpdate="false"/>
<bm:field name="bp_id_agent_desc"/> <bm:field name="bp_id_agent_desc"/>
<bm:field name="business_type_n"/> <bm:field name="business_type_n"/>
<bm:field name="division_n"/> <bm:field name="division_n"/>
......
...@@ -51,7 +51,10 @@ ...@@ -51,7 +51,10 @@
Where tn.cashflow_id = cwo.cashflow_id Where tn.cashflow_id = cwo.cashflow_id
And tn.creation_date <= cwo.creation_date), And tn.creation_date <= cwo.creation_date),
0)) As unreceived_amount, 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, From con_contract_cashflow ccc,
con_contract c, con_contract c,
hls_bp_master h, hls_bp_master h,
......
...@@ -78,6 +78,10 @@ ...@@ -78,6 +78,10 @@
(select contract_number (select contract_number
from con_contract from con_contract
where contract_id = t.contract_id) contract_number, 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, t.account_code account_id_n,
(select description_text (select description_text
from fnd_descriptions from fnd_descriptions
...@@ -164,6 +168,10 @@ ...@@ -164,6 +168,10 @@
(select contract_number (select contract_number
from con_contract from con_contract
where contract_id = tt.contract_id) contract_number, 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, '小计:' account_id_n,
null account_name, null account_name,
tt.contract_id, tt.contract_id,
...@@ -259,6 +267,7 @@ ...@@ -259,6 +267,7 @@
p_due_date =>to_date(${@due_date},'yyyy-mm-dd'), p_due_date =>to_date(${@due_date},'yyyy-mm-dd'),
p_user_id =>${/session/@user_id}, p_user_id =>${/session/@user_id},
p_bp_id =>${@bp_id}, p_bp_id =>${@bp_id},
p_business_type =>${@business_type},
p_overday1 =>${@overday1}, p_overday1 =>${@overday1},
p_overday2 =>${@overday2}, p_overday2 =>${@overday2},
p_overday3 =>${@overday3}, p_overday3 =>${@overday3},
...@@ -274,6 +283,7 @@ ...@@ -274,6 +283,7 @@
</bm:operations> </bm:operations>
<bm:fields> <bm:fields>
<bm:field name="division_n"/> <bm:field name="division_n"/>
<bm:field name="business_type_n"/>
<bm:field name="contract_id"/> <bm:field name="contract_id"/>
<bm:field name="bp_code"/> <bm:field name="bp_code"/>
<bm:field name="contract_number"/> <bm:field name="contract_number"/>
......
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
<bm:field name="paid_byother_flag"/> <bm:field name="paid_byother_flag"/>
<bm:field name="receipt_type_des" expression="(select v.code_value_name from sys_code_values_v v where v.code=&apos;RECEIPT_TYPE&apos; and v.code_value=t1.receipt_type)"/> <bm:field name="receipt_type_des" expression="(select v.code_value_name from sys_code_values_v v where v.code=&apos;RECEIPT_TYPE&apos; and v.code_value=t1.receipt_type)"/>
<bm:field name="ref_n01"/> <bm:field name="ref_n01"/>
<bm:field name="approval_status" expression="decode(nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW'), 'APPROVED', decode(nvl(t1.reversed_flag, 'N'), 'N', 'NEW', 'APPROVED'), nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW'))"/>
<bm:field name="approval_status_desc" expression="(Select v.code_value_name From sys_code_values_v v Where v.code = &apos;WFL_STATUS&apos; And v.code_value = decode(nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW'), 'APPROVED', decode(nvl(t1.reversed_flag, 'N'), 'N', 'NEW', 'APPROVED'), nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW')))"/>
<bm:field name="transaction_wfl_id"/>
</bm:fields> </bm:fields>
<bm:features> <bm:features>
<f:standard-who/> <f:standard-who/>
...@@ -89,6 +92,7 @@ ...@@ -89,6 +92,7 @@
<bm:data-filters> <bm:data-filters>
<bm:data-filter name="query" expression="(t1.company_id=${/session/@company_id})"/> <bm:data-filter name="query" expression="(t1.company_id=${/session/@company_id})"/>
<!-- <bm:data-filter name="query" expression="(t1.posted_flag=&apos;Y&apos;)"/>--> <!-- <bm:data-filter name="query" expression="(t1.posted_flag=&apos;Y&apos;)"/>-->
<bm:data-filter name="approval_status" enforceOperations="query" expression="('APPROVED' != decode(nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW'), 'APPROVED', decode(nvl(t1.reversed_flag, 'N'), 'N', 'NEW', 'APPROVED'), nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW')))"/>
</bm:data-filters> </bm:data-filters>
<bm:query-fields> <bm:query-fields>
<bm:query-field field="receipt_type" queryOperator="="/> <bm:query-field field="receipt_type" queryOperator="="/>
...@@ -142,5 +146,6 @@ and cwo.reversed_flag = 'N' ...@@ -142,5 +146,6 @@ and cwo.reversed_flag = 'N'
and cc.data_class = 'NORMAL' and cc.data_class = 'NORMAL'
and cwo.csh_transaction_id = t1.transaction_id and cwo.csh_transaction_id = t1.transaction_id
and hbm.bp_name like ${@bp_name_r})"/> and hbm.bp_name like ${@bp_name_r})"/>
<bm:query-field name="approval_status" queryExpression="decode(nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW'), 'APPROVED', decode(nvl(t1.reversed_flag, 'N'), 'N', 'NEW', 'APPROVED'), nvl((Select nvl(cw.approval_status, 'NEW') From csh_transaction_wfl cw Where cw.transaction_wfl_id = t1.transaction_wfl_id), 'NEW')) = ${@approval_status}"/>
</bm:query-fields> </bm:query-fields>
</bm:model> </bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
Select
t.transaction_wfl_id,
t.transaction_id,
t.transaction_num,
to_char(t.transaction_date, 'yyyy-mm-dd') transaction_date,
to_char(t.reversed_date, 'yyyy-mm-dd') reversed_date,
t.reversed_period_name,
t.description,
t.note,
t.creation_date,
t.created_by,
t.last_update_date,
t.last_updated_by,
t.ref_v01,
t.ref_v02,
t.ref_v03,
t.ref_v04,
t.ref_v05,
t.ref_n01,
t.ref_n02,
t.ref_n03,
t.ref_n04,
t.ref_n05,
t.ref_d01,
t.ref_d02,
t.ref_d03,
t.ref_d04,
t.ref_d05,
t.wfl_instance_id,
t.approval_status
From csh_transaction_wfl t #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:query-fields>
<bm:query-field name="transaction_wfl_id" queryExpression="t.transaction_wfl_id = ${@transaction_wfl_id}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-6-3 下午12:38:12
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="CSH_WRITE_OFF_WFL" defaultOrderBy="t1.write_off_id" needAccessControl="false">
<bm:fields>
<bm:field name="write_off_wfl_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_WFL_ID" prompt="CSH_WRITE_OFF.WRITE_OFF_WFL_ID"/>
<bm:field name="write_off_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="WRITE_OFF_ID" prompt="CSH_WRITE_OFF.WRITE_OFF_ID"/>
<bm:field name="write_off_type" databaseType="VARCHAR2" datatype="java.lang.String" lookupCode="CSH513_WRITE_OFF_TYPE" lookupField="write_off_type_name" physicalName="WRITE_OFF_TYPE" prompt="CSH_WRITE_OFF.WRITE_OFF_TYPE"/>
<bm:field name="write_off_date" databaseType="DATE" datatype="java.util.Date" physicalName="WRITE_OFF_DATE" prompt="HLS.WRITE_OFF_DATE"/>
<bm:field name="journal_date" databaseType="DATE" datatype="java.util.Date" physicalName="JOURNAL_DATE" prompt="CSH_WRITE_OFF.JOURNAL_DATE"/>
<bm:field name="internal_period_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERNAL_PERIOD_NUM" prompt="CSH_WRITE_OFF.INTERNAL_PERIOD_NUM"/>
<bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PERIOD_NAME" prompt="CSH_WRITE_OFF.PERIOD_NAME"/>
<bm:field name="csh_transaction_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CSH_TRANSACTION_ID" prompt="CSH_WRITE_OFF.CSH_TRANSACTION_ID"/>
<bm:field name="csh_write_off_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="CSH_WRITE_OFF_AMOUNT" prompt="HLS.CSH_WRITE_OFF_AMOUNT"/>
<bm:field name="subsequent_csh_trx_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SUBSEQUENT_CSH_TRX_ID" prompt="CSH_WRITE_OFF.SUBSEQUENT_CSH_TRX_ID"/>
<bm:field name="subseq_csh_write_off_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="SUBSEQ_CSH_WRITE_OFF_AMOUNT" prompt="CSH_WRITE_OFF.SUBSEQ_CSH_WRITE_OFF_AMOUNT"/>
<bm:field name="reversed_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REVERSED_FLAG" prompt="CSH_WRITE_OFF.REVERSED_FLAG"/>
<bm:field name="reversed_write_off_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REVERSED_WRITE_OFF_ID" prompt="CSH_WRITE_OFF.REVERSED_WRITE_OFF_ID"/>
<bm:field name="reversed_date" databaseType="DATE" datatype="java.util.Date" physicalName="REVERSED_DATE" prompt="CSH_WRITE_OFF.REVERSED_DATE"/>
<bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID" prompt="CSH_WRITE_OFF.CASHFLOW_ID"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="CSH_WRITE_OFF.CONTRACT_ID"/>
<bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES" prompt="CSH_WRITE_OFF.TIMES"/>
<bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" prompt="CSH_WRITE_OFF.CF_ITEM"/>
<bm:field name="cf_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_TYPE" prompt="CSH_WRITE_OFF.CF_TYPE"/>
<bm:field name="penalty_calc_date" databaseType="DATE" datatype="java.util.Date" physicalName="PENALTY_CALC_DATE" prompt="CSH_WRITE_OFF.PENALTY_CALC_DATE"/>
<bm:field name="write_off_due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_DUE_AMOUNT" prompt="HLS.WRITEOFF_DUE_AMOUNT"/>
<bm:field name="write_off_principal" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_PRINCIPAL" prompt="CSH513.WRITE_OFF_PRINCIPAL"/>
<bm:field name="write_off_interest" databaseType="NUMBER" datatype="java.lang.Double" physicalName="WRITE_OFF_INTEREST" prompt="CSH513.WRITE_OFF_INTEREST"/>
<bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="CSH_WRITE_OFF.DESCRIPTION"/>
<bm:field name="opposite_doc_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OPPOSITE_DOC_CATEGORY" prompt="CSH_WRITE_OFF.OPPOSITE_DOC_CATEGORY"/>
<bm:field name="opposite_doc_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OPPOSITE_DOC_TYPE" prompt="CSH_WRITE_OFF.OPPOSITE_DOC_TYPE"/>
<bm:field name="opposite_doc_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OPPOSITE_DOC_ID" prompt="CSH_WRITE_OFF.OPPOSITE_DOC_ID"/>
<bm:field name="opposite_doc_line_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OPPOSITE_DOC_LINE_ID" prompt="CSH_WRITE_OFF.OPPOSITE_DOC_LINE_ID"/>
<bm:field name="opposite_doc_detail_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OPPOSITE_DOC_DETAIL_ID" prompt="CSH_WRITE_OFF.OPPOSITE_DOC_DETAIL_ID"/>
<bm:field name="opposite_write_off_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="OPPOSITE_WRITE_OFF_AMOUNT" prompt="CSH_WRITE_OFF.OPPOSITE_WRITE_OFF_AMOUNT"/>
<bm:field name="create_je_mothed" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CREATE_JE_MOTHED" prompt="CSH_WRITE_OFF.CREATE_JE_MOTHED"/>
<bm:field name="create_je_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CREATE_JE_FLAG" prompt="CSH_WRITE_OFF.CREATE_JE_FLAG"/>
<bm:field name="gld_interface_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GLD_INTERFACE_FLAG" prompt="CSH_WRITE_OFF.GLD_INTERFACE_FLAG"/>
<bm:field name="write_off_type_name" forInsert="false" forUpdate="false" prompt="HLS.WRITE_OFF_TYPE"/>
<bm:field name="write_off_classification" lookupField="write_off_classification_desc" lookupCode="DS_CSH_WRITE_OFF_CLASSIFICATION" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="write_off_classification_desc" forInsert="false" forUpdate="false"/>
<bm:field name="journal_num" expression="(SELECT h.journal_num FROM hls_journal_header h, hls_journal_detail d WHERE d.source_table = 'CSH_WRITE_OFF' AND d.source_id = t1.write_off_id AND h.journal_header_id = d.journal_header_id AND h.reversed_flag = 'N' AND rownum = 1)" forInsert="false" forUpdate="false"/>
<bm:field name="journal_user" expression="(SELECT u.description FROM hls_journal_detail d, sys_user u WHERE d.source_table = 'CSH_WRITE_OFF' AND d.source_id = t1.write_off_id AND d.created_by = u.user_id AND rownum = 1)" forInsert="false" forUpdate="false"/>
<bm:field name="history_flag" expression="(SELECT ct.history_flag FROM csh_transaction ct WHERE ct.transaction_id = t1.csh_transaction_id)" forInsert="false" forUpdate="false"/>
<bm:field name="ref_bp_name" expression="(select cc.bp_name from con_contract_v cc where cc.contract_id = nvl(t1.contract_id,t1.ASSIGNS_CONTRACT_ID))" forInsert="false" forUpdate="false"/>
<bm:field name="ref_contract_number" expression="(select cc.contract_number from con_contract cc where cc.contract_id = nvl(t1.contract_id,t1.ASSIGNS_CONTRACT_ID))" forInsert="false" forUpdate="false"/>
<bm:field name="gld_batch_id"/>
<bm:field name="transaction_wfl_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TRANSACTION_WFL_ID" prompt="CSH_WRITE_OFF.TRANSACTION_WFL_ID"/>
</bm:fields>
<bm:features>
<f:standard-who/>
</bm:features>
<bm:primary-key>
<bm:pk-field name="write_off_wfl_id"/>
</bm:primary-key>
<bm:relations>
<bm:relation name="con_cashflow" joinType="left outer" refAlias="t2" refModel="cont.CON500.con_contract_cashflow_v">
<bm:reference foreignField="cashflow_id" localField="cashflow_id"/>
</bm:relation>
<bm:relation name="hls_cf_type" joinType="left outer" refAlias="t3" refModel="hls.HLS005.hls_cashflow_type_v">
<bm:reference foreignField="cf_type" localField="cf_type"/>
</bm:relation>
<bm:relation name="hls_cf_item" joinType="left outer" refAlias="t4" refModel="hls.HLS005.hls_cashflow_item_v">
<bm:reference foreignField="cf_item" localField="cf_item"/>
</bm:relation>
</bm:relations>
<bm:ref-fields>
<bm:ref-field name="due_date" relationName="con_cashflow" sourceField="due_date"/>
<bm:ref-field name="contract_number" relationName="con_cashflow" sourceField="contract_number"/>
<bm:ref-field name="project_name" relationName="con_cashflow" sourceField="project_name"/>
<bm:ref-field name="bp_name" relationName="con_cashflow" sourceField="bp_name"/>
<bm:ref-field name="cf_type_name" relationName="hls_cf_type" sourceField="description"/>
<bm:ref-field name="cf_item_name" relationName="hls_cf_item" sourceField="cf_item_desc"/>
</bm:ref-fields>
<bm:query-fields>
<bm:query-field field="transaction_wfl_id" queryOperator="="/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: gaoyang
$Date: 2013-5-28 下午01:44:42
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
csh_transaction_wfl_pkg.csh_transaction_wfl_insert(
p_transaction_wfl_id => ${@transaction_wfl_id},
p_transaction_id => ${@transaction_id},
p_reversed_date => to_date(${@reversed_date}, 'yyyy-mm-dd'),
p_reversed_period_name => ${@reversed_period_name},
p_transaction_date => to_date(${@transaction_date}, 'yyyy-mm-dd'),
p_description => ${@description},
p_note => ${@note},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="transaction_wfl_id" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@transaction_wfl_id"/>
</bm:parameters>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
csh_transaction_wfl_pkg.csh_write_off_wfl_insert(
p_transaction_wfl_id => ${../../@transaction_wfl_id},
p_write_off_id => ${@write_off_id},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
csh_transaction_wfl_pkg.csh_reverse_wfl_start(
p_transaction_wfl_id => ${@transaction_wfl_id},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-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<=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 @@ ...@@ -50,7 +50,18 @@
p_role_flag => ${@role_flag}, p_role_flag => ${@role_flag},
p_csh_date => ${@csh_date}, p_csh_date => ${@csh_date},
p_ref_v04 => ${@ref_v04}, 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; end;
]]></bm:update-sql> ]]></bm:update-sql>
</bm:operation> </bm:operation>
......
...@@ -29,7 +29,7 @@ SELECT h.period_year, ...@@ -29,7 +29,7 @@ SELECT h.period_year,
AND (li.cashflow_id = l.cashflow_id OR AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id) li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date, 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, DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY', 'HL_CSH_CONSOLIDATION_DALAY',
'违约金', '违约金',
...@@ -48,69 +48,72 @@ SELECT h.period_year, ...@@ -48,69 +48,72 @@ SELECT h.period_year,
0, 0,
'设备款') '设备款')
FROM con_contract_cashflow 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, DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY', 'HL_CSH_CONSOLIDATION_DALAY',
h.journal_date, h.journal_date,
'HL_SALES_TAX_ACT_NEW', 'HL_SALES_TAX_ACT_NEW',
(SELECT due_date (SELECT due_date
FROM con_contract_cashflow 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, DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY', 'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, l.amount_dr, 0)), decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW', 'HL_SALES_TAX_ACT_NEW',
(SELECT due_amount (SELECT due_amount
FROM con_contract_cashflow 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 (SELECT principal
FROM con_contract_cashflow FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id) principal, WHERE cashflow_id = l.cashflow_id) principal,
DECODE(h.je_transaction_code, DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY', 'HL_CSH_CONSOLIDATION_DALAY',
SUM(decode(reference6, NULL, l.amount_dr, 0)), decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW', 'HL_SALES_TAX_ACT_NEW',
(SELECT decode(cf_item, 8, due_amount, interest) (SELECT decode(cf_item, 8, due_amount, interest)
FROM con_contract_cashflow 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, DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY', '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', 'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount (SELECT vat_due_amount
FROM con_contract_cashflow FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id)) vat_due_amount, WHERE cashflow_id = l.cashflow_id),
nvl(ROUND((DECODE(h.je_transaction_code, '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', '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', 'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount (SELECT vat_due_amount/(due_amount-vat_due_amount)
FROM con_contract_cashflow FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id))) / WHERE cashflow_id = l.cashflow_id),
(DECODE(h.je_transaction_code, l.amount_cr/(l.reference7-l.amount_cr),
'HL_CSH_CONSOLIDATION_DALAY', 'CON_REPURCHASE',
SUM(decode(reference6, NULL, l.amount_dr, 0)), l.amount_cr/(l.reference7-l.amount_cr))),2) * 100,0)|| '%' vat_rate,
'HL_SALES_TAX_ACT_NEW', h.je_transaction_code,
(SELECT due_amount l.cashflow_id
FROM con_contract_cashflow FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
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 h.journal_header_id = l.journal_header_id WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null 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') ('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( (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 AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li FROM acr_invoice_hd hi, acr_invoice_ln li
...@@ -118,20 +121,29 @@ SELECT h.period_year, ...@@ -118,20 +121,29 @@ SELECT h.period_year,
AND hi.vat_interface_status = 'BACK' AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period} AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period}
AND (li.cashflow_id = l.cashflow_id OR AND (li.cashflow_id = l.cashflow_id OR
li.ref_n04 = l.journal_line_id)) li.ref_n03 = l.journal_header_id))
GROUP BY l.reference1, UNION
reference3, select vl.*
reference4, from ET_VAT_JOURNAL_LV vl
h.sbo_num, where not EXISTS
l.cashflow_id, (SELECT 1
l.journal_header_id, FROM acr_invoice_hd hi, acr_invoice_ln li
h.je_transaction_code, WHERE hi.invoice_hd_id = li.invoice_hd_id
h.period_year, AND hi.vat_interface_status = 'BACK'
h.period_num, AND to_char(hi.invoice_date, 'yyyymm') <= ${@base_period}
h.internal_period_num, AND (li.cashflow_id = vl.cashflow_id))
h.journal_date 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, SELECT h.period_year,
h.period_num, h.period_num,
...@@ -153,7 +165,7 @@ SELECT h.period_year, ...@@ -153,7 +165,7 @@ SELECT h.period_year,
AND li.cf_item = 2 AND li.cf_item = 2
and hi.contract_id = l.source_doc_id and hi.contract_id = l.source_doc_id
AND ROWNUM = 1) invoice_date, AND ROWNUM = 1) invoice_date,
l.amount_dr amount_tax, round(l.amount_dr,2) amount_tax,
'首付款' times, '首付款' times,
(SELECT due_date (SELECT due_date
...@@ -186,26 +198,20 @@ SELECT h.period_year, ...@@ -186,26 +198,20 @@ SELECT h.period_year,
WHERE contract_id = l.source_doc_id WHERE contract_id = l.source_doc_id
AND cf_item = 2 AND cf_item = 2
AND ROWNUM = 1) vat_due_amount, AND ROWNUM = 1) vat_due_amount,
NVL(ROUND(( NVL(ROUND(
(SELECT vat_due_amount (SELECT vat_due_amount/net_due_amount
FROM con_contract_cashflow FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id WHERE contract_id = l.source_doc_id
AND cf_item = 2 AND cf_item = 2
AND ROWNUM = 1) 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)
),
2) * 100, 2) * 100,
0) || '%' vat_rate, 0) || '%' vat_rate,
h.je_transaction_code h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null and h.sbo_num is not null
and h.reversed_flag='N'
AND h.je_transaction_code = 'LEASE_INCEPT' AND h.je_transaction_code = 'LEASE_INCEPT'
AND l.je_template_ln_id = 8797 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')))) 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, ...@@ -223,6 +229,7 @@ SELECT h.period_year,
</bm:operations> </bm:operations>
<bm:data-filters> <bm:data-filters>
<bm:data-filter enforceOperations="query" expression="to_char(t1.journal_date,'yyyymm') = ${@base_period}"/> <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:data-filters>
<bm:query-fields> <bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/> <bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
WHERE t.session_id=${/session/@session_id} WHERE t.session_id=${/session/@session_id}
) t1 ) t1
#WHERE_CLAUSE# #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:query-sql>
</bm:operation> </bm:operation>
<bm:operation name="update"> <bm:operation name="update">
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-insert model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
<batch-apply sourcePath="/parameter/details">
<a:model-update model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
</batch-apply>
<a:model-execute model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
...@@ -78,10 +78,13 @@ ...@@ -78,10 +78,13 @@
if (record.get('secondary_lease') == 'YES') { if (record.get('secondary_lease') == 'YES') {
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID_prompt').style.display = 'block'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID_prompt').style.display = 'block';
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID').style.display = 'block'; document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID').style.display = 'block';
} else if (record.get('secondary_lease') == 'NO') { } else /*if (record.get('secondary_lease') == 'NO') */{
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_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_BASIC_1_CON_CONTRACT_REPUR_CONTRACT_ID').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 @@ ...@@ -38,6 +38,7 @@
$(ds).setQueryParameter('due_date_from',record.get('due_date_from')); $(ds).setQueryParameter('due_date_from',record.get('due_date_from'));
$(ds).setQueryParameter('due_date_to',record.get('due_date_to')); $(ds).setQueryParameter('due_date_to',record.get('due_date_to'));
$(ds).setQueryParameter('base_date',record.get('base_date')); $(ds).setQueryParameter('base_date',record.get('base_date'));
$(ds).setQueryParameter('business_type',record.get('business_type'));
$(ds).query(); $(ds).query();
}else{ }else{
$L.showInfoMessage("提示",'请输入字段:租赁开始日从、租赁开始日到、基准日!'); $L.showInfoMessage("提示",'请输入字段:租赁开始日从、租赁开始日到、基准日!');
......
...@@ -153,6 +153,13 @@ ...@@ -153,6 +153,13 @@
} }
} }
} }
function change_background_color(record) {
if (record.get('trans_pently_flag') == 'Y') {
return 'background-color:#00ff00';
}
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true" <a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true"
...@@ -164,7 +171,7 @@ ...@@ -164,7 +171,7 @@
</a:dataSet> </a:dataSet>
<a:dataSet id="con7000_csh_write_off_ds" fetchAll="true" autoQuery="true" <a:dataSet id="con7000_csh_write_off_ds" fetchAll="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_csh_write_off" 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"> selectable="true">
<a:events> <a:events>
<a:event name="load" handler="con7000_csh_write_off_ds_load"/> <a:event name="load" handler="con7000_csh_write_off_ds_load"/>
...@@ -209,7 +216,7 @@ ...@@ -209,7 +216,7 @@
<a:tabs> <a:tabs>
<a:tab prompt="营业违约金核销明细" width="150"> <a:tab prompt="营业违约金核销明细" width="150">
<a:grid id="con7000_csh_write_off_grid" bindTarget="con7000_csh_write_off_ds" marginHeight="130" <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:columns>
<a:column name="times" prompt="回数" width="70" align="center"/> <a:column name="times" prompt="回数" width="70" align="center"/>
<a:column name="due_date" prompt="预定支付日" width="120" align="center" <a:column name="due_date" prompt="预定支付日" width="120" align="center"
......
...@@ -47,6 +47,13 @@ ...@@ -47,6 +47,13 @@
function con7000_csh_write_off_ds_unselect(ds, record) { function con7000_csh_write_off_ds_unselect(ds, record) {
return false; return false;
} }
function change_background_color(record) {
if (record.get('trans_pently_flag') == 'Y') {
return 'background-color:#00ff00';
}
}
]]></script> ]]></script>
<a:dataSets> <a:dataSets>
<a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true" <a:dataSet id="con_rent_trans_penalty_hd_ds" autoPageSize="true" autoQuery="true"
...@@ -55,7 +62,7 @@ ...@@ -55,7 +62,7 @@
</a:dataSet> </a:dataSet>
<a:dataSet id="con7000_csh_write_off_ds" autoPageSize="true" autoQuery="true" <a:dataSet id="con7000_csh_write_off_ds" autoPageSize="true" autoQuery="true"
model="cont.CON7001.con_rent_trans_penalty_csh_write_off" 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"> selectable="true" showCheckAll="false">
<a:events> <a:events>
<a:event name="load" handler="con7000_csh_write_off_ds_load"/> <a:event name="load" handler="con7000_csh_write_off_ds_load"/>
...@@ -98,7 +105,7 @@ ...@@ -98,7 +105,7 @@
<a:tabs> <a:tabs>
<a:tab prompt="营业违约金核销明细" width="150"> <a:tab prompt="营业违约金核销明细" width="150">
<a:grid id="con7000_csh_write_off_grid" bindTarget="con7000_csh_write_off_ds" marginHeight="130" <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:columns>
<a:column name="times" prompt="回数" width="70" align="center"/> <a:column name="times" prompt="回数" width="70" align="center"/>
<a:column name="due_date" prompt="预定支付日" width="120" align="center" <a:column name="due_date" prompt="预定支付日" width="120" align="center"
......
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-insert model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
<batch-apply sourcePath="/parameter/details">
<a:model-update model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
</batch-apply>
<a:model-execute model="csh.CSH514.csh_transaction_write_off_reverse_wfl" trace="true"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
This diff is collapsed.
This diff is collapsed.
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