切换分支物资管理系统备份
parent
43c2b5a72e
commit
9054f3f250
@ -0,0 +1,197 @@
|
|||||||
|
package com.glxp.api.admin.controller.purchase;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
|
||||||
|
import com.glxp.api.admin.annotation.RepeatSubmit;
|
||||||
|
import com.glxp.api.admin.constant.Constant;
|
||||||
|
import com.glxp.api.admin.constant.ConstantStatus;
|
||||||
|
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PostPurApplyRequest;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyDetailRequest;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyRequest;
|
||||||
|
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.admin.service.auth.CustomerService;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurApplyDetailService;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurApplyService;
|
||||||
|
import com.glxp.api.admin.util.GennerOrderUtils;
|
||||||
|
import com.glxp.api.admin.util.MyStrUtil;
|
||||||
|
import com.glxp.api.admin.util.OrderNoTypeBean;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pur
|
||||||
|
*
|
||||||
|
* @author anthony.ywj
|
||||||
|
* @date 2022-10-12
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/purchase/apply")
|
||||||
|
public class PurApplyController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IPurApplyService purApplyService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IPurApplyDetailService purApplyDetailService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
CustomerService customerService;
|
||||||
|
@Resource
|
||||||
|
GennerOrderUtils gennerOrderUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@AuthRuleAnnotation("")
|
||||||
|
@PostMapping("/postOrder")
|
||||||
|
public BaseResponse postOrder(@RequestBody PostPurApplyRequest postPurApplyRequest) {
|
||||||
|
|
||||||
|
Integer userId = customerService.getUserId();
|
||||||
|
PurApplyEntity purApplyEntity = postPurApplyRequest.getPurApplyEntity();
|
||||||
|
purApplyEntity.setCreateBy(userId + "");
|
||||||
|
purApplyEntity.setCreateTime(new Date());
|
||||||
|
purApplyEntity.setUpdateTime(new Date());
|
||||||
|
purApplyEntity.setStatus(postPurApplyRequest.getEditStatus()); //草稿状态
|
||||||
|
if (purApplyEntity.getId() == null) {
|
||||||
|
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.SG_ORDER, "yyyyMMdd"));
|
||||||
|
purApplyEntity.setBillNo(billNo);
|
||||||
|
purApplyService.insert(purApplyEntity);
|
||||||
|
} else {
|
||||||
|
purApplyService.update(purApplyEntity);
|
||||||
|
if (CollUtil.isNotEmpty(postPurApplyRequest.getSubErpOrders())) {
|
||||||
|
purApplyDetailService.deleteByOrderId(purApplyEntity.getId() + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(postPurApplyRequest.getSubErpOrders())) {
|
||||||
|
for (StockOrderDetailEntity stockOrderDetailEntity : postPurApplyRequest.getSubErpOrders()) {
|
||||||
|
PurApplyDetailEntity purApplyDetailEntity = new PurApplyDetailEntity();
|
||||||
|
BeanUtils.copyProperties(stockOrderDetailEntity, purApplyDetailEntity);
|
||||||
|
purApplyDetailEntity.setOrderIdFk(purApplyEntity.getId() + "");
|
||||||
|
purApplyDetailService.insert(purApplyDetailEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResultVOUtils.success("提交成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申购单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public BaseResponse list(PurApplyRequest purApplyRequest) {
|
||||||
|
|
||||||
|
List<PurApplyEntity> purApplyEntities = purApplyService.queryPageList(purApplyRequest);
|
||||||
|
PageInfo<PurApplyEntity> pageInfo;
|
||||||
|
pageInfo = new PageInfo<>(purApplyEntities);
|
||||||
|
PageSimpleResponse<PurApplyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
pageSimpleResponse.setList(purApplyEntities);
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public BaseResponse add(@RequestBody PurApplyEntity purApplyRequest) {
|
||||||
|
|
||||||
|
purApplyService.insert(purApplyRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public BaseResponse edit(@RequestBody PurApplyEntity purApplyRequest) {
|
||||||
|
purApplyService.update(purApplyRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申购单
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public BaseResponse remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
|
||||||
|
purApplyService.deleteByIds(Arrays.asList(ids));
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申购单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list/detail")
|
||||||
|
public BaseResponse detailList(PurApplyDetailRequest purApplyDetailRequest) {
|
||||||
|
|
||||||
|
List<StockOrderDetailEntity> purApplyDetailEntities = purApplyDetailService.joinQueryList(purApplyDetailRequest);
|
||||||
|
PageInfo<StockOrderDetailEntity> pageInfo;
|
||||||
|
pageInfo = new PageInfo<>(purApplyDetailEntities);
|
||||||
|
PageSimpleResponse<StockOrderDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
pageSimpleResponse.setList(purApplyDetailEntities);
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/detail")
|
||||||
|
public BaseResponse detailAdd(@RequestBody PurApplyDetailEntity purApplyDetailRequest) {
|
||||||
|
|
||||||
|
purApplyDetailService.insert(purApplyDetailRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping("/detail")
|
||||||
|
public BaseResponse detailEdit(@RequestBody PurApplyDetailEntity purApplyDetailRequest) {
|
||||||
|
purApplyDetailService.update(purApplyDetailRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申购单
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/detail/{ids}")
|
||||||
|
public BaseResponse detailRemove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
|
||||||
|
purApplyDetailService.deleteByIds(Arrays.asList(ids));
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,144 @@
|
|||||||
|
package com.glxp.api.admin.controller.purchase;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.glxp.api.admin.annotation.RepeatSubmit;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyDetailRequest;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanDetailRequest;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanRequest;
|
||||||
|
import com.glxp.api.admin.res.PageSimpleResponse;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurPlanDetailService;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurPlanService;
|
||||||
|
import com.glxp.api.common.res.BaseResponse;
|
||||||
|
import com.glxp.api.common.util.ResultVOUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pur
|
||||||
|
*
|
||||||
|
* @author anthony.ywj
|
||||||
|
* @date 2022-10-12
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/purchase/plan")
|
||||||
|
public class PurPlanController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
IPurPlanService purPlanService;
|
||||||
|
@Resource
|
||||||
|
IPurPlanDetailService purPlanDetailService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申购单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public BaseResponse list(PurPlanRequest purPlanRequest) {
|
||||||
|
|
||||||
|
List<PurPlanEntity> purApplyEntities = purPlanService.queryPageList(purPlanRequest);
|
||||||
|
PageInfo<PurPlanEntity> pageInfo;
|
||||||
|
pageInfo = new PageInfo<>(purApplyEntities);
|
||||||
|
PageSimpleResponse<PurPlanEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
pageSimpleResponse.setList(purApplyEntities);
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public BaseResponse add(@RequestBody PurPlanRequest purApplyRequest) {
|
||||||
|
|
||||||
|
purPlanService.insert(purApplyRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public BaseResponse edit(@RequestBody PurPlanRequest purApplyRequest) {
|
||||||
|
purPlanService.update(purApplyRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申购单
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public BaseResponse remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
|
||||||
|
purPlanService.deleteByIds(Arrays.asList(ids));
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询申购单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list/detail")
|
||||||
|
public BaseResponse detailList(PurPlanDetailRequest purPlanDetailRequest) {
|
||||||
|
|
||||||
|
List<PurPlanDetailEntity> purApplyDetailEntities = purPlanDetailService.queryPageList(purPlanDetailRequest);
|
||||||
|
PageInfo<PurPlanDetailEntity> pageInfo;
|
||||||
|
pageInfo = new PageInfo<>(purApplyDetailEntities);
|
||||||
|
PageSimpleResponse<PurPlanDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||||
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||||
|
pageSimpleResponse.setList(purApplyDetailEntities);
|
||||||
|
return ResultVOUtils.success(pageSimpleResponse);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/detail")
|
||||||
|
public BaseResponse detailAdd(@RequestBody PurPlanDetailRequest purPlanDetailRequest) {
|
||||||
|
|
||||||
|
purPlanDetailService.insert(purPlanDetailRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改申购单
|
||||||
|
*/
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping("/detail")
|
||||||
|
public BaseResponse detailEdit(@RequestBody PurPlanDetailRequest purPlanDetailRequest) {
|
||||||
|
purPlanDetailService.update(purPlanDetailRequest);
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除申购单
|
||||||
|
*
|
||||||
|
* @param ids 主键串
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/detail/{ids}")
|
||||||
|
public BaseResponse detailRemove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] ids) {
|
||||||
|
|
||||||
|
purPlanDetailService.deleteByIds(Arrays.asList(ids));
|
||||||
|
return ResultVOUtils.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.glxp.api.admin.dao.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyRequest;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PurApplyDao {
|
||||||
|
|
||||||
|
List<PurApplyEntity> queryPageList(PurApplyRequest purApplyRequest);
|
||||||
|
|
||||||
|
Integer insert(PurApplyEntity purApplyRequest);
|
||||||
|
|
||||||
|
Boolean update(PurApplyEntity purApplyRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.glxp.api.admin.dao.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyDetailEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyDetailRequest;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PurApplyDetailDao {
|
||||||
|
|
||||||
|
List<PurApplyDetailEntity> queryPageList(PurApplyDetailRequest purApplyRequest);
|
||||||
|
|
||||||
|
List<StockOrderDetailEntity> joinQueryList(PurApplyDetailRequest purApplyRequest);
|
||||||
|
|
||||||
|
Boolean insert(PurApplyDetailEntity purApplyDetailEntity);
|
||||||
|
|
||||||
|
Boolean update(PurApplyDetailEntity purApplyRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(List<Long> ids);
|
||||||
|
|
||||||
|
Boolean deleteByOrderId(@Param("orderIdFk") String orderIdFk);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.glxp.api.admin.dao.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanRequest;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PurPlanDao {
|
||||||
|
|
||||||
|
List<PurPlanEntity> queryPageList(PurPlanRequest purPlanRequest);
|
||||||
|
|
||||||
|
Boolean insert(PurPlanRequest purPlanRequest);
|
||||||
|
|
||||||
|
Boolean update(PurPlanRequest purPlanRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(List<Long> ids);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.glxp.api.admin.dao.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanDetailEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanDetailRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface PurPlanDetailDao {
|
||||||
|
|
||||||
|
List<PurPlanDetailEntity> queryPageList(PurPlanDetailRequest purPlanDetailRequest);
|
||||||
|
|
||||||
|
Boolean insert(PurPlanDetailRequest purPlanDetailRequest);
|
||||||
|
|
||||||
|
Boolean update(PurPlanDetailRequest purPlanDetailRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(List<Long> ids);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.glxp.api.admin.entity.purchase;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PurApplyDetailEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 订单外键
|
||||||
|
*/
|
||||||
|
private String orderIdFk;
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
|
*/
|
||||||
|
private String productId;
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String productName;
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Integer count;
|
||||||
|
/**
|
||||||
|
* 供应商ID
|
||||||
|
*/
|
||||||
|
private String supId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.glxp.api.admin.entity.purchase;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PurPlanDetailEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 订单外键
|
||||||
|
*/
|
||||||
|
private String orderIdFk;
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String productName;
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
private Long count;
|
||||||
|
/**
|
||||||
|
* 供应商ID
|
||||||
|
*/
|
||||||
|
private String supId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.glxp.api.admin.req.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PostPurApplyRequest {
|
||||||
|
|
||||||
|
int editStatus;
|
||||||
|
PurApplyEntity purApplyEntity;
|
||||||
|
List<PurApplyDetailEntity> purApplyDetailEntities;
|
||||||
|
List<StockOrderDetailEntity> subErpOrders;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.glxp.api.admin.req.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.req.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author anthony.ywj
|
||||||
|
* @date 2022-10-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PurApplyDetailRequest extends ListPageRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单外键
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "订单外键不能为空")
|
||||||
|
private String orderIdFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "产品ID不能为空")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "产品名称不能为空")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@NotNull(message = "数量不能为空")
|
||||||
|
private Long count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商ID
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "供应商ID不能为空")
|
||||||
|
private String supId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.glxp.api.admin.req.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.req.ListPageRequest;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PurPlanDetailRequest extends ListPageRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@NotNull(message = "不能为空")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单外键
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "订单外键不能为空")
|
||||||
|
private String orderIdFk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
|
*/
|
||||||
|
@NotNull(message = "产品ID不能为空")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "产品名称不能为空")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数量
|
||||||
|
*/
|
||||||
|
@NotNull(message = "数量不能为空")
|
||||||
|
private Long count;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商ID
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "供应商ID不能为空")
|
||||||
|
private String supId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyDetailRequest;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyDetailRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IPurApplyDetailService {
|
||||||
|
|
||||||
|
List<PurApplyDetailEntity> queryPageList(PurApplyDetailRequest purApplyRequest);
|
||||||
|
|
||||||
|
List<StockOrderDetailEntity> joinQueryList(PurApplyDetailRequest purApplyRequest);
|
||||||
|
|
||||||
|
|
||||||
|
Boolean insert(PurApplyDetailEntity purApplyRequest);
|
||||||
|
|
||||||
|
Boolean update(PurApplyDetailEntity purApplyRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(List<Long> ids);
|
||||||
|
|
||||||
|
Boolean deleteByOrderId(String orderIdfK);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IPurApplyService {
|
||||||
|
|
||||||
|
List<PurApplyEntity> queryPageList(PurApplyRequest purApplyRequest);
|
||||||
|
|
||||||
|
Integer insert(PurApplyEntity purApplyEntity);
|
||||||
|
|
||||||
|
Boolean update(PurApplyEntity purApplyRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(List<Long> ids);
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanDetailEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanDetailRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IPurPlanDetailService {
|
||||||
|
|
||||||
|
List<PurPlanDetailEntity> queryPageList(PurPlanDetailRequest purPlanDetailRequest);
|
||||||
|
|
||||||
|
Boolean insert(PurPlanDetailRequest purPlanDetailRequest);
|
||||||
|
|
||||||
|
Boolean update(PurPlanDetailRequest purPlanDetailRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(List<Long> ids);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase;
|
||||||
|
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyRequest;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface IPurPlanService {
|
||||||
|
|
||||||
|
List<PurPlanEntity> queryPageList(PurPlanRequest purPlanRequest);
|
||||||
|
|
||||||
|
Boolean insert(PurPlanRequest purPlanRequest);
|
||||||
|
|
||||||
|
Boolean update(PurPlanRequest purPlanRequest);
|
||||||
|
|
||||||
|
Boolean deleteByIds(List<Long> ids);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.admin.dao.purchase.PurApplyDetailDao;
|
||||||
|
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyDetailEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyDetailRequest;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurApplyDetailService;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PurApplyDetailImplService implements IPurApplyDetailService {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
PurApplyDetailDao purApplyDetailDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PurApplyDetailEntity> queryPageList(PurApplyDetailRequest purApplyRequest) {
|
||||||
|
if (purApplyRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (purApplyRequest.getPage() != null) {
|
||||||
|
int offset = (purApplyRequest.getPage() - 1) * purApplyRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, purApplyRequest.getLimit());
|
||||||
|
}
|
||||||
|
List<PurApplyDetailEntity> data = purApplyDetailDao.queryPageList(purApplyRequest);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StockOrderDetailEntity> joinQueryList(PurApplyDetailRequest purApplyRequest) {
|
||||||
|
if (purApplyRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (purApplyRequest.getPage() != null) {
|
||||||
|
int offset = (purApplyRequest.getPage() - 1) * purApplyRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, purApplyRequest.getLimit());
|
||||||
|
}
|
||||||
|
List<StockOrderDetailEntity> data = purApplyDetailDao.joinQueryList(purApplyRequest);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insert(PurApplyDetailEntity purApplyRequest) {
|
||||||
|
return purApplyDetailDao.insert(purApplyRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(PurApplyDetailEntity purApplyRequest) {
|
||||||
|
return purApplyDetailDao.update(purApplyRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByIds(List<Long> ids) {
|
||||||
|
return purApplyDetailDao.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByOrderId(String orderIdfK) {
|
||||||
|
return purApplyDetailDao.deleteByOrderId(orderIdfK);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.admin.dao.purchase.PurApplyDao;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurApplyRequest;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurApplyService;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PurApplyServiceImpl implements IPurApplyService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
PurApplyDao purApplyDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PurApplyEntity> queryPageList(PurApplyRequest purApplyRequest) {
|
||||||
|
if (purApplyRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (purApplyRequest.getPage() != null) {
|
||||||
|
int offset = (purApplyRequest.getPage() - 1) * purApplyRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, purApplyRequest.getLimit());
|
||||||
|
}
|
||||||
|
List<PurApplyEntity> data = purApplyDao.queryPageList(purApplyRequest);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer insert(PurApplyEntity purApplyEntity) {
|
||||||
|
return purApplyDao.insert(purApplyEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(PurApplyEntity purApplyRequest) {
|
||||||
|
return purApplyDao.update(purApplyRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByIds(List<Long> ids) {
|
||||||
|
return purApplyDao.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.admin.dao.purchase.PurPlanDao;
|
||||||
|
import com.glxp.api.admin.dao.purchase.PurPlanDetailDao;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurApplyEntity;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanDetailEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanDetailRequest;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanRequest;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurPlanDetailService;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
@Service
|
||||||
|
public class PurPlanDetailServiceImpl implements IPurPlanDetailService {
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
PurPlanDetailDao purPlanDetailDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PurPlanDetailEntity> queryPageList(PurPlanDetailRequest purPlanDetailRequest) {
|
||||||
|
if (purPlanDetailRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (purPlanDetailRequest.getPage() != null) {
|
||||||
|
int offset = (purPlanDetailRequest.getPage() - 1) * purPlanDetailRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, purPlanDetailRequest.getLimit());
|
||||||
|
}
|
||||||
|
List<PurPlanDetailEntity> data = purPlanDetailDao.queryPageList(purPlanDetailRequest);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insert(PurPlanDetailRequest purPlanDetailRequest) {
|
||||||
|
return purPlanDetailDao.insert(purPlanDetailRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(PurPlanDetailRequest purPlanDetailRequest) {
|
||||||
|
return purPlanDetailDao.update(purPlanDetailRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByIds(List<Long> ids) {
|
||||||
|
return purPlanDetailDao.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.glxp.api.admin.service.purchase.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.glxp.api.admin.dao.purchase.PurPlanDao;
|
||||||
|
import com.glxp.api.admin.entity.purchase.PurPlanEntity;
|
||||||
|
import com.glxp.api.admin.req.purchase.PurPlanRequest;
|
||||||
|
import com.glxp.api.admin.service.purchase.IPurPlanService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PurPlanServiceImpl implements IPurPlanService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
PurPlanDao purPlanDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PurPlanEntity> queryPageList(PurPlanRequest purPlanRequest) {
|
||||||
|
if (purPlanRequest == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
if (purPlanRequest.getPage() != null) {
|
||||||
|
int offset = (purPlanRequest.getPage() - 1) * purPlanRequest.getLimit();
|
||||||
|
PageHelper.offsetPage(offset, purPlanRequest.getLimit());
|
||||||
|
}
|
||||||
|
List<PurPlanEntity> data = purPlanDao.queryPageList(purPlanRequest);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean insert(PurPlanRequest purPlanRequest) {
|
||||||
|
return purPlanDao.insert(purPlanRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(PurPlanRequest purPlanRequest) {
|
||||||
|
return purPlanDao.update(purPlanRequest);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deleteByIds(List<Long> ids) {
|
||||||
|
return purPlanDao.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
<?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.admin.dao.purchase.PurApplyDao">
|
||||||
|
|
||||||
|
<select id="queryPageList" parameterType="com.glxp.api.admin.req.purchase.PurApplyRequest"
|
||||||
|
resultType="com.glxp.api.admin.entity.purchase.PurApplyEntity">
|
||||||
|
select *
|
||||||
|
FROM pur_apply
|
||||||
|
<where>
|
||||||
|
<if test="billNo != '' and billNo != null">
|
||||||
|
AND billNo = #{billNo}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
AND status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != '' and deptCode != null">
|
||||||
|
AND deptCode = #{deptCode}
|
||||||
|
</if>
|
||||||
|
<if test="locStorageCode != '' and locStorageCode != null">
|
||||||
|
AND locStorageCode = #{locStorageCode}
|
||||||
|
</if>
|
||||||
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
||||||
|
AND invWarehouseCode = #{invWarehouseCode}
|
||||||
|
</if>
|
||||||
|
<if test="auditBy != '' and auditBy != null">
|
||||||
|
AND auditBy = #{auditBy}
|
||||||
|
</if>
|
||||||
|
<if test="createBy != '' and createBy != null">
|
||||||
|
AND createBy = #{createBy}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id"
|
||||||
|
parameterType="com.glxp.api.admin.entity.purchase.PurApplyEntity" useGeneratedKeys="true">
|
||||||
|
replace
|
||||||
|
INTO pur_apply
|
||||||
|
(
|
||||||
|
billNo,billDate,status,billType,remark,locStorageCode,invWarehouseCode,
|
||||||
|
deptCode,createBy,createTime,auditBy,auditTime,updateTime
|
||||||
|
)
|
||||||
|
values (
|
||||||
|
#{billNo},
|
||||||
|
#{billDate},
|
||||||
|
#{status},
|
||||||
|
#{billType},
|
||||||
|
#{remark},
|
||||||
|
#{locStorageCode},
|
||||||
|
#{invWarehouseCode},
|
||||||
|
#{deptCode},
|
||||||
|
#{createBy},
|
||||||
|
#{createTime},
|
||||||
|
#{auditBy},
|
||||||
|
#{auditTime},#{updateTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteByIds" parameterType="java.util.List">
|
||||||
|
DELETE FROM pur_apply WHERE id in
|
||||||
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="Map">
|
||||||
|
DELETE
|
||||||
|
FROM pur_apply
|
||||||
|
WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.glxp.api.admin.entity.purchase.PurApplyEntity">
|
||||||
|
UPDATE pur_apply
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="billNo != null">billNo=#{billNo},</if>
|
||||||
|
<if test="billDate != null">billDate=#{billDate},</if>
|
||||||
|
<if test="status != null">status=#{status},</if>
|
||||||
|
<if test="billType != null">billType=#{billType},</if>
|
||||||
|
<if test="remark != null">remark=#{remark},</if>
|
||||||
|
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
|
||||||
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
||||||
|
<if test="deptCode != null">deptCode=#{deptCode},</if>
|
||||||
|
<if test="auditBy != null">auditBy=#{auditBy},</if>
|
||||||
|
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
||||||
|
<if test="createBy != null">createBy=#{createBy},</if>
|
||||||
|
<if test="createTime != null">createTime=#{createTime},</if>
|
||||||
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||||
|
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,96 @@
|
|||||||
|
<?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.admin.dao.purchase.PurApplyDetailDao">
|
||||||
|
|
||||||
|
<select id="queryPageList" parameterType="com.glxp.api.admin.req.purchase.PurApplyDetailRequest"
|
||||||
|
resultType="com.glxp.api.admin.entity.purchase.PurApplyEntity">
|
||||||
|
select *
|
||||||
|
FROM pur_apply_detail
|
||||||
|
<where>
|
||||||
|
<if test="orderIdFk != '' and orderIdFk != null">
|
||||||
|
AND orderIdFk = #{orderIdFk}
|
||||||
|
</if>
|
||||||
|
<if test="productId != null">
|
||||||
|
AND productId = #{productId}
|
||||||
|
</if>
|
||||||
|
<if test="supId != '' and supId != null">
|
||||||
|
AND supId = #{supId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="joinQueryList" parameterType="com.glxp.api.admin.req.purchase.PurApplyDetailRequest"
|
||||||
|
resultType="com.glxp.api.admin.entity.business.StockOrderDetailEntity">
|
||||||
|
select
|
||||||
|
pur_apply_detail.*,
|
||||||
|
basic_products.ggxh spec,basic_udirel.measname,basic_udirel.manufactory
|
||||||
|
FROM pur_apply_detail
|
||||||
|
INNER JOIN basic_udirel on pur_apply_detail.productId = basic_udirel.id
|
||||||
|
INNER JOIN basic_products on basic_udirel.uuid = basic_products.uuid
|
||||||
|
<where>
|
||||||
|
<if test="orderIdFk != '' and orderIdFk != null">
|
||||||
|
AND orderIdFk = #{orderIdFk}
|
||||||
|
</if>
|
||||||
|
<if test="productId != null">
|
||||||
|
AND productId = #{productId}
|
||||||
|
</if>
|
||||||
|
<if test="supId != '' and supId != null">
|
||||||
|
AND supId = #{supId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id"
|
||||||
|
parameterType="com.glxp.api.admin.entity.purchase.PurApplyDetailEntity">
|
||||||
|
replace
|
||||||
|
INTO pur_apply_detail
|
||||||
|
(
|
||||||
|
orderIdFk,productId,productName,`count`,supId
|
||||||
|
)
|
||||||
|
values (
|
||||||
|
#{orderIdFk},
|
||||||
|
#{productId},
|
||||||
|
#{productName},
|
||||||
|
#{count},
|
||||||
|
#{supId}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteByIds" parameterType="java.util.List">
|
||||||
|
DELETE FROM pur_apply_detail WHERE id in
|
||||||
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="Map">
|
||||||
|
DELETE
|
||||||
|
FROM pur_apply_detail
|
||||||
|
WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteByOrderId" parameterType="Map">
|
||||||
|
DELETE
|
||||||
|
FROM pur_apply_detail
|
||||||
|
WHERE orderIdFk = #{orderIdFk}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.glxp.api.admin.entity.purchase.PurApplyDetailEntity">
|
||||||
|
UPDATE pur_apply_detail
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
||||||
|
<if test="productId != null">productId=#{productId},</if>
|
||||||
|
<if test="productName != null">productName=#{productName},</if>
|
||||||
|
<if test="count != null">`count`=#{count},</if>
|
||||||
|
<if test="supId != null">supId=#{supId},</if>
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,94 @@
|
|||||||
|
<?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.admin.dao.purchase.PurPlanDao">
|
||||||
|
|
||||||
|
<select id="queryPageList" parameterType="com.glxp.api.admin.req.purchase.PurPlanRequest"
|
||||||
|
resultType="com.glxp.api.admin.entity.purchase.PurPlanEntity">
|
||||||
|
select *
|
||||||
|
FROM pur_plan
|
||||||
|
<where>
|
||||||
|
<if test="billNo != '' and billNo != null">
|
||||||
|
AND billNo = #{billNo}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
AND status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="deptCode != '' and deptCode != null">
|
||||||
|
AND deptCode = #{deptCode}
|
||||||
|
</if>
|
||||||
|
<if test="locStorageCode != '' and locStorageCode != null">
|
||||||
|
AND locStorageCode = #{locStorageCode}
|
||||||
|
</if>
|
||||||
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
||||||
|
AND invWarehouseCode = #{invWarehouseCode}
|
||||||
|
</if>
|
||||||
|
<if test="auditBy != '' and auditBy != null">
|
||||||
|
AND auditBy = #{auditBy}
|
||||||
|
</if>
|
||||||
|
<if test="createBy != '' and createBy != null">
|
||||||
|
AND createBy = #{createBy}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id"
|
||||||
|
parameterType="com.glxp.api.admin.req.purchase.PurPlanRequest">
|
||||||
|
replace
|
||||||
|
INTO pur_plan
|
||||||
|
(
|
||||||
|
billNo,billDate,status,billType,remark,locStorageCode,invWarehouseCode,
|
||||||
|
deptCode,createBy,createTime,auditBy,auditTime
|
||||||
|
)
|
||||||
|
values (
|
||||||
|
#{billNo},
|
||||||
|
#{billDate},
|
||||||
|
#{status},
|
||||||
|
#{billType},
|
||||||
|
#{remark},
|
||||||
|
#{locStorageCode},
|
||||||
|
#{invWarehouseCode},
|
||||||
|
#{deptCode},
|
||||||
|
#{createBy},
|
||||||
|
#{createTime},
|
||||||
|
#{auditBy},
|
||||||
|
#{auditTime}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteByIds" parameterType="java.util.List">
|
||||||
|
DELETE FROM pur_plan WHERE id in
|
||||||
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="Map">
|
||||||
|
DELETE
|
||||||
|
FROM pur_plan
|
||||||
|
WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.glxp.api.admin.req.purchase.PurPlanRequest">
|
||||||
|
UPDATE pur_plan
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="billNo != null">billNo=#{billNo},</if>
|
||||||
|
<if test="billDate != null">billDate=#{billDate},</if>
|
||||||
|
<if test="status != null">status=#{status},</if>
|
||||||
|
<if test="billType != null">billType=#{billType},</if>
|
||||||
|
<if test="remark != null">remark=#{remark},</if>
|
||||||
|
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
|
||||||
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
||||||
|
<if test="deptCode != null">deptCode=#{deptCode},</if>
|
||||||
|
<if test="auditBy != null">auditBy=#{auditBy},</if>
|
||||||
|
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
||||||
|
<if test="createBy != null">createBy=#{createBy},</if>
|
||||||
|
<if test="createTime != null">createTime=#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,67 @@
|
|||||||
|
<?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.admin.dao.purchase.PurPlanDetailDao">
|
||||||
|
|
||||||
|
<select id="queryPageList" parameterType="com.glxp.api.admin.req.purchase.PurPlanDetailRequest"
|
||||||
|
resultType="com.glxp.api.admin.entity.purchase.PurPlanDetailEntity">
|
||||||
|
select *
|
||||||
|
FROM pur_plan_detail
|
||||||
|
<where>
|
||||||
|
<if test="orderIdFk != '' and orderIdFk != null">
|
||||||
|
AND orderIdFk = #{orderIdFk}
|
||||||
|
</if>
|
||||||
|
<if test="productId != null">
|
||||||
|
AND productId = #{productId}
|
||||||
|
</if>
|
||||||
|
<if test="supId != '' and supId != null">
|
||||||
|
AND supId = #{supId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" keyProperty="id"
|
||||||
|
parameterType="com.glxp.api.admin.req.purchase.PurPlanDetailRequest">
|
||||||
|
replace
|
||||||
|
INTO pur_plan_detail
|
||||||
|
(
|
||||||
|
orderIdFk,productId,productName,`count`,supId
|
||||||
|
)
|
||||||
|
values (
|
||||||
|
#{orderIdFk},
|
||||||
|
#{productId},
|
||||||
|
#{productName},
|
||||||
|
#{count},
|
||||||
|
#{supId}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteByIds" parameterType="java.util.List">
|
||||||
|
DELETE FROM pur_plan_detail WHERE id in
|
||||||
|
<foreach collection="ids" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="deleteById" parameterType="Map">
|
||||||
|
DELETE
|
||||||
|
FROM pur_plan_detail
|
||||||
|
WHERE id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<update id="update" parameterType="com.glxp.api.admin.req.purchase.PurPlanDetailRequest">
|
||||||
|
UPDATE pur_plan_detail
|
||||||
|
<trim prefix="set" suffixOverrides=",">
|
||||||
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
||||||
|
<if test="productId != null">productId=#{productId},</if>
|
||||||
|
<if test="productName != null">productName=#{productName},</if>
|
||||||
|
<if test="count != null">`count`=#{count},</if>
|
||||||
|
<if test="supId != null">supId=#{supId},</if>
|
||||||
|
</trim>
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue