|
@@ -155,7 +155,15 @@ public class DataCollectController {
|
|
|
|
|
|
@RequestMapping("/getSqlServerDataSum")
|
|
@RequestMapping("/getSqlServerDataSum")
|
|
public String getSqlServerDataSum() {
|
|
public String getSqlServerDataSum() {
|
|
- String sqlCount = "select count(*) from mom_orderdetail where status in (3,4) ";
|
|
|
|
|
|
+// String sqlCount = "select count(*) from mom_orderdetail where status in (3,4) ";
|
|
|
|
+ String sqlCount = "select count(*) " +
|
|
|
|
+ "from ( " +
|
|
|
|
+ " select mo.cbSysBarCode,SUBSTRING(mo.cbSysBarCode, 8, 15) as orderId,mo.Define24,mo.Define25 " +
|
|
|
|
+ " ,RIGHT(mo.cbSysBarCode,1) as line,mo.Status,cb.cDeptID,cb.cDepName,mo.MoDId " +
|
|
|
|
+ " from mom_orderdetail mo " +
|
|
|
|
+ " left join ca_batchmap cb on SUBSTRING(mo.cbSysBarCode, 8, 15) = cb.cMOCode and RIGHT(mo.cbSysBarCode,1) = cb.iMOSubSN " +
|
|
|
|
+ " where mo.Status in (3,4) " +
|
|
|
|
+ " )tmp ";
|
|
int totalCount = 0;
|
|
int totalCount = 0;
|
|
try (Connection connection = sqlServerDataSource.getConnection()) {
|
|
try (Connection connection = sqlServerDataSource.getConnection()) {
|
|
PreparedStatement countStmt = connection.prepareStatement(sqlCount);
|
|
PreparedStatement countStmt = connection.prepareStatement(sqlCount);
|
|
@@ -172,10 +180,16 @@ public class DataCollectController {
|
|
|
|
|
|
@RequestMapping("/getSqlServerDataList")
|
|
@RequestMapping("/getSqlServerDataList")
|
|
public List<ErpOrderInfo> getSqlServerData(@RequestBody PageBO pageBO) {
|
|
public List<ErpOrderInfo> getSqlServerData(@RequestBody PageBO pageBO) {
|
|
- String sqlQuery = " select MoDId ,SUBSTRING(cbSysBarCode, 8, 15) as orderId,Define24 as projectId,Define25 as projectName,RIGHT(cbSysBarCode,1) as line,status,relsdate " +
|
|
|
|
- " from mom_orderdetail " +
|
|
|
|
- " where status in (3,4) "
|
|
|
|
- +" ORDER BY MoDId OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
|
|
|
|
|
|
+// String sqlQuery = " select MoDId ,SUBSTRING(cbSysBarCode, 8, 15) as orderId,Define24 as projectId,Define25 as projectName,RIGHT(cbSysBarCode,1) as line,status,relsdate " +
|
|
|
|
+// " from mom_orderdetail " +
|
|
|
|
+// " where status in (3,4) "
|
|
|
|
+// +" ORDER BY MoDId OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
|
|
|
|
+ String sqlQuery = "select mo.cbSysBarCode,SUBSTRING(mo.cbSysBarCode, 8, 15) as orderId,mo.Define24,mo.Define25 " +
|
|
|
|
+ " ,RIGHT(mo.cbSysBarCode,1) as line,mo.Status,cb.cDeptID,cb.cDepName,mo.MoDId " +
|
|
|
|
+ " from mom_orderdetail mo " +
|
|
|
|
+ " left join ca_batchmap cb on SUBSTRING(mo.cbSysBarCode, 8, 15) = cb.cMOCode and RIGHT(mo.cbSysBarCode,1) = cb.iMOSubSN " +
|
|
|
|
+ " where mo.Status in (3,4) " +
|
|
|
|
+ " ORDER BY mo.MoDId OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ";
|
|
List<ErpOrderInfo> resList = new ArrayList<>();
|
|
List<ErpOrderInfo> resList = new ArrayList<>();
|
|
SimpleDateFormat sdfAll = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
SimpleDateFormat sdfAll = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
try (Connection connection = sqlServerDataSource.getConnection()) {
|
|
try (Connection connection = sqlServerDataSource.getConnection()) {
|
|
@@ -194,6 +208,8 @@ public class DataCollectController {
|
|
erpOrderInfo.setLine(resultSet.getInt("line"));
|
|
erpOrderInfo.setLine(resultSet.getInt("line"));
|
|
erpOrderInfo.setStatus(resultSet.getInt("status"));
|
|
erpOrderInfo.setStatus(resultSet.getInt("status"));
|
|
erpOrderInfo.setRelsDate(resultSet.getDate("relsdate"));
|
|
erpOrderInfo.setRelsDate(resultSet.getDate("relsdate"));
|
|
|
|
+ erpOrderInfo.setDeptId(resultSet.getString("cDeptID"));
|
|
|
|
+ erpOrderInfo.setDeptName(resultSet.getString("cDepName"));
|
|
resList.add(erpOrderInfo);
|
|
resList.add(erpOrderInfo);
|
|
}
|
|
}
|
|
}
|
|
}
|