2023-01-17-产品派单

zhc4dev
喻忠伟 2 years ago
parent 6d6c7f107e
commit e9d6d744d9
  1. 222
      ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue
  2. 35
      ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyWorkOrderList.vue
  3. 12
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/ordergoods/entity/OrderGoods.java
  4. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/productModule/entity/ProductModule.java
  5. 194
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java
  6. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/IWorkOrderService.java
  7. 337
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java
  8. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/controller/ZyProductController.java
  9. 3
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProduct.java
  10. 183
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProductVo.java
  11. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/ZyProductMapper.java
  12. 53
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/xml/ZyProductMapper.xml
  13. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/IZyProductService.java
  14. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/impl/ZyProductServiceImpl.java

@ -4,6 +4,56 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="产品编号">
<a-input placeholder="请输入产品编号" v-model="queryParam.productCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="产品名称">
<a-input placeholder="请输入产品名称" v-model="queryParam.productName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工单编号">
<a-input placeholder="请输入工单编号" v-model="queryParam.workCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="客户姓名">
<a-input placeholder="请输入客户姓名" v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="生产企业">
<a-input placeholder="请输入生产企业" v-model="queryParam.departName"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<!--<a-form-item label="生产时间">-->
<!--<a-range-picker v-model="queryParam.produceTime"-->
<!--format="yyyy-MM-dd HH:mm:ss"-->
<!--:placeholder="['开始时间', '结束时间']"-->
<!--@change="onproducetimeChange" />-->
<!--</a-form-item>-->
<a-form-item label="生产时间">
<!-- <a-input-number v-model="model.money" placeholder="请输入单价" :precision="2" :min="0" style="width: 100%" />-->
<a-input-number placeholder="请输入生产时间" v-model="queryParam.produceTime" :min="0"></a-input-number>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<!--<a @click="handleToggleSearch" style="margin-left: 8px">-->
<!--{{ toggleSearchStatus ? '收起' : '展开' }}-->
<!--<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
<!--</a>-->
</span>
</a-col>
</a-row>
</a-form>
</div>
@ -68,22 +118,27 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleDetail(record)">工序</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">模块</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">面料</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">辅料</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">设备</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">工具</a>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
<a-divider type="vertical" />
<!--<a-divider type="vertical" />-->
<!--<a-dropdown>-->
<!--<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
<!--<a-menu slot="overlay">-->
<!--<a-menu-item>-->
<!--<a @click="handleDetail(record)">详情</a>-->
<!--</a-menu-item>-->
<!--<a-menu-item>-->
<!--<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!--<a>删除</a>-->
<!--</a-popconfirm>-->
<!--</a-menu-item>-->
<!--</a-menu>-->
<!--</a-dropdown>-->
</span>
</a-table>
@ -127,62 +182,78 @@
dataIndex: 'productCode'
},
{
title:'工单',
title:'产品名称',
align:"center",
dataIndex: 'workOrderId'
dataIndex: 'productName'
},
{
title:'生产时间',
title:'工单编号',
align:"center",
dataIndex: 'produceTime'
dataIndex: 'workCode'
},
{
title:'合计(手工TMU)',
title:'客户姓名',
align:"center",
dataIndex: 'totalManualTmu'
dataIndex: 'realname'
},
{
title:'合计(设备TMU)',
title:'产品图片',
align:"center",
dataIndex: 'totalMachineTmu'
dataIndex: 'productPicture',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'合计(手工秒)',
title:'结构图',
align:"center",
dataIndex: 'totalMaunal'
dataIndex: 'structureDiagram',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'合计(设备秒)',
title:'排料图',
align:"center",
dataIndex: 'totalMachine'
dataIndex: 'layoutDiagram',
scopedSlots: {customRender: 'imgSlot'}
},
{
title:'企业',
title:'款式',
align:"center",
dataIndex: 'enterprisesId'
dataIndex: 'typeName'
},
{
title:'用户',
title:'型号',
align:"center",
dataIndex: 'userId'
dataIndex: 'modelNumber'
},
{
title:'结构图',
title:'合计(手工TMU)',
align:"center",
dataIndex: 'structureDiagram',
scopedSlots: {customRender: 'imgSlot'}
dataIndex: 'totalManualTmu'
},
{
title:'排料图',
title:'合计(设备TMU)',
align:"center",
dataIndex: 'layoutDiagram',
scopedSlots: {customRender: 'imgSlot'}
dataIndex: 'totalMachineTmu'
},
{
title:'产品图片',
title:'合计(手工秒)',
align:"center",
dataIndex: 'productPicture',
scopedSlots: {customRender: 'imgSlot'}
dataIndex: 'totalMaunal'
},
{
title:'合计(设备秒)',
align:"center",
dataIndex: 'totalMachine'
},
{
title:'生产时间',
align:"center",
dataIndex: 'produceTime'
},
{
title:'生产企业',
align:"center",
dataIndex: 'departName'
},
{
title:'身高',
@ -281,6 +352,79 @@
methods: {
initDictConfig(){
},
//
//-
jumpProcesses(record)
{
this.$router.push({
path: '/src/views/product/productProcess/ZyProductProcessList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
});
},
//-
jumpModules(record)
{
this.$router.push({
path: '/src/views/product/productModule/ProductModuleList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
});
},
//-
jumpFabrics(record)
{
this.$router.push({
path: '/src/views/product/pdfabric/ProductFabricList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
});
},
//-
jumpAccessories(record)
{
this.$router.push({
path: '/src/views/duct/pdaccessories/ProductAccessoriesList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
});
},
//-
jumpEquipment(record)
{
this.$router.push({
path: '/src/views/product/pdmachine/ProductMachineList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
});
},
//-
jumpTools(record)
{
this.$router.push({
path: '/src/views/product/pdoperationtool/ProductOperationtoolList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
});
},
onproducetimeChange: function (value, dateString) {
console.log(dateString[0],dateString[1]);
this.queryParam.produceTimeBegin=dateString[0];
this.queryParam.produceTimeEnd=dateString[1];
},
getSuperFieldList(){
let fieldList=[];
fieldList.push({type:'string',value:'productCode',text:'产品编号',dictCode:''})

@ -94,6 +94,14 @@
<a @click="handleProductDetail(record)">产品管理</a>
<a-divider type="vertical" />
<a @click="jumpMaking(record)">制单</a>
<a-divider type="vertical" />
<a-popconfirm title="确定撤销吗?" @confirm="() => cancellationWorkOrder(record.id)">
<a>撤销工单</a>
</a-popconfirm>
<a-divider type="vertical" />
<a @click="handleDetail(record)">详情</a>
</span>
@ -113,7 +121,7 @@
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import WorkOrderModal from '@/views/workorder/modules/WorkOrderModal'
import ZyProductModal from '@/views/zyWorkProduct/modules/ZyProductModal'
import {getAction } from '@/api/manage'
export default {
name: 'ZyWorkOrderList',
mixins:[JeecgListMixin, mixinDevice],
@ -197,7 +205,7 @@
deleteBatch: "/workOrder/workOrder/deleteBatch",
exportXlsUrl: "/workOrder/workOrder/exportXls",
importExcelUrl: "workOrder/workOrder/importExcel",
cancellationWorkOrderUrl:"workOrder/workOrder/cancellationWorkOrder",
},
dictOptions:{},
}
@ -212,6 +220,29 @@
methods: {
initDictConfig(){
},
//-
jumpMaking(record)
{
this.$router.push({
path: '/src/views/maker/ZyMakerList',
// query: { //
// 'pid': record.id,
// 'tname': record.name,
// }
});
},
//
cancellationWorkOrder(workId) {
// /
getAction(this.url.cancellationWorkOrderUrl,{'id':workId}).then((res) => {
if (res.success) {
this.$message.success("撤销成功!");
this.loadData();
}else{
this.$message.error(res.message);
}
})
},
handleProductDetail(record){
this.$refs.productForm.edit(record);
this.$refs.productForm.title="产品管理";

@ -102,16 +102,18 @@ public class OrderGoods implements Serializable {
@Excel(name = "商品视频", width = 15)
@ApiModelProperty(value = "商品视频")
private java.lang.String goodsVideo;
/**服装款式*/
@Excel(name = "服装款式", width = 15)
@Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id")
@ApiModelProperty(value = "服装款式id")
private java.lang.String styleId;
/**服装类型id*/
@Excel(name = "服装类型id", width = 15)
@Dict(dictTable = "zy_cloths_type ", dicText = "type_name", dicCode = "id")
@ApiModelProperty(value = "服装类型id")
private java.lang.String clothsTypeId;
/**款式id*/
@Excel(name = "款式id", width = 15)
@Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id")
@ApiModelProperty(value = "款式id")
private java.lang.String styleId;
/**型号id*/
@Excel(name = "型号id", width = 15)
@Dict(dictTable = "zy_style_model", dicText = "model_number", dicCode = "id")

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
@ -63,6 +64,7 @@ public class ProductModule implements Serializable {
private String styleModuleId;
/**模块id*/
@Excel(name = "模块id", width = 15)
@Dict(dictTable = "zy_cloths_modular ", dicText = "modular_name", dicCode = "id")
@ApiModelProperty(value = "模块id")
private String moduleId;
/**部位*/

@ -1,5 +1,6 @@
package org.jeecg.modules.workorder.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -21,8 +22,24 @@ import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure;
import org.jeecg.modules.demo.customermeasure.service.ICustomerMeasureService;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories;
import org.jeecg.modules.demo.ordergoodsaccessories.service.IOrderGoodsAccessoriesService;
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric;
import org.jeecg.modules.demo.ordergoodsfabric.service.IOrderGoodsFabricService;
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule;
import org.jeecg.modules.demo.ordergoodsmodule.service.IOrderGoodsModuleService;
import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular;
import org.jeecg.modules.demo.zyStyleModular.service.IZyStyleModularService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.service.IProductAccessoriesService;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.service.IProductFabricService;
import org.jeecg.modules.product.productModule.entity.ProductModule;
import org.jeecg.modules.product.productModule.service.IProductModuleService;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.workorder.entity.WorkOrder;
@ -65,38 +82,15 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class WorkOrderController extends JeecgController<WorkOrder, IWorkOrderService> {
@Autowired
private IWorkOrderService workOrderService;
//订单
@Autowired
private IZyOrdersService zyOrdersService;
//订单商品
@Autowired
private IOrderGoodsService orderGoodsService;
//工单产品
@Autowired
private IZyProductService zyProductService;
//款式
@Autowired
private IZyClothsStyleService zyClothsStyleService;
//型号
@Autowired
private IZyStyleModelService zyStyleModelService;
//顾客测体
@Autowired
private ICustomerMeasureService customerMeasureService;
//成衣样板
@Autowired
private IZyClothSampleService zyClothSampleService;
//部门
@Autowired
private ISysDepartService sysDepartService;
/**
* 分页列表查询
*
@ -309,100 +303,8 @@ public class WorkOrderController extends JeecgController<WorkOrder, IWorkOrderSe
return Result.error("该订单已经派单,请不要重复操作!");
}
else {//start for 1
//商品订单是否存在
QueryWrapper<OrderGoods> ogWrapper=new QueryWrapper<OrderGoods>();
ogWrapper.eq("orders_id",orderId);
List<OrderGoods> ogList=orderGoodsService.list(ogWrapper);
if(ogList.size()>0)
{//start if 02
// 保存工单
OrderGoods ogModel=ogList.get(0);
//服装款式
//QueryWrapper<ZyClothsStyle> csWrapper=new QueryWrapper<ZyClothsStyle>();
ZyClothsStyle csModel=zyClothsStyleService.getById(ogModel.getStyleId());
//服装型号
//QueryWrapper<ZyStyleModel> sm=new QueryWrapper<ZyStyleModel>();
ZyStyleModel smModel=zyStyleModelService.getById(ogModel.getModelId());
if(csModel==null ||smModel==null)
{
return Result.error("该订单服装型号或服装款式不存在,请检查后在操作!");
}
//得到结构图和排排料图
QueryWrapper<ZyClothSample> csWrapper=new QueryWrapper<ZyClothSample>();
csWrapper.eq("style_id",ogModel.getStyleId());
csWrapper.eq("stylemodel_id",ogModel.getModelId());
List<ZyClothSample> csList=zyClothSampleService.list(csWrapper);
if(csList.size()<=0)
{
return Result.error("商品成衣样板不存在,请检查后在操作!");
}
ZyClothSample cSampleModel=csList.get(0);
int goodNum=ogModel.getGoodsNum();
WorkOrder workOrder=new WorkOrder();
workOrder.setProductCode(CreateWorkCode(csModel.getNums(),smModel.getModelNumber()));//工单编号
workOrder.setOrdersId(orderId);//订单id
workOrder.setOrderGoodsId(ogModel.getId());// 订单商品
workOrder.setGoodsNum(goodNum);//商品数量
workOrder.setOrderTime(zyOrders.getOrderTime());//下单时间
workOrder.setDeliveryTime(zyOrders.getDeliveryTime());//交货期
workOrder.setWorkOrderStatus(0);//工单状态
workOrder.setEnterprisesId(depId);//企业id
workOrderService.save(workOrder);
//保存产品
if(ogModel.getGoodsNum()>0)
{
//量体数据
CustomerMeasure mesureModel=customerMeasureService.getById(ogModel.getMeasureId());
if(mesureModel==null) {
return Result.error("未找到对客户量体数据!");
}
for(int i=0;i<goodNum;i++)
{
ZyProduct productModel=new ZyProduct();
productModel.setProductName(ogModel.getGoodsName());
productModel.setProductCode(CreateProductCode(workOrder.getProductCode()));// 产品编号
productModel.setWorkOrderId(workOrder.getId());//_ 工单id
// productModel.setProduceTime("");// 生产时间
// productModel.setTotalManualTmu("");// 合计(手工TMU)
// productModel.setTotalMachineTmu("");// 合计(设备TMU)
// productModel.setTotalMaunal("");// 合计(手工秒)
// productModel.setTotalMachine("");// 合计(设备秒)
// productModel.setEnterprisesId("");//_id 企业id
productModel.setUserId(zyOrders.getUserId());//_id 用户id
productModel.setStructureDiagram(cSampleModel.getStructureDiagram());//_diagram 结构图
productModel.setLayoutDiagram(cSampleModel.getLayoutDiagram());//_diagram 排料图
productModel.setProductPicture(cSampleModel.getUrl());//_picture 产品图片
productModel.setHeight(mesureModel.getHeight());// 身高
productModel.setWeight(mesureModel.getWeight());// 体重
productModel.setHem(mesureModel.getHem());// 下摆
productModel.setCuff(mesureModel.getCuff());// 袖口
productModel.setSleeveLength(mesureModel.getSleeveLength());//_length 袖长
productModel.setBust(mesureModel.getBust()) ;//胸围
productModel.setTheWaist(mesureModel.getTheWaist());//_waist 腰围
productModel.setShoulderwidth(mesureModel.getShoulderWidth());// width 肩宽
productModel.setForebodylength(mesureModel.getForebodyLength()) ;//length 前身长
productModel.setNeck(mesureModel.getNeck());// 领围
productModel.setHipline(mesureModel.getHipline());// 臀围
productModel.setLength(mesureModel.getLength());// 衣长
productModel.setSternalDistance(mesureModel.getSternalDistance());//distance 胸距
productModel.setEnterprisesId(depId);//企业
zyProductService.save(productModel);
}
}else
{
return Result.error("订单商品数量小于0!");
Result result=workOrderService.paidan(zyOrders,depId);
}
}else//end if 02
{
return Result.error("订单商品数据未找到!");
}
}//end for 1
}
@ -412,42 +314,36 @@ public class WorkOrderController extends JeecgController<WorkOrder, IWorkOrderSe
return Result.OK("成功");
}
//生成工单编号
/**
*
* @param styleCode 款式编号
* @param modelCode 型号编号
* 撤销工单
* 增加撤销操作点击撤销删除工单和对应的产品订单状态改为派单前的状态
* 撤销操作同时会撤销产品模块产品面料产品辅料产品工序以及制单数据
* @param
* @return
*/
private String CreateWorkCode(String styleCode,String modelCode)
{//编号规则:款式编号(10)+型号(4)+顺序号(8)
String mrstr = "00000000";
int listsize = workOrderService.count();
int strsize = listsize+1;
String str = strsize+"";
int strlength = str.length();
String substr = mrstr.substring(0,mrstr.length()-strlength);
String workCode = styleCode+modelCode+substr+str;
return workCode;
@AutoLog(value = "撤销工单")
@ApiOperation(value="撤销工单", notes="撤销工单")
@GetMapping(value = "/cancellationWorkOrder")
public Result<?> cancellationWorkOrder(@RequestParam(name="id",required=true) String id,HttpServletRequest req) {
WorkOrder woModel=workOrderService.getById(id);
if(woModel==null) {
return Result.error("未找到对应数据!");
}else{
// 增加撤销操作,点击撤销删除工单和对应的产品,订单状态改为派单前的状态。
// * 撤销操作,同时会撤销产品模块、产品面料、产品辅料、产品工序、以及制单数据
//修改订单状态
ZyOrders zyOrders = zyOrdersService.getById(woModel.getOrdersId());
zyOrders.setDeliveryStatus(2);
zyOrdersService.updateById(zyOrders);
}
/**
*
* @param workCode 工单编号
* @return
*/
private String CreateProductCode(String workCode)
{//编号规则:工单编号(22)+顺序号(8)
String mrstr = "00000000";
int listsize = zyProductService.count();
int strsize = listsize+1;
String str = strsize+"";
int strlength = str.length();
String substr = mrstr.substring(0,mrstr.length()-strlength);
String produceCode = workCode+substr+str;
return produceCode;
return Result.OK("成功");
}
}

@ -4,6 +4,8 @@ package org.jeecg.modules.workorder.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.workorder.entity.WorkOrder;
import org.jeecg.modules.workorder.entity.WorkOrderVo;
@ -17,4 +19,7 @@ public interface IWorkOrderService extends IService<WorkOrder> {
//自定义分页查询
IPage<WorkOrder> selectPage(Page<WorkOrder> page, WorkOrderVo workOrder);
//派单
Result paidan(ZyOrders zyOrders,String depId);
}

@ -1,16 +1,50 @@
package org.jeecg.modules.workorder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure;
import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper;
import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories;
import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper;
import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric;
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper;
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule;
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper;
import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular;
import org.jeecg.modules.demo.zyStyleModular.mapper.ZyStyleModularMapper;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.mapper.ProductAccessoriesMapper;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.mapper.ProductFabricMapper;
import org.jeecg.modules.product.productModule.entity.ProductModule;
import org.jeecg.modules.product.productModule.mapper.ProductModuleMapper;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.workorder.entity.WorkOrder;
import org.jeecg.modules.workorder.entity.WorkOrderVo;
import org.jeecg.modules.workorder.mapper.WorkOrderMapper;
import org.jeecg.modules.workorder.service.IWorkOrderService;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.mapper.ZyProductMapper;
import org.jeecg.modules.zyclothsample.entity.ZyClothSample;
import org.jeecg.modules.zyclothsample.mapper.ZyClothSampleMapper;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper;
import org.jeecg.modules.zystylemodel.entity.ZyStyleModel;
import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.List;
/**
* @Description: 工单订单完工
* @Author: jeecg-boot
@ -20,6 +54,57 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements IWorkOrderService {
//订单商品
@Autowired
private OrderGoodsMapper orderGoodsMapper;
//服装款式表
@Autowired
private ZyClothsStyleMapper clothsStyleMapper;
//服装型号
@Autowired
private ZyStyleModelMapper styleModelMapper;
//成衣样板
@Autowired
private ZyClothSampleMapper clothSampleMapper;
//顾客测体
@Autowired
private CustomerMeasureMapper customerMeasureMapper;
//工单产品
@Autowired
private ZyProductMapper productMapper;
//工序
@Autowired
private ZyStyleModularMapper styleModularMapper;
//订单商品模块表
@Autowired
private OrderGoodsModuleMapper orderGoodsModuleMapper;
//产品模块
@Autowired
private ProductModuleMapper productModuleMapper;
//订单商品面料表
@Autowired
private OrderGoodsFabricMapper orderGoodsFabricMapper;
//产品面料表
@Autowired
private ProductFabricMapper productFabricMapper;
//订单商品辅料表
@Autowired
private OrderGoodsAccessoriesMapper orderGoodsAccessoriesMapper;
//产品辅料表
@Autowired
private ProductAccessoriesMapper productAccessoriesMapper;
/**
* 自定义分页查询
* @param page
@ -30,4 +115,256 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
public IPage<WorkOrder> selectPage(Page<WorkOrder> page, WorkOrderVo workOrder) {
return baseMapper.selectListPage(page,workOrder);
}
/**
* 派单
* @param zyOrders
* @return
*/
@Override
public Result paidan(ZyOrders zyOrders,String depId) {
//订单ID
String orderId=zyOrders.getId();
//商品订单是否存在
QueryWrapper<OrderGoods> ogWrapper=new QueryWrapper<OrderGoods>();
ogWrapper.eq("orders_id",orderId);
List<OrderGoods> ogList=orderGoodsMapper.selectList(ogWrapper);
if(ogList.size()>0)
{//start if 02
// 保存工单
OrderGoods ogModel=ogList.get(0);
//服装款式
//QueryWrapper<ZyClothsStyle> csWrapper=new QueryWrapper<ZyClothsStyle>();
ZyClothsStyle csModel=clothsStyleMapper.selectById(ogModel.getStyleId());
//服装型号
//QueryWrapper<ZyStyleModel> sm=new QueryWrapper<ZyStyleModel>();
ZyStyleModel smModel=styleModelMapper.selectById(ogModel.getModelId());
if(csModel==null ||smModel==null)
{
return Result.error("该订单服装型号或服装款式不存在,请检查后在操作!");
}
//得到结构图和排排料图
QueryWrapper<ZyClothSample> csWrapper=new QueryWrapper<ZyClothSample>();
csWrapper.eq("style_id",ogModel.getStyleId());
csWrapper.eq("stylemodel_id",ogModel.getModelId());
//成衣样板
List<ZyClothSample> csList=clothSampleMapper.selectList(csWrapper);
if(csList.size()<=0)
{
return Result.error("商品成衣样板不存在,请检查后在操作!");
}
ZyClothSample cSampleModel=csList.get(0);
int goodNum=ogModel.getGoodsNum();
WorkOrder workOrder=new WorkOrder();
workOrder.setProductCode(CreateWorkCode(csModel.getNums(),smModel.getModelNumber()));//工单编号
workOrder.setOrdersId(orderId);//订单id
workOrder.setOrderGoodsId(ogModel.getId());// 订单商品
workOrder.setGoodsNum(goodNum);//商品数量
workOrder.setOrderTime(zyOrders.getOrderTime());//下单时间
workOrder.setDeliveryTime(zyOrders.getDeliveryTime());//交货期
workOrder.setWorkOrderStatus(0);//工单状态
workOrder.setEnterprisesId(depId);//企业id
baseMapper.insert(workOrder);
//保存产品
if(ogModel.getGoodsNum()>0)
{
//量体数据
CustomerMeasure mesureModel=customerMeasureMapper.selectById(ogModel.getMeasureId());
if(mesureModel==null) {
return Result.error("未找到对客户量体数据!");
}
for(int i=0;i<goodNum;i++)
{
ZyProduct productModel=new ZyProduct();
productModel.setProductName(ogModel.getGoodsName());
productModel.setProductCode(CreateProductCode(workOrder.getProductCode()));// 产品编号
productModel.setWorkOrderId(workOrder.getId());//_ 工单id
// productModel.setProduceTime("");// 生产时间
// productModel.setTotalManualTmu("");// 合计(手工TMU)
// productModel.setTotalMachineTmu("");// 合计(设备TMU)
// productModel.setTotalMaunal("");// 合计(手工秒)
// productModel.setTotalMachine("");// 合计(设备秒)
// productModel.setEnterprisesId("");//_id 企业id
productModel.setUserId(zyOrders.getUserId());//_id 用户id
productModel.setStructureDiagram(cSampleModel.getStructureDiagram());//_diagram 结构图
productModel.setLayoutDiagram(cSampleModel.getLayoutDiagram());//_diagram 排料图
productModel.setProductPicture(cSampleModel.getUrl());//_picture 产品图片
productModel.setHeight(mesureModel.getHeight());// 身高
productModel.setWeight(mesureModel.getWeight());// 体重
productModel.setHem(mesureModel.getHem());// 下摆
productModel.setCuff(mesureModel.getCuff());// 袖口
productModel.setSleeveLength(mesureModel.getSleeveLength());//_length 袖长
productModel.setBust(mesureModel.getBust()) ;//胸围
productModel.setTheWaist(mesureModel.getTheWaist());//_waist 腰围
productModel.setShoulderwidth(mesureModel.getShoulderWidth());// width 肩宽
productModel.setForebodylength(mesureModel.getForebodyLength()) ;//length 前身长
productModel.setNeck(mesureModel.getNeck());// 领围
productModel.setHipline(mesureModel.getHipline());// 臀围
productModel.setLength(mesureModel.getLength());// 衣长
productModel.setSternalDistance(mesureModel.getSternalDistance());//distance 胸距
productModel.setEnterprisesId(depId);//企业
productMapper.insert(productModel);
//产品模块、产品面料、产品辅料、产品工序、
//#region 产品工序-添加(服装款式类型中读取)
//根据服务款式表id 得到工序数据
QueryWrapper<ZyStyleModular> styleModularLWrapper=new QueryWrapper<ZyStyleModular>();
styleModularLWrapper.eq("type_id",ogModel.getStyleId());
List<ZyStyleModular> zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper);
//将工序保存到产品工序中
List<ZyProductProcess> productProcessList=new ArrayList<>();
for(ZyStyleModular item:zyStyleModularList)
{
ZyProductProcess zpp=new ZyProductProcess();
//zpp.setProductId()//产品id
// /***/
// @Excel(name = "产品id", width = 15)
// @ApiModelProperty(value = "产品id")
// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id")
// private String productId;
// /**工序id*/
// @Excel(name = "工序id", width = 15)
// @ApiModelProperty(value = "工序id")
// @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id")
// private String processId;
// /**序号*/
// @Excel(name = "序号", width = 15)
// @ApiModelProperty(value = "序号")
// private Integer number;
productProcessList.add(zpp);
}
//zyProductProcessService.save()
//#endregion
//#region 工具-添加(服装款式类型中读取)
//#endregion
//#region 设备-添加(服装款式类型中读取)
//#endregion
//#region 产品模块-添加(从订单中读取)
//订单商品模块表-根据订单商品id
QueryWrapper<OrderGoodsModule> productModuleWrapper=new QueryWrapper<OrderGoodsModule>();
productModuleWrapper.eq("order_goods_id",ogModel.getId());
List<OrderGoodsModule> orderGoodsModuleList=orderGoodsModuleMapper.selectList(productModuleWrapper);
//循环保存
List<ProductModule> ProductModuleList=new ArrayList<>();
for(OrderGoodsModule item:orderGoodsModuleList)
{
ProductModule pmModel=new ProductModule();
pmModel.setProductId(productModel.getId());//产品id
pmModel.setStyleModuleId(item.getStyleModuleId());//款式模块id
pmModel.setModuleId(item.getModuleId());//模块id
//保存
productModuleMapper.insert(pmModel);
//ProductModuleList.add(pmModel);
}
//productModuleMapper.saveBatch(ProductModuleList);
//#endregion
//#region 产品面料-添加(从订单中读取)
//订单商品面料表-根据订单商品id
QueryWrapper<OrderGoodsFabric> ogFabricWrapper=new QueryWrapper<OrderGoodsFabric>();
ogFabricWrapper.eq("order_goods_id",ogModel.getId());
List<OrderGoodsFabric> orderGoodsFabricList=orderGoodsFabricMapper.selectList(ogFabricWrapper);
//循环保存
List<ProductFabric> productFabricList=new ArrayList<>();
for(OrderGoodsFabric item:orderGoodsFabricList)
{
ProductFabric ptModel=new ProductFabric();
ptModel.setProductId(productModel.getId());//产品id
ptModel.setFabricId(item.getFabricId());//面料id
// productFabricList.add(ptModel);
//保存
productFabricMapper.insert(ptModel);
}
//保存
// productFabricMapper.saveBatch(productFabricList);
//#endregion
//#region 产品辅料-添加(从订单中读取)
//订单商品辅料表-根据订单商品id
QueryWrapper<OrderGoodsAccessories> ogAccessoriesWrapper=new QueryWrapper<OrderGoodsAccessories>();
ogAccessoriesWrapper.eq("order_goods_id",ogModel.getId());
List<OrderGoodsAccessories> orderGoodsAccessoriesList=orderGoodsAccessoriesMapper.selectList(ogAccessoriesWrapper);
//循环保存
List<ProductAccessories> productAccessoriesList=new ArrayList<>();
for(OrderGoodsAccessories item:orderGoodsAccessoriesList)
{
ProductAccessories paModel=new ProductAccessories();
paModel.setProductId(productModel.getId());//产品id
productAccessoriesMapper.insert(paModel);
// productAccessoriesList.add(paModel);
}
//保存
// productAccessoriesMapper.saveBatch(productAccessoriesList);
//#endregion
}
}else
{
return Result.error("订单商品数量小于0!");
}
}else//end if 02
{
return Result.error("订单商品数据未找到!");
}
return null;
}
//生成工单编号
/**
*
* @param styleCode 款式编号
* @param modelCode 型号编号
* @return
*/
private String CreateWorkCode(String styleCode,String modelCode)
{//编号规则:款式编号(10)+型号(4)+顺序号(8)
String mrstr = "00000000";
QueryWrapper<WorkOrder> query = new QueryWrapper<WorkOrder>();
int listsize = baseMapper.selectList(query).size();
int strsize = listsize+1;
String str = strsize+"";
int strlength = str.length();
String substr = mrstr.substring(0,mrstr.length()-strlength);
String workCode = styleCode+modelCode+substr+str;
return workCode;
}
/**
*
* @param workCode 工单编号
* @return
*/
private String CreateProductCode(String workCode)
{//编号规则:工单编号(22)+顺序号(8)
String mrstr = "00000000";
QueryWrapper<ZyProduct> query = new QueryWrapper<ZyProduct>();
int listsize = productMapper.selectList(query).size();
int strsize = listsize+1;
String str = strsize+"";
int strlength = str.length();
String substr = mrstr.substring(0,mrstr.length()-strlength);
String produceCode = workCode+substr+str;
return produceCode;
}
}

@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.entity.ZyProductVo;
import org.jeecg.modules.workproduct.service.IZyProductService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@ -62,13 +63,13 @@ public class ZyProductController extends JeecgController<ZyProduct, IZyProductSe
@AutoLog(value = "产品表-分页列表查询")
@ApiOperation(value="产品表-分页列表查询", notes="产品表-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyProduct zyProduct,
public Result<?> queryPageList(ZyProductVo zyProduct,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyProduct> queryWrapper = QueryGenerator.initQueryWrapper(zyProduct, req.getParameterMap());
//QueryWrapper<ZyProduct> queryWrapper = QueryGenerator.initQueryWrapper(zyProduct, req.getParameterMap());
Page<ZyProduct> page = new Page<ZyProduct>(pageNo, pageSize);
IPage<ZyProduct> pageList = zyProductService.page(page, queryWrapper);
IPage<ZyProduct> pageList = zyProductService.selectListPage(page, zyProduct);
return Result.OK(pageList);
}

@ -64,6 +64,7 @@ public class ZyProduct implements Serializable {
private String productName;
/**工单*/
@Excel(name = "工单", width = 15)
@Dict(dictTable = "work_order", dicText = "product_code", dicCode = "id")
@ApiModelProperty(value = "工单")
private String workOrderId;
/**生产时间*/
@ -88,10 +89,12 @@ public class ZyProduct implements Serializable {
private Integer totalMachine;
/**企业*/
@Excel(name = "企业", width = 15)
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "企业")
private String enterprisesId;
/**用户*/
@Excel(name = "用户", width = 15)
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "用户")
private String userId;
/**结构图*/

@ -0,0 +1,183 @@
package org.jeecg.modules.workproduct.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 产品表
* @Author: jeecg-boot
* @Date: 2023-01-07
* @Version: V1.0
*/
@Data
@TableName("zy_product")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_product对象", description="产品表")
public class ZyProductVo implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**产品编号*/
@Excel(name = "产品编号", width = 15)
@ApiModelProperty(value = "产品编号")
private String productCode;
@Excel(name = "产品名称", width = 50)
@ApiModelProperty(value = "产品名称")
private String productName;
/**工单编号*/
@Excel(name = "工单", width = 15)
@ApiModelProperty(value = "工单")
private String workCode;
/**生产时间*/
@Excel(name = "生产时间", width = 15)
@ApiModelProperty(value = "生产时间")
private Integer produceTime;
/**合计(手工TMU)*/
@Excel(name = "合计(手工TMU)", width = 15)
@ApiModelProperty(value = "合计(手工TMU)")
private Double totalManualTmu;
/**合计(设备TMU)*/
@Excel(name = "合计(设备TMU)", width = 15)
@ApiModelProperty(value = "合计(设备TMU)")
private Double totalMachineTmu;
/**合计(手工秒)*/
@Excel(name = "合计(手工秒)", width = 15)
@ApiModelProperty(value = "合计(手工秒)")
private Integer totalMaunal;
/**合计(设备秒)*/
@Excel(name = "合计(设备秒)", width = 15)
@ApiModelProperty(value = "合计(设备秒)")
private Integer totalMachine;
/**企业*/
@Excel(name = "企业", width = 15)
@Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "企业")
private String enterprisesId;
/**用户*/
@Excel(name = "用户", width = 15)
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
@ApiModelProperty(value = "用户")
private String userId;
/**结构图*/
@Excel(name = "结构图", width = 15)
@ApiModelProperty(value = "结构图")
private String structureDiagram;
/**排料图*/
@Excel(name = "排料图", width = 15)
@ApiModelProperty(value = "排料图")
private String layoutDiagram;
/**产品图片*/
@Excel(name = "产品图片", width = 15)
@ApiModelProperty(value = "产品图片")
private String productPicture;
/**身高*/
@Excel(name = "身高", width = 15)
@ApiModelProperty(value = "身高")
private Double height;
/**体重*/
@Excel(name = "体重", width = 15)
@ApiModelProperty(value = "体重")
private Double weight;
/**下摆*/
@Excel(name = "下摆", width = 15)
@ApiModelProperty(value = "下摆")
private Double hem;
/**袖口*/
@Excel(name = "袖口", width = 15)
@ApiModelProperty(value = "袖口")
private Double cuff;
/**袖长*/
@Excel(name = "袖长", width = 15)
@ApiModelProperty(value = "袖长")
private Double sleeveLength;
/**胸围*/
@Excel(name = "胸围", width = 15)
@ApiModelProperty(value = "胸围")
private Double bust;
/**腰围*/
@Excel(name = "腰围", width = 15)
@ApiModelProperty(value = "腰围")
private Double theWaist;
/**肩宽*/
@Excel(name = "肩宽", width = 15)
@ApiModelProperty(value = "肩宽")
private Double shoulderwidth;
/**前身长*/
@Excel(name = "前身长", width = 15)
@ApiModelProperty(value = "前身长")
private Double forebodylength;
/**领围*/
@Excel(name = "领围", width = 15)
@ApiModelProperty(value = "领围")
private Double neck;
/**臀围*/
@Excel(name = "臀围", width = 15)
@ApiModelProperty(value = "臀围")
private Double hipline;
/**衣长*/
@Excel(name = "衣长", width = 15)
@ApiModelProperty(value = "衣长")
private Double length;
/**胸距*/
@Excel(name = "胸距", width = 15)
@ApiModelProperty(value = "胸距")
private Double sternalDistance;
@ApiModelProperty(value = "客户姓名")
private String realname;
@ApiModelProperty(value = "企业名称")
private String departName;
@ApiModelProperty(value = "款式")
private String typeName;
@ApiModelProperty(value = "型号")
private String modelNumber;
@ApiModelProperty(value = "生产时间-开始")
private Integer produceTimeBegin;
@ApiModelProperty(value = "生产时间")
private Integer produceTimeEnd;
}

@ -2,9 +2,12 @@ package org.jeecg.modules.workproduct.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.entity.ZyProductVo;
/**
* @Description: 产品表
@ -14,4 +17,6 @@ import org.jeecg.modules.workproduct.entity.ZyProduct;
*/
public interface ZyProductMapper extends BaseMapper<ZyProduct> {
//自定义分页查询
IPage<ZyProduct> selectListPage(Page<ZyProduct> page, @Param("model")ZyProductVo model);
}

@ -2,4 +2,57 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.workproduct.mapper.ZyProductMapper">
<select id="selectListPage" resultType="org.jeecg.modules.workproduct.entity.ZyProductVo">
SELECT p.*,wo.product_code AS workCode,us.realname,dep.depart_name AS departName,cs.type_name AS typeName,sm.model_number AS modelNumber FROM
zy_product p
LEFT JOIN work_order wo ON wo.id= p.work_order_id
LEFT JOIN order_goods og ON og.id= wo.order_goods_id
LEFT JOIN sys_user us ON us.username= p.user_id
LEFT JOIN sys_depart dep ON dep.id=p.enterprises_id
LEFT JOIN zy_cloths_style cs ON cs.id= og.style_id
LEFT JOIN zy_style_model sm ON sm.id= og.model_id
<where>
<if test="model != null">
<!--产品编号 -->
<if test="model.productCode!=null and model.productCode!=''">
and p.product_code LIKE CONCAT("%",#{model.productCode},"%")
</if >
<!--产品名称 -->
<if test="model.productName!=null and model.productName!=''">
and p.product_name LIKE CONCAT("%",#{model.productName},"%")
</if >
<!--工单编号 -->
<if test="model.workCode!=null and model.workCode!=''">
and wo.product_codeLIKE CONCAT("%",#{model.workCode},"%")
</if >
<!--客户名称 -->
<if test="model.realname!=null and model.realname!=''">
and us.realname LIKE CONCAT("%",#{model.realname},"%")
</if >
<!--生产企业 -->
<if test="model.departName!=null and model.departName!=''">
and dep.depart_name LIKE CONCAT("%",#{model.departName},"%")
</if >
<!--生产时间 -->
<if test="model.produceTime!=null and model.produceTime!=''">
and p.produce_time =#{model.produceTime}
</if >
<!--<if test="model.produceTimeBegin!=null and model.produceTimeBegin.trim() neq ''">-->
<!--and date_format(create_time,'%Y-%m-%d %H:%i:%s') &gt;= str_to_date(#{model.produceTimeBegin},'%Y-%m-%d %H:%i:%s')-->
<!--</if>-->
<!--<if test="model.produceTimeEnd!=null and model.produceTimeEnd.trim() neq ''">-->
<!--and date_format(create_time,'%Y-%m-%d %H:%i:%s') &lt;= str_to_date(#{model.produceTimeEnd},'%Y-%m-%d %H:%i:%s')-->
<!--</if>-->
</if>
</where>
order by p.create_time desc
</select>
</mapper>

@ -1,7 +1,10 @@
package org.jeecg.modules.workproduct.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.entity.ZyProductVo;
/**
* @Description: 产品表
@ -11,4 +14,11 @@ import org.jeecg.modules.workproduct.entity.ZyProduct;
*/
public interface IZyProductService extends IService<ZyProduct> {
/**
* 自定义分页查询
* @param page
* @param zyProduct
* @return
*/
IPage<ZyProduct> selectListPage(Page<ZyProduct> page, ZyProductVo zyProduct);
}

@ -1,6 +1,9 @@
package org.jeecg.modules.workproduct.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.entity.ZyProductVo;
import org.jeecg.modules.workproduct.mapper.ZyProductMapper;
import org.jeecg.modules.workproduct.service.IZyProductService;
import org.springframework.stereotype.Service;
@ -16,4 +19,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class ZyProductServiceImpl extends ServiceImpl<ZyProductMapper, ZyProduct> implements IZyProductService {
//自定义分页查询
@Override
public IPage<ZyProduct> selectListPage(Page<ZyProduct> page, ZyProductVo zyProduct) {
return baseMapper.selectListPage(page,zyProduct);
}
}

Loading…
Cancel
Save