From 8bc844ae73ae5a269d193d362c39d923880074cc Mon Sep 17 00:00:00 2001 From: zhaoxl Date: Fri, 18 Aug 2023 17:19:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20'op-modules/op-quality/src/main/java/com/op/quality/service/?= =?UTF-8?q?serviceImpl'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../serviceImpl/QcProCheckServiceImpl.java | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java new file mode 100644 index 00000000..d91ee1eb --- /dev/null +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl/QcProCheckServiceImpl.java @@ -0,0 +1,92 @@ +package com.op.quality.service.serviceImpl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; +import com.op.common.core.domain.R; +//import com.op.quality.domain.BaseFile; +import com.op.quality.domain.BaseFile; +import com.op.quality.domain.QcProCheck; +//import com.op.quality.mapper.BaseFileMapper; +import com.op.quality.mapper.BaseFileMapper; +import com.op.quality.mapper.QcProCheckMapper; +import com.op.quality.service.QcProCheckService; +import com.sap.conn.jco.JCoException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * @ClassName : quaServiceImpl + * @Description : + * @Author : + * @Date: 2023-08-17 10:28 + */ +@Service +public class QcProCheckServiceImpl implements QcProCheckService { + @Autowired + private QcProCheckMapper qcProCheckMapper; + @Autowired + private BaseFileMapper baseFileMapper; + + @Override +// @DS("#header.poolName") + public List selectQcProCheck() { + return qcProCheckMapper.selectQcProCheckList(); + } + + @Override +// @DS("#header.poolName") + public R saveQcProCheck(QcProCheck qcProCheck, BaseFile baseFile) { + DynamicDataSourceContextHolder.push("op_xiaolan"); + + qcProCheck.setId(UUID.randomUUID().toString().replace("-", "")); + if (baseFile.getFileAddress()==null){ + + qcProCheckMapper.insertQcProCheck(qcProCheck); + } + else { + baseFile.setFileId(UUID.randomUUID().toString().replace("-", "")); + qcProCheck.setFileId(baseFile.getFileId()); + qcProCheckMapper.insertQcProCheck(qcProCheck); + baseFileMapper.insertBaseFile(baseFile); + } + + return R.ok(true); + } + + + @Override +// @DS("#header.poolName") + public int updateQcProCheck(String id) { + return qcProCheckMapper.updateQcProCheckById(id); + } + + @Override +// @DS("#header.poolName") + public int deleteQcProCheck(String id) { + return qcProCheckMapper.deleteQcProCheckById(id); + } + +// public static void main(String[] args)throws JCoException{ +// QcProCheck qcProCheck = new QcProCheck(); +// qcProCheck.setId("1111"); +// qcProCheck.setMachineId("2222"); +// BaseFile baseFile = new BaseFile(); +// baseFile.setFileId("11112"); +// Map map = new HashMap(); +//// map.put(qcProCheck,baseFile); +// QcProCheck qc2 = new QcProCheck(); +// BaseFile b2 = new BaseFile(); +//// qc2 = map.keySet().iterator().next(); +//// b2 = map.get(qc2); +// map.put(qc2,null); +// System.out.println(map); +// +// +// } + +}