盘点接口相关调整

test
anthonywj 1 year ago
parent 474971fb2f
commit b626d39d0d

@ -0,0 +1,96 @@
package com.glxp.api.controller.inv;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.inv.InvCountCodesEntity;
import com.glxp.api.req.inv.FilterInvCountCodesRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.service.inv.InvCountCodesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class InvCountCodesController {
@Resource
private InvCountCodesService invCountCodesService;
/**
*
*
* @param codesRequest
* @return
*/
@Log(title = "查询码表")
@GetMapping("/invCount/codes/filter")
public BaseResponse filterList(FilterInvCountCodesRequest codesRequest) {
List<InvCountCodesEntity> list = invCountCodesService.filterList(codesRequest);
PageInfo<InvCountCodesEntity> pageInfo = new PageInfo<>(list);
PageSimpleResponse<InvCountCodesEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(list);
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param codesRequest
* @return
*/
@Log(title = "移除条码", businessType = BusinessType.DELETE)
@PostMapping("/invCount/codes/deleteCode")
public BaseResponse deleteCode(@RequestBody FilterInvCountCodesRequest codesRequest) {
if (null == codesRequest || StrUtil.isBlank(codesRequest.getOrderIdFk()) || StrUtil.isBlank(codesRequest.getProductId()) || StrUtil.isBlank(codesRequest.getCode())) {
return ResultVOUtils.success(ResultEnum.PARAM_VERIFY_FALL);
}
return invCountCodesService.deleteCode(codesRequest);
}
/**
*
*
* @param invCountCodes
* @return
*/
@Log(title = "添加条码", businessType = BusinessType.INSERT)
@PostMapping("/invCount/codes/addCode")
public BaseResponse addCode(@RequestBody InvCountCodesEntity invCountCodes) {
if (null == invCountCodes || StrUtil.isBlank(invCountCodes.getCode())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invCountCodesService.addCode(invCountCodes);
}
/**
*
*
* @param orderIdFk
* @return
*/
@Log(title = "根据此盘点单据号统计条码数量")
@GetMapping("/invCount/codes/getCountOrderCodesNum")
public BaseResponse getCountOrderCodesNum(String orderIdFk) {
if (StrUtil.isBlank(orderIdFk)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
Long codesNum = invCountCodesService.getCountOrderCodesNum(orderIdFk);
return ResultVOUtils.success(codesNum);
}
}

@ -0,0 +1,198 @@
package com.glxp.api.controller.inv;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.inv.InvCountOrderEntity;
import com.glxp.api.entity.system.SystemPDFModuleEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
import com.glxp.api.req.inout.SystemPDFModuleRequest;
import com.glxp.api.req.inv.FilterInvCountOrderRequest;
import com.glxp.api.req.inv.FilterInvCountOrderSaveRequest;
import com.glxp.api.req.inv.InvCountOrderPrintRequest;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.req.system.FilterPdfModuleRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inv.InvCountOrderResponse;
import com.glxp.api.service.inv.InvCountOrderService;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.util.JasperUtils;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
*/
@RestController
public class InvCountOrderController {
@Resource
private InvCountOrderService invCountOrderService;
@Resource
private SystemPDFTemplateService systemPDFTemplateService;
@Resource
private SystemPDFModuleService systemPDFModuleService;
/**
*
*
* @param filterInvCountOrderRequest
* @return
*/
@Log(title = "查询盘点单列表")
@GetMapping("/invCount/order/filter")
public BaseResponse filterList(FilterInvCountOrderRequest filterInvCountOrderRequest) {
List<InvCountOrderResponse> list = invCountOrderService.filterList(filterInvCountOrderRequest);
PageInfo<InvCountOrderResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<InvCountOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(pageInfo.getList());
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param deleteRequest
* @return
*/
@Log(title = "删除盘点单据", businessType = BusinessType.DELETE)
@PostMapping("/invCount/order/delete")
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
invCountOrderService.deleteOrder(deleteRequest.getId());
return ResultVOUtils.success();
}
/**
*
*
* @return
*/
@Log(title = "网页新增盘点单据", businessType = BusinessType.INSERT)
@PostMapping("/invCount/order/saveCountOrder")
public BaseResponse saveCountOrder(@RequestBody InvCountOrderEntity invCountOrder, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
if (null == invCountOrder) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invCountOrderService.saveCountOrder(invCountOrder);
}
/**
*
*
* @param id
* @return
*/
@Log(title = "提交审核")
@GetMapping("/invCount/order/submitAudit")
public BaseResponse submitAudit(String id) {
if (StrUtil.isBlank(id)) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invCountOrderService.submitAudit(id);
}
/**
*
*
* @param filterInvCountOrderRequest
* @return
*/
@Log(title = "更新盘点单据状态", businessType = BusinessType.UPDATE)
@PostMapping("/invCount/order/updateCountOrderStatus")
public BaseResponse updateCountOrderStatus(@RequestBody FilterInvCountOrderRequest filterInvCountOrderRequest) {
if (null == filterInvCountOrderRequest || StrUtil.isBlank(filterInvCountOrderRequest.getId()) || null == filterInvCountOrderRequest.getStatus()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invCountOrderService.updateCountOrderStatus(filterInvCountOrderRequest.getId(), filterInvCountOrderRequest.getStatus());
}
/**
*
*
* @param inspectionPDFTemplateRequest
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/verifyTemplateFile")
public BaseResponse verifyTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) {
if (null == inspectionPDFTemplateRequest) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
//查询模板文件是否存在
FilterPdfModuleRequest systemPDFModuleRequest = new FilterPdfModuleRequest();
systemPDFModuleRequest.setId(inspectionPDFTemplateRequest.getModuleId());
SystemPDFModuleEntity systemPDFModule = systemPDFModuleService.findSystemPDFModule(systemPDFModuleRequest);
if (null == systemPDFModule) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
}
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(systemPDFModule.getTemplateId()));
if (null == systemPDFTemplateEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
}
return ResultVOUtils.success(systemPDFModule.getTemplateId());
}
/**
*
*
* @param invCountOrderPrintRequest
* @param request
* @param response
* @throws Exception
*/
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/printOrder")
public void printOrder(@RequestBody InvCountOrderPrintRequest invCountOrderPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(invCountOrderPrintRequest.getTemplateId());
//打印单号标签
Map<String, Object> data = new HashMap<>(1);
data.put("orderId", invCountOrderPrintRequest.getOrderId());
Map<String, List<Map<String, Object>>> printData = new HashMap<>(1);
printData.put("data", Arrays.asList(data));
JasperUtils.jasperReport(request, response, JSONUtil.toJsonStr(printData), systemPDFTemplateEntity.getPath(), "pdf");
}
//------------------------------------------------------手持终端接口---------------------------------------------------------------
/**
*
*
* @return
*/
@Log(title = "手持终端新增盘点单据接口", businessType = BusinessType.INSERT)
@AuthRuleAnnotation("")
@PostMapping("/invCount/order/saveCountOrderForPDA")
public BaseResponse saveCountOrderForPDA(@RequestBody @Valid FilterInvCountOrderSaveRequest filterInvCountOrderSaveRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
return invCountOrderService.saveCountOrderForPDA(filterInvCountOrderSaveRequest);
}
}

@ -0,0 +1,80 @@
package com.glxp.api.controller.inv;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.inv.InvCountOrderDetailEntity;
import com.glxp.api.req.inv.FilterInvCountOrderDetailRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inv.InvCountOrderDetailResponse;
import com.glxp.api.service.inv.InvCountOrderDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class InvCountOrderDetailController {
@Resource
private InvCountOrderDetailService invCountOrderDetailService;
/**
*
*
* @return
*/
@Log(title = "查询盘点单据详情")
@GetMapping("/invCount/order/detail/filter")
public BaseResponse filterList(FilterInvCountOrderDetailRequest detailRequest) {
List<InvCountOrderDetailResponse> list = invCountOrderDetailService.filterCountDetail(detailRequest);
PageInfo<InvCountOrderDetailResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<InvCountOrderDetailResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(pageInfo.getList());
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param detailRequest
* @return
*/
@Log(title = "删除盘点单据详情", businessType = BusinessType.DELETE)
@PostMapping("/invCount/order/detail/deleteOrderDetail")
public BaseResponse deleteOrderDetail(@RequestBody FilterInvCountOrderDetailRequest detailRequest) {
if (null == detailRequest || null == detailRequest.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invCountOrderDetailService.deleteOrderDetail(detailRequest);
}
/**
*
*
* @param invCountOrderDetail
* @return
*/
@Log(title = "添加产品详情", businessType = BusinessType.INSERT)
@PostMapping("/invCount/order/detail/addCountOrderDetail")
public BaseResponse addCountOrderDetail(@RequestBody InvCountOrderDetailEntity invCountOrderDetail) {
if (null == invCountOrderDetail || StrUtil.isBlank(invCountOrderDetail.getOrderIdFk()) || StrUtil.isBlank(invCountOrderDetail.getProductId())) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
return invCountOrderDetailService.addCountOrderDetail(invCountOrderDetail);
}
}

@ -0,0 +1,89 @@
package com.glxp.api.controller.inv;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.entity.inv.InvCountSettingEntity;
import com.glxp.api.req.inv.FilterInvCountSettingRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inv.InvCountSettingResponse;
import com.glxp.api.service.inv.InvCountSettingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
public class InvCountSettingController {
@Resource
private InvCountSettingService invCountSettingService;
/**
*
*
* @param settingRequest
* @return
*/
@Log(title = "查询盘点设置")
@GetMapping("/invCount/setting/filterList")
public BaseResponse filterList(FilterInvCountSettingRequest settingRequest) {
List<InvCountSettingResponse> list = invCountSettingService.filterList(settingRequest);
PageInfo<InvCountSettingResponse> pageInfo = new PageInfo<>(list);
PageSimpleResponse<InvCountSettingResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(pageInfo.getList());
return ResultVOUtils.success(pageSimpleResponse);
}
/**
*
*
* @param invCountSettingEntity
* @return
*/
@Log(title = "更新盘点设置", businessType = BusinessType.UPDATE)
@PostMapping("/invCount/setting/update")
public BaseResponse updateCountSetting(@RequestBody InvCountSettingEntity invCountSettingEntity) {
return invCountSettingService.updateCountSetting(invCountSettingEntity);
}
/**
*
*
* @param invCountSettingEntity
* @return
*/
@Log(title = "添加盘点设置", businessType = BusinessType.INSERT)
@PostMapping("/invCount/setting/add")
public BaseResponse addCountCountSetting(@RequestBody InvCountSettingEntity invCountSettingEntity) {
return invCountSettingService.addCountSetting(invCountSettingEntity);
}
/**
*
*
* @return
*/
@Log(title = "判断是否可以新增盘点设置")
@GetMapping("/invCount/setting/verifyAdd")
public BaseResponse verifyAdd() {
boolean verify = invCountSettingService.verifyAdd();
if (verify) {
return ResultVOUtils.success();
}
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "已经存在盘点设置,无法添加");
}
}
Loading…
Cancel
Save