导入问题,子单号问题
This commit is contained in:
parent
6f2c5f534d
commit
0a4264c9ac
|
|
@ -380,7 +380,7 @@ public class OrderController extends BaseController {
|
||||||
// 创建子订单
|
// 创建子订单
|
||||||
OrderDetail od = new OrderDetail();
|
OrderDetail od = new OrderDetail();
|
||||||
od.setDeptId(om.getDeptId());
|
od.setDeptId(om.getDeptId());
|
||||||
od.setCode(orderDetailService.createCode());
|
od.setCode(orderDetailService.createCode(om.getCode()));
|
||||||
od.setOrderMasterId(om.getId());
|
od.setOrderMasterId(om.getId());
|
||||||
od.setOrderMasterCode(om.getCode());
|
od.setOrderMasterCode(om.getCode());
|
||||||
od.setCustomerId(om.getCustomerId());
|
od.setCustomerId(om.getCustomerId());
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,10 @@ public class OrderDetailController extends BaseController {
|
||||||
// 填充商品三级类目
|
// 填充商品三级类目
|
||||||
if(good.getDeptGoodsCategoryId() != null){
|
if(good.getDeptGoodsCategoryId() != null){
|
||||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId());
|
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId());
|
||||||
|
if(deptGoodsCategory == null){
|
||||||
|
deptGoodsCategory = new DeptGoodsCategory();
|
||||||
|
deptGoodsCategory.setGoodsCategoryId(good.getDeptGoodsCategoryId());
|
||||||
|
}
|
||||||
if(deptGoodsCategory != null){
|
if(deptGoodsCategory != null){
|
||||||
GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId());
|
GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId());
|
||||||
if(one != null && one.getParentCategoryId() != null){
|
if(one != null && one.getParentCategoryId() != null){
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ghy.web.controller.order;
|
package com.ghy.web.controller.order;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.db.sql.Order;
|
import cn.hutool.db.sql.Order;
|
||||||
import com.ghy.common.adapay.model.AdapayStatusEnum;
|
import com.ghy.common.adapay.model.AdapayStatusEnum;
|
||||||
import com.ghy.common.adapay.model.PayParam;
|
import com.ghy.common.adapay.model.PayParam;
|
||||||
|
|
@ -215,7 +216,9 @@ public class OrderMasterController extends BaseController {
|
||||||
ExcelUtil<SysOrderRequest> util = new ExcelUtil<SysOrderRequest>(SysOrderRequest.class);
|
ExcelUtil<SysOrderRequest> util = new ExcelUtil<SysOrderRequest>(SysOrderRequest.class);
|
||||||
List<SysOrderRequest> jsonObjects = util.importExcel(file.getInputStream());
|
List<SysOrderRequest> jsonObjects = util.importExcel(file.getInputStream());
|
||||||
for (SysOrderRequest model : jsonObjects) {
|
for (SysOrderRequest model : jsonObjects) {
|
||||||
this.sysOrder(format(model));
|
if(NumberUtil.isNumber(model.getSeq())){
|
||||||
|
this.sysOrder(format(model));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success(jsonObjects);
|
return AjaxResult.success(jsonObjects);
|
||||||
}
|
}
|
||||||
|
|
@ -223,14 +226,14 @@ public class OrderMasterController extends BaseController {
|
||||||
public SysOrderAssignRequest format(SysOrderRequest orderRequest) throws Exception{
|
public SysOrderAssignRequest format(SysOrderRequest orderRequest) throws Exception{
|
||||||
SysOrderAssignRequest request = new SysOrderAssignRequest();
|
SysOrderAssignRequest request = new SysOrderAssignRequest();
|
||||||
if(StringUtils.isEmpty(orderRequest.getSeq())){
|
if(StringUtils.isEmpty(orderRequest.getSeq())){
|
||||||
throw new Exception("导入列表中,序号不能为空!");
|
throw new Exception("导入表格序号,序号不能为空!");
|
||||||
}
|
}
|
||||||
if(StringUtils.isEmpty(orderRequest.getName())){
|
if(StringUtils.isEmpty(orderRequest.getName())){
|
||||||
throw new Exception(orderRequest.getSeq() + "行,导入姓名不能为空!");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",姓名不能为空!");
|
||||||
}
|
}
|
||||||
request.setCustomerName(orderRequest.getName());
|
request.setCustomerName(orderRequest.getName());
|
||||||
if(StringUtils.isEmpty(orderRequest.getPhone())){
|
if(StringUtils.isEmpty(orderRequest.getPhone())){
|
||||||
throw new Exception(orderRequest.getSeq() + "行,导入手机号不能为空!");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",导入手机号不能为空!");
|
||||||
}
|
}
|
||||||
request.setCustomerPhone(orderRequest.getPhone());
|
request.setCustomerPhone(orderRequest.getPhone());
|
||||||
request.setServDate(orderRequest.getDate());
|
request.setServDate(orderRequest.getDate());
|
||||||
|
|
@ -238,32 +241,50 @@ public class OrderMasterController extends BaseController {
|
||||||
request.setGoodsBrand(orderRequest.getBrand());
|
request.setGoodsBrand(orderRequest.getBrand());
|
||||||
request.setRemark(orderRequest.getRemark());
|
request.setRemark(orderRequest.getRemark());
|
||||||
if(StringUtils.isEmpty(orderRequest.getMode())){
|
if(StringUtils.isEmpty(orderRequest.getMode())){
|
||||||
throw new Exception(orderRequest.getSeq() + "行,下单模式不能为空!");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",下单模式不能为空!");
|
||||||
}else {
|
}else {
|
||||||
if("带价发布".equals(orderRequest.getMode())){
|
if(orderRequest.getMode().contains("-")){
|
||||||
request.setOrderMode("02");
|
String orderModel = orderRequest.getMode().split("-")[0];
|
||||||
request.setPayMode("02");
|
String payType = orderRequest.getMode().split("-")[1];
|
||||||
}else if("一票价".equals(orderRequest.getMode())){
|
if("带价下单".equals(orderModel)){
|
||||||
request.setOrderMode("01");
|
request.setOrderMode("02");
|
||||||
request.setPayMode("02");
|
}else if("一票价".equals(orderModel)){
|
||||||
|
request.setOrderMode("01");
|
||||||
|
}else {
|
||||||
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",下单模式填写错误!");
|
||||||
|
}
|
||||||
|
if("到付".equals(payType)){
|
||||||
|
request.setPayMode("02");
|
||||||
|
}else {
|
||||||
|
request.setPayMode("01");
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
throw new Exception(orderRequest.getSeq() + "行,下单模式填写错误!");
|
if("带价下单".equals(orderRequest.getMode())){
|
||||||
|
request.setOrderMode("02");
|
||||||
|
request.setPayMode("02");
|
||||||
|
}else if("一票价".equals(orderRequest.getMode())){
|
||||||
|
request.setOrderMode("01");
|
||||||
|
request.setPayMode("02");
|
||||||
|
}else {
|
||||||
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",下单模式填写错误!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StringUtils.isEmpty(orderRequest.getPrice())){
|
if(StringUtils.isEmpty(orderRequest.getPrice())){
|
||||||
throw new Exception(orderRequest.getSeq() + "行,导入价格不能为空!");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",价格不能为空!");
|
||||||
}
|
}
|
||||||
request.setPrice(new BigDecimal(orderRequest.getPrice()));
|
request.setPrice(new BigDecimal(orderRequest.getPrice()));
|
||||||
request.setVideoUrl(orderRequest.getUrl());
|
request.setVideoUrl(orderRequest.getUrl());
|
||||||
request.setImageUrl("http://gqz.opsoul.com/default.jpeg");
|
request.setImageUrl("http://gqz.opsoul.com/default.jpeg");
|
||||||
List<SysOrderGoodsStandards> goodsStandards = new ArrayList<>();
|
List<SysOrderGoodsStandards> goodsStandards = new ArrayList<>();
|
||||||
String [] categoryNames = orderRequest.getCategory().split("-");
|
String [] categoryNames = orderRequest.getCategory().split("-");
|
||||||
if(categoryNames.length != 4){
|
if(categoryNames.length != 3){
|
||||||
throw new Exception(orderRequest.getSeq() + "行,导入四级类目数据格式错误");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",三级类目数据格式错误");
|
||||||
}else {
|
}else {
|
||||||
if(StringUtils.isEmpty(categoryNames[0])||StringUtils.isEmpty(categoryNames[1])||StringUtils.isEmpty(categoryNames[2])){
|
if(StringUtils.isEmpty(categoryNames[0])||StringUtils.isEmpty(categoryNames[1])||StringUtils.isEmpty(orderRequest.getLastCategory())){
|
||||||
throw new Exception(orderRequest.getSeq() + "行,前三级类目不能为空,请参照系统填写");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",前三级类目不能为空,请参照系统填写");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
// 第一层
|
// 第一层
|
||||||
|
|
@ -287,16 +308,22 @@ public class OrderMasterController extends BaseController {
|
||||||
// 第四层
|
// 第四层
|
||||||
GoodsCategory param4 = new GoodsCategory();
|
GoodsCategory param4 = new GoodsCategory();
|
||||||
param4.setParentCategoryId(category3.getGoodsCategoryId());
|
param4.setParentCategoryId(category3.getGoodsCategoryId());
|
||||||
param4.setGoodsCategoryName(categoryNames[3]);
|
param4.setGoodsCategoryName(orderRequest.getLastCategory());
|
||||||
GoodsCategory category4 = goodsCategoryService.selectGoodsCategoryList(param4).get(0);
|
List<GoodsCategory> categories = goodsCategoryService.selectGoodsCategoryList(param4);
|
||||||
|
if(CollectionUtils.isEmpty(categories)){
|
||||||
|
param4.setGoodsCategoryName(null);
|
||||||
|
categories = goodsCategoryService.selectGoodsCategoryList(param4);
|
||||||
|
}
|
||||||
|
GoodsCategory category4 = categories.get(0);
|
||||||
|
|
||||||
SysOrderGoodsStandards standards = new SysOrderGoodsStandards();
|
SysOrderGoodsStandards standards = new SysOrderGoodsStandards();
|
||||||
DeptGoodsCategory deptGoodsCategory2 = deptGoodsCategoryService.selectOneByGoodsCategoryId(category4.getGoodsCategoryId());
|
DeptGoodsCategory deptGoodsCategory2 = deptGoodsCategoryService.selectOneByGoodsCategoryId(category4.getGoodsCategoryId());
|
||||||
standards.setDeptCategoryId(deptGoodsCategory2.getDeptGoodsCategoryId());
|
standards.setDeptCategoryId(deptGoodsCategory2.getDeptGoodsCategoryId());
|
||||||
standards.setGoodsStandardNum(Integer.parseInt(orderRequest.getNum()));
|
standards.setGoodsStandardNum(Integer.parseInt(orderRequest.getNum()));
|
||||||
|
standards.setGoodsStandardName(orderRequest.getLastCategory());
|
||||||
goodsStandards.add(standards);
|
goodsStandards.add(standards);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
throw new Exception(orderRequest.getSeq() + "行,前三级类目有错误,请参照系统填写");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",前三级类目有错误,请参照系统填写");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -306,10 +333,12 @@ public class OrderMasterController extends BaseController {
|
||||||
addressName = orderRequest.getAddress().split(",");
|
addressName = orderRequest.getAddress().split(",");
|
||||||
if(addressName.length == 1){
|
if(addressName.length == 1){
|
||||||
addressName = orderRequest.getAddress().split(" ");
|
addressName = orderRequest.getAddress().split(" ");
|
||||||
|
}if(addressName.length == 1){
|
||||||
|
addressName = orderRequest.getAddress().split("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(addressName.length < 4){
|
if(addressName.length < 4){
|
||||||
throw new Exception("导入地址数据格式错误");
|
throw new Exception("导入表格序号" + orderRequest.getSeq() + ",地址数据格式错误");
|
||||||
}else {
|
}else {
|
||||||
// 省
|
// 省
|
||||||
SysArea param1 = new SysArea();
|
SysArea param1 = new SysArea();
|
||||||
|
|
@ -406,7 +435,7 @@ public class OrderMasterController extends BaseController {
|
||||||
request.getOrderGoodsStandards().forEach(list -> {
|
request.getOrderGoodsStandards().forEach(list -> {
|
||||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(list.getDeptCategoryId());
|
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(list.getDeptCategoryId());
|
||||||
GoodsStandard standard = new GoodsStandard();
|
GoodsStandard standard = new GoodsStandard();
|
||||||
standard.setGoodsStandardName(deptGoodsCategory.getGoodsCategoryName());
|
standard.setGoodsStandardName(list.getGoodsStandardName());
|
||||||
standard.setDeptGoodsCategoryId(deptGoodsCategory.getDeptGoodsCategoryId());
|
standard.setDeptGoodsCategoryId(deptGoodsCategory.getDeptGoodsCategoryId());
|
||||||
standard.setGoodsCategoryName(deptGoodsCategory.getGoodsCategoryName());
|
standard.setGoodsCategoryName(deptGoodsCategory.getGoodsCategoryName());
|
||||||
standard.setGoodsPrice(goodsPrice);
|
standard.setGoodsPrice(goodsPrice);
|
||||||
|
|
@ -1146,6 +1175,10 @@ public class OrderMasterController extends BaseController {
|
||||||
// 填充商品三级类目
|
// 填充商品三级类目
|
||||||
if(good.getDeptGoodsCategoryId() != null){
|
if(good.getDeptGoodsCategoryId() != null){
|
||||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId());
|
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(good.getDeptGoodsCategoryId());
|
||||||
|
if(deptGoodsCategory == null){
|
||||||
|
deptGoodsCategory = new DeptGoodsCategory();
|
||||||
|
deptGoodsCategory.setGoodsCategoryId(good.getDeptGoodsCategoryId());
|
||||||
|
}
|
||||||
if(deptGoodsCategory != null){
|
if(deptGoodsCategory != null){
|
||||||
GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId());
|
GoodsCategory one = goodsCategoryService.selectById(deptGoodsCategory.getGoodsCategoryId());
|
||||||
if(one != null && one.getParentCategoryId() != null){
|
if(one != null && one.getParentCategoryId() != null){
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,26 @@ public class SysOrderRequest {
|
||||||
@Excel(name = "category")
|
@Excel(name = "category")
|
||||||
private String category;
|
private String category;
|
||||||
|
|
||||||
|
@Excel(name = "lastCategory")
|
||||||
|
private String lastCategory;
|
||||||
|
|
||||||
@Excel(name = "brand")
|
@Excel(name = "brand")
|
||||||
private String brand;
|
private String brand;
|
||||||
|
|
||||||
@Excel(name = "num")
|
|
||||||
private String num;
|
|
||||||
|
|
||||||
@Excel(name = "date")
|
@Excel(name = "date")
|
||||||
private String date;
|
private String date;
|
||||||
|
|
||||||
@Excel(name = "time")
|
@Excel(name = "time")
|
||||||
private String time;
|
private String time;
|
||||||
|
|
||||||
@Excel(name = "address")
|
@Excel(name = "mode")
|
||||||
private String address;
|
private String mode;
|
||||||
|
|
||||||
|
@Excel(name = "num")
|
||||||
|
private String num;
|
||||||
|
|
||||||
|
@Excel(name = "price")
|
||||||
|
private String price;
|
||||||
|
|
||||||
@Excel(name = "name")
|
@Excel(name = "name")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
@ -33,11 +39,8 @@ public class SysOrderRequest {
|
||||||
@Excel(name = "phone")
|
@Excel(name = "phone")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@Excel(name = "mode")
|
@Excel(name = "address")
|
||||||
private String mode;
|
private String address;
|
||||||
|
|
||||||
@Excel(name = "price")
|
|
||||||
private String price;
|
|
||||||
|
|
||||||
@Excel(name = "remark")
|
@Excel(name = "remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
@ -48,6 +51,9 @@ public class SysOrderRequest {
|
||||||
@Excel(name = "award")
|
@Excel(name = "award")
|
||||||
private String award;
|
private String award;
|
||||||
|
|
||||||
|
@Excel(name = "infoMoney")
|
||||||
|
private String infoMoney;
|
||||||
|
|
||||||
@Excel(name = "url")
|
@Excel(name = "url")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ shiro:
|
||||||
cipherKey:
|
cipherKey:
|
||||||
session:
|
session:
|
||||||
# Session超时时间,-1代表永不过期(默认30分钟)
|
# Session超时时间,-1代表永不过期(默认30分钟)
|
||||||
expireTime: 30
|
expireTime: 720
|
||||||
# 同步session到数据库的周期(默认1分钟)
|
# 同步session到数据库的周期(默认1分钟)
|
||||||
dbSyncPeriod: 1
|
dbSyncPeriod: 1
|
||||||
# 相隔多久检查一次session的有效性,默认就是10分钟
|
# 相隔多久检查一次session的有效性,默认就是10分钟
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ var table = {
|
||||||
importTemplate: function() {
|
importTemplate: function() {
|
||||||
$.get(activeWindow().table.options.importTemplateUrl, function(result) {
|
$.get(activeWindow().table.options.importTemplateUrl, function(result) {
|
||||||
if (result.code == web_status.SUCCESS) {
|
if (result.code == web_status.SUCCESS) {
|
||||||
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
|
window.location.href = "http://gqz.opsoul.com/%E6%89%B9%E9%87%8F%E4%B8%8B%E5%8D%95%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xls";
|
||||||
} else if (result.code == web_status.WARNING) {
|
} else if (result.code == web_status.WARNING) {
|
||||||
$.modal.alertWarning(result.msg)
|
$.modal.alertWarning(result.msg)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -632,8 +632,9 @@
|
||||||
+ '<div>'
|
+ '<div>'
|
||||||
+ '<small> ' + row.code + '<small/> <br>'
|
+ '<small> ' + row.code + '<small/> <br>'
|
||||||
+ '<small> ' + row.consoleGoodsName+ '<small/> <br>'
|
+ '<small> ' + row.consoleGoodsName+ '<small/> <br>'
|
||||||
+ '<small>' + row.addressName +' ' + row.addressName + '</small> <br>'
|
+ '<small> 联系人:' + row.addressName + '</small> <br>'
|
||||||
+ '<small>' + row.address + '</small> <br>'
|
+ '<small> 联系电话:' + row.addressPhone + '</small> <br>'
|
||||||
|
+ '<small> 联系地址:' + row.address + '</small> <br>'
|
||||||
+ '<small> 下单时间:' + row.createTime + '</small> <br>'
|
+ '<small> 下单时间:' + row.createTime + '</small> <br>'
|
||||||
+ '<small> 预约时间:' + row.mixExpectTime + '</small> <br>'
|
+ '<small> 预约时间:' + row.mixExpectTime + '</small> <br>'
|
||||||
+ '<small> 总金额:' + row.financialMasterMoney + '元 应得金额:' + row.financialDetailMoney + '元</small> <br>'
|
+ '<small> 总金额:' + row.financialMasterMoney + '元 应得金额:' + row.financialDetailMoney + '元</small> <br>'
|
||||||
|
|
|
||||||
|
|
@ -313,8 +313,7 @@
|
||||||
shiro:hasPermission="order:order:export">
|
shiro:hasPermission="order:order:export">
|
||||||
<i class="fa fa-download"></i> 导出
|
<i class="fa fa-download"></i> 导出
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-warning" onclick="$.table.importExcel()"
|
<a class="btn btn-warning" onclick="$.table.importExcel()">
|
||||||
shiro:hasPermission="order:order:import">
|
|
||||||
<i class="fa fa-download"></i> 导入
|
<i class="fa fa-download"></i> 导入
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-default" onclick="mergePay()">
|
<a class="btn btn-default" onclick="mergePay()">
|
||||||
|
|
@ -997,7 +996,7 @@
|
||||||
<input type="file" id="file" name="file"/>
|
<input type="file" id="file" name="file"/>
|
||||||
<div class="mt10 pt5">
|
<div class="mt10 pt5">
|
||||||
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
|
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
|
||||||
<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
|
<a href="http://gqz.opsoul.com/%E6%89%B9%E9%87%8F%E4%B8%8B%E5%8D%95%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xls" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
|
||||||
</div>
|
</div>
|
||||||
<font color="red" class="pull-left mt10">
|
<font color="red" class="pull-left mt10">
|
||||||
提示:仅允许导入“xls”或“xlsx”格式文件!
|
提示:仅允许导入“xls”或“xlsx”格式文件!
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,6 @@ public class SysOrderGoodsStandards {
|
||||||
|
|
||||||
private Integer goodsStandardNum;
|
private Integer goodsStandardNum;
|
||||||
|
|
||||||
|
private String goodsStandardName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public interface OrderDetailService {
|
||||||
/**
|
/**
|
||||||
* 创建code
|
* 创建code
|
||||||
*/
|
*/
|
||||||
String createCode();
|
String createCode(String orderMasterCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单id集合信息进行查询封装成为map数据,
|
* 根据订单id集合信息进行查询封装成为map数据,
|
||||||
|
|
|
||||||
|
|
@ -225,11 +225,15 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized String createCode() {
|
public synchronized String createCode(String orderMasterCode) {
|
||||||
INDEX.compareAndSet(9999L, 1L);
|
OrderDetail param = new OrderDetail();
|
||||||
LocalDateTime now = LocalDateTime.now();
|
param.setOrderMasterCode(orderMasterCode);
|
||||||
// 得到的CODE长度相同
|
List<OrderDetail> details = orderDetailMapper.selectOrderDetailList(param);
|
||||||
return "od" + now.format(MINI_FORMATTER) + String.format("%04d", INDEX.getAndIncrement());
|
int count = 0;
|
||||||
|
if(CollectionUtils.isNotEmpty(details)){
|
||||||
|
count = details.size();
|
||||||
|
}
|
||||||
|
return orderMasterCode + "-" + (count+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue