Merge remote-tracking branch 'origin/master' into zhc4dev

zhc4dev
zhc077 2 years ago
commit 16d752c3a6
  1. 1
      ant-design-vue-jeecg/package.json
  2. 8
      ant-design-vue-jeecg/src/views/device/modules/ZyDeviceForm.vue
  3. 4
      ant-design-vue-jeecg/src/views/erp/accessories/ZyAccessoriesList.vue
  4. 2
      ant-design-vue-jeecg/src/views/erp/accessories/modules/ZyAccessoriesForm.vue
  5. 10
      ant-design-vue-jeecg/src/views/erp/fabric/modules/ZyFabricTypeForm.vue
  6. 9
      ant-design-vue-jeecg/src/views/process/ZyProcessList.vue
  7. 2
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessForm.vue
  8. 2
      ant-design-vue-jeecg/src/views/system/modules/DepartModal.vue
  9. 86
      jeecg-boot/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/XJobUtils.java
  10. 1
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/accessories/controller/ZyAccessoriesController.java
  11. 6
      jeecg-boot/jeecg-boot-module-erp/src/main/java/org/jeecg/modules/demo/accessories/entity/ZyAccessories.java
  12. 8
      jeecg-boot/jeecg-boot-module-system/pom.xml
  13. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/impl/ZyOrdersServiceImpl.java
  14. 86
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangerlocation/service/impl/HangerLocationServiceImpl.java
  15. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hangermaker/service/impl/HangerMakerServiceImpl.java
  16. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java
  17. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyProductPlanServiceImpl.java
  18. 59
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java

@ -11,7 +11,6 @@
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.11.4", "@antv/data-set": "^0.11.4",
"@jeecg/antd-online-mini": "2.4.5-RC",
"@jiaminghi/data-view": "^2.10.0", "@jiaminghi/data-view": "^2.10.0",
"@tinymce/tinymce-vue": "2.1.0", "@tinymce/tinymce-vue": "2.1.0",
"@toast-ui/editor": "^2.1.2", "@toast-ui/editor": "^2.1.2",

@ -77,8 +77,8 @@
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-model-item label="设备品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status"> <a-form-model-item label="设备品牌" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
<j-dict-select-tag v-model="model.canshu" dictCode="zy_devicebrand,brand,id" <j-dict-select-tag v-model="model.brandId" dictCode="zy_devicebrand,brand,id"
placeholder="设备品牌" @change="canshu"></j-dict-select-tag> placeholder="设备品牌" ></j-dict-select-tag>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
@ -139,7 +139,7 @@
validatorRules: { validatorRules: {
name:[ name:[
{ required: true, message: '请输入设备名称!'}, { required: true, message: '请输入设备名称!'},
{min: 1, max: 50, message: '最多输入50字!', trigger: 'blur'}, {min: 1, max: 200, message: '最多输入200字!', trigger: 'blur'},
], ],
}, },
url: { url: {
@ -161,7 +161,7 @@
methods: { methods: {
canshu(){ canshu(){
this.parm1.brand_id=this.model.canshu this.parm1.brand_id=this.model.canshu
console.log(this.parm1) // console.log(this.parm1)
}, },
add () { add () {
this.edit(this.modelDefault); this.edit(this.modelDefault);

@ -84,9 +84,9 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<!-- <a @click="handleEdit(record)">编辑</a>--> <a @click="handleEdit(record)">编辑</a>
<!-- <a-divider type="vertical" />--> <a-divider type="vertical" />
<!-- --> <!-- -->
<a @click="handleDetail(record.id)">详情</a> <a @click="handleDetail(record.id)">详情</a>

@ -8,7 +8,7 @@
<j-popup <j-popup
v-model="model.typeName" v-model="model.typeName"
field="typeName" field="typeName"
org-fields="nums,contents" org-fields="id,contents"
dest-fields="typeId,typeName" dest-fields="typeId,typeName"
code="zy_accessories_type" code="zy_accessories_type"
:multi="false" :multi="false"

@ -82,7 +82,15 @@
add () { add () {
var n=4 var n=4
getAction(this.url.weiyi,{id:this.model.nums}).then((res)=>{ getAction(this.url.weiyi,{id:this.model.nums}).then((res)=>{
var num=parseInt(res.result,10)+1 var num="";
if(res.message!="")
{
num=parseInt(res.message,10)+1
}else
{
num="0001";
}
var num=parseInt(res.message,10)+1
num=num.toString() num=num.toString()
while(num.length<n){ while(num.length<n){
num="0"+num num="0"+num

@ -335,6 +335,15 @@ export default {
enterpriseId:'', enterpriseId:'',
dictOptions: {}, dictOptions: {},
superFieldList: [], superFieldList: [],
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
} }
}, },
created() { created() {

@ -9,7 +9,7 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeId"> <a-form-model-item label="服装类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeName ">
<j-popup <j-popup
v-model="model.typeName" v-model="model.typeName"
field="type_name" field="type_name"

@ -41,7 +41,7 @@
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="缩写"> label="缩写">
<a-input placeholder="请输入手机号" v-decorator="['departNameAbbr', validatorRules.departNameAbbr ]"/> <a-input placeholder="请输入缩写" v-decorator="['departNameAbbr', validatorRules.departNameAbbr ]"/>
</a-form-item> </a-form-item>
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsPicture"> <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="goodsPicture">
<j-image-upload isMultiple v-model="model.goodsPicture" ></j-image-upload> <j-image-upload isMultiple v-model="model.goodsPicture" ></j-image-upload>

@ -0,0 +1,86 @@
package org.jeecg.common.util;
import org.springframework.util.StringUtils;
import java.beans.PropertyEditorSupport;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Random;
/**
* 定时类使用的方法
*/
public class XJobUtils{
/**
* 获取间隔时间
* @param start_Date
* @return
*/
public static Date randomIntervaltime(Date start_Date,int s,int e)
{
//将时间转为long类型
long start=start_Date.getTime();
//获取30-180秒对应毫秒
long intervalTime=randInt(s*60,s*60)*1000;
//总共花费时长
long timeMillis =start+intervalTime;
return longToDate(timeMillis);
}
/**
* 其实这是基于一个公式 如果要取一个范围在[min,max]之间的随机整数那么公式如下
* @param min
* @param max
* @return
*/
public static int randInt(int min,int max)
{
Random rand = new Random();
// nextInt通常不包含顶部值,因此加上1使其包含
int randomNum = rand.nextInt((max - min) + 1) + min;
return randomNum;
}
//将long转为日期
public static Date longToDate(long lo)
{
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//long转Date
Date date = null;
try {
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(sd.format(new Date(lo)));
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
//间隔时间(秒)
public static long dateToLong(Date s,Date e)
{
long sl=s.getTime();
long el=e.getTime();
long r=el-sl;
return (el-sl)/1000;
}
//随机暂停s-e分钟()
public static void sleepTime(int s ,int e) throws InterruptedException {
Thread.sleep(randInt(60*1000*s,60*1000*e));
}
}

@ -106,6 +106,7 @@ public class ZyAccessoriesController extends JeecgController<ZyAccessories, IZyA
public Result<?> edit(@RequestBody ZyAccessories zyAccessories) { public Result<?> edit(@RequestBody ZyAccessories zyAccessories) {
QueryWrapper queryWrapper=new QueryWrapper(); QueryWrapper queryWrapper=new QueryWrapper();
queryWrapper.eq("contents",zyAccessories.getContents()); queryWrapper.eq("contents",zyAccessories.getContents());
queryWrapper.ne("id",zyAccessories.getId());
int a= zyAccessoriesService.count(queryWrapper); int a= zyAccessoriesService.count(queryWrapper);
if(a>=1){ if(a>=1){
return Result.error("名称重复,请修改后重试!!"); return Result.error("名称重复,请修改后重试!!");

@ -38,8 +38,12 @@ public class ZyAccessories implements Serializable {
/**类型id*/ /**类型id*/
@Excel(name = "类型id", width = 15) @Excel(name = "类型id", width = 15)
@ApiModelProperty(value = "类型id") @ApiModelProperty(value = "类型id")
@Dict(dictTable = "zy_accessories_type", dicText = "contents", dicCode = "nums") @Dict(dictTable = "zy_accessories_type", dicText = "contents", dicCode = "id")
private java.lang.String typeId; private java.lang.String typeId;
/**类型名称*/
@Excel(name = "类型名称", width = 15)
@ApiModelProperty(value = "类型名称")
private java.lang.String typeName;
/**编号*/ /**编号*/
@Excel(name = "编号", width = 15) @Excel(name = "编号", width = 15)
@ApiModelProperty(value = "编号") @ApiModelProperty(value = "编号")

@ -135,10 +135,10 @@
<version>5.2.4.RELEASE</version> <version>5.2.4.RELEASE</version>
</dependency> </dependency>
<!-- 引入定时任务依赖 --> <!-- 引入定时任务依赖 -->
<!-- <dependency>--> <dependency>
<!-- <groupId>org.jeecgframework.boot</groupId>--> <groupId>org.jeecgframework.boot</groupId>
<!-- <artifactId>jeecg-boot-starter-job</artifactId>--> <artifactId>jeecg-boot-starter-job</artifactId>
<!-- </dependency>--> </dependency>
<!-- https://mvnrepository.com/artifact/com.jacob/jacob 语音合成 --> <!-- https://mvnrepository.com/artifact/com.jacob/jacob 语音合成 -->
<dependency> <dependency>

@ -188,12 +188,20 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> i
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()!="")
{
CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId()); CustomerReceivingAddress customerReceivingAddress = customerReceivingAddressMapper.selectById(zyOrdersJk.getAddressId());
zyOrders.setCityId(customerReceivingAddress.getCityId()); zyOrders.setCityId(customerReceivingAddress.getCityId());
zyOrders.setAddress(customerReceivingAddress.getAddress()); zyOrders.setAddress(customerReceivingAddress.getAddress());
zyOrders.setZipCode(customerReceivingAddress.getZipCode()); zyOrders.setZipCode(customerReceivingAddress.getZipCode());
zyOrders.setReceiver(zyOrdersJk.getReceiver()); zyOrders.setReceiver(zyOrdersJk.getReceiver());
zyOrders.setMobile(customerReceivingAddress.getMobile()); zyOrders.setMobile(customerReceivingAddress.getMobile());
}
//顾客发票
if(zyOrdersJk.getInvoiceId()!=null&&zyOrdersJk.getInvoiceId()!="")
{
CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId()); CustomerInvoice customerInvoice = customerInvoiceMapper.selectById(zyOrdersJk.getInvoiceId());
zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType())); zyOrders.setInvoiceCustomerType(Integer.parseInt(customerInvoice.getCustomerType()));
zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType())); zyOrders.setInvoiceType(Integer.parseInt(customerInvoice.getInvoiceType()));
@ -202,6 +210,8 @@ public class ZyOrdersServiceImpl extends ServiceImpl<ZyOrdersMapper, ZyOrders> i
zyOrders.setTelephone(customerInvoice.getTelephone()); zyOrders.setTelephone(customerInvoice.getTelephone());
zyOrders.setBankPublic(customerInvoice.getBankDeposit()); zyOrders.setBankPublic(customerInvoice.getBankDeposit());
zyOrders.setAccountNumber(customerInvoice.getAccountNumber()); zyOrders.setAccountNumber(customerInvoice.getAccountNumber());
}
zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId()); zyOrders.setSalesEnterpriseId(zyOrdersJk.getSalesEnterpriseId());
zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId()); zyOrders.setSalespersonId(zyOrdersJk.getSalespersonId());
zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId()); zyOrders.setLogisticsEnterprisesId(zyOrdersJk.getLogisticsEnterprisesId());

@ -1,6 +1,7 @@
package org.jeecg.modules.hangerlocation.service.impl; package org.jeecg.modules.hangerlocation.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.common.util.XJobUtils;
import org.jeecg.modules.hangerlocation.entity.HangerLocation; import org.jeecg.modules.hangerlocation.entity.HangerLocation;
import org.jeecg.modules.hangerlocation.mapper.HangerLocationMapper; import org.jeecg.modules.hangerlocation.mapper.HangerLocationMapper;
import org.jeecg.modules.hangerlocation.service.IHangerLocationService; import org.jeecg.modules.hangerlocation.service.IHangerLocationService;
@ -16,6 +17,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import static org.jeecg.common.util.XJobUtils.dateToLong;
/** /**
* @Description: 衣架定位表 * @Description: 衣架定位表
* @Author: jeecg-boot * @Author: jeecg-boot
@ -56,7 +59,7 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
//服装进入制作工艺过程 //服装进入制作工艺过程
long timeMillis = System.currentTimeMillis(); long timeMillis = System.currentTimeMillis();
//将获取时间转为日期类型 //将获取时间转为日期类型
Date start_time=longToDate(timeMillis); Date start_time=XJobUtils.longToDate(timeMillis);
QueryWrapper<HangerMaker> qwhm=new QueryWrapper(); QueryWrapper<HangerMaker> qwhm=new QueryWrapper();
qwhm.eq("order_code",entry.getKey()); qwhm.eq("order_code",entry.getKey());
HangerMaker hm=hangerMakerMapper.selectOne(qwhm); HangerMaker hm=hangerMakerMapper.selectOne(qwhm);
@ -86,13 +89,13 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
/**到达时间*/ /**到达时间*/
model.setArrivalTime(start_time); model.setArrivalTime(start_time);
/**离开时间*/ /**离开时间*/
Date end_time=returnEXtime(start_time); Date end_time= XJobUtils.randomIntervaltime(start_time,3,5);
model.setLeaveTime(end_time); model.setLeaveTime(end_time);
/**时长*/ /**时长*/
model.setDuration(dateToLong(start_time,end_time)+""); model.setDuration(dateToLong(start_time,end_time)+"");
//执行下一步间隔时间 //执行下一步间隔时间
start_time=returnIntervaltime(end_time); start_time=XJobUtils.randomIntervaltime(end_time,1,3);
hangerLocationMapper.insert(model); hangerLocationMapper.insert(model);
} }
// System.out.println(entry.getKey()); // System.out.println(entry.getKey());
@ -101,81 +104,4 @@ public class HangerLocationServiceImpl extends ServiceImpl<HangerLocationMapper,
} }
} }
/**
* 获取制作时间
* @param start_Date
* @return
*/
private Date returnEXtime(Date start_Date)
{
//将时间转为long类型
long start=start_Date.getTime();
//获取5-20分钟对应毫秒
long intervalTime=randInt(300,1200)*1000;
//总共花费时长
long timeMillis =start+intervalTime;
//实例化日期对象
Calendar calendar = Calendar.getInstance();
//将毫秒值传入转Date类型
calendar.setTimeInMillis(timeMillis);
//Calendar --> date
Date time = calendar.getTime();
return time;
}
/**
* 获取间隔时间
* @param start_Date
* @return
*/
private Date returnIntervaltime(Date start_Date)
{
//将时间转为long类型
long start=start_Date.getTime();
//获取30-180秒对应毫秒
long intervalTime=randInt(30,180)*1000;
//总共花费时长
long timeMillis =start+intervalTime;
return longToDate(timeMillis);
}
/**
* 其实这是基于一个公式 如果要取一个范围在[min,max]之间的随机整数那么公式如下
* @param min
* @param max
* @return
*/
private int randInt(int min,int max)
{
Random rand = new Random();
// nextInt通常不包含顶部值,因此加上1使其包含
int randomNum = rand.nextInt((max - min) + 1) + min;
return randomNum;
}
//将long转为日期
private Date longToDate(long lo)
{
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//long转Date
Date date = null;
try {
date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(sd.format(new Date(lo)));
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
//将日期转为long
private long dateToLong(Date s,Date e)
{
long sl=s.getTime();
long el=e.getTime();
long r=el-sl;
return (el-sl)/1000;
}
} }

@ -30,6 +30,9 @@ public class HangerMakerServiceImpl extends ServiceImpl<HangerMakerMapper, Hange
@Autowired @Autowired
private WorkOrderMapper workOrderMapper; private WorkOrderMapper workOrderMapper;
/** /**
* 自动衣架绑定工单 * 自动衣架绑定工单
* @param woList * @param woList

@ -372,11 +372,20 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
for (int i = 0; i < planProcessList.size(); i++) { for (int i = 0; i < planProcessList.size(); i++) {
//第一个没有前导工序 //第一个没有前导工序
if (i == 0) { if (i == 0) {
//判断是否有下到工序
if(planProcessList.size()>1)
{
ZyPlanProcess process1 = planProcessList.get(i); ZyPlanProcess process1 = planProcessList.get(i);
ZyPlanProcess process2 = planProcessList.get(i + 1); ZyPlanProcess process2 = planProcessList.get(i + 1);
process1.setPostProcess(process2.getProcessId()); process1.setPostProcess(process2.getProcessId());
process1.setPostProcessName(process2.getProcessName()); process1.setPostProcessName(process2.getProcessName());
updateList.add(process1); updateList.add(process1);
}else
{
ZyPlanProcess process1 = planProcessList.get(i);
updateList.add(process1);
}
} else if (i > 0 && i < planProcessList.size() - 1) { } else if (i > 0 && i < planProcessList.size() - 1) {
ZyPlanProcess process = planProcessList.get(i - 1); ZyPlanProcess process = planProcessList.get(i - 1);
ZyPlanProcess process1 = planProcessList.get(i); ZyPlanProcess process1 = planProcessList.get(i);

@ -137,7 +137,7 @@ public class ZyProductPlanServiceImpl extends ServiceImpl<ZyProductPlanMapper, Z
SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId()); SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId());
zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : ""); zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : "");
} }
SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getRealname, zyProductPlan.getTeamLeader())); SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>().eq(SysUser::getUsername, zyProductPlan.getTeamLeader()));
zyProductPlan.setTeamLeader(sysUser.getUsername()); zyProductPlan.setTeamLeader(sysUser.getUsername());
zyProductPlan.setStatus(new Integer(ProductPlanStatusEnum.UNAUDITED.getCode())); zyProductPlan.setStatus(new Integer(ProductPlanStatusEnum.UNAUDITED.getCode()));
this.save(zyProductPlan); this.save(zyProductPlan);

@ -51,12 +51,16 @@ import org.jeecg.modules.workorder.mapper.WorkOrderMapper;
import org.jeecg.modules.workorder.service.IWorkOrderService; import org.jeecg.modules.workorder.service.IWorkOrderService;
import org.jeecg.modules.workproduct.entity.ZyProduct; import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.mapper.ZyProductMapper; import org.jeecg.modules.workproduct.mapper.ZyProductMapper;
import org.jeecg.modules.zyProcessModular.entity.ZyProcessModular;
import org.jeecg.modules.zyProcessModular.mapper.ZyProcessModularMapper;
import org.jeecg.modules.zyclothsample.entity.ZyClothSample; import org.jeecg.modules.zyclothsample.entity.ZyClothSample;
import org.jeecg.modules.zyclothsample.mapper.ZyClothSampleMapper; import org.jeecg.modules.zyclothsample.mapper.ZyClothSampleMapper;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper; import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; import org.jeecg.modules.zystylemodel.entity.ZyStyleModel;
import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper; import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper;
import org.jeecg.modules.zystylemodule.entity.ZyStyleModule;
import org.jeecg.modules.zystylemodule.mapper.ZyStyleModuleMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -114,10 +118,21 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
@Autowired @Autowired
private ZyProcessMapper processMapper; private ZyProcessMapper processMapper;
//款式模块
@Autowired
private ZyStyleModuleMapper zyStyleModuleMapper;
//款式模块工序
@Autowired
private ZyProcessModularMapper zyProcessModularMapper;
//产品工序 //产品工序
@Autowired @Autowired
private ZyProductProcessMapper productProcessMapper; private ZyProductProcessMapper productProcessMapper;
//工序工具 //工序工具
@Autowired @Autowired
private ZyOperationtoolMapper zyOperationtoolMapper; private ZyOperationtoolMapper zyOperationtoolMapper;
@ -276,13 +291,16 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
//产品模块、产品面料、产品辅料、产品工序、 //产品模块、产品面料、产品辅料、产品工序、
//#region 产品工序-添加(服装款式类型中读取) //#region 产品工序-添加(服装款式类型中读取)
//工序有模块工序-和款式工序
//根据服务款式表id 得到服装工序,然后在得到基本工序 //根据服务款式表id 得到服装工序,然后在得到基本工序
//款式工序
QueryWrapper<ZyStyleModular> styleModularLWrapper=new QueryWrapper<ZyStyleModular>(); QueryWrapper<ZyStyleModular> styleModularLWrapper=new QueryWrapper<ZyStyleModular>();
styleModularLWrapper.eq("style_id",ogModel.getStyleId()); styleModularLWrapper.eq("style_id",ogModel.getStyleId());
List<ZyStyleModular> zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper); List<ZyStyleModular> zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper);
//将工序保存到产品工序中 List<ZyProductProcess> pplist=new ArrayList<>();
//List<ZyProductProcess> productProcessList=new ArrayList<>(); //将款式工序保存到变量pplist中
for(ZyStyleModular item:zyStyleModularList) for(ZyStyleModular item:zyStyleModularList)
{ {
ZyProductProcess zpp=new ZyProductProcess(); ZyProductProcess zpp=new ZyProductProcess();
@ -290,14 +308,45 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
zpp.setProcessId(item.getProcessId());//工序id zpp.setProcessId(item.getProcessId());//工序id
zpp.setNumber(item.getSerialnumber());//序号 zpp.setNumber(item.getSerialnumber());//序号
productProcessMapper.insert(zpp);//保存 productProcessMapper.insert(zpp);//保存
pplist.add(zpp);
}
//模块工序
QueryWrapper<ZyStyleModule> qwStyleModule = new QueryWrapper<>();
qwStyleModule.eq("style_id",ogModel.getStyleId());
List<ZyStyleModule> smList=zyStyleModuleMapper.selectList(qwStyleModule);
//将模块工序保存到变量pplist中
for(ZyStyleModule item:smList)
{
//读取模块工序
QueryWrapper<ZyProcessModular> qwProcessModular = new QueryWrapper<>();
qwProcessModular.eq("modular_id",item.getModularId());
List<ZyProcessModular> pmList=zyProcessModularMapper.selectList(qwProcessModular);
for(ZyProcessModular pm:pmList)
{
ZyProductProcess zpp=new ZyProductProcess();
zpp.setProductId(productModel.getId());//产品id
zpp.setProcessId(pm.getProcessId());//工序id
zpp.setNumber(pm.getSerialnumber());//序号
productProcessMapper.insert(zpp);//保存
pplist.add(zpp);
}
}
//将工序保存到产品工序中
//List<ZyProductProcess> productProcessList=new ArrayList<>();
for(ZyProductProcess item:pplist)
{
//首先查询到对应的产品工序id,由于产品和工序对应应该唯一 //首先查询到对应的产品工序id,由于产品和工序对应应该唯一
String productprocessId=productProcessMapper.findProductProcessId(zpp.getProductId(),zpp.getProcessId()); String productprocessId=productProcessMapper.findProductProcessId(item.getProductId(),item.getProcessId());
//然后根据对应的工序id去基本工序关联的辅料和面料表中找到对应的数据 //然后根据对应的工序id去基本工序关联的辅料和面料表中找到对应的数据
//面料 //面料
List<ZyProcessFabric> listFabric= productProcessMapper.findFabric(zpp.getProcessId()); List<ZyProcessFabric> listFabric= productProcessMapper.findFabric(item.getProcessId());
//辅料 //辅料
List<ZyProcessAccessories> listAccessories=productProcessMapper.findAccessories(zpp.getProcessId()); List<ZyProcessAccessories> listAccessories=productProcessMapper.findAccessories(item.getProcessId());
//然后将产品工序id和辅料面料绑定 //然后将产品工序id和辅料面料绑定
//产品工序面料 //产品工序面料
for (ZyProcessFabric zyProcessFabric : listFabric) { for (ZyProcessFabric zyProcessFabric : listFabric) {

Loading…
Cancel
Save