|
@@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.plugins.Page;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
import com.winsea.svc.base.base.entity.CommonRoleResource;
|
|
import com.winsea.svc.base.base.entity.CommonRoleResource;
|
|
import com.winsea.svc.base.base.service.ICommonRoleResourceService;
|
|
import com.winsea.svc.base.base.service.ICommonRoleResourceService;
|
|
-import com.winsea.svc.base.base.util.DateUtils;
|
|
|
|
import com.winsea.svc.base.security.entity.User;
|
|
import com.winsea.svc.base.security.entity.User;
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
import com.winsea.svc.base.workflow.entity.Workflow;
|
|
import com.winsea.svc.base.workflow.entity.Workflow;
|
|
@@ -27,6 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -203,30 +205,31 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
} else {
|
|
} else {
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
- boolean isStartWorkflow = StringUtils.isBlank(tradeWarehouseReceiptAppl.getWorkflowId());
|
|
|
|
- // 不是退回的单子
|
|
|
|
- if (isStartWorkflow) {
|
|
|
|
- Workflow workflow = workflowService
|
|
|
|
- .findLatestWorkflowByBusinessCodeByApp(tradeWarehouseReceiptAppl.getCompId(), "TRADE-WAREHOUSE-REPORT");
|
|
|
|
- // 没配置审核流程,直接结束并处理信息
|
|
|
|
- if (workflow == null) {
|
|
|
|
- throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
|
|
|
+ if("0".equals(tradeWarehouseReceiptAppl.getStatusFlag())){
|
|
|
|
+ boolean isStartWorkflow = StringUtils.isBlank(tradeWarehouseReceiptAppl.getWorkflowId());
|
|
|
|
+ // 不是退回的单子
|
|
|
|
+ if (isStartWorkflow) {
|
|
|
|
+ Workflow workflow = workflowService
|
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(tradeWarehouseReceiptAppl.getCompId(), "TRADE-WAREHOUSE-REPORT");
|
|
|
|
+ // 没配置审核流程,直接结束并处理信息
|
|
|
|
+ if (workflow == null) {
|
|
|
|
+ throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
|
+ }
|
|
|
|
+ // 开启审核流
|
|
|
|
+ else {
|
|
|
|
+ // 设置状态 已提交审核
|
|
|
|
+ tradeWarehouseReceiptAppl.setWorkflowId(workflow.getId());
|
|
|
|
+ this.updateById(tradeWarehouseReceiptAppl);
|
|
|
|
+ workflowService.startInstance(workflow.getId(), tradeWarehouseReceiptAppl.getId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- // 开启审核流
|
|
|
|
|
|
+ // 退回的单子 再启用
|
|
else {
|
|
else {
|
|
|
|
|
|
- // 设置状态 已提交审核
|
|
|
|
- tradeWarehouseReceiptAppl.setWorkflowId(workflow.getId());
|
|
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
- workflowService.startInstance(workflow.getId(), tradeWarehouseReceiptAppl.getId());
|
|
|
|
|
|
+ workflowService.activateInstance(tradeWarehouseReceiptAppl.getWorkflowId(), tradeWarehouseReceiptAppl.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- // 退回的单子 再启用
|
|
|
|
- else {
|
|
|
|
-
|
|
|
|
- this.updateById(tradeWarehouseReceiptAppl);
|
|
|
|
- workflowService.activateInstance(tradeWarehouseReceiptAppl.getWorkflowId(), tradeWarehouseReceiptAppl.getId());
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
return tradeWarehouseReceiptAppl.getId();
|
|
return tradeWarehouseReceiptAppl.getId();
|
|
}
|
|
}
|
|
@@ -240,11 +243,18 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
|
|
@Override
|
|
@Override
|
|
public TradeWarehouseReceiptAppl getTrageInfo(String id){
|
|
public TradeWarehouseReceiptAppl getTrageInfo(String id){
|
|
TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl = this.selectById(id);
|
|
TradeWarehouseReceiptAppl tradeWarehouseReceiptAppl = this.selectById(id);
|
|
|
|
+ String taskId = "";
|
|
|
|
+ // 只有待审核状态才有taskId
|
|
|
|
+ if (StringUtils.isNotBlank(tradeWarehouseReceiptAppl.getWorkflowId())) {
|
|
|
|
+ JSONObject jsonObject = workflowService.getActiveTask(Lists.newArrayList(tradeWarehouseReceiptAppl.getWorkflowId()), tradeWarehouseReceiptAppl.getId());
|
|
|
|
+ taskId = jsonObject.getString("taskId");
|
|
|
|
+ tradeWarehouseReceiptAppl.setTaskId(taskId);
|
|
|
|
+ }
|
|
return tradeWarehouseReceiptAppl;
|
|
return tradeWarehouseReceiptAppl;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 查看
|
|
|
|
|
|
+ * 删除
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@@ -254,6 +264,7 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 可用库存
|
|
* 可用库存
|
|
*
|
|
*
|