|
|
|
@ -2,13 +2,17 @@ package cn.chjyj.szwh.service.impl; |
|
|
|
|
|
|
|
import cn.chjyj.szwh.bean.Order; |
|
|
|
import cn.chjyj.szwh.bean.OrderGoodsDetail; |
|
|
|
import cn.chjyj.szwh.bean.OrderGoodsSource; |
|
|
|
import cn.chjyj.szwh.bean.OrderUser; |
|
|
|
import cn.chjyj.szwh.constant.ChConstant; |
|
|
|
import cn.chjyj.szwh.exception.ChException; |
|
|
|
import cn.chjyj.szwh.mapper.OrderGoodsDetailMapper; |
|
|
|
import cn.chjyj.szwh.mapper.OrderGoodsSourceMapper; |
|
|
|
import cn.chjyj.szwh.mapper.OrderMapper; |
|
|
|
import cn.chjyj.szwh.mapper.OrderUserMapper; |
|
|
|
import cn.chjyj.szwh.service.OrderService; |
|
|
|
import cn.chjyj.szwh.vo.OrderDetailVo; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.commons.logging.Log; |
|
|
|
import org.apache.commons.logging.LogFactory; |
|
|
|
@ -34,6 +38,8 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
*/ |
|
|
|
@Autowired |
|
|
|
private OrderGoodsDetailMapper orderGoodsDetailMapper; |
|
|
|
@Autowired |
|
|
|
private OrderGoodsSourceMapper orderGoodsSourceMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<Order> getAllOrderList(int page) { |
|
|
|
@ -129,6 +135,51 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
return retmap; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 订单详情,方法2 |
|
|
|
* @param batchcode |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Map<String, Object> orderDetail(String batchcode) { |
|
|
|
Map retmap =new HashMap(); |
|
|
|
// 订单详情及产品信息
|
|
|
|
OrderDetailVo ordv =orderGoodsDetailMapper.getOrderDetailVo(batchcode); |
|
|
|
if(ordv==null){ |
|
|
|
// 订单不存在
|
|
|
|
} |
|
|
|
// 商品图片
|
|
|
|
if(StringUtils.isNotBlank(ordv.getGoods_image())){ |
|
|
|
//todo 远程获取图
|
|
|
|
} |
|
|
|
|
|
|
|
// 订单用户 ,
|
|
|
|
OrderUser orderUser = orderUserMapper.getUserOrder(batchcode,ordv.getEntrust_islicode()); |
|
|
|
// 显示时候取出ID,
|
|
|
|
orderUser.setId(null); |
|
|
|
orderUser.setBatchcode(null); |
|
|
|
retmap.put("userinfo",orderUser); |
|
|
|
|
|
|
|
//商品来源
|
|
|
|
List<OrderGoodsSource> orderGoodsSourceList = orderGoodsSourceMapper. |
|
|
|
getOrderGoodsSourceList(ordv.getSource_id()); |
|
|
|
// 遍历
|
|
|
|
for(OrderGoodsSource ods:orderGoodsSourceList){ |
|
|
|
String sourceData = ods.getSourceData(); |
|
|
|
// 转为json
|
|
|
|
JSONObject json = JSONObject.parseObject(sourceData); |
|
|
|
Integer dataType= json.getInteger("datatype"); |
|
|
|
// 如果不存在的话,需要进行下载
|
|
|
|
// if(dataType==1){
|
|
|
|
//
|
|
|
|
// }else{
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
return retmap; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Order getOrderById(Integer id) { |
|
|
|
return orderMapper.getOrderById(id); |
|
|
|
@ -145,12 +196,13 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List orderInfo(String bathcode) { |
|
|
|
public Map<String,Object> orderInfo(String bathcode) { |
|
|
|
List xoutList =new ArrayList(); //返回结果list
|
|
|
|
Map retmap =new HashMap(); |
|
|
|
int code=200; |
|
|
|
// 订单基础信息
|
|
|
|
Order bsod = orderMapper.getOrderByBatchcode(bathcode); |
|
|
|
|
|
|
|
retmap.put("order",bsod); |
|
|
|
xoutList.add(retmap); |
|
|
|
|
|
|
|
@ -169,6 +221,8 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
String goods_type = ""; // 商品类型
|
|
|
|
//$goods_entrust = [];
|
|
|
|
Set goodsTypeSet =new HashSet(); |
|
|
|
Set goods_entrust= new HashSet(); |
|
|
|
|
|
|
|
|
|
|
|
String goods_ownership_str = ""; //商品主人
|
|
|
|
BigDecimal price = new BigDecimal(0.00);//
|
|
|
|
@ -177,12 +231,41 @@ public class OrderServiceImpl implements OrderService { |
|
|
|
BigDecimal service_charge = new BigDecimal(0.00); |
|
|
|
String contract_code = ""; |
|
|
|
String close_serial_number = ""; |
|
|
|
|
|
|
|
Set entnSet =new HashSet(); |
|
|
|
//
|
|
|
|
for(OrderGoodsDetail odg:odglist){ |
|
|
|
// for 每个商品 购买者
|
|
|
|
OrderUser orderUser = orderUserMapper.getUserOrder(bathcode,odg.getEntrustIslicode()); |
|
|
|
entnSet.add(orderUser.getName()); |
|
|
|
//
|
|
|
|
goods_name+=odg.getGoodsName()+","; |
|
|
|
goods_type+=(odg.getGoodsType()==1)? "文化资源数据," : "文化数字内容,"; |
|
|
|
|
|
|
|
//
|
|
|
|
String tmstr=odg.getGoodsEntrust()==1?"转让" : "授权"; |
|
|
|
goods_entrust.add(tmstr); |
|
|
|
|
|
|
|
//
|
|
|
|
} |
|
|
|
|
|
|
|
return xoutList; |
|
|
|
//购买者
|
|
|
|
OrderUser buyuser= orderUserMapper.getUserOrder(bathcode,bsod.getBuyIslicode()); |
|
|
|
retmap.put("buyuser",buyuser); |
|
|
|
|
|
|
|
//分账比例 todo
|
|
|
|
retmap.put("ratio_setting",null); |
|
|
|
|
|
|
|
// 资金结算表
|
|
|
|
//$closeTable = $this->getCloseTable($order, $order_detail);
|
|
|
|
retmap.put("close",null); |
|
|
|
|
|
|
|
// 发票
|
|
|
|
//$bill = $this->getBill($batchcode);
|
|
|
|
//$result['bill'] = $bill;
|
|
|
|
retmap.put("bill",null); |
|
|
|
|
|
|
|
return retmap; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
|