25 changed files with 1529 additions and 57 deletions
@ -0,0 +1,19 @@ |
|||||
|
package com.base.springcloud.base; |
||||
|
|
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
@Data |
||||
|
@NoArgsConstructor |
||||
|
@Accessors(chain = true) |
||||
|
public class ReportResult<T> { |
||||
|
|
||||
|
//返回的数据
|
||||
|
private T data; |
||||
|
|
||||
|
public ReportResult(T data) { |
||||
|
this.data = data; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.base.springcloud.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class MerchantConfigBO { |
||||
|
|
||||
|
private String appId; |
||||
|
|
||||
|
private String appKey; |
||||
|
|
||||
|
private String certPath; |
||||
|
|
||||
|
private String merchantId; |
||||
|
|
||||
|
private String merchantName; |
||||
|
|
||||
|
private String cityStoreName; |
||||
|
|
||||
|
private String storeBrandName; |
||||
|
|
||||
|
private String signType; |
||||
|
|
||||
|
private String privateKey; |
||||
|
|
||||
|
private String deviceInfo; |
||||
|
|
||||
|
private String spbillCreateIp; |
||||
|
|
||||
|
private String notifyUrl; |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
package com.base.springcloud.bo; |
||||
|
|
||||
|
import com.base.springcloud.entity.Order; |
||||
|
import com.base.springcloud.entity.SaleBill; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class OrderBO { |
||||
|
|
||||
|
// 销售单据号
|
||||
|
private String billNo; |
||||
|
|
||||
|
// 销售单
|
||||
|
private SaleBill saleBill; |
||||
|
|
||||
|
// 支付订单
|
||||
|
private Order order; |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
package com.base.springcloud.dao; |
||||
|
|
||||
|
import com.base.springcloud.entity.MerchantConfig; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
@Repository |
||||
|
public interface MerchantConfigMapper { |
||||
|
int deleteByPrimaryKey(String id); |
||||
|
|
||||
|
int insert(MerchantConfig record); |
||||
|
|
||||
|
int insertSelective(MerchantConfig record); |
||||
|
|
||||
|
MerchantConfig selectByPrimaryKey(String id); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(MerchantConfig record); |
||||
|
|
||||
|
int updateByPrimaryKey(MerchantConfig record); |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.base.springcloud.dao; |
||||
|
|
||||
|
import com.base.springcloud.entity.SaleBill; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
@Repository |
||||
|
public interface SaleBillMapper { |
||||
|
|
||||
|
int deleteByPrimaryKey(String id); |
||||
|
|
||||
|
int insert(SaleBill record); |
||||
|
|
||||
|
int insertSelective(SaleBill record); |
||||
|
|
||||
|
SaleBill selectByPrimaryKey(String id); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(SaleBill record); |
||||
|
|
||||
|
int updateByPrimaryKey(SaleBill record); |
||||
|
|
||||
|
SaleBill queryBillInfo(SaleBill saleBill); |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.base.springcloud.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.File; |
||||
|
|
||||
|
@Data |
||||
|
public class MerchantConfigDTO { |
||||
|
|
||||
|
private File certFile; |
||||
|
|
||||
|
private String appId; |
||||
|
|
||||
|
private String appKey; |
||||
|
|
||||
|
private String certPath; |
||||
|
|
||||
|
private String merchantId; |
||||
|
|
||||
|
private String merchantName; |
||||
|
|
||||
|
private String cityStoreName; |
||||
|
|
||||
|
private String storeBrandName; |
||||
|
|
||||
|
private String signType; |
||||
|
|
||||
|
private String privateKey; |
||||
|
|
||||
|
private String deviceInfo; |
||||
|
|
||||
|
private String spbillCreateIp; |
||||
|
|
||||
|
private String notifyUrl; |
||||
|
} |
||||
@ -0,0 +1,9 @@ |
|||||
|
package com.base.springcloud.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class NativePlaceOrderDTO { |
||||
|
|
||||
|
private String codeUrl; |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.base.springcloud.entity; |
||||
|
|
||||
|
import com.base.springcloud.base.BaseEntity; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class MerchantConfig extends BaseEntity { |
||||
|
|
||||
|
private String id; |
||||
|
|
||||
|
private String appId; |
||||
|
|
||||
|
private String appKey; |
||||
|
|
||||
|
private String certPath; |
||||
|
|
||||
|
private String merchantId; |
||||
|
|
||||
|
private String merchantName; |
||||
|
|
||||
|
private String cityStoreName; |
||||
|
|
||||
|
private String storeBrandName; |
||||
|
|
||||
|
private String signType; |
||||
|
|
||||
|
private String privateKey; |
||||
|
|
||||
|
private String deviceInfo; |
||||
|
|
||||
|
private String spbillCreateIp; |
||||
|
|
||||
|
private String notifyUrl; |
||||
|
} |
||||
@ -0,0 +1,426 @@ |
|||||
|
package com.base.springcloud.entity; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class SaleBill { |
||||
|
private String id; |
||||
|
|
||||
|
private String billNo; |
||||
|
|
||||
|
private String stockIoType; |
||||
|
|
||||
|
private Integer isRubric; |
||||
|
|
||||
|
private Date billDate; |
||||
|
|
||||
|
private String sourceType; |
||||
|
|
||||
|
private String sourceId; |
||||
|
|
||||
|
private String clerkId; |
||||
|
|
||||
|
private String handlerId; |
||||
|
|
||||
|
private Integer hasRp; |
||||
|
|
||||
|
private String supplierId; |
||||
|
|
||||
|
private String customerId; |
||||
|
|
||||
|
private String remark; |
||||
|
|
||||
|
private String approverId; |
||||
|
|
||||
|
private String flowId; |
||||
|
|
||||
|
private Integer isApproved; |
||||
|
|
||||
|
private Date effectiveTime; |
||||
|
|
||||
|
private Integer isVoided; |
||||
|
|
||||
|
private Integer isClosed; |
||||
|
|
||||
|
private String sysOrgCode; |
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
private Date createTime; |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
private Integer version; |
||||
|
|
||||
|
private String ctCompanyId; |
||||
|
|
||||
|
private String attachmentId; |
||||
|
|
||||
|
private BigDecimal payAmount; |
||||
|
|
||||
|
private String billStatus; |
||||
|
|
||||
|
private BigDecimal totalAmount; |
||||
|
|
||||
|
private BigDecimal lockAmount; |
||||
|
|
||||
|
private String sourceNo; |
||||
|
|
||||
|
private Integer isSameSettle; |
||||
|
|
||||
|
private String isTurnSale; |
||||
|
|
||||
|
private String logisticsNo; |
||||
|
|
||||
|
private Integer isPlatformSupplier; |
||||
|
|
||||
|
private String saleNo; |
||||
|
|
||||
|
private Integer isDelivery; |
||||
|
|
||||
|
private Integer isAuto; |
||||
|
|
||||
|
private String attachment; |
||||
|
|
||||
|
private String billProcStatus; |
||||
|
|
||||
|
private Integer isRefStk; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getBillNo() { |
||||
|
return billNo; |
||||
|
} |
||||
|
|
||||
|
public void setBillNo(String billNo) { |
||||
|
this.billNo = billNo; |
||||
|
} |
||||
|
|
||||
|
public String getStockIoType() { |
||||
|
return stockIoType; |
||||
|
} |
||||
|
|
||||
|
public void setStockIoType(String stockIoType) { |
||||
|
this.stockIoType = stockIoType; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsRubric() { |
||||
|
return isRubric; |
||||
|
} |
||||
|
|
||||
|
public void setIsRubric(Integer isRubric) { |
||||
|
this.isRubric = isRubric; |
||||
|
} |
||||
|
|
||||
|
public Date getBillDate() { |
||||
|
return billDate; |
||||
|
} |
||||
|
|
||||
|
public void setBillDate(Date billDate) { |
||||
|
this.billDate = billDate; |
||||
|
} |
||||
|
|
||||
|
public String getSourceType() { |
||||
|
return sourceType; |
||||
|
} |
||||
|
|
||||
|
public void setSourceType(String sourceType) { |
||||
|
this.sourceType = sourceType; |
||||
|
} |
||||
|
|
||||
|
public String getSourceId() { |
||||
|
return sourceId; |
||||
|
} |
||||
|
|
||||
|
public void setSourceId(String sourceId) { |
||||
|
this.sourceId = sourceId; |
||||
|
} |
||||
|
|
||||
|
public String getClerkId() { |
||||
|
return clerkId; |
||||
|
} |
||||
|
|
||||
|
public void setClerkId(String clerkId) { |
||||
|
this.clerkId = clerkId; |
||||
|
} |
||||
|
|
||||
|
public String getHandlerId() { |
||||
|
return handlerId; |
||||
|
} |
||||
|
|
||||
|
public void setHandlerId(String handlerId) { |
||||
|
this.handlerId = handlerId; |
||||
|
} |
||||
|
|
||||
|
public Integer getHasRp() { |
||||
|
return hasRp; |
||||
|
} |
||||
|
|
||||
|
public void setHasRp(Integer hasRp) { |
||||
|
this.hasRp = hasRp; |
||||
|
} |
||||
|
|
||||
|
public String getSupplierId() { |
||||
|
return supplierId; |
||||
|
} |
||||
|
|
||||
|
public void setSupplierId(String supplierId) { |
||||
|
this.supplierId = supplierId; |
||||
|
} |
||||
|
|
||||
|
public String getCustomerId() { |
||||
|
return customerId; |
||||
|
} |
||||
|
|
||||
|
public void setCustomerId(String customerId) { |
||||
|
this.customerId = customerId; |
||||
|
} |
||||
|
|
||||
|
public String getRemark() { |
||||
|
return remark; |
||||
|
} |
||||
|
|
||||
|
public void setRemark(String remark) { |
||||
|
this.remark = remark; |
||||
|
} |
||||
|
|
||||
|
public String getApproverId() { |
||||
|
return approverId; |
||||
|
} |
||||
|
|
||||
|
public void setApproverId(String approverId) { |
||||
|
this.approverId = approverId; |
||||
|
} |
||||
|
|
||||
|
public String getFlowId() { |
||||
|
return flowId; |
||||
|
} |
||||
|
|
||||
|
public void setFlowId(String flowId) { |
||||
|
this.flowId = flowId; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsApproved() { |
||||
|
return isApproved; |
||||
|
} |
||||
|
|
||||
|
public void setIsApproved(Integer isApproved) { |
||||
|
this.isApproved = isApproved; |
||||
|
} |
||||
|
|
||||
|
public Date getEffectiveTime() { |
||||
|
return effectiveTime; |
||||
|
} |
||||
|
|
||||
|
public void setEffectiveTime(Date effectiveTime) { |
||||
|
this.effectiveTime = effectiveTime; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsVoided() { |
||||
|
return isVoided; |
||||
|
} |
||||
|
|
||||
|
public void setIsVoided(Integer isVoided) { |
||||
|
this.isVoided = isVoided; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsClosed() { |
||||
|
return isClosed; |
||||
|
} |
||||
|
|
||||
|
public void setIsClosed(Integer isClosed) { |
||||
|
this.isClosed = isClosed; |
||||
|
} |
||||
|
|
||||
|
public String getSysOrgCode() { |
||||
|
return sysOrgCode; |
||||
|
} |
||||
|
|
||||
|
public void setSysOrgCode(String sysOrgCode) { |
||||
|
this.sysOrgCode = sysOrgCode; |
||||
|
} |
||||
|
|
||||
|
public String getCreateBy() { |
||||
|
return createBy; |
||||
|
} |
||||
|
|
||||
|
public void setCreateBy(String createBy) { |
||||
|
this.createBy = createBy; |
||||
|
} |
||||
|
|
||||
|
public Date getCreateTime() { |
||||
|
return createTime; |
||||
|
} |
||||
|
|
||||
|
public void setCreateTime(Date createTime) { |
||||
|
this.createTime = createTime; |
||||
|
} |
||||
|
|
||||
|
public String getUpdateBy() { |
||||
|
return updateBy; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateBy(String updateBy) { |
||||
|
this.updateBy = updateBy; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdateTime() { |
||||
|
return updateTime; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateTime(Date updateTime) { |
||||
|
this.updateTime = updateTime; |
||||
|
} |
||||
|
|
||||
|
public Integer getVersion() { |
||||
|
return version; |
||||
|
} |
||||
|
|
||||
|
public void setVersion(Integer version) { |
||||
|
this.version = version; |
||||
|
} |
||||
|
|
||||
|
public String getCtCompanyId() { |
||||
|
return ctCompanyId; |
||||
|
} |
||||
|
|
||||
|
public void setCtCompanyId(String ctCompanyId) { |
||||
|
this.ctCompanyId = ctCompanyId; |
||||
|
} |
||||
|
|
||||
|
public String getAttachmentId() { |
||||
|
return attachmentId; |
||||
|
} |
||||
|
|
||||
|
public void setAttachmentId(String attachmentId) { |
||||
|
this.attachmentId = attachmentId; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getPayAmount() { |
||||
|
return payAmount; |
||||
|
} |
||||
|
|
||||
|
public void setPayAmount(BigDecimal payAmount) { |
||||
|
this.payAmount = payAmount; |
||||
|
} |
||||
|
|
||||
|
public String getBillStatus() { |
||||
|
return billStatus; |
||||
|
} |
||||
|
|
||||
|
public void setBillStatus(String billStatus) { |
||||
|
this.billStatus = billStatus; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getTotalAmount() { |
||||
|
return totalAmount; |
||||
|
} |
||||
|
|
||||
|
public void setTotalAmount(BigDecimal totalAmount) { |
||||
|
this.totalAmount = totalAmount; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getLockAmount() { |
||||
|
return lockAmount; |
||||
|
} |
||||
|
|
||||
|
public void setLockAmount(BigDecimal lockAmount) { |
||||
|
this.lockAmount = lockAmount; |
||||
|
} |
||||
|
|
||||
|
public String getSourceNo() { |
||||
|
return sourceNo; |
||||
|
} |
||||
|
|
||||
|
public void setSourceNo(String sourceNo) { |
||||
|
this.sourceNo = sourceNo; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsSameSettle() { |
||||
|
return isSameSettle; |
||||
|
} |
||||
|
|
||||
|
public void setIsSameSettle(Integer isSameSettle) { |
||||
|
this.isSameSettle = isSameSettle; |
||||
|
} |
||||
|
|
||||
|
public String getIsTurnSale() { |
||||
|
return isTurnSale; |
||||
|
} |
||||
|
|
||||
|
public void setIsTurnSale(String isTurnSale) { |
||||
|
this.isTurnSale = isTurnSale; |
||||
|
} |
||||
|
|
||||
|
public String getLogisticsNo() { |
||||
|
return logisticsNo; |
||||
|
} |
||||
|
|
||||
|
public void setLogisticsNo(String logisticsNo) { |
||||
|
this.logisticsNo = logisticsNo; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsPlatformSupplier() { |
||||
|
return isPlatformSupplier; |
||||
|
} |
||||
|
|
||||
|
public void setIsPlatformSupplier(Integer isPlatformSupplier) { |
||||
|
this.isPlatformSupplier = isPlatformSupplier; |
||||
|
} |
||||
|
|
||||
|
public String getSaleNo() { |
||||
|
return saleNo; |
||||
|
} |
||||
|
|
||||
|
public void setSaleNo(String saleNo) { |
||||
|
this.saleNo = saleNo; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsDelivery() { |
||||
|
return isDelivery; |
||||
|
} |
||||
|
|
||||
|
public void setIsDelivery(Integer isDelivery) { |
||||
|
this.isDelivery = isDelivery; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsAuto() { |
||||
|
return isAuto; |
||||
|
} |
||||
|
|
||||
|
public void setIsAuto(Integer isAuto) { |
||||
|
this.isAuto = isAuto; |
||||
|
} |
||||
|
|
||||
|
public String getAttachment() { |
||||
|
return attachment; |
||||
|
} |
||||
|
|
||||
|
public void setAttachment(String attachment) { |
||||
|
this.attachment = attachment; |
||||
|
} |
||||
|
|
||||
|
public String getBillProcStatus() { |
||||
|
return billProcStatus; |
||||
|
} |
||||
|
|
||||
|
public void setBillProcStatus(String billProcStatus) { |
||||
|
this.billProcStatus = billProcStatus; |
||||
|
} |
||||
|
|
||||
|
public Integer getIsRefStk() { |
||||
|
return isRefStk; |
||||
|
} |
||||
|
|
||||
|
public void setIsRefStk(Integer isRefStk) { |
||||
|
this.isRefStk = isRefStk; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
package com.base.springcloud.service; |
||||
|
|
||||
|
import com.base.springcloud.bo.OrderBO; |
||||
|
|
||||
|
public interface BillService { |
||||
|
|
||||
|
/** |
||||
|
* 销售单据核查 |
||||
|
* @param orderBO |
||||
|
*/ |
||||
|
void billCheck(OrderBO orderBO); |
||||
|
} |
||||
@ -1,5 +1,12 @@ |
|||||
package com.base.springcloud.service; |
package com.base.springcloud.service; |
||||
|
|
||||
|
import com.base.springcloud.bo.MerchantConfigBO; |
||||
|
|
||||
public interface MerchantService { |
public interface MerchantService { |
||||
|
|
||||
|
/** |
||||
|
* 支付信息配置 |
||||
|
* @param merchantConfigBO |
||||
|
*/ |
||||
|
void paymentConfigure(MerchantConfigBO merchantConfigBO); |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,9 @@ |
|||||
package com.base.springcloud.service; |
package com.base.springcloud.service; |
||||
|
|
||||
import com.base.springcloud.entity.Order; |
import com.base.springcloud.bo.OrderBO; |
||||
|
|
||||
public interface PaymentService { |
public interface PaymentService { |
||||
|
|
||||
// 下单
|
// 下单
|
||||
String placeOrder(Order order); |
String placeOrder(OrderBO orderBO); |
||||
} |
} |
||||
|
|||||
@ -1,8 +1,8 @@ |
|||||
package com.base.springcloud.service; |
package com.base.springcloud.service; |
||||
|
|
||||
import com.base.springcloud.entity.Order; |
import com.base.springcloud.bo.OrderBO; |
||||
|
|
||||
public interface WecPaymentService { |
public interface WecPaymentService { |
||||
|
|
||||
String nativePay(Order order); |
String nativePay(OrderBO orderBO); |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,34 @@ |
|||||
|
package com.base.springcloud.service.imp; |
||||
|
|
||||
|
import com.base.springcloud.bo.OrderBO; |
||||
|
import com.base.springcloud.dao.SaleBillMapper; |
||||
|
import com.base.springcloud.entity.SaleBill; |
||||
|
import com.base.springcloud.service.BillService; |
||||
|
import org.slf4j.Logger; |
||||
|
import org.slf4j.LoggerFactory; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Optional; |
||||
|
|
||||
|
@Service |
||||
|
public class BillServiceImp implements BillService { |
||||
|
|
||||
|
Logger logger = LoggerFactory.getLogger(BillServiceImp.class); |
||||
|
|
||||
|
@Autowired |
||||
|
private SaleBillMapper saleBillMapper; |
||||
|
|
||||
|
@Override |
||||
|
public void billCheck(OrderBO orderBO) { |
||||
|
SaleBill saleBill = new SaleBill(); |
||||
|
saleBill.setBillNo(orderBO.getBillNo()); |
||||
|
SaleBill queryResult = saleBillMapper.queryBillInfo(saleBill); |
||||
|
if(!Optional.ofNullable(queryResult).isPresent()){ |
||||
|
saleBill.setTotalAmount(new BigDecimal(1)); |
||||
|
logger.warn("==================销售单据查询失败!============================="); |
||||
|
} |
||||
|
orderBO.setSaleBill(queryResult); |
||||
|
} |
||||
|
} |
||||
@ -1,9 +1,14 @@ |
|||||
package com.base.springcloud.service.imp; |
package com.base.springcloud.service.imp; |
||||
|
|
||||
|
import com.base.springcloud.bo.MerchantConfigBO; |
||||
import com.base.springcloud.service.MerchantService; |
import com.base.springcloud.service.MerchantService; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
|
||||
@Service |
@Service |
||||
public class MerchantServiceImp implements MerchantService { |
public class MerchantServiceImp implements MerchantService { |
||||
|
|
||||
|
@Override |
||||
|
public void paymentConfigure(MerchantConfigBO merchantConfigBO) { |
||||
|
|
||||
|
} |
||||
} |
} |
||||
|
|||||
@ -1,34 +1,45 @@ |
|||||
package com.base.springcloud.service.imp; |
package com.base.springcloud.service.imp; |
||||
|
|
||||
|
import com.base.springcloud.bo.OrderBO; |
||||
import com.base.springcloud.entity.Order; |
import com.base.springcloud.entity.Order; |
||||
|
import com.base.springcloud.service.BillService; |
||||
import com.base.springcloud.service.OrderService; |
import com.base.springcloud.service.OrderService; |
||||
import com.base.springcloud.service.PaymentService; |
import com.base.springcloud.service.PaymentService; |
||||
import com.base.springcloud.service.WecPaymentService; |
import com.base.springcloud.service.WecPaymentService; |
||||
|
import com.base.springcloud.util.DateUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
|
||||
@Service |
@Service |
||||
public class PaymentServiceImp implements PaymentService { |
public class PaymentServiceImp implements PaymentService { |
||||
|
|
||||
@Autowired |
@Autowired |
||||
private OrderService orderService; |
private OrderService orderService; |
||||
|
|
||||
|
@Autowired |
||||
|
private BillService billService; |
||||
|
|
||||
@Autowired |
@Autowired |
||||
private WecPaymentService wecPaymentService; |
private WecPaymentService wecPaymentService; |
||||
|
|
||||
@Override |
@Override |
||||
public String placeOrder(Order order){ |
public String placeOrder(OrderBO orderBO){ |
||||
|
Order order = new Order(); |
||||
// 参数检查
|
// 参数检查
|
||||
parameterCheck(order); |
parameterCheck(orderBO); |
||||
|
// 销售单据核查
|
||||
|
billService.billCheck(orderBO); |
||||
// 登记订单
|
// 登记订单
|
||||
orderService.registerOrder(order); |
orderService.registerOrder(orderBO); |
||||
// 请求微信生成二维码
|
// 请求微信生成二维码
|
||||
String codeUrl = wecPaymentService.nativePay(order); |
String codeUrl = wecPaymentService.nativePay(orderBO); |
||||
return codeUrl; |
return codeUrl; |
||||
} |
} |
||||
|
|
||||
// 参数检查
|
// 参数检查
|
||||
private void parameterCheck(Order order) { |
private void parameterCheck(OrderBO orderBO) { |
||||
|
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -0,0 +1,199 @@ |
|||||
|
<?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.base.springcloud.dao.MerchantConfigMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.base.springcloud.entity.MerchantConfig"> |
||||
|
<id column="id" jdbcType="VARCHAR" property="id" /> |
||||
|
<result column="app_id" jdbcType="VARCHAR" property="appId" /> |
||||
|
<result column="api_key" jdbcType="VARCHAR" property="appKey" /> |
||||
|
<result column="cert_path" jdbcType="VARCHAR" property="certPath" /> |
||||
|
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" /> |
||||
|
<result column="merchant_name" jdbcType="VARCHAR" property="merchantName" /> |
||||
|
<result column="city_store_name" jdbcType="VARCHAR" property="cityStoreName" /> |
||||
|
<result column="store_brand_name" jdbcType="VARCHAR" property="storeBrandName" /> |
||||
|
<result column="sign_type" jdbcType="VARCHAR" property="signType" /> |
||||
|
<result column="private_key" jdbcType="VARCHAR" property="privateKey" /> |
||||
|
<result column="device_info" jdbcType="VARCHAR" property="deviceInfo" /> |
||||
|
<result column="spbill_create_ip" jdbcType="VARCHAR" property="spbillCreateIp" /> |
||||
|
<result column="notify_url" jdbcType="VARCHAR" property="notifyUrl" /> |
||||
|
<result column="time_stamp" jdbcType="TIMESTAMP" property="timeStamp" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, app_id, api_key, cert_path, merchant_id, merchant_name, city_store_name, store_brand_name, |
||||
|
sign_type, private_key, device_info, spbill_create_ip, notify_url, time_stamp |
||||
|
</sql> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from pay_merchant_config |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
||||
|
delete from pay_merchant_config |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.base.springcloud.entity.MerchantConfig"> |
||||
|
insert into pay_merchant_config (id, app_id, api_key, |
||||
|
cert_path, merchant_id, merchant_name, |
||||
|
city_store_name, store_brand_name, sign_type, |
||||
|
private_key, device_info, spbill_create_ip, |
||||
|
notify_url, time_stamp) |
||||
|
values (#{id,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, |
||||
|
#{certPath,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{merchantName,jdbcType=VARCHAR}, |
||||
|
#{cityStoreName,jdbcType=VARCHAR}, #{storeBrandName,jdbcType=VARCHAR}, #{signType,jdbcType=VARCHAR}, |
||||
|
#{privateKey,jdbcType=VARCHAR}, #{deviceInfo,jdbcType=VARCHAR}, #{spbillCreateIp,jdbcType=VARCHAR}, |
||||
|
#{notifyUrl,jdbcType=VARCHAR}, #{timeStamp,jdbcType=TIMESTAMP}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.base.springcloud.entity.MerchantConfig"> |
||||
|
insert into pay_merchant_config |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="appId != null"> |
||||
|
app_id, |
||||
|
</if> |
||||
|
<if test="appKey != null"> |
||||
|
api_key, |
||||
|
</if> |
||||
|
<if test="certPath != null"> |
||||
|
cert_path, |
||||
|
</if> |
||||
|
<if test="merchantId != null"> |
||||
|
merchant_id, |
||||
|
</if> |
||||
|
<if test="merchantName != null"> |
||||
|
merchant_name, |
||||
|
</if> |
||||
|
<if test="cityStoreName != null"> |
||||
|
city_store_name, |
||||
|
</if> |
||||
|
<if test="storeBrandName != null"> |
||||
|
store_brand_name, |
||||
|
</if> |
||||
|
<if test="signType != null"> |
||||
|
sign_type, |
||||
|
</if> |
||||
|
<if test="privateKey != null"> |
||||
|
private_key, |
||||
|
</if> |
||||
|
<if test="deviceInfo != null"> |
||||
|
device_info, |
||||
|
</if> |
||||
|
<if test="spbillCreateIp != null"> |
||||
|
spbill_create_ip, |
||||
|
</if> |
||||
|
<if test="notifyUrl != null"> |
||||
|
notify_url, |
||||
|
</if> |
||||
|
<if test="timeStamp != null"> |
||||
|
time_stamp, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="appId != null"> |
||||
|
#{appId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="appKey != null"> |
||||
|
#{appKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="certPath != null"> |
||||
|
#{certPath,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="merchantId != null"> |
||||
|
#{merchantId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="merchantName != null"> |
||||
|
#{merchantName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="cityStoreName != null"> |
||||
|
#{cityStoreName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="storeBrandName != null"> |
||||
|
#{storeBrandName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="signType != null"> |
||||
|
#{signType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="privateKey != null"> |
||||
|
#{privateKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="deviceInfo != null"> |
||||
|
#{deviceInfo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="spbillCreateIp != null"> |
||||
|
#{spbillCreateIp,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="notifyUrl != null"> |
||||
|
#{notifyUrl,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="timeStamp != null"> |
||||
|
#{timeStamp,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.base.springcloud.entity.MerchantConfig"> |
||||
|
update pay_merchant_config |
||||
|
<set> |
||||
|
<if test="appId != null"> |
||||
|
app_id = #{appId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="appKey != null"> |
||||
|
api_key = #{appKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="certPath != null"> |
||||
|
cert_path = #{certPath,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="merchantId != null"> |
||||
|
merchant_id = #{merchantId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="merchantName != null"> |
||||
|
merchant_name = #{merchantName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="cityStoreName != null"> |
||||
|
city_store_name = #{cityStoreName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="storeBrandName != null"> |
||||
|
store_brand_name = #{storeBrandName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="signType != null"> |
||||
|
sign_type = #{signType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="privateKey != null"> |
||||
|
private_key = #{privateKey,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="deviceInfo != null"> |
||||
|
device_info = #{deviceInfo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="spbillCreateIp != null"> |
||||
|
spbill_create_ip = #{spbillCreateIp,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="notifyUrl != null"> |
||||
|
notify_url = #{notifyUrl,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="timeStamp != null"> |
||||
|
time_stamp = #{timeStamp,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.base.springcloud.entity.MerchantConfig"> |
||||
|
update pay_merchant_config |
||||
|
set app_id = #{appId,jdbcType=VARCHAR}, |
||||
|
api_key = #{appKey,jdbcType=VARCHAR}, |
||||
|
cert_path = #{certPath,jdbcType=VARCHAR}, |
||||
|
merchant_id = #{merchantId,jdbcType=VARCHAR}, |
||||
|
merchant_name = #{merchantName,jdbcType=VARCHAR}, |
||||
|
city_store_name = #{cityStoreName,jdbcType=VARCHAR}, |
||||
|
store_brand_name = #{storeBrandName,jdbcType=VARCHAR}, |
||||
|
sign_type = #{signType,jdbcType=VARCHAR}, |
||||
|
private_key = #{privateKey,jdbcType=VARCHAR}, |
||||
|
device_info = #{deviceInfo,jdbcType=VARCHAR}, |
||||
|
spbill_create_ip = #{spbillCreateIp,jdbcType=VARCHAR}, |
||||
|
notify_url = #{notifyUrl,jdbcType=VARCHAR}, |
||||
|
time_stamp = #{timeStamp,jdbcType=TIMESTAMP} |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
</mapper> |
||||
@ -0,0 +1,539 @@ |
|||||
|
<?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.base.springcloud.dao.SaleBillMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.base.springcloud.entity.SaleBill"> |
||||
|
<id column="id" jdbcType="VARCHAR" property="id" /> |
||||
|
<result column="bill_no" jdbcType="VARCHAR" property="billNo" /> |
||||
|
<result column="stock_io_type" jdbcType="VARCHAR" property="stockIoType" /> |
||||
|
<result column="is_rubric" jdbcType="VARCHAR" property="isRubric" /> |
||||
|
<result column="bill_date" jdbcType="TIMESTAMP" property="billDate" /> |
||||
|
<result column="source_type" jdbcType="VARCHAR" property="sourceType" /> |
||||
|
<result column="source_id" jdbcType="VARCHAR" property="sourceId" /> |
||||
|
<result column="clerk_id" jdbcType="VARCHAR" property="clerkId" /> |
||||
|
<result column="handler_id" jdbcType="VARCHAR" property="handlerId" /> |
||||
|
<result column="has_rp" jdbcType="INTEGER" property="hasRp" /> |
||||
|
<result column="supplier_id" jdbcType="VARCHAR" property="supplierId" /> |
||||
|
<result column="customer_id" jdbcType="VARCHAR" property="customerId" /> |
||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" /> |
||||
|
<result column="approver_id" jdbcType="VARCHAR" property="approverId" /> |
||||
|
<result column="flow_id" jdbcType="VARCHAR" property="flowId" /> |
||||
|
<result column="is_approved" jdbcType="INTEGER" property="isApproved" /> |
||||
|
<result column="effective_time" jdbcType="TIMESTAMP" property="effectiveTime" /> |
||||
|
<result column="is_voided" jdbcType="INTEGER" property="isVoided" /> |
||||
|
<result column="is_closed" jdbcType="INTEGER" property="isClosed" /> |
||||
|
<result column="sys_org_code" jdbcType="VARCHAR" property="sysOrgCode" /> |
||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="version" jdbcType="INTEGER" property="version" /> |
||||
|
<result column="ct_company_id" jdbcType="VARCHAR" property="ctCompanyId" /> |
||||
|
<result column="attachment_id" jdbcType="VARCHAR" property="attachmentId" /> |
||||
|
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount" /> |
||||
|
<result column="bill_status" jdbcType="VARCHAR" property="billStatus" /> |
||||
|
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" /> |
||||
|
<result column="lock_amount" jdbcType="DECIMAL" property="lockAmount" /> |
||||
|
<result column="source_no" jdbcType="VARCHAR" property="sourceNo" /> |
||||
|
<result column="is_same_settle" jdbcType="INTEGER" property="isSameSettle" /> |
||||
|
<result column="is_turn_sale" jdbcType="VARCHAR" property="isTurnSale" /> |
||||
|
<result column="logistics_no" jdbcType="VARCHAR" property="logisticsNo" /> |
||||
|
<result column="is_platform_supplier" jdbcType="INTEGER" property="isPlatformSupplier" /> |
||||
|
<result column="sale_no" jdbcType="VARCHAR" property="saleNo" /> |
||||
|
<result column="is_delivery" jdbcType="INTEGER" property="isDelivery" /> |
||||
|
<result column="is_auto" jdbcType="INTEGER" property="isAuto" /> |
||||
|
<result column="attachment" jdbcType="VARCHAR" property="attachment" /> |
||||
|
<result column="bill_proc_status" jdbcType="VARCHAR" property="billProcStatus" /> |
||||
|
<result column="is_ref_stk" jdbcType="INTEGER" property="isRefStk" /> |
||||
|
</resultMap> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, bill_no, stock_io_type, is_rubric, bill_date, source_type, source_id, clerk_id, |
||||
|
handler_id, has_rp, supplier_id, customer_id, remark, approver_id, flow_id, is_approved, |
||||
|
effective_time, is_voided, is_closed, sys_org_code, create_by, create_time, update_by, |
||||
|
update_time, version, ct_company_id, attachment_id, pay_amount, bill_status, total_amount, |
||||
|
lock_amount, source_no, is_same_settle, is_turn_sale, logistics_no, is_platform_supplier, |
||||
|
sale_no, is_delivery, is_auto, attachment, bill_proc_status, is_ref_stk |
||||
|
</sql> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from stk_io_bill |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
||||
|
delete from stk_io_bill |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.base.springcloud.entity.SaleBill"> |
||||
|
insert into stk_io_bill (id, bill_no, stock_io_type, |
||||
|
is_rubric, bill_date, source_type, |
||||
|
source_id, clerk_id, handler_id, |
||||
|
has_rp, supplier_id, customer_id, |
||||
|
remark, approver_id, flow_id, |
||||
|
is_approved, effective_time, is_voided, |
||||
|
is_closed, sys_org_code, create_by, |
||||
|
create_time, update_by, update_time, |
||||
|
version, ct_company_id, attachment_id, |
||||
|
pay_amount, bill_status, total_amount, |
||||
|
lock_amount, source_no, is_same_settle, |
||||
|
is_turn_sale, logistics_no, is_platform_supplier, |
||||
|
sale_no, is_delivery, is_auto, |
||||
|
attachment, bill_proc_status, is_ref_stk |
||||
|
) |
||||
|
values (#{id,jdbcType=VARCHAR}, #{billNo,jdbcType=VARCHAR}, #{stockIoType,jdbcType=VARCHAR}, |
||||
|
#{isRubric,jdbcType=VARCHAR}, #{billDate,jdbcType=TIMESTAMP}, #{sourceType,jdbcType=VARCHAR}, |
||||
|
#{sourceId,jdbcType=VARCHAR}, #{clerkId,jdbcType=VARCHAR}, #{handlerId,jdbcType=VARCHAR}, |
||||
|
#{hasRp,jdbcType=INTEGER}, #{supplierId,jdbcType=VARCHAR}, #{customerId,jdbcType=VARCHAR}, |
||||
|
#{remark,jdbcType=VARCHAR}, #{approverId,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, |
||||
|
#{isApproved,jdbcType=INTEGER}, #{effectiveTime,jdbcType=TIMESTAMP}, #{isVoided,jdbcType=INTEGER}, |
||||
|
#{isClosed,jdbcType=INTEGER}, #{sysOrgCode,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, |
||||
|
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
#{version,jdbcType=INTEGER}, #{ctCompanyId,jdbcType=VARCHAR}, #{attachmentId,jdbcType=VARCHAR}, |
||||
|
#{payAmount,jdbcType=DECIMAL}, #{billStatus,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, |
||||
|
#{lockAmount,jdbcType=DECIMAL}, #{sourceNo,jdbcType=VARCHAR}, #{isSameSettle,jdbcType=INTEGER}, |
||||
|
#{isTurnSale,jdbcType=VARCHAR}, #{logisticsNo,jdbcType=VARCHAR}, #{isPlatformSupplier,jdbcType=INTEGER}, |
||||
|
#{saleNo,jdbcType=VARCHAR}, #{isDelivery,jdbcType=INTEGER}, #{isAuto,jdbcType=INTEGER}, |
||||
|
#{attachment,jdbcType=VARCHAR}, #{billProcStatus,jdbcType=VARCHAR}, #{isRefStk,jdbcType=INTEGER} |
||||
|
) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.base.springcloud.entity.SaleBill"> |
||||
|
insert into stk_io_bill |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="billNo != null"> |
||||
|
bill_no, |
||||
|
</if> |
||||
|
<if test="stockIoType != null"> |
||||
|
stock_io_type, |
||||
|
</if> |
||||
|
<if test="isRubric != null"> |
||||
|
is_rubric, |
||||
|
</if> |
||||
|
<if test="billDate != null"> |
||||
|
bill_date, |
||||
|
</if> |
||||
|
<if test="sourceType != null"> |
||||
|
source_type, |
||||
|
</if> |
||||
|
<if test="sourceId != null"> |
||||
|
source_id, |
||||
|
</if> |
||||
|
<if test="clerkId != null"> |
||||
|
clerk_id, |
||||
|
</if> |
||||
|
<if test="handlerId != null"> |
||||
|
handler_id, |
||||
|
</if> |
||||
|
<if test="hasRp != null"> |
||||
|
has_rp, |
||||
|
</if> |
||||
|
<if test="supplierId != null"> |
||||
|
supplier_id, |
||||
|
</if> |
||||
|
<if test="customerId != null"> |
||||
|
customer_id, |
||||
|
</if> |
||||
|
<if test="remark != null"> |
||||
|
remark, |
||||
|
</if> |
||||
|
<if test="approverId != null"> |
||||
|
approver_id, |
||||
|
</if> |
||||
|
<if test="flowId != null"> |
||||
|
flow_id, |
||||
|
</if> |
||||
|
<if test="isApproved != null"> |
||||
|
is_approved, |
||||
|
</if> |
||||
|
<if test="effectiveTime != null"> |
||||
|
effective_time, |
||||
|
</if> |
||||
|
<if test="isVoided != null"> |
||||
|
is_voided, |
||||
|
</if> |
||||
|
<if test="isClosed != null"> |
||||
|
is_closed, |
||||
|
</if> |
||||
|
<if test="sysOrgCode != null"> |
||||
|
sys_org_code, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
create_by, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time, |
||||
|
</if> |
||||
|
<if test="version != null"> |
||||
|
version, |
||||
|
</if> |
||||
|
<if test="ctCompanyId != null"> |
||||
|
ct_company_id, |
||||
|
</if> |
||||
|
<if test="attachmentId != null"> |
||||
|
attachment_id, |
||||
|
</if> |
||||
|
<if test="payAmount != null"> |
||||
|
pay_amount, |
||||
|
</if> |
||||
|
<if test="billStatus != null"> |
||||
|
bill_status, |
||||
|
</if> |
||||
|
<if test="totalAmount != null"> |
||||
|
total_amount, |
||||
|
</if> |
||||
|
<if test="lockAmount != null"> |
||||
|
lock_amount, |
||||
|
</if> |
||||
|
<if test="sourceNo != null"> |
||||
|
source_no, |
||||
|
</if> |
||||
|
<if test="isSameSettle != null"> |
||||
|
is_same_settle, |
||||
|
</if> |
||||
|
<if test="isTurnSale != null"> |
||||
|
is_turn_sale, |
||||
|
</if> |
||||
|
<if test="logisticsNo != null"> |
||||
|
logistics_no, |
||||
|
</if> |
||||
|
<if test="isPlatformSupplier != null"> |
||||
|
is_platform_supplier, |
||||
|
</if> |
||||
|
<if test="saleNo != null"> |
||||
|
sale_no, |
||||
|
</if> |
||||
|
<if test="isDelivery != null"> |
||||
|
is_delivery, |
||||
|
</if> |
||||
|
<if test="isAuto != null"> |
||||
|
is_auto, |
||||
|
</if> |
||||
|
<if test="attachment != null"> |
||||
|
attachment, |
||||
|
</if> |
||||
|
<if test="billProcStatus != null"> |
||||
|
bill_proc_status, |
||||
|
</if> |
||||
|
<if test="isRefStk != null"> |
||||
|
is_ref_stk, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="billNo != null"> |
||||
|
#{billNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="stockIoType != null"> |
||||
|
#{stockIoType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isRubric != null"> |
||||
|
#{isRubric,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="billDate != null"> |
||||
|
#{billDate,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="sourceType != null"> |
||||
|
#{sourceType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="sourceId != null"> |
||||
|
#{sourceId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="clerkId != null"> |
||||
|
#{clerkId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="handlerId != null"> |
||||
|
#{handlerId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="hasRp != null"> |
||||
|
#{hasRp,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="supplierId != null"> |
||||
|
#{supplierId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="customerId != null"> |
||||
|
#{customerId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="remark != null"> |
||||
|
#{remark,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="approverId != null"> |
||||
|
#{approverId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="flowId != null"> |
||||
|
#{flowId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isApproved != null"> |
||||
|
#{isApproved,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="effectiveTime != null"> |
||||
|
#{effectiveTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="isVoided != null"> |
||||
|
#{isVoided,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="isClosed != null"> |
||||
|
#{isClosed,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="sysOrgCode != null"> |
||||
|
#{sysOrgCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
#{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
#{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
#{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
#{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="version != null"> |
||||
|
#{version,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="ctCompanyId != null"> |
||||
|
#{ctCompanyId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="attachmentId != null"> |
||||
|
#{attachmentId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="payAmount != null"> |
||||
|
#{payAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="billStatus != null"> |
||||
|
#{billStatus,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="totalAmount != null"> |
||||
|
#{totalAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="lockAmount != null"> |
||||
|
#{lockAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="sourceNo != null"> |
||||
|
#{sourceNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isSameSettle != null"> |
||||
|
#{isSameSettle,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="isTurnSale != null"> |
||||
|
#{isTurnSale,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="logisticsNo != null"> |
||||
|
#{logisticsNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isPlatformSupplier != null"> |
||||
|
#{isPlatformSupplier,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="saleNo != null"> |
||||
|
#{saleNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isDelivery != null"> |
||||
|
#{isDelivery,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="isAuto != null"> |
||||
|
#{isAuto,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="attachment != null"> |
||||
|
#{attachment,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="billProcStatus != null"> |
||||
|
#{billProcStatus,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isRefStk != null"> |
||||
|
#{isRefStk,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.base.springcloud.entity.SaleBill"> |
||||
|
update stk_io_bill |
||||
|
<set> |
||||
|
<if test="billNo != null"> |
||||
|
bill_no = #{billNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="stockIoType != null"> |
||||
|
stock_io_type = #{stockIoType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isRubric != null"> |
||||
|
is_rubric = #{isRubric,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="billDate != null"> |
||||
|
bill_date = #{billDate,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="sourceType != null"> |
||||
|
source_type = #{sourceType,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="sourceId != null"> |
||||
|
source_id = #{sourceId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="clerkId != null"> |
||||
|
clerk_id = #{clerkId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="handlerId != null"> |
||||
|
handler_id = #{handlerId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="hasRp != null"> |
||||
|
has_rp = #{hasRp,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="supplierId != null"> |
||||
|
supplier_id = #{supplierId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="customerId != null"> |
||||
|
customer_id = #{customerId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="remark != null"> |
||||
|
remark = #{remark,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="approverId != null"> |
||||
|
approver_id = #{approverId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="flowId != null"> |
||||
|
flow_id = #{flowId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isApproved != null"> |
||||
|
is_approved = #{isApproved,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="effectiveTime != null"> |
||||
|
effective_time = #{effectiveTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="isVoided != null"> |
||||
|
is_voided = #{isVoided,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="isClosed != null"> |
||||
|
is_closed = #{isClosed,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="sysOrgCode != null"> |
||||
|
sys_org_code = #{sysOrgCode,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="version != null"> |
||||
|
version = #{version,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="ctCompanyId != null"> |
||||
|
ct_company_id = #{ctCompanyId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="attachmentId != null"> |
||||
|
attachment_id = #{attachmentId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="payAmount != null"> |
||||
|
pay_amount = #{payAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="billStatus != null"> |
||||
|
bill_status = #{billStatus,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="totalAmount != null"> |
||||
|
total_amount = #{totalAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="lockAmount != null"> |
||||
|
lock_amount = #{lockAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="sourceNo != null"> |
||||
|
source_no = #{sourceNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isSameSettle != null"> |
||||
|
is_same_settle = #{isSameSettle,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="isTurnSale != null"> |
||||
|
is_turn_sale = #{isTurnSale,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="logisticsNo != null"> |
||||
|
logistics_no = #{logisticsNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isPlatformSupplier != null"> |
||||
|
is_platform_supplier = #{isPlatformSupplier,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="saleNo != null"> |
||||
|
sale_no = #{saleNo,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isDelivery != null"> |
||||
|
is_delivery = #{isDelivery,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="isAuto != null"> |
||||
|
is_auto = #{isAuto,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="attachment != null"> |
||||
|
attachment = #{attachment,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="billProcStatus != null"> |
||||
|
bill_proc_status = #{billProcStatus,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="isRefStk != null"> |
||||
|
is_ref_stk = #{isRefStk,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.base.springcloud.entity.SaleBill"> |
||||
|
update stk_io_bill |
||||
|
set bill_no = #{billNo,jdbcType=VARCHAR}, |
||||
|
stock_io_type = #{stockIoType,jdbcType=VARCHAR}, |
||||
|
is_rubric = #{isRubric,jdbcType=VARCHAR}, |
||||
|
bill_date = #{billDate,jdbcType=TIMESTAMP}, |
||||
|
source_type = #{sourceType,jdbcType=VARCHAR}, |
||||
|
source_id = #{sourceId,jdbcType=VARCHAR}, |
||||
|
clerk_id = #{clerkId,jdbcType=VARCHAR}, |
||||
|
handler_id = #{handlerId,jdbcType=VARCHAR}, |
||||
|
has_rp = #{hasRp,jdbcType=INTEGER}, |
||||
|
supplier_id = #{supplierId,jdbcType=VARCHAR}, |
||||
|
customer_id = #{customerId,jdbcType=VARCHAR}, |
||||
|
remark = #{remark,jdbcType=VARCHAR}, |
||||
|
approver_id = #{approverId,jdbcType=VARCHAR}, |
||||
|
flow_id = #{flowId,jdbcType=VARCHAR}, |
||||
|
is_approved = #{isApproved,jdbcType=INTEGER}, |
||||
|
effective_time = #{effectiveTime,jdbcType=TIMESTAMP}, |
||||
|
is_voided = #{isVoided,jdbcType=INTEGER}, |
||||
|
is_closed = #{isClosed,jdbcType=INTEGER}, |
||||
|
sys_org_code = #{sysOrgCode,jdbcType=VARCHAR}, |
||||
|
create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
version = #{version,jdbcType=INTEGER}, |
||||
|
ct_company_id = #{ctCompanyId,jdbcType=VARCHAR}, |
||||
|
attachment_id = #{attachmentId,jdbcType=VARCHAR}, |
||||
|
pay_amount = #{payAmount,jdbcType=DECIMAL}, |
||||
|
bill_status = #{billStatus,jdbcType=VARCHAR}, |
||||
|
total_amount = #{totalAmount,jdbcType=DECIMAL}, |
||||
|
lock_amount = #{lockAmount,jdbcType=DECIMAL}, |
||||
|
source_no = #{sourceNo,jdbcType=VARCHAR}, |
||||
|
is_same_settle = #{isSameSettle,jdbcType=INTEGER}, |
||||
|
is_turn_sale = #{isTurnSale,jdbcType=VARCHAR}, |
||||
|
logistics_no = #{logisticsNo,jdbcType=VARCHAR}, |
||||
|
is_platform_supplier = #{isPlatformSupplier,jdbcType=INTEGER}, |
||||
|
sale_no = #{saleNo,jdbcType=VARCHAR}, |
||||
|
is_delivery = #{isDelivery,jdbcType=INTEGER}, |
||||
|
is_auto = #{isAuto,jdbcType=INTEGER}, |
||||
|
attachment = #{attachment,jdbcType=VARCHAR}, |
||||
|
bill_proc_status = #{billProcStatus,jdbcType=VARCHAR}, |
||||
|
is_ref_stk = #{isRefStk,jdbcType=INTEGER} |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
|
||||
|
<!-- 销售单据查询 --> |
||||
|
<select id="queryBillInfo" parameterType="com.base.springcloud.entity.SaleBill" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from stk_io_bill |
||||
|
where bill_no = #{billNo,jdbcType=VARCHAR} |
||||
|
</select> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue