Commit 76fbb881 authored by 李驰骋's avatar 李驰骋

导出excel多余字段去掉

parent fe7ea32f
......@@ -26,7 +26,7 @@ import java.util.regex.Pattern;
* @author chicheng.li
* @version V1.0
*/
public class StaticDataMappingConverter implements Converter<String> {
public class StaticDataMappingConverter implements Converter<Object> {
@Override
public Class<?> supportJavaTypeKey() {
......@@ -59,14 +59,14 @@ public class StaticDataMappingConverter implements Converter<String> {
}
@Override
public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
public WriteCellData<?> convertToExcelData(Object value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
Optional<StaticDataMappingFormat> conf = Optional.ofNullable(contentProperty.getField().getAnnotation(StaticDataMappingFormat.class));
if(!conf.isPresent()){
throw new ServiceException(MessageUtils.message("basic.excel.error.not.null.StaticDataMappingFormat"));
}
int i=0;
for(String s : conf.get().value()){
if(s.equals(value)){
if(s.equals(value+"")){
break;
}
i++;
......
......@@ -96,7 +96,6 @@ public class MdItemController extends BaseController {
}
mdItem.setCreateBy(getUsername());
mdItemService.insertMdItem(mdItem);
barcodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_ITEM, mdItem.getItemId(), mdItem.getItemCode(), mdItem.getItemName());
return AjaxResult.success(mdItem.getItemId());
}
......
......@@ -119,11 +119,6 @@ public class MdWorkstationController extends BaseController {
if (UserConstants.NOT_UNIQUE.equals(mdWorkstationService.checkWorkStationNameUnique(mdWorkstation))) {
return AjaxResult.error("工作站名称已存在!");
}
// ProProcess process = proProcessService.selectProProcessByProcessId(mdWorkstation.getProcessId());
//// if (!StringUtils.isNotNull(process)) {
//// return AjaxResult.error("工序不存在!");
//// }
// mdWorkstation.setProcessName(process.getProcessName());
MdWorkshop workshop = mdWorkshopService.selectMdWorkshopByWorkshopId(mdWorkstation.getWorkshopId());
if (!StringUtils.isNotNull(workshop)) {
......
......@@ -26,8 +26,6 @@ public class MdItemExcelExport {
@ExcelProperty("物料/产品编码")
private String itemCode;
private String dta;
@ExcelProperty("SAP产品编码")
private String sapItemCode;
......@@ -41,9 +39,6 @@ public class MdItemExcelExport {
@ExcelProperty("计量单位名称")
private String unitOfMeasure;
@ExcelProperty("物料/产品")
private String itemOrProduct;
@ExcelProperty("物料/产品分类")
private String itemTypeName;
......
......@@ -23,15 +23,9 @@ import java.math.BigDecimal;
@ApiModel("工作站")
@AllArgsConstructor
@NoArgsConstructor
public class MdWorkstationExcelExport extends BaseEntity {
public class MdWorkstationExcelExport {
private static final long serialVersionUID = 1L;
/**
* 工作中心ID
*/
@TableId(type = IdType.AUTO)
private Long workstationId;
/**
* 工作中心编码
*/
......@@ -59,92 +53,10 @@ public class MdWorkstationExcelExport extends BaseEntity {
@ExcelProperty("工厂编号")
private String factoryCode;
/**
* 工作中心用途
*/
@ExcelProperty("工作中心用途")
private String usageCode;
/**
* 车间ID
*/
@ExcelProperty("车间ID")
@ApiModelProperty("车间ID")
private Long workshopId;
@ExcelProperty("车间名称")
@ApiModelProperty("车间名称")
private String workshopName;
private String workshopCode;
/**
* 工序ID
*/
@ExcelProperty("工序ID")
private Long processId;
private String processName;
private String processCode;
/**
* 工作中心负责人
*/
@ExcelProperty("工作中心负责人")
private String responsiblePerson;
private String nickName;
/**
* 标准工时
*/
@ExcelProperty("标准工时")
@ApiModelProperty("标准工时")
private Long stdWorkingTime;
/**
* 标准值码
*/
@ExcelProperty("标准值码")
@ApiModelProperty("标准值码")
private String standardValueCode;
/**
* 加工方式
*/
@ExcelProperty("加工方式")
@ApiModelProperty("加工方式")
private String processingMethod;
/**
* 成本中心
*/
@ExcelProperty("成本中心")
@ApiModelProperty("成本中心")
private String costCenterCode;
/**
* 是否倒冲
*/
@ExcelProperty("是否倒冲")
@ApiModelProperty("是否倒冲")
private String isBackflush;
/**
* 看机人数
*/
@ExcelProperty("看机人数")
@ApiModelProperty("看机人数")
private BigDecimal watchingAircraftNum;
/**
* 是否启用
*/
@ExcelProperty("是否启用")
private String enableFlag;
/**
* 转间配送时间
*/
@ExcelProperty("转间配送时间")
private BigDecimal transferTime;
}
......@@ -3,6 +3,8 @@ package com.ximai.mes.md.dto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ximai.common.annotation.Excel;
import com.ximai.common.core.domain.BaseEntity;
import com.ximai.common.utils.excel.converter.DictionaryConverter;
import com.ximai.common.utils.excel.converter.DictionaryFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
......@@ -21,15 +23,7 @@ import java.math.BigDecimal;
@ApiModel("工作单元")
@AllArgsConstructor
@NoArgsConstructor
public class MdWorkunitExcelExport extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 工作站ID
*/
@ExcelProperty("工作站ID")
private Long workstationId;
public class MdWorkunitExcelExport {
/**
* 工作站名称
*/
......@@ -57,17 +51,18 @@ public class MdWorkunitExcelExport extends BaseEntity {
/**
* 是否故障
*/
@ExcelProperty("是否故障")
@ExcelProperty(value = "是否故障", converter = DictionaryConverter.class)
@DictionaryFormat(dictType = "sys_yes_no")
private String faultFlag;
/**
* 是否启用
*/
@ExcelProperty("是否启用")
@ExcelProperty(value="是否启用", converter = DictionaryConverter.class)
@DictionaryFormat(dictType = "sys_yes_no")
private String enableFlag;
/** 固化时间 */
@ExcelProperty("固化时间")
private BigDecimal solidifyTime;
@ExcelProperty(value="备注")
private String remark;
}
......@@ -4,6 +4,10 @@ import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ximai.common.annotation.Excel;
import com.ximai.common.core.domain.BaseEntity;
import com.ximai.common.utils.excel.converter.DictionaryConverter;
import com.ximai.common.utils.excel.converter.DictionaryFormat;
import com.ximai.common.utils.excel.converter.StaticDataMappingConverter;
import com.ximai.common.utils.excel.converter.StaticDataMappingFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -30,14 +34,15 @@ public class ProProcessExcelExport
private String attention;
/** 是否启用 */
@ExcelProperty("是否启用")
@ExcelProperty(value="是否启用", converter = DictionaryConverter.class)
@DictionaryFormat(dictType = "sys_yes_no")
private String enableFlag;
@ApiModelProperty("是否包装工序,1:是,0:否")
private String isPackage;
@ApiModelProperty("是否序列号报工,1:是,0:否")
@ExcelProperty(value="序列号报工", converter = StaticDataMappingConverter.class)
@StaticDataMappingFormat(value = {"1","0"}, excelValue = {"是","否"})
private Integer isSerialReport;
private String isExistTool;
@ExcelProperty(value="备注")
private String remark;
}
......@@ -270,6 +270,7 @@
update md_workunit
<trim prefix="SET" suffixOverrides=",">
<if test="workstationCode != null">workstation_code = #{workstationCode},</if>
<if test="workstationId != null">workstation_id = #{workstationId},</if>
<if test="workunitCode != null">workunit_code = #{workunitCode},</if>
<if test="workunitName != null">workunit_name = #{workunitName},</if>
<if test="enableFlag != null">enable_flag = #{enableFlag},</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment