|
@@ -22,9 +22,8 @@ public class Tinvoiceapply_saler extends Controller {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public String queryInvoiceApplyList() {
|
|
public String queryInvoiceApplyList() {
|
|
|
- String[] sortmsg = {"t1.tinvoiceapplyid desc"};
|
|
|
|
|
-
|
|
|
|
|
- String sort = "t1.tinvoiceapplyid desc";
|
|
|
|
|
|
|
+ String[] sortmsg = {"case when t1.fstatus='新建'then 1 when t1.fstatus='提交'then 2 when t1.fstatus='审核'then 3 else 4 end,t1.createdate desc "};
|
|
|
|
|
+ String sort = "case when t1.fstatus='新建'then 1 when t1.fstatus='提交'then 2 when t1.fstatus='审核'then 3 else 4 end,t1.createdate desc ";
|
|
|
if (content.containsKey("sort") && Arrays.asList(sortmsg).contains(content.getString("sort"))) {
|
|
if (content.containsKey("sort") && Arrays.asList(sortmsg).contains(content.getString("sort"))) {
|
|
|
sort = content.getString("sort");
|
|
sort = content.getString("sort");
|
|
|
}
|
|
}
|
|
@@ -32,7 +31,9 @@ public class Tinvoiceapply_saler extends Controller {
|
|
|
if (content.containsKey("where")) {
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
- where = where + " and t1.finvoicename like'%" + whereObject.getString("condition") + "%'";
|
|
|
|
|
|
|
+ where = where + " and (t1.finvoicename like'%" + whereObject.getString("condition") + "%' " +
|
|
|
|
|
+ "or exists(select tinvoicebillid from tinvoicebill where siteid=t1.siteid and tinvoiceapplyid=t1.tinvoiceapplyid and (invoicecode like'%" + whereObject.getString("condition") + "%' or invoiceno like'%" + whereObject.getString("condition") +
|
|
|
|
|
+ "%')))";
|
|
|
}
|
|
}
|
|
|
if (whereObject.containsKey("fbegdate") && !"".equals(whereObject.getString("fbegdate"))) {
|
|
if (whereObject.containsKey("fbegdate") && !"".equals(whereObject.getString("fbegdate"))) {
|
|
|
where = where + " and t1.createdate >='" + whereObject.getString("fbegdate") + "'";
|
|
where = where + " and t1.createdate >='" + whereObject.getString("fbegdate") + "'";
|