2023-06-3-01-bug

master
喻忠伟 1 year ago
parent 894776036e
commit 689344098a
  1. 6
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/XJobUtils.java
  2. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrders.java
  3. 185
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/entity/ZyOrdersJk.java
  4. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java
  5. 52
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java
  6. 14
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java
  7. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.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));
}

@ -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;
}

@ -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;
}

@ -192,6 +192,7 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> 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<ZyOrdersMapper, ZyOrders> 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();

@ -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<HangerLocationMapper,
@Autowired
private HangRecordMapper hangRecordMapper;
//数据字典
@Autowired
private ISysDictItemService sysDictItemService;//
//定时间隔
private String dictItem_id3="1664449357463691266";
private String dictItem_id4="1664449522291449858";
@Override
@ -91,7 +99,10 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
*/
@Override
public void recordAuto(List<String> 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<HangerLocationMapper,
QueryWrapper<Sensor> qws=new QueryWrapper<>();
List<Sensor> sensorList=sensorMapper.selectList(qws);
//#region2.遍历list 吊挂(开始+结束)+传感器记录(每个)+生产记录(每个)
//#region2.遍历生产计划 吊挂(开始+结束)+传感器记录(每个)+生产记录(每个)
for(ZyProductPlan item :productPlanList)
{
//3、每个生产计划对应工序,每一道工序对应工位
QueryWrapper<ZyPlanProcess> qwProcess=new QueryWrapper<>();
qwProcess.eq("plan_id",item.getId());
List<ZyPlanProcess> listProcess=zyPlanProcessMapper.selectList(qwProcess);
//服装进入制作工艺过程
long timeMillis = System.currentTimeMillis();
//将获取时间转为日期类型
Date start_time=XJobUtils.longToDate(timeMillis);
Date start_time=new Date();
//生产记录
List<ProductRecord> arrPR=new ArrayList<>();
@ -138,7 +148,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
//开始时间
Date str01= start_time;
//结束时间
Date str02= XJobUtils.randomIntervaltime(str01,1,5);
Date str02= XJobUtils.randomIntervaltime(str01,time_s,time_e);
//生产时间
long time=XJobUtils.dateToLong(str01,str02);
@ -161,6 +171,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
prmodel.setDuration(time+"");
//状态
prmodel.setStatus("1");
productRecordMapper.insert(prmodel);
arrPR.add(prmodel);
//#endregion
@ -189,6 +200,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
srmodel.setProductIdenti(item.getProductCode());
//触发时间
srmodel.setTriggerTime(str01);
sensorRecordMapper.insert(srmodel);
arrSR.add(srmodel);
}
//查找出
@ -211,6 +223,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
srmodel.setProductIdenti(item.getProductCode());
//触发时间
srmodel.setTriggerTime(str01);
sensorRecordMapper.insert(srmodel);
arrSR.add(srmodel);
}
//#endregion
@ -231,26 +244,27 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
hrmodel.setDuration(time+"");
//状态
hrmodel.setStatus("1");
hangRecordMapper.insert(hrmodel);
arrHR.add(hrmodel);
//#endregion
//间隔时间
start_time=XJobUtils.randomIntervaltime(str01,1,2);
start_time=XJobUtils.randomIntervaltime(str01,time_s,time_e);
}
//#endregion
//#region批量保存
for(ProductRecord arr:arrPR)
{//生产记录
productRecordMapper.insert(arr);
}
for(SensorRecord arr:arrSR)
{//传感器
sensorRecordMapper.insert(arr);
}
for(HangRecord arr:arrHR)
{//吊挂
hangRecordMapper.insert(arr);
}
// for(ProductRecord arr:arrPR)
// {//生产记录
// productRecordMapper.insert(arr);
// }
// for(SensorRecord arr:arrSR)
// {//传感器
// sensorRecordMapper.insert(arr);
// }
// for(HangRecord arr:arrHR)
// {//吊挂
// hangRecordMapper.insert(arr);
// }
//#endregion
}

@ -378,11 +378,15 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
ZyPlanProcess en = new ZyPlanProcess();
en.setProcessId(o.getProcessId());
ZyProcess zyProcess = iZyProcessService.getById(o.getProcessId());
en.setProcessName(StringUtils.isNotBlank(zyProcess.getProcessName()) ? zyProcess.getProcessName() : "");
en.setPlanId(zyPlanProcess.getPlanId());
en.setTotalMachine(!ObjectUtils.isEmpty(zyProcess.getTotalMachine()) ? zyProcess.getTotalMachine() : 0);
en.setTotalMaunal(!ObjectUtils.isEmpty(zyProcess.getTotalMaunal()) ? zyProcess.getTotalMaunal() : 0);
saveList.add(en);
if(zyProcess!=null)
{
en.setProcessName(StringUtils.isNotBlank(zyProcess.getProcessName()) ? zyProcess.getProcessName() : "");
en.setPlanId(zyPlanProcess.getPlanId());
en.setTotalMachine(!ObjectUtils.isEmpty(zyProcess.getTotalMachine()) ? zyProcess.getTotalMachine() : 0);
en.setTotalMaunal(!ObjectUtils.isEmpty(zyProcess.getTotalMaunal()) ? zyProcess.getTotalMaunal() : 0);
saveList.add(en);
}
});
this.saveBatch(saveList);
}

@ -69,6 +69,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@ -209,6 +210,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
* @return
*/
@Override
@Transactional (readOnly = false, rollbackFor = Exception.class)
public Result<?> paidan(ZyOrders zyOrders,String depId) {
//订单ID
String orderId=zyOrders.getId();

Loading…
Cancel
Save