| | |
| | | package com.consum.base.controller; |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.PageUtil; |
| | |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.web.ResponseValue; |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Description 盘点 |
| | |
| | | @Autowired |
| | | private FinSysTenantUserServiceImpl finSysTenantUserService; |
| | | |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "新增盘点", notes = "新增盘点") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam") |
| | | }) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam")}) |
| | | @PostMapping("/add") |
| | | public ResponseValue add() { |
| | | |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | //根据盘点人id查询盘点人 |
| | | // 根据盘点人id查询盘点人 |
| | | // 盘点人id为sysUserId字段查询 |
| | | FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); |
| | | finSysTenantUser.setId(param.getOperatorUserId()); |
| | | FinSysTenantUser operatorUser = finSysTenantUserService.get(finSysTenantUser); |
| | | //根据监盘人id查询监盘人 |
| | | finSysTenantUser.setSysUserId(param.getOperatorUserId()); |
| | | FinSysTenantUser operatorUser = |
| | | finSysTenantUserService.select(finSysTenantUser).stream().findFirst().orElse(null); |
| | | // 根据监盘人id查询监盘人 |
| | | FinSysTenantUser monitorUserInfo = new FinSysTenantUser(); |
| | | monitorUserInfo.setId(param.getMonitorUserId()); |
| | | FinSysTenantUser monitorUser = finSysTenantUserService.get(monitorUserInfo); |
| | |
| | | * @Date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "盘点单列表查询", notes = "盘点单列表查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", required = true, paramType = "query") |
| | | }) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", |
| | | required = true, paramType = "query")}) |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList() { |
| | | LWhFormInventoryQry param = CommonUtil.getObjFromReq(LWhFormInventoryQry.class); |
| | |
| | | |
| | | @ApiOperation(value = "盘点单物品列表查询", notes = "盘点单物品列表查询", response = FormInventoryVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query") |
| | | }) |
| | | @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query")}) |
| | | @ApiResponse(code = 200, message = "成功", response = FormInventoryVO.class) |
| | | @GetMapping("/query") |
| | | public ResponseValue queryInventBaseGoodTemplate(Long id) { |
| | |
| | | if (id == null) { |
| | | return ResponseValue.error("参数不能为空"); |
| | | } |
| | | //通过机构查询相关的模板信息 |
| | | // 通过机构查询相关的模板信息 |
| | | FormInventoryVO formInventoryVO = lWhFormInventoryService.queryInventBaseGoodTemplate(id); |
| | | |
| | | // 保存后返回记录信息 |
| | |
| | | * @Date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "编辑盘点", notes = "编辑盘点") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam") |
| | | }) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam")}) |
| | | @PostMapping("/edit") |
| | | public ResponseValue edit() { |
| | | FormInventoryParam param = CommonUtil.getObjFromReqBody(FormInventoryParam.class); |
| | |
| | | return ResponseValue.error("编辑失败!"); |
| | | } |
| | | |
| | | //根据盘点人id查询盘点人 |
| | | // 根据盘点人id查询盘点人 |
| | | FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); |
| | | finSysTenantUser.setId(param.getOperatorUserId()); |
| | | FinSysTenantUser operatorUser = finSysTenantUserService.get(finSysTenantUser); |
| | | //根据监盘人id查询监盘人 |
| | | // 根据监盘人id查询监盘人 |
| | | FinSysTenantUser monitorUserInfo = new FinSysTenantUser(); |
| | | monitorUserInfo.setId(param.getMonitorUserId()); |
| | | FinSysTenantUser monitorUser = finSysTenantUserService.get(monitorUserInfo); |
| | |
| | | */ |
| | | @ApiOperation(value = "根据id删除盘点", notes = "根据id删除盘点") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query") |
| | | }) |
| | | @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query")}) |
| | | @DeleteMapping("/del") |
| | | public ResponseValue delById(Long id) { |
| | | if (id == null) { |
| | |
| | | return ResponseValue.success(1); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 暂存 |
| | | * |
| | |
| | | * @date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "盘点暂存", notes = "盘点暂存") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto") |
| | | }) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto")}) |
| | | @PostMapping("/temporary/storage") |
| | | public ResponseValue updateTemporaryStorage() { |
| | | LWhFormInventoryParam param = CommonUtil.getObjFromReqBody(LWhFormInventoryParam.class); |
| | |
| | | * @date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "完成盘点", notes = "完成盘点") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto") |
| | | }) |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto")}) |
| | | @PostMapping("/finish") |
| | | public ResponseValue updateFinishPd() { |
| | | LWhFormInventoryParam param = CommonUtil.getObjFromReqBody(LWhFormInventoryParam.class); |
| | |
| | | */ |
| | | @ApiOperation(value = "异常明细列表查询", notes = "异常明细列表查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", paramType = "query") |
| | | }) |
| | | @ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", paramType = "query")}) |
| | | @GetMapping("/list/PdDetail") |
| | | public ResponseValue queryPdDetailList() { |
| | | LWhFormInventoryQry param = CommonUtil.getObjFromReq(LWhFormInventoryQry.class); |
| | |
| | | |
| | | @ApiOperation(value = "根据id查询盘点物品详细信息", notes = "根据id查询盘点物品详细信息") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "盘点id", dataType = "Long", required = true, paramType = "query") |
| | | }) |
| | | @ApiImplicitParam(name = "id", value = "盘点id", dataType = "Long", required = true, paramType = "query")}) |
| | | @GetMapping("/detail") |
| | | public ResponseValue selectDetailById(Long id) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | |
| | | |
| | | @ApiOperation(value = "盘点单导出", notes = "盘点单导出") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query") |
| | | }) |
| | | @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query")}) |
| | | @GetMapping("/list/export") |
| | | public void export(Long id, HttpServletResponse response) throws Exception { |
| | | |
| | |
| | | map.put("endDate", DateUtils.toShowDate(endTime)); |
| | | map.put("monitorName", monitorName); |
| | | map.put("name", operatorName); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, InventoryExcelTemplate.class, |
| | | exportList, map); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, InventoryExcelTemplate.class, exportList, map); |
| | | |
| | | downLoadExcel("低值易耗品盘点表", response, workbook); |
| | | } |
| | | |
| | | |
| | | } |
| | | |