|
@@ -13,9 +13,7 @@ import com.fjhx.common.service.coding.CodingRuleService;
|
|
|
import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.flow.core.FlowDelegate;
|
|
|
-import com.fjhx.flow.core.FlowThreadLocalUtil;
|
|
|
import com.fjhx.flow.enums.FlowStatusEnum;
|
|
|
-import com.fjhx.flow.enums.HandleTypeEnum;
|
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseDataResourceEnum;
|
|
|
import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
|
|
|
import com.fjhx.purchase.entity.subscribe.enums.SubscribeDetailStatusEnum;
|
|
@@ -33,11 +31,9 @@ import com.fjhx.sale.service.purchase.*;
|
|
|
import com.fjhx.sale.service.sample.SampleProductService;
|
|
|
import com.fjhx.sale.service.sample.SampleService;
|
|
|
import com.ruoyi.common.annotation.LogicIgnore;
|
|
|
-import com.ruoyi.common.annotation.TenantIgnore;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
-import lombok.experimental.Delegate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -160,7 +156,7 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
purchaseProductMountingsList.forEach(obj -> obj.setPurchaseProductId(id));
|
|
|
addMountingsList.addAll(purchaseProductMountingsList);
|
|
|
}
|
|
|
- ObsFileUtil.saveAllFile(s.getFileList(), s.getId(),0);
|
|
|
+ ObsFileUtil.saveAllFile(s.getFileList(), s.getId(), 0);
|
|
|
|
|
|
if ("0".equals(purchase.getDataResource())) {
|
|
|
//计算采购数量是否大于申购数量
|
|
@@ -198,7 +194,6 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 公共代码块--发起
|
|
|
*/
|
|
@@ -220,10 +215,10 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
List<EhsdPurchaseProductMountings> addMountingsList = new ArrayList<>();
|
|
|
if (CollectionUtils.isNotEmpty(purchaseProductList)) {
|
|
|
for (EhsdPurchaseProduct s : purchaseProductList) {//产品
|
|
|
- long id ;
|
|
|
- if(ObjectUtils.isNotEmpty(s.getId())){
|
|
|
+ long id;
|
|
|
+ if (ObjectUtils.isNotEmpty(s.getId())) {
|
|
|
id = s.getId();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
id = IdWorker.getId();
|
|
|
}
|
|
|
s.setId(id);
|
|
@@ -346,18 +341,19 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
|
|
|
/**
|
|
|
* 重新发起
|
|
|
+ *
|
|
|
* @param flowId
|
|
|
* @param businessId
|
|
|
* @param flowStatus
|
|
|
* @param submitData
|
|
|
*/
|
|
|
@Override
|
|
|
- @LogicIgnore(tableName = {""},alias = {""})
|
|
|
+ @LogicIgnore
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public void relaunch(Long flowId, Long businessId, FlowStatusEnum flowStatus, JSONObject submitData) {
|
|
|
//删除采购合同
|
|
|
EhsdPurchaseDto purchase = submitData.toJavaObject(EhsdPurchaseDto.class);
|
|
|
- if(ObjectUtils.isEmpty(purchase)){
|
|
|
+ if (ObjectUtils.isEmpty(purchase)) {
|
|
|
throw new ServiceException("采购数据不能为空");
|
|
|
}
|
|
|
purchase.setFlowId(flowId);
|
|
@@ -366,20 +362,19 @@ public class EhsdPurchaseFlow extends FlowDelegate {
|
|
|
|
|
|
/**
|
|
|
* 驳回
|
|
|
+ *
|
|
|
* @param flowId
|
|
|
* @param businessId
|
|
|
* @param flowStatus
|
|
|
*/
|
|
|
@Override
|
|
|
public void reject(Long flowId, Long businessId, FlowStatusEnum flowStatus) {
|
|
|
- if (HandleTypeEnum.REJECT.equals(FlowThreadLocalUtil.getHandleTypeEnum())) {
|
|
|
- sampleService.update(q -> q
|
|
|
- .eq(Sample::getId, FlowThreadLocalUtil.getBusinessId())
|
|
|
- .set(Sample::getStatus, 20)//20为驳回
|
|
|
- .set(Sample::getUpdateTime, new Date())
|
|
|
- .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
- );
|
|
|
- }
|
|
|
+ sampleService.update(q -> q
|
|
|
+ .eq(Sample::getId, businessId)
|
|
|
+ .set(Sample::getStatus, 20)//20为驳回
|
|
|
+ .set(Sample::getUpdateTime, new Date())
|
|
|
+ .set(BasePo::getUpdateUser, SecurityUtils.getUserId())
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
}
|