| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | |
| | | import com.consum.base.service.*; |
| | | import com.consum.base.util.DateUtil; |
| | | import com.consum.model.po.*; |
| | | import jakarta.annotation.Resource; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureController |
| | |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Api(value = "仓库表单采购", tags = "仓库表单采购") |
| | | //@Api(value = "仓库表单采购", tags = "仓库表单采购") |
| | | @RestController |
| | | @RequestMapping("/pc/whForm/procure") |
| | | public class LWhFormProcureController extends BaseController { |
| | |
| | | /** |
| | | * @Description 列表查询 |
| | | */ |
| | | @ApiOperation(value = "采购单列表查询", notes = "采购单列表查询") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "采购查询条件", required = true, |
| | | dataType = "FormProcureQryDto", paramType = "query")}) |
| | | // @ApiOperation(value = "采购单列表查询", notes = "采购单列表查询") |
| | | // @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "采购查询条件", required = true, |
| | | // dataType = "FormProcureQryDto", paramType = "query")}) |
| | | @GetMapping("/list") |
| | | public ResponseValue queryFormProcureList() { |
| | | FormProcureQry param = CommonUtil.getObjFromReq(FormProcureQry.class); |
| | |
| | | return goodsModelVO; |
| | | } |
| | | |
| | | @ApiOperation(value = "采购单明细查询", notes = "采购单明细查询") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "采购单明细查询", required = true, |
| | | dataType = "FormProcureQryDto", paramType = "query")}) |
| | | // @ApiOperation(value = "采购单明细查询", notes = "采购单明细查询") |
| | | // @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "采购单明细查询", required = true, |
| | | // dataType = "FormProcureQryDto", paramType = "query")}) |
| | | @GetMapping("detail/list") |
| | | public ResponseValue queryFormProcureDetailList() { |
| | | FormProcureQry formProcureQry = CommonUtil.getObjFromReq(FormProcureQry.class); |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | // formProcureQry.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | if (param2.getAgencyId() == null) { |
| | | formProcureQry.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | } |
| | | GenericPager genericPager = lWhFormProcureService.queryFormProcureDetailList(formProcureQry); |
| | | return ResponseValue.success(genericPager); |
| | | } |
| | | |
| | | @ApiOperation(value = "采购单导出", notes = "采购单导出") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "采购单id", required = true, dataType = "Long", paramType = "query")}) |
| | | // @ApiOperation(value = "采购单导出", notes = "采购单导出") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "id", value = "采购单id", required = true, dataType = "Long", paramType = "query")}) |
| | | @GetMapping("/list/export") |
| | | public ResponseValue<String> export(Long id, HttpServletResponse response) throws Exception { |
| | | TemplateExportParams params = new TemplateExportParams("import/采购入库单.xls"); |
| | |
| | | * @param file |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "采购单导入", notes = "采购单导入") |
| | | // @ApiOperation(value = "采购单导入", notes = "采购单导入") |
| | | @PostMapping("/import") |
| | | public ResponseValue upload(MultipartFile file) { |
| | | String originalFilename = file.getOriginalFilename(); |
| | |
| | | if (StrUtil.isEmpty(goodsType)) { |
| | | throw new ExcelAnalysisException("第" + index + "条数据,物品类型不能为空:" + goodsType); |
| | | } |
| | | if(!"自采".equals(goodsType) && !"集采".equals(goodsType)){ |
| | | throw new ExcelAnalysisException("第" + index + "条数据,物品类型取值为[自采/集采] 数据源值为:" + goodsType); |
| | | } |
| | | |
| | | // 第一次进来把外层的值设置一下 |
| | | if (lWhFormProcureParam.getAgencyId() == null) { |