|
|
@@ -495,6 +495,50 @@ public class hyworkorder extends PaoCust {
|
|
|
setValue("PROGRESS", 100, 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 {
|