添加打印日志

This commit is contained in:
牛叉闪闪
2024-07-25 15:49:44 +08:00
parent e91ae3bd8d
commit 1bf12d880c
4 changed files with 570 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.tbHandover;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface tbHandoverMapper {
int deleteByPrimaryKey(Integer id);
int insert(tbHandover record);
int insertSelective(tbHandover record);
tbHandover selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(tbHandover record);
int updateByPrimaryKey(tbHandover record);
}

View File

@@ -0,0 +1,238 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class tbHandover implements Serializable {
private Integer id;
private String tradeDay;
private String printNo;
private Integer dutyId;
private Integer shopId;
private String merchantName;
private String startTime;
private String endTime;
private Integer staffId;
private String staffName;
private String payInfos;
private String memberData;
private String productCategories;
private String totalAmount;
private String imprest;
private String payable;
private String handIn;
private String returnAmount;
private String orderNum;
private String quickAmount;
private String productInfoPos;
private String productInfos;
private Date createTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTradeDay() {
return tradeDay;
}
public void setTradeDay(String tradeDay) {
this.tradeDay = tradeDay == null ? null : tradeDay.trim();
}
public String getPrintNo() {
return printNo;
}
public void setPrintNo(String printNo) {
this.printNo = printNo == null ? null : printNo.trim();
}
public Integer getDutyId() {
return dutyId;
}
public void setDutyId(Integer dutyId) {
this.dutyId = dutyId;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public String getMerchantName() {
return merchantName;
}
public void setMerchantName(String merchantName) {
this.merchantName = merchantName == null ? null : merchantName.trim();
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime == null ? null : startTime.trim();
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime == null ? null : endTime.trim();
}
public Integer getStaffId() {
return staffId;
}
public void setStaffId(Integer staffId) {
this.staffId = staffId;
}
public String getStaffName() {
return staffName;
}
public void setStaffName(String staffName) {
this.staffName = staffName == null ? null : staffName.trim();
}
public String getPayInfos() {
return payInfos;
}
public void setPayInfos(String payInfos) {
this.payInfos = payInfos == null ? null : payInfos.trim();
}
public String getMemberData() {
return memberData;
}
public void setMemberData(String memberData) {
this.memberData = memberData == null ? null : memberData.trim();
}
public String getProductCategories() {
return productCategories;
}
public void setProductCategories(String productCategories) {
this.productCategories = productCategories == null ? null : productCategories.trim();
}
public String getTotalAmount() {
return totalAmount;
}
public void setTotalAmount(String totalAmount) {
this.totalAmount = totalAmount == null ? null : totalAmount.trim();
}
public String getImprest() {
return imprest;
}
public void setImprest(String imprest) {
this.imprest = imprest == null ? null : imprest.trim();
}
public String getPayable() {
return payable;
}
public void setPayable(String payable) {
this.payable = payable == null ? null : payable.trim();
}
public String getHandIn() {
return handIn;
}
public void setHandIn(String handIn) {
this.handIn = handIn == null ? null : handIn.trim();
}
public String getReturnAmount() {
return returnAmount;
}
public void setReturnAmount(String returnAmount) {
this.returnAmount = returnAmount == null ? null : returnAmount.trim();
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum == null ? null : orderNum.trim();
}
public String getQuickAmount() {
return quickAmount;
}
public void setQuickAmount(String quickAmount) {
this.quickAmount = quickAmount == null ? null : quickAmount.trim();
}
public String getProductInfoPos() {
return productInfoPos;
}
public void setProductInfoPos(String productInfoPos) {
this.productInfoPos = productInfoPos == null ? null : productInfoPos.trim();
}
public String getProductInfos() {
return productInfos;
}
public void setProductInfos(String productInfos) {
this.productInfos = productInfos == null ? null : productInfos.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@@ -197,18 +197,18 @@ public class PrinterUtils {
char paddingCharacter = ' ';
sb.append("<S> "+String.format("%-18s","品名").replace(' ', paddingCharacter)+String.format("%-4s","数量").replace(' ', paddingCharacter)+"</S><BR>");
sb.append("<S> 品名"+String.format("%22s","数量").replace(' ', paddingCharacter)+"</S><BR>");
for (ProductInfo productInfo : handoverInfo.getProductInfos()) {
if(productInfo.getProductName().length()>=16){
if(productInfo.getProductName().length()>=14){
sb.append("<S> "+productInfo.getProductName()+"</S><BR>");
sb.append("<S> "+String.format("%22s",productInfo.getNum()).replace(' ', paddingCharacter)+"</S><BR>");
sb.append("<S> "+String.format("%27s",productInfo.getNum()).replace(' ', paddingCharacter)+"</S><BR>");
}else {
int tt=21-productInfo.getProductName().length();
sb.append("<S> "+String.format("%-"+tt+"s",productInfo.getProductName()).replace(' ', paddingCharacter)+String.format("%-4s",productInfo.getNum()).replace(' ', paddingCharacter)+"</S><BR>");
int tt=22-productInfo.getProductName().length();
sb.append("<S> "+productInfo.getProductName()+String.format("%"+tt+"s",productInfo.getNum()).replace(' ', paddingCharacter)+"</S><BR>");
}
sb.append("<BR>");
}