12 changed files with 327 additions and 4 deletions
@ -0,0 +1,64 @@ |
|||||
|
package com.yxt.purchase.apiadmin; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
|
||||
|
import com.yxt.purchase.biz.purchasereceiptbilldetail.PurchaseReceiptBillDetailDto; |
||||
|
import com.yxt.purchase.biz.purchasereceiptbilldetail.PurchaseReceiptBillDetailQuery; |
||||
|
import com.yxt.purchase.biz.purchasereceiptbilldetail.PurchaseReceiptBillDetailService; |
||||
|
import com.yxt.purchase.biz.purchasereceiptbilldetail.PurchaseReceiptBillDetailVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 15:49 |
||||
|
*/ |
||||
|
@Api(tags = "采购入库预约单") |
||||
|
@RestController |
||||
|
@RequestMapping("/apiadmin/purchasereceiptbilldetail") |
||||
|
public class PurchaseReceiptBillDetailRest { |
||||
|
|
||||
|
@Autowired |
||||
|
PurchaseReceiptBillDetailService baseBrandInfoService; |
||||
|
|
||||
|
@ApiOperation("分页列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<PurchaseReceiptBillDetailVo>> listPage(@RequestBody PagerQuery<PurchaseReceiptBillDetailQuery> pq) { |
||||
|
ResultBean<PagerVo<PurchaseReceiptBillDetailVo>> rb = ResultBean.fireFail(); |
||||
|
PagerVo<PurchaseReceiptBillDetailVo> pv = baseBrandInfoService.listPage(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
@ApiOperation("保存修改") |
||||
|
@PostMapping("/saveOrUpdate") |
||||
|
public ResultBean<String> saveOrUpdate(@RequestBody PurchaseReceiptBillDetailDto dto) { |
||||
|
return baseBrandInfoService.saveOrUpdate(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("初始化") |
||||
|
@GetMapping("/initialization/{sid}") |
||||
|
public ResultBean<PurchaseReceiptBillDetailVo> initialization(@PathVariable("sid") String sid) { |
||||
|
return baseBrandInfoService.initialization(sid); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("删除") |
||||
|
@DeleteMapping("/delete/{sid}") |
||||
|
public ResultBean delete(@PathVariable("sid") String sid) { |
||||
|
return baseBrandInfoService.delete(sid); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("根据sid批量删除") |
||||
|
@DeleteMapping("/delBySids") |
||||
|
public ResultBean delBySids(@RequestBody String[] sids){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
baseBrandInfoService.delAll(sids); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbilldetail; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:36 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PurchaseReceiptBillDetail extends BaseEntity { |
||||
|
|
||||
|
|
||||
|
private String billSid;//单据sid
|
||||
|
private String goodsSid;//商品sid
|
||||
|
private String goodsName;//商品名称
|
||||
|
private String goodsCode;//商品编码(图号)
|
||||
|
private String specification;//规格
|
||||
|
private String goodsModel;//型号
|
||||
|
private double currentCount;//当前库存数量
|
||||
|
private String unit;//计量单位
|
||||
|
private String warehouseSid;//仓库sid
|
||||
|
private String warehouseName;//仓库名称
|
||||
|
private String position;//货位
|
||||
|
private double cost;//单位成本(进货价)
|
||||
|
private double count;//采购数量
|
||||
|
private double taxAmount;//税额(
|
||||
|
private double taxPrice;//含税价
|
||||
|
private double amount;//采购金额
|
||||
|
private double price1;//销售价1
|
||||
|
private double price2;//销售价2
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbilldetail; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:38 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PurchaseReceiptBillDetailDto implements Dto { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private Date createTime; |
||||
|
private String remarks; |
||||
|
private String isEnable; |
||||
|
private String billSid;//单据sid
|
||||
|
private String goodsSid;//商品sid
|
||||
|
private String goodsName;//商品名称
|
||||
|
private String goodsCode;//商品编码(图号)
|
||||
|
private String specification;//规格
|
||||
|
private String goodsModel;//型号
|
||||
|
private double currentCount;//当前库存数量
|
||||
|
private String unit;//计量单位
|
||||
|
private String warehouseSid;//仓库sid
|
||||
|
private String warehouseName;//仓库名称
|
||||
|
private String position;//货位
|
||||
|
private double cost;//单位成本(进货价)
|
||||
|
private double count;//采购数量
|
||||
|
private double taxAmount;//税额(
|
||||
|
private double taxPrice;//含税价
|
||||
|
private double amount;//采购金额
|
||||
|
private double price1;//销售价1
|
||||
|
private double price2;//销售价2
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbilldetail; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:40 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface PurchaseReceiptBillDetailMapper extends BaseMapper<PurchaseReceiptBillDetail> { |
||||
|
|
||||
|
IPage<PurchaseReceiptBillDetailVo> listPage(IPage<PurchaseReceiptBillDetail> page, @Param(Constants.WRAPPER) QueryWrapper<PurchaseReceiptBillDetail> qw); |
||||
|
PurchaseReceiptBillDetailVo initialization (@Param("sid") String sid); |
||||
|
int updateBySidIsDelete(List<String> list); |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
<?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.yxt.purchase.biz.purchasereceiptbilldetail.PurchaseReceiptBillDetailMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
|
||||
|
<select id="listPage" resultType="com.yxt.purchase.biz.purchasereceiptbilldetail.PurchaseReceiptBillDetailVo"> |
||||
|
select |
||||
|
* |
||||
|
from purchase_receipt_bill_detail |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
<select id="initialization" resultType="com.yxt.purchase.biz.purchasereceiptbilldetail.PurchaseReceiptBillDetailVo"> |
||||
|
select |
||||
|
a.* |
||||
|
from purchase_receipt_bill_detail a |
||||
|
where a.sid =#{sid} |
||||
|
</select> |
||||
|
<update id="updateBySidIsDelete"> |
||||
|
UPDATE purchase_receipt_bill_detail |
||||
|
SET isDelete=1 |
||||
|
where sid in |
||||
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")"> |
||||
|
#{item} |
||||
|
</foreach> |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbilldetail; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:37 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PurchaseReceiptBillDetailQuery implements Query { |
||||
|
private String name; |
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbilldetail; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.yxt.common.base.config.component.FileUploadComponent; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.PagerUtil; |
||||
|
import com.yxt.common.base.utils.StringUtils; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:40 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class PurchaseReceiptBillDetailService extends MybatisBaseService<PurchaseReceiptBillDetailMapper, PurchaseReceiptBillDetail> { |
||||
|
@Autowired |
||||
|
private FileUploadComponent fileUploadComponent; |
||||
|
|
||||
|
public PagerVo<PurchaseReceiptBillDetailVo> listPage(PagerQuery<PurchaseReceiptBillDetailQuery> pq) { |
||||
|
PurchaseReceiptBillDetailQuery query = pq.getParams(); |
||||
|
QueryWrapper<PurchaseReceiptBillDetail> qw = new QueryWrapper<>(); |
||||
|
IPage<PurchaseReceiptBillDetail> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<PurchaseReceiptBillDetailVo> pagging = baseMapper.listPage(page, qw); |
||||
|
PagerVo<PurchaseReceiptBillDetailVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> saveOrUpdate(PurchaseReceiptBillDetailDto dto) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
String sid = dto.getSid(); |
||||
|
if (StringUtils.isBlank(sid)) { |
||||
|
PurchaseReceiptBillDetail PurchaseReceiptBill = new PurchaseReceiptBillDetail(); |
||||
|
BeanUtil.copyProperties(dto, PurchaseReceiptBill, "sid"); |
||||
|
sid = PurchaseReceiptBill.getSid(); |
||||
|
baseMapper.insert(PurchaseReceiptBill); |
||||
|
|
||||
|
} else { |
||||
|
PurchaseReceiptBillDetail PurchaseReceiptBill = fetchBySid(sid); |
||||
|
if (PurchaseReceiptBill == null) { |
||||
|
return rb.setMsg("该单据不存在"); |
||||
|
} |
||||
|
BeanUtil.copyProperties(dto, PurchaseReceiptBill, "sid"); |
||||
|
baseMapper.updateById(PurchaseReceiptBill); |
||||
|
|
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<PurchaseReceiptBillDetailVo> initialization(String sid) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PurchaseReceiptBillDetailVo vo = baseMapper.initialization(sid); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
public ResultBean delete(String sid) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
return rb.success().setMsg("成功"); |
||||
|
} |
||||
|
public void delAll(String[] sids) { |
||||
|
baseMapper.updateBySidIsDelete(Arrays.stream(sids).collect(Collectors.toList())); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbilldetail; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:37 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PurchaseReceiptBillDetailVo implements Vo { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
private String lockVersion; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private Date createTime; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private Date modifyTime; |
||||
|
private String remarks; |
||||
|
private String isEnable; |
||||
|
private String state; |
||||
|
private String isDelete; |
||||
|
private String billSid;//单据sid
|
||||
|
private String goodsSid;//商品sid
|
||||
|
private String goodsName;//商品名称
|
||||
|
private String goodsCode;//商品编码(图号)
|
||||
|
private String specification;//规格
|
||||
|
private String goodsModel;//型号
|
||||
|
private double currentCount;//当前库存数量
|
||||
|
private String unit;//计量单位
|
||||
|
private String warehouseSid;//仓库sid
|
||||
|
private String warehouseName;//仓库名称
|
||||
|
private String position;//货位
|
||||
|
private double cost;//单位成本(进货价)
|
||||
|
private double count;//采购数量
|
||||
|
private double taxAmount;//税额(
|
||||
|
private double taxPrice;//含税价
|
||||
|
private double amount;//采购金额
|
||||
|
private double price1;//销售价1
|
||||
|
private double price2;//销售价2
|
||||
|
} |
Loading…
Reference in new issue