zhc4dev
喻忠伟 2 years ago
parent bf194a1dba
commit d1cfef3e27
  1. 4
      ant-design-vue-jeecg/src/main.js
  2. 4
      ant-design-vue-jeecg/src/views/system/Depart3List.vue
  3. 6
      ant-design-vue-jeecg/src/views/system/modules/DepartModal.vue
  4. 6
      ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyWorkOrderList.vue
  5. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java
  6. 69
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java

@ -12,8 +12,8 @@ import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import './views/shopping/assets/iconfont/iconfont.css'//引入商城所需图标 import './views/shopping/assets/iconfont/iconfont.css'//引入商城所需图标
// YU-优化 // YU-优化
require('@jeecg/antd-online-mini') // require('@jeecg/antd-online-mini')
require('@jeecg/antd-online-mini/dist/OnlineForm.css') // require('@jeecg/antd-online-mini/dist/OnlineForm.css')
// 引入 按需组件的统一引入文件 // 引入 按需组件的统一引入文件
//import './components/use' //import './components/use'
import Antd, { version } from 'ant-design-vue' import Antd, { version } from 'ant-design-vue'

@ -158,7 +158,7 @@
<!--</template>--> <!--</template>-->
<template v-if="orgTypeDisabled"> <!--<template v-if="orgTypeDisabled">-->
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
@ -171,7 +171,7 @@
label="地址"> label="地址">
<a-input placeholder="请输入地址" v-decorator="['address', {'initialValue':''}]"/> <a-input placeholder="请输入地址" v-decorator="['address', {'initialValue':''}]"/>
</a-form-item> </a-form-item>
</template> <!--</template>-->
<a-form-item <a-form-item

@ -87,11 +87,11 @@
label="排序"> label="排序">
<a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/> <a-input-number v-decorator="[ 'departOrder',{'initialValue':0}]"/>
</a-form-item> </a-form-item>
<template v-if="seen"> <!--<template v-if="seen">-->
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="电话"> label="手机号">
<a-input placeholder="请输入电话" v-decorator="['mobile',validatorRules.mobile]"/> <a-input placeholder="请输入电话" v-decorator="['mobile',validatorRules.mobile]"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
@ -100,7 +100,7 @@
label="地址"> label="地址">
<a-input placeholder="请输入地址" v-decorator="['address', {}]"/> <a-input placeholder="请输入地址" v-decorator="['address', {}]"/>
</a-form-item> </a-form-item>
</template> <!--</template>-->
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"

@ -204,8 +204,8 @@
delete: "/workOrder/workOrder/delete", delete: "/workOrder/workOrder/delete",
deleteBatch: "/workOrder/workOrder/deleteBatch", deleteBatch: "/workOrder/workOrder/deleteBatch",
exportXlsUrl: "/workOrder/workOrder/exportXls", exportXlsUrl: "/workOrder/workOrder/exportXls",
importExcelUrl: "workOrder/workOrder/importExcel", importExcelUrl: "/workOrder/workOrder/importExcel",
cancellationWorkOrderUrl:"workOrder/workOrder/cancellationWorkOrder", cancellationWorkOrderUrl:"/workOrder/workOrder/cancellationWorkOrder",
}, },
dictOptions:{}, dictOptions:{},
} }
@ -233,7 +233,7 @@
}, },
// //
cancellationWorkOrder(workId) { cancellationWorkOrder(workId) {
// /
getAction(this.url.cancellationWorkOrderUrl,{'id':workId}).then((res) => { getAction(this.url.cancellationWorkOrderUrl,{'id':workId}).then((res) => {
if (res.success) { if (res.success) {
this.$message.success("撤销成功!"); this.$message.success("撤销成功!");

@ -278,7 +278,7 @@ public class WorkOrderController extends JeecgController<WorkOrder, IWorkOrderSe
HttpServletRequest req) { HttpServletRequest req) {
QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, req.getParameterMap()); QueryWrapper<SysDepart> queryWrapper = QueryGenerator.initQueryWrapper(sysDepart, req.getParameterMap());
Page<SysDepart> page = new Page<SysDepart>(pageNo, pageSize); Page<SysDepart> page = new Page<SysDepart>(pageNo, pageSize);
queryWrapper.eq("org_type",1); // queryWrapper.eq("org_type",1);
queryWrapper.eq("org_category",2); queryWrapper.eq("org_category",2);
IPage<SysDepart> pageList = sysDepartService.page(page, queryWrapper); IPage<SysDepart> pageList = sysDepartService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);

@ -2,6 +2,7 @@ package org.jeecg.modules.workorder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
@ -173,6 +174,8 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
if(ogList.size()>0) if(ogList.size()>0)
{//start if 02 {//start if 02
// 保存工单 // 保存工单
//获取订单商品
OrderGoods ogModel=ogList.get(0); OrderGoods ogModel=ogList.get(0);
//服装款式 //服装款式
@ -199,6 +202,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
} }
ZyClothSample cSampleModel=csList.get(0); ZyClothSample cSampleModel=csList.get(0);
//生成工单
int goodNum=ogModel.getGoodsNum(); int goodNum=ogModel.getGoodsNum();
WorkOrder workOrder=new WorkOrder(); WorkOrder workOrder=new WorkOrder();
workOrder.setProductCode(CreateWorkCode(csModel.getNums(),smModel.getModelNumber()));//工单编号 workOrder.setProductCode(CreateWorkCode(csModel.getNums(),smModel.getModelNumber()));//工单编号
@ -210,8 +214,9 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
workOrder.setWorkOrderStatus(0);//工单状态 workOrder.setWorkOrderStatus(0);//工单状态
workOrder.setEnterprisesId(depId);//企业id workOrder.setEnterprisesId(depId);//企业id
baseMapper.insert(workOrder); baseMapper.insert(workOrder);
//保存产品 //保存产品
if(ogModel.getGoodsNum()>0) if(goodNum>0)
{ {
//量体数据 //量体数据
CustomerMeasure mesureModel=customerMeasureMapper.selectById(ogModel.getMeasureId()); CustomerMeasure mesureModel=customerMeasureMapper.selectById(ogModel.getMeasureId());
@ -219,7 +224,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
return Result.error("未找到对客户量体数据!"); return Result.error("未找到对客户量体数据!");
} }
//商品数量对应产品 //#region 商品数量对应产品 保存产品
for(int i=0;i<goodNum;i++) for(int i=0;i<goodNum;i++)
{ {
ZyProduct productModel=new ZyProduct(); ZyProduct productModel=new ZyProduct();
@ -312,13 +317,6 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
//zyProductProcessService.save() //zyProductProcessService.save()
//#endregion //#endregion
//#region 工具-添加(服装款式类型中读取)
//#endregion
//#region 设备-添加(服装款式类型中读取)
//#endregion
//#region 产品模块-添加(从订单中读取) //#region 产品模块-添加(从订单中读取)
//订单商品模块表-根据订单商品id //订单商品模块表-根据订单商品id
@ -382,7 +380,10 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
// productAccessoriesMapper.saveBatch(productAccessoriesList); // productAccessoriesMapper.saveBatch(productAccessoriesList);
//#endregion //#endregion
} }
}else //#endregion
}
else
{ {
return Result.error("订单商品数量小于0!"); return Result.error("订单商品数量小于0!");
@ -405,13 +406,57 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
*/ */
@Override @Override
public Result<?> cancellationWorkOrder(WorkOrder woModel) { public Result<?> cancellationWorkOrder(WorkOrder woModel) {
//根据工单获取产品列表,然后循环删除产品列表中的工序,以及工序对应的设备、工具,再删除产品中对应模块、面料、辅料
//ZyProduct
//工单 //工单
//-产品 //-产品
QueryWrapper<ZyProduct> productWrapper = new QueryWrapper<ZyProduct>();
productWrapper.eq("work_order_id", woModel.getId());
List<ZyProduct> productList = productMapper.selectList(productWrapper);
for (ZyProduct model:productList)
{
//-工序 //-工序
QueryWrapper<ZyProductProcess> productProcessWrapper = new QueryWrapper<ZyProductProcess>();
productProcessWrapper.eq("product_id",model.getId());
productProcessMapper.delete(productProcessWrapper);
//-工具
QueryWrapper<ProductOperationtool> productOperationtoolWrapper = new QueryWrapper<ProductOperationtool>();
productOperationtoolWrapper.eq("product_id",model.getId());
productOperationtoolMapper.delete(productOperationtoolWrapper);
//-设备
QueryWrapper<ProductMachine> productMachineWrapper = new QueryWrapper<ProductMachine>();
productMachineWrapper.eq("product_id",model.getId());
productMachineMapper.delete(productMachineWrapper);
//产品模块
QueryWrapper<ProductModule> productModuleWrapper = new QueryWrapper<ProductModule>();
productModuleWrapper.eq("product_id",model.getId());
productModuleMapper.delete(productModuleWrapper);
//产品面料
QueryWrapper<ProductFabric> productFabricWrapper = new QueryWrapper<ProductFabric>();
productFabricWrapper.eq("product_id",model.getId());
productFabricMapper.delete(productFabricWrapper);
//产品面料
QueryWrapper<ProductAccessories> productAccessoriesWrapper = new QueryWrapper<ProductAccessories>();
productAccessoriesWrapper.eq("product_id",model.getId());
productAccessoriesMapper.delete(productAccessoriesWrapper);
}
return null;
//修改订单
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("id", woModel.getOrdersId());
updateWrapper.set("delivery_status", 2);
int update = zyOrdersMapper.update(null, updateWrapper);
//产品
productMapper.delete(productWrapper);
//工单
baseMapper.deleteById(woModel.getId());
return Result.OK("成功");
} }

Loading…
Cancel
Save