上传文件至 'op-modules/op-quality/src/main/java/com/op/quality/service/serviceImpl'

highway
zhaoxl 1 year ago
parent 992613c54e
commit 8bc844ae73

@ -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<QcProCheck> selectQcProCheck() {
return qcProCheckMapper.selectQcProCheckList();
}
@Override
// @DS("#header.poolName")
public R<Boolean> 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<QcProCheck,BaseFile> map = new HashMap<QcProCheck,BaseFile>();
//// 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);
//
//
// }
}
Loading…
Cancel
Save