|
|
@@ -17,6 +17,8 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.sql.Timestamp;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -30,79 +32,215 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
private String username;
|
|
|
|
|
|
@Override
|
|
|
- public String snStepPass(String accessKey, String requestId, String data) {
|
|
|
+ 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);
|
|
|
+ List<Map<Object, Object>> relist = new ArrayList<>();
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
- map.put("T_STATUS","W");
|
|
|
+ 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"));
|
|
|
+ remap.put("id",map.get("SP_ID"));
|
|
|
+ if(cn>0){
|
|
|
+ map.put("T_STATUS","D");
|
|
|
+ map.put("T_REMAKR","重复");
|
|
|
+ remark = "重复";
|
|
|
+ }else{
|
|
|
+ map.put("T_STATUS","W");
|
|
|
+ }
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
+ try {
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_STEPPASSED"));
|
|
|
+ remap.put("result","OK");
|
|
|
+ remap.put("remark",remark);
|
|
|
+ }catch (Exception e){
|
|
|
+ remap.put("result","NG");
|
|
|
+ remap.put("remark",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ relist.add(remap);
|
|
|
}
|
|
|
- SpObserver.putSp(AE_MASTER);
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlbyGridStore(maps, "TEMP_STEPPASSED"));
|
|
|
- baseDao.execute("update temp_steppassed set t_status='D',T_REMAKR='重复' where t_id in (select t_id from (select temp_steppassed.*,row_number()over(partition by sp_id order by t_id desc) cn from temp_steppassed where nvl(t_status,'W')='W' ) where cn>1)");
|
|
|
+ //baseDao.execute(SqlUtil.getInsertSqlbyGridStore(maps, "TEMP_STEPPASSED"));
|
|
|
+ //baseDao.execute("update temp_steppassed set t_status='D',T_REMAKR='重复' where t_id in (select t_id from (select temp_steppassed.*,row_number()over(partition by sp_id order by t_id desc) cn from temp_steppassed where nvl(t_status,'W')='W' ) where cn>1)");
|
|
|
SpObserver.putSp(username);
|
|
|
- return null;
|
|
|
+ return relist;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void snInfo(String accessKey, String requestId, String data) {
|
|
|
+ public List<Map<Object,Object>> snInfo(String accessKey, String requestId, String data) {
|
|
|
String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
List<Map<Object, Object>> maps = BaseUtil.parseGridStoreToMaps(data);
|
|
|
+ SpObserver.putSp(AE_MASTER);
|
|
|
+ List<Map<Object, Object>> relist = new ArrayList<>();
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
- map.put("T_STATUS","W");
|
|
|
+ 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"));
|
|
|
+ remap.put("id",map.get("SI_ID"));
|
|
|
+ if(cn>0){
|
|
|
+ map.put("T_STATUS","D");
|
|
|
+ map.put("T_REMAKR","重复");
|
|
|
+ remark = "重复";
|
|
|
+ }else{
|
|
|
+ map.put("T_STATUS","W");
|
|
|
+ }
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
+ try {
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_SNINFO"));
|
|
|
+ remap.put("result","OK");
|
|
|
+ remap.put("remark",remark);
|
|
|
+ }catch (Exception e){
|
|
|
+ remap.put("result","NG");
|
|
|
+ remap.put("remark",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ relist.add(remap);
|
|
|
}
|
|
|
- SpObserver.putSp(AE_MASTER);
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlbyGridStore(maps, "TEMP_MAKEBAD"));
|
|
|
- baseDao.execute("update temp_snInfo set t_status='D',T_REMAKR='重复' where t_id in (select t_id from (select temp_snInfo.*,row_number()over(partition by si_id order by t_id desc) cn from temp_snInfo where nvl(t_status,'W')='W' ) where cn>1)");
|
|
|
SpObserver.putSp(username);
|
|
|
+ return relist;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void makeSnRelation(String accessKey, String requestId, String data) {
|
|
|
+ public List<Map<Object,Object>> makeSnRelation(String accessKey, String requestId, String data) {
|
|
|
String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
List<Map<Object, Object>> maps = BaseUtil.parseGridStoreToMaps(data);
|
|
|
+ SpObserver.putSp(AE_MASTER);
|
|
|
+ List<Map<Object, Object>> relist = new ArrayList<>();
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
- map.put("T_STATUS","W");
|
|
|
+ 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"));
|
|
|
+ remap.put("id",map.get("ID"));
|
|
|
+ if(cn>0){
|
|
|
+ map.put("T_STATUS","D");
|
|
|
+ map.put("T_REMAKR","重复");
|
|
|
+ remark = "重复";
|
|
|
+ }else{
|
|
|
+ map.put("T_STATUS","W");
|
|
|
+ }
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
+ try {
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_MAKESNRELATION"));
|
|
|
+ remap.put("result","OK");
|
|
|
+ remap.put("remark",remark);
|
|
|
+ }catch (Exception e){
|
|
|
+ remap.put("result","NG");
|
|
|
+ remap.put("remark",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ relist.add(remap);
|
|
|
}
|
|
|
- SpObserver.putSp(AE_MASTER);
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlbyGridStore(maps, "TEMP_MAKESNRELATION"));
|
|
|
- baseDao.execute("update TEMP_MAKESNRELATION set t_status='D',T_REMAKR='重复' where t_id in (select t_id from (select TEMP_MAKESNRELATION.*,row_number()over(partition by id order by t_id desc) cn from TEMP_MAKESNRELATION where nvl(t_status,'W')='W' ) where cn>1)");
|
|
|
SpObserver.putSp(username);
|
|
|
+ return relist;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void MAKEBAD(String accessKey, String requestId, String data) {
|
|
|
+ public List<Map<Object,Object>> MAKEBAD(String accessKey, String requestId, String data) {
|
|
|
String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
List<Map<Object, Object>> maps = BaseUtil.parseGridStoreToMaps(data);
|
|
|
+ SpObserver.putSp(AE_MASTER);
|
|
|
+ List<Map<Object, Object>> relist = new ArrayList<>();
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
- map.put("T_STATUS","W");
|
|
|
+ Map<Object, Object> remap = new HashMap<>();
|
|
|
+ String remark = "";
|
|
|
+ int cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from TEMP_MAKEBAD where MB_ID=? and nvl(t_status,'W')='W' ",Integer.class,map.get("MB_ID"));
|
|
|
+ remap.put("id",map.get("MB_ID"));
|
|
|
+ if(cn>0){
|
|
|
+ map.put("T_STATUS","D");
|
|
|
+ map.put("T_REMAKR","重复");
|
|
|
+ remark = "重复";
|
|
|
+ }else{
|
|
|
+ map.put("T_STATUS","W");
|
|
|
+ }
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
+ try {
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_MAKEBAD"));
|
|
|
+ remap.put("result","OK");
|
|
|
+ remap.put("remark",remark);
|
|
|
+ }catch (Exception e){
|
|
|
+ remap.put("result","NG");
|
|
|
+ remap.put("remark",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ relist.add(remap);
|
|
|
}
|
|
|
- SpObserver.putSp(AE_MASTER);
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlbyGridStore(maps, "TEMP_MAKEBAD"));
|
|
|
- baseDao.execute("update TEMP_MAKEBAD set t_status='D',T_REMAKR='重复' where t_id in (select t_id from (select TEMP_MAKEBAD.*,row_number()over(partition by mb_id order by t_id desc) cn from TEMP_MAKEBAD where nvl(t_status,'W')='W' ) where cn>1)");
|
|
|
SpObserver.putSp(username);
|
|
|
+ return relist;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void makeBadReason(String accessKey, String requestId, String data) {
|
|
|
+ public List<Map<Object,Object>> makeBadReason(String accessKey, String requestId, String data) {
|
|
|
String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
List<Map<Object, Object>> maps = BaseUtil.parseGridStoreToMaps(data);
|
|
|
+ SpObserver.putSp(AE_MASTER);
|
|
|
+ List<Map<Object, Object>> relist = new ArrayList<>();
|
|
|
for (Map<Object, Object> map : maps) {
|
|
|
- map.put("T_STATUS","W");
|
|
|
+ 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"));
|
|
|
+ remap.put("id",map.get("MBR_ID"));
|
|
|
+ if(cn>0){
|
|
|
+ map.put("T_STATUS","D");
|
|
|
+ map.put("T_REMAKR","重复");
|
|
|
+ remark = "重复";
|
|
|
+ }else{
|
|
|
+ map.put("T_STATUS","W");
|
|
|
+ }
|
|
|
map.put("T_KEY",accessKey);
|
|
|
map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
+ try {
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_MAKEBADREASON"));
|
|
|
+ remap.put("result","OK");
|
|
|
+ remap.put("remark",remark);
|
|
|
+ }catch (Exception e){
|
|
|
+ remap.put("result","NG");
|
|
|
+ remap.put("remark",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ relist.add(remap);
|
|
|
}
|
|
|
+ SpObserver.putSp(username);
|
|
|
+ return relist;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<Object,Object>> packageDetail(String accessKey, String requestId, String data) {
|
|
|
+ String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
+ List<Map<Object, Object>> maps = BaseUtil.parseGridStoreToMaps(data);
|
|
|
SpObserver.putSp(AE_MASTER);
|
|
|
- baseDao.execute(SqlUtil.getInsertSqlbyGridStore(maps, "TEMP_makeBadReason"));
|
|
|
- baseDao.execute("update TEMP_makeBadReason set t_status='D',T_REMAKR='重复' where t_id in (select t_id from (select TEMP_makeBadReason.*,row_number()over(partition by mbr_id order by t_id desc) cn from TEMP_makeBadReason where nvl(t_status,'W')='W' ) where cn>1)");
|
|
|
+ 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_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");
|
|
|
+ map.put("T_REMAKR","重复");
|
|
|
+ remark = "重复";
|
|
|
+ }else{
|
|
|
+ map.put("T_STATUS","W");
|
|
|
+ }
|
|
|
+ map.put("T_KEY",accessKey);
|
|
|
+ map.put("T_INDATE", Timestamp.valueOf(DateUtil.currentDateString(Constant.YMD_HMS)));
|
|
|
+ try {
|
|
|
+ baseDao.execute(SqlUtil.getInsertSqlByMap(map,"TEMP_PACKAGEDETAIL"));
|
|
|
+ remap.put("result","OK");
|
|
|
+ remap.put("remark",remark);
|
|
|
+ }catch (Exception e){
|
|
|
+ remap.put("result","NG");
|
|
|
+ remap.put("remark",e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ relist.add(remap);
|
|
|
+ }
|
|
|
SpObserver.putSp(username);
|
|
|
+ return relist;
|
|
|
}
|
|
|
|
|
|
private String checkAccessKey(String accessKey,String requestId){
|