移除盘点相关功能
parent
1b6eb549d8
commit
1b3c16482a
@ -1,88 +0,0 @@
|
||||
package com.glxp.api.controller.inv;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
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.entity.inv.InvCountCodesEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCountCodesRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.inv.InvCountCodesService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 盘点单据码表
|
||||
*/
|
||||
@RestController
|
||||
public class InvCountCodesController {
|
||||
|
||||
@Resource
|
||||
private InvCountCodesService invCountCodesService;
|
||||
|
||||
/**
|
||||
* 查询码表
|
||||
*
|
||||
* @param codesRequest
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/inv/count/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
|
||||
*/
|
||||
@PostMapping("/inv/count/codes/deleteCode")
|
||||
public BaseResponse deleteCode(@RequestBody FilterInvCountCodesRequest codesRequest) {
|
||||
if (null == codesRequest || StrUtil.isBlank(codesRequest.getOrderIdFk()) || StrUtil.isBlank(codesRequest.getRelId()) || StrUtil.isBlank(codesRequest.getCode())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return invCountCodesService.deleteCode(codesRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加条码
|
||||
*
|
||||
* @param invCountCodes
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/count/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
|
||||
*/
|
||||
@GetMapping("/inv/count/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);
|
||||
}
|
||||
|
||||
}
|
@ -1,197 +0,0 @@
|
||||
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.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
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.inv.AddInvCountOrderSaveRequest;
|
||||
import com.glxp.api.req.inv.FilterInvCountOrderRequest;
|
||||
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.beans.factory.annotation.Value;
|
||||
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;
|
||||
@Value("${file_path}")
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 查询盘点单列表
|
||||
*
|
||||
* @param filterInvCountOrderRequest
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/inv/count/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
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/inv/count/order/delete")
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest) {
|
||||
invCountOrderService.deleteOrder(deleteRequest.getId());
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 网页新增盘点单据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/inv/count/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
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/inv/count/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
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/inv/count/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), filePath + "/pdf/template/"+systemPDFTemplateEntity.getPath(), "pdf");
|
||||
}
|
||||
|
||||
//------------------------------------------------------手持终端接口---------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* 手持终端新增盘点单据接口
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/invCount/order/saveCountOrderForPDA")
|
||||
public BaseResponse saveCountOrderForPDA(@RequestBody @Valid AddInvCountOrderSaveRequest addInvCountOrderSaveRequest, BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
return invCountOrderService.saveCountOrderForPDA(addInvCountOrderSaveRequest);
|
||||
}
|
||||
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
package com.glxp.api.controller.inv;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
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.entity.inv.InvCountOrderDetailEntity;
|
||||
import com.glxp.api.req.inv.AddInvCountOrderSaveRequest;
|
||||
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
|
||||
*/
|
||||
@GetMapping("/inv/count/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
|
||||
*/
|
||||
@PostMapping("/inv/count/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
|
||||
*/
|
||||
@PostMapping("/inv/count/order/detail/addCountOrderDetail")
|
||||
public BaseResponse addCountOrderDetail(@RequestBody InvCountOrderDetailEntity invCountOrderDetail) {
|
||||
if (null == invCountOrderDetail || StrUtil.isBlank(invCountOrderDetail.getOrderIdFk()) || null == invCountOrderDetail.getRelId()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return invCountOrderDetailService.addCountOrderDetail(invCountOrderDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加盘点单据详情
|
||||
*
|
||||
* @param addInvCountOrderSaveRequest
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/inv/count/order/detail/batchAddDetail")
|
||||
public BaseResponse batchAddDetail(@RequestBody AddInvCountOrderSaveRequest addInvCountOrderSaveRequest) {
|
||||
if (null == addInvCountOrderSaveRequest || CollUtil.isEmpty(addInvCountOrderSaveRequest.getCountOrderDetailList())) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
||||
}
|
||||
return invCountOrderDetailService.batchAddDetail(addInvCountOrderSaveRequest.getOrderId(), addInvCountOrderSaveRequest.getCountOrderDetailList());
|
||||
}
|
||||
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
package com.glxp.api.dao.inv;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.inv.InvCountCodesEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCountCodesRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点单据码表Dao
|
||||
*/
|
||||
public interface InvCountCodesDao extends BaseMapper<InvCountCodesEntity> {
|
||||
|
||||
/**
|
||||
* 根据盘点单号删除盘点单据码详情
|
||||
*
|
||||
* @param orderId
|
||||
*/
|
||||
void deleteByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 查询盘点单据码详情
|
||||
*
|
||||
* @param codesRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvCountCodesEntity> filterList(FilterInvCountCodesRequest codesRequest);
|
||||
|
||||
/**
|
||||
* 根据盘点单据ID统计条码数量
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @return
|
||||
*/
|
||||
Long countByOrderIdFk(@Param("orderIdFk") String orderIdFk);
|
||||
|
||||
/**
|
||||
* 根据单据号统计条码数量
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @return
|
||||
*/
|
||||
Long countByOrderId(@Param("orderIdFk") String orderIdFk);
|
||||
|
||||
/**
|
||||
* 根据条码和盘点单号统计数量
|
||||
*
|
||||
* @param code
|
||||
* @param orderIdFk
|
||||
* @return
|
||||
*/
|
||||
Long selectCountByCodeAndOrderId(@Param("code") String code, @Param("orderIdFk") String orderIdFk);
|
||||
|
||||
/**
|
||||
* 清空盘点单据相关字段
|
||||
*
|
||||
* @param orderId
|
||||
*/
|
||||
void resetCountFiledValue(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 根据盘点单号和产品ID查询码表
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
List<InvCountCodesEntity> selectByOrderIdAndProductId(@Param("orderIdFk") String orderIdFk, @Param("productId") String productId);
|
||||
|
||||
/**
|
||||
* 查询盘点单据码详情集合
|
||||
*
|
||||
* @param codesRequest
|
||||
* @return
|
||||
*/
|
||||
List<String> selectCodes(FilterInvCountCodesRequest codesRequest);
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.glxp.api.dao.inv;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.inv.InvCountOrderEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCountOrderRequest;
|
||||
import com.glxp.api.res.inv.InvCountOrderResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点单据表Dao
|
||||
*/
|
||||
public interface InvCountOrderDao extends BaseMapper<InvCountOrderEntity> {
|
||||
|
||||
/***
|
||||
* 查询盘点单据数据
|
||||
* @param filterInvCountOrderRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvCountOrderResponse> filterList(FilterInvCountOrderRequest filterInvCountOrderRequest);
|
||||
|
||||
/**
|
||||
* 根据id查询盘点单号
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
String selectOrderIdById(@Param("id") String id);
|
||||
|
||||
/**
|
||||
* 根据仓库和货位码统计盘点单数量
|
||||
*
|
||||
* @param deptCode 部门编码
|
||||
* @param invCode 仓库编码
|
||||
* @param invSpaceCode 货位编码
|
||||
* @return
|
||||
*/
|
||||
Integer countBySpaceCode(@Param("deptCode") String deptCode, @Param("invCode") String invCode, @Param("invSpaceCode") String invSpaceCode);
|
||||
|
||||
/**
|
||||
* 根据盘点单号更新单据信息
|
||||
*
|
||||
* @param invCountOrder
|
||||
*/
|
||||
void updateByOrderId(InvCountOrderEntity invCountOrder);
|
||||
|
||||
/**
|
||||
* 根据单据号查询盘点单据信息
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
InvCountOrderEntity selectByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 根据单据号删除单据
|
||||
*
|
||||
* @param orderId
|
||||
*/
|
||||
void deleteByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
package com.glxp.api.dao.inv;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.glxp.api.entity.inv.InvCountOrderDetailEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCountOrderDetailRequest;
|
||||
import com.glxp.api.res.inv.InvCountOrderDetailResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点单据详情Dao
|
||||
*/
|
||||
public interface InvCountOrderDetailDao extends BaseMapper<InvCountOrderDetailEntity> {
|
||||
|
||||
/**
|
||||
* 根据盘点单号删除单据详情
|
||||
*
|
||||
* @param orderId
|
||||
*/
|
||||
void deleteByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 查询盘点单据详情
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvCountOrderDetailEntity> filterList(FilterInvCountOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 根据盘点单据ID统计单据详情数量
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @return
|
||||
*/
|
||||
Long countByOrderIdFk(@Param("orderIdFk") String orderIdFk);
|
||||
|
||||
/**
|
||||
* 查询盘点单据详情
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvCountOrderDetailResponse> filterCountDetail(FilterInvCountOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 根据产品ID和盘点单号删除条码
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @param productId
|
||||
*/
|
||||
void deleteByOrderIdAndProductId(@Param("orderIdFk") String orderIdFk, @Param("productId") Long productId);
|
||||
|
||||
/**
|
||||
* 根据单据号和产品DI查询单据详情
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @param nameCode
|
||||
* @return
|
||||
*/
|
||||
InvCountOrderDetailEntity selectOrderDetail(@Param("orderIdFk") String orderIdFk, @Param("nameCode") String nameCode, @Param("batchNo") String batchNo, @Param("produceDate") String produceDate, @Param("expireDate") String expireDate);
|
||||
|
||||
/**
|
||||
* 查询此盘点单的单据详情
|
||||
*
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
List<InvCountOrderDetailEntity> selectByOrderId(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 置空盘点相关字段值
|
||||
*
|
||||
* @param orderId
|
||||
*/
|
||||
void resetCountFiledValue(@Param("orderId") String orderId);
|
||||
|
||||
/**
|
||||
* 批量更新盘点单据详情
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
int updateBatch(List<InvCountOrderDetailEntity> list);
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
package com.glxp.api.req.inv;
|
||||
|
||||
import com.glxp.api.entity.inv.InvCountCodesEntity;
|
||||
import com.glxp.api.entity.inv.InvCountOrderDetailEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 手持终端盘点单据保存接口参数
|
||||
*/
|
||||
@Data
|
||||
public class AddInvCountOrderSaveRequest {
|
||||
|
||||
/**
|
||||
* 盘点单号
|
||||
*/
|
||||
@NotBlank(message = "盘点单号为空")
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
@NotEmpty(message = "盘点产品不能为空")
|
||||
private List<InvCountCodesEntity> countCodeList;
|
||||
|
||||
/**
|
||||
* 盘点单据详情列表
|
||||
*/
|
||||
private List<InvCountOrderDetailEntity> countOrderDetailList;
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package com.glxp.api.service.inv;
|
||||
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.entity.inv.InvCountCodesEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCountCodesRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点单据码Service
|
||||
*/
|
||||
public interface InvCountCodesService {
|
||||
|
||||
/**
|
||||
* 查询盘点单据码详情
|
||||
*
|
||||
* @param codesRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvCountCodesEntity> filterList(FilterInvCountCodesRequest codesRequest);
|
||||
|
||||
/**
|
||||
* 盘点单据移除条码
|
||||
*
|
||||
* @param codesRequest
|
||||
* @return
|
||||
*/
|
||||
BaseResponse deleteCode(FilterInvCountCodesRequest codesRequest);
|
||||
|
||||
/**
|
||||
* 添加条码
|
||||
*
|
||||
* @param invCountCodes
|
||||
* @return
|
||||
*/
|
||||
BaseResponse addCode(InvCountCodesEntity invCountCodes);
|
||||
|
||||
/**
|
||||
* 根据盘点单号统计条码数量
|
||||
*
|
||||
* @param orderIdFk
|
||||
* @return
|
||||
*/
|
||||
Long getCountOrderCodesNum(String orderIdFk);
|
||||
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package com.glxp.api.service.inv;
|
||||
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.entity.inv.InvCountOrderDetailEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCountOrderDetailRequest;
|
||||
import com.glxp.api.res.inv.InvCountOrderDetailResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点单据详情Service
|
||||
*/
|
||||
public interface InvCountOrderDetailService {
|
||||
|
||||
List<InvCountOrderDetailEntity> filterList(FilterInvCountOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 查询盘点单据详情
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<InvCountOrderDetailResponse> filterCountDetail(FilterInvCountOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 删除盘点单据详情
|
||||
*
|
||||
* @param detailRequest
|
||||
* @return
|
||||
*/
|
||||
BaseResponse deleteOrderDetail(FilterInvCountOrderDetailRequest detailRequest);
|
||||
|
||||
/**
|
||||
* 添加单据详情
|
||||
*
|
||||
* @param invCountOrderDetail
|
||||
* @return
|
||||
*/
|
||||
BaseResponse addCountOrderDetail(InvCountOrderDetailEntity invCountOrderDetail);
|
||||
|
||||
/**
|
||||
* 批量添加盘点单据详情
|
||||
*
|
||||
* @param orderId
|
||||
* @param countOrderDetailList
|
||||
* @return
|
||||
*/
|
||||
BaseResponse batchAddDetail(String orderId, List<InvCountOrderDetailEntity> countOrderDetailList);
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package com.glxp.api.service.inv;
|
||||
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.entity.inv.InvCountOrderEntity;
|
||||
import com.glxp.api.req.inv.AddInvCountOrderSaveRequest;
|
||||
import com.glxp.api.req.inv.FilterInvCountOrderRequest;
|
||||
import com.glxp.api.res.inv.InvCountOrderResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 盘点单据Service
|
||||
*/
|
||||
public interface InvCountOrderService {
|
||||
|
||||
/**
|
||||
* 查询盘点单列表
|
||||
*
|
||||
* @param filterInvCountOrderRequest
|
||||
* @return
|
||||
*/
|
||||
List<InvCountOrderResponse> filterList(FilterInvCountOrderRequest filterInvCountOrderRequest);
|
||||
|
||||
/**
|
||||
* 删除盘点单
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
void deleteOrder(String id);
|
||||
|
||||
/**
|
||||
* 新增盘点单
|
||||
*
|
||||
* @param invCountOrder
|
||||
*/
|
||||
BaseResponse saveCountOrder(InvCountOrderEntity invCountOrder);
|
||||
|
||||
/**
|
||||
* 盘点单据提交审核
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
BaseResponse submitAudit(String id);
|
||||
|
||||
/**
|
||||
* 更新盘点单据状态
|
||||
*
|
||||
* @param id
|
||||
* @param status
|
||||
* @return
|
||||
*/
|
||||
BaseResponse updateCountOrderStatus(String id, Integer status);
|
||||
|
||||
/**
|
||||
* 手持终端保存盘点单据
|
||||
*
|
||||
* @param addInvCountOrderSaveRequest
|
||||
* @return
|
||||
*/
|
||||
BaseResponse saveCountOrderForPDA(AddInvCountOrderSaveRequest addInvCountOrderSaveRequest);
|
||||
|
||||
}
|
@ -1,136 +0,0 @@
|
||||
package com.glxp.api.service.inv.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
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.dao.inv.*;
|
||||
import com.glxp.api.entity.inv.InvCountCodesEntity;
|
||||
import com.glxp.api.entity.inv.InvCountOrderDetailEntity;
|
||||
import com.glxp.api.entity.inv.InvCountOrderEntity;
|
||||
import com.glxp.api.entity.inv.InvProductEntity;
|
||||
import com.glxp.api.req.inv.FilterInvCountOrderDetailRequest;
|
||||
import com.glxp.api.res.inv.InvCountOrderDetailResponse;
|
||||
import com.glxp.api.service.inv.InvCountOrderDetailService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.ibatis.session.TransactionIsolationLevel;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class InvCountOrderDetailServiceImpl implements InvCountOrderDetailService {
|
||||
|
||||
@Resource
|
||||
private InvCountOrderDetailDao invCountOrderDetailDao;
|
||||
@Resource
|
||||
private InvCountOrderDao invCountOrderDao;
|
||||
@Resource
|
||||
private InvProductDao invProductDao;
|
||||
@Resource
|
||||
private SqlSessionFactory sqlSessionFactory;
|
||||
@Resource
|
||||
private InvProductDetailDao invProductDetailDao;
|
||||
|
||||
@Override
|
||||
public List<InvCountOrderDetailEntity> filterList(FilterInvCountOrderDetailRequest detailRequest) {
|
||||
if (null == detailRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != detailRequest.getPage() && null != detailRequest.getLimit()) {
|
||||
PageHelper.offsetPage((detailRequest.getPage() - 1) * detailRequest.getLimit(), detailRequest.getLimit());
|
||||
}
|
||||
return invCountOrderDetailDao.filterList(detailRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InvCountOrderDetailResponse> filterCountDetail(FilterInvCountOrderDetailRequest detailRequest) {
|
||||
if (null == detailRequest) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (null != detailRequest.getPage() && null != detailRequest.getLimit()) {
|
||||
PageHelper.offsetPage((detailRequest.getPage() - 1) * detailRequest.getLimit(), detailRequest.getLimit());
|
||||
}
|
||||
return invCountOrderDetailDao.filterCountDetail(detailRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse deleteOrderDetail(FilterInvCountOrderDetailRequest detailRequest) {
|
||||
InvCountOrderDetailEntity invCountOrderDetail = invCountOrderDetailDao.selectById(detailRequest.getId());
|
||||
if (null == invCountOrderDetail) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_NOT);
|
||||
}
|
||||
//删除盘点单据详情
|
||||
invCountOrderDetailDao.deleteById(detailRequest.getId());
|
||||
//删除盘点单据详情的条码数据
|
||||
invCountOrderDetailDao.deleteByOrderIdAndProductId(invCountOrderDetail.getOrderIdFk(), invCountOrderDetail.getRelId());
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse addCountOrderDetail(InvCountOrderDetailEntity invCountOrderDetail) {
|
||||
//查询单据信息
|
||||
InvCountOrderEntity invCountOrder = invCountOrderDao.selectByOrderId(invCountOrderDetail.getOrderIdFk());
|
||||
InvProductEntity invProductEntity = invProductDao.selectProductInfo(invCountOrderDetail.getRelId(), invCountOrderDetail.getBatchNo(), invCountOrder.getDeptCode(), invCountOrder.getInvCode(), invCountOrder.getInvSpaceCode());
|
||||
invCountOrderDetail.setInvNum(invProductEntity.getReCount());
|
||||
invCountOrderDetail.setCountNum(0);
|
||||
invCountOrderDetailDao.insert(invCountOrderDetail);
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse batchAddDetail(String orderId, List<InvCountOrderDetailEntity> countOrderDetailList) {
|
||||
InvCountOrderEntity invCountOrder = invCountOrderDao.selectByOrderId(orderId);
|
||||
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
|
||||
InvCountOrderDetailDao mapper = sqlSession.getMapper(InvCountOrderDetailDao.class);
|
||||
InvCountCodesDao codeMapper = sqlSession.getMapper(InvCountCodesDao.class);
|
||||
for (InvCountOrderDetailEntity orderDetailEntity : countOrderDetailList) {
|
||||
InvProductEntity invProductEntity = invProductDao.selectProductInfo(orderDetailEntity.getRelId(), orderDetailEntity.getBatchNo(), invCountOrder.getDeptCode(), invCountOrder.getInvCode(), invCountOrder.getInvSpaceCode());
|
||||
orderDetailEntity.setInvNum(invProductEntity.getReCount());
|
||||
orderDetailEntity.setCountNum(0);
|
||||
|
||||
//TODO 此查询无法区分无序列号条码,待优化
|
||||
//查询此库存的详情,构造并插入码数据
|
||||
List<String> codes = invProductDetailDao.selectCountOrderCodes(invCountOrder.getInvCode(), invCountOrder.getInvSpaceCode(), orderDetailEntity.getRelId(), orderDetailEntity.getBatchNo());
|
||||
|
||||
if (CollUtil.isNotEmpty(codes)) {
|
||||
Map<String, InvCountCodesEntity> codesMap = new HashMap<>(codes.size());
|
||||
for (String code : codes) {
|
||||
InvCountCodesEntity codesEntity = codesMap.get(code);
|
||||
if (null == codesEntity) {
|
||||
//构造条码信息
|
||||
codesEntity = new InvCountCodesEntity();
|
||||
codesEntity.setCode(code);
|
||||
codesEntity.setOrderIdFk(orderId);
|
||||
codesEntity.setCount(1);
|
||||
codesEntity.setBatchNo(orderDetailEntity.getBatchNo());
|
||||
codesEntity.setRelId(orderDetailEntity.getRelId());
|
||||
|
||||
codesMap.put(code, codesEntity);
|
||||
} else {
|
||||
codesEntity.setCount(codesEntity.getCount() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
for (String key : codesMap.keySet()) {
|
||||
codeMapper.insert(codesMap.get(key));
|
||||
}
|
||||
}
|
||||
mapper.insert(orderDetailEntity);
|
||||
}
|
||||
sqlSession.commit();
|
||||
sqlSession.close();
|
||||
return ResultVOUtils.success();
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.inv.InvCountCodesDao">
|
||||
<delete id="deleteByOrderId">
|
||||
delete
|
||||
from inv_count_codes
|
||||
where orderIdFk = #{orderId}
|
||||
</delete>
|
||||
|
||||
<select id="filterList" resultType="com.glxp.api.entity.inv.InvCountCodesEntity">
|
||||
select *
|
||||
from inv_count_codes
|
||||
<where>
|
||||
<if test="orderIdFk != null and orderIdFk != ''">
|
||||
AND orderIdFk = #{orderIdFk}
|
||||
</if>
|
||||
<if test="relId != null and relId != ''">
|
||||
AND relId = #{relId}
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
AND code like concat('%', #{code}, '%')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="batchNo != null and batchNo != ''">
|
||||
AND batchNo = #{batchNo}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="countByOrderIdFk" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from inv_count_codes
|
||||
where orderIdFk = #{orderIdFk}
|
||||
</select>
|
||||
|
||||
<select id="countByOrderId" resultType="java.lang.Long">
|
||||
select sum(count)
|
||||
from inv_count_codes
|
||||
where orderIdFk = #{orderIdFk}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByCodeAndOrderId" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from inv_count_codes
|
||||
where orderIdFk = #{orderIdFk}
|
||||
and code = #{code}
|
||||
</select>
|
||||
|
||||
<update id="resetCountFiledValue">
|
||||
update inv_count_codes
|
||||
set status = null
|
||||
where orderIdFk = #{orderId}
|
||||
</update>
|
||||
|
||||
<select id="selectByOrderIdAndProductId" resultType="com.glxp.api.entity.inv.InvCountCodesEntity">
|
||||
select *
|
||||
from inv_count_codes
|
||||
where orderIdFk = #{orderIdFk}
|
||||
and relId = #{productId}
|
||||
</select>
|
||||
|
||||
<select id="selectCodes" resultType="java.lang.String">
|
||||
select code
|
||||
from inv_count_codes
|
||||
<where>
|
||||
<if test="orderIdFk != null and orderIdFk != ''">
|
||||
AND orderIdFk = #{orderIdFk}
|
||||
</if>
|
||||
<if test="relId != null and relId != ''">
|
||||
AND relId = #{relId}
|
||||
</if>
|
||||
<if test="batchNo != null and batchNo != ''">
|
||||
AND batchNo = #{batchNo}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -1,96 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.inv.InvCountOrderDao">
|
||||
<select id="filterList" resultType="com.glxp.api.res.inv.InvCountOrderResponse">
|
||||
select co.id,
|
||||
co.orderId,
|
||||
co.deptCode,
|
||||
co.invCode,
|
||||
co.invSpaceCode,
|
||||
co.invSpaceCode,
|
||||
co.createUser,
|
||||
co.createTime,
|
||||
co.updateTime,
|
||||
co.auditUser,
|
||||
co.auditTime,
|
||||
co.status,
|
||||
co.remark,
|
||||
co.inOrderIds,
|
||||
co.outOrderIds,
|
||||
co.countType,
|
||||
(select `name` from auth_dept where code = co.deptCode) deptName,
|
||||
(select `name` from auth_warehouse where code = co.invCode) invName,
|
||||
(select `name` from auth_space where code = co.invSpaceCode) invSpaceName
|
||||
from inv_count_order co
|
||||
<where>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND co.invCode = #{invCode}
|
||||
</if>
|
||||
<if test="invSpaceCode != null and invSpaceCode != ''">
|
||||
AND co.invSpaceCode = #{invSpaceCode}
|
||||
</if>
|
||||
<if test="invSpaceCode != null and invSpaceCode != ''">
|
||||
AND co.invSpaceCode = #{invSpaceCode}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND co.status = #{status}
|
||||
</if>
|
||||
<if test="orderId != null and orderId != ''">
|
||||
AND co.orderId like concat('%', #{orderId}, '%')
|
||||
</if>
|
||||
</where>
|
||||
order by co.updateTime desc
|
||||
</select>
|
||||
|
||||
<select id="selectOrderIdById" resultType="java.lang.String">
|
||||
select orderId
|
||||
from inv_count_order
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="countBySpaceCode" resultType="java.lang.Integer">
|
||||
select count(*)
|
||||
from inv_count_order
|
||||
<where>
|
||||
<if test="deptCode != null and deptCode != ''">
|
||||
AND deptCode = #{deptCode}
|
||||
</if>
|
||||
<if test="invCode != null and invCode != ''">
|
||||
AND invCode = #{invCode}
|
||||
</if>
|
||||
<if test="invSpaceCode != null and invSpaceCode != ''">
|
||||
AND invSpaceCode = #{invSpaceCode}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateByOrderId">
|
||||
update inv_count_order
|
||||
set deptCode = #{deptCode,jdbcType=VARCHAR},
|
||||
invCode = #{invCode,jdbcType=VARCHAR},
|
||||
invSpaceCode = #{invSpaceCode,jdbcType=VARCHAR},
|
||||
`createUser` = #{createUser,jdbcType=VARCHAR},
|
||||
createTime = #{createTime,jdbcType=TIMESTAMP},
|
||||
updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
||||
auditUser = #{auditUser,jdbcType=VARCHAR},
|
||||
auditTime = #{auditTime,jdbcType=TIMESTAMP},
|
||||
`status` = #{status,jdbcType=BOOLEAN},
|
||||
remark = #{remark,jdbcType=VARCHAR},
|
||||
inOrderIds = #{inOrderIds,jdbcType=VARCHAR},
|
||||
outOrderIds = #{outOrderIds,jdbcType=VARCHAR},
|
||||
countType = #{countType,jdbcType=INTEGER}
|
||||
where orderId = #{orderId}
|
||||
</update>
|
||||
|
||||
<select id="selectByOrderId" resultType="com.glxp.api.entity.inv.InvCountOrderEntity">
|
||||
select *
|
||||
from inv_count_order
|
||||
where orderId = #{orderId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByOrderId">
|
||||
delete
|
||||
from inv_count_order
|
||||
where orderId = #{orderId}
|
||||
</delete>
|
||||
</mapper>
|
@ -1,150 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.glxp.api.dao.inv.InvCountOrderDetailDao">
|
||||
<delete id="deleteByOrderId">
|
||||
delete
|
||||
from inv_count_order_detail
|
||||
where orderIdFk = #{orderId}
|
||||
</delete>
|
||||
|
||||
<select id="filterList" resultType="com.glxp.api.entity.inv.InvCountOrderDetailEntity">
|
||||
select *
|
||||
from inv_count_order_detail
|
||||
<where>
|
||||
<if test="orderIdFk != null and orderIdFk != ''">
|
||||
AND orderIdFk = #{orderIdFk}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="countByOrderIdFk" resultType="java.lang.Long">
|
||||
select count(*)
|
||||
from inv_count_order_detail
|
||||
where orderIdFk = #{orderIdFk}
|
||||
</select>
|
||||
|
||||
<select id="filterCountDetail" resultType="com.glxp.api.res.inv.InvCountOrderDetailResponse">
|
||||
select od.*, bp.cpmctymc productName, bp.ggxh, bp.ylqxzcrbarmc, bp.zczbhhzbapzbh
|
||||
from inv_count_order_detail od
|
||||
left join basic_udirel bu on od.relId = bu.id
|
||||
left join basic_products bp on bu.uuid = bp.uuid
|
||||
where orderIdFk = #{orderIdFk}
|
||||
group by od.id
|
||||
</select>
|
||||
|
||||
<delete id="deleteByOrderIdAndProductId">
|
||||
delete
|
||||
from inv_count_codes
|
||||
where orderIdFk = #{orderIdFk}
|
||||
and relId = #{productId}
|
||||
</delete>
|
||||
|
||||
<select id="selectOrderDetail" resultType="com.glxp.api.entity.inv.InvCountOrderDetailEntity">
|
||||
select *
|
||||
from inv_count_order_detail
|
||||
<where>
|
||||
<if test="nameCode != null and nameCode != ''">
|
||||
AND nameCode = #{nameCode}
|
||||
</if>
|
||||
<if test="orderIdFk != null and orderIdFk != ''">
|
||||
AND orderIdFk = #{orderIdFk}
|
||||
</if>
|
||||
<if test="batchNo != null and batchNo != ''">
|
||||
AND batchNo = #{batchNo}
|
||||
</if>
|
||||
<if test="produceDate != null and produceDate != ''">
|
||||
AND produceDate = #{produceDate}
|
||||
</if>
|
||||
<if test="expireDate != null and expireDate != ''">
|
||||
AND expireDate = #{expireDate}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByOrderId" resultType="com.glxp.api.entity.inv.InvCountOrderDetailEntity">
|
||||
select *
|
||||
from inv_count_order_detail
|
||||
where orderIdFk = #{orderId}
|
||||
</select>
|
||||
|
||||
<select id="resetCountFiledValue">
|
||||
update inv_count_order_detail
|
||||
set profitNum = null,
|
||||
lossNum = null,
|
||||
status = null
|
||||
where orderIdFk = #{orderId}
|
||||
</select>
|
||||
|
||||
<update id="updateBatch" parameterType="java.util.List">
|
||||
update inv_count_order_detail
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<trim prefix="orderIdFk = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.orderIdFk,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="relId = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.relId,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="nameCode = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.nameCode,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="batchNo = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.batchNo,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="produceDate = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.produceDate,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="expireDate = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.expireDate,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="serialNo = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.serialNo,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="countNum = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.countNum,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="invNum = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.invNum,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="profitNum = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.profitNum,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="lossNum = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.lossNum,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="`status` = case" suffix="end,">
|
||||
<foreach collection="list" index="index" item="item">
|
||||
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</trim>
|
||||
</trim>
|
||||
where id in
|
||||
<foreach close=")" collection="list" item="item" open="(" separator=", ">
|
||||
#{item.id,jdbcType=INTEGER}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
Loading…
Reference in New Issue