Ver Fonte

Merge remote-tracking branch 'Gogs/develop' into develop

沈静伟 há 4 anos atrás
pai
commit
3acdef9077

BIN
src.zip


+ 98 - 0
src/apps/hyconfirmationorder/hyconfirmationorder.java

@@ -0,0 +1,98 @@
+package hyconfirmationorder;
+
+import baseclass.PaoCust;
+import p2.p2server.P2Server;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSet;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+import tmaxbillnum.tmaxbillnum;
+
+import java.util.Date;
+
+public class hyconfirmationorder extends PaoCust {
+    /**
+     * ¹¹Ô캯Êý
+     *
+     * @param arg0
+     */
+    public hyconfirmationorder(PaoSet arg0) {
+        super(arg0);
+    }
+
+
+    @Override
+    protected void save() throws P2Exception {
+        super.save();
+
+    }
+
+    @Override
+    public void init() throws P2Exception {
+        super.init();
+    }
+
+    @Override
+    public void add() throws P2Exception {
+        super.add();
+
+        PaoSetRemote hyordernode = getOwner().getPaoSet("HYORDERNODE");
+        hyordernode.setWhere("ischilden=0");
+        hyordernode.setOrderBy("FROWNUM desc");
+        hyordernode.reset();
+        if(!hyordernode.isEmpty())
+            setValue("fnotes",hyordernode.getPao(0).getString("fnotes"),11l);
+        setValue("fbillnum",getbillnum(),11l);
+        setValue("fstatus","н¨",11l);
+
+
+    }
+
+
+    public String getbillnum() throws P2Exception {
+        PaoSetRemote maxbill = P2Server.getP2Server().getPaoSet("tmaxbillnum",
+                getUserInfo());
+        maxbill.setInsertSite(getSite());
+        maxbill.setWhere("app='hyconfirmationorder' and siteid='" + getString("siteid") + "'");
+        maxbill.reset();
+
+        PaoRemote pao = null;
+        if (maxbill.isEmpty()) {
+            pao = maxbill.addAtEnd();
+            pao.setValue("FSERIALNUM", 1);
+            pao.setValue("APP", "hyconfirmationorder");
+            pao.setValue("FLENGTH", 10);
+        } else {
+            pao = maxbill.getPao(0);
+        }
+        String billnum = ((tmaxbillnum) pao).getBillNum();
+        maxbill.save();
+        return billnum;
+    }
+
+    @Override
+    public void fieldAction(Object paoField, String fieldname) throws P2Exception {
+        super.fieldAction(paoField, fieldname);
+    }
+    @Override
+    public void fieldValidate(Object paoField, String fieldname) throws P2Exception {
+        super.fieldValidate(paoField, fieldname);
+
+    }
+
+    @Override
+    public void delete() throws P2Exception {
+        super.delete();
+    }
+
+
+    public void submit(boolean issubmit,String hrid) throws P2Exception {
+        super.submit(issubmit);
+        if(issubmit){
+            setValue("fstatus","Ìá½»",11l);
+            setValue("submitdate",new Date(),11l);
+            setValue("submitby",hrid,11l);
+        }
+
+    }
+}

+ 1 - 2
src/apps/hyworkorder/hyworkorder.java

@@ -31,10 +31,9 @@ public class hyworkorder extends PaoCust {
     @Override
     @Override
     public void init() throws P2Exception {
     public void init() throws P2Exception {
         super.init();
         super.init();
-
-
         if(!toBeAdded()&&!getString("fstatus").equals("´ý¿ªÊ¼")){
         if(!toBeAdded()&&!getString("fstatus").equals("´ý¿ªÊ¼")){
             setFieldFlag(new GetFieldsName(getName()).getFields(), READONLY,true);
             setFieldFlag(new GetFieldsName(getName()).getFields(), READONLY,true);
+            setFieldFlag("fisperiod", READONLY,false);
         }
         }
     }
     }
 
 

+ 1 - 1
src/rest/openapi/base/restful/WebClientRest.java

@@ -601,7 +601,7 @@ public class WebClientRest {
             docManage docManage = new docManage();
             docManage docManage = new docManage();
             String result=null;
             String result=null;
             Set set=new HashSet();
             Set set=new HashSet();
-            set.addAll(Arrays.asList("ordernode","hyordernode","hyworkorder","afterserviceorder"));
+            set.addAll(Arrays.asList("ordernode","hyordernode","hyworkorder","afterserviceorder","hyconfirmationorder"));
             if(set.contains(ownertable.toLowerCase())&&FISUPLOADFOROBS){
             if(set.contains(ownertable.toLowerCase())&&FISUPLOADFOROBS){
                 result = docManage.upLoadDocForOBS(uploadfileInputStream, uploadfile, ownertable, ownerid, hrid, description, "",type);
                 result = docManage.upLoadDocForOBS(uploadfileInputStream, uploadfile, ownertable, ownerid, hrid, description, "",type);
             }else{
             }else{

+ 21 - 0
src/rest/openapi/restcontroller/hyworkorder/web/afterserviceorder/Afterserviceorder.java

@@ -219,6 +219,13 @@ public class Afterserviceorder extends Controller {
                     remote.setValue("scenephone",where.getString("scenephone"),11l);
                     remote.setValue("scenephone",where.getString("scenephone"),11l);
                 if(where.containsKey("error_msg"))
                 if(where.containsKey("error_msg"))
                     remote.setValue("error_msg",where.getString("error_msg"),11l);
                     remote.setValue("error_msg",where.getString("error_msg"),11l);
+
+                if(where.containsKey("appsystem"))
+                    remote.setValue("appsystem",where.getString("appsystem"),11l);
+                if(where.containsKey("errcategory"))
+                    remote.setValue("errcategory",where.getString("errcategory"),11l);
+
+
                 if(where.containsKey("fnotes"))
                 if(where.containsKey("fnotes"))
                     remote.setValue("fnotes",where.getString("fnotes"),11l);
                     remote.setValue("fnotes",where.getString("fnotes"),11l);
                 if(where.containsKey("titems")){
                 if(where.containsKey("titems")){
@@ -396,5 +403,19 @@ public class Afterserviceorder extends Controller {
     }
     }
 
 
 
 
+    /**获取应用系统**/
+    public String get_appsystem(){
+        DBConnect dbConnect=new DBConnect();
+        Rows rows = dbConnect.runSqlQuery("select value from PS_DATABIND_LIST where databindid='APPSYSTEM'");
+        return getReturnObject_suc(rows,false).toString();
+    }
+    /**获取客诉大类**/
+    public String errcategory(){
+        DBConnect dbConnect=new DBConnect();
+        Rows rows = dbConnect.runSqlQuery("select value from PS_DATABIND_LIST where databindid='ERRCATEGORY'");
+        return getReturnObject_suc(rows,false).toString();
+    }
+
+
 
 
 }
 }

+ 6 - 1
src/rest/openapi/restcontroller/hyworkorder/web/afterserviceorder/SQL/售后单列表查询.sql

@@ -1,2 +1,7 @@
-select t.servicenum,convert(varchar,t.createdate,120)createdate,t.fsonum,t.fnotes,t.fstatus,t.Afterserviceordeid ownerid from Afterserviceorder t
+select t.servicenum,convert(varchar,t.createdate,120)createdate,t.fsonum,t.fnotes,t.fstatus,t.Afterserviceordeid ownerid,
+       t.fprovince,
+       t.fcity,
+       t.fcounty,
+       t.faddress
+       from Afterserviceorder t
 where t.siteid=$siteid$ and t.fagentnum=$fagentnum$ and $where$
 where t.siteid=$siteid$ and t.fagentnum=$fagentnum$ and $where$

+ 1 - 1
src/rest/openapi/restcontroller/hyworkorder/web/afterserviceorder/SQL/售后服务单详情.sql

@@ -1,4 +1,4 @@
 select t.servicenum,convert(varchar,t.createdate,120)createdate,t.fsonum,t.fnotes,t.fstatus,t.fprovince,t.fcity,t.fcounty,t.faddress,
 select t.servicenum,convert(varchar,t.createdate,120)createdate,t.fsonum,t.fnotes,t.fstatus,t.fprovince,t.fcity,t.fcounty,t.faddress,
-t.Afterserviceordeid ownerid,scenefname,scenephone,error_msg
+t.Afterserviceordeid ownerid,scenefname,scenephone,error_msg,t.appsystem,t.errcategory
 from Afterserviceorder t
 from Afterserviceorder t
 where t.servicenum=$servicenum$
 where t.servicenum=$servicenum$

+ 1 - 1
src/rest/openapi/restcontroller/hyworkorder/web/afterserviceorder/SQL/服务单关联工单.sql

@@ -1,5 +1,5 @@
 select t1.fworknum,t1.ftype,t1.fstatus,CONVERT(varchar,t1.createdate,120)createdate,t1.progress,t1.fnotes,t1.fprovince,
 select t1.fworknum,t1.ftype,t1.fstatus,CONVERT(varchar,t1.createdate,120)createdate,t1.progress,t1.fnotes,t1.fprovince,
-       t1.fcity,t1.fcount,t1.faddress
+       t1.fcity,t1.fcounty,t1.faddress
 from Afterserviceorder t
 from Afterserviceorder t
 join hyWorkorder t1 on t.Servicenum=t1.servernum
 join hyWorkorder t1 on t.Servicenum=t1.servernum
 where t.servicenum=$servicenum$
 where t.servicenum=$servicenum$

+ 183 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/hyconfirmationorder/MyHyconfirmationorder.java

@@ -0,0 +1,183 @@
+package openapi.restcontroller.hyworkorder.webapp.hyconfirmationorder;
+
+import hyconfirmationorder.hyconfirmationorder;
+import net.sf.json.JSONObject;
+import openapi.base.Controller;
+import openapi.base.SQLFactory;
+import openapi.base.data.Row;
+import openapi.base.data.Rows;
+import openapi.base.data.db.DBConnect;
+import org.apache.commons.lang.StringUtils;
+import p2.pao.PaoRemote;
+import p2.pao.PaoSetRemote;
+import p2.util.P2Exception;
+
+public class MyHyconfirmationorder extends Controller {
+
+
+    public MyHyconfirmationorder(JSONObject content) {
+        super(content);
+    }
+
+
+
+    /**创建售后服务确认单**/
+    public String create(){
+        JSONObject where = content.getJSONObject("where");
+        String s[] = {"fworknum"};
+        for (String s1 : s) {
+            if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
+                return getReturnObject_err("缺少" + s1 + "参数").toString();
+        }
+        try {
+            PaoSetRemote hyWorkorderset = getpaoset("hyWorkorder");
+            hyWorkorderset.setInsertSite(siteid);
+            hyWorkorderset.setWhere("fworknum='"+where.getString("fworknum")+"'");
+            hyWorkorderset.reset();
+            if(hyWorkorderset.isEmpty())return getReturnObject_err("没有此工单").toString();
+            PaoRemote pao = hyWorkorderset.getPao(0);
+            PaoSetRemote hyconfirmationorder = pao.getPaoSet("hyconfirmationorder");
+            hyconfirmationorder.setWhere("fstatus='新建'");
+            hyconfirmationorder.reset();
+            if(!hyconfirmationorder.isEmpty())return getReturnObject_err("已存在新建的确认单").toString();
+            PaoRemote remote = hyconfirmationorder.addAtEnd();
+            remote.setValue("createby",hrid,11l);
+            hyconfirmationorder.save();
+            Row row=new Row();
+            row.put("fbillnum",remote.getString("fbillnum"));
+            return getReturnObject_suc(row,false).toString();
+        } catch (P2Exception e) {
+            return getReturnObject_err(e.getMessage()).toString();
+        }
+
+    }
+
+    /**售后服务确认单详情**/
+    public String detail(){
+        JSONObject where = content.getJSONObject("where");
+        String s[] = {"fbillnum"};
+        for (String s1 : s) {
+            if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
+                return getReturnObject_err("缺少" + s1 + "参数").toString();
+        }
+
+        DBConnect dbConnect=new DBConnect();
+        SQLFactory factory_detail = new SQLFactory(this, "售后服务确认单详情");
+        factory_detail.addParameter("fbillnum",where.getString("fbillnum"));
+        Rows rows = dbConnect.runSqlQuery(factory_detail.getSQL());
+        if(rows.isEmpty())return getReturnObject_err("没有该单号").toString();
+        Row result=new Row();
+        Row detail = rows.get(0);
+
+        SQLFactory factory_titems = new SQLFactory(this, "售后商品查询");
+        factory_titems.addParameter("fparentid",detail.getInteger("afterserviceordeid"));
+        Rows titems = dbConnect.runSqlQuery(factory_titems.getSQL());
+
+
+        SQLFactory factory_url = new SQLFactory(this, "售后服务确认单附件查询");
+        factory_url.addParameter("ownerid",detail.getInteger("ownerid"));
+        Rows urls = dbConnect.runSqlQuery(factory_url.getSQL());
+
+
+        result.put("detail",detail);
+        result.put("titems",titems);
+        result.put("url",urls);
+
+        return getReturnObject_suc(result,false).toString();
+    }
+
+    /**售后服务确认单列表**/
+    public String list(){
+        JSONObject where = content.getJSONObject("where");
+        String s[] = {"fworknum"};
+        for (String s1 : s) {
+            if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
+                return getReturnObject_err("缺少" + s1 + "参数").toString();
+        }
+
+        DBConnect dbConnect=new DBConnect();
+        SQLFactory sqlFactory_list = new SQLFactory(this, "售后服务确认单列表");
+        sqlFactory_list.addParameter("fworknum",where.getString("fworknum"));
+        Rows rows = dbConnect.runSqlQuery(sqlFactory_list.getSQL());
+        return getReturnObject_suc(rows,false).toString();
+    }
+
+    /**售后服务确认单更新**/
+    public String update()  {
+        JSONObject where = content.getJSONObject("where");
+        String s[] = {"fbillnum"};
+        for (String s1 : s) {
+            if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
+                return getReturnObject_err("缺少" + s1 + "参数").toString();
+        }
+
+        try {
+            PaoSetRemote hyconfirmationorder = getpaoset("hyconfirmationorder");
+            hyconfirmationorder.setInsertSite(siteid);
+            hyconfirmationorder.setWhere("fbillnum='"+where.getString("fbillnum")+"'");
+            hyconfirmationorder.reset();
+            if(hyconfirmationorder.isEmpty())return getReturnObject_err("没有该单号").toString();
+            PaoRemote pao = hyconfirmationorder.getPao(0);
+            if(where.containsKey("problemmsg")){
+                pao.setValue("Problemmsg",where.getString("problemmsg"),11l);
+            }
+            if(where.containsKey("treatmentmeasures")){
+                pao.setValue("Treatmentmeasures",where.getString("treatmentmeasures"),11l);
+            }
+            if(where.containsKey("nexthandledate")){
+                pao.setValue("nexthandledate",where.getString("nexthandledate"),11l);
+            }
+            if(where.containsKey("itemdescription")){
+                pao.setValue("Itemdescription",where.getString("itemdescription"),11l);
+            }
+            if(where.containsKey("result")){
+                pao.setValue("result",where.getString("result"),11l);
+            }
+            if(where.containsKey("result_msg")){
+                pao.setValue("result_msg",where.getString("result_msg"),11l);
+            }
+            if(where.containsKey("cooperativeattitude")){
+                pao.setValue("Cooperativeattitude",where.getDouble("cooperativeattitude"),11l);
+            }
+            if(where.containsKey("reactionrate")){
+                pao.setValue("reactionrate",where.getDouble("reactionrate"),11l);
+            }
+            //nextreturndate
+            if(where.containsKey("nextreturndate")){
+                pao.setValue("nextreturndate",where.getString("nextreturndate"),11l);
+            }
+
+            hyconfirmationorder.save();
+            return getReturnObject_suc().toString();
+        } catch (P2Exception e) {
+            return getReturnObject_err(e.getMessage()).toString();
+        }
+
+
+    }
+
+    /**提交服务确认单**/
+    public String submit(){
+        JSONObject where = content.getJSONObject("where");
+        String s[] = {"fbillnum"};
+        for (String s1 : s) {
+            if (!where.containsKey(s1) && !StringUtils.isBlank(where.getString(s1)))
+                return getReturnObject_err("缺少" + s1 + "参数").toString();
+        }
+        try {
+            PaoSetRemote hyconfirmationorderset = getpaoset("hyconfirmationorder");
+            hyconfirmationorderset.setInsertSite(siteid);
+            hyconfirmationorderset.setWhere("fbillnum='"+where.getString("fbillnum")+"'");
+            hyconfirmationorderset.reset();
+            if(hyconfirmationorderset.isEmpty())return getReturnObject_err("没有该单号").toString();
+//            System.out.println(hyconfirmationorderset.getPao(0).getClass().toString());
+            hyconfirmationorder pao = (hyconfirmationorder)hyconfirmationorderset.getPao(0);
+            pao.submit(true,hrid);
+            hyconfirmationorderset.save();
+            return getReturnObject_suc().toString();
+        } catch (P2Exception e) {
+            return getReturnObject_err(e.getMessage()).toString();
+        }
+    }
+
+}

+ 4 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/hyconfirmationorder/SQL/售后商品查询.sql

@@ -0,0 +1,4 @@
+select t1.fitemno,t1.fitemname,t1.fspec,t2.fitemclsname from hyAfterserviceorder_titem t
+join titem t1 on t.FITEMNO=t1.FITEMNO and t.siteid=t1.siteid
+join TITEMCLASS_VIEW t2 on t2.FITEMCLSNUM=t1.FSALECLSNUM and  t2.fclasstype='ÓªÏúÀà±ð'and t2.siteid=t1.siteid
+where fparentid=$fparentid$

+ 8 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/hyconfirmationorder/SQL/售后服务确认单列表.sql

@@ -0,0 +1,8 @@
+select t.fbillnum,t.fstatus,convert(varchar,t.createdate,120)createdate,convert(varchar,t.submitdate,120)submitdate,problemmsg,submitby,
+       (
+
+           select top 1 fobsurl from tattachment t3 where ownertable='HYCONFIRMATIONORDER' and ownerid=t.hyconfirmationorid and type='È·Èϵ¥Ô¤ÀÀͼ'
+       )fobsurl
+from hyconfirmationorder t
+         join hyWorkorder t1 on t.fparentid=t1.hyWorkorderid
+where t1.fworknum=$fworknum$

+ 10 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/hyconfirmationorder/SQL/售后服务确认单详情.sql

@@ -0,0 +1,10 @@
+select t.fbillnum,t.fstatus,t1.fisperiod,t1.repairprice,t1.scenefname,t1.scenephone,t2.appsystem,t2.errcategory,t.problemmsg,t.treatmentmeasures,
+       CONVERT(varchar,t.nexthandledate,120)nexthandledate,t.Itemdescription,t.result,t.result_msg,t.fnotes,t.nextreturndate,t.reactionrate,t.Cooperativeattitude,
+       t.hyconfirmationorid ownerid,t2.afterserviceordeid,convert(varchar,t.createdate,120)createdate,case when t3.ftype='ÏîÄ¿¶©µ¥' then t4.FPROJECTNAME else t3.FPROJECTNOTES end fprojectname,
+       t1.faddress
+from hyconfirmationorder t
+         join hyWorkorder t1 on t.fparentid=t1.hyWorkorderid
+         join Afterserviceorder t2 on t2.Servicenum=t1.servernum
+         left join saorder t3 on t3.fsonum=t2.fsonum
+         left join TPROJECT t4 on t4.fprojectnum=t3.fprojectnum
+where t.fbillnum=$fbillnum$

+ 1 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/hyconfirmationorder/SQL/售后服务确认单附件查询.sql

@@ -0,0 +1 @@
+select fobsurl,postfix,type,fdocument,tattachmentid from tattachment where ownertable='HYCONFIRMATIONORDER' and ownerid=$ownerid$

+ 5 - 7
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/HyWorkOrder.java

@@ -63,12 +63,6 @@ public class HyWorkOrder extends Controller {
     }
     }
 
 
 
 
-
-
-
-
-
-
     /**工单详情**/
     /**工单详情**/
     public String detail(){
     public String detail(){
 //        if (StringUtils.isBlank(hrid)) getReturnObject_err("hrid为空").toString();
 //        if (StringUtils.isBlank(hrid)) getReturnObject_err("hrid为空").toString();
@@ -747,7 +741,11 @@ public class HyWorkOrder extends Controller {
         factory.addParameter("fworknum",where.getString("fworknum"));
         factory.addParameter("fworknum",where.getString("fworknum"));
         Rows rows = dbConnect.runSqlQuery(factory.getSQL());
         Rows rows = dbConnect.runSqlQuery(factory.getSQL());
         if(rows.isEmpty())return getReturnObject_err("没有此工单").toString();
         if(rows.isEmpty())return getReturnObject_err("没有此工单").toString();
-        return getReturnObject_suc(rows.get(0),false).toString();
+        Row row = rows.get(0);
+        Rows url = dbConnect.runSqlQuery("select tattachmentid,fdocument,fobsurl,type,UPPER(postfix) postfix from tattachment where ownertable='HYWORKORDER' and ownerid=" + row.getInteger("ownerid"));
+        row.put("url",url);
+
+        return getReturnObject_suc(row,false).toString();
     }
     }
 
 
 
 

+ 2 - 0
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/SQL/工单开始前确认.sql

@@ -0,0 +1,2 @@
+select fisscenefname,fistitem,fisperiod,fiserror,repairprice,errormsg,scenefname,scenephone,ftext,faddress,hyWorkorderid ownerid from hyWorkorder
+where fworknum=$fworknum$