1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package com.jsh.erp.controller.materialBatch;
- import com.alibaba.fastjson.JSONArray;
- import com.alibaba.fastjson.JSONObject;
- import com.jsh.erp.base.AjaxResult;
- import com.jsh.erp.base.BaseController;
- import com.jsh.erp.base.TableDataInfo;
- import com.jsh.erp.datasource.entities.MaterialBatch;
- import com.jsh.erp.datasource.entities.MaterialVo4Unit;
- import com.jsh.erp.datasource.vo.MaterialExtendVo4List;
- import com.jsh.erp.query.LambdaQueryWrapperX;
- import com.jsh.erp.query.QueryWrapperX;
- import com.jsh.erp.service.MaterialBatchService;
- import com.jsh.erp.utils.BaseResponseInfo;
- import com.jsh.erp.utils.DateUtils;
- import com.jsh.erp.utils.StringUtil;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import javax.annotation.Resource;
- import javax.servlet.http.HttpServletRequest;
- import java.util.ArrayList;
- import java.util.List;
- @RestController
- @RequestMapping(value = "/materialBatch")
- @Api(tags = {"商品批次信息管理"})
- public class MaterialBatchController extends BaseController {
- @Resource
- private MaterialBatchService materialBatchService;
- @GetMapping(value = "/getDetailList")
- @ApiOperation(value = "商品批次信息管理")
- public TableDataInfo getDetailList(@RequestParam("materialId") Long materialId,
- HttpServletRequest request)throws Exception {
- startPage();
- List<MaterialBatch> list = materialBatchService.list(new LambdaQueryWrapperX<MaterialBatch>().eq(MaterialBatch::getMaterialId,materialId).eq(MaterialBatch::getDeleteFlag,"0"));
- return getDataTable(list);
- }
- @GetMapping(value = "/findBatchNumbersByBarCode")
- @ApiOperation(value = "根据条码查询批次号")
- public AjaxResult findBatchNumbersByBarCode(@RequestParam(value = "barCodes",required = false) String barCodes){
- List<MaterialBatch> dataList = materialBatchService.findBySelectWithBarCode(barCodes);
- StringBuffer str = new StringBuffer();
- //存放数据json数组
- if (null != dataList) {
- for (MaterialBatch material : dataList) {
- str.append("," + material.getBatchNumber());
- }
- }
- return AjaxResult.success(str.length() > 1 ? str.deleteCharAt(0) : str);
- }
- }
|