物料信息修改

product
chuang 2 years ago
parent 750c88a777
commit 8b14f1778e

@ -19,6 +19,20 @@
</properties>
<dependencies>
<!--freemarker-->
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.27-incubating</version>
</dependency>
<!--html 转 pdf-->
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>flying-saucer-pdf</artifactId>
<version>9.0.7</version>
</dependency>
<!--实体类转换-->
<dependency>
<groupId>com.google.guava</groupId>

@ -1,202 +0,0 @@
package jnpf.material.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.google.common.base.Converter;
import lombok.Data;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
*/
@Data
@TableName("jg_material")
public class MaterialEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatoruserid;
@TableField("CREATOR_USER_NAME")
private String creatorusername;
@TableField("CREATOR_TIME")
private Date creatortime;
@TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid;
@TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername;
@TableField("LAST_MODIFY_TIME")
private Date lastmodifytime;
@TableField("DELETE_USER_ID")
private String deleteuserid;
@TableField("DELETE_USER_NAME")
private String deleteusername;
@TableField("DELETE_TIME")
private Date deletetime;
@TableField("DELETE_MARK")
private String deletemark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("M_ID")
private String mId;
@TableField("ITEM_ID")
private String itemId;
@TableField("ITEM_CODE")
private String itemCode;
@TableField("ORGANIZATION_ID")
private String organizationId;
@TableField("ORGANIZATION_CODE")
private String organizationCode;
@TableField("DESCRIPTION")
private String description;
@TableField("PRIMARY_UOM_CODE")
private String primaryUomCode;
@TableField("PRIMARY_UNIT_OF_MEASURE")
private String primaryUnitOmeasure;
@TableField("PURCHASE_FLAG")
private String purchaseFlag;
@TableField("SALES_FLAG")
private String salesFlag;
@TableField("IN_AREA")
private String inArea;
@TableField("OUT_AREA")
private String outArea;
@TableField("EFFECTIVE_STATUS")
private String effectiveStatus;
@TableField("PROCESSING_TYPE")
private String processingType;
@TableField("READ_TAG")
private String readTag;
@TableField("READ_DATE")
private Date readDate;
@TableField("ERROR_MESSAGE")
private String errorMessage;
// 转换方法
public MaterialMobileEntity convertTo() {
OrderConverter convert = new OrderConverter();
return convert.convert(this);
}
public MaterialEntity convertFrom(MaterialMobileEntity order) {
OrderConverter convert = new OrderConverter();
return convert.reverse().convert(order);
}
private static class OrderConverter extends Converter<MaterialEntity, MaterialMobileEntity> {
@Override
protected MaterialMobileEntity doForward(MaterialEntity materialMobileEntty) {
MaterialMobileEntity dto = new MaterialMobileEntity();
dto.setCreatortime(materialMobileEntty.getCreatortime());
dto.setCreatoruserid(materialMobileEntty.getCreatoruserid());
dto.setCreatorusername(materialMobileEntty.getCreatorusername());
dto.setDeletemark(materialMobileEntty.getDeletemark());
dto.setDeletetime(materialMobileEntty.getDeletetime());
dto.setDeleteuserid(materialMobileEntty.getDeleteuserid());
dto.setDeleteusername(materialMobileEntty.getDeleteusername());
dto.setDepartmentId(materialMobileEntty.getDepartmentId());
dto.setDescription(materialMobileEntty.getDescription());
dto.setEffectiveStatus(materialMobileEntty.getEffectiveStatus());
dto.setErrorMessage(materialMobileEntty.getErrorMessage());
dto.setId(materialMobileEntty.getId());
dto.setInArea(materialMobileEntty.getInArea());
dto.setItemCode(materialMobileEntty.getItemCode());
dto.setItemId(materialMobileEntty.getItemId());
dto.setLastmodifytime(materialMobileEntty.getLastmodifytime());
dto.setLastmodifyuserid(materialMobileEntty.getLastmodifyuserid());
dto.setLastmodifyusername(materialMobileEntty.getLastmodifyusername());
dto.setMId(materialMobileEntty.getMId());
dto.setOrganizationCode(materialMobileEntty.getOrganizationCode());
dto.setOrganizationId(materialMobileEntty.getOrganizationId());
dto.setOrgnizeId(materialMobileEntty.getOrgnizeId());
dto.setOutArea(materialMobileEntty.getOutArea());
dto.setPrimaryUnitOmeasure(materialMobileEntty.getPrimaryUnitOmeasure());
dto.setPrimaryUomCode(materialMobileEntty.getPrimaryUomCode());
dto.setProcessingType(materialMobileEntty.getProcessingType());
dto.setPurchaseFlag(materialMobileEntty.getPurchaseFlag());
dto.setReadDate(materialMobileEntty.getReadDate());
dto.setReadTag(materialMobileEntty.getReadTag());
dto.setSalesFlag(materialMobileEntty.getSalesFlag());
return dto;
}
//具体的转换内容
@Override
protected MaterialEntity doBackward(MaterialMobileEntity materialMobileEntty) {
MaterialEntity dto = new MaterialEntity();
dto.setCreatortime(materialMobileEntty.getCreatortime());
dto.setCreatoruserid(materialMobileEntty.getCreatoruserid());
dto.setCreatorusername(materialMobileEntty.getCreatorusername());
dto.setDeletemark(materialMobileEntty.getDeletemark());
dto.setDeletetime(materialMobileEntty.getDeletetime());
dto.setDeleteuserid(materialMobileEntty.getDeleteuserid());
dto.setDeleteusername(materialMobileEntty.getDeleteusername());
dto.setDepartmentId(materialMobileEntty.getDepartmentId());
dto.setDescription(materialMobileEntty.getDescription());
dto.setEffectiveStatus(materialMobileEntty.getEffectiveStatus());
dto.setErrorMessage(materialMobileEntty.getErrorMessage());
dto.setId(materialMobileEntty.getId());
dto.setInArea(materialMobileEntty.getInArea());
dto.setItemCode(materialMobileEntty.getItemCode());
dto.setItemId(materialMobileEntty.getItemId());
dto.setLastmodifytime(materialMobileEntty.getLastmodifytime());
dto.setLastmodifyuserid(materialMobileEntty.getLastmodifyuserid());
dto.setLastmodifyusername(materialMobileEntty.getLastmodifyusername());
dto.setMId(materialMobileEntty.getMId());
dto.setOrganizationCode(materialMobileEntty.getOrganizationCode());
dto.setOrganizationId(materialMobileEntty.getOrganizationId());
dto.setOrgnizeId(materialMobileEntty.getOrgnizeId());
dto.setOutArea(materialMobileEntty.getOutArea());
dto.setPrimaryUnitOmeasure(materialMobileEntty.getPrimaryUnitOmeasure());
dto.setPrimaryUomCode(materialMobileEntty.getPrimaryUomCode());
dto.setProcessingType(materialMobileEntty.getProcessingType());
dto.setPurchaseFlag(materialMobileEntty.getPurchaseFlag());
dto.setReadDate(materialMobileEntty.getReadDate());
dto.setReadTag(materialMobileEntty.getReadTag());
dto.setSalesFlag(materialMobileEntty.getSalesFlag());
return dto;
}
}
}

@ -1,40 +0,0 @@
package jnpf.material.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.material.entity.MaterialEntity;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.material.entity.MaterialMobileEntity;
import jnpf.material.model.material.MaterialPagination;
import java.util.*;
/**
*
* material
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
*/
public interface MaterialService extends IService<MaterialEntity> {
IPage<MaterialMobileEntity> pagee(Page<MaterialMobileEntity> page, Wrapper<MaterialEntity> queryWrapper);
List<MaterialMobileEntity> getList(MaterialPagination materialPagination);
List<MaterialMobileEntity> getTypeList(MaterialPagination materialPagination,String dataType);
MaterialEntity getInfo(String id);
void delete(MaterialEntity entity);
void create(MaterialEntity entity);
boolean update( String id, MaterialEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,64 +1,55 @@
package jnpf.material.controller;
package jnpf.materialvo.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.UserInfo;
import jnpf.base.vo.DownloadVO;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.config.ConfigValueUtil;
import jnpf.exception.DataException;
import jnpf.material.entity.MaterialMobileEntity;
import org.springframework.transaction.annotation.Transactional;
import jnpf.base.entity.ProvinceEntity;
import jnpf.material.model.material.*;
import jnpf.material.model.material.MaterialPagination;
import jnpf.entity.*;
import jnpf.materialvo.entity.MaterialEntity;
import jnpf.materialvo.entity.MaterialVoMobileEntity;
import jnpf.materialvo.model.material.*;
import jnpf.materialvo.service.MaterialService;
import jnpf.util.*;
import jnpf.base.util.*;
import jnpf.base.vo.ListVO;
import jnpf.util.context.SpringContext;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import jnpf.util.enums.FileTypeEnum;
import jnpf.util.file.UploadUtil;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import jnpf.material.entity.MaterialEntity;
import jnpf.material.service.MaterialService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import jnpf.util.GeneraterSwapUtil;
import java.util.*;
import jnpf.util.file.UploadUtil;
import jnpf.util.enums.FileTypeEnum;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* material
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Slf4j
@RestController
@Api(tags = "material" , value = "Material")
@RequestMapping("/api/Material/Material")
@Api(tags = "物料档案" , value = "example")
@RequestMapping("/api/example/Material")
public class MaterialController {
@Autowired
@ -82,12 +73,11 @@ public class MaterialController {
* @param materialPagination
* @return
*/
@ApiOperation("列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody MaterialPagination materialPagination)throws IOException{
List<MaterialMobileEntity> list= materialService.getList(materialPagination);
List<MaterialVoMobileEntity> list= materialService.getList(materialPagination);
//处理id字段转名称若无需转或者为空可删除
for(MaterialMobileEntity entity:list){
for(MaterialVoMobileEntity entity:list){
Map<String,Object> outAreaMap = new HashMap<>();
entity.setOutArea(generaterSwapUtil.getPopupSelectValue("381404161809350213","id","areaname",entity.getOutArea(),outAreaMap));
Map<String,Object> inAreaMap = new HashMap<>();
@ -117,6 +107,7 @@ public class MaterialController {
public ActionResult create(@RequestBody @Valid MaterialCrForm materialCrForm) throws DataException {
String mainId =RandomUtil.uuId();
UserInfo userInfo=userProvider.get();
materialCrForm.setCreatorTime(DateUtil.getNow());
MaterialEntity entity = JsonUtil.getJsonToBean(materialCrForm, MaterialEntity.class);
entity.setId(mainId);
materialService.save(entity);
@ -157,13 +148,13 @@ public class MaterialController {
return ActionResult.fail("请选择导出字段");
}
MaterialPagination materialPagination=JsonUtil.getJsonToBean(materialPaginationExportModel, MaterialPagination.class);
List<MaterialMobileEntity> list= materialService.getTypeList(materialPagination,materialPaginationExportModel.getDataType());
List<MaterialEntity> list= materialService.getTypeList(materialPagination,materialPaginationExportModel.getDataType());
//处理id字段转名称若无需转或者为空可删除
for(MaterialEntity entity:list){
Map<String,Object> outAreaMap = new HashMap<>();
entity.setOutArea(generaterSwapUtil.swapRelationFormValue("comInputField102",entity.getOutArea(),"294012196529150981",outAreaMap));
entity.setOutArea(generaterSwapUtil.getPopupSelectValue("381404161809350213","id","areaname",entity.getOutArea(),outAreaMap));
Map<String,Object> inAreaMap = new HashMap<>();
entity.setInArea(generaterSwapUtil.swapRelationFormValue("comInputField102",entity.getInArea(),"294012196529150981",inAreaMap));
entity.setInArea(generaterSwapUtil.getPopupSelectValue("381404161809350213","id","areaname",entity.getInArea(),inAreaMap));
}
List<MaterialListVO> listVO=JsonUtil.getJsonToList(list,MaterialListVO.class);
for(MaterialListVO materialVO:listVO){
@ -186,14 +177,11 @@ public class MaterialController {
case "itemCode" :
entitys.add(new ExcelExportEntity("物料编码" ,"itemCode"));
break;
case "description" :
entitys.add(new ExcelExportEntity("物料名称" ,"description"));
break;
case "organizationCode" :
entitys.add(new ExcelExportEntity("库存组织代码" ,"organizationCode"));
case "itemName" :
entitys.add(new ExcelExportEntity("物料名称" ,"itemName"));
break;
case "primaryUomCode" :
entitys.add(new ExcelExportEntity("主单位代码" ,"primaryUomCode"));
case "description" :
entitys.add(new ExcelExportEntity("物料说明" ,"description"));
break;
case "primaryUnitOmeasure" :
entitys.add(new ExcelExportEntity("主单位名称" ,"primaryUnitOmeasure"));
@ -210,33 +198,30 @@ public class MaterialController {
case "inArea" :
entitys.add(new ExcelExportEntity("默认入库区" ,"inArea"));
break;
case "creatorusername" :
entitys.add(new ExcelExportEntity("创建人名称" ,"creatorusername"));
case "standardCost" :
entitys.add(new ExcelExportEntity("标准成本" ,"standardCost"));
break;
case "creatortime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatortime"));
case "financial" :
entitys.add(new ExcelExportEntity("财务类别" ,"financial"));
break;
case "lastmodifyusername" :
entitys.add(new ExcelExportEntity("修改人名称" ,"lastmodifyusername"));
break;
case "lastmodifytime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastmodifytime"));
case "financialName" :
entitys.add(new ExcelExportEntity("类别名称" ,"financialName"));
break;
case "effectiveStatus" :
entitys.add(new ExcelExportEntity("生效状态" ,"effectiveStatus"));
break;
case "processingType" :
entitys.add(new ExcelExportEntity("处理类型" ,"processingType"));
break;
case "readTag" :
entitys.add(new ExcelExportEntity("读取标记" ,"readTag"));
break;
case "readDate" :
entitys.add(new ExcelExportEntity("读取时间" ,"readDate"));
case "itemId" :
entitys.add(new ExcelExportEntity("ERP物料ID" ,"itemId"));
break;
case "errorMessage" :
entitys.add(new ExcelExportEntity("错误信息" ,"errorMessage"));
break;
case "creatorTime" :
entitys.add(new ExcelExportEntity("创建时间" ,"creatorTime"));
break;
case "lastModifyTime" :
entitys.add(new ExcelExportEntity("修改时间" ,"lastModifyTime"));
break;
default:
break;
}
@ -300,6 +285,12 @@ public class MaterialController {
public ActionResult<MaterialInfoVO> info(@PathVariable("id") String id){
MaterialEntity entity= materialService.getInfo(id);
MaterialInfoVO vo=JsonUtil.getJsonToBean(entity, MaterialInfoVO.class);
if(vo.getCreatorTime()!=null){
vo.setCreatorTime(vo.getCreatorTime());
}
if(vo.getLastModifyTime()!=null){
vo.setLastModifyTime(vo.getLastModifyTime());
}
//子表
//副表
@ -323,9 +314,9 @@ public class MaterialController {
//添加到详情表单对象中
Map<String,Object> outAreaMap = new HashMap<>();
vo.setOutArea(generaterSwapUtil.swapRelationFormValue("comInputField102",vo.getOutArea(),"294012196529150981",outAreaMap));
vo.setOutArea(generaterSwapUtil.getPopupSelectValue("381404161809350213","id","areaname",vo.getOutArea(),outAreaMap));
Map<String,Object> inAreaMap = new HashMap<>();
vo.setInArea(generaterSwapUtil.swapRelationFormValue("comInputField102",vo.getInArea(),"294012196529150981",inAreaMap));
vo.setInArea(generaterSwapUtil.getPopupSelectValue("381404161809350213","id","areaname",vo.getInArea(),inAreaMap));
return ActionResult.success(vo);
}
@ -345,7 +336,9 @@ public class MaterialController {
UserInfo userInfo=userProvider.get();
MaterialEntity entity= materialService.getInfo(id);
if(entity!=null){
materialUpForm.setLastModifyTime(DateUtil.getNow());
MaterialEntity subentity=JsonUtil.getJsonToBean(materialUpForm, MaterialEntity.class);
subentity.setCreatorTime(entity.getCreatorTime());
materialService.update(id, subentity);
return ActionResult.success("更新成功");
}else{

@ -0,0 +1,117 @@
package jnpf.materialvo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-02-15
*/
@Data
@TableName("jg_material")
public class MaterialEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deleteTime;
@TableField("DELETE_MARK")
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("M_ID")
private String mId;
@TableField("ITEM_ID")
private String itemId;
@TableField("ITEM_CODE")
private String itemCode;
@TableField("ITEM_NAME")
private String itemName;
@TableField("DESCRIPTION")
private String description;
@TableField("PRIMARY_UNIT_OF_MEASURE")
private String primaryUnitOmeasure;
@TableField("PURCHASE_FLAG")
private String purchaseFlag;
@TableField("SALES_FLAG")
private String salesFlag;
@TableField("IN_AREA")
private String inArea;
@TableField("OUT_AREA")
private String outArea;
@TableField("EFFECTIVE_STATUS")
private String effectiveStatus;
@TableField("PROCESSING_TYPE")
private String processingType;
@TableField("READ_TAG")
private String readTag;
@TableField("READ_DATE")
private Date readDate;
@TableField("ERROR_MESSAGE")
private String errorMessage;
@TableField("FINANCIAL")
private String financial;
@TableField("FINANCIAL_NAME")
private String financialName;
@TableField("STANDARD_COST")
private BigDecimal standardCost;
}

@ -1,7 +1,8 @@
package jnpf.material.entity;
package jnpf.materialvo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.math.BigDecimal;
@ -9,44 +10,44 @@ import java.util.Date;
/**
* @Author: WangChuang
* @Date: 2/2/2023 3:31
* @Date: 15/2/2023 11:30
* @Description //注释:
* @Version 1.0
*/
@Data
public class MaterialMobileEntity extends MaterialEntity {
public class MaterialVoMobileEntity {
@TableId("ID")
private String id;
@TableField("CREATOR_USER_ID")
private String creatoruserid;
private String creatorUserId;
@TableField("CREATOR_USER_NAME")
private String creatorusername;
private String creatorUserName;
@TableField("CREATOR_TIME")
private Date creatortime;
private Date creatorTime;
@TableField("LAST_MODIFY_USER_ID")
private String lastmodifyuserid;
private String lastModifyUserId;
@TableField("LAST_MODIFY_USER_NAME")
private String lastmodifyusername;
private String lastModifyUserName;
@TableField("LAST_MODIFY_TIME")
private Date lastmodifytime;
private Date lastModifyTime;
@TableField("DELETE_USER_ID")
private String deleteuserid;
private String deleteUserId;
@TableField("DELETE_USER_NAME")
private String deleteusername;
private String deleteUserName;
@TableField("DELETE_TIME")
private Date deletetime;
private Date deleteTime;
@TableField("DELETE_MARK")
private String deletemark;
private String deleteMark;
@TableField("ORGNIZE_ID")
private String orgnizeId;
@ -63,18 +64,12 @@ public class MaterialMobileEntity extends MaterialEntity {
@TableField("ITEM_CODE")
private String itemCode;
@TableField("ORGANIZATION_ID")
private String organizationId;
@TableField("ORGANIZATION_CODE")
private String organizationCode;
@TableField("ITEM_NAME")
private String itemName;
@TableField("DESCRIPTION")
private String description;
@TableField("PRIMARY_UOM_CODE")
private String primaryUomCode;
@TableField("PRIMARY_UNIT_OF_MEASURE")
private String primaryUnitOmeasure;
@ -104,18 +99,25 @@ public class MaterialMobileEntity extends MaterialEntity {
@TableField("ERROR_MESSAGE")
private String errorMessage;
// 采购次数
@TableField("FINANCIAL")
private String financial;
@TableField("FINANCIAL_NAME")
private String financialName;
@TableField("STANDARD_COST")
private BigDecimal standardCost;
@JsonProperty("purchasesNumber")
private Integer purchasesNumber;
// 采购量(吨)
private BigDecimal purchasesWeight;
@JsonProperty("purchasesWeight")
private Double purchasesWeight;
// 销售次数
@JsonProperty("salesNumber")
private Integer salesNumber;
// 销售量
private BigDecimal salesWeight;
// 转换方法
//创建转换方法
@JsonProperty("salesWeight")
private Double salesWeight;
}

@ -1,31 +1,29 @@
package jnpf.material.mapper;
package jnpf.materialvo.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.material.entity.MaterialEntity;
import jnpf.material.entity.MaterialMobileEntity;
import jnpf.materialvo.entity.MaterialEntity;
import jnpf.materialvo.entity.MaterialVoMobileEntity;
import org.apache.ibatis.annotations.Param;
/**
*
* material
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
* 2023-02-15
*/
public interface MaterialMapper extends BaseMapper<MaterialEntity> {
/**
*
* @param page
* @param queryWrapper
* @return
*/
IPage<MaterialMobileEntity> getMaterialMobileList(@Param("page") IPage<MaterialMobileEntity> page,
IPage<MaterialVoMobileEntity> getMaterialMobileList(@Param("page") IPage<MaterialVoMobileEntity> page,
@Param("ew") Wrapper<MaterialEntity> queryWrapper);
}

@ -1,6 +1,6 @@
package jnpf.material.model.material;
package jnpf.materialvo.model.material;
import lombok.Data;
import java.util.List;
@ -14,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Data
public class MaterialCrForm {
@ -24,17 +24,13 @@ public class MaterialCrForm {
private String itemCode;
/** 物料名称 **/
@JsonProperty("itemName")
private String itemName;
/** 物料说明 **/
@JsonProperty("description")
private String description;
/** 库存组织代码 **/
@JsonProperty("organizationCode")
private String organizationCode;
/** 主单位代码 **/
@JsonProperty("primaryUomCode")
private String primaryUomCode;
/** 主单位名称 **/
@JsonProperty("primaryUnitOmeasure")
private String primaryUnitOmeasure;
@ -55,42 +51,38 @@ public class MaterialCrForm {
@JsonProperty("inArea")
private String inArea;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 标准成本 **/
@JsonProperty("standardCost")
private String standardCost;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 财务类别 **/
@JsonProperty("financial")
private String financial;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
/** 类别名称 **/
@JsonProperty("financialName")
private String financialName;
/** 生效状态 **/
@JsonProperty("effectiveStatus")
private String effectiveStatus;
/** 处理类型 **/
@JsonProperty("processingType")
private String processingType;
/** 读取标记 **/
@JsonProperty("readTag")
private String readTag;
/** 读取时间 **/
@JsonProperty("readDate")
private Long readDate;
/** ERP物料ID **/
@JsonProperty("itemId")
private String itemId;
/** 错误信息 **/
@JsonProperty("errorMessage")
private String errorMessage;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
}

@ -1,7 +1,7 @@
package jnpf.material.model.material;
package jnpf.materialvo.model.material;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonProperty;
@ -15,7 +15,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Data
public class MaterialInfoVO{
@ -28,17 +28,13 @@ public class MaterialInfoVO{
private String itemCode;
/** 物料名称 **/
@JsonProperty("itemName")
private String itemName;
/** 物料说明 **/
@JsonProperty("description")
private String description;
/** 库存组织代码 **/
@JsonProperty("organizationCode")
private String organizationCode;
/** 主单位代码 **/
@JsonProperty("primaryUomCode")
private String primaryUomCode;
/** 主单位名称 **/
@JsonProperty("primaryUnitOmeasure")
private String primaryUnitOmeasure;
@ -59,40 +55,38 @@ public class MaterialInfoVO{
@JsonProperty("inArea")
private String inArea;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 标准成本 **/
@JsonProperty("standardCost")
private String standardCost;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 财务类别 **/
@JsonProperty("financial")
private String financial;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
/** 类别名称 **/
@JsonProperty("financialName")
private String financialName;
/** 生效状态 **/
@JsonProperty("effectiveStatus")
private String effectiveStatus;
/** 处理类型 **/
@JsonProperty("processingType")
private String processingType;
/** 读取标记 **/
@JsonProperty("readTag")
private String readTag;
/** 读取时间 **/
@JsonProperty("readDate")
private Long readDate;
/** ERP物料ID **/
@JsonProperty("itemId")
private String itemId;
/** 错误信息 **/
@JsonProperty("errorMessage")
private String errorMessage;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatorTime")
private Date creatorTime;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
}

@ -1,4 +1,4 @@
package jnpf.material.model.material;
package jnpf.materialvo.model.material;
import lombok.Data;
import java.util.Date;
@ -10,7 +10,7 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Data
public class MaterialListQuery extends Pagination {
@ -19,7 +19,7 @@ public class MaterialListQuery extends Pagination {
private String itemCode;
/** 物料名称 */
private String description;
private String itemName;
/**
* id
*/

@ -1,21 +1,20 @@
package jnpf.material.model.material;
package jnpf.materialvo.model.material;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
import lombok.Data;
import java.util.Date;
/**
*
*
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Data
public class MaterialListVO{
@ -30,18 +29,13 @@ public class MaterialListVO{
/** 物料名称 **/
@JsonProperty("description")
private String description;
@JsonProperty("itemName")
private String itemName;
/** 库存组织代码 **/
@JsonProperty("organizationCode")
private String organizationCode;
/** 主单位代码 **/
@JsonProperty("primaryUomCode")
private String primaryUomCode;
/** 物料说明 **/
@JsonProperty("description")
private String description;
/** 主单位名称 **/
@ -69,26 +63,19 @@ public class MaterialListVO{
private String inArea;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("creatortime")
private Date creatortime;
/** 标准成本 **/
@JsonProperty("standardCost")
private String standardCost;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 财务类别 **/
@JsonProperty("financial")
private String financial;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastmodifytime")
private Date lastmodifytime;
/** 类别名称 **/
@JsonProperty("financialName")
private String financialName;
/** 生效状态 **/
@ -96,25 +83,26 @@ public class MaterialListVO{
private String effectiveStatus;
/** 处理类型 **/
@JsonProperty("processingType")
private String processingType;
/** ERP物料ID **/
@JsonProperty("itemId")
private String itemId;
/** 读取标记 **/
@JsonProperty("readTag")
private String readTag;
/** 错误信息 **/
@JsonProperty("errorMessage")
private String errorMessage;
/** 读取时间 **/
/** 创建时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("readDate")
private Date readDate;
@JsonProperty("creatorTime")
private Date creatorTime;
/** 错误信息 **/
@JsonProperty("errorMessage")
private String errorMessage;
/** 修改时间 **/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@JsonProperty("lastModifyTime")
private Date lastModifyTime;
@JsonProperty("purchasesNumber")
private Integer purchasesNumber;

@ -1,4 +1,4 @@
package jnpf.material.model.material;
package jnpf.materialvo.model.material;
import lombok.Data;
@ -11,7 +11,7 @@ import java.util.List;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Data
public class MaterialPagination extends Pagination {
@ -20,7 +20,7 @@ public class MaterialPagination extends Pagination {
private String itemCode;
/** 物料名称 */
private String description;
private String itemName;
/**
* id
*/

@ -1,4 +1,4 @@
package jnpf.material.model.material;
package jnpf.materialvo.model.material;
import lombok.Data;
import jnpf.base.Pagination;
@ -9,7 +9,7 @@ import java.util.*;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Data
public class MaterialPaginationExportModel extends Pagination {
@ -25,5 +25,5 @@ public class MaterialPaginationExportModel extends Pagination {
private String itemCode;
/** 物料名称 */
private String description;
private String itemName;
}

@ -1,6 +1,6 @@
package jnpf.material.model.material;
package jnpf.materialvo.model.material;
import lombok.Data;
import java.util.List;
@ -15,7 +15,7 @@ import lombok.Data;
* @ V3.2.0
* @ LINKAGE-BOOT
* @ LINKAGE-BOOT
* @ 2023-01-05
* @ 2023-02-15
*/
@Data
public class MaterialUpForm{
@ -29,18 +29,13 @@ public class MaterialUpForm{
/** 物料名称 **/
@JsonProperty("description")
private String description;
@JsonProperty("itemName")
private String itemName;
/** 库存组织代码 **/
@JsonProperty("organizationCode")
private String organizationCode;
/** 主单位代码 **/
@JsonProperty("primaryUomCode")
private String primaryUomCode;
/** 物料说明 **/
@JsonProperty("description")
private String description;
/** 主单位名称 **/
@ -68,24 +63,19 @@ public class MaterialUpForm{
private String inArea;
/** 创建人名称 **/
@JsonProperty("creatorusername")
private String creatorusername;
/** 创建时间 **/
@JsonProperty("creatortime")
private Long creatortime;
/** 标准成本 **/
@JsonProperty("standardCost")
private String standardCost;
/** 修改人名称 **/
@JsonProperty("lastmodifyusername")
private String lastmodifyusername;
/** 财务类别 **/
@JsonProperty("financial")
private String financial;
/** 修改时间 **/
@JsonProperty("lastmodifytime")
private Long lastmodifytime;
/** 类别名称 **/
@JsonProperty("financialName")
private String financialName;
/** 生效状态 **/
@ -93,24 +83,24 @@ public class MaterialUpForm{
private String effectiveStatus;
/** 处理类型 **/
@JsonProperty("processingType")
private String processingType;
/** ERP物料ID **/
@JsonProperty("itemId")
private String itemId;
/** 读取标记 **/
@JsonProperty("readTag")
private String readTag;
/** 错误信息 **/
@JsonProperty("errorMessage")
private String errorMessage;
/** 读取时间 **/
@JsonProperty("readDate")
private Long readDate;
/** 创建时间 **/
@JsonProperty("creatorTime")
private String creatorTime;
/** 错误信息 **/
@JsonProperty("errorMessage")
private String errorMessage;
/** 修改时间 **/
@JsonProperty("lastModifyTime")
private String lastModifyTime;
}

@ -0,0 +1,45 @@
package jnpf.materialvo.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import jnpf.materialvo.entity.MaterialEntity;
import jnpf.materialvo.entity.MaterialVoMobileEntity;
import jnpf.materialvo.model.material.MaterialPagination;
import java.util.List;
/**
*
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-02-15
*/
public interface MaterialService extends IService<MaterialEntity> {
IPage<MaterialVoMobileEntity> page(Page<MaterialVoMobileEntity> page, Wrapper<MaterialEntity> queryWrapper);
// IPage<MaterialVoMobileEntity> page(IPage<MaterialVoMobileEntity> page, Wrapper<MaterialEntity> queryWrapper);
List<MaterialVoMobileEntity> getList(MaterialPagination materialPagination);
List<MaterialEntity> getTypeList(MaterialPagination materialPagination,String dataType);
MaterialEntity getInfo(String id);
void delete(MaterialEntity entity);
void create(MaterialEntity entity);
boolean update( String id, MaterialEntity entity);
// 子表方法
//列表子表数据方法
}

@ -1,4 +1,4 @@
package jnpf.material.service.impl;
package jnpf.materialvo.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.annotation.TableField;
@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.material.entity.MaterialEntity;
import jnpf.material.entity.MaterialMobileEntity;
import jnpf.material.mapper.MaterialMapper;
import jnpf.material.model.material.MaterialPagination;
import jnpf.material.service.MaterialService;
import jnpf.materialvo.entity.MaterialEntity;
import jnpf.materialvo.entity.MaterialVoMobileEntity;
import jnpf.materialvo.mapper.MaterialMapper;
import jnpf.materialvo.model.material.MaterialPagination;
import jnpf.materialvo.service.MaterialService;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.permission.service.AuthorizeService;
import jnpf.util.ServletUtil;
@ -27,11 +27,11 @@ import java.util.List;
/**
*
* material
*
* V3.2.0
* LINKAGE-BOOT
* LINKAGE-BOOT
* 2023-01-05
* 2023-02-15
*/
@Service
public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEntity> implements MaterialService {
@ -47,10 +47,21 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
private MaterialMapper materialMapper;
// @Override
// public IPage<MaterialVoMobileEntity> page(IPage<MaterialVoMobileEntity> page, Wrapper<MaterialEntity> queryWrapper) {
//
//// IPage<MaterialMobileEntity> materialMobileList = materialMapper.getMaterialMobileList(null, null);
//// return super.page(page, queryWrapper);
// return materialMapper.getMaterialMobileList(page, queryWrapper);;
// }
@Override
public IPage<MaterialVoMobileEntity> page(Page<MaterialVoMobileEntity> page, Wrapper<MaterialEntity> queryWrapper) {
return materialMapper.getMaterialMobileList(page,queryWrapper);
}
@Override
public List<MaterialMobileEntity> getList(MaterialPagination materialPagination){
public List<MaterialVoMobileEntity> getList(MaterialPagination materialPagination){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
@ -88,9 +99,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
materialQueryWrapper.lambda().like(MaterialEntity::getItemCode,materialPagination.getItemCode());
}
if(StringUtil.isNotEmpty(materialPagination.getDescription())){
if(StringUtil.isNotEmpty(materialPagination.getItemName())){
materialNum++;
materialQueryWrapper.lambda().like(MaterialEntity::getDescription,materialPagination.getDescription());
materialQueryWrapper.lambda().like(MaterialEntity::getItemName,materialPagination.getItemName());
}
if(AllIdList.size()>0){
@ -98,7 +109,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
}
//排序
if(StringUtil.isEmpty(materialPagination.getSidx())){
materialQueryWrapper.lambda().orderByDesc(MaterialEntity::getId);
materialQueryWrapper.lambda().orderByDesc(MaterialEntity::getCreatorTime);
}else{
try {
String sidx = materialPagination.getSidx();
@ -111,24 +122,17 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
e.printStackTrace();
}
}
ArrayList<MaterialMobileEntity> list1 = new ArrayList<>();
if((total>0 && AllIdList.size()>0) || total==0){
Page<MaterialMobileEntity> page=new Page<>(materialPagination.getCurrentPage(), materialPagination.getPageSize());
IPage<MaterialMobileEntity> userIPage=this.pagee(page, materialQueryWrapper);
List<MaterialMobileEntity> materialEntities = materialPagination.setData(userIPage.getRecords(), userIPage.getTotal());
return materialEntities;
Page<MaterialVoMobileEntity> page=new Page<>(materialPagination.getCurrentPage(), materialPagination.getPageSize());
IPage<MaterialVoMobileEntity> userIPage=this.page(page, materialQueryWrapper);
return materialPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MaterialEntity> list = new ArrayList();
List<MaterialEntity> materialEntities = materialPagination.setData(list, list.size());
for (MaterialEntity materialEntity : materialEntities) {
list1.add(materialEntity.convertTo());
}
return list1;
List<MaterialVoMobileEntity> list = new ArrayList();
return materialPagination.setData(list, list.size());
}
}
@Override
public List<MaterialMobileEntity> getTypeList(MaterialPagination materialPagination,String dataType){
public List<MaterialEntity> getTypeList(MaterialPagination materialPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
int total=0;
@ -166,9 +170,9 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
materialQueryWrapper.lambda().like(MaterialEntity::getItemCode,materialPagination.getItemCode());
}
if(StringUtil.isNotEmpty(materialPagination.getDescription())){
if(StringUtil.isNotEmpty(materialPagination.getItemName())){
materialNum++;
materialQueryWrapper.lambda().like(MaterialEntity::getDescription,materialPagination.getDescription());
materialQueryWrapper.lambda().like(MaterialEntity::getItemName,materialPagination.getItemName());
}
if(AllIdList.size()>0){
@ -176,7 +180,7 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
}
//排序
if(StringUtil.isEmpty(materialPagination.getSidx())){
materialQueryWrapper.lambda().orderByDesc(MaterialEntity::getId);
materialQueryWrapper.lambda().orderByDesc(MaterialEntity::getCreatorTime);
}else{
try {
String sidx = materialPagination.getSidx();
@ -191,20 +195,15 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<MaterialMobileEntity> page=new Page<>(materialPagination.getCurrentPage(), materialPagination.getPageSize());
IPage<MaterialMobileEntity> userIPage=this.pagee(page, materialQueryWrapper);
Page<MaterialEntity> page=new Page<>(materialPagination.getCurrentPage(), materialPagination.getPageSize());
IPage<MaterialEntity> userIPage=this.page(page, materialQueryWrapper);
return materialPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<MaterialMobileEntity> list = new ArrayList();
List<MaterialEntity> list = new ArrayList();
return materialPagination.setData(list, list.size());
}
}else{
List<MaterialEntity> list = list(materialQueryWrapper);
List<MaterialMobileEntity> list2 = new ArrayList<>();
for (MaterialEntity materialEntity : list) {
list2.add(materialEntity.convertTo());
}
return list2;
return this.list(materialQueryWrapper);
}
}
@ -231,21 +230,6 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
this.removeById(entity.getId());
}
}
@Override
public <E extends IPage<MaterialEntity>> E page(E page) {
return super.page(page);
}
public IPage<MaterialMobileEntity> pagee(Page<MaterialMobileEntity> page, Wrapper<MaterialEntity> queryWrapper) {
IPage<MaterialMobileEntity> materialMobileList = materialMapper.getMaterialMobileList(page, queryWrapper);
// IPage<MaterialMobileEntity> materialMobileList = materialMapper.getMaterialMobileList(null, null);
// return super.page(page, queryWrapper);
return materialMobileList;
}
//子表方法
//列表子表数据方法

@ -4,13 +4,21 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jnpf.base.ActionResult;
import jnpf.contractfile.model.contractfile.ContractFileListQueryModel;
import jnpf.mobilePort.utils.ExportPdf;
import jnpf.util.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@Slf4j
@RestController
@ -19,6 +27,46 @@ import java.util.HashMap;
public class MobilePortController {
@GetMapping(value = "/exportPdf", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public ResponseEntity<byte[]> exportBillInfo() {
byte[] bytes = null;
HttpHeaders headers = null;
ByteArrayOutputStream out=null;
try {
ExportPdf exportPdf = new ExportPdf();
//渲染模板参数
Map map=new HashMap();
map.put("title","标题");
map.put("name", "老王");
//repotData自己加测试数据
map.put("repotData", new ArrayList<>());
out= exportPdf.createPdf(map, "test.ftl", "/templates/export");
bytes = out.toByteArray();
String fileName="测试.pdf";
fileName = URLEncoder.encode(fileName, "utf-8");
headers = new HttpHeaders();
headers.add("Content-Disposition",
"attachment; filename=" + fileName);
//"attachment; filename=" + new String(fileName.getBytes("gbk"), StandardCharsets.ISO_8859_1));
} catch (Exception e) {
log.error("导出pdf失败:{}", e);
// throw new SubBusinessException(ErrorCode.FILE_DOWNLOAD_ERROR, "导出pdf失败!");
}finally {
if (null!=out){
try {
out.close();
} catch (IOException e) {
log.error("out close error:{}", e);
}
}
}
return new ResponseEntity<>(bytes, headers, HttpStatus.OK);
}
/**
* 退-退
* @author

@ -0,0 +1,69 @@
package jnpf.mobilePort.utils;
import com.lowagie.text.pdf.BaseFont;
import freemarker.template.Configuration;
import freemarker.template.Template;
import org.xhtmlrenderer.pdf.ITextRenderer;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.StringWriter;
import java.util.Locale;
import java.util.Map;
/**
* @Author: WangChuang
* @Date: 15/2/2023 10:03
* @Description //注释:
* @Version 1.0
*/
public class ExportPdf {
/**
* pdf
*
* @param data
* @param templateFileName
* @throws Exception SIMSUN.TTC
*/
public ByteArrayOutputStream createPdf(Map data, String templateFileName, String basePackagePath) throws Exception {
OutputStream out = new ByteArrayOutputStream();
// 创建一个FreeMarker实例, 负责管理FreeMarker模板的Configuration实例
Configuration cfg = new Configuration();
cfg.setDefaultEncoding("UTF-8");
// 指定FreeMarker模板文件的位置
cfg.setClassForTemplateLoading(this.getClass(), basePackagePath);
ITextRenderer renderer = new ITextRenderer();
// 设置 css中 的字体样式(暂时仅支持宋体和黑体) 必须,不然中文不显示
//String path = ExportPdf.class.getResource("").getPath();
//String path = ExportPdf.class.getResource("/").getPath() + "templates/export/";
String path = "/templates/export/";
renderer.getFontResolver().addFont(path + "simsun.ttc", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
// 设置模板的编码格式
cfg.setEncoding(Locale.CHINA, "UTF-8");
// 获取模板文件
Template template = cfg.getTemplate(templateFileName, "UTF-8");
StringWriter writer = new StringWriter();
// 将数据输出到html中
template.process(data, writer);
writer.flush();
String html = writer.toString();
// 把html代码传入渲染器中
renderer.setDocumentFromString(html);
// 设置模板中的图片路径 这里的images在resources目录下 模板中img标签src路径需要相对路径加图片名 如<img src="images/xh.jpg"/>
// String url = ImportExcelUtil.class.getClassLoader().getResource("images").toURI().toString();
// renderer.getSharedContext().setBaseURL(url);
renderer.layout();
renderer.createPDF(out, false);
renderer.finishPDF();
out.flush();
writer.close();
return (ByteArrayOutputStream) out;
}
}

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.material.mapper.MaterialMapper">
<mapper namespace="jnpf.materialvo.mapper.MaterialMapper">
<!--获取派工单信息-->
@ -26,10 +26,11 @@
a.m_id m_id,
a.item_id item_id,
a.item_code item_code,
a.organization_id organization_id,
a.organization_code organization_code,
a.item_name item_name,
a.financial financial,
a.financial_name financial_name,
a.standard_cost standard_cost,
a.description description,
a.primary_uom_code primary_uom_code,
a.primary_unit_of_measure primary_unit_of_measure,
a.purchase_flag purchase_flag,
a.sales_flag sales_flag,
@ -56,7 +57,6 @@
AND ( b.purchase_status != 0 OR b.purchase_status IS NULL )
AND ( b.purchase_status != 99 OR b.purchase_status IS NULL )
AND ( b.pound_status != '1' OR b.pound_status IS NULL )
GROUP BY
a.id
) aaa
@ -64,27 +64,30 @@
</select>
<!--获取派工单信息映射-->
<resultMap id="findWorkOrderByCondition" type="jnpf.material.entity.MaterialMobileEntity">
<resultMap id="findWorkOrderByCondition" type="jnpf.materialvo.entity.MaterialVoMobileEntity">
<result column="id" property="id"/>
<result column="creator_user_id" property="creatoruserid"/>
<result column="creator_user_name" property="creatorusername"/>
<result column="creator_time" property="creatortime"/>
<result column="last_modify_user_id" property="lastmodifyuserid"/>
<result column="last_modify_user_name" property="lastmodifyusername"/>
<result column="last_modify_time" property="lastmodifytime"/>
<result column="delete_user_id" property="deleteuserid"/>
<result column="delete_user_name" property="deleteusername"/>
<result column="delete_time" property="deletetime"/>
<result column="delete_mark" property="deletemark"/>
<result column="creator_user_id" property="creatorUserId"/>
<result column="creator_user_name" property="creatorUserName"/>
<result column="creator_time" property="creatorTime"/>
<result column="last_modify_user_id" property="lastModifyUserId"/>
<result column="last_modify_user_name" property="lastModifyUserName"/>
<result column="last_modify_time" property="lastModifyTime"/>
<result column="delete_user_id" property="deleteUserId"/>
<result column="delete_user_name" property="deleteUserName"/>
<result column="delete_time" property="deleteTime"/>
<result column="delete_mark" property="deleteMark"/>
<result column="orgnize_id" property="orgnizeId"/>
<result column="department_id" property="departmentId"/>
<result column="m_id" property="mId"/>
<result column="item_id" property="itemId"/>
<result column="item_code" property="itemCode"/>
<result column="organization_id" property="organizationId"/>
<result column="organization_code" property="organizationCode"/>
<result column="item_name" property="itemName"/>
<result column="description" property="description"/>
<result column="primary_uom_code" property="primaryUomCode"/>
<result column="financial" property="financial"/>
<result column="financial_name" property="financialName"/>
<result column="standard_cost" property="standardCost"/>
<result column="primary_unit_of_measure" property="primaryUnitOmeasure"/>
<result column="purchase_flag" property="purchaseFlag"/>
<result column="sales_flag" property="salesFlag"/>

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"></meta>
<title>
${title!""}
</title>
<style>
body {
font-family: SimSun;
}
</style>
</head>
<body>
<h2 style="text-align: center">${title!""}</h2>
<p style="text-indent: 2em">信息</p>
<br/>
<br/>
<p style="font-weight: bold">基本信息:</p>
<p style="text-indent: 2em">用户名称:${name!""}</p>
<br/>
<br/>
<p style="font-weight: bold">集合:</p>
<table border="1" cellspacing="0" width="100%">
<tr bgcolor="#6495ed" style="font-weight: bold">
<td width="10%">字段1</td>
<td width="15%">字段2</td>
<td width="10%">字段3</td>
<td width="25%">字段4</td>
<td width="20%">字段5</td>
<td width="10%">字段6</td>
<td width="10%">字段7</td>
</tr>
<#if reportList?? && (reportList?size>0)>
<#list reportList as reportData>
<#if reportData??>
<#if reportData_index == 0>
<tr style="page-break-inside: avoid;page-break-after: auto;">
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column1!""}</td>
<td width="15%" style="word-break: break-all;word-wrap: break-word">${reportData.column2!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column3!""}</td>
<td width="25%" style="word-break: break-all;word-wrap: break-word">${reportData.column4!""}</td>
<td width="20%" style="word-break: break-all;word-wrap: break-word">${reportData.column5!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column6!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column7!""}</td>
</tr>
<#else >
<#assign preData=reportList[reportData_index-1] />
<tr style="page-break-inside: avoid;page-break-after: auto;">
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column1!""}</td>
<td width="15%" style="word-break: break-all;word-wrap: break-word">${reportData.column2!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column3!""}</td>
<td width="25%" style="word-break: break-all;word-wrap: break-word">${reportData.column4!""}</td>
<td width="20%" style="word-break: break-all;word-wrap: break-word">${reportData.column5!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column6!""}</td>
<td width="10%" style="word-break: break-all;word-wrap: break-word">${reportData.column7!""}</td>
</tr>
</#if>
</#if>
</#list>
</#if>
</table>
<br/>
<br/>
</body>
</html>

@ -14,26 +14,20 @@
</el-col>
<el-col :span="12" >
<el-form-item label="物料名称"
prop="description" >
<p>{{dataForm.description}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="库存组织代码"
prop="organizationCode" >
<p>{{dataForm.organizationCode}}</p>
prop="itemName" >
<p>{{dataForm.itemName}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="主单位代码"
prop="primaryUomCode" >
<p>{{dataForm.primaryUomCode}}</p>
<el-form-item label="物料说明"
prop="description" >
<p>{{dataForm.description}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="主单位名称"
prop="primaryUnitOmeasure" >
<p>{{dataForm.primaryUnitOmeasure}}</p>
<p>{{ dataForm.primaryUnitOmeasure | dynamicText(primaryUnitOmeasureOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
@ -61,27 +55,21 @@
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<p>{{dataForm.creatorusername}}</p>
<el-form-item label="标准成本"
prop="standardCost" >
<p>{{dataForm.standardCost}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="创建时间"
prop="creatortime" >
<p>{{jnpf.dateFormat(dataForm.creatortime)}}</p>
<el-form-item label="财务类别"
prop="financial" >
<p>{{dataForm.financial}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<p>{{dataForm.lastmodifyusername}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<p>{{jnpf.dateFormat(dataForm.lastmodifytime)}}</p>
<el-form-item label="类别名称"
prop="financialName" >
<p>{{dataForm.financialName}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
@ -90,30 +78,6 @@
<p>{{ dataForm.effectiveStatus | dynamicText(effectiveStatusOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="处理类型"
prop="processingType" >
<p>{{ dataForm.processingType | dynamicText(processingTypeOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="读取标记"
prop="readTag" >
<p>{{ dataForm.readTag | dynamicText(readTagOptions) }} </p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="读取时间"
prop="readDate" >
<p>{{dataForm.readDate}}</p>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="错误信息"
prop="errorMessage" >
<p>{{dataForm.errorMessage}}</p>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
@ -138,29 +102,26 @@
dataForm: {
id :'',
itemCode : '',
itemName : '',
description : '',
organizationCode : '',
primaryUomCode : '',
primaryUnitOmeasure : '',
primaryUnitOmeasure : "",
purchaseFlag : "",
salesFlag : "",
outArea : "",
inArea : "",
creatorusername : '',
creatortime : '',
lastmodifyusername : '',
lastmodifytime : '',
effectiveStatus : "",
processingType : "",
readTag : "",
readDate : '',
standardCost : '',
financial : '',
financialName : '',
effectiveStatus : "Y",
itemId : '',
errorMessage : '',
creatorTime : "",
lastModifyTime : "",
},
purchaseFlagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
salesFlagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
effectiveStatusOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
processingTypeOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
readTagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
primaryUnitOmeasureOptions:[{"fullName":"千克","id":"1"},{"fullName":"吨","id":"0"}],
purchaseFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
salesFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
effectiveStatusOptions:[{"fullName":"生效","id":"Y"},{"fullName":"不生效","id":"N"}],
}
},
@ -183,7 +144,7 @@
if(this.dataForm.id){
this.loading = true
request({
url: '/api/Material/Material/detail/'+this.dataForm.id,
url: '/api/example/Material/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)

@ -1,167 +1,127 @@
<template>
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="1000px">
<el-row :gutter="15" class="">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
label-position="right">
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="12" >
<el-form-item label="物料编码" prop="itemCode">
<el-input v-model="dataForm.itemCode" placeholder="请输入" clearable :style='{"width":"100%"}'>
<el-form-item label="物料编码"
prop="itemCode" >
<el-input v-model="dataForm.itemCode"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="物料名称" prop="description">
<el-input v-model="dataForm.description" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<el-form-item label="物料名称"
prop="itemName" >
<el-input v-model="dataForm.itemName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="库存组织代码" prop="organizationCode">
<el-input v-model="dataForm.organizationCode" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<el-form-item label="物料说明"
prop="description" >
<el-input v-model="dataForm.description"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="主单位代码" prop="primaryUomCode">
<el-input v-model="dataForm.primaryUomCode" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<el-form-item label="主单位名称"
prop="primaryUnitOmeasure" >
<el-select v-model="dataForm.primaryUnitOmeasure"
placeholder="请选择单位名称" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in primaryUnitOmeasureOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主单位名称" prop="primaryUnitOmeasure">
<el-input v-model="dataForm.primaryUnitOmeasure" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="是否可采购" prop="purchaseFlag">
<el-select v-model="dataForm.purchaseFlag" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in purchaseFlagOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
<el-form-item label="是否可采购"
prop="purchaseFlag" >
<el-select v-model="dataForm.purchaseFlag"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in purchaseFlagOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="是否可销售 " prop="salesFlag">
<el-select v-model="dataForm.salesFlag" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in salesFlagOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
<el-form-item label="是否可销售 "
prop="salesFlag" >
<el-select v-model="dataForm.salesFlag"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in salesFlagOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="默认出库区" prop="outArea">
<popupSelect v-model="dataForm.outArea" placeholder="请选择" clearable field="outArea"
interfaceId="381404161809350213" :columnOptions="outAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
popupTitle="选择数据" popupWidth="800px">
<el-form-item label="默认出库区"
prop="outArea" >
<popupSelect v-model="dataForm.outArea"
placeholder="请选择" clearable field="outArea" interfaceId="381404161809350213" :columnOptions="outAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="默认入库区" prop="inArea">
<popupSelect v-model="dataForm.inArea" placeholder="请选择" clearable field="inArea"
interfaceId="381404161809350213" :columnOptions="inAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
popupTitle="选择数据" popupWidth="800px">
<el-form-item label="默认入库区"
prop="inArea" >
<popupSelect v-model="dataForm.inArea"
placeholder="请选择" clearable field="inArea" interfaceId="381404161809350213" :columnOptions="inAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
popupTitle="选择数据" popupWidth="800px"
>
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<el-form-item label="标准成本"
prop="standardCost" >
<el-input v-model="dataForm.standardCost"
placeholder="请输入标准成本" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="创建时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
<el-form-item label="财务类别"
prop="financial" >
<el-input v-model="dataForm.financial"
placeholder="请输入财务类别" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="修改时间" prop="lastmodifytime">
<el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生效状态" prop="effectiveStatus">
<el-select v-model="dataForm.effectiveStatus" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in effectiveStatusOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="处理类型" prop="processingType">
<el-select v-model="dataForm.processingType" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in processingTypeOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
<el-form-item label="类别名称"
prop="financialName" >
<el-input v-model="dataForm.financialName"
placeholder="请输入类别名称" clearable :style='{"width":"100%"}'>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="读取标记" prop="readTag">
<el-select v-model="dataForm.readTag" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in readTagOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
<el-form-item label="生效状态"
prop="effectiveStatus" >
<el-select v-model="dataForm.effectiveStatus"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in effectiveStatusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="读取时间" prop="readDate">
<el-date-picker v-model="dataForm.readDate" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="错误信息" prop="errorMessage">
<el-input v-model="dataForm.errorMessage" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
</template>
</el-form>
</el-row>
@ -173,12 +133,8 @@
</template>
<script>
import request from '@/utils/request'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default {
components: {},
props: [],
@ -189,109 +145,54 @@
isDetail: false,
dataForm: {
itemCode : '',
itemName : '',
description : '',
organizationCode: '',
primaryUomCode: '',
primaryUnitOmeasure: '',
primaryUnitOmeasure : "",
purchaseFlag : "",
salesFlag : "",
outArea : "",
inArea : "",
creatorusername: '',
creatortime: '',
lastmodifyusername: '',
lastmodifytime: '',
effectiveStatus: "",
processingType: "",
readTag: "",
readDate: '',
standardCost : '',
financial : '',
financialName : '',
effectiveStatus : "Y",
itemId : '',
errorMessage : '',
creatorTime : "",
lastModifyTime : "",
},
rules: {
itemCode: [{
rules:
{
itemCode: [
{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
description: [{
},
],
itemName: [
{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
purchaseFlagOptions: [{
"fullName": "是",
"id": "Y"
}, {
"fullName": "否",
"id": "N"
}],
salesFlagOptions: [{
"fullName": "是",
"id": "Y"
}, {
"fullName": "否",
"id": "N"
}],
outAreacolumnOptions: [{
"label": "库区编码",
"value": "areacode"
},
{
"label": "库区名称",
"value": "areaname"
},
{
"label": "仓库",
"value": "name"
},
{
"label": "最高库存",
"value": "maximum"
},],
inAreacolumnOptions: [{
"label": "库区编码",
"value": "areacode"
},
{
"label": "库区名称",
"value": "areaname"
},
{
"label": "仓库",
"value": "name"
],
standardCost: [
],
},
{
"label": "最高库存",
"value": "maximum"
},],
effectiveStatusOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
processingTypeOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
readTagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
primaryUnitOmeasureOptions:[{"fullName":"千克","id":"1"},{"fullName":"吨","id":"0"}],
purchaseFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
salesFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
outAreacolumnOptions:[ {"label":"库区编码","value":"areacode"}, {"label":"库区名称","value":"areaname"}, {"label":"仓库","value":"name"}, {"label":"最高库存","value":"maximum"},],
inAreacolumnOptions:[ {"label":"库区编码","value":"areacode"}, {"label":"库区名称","value":"areaname"}, {"label":"仓库","value":"name"}, {"label":"最高库存","value":"maximum"},],
effectiveStatusOptions:[{"fullName":"生效","id":"Y"},{"fullName":"不生效","id":"N"}],
}
},
computed: {},
watch: {},
created() {},
created() {
},
mounted() {},
methods: {
clearData(data){
@ -314,7 +215,7 @@
if(this.dataForm.id){
this.loading = true
request({
url: '/api/Material/Material/' + this.dataForm.id,
url: '/api/example/Material/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
@ -338,7 +239,7 @@
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/Material/Material',
url: '/api/example/Material',
method: 'post',
data: _data
}).then((res) => {
@ -354,7 +255,7 @@
})
}else{
request({
url: '/api/Material/Material/' + this.dataForm.id,
url: '/api/example/Material/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
@ -380,4 +281,5 @@
},
},
}
</script>

@ -11,7 +11,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="物料名称">
<el-input v-model="query.description" placeholder="请输入" clearable> </el-input>
<el-input v-model="query.itemName" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@ -40,55 +40,63 @@
<screenfull isContainer/>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
@selection-change="handleSelectionChange">
<el-table-column prop="itemCode" label="物料编码" width="0" align="left" />
<el-table-column prop="description" label="物料名称" width="0" align="left" />
<el-table-column prop="outArea" label="默认出库区" width="0" align="left" />
<el-table-column prop="inArea" label="默认入库区" width="0" align="left" />
<el-table-column prop="primaryUnitOmeasure" label="主单位名称" width="0" align="left" />
<el-table-column label="是否可采购" width="0" prop="purchaseFlag" algin="left">
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
<el-table-column prop="itemCode" label="物料编码" width="0" align="left"
/>
<el-table-column prop="itemName" label="物料名称" width="0" align="left"
/>
<el-table-column prop="description" label="物料说明" width="0" align="left"
/>
<el-table-column label="主单位名称" width="0" prop="primaryUnitOmeasure" algin="left"
>
<template slot-scope="scope">
{{ scope.row.purchaseFlag | dynamicText(purchaseFlagOptions) }}
</template>
</el-table-column>
<el-table-column label="是否可销售 " width="0" prop="salesFlag" algin="left">
<template slot-scope="scope">
{{ scope.row.salesFlag | dynamicText(salesFlagOptions) }}
{{ scope.row.primaryUnitOmeasure | dynamicText(primaryUnitOmeasureOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column label="生效状态" width="0" prop="effectiveStatus" algin="left">
<el-table-column label="是否可采购" width="0" prop="purchaseFlag" algin="left"
>
<template slot-scope="scope">
{{ scope.row.effectiveStatus | dynamicText(effectiveStatusOptions) }}
{{ scope.row.purchaseFlag | dynamicText(purchaseFlagOptions) }}
</template>
</el-table-column>
<el-table-column label="处理类型" width="0" prop="processingType" algin="left">
<el-table-column label="是否可销售 " width="0" prop="salesFlag" algin="left"
>
<template slot-scope="scope">
{{ scope.row.processingType | dynamicText(processingTypeOptions) }}
{{ scope.row.salesFlag | dynamicText(salesFlagOptions) }}
</template>
</el-table-column>
<el-table-column label="读取标记" width="0" prop="readTag" algin="left">
<el-table-column prop="outArea" label="默认出库区" width="0" align="left"
/>
<el-table-column prop="inArea" label="默认入库区" width="0" align="left"
/>
<el-table-column prop="standardCost" label="标准成本" width="0" align="left"
/>
<el-table-column prop="financial" label="财务类别" width="0" align="left"
/>
<el-table-column prop="financialName" label="类别名称" width="0" align="left"
/>
<el-table-column prop="itemId" label="ERP物料ID" width="0" align="left"
/>
<el-table-column prop="errorMessage" label="错误信息" width="0" align="left"
/>
<el-table-column label="生效状态" width="0" prop="effectiveStatus" algin="left"
>
<template slot-scope="scope">
{{ scope.row.readTag | dynamicText(readTagOptions) }}
{{ scope.row.effectiveStatus | dynamicText(effectiveStatusOptions) }}
</template>
</el-table-column>
<el-table-column prop="readDate" label="读取时间" width="0" align="left" />
<el-table-column prop="errorMessage" label="错误信息" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<el-table-column label="操作" fixed="right"
width="100" >
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">
<el-button type="text"
@click="addOrUpdateHandle(scope.row.id)" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
@pagination="initData" />
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
@ -99,28 +107,20 @@
<script>
import request from '@/utils/request'
import {
getDictionaryDataSelector
} from '@/api/systemData/dictionary'
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import JNPFForm from './Form'
import ExportBox from './ExportBox'
import {
getDataInterfaceRes
} from '@/api/systemData/dataInterface'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import Detail from './Detail'
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
components: {JNPFForm, ExportBox,Detail},
data() {
return {
detailVisible: false,
query: {
itemCode:undefined,
description: undefined,
itemName:undefined,
},
treeProps: {
children: 'children',
@ -129,136 +129,39 @@
},
list: [],
listLoading: true,
multipleSelection: [],
total: 0,
multipleSelection: [], total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
sidx: "creatorTime",
},
formVisible: false,
exportBoxVisible: false,
columnList: [{
prop: 'itemCode',
label: '物料编码'
},
{
prop: 'description',
label: '物料名称'
},
{
prop: 'outArea',
label: '默认出库区'
},
{
prop: 'inArea',
label: '默认入库区'
},
{
prop: 'primaryUnitOmeasure',
label: '主单位名称'
},
{
prop: 'purchaseFlag',
label: '是否可采购'
},
{
prop: 'salesFlag',
label: '是否可销售 '
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
{
prop: 'effectiveStatus',
label: '生效状态'
},
{
prop: 'processingType',
label: '处理类型'
},
{
prop: 'readTag',
label: '读取标记'
},
{
prop: 'readDate',
label: '读取时间'
},
{
prop: 'errorMessage',
label: '错误信息'
},
columnList: [
{prop: 'itemCode', label: '物料编码'},
{prop: 'itemName', label: '物料名称'},
{prop: 'description', label: '物料说明'},
{prop: 'primaryUnitOmeasure', label: '主单位名称'},
{prop: 'purchaseFlag', label: '是否可采购'},
{prop: 'salesFlag', label: '是否可销售 '},
{prop: 'outArea', label: '默认出库区'},
{prop: 'inArea', label: '默认入库区'},
{prop: 'standardCost', label: '标准成本'},
{prop: 'financial', label: '财务类别'},
{prop: 'financialName', label: '类别名称'},
{prop: 'itemId', label: 'ERP物料ID'},
{prop: 'errorMessage', label: '错误信息'},
{prop: 'effectiveStatus', label: '生效状态'},
],
purchaseFlagOptions: [{
"fullName": "是",
"id": "Y"
}, {
"fullName": "否",
"id": "N"
}],
purchaseFlagProps: {
"label": "fullName",
"value": "id"
},
salesFlagOptions: [{
"fullName": "是",
"id": "Y"
}, {
"fullName": "否",
"id": "N"
}],
salesFlagProps: {
"label": "fullName",
"value": "id"
},
effectiveStatusOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
effectiveStatusProps: {
"label": "fullName",
"value": "id"
},
processingTypeOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
processingTypeProps: {
"label": "fullName",
"value": "id"
},
readTagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
readTagProps: {
"label": "fullName",
"value": "id"
},
primaryUnitOmeasureOptions:[{"fullName":"千克","id":"1"},{"fullName":"吨","id":"0"}],
primaryUnitOmeasureProps:{"label":"fullName","value":"id"},
purchaseFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
purchaseFlagProps:{"label":"fullName","value":"id"},
salesFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
salesFlagProps:{"label":"fullName","value":"id"},
effectiveStatusOptions:[{"fullName":"生效","id":"Y"},{"fullName":"不生效","id":"N"}],
effectiveStatusProps:{"label":"fullName","value":"id"},
}
},
computed: {
@ -276,11 +179,7 @@
this.$refs.Detail.init(id)
})
},
sortChange({
column,
prop,
order
}) {
sortChange({column, prop, order}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
@ -293,7 +192,7 @@
menuId:this.menuId
};
request({
url: `/api/Material/Material/getList`,
url: `/api/example/Material/getList`,
method: 'post',
data: _query
}).then(res => {
@ -313,7 +212,7 @@
type: 'warning'
}).then(() => {
request({
url: `/api/Material/Material/${id}`,
url: `/api/example/Material/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
@ -324,7 +223,8 @@
}
});
})
}).catch(() => {});
}).catch(() => {
});
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
@ -344,7 +244,7 @@
type: 'warning'
}).then(() => {
request({
url: `/api/Material/Material/batchRemove/${ids}`,
url: `/api/example/Material/batchRemove/${ids}`,
method: 'DELETE'
}).then(res => {
this.$message({
@ -355,7 +255,8 @@
}
});
})
}).catch(() => {})
}).catch(() => {
})
},
addOrUpdateHandle(id, isDetail) {
this.formVisible = true
@ -370,14 +271,9 @@
})
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
}
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({
url: `/api/Material/Material/Actions/Export`,
url: `/api/example/Material/Actions/Export`,
method: 'GET',
data: query
}).then(res => {
@ -392,7 +288,7 @@
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
sidx: "creatorTime",
}
this.initData()
},

Loading…
Cancel
Save