9 changed files with 345 additions and 1 deletions
@ -0,0 +1,62 @@ |
|||||
|
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.purchasereceiptbill.*; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 15:49 |
||||
|
*/ |
||||
|
@Api(tags = "商品品牌") |
||||
|
@RestController |
||||
|
@RequestMapping("/apiadmin/base/basegoodsbrand") |
||||
|
public class PurchaseReceiptBillRest { |
||||
|
|
||||
|
@Autowired |
||||
|
PurchaseReceiptBillService baseBrandInfoService; |
||||
|
|
||||
|
@ApiOperation("分页列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<PurchaseReceiptBillVo>> listPage(@RequestBody PagerQuery<PurchaseReceiptBillQuery> pq) { |
||||
|
ResultBean<PagerVo<PurchaseReceiptBillVo>> rb = ResultBean.fireFail(); |
||||
|
PagerVo<PurchaseReceiptBillVo> pv = baseBrandInfoService.listPage(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
@ApiOperation("保存修改") |
||||
|
@PostMapping("/saveOrUpdate") |
||||
|
public ResultBean<String> saveOrUpdate(@RequestBody PurchaseReceiptBillDto dto) { |
||||
|
return baseBrandInfoService.saveOrUpdate(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("初始化") |
||||
|
@GetMapping("/initialization/{sid}") |
||||
|
public ResultBean<PurchaseReceiptBillVo> 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,42 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbill; |
||||
|
|
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:36 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PurchaseReceiptBill extends BaseEntity { |
||||
|
|
||||
|
|
||||
|
private String sourceBillSid;//来源单sid(工单sid)
|
||||
|
private String sourceBillNo;//来源单编号
|
||||
|
private String billNo;//单据编号
|
||||
|
private String createDate;//单据日期
|
||||
|
private String createUserSid;//制单人sid
|
||||
|
private String createByName;//制单人姓名
|
||||
|
private String purchaseType;//采购类型(厂家采购、外采)
|
||||
|
private String supplierSid;//供应商sid
|
||||
|
private String supplierName;//供应商名称
|
||||
|
private String supplierPhone;//供应商联系电话
|
||||
|
private String billType;//票据类型(不含税、增值税、普通税、已含增值税)
|
||||
|
private String markupType;//加价方式(统一加价率、区间加价率、仓库加价率)
|
||||
|
private String priceStrategy;//进价不同时的价格策略(加权平均、分别计价)
|
||||
|
private String isInvoicing;//是否需要开发票(是1,否0)
|
||||
|
private String invoiceCode;//发票号码
|
||||
|
private String tempMarkupRate;//临时加价率
|
||||
|
private String purchaserSid;//采购员sid(单选)
|
||||
|
private String purchaserName;//
|
||||
|
private String storekeeperSid;//库管员sid(单选)
|
||||
|
private String storekeeperName;//
|
||||
|
private String errorAmount;//误差调整金额
|
||||
|
private String freight;//运费
|
||||
|
private String discountAmount;//优惠金额
|
||||
|
private String payableAmount;//应付金额(=采购金额+运费-优惠金额)
|
||||
|
private String useOrgSid;//使用组织sid
|
||||
|
private String createOrgSid;//创建组织sid
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbill; |
||||
|
|
||||
|
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 PurchaseReceiptBillDto 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 sourceBillSid;//来源单sid(工单sid)
|
||||
|
private String sourceBillNo;//来源单编号
|
||||
|
private String billNo;//单据编号
|
||||
|
private String createDate;//单据日期
|
||||
|
private String createUserSid;//制单人sid
|
||||
|
private String createByName;//制单人姓名
|
||||
|
private String purchaseType;//采购类型(厂家采购、外采)
|
||||
|
private String supplierSid;//供应商sid
|
||||
|
private String supplierName;//供应商名称
|
||||
|
private String supplierPhone;//供应商联系电话
|
||||
|
private String billType;//票据类型(不含税、增值税、普通税、已含增值税)
|
||||
|
private String markupType;//加价方式(统一加价率、区间加价率、仓库加价率)
|
||||
|
private String priceStrategy;//进价不同时的价格策略(加权平均、分别计价)
|
||||
|
private String isInvoicing;//是否需要开发票(是1,否0)
|
||||
|
private String invoiceCode;//发票号码
|
||||
|
private String tempMarkupRate;//临时加价率
|
||||
|
private String purchaserSid;//采购员sid(单选)
|
||||
|
private String purchaserName;//
|
||||
|
private String storekeeperSid;//库管员sid(单选)
|
||||
|
private String storekeeperName;//
|
||||
|
private String errorAmount;//误差调整金额
|
||||
|
private String freight;//运费
|
||||
|
private String discountAmount;//优惠金额
|
||||
|
private String payableAmount;//应付金额(=采购金额+运费-优惠金额)
|
||||
|
private String useOrgSid;//使用组织sid
|
||||
|
private String createOrgSid;//创建组织sid
|
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbill; |
||||
|
|
||||
|
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 PurchaseReceiptBillMapper extends BaseMapper<PurchaseReceiptBill> { |
||||
|
|
||||
|
IPage<PurchaseReceiptBillVo> listPage(IPage<PurchaseReceiptBill> page, @Param(Constants.WRAPPER) QueryWrapper<PurchaseReceiptBill> qw); |
||||
|
PurchaseReceiptBillVo 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.purchasereceiptbill.PurchaseReceiptBillMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
|
||||
|
<select id="listPage" resultType="com.yxt.purchase.biz.purchasereceiptbill.PurchaseReceiptBillVo"> |
||||
|
select |
||||
|
* |
||||
|
from purchase_receipt_bill |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
<select id="initialization" resultType="com.yxt.purchase.biz.purchasereceiptbill.PurchaseReceiptBillVo"> |
||||
|
select |
||||
|
a.* |
||||
|
from purchase_receipt_bill a |
||||
|
where a.sid =#{sid} |
||||
|
</select> |
||||
|
<update id="updateBySidIsDelete"> |
||||
|
UPDATE purchase_receipt_bill |
||||
|
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.purchasereceiptbill; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:37 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PurchaseReceiptBillQuery implements Query { |
||||
|
private String name; |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbill; |
||||
|
|
||||
|
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.Collections; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2024/2/26 13:40 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class PurchaseReceiptBillService extends MybatisBaseService<PurchaseReceiptBillMapper, PurchaseReceiptBill> { |
||||
|
@Autowired |
||||
|
private FileUploadComponent fileUploadComponent; |
||||
|
|
||||
|
public PagerVo<PurchaseReceiptBillVo> listPage(PagerQuery<PurchaseReceiptBillQuery> pq) { |
||||
|
PurchaseReceiptBillQuery query = pq.getParams(); |
||||
|
QueryWrapper<PurchaseReceiptBill> qw = new QueryWrapper<>(); |
||||
|
IPage<PurchaseReceiptBill> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<PurchaseReceiptBillVo> pagging = baseMapper.listPage(page, qw); |
||||
|
PagerVo<PurchaseReceiptBillVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> saveOrUpdate(PurchaseReceiptBillDto dto) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
String sid = dto.getSid(); |
||||
|
if (StringUtils.isBlank(sid)) { |
||||
|
PurchaseReceiptBill PurchaseReceiptBill = new PurchaseReceiptBill(); |
||||
|
BeanUtil.copyProperties(dto, PurchaseReceiptBill, "sid"); |
||||
|
sid = PurchaseReceiptBill.getSid(); |
||||
|
baseMapper.insert(PurchaseReceiptBill); |
||||
|
|
||||
|
} else { |
||||
|
PurchaseReceiptBill PurchaseReceiptBill = fetchBySid(sid); |
||||
|
if (PurchaseReceiptBill == null) { |
||||
|
return rb.setMsg("该单据不存在"); |
||||
|
} |
||||
|
BeanUtil.copyProperties(dto, PurchaseReceiptBill, "sid"); |
||||
|
baseMapper.updateById(PurchaseReceiptBill); |
||||
|
|
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<PurchaseReceiptBillVo> initialization(String sid) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PurchaseReceiptBillVo 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,52 @@ |
|||||
|
package com.yxt.purchase.biz.purchasereceiptbill; |
||||
|
|
||||
|
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 PurchaseReceiptBillVo 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 sourceBillSid;//来源单sid(工单sid)
|
||||
|
private String sourceBillNo;//来源单编号
|
||||
|
private String billNo;//单据编号
|
||||
|
private String createDate;//单据日期
|
||||
|
private String createUserSid;//制单人sid
|
||||
|
private String createByName;//制单人姓名
|
||||
|
private String purchaseType;//采购类型(厂家采购、外采)
|
||||
|
private String supplierSid;//供应商sid
|
||||
|
private String supplierName;//供应商名称
|
||||
|
private String supplierPhone;//供应商联系电话
|
||||
|
private String billType;//票据类型(不含税、增值税、普通税、已含增值税)
|
||||
|
private String markupType;//加价方式(统一加价率、区间加价率、仓库加价率)
|
||||
|
private String priceStrategy;//进价不同时的价格策略(加权平均、分别计价)
|
||||
|
private String isInvoicing;//是否需要开发票(是1,否0)
|
||||
|
private String invoiceCode;//发票号码
|
||||
|
private String tempMarkupRate;//临时加价率
|
||||
|
private String purchaserSid;//采购员sid(单选)
|
||||
|
private String purchaserName;//
|
||||
|
private String storekeeperSid;//库管员sid(单选)
|
||||
|
private String storekeeperName;//
|
||||
|
private String errorAmount;//误差调整金额
|
||||
|
private String freight;//运费
|
||||
|
private String discountAmount;//优惠金额
|
||||
|
private String payableAmount;//应付金额(=采购金额+运费-优惠金额)
|
||||
|
private String useOrgSid;//使用组织sid
|
||||
|
private String createOrgSid;//创建组织sid
|
||||
|
} |
Loading…
Reference in new issue