|
|
@@ -9,9 +9,10 @@ import java.util.Map;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
-import com.uas.eis.dao.SqlRowList;
|
|
|
-import com.uas.eis.entity.ActionConfig;
|
|
|
-import com.uas.eis.entity.ErrorMsg;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
+import com.uas.eis.entity.*;
|
|
|
import com.uas.eis.exception.SystemException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
@@ -21,14 +22,12 @@ import org.springframework.util.StringUtils;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.eis.core.support.TokenHandler;
|
|
|
import com.uas.eis.dao.BaseDao;
|
|
|
-import com.uas.eis.entity.QueryArgs;
|
|
|
-import com.uas.eis.entity.QueryConfig;
|
|
|
-import com.uas.eis.entity.QueryConfigDetail;
|
|
|
import com.uas.eis.service.QueryService;
|
|
|
import com.uas.eis.utils.BaseUtil;
|
|
|
|
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
|
+
|
|
|
@Service
|
|
|
public class QueryServiceImpl implements QueryService {
|
|
|
|
|
|
@@ -257,31 +256,14 @@ public class QueryServiceImpl implements QueryService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<Map<String, Object>> queryProduct(int size) {
|
|
|
- size=size>100?100:size;
|
|
|
- SqlRowList rs = baseDao.queryForRowSet("select * from (select pr_code ,pr_detail ,pr_spec ,pr_unit ,pr_cop ,pr_version ,pr_serial ,pr_validdays ,pr_msdlevel ,pr_fhelpcode ,pr_f_115 ,pr_f_116 ,pr_f_102 ,pr_kind ,pr_whcode from product where pr_sendstatus='待上传' and pr_statuscode='AUDITED') where rownum<=" + size);
|
|
|
- List<Map<String, Object>> maps = new ArrayList<>();
|
|
|
- while (rs.next()){
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("itemNo",rs.getString("pr_code"));
|
|
|
- map.put("itemName",rs.getString("pr_detail"));
|
|
|
- map.put("description",rs.getString("pr_spec"));
|
|
|
- map.put("unitNo",rs.getString("pr_unit"));
|
|
|
- map.put("companyNo",rs.getString("pr_cop"));
|
|
|
- map.put("version",rs.getInt("pr_version"));
|
|
|
- map.put("itemType",rs.getString("pr_serial"));
|
|
|
- map.put("invalidQty",rs.getInt("pr_validdays"));
|
|
|
- map.put("msdLevel",rs.getString("pr_msdlevel"));
|
|
|
- map.put("FhelpCode",rs.getString("pr_fhelpcode"));
|
|
|
- map.put("F_115",rs.getString("pr_f_115"));
|
|
|
- map.put("F_116",rs.getString("pr_f_116"));
|
|
|
- map.put("F_102",rs.getString("pr_f_102"));
|
|
|
- map.put("F_103",rs.getString("pr_kind"));
|
|
|
- map.put("FDefaultLoc",rs.getString("pr_whcode"));
|
|
|
- maps.add(map);
|
|
|
- }
|
|
|
- return maps;
|
|
|
+ public String queryProduct(String data) {
|
|
|
+ Map<Object, Object> store = BaseUtil.parseFormStoreToMap(data);
|
|
|
+ int size = store.get("size") == null ? 500 : Integer.parseInt(store.get("size").toString());
|
|
|
+ size=size>500?500:size;
|
|
|
+ List<Product> products = baseDao.query("select * from (select pr_code ,pr_detail ,pr_spec ,nvl(pr_unit,'PCS') pr_unit,nvl(pr_cop,'BYT') pr_cop,nvl(pr_version,0) pr_version,pr_serial ,pr_validdays ,pr_msdlevel ,pr_fhelpcode ,pr_f_115 ,pr_f_116 ,pr_f_102 ,pr_kind ,pr_whcode from product where pr_sendstatus='待上传' and pr_statuscode='AUDITED' and nvl(pr_groupcode,' ')<>'用品' order by pr_auditdate,pr_id) where rownum<=" + size,
|
|
|
+ Product.class);
|
|
|
+ String s = JSON.toJSONString(products, SerializerFeature.WriteMapNullValue);
|
|
|
+ baseDao.execute("update product set pr_sendstatus='已上传' where pr_id in (select pr_id from (select pr_id from product where pr_sendstatus='待上传' and pr_statuscode='AUDITED' and nvl(pr_groupcode,' ')<>'用品' order by pr_auditdate,pr_id) where rownum<=" + size+")");
|
|
|
+ return s;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|