|
|
|
package org.jeecg.modules.erp.trade.controller;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import com.alibaba.excel.ExcelReader;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
|
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
|
...
|
...
|
@@ -11,6 +14,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
|
import org.jeecg.modules.erp.trade.entity.TblTradePriceInquiry;
|
|
|
|
import org.jeecg.modules.erp.trade.mapper.TblTradePriceInquiryMapper;
|
|
|
|
import org.jeecg.modules.erp.trade.vo.TblTradeBidSubPage;
|
|
|
|
import org.jeecgframework.poi.util.ExcelUtil;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
...
|
...
|
@@ -66,6 +71,10 @@ public class TblTradeTenderInfoController extends JeecgController<TblTradeTender |
|
|
|
private ITblTradeBidSubService tblTradeBidSubService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private TblTradePriceInquiryMapper tblTradePriceInquiryMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/*---------------------------------主表处理-begin-------------------------------------*/
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -185,6 +194,8 @@ public class TblTradeTenderInfoController extends JeecgController<TblTradeTender |
|
|
|
page.setYxdj(yxdj);
|
|
|
|
page.setXjjhwcsj(xjwcrq);
|
|
|
|
page.setBdlx(bdlx);
|
|
|
|
// 状态默认询价中
|
|
|
|
page.setStatus("1");
|
|
|
|
}
|
|
|
|
tblTradeTenderInfoService.saveUploadData(list);
|
|
|
|
return Result.OK("文件导入成功!数据行数:" + list.size());
|
|
...
|
...
|
@@ -202,6 +213,40 @@ public class TblTradeTenderInfoController extends JeecgController<TblTradeTender |
|
|
|
return Result.OK("文件导入失败!");
|
|
|
|
// return super.importExcel(request, response, TblTradeTenderInfo.class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 询价提交审批
|
|
|
|
* @param tblTradeTenderInfo
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="询价提交审批", notes="询价提交审批")
|
|
|
|
@PostMapping(value = "/submit")
|
|
|
|
public Result<String> submit(@RequestBody TblTradeTenderInfo tblTradeTenderInfo) {
|
|
|
|
// 1、修改状态为审批中,状态:1-询价中,2-询价审批中,3-询价审批通过
|
|
|
|
tblTradeTenderInfo.setStatus("2");
|
|
|
|
tblTradeTenderInfoService.updateById(tblTradeTenderInfo);
|
|
|
|
|
|
|
|
// 2、判断此标书的询价是否全部提交,如果全部提交完成,修改询价状态和询价完成时间
|
|
|
|
long count = tblTradeTenderInfoService.count(Wrappers.lambdaQuery(TblTradeTenderInfo.class)
|
|
|
|
.eq(TblTradeTenderInfo::getStatus, "1"));
|
|
|
|
if (count == 0){
|
|
|
|
// 状态为询价中的数据没有了,表明全部已提交或审批完成
|
|
|
|
LambdaUpdateWrapper<TblTradePriceInquiry> updateWrapper = Wrappers.lambdaUpdate(TblTradePriceInquiry.class)
|
|
|
|
.set(TblTradePriceInquiry::getSjwcrq, DateUtil.today())
|
|
|
|
.set(TblTradePriceInquiry::getXdzt, "完成")
|
|
|
|
.eq(TblTradePriceInquiry::getXjbswjh, tblTradeTenderInfo.getXjbswjh());
|
|
|
|
tblTradePriceInquiryMapper.update(null,updateWrapper);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 3、更新责任人
|
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
System.out.println(loginUser);
|
|
|
|
LambdaUpdateWrapper<TblTradePriceInquiry> updateWrapper = Wrappers.lambdaUpdate(TblTradePriceInquiry.class)
|
|
|
|
.set(TblTradePriceInquiry::getZrr, loginUser.getRealname())
|
|
|
|
.eq(TblTradePriceInquiry::getXjbswjh, tblTradeTenderInfo.getXjbswjh());
|
|
|
|
tblTradePriceInquiryMapper.update(null,updateWrapper);
|
|
|
|
return Result.OK("提交成功!");
|
|
|
|
}
|
|
|
|
/*---------------------------------主表处理-end-------------------------------------*/
|
|
|
|
|
|
|
|
|
...
|
...
|
|