feat:添加生产工单打印功能;二维码相关功能回显问题

This commit is contained in:
yanshikui 2024-11-18 16:43:37 +08:00
parent a2127f626f
commit a6f9d715d1
12 changed files with 215 additions and 113 deletions

View File

@ -1,10 +1,9 @@
package com.ktg.common.constant;
import org.omg.CORBA.PUBLIC_MEMBER;
/**
* 用户常量信息
*
*
* @author ruoyi
*/
public class UserConstants
@ -57,7 +56,7 @@ public class UserConstants
/** Layout组件标识 */
public final static String LAYOUT = "Layout";
/** ParentView组件标识 */
public final static String PARENT_VIEW = "ParentView";
@ -229,8 +228,12 @@ public class UserConstants
public static final String BARCODE_TYPE_TRANSORDER = "TRANSORDER"; //流转单
public static final String BARCODE_TYPE_CLIENT = "CLIENT"; //客户
public static final String BARCODE_TYPE_VENDOR = "VENDOR"; //供应商
public static final String BARCODE_TYPE_WORKSHOP = "WORKSHOP";
public static final String BARCODE_TYPE_WORKORDER = "WORKORDER";
public static final String BARCODE_TYPE_TOOL = "TOOL";
public static final String BARCODE_TYPE_SN = "SN";
/**
* 消息状态
*/

View File

@ -52,6 +52,10 @@
<artifactId>swagger-models</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,31 +1,25 @@
package com.ktg.mes.md.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ktg.common.constant.UserConstants;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ktg.common.annotation.Log;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.md.domain.MdWorkshop;
import com.ktg.mes.md.service.IMdWorkshopService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.mes.wm.utils.WmBarCodeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 车间Controller
*
*
* @author yinjinlu
* @date 2022-05-07
*/
@ -36,6 +30,8 @@ public class MdWorkshopController extends BaseController
@Autowired
private IMdWorkshopService mdWorkshopService;
@Autowired
private WmBarCodeUtil wmBarCodeUtil;
/**
* 查询车间列表
*/
@ -96,7 +92,9 @@ public class MdWorkshopController extends BaseController
if(UserConstants.NOT_UNIQUE.equals(mdWorkshopService.checkWorkshopNameUnique(mdWorkshop))){
return AjaxResult.error("车间名称已存在!");
}
return toAjax(mdWorkshopService.insertMdWorkshop(mdWorkshop));
int i = mdWorkshopService.insertMdWorkshop(mdWorkshop);
wmBarCodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_WORKSHOP,mdWorkshop.getWorkshopId(),mdWorkshop.getWorkshopCode(),mdWorkshop.getWorkshopName());
return toAjax(i);
}
/**

View File

@ -1,49 +1,37 @@
package com.ktg.mes.pro.controller;
import cn.hutool.core.collection.CollUtil;
import com.ktg.common.annotation.Log;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.md.domain.MdProductBom;
import com.ktg.mes.md.service.IMdProductBomService;
import com.ktg.mes.pro.domain.ProTask;
import com.ktg.mes.pro.domain.ProWorkorder;
import com.ktg.mes.pro.domain.ProWorkorderBom;
import com.ktg.mes.pro.service.IProTaskService;
import com.ktg.mes.pro.service.IProWorkorderBomService;
import com.ktg.mes.pro.service.IProWorkorderService;
import com.ktg.mes.wm.utils.WmBarCodeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.md.domain.MdItem;
import com.ktg.mes.md.domain.MdProductBom;
import com.ktg.mes.md.service.IMdProductBomService;
import com.ktg.mes.pro.domain.ProTask;
import com.ktg.mes.pro.domain.ProWorkorderBom;
import com.ktg.mes.pro.service.IProTaskService;
import com.ktg.mes.pro.service.IProWorkorderBomService;
import com.ktg.mes.wm.domain.WmRtIssue;
import com.ktg.mes.wm.domain.WmRtIssueLine;
import com.ktg.mes.wm.domain.tx.RtIssueTxBean;
import io.minio.messages.Item;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ktg.common.annotation.Log;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.pro.domain.ProWorkorder;
import com.ktg.mes.pro.service.IProWorkorderService;
import com.ktg.common.utils.poi.ExcelUtil;
/**
* 生产工单Controller
*
*
* @author yinjinlu
* @date 2022-05-09
*/
@ -63,6 +51,9 @@ public class ProWorkorderController extends BaseController
@Autowired
private IProTaskService proTaskService;
@Autowired
private WmBarCodeUtil wmBarCodeUtil;
/**
* 查询生产工单列表
*/
@ -129,6 +120,7 @@ public class ProWorkorderController extends BaseController
Long workorderId = proWorkorder.getWorkorderId();
generateBomLine(workorderId);
proWorkorder.setCreateBy(getUsername());
wmBarCodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_WORKORDER,proWorkorder.getWorkorderId(),proWorkorder.getWorkorderCode(),proWorkorder.getWorkorderName());
return AjaxResult.success(workorderId);
}

View File

@ -1,27 +1,36 @@
package com.ktg.mes.pro.mapper;
import java.util.List;
import com.ktg.mes.pro.domain.ProWorkorder;
import java.util.List;
/**
* 生产工单Mapper接口
*
*
* @author yinjinlu
* @date 2022-05-09
*/
public interface ProWorkorderMapper
public interface ProWorkorderMapper
{
/**
* 查询生产工单
*
*
* @param workorderId 生产工单主键
* @return 生产工单
*/
public ProWorkorder selectProWorkorderByWorkorderId(Long workorderId);
/**
* 查询生产工单
*
* @param workorderId 生产工单主键
* @return 生产工单
*/
public List<ProWorkorder> selectProWorkorderListByParentId(Long workorderId);
/**
* 查询生产工单列表
*
*
* @param proWorkorder 生产工单
* @return 生产工单集合
*/
@ -31,7 +40,7 @@ public interface ProWorkorderMapper
/**
* 新增生产工单
*
*
* @param proWorkorder 生产工单
* @return 结果
*/
@ -39,7 +48,7 @@ public interface ProWorkorderMapper
/**
* 修改生产工单
*
*
* @param proWorkorder 生产工单
* @return 结果
*/
@ -47,7 +56,7 @@ public interface ProWorkorderMapper
/**
* 删除生产工单
*
*
* @param workorderId 生产工单主键
* @return 结果
*/
@ -55,7 +64,7 @@ public interface ProWorkorderMapper
/**
* 批量删除生产工单
*
*
* @param workorderIds 需要删除的数据主键集合
* @return 结果
*/

View File

@ -1,27 +1,36 @@
package com.ktg.mes.pro.service;
import java.util.List;
import com.ktg.mes.pro.domain.ProWorkorder;
import java.util.List;
/**
* 生产工单Service接口
*
*
* @author yinjinlu
* @date 2022-05-09
*/
public interface IProWorkorderService
public interface IProWorkorderService
{
/**
* 查询生产工单
*
*
* @param workorderId 生产工单主键
* @return 生产工单
*/
public ProWorkorder selectProWorkorderByWorkorderId(Long workorderId);
/**
* 查询生产工单
*
* @param workorderId 生产工单主键
* @return 生产工单
*/
public List<ProWorkorder> selectProWorkorderListByParentId(Long workorderId);
/**
* 查询生产工单列表
*
*
* @param proWorkorder 生产工单
* @return 生产工单集合
*/
@ -32,7 +41,7 @@ public interface IProWorkorderService
/**
* 新增生产工单
*
*
* @param proWorkorder 生产工单
* @return 结果
*/
@ -40,7 +49,7 @@ public interface IProWorkorderService
/**
* 修改生产工单
*
*
* @param proWorkorder 生产工单
* @return 结果
*/
@ -48,7 +57,7 @@ public interface IProWorkorderService
/**
* 批量删除生产工单
*
*
* @param workorderIds 需要删除的生产工单主键集合
* @return 结果
*/
@ -56,7 +65,7 @@ public interface IProWorkorderService
/**
* 删除生产工单信息
*
*
* @param workorderId 生产工单主键
* @return 结果
*/

View File

@ -1,32 +1,31 @@
package com.ktg.mes.pro.service.impl;
import java.util.List;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.utils.DateUtils;
import com.ktg.common.utils.StringUtils;
import com.ktg.mes.dv.domain.DvMachineryType;
import com.ktg.mes.pro.domain.ProWorkorder;
import com.ktg.mes.pro.mapper.ProWorkorderMapper;
import com.ktg.mes.pro.service.IProWorkorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktg.mes.pro.mapper.ProWorkorderMapper;
import com.ktg.mes.pro.domain.ProWorkorder;
import com.ktg.mes.pro.service.IProWorkorderService;
import java.util.List;
/**
* 生产工单Service业务层处理
*
*
* @author yinjinlu
* @date 2022-05-09
*/
@Service
public class ProWorkorderServiceImpl implements IProWorkorderService
public class ProWorkorderServiceImpl implements IProWorkorderService
{
@Autowired
private ProWorkorderMapper proWorkorderMapper;
/**
* 查询生产工单
*
*
* @param workorderId 生产工单主键
* @return 生产工单
*/
@ -36,9 +35,21 @@ public class ProWorkorderServiceImpl implements IProWorkorderService
return proWorkorderMapper.selectProWorkorderByWorkorderId(workorderId);
}
/**
* 查询生产工单
*
* @param workorderId 生产工单主键
* @return 生产工单
*/
@Override
public List<ProWorkorder> selectProWorkorderListByParentId(Long workorderId)
{
return proWorkorderMapper.selectProWorkorderListByParentId(workorderId);
}
/**
* 查询生产工单列表
*
*
* @param proWorkorder 生产工单
* @return 生产工单
*/
@ -61,7 +72,7 @@ public class ProWorkorderServiceImpl implements IProWorkorderService
/**
* 新增生产工单
*
*
* @param proWorkorder 生产工单
* @return 结果
*/
@ -81,7 +92,7 @@ public class ProWorkorderServiceImpl implements IProWorkorderService
/**
* 修改生产工单
*
*
* @param proWorkorder 生产工单
* @return 结果
*/
@ -94,7 +105,7 @@ public class ProWorkorderServiceImpl implements IProWorkorderService
/**
* 批量删除生产工单
*
*
* @param workorderIds 需要删除的生产工单主键
* @return 结果
*/
@ -106,7 +117,7 @@ public class ProWorkorderServiceImpl implements IProWorkorderService
/**
* 删除生产工单信息
*
*
* @param workorderId 生产工单主键
* @return 结果
*/

View File

@ -0,0 +1,65 @@
package com.ktg.mes.report.bean;
import com.alibaba.fastjson.JSON;
import com.ktg.mes.pro.domain.ProWorkorder;
import com.ktg.mes.pro.service.IProWorkorderService;
import com.ktg.mes.wm.domain.WmBarcode;
import com.ktg.mes.wm.service.IWmBarcodeService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Component
@Slf4j
public class PmReportBean {
@Autowired
private IProWorkorderService proWorkorderService;
@Autowired
private IWmBarcodeService wmBarcodeService;
public List<ProWorkorder> getData(String dsName, String datasetName, Map<String, Object> parameters) {
String id = MapUtils.getString(parameters, "id");
ProWorkorder proWorkorder = proWorkorderService.selectProWorkorderByWorkorderId(Long.parseLong(id));
List<ProWorkorder> list = new ArrayList<>();
list.add(proWorkorder);
log.info("PmReportBean dsName :" + dsName + ", datasetName :" + datasetName + ", resp:" + JSON.toJSONString(list));
return list;
}
public List<ProWorkorder> getChildData(String dsName, String datasetName, Map<String, Object> parameters) {
String id = MapUtils.getString(parameters, "id");
List<ProWorkorder> proWorkorders = proWorkorderService.selectProWorkorderListByParentId(Long.parseLong(id));
List<ProWorkorder> list = new ArrayList<>();
log.info("PmReportBean dsName :" + dsName + ", datasetName :" + datasetName + ", resp:" + JSON.toJSONString(list));
return proWorkorders;
}
public List<WmBarcode> getQc(String dsName, String datasetName, Map<String, Object> parameters) {
String id = MapUtils.getString(parameters, "id");
WmBarcode wmBarcode = new WmBarcode();
wmBarcode.setBarcodeId(Long.parseLong(id));
List<WmBarcode> codeList = wmBarcodeService.selectWmBarcodeList(wmBarcode);
List<WmBarcode> list = new ArrayList<>();
if(!CollectionUtils.isEmpty(codeList)){
list.add(codeList.get(0));
}
log.info("PmReportBean dsName :" + dsName + ", datasetName :" + datasetName + ", resp:" + JSON.toJSONString(list));
return list;
}
}

View File

@ -1,33 +1,27 @@
package com.ktg.mes.tm.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ktg.common.constant.UserConstants;
import com.ktg.mes.tm.domain.TmToolType;
import com.ktg.mes.tm.service.ITmToolTypeService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ktg.common.annotation.Log;
import com.ktg.common.constant.UserConstants;
import com.ktg.common.core.controller.BaseController;
import com.ktg.common.core.domain.AjaxResult;
import com.ktg.common.enums.BusinessType;
import com.ktg.mes.tm.domain.TmTool;
import com.ktg.mes.tm.service.ITmToolService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
import com.ktg.common.enums.BusinessType;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.mes.tm.domain.TmTool;
import com.ktg.mes.tm.domain.TmToolType;
import com.ktg.mes.tm.service.ITmToolService;
import com.ktg.mes.tm.service.ITmToolTypeService;
import com.ktg.mes.wm.utils.WmBarCodeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 工装夹具清单Controller
*
*
* @author yinjinlu
* @date 2022-05-11
*/
@ -40,7 +34,8 @@ public class TmToolController extends BaseController
@Autowired
private ITmToolTypeService tmToolTypeService;
@Autowired
private WmBarCodeUtil wmBarCodeUtil;
/**
* 查询工装夹具清单列表
*/
@ -91,7 +86,9 @@ public class TmToolController extends BaseController
tmTool.setToolTypeCode(type.getToolTypeCode());
tmTool.setToolTypeName(type.getToolTypeName());
tmTool.setCodeFlag(type.getCodeFlag());
return toAjax(tmToolService.insertTmTool(tmTool));
int i = tmToolService.insertTmTool(tmTool);
wmBarCodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_TOOL,tmTool.getToolId(),tmTool.getToolCode(),tmTool.getToolName());
return toAjax(i);
}
/**

View File

@ -85,6 +85,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where workorder_id = #{workorderId}
</select>
<select id="selectProWorkorderListByParentId" parameterType="Long" resultMap="ProWorkorderResult">
<include refid="selectProWorkorderVo"/>
where parent_id = #{parentId}
</select>
<select id="checkWorkorderCodeUnique" parameterType="ProWorkorder" resultMap="ProWorkorderResult">
<include refid="selectProWorkorderVo"/>
where workorder_code = #{workorderCode} limit 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<import resource="classpath:ureport-console-context.xml"/>
<bean id="pmReportBean" class="com.ktg.mes.report.bean.PmReportBean"></bean>
</beans>