|
@@ -5,6 +5,7 @@ import com.management.collectdata.entity.bo.PageBO;
|
|
|
import com.zaxxer.hikari.HikariConfig;
|
|
|
import com.zaxxer.hikari.HikariDataSource;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -66,6 +67,33 @@ public class DataCollectController {
|
|
|
// @Autowired
|
|
|
// private ErpOrderInfoMapper erpOrderInfoMapper;
|
|
|
|
|
|
+ @RequestMapping("/insertCisData")
|
|
|
+ public String insertCisData(@RequestBody List<TisTimeVO> tisList) {
|
|
|
+// List<TisTimeVO> tisTimeVOS = JSONArray.parseArray(jsonarray, TisTimeVO.class);
|
|
|
+ if(!CollectionUtils.isEmpty(tisList)){
|
|
|
+ for (TisTimeVO tisTimeVO : tisList) {
|
|
|
+ try (Connection connection = sqlServerDataSource.getConnection()) {
|
|
|
+ String sqlInsert = "insert into CA_DayTiS(cPPID,iRealWkt,dDate) values(?,?,?)";
|
|
|
+ PreparedStatement insertStmt = connection.prepareStatement(sqlInsert);
|
|
|
+ insertStmt.setString(1,tisTimeVO.getCoId());
|
|
|
+ insertStmt.setBigDecimal(2,tisTimeVO.getWorkTime());
|
|
|
+ insertStmt.setString(3,tisTimeVO.getDateStr());
|
|
|
+ int i = insertStmt.executeUpdate();
|
|
|
+ if(i>0){
|
|
|
+// System.out.println("执行成功");
|
|
|
+ }else{
|
|
|
+ System.out.println(tisTimeVO.getCoId()+"执行失败");
|
|
|
+ }
|
|
|
+ } catch (SQLException e) {
|
|
|
+ System.err.println("数据库操作错误: " + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@RequestMapping("/getSqlServerProjectTypeDataSum")
|
|
|
public String getSqlServerProjectTypeDataSum() {
|
|
|
String sqlCount = "select count(distinct citemccode) from fitemss97 where bclose = 0";
|