|
|
@@ -1,18 +1,5 @@
|
|
|
package com.uas.mes.pm.service.impl;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Iterator;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Propagation;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-
|
|
|
import com.uas.mes.common.dao.MakeDao;
|
|
|
import com.uas.mes.common.dao.MakeNoticeDetailDao;
|
|
|
import com.uas.mes.common.dao.MrpDao;
|
|
|
@@ -32,8 +19,13 @@ import com.uas.mes.core.util.MapComparator;
|
|
|
import com.uas.mes.dao.TransferRepository;
|
|
|
import com.uas.mes.model.Key;
|
|
|
import com.uas.mes.pm.service.BatchDealService;
|
|
|
-
|
|
|
import net.sf.json.JSONObject;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service("PmBatchDealService")
|
|
|
public class BatchDealServiceImpl implements BatchDealService {
|
|
|
@@ -2183,4 +2175,26 @@ public class BatchDealServiceImpl implements BatchDealService {
|
|
|
return "确认成功";
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String SmtMessageConfirm(String caller, String data) {
|
|
|
+ List<Map<Object, Object>> store = BaseUtil.parseGridStoreToMaps(data);
|
|
|
+ // 1.判断是否为待确认状态
|
|
|
+ String ids = CollectionUtil.pluckSqlString(store, "sml_id");
|
|
|
+ // 2.更新ms_checkpack=0
|
|
|
+ String updateSql = "UPDATE SMTMESSAGELOG SET sml_confirm=-1 WHERE sml_id IN (" + ids + ")";
|
|
|
+ baseDao.execute(updateSql);
|
|
|
+ // 3.记录日志
|
|
|
+ List<String> sqls = new ArrayList<String>();
|
|
|
+ String sql = "";
|
|
|
+ Employee employee = SystemSession.getUser();
|
|
|
+ String userName = employee.getEm_name(), userCode = employee.getEm_code();
|
|
|
+ for (Map<Object, Object> map : store) {
|
|
|
+ sql = "INSERT INTO PQCCONFIRMPACKLOG(PL_ID,PL_CONFIRMMAN,PL_COFIRMMANCODE,PL_CONFIRMDATE,PL_MAKECODE,PL_PRODCODE,PL_LINECODE,PL_TABLE,PL_LOCATION,PL_TYPE,PL_CONTENT)"
|
|
|
+ + " SELECT PQCCONFIRMPACKLOG_SEQ.NEXTVAL,'"+userName+"','"+userCode+"',SYSDATE,sml_makecode,sml_prodcode,sml_linecode,sml_table,sml_location,sml_type,sml_content FROM SMTMESSAGELOG WHERE sml_id = " + map.get("sml_id");
|
|
|
+ sqls.add(sql);
|
|
|
+ }
|
|
|
+ baseDao.execute(sqls);
|
|
|
+ return "确认成功";
|
|
|
+ }
|
|
|
+
|
|
|
}
|