|
@@ -9,8 +9,11 @@ import com.winsea.svc.base.base.entity.CommonRoleResource;
|
|
|
import com.winsea.svc.base.base.service.ICommonRoleResourceService;
|
|
|
import com.winsea.svc.base.security.entity.User;
|
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
+import com.winsea.svc.base.workflow.entity.Workflow;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.PaymentManagementMapper;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IPaymentManagementService;
|
|
@@ -60,7 +63,7 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
|
* paymentManagement.getPageSize());
|
|
|
List<String> businessKeys = null;
|
|
|
if ("1".equals(paymentManagement.getSearchType())) {
|
|
|
- businessKeys = workflowService.getTaskBusinessKeysByCode("PROCUREMENT-RECEIPT-REPORT");
|
|
|
+ businessKeys = workflowService.getTaskBusinessKeysByCode("PAYMENT-MANAGEMENT-APPROVE");
|
|
|
}
|
|
|
List<String> statusSet = new ArrayList<>();
|
|
|
List<String> resourceIdList = this.getResourceIdList();
|
|
@@ -126,7 +129,31 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
|
*/
|
|
|
@Override
|
|
|
public String editInfo(PaymentManagement paymentManagement) {
|
|
|
+ PaymentManagement paymentManagement1=this.selectById(paymentManagement.getId());
|
|
|
this.updateById(paymentManagement);
|
|
|
+ boolean isStartWorkflow = org.apache.commons.lang3.StringUtils.isBlank(paymentManagement.getWorkflowId());
|
|
|
+ // 不是退回的单子
|
|
|
+ if (isStartWorkflow) {
|
|
|
+ Workflow workflow = workflowService
|
|
|
+ .findLatestWorkflowByBusinessCodeByApp(paymentManagement1.getCompId(), "PAYMENT-MANAGEMENT-APPROVE");
|
|
|
+ // 没配置审核流程,直接结束并处理信息
|
|
|
+ if (workflow == null) {
|
|
|
+ throw new YException(YExceptionEnum.PURCHASE_ORDER_ERROR);
|
|
|
+ }
|
|
|
+ // 开启审核流
|
|
|
+ else {
|
|
|
+
|
|
|
+ // 设置状态 已提交审核
|
|
|
+ paymentManagement1.setWorkflowId(workflow.getId());
|
|
|
+ this.updateById(paymentManagement1);
|
|
|
+ workflowService.startInstance(workflow.getId(), paymentManagement1.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 退回的单子 再启用
|
|
|
+ else {
|
|
|
+ this.updateById(paymentManagement1);
|
|
|
+ workflowService.activateInstance(paymentManagement1.getWorkflowId(), paymentManagement1.getId());
|
|
|
+ }
|
|
|
return "OK";
|
|
|
}
|
|
|
|
|
@@ -194,6 +221,30 @@ public class PaymentManagementServiceImpl extends ServiceImpl<PaymentManagementM
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Float cumulant(PaymentManagement paymentManagement) {
|
|
|
+ Float cumulant=0.0f;
|
|
|
+ List<PaymentManagement> paymentManagementList = this.selectList(new EntityWrapper<PaymentManagement>()
|
|
|
+ .eq("goods_name",paymentManagement.getGoodsName())
|
|
|
+ .eq("customer_name",paymentManagement.getCustomerName())
|
|
|
+ .eq("comp_id",paymentManagement.getCompId()));
|
|
|
+ if (!CollectionUtils.isEmpty(paymentManagementList)){
|
|
|
+ Float netWeight = 0f;
|
|
|
+ for (PaymentManagement paymentManagement1:paymentManagementList){
|
|
|
+ //干粮净重
|
|
|
+ if ("干粮".equals(paymentManagement1.getType())){
|
|
|
+ netWeight=paymentManagement1.getNetWeight();
|
|
|
+ }
|
|
|
+ //潮粮纯重
|
|
|
+ else {
|
|
|
+ netWeight=paymentManagement1.getPureWeight();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ cumulant=cumulant+netWeight;
|
|
|
+ }
|
|
|
+ return cumulant;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private List<String> getResourceIdList() {
|
|
|
User currentUser = AuthSecurityUtils.getCurrentUserInfo();
|