| | |
| | | package com.by4cloud.platformx.device.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.by4cloud.platformx.device.constant.MaxSizeContant; |
| | | import com.by4cloud.platformx.device.entity.PurchaseTendrOrderEntity; |
| | | import com.by4cloud.platformx.device.entity.PurchaseWinningLetterEntity; |
| | | import com.by4cloud.platformx.device.mapper.PurchaseTendrOrderMapper; |
| | | import com.by4cloud.platformx.device.mapper.PurchaseWinningLetterMapper; |
| | | import com.by4cloud.platformx.device.service.JcMaxSizeService; |
| | | import com.by4cloud.platformx.device.service.PurchaseTendrOrderService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 招标采购单 |
| | | * |
| | |
| | | @RequiredArgsConstructor |
| | | public class PurchaseTendrOrderServiceImpl extends ServiceImpl<PurchaseTendrOrderMapper, PurchaseTendrOrderEntity> implements PurchaseTendrOrderService { |
| | | |
| | | private final PurchaseTendrOrderMapper purchaseTendrOrderMapper; |
| | | private final PurchaseWinningLetterMapper purchaseWinningLetterMapper; |
| | | private final JcMaxSizeService maxSizeService; |
| | | |
| | | |
| | | @Override |
| | | public boolean complete(Long id) { |
| | | return false; |
| | | PurchaseTendrOrderEntity orderEntity = baseMapper.selectById(id); |
| | | PurchaseWinningLetterEntity entity = BeanUtil.copyProperties(orderEntity, PurchaseWinningLetterEntity.class); |
| | | entity.setWinningCode(maxSizeService.nextNo(MaxSizeContant.WINNING_CODE)); |
| | | entity.setWinningPrice(orderEntity.getEstimatePrice()); |
| | | entity.setTotalWinningAmount(orderEntity.getTotalPlanndAmount()); |
| | | purchaseWinningLetterMapper.insert(entity); |
| | | orderEntity.setStatus("2"); |
| | | baseMapper.updateById(orderEntity); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public List<PurchaseTendrOrderEntity> getPurchaseRenderList() { |
| | | List<PurchaseTendrOrderEntity> list = baseMapper.selectList(null); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public boolean approved(Long id) { |
| | | PurchaseTendrOrderEntity orderEntity = baseMapper.selectById(id); |
| | | orderEntity.setStatus("1"); |
| | | baseMapper.updateById(orderEntity); |
| | | return true; |
| | | } |
| | | |
| | | } |