parent
c62e4e7c16
commit
558ecd11e9
5 changed files with 1034 additions and 1005 deletions
@ -1,355 +1,354 @@ |
|||||||
package org.jeecg.modules.demo.zyorders.service.impl; |
package org.jeecg.modules.demo.zyorders.service.impl; |
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; |
import org.jeecg.modules.demo.customerinvoice.entity.CustomerInvoice; |
||||||
import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; |
import org.jeecg.modules.demo.customerinvoice.mapper.CustomerInvoiceMapper; |
||||||
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; |
import org.jeecg.modules.demo.customerreceivingaddress.entity.CustomerReceivingAddress; |
||||||
import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; |
import org.jeecg.modules.demo.customerreceivingaddress.mapper.CustomerReceivingAddressMapper; |
||||||
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
import org.jeecg.modules.demo.goodsaccessories.entity.GoodsAccessories; |
||||||
import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; |
import org.jeecg.modules.demo.goodsaccessories.mapper.GoodsAccessoriesMapper; |
||||||
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
import org.jeecg.modules.demo.goodsfabric.entity.GoodsFabric; |
||||||
import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; |
import org.jeecg.modules.demo.goodsfabric.mapper.GoodsFabricMapper; |
||||||
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
import org.jeecg.modules.demo.goodsmodule.entity.GoodsModule; |
||||||
import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; |
import org.jeecg.modules.demo.goodsmodule.mapper.GoodsModuleMapper; |
||||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; |
||||||
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk; |
import org.jeecg.modules.demo.ordergoods.entity.OrderGoodsJk; |
||||||
import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; |
import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; |
||||||
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; |
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; |
||||||
import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; |
import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; |
||||||
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; |
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; |
||||||
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; |
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; |
||||||
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; |
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; |
||||||
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; |
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; |
||||||
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
import org.jeecg.modules.demo.zygoods.entity.ZyGoods; |
||||||
import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; |
import org.jeecg.modules.demo.zygoods.mapper.ZyGoodsMapper; |
||||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; |
||||||
import org.jeecg.modules.demo.zyorders.entity.ZyOrdersJk; |
import org.jeecg.modules.demo.zyorders.entity.ZyOrdersJk; |
||||||
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; |
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper; |
||||||
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; |
||||||
import org.jeecg.modules.message.entity.ZySpeechMessage; |
import org.jeecg.modules.message.entity.ZySpeechMessage; |
||||||
import org.jeecg.modules.message.mapper.ZySpeechMessageMapper; |
import org.jeecg.modules.message.mapper.ZySpeechMessageMapper; |
||||||
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; |
import org.jeecg.modules.orderbymakeclothplan.vo.TodayOrderAndQIriVo; |
||||||
import org.springframework.beans.factory.annotation.Autowired; |
import org.springframework.beans.factory.annotation.Autowired; |
||||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
|
||||||
import java.text.SimpleDateFormat; |
import java.text.SimpleDateFormat; |
||||||
import java.util.ArrayList; |
import java.util.ArrayList; |
||||||
import java.util.Calendar; |
import java.util.Calendar; |
||||||
import java.util.Date; |
import java.util.Date; |
||||||
import java.util.List; |
import java.util.List; |
||||||
|
|
||||||
/** |
/** |
||||||
* @Description: 订单基本信息管理 |
* @Description: 订单基本信息管理 |
||||||
* @Author: jeecg-boot |
* @Author: jeecg-boot |
||||||
* @Date: 2022-12-26 |
* @Date: 2022-12-26 |
||||||
* @Version: V1.0 |
* @Version: V1.0 |
||||||
*/ |
*/ |
||||||
@Service |
@Service |
||||||
public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> implements IZyOrdersService { |
public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> implements IZyOrdersService { |
||||||
|
|
||||||
//商品
|
//商品
|
||||||
@Autowired |
@Autowired |
||||||
private ZyGoodsMapper zyGoodsMapper; |
private ZyGoodsMapper zyGoodsMapper; |
||||||
|
|
||||||
//订单商品表
|
//订单商品表
|
||||||
@Autowired |
@Autowired |
||||||
private OrderGoodsMapper zyOrderGoodsMapper; |
private OrderGoodsMapper zyOrderGoodsMapper; |
||||||
|
|
||||||
//商品模块表
|
//商品模块表
|
||||||
@Autowired |
@Autowired |
||||||
private GoodsModuleMapper zyGoodsModuleMapper; |
private GoodsModuleMapper zyGoodsModuleMapper; |
||||||
|
|
||||||
|
|
||||||
//订单商品模块表
|
//订单商品模块表
|
||||||
@Autowired |
@Autowired |
||||||
private OrderGoodsModuleMapper zyOrderGoodsModuleMapper; |
private OrderGoodsModuleMapper zyOrderGoodsModuleMapper; |
||||||
|
|
||||||
|
|
||||||
//商品面料表
|
//商品面料表
|
||||||
@Autowired |
@Autowired |
||||||
private GoodsFabricMapper zyGoodsFabricMapper; |
private GoodsFabricMapper zyGoodsFabricMapper; |
||||||
|
|
||||||
//订单商品面料表
|
//订单商品面料表
|
||||||
@Autowired |
@Autowired |
||||||
private OrderGoodsFabricMapper zyOrderGoodsFabricMapper; |
private OrderGoodsFabricMapper zyOrderGoodsFabricMapper; |
||||||
|
|
||||||
//商品辅料表
|
//商品辅料表
|
||||||
@Autowired |
@Autowired |
||||||
private GoodsAccessoriesMapper zyGoodsAccessoriesMapper; |
private GoodsAccessoriesMapper zyGoodsAccessoriesMapper; |
||||||
|
|
||||||
//订单商品辅料表
|
//订单商品辅料表
|
||||||
@Autowired |
@Autowired |
||||||
private OrderGoodsAccessoriesMapper zyOrderGoodsAccessoriesMapper; |
private OrderGoodsAccessoriesMapper zyOrderGoodsAccessoriesMapper; |
||||||
|
|
||||||
|
|
||||||
|
//顾客地址表
|
||||||
//顾客地址表
|
@Autowired |
||||||
@Autowired |
CustomerReceivingAddressMapper customerReceivingAddressMapper; |
||||||
CustomerReceivingAddressMapper customerReceivingAddressMapper; |
|
||||||
|
//客户发票信息
|
||||||
//客户发票信息
|
@Autowired |
||||||
@Autowired |
CustomerInvoiceMapper customerInvoiceMapper; |
||||||
CustomerInvoiceMapper customerInvoiceMapper; |
|
||||||
|
//定时播报
|
||||||
//定时播报
|
@Autowired |
||||||
@Autowired |
private ZySpeechMessageMapper zySpeechMessageMapper; |
||||||
private ZySpeechMessageMapper zySpeechMessageMapper; |
|
||||||
|
|
||||||
|
/** |
||||||
|
* 大屏数据-获取订单的状态 |
||||||
|
* |
||||||
/** |
* @return |
||||||
* 大屏数据-获取订单的状态 |
*/ |
||||||
* @return |
@Override |
||||||
*/ |
public List<ZyOrders> getOrderStatus() { |
||||||
@Override |
String starTime; |
||||||
public List<ZyOrders> getOrderStatus() { |
String endTime; |
||||||
String starTime; |
Date date = new Date(); |
||||||
String endTime; |
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
||||||
Date date = new Date(); |
String todayStr = formatter.format(date);//今天
|
||||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); |
Calendar calendar = Calendar.getInstance(); |
||||||
String todayStr = formatter.format(date);//今天
|
calendar.setTime(date); |
||||||
Calendar calendar = Calendar.getInstance(); |
//把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天)
|
||||||
calendar.setTime(date); |
calendar.add(Calendar.DATE, 1); |
||||||
//把日期往后增加一天.整数往后推,负数往前移动(1:表示明天、-1:表示昨天,0:表示今天)
|
//这个时间就是日期往后推一天的结果,明天
|
||||||
calendar.add(Calendar.DATE, 1); |
date = calendar.getTime(); |
||||||
//这个时间就是日期往后推一天的结果,明天
|
String tomorrowStr = formatter.format(date); |
||||||
date = calendar.getTime(); |
|
||||||
String tomorrowStr = formatter.format(date); |
starTime = todayStr + " 00:00:00"; |
||||||
|
endTime = tomorrowStr + " 00:00:00"; |
||||||
starTime = todayStr + " 00:00:00"; |
|
||||||
endTime = tomorrowStr + " 00:00:00"; |
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
||||||
|
wrapper.ge("create_time", starTime).le("create_time", endTime).eq("payment_status", 1); |
||||||
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
|
||||||
wrapper.ge("create_time", starTime).le("create_time", endTime).eq("payment_status", 1); |
List<ZyOrders> zyOrderList = baseMapper.selectList(wrapper); |
||||||
|
return zyOrderList; |
||||||
List<ZyOrders> zyOrderList = baseMapper.selectList(wrapper); |
} |
||||||
return zyOrderList; |
|
||||||
} |
/** |
||||||
|
* 大屏数据-获取历史订单 |
||||||
/** |
* |
||||||
* 大屏数据-获取历史订单 |
* @return |
||||||
* @return |
*/ |
||||||
*/ |
@Override |
||||||
@Override |
public List<ZyOrders> getOldOrder() { |
||||||
public List<ZyOrders> getOldOrder() { |
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
||||||
QueryWrapper<ZyOrders> wrapper = new QueryWrapper<>(); |
wrapper |
||||||
wrapper |
// .eq("is_delete", 0)
|
||||||
// .eq("is_delete", 0)
|
.orderByDesc("create_time"); |
||||||
.orderByDesc("create_time"); |
List<ZyOrders> orderList = baseMapper.selectList(wrapper); |
||||||
List<ZyOrders> orderList = baseMapper.selectList(wrapper); |
return orderList; |
||||||
return orderList; |
} |
||||||
} |
|
||||||
|
/** |
||||||
/** |
* 获取今日订单及七日订单 |
||||||
* 获取今日订单及七日订单 |
* |
||||||
* @return |
* @return |
||||||
*/ |
*/ |
||||||
@Override |
@Override |
||||||
public TodayOrderAndQIriVo getOrder() { |
public TodayOrderAndQIriVo getOrder() { |
||||||
TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek(); |
TodayOrderAndQIriVo todayOrderAndQIriVo = baseMapper.getTotalOrderAndWeek(); |
||||||
if (todayOrderAndQIriVo != null) { |
if (todayOrderAndQIriVo != null) { |
||||||
return todayOrderAndQIriVo; |
return todayOrderAndQIriVo; |
||||||
} else { |
} else { |
||||||
return null; |
return null; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
/** |
/** |
||||||
* |
* @param zyOrdersJk |
||||||
* @param zyOrdersJk |
* @param orderGoodsJkList |
||||||
* @param orderGoodsJkList |
* @return |
||||||
* @return |
*/ |
||||||
*/ |
@Override |
||||||
@Override |
public List<String> orderJk(ZyOrdersJk zyOrdersJk, List<OrderGoodsJk> orderGoodsJkList) { |
||||||
public List<String> orderJk(ZyOrdersJk zyOrdersJk, List<OrderGoodsJk> orderGoodsJkList) { |
|
||||||
|
Double actual_payment = 0.00; |
||||||
Double actual_payment = 0.00; |
Double money = 0.00; |
||||||
Double money = 0.00; |
for (int i = 0; i < orderGoodsJkList.size(); i++) { |
||||||
for(int i = 0 ; i < orderGoodsJkList.size() ; i++){ |
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(i).getGoodsId()); |
||||||
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(i).getGoodsId()); |
money = money + zyGoods.getUnitPrice() * orderGoodsJkList.get(i).getGoodsNum(); |
||||||
money = money + zyGoods.getUnitPrice()*orderGoodsJkList.get(i).getGoodsNum(); |
actual_payment = actual_payment + zyGoods.getPromotionPrice() * orderGoodsJkList.get(i).getGoodsNum(); |
||||||
actual_payment = actual_payment + zyGoods.getPromotionPrice()*orderGoodsJkList.get(i).getGoodsNum(); |
} |
||||||
} |
ZyOrders zyOrders = new ZyOrders(); |
||||||
ZyOrders zyOrders = new ZyOrders(); |
zyOrders.setIschild(0); |
||||||
zyOrders.setIschild(0); |
zyOrders.setOrderTime(new Date()); |
||||||
zyOrders.setOrderTime(new Date()); |
zyOrders.setOrdersNum(getOrdersNum()); |
||||||
zyOrders.setOrdersNum(getOrdersNum()); |
zyOrders.setMoney(money); |
||||||
zyOrders.setMoney(money); |
zyOrders.setFreight(zyOrdersJk.getFreight()); |
||||||
zyOrders.setFreight(zyOrdersJk.getFreight()); |
zyOrders.setPromotionPrice(money - actual_payment); |
||||||
zyOrders.setPromotionPrice(money-actual_payment); |
zyOrders.setActualPayment(actual_payment); |
||||||
zyOrders.setActualPayment(actual_payment); |
zyOrders.setDeliveryTime(zyOrdersJk.getDeliveryTime()); |
||||||
zyOrders.setDeliveryTime(zyOrdersJk.getDeliveryTime()); |
zyOrders.setOrdersType(zyOrdersJk.getOrdersType()); |
||||||
zyOrders.setOrdersType(zyOrdersJk.getOrdersType()); |
zyOrders.setUserId(zyOrdersJk.getUserId()); |
||||||
zyOrders.setUserId(zyOrdersJk.getUserId()); |
zyOrders.setGoodsQuantity(zyOrdersJk.getGoodsQuantity()); |
||||||
zyOrders.setGoodsQuantity(zyOrdersJk.getGoodsQuantity()); |
//顾客地址
|
||||||
//顾客地址
|
if (zyOrdersJk.getAddressId() != null && zyOrdersJk.getAddressId() != "") { |
||||||
if(zyOrdersJk.getAddressId()!=null&&zyOrdersJk.getAddressId()!="") |
CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); |
||||||
{ |
zyOrders.setCityId(customerReceivingAddress.getCityId()); |
||||||
CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); |
zyOrders.setAddress(customerReceivingAddress.getAddress()); |
||||||
zyOrders.setCityId(customerReceivingAddress.getCityId()); |
zyOrders.setZipCode(customerReceivingAddress.getZipCode()); |
||||||
zyOrders.setAddress(customerReceivingAddress.getAddress()); |
zyOrders.setReceiver(zyOrdersJk.getReceiver()); |
||||||
zyOrders.setZipCode(customerReceivingAddress.getZipCode()); |
zyOrders.setMobile(customerReceivingAddress.getMobile()); |
||||||
zyOrders.setReceiver(zyOrdersJk.getReceiver()); |
} |
||||||
zyOrders.setMobile(customerReceivingAddress.getMobile()); |
|
||||||
} |
//顾客发票
|
||||||
|
if (zyOrdersJk.getInvoiceId() != null && zyOrdersJk.getInvoiceId() != "") { |
||||||
//顾客发票
|
CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId()); |
||||||
if(zyOrdersJk.getInvoiceId()!=null&&zyOrdersJk.getInvoiceId()!="") |
zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType())); |
||||||
{ |
zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType())); |
||||||
CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId()); |
zyOrders.setTaxIdentificationNumber(customerInvoice.getTaxIdentificationNumber()); |
||||||
zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType())); |
zyOrders.setAddressBilling(customerInvoice.getAddress()); |
||||||
zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType())); |
zyOrders.setTelephone(customerInvoice.getTelephone()); |
||||||
zyOrders.setTaxIdentificationNumber(customerInvoice.getTaxIdentificationNumber()); |
zyOrders.setBankPublic(customerInvoice.getBankDeposit()); |
||||||
zyOrders.setAddressBilling(customerInvoice.getAddress()); |
zyOrders.setAccountNumber(customerInvoice.getAccountNumber()); |
||||||
zyOrders.setTelephone(customerInvoice.getTelephone()); |
} |
||||||
zyOrders.setBankPublic(customerInvoice.getBankDeposit()); |
|
||||||
zyOrders.setAccountNumber(customerInvoice.getAccountNumber()); |
zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId()); |
||||||
} |
zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId()); |
||||||
|
zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId()); |
||||||
zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId()); |
zyOrders.setDeliveryStatus(0); |
||||||
zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId()); |
zyOrders.setPaymentStatus(1); |
||||||
zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId()); |
zyOrders.setPaymentTime(new Date()); |
||||||
zyOrders.setDeliveryStatus(0); |
baseMapper.insert(zyOrders); |
||||||
zyOrders.setPaymentStatus(1); |
for (int j = 0; j < orderGoodsJkList.size(); j++) { |
||||||
zyOrders.setPaymentTime(new Date()); |
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(j).getGoodsId()); |
||||||
baseMapper.insert(zyOrders); |
OrderGoods orderGoods = new OrderGoods(); |
||||||
for(int j = 0 ; j < orderGoodsJkList.size() ; j++){ |
orderGoods.setOrdersId(zyOrders.getId()); |
||||||
ZyGoods zyGoods = zyGoodsMapper.selectById(orderGoodsJkList.get(j).getGoodsId()); |
orderGoods.setGoodsId(orderGoodsJkList.get(j).getGoodsId()); |
||||||
OrderGoods orderGoods = new OrderGoods(); |
orderGoods.setGoodsNum(orderGoodsJkList.get(j).getGoodsNum()); |
||||||
orderGoods.setOrdersId(zyOrders.getId()); |
orderGoods.setGoodsCode(zyGoods.getGoodsCode()); |
||||||
orderGoods.setGoodsId(orderGoodsJkList.get(j).getGoodsId()); |
orderGoods.setGoodsName(zyGoods.getGoodsName()); |
||||||
orderGoods.setGoodsNum(orderGoodsJkList.get(j).getGoodsNum()); |
orderGoods.setGoodsIntr(zyGoods.getGoodsIntr()); |
||||||
orderGoods.setGoodsCode(zyGoods.getGoodsCode()); |
orderGoods.setCustomized(zyGoods.getCustomized()); |
||||||
orderGoods.setGoodsName(zyGoods.getGoodsName()); |
orderGoods.setMeasureId(zyOrdersJk.getMeasureId()); |
||||||
orderGoods.setGoodsIntr(zyGoods.getGoodsIntr()); |
orderGoods.setGoodsPicture(zyGoods.getGoodsPicture()); |
||||||
orderGoods.setCustomized(zyGoods.getCustomized()); |
orderGoods.setDefaultPicture(zyGoods.getDefaultPicture()); |
||||||
orderGoods.setMeasureId(zyOrdersJk.getMeasureId()); |
orderGoods.setGoodsVideo(zyGoods.getGoodsVideo()); |
||||||
orderGoods.setGoodsPicture(zyGoods.getGoodsPicture()); |
orderGoods.setClothsTypeId(zyGoods.getClothsTypeId()); |
||||||
orderGoods.setDefaultPicture(zyGoods.getDefaultPicture()); |
orderGoods.setStyleId(zyGoods.getStyleId()); |
||||||
orderGoods.setGoodsVideo(zyGoods.getGoodsVideo()); |
orderGoods.setModelId(zyGoods.getModelId()); |
||||||
orderGoods.setClothsTypeId(zyGoods.getClothsTypeId()); |
orderGoods.setUnit(zyGoods.getUnit()); |
||||||
orderGoods.setStyleId(zyGoods.getStyleId()); |
orderGoods.setNumber(zyGoods.getNumber()); |
||||||
orderGoods.setModelId(zyGoods.getModelId()); |
orderGoods.setUnitPrice(zyGoods.getUnitPrice()); |
||||||
orderGoods.setUnit(zyGoods.getUnit()); |
orderGoods.setDiscount(zyGoods.getDiscount()); |
||||||
orderGoods.setNumber(zyGoods.getNumber()); |
orderGoods.setPromotionPrice(zyGoods.getPromotionPrice()); |
||||||
orderGoods.setUnitPrice(zyGoods.getUnitPrice()); |
orderGoods.setRecommend(zyGoods.getRecommend()); |
||||||
orderGoods.setDiscount(zyGoods.getDiscount()); |
orderGoods.setPlaceOrigin(zyGoods.getPlaceOrigin()); |
||||||
orderGoods.setPromotionPrice(zyGoods.getPromotionPrice()); |
orderGoods.setStatus(zyGoods.getStatus()); |
||||||
orderGoods.setRecommend(zyGoods.getRecommend()); |
orderGoods.setTotalPrice(zyGoods.getUnitPrice() * orderGoodsJkList.get(j).getGoodsNum()); |
||||||
orderGoods.setPlaceOrigin(zyGoods.getPlaceOrigin()); |
orderGoods.setPayTotalPrice(zyGoods.getPromotionPrice() * orderGoodsJkList.get(j).getGoodsNum()); |
||||||
orderGoods.setStatus(zyGoods.getStatus()); |
zyOrderGoodsMapper.insert(orderGoods); |
||||||
orderGoods.setTotalPrice(zyGoods.getUnitPrice()*orderGoodsJkList.get(j).getGoodsNum()); |
GoodsModule goodsModule = new GoodsModule(); |
||||||
orderGoods.setPayTotalPrice(zyGoods.getPromotionPrice()*orderGoodsJkList.get(j).getGoodsNum()); |
QueryWrapper<GoodsModule> queryWrapperzsm = new QueryWrapper(); |
||||||
zyOrderGoodsMapper.insert(orderGoods); |
queryWrapperzsm.eq("goods_id", zyGoods.getId()); |
||||||
GoodsModule goodsModule = new GoodsModule(); |
queryWrapperzsm.eq("style_id", zyGoods.getStyleId()); |
||||||
QueryWrapper<GoodsModule> queryWrapperzsm = new QueryWrapper(); |
List<GoodsModule> listzsm = zyGoodsModuleMapper.selectList(queryWrapperzsm); |
||||||
queryWrapperzsm.eq("goods_id",zyGoods.getId()); |
for (int k = 0; k < listzsm.size(); k++) { |
||||||
queryWrapperzsm.eq("style_id",zyGoods.getStyleId()); |
OrderGoodsModule orderGoodsModule = new OrderGoodsModule(); |
||||||
List<GoodsModule> listzsm = zyGoodsModuleMapper.selectList(queryWrapperzsm); |
orderGoodsModule.setOrderGoodsId(orderGoods.getId()); |
||||||
for (int k = 0 ; k < listzsm.size() ; k++){ |
orderGoodsModule.setGoodsId(zyGoods.getId()); |
||||||
OrderGoodsModule orderGoodsModule = new OrderGoodsModule(); |
orderGoodsModule.setStyleId(zyGoods.getStyleId()); |
||||||
orderGoodsModule.setOrderGoodsId(orderGoods.getId()); |
orderGoodsModule.setStyleModuleId(listzsm.get(k).getStyleModuleId()); |
||||||
orderGoodsModule.setGoodsId(zyGoods.getId()); |
orderGoodsModule.setModuleId(listzsm.get(k).getModuleId()); |
||||||
orderGoodsModule.setStyleId(zyGoods.getStyleId()); |
zyOrderGoodsModuleMapper.insert(orderGoodsModule); |
||||||
orderGoodsModule.setStyleModuleId(listzsm.get(k).getStyleModuleId()); |
} |
||||||
orderGoodsModule.setModuleId(listzsm.get(k).getModuleId()); |
GoodsFabric goodsFabric = new GoodsFabric(); |
||||||
zyOrderGoodsModuleMapper.insert(orderGoodsModule); |
QueryWrapper<GoodsFabric> queryWrapperzsf = new QueryWrapper(); |
||||||
} |
queryWrapperzsf.eq("goods_id", zyGoods.getId()); |
||||||
GoodsFabric goodsFabric = new GoodsFabric(); |
List<GoodsFabric> listzsf = zyGoodsFabricMapper.selectList(queryWrapperzsf); |
||||||
QueryWrapper<GoodsFabric> queryWrapperzsf =new QueryWrapper(); |
for (int o = 0; o < listzsf.size(); o++) { |
||||||
queryWrapperzsf.eq("goods_id",zyGoods.getId()); |
OrderGoodsFabric orderGoodsFabric = new OrderGoodsFabric(); |
||||||
List<GoodsFabric> listzsf = zyGoodsFabricMapper.selectList(queryWrapperzsf); |
orderGoodsFabric.setOrderGoodsId(orderGoods.getId()); |
||||||
for (int o = 0 ; o < listzsf.size() ; o++){ |
orderGoodsFabric.setGoodsId(zyGoods.getId()); |
||||||
OrderGoodsFabric orderGoodsFabric = new OrderGoodsFabric(); |
orderGoodsFabric.setFabricId(listzsf.get(o).getFabricId()); |
||||||
orderGoodsFabric.setOrderGoodsId(orderGoods.getId()); |
zyOrderGoodsFabricMapper.insert(orderGoodsFabric); |
||||||
orderGoodsFabric.setGoodsId(zyGoods.getId()); |
} |
||||||
orderGoodsFabric.setFabricId(listzsf.get(o).getFabricId()); |
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
||||||
zyOrderGoodsFabricMapper.insert(orderGoodsFabric); |
QueryWrapper<GoodsAccessories> queryWrapperzsa = new QueryWrapper(); |
||||||
} |
queryWrapperzsa.eq("goods_id", zyGoods.getId()); |
||||||
GoodsAccessories goodsAccessories = new GoodsAccessories(); |
List<GoodsAccessories> listzsa = zyGoodsAccessoriesMapper.selectList(queryWrapperzsa); |
||||||
QueryWrapper<GoodsAccessories> queryWrapperzsa = new QueryWrapper(); |
for (int p = 0; p < listzsa.size(); p++) { |
||||||
queryWrapperzsa.eq("goods_id",zyGoods.getId()); |
OrderGoodsAccessories orderGoodsAccessories = new OrderGoodsAccessories(); |
||||||
List<GoodsAccessories> listzsa = zyGoodsAccessoriesMapper.selectList(queryWrapperzsa); |
orderGoodsAccessories.setOrderGoodsId(orderGoods.getId()); |
||||||
for (int p = 0 ; p < listzsa.size() ; p++){ |
orderGoodsAccessories.setGoodsId(zyGoods.getId()); |
||||||
OrderGoodsAccessories orderGoodsAccessories = new OrderGoodsAccessories(); |
orderGoodsAccessories.setAccessoriesId(listzsa.get(p).getAccessoriesId()); |
||||||
orderGoodsAccessories.setOrderGoodsId(orderGoods.getId()); |
zyOrderGoodsAccessoriesMapper.insert(orderGoodsAccessories); |
||||||
orderGoodsAccessories.setGoodsId(zyGoods.getId()); |
} |
||||||
orderGoodsAccessories.setAccessoriesId(listzsa.get(p).getAccessoriesId()); |
|
||||||
zyOrderGoodsAccessoriesMapper.insert(orderGoodsAccessories); |
|
||||||
} |
} |
||||||
|
List<String> ids = new ArrayList<>(); |
||||||
|
ZyOrders zos = new ZyOrders(); |
||||||
} |
QueryWrapper<ZyOrders> queryWrapperzos = new QueryWrapper(); |
||||||
List<String> ids = new ArrayList<>(); |
queryWrapperzos.eq("order_id", zyOrders.getId()); |
||||||
ZyOrders zos = new ZyOrders(); |
List<ZyOrders> listzos = baseMapper.selectList(queryWrapperzos); |
||||||
QueryWrapper<ZyOrders> queryWrapperzos = new QueryWrapper(); |
if (listzos.size() > 0) { |
||||||
queryWrapperzos.eq("order_id",zyOrders.getId()); |
//return Result.error("该订单已经拆分,不可以再次拆单!");
|
||||||
List<ZyOrders> listzos = baseMapper.selectList(queryWrapperzos); |
return null; |
||||||
if(listzos.size()>0){ |
} else { |
||||||
//return Result.error("该订单已经拆分,不可以再次拆单!");
|
OrderGoods orderGoods = new OrderGoods(); |
||||||
return null; |
QueryWrapper<OrderGoods> queryWrapperog = new QueryWrapper(); |
||||||
}else{ |
queryWrapperog.eq("orders_id", zyOrders.getId()); |
||||||
OrderGoods orderGoods = new OrderGoods(); |
List<OrderGoods> listog = zyOrderGoodsMapper.selectList(queryWrapperog); |
||||||
QueryWrapper<OrderGoods> queryWrapperog = new QueryWrapper(); |
if (listog.size() > 0) { |
||||||
queryWrapperog.eq("orders_id",zyOrders.getId()); |
for (int i = 0; i < listog.size(); i++) { |
||||||
List<OrderGoods> listog = zyOrderGoodsMapper.selectList(queryWrapperog); |
ZyOrders zo = new ZyOrders(); |
||||||
if(listog.size()>0){ |
zo = zyOrders; |
||||||
for (int i = 0 ; i < listog.size() ; i++){ |
zo.setId(null); |
||||||
ZyOrders zo = new ZyOrders(); |
zo.setOrdersNum(getOrdersNum()); |
||||||
zo = zyOrders; |
zo.setOrderId(listog.get(i).getId()); |
||||||
zo.setId(null); |
zo.setFreight(Double.parseDouble("0")); |
||||||
zo.setOrdersNum(getOrdersNum()); |
zo.setIschild(1); |
||||||
zo.setOrderId(listog.get(i).getId()); |
zo.setOrderId(zyOrders.getId()); |
||||||
zo.setFreight(Double.parseDouble("0")); |
zo.setMoney(listog.get(i).getTotalPrice()); |
||||||
zo.setIschild(1); |
zo.setPromotionPrice(listog.get(i).getPromotionPrice()); |
||||||
zo.setOrderId(zyOrders.getId()); |
zo.setActualPayment(listog.get(i).getPayTotalPrice()); |
||||||
zo.setMoney(listog.get(i).getTotalPrice()); |
zo.setGoodsQuantity(1); |
||||||
zo.setPromotionPrice(listog.get(i).getPromotionPrice()); |
baseMapper.insert(zo); |
||||||
zo.setActualPayment(listog.get(i).getPayTotalPrice()); |
ids.add(zo.getId()); |
||||||
zo.setGoodsQuantity(1); |
OrderGoods og = new OrderGoods(); |
||||||
baseMapper.insert(zo); |
og = listog.get(i); |
||||||
ids.add(zo.getId()); |
og.setOrdersId(zo.getId()); |
||||||
OrderGoods og = new OrderGoods(); |
zyOrderGoodsMapper.updateById(og); |
||||||
og = listog.get(i); |
//定时播报
|
||||||
og.setOrdersId(zo.getId()); |
ZySpeechMessage message = new ZySpeechMessage(); |
||||||
zyOrderGoodsMapper.updateById(og); |
//订单商品id
|
||||||
//定时播报
|
message.setOrdergoodsId(zo.getId()); |
||||||
ZySpeechMessage message=new ZySpeechMessage(); |
// //工单id
|
||||||
//订单商品id
|
// message.setWorkorderId();
|
||||||
message.setOrdergoodsId(zo.getId()); |
// //生产计划工序id
|
||||||
// //工单id
|
// message.setZyplanprocessId();
|
||||||
// message.setWorkorderId();
|
//消息
|
||||||
// //生产计划工序id
|
String ordersNum = zo.getOrdersNum(); |
||||||
// message.setZyplanprocessId();
|
String code = ordersNum.substring(ordersNum.length() - 6); |
||||||
//消息
|
message.setMessage("您有新的订单,订单尾号:" + code + ",请及时查看!"); |
||||||
message.setMessage("您有新的订单,订单编号:"+zo.getOrdersNum()+",请及时查看!"); |
zySpeechMessageMapper.insert(message); |
||||||
zySpeechMessageMapper.insert(message); |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
return ids; |
||||||
return ids; |
} |
||||||
} |
|
||||||
|
|
||||||
|
/** |
||||||
/** |
* 生成订单编号 |
||||||
* 生成订单编号 |
* |
||||||
* |
* @param |
||||||
* @param |
* @return |
||||||
* @return |
*/ |
||||||
*/ |
public String getOrdersNum() { |
||||||
public String getOrdersNum() { |
String mrstr = "000000000000000000"; |
||||||
String mrstr = "000000000000000000"; |
QueryWrapper<ZyOrders> qw = new QueryWrapper(); |
||||||
QueryWrapper<ZyOrders> qw=new QueryWrapper(); |
int listsize = baseMapper.selectCount(qw); |
||||||
int listsize = baseMapper.selectCount(qw); |
int strsize = listsize + 1; |
||||||
int strsize = listsize+1; |
String str = strsize + ""; |
||||||
String str = strsize+""; |
int strlength = str.length(); |
||||||
int strlength = str.length(); |
String substr = mrstr.substring(0, mrstr.length() - strlength); |
||||||
String substr = mrstr.substring(0,mrstr.length()-strlength); |
String OrdersNum = substr + str; |
||||||
String OrdersNum = substr+str; |
return OrdersNum; |
||||||
return OrdersNum; |
} |
||||||
} |
|
||||||
|
} |
||||||
} |
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue