|
@@ -0,0 +1,74 @@
|
|
|
+package org.jeecg.modules.openApi.service.impl;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import org.jeecg.modules.openApi.service.IRdrecord11Service;
|
|
|
+import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
|
|
|
+import org.jeecg.modules.openApi.service.ISenYuDataSourceThree;
|
|
|
+import org.jeecg.modules.openApi.service.ISenYuDataSourceTwo;
|
|
|
+import org.jeecg.modules.system.util.JsonChangeUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Service
|
|
|
+public class Rdrecord11ServiceImpl implements IRdrecord11Service {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISenYuDataSourceOne senYuDataSourceOne;
|
|
|
+ @Autowired
|
|
|
+ private ISenYuDataSourceTwo senYuDataSourceTwo;
|
|
|
+ @Autowired
|
|
|
+ private ISenYuDataSourceThree senYuDataSourceThree;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public JSONObject getRdrecord(String org, String cCode) throws Exception{
|
|
|
+ JSONObject resultJson=new JSONObject();
|
|
|
+ //主表查询SQl
|
|
|
+ String hsql="select * From rdrecord11 where cCode='"+cCode+"'";
|
|
|
+ //子表查询SQl
|
|
|
+ String bsql="select a.* From rdrecords11 a,rdrecord11 b where a.id=b.id and b.cCode='"+cCode+"'";
|
|
|
+ if(org.equals("101")){
|
|
|
+ List<Map<String, Object>> hresult = senYuDataSourceOne.queryForList(hsql);
|
|
|
+ List<Map<String, Object>> bresult = senYuDataSourceOne.queryForList(bsql);
|
|
|
+ if(hresult.size()!=1||bresult.size()==0){
|
|
|
+ throw new Exception(cCode+"单号查询有误,请确认数据!");
|
|
|
+ }
|
|
|
+ resultJson=JsonChangeUtils.toJSONObject(hresult).get(0);
|
|
|
+ resultJson.put("b",JsonChangeUtils.toJSONObject(bresult));
|
|
|
+ }else if(org.equals("102")){
|
|
|
+
|
|
|
+ }else if(org.equals("103")){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ throw new Exception(org+"该账套号不存在!");
|
|
|
+ }
|
|
|
+ return resultJson;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public JSONObject getRdrecordToPrint(String org, String cCode) throws Exception {
|
|
|
+ JSONObject resultJson=new JSONObject();
|
|
|
+ //查询SQl
|
|
|
+ String sql="select a.csysbarcode as '缸单条码(单据条码)',c.cCusCode as '客户',b.cBatch as '缸号' ,a.cVenCode as '供应商', " +
|
|
|
+ "'染厂色号',d.cVenCode as '委外供应商',b.iQuantity as '数量',b.csocode as '上游订单号',b.irowno as '匹数(行号)', " +
|
|
|
+ "b.comcode as '委外订单号',b.cInvCode as '存货名称',a.cCode as '材料出库单号','描述' From rdrecord11 a left join rdrecords11 b " +
|
|
|
+ "on a.id=b.id left join SO_SOMain c on b.csocode=c.csocode left join OM_MOMain d on b.comcode=d.cCode " +
|
|
|
+ "where a.cCode='"+cCode+"'";
|
|
|
+ if(org.equals("101")){
|
|
|
+ List<Map<String, Object>> result = senYuDataSourceOne.queryForList(sql);
|
|
|
+ if(result.size()==0){
|
|
|
+ throw new Exception(cCode+"单号查询有误,请确认数据!");
|
|
|
+ }
|
|
|
+ resultJson.put("b",JsonChangeUtils.toJSONObject(result));
|
|
|
+ }else if(org.equals("102")){
|
|
|
+
|
|
|
+ }else if(org.equals("103")){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ throw new Exception(org+"该账套号不存在!");
|
|
|
+ }
|
|
|
+ return resultJson;
|
|
|
+ }
|
|
|
+}
|