|
|
@@ -30,16 +30,19 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
@Value("${spring.datasource.username}")
|
|
|
private String username;
|
|
|
|
|
|
+ String Master;
|
|
|
+
|
|
|
@Override
|
|
|
public List<Map<Object,Object>> snStepPass(String accessKey, String requestId, String data) {
|
|
|
String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
List<Map<Object, Object>> maps = BaseUtil.parseGridStoreToMaps(data);
|
|
|
SpObserver.putSp(AE_MASTER);
|
|
|
+ Master=SpObserver.getSp();
|
|
|
List<Map<Object, Object>> relist = new ArrayList<>();
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_STEPPASSED where sp_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("SP_ID"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_STEPPASSED where sp_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("SP_ID"));
|
|
|
remap.put("id",map.get("SP_ID"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -51,7 +54,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_STEPPASSED"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_STEPPASSED"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -76,7 +79,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_SNINFO where SI_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("SI_ID"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_SNINFO where SI_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("SI_ID"));
|
|
|
remap.put("id",map.get("SI_ID"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -88,7 +91,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_SNINFO"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_SNINFO"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -111,7 +114,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_MAKESNRELATION where ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("ID"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_MAKESNRELATION where ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("ID"));
|
|
|
remap.put("id",map.get("ID"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -123,7 +126,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_MAKESNRELATION"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_MAKESNRELATION"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -146,7 +149,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_MAKEBAD where MB_CODE=? and nvl(t_status,'W')='W' ",Integer.class,map.get("MB_CODE"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_MAKEBAD where MB_CODE=? and nvl(t_status,'W')='W' ",Integer.class,map.get("MB_CODE"));
|
|
|
remap.put("id",map.get("MB_CODE"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -158,7 +161,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_MAKEBAD"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_MAKEBAD"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -181,7 +184,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_MAKEBADREASON where MBR_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("MBR_ID"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_MAKEBADREASON where MBR_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("MBR_ID"));
|
|
|
remap.put("id",map.get("MBR_ID"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -193,7 +196,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_MAKEBADREASON"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_MAKEBADREASON"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -216,7 +219,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_PACKAGEDETAIL where PD_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("MBR_ID"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_PACKAGEDETAIL where PD_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("MBR_ID"));
|
|
|
remap.put("id",map.get("PD_ID"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -228,7 +231,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_PACKAGEDETAIL"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_PACKAGEDETAIL"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -251,7 +254,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_CRAFTMATERIAL where cm_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("cm_id"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_CRAFTMATERIAL where cm_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("cm_id"));
|
|
|
remap.put("id",map.get("cm_id"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -263,7 +266,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_CRAFTMATERIAL"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_CRAFTMATERIAL"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -286,7 +289,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_OQCBATCHDETAIL where obd_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("obd_id"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".TEMP_OQCBATCHDETAIL where obd_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("obd_id"));
|
|
|
remap.put("id",map.get("obd_id"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -298,7 +301,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_OQCBATCHDETAIL"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_OQCBATCHDETAIL"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -321,7 +324,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from temp_inspectdata where id_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("id_id"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".temp_inspectdata where id_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("id_id"));
|
|
|
remap.put("id",map.get("id_id"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -333,7 +336,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"temp_inspectdata"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".temp_inspectdata"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -356,7 +359,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from temp_prodiomac where pim_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("pim_id"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".temp_prodiomac where pim_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("pim_id"));
|
|
|
remap.put("id",map.get("pim_id"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -368,7 +371,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"temp_prodiomac"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".temp_prodiomac"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -391,7 +394,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from temp_oqcitemsamples where OIS_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("OIS_ID"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".temp_oqcitemsamples where OIS_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("OIS_ID"));
|
|
|
remap.put("id",map.get("OIS_ID"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -403,7 +406,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_OQCITEMSAMPLES"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".TEMP_OQCITEMSAMPLES"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -426,7 +429,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
Map<Object, Object> remap = new HashMap<>();
|
|
|
String remark = "";
|
|
|
- int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from temp_makeserial where ms_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("ms_id"));
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from "+Master+".temp_makeserial where ms_id=? and nvl(t_status,'W')='W' ",Integer.class,map.get("ms_id"));
|
|
|
remap.put("id",map.get("ms_id"));
|
|
|
if(cn>0){
|
|
|
map.put("T_STATUS","D");
|
|
|
@@ -438,7 +441,7 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
try {
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(map,"temp_makeserial"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,Master+".temp_makeserial"));
|
|
|
remap.put("result","OK");
|
|
|
remap.put("remark",remark);
|
|
|
}catch (Exception e){
|
|
|
@@ -481,13 +484,13 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
mapb.put("BAR_BATCHQTY",mp.get("bar_batchqty"));
|
|
|
datab.add(mapb);
|
|
|
}
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlbyGridStore(datab,"TEMP_BARCODE"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlbyGridStore(datab,Master+".TEMP_BARCODE"));
|
|
|
}else if("DEL".equals(map.get("action"))){
|
|
|
Map<Object,Object> mapb = new HashMap<>();
|
|
|
mapb.put("ACTION","D");
|
|
|
mapb.put("ERPID",0);
|
|
|
mapb.put("BAR_OUTNO",map.get("outno"));
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlByMap(mapb,"TEMP_BARCODE"));
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(mapb,Master+".TEMP_BARCODE"));
|
|
|
}else{
|
|
|
return ApiResponse.failRsp(ErrorMessage.BUSINESS_ILLEGAL.getCode(),requestId,"传参操作类型:"+map.get("action")+"错误,只能是ADD或者DEL");
|
|
|
}
|