|
@@ -7,6 +7,7 @@ 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;
|
|
@@ -26,9 +27,6 @@ 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.*;
|
|
@@ -205,31 +203,30 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
} else {
|
|
} else {
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
- 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());
|
|
|
|
- }
|
|
|
|
|
|
+ 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 {
|
|
else {
|
|
|
|
|
|
|
|
+ // 设置状态 已提交审核
|
|
|
|
+ tradeWarehouseReceiptAppl.setWorkflowId(workflow.getId());
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
this.updateById(tradeWarehouseReceiptAppl);
|
|
- workflowService.activateInstance(tradeWarehouseReceiptAppl.getWorkflowId(), tradeWarehouseReceiptAppl.getId());
|
|
|
|
|
|
+ workflowService.startInstance(workflow.getId(), tradeWarehouseReceiptAppl.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 退回的单子 再启用
|
|
|
|
+ else {
|
|
|
|
+
|
|
|
|
+ this.updateById(tradeWarehouseReceiptAppl);
|
|
|
|
+ workflowService.activateInstance(tradeWarehouseReceiptAppl.getWorkflowId(), tradeWarehouseReceiptAppl.getId());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return tradeWarehouseReceiptAppl.getId();
|
|
return tradeWarehouseReceiptAppl.getId();
|
|
}
|
|
}
|
|
@@ -243,18 +240,11 @@ 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
|
|
*/
|
|
*/
|
|
@@ -264,7 +254,6 @@ public class TradeWarehouseReceiptApplServiceImpl extends ServiceImpl<TradeWareh
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 可用库存
|
|
* 可用库存
|
|
*
|
|
*
|