Преглед на файлове

Merge branch 'master' of http://47.108.172.52:3000/dayou/item-management-1phase

GouGengquan преди 1 седмица
родител
ревизия
e091d000b1

+ 11 - 0
biz-base/src/main/java/com/dayou/controller/FinanceInvoiceController.java

@@ -178,5 +178,16 @@ public class FinanceInvoiceController extends BaseController {
         return RestResponse.data(ret);
     }
 
+    /**
+     * 拒绝作废
+     * @param id
+     * @return
+     */
+    @GetMapping("/refuse/cancel/{id}")
+    public RestResponse<Boolean> refuseCancel(@PathVariable("id") Long id){
+        Boolean ret = financeInvoiceService.refuseCancel(id);
+        return RestResponse.data(ret);
+    }
+
 }
 

+ 1 - 0
dao/src/main/resources/mapper/PersonalMapper.xml

@@ -124,6 +124,7 @@
             or cl1.name like concat('%',#{keyword},'%')
             or p.bailorA_tel like concat('%',#{keyword},'%')
             or p.bailorB_tel like concat('%',#{keyword},'%')
+            or wn.NAME like concat('%',#{keyword},'%')
             )
         </if>
         <if test="personal!=null and personal.startDate!=null and personal.startDate!=''">

+ 2 - 0
service/src/main/java/com/dayou/service/IFinanceInvoiceService.java

@@ -56,4 +56,6 @@ public interface IFinanceInvoiceService extends IService<FinanceInvoice> {
     List<FinanceInvoiceVo> getInvoiceAmountInfo(MajorProductionSimpleDTO simpleDTO);
 
     Boolean cancelling(Long id);
+
+    Boolean refuseCancel(Long id);
 }

+ 11 - 0
service/src/main/java/com/dayou/service/impl/FinanceInvoiceServiceImpl.java

@@ -207,4 +207,15 @@ public class FinanceInvoiceServiceImpl extends ServiceImpl<FinanceInvoiceMapper,
         return this.update(new LambdaUpdateWrapper<FinanceInvoice>().set(FinanceInvoice::getState, FinanceInvoiceState.已作废).eq(BaseEntity::getId,id));
 
     }
+
+    @Override
+    public Boolean refuseCancel(Long id) {
+        FinanceInvoice invoice = this.getById(id);
+        if (!invoice.getState().equals(FinanceInvoiceState.申请作废.name())){
+            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"发票状态错误,无法作废。");
+        }
+
+        return this.update(new LambdaUpdateWrapper<FinanceInvoice>().set(FinanceInvoice::getState, FinanceInvoiceState.已开票).eq(BaseEntity::getId,id));
+
+    }
 }

+ 8 - 8
service/src/main/java/com/dayou/service/impl/MajorServiceImpl.java

@@ -238,6 +238,7 @@ public class MajorServiceImpl extends ServiceImpl<MajorMapper, Major> implements
                 .eq(WorkFlowNodeInstance::getBusinessId, id)
                 .eq(BaseEntity::getDeleted, Boolean.FALSE));
         WorkFlowNodeInstance allotNode = exists.stream().filter(x -> x.getSequence().equals(1) && x.getState().equals(NodeStateEnum.FINISHED.name())).findFirst().orElse(null);
+
         if (allotNode!=null){
             ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"业务部已分单,无法撤回。若需撤回请联系当前节点待办人退回流程。");
             return Boolean.FALSE;
@@ -245,15 +246,14 @@ public class MajorServiceImpl extends ServiceImpl<MajorMapper, Major> implements
             try {
                 WorkFlowNodeInstance instance = exists.stream().filter(x -> x.getState().equals(NodeStateEnum.PENDING.name())).findFirst().get();
                 //撤回时,当前节点有可能是下单加点和分单节点。如果不是下单节点,就找到分单节点状态改为pending。sequence:0 代表下单节点
-                if (!instance.getSequence().equals(0)){
-                    WorkFlowNodeInstance openNode = exists.stream().filter(x -> x.getSequence().equals(0)).findFirst().get();
-                    List<WorkFlowNodeInstance> others = exists.stream().filter(x -> !x.getSequence().equals(0)).collect(Collectors.toList());
-                    for (WorkFlowNodeInstance workFlowNodeInstance: others){
-                        workFlowNodeInstanceService.removeById(workFlowNodeInstance.getId());
-                    }
-                    openNode.setState(NodeStateEnum.PENDING.name());
-                    workFlowNodeInstanceService.updateById(openNode);
+
+                WorkFlowNodeInstance openNode = exists.stream().filter(x -> x.getSequence().equals(0) && !x.getNodeId().equals(262L)).findFirst().get();
+                List<WorkFlowNodeInstance> others = exists.stream().filter(x -> !x.getId().equals(openNode.getId())).collect(Collectors.toList());
+                for (WorkFlowNodeInstance workFlowNodeInstance: others){
+                    workFlowNodeInstanceService.removeById(workFlowNodeInstance.getId());
                 }
+                openNode.setState(NodeStateEnum.PENDING.name());
+                workFlowNodeInstanceService.updateById(openNode);
             } catch (Exception e) {
                 ErrorCode.throwBusinessException(ErrorCode.DATA_NOT_EXISTS);
             }