Parcourir la source

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

沈静伟 il y a 3 ans
Parent
commit
2cd5c29c71

+ 44 - 0
src/apps/hyworkorder/hyworkorder.java

@@ -495,6 +495,50 @@ public class hyworkorder extends PaoCust {
 		setValue("PROGRESS", 100, 11l);
 		setValue("PROGRESS", 100, 11l);
 		setValue("fstatus", "已完成", 11l);
 		setValue("fstatus", "已完成", 11l);
 	}
 	}
+	
+	  /**作废**/
+    public void cancel() throws Exception {
+     
+        if (getString("fstatus").equals("已完成")) {
+        	throw new P2AppException("","已完成不可作废");
+        	}
+        setValue("fstatus", "作废",11L);
+        PaoSetRemote hyworkorders = P2Server.getP2Server().getPaoSet("HYWORKORDER", P2Server.getP2Server().getSystemUserInfo());
+        hyworkorders.setWhere("siteid='"+getString("siteid")+"' and servernum='"+getString("servernum")+"' and HYWORKORDERID!="+getUniqueIDValue());
+        hyworkorders.reset();
+        if(hyworkorders.isEmpty()) {
+        	if(!getPaoSet("AFTERSERVICEORDER").isEmpty()) {
+        		System.out.println(111);
+        		getPaoSet("AFTERSERVICEORDER").getPao(0).setValue("fstatus", "待指派");
+        	}
+        }else {
+        	int i=0;
+        	int count=0;
+        	PaoRemote paoRemote=null;
+        	while ((paoRemote=hyworkorders.getPao(i))!=null) {
+        		if((paoRemote.getString("fstatus")==null || paoRemote.getString("fstatus").length()==0) || paoRemote.getString("fstatus").equals("作废")){
+        			System.out.println(paoRemote.getString("fworknum"));
+        			count++;
+        		}
+				i++;
+			}
+//        	System.out.println(55);
+//        	System.out.println(count);
+//        	System.out.println(hyworkorders.count());
+        	if(count==hyworkorders.count()) {
+        		System.out.println("测试");
+        		getPaoSet("AFTERSERVICEORDER").getPao(0).setValue("fstatus", "待指派");
+        	}
+		}
+        if(getSite().equals("TZ")) {
+			PaoSetRemote workermassage = getPaoSet("$workermassage", "workermassage", "");
+      		PaoRemote remote1 = workermassage.addAtEnd();
+      		remote1.setValue("ftype", "工单消息", 11l);
+      		remote1.setValue("title", "服务工单:"+getString("FWORKNUM")+"已作废", 11l);
+      		remote1.setValue("content","服务工单:"+getString("FWORKNUM")+"已作废", 11l);
+      		remote1.setValue("phone", getString("PROJECTLEADER"), 11l);
+      		} 
+        }
 
 
 	/** 拒绝 **/
 	/** 拒绝 **/
 	public void refuse() throws P2Exception {
 	public void refuse() throws P2Exception {

+ 3 - 2
src/rest/openapi/restcontroller/hyworkorder/webapp/workorder/HyWorkOrder.java

@@ -1031,8 +1031,9 @@ public class HyWorkOrder extends Controller {
 
 
     /**
     /**
      * 工单作废
      * 工单作废
+     * @throws Exception 
      **/
      **/
-    public String cancel() {
+    public String cancel() throws Exception {
         if (StringUtils.isBlank(hrid))
         if (StringUtils.isBlank(hrid))
             return getReturnObject_err("hrid为空").toString();
             return getReturnObject_err("hrid为空").toString();
 //        if(StringUtils.isBlank(fagentnum))return getReturnObject_err("fagentnum为空").toString();
 //        if(StringUtils.isBlank(fagentnum))return getReturnObject_err("fagentnum为空").toString();
@@ -1060,7 +1061,7 @@ public class HyWorkOrder extends Controller {
                 if (hyworkorder.getString("fstatus").equals("已完成")) {
                 if (hyworkorder.getString("fstatus").equals("已完成")) {
                     return getReturnObject_err("已完成不可作废").toString();
                     return getReturnObject_err("已完成不可作废").toString();
                 }
                 }
-                hyworkorder.setValue("fstatus", "作废", 11L);
+                hyworkorder.cancel();
                 if (hyworkorder.getSite().equals("TZ")) {
                 if (hyworkorder.getSite().equals("TZ")) {
 
 
                     PaoSetRemote workermassage = hyworkorder.getPaoSet("$workermassage", "workermassage", "");
                     PaoSetRemote workermassage = hyworkorder.getPaoSet("$workermassage", "workermassage", "");

+ 2 - 1
src/rest/openapi/restcontroller/wechatapp/titem/SQL/货品档案列表查询.sql

@@ -41,6 +41,7 @@ from titem t1
          left join tunit t2 on t1.funitid = t2.funitid and t1.siteid = t2.siteid
          left join tunit t2 on t1.funitid = t2.funitid and t1.siteid = t2.siteid
          left join titemclass t3 on t1.fsaleclsnum = t3.fitemclsnum and t3.fclasstype = 'ÓªÏúÀà±ð' and t1.siteid = t3.siteid
          left join titemclass t3 on t1.fsaleclsnum = t3.fitemclsnum and t3.fclasstype = 'ÓªÏúÀà±ð' and t1.siteid = t3.siteid
          left join tfavorites t4 on t1.fitemno = t4.fitemno and t1.siteid = t4.siteid and t4.fagentnum =$fagentnum$
          left join tfavorites t4 on t1.fitemno = t4.fitemno and t1.siteid = t4.siteid and t4.fagentnum =$fagentnum$
+         inner join titem_saleclsnum t5 on t1.siteid=t5.siteid and t1.titemid=t5.fparentid
 where fisonsale = 1
 where fisonsale = 1
   and fstatus = 'ÉóºË'
   and fstatus = 'ÉóºË'
   and t1.siteid =$siteid$
   and t1.siteid =$siteid$
@@ -48,7 +49,7 @@ where fisonsale = 1
   and (exists ( select * from tagentauthors where fagentnum=$fagentnum$
   and (exists ( select * from tagentauthors where fagentnum=$fagentnum$
   and siteid=t1.siteid
   and siteid=t1.siteid
   and (isnull(fsaleclsnum
   and (isnull(fsaleclsnum
-    , '')=isnull(t1.fsaleclsnum
+    , '')=isnull(t5.fsaleclsnum
     , '')
     , '')
    or isnull(fitemno
    or isnull(fitemno
     , '')=t1.fitemno))
     , '')=t1.fitemno))