diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/XJobUtils.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/XJobUtils.java index c69c28d6..5967edc9 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/XJobUtils.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/XJobUtils.java @@ -30,7 +30,7 @@ public class XJobUtils{ //将时间转为long类型 long start=start_Date.getTime(); //获取30-180秒对应毫秒 - long intervalTime=randInt(s*60,e*60)*1000; + long intervalTime=randInt(s,e)*1000; //总共花费时长 long timeMillis =start+intervalTime; @@ -77,10 +77,10 @@ public class XJobUtils{ return (el-sl)/1000; } - //随机暂停s-e分钟() + //随机暂停s-e秒() public static void sleepTime(int s ,int e) throws InterruptedException { - Thread.sleep(randInt(60*1000*s,60*1000*e)); + Thread.sleep(randInt(1000*s,1000*e)); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java index 636a3e39..77184eb9 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java @@ -203,4 +203,9 @@ public class ZyOrders implements Serializable { @Dict(dicCode = "delivery_status") @ApiModelProperty(value = "交付状态") private java.lang.Integer deliveryStatus; + + /**是否虚拟订单*/ + @Dict(dicCode = "isvirtual") + @ApiModelProperty(value = "是否虚拟订单") + private java.lang.String isvirtual; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrdersJk.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrdersJk.java index edfde838..6672daea 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrdersJk.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrdersJk.java @@ -1,90 +1,95 @@ -package org.jeecg.modules.demo.zyorders.entity; - -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; -import lombok.experimental.Accessors; - -/** - * @Description: 订单基本信息 - * @Author: jeecg-boot - * @Date: 2022-12-26 - * @Version: V1.0 - */ -@Data -public class ZyOrdersJk implements Serializable { - private static final long serialVersionUID = 1L; - - /**运费*/ - @Excel(name = "运费", width = 15) - @ApiModelProperty(value = "运费") - private java.lang.Double freight; - /**交货期*/ - @Excel(name = "交货期", width = 15) - @ApiModelProperty(value = "交货期") - private java.lang.Integer deliveryTime; - /**订单类型*/ - @Excel(name = "订单类型", width = 15, dicCode = "orders_type") - @Dict(dicCode = "orders_type") - @ApiModelProperty(value = "订单类型") - private java.lang.Integer ordersType; - /**顾客id*/ - @Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "顾客id") - private java.lang.String userId; - /**商品条目数量*/ - @Excel(name = "商品条目数量", width = 15) - @ApiModelProperty(value = "商品条目数量") - private java.lang.Integer goodsQuantity; - /**顾客地址id*/ - @Excel(name = "顾客地址id", width = 15) - @ApiModelProperty(value = "顾客地址id") - private java.lang.String addressId; - /**收货人*/ - @Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "收货人") - private java.lang.String receiver; - /**顾客发票id*/ - @Excel(name = "顾客发票id", width = 15) - @ApiModelProperty(value = "顾客发票id") - private java.lang.String invoiceId; - /**销售门店*/ - @Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @ApiModelProperty(value = "销售门店") - private java.lang.String salesEnterpriseId; - /**销售员*/ - @Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") - @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") - @ApiModelProperty(value = "销售员") - private java.lang.String salespersonId; - /**物流企业*/ - @Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") - @ApiModelProperty(value = "物流企业") - private java.lang.String logisticsEnterprisesId; - /**交付状态*/ - @Excel(name = "交付状态", width = 15, dicCode = "delivery_status") - @Dict(dicCode = "delivery_status") - @ApiModelProperty(value = "交付状态") - private java.lang.Integer deliveryStatus; - - /**顾客量体id*/ - @Excel (name = "顾客量体id", width = 15, dictTable = "customer_measure", dicText = "username", dicCode = "id") - @ApiModelProperty (value = "顾客量体id") - private java.lang.String measureId; -} +package org.jeecg.modules.demo.zyorders.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 订单基本信息 + * @Author: jeecg-boot + * @Date: 2022-12-26 + * @Version: V1.0 + */ +@Data +public class ZyOrdersJk implements Serializable { + private static final long serialVersionUID = 1L; + + /**运费*/ + @Excel(name = "运费", width = 15) + @ApiModelProperty(value = "运费") + private java.lang.Double freight; + /**交货期*/ + @Excel(name = "交货期", width = 15) + @ApiModelProperty(value = "交货期") + private java.lang.Integer deliveryTime; + /**订单类型*/ + @Excel(name = "订单类型", width = 15, dicCode = "orders_type") + @Dict(dicCode = "orders_type") + @ApiModelProperty(value = "订单类型") + private java.lang.Integer ordersType; + /**顾客id*/ + @Excel(name = "顾客id", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "顾客id") + private java.lang.String userId; + /**商品条目数量*/ + @Excel(name = "商品条目数量", width = 15) + @ApiModelProperty(value = "商品条目数量") + private java.lang.Integer goodsQuantity; + /**顾客地址id*/ + @Excel(name = "顾客地址id", width = 15) + @ApiModelProperty(value = "顾客地址id") + private java.lang.String addressId; + /**收货人*/ + @Excel(name = "收货人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "收货人") + private java.lang.String receiver; + /**顾客发票id*/ + @Excel(name = "顾客发票id", width = 15) + @ApiModelProperty(value = "顾客发票id") + private java.lang.String invoiceId; + /**销售门店*/ + @Excel(name = "销售门店", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "销售门店") + private java.lang.String salesEnterpriseId; + /**销售员*/ + @Excel(name = "销售员", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "销售员") + private java.lang.String salespersonId; + /**物流企业*/ + @Excel(name = "物流企业", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "物流企业") + private java.lang.String logisticsEnterprisesId; + /**交付状态*/ + @Excel(name = "交付状态", width = 15, dicCode = "delivery_status") + @Dict(dicCode = "delivery_status") + @ApiModelProperty(value = "交付状态") + private java.lang.Integer deliveryStatus; + + /**是否虚拟订单*/ + @Dict(dicCode = "isvirtual") + @ApiModelProperty(value = "是否虚拟订单") + private java.lang.String isvirtual; + + /**顾客量体id*/ + @Excel (name = "顾客量体id", width = 15, dictTable = "customer_measure", dicText = "username", dicCode = "id") + @ApiModelProperty (value = "顾客量体id") + private java.lang.String measureId; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java index b592a03f..20cf5508 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java @@ -192,6 +192,7 @@ public class ZyOrdersServiceImpl extends ServiceImpl i zyOrders.setOrdersType(zyOrdersJk.getOrdersType()); zyOrders.setUserId(zyOrdersJk.getUserId()); zyOrders.setGoodsQuantity(zyOrdersJk.getGoodsQuantity()); + zyOrders.setIsvirtual(zyOrdersJk.getIsvirtual()); //顾客地址 if (zyOrdersJk.getAddressId() != null && zyOrdersJk.getAddressId() != "") { CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); @@ -315,6 +316,8 @@ public class ZyOrdersServiceImpl extends ServiceImpl i zo.setPromotionPrice(listog.get(i).getPromotionPrice()); zo.setActualPayment(listog.get(i).getPayTotalPrice()); zo.setGoodsQuantity(1); + zo.setDeliveryStatus(2); + zo.setIsvirtual("1"); baseMapper.insert(zo); ids.add(zo.getId()); OrderGoods og = new OrderGoods(); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java index d33f83be..5f11fcee 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java @@ -19,6 +19,8 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.ZyProductPlan; import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper; import org.jeecg.modules.productplan.mapper.ZyProductPlanMapper; +import org.jeecg.modules.system.entity.SysDictItem; +import org.jeecg.modules.system.service.ISysDictItemService; import org.jeecg.modules.workorder.entity.WorkOrder; import org.jeecg.modules.workorder.mapper.WorkOrderMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -77,7 +79,13 @@ public class HangerLocationServiceImpl extends ServiceImpl woList) { - + SysDictItem dictItem1=sysDictItemService.getById(dictItem_id3); + SysDictItem dictItem2=sysDictItemService.getById(dictItem_id4); + int time_s=Integer.parseInt(dictItem1.getItemValue()); + int time_e=Integer.parseInt(dictItem2.getItemValue()); //1、读取工单,得到生产计划 if(woList.size()<=0) { @@ -112,17 +123,16 @@ public class HangerLocationServiceImpl extends ServiceImpl qws=new QueryWrapper<>(); List sensorList=sensorMapper.selectList(qws); - //#region2.遍历list 吊挂(开始+结束)+传感器记录(每个)+生产记录(每个) + //#region2.遍历生产计划 吊挂(开始+结束)+传感器记录(每个)+生产记录(每个) for(ZyProductPlan item :productPlanList) { //3、每个生产计划对应工序,每一道工序对应工位 QueryWrapper qwProcess=new QueryWrapper<>(); + qwProcess.eq("plan_id",item.getId()); List listProcess=zyPlanProcessMapper.selectList(qwProcess); //服装进入制作工艺过程 - long timeMillis = System.currentTimeMillis(); - //将获取时间转为日期类型 - Date start_time=XJobUtils.longToDate(timeMillis); + Date start_time=new Date(); //生产记录 List arrPR=new ArrayList<>(); @@ -138,7 +148,7 @@ public class HangerLocationServiceImpl extends ServiceImpl paidan(ZyOrders zyOrders,String depId) { //订单ID String orderId=zyOrders.getId();