cjl
2023-09-27 57b29a43e4d1505d44e1ac82ed61ef640ba49e8c
screen-api/src/main/java/com/moral/api/service/impl/AllocationExtensionServiceImpl.java
@@ -16,8 +16,11 @@
import com.moral.api.service.AllocationExtensionService;
import com.moral.api.service.AllocationService;
import com.moral.api.service.FileTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * <p>
@@ -30,11 +33,11 @@
@Service
public class AllocationExtensionServiceImpl extends ServiceImpl<AllocationExtensionMapper, AllocationExtension> implements AllocationExtensionService {
    private final AllocationService allocationService;
    @Autowired
    private AllocationService allocationService;
    private final FileTableService fileTableService;
    public AllocationExtensionServiceImpl(AllocationService allocationService, FileTableService fileTableService) {
        this.allocationService = allocationService;
    public AllocationExtensionServiceImpl( FileTableService fileTableService) {
        this.fileTableService = fileTableService;
    }
@@ -63,6 +66,8 @@
    @Override
    public Page<AllocationExtensionPageExt> extPage(AllocationExtensionPageCond allocationExtensionPageCond) {
        List<Integer> unitList = allocationService.unitResult();
        allocationExtensionPageCond.setUnitList(unitList);
        return this.baseMapper.extPage(allocationExtensionPageCond.getPage().convertPage(), allocationExtensionPageCond);
    }
@@ -73,16 +78,16 @@
    @Override
    @Transactional
    public boolean check(Integer id, Integer sate) {
    public boolean check(Integer id, Integer state) {
        AllocationExtensionExt extensionExt = this.baseMapper.extOne(id);
        if(!AllocationExtensionApproveEnum.APPLYING.value.equals(extensionExt.getState())){
            throw new BusinessException("审批中才能发起审批!");
        }
        AllocationExtension allocationExtension = new AllocationExtension();
        allocationExtension.setId(id);
        allocationExtension.setState(sate);
        allocationExtension.setState(state);
        this.baseMapper.updateById(allocationExtension);
        if(AllocationExtensionApproveEnum.PASS.value.equals(sate)){
        if(AllocationExtensionApproveEnum.PASS.value.equals(state)){
            Allocation allocation = new Allocation();
            allocation.setAllocationId(extensionExt.getAllocationId());
            allocation.setChangeDay(extensionExt.getChangeDay()+extensionExt.getExtensionNum());