|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import org.jeecg.modules.documents.orderData.entity.SyOrderData;
|
|
|
import org.jeecg.modules.documents.orderData.entity.SyOrderDataItem;
|
|
|
+import org.jeecg.modules.documents.orderData.entity.SyOrderDataVO;
|
|
|
import org.jeecg.modules.documents.orderData.mapper.SyOrderDataMapper;
|
|
|
import org.jeecg.modules.documents.orderData.service.ISyOrderDataItemService;
|
|
|
import org.jeecg.modules.documents.orderData.service.ISyOrderDataService;
|
|
@@ -138,7 +139,7 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
|
|
|
" LEFT JOIN Customer cc ON s.cCusCode = cc.cCusCode" +
|
|
|
" LEFT JOIN Person pe ON s.cPersonCode = pe.cPersonCode" +
|
|
|
" left join Vendor v on s.cDefine12=v.cVenName" +
|
|
|
- " where s.iStatus = 1 AND s.dverifysystime > '"+lastTimeSf+"'";
|
|
|
+ " where s.iStatus = 1 AND s.cdefine11 !=1 ";//and s.dverifysystime > '"+lastTimeSf+"'
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
if(pkorgValue[0].equals("one")){
|
|
|
list = senYuDataSourceOne.queryForList(sql);
|
|
@@ -205,6 +206,17 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
|
|
|
SyOrderDataItem sy2 = JSONObject.toJavaObject(Object, SyOrderDataItem.class);
|
|
|
sy2.setId(sy.getAccount()+sy2.getId());
|
|
|
sy2.setSyOrderDataId(sy.getAccount()+sy2.getSyOrderDataId());
|
|
|
+ SyOrderDataVO ordervo = queryOrder(sy2.getSyOrderDataId());
|
|
|
+ if(ordervo != null){
|
|
|
+ sy2.setOmpoAccount(ordervo.getOmpoAccount());
|
|
|
+ sy2.setOmpoCode(ordervo.getOmpoCode());
|
|
|
+ sy2.setOmpoId(ordervo.getOmpoId());
|
|
|
+ sy2.setOmpoIdItem(ordervo.getOmpoIdItem());
|
|
|
+ sy2.setITaxPrice(ordervo.getITaxPrice());
|
|
|
+ sy2.setGuangpeiGateWidth(ordervo.getGuangpeiGateWidth().toString());
|
|
|
+ sy2.setSupplier(ordervo.getSupplier());
|
|
|
+ sy2.setSupplierCode(ordervo.getSupplierCode());
|
|
|
+ }
|
|
|
syOrderDataItemService.save(sy2);
|
|
|
}
|
|
|
//添加主表数据进入数据库
|
|
@@ -220,6 +232,141 @@ public class SyOrderDataServiceImpl extends ServiceImpl<SyOrderDataMapper, SyOrd
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /*
|
|
|
+ 查询数据
|
|
|
+ */
|
|
|
+ public SyOrderDataVO queryOrder(String orderItemID){
|
|
|
+ SyOrderDataVO syOrderDataVO = new SyOrderDataVO();
|
|
|
+ syOrderDataVO.setId(orderItemID);
|
|
|
+ List<Map<String, Object>> listSon = new ArrayList<>();
|
|
|
+ SyOrderDataVO result = new SyOrderDataVO();
|
|
|
+ /*
|
|
|
+ 查询账套用于判断
|
|
|
+ */
|
|
|
+ QueryWrapper<DxpDataPlan> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("code", "senYu_syOrder");
|
|
|
+ List<DxpDataPlan> pageList = dxpDataPlanService.list(queryWrapper);
|
|
|
+ String pkorg = pageList.get(0).getPkOrg();
|
|
|
+ String pkorgSplit[] = pkorg.split(",");
|
|
|
+ //定义账套集合
|
|
|
+ String account[] = new String[4];
|
|
|
+ int index = 0;
|
|
|
+ //得到对应的账套
|
|
|
+ for (String str : pkorgSplit) {
|
|
|
+ String pkorgValue[] = str.split(":");
|
|
|
+ account[index] = pkorgValue[1];
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ 对应账套取对应的值
|
|
|
+ */
|
|
|
+ if(account[0].equals(syOrderDataVO.getAccount())){
|
|
|
+ String sql = " SELECT" +
|
|
|
+ " ompoCode,ompoIdItem,ompoId,supplierCode,v.cVenAbbName as supplier,iTaxPrice,guangpeiGateWidth," +account[0]+" as ompoAccount"+
|
|
|
+ " FROM" +
|
|
|
+ " SO_SODetails s" +
|
|
|
+ " left join (" +
|
|
|
+ " SELECT om.cCode as ompoCode,om.MOID as ompoId,od.MODetailsID as ompoIdItem," +
|
|
|
+ " od.cDefine23 as guangpeiGateWidth,"+
|
|
|
+ " om.cVenCode as supplierCode,od.iTaxPrice,od.cInvCode,od.isosid" +
|
|
|
+ " FROM OM_MOMain om" +
|
|
|
+ " LEFT JOIN OM_MODetails od on om.MOID =od.MOID" +
|
|
|
+ " where om.cState = 1" +
|
|
|
+ ") p on s.isosid = p.isosid and s.cInvCode = p.cInvCode" +
|
|
|
+ " left join Vendor v on p.supplierCode=v.cVenCode" +
|
|
|
+ " where s.autoid ="+syOrderDataVO.getId();
|
|
|
+ listSon = senYuDataSourceOne.queryForList(sql);
|
|
|
+ List<JSONObject> jian = JsonChangeUtils.toJSONObject(listSon);
|
|
|
+ for (JSONObject jsonObject:jian) {
|
|
|
+ result = JSONObject.toJavaObject(jsonObject, SyOrderDataVO.class);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }else if(account[1].equals(syOrderDataVO.getAccount())){
|
|
|
+ String sql = "SELECT" +
|
|
|
+ " ompoCode,ompoIdItem,ompoId,supplierCode,v.cVenAbbName as supplier,iTaxPrice,guangpeiGateWidth," +account[1]+" as ompoAccount"+
|
|
|
+ " FROM" +
|
|
|
+ " SO_SODetails s" +
|
|
|
+ " left join (" +
|
|
|
+ " SELECT pm.cPOID as ompoCode,pm.POID as ompoId,pd.id as ompoIdItem,pd.irowno as poIrowno,"+
|
|
|
+ " pd.cDefine23 as guangpeiGateWidth,"+
|
|
|
+ " pm.cVenCode as supplierCode,pd.iTaxPrice,pd.cInvCode,pd.iorderdid as isosid" +
|
|
|
+ " FROM PO_Pomain pm" +
|
|
|
+ " LEFT JOIN PO_Podetails pd on pm.POID=pd.POID" +
|
|
|
+ " where pm.cState = 1" +
|
|
|
+ ") p on s.isosid = p.isosid and s.cInvCode = p.cInvCode" +
|
|
|
+ " left join Vendor v on p.supplierCode=v.cVenCode"+
|
|
|
+ " where s.autoid ="+syOrderDataVO.getId();
|
|
|
+ List<Map<String, Object>> list = senYuDataSourceTwo.queryForList(sql);
|
|
|
+ List<JSONObject> jian = JsonChangeUtils.toJSONObject(list);
|
|
|
+ for (JSONObject jsonObject:jian) {
|
|
|
+ result = JSONObject.toJavaObject(jsonObject, SyOrderDataVO.class);
|
|
|
+ }
|
|
|
+ if(!result.getSupplier().equals("马菲羊")){
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ String sql2 = "SELECT" +
|
|
|
+ " ompoCode,ompoIdItem,ompoId,supplierCode,v.cVenAbbName as supplier,iTaxPrice,guangpeiGateWidth," +account[2]+" as ompoAccount"+
|
|
|
+ " FROM" +
|
|
|
+ " SO_SODetails s" +
|
|
|
+ " left join (" +
|
|
|
+ " SELECT pm.cPOID as ompoCode,pm.POID as ompoId,pd.id as ompoIdItem," +
|
|
|
+ " pd.cDefine23 as guangpeiGateWidth,"+
|
|
|
+ " pm.cVenCode as supplierCode,pd.iTaxPrice,pd.cInvCode,pd.iorderdid as isosid" +
|
|
|
+ " FROM PO_Pomain pm" +
|
|
|
+ " LEFT JOIN PO_Podetails pd on pm.POID=pd.POID" +
|
|
|
+ " where pm.cState = 1" +
|
|
|
+ " UNION" +
|
|
|
+ " SELECT om.cCode as ompoCode,om.MOID as ompoId,od.MODetailsID as ompoIdItem," +
|
|
|
+ " od.cDefine23 as guangpeiGateWidth,"+
|
|
|
+ " om.cVenCode as supplierCode,od.iTaxPrice,od.cInvCode,od.isosid" +
|
|
|
+ " FROM OM_MOMain om" +
|
|
|
+ " LEFT JOIN OM_MODetails od on om.MOID =od.MOID" +
|
|
|
+ " where om.cState = 1" +
|
|
|
+ " ) p on s.isosid = p.isosid and s.cInvCode = p.cInvCode" +
|
|
|
+ " left join Vendor v on p.supplierCode=v.cVenCode"+
|
|
|
+ " where s.iRowNo ="+syOrderDataVO.getPoIrowno();
|
|
|
+ listSon = senYuDataSourceThree.queryForList(sql2);
|
|
|
+ List<JSONObject> jian2 = JsonChangeUtils.toJSONObject(listSon);
|
|
|
+ for (JSONObject jsonObject:jian2) {
|
|
|
+ result = JSONObject.toJavaObject(jsonObject, SyOrderDataVO.class);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }else if(account[2].equals(syOrderDataVO.getAccount())){
|
|
|
+ String sql = "SELECT" +
|
|
|
+ " ompoCode,ompoIdItem,ompoId,supplierCode,v.cVenAbbName as supplier,iTaxPrice,guangpeiGateWidth," +account[2]+" as ompoAccount"+
|
|
|
+ " FROM" +
|
|
|
+ " SO_SODetails s" +
|
|
|
+ " left join (" +
|
|
|
+ " SELECT pm.cPOID as ompoCode,pm.POID as ompoId,pd.id as ompoIdItem," +
|
|
|
+ " pd.cDefine23 as guangpeiGateWidth,"+
|
|
|
+ " pm.cVenCode as supplierCode,pd.iTaxPrice,pd.cInvCode,pd.iorderdid as isosid" +
|
|
|
+ " FROM PO_Pomain pm" +
|
|
|
+ " LEFT JOIN PO_Podetails pd on pm.POID=pd.POID" +
|
|
|
+ " where pm.cState = 1" +
|
|
|
+ " UNION" +
|
|
|
+ " SELECT om.cCode as ompoCode,om.MOID as ompoId,od.MODetailsID as ompoIdItem," +
|
|
|
+ " od.cDefine23 as guangpeiGateWidth,"+
|
|
|
+ " om.cVenCode as supplierCode,od.iTaxPrice,od.cInvCode,od.isosid" +
|
|
|
+ " FROM OM_MOMain om" +
|
|
|
+ " LEFT JOIN OM_MODetails od on om.MOID =od.MOID" +
|
|
|
+ " where om.cState = 1" +
|
|
|
+ ") p on s.isosid = p.isosid and s.cInvCode = p.cInvCode" +
|
|
|
+ " left join Vendor v on p.supplierCode=v.cVenCode"+
|
|
|
+ " where s.autoid ="+syOrderDataVO.getId();
|
|
|
+ listSon = senYuDataSourceThree.queryForList(sql);
|
|
|
+ List<JSONObject> jian = JsonChangeUtils.toJSONObject(listSon);
|
|
|
+ for (JSONObject jsonObject:jian) {
|
|
|
+ result = JSONObject.toJavaObject(jsonObject, SyOrderDataVO.class);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
|
|
|