From c2fa05e374856644788e7604daab44de16a5ae65 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 08 十二月 2022 15:16:44 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/service/erp/ErpService.java | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/zy/common/service/erp/ErpService.java b/src/main/java/com/zy/common/service/erp/ErpService.java
index 92f979b..d6fc76f 100644
--- a/src/main/java/com/zy/common/service/erp/ErpService.java
+++ b/src/main/java/com/zy/common/service/erp/ErpService.java
@@ -1,6 +1,7 @@
package com.zy.common.service.erp;
import com.core.common.Cools;
+import com.core.common.DateUtils;
import com.zy.common.service.erp.dto.VoucherDto;
import com.zy.common.service.erp.entity.Goods;
import com.zy.common.service.erp.entity.Voucher;
@@ -12,6 +13,7 @@
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
/**
@@ -32,7 +34,7 @@
* 鑾峰彇GOODS琛�
*/
public List<Goods> selectGoods(Integer state) {
- String sql = "select * from Goods where 1=1 where state = '" + state + "'";
+ String sql = "select * from Goods where state = '" + state + "'";
return erpSqlServer.select(sql, Goods.class);
}
@@ -60,7 +62,7 @@
* 鑾峰彇Voucher琛�
*/
public List<Voucher> selectVoucher(Integer state) {
- String sql = "select * from Voucher where 1=1 where state = '" + state + "'";
+ String sql = "select * from Voucher where state = '" + state + "'";
return erpSqlServer.select(sql, Voucher.class);
}
@@ -68,7 +70,7 @@
* 鑾峰彇VoucherDetail琛�
*/
public List<VoucherDetail> selectVoucherDetail(String VoucherID) {
- String sql = "select * from VoucherDetail where 1=1 where VoucherID = '" + VoucherID + "'";
+ String sql = "select * from VoucherDetail where VoucherID = '" + VoucherID + "'";
return erpSqlServer.select(sql, VoucherDetail.class);
}
@@ -77,8 +79,8 @@
* 淇敼 Goods 琛� state
*/
public boolean updateStateForGoods(String barcode, Integer state){
- String sql = "update Goods set State = ''{1}' where BarCode = ''{0}''";
- sql = MessageFormat.format(sql, barcode, state);
+ String sql = "update Goods set State = ''{1}'', LastUpdatedDate = ''{2}'' where BarCode = ''{0}''";
+ sql = MessageFormat.format(sql, barcode, state, DateUtils.convert(new Date()));
return erpSqlServer.update(sql) > 0;
}
--
Gitblit v1.9.1