制单管理相关问题

zhc4dev
赵玉瑞 2 years ago
parent 87501ef21f
commit 72a9bc3b1d
  1. 2
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  2. 84
      ant-design-vue-jeecg/src/views/maker/ZyMakerList.vue
  3. 3
      ant-design-vue-jeecg/src/views/maker/modules/ZyMakerFormDetail.vue
  4. 1
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/base/controller/ZyClothsTypeController.java
  5. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/controller/ZyMakerController.java
  6. 7
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/entity/ZyMaker.java
  7. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/mapper/ZyMakerMapper.java
  8. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/IZyMakerService.java
  9. 90
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/maker/service/impl/ZyMakerServiceImpl.java

@ -322,7 +322,7 @@ export const JeecgListMixin = {
zyStyleFabricHandleAdd: function (id) {
this.$refs.modalForm.add(id);
this.$refs.modalForm.title = "新增";
console.log("js层id的传递"+id);
//console.log("js层id的传递"+id);
this.$refs.modalForm.disableSubmit = false;
},
styleModuleHandleAdd: function (id,typeId,styleNames) {

@ -11,25 +11,34 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<a-button @click="makerAdd" type="primary" icon="plus">制单</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('制单管理')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@handleSuperQuery="handleSuperQuery"></j-super-query>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
<a-menu-item key="1" @click="batchDel">
<a-icon type="delete"/>
删除
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
<!-- table区域-begin -->
<div>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
@ -52,7 +61,8 @@
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
<img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
@ -68,27 +78,31 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<!-- <a @click="handleEdit(record)">编辑</a>-->
<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.id)">详情</a>
</a-menu-item>
<a-menu-item>
<a @click="qrPrint(record)">二维码</a>
</a-menu-item>
<a-menu-item>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
<!-- <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.id)">详情</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<!-- <a @click="qrPrint(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>
</div>
<ZyMakerFormDetail ref="ZyMakerFormDetail"></ZyMakerFormDetail>
@ -105,6 +119,8 @@
import ZyMakerModal from './modules/ZyMakerModal'
import QRCode from "./modules/QRCode";
import ZyMakerFormDetail from './modules/ZyMakerFormDetail'
import {getAction, postAction} from "@api/manage";
export default {
name: 'ZyMakerList',
mixins: [JeecgListMixin, mixinDevice],
@ -138,6 +154,16 @@
align: "center",
dataIndex: 'workerCode'
},
{
title: '产品编号',
align: "center",
dataIndex: 'productCode'
},
{
title: '产品名称',
align: "center",
dataIndex: 'productName'
},
{
title: '模块名称',
align: "center",
@ -159,6 +185,7 @@
],
url: {
list: "/maker/zyMaker/list",
listMakerAdd: "/maker/zyMaker/listMakerAdd",
delete: "/maker/zyMaker/delete",
deleteBatch: "/maker/zyMaker/deleteBatch",
exportXlsUrl: "/maker/zyMaker/exportXls",
@ -178,6 +205,19 @@
},
},
methods: {
makerAdd() {
//this.url.listMakerAdd = '/maker/zyMaker/listMakerAdd';
postAction(this.url.listMakerAdd, null).then((res) => {
if(res.success){
this.$message.success(res.message);
this.loadData();
}else{
this.$message.warning(res.message);
}
// this.$emit('valueChange',1)
// this.close()
})
},
initDictConfig() {
},
qrPrint(record) {

@ -35,8 +35,7 @@
return {
visible: false,
confirmLoading: false,
model:{
},
model: {},
}
},
created() {

@ -237,6 +237,7 @@ public class ZyClothsTypeController extends JeecgController<ZyClothsType, IZyClo
return Result.error("只能选择一个企业");
} else {
//String enterpriseName = zyClothsTypeMapper.getEnterprisenameById(id);
//根据企业id 直接在数据库里面拿到企业缩写 然后处理一下空值问题
String enterpriseName = zyClothsTypeMapper.getEnterpriseNum(id);
//根据企业名称拿到企业编号 //two 是直接编号 然后做一个判断
return Result.OK(zyClothsTypeService.getEnterpriseNumsTwo(enterpriseName));

@ -9,6 +9,7 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
@ -69,6 +70,8 @@ public class ZyMakerController extends JeecgController<ZyMaker, IZyMakerService>
QueryWrapper<ZyMaker> queryWrapper = QueryGenerator.initQueryWrapper(zyMaker, req.getParameterMap());
Page<ZyMaker> page = new Page<ZyMaker>(pageNo, pageSize);
IPage<ZyMaker> pageList = zyMakerService.page(page, queryWrapper);
List<ZyMaker> zyMakerList = zyMakerService.ZyMakerVo(pageList.getRecords());
pageList.setRecords(zyMakerList);
return Result.OK(pageList);
}
@ -86,6 +89,19 @@ public class ZyMakerController extends JeecgController<ZyMaker, IZyMakerService>
return Result.OK("添加成功!");
}
/**
* 制单
*/
@AutoLog(value = "制单管理-制单")
@ApiOperation(value = "制单管理-制单", notes = "制单管理-制单")
@PostMapping(value = "/listMakerAdd")
public Result<?> listMakerAdd() {
//点击制单 点击后按产品模块分解成制单写入制单表
zyMakerService.listMakerAdd();
//zyMakerService.save(zyMaker);
return Result.OK("添加成功!");
}
/**
* 编辑
*

@ -5,6 +5,7 @@ import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -66,6 +67,12 @@ public class ZyMaker implements Serializable {
@Excel(name = "工单编号", width = 15)
@ApiModelProperty(value = "工单编号")
private String workerCode;
/**产品编号*/
@TableField(exist = false)
private String productCode;
/**产品名称*/
@TableField(exist = false)
private String productName;
/**模块id*/
@Excel(name = "模块id", width = 15)
@ApiModelProperty(value = "模块id")

@ -3,8 +3,10 @@ package org.jeecg.modules.maker.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.maker.entity.ZyMaker;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.workproduct.entity.ZyProduct;
/**
* @Description: 制单管理
@ -14,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ZyMakerMapper extends BaseMapper<ZyMaker> {
@Select("select * from zy_product where work_order_id=#{workerCode}")
ZyProduct getProduct(String workerCode);
}

@ -3,6 +3,8 @@ package org.jeecg.modules.maker.service;
import org.jeecg.modules.maker.entity.ZyMaker;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 制单管理
* @Author: jeecg-boot
@ -11,4 +13,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IZyMakerService extends IService<ZyMaker> {
//点击制单 点击后按产品模块分解成制单写入制单表
void listMakerAdd();
List<ZyMaker> ZyMakerVo(List<ZyMaker> records);
}

@ -1,11 +1,26 @@
package org.jeecg.modules.maker.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.maker.entity.ZyMaker;
import org.jeecg.modules.maker.mapper.ZyMakerMapper;
import org.jeecg.modules.maker.service.IZyMakerService;
import org.jeecg.modules.workorder.entity.WorkOrder;
import org.jeecg.modules.workorder.service.IWorkOrderService;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.service.IZyProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
* @Description: 制单管理
@ -16,4 +31,79 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class ZyMakerServiceImpl extends ServiceImpl<ZyMakerMapper, ZyMaker> implements IZyMakerService {
@Autowired
private IWorkOrderService workOrderService;
@Autowired
private IZyProductService productService;
@Resource
private ZyMakerMapper zyMakerMapper;
////点击制单 点击后按产品模块分解成制单写入制单表
@Override
public void listMakerAdd() {
//先拿到所有产品 产品暂定为服装款式里面的数据
List<WorkOrder> workOrderList = workOrderService.list();
for (WorkOrder workOrder : workOrderList) {
ZyMaker maker = new ZyMaker();
//制单编号 工单编号(22)+顺序号(2)
maker.setCode(getMakerCode(workOrder.getProductCode()));
//工单编号
maker.setWorkerCode(workOrder.getProductCode());
this.save(maker);
}
}
@Override
public List<ZyMaker> ZyMakerVo(List<ZyMaker> records) {
if (ObjectUtils.isEmpty(records)) {
return null;
}
//根据工单编号找到产品编号 产品名称
for (ZyMaker maker : records) {
ZyProduct zyProductMapper = zyMakerMapper.getProduct(maker.getWorkerCode());
// LambdaQueryWrapper<ZyProduct> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(ZyProduct::getWorkOrderId, maker.getWorkerCode());
// ZyProduct zyProduct = productService.getOne(queryWrapper);
//产品编号
if (!ObjectUtils.isEmpty(zyProductMapper)){
if (StringUtils.hasText(zyProductMapper.getProductCode())) {
maker.setProductCode(zyProductMapper.getProductCode());
}
if (StringUtils.hasText(zyProductMapper.getProductName())) {
maker.setProductName(zyProductMapper.getProductName());
}
}
//产品名称
}
return records;
}
private String getMakerCode(String productCode) {
if (StringUtils.isEmpty(productCode)) {
return "null";
}
List<ZyMaker> zyMakerList = this.list();
List<String> collect = zyMakerList.stream().map(ZyMaker::getCode).collect(Collectors.toList());
List<Long> longList = new ArrayList<>();
for (String makerCode : collect) {
String newNums = makerCode.trim();
if (StringUtils.isEmpty(newNums)) continue;
if (newNums.length() <= 2) longList.add(Long.valueOf(newNums));
else {
//拿到后6位 substring(4) 截掉前4位
String substring = newNums.substring(newNums.length() - 2);
longList.add(Long.valueOf(substring));
}
}
long max = Collections.max(longList) + 1;
if (Long.toString(max).length() > 2) {
String toString = Long.toString(max);
return toString.substring(toString.length() - 2);
}
return String.format("%02d", max);
}
}

Loading…
Cancel
Save